ace.js 640 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703
  1. (function () {
  2. function o(n) {
  3. var i = e;
  4. n && (e[n] || (e[n] = {}), (i = e[n]));
  5. if (!i.define || !i.define.packaged)
  6. (t.original = i.define), (i.define = t), (i.define.packaged = !0);
  7. if (!i.require || !i.require.packaged)
  8. (r.original = i.require), (i.require = r), (i.require.packaged = !0);
  9. }
  10. var ACE_NAMESPACE = "",
  11. e = (function () {
  12. return this;
  13. })();
  14. !e && typeof window != "undefined" && (e = window);
  15. if (!ACE_NAMESPACE && typeof requirejs != "undefined") return;
  16. var t = function (e, n, r) {
  17. if (typeof e != "string") {
  18. t.original
  19. ? t.original.apply(this, arguments)
  20. : (console.error("dropping module because define wasn't a string."),
  21. console.trace());
  22. return;
  23. }
  24. arguments.length == 2 && (r = n),
  25. t.modules[e] || ((t.payloads[e] = r), (t.modules[e] = null));
  26. };
  27. (t.modules = {}), (t.payloads = {});
  28. var n = function (e, t, n) {
  29. if (typeof t == "string") {
  30. var i = s(e, t);
  31. if (i != undefined) return n && n(), i;
  32. } else if (Object.prototype.toString.call(t) === "[object Array]") {
  33. var o = [];
  34. for (var u = 0, a = t.length; u < a; ++u) {
  35. var f = s(e, t[u]);
  36. if (f == undefined && r.original) return;
  37. o.push(f);
  38. }
  39. return (n && n.apply(null, o)) || !0;
  40. }
  41. },
  42. r = function (e, t) {
  43. var i = n("", e, t);
  44. return i == undefined && r.original
  45. ? r.original.apply(this, arguments)
  46. : i;
  47. },
  48. i = function (e, t) {
  49. if (t.indexOf("!") !== -1) {
  50. var n = t.split("!");
  51. return i(e, n[0]) + "!" + i(e, n[1]);
  52. }
  53. if (t.charAt(0) == ".") {
  54. var r = e.split("/").slice(0, -1).join("/");
  55. t = r + "/" + t;
  56. while (t.indexOf(".") !== -1 && s != t) {
  57. var s = t;
  58. t = t.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
  59. }
  60. }
  61. return t;
  62. },
  63. s = function (e, r) {
  64. r = i(e, r);
  65. var s = t.modules[r];
  66. if (!s) {
  67. s = t.payloads[r];
  68. if (typeof s == "function") {
  69. var o = {},
  70. u = { id: r, uri: "", exports: o, packaged: !0 },
  71. a = function (e, t) {
  72. return n(r, e, t);
  73. },
  74. f = s(a, o, u);
  75. (o = f || u.exports), (t.modules[r] = o), delete t.payloads[r];
  76. }
  77. s = t.modules[r] = o || s;
  78. }
  79. return s;
  80. };
  81. o(ACE_NAMESPACE);
  82. })(),
  83. define(
  84. "ace/lib/regexp",
  85. ["require", "exports", "module"],
  86. function (e, t, n) {
  87. "use strict";
  88. function o(e) {
  89. return (
  90. (e.global ? "g" : "") +
  91. (e.ignoreCase ? "i" : "") +
  92. (e.multiline ? "m" : "") +
  93. (e.extended ? "x" : "") +
  94. (e.sticky ? "y" : "")
  95. );
  96. }
  97. function u(e, t, n) {
  98. if (Array.prototype.indexOf) return e.indexOf(t, n);
  99. for (var r = n || 0; r < e.length; r++) if (e[r] === t) return r;
  100. return -1;
  101. }
  102. var r = {
  103. exec: RegExp.prototype.exec,
  104. test: RegExp.prototype.test,
  105. match: String.prototype.match,
  106. replace: String.prototype.replace,
  107. split: String.prototype.split,
  108. },
  109. i = r.exec.call(/()??/, "")[1] === undefined,
  110. s = (function () {
  111. var e = /^/g;
  112. return r.test.call(e, ""), !e.lastIndex;
  113. })();
  114. if (s && i) return;
  115. (RegExp.prototype.exec = function (e) {
  116. var t = r.exec.apply(this, arguments),
  117. n,
  118. a;
  119. if (typeof e == "string" && t) {
  120. !i &&
  121. t.length > 1 &&
  122. u(t, "") > -1 &&
  123. ((a = RegExp(this.source, r.replace.call(o(this), "g", ""))),
  124. r.replace.call(e.slice(t.index), a, function () {
  125. for (var e = 1; e < arguments.length - 2; e++)
  126. arguments[e] === undefined && (t[e] = undefined);
  127. }));
  128. if (this._xregexp && this._xregexp.captureNames)
  129. for (var f = 1; f < t.length; f++)
  130. (n = this._xregexp.captureNames[f - 1]), n && (t[n] = t[f]);
  131. !s &&
  132. this.global &&
  133. !t[0].length &&
  134. this.lastIndex > t.index &&
  135. this.lastIndex--;
  136. }
  137. return t;
  138. }),
  139. s ||
  140. (RegExp.prototype.test = function (e) {
  141. var t = r.exec.call(this, e);
  142. return (
  143. t &&
  144. this.global &&
  145. !t[0].length &&
  146. this.lastIndex > t.index &&
  147. this.lastIndex--,
  148. !!t
  149. );
  150. });
  151. }
  152. ),
  153. define(
  154. "ace/lib/es5-shim",
  155. ["require", "exports", "module"],
  156. function (e, t, n) {
  157. function r() {}
  158. function w(e) {
  159. try {
  160. return Object.defineProperty(e, "sentinel", {}), "sentinel" in e;
  161. } catch (t) {}
  162. }
  163. function H(e) {
  164. return (
  165. (e = +e),
  166. e !== e
  167. ? (e = 0)
  168. : e !== 0 &&
  169. e !== 1 / 0 &&
  170. e !== -1 / 0 &&
  171. (e = (e > 0 || -1) * Math.floor(Math.abs(e))),
  172. e
  173. );
  174. }
  175. function B(e) {
  176. var t = typeof e;
  177. return (
  178. e === null ||
  179. t === "undefined" ||
  180. t === "boolean" ||
  181. t === "number" ||
  182. t === "string"
  183. );
  184. }
  185. function j(e) {
  186. var t, n, r;
  187. if (B(e)) return e;
  188. n = e.valueOf;
  189. if (typeof n == "function") {
  190. t = n.call(e);
  191. if (B(t)) return t;
  192. }
  193. r = e.toString;
  194. if (typeof r == "function") {
  195. t = r.call(e);
  196. if (B(t)) return t;
  197. }
  198. throw new TypeError();
  199. }
  200. Function.prototype.bind ||
  201. (Function.prototype.bind = function (t) {
  202. var n = this;
  203. if (typeof n != "function")
  204. throw new TypeError(
  205. "Function.prototype.bind called on incompatible " + n
  206. );
  207. var i = u.call(arguments, 1),
  208. s = function () {
  209. if (this instanceof s) {
  210. var e = n.apply(this, i.concat(u.call(arguments)));
  211. return Object(e) === e ? e : this;
  212. }
  213. return n.apply(t, i.concat(u.call(arguments)));
  214. };
  215. return (
  216. n.prototype &&
  217. ((r.prototype = n.prototype),
  218. (s.prototype = new r()),
  219. (r.prototype = null)),
  220. s
  221. );
  222. });
  223. var i = Function.prototype.call,
  224. s = Array.prototype,
  225. o = Object.prototype,
  226. u = s.slice,
  227. a = i.bind(o.toString),
  228. f = i.bind(o.hasOwnProperty),
  229. l,
  230. c,
  231. h,
  232. p,
  233. d;
  234. if ((d = f(o, "__defineGetter__")))
  235. (l = i.bind(o.__defineGetter__)),
  236. (c = i.bind(o.__defineSetter__)),
  237. (h = i.bind(o.__lookupGetter__)),
  238. (p = i.bind(o.__lookupSetter__));
  239. if ([1, 2].splice(0).length != 2)
  240. if (
  241. !(function () {
  242. function e(e) {
  243. var t = new Array(e + 2);
  244. return (t[0] = t[1] = 0), t;
  245. }
  246. var t = [],
  247. n;
  248. t.splice.apply(t, e(20)),
  249. t.splice.apply(t, e(26)),
  250. (n = t.length),
  251. t.splice(5, 0, "XXX"),
  252. n + 1 == t.length;
  253. if (n + 1 == t.length) return !0;
  254. })()
  255. )
  256. Array.prototype.splice = function (e, t) {
  257. var n = this.length;
  258. e > 0
  259. ? e > n && (e = n)
  260. : e == void 0
  261. ? (e = 0)
  262. : e < 0 && (e = Math.max(n + e, 0)),
  263. e + t < n || (t = n - e);
  264. var r = this.slice(e, e + t),
  265. i = u.call(arguments, 2),
  266. s = i.length;
  267. if (e === n) s && this.push.apply(this, i);
  268. else {
  269. var o = Math.min(t, n - e),
  270. a = e + o,
  271. f = a + s - o,
  272. l = n - a,
  273. c = n - o;
  274. if (f < a) for (var h = 0; h < l; ++h) this[f + h] = this[a + h];
  275. else if (f > a) for (h = l; h--; ) this[f + h] = this[a + h];
  276. if (s && e === c) (this.length = c), this.push.apply(this, i);
  277. else {
  278. this.length = c + s;
  279. for (h = 0; h < s; ++h) this[e + h] = i[h];
  280. }
  281. }
  282. return r;
  283. };
  284. else {
  285. var v = Array.prototype.splice;
  286. Array.prototype.splice = function (e, t) {
  287. return arguments.length
  288. ? v.apply(
  289. this,
  290. [
  291. e === void 0 ? 0 : e,
  292. t === void 0 ? this.length - e : t,
  293. ].concat(u.call(arguments, 2))
  294. )
  295. : [];
  296. };
  297. }
  298. Array.isArray ||
  299. (Array.isArray = function (t) {
  300. return a(t) == "[object Array]";
  301. });
  302. var m = Object("a"),
  303. g = m[0] != "a" || !(0 in m);
  304. Array.prototype.forEach ||
  305. (Array.prototype.forEach = function (t) {
  306. var n = F(this),
  307. r = g && a(this) == "[object String]" ? this.split("") : n,
  308. i = arguments[1],
  309. s = -1,
  310. o = r.length >>> 0;
  311. if (a(t) != "[object Function]") throw new TypeError();
  312. while (++s < o) s in r && t.call(i, r[s], s, n);
  313. }),
  314. Array.prototype.map ||
  315. (Array.prototype.map = function (t) {
  316. var n = F(this),
  317. r = g && a(this) == "[object String]" ? this.split("") : n,
  318. i = r.length >>> 0,
  319. s = Array(i),
  320. o = arguments[1];
  321. if (a(t) != "[object Function]")
  322. throw new TypeError(t + " is not a function");
  323. for (var u = 0; u < i; u++)
  324. u in r && (s[u] = t.call(o, r[u], u, n));
  325. return s;
  326. }),
  327. Array.prototype.filter ||
  328. (Array.prototype.filter = function (t) {
  329. var n = F(this),
  330. r = g && a(this) == "[object String]" ? this.split("") : n,
  331. i = r.length >>> 0,
  332. s = [],
  333. o,
  334. u = arguments[1];
  335. if (a(t) != "[object Function]")
  336. throw new TypeError(t + " is not a function");
  337. for (var f = 0; f < i; f++)
  338. f in r && ((o = r[f]), t.call(u, o, f, n) && s.push(o));
  339. return s;
  340. }),
  341. Array.prototype.every ||
  342. (Array.prototype.every = function (t) {
  343. var n = F(this),
  344. r = g && a(this) == "[object String]" ? this.split("") : n,
  345. i = r.length >>> 0,
  346. s = arguments[1];
  347. if (a(t) != "[object Function]")
  348. throw new TypeError(t + " is not a function");
  349. for (var o = 0; o < i; o++)
  350. if (o in r && !t.call(s, r[o], o, n)) return !1;
  351. return !0;
  352. }),
  353. Array.prototype.some ||
  354. (Array.prototype.some = function (t) {
  355. var n = F(this),
  356. r = g && a(this) == "[object String]" ? this.split("") : n,
  357. i = r.length >>> 0,
  358. s = arguments[1];
  359. if (a(t) != "[object Function]")
  360. throw new TypeError(t + " is not a function");
  361. for (var o = 0; o < i; o++)
  362. if (o in r && t.call(s, r[o], o, n)) return !0;
  363. return !1;
  364. }),
  365. Array.prototype.reduce ||
  366. (Array.prototype.reduce = function (t) {
  367. var n = F(this),
  368. r = g && a(this) == "[object String]" ? this.split("") : n,
  369. i = r.length >>> 0;
  370. if (a(t) != "[object Function]")
  371. throw new TypeError(t + " is not a function");
  372. if (!i && arguments.length == 1)
  373. throw new TypeError(
  374. "reduce of empty array with no initial value"
  375. );
  376. var s = 0,
  377. o;
  378. if (arguments.length >= 2) o = arguments[1];
  379. else
  380. do {
  381. if (s in r) {
  382. o = r[s++];
  383. break;
  384. }
  385. if (++s >= i)
  386. throw new TypeError(
  387. "reduce of empty array with no initial value"
  388. );
  389. } while (!0);
  390. for (; s < i; s++) s in r && (o = t.call(void 0, o, r[s], s, n));
  391. return o;
  392. }),
  393. Array.prototype.reduceRight ||
  394. (Array.prototype.reduceRight = function (t) {
  395. var n = F(this),
  396. r = g && a(this) == "[object String]" ? this.split("") : n,
  397. i = r.length >>> 0;
  398. if (a(t) != "[object Function]")
  399. throw new TypeError(t + " is not a function");
  400. if (!i && arguments.length == 1)
  401. throw new TypeError(
  402. "reduceRight of empty array with no initial value"
  403. );
  404. var s,
  405. o = i - 1;
  406. if (arguments.length >= 2) s = arguments[1];
  407. else
  408. do {
  409. if (o in r) {
  410. s = r[o--];
  411. break;
  412. }
  413. if (--o < 0)
  414. throw new TypeError(
  415. "reduceRight of empty array with no initial value"
  416. );
  417. } while (!0);
  418. do o in this && (s = t.call(void 0, s, r[o], o, n));
  419. while (o--);
  420. return s;
  421. });
  422. if (!Array.prototype.indexOf || [0, 1].indexOf(1, 2) != -1)
  423. Array.prototype.indexOf = function (t) {
  424. var n = g && a(this) == "[object String]" ? this.split("") : F(this),
  425. r = n.length >>> 0;
  426. if (!r) return -1;
  427. var i = 0;
  428. arguments.length > 1 && (i = H(arguments[1])),
  429. (i = i >= 0 ? i : Math.max(0, r + i));
  430. for (; i < r; i++) if (i in n && n[i] === t) return i;
  431. return -1;
  432. };
  433. if (!Array.prototype.lastIndexOf || [0, 1].lastIndexOf(0, -3) != -1)
  434. Array.prototype.lastIndexOf = function (t) {
  435. var n = g && a(this) == "[object String]" ? this.split("") : F(this),
  436. r = n.length >>> 0;
  437. if (!r) return -1;
  438. var i = r - 1;
  439. arguments.length > 1 && (i = Math.min(i, H(arguments[1]))),
  440. (i = i >= 0 ? i : r - Math.abs(i));
  441. for (; i >= 0; i--) if (i in n && t === n[i]) return i;
  442. return -1;
  443. };
  444. Object.getPrototypeOf ||
  445. (Object.getPrototypeOf = function (t) {
  446. return t.__proto__ || (t.constructor ? t.constructor.prototype : o);
  447. });
  448. if (!Object.getOwnPropertyDescriptor) {
  449. var y = "Object.getOwnPropertyDescriptor called on a non-object: ";
  450. Object.getOwnPropertyDescriptor = function (t, n) {
  451. if ((typeof t != "object" && typeof t != "function") || t === null)
  452. throw new TypeError(y + t);
  453. if (!f(t, n)) return;
  454. var r, i, s;
  455. r = { enumerable: !0, configurable: !0 };
  456. if (d) {
  457. var u = t.__proto__;
  458. t.__proto__ = o;
  459. var i = h(t, n),
  460. s = p(t, n);
  461. t.__proto__ = u;
  462. if (i || s) return i && (r.get = i), s && (r.set = s), r;
  463. }
  464. return (r.value = t[n]), r;
  465. };
  466. }
  467. Object.getOwnPropertyNames ||
  468. (Object.getOwnPropertyNames = function (t) {
  469. return Object.keys(t);
  470. });
  471. if (!Object.create) {
  472. var b;
  473. Object.prototype.__proto__ === null
  474. ? (b = function () {
  475. return { __proto__: null };
  476. })
  477. : (b = function () {
  478. var e = {};
  479. for (var t in e) e[t] = null;
  480. return (
  481. (e.constructor =
  482. e.hasOwnProperty =
  483. e.propertyIsEnumerable =
  484. e.isPrototypeOf =
  485. e.toLocaleString =
  486. e.toString =
  487. e.valueOf =
  488. e.__proto__ =
  489. null),
  490. e
  491. );
  492. }),
  493. (Object.create = function (t, n) {
  494. var r;
  495. if (t === null) r = b();
  496. else {
  497. if (typeof t != "object")
  498. throw new TypeError(
  499. "typeof prototype[" + typeof t + "] != 'object'"
  500. );
  501. var i = function () {};
  502. (i.prototype = t), (r = new i()), (r.__proto__ = t);
  503. }
  504. return n !== void 0 && Object.defineProperties(r, n), r;
  505. });
  506. }
  507. if (Object.defineProperty) {
  508. var E = w({}),
  509. S =
  510. typeof document == "undefined" || w(document.createElement("div"));
  511. if (!E || !S) var x = Object.defineProperty;
  512. }
  513. if (!Object.defineProperty || x) {
  514. var T = "Property description must be an object: ",
  515. N = "Object.defineProperty called on non-object: ",
  516. C = "getters & setters can not be defined on this javascript engine";
  517. Object.defineProperty = function (t, n, r) {
  518. if ((typeof t != "object" && typeof t != "function") || t === null)
  519. throw new TypeError(N + t);
  520. if ((typeof r != "object" && typeof r != "function") || r === null)
  521. throw new TypeError(T + r);
  522. if (x)
  523. try {
  524. return x.call(Object, t, n, r);
  525. } catch (i) {}
  526. if (f(r, "value"))
  527. if (d && (h(t, n) || p(t, n))) {
  528. var s = t.__proto__;
  529. (t.__proto__ = o),
  530. delete t[n],
  531. (t[n] = r.value),
  532. (t.__proto__ = s);
  533. } else t[n] = r.value;
  534. else {
  535. if (!d) throw new TypeError(C);
  536. f(r, "get") && l(t, n, r.get), f(r, "set") && c(t, n, r.set);
  537. }
  538. return t;
  539. };
  540. }
  541. Object.defineProperties ||
  542. (Object.defineProperties = function (t, n) {
  543. for (var r in n) f(n, r) && Object.defineProperty(t, r, n[r]);
  544. return t;
  545. }),
  546. Object.seal ||
  547. (Object.seal = function (t) {
  548. return t;
  549. }),
  550. Object.freeze ||
  551. (Object.freeze = function (t) {
  552. return t;
  553. });
  554. try {
  555. Object.freeze(function () {});
  556. } catch (k) {
  557. Object.freeze = (function (t) {
  558. return function (n) {
  559. return typeof n == "function" ? n : t(n);
  560. };
  561. })(Object.freeze);
  562. }
  563. Object.preventExtensions ||
  564. (Object.preventExtensions = function (t) {
  565. return t;
  566. }),
  567. Object.isSealed ||
  568. (Object.isSealed = function (t) {
  569. return !1;
  570. }),
  571. Object.isFrozen ||
  572. (Object.isFrozen = function (t) {
  573. return !1;
  574. }),
  575. Object.isExtensible ||
  576. (Object.isExtensible = function (t) {
  577. if (Object(t) === t) throw new TypeError();
  578. var n = "";
  579. while (f(t, n)) n += "?";
  580. t[n] = !0;
  581. var r = f(t, n);
  582. return delete t[n], r;
  583. });
  584. if (!Object.keys) {
  585. var L = !0,
  586. A = [
  587. "toString",
  588. "toLocaleString",
  589. "valueOf",
  590. "hasOwnProperty",
  591. "isPrototypeOf",
  592. "propertyIsEnumerable",
  593. "constructor",
  594. ],
  595. O = A.length;
  596. for (var M in { toString: null }) L = !1;
  597. Object.keys = function I(e) {
  598. if ((typeof e != "object" && typeof e != "function") || e === null)
  599. throw new TypeError("Object.keys called on a non-object");
  600. var I = [];
  601. for (var t in e) f(e, t) && I.push(t);
  602. if (L)
  603. for (var n = 0, r = O; n < r; n++) {
  604. var i = A[n];
  605. f(e, i) && I.push(i);
  606. }
  607. return I;
  608. };
  609. }
  610. Date.now ||
  611. (Date.now = function () {
  612. return new Date().getTime();
  613. });
  614. var _ =
  615. " \n\x0b\f\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff";
  616. if (!String.prototype.trim || _.trim()) {
  617. _ = "[" + _ + "]";
  618. var D = new RegExp("^" + _ + _ + "*"),
  619. P = new RegExp(_ + _ + "*$");
  620. String.prototype.trim = function () {
  621. return String(this).replace(D, "").replace(P, "");
  622. };
  623. }
  624. var F = function (e) {
  625. if (e == null) throw new TypeError("can't convert " + e + " to object");
  626. return Object(e);
  627. };
  628. }
  629. ),
  630. define(
  631. "ace/lib/fixoldbrowsers",
  632. ["require", "exports", "module", "ace/lib/regexp", "ace/lib/es5-shim"],
  633. function (e, t, n) {
  634. "use strict";
  635. e("./regexp"),
  636. e("./es5-shim"),
  637. typeof Element != "undefined" &&
  638. !Element.prototype.remove &&
  639. Object.defineProperty(Element.prototype, "remove", {
  640. enumerable: !1,
  641. writable: !0,
  642. configurable: !0,
  643. value: function () {
  644. this.parentNode && this.parentNode.removeChild(this);
  645. },
  646. });
  647. }
  648. ),
  649. define(
  650. "ace/lib/useragent",
  651. ["require", "exports", "module"],
  652. function (e, t, n) {
  653. "use strict";
  654. (t.OS = { LINUX: "LINUX", MAC: "MAC", WINDOWS: "WINDOWS" }),
  655. (t.getOS = function () {
  656. return t.isMac ? t.OS.MAC : t.isLinux ? t.OS.LINUX : t.OS.WINDOWS;
  657. });
  658. if (typeof navigator != "object") return;
  659. var r = (navigator.platform.match(/mac|win|linux/i) || [
  660. "other",
  661. ])[0].toLowerCase(),
  662. i = navigator.userAgent;
  663. (t.isWin = r == "win"),
  664. (t.isMac = r == "mac"),
  665. (t.isLinux = r == "linux"),
  666. (t.isIE =
  667. navigator.appName == "Microsoft Internet Explorer" ||
  668. navigator.appName.indexOf("MSAppHost") >= 0
  669. ? parseFloat(
  670. (i.match(
  671. /(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/
  672. ) || [])[1]
  673. )
  674. : parseFloat(
  675. (i.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) ||
  676. [])[1]
  677. )),
  678. (t.isOldIE = t.isIE && t.isIE < 9),
  679. (t.isGecko = t.isMozilla = i.match(/ Gecko\/\d+/)),
  680. (t.isOpera =
  681. window.opera &&
  682. Object.prototype.toString.call(window.opera) == "[object Opera]"),
  683. (t.isWebKit = parseFloat(i.split("WebKit/")[1]) || undefined),
  684. (t.isChrome = parseFloat(i.split(" Chrome/")[1]) || undefined),
  685. (t.isEdge = parseFloat(i.split(" Edge/")[1]) || undefined),
  686. (t.isAIR = i.indexOf("AdobeAIR") >= 0),
  687. (t.isIPad = i.indexOf("iPad") >= 0),
  688. (t.isAndroid = i.indexOf("Android") >= 0),
  689. (t.isChromeOS = i.indexOf(" CrOS ") >= 0),
  690. (t.isIOS = /iPad|iPhone|iPod/.test(i) && !window.MSStream),
  691. t.isIOS && (t.isMac = !0),
  692. (t.isMobile = t.isIPad || t.isAndroid);
  693. }
  694. ),
  695. define(
  696. "ace/lib/dom",
  697. ["require", "exports", "module", "ace/lib/useragent"],
  698. function (e, t, n) {
  699. "use strict";
  700. var r = e("./useragent"),
  701. i = "http://www.w3.org/1999/xhtml";
  702. (t.buildDom = function o(e, t, n) {
  703. if (typeof e == "string" && e) {
  704. var r = document.createTextNode(e);
  705. return t && t.appendChild(r), r;
  706. }
  707. if (!Array.isArray(e)) return e;
  708. if (typeof e[0] != "string" || !e[0]) {
  709. var i = [];
  710. for (var s = 0; s < e.length; s++) {
  711. var u = o(e[s], t, n);
  712. u && i.push(u);
  713. }
  714. return i;
  715. }
  716. var a = document.createElement(e[0]),
  717. f = e[1],
  718. l = 1;
  719. f && typeof f == "object" && !Array.isArray(f) && (l = 2);
  720. for (var s = l; s < e.length; s++) o(e[s], a, n);
  721. return (
  722. l == 2 &&
  723. Object.keys(f).forEach(function (e) {
  724. var t = f[e];
  725. e === "class"
  726. ? (a.className = Array.isArray(t) ? t.join(" ") : t)
  727. : typeof t == "function" || e == "value"
  728. ? (a[e] = t)
  729. : e === "ref"
  730. ? n && (n[t] = a)
  731. : t != null && a.setAttribute(e, t);
  732. }),
  733. t && t.appendChild(a),
  734. a
  735. );
  736. }),
  737. (t.getDocumentHead = function (e) {
  738. return (
  739. e || (e = document),
  740. e.head || e.getElementsByTagName("head")[0] || e.documentElement
  741. );
  742. }),
  743. (t.createElement = function (e, t) {
  744. return document.createElementNS
  745. ? document.createElementNS(t || i, e)
  746. : document.createElement(e);
  747. }),
  748. (t.removeChildren = function (e) {
  749. e.innerHTML = "";
  750. }),
  751. (t.createTextNode = function (e, t) {
  752. var n = t ? t.ownerDocument : document;
  753. return n.createTextNode(e);
  754. }),
  755. (t.createFragment = function (e) {
  756. var t = e ? e.ownerDocument : document;
  757. return t.createDocumentFragment();
  758. }),
  759. (t.hasCssClass = function (e, t) {
  760. var n = (e.className + "").split(/\s+/g);
  761. return n.indexOf(t) !== -1;
  762. }),
  763. (t.addCssClass = function (e, n) {
  764. t.hasCssClass(e, n) || (e.className += " " + n);
  765. }),
  766. (t.removeCssClass = function (e, t) {
  767. var n = e.className.split(/\s+/g);
  768. for (;;) {
  769. var r = n.indexOf(t);
  770. if (r == -1) break;
  771. n.splice(r, 1);
  772. }
  773. e.className = n.join(" ");
  774. }),
  775. (t.toggleCssClass = function (e, t) {
  776. var n = e.className.split(/\s+/g),
  777. r = !0;
  778. for (;;) {
  779. var i = n.indexOf(t);
  780. if (i == -1) break;
  781. (r = !1), n.splice(i, 1);
  782. }
  783. return r && n.push(t), (e.className = n.join(" ")), r;
  784. }),
  785. (t.setCssClass = function (e, n, r) {
  786. r ? t.addCssClass(e, n) : t.removeCssClass(e, n);
  787. }),
  788. (t.hasCssString = function (e, t) {
  789. var n = 0,
  790. r;
  791. t = t || document;
  792. if ((r = t.querySelectorAll("style")))
  793. while (n < r.length) if (r[n++].id === e) return !0;
  794. }),
  795. (t.importCssString = function (n, r, i) {
  796. var s = i;
  797. if (!i || !i.getRootNode) s = document;
  798. else {
  799. s = i.getRootNode();
  800. if (!s || s == i) s = document;
  801. }
  802. var o = s.ownerDocument || s;
  803. if (r && t.hasCssString(r, s)) return null;
  804. r && (n += "\n/*# sourceURL=ace/css/" + r + " */");
  805. var u = t.createElement("style");
  806. u.appendChild(o.createTextNode(n)),
  807. r && (u.id = r),
  808. s == o && (s = t.getDocumentHead(o)),
  809. s.insertBefore(u, s.firstChild);
  810. }),
  811. (t.importCssStylsheet = function (e, n) {
  812. t.buildDom(
  813. ["link", { rel: "stylesheet", href: e }],
  814. t.getDocumentHead(n)
  815. );
  816. }),
  817. (t.scrollbarWidth = function (e) {
  818. var n = t.createElement("ace_inner");
  819. (n.style.width = "100%"),
  820. (n.style.minWidth = "0px"),
  821. (n.style.height = "200px"),
  822. (n.style.display = "block");
  823. var r = t.createElement("ace_outer"),
  824. i = r.style;
  825. (i.position = "absolute"),
  826. (i.left = "-10000px"),
  827. (i.overflow = "hidden"),
  828. (i.width = "200px"),
  829. (i.minWidth = "0px"),
  830. (i.height = "150px"),
  831. (i.display = "block"),
  832. r.appendChild(n);
  833. var s = e.documentElement;
  834. s.appendChild(r);
  835. var o = n.offsetWidth;
  836. i.overflow = "scroll";
  837. var u = n.offsetWidth;
  838. return o == u && (u = r.clientWidth), s.removeChild(r), o - u;
  839. }),
  840. typeof document == "undefined" && (t.importCssString = function () {}),
  841. (t.computedStyle = function (e, t) {
  842. return window.getComputedStyle(e, "") || {};
  843. }),
  844. (t.setStyle = function (e, t, n) {
  845. e[t] !== n && (e[t] = n);
  846. }),
  847. (t.HAS_CSS_ANIMATION = !1),
  848. (t.HAS_CSS_TRANSFORMS = !1),
  849. (t.HI_DPI = r.isWin
  850. ? typeof window != "undefined" && window.devicePixelRatio >= 1.5
  851. : !0);
  852. if (typeof document != "undefined") {
  853. var s = document.createElement("div");
  854. t.HI_DPI &&
  855. s.style.transform !== undefined &&
  856. (t.HAS_CSS_TRANSFORMS = !0),
  857. !r.isEdge &&
  858. typeof s.style.animationName != "undefined" &&
  859. (t.HAS_CSS_ANIMATION = !0),
  860. (s = null);
  861. }
  862. t.HAS_CSS_TRANSFORMS
  863. ? (t.translate = function (e, t, n) {
  864. e.style.transform =
  865. "translate(" + Math.round(t) + "px, " + Math.round(n) + "px)";
  866. })
  867. : (t.translate = function (e, t, n) {
  868. (e.style.top = Math.round(n) + "px"),
  869. (e.style.left = Math.round(t) + "px");
  870. });
  871. }
  872. ),
  873. define("ace/lib/oop", ["require", "exports", "module"], function (e, t, n) {
  874. "use strict";
  875. (t.inherits = function (e, t) {
  876. (e.super_ = t),
  877. (e.prototype = Object.create(t.prototype, {
  878. constructor: {
  879. value: e,
  880. enumerable: !1,
  881. writable: !0,
  882. configurable: !0,
  883. },
  884. }));
  885. }),
  886. (t.mixin = function (e, t) {
  887. for (var n in t) e[n] = t[n];
  888. return e;
  889. }),
  890. (t.implement = function (e, n) {
  891. t.mixin(e, n);
  892. });
  893. }),
  894. define(
  895. "ace/lib/keys",
  896. ["require", "exports", "module", "ace/lib/oop"],
  897. function (e, t, n) {
  898. "use strict";
  899. var r = e("./oop"),
  900. i = (function () {
  901. var e = {
  902. MODIFIER_KEYS: {
  903. 16: "Shift",
  904. 17: "Ctrl",
  905. 18: "Alt",
  906. 224: "Meta",
  907. },
  908. KEY_MODS: {
  909. ctrl: 1,
  910. alt: 2,
  911. option: 2,
  912. shift: 4,
  913. super: 8,
  914. meta: 8,
  915. command: 8,
  916. cmd: 8,
  917. },
  918. FUNCTION_KEYS: {
  919. 8: "Backspace",
  920. 9: "Tab",
  921. 13: "Return",
  922. 19: "Pause",
  923. 27: "Esc",
  924. 32: "Space",
  925. 33: "PageUp",
  926. 34: "PageDown",
  927. 35: "End",
  928. 36: "Home",
  929. 37: "Left",
  930. 38: "Up",
  931. 39: "Right",
  932. 40: "Down",
  933. 44: "Print",
  934. 45: "Insert",
  935. 46: "Delete",
  936. 96: "Numpad0",
  937. 97: "Numpad1",
  938. 98: "Numpad2",
  939. 99: "Numpad3",
  940. 100: "Numpad4",
  941. 101: "Numpad5",
  942. 102: "Numpad6",
  943. 103: "Numpad7",
  944. 104: "Numpad8",
  945. 105: "Numpad9",
  946. "-13": "NumpadEnter",
  947. 112: "F1",
  948. 113: "F2",
  949. 114: "F3",
  950. 115: "F4",
  951. 116: "F5",
  952. 117: "F6",
  953. 118: "F7",
  954. 119: "F8",
  955. 120: "F9",
  956. 121: "F10",
  957. 122: "F11",
  958. 123: "F12",
  959. 144: "Numlock",
  960. 145: "Scrolllock",
  961. },
  962. PRINTABLE_KEYS: {
  963. 32: " ",
  964. 48: "0",
  965. 49: "1",
  966. 50: "2",
  967. 51: "3",
  968. 52: "4",
  969. 53: "5",
  970. 54: "6",
  971. 55: "7",
  972. 56: "8",
  973. 57: "9",
  974. 59: ";",
  975. 61: "=",
  976. 65: "a",
  977. 66: "b",
  978. 67: "c",
  979. 68: "d",
  980. 69: "e",
  981. 70: "f",
  982. 71: "g",
  983. 72: "h",
  984. 73: "i",
  985. 74: "j",
  986. 75: "k",
  987. 76: "l",
  988. 77: "m",
  989. 78: "n",
  990. 79: "o",
  991. 80: "p",
  992. 81: "q",
  993. 82: "r",
  994. 83: "s",
  995. 84: "t",
  996. 85: "u",
  997. 86: "v",
  998. 87: "w",
  999. 88: "x",
  1000. 89: "y",
  1001. 90: "z",
  1002. 107: "+",
  1003. 109: "-",
  1004. 110: ".",
  1005. 186: ";",
  1006. 187: "=",
  1007. 188: ",",
  1008. 189: "-",
  1009. 190: ".",
  1010. 191: "/",
  1011. 192: "`",
  1012. 219: "[",
  1013. 220: "\\",
  1014. 221: "]",
  1015. 222: "'",
  1016. 111: "/",
  1017. 106: "*",
  1018. },
  1019. },
  1020. t,
  1021. n;
  1022. for (n in e.FUNCTION_KEYS)
  1023. (t = e.FUNCTION_KEYS[n].toLowerCase()), (e[t] = parseInt(n, 10));
  1024. for (n in e.PRINTABLE_KEYS)
  1025. (t = e.PRINTABLE_KEYS[n].toLowerCase()), (e[t] = parseInt(n, 10));
  1026. return (
  1027. r.mixin(e, e.MODIFIER_KEYS),
  1028. r.mixin(e, e.PRINTABLE_KEYS),
  1029. r.mixin(e, e.FUNCTION_KEYS),
  1030. (e.enter = e["return"]),
  1031. (e.escape = e.esc),
  1032. (e.del = e["delete"]),
  1033. (e[173] = "-"),
  1034. (function () {
  1035. var t = ["cmd", "ctrl", "alt", "shift"];
  1036. for (var n = Math.pow(2, t.length); n--; )
  1037. e.KEY_MODS[n] =
  1038. t
  1039. .filter(function (t) {
  1040. return n & e.KEY_MODS[t];
  1041. })
  1042. .join("-") + "-";
  1043. })(),
  1044. (e.KEY_MODS[0] = ""),
  1045. (e.KEY_MODS[-1] = "input-"),
  1046. e
  1047. );
  1048. })();
  1049. r.mixin(t, i),
  1050. (t.keyCodeToString = function (e) {
  1051. var t = i[e];
  1052. return (
  1053. typeof t != "string" && (t = String.fromCharCode(e)),
  1054. t.toLowerCase()
  1055. );
  1056. });
  1057. }
  1058. ),
  1059. define(
  1060. "ace/lib/event",
  1061. ["require", "exports", "module", "ace/lib/keys", "ace/lib/useragent"],
  1062. function (e, t, n) {
  1063. "use strict";
  1064. function a(e, t, n) {
  1065. var a = u(t);
  1066. if (!i.isMac && s) {
  1067. t.getModifierState &&
  1068. (t.getModifierState("OS") || t.getModifierState("Win")) &&
  1069. (a |= 8);
  1070. if (s.altGr) {
  1071. if ((3 & a) == 3) return;
  1072. s.altGr = 0;
  1073. }
  1074. if (n === 18 || n === 17) {
  1075. var f = "location" in t ? t.location : t.keyLocation;
  1076. if (n === 17 && f === 1) s[n] == 1 && (o = t.timeStamp);
  1077. else if (n === 18 && a === 3 && f === 2) {
  1078. var l = t.timeStamp - o;
  1079. l < 50 && (s.altGr = !0);
  1080. }
  1081. }
  1082. }
  1083. n in r.MODIFIER_KEYS && (n = -1),
  1084. a & 8 && n >= 91 && n <= 93 && (n = -1);
  1085. if (!a && n === 13) {
  1086. var f = "location" in t ? t.location : t.keyLocation;
  1087. if (f === 3) {
  1088. e(t, a, -n);
  1089. if (t.defaultPrevented) return;
  1090. }
  1091. }
  1092. if (i.isChromeOS && a & 8) {
  1093. e(t, a, n);
  1094. if (t.defaultPrevented) return;
  1095. a &= -9;
  1096. }
  1097. return !!a || n in r.FUNCTION_KEYS || n in r.PRINTABLE_KEYS
  1098. ? e(t, a, n)
  1099. : !1;
  1100. }
  1101. function f() {
  1102. s = Object.create(null);
  1103. }
  1104. var r = e("./keys"),
  1105. i = e("./useragent"),
  1106. s = null,
  1107. o = 0;
  1108. (t.addListener = function (e, t, n) {
  1109. if (e.addEventListener) return e.addEventListener(t, n, !1);
  1110. if (e.attachEvent) {
  1111. var r = function () {
  1112. n.call(e, window.event);
  1113. };
  1114. (n._wrapper = r), e.attachEvent("on" + t, r);
  1115. }
  1116. }),
  1117. (t.removeListener = function (e, t, n) {
  1118. if (e.removeEventListener) return e.removeEventListener(t, n, !1);
  1119. e.detachEvent && e.detachEvent("on" + t, n._wrapper || n);
  1120. }),
  1121. (t.stopEvent = function (e) {
  1122. return t.stopPropagation(e), t.preventDefault(e), !1;
  1123. }),
  1124. (t.stopPropagation = function (e) {
  1125. e.stopPropagation ? e.stopPropagation() : (e.cancelBubble = !0);
  1126. }),
  1127. (t.preventDefault = function (e) {
  1128. e.preventDefault ? e.preventDefault() : (e.returnValue = !1);
  1129. }),
  1130. (t.getButton = function (e) {
  1131. return e.type == "dblclick"
  1132. ? 0
  1133. : e.type == "contextmenu" ||
  1134. (i.isMac && e.ctrlKey && !e.altKey && !e.shiftKey)
  1135. ? 2
  1136. : e.preventDefault
  1137. ? e.button
  1138. : { 1: 0, 2: 2, 4: 1 }[e.button];
  1139. }),
  1140. (t.capture = function (e, n, r) {
  1141. function i(e) {
  1142. n && n(e),
  1143. r && r(e),
  1144. t.removeListener(document, "mousemove", n, !0),
  1145. t.removeListener(document, "mouseup", i, !0),
  1146. t.removeListener(document, "dragstart", i, !0);
  1147. }
  1148. return (
  1149. t.addListener(document, "mousemove", n, !0),
  1150. t.addListener(document, "mouseup", i, !0),
  1151. t.addListener(document, "dragstart", i, !0),
  1152. i
  1153. );
  1154. }),
  1155. (t.addTouchMoveListener = function (e, n) {
  1156. var r, i;
  1157. t.addListener(e, "touchstart", function (e) {
  1158. var t = e.touches,
  1159. n = t[0];
  1160. (r = n.clientX), (i = n.clientY);
  1161. }),
  1162. t.addListener(e, "touchmove", function (e) {
  1163. var t = e.touches;
  1164. if (t.length > 1) return;
  1165. var s = t[0];
  1166. (e.wheelX = r - s.clientX),
  1167. (e.wheelY = i - s.clientY),
  1168. (r = s.clientX),
  1169. (i = s.clientY),
  1170. n(e);
  1171. });
  1172. }),
  1173. (t.addMouseWheelListener = function (e, n) {
  1174. "onmousewheel" in e
  1175. ? t.addListener(e, "mousewheel", function (e) {
  1176. var t = 8;
  1177. e.wheelDeltaX !== undefined
  1178. ? ((e.wheelX = -e.wheelDeltaX / t),
  1179. (e.wheelY = -e.wheelDeltaY / t))
  1180. : ((e.wheelX = 0), (e.wheelY = -e.wheelDelta / t)),
  1181. n(e);
  1182. })
  1183. : "onwheel" in e
  1184. ? t.addListener(e, "wheel", function (e) {
  1185. var t = 0.35;
  1186. switch (e.deltaMode) {
  1187. case e.DOM_DELTA_PIXEL:
  1188. (e.wheelX = e.deltaX * t || 0),
  1189. (e.wheelY = e.deltaY * t || 0);
  1190. break;
  1191. case e.DOM_DELTA_LINE:
  1192. case e.DOM_DELTA_PAGE:
  1193. (e.wheelX = (e.deltaX || 0) * 5),
  1194. (e.wheelY = (e.deltaY || 0) * 5);
  1195. }
  1196. n(e);
  1197. })
  1198. : t.addListener(e, "DOMMouseScroll", function (e) {
  1199. e.axis && e.axis == e.HORIZONTAL_AXIS
  1200. ? ((e.wheelX = (e.detail || 0) * 5), (e.wheelY = 0))
  1201. : ((e.wheelX = 0), (e.wheelY = (e.detail || 0) * 5)),
  1202. n(e);
  1203. });
  1204. }),
  1205. (t.addMultiMouseDownListener = function (e, n, r, s) {
  1206. function c(e) {
  1207. t.getButton(e) !== 0
  1208. ? (o = 0)
  1209. : e.detail > 1
  1210. ? (o++, o > 4 && (o = 1))
  1211. : (o = 1);
  1212. if (i.isIE) {
  1213. var c =
  1214. Math.abs(e.clientX - u) > 5 || Math.abs(e.clientY - a) > 5;
  1215. if (!f || c) o = 1;
  1216. f && clearTimeout(f),
  1217. (f = setTimeout(function () {
  1218. f = null;
  1219. }, n[o - 1] || 600)),
  1220. o == 1 && ((u = e.clientX), (a = e.clientY));
  1221. }
  1222. (e._clicks = o), r[s]("mousedown", e);
  1223. if (o > 4) o = 0;
  1224. else if (o > 1) return r[s](l[o], e);
  1225. }
  1226. function h(e) {
  1227. (o = 2),
  1228. f && clearTimeout(f),
  1229. (f = setTimeout(function () {
  1230. f = null;
  1231. }, n[o - 1] || 600)),
  1232. r[s]("mousedown", e),
  1233. r[s](l[o], e);
  1234. }
  1235. var o = 0,
  1236. u,
  1237. a,
  1238. f,
  1239. l = { 2: "dblclick", 3: "tripleclick", 4: "quadclick" };
  1240. Array.isArray(e) || (e = [e]),
  1241. e.forEach(function (e) {
  1242. t.addListener(e, "mousedown", c),
  1243. i.isOldIE && t.addListener(e, "dblclick", h);
  1244. });
  1245. });
  1246. var u =
  1247. !i.isMac || !i.isOpera || "KeyboardEvent" in window
  1248. ? function (e) {
  1249. return (
  1250. 0 |
  1251. (e.ctrlKey ? 1 : 0) |
  1252. (e.altKey ? 2 : 0) |
  1253. (e.shiftKey ? 4 : 0) |
  1254. (e.metaKey ? 8 : 0)
  1255. );
  1256. }
  1257. : function (e) {
  1258. return (
  1259. 0 |
  1260. (e.metaKey ? 1 : 0) |
  1261. (e.altKey ? 2 : 0) |
  1262. (e.shiftKey ? 4 : 0) |
  1263. (e.ctrlKey ? 8 : 0)
  1264. );
  1265. };
  1266. (t.getModifierString = function (e) {
  1267. return r.KEY_MODS[u(e)];
  1268. }),
  1269. (t.addCommandKeyListener = function (e, n) {
  1270. var r = t.addListener;
  1271. if (i.isOldGecko || (i.isOpera && !("KeyboardEvent" in window))) {
  1272. var o = null;
  1273. r(e, "keydown", function (e) {
  1274. o = e.keyCode;
  1275. }),
  1276. r(e, "keypress", function (e) {
  1277. return a(n, e, o);
  1278. });
  1279. } else {
  1280. var u = null;
  1281. r(e, "keydown", function (e) {
  1282. s[e.keyCode] = (s[e.keyCode] || 0) + 1;
  1283. var t = a(n, e, e.keyCode);
  1284. return (u = e.defaultPrevented), t;
  1285. }),
  1286. r(e, "keypress", function (e) {
  1287. u &&
  1288. (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) &&
  1289. (t.stopEvent(e), (u = null));
  1290. }),
  1291. r(e, "keyup", function (e) {
  1292. s[e.keyCode] = null;
  1293. }),
  1294. s || (f(), r(window, "focus", f));
  1295. }
  1296. });
  1297. if (typeof window == "object" && window.postMessage && !i.isOldIE) {
  1298. var l = 1;
  1299. t.nextTick = function (e, n) {
  1300. n = n || window;
  1301. var r = "zero-timeout-message-" + l++,
  1302. i = function (s) {
  1303. s.data == r &&
  1304. (t.stopPropagation(s), t.removeListener(n, "message", i), e());
  1305. };
  1306. t.addListener(n, "message", i), n.postMessage(r, "*");
  1307. };
  1308. }
  1309. (t.$idleBlocked = !1),
  1310. (t.onIdle = function (e, n) {
  1311. return setTimeout(function r() {
  1312. t.$idleBlocked ? setTimeout(r, 100) : e();
  1313. }, n);
  1314. }),
  1315. (t.$idleBlockId = null),
  1316. (t.blockIdle = function (e) {
  1317. t.$idleBlockId && clearTimeout(t.$idleBlockId),
  1318. (t.$idleBlocked = !0),
  1319. (t.$idleBlockId = setTimeout(function () {
  1320. t.$idleBlocked = !1;
  1321. }, e || 100));
  1322. }),
  1323. (t.nextFrame =
  1324. typeof window == "object" &&
  1325. (window.requestAnimationFrame ||
  1326. window.mozRequestAnimationFrame ||
  1327. window.webkitRequestAnimationFrame ||
  1328. window.msRequestAnimationFrame ||
  1329. window.oRequestAnimationFrame)),
  1330. t.nextFrame
  1331. ? (t.nextFrame = t.nextFrame.bind(window))
  1332. : (t.nextFrame = function (e) {
  1333. setTimeout(e, 17);
  1334. });
  1335. }
  1336. ),
  1337. define("ace/range", ["require", "exports", "module"], function (e, t, n) {
  1338. "use strict";
  1339. var r = function (e, t) {
  1340. return e.row - t.row || e.column - t.column;
  1341. },
  1342. i = function (e, t, n, r) {
  1343. (this.start = { row: e, column: t }),
  1344. (this.end = { row: n, column: r });
  1345. };
  1346. (function () {
  1347. (this.isEqual = function (e) {
  1348. return (
  1349. this.start.row === e.start.row &&
  1350. this.end.row === e.end.row &&
  1351. this.start.column === e.start.column &&
  1352. this.end.column === e.end.column
  1353. );
  1354. }),
  1355. (this.toString = function () {
  1356. return (
  1357. "Range: [" +
  1358. this.start.row +
  1359. "/" +
  1360. this.start.column +
  1361. "] -> [" +
  1362. this.end.row +
  1363. "/" +
  1364. this.end.column +
  1365. "]"
  1366. );
  1367. }),
  1368. (this.contains = function (e, t) {
  1369. return this.compare(e, t) == 0;
  1370. }),
  1371. (this.compareRange = function (e) {
  1372. var t,
  1373. n = e.end,
  1374. r = e.start;
  1375. return (
  1376. (t = this.compare(n.row, n.column)),
  1377. t == 1
  1378. ? ((t = this.compare(r.row, r.column)),
  1379. t == 1 ? 2 : t == 0 ? 1 : 0)
  1380. : t == -1
  1381. ? -2
  1382. : ((t = this.compare(r.row, r.column)),
  1383. t == -1 ? -1 : t == 1 ? 42 : 0)
  1384. );
  1385. }),
  1386. (this.comparePoint = function (e) {
  1387. return this.compare(e.row, e.column);
  1388. }),
  1389. (this.containsRange = function (e) {
  1390. return (
  1391. this.comparePoint(e.start) == 0 && this.comparePoint(e.end) == 0
  1392. );
  1393. }),
  1394. (this.intersects = function (e) {
  1395. var t = this.compareRange(e);
  1396. return t == -1 || t == 0 || t == 1;
  1397. }),
  1398. (this.isEnd = function (e, t) {
  1399. return this.end.row == e && this.end.column == t;
  1400. }),
  1401. (this.isStart = function (e, t) {
  1402. return this.start.row == e && this.start.column == t;
  1403. }),
  1404. (this.setStart = function (e, t) {
  1405. typeof e == "object"
  1406. ? ((this.start.column = e.column), (this.start.row = e.row))
  1407. : ((this.start.row = e), (this.start.column = t));
  1408. }),
  1409. (this.setEnd = function (e, t) {
  1410. typeof e == "object"
  1411. ? ((this.end.column = e.column), (this.end.row = e.row))
  1412. : ((this.end.row = e), (this.end.column = t));
  1413. }),
  1414. (this.inside = function (e, t) {
  1415. return this.compare(e, t) == 0
  1416. ? this.isEnd(e, t) || this.isStart(e, t)
  1417. ? !1
  1418. : !0
  1419. : !1;
  1420. }),
  1421. (this.insideStart = function (e, t) {
  1422. return this.compare(e, t) == 0 ? (this.isEnd(e, t) ? !1 : !0) : !1;
  1423. }),
  1424. (this.insideEnd = function (e, t) {
  1425. return this.compare(e, t) == 0 ? (this.isStart(e, t) ? !1 : !0) : !1;
  1426. }),
  1427. (this.compare = function (e, t) {
  1428. return !this.isMultiLine() && e === this.start.row
  1429. ? t < this.start.column
  1430. ? -1
  1431. : t > this.end.column
  1432. ? 1
  1433. : 0
  1434. : e < this.start.row
  1435. ? -1
  1436. : e > this.end.row
  1437. ? 1
  1438. : this.start.row === e
  1439. ? t >= this.start.column
  1440. ? 0
  1441. : -1
  1442. : this.end.row === e
  1443. ? t <= this.end.column
  1444. ? 0
  1445. : 1
  1446. : 0;
  1447. }),
  1448. (this.compareStart = function (e, t) {
  1449. return this.start.row == e && this.start.column == t
  1450. ? -1
  1451. : this.compare(e, t);
  1452. }),
  1453. (this.compareEnd = function (e, t) {
  1454. return this.end.row == e && this.end.column == t
  1455. ? 1
  1456. : this.compare(e, t);
  1457. }),
  1458. (this.compareInside = function (e, t) {
  1459. return this.end.row == e && this.end.column == t
  1460. ? 1
  1461. : this.start.row == e && this.start.column == t
  1462. ? -1
  1463. : this.compare(e, t);
  1464. }),
  1465. (this.clipRows = function (e, t) {
  1466. if (this.end.row > t) var n = { row: t + 1, column: 0 };
  1467. else if (this.end.row < e) var n = { row: e, column: 0 };
  1468. if (this.start.row > t) var r = { row: t + 1, column: 0 };
  1469. else if (this.start.row < e) var r = { row: e, column: 0 };
  1470. return i.fromPoints(r || this.start, n || this.end);
  1471. }),
  1472. (this.extend = function (e, t) {
  1473. var n = this.compare(e, t);
  1474. if (n == 0) return this;
  1475. if (n == -1) var r = { row: e, column: t };
  1476. else var s = { row: e, column: t };
  1477. return i.fromPoints(r || this.start, s || this.end);
  1478. }),
  1479. (this.isEmpty = function () {
  1480. return (
  1481. this.start.row === this.end.row &&
  1482. this.start.column === this.end.column
  1483. );
  1484. }),
  1485. (this.isMultiLine = function () {
  1486. return this.start.row !== this.end.row;
  1487. }),
  1488. (this.clone = function () {
  1489. return i.fromPoints(this.start, this.end);
  1490. }),
  1491. (this.collapseRows = function () {
  1492. return this.end.column == 0
  1493. ? new i(
  1494. this.start.row,
  1495. 0,
  1496. Math.max(this.start.row, this.end.row - 1),
  1497. 0
  1498. )
  1499. : new i(this.start.row, 0, this.end.row, 0);
  1500. }),
  1501. (this.toScreenRange = function (e) {
  1502. var t = e.documentToScreenPosition(this.start),
  1503. n = e.documentToScreenPosition(this.end);
  1504. return new i(t.row, t.column, n.row, n.column);
  1505. }),
  1506. (this.moveBy = function (e, t) {
  1507. (this.start.row += e),
  1508. (this.start.column += t),
  1509. (this.end.row += e),
  1510. (this.end.column += t);
  1511. });
  1512. }).call(i.prototype),
  1513. (i.fromPoints = function (e, t) {
  1514. return new i(e.row, e.column, t.row, t.column);
  1515. }),
  1516. (i.comparePoints = r),
  1517. (i.comparePoints = function (e, t) {
  1518. return e.row - t.row || e.column - t.column;
  1519. }),
  1520. (t.Range = i);
  1521. }),
  1522. define("ace/lib/lang", ["require", "exports", "module"], function (e, t, n) {
  1523. "use strict";
  1524. (t.last = function (e) {
  1525. return e[e.length - 1];
  1526. }),
  1527. (t.stringReverse = function (e) {
  1528. return e.split("").reverse().join("");
  1529. }),
  1530. (t.stringRepeat = function (e, t) {
  1531. var n = "";
  1532. while (t > 0) {
  1533. t & 1 && (n += e);
  1534. if ((t >>= 1)) e += e;
  1535. }
  1536. return n;
  1537. });
  1538. var r = /^\s\s*/,
  1539. i = /\s\s*$/;
  1540. (t.stringTrimLeft = function (e) {
  1541. return e.replace(r, "");
  1542. }),
  1543. (t.stringTrimRight = function (e) {
  1544. return e.replace(i, "");
  1545. }),
  1546. (t.copyObject = function (e) {
  1547. var t = {};
  1548. for (var n in e) t[n] = e[n];
  1549. return t;
  1550. }),
  1551. (t.copyArray = function (e) {
  1552. var t = [];
  1553. for (var n = 0, r = e.length; n < r; n++)
  1554. e[n] && typeof e[n] == "object"
  1555. ? (t[n] = this.copyObject(e[n]))
  1556. : (t[n] = e[n]);
  1557. return t;
  1558. }),
  1559. (t.deepCopy = function s(e) {
  1560. if (typeof e != "object" || !e) return e;
  1561. var t;
  1562. if (Array.isArray(e)) {
  1563. t = [];
  1564. for (var n = 0; n < e.length; n++) t[n] = s(e[n]);
  1565. return t;
  1566. }
  1567. if (Object.prototype.toString.call(e) !== "[object Object]") return e;
  1568. t = {};
  1569. for (var n in e) t[n] = s(e[n]);
  1570. return t;
  1571. }),
  1572. (t.arrayToMap = function (e) {
  1573. var t = {};
  1574. for (var n = 0; n < e.length; n++) t[e[n]] = 1;
  1575. return t;
  1576. }),
  1577. (t.createMap = function (e) {
  1578. var t = Object.create(null);
  1579. for (var n in e) t[n] = e[n];
  1580. return t;
  1581. }),
  1582. (t.arrayRemove = function (e, t) {
  1583. for (var n = 0; n <= e.length; n++) t === e[n] && e.splice(n, 1);
  1584. }),
  1585. (t.escapeRegExp = function (e) {
  1586. return e.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
  1587. }),
  1588. (t.escapeHTML = function (e) {
  1589. return ("" + e)
  1590. .replace(/&/g, "&#38;")
  1591. .replace(/"/g, "&#34;")
  1592. .replace(/'/g, "&#39;")
  1593. .replace(/</g, "&#60;");
  1594. }),
  1595. (t.getMatchOffsets = function (e, t) {
  1596. var n = [];
  1597. return (
  1598. e.replace(t, function (e) {
  1599. n.push({
  1600. offset: arguments[arguments.length - 2],
  1601. length: e.length,
  1602. });
  1603. }),
  1604. n
  1605. );
  1606. }),
  1607. (t.deferredCall = function (e) {
  1608. var t = null,
  1609. n = function () {
  1610. (t = null), e();
  1611. },
  1612. r = function (e) {
  1613. return r.cancel(), (t = setTimeout(n, e || 0)), r;
  1614. };
  1615. return (
  1616. (r.schedule = r),
  1617. (r.call = function () {
  1618. return this.cancel(), e(), r;
  1619. }),
  1620. (r.cancel = function () {
  1621. return clearTimeout(t), (t = null), r;
  1622. }),
  1623. (r.isPending = function () {
  1624. return t;
  1625. }),
  1626. r
  1627. );
  1628. }),
  1629. (t.delayedCall = function (e, t) {
  1630. var n = null,
  1631. r = function () {
  1632. (n = null), e();
  1633. },
  1634. i = function (e) {
  1635. n == null && (n = setTimeout(r, e || t));
  1636. };
  1637. return (
  1638. (i.delay = function (e) {
  1639. n && clearTimeout(n), (n = setTimeout(r, e || t));
  1640. }),
  1641. (i.schedule = i),
  1642. (i.call = function () {
  1643. this.cancel(), e();
  1644. }),
  1645. (i.cancel = function () {
  1646. n && clearTimeout(n), (n = null);
  1647. }),
  1648. (i.isPending = function () {
  1649. return n;
  1650. }),
  1651. i
  1652. );
  1653. });
  1654. }),
  1655. define(
  1656. "ace/keyboard/textinput",
  1657. [
  1658. "require",
  1659. "exports",
  1660. "module",
  1661. "ace/lib/event",
  1662. "ace/lib/useragent",
  1663. "ace/lib/dom",
  1664. "ace/lib/lang",
  1665. "ace/lib/keys",
  1666. ],
  1667. function (e, t, n) {
  1668. "use strict";
  1669. var r = e("../lib/event"),
  1670. i = e("../lib/useragent"),
  1671. s = e("../lib/dom"),
  1672. o = e("../lib/lang"),
  1673. u = i.isChrome < 18,
  1674. a = i.isIE,
  1675. f = i.isChrome > 63,
  1676. l = 400,
  1677. c = e("../lib/keys"),
  1678. h = c.KEY_MODS,
  1679. p = i.isIOS,
  1680. d = p ? /\s/ : /\n/,
  1681. v = function (e, t) {
  1682. function W() {
  1683. (x = !0), n.blur(), n.focus(), (x = !1);
  1684. }
  1685. function V(e) {
  1686. e.keyCode == 27 &&
  1687. n.value.length < n.selectionStart &&
  1688. (g || (T = n.value), (N = C = -1), A()),
  1689. X();
  1690. }
  1691. function J() {
  1692. clearTimeout($),
  1693. ($ = setTimeout(function () {
  1694. b && ((n.style.cssText = b), (b = "")),
  1695. t.renderer.$keepTextAreaAtCursor == null &&
  1696. ((t.renderer.$keepTextAreaAtCursor = !0),
  1697. t.renderer.$moveTextAreaToCursor());
  1698. }, 0));
  1699. }
  1700. function Q(e, t, n) {
  1701. var r = null,
  1702. i = !1;
  1703. n.addEventListener(
  1704. "keydown",
  1705. function (e) {
  1706. r && clearTimeout(r), (i = !0);
  1707. },
  1708. !0
  1709. ),
  1710. n.addEventListener(
  1711. "keyup",
  1712. function (e) {
  1713. r = setTimeout(function () {
  1714. i = !1;
  1715. }, 100);
  1716. },
  1717. !0
  1718. );
  1719. var s = function (e) {
  1720. if (document.activeElement !== n) return;
  1721. if (i || g) return;
  1722. if (v) return;
  1723. var r = n.selectionStart,
  1724. s = n.selectionEnd,
  1725. o = null,
  1726. u = 0;
  1727. console.log(r, s);
  1728. if (r == 0) o = c.up;
  1729. else if (r == 1) o = c.home;
  1730. else if (s > C && T[s] == "\n") o = c.end;
  1731. else if (r < N && T[r - 1] == " ") (o = c.left), (u = h.option);
  1732. else if (r < N || (r == N && C != N && r == s)) o = c.left;
  1733. else if (s > C && T.slice(0, s).split("\n").length > 2)
  1734. o = c.down;
  1735. else if (s > C && T[s - 1] == " ") (o = c.right), (u = h.option);
  1736. else if (s > C || (s == C && C != N && r == s)) o = c.right;
  1737. r !== s && (u |= h.shift),
  1738. o && (t.onCommandKey(null, u, o), (N = r), (C = s), A(""));
  1739. };
  1740. document.addEventListener("selectionchange", s),
  1741. t.on("destroy", function () {
  1742. document.removeEventListener("selectionchange", s);
  1743. });
  1744. }
  1745. var n = s.createElement("textarea");
  1746. (n.className = "ace_text-input"),
  1747. n.setAttribute("wrap", "off"),
  1748. n.setAttribute("autocorrect", "off"),
  1749. n.setAttribute("autocapitalize", "off"),
  1750. n.setAttribute("spellcheck", !1),
  1751. (n.style.opacity = "0"),
  1752. e.insertBefore(n, e.firstChild);
  1753. var v = !1,
  1754. m = !1,
  1755. g = !1,
  1756. y = !1,
  1757. b = "",
  1758. w = !0,
  1759. E = !1;
  1760. i.isMobile || (n.style.fontSize = "1px");
  1761. var S = !1,
  1762. x = !1,
  1763. T = "",
  1764. N = 0,
  1765. C = 0;
  1766. try {
  1767. var k = document.activeElement === n;
  1768. } catch (L) {}
  1769. r.addListener(n, "blur", function (e) {
  1770. if (x) return;
  1771. t.onBlur(e), (k = !1);
  1772. }),
  1773. r.addListener(n, "focus", function (e) {
  1774. if (x) return;
  1775. k = !0;
  1776. if (i.isEdge)
  1777. try {
  1778. if (!document.hasFocus()) return;
  1779. } catch (e) {}
  1780. t.onFocus(e), i.isEdge ? setTimeout(A) : A();
  1781. }),
  1782. (this.$focusScroll = !1),
  1783. (this.focus = function () {
  1784. if (b || f || this.$focusScroll == "browser")
  1785. return n.focus({ preventScroll: !0 });
  1786. var e = n.style.top;
  1787. (n.style.position = "fixed"), (n.style.top = "0px");
  1788. try {
  1789. var t = n.getBoundingClientRect().top != 0;
  1790. } catch (r) {
  1791. return;
  1792. }
  1793. var i = [];
  1794. if (t) {
  1795. var s = n.parentElement;
  1796. while (s && s.nodeType == 1)
  1797. i.push(s),
  1798. s.setAttribute("ace_nocontext", !0),
  1799. !s.parentElement && s.getRootNode
  1800. ? (s = s.getRootNode().host)
  1801. : (s = s.parentElement);
  1802. }
  1803. n.focus({ preventScroll: !0 }),
  1804. t &&
  1805. i.forEach(function (e) {
  1806. e.removeAttribute("ace_nocontext");
  1807. }),
  1808. setTimeout(function () {
  1809. (n.style.position = ""),
  1810. n.style.top == "0px" && (n.style.top = e);
  1811. }, 0);
  1812. }),
  1813. (this.blur = function () {
  1814. n.blur();
  1815. }),
  1816. (this.isFocused = function () {
  1817. return k;
  1818. }),
  1819. t.on("beforeEndOperation", function () {
  1820. if (t.curOp && t.curOp.command.name == "insertstring") return;
  1821. g && ((T = n.value = ""), z()), A();
  1822. });
  1823. var A = p
  1824. ? function (e) {
  1825. if (!k || (v && !e)) return;
  1826. e || (e = "");
  1827. var r = "\n ab" + e + "cde fg\n";
  1828. r != n.value && (n.value = T = r);
  1829. var i = 4,
  1830. s = 4 + (e.length || (t.selection.isEmpty() ? 0 : 1));
  1831. (N != i || C != s) && n.setSelectionRange(i, s),
  1832. (N = i),
  1833. (C = s);
  1834. }
  1835. : function () {
  1836. if (g || y) return;
  1837. if (!k && !D) return;
  1838. g = !0;
  1839. var e = t.selection,
  1840. r = e.getRange(),
  1841. i = e.cursor.row,
  1842. s = r.start.column,
  1843. o = r.end.column,
  1844. u = t.session.getLine(i);
  1845. if (r.start.row != i) {
  1846. var a = t.session.getLine(i - 1);
  1847. (s = r.start.row < i - 1 ? 0 : s),
  1848. (o += a.length + 1),
  1849. (u = a + "\n" + u);
  1850. } else if (r.end.row != i) {
  1851. var f = t.session.getLine(i + 1);
  1852. (o = r.end.row > i + 1 ? f.length : o),
  1853. (o += u.length + 1),
  1854. (u = u + "\n" + f);
  1855. }
  1856. u.length > l &&
  1857. (s < l && o < l
  1858. ? (u = u.slice(0, l))
  1859. : ((u = "\n"), (s = 0), (o = 1)));
  1860. var c = u + "\n\n";
  1861. c != T && ((n.value = T = c), (N = C = c.length)),
  1862. D && ((N = n.selectionStart), (C = n.selectionEnd));
  1863. if (C != o || N != s || n.selectionEnd != C)
  1864. try {
  1865. n.setSelectionRange(s, o), (N = s), (C = o);
  1866. } catch (h) {}
  1867. g = !1;
  1868. };
  1869. k && t.onFocus();
  1870. var O = function (e) {
  1871. return (
  1872. e.selectionStart === 0 &&
  1873. e.selectionEnd >= T.length &&
  1874. e.value === T &&
  1875. T &&
  1876. e.selectionEnd !== C
  1877. );
  1878. },
  1879. M = function (e) {
  1880. if (g) return;
  1881. v ? (v = !1) : O(n) && (t.selectAll(), A());
  1882. },
  1883. _ = null;
  1884. (this.setInputHandler = function (e) {
  1885. _ = e;
  1886. }),
  1887. (this.getInputHandler = function () {
  1888. return _;
  1889. });
  1890. var D = !1,
  1891. P = function (e, r) {
  1892. D && (D = !1);
  1893. if (m) return A(), e && t.onPaste(e), (m = !1), "";
  1894. var i = n.selectionStart,
  1895. s = n.selectionEnd,
  1896. o = N,
  1897. u = T.length - C,
  1898. a = e,
  1899. f = e.length - i,
  1900. l = e.length - s,
  1901. c = 0;
  1902. while (o > 0 && T[c] == e[c]) c++, o--;
  1903. (a = a.slice(c)), (c = 1);
  1904. while (
  1905. u > 0 &&
  1906. T.length - c > N - 1 &&
  1907. T[T.length - c] == e[e.length - c]
  1908. )
  1909. c++, u--;
  1910. return (
  1911. (f -= c - 1),
  1912. (l -= c - 1),
  1913. (a = a.slice(0, a.length - c + 1)),
  1914. !r && f == a.length && !o && !u && !l
  1915. ? ""
  1916. : ((y = !0),
  1917. (a && !o && !u && !f && !l) || S
  1918. ? t.onTextInput(a)
  1919. : t.onTextInput(a, {
  1920. extendLeft: o,
  1921. extendRight: u,
  1922. restoreStart: f,
  1923. restoreEnd: l,
  1924. }),
  1925. (y = !1),
  1926. (T = e),
  1927. (N = i),
  1928. (C = s),
  1929. a)
  1930. );
  1931. },
  1932. H = function (e) {
  1933. if (g) return U();
  1934. var t = n.value,
  1935. r = P(t, !0);
  1936. (t.length > l + 100 || d.test(r)) && A();
  1937. },
  1938. B = function (e, t, n) {
  1939. var r = e.clipboardData || window.clipboardData;
  1940. if (!r || u) return;
  1941. var i = a || n ? "Text" : "text/plain";
  1942. try {
  1943. return t ? r.setData(i, t) !== !1 : r.getData(i);
  1944. } catch (e) {
  1945. if (!n) return B(e, t, !0);
  1946. }
  1947. },
  1948. j = function (e, i) {
  1949. var s = t.getCopyText();
  1950. if (!s) return r.preventDefault(e);
  1951. B(e, s)
  1952. ? (p &&
  1953. (A(s),
  1954. (v = s),
  1955. setTimeout(function () {
  1956. v = !1;
  1957. }, 10)),
  1958. i ? t.onCut() : t.onCopy(),
  1959. r.preventDefault(e))
  1960. : ((v = !0),
  1961. (n.value = s),
  1962. n.select(),
  1963. setTimeout(function () {
  1964. (v = !1), A(), i ? t.onCut() : t.onCopy();
  1965. }));
  1966. },
  1967. F = function (e) {
  1968. j(e, !0);
  1969. },
  1970. I = function (e) {
  1971. j(e, !1);
  1972. },
  1973. q = function (e) {
  1974. var s = B(e);
  1975. typeof s == "string"
  1976. ? (s && t.onPaste(s, e),
  1977. i.isIE && setTimeout(A),
  1978. r.preventDefault(e))
  1979. : ((n.value = ""), (m = !0));
  1980. };
  1981. r.addCommandKeyListener(n, t.onCommandKey.bind(t)),
  1982. r.addListener(n, "select", M),
  1983. r.addListener(n, "input", H),
  1984. r.addListener(n, "cut", F),
  1985. r.addListener(n, "copy", I),
  1986. r.addListener(n, "paste", q),
  1987. (!("oncut" in n) || !("oncopy" in n) || !("onpaste" in n)) &&
  1988. r.addListener(e, "keydown", function (e) {
  1989. if ((i.isMac && !e.metaKey) || !e.ctrlKey) return;
  1990. switch (e.keyCode) {
  1991. case 67:
  1992. I(e);
  1993. break;
  1994. case 86:
  1995. q(e);
  1996. break;
  1997. case 88:
  1998. F(e);
  1999. }
  2000. });
  2001. var R = function (e) {
  2002. if (g || !t.onCompositionStart || t.$readOnly) return;
  2003. g = {};
  2004. if (S) return;
  2005. setTimeout(U, 0), t.on("mousedown", W);
  2006. var r = t.getSelectionRange();
  2007. (r.end.row = r.start.row),
  2008. (r.end.column = r.start.column),
  2009. (g.markerRange = r),
  2010. (g.selectionStart = N),
  2011. t.onCompositionStart(g),
  2012. g.useTextareaForIME
  2013. ? ((n.value = ""), (T = ""), (N = 0), (C = 0))
  2014. : (n.msGetInputContext && (g.context = n.msGetInputContext()),
  2015. n.getInputContext && (g.context = n.getInputContext()));
  2016. },
  2017. U = function () {
  2018. if (!g || !t.onCompositionUpdate || t.$readOnly) return;
  2019. if (S) return W();
  2020. if (g.useTextareaForIME) t.onCompositionUpdate(n.value);
  2021. else {
  2022. var e = n.value;
  2023. P(e),
  2024. g.markerRange &&
  2025. (g.context &&
  2026. (g.markerRange.start.column = g.selectionStart =
  2027. g.context.compositionStartOffset),
  2028. (g.markerRange.end.column =
  2029. g.markerRange.start.column + C - g.selectionStart));
  2030. }
  2031. },
  2032. z = function (e) {
  2033. if (!t.onCompositionEnd || t.$readOnly) return;
  2034. (g = !1), t.onCompositionEnd(), t.off("mousedown", W), e && H();
  2035. },
  2036. X = o.delayedCall(U, 50).schedule.bind(null, null);
  2037. r.addListener(n, "compositionstart", R),
  2038. r.addListener(n, "compositionupdate", U),
  2039. r.addListener(n, "keyup", V),
  2040. r.addListener(n, "keydown", X),
  2041. r.addListener(n, "compositionend", z),
  2042. (this.getElement = function () {
  2043. return n;
  2044. }),
  2045. (this.setCommandMode = function (e) {
  2046. (S = e), (n.readOnly = !1);
  2047. }),
  2048. (this.setReadOnly = function (e) {
  2049. S || (n.readOnly = e);
  2050. }),
  2051. (this.setCopyWithEmptySelection = function (e) {
  2052. E = e;
  2053. }),
  2054. (this.onContextMenu = function (e) {
  2055. (D = !0),
  2056. A(),
  2057. t._emit("nativecontextmenu", { target: t, domEvent: e }),
  2058. this.moveToMouse(e, !0);
  2059. }),
  2060. (this.moveToMouse = function (e, o) {
  2061. b || (b = n.style.cssText),
  2062. (n.style.cssText =
  2063. (o ? "z-index:100000;" : "") +
  2064. (i.isIE ? "opacity:0.1;" : "") +
  2065. "text-indent: -" +
  2066. (N + C) * t.renderer.characterWidth * 0.5 +
  2067. "px;");
  2068. var u = t.container.getBoundingClientRect(),
  2069. a = s.computedStyle(t.container),
  2070. f = u.top + (parseInt(a.borderTopWidth) || 0),
  2071. l = u.left + (parseInt(u.borderLeftWidth) || 0),
  2072. c = u.bottom - f - n.clientHeight - 2,
  2073. h = function (e) {
  2074. (n.style.left = e.clientX - l - 2 + "px"),
  2075. (n.style.top = Math.min(e.clientY - f - 2, c) + "px");
  2076. };
  2077. h(e);
  2078. if (e.type != "mousedown") return;
  2079. t.renderer.$keepTextAreaAtCursor &&
  2080. (t.renderer.$keepTextAreaAtCursor = null),
  2081. clearTimeout($),
  2082. i.isWin && r.capture(t.container, h, J);
  2083. }),
  2084. (this.onContextMenuClose = J);
  2085. var $,
  2086. K = function (e) {
  2087. t.textInput.onContextMenu(e), J();
  2088. };
  2089. r.addListener(n, "mouseup", K),
  2090. r.addListener(n, "mousedown", function (e) {
  2091. e.preventDefault(), J();
  2092. }),
  2093. r.addListener(t.renderer.scroller, "contextmenu", K),
  2094. r.addListener(n, "contextmenu", K),
  2095. p && Q(e, t, n);
  2096. };
  2097. t.TextInput = v;
  2098. }
  2099. ),
  2100. define(
  2101. "ace/mouse/default_handlers",
  2102. ["require", "exports", "module", "ace/lib/useragent"],
  2103. function (e, t, n) {
  2104. "use strict";
  2105. function o(e) {
  2106. e.$clickSelection = null;
  2107. var t = e.editor;
  2108. t.setDefaultHandler("mousedown", this.onMouseDown.bind(e)),
  2109. t.setDefaultHandler("dblclick", this.onDoubleClick.bind(e)),
  2110. t.setDefaultHandler("tripleclick", this.onTripleClick.bind(e)),
  2111. t.setDefaultHandler("quadclick", this.onQuadClick.bind(e)),
  2112. t.setDefaultHandler("mousewheel", this.onMouseWheel.bind(e)),
  2113. t.setDefaultHandler("touchmove", this.onTouchMove.bind(e));
  2114. var n = [
  2115. "select",
  2116. "startSelect",
  2117. "selectEnd",
  2118. "selectAllEnd",
  2119. "selectByWordsEnd",
  2120. "selectByLinesEnd",
  2121. "dragWait",
  2122. "dragWaitEnd",
  2123. "focusWait",
  2124. ];
  2125. n.forEach(function (t) {
  2126. e[t] = this[t];
  2127. }, this),
  2128. (e.selectByLines = this.extendSelectionBy.bind(e, "getLineRange")),
  2129. (e.selectByWords = this.extendSelectionBy.bind(e, "getWordRange"));
  2130. }
  2131. function u(e, t, n, r) {
  2132. return Math.sqrt(Math.pow(n - e, 2) + Math.pow(r - t, 2));
  2133. }
  2134. function a(e, t) {
  2135. if (e.start.row == e.end.row)
  2136. var n = 2 * t.column - e.start.column - e.end.column;
  2137. else if (
  2138. e.start.row == e.end.row - 1 &&
  2139. !e.start.column &&
  2140. !e.end.column
  2141. )
  2142. var n = t.column - 4;
  2143. else var n = 2 * t.row - e.start.row - e.end.row;
  2144. return n < 0
  2145. ? { cursor: e.start, anchor: e.end }
  2146. : { cursor: e.end, anchor: e.start };
  2147. }
  2148. var r = e("../lib/useragent"),
  2149. i = 0,
  2150. s = 550;
  2151. (function () {
  2152. (this.onMouseDown = function (e) {
  2153. var t = e.inSelection(),
  2154. n = e.getDocumentPosition();
  2155. this.mousedownEvent = e;
  2156. var i = this.editor,
  2157. s = e.getButton();
  2158. if (s !== 0) {
  2159. var o = i.getSelectionRange(),
  2160. u = o.isEmpty();
  2161. (u || s == 1) && i.selection.moveToPosition(n),
  2162. s == 2 &&
  2163. (i.textInput.onContextMenu(e.domEvent),
  2164. r.isMozilla || e.preventDefault());
  2165. return;
  2166. }
  2167. this.mousedownEvent.time = Date.now();
  2168. if (t && !i.isFocused()) {
  2169. i.focus();
  2170. if (
  2171. this.$focusTimeout &&
  2172. !this.$clickSelection &&
  2173. !i.inMultiSelectMode
  2174. ) {
  2175. this.setState("focusWait"), this.captureMouse(e);
  2176. return;
  2177. }
  2178. }
  2179. return (
  2180. this.captureMouse(e),
  2181. this.startSelect(n, e.domEvent._clicks > 1),
  2182. e.preventDefault()
  2183. );
  2184. }),
  2185. (this.startSelect = function (e, t) {
  2186. e =
  2187. e || this.editor.renderer.screenToTextCoordinates(this.x, this.y);
  2188. var n = this.editor;
  2189. if (!this.mousedownEvent) return;
  2190. this.mousedownEvent.getShiftKey()
  2191. ? n.selection.selectToPosition(e)
  2192. : t || n.selection.moveToPosition(e),
  2193. t || this.select(),
  2194. n.renderer.scroller.setCapture &&
  2195. n.renderer.scroller.setCapture(),
  2196. n.setStyle("ace_selecting"),
  2197. this.setState("select");
  2198. }),
  2199. (this.select = function () {
  2200. var e,
  2201. t = this.editor,
  2202. n = t.renderer.screenToTextCoordinates(this.x, this.y);
  2203. if (this.$clickSelection) {
  2204. var r = this.$clickSelection.comparePoint(n);
  2205. if (r == -1) e = this.$clickSelection.end;
  2206. else if (r == 1) e = this.$clickSelection.start;
  2207. else {
  2208. var i = a(this.$clickSelection, n);
  2209. (n = i.cursor), (e = i.anchor);
  2210. }
  2211. t.selection.setSelectionAnchor(e.row, e.column);
  2212. }
  2213. t.selection.selectToPosition(n), t.renderer.scrollCursorIntoView();
  2214. }),
  2215. (this.extendSelectionBy = function (e) {
  2216. var t,
  2217. n = this.editor,
  2218. r = n.renderer.screenToTextCoordinates(this.x, this.y),
  2219. i = n.selection[e](r.row, r.column);
  2220. if (this.$clickSelection) {
  2221. var s = this.$clickSelection.comparePoint(i.start),
  2222. o = this.$clickSelection.comparePoint(i.end);
  2223. if (s == -1 && o <= 0) {
  2224. t = this.$clickSelection.end;
  2225. if (i.end.row != r.row || i.end.column != r.column) r = i.start;
  2226. } else if (o == 1 && s >= 0) {
  2227. t = this.$clickSelection.start;
  2228. if (i.start.row != r.row || i.start.column != r.column)
  2229. r = i.end;
  2230. } else if (s == -1 && o == 1) (r = i.end), (t = i.start);
  2231. else {
  2232. var u = a(this.$clickSelection, r);
  2233. (r = u.cursor), (t = u.anchor);
  2234. }
  2235. n.selection.setSelectionAnchor(t.row, t.column);
  2236. }
  2237. n.selection.selectToPosition(r), n.renderer.scrollCursorIntoView();
  2238. }),
  2239. (this.selectEnd =
  2240. this.selectAllEnd =
  2241. this.selectByWordsEnd =
  2242. this.selectByLinesEnd =
  2243. function () {
  2244. (this.$clickSelection = null),
  2245. this.editor.unsetStyle("ace_selecting"),
  2246. this.editor.renderer.scroller.releaseCapture &&
  2247. this.editor.renderer.scroller.releaseCapture();
  2248. }),
  2249. (this.focusWait = function () {
  2250. var e = u(
  2251. this.mousedownEvent.x,
  2252. this.mousedownEvent.y,
  2253. this.x,
  2254. this.y
  2255. ),
  2256. t = Date.now();
  2257. (e > i || t - this.mousedownEvent.time > this.$focusTimeout) &&
  2258. this.startSelect(this.mousedownEvent.getDocumentPosition());
  2259. }),
  2260. (this.onDoubleClick = function (e) {
  2261. var t = e.getDocumentPosition(),
  2262. n = this.editor,
  2263. r = n.session,
  2264. i = r.getBracketRange(t);
  2265. i
  2266. ? (i.isEmpty() && (i.start.column--, i.end.column++),
  2267. this.setState("select"))
  2268. : ((i = n.selection.getWordRange(t.row, t.column)),
  2269. this.setState("selectByWords")),
  2270. (this.$clickSelection = i),
  2271. this.select();
  2272. }),
  2273. (this.onTripleClick = function (e) {
  2274. var t = e.getDocumentPosition(),
  2275. n = this.editor;
  2276. this.setState("selectByLines");
  2277. var r = n.getSelectionRange();
  2278. r.isMultiLine() && r.contains(t.row, t.column)
  2279. ? ((this.$clickSelection = n.selection.getLineRange(r.start.row)),
  2280. (this.$clickSelection.end = n.selection.getLineRange(
  2281. r.end.row
  2282. ).end))
  2283. : (this.$clickSelection = n.selection.getLineRange(t.row)),
  2284. this.select();
  2285. }),
  2286. (this.onQuadClick = function (e) {
  2287. var t = this.editor;
  2288. t.selectAll(),
  2289. (this.$clickSelection = t.getSelectionRange()),
  2290. this.setState("selectAll");
  2291. }),
  2292. (this.onMouseWheel = function (e) {
  2293. if (e.getAccelKey()) return;
  2294. e.getShiftKey() &&
  2295. e.wheelY &&
  2296. !e.wheelX &&
  2297. ((e.wheelX = e.wheelY), (e.wheelY = 0));
  2298. var t = this.editor;
  2299. this.$lastScroll ||
  2300. (this.$lastScroll = { t: 0, vx: 0, vy: 0, allowed: 0 });
  2301. var n = this.$lastScroll,
  2302. r = e.domEvent.timeStamp,
  2303. i = r - n.t,
  2304. o = i ? e.wheelX / i : n.vx,
  2305. u = i ? e.wheelY / i : n.vy;
  2306. i < s && ((o = (o + n.vx) / 2), (u = (u + n.vy) / 2));
  2307. var a = Math.abs(o / u),
  2308. f = !1;
  2309. a >= 1 &&
  2310. t.renderer.isScrollableBy(e.wheelX * e.speed, 0) &&
  2311. (f = !0),
  2312. a <= 1 &&
  2313. t.renderer.isScrollableBy(0, e.wheelY * e.speed) &&
  2314. (f = !0);
  2315. if (f) n.allowed = r;
  2316. else if (r - n.allowed < s) {
  2317. var l =
  2318. Math.abs(o) <= 1.5 * Math.abs(n.vx) &&
  2319. Math.abs(u) <= 1.5 * Math.abs(n.vy);
  2320. l ? ((f = !0), (n.allowed = r)) : (n.allowed = 0);
  2321. }
  2322. (n.t = r), (n.vx = o), (n.vy = u);
  2323. if (f)
  2324. return (
  2325. t.renderer.scrollBy(e.wheelX * e.speed, e.wheelY * e.speed),
  2326. e.stop()
  2327. );
  2328. }),
  2329. (this.onTouchMove = function (e) {
  2330. this.editor._emit("mousewheel", e);
  2331. });
  2332. }).call(o.prototype),
  2333. (t.DefaultHandlers = o);
  2334. }
  2335. ),
  2336. define(
  2337. "ace/tooltip",
  2338. ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom"],
  2339. function (e, t, n) {
  2340. "use strict";
  2341. function s(e) {
  2342. (this.isOpen = !1), (this.$element = null), (this.$parentNode = e);
  2343. }
  2344. var r = e("./lib/oop"),
  2345. i = e("./lib/dom");
  2346. (function () {
  2347. (this.$init = function () {
  2348. return (
  2349. (this.$element = i.createElement("div")),
  2350. (this.$element.className = "ace_tooltip"),
  2351. (this.$element.style.display = "none"),
  2352. this.$parentNode.appendChild(this.$element),
  2353. this.$element
  2354. );
  2355. }),
  2356. (this.getElement = function () {
  2357. return this.$element || this.$init();
  2358. }),
  2359. (this.setText = function (e) {
  2360. this.getElement().textContent = e;
  2361. }),
  2362. (this.setHtml = function (e) {
  2363. this.getElement().innerHTML = e;
  2364. }),
  2365. (this.setPosition = function (e, t) {
  2366. (this.getElement().style.left = e + "px"),
  2367. (this.getElement().style.top = t + "px");
  2368. }),
  2369. (this.setClassName = function (e) {
  2370. i.addCssClass(this.getElement(), e);
  2371. }),
  2372. (this.show = function (e, t, n) {
  2373. e != null && this.setText(e),
  2374. t != null && n != null && this.setPosition(t, n),
  2375. this.isOpen ||
  2376. ((this.getElement().style.display = "block"),
  2377. (this.isOpen = !0));
  2378. }),
  2379. (this.hide = function () {
  2380. this.isOpen &&
  2381. ((this.getElement().style.display = "none"), (this.isOpen = !1));
  2382. }),
  2383. (this.getHeight = function () {
  2384. return this.getElement().offsetHeight;
  2385. }),
  2386. (this.getWidth = function () {
  2387. return this.getElement().offsetWidth;
  2388. }),
  2389. (this.destroy = function () {
  2390. (this.isOpen = !1),
  2391. this.$element &&
  2392. this.$element.parentNode &&
  2393. this.$element.parentNode.removeChild(this.$element);
  2394. });
  2395. }).call(s.prototype),
  2396. (t.Tooltip = s);
  2397. }
  2398. ),
  2399. define(
  2400. "ace/mouse/default_gutter_handler",
  2401. [
  2402. "require",
  2403. "exports",
  2404. "module",
  2405. "ace/lib/dom",
  2406. "ace/lib/oop",
  2407. "ace/lib/event",
  2408. "ace/tooltip",
  2409. ],
  2410. function (e, t, n) {
  2411. "use strict";
  2412. function u(e) {
  2413. function l() {
  2414. var r = u.getDocumentPosition().row,
  2415. s = n.$annotations[r];
  2416. if (!s) return c();
  2417. var o = t.session.getLength();
  2418. if (r == o) {
  2419. var a = t.renderer.pixelToScreenCoordinates(0, u.y).row,
  2420. l = u.$pos;
  2421. if (a > t.session.documentToScreenRow(l.row, l.column)) return c();
  2422. }
  2423. if (f == s) return;
  2424. (f = s.text.join("<br/>")),
  2425. i.setHtml(f),
  2426. i.show(),
  2427. t._signal("showGutterTooltip", i),
  2428. t.on("mousewheel", c);
  2429. if (e.$tooltipFollowsMouse) h(u);
  2430. else {
  2431. var p = u.domEvent.target,
  2432. d = p.getBoundingClientRect(),
  2433. v = i.getElement().style;
  2434. (v.left = d.right + "px"), (v.top = d.bottom + "px");
  2435. }
  2436. }
  2437. function c() {
  2438. o && (o = clearTimeout(o)),
  2439. f &&
  2440. (i.hide(),
  2441. (f = null),
  2442. t._signal("hideGutterTooltip", i),
  2443. t.removeEventListener("mousewheel", c));
  2444. }
  2445. function h(e) {
  2446. i.setPosition(e.x, e.y);
  2447. }
  2448. var t = e.editor,
  2449. n = t.renderer.$gutterLayer,
  2450. i = new a(t.container);
  2451. e.editor.setDefaultHandler("guttermousedown", function (r) {
  2452. if (!t.isFocused() || r.getButton() != 0) return;
  2453. var i = n.getRegion(r);
  2454. if (i == "foldWidgets") return;
  2455. var s = r.getDocumentPosition().row,
  2456. o = t.session.selection;
  2457. if (r.getShiftKey()) o.selectTo(s, 0);
  2458. else {
  2459. if (r.domEvent.detail == 2)
  2460. return t.selectAll(), r.preventDefault();
  2461. e.$clickSelection = t.selection.getLineRange(s);
  2462. }
  2463. return (
  2464. e.setState("selectByLines"), e.captureMouse(r), r.preventDefault()
  2465. );
  2466. });
  2467. var o, u, f;
  2468. e.editor.setDefaultHandler("guttermousemove", function (t) {
  2469. var n = t.domEvent.target || t.domEvent.srcElement;
  2470. if (r.hasCssClass(n, "ace_fold-widget")) return c();
  2471. f && e.$tooltipFollowsMouse && h(t), (u = t);
  2472. if (o) return;
  2473. o = setTimeout(function () {
  2474. (o = null), u && !e.isMousePressed ? l() : c();
  2475. }, 50);
  2476. }),
  2477. s.addListener(t.renderer.$gutter, "mouseout", function (e) {
  2478. u = null;
  2479. if (!f || o) return;
  2480. o = setTimeout(function () {
  2481. (o = null), c();
  2482. }, 50);
  2483. }),
  2484. t.on("changeSession", c);
  2485. }
  2486. function a(e) {
  2487. o.call(this, e);
  2488. }
  2489. var r = e("../lib/dom"),
  2490. i = e("../lib/oop"),
  2491. s = e("../lib/event"),
  2492. o = e("../tooltip").Tooltip;
  2493. i.inherits(a, o),
  2494. function () {
  2495. this.setPosition = function (e, t) {
  2496. var n = window.innerWidth || document.documentElement.clientWidth,
  2497. r = window.innerHeight || document.documentElement.clientHeight,
  2498. i = this.getWidth(),
  2499. s = this.getHeight();
  2500. (e += 15),
  2501. (t += 15),
  2502. e + i > n && (e -= e + i - n),
  2503. t + s > r && (t -= 20 + s),
  2504. o.prototype.setPosition.call(this, e, t);
  2505. };
  2506. }.call(a.prototype),
  2507. (t.GutterHandler = u);
  2508. }
  2509. ),
  2510. define(
  2511. "ace/mouse/mouse_event",
  2512. ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent"],
  2513. function (e, t, n) {
  2514. "use strict";
  2515. var r = e("../lib/event"),
  2516. i = e("../lib/useragent"),
  2517. s = (t.MouseEvent = function (e, t) {
  2518. (this.domEvent = e),
  2519. (this.editor = t),
  2520. (this.x = this.clientX = e.clientX),
  2521. (this.y = this.clientY = e.clientY),
  2522. (this.$pos = null),
  2523. (this.$inSelection = null),
  2524. (this.propagationStopped = !1),
  2525. (this.defaultPrevented = !1);
  2526. });
  2527. (function () {
  2528. (this.stopPropagation = function () {
  2529. r.stopPropagation(this.domEvent), (this.propagationStopped = !0);
  2530. }),
  2531. (this.preventDefault = function () {
  2532. r.preventDefault(this.domEvent), (this.defaultPrevented = !0);
  2533. }),
  2534. (this.stop = function () {
  2535. this.stopPropagation(), this.preventDefault();
  2536. }),
  2537. (this.getDocumentPosition = function () {
  2538. return this.$pos
  2539. ? this.$pos
  2540. : ((this.$pos = this.editor.renderer.screenToTextCoordinates(
  2541. this.clientX,
  2542. this.clientY
  2543. )),
  2544. this.$pos);
  2545. }),
  2546. (this.inSelection = function () {
  2547. if (this.$inSelection !== null) return this.$inSelection;
  2548. var e = this.editor,
  2549. t = e.getSelectionRange();
  2550. if (t.isEmpty()) this.$inSelection = !1;
  2551. else {
  2552. var n = this.getDocumentPosition();
  2553. this.$inSelection = t.contains(n.row, n.column);
  2554. }
  2555. return this.$inSelection;
  2556. }),
  2557. (this.getButton = function () {
  2558. return r.getButton(this.domEvent);
  2559. }),
  2560. (this.getShiftKey = function () {
  2561. return this.domEvent.shiftKey;
  2562. }),
  2563. (this.getAccelKey = i.isMac
  2564. ? function () {
  2565. return this.domEvent.metaKey;
  2566. }
  2567. : function () {
  2568. return this.domEvent.ctrlKey;
  2569. });
  2570. }).call(s.prototype);
  2571. }
  2572. ),
  2573. define(
  2574. "ace/mouse/dragdrop_handler",
  2575. [
  2576. "require",
  2577. "exports",
  2578. "module",
  2579. "ace/lib/dom",
  2580. "ace/lib/event",
  2581. "ace/lib/useragent",
  2582. ],
  2583. function (e, t, n) {
  2584. "use strict";
  2585. function f(e) {
  2586. function T(e, n) {
  2587. var r = Date.now(),
  2588. i = !n || e.row != n.row,
  2589. s = !n || e.column != n.column;
  2590. if (!S || i || s)
  2591. t.moveCursorToPosition(e), (S = r), (x = { x: p, y: d });
  2592. else {
  2593. var o = l(x.x, x.y, p, d);
  2594. o > a
  2595. ? (S = null)
  2596. : r - S >= u && (t.renderer.scrollCursorIntoView(), (S = null));
  2597. }
  2598. }
  2599. function N(e, n) {
  2600. var r = Date.now(),
  2601. i = t.renderer.layerConfig.lineHeight,
  2602. s = t.renderer.layerConfig.characterWidth,
  2603. u = t.renderer.scroller.getBoundingClientRect(),
  2604. a = {
  2605. x: { left: p - u.left, right: u.right - p },
  2606. y: { top: d - u.top, bottom: u.bottom - d },
  2607. },
  2608. f = Math.min(a.x.left, a.x.right),
  2609. l = Math.min(a.y.top, a.y.bottom),
  2610. c = { row: e.row, column: e.column };
  2611. f / s <= 2 && (c.column += a.x.left < a.x.right ? -3 : 2),
  2612. l / i <= 1 && (c.row += a.y.top < a.y.bottom ? -1 : 1);
  2613. var h = e.row != c.row,
  2614. v = e.column != c.column,
  2615. m = !n || e.row != n.row;
  2616. h || (v && !m)
  2617. ? E
  2618. ? r - E >= o && t.renderer.scrollCursorIntoView(c)
  2619. : (E = r)
  2620. : (E = null);
  2621. }
  2622. function C() {
  2623. var e = g;
  2624. (g = t.renderer.screenToTextCoordinates(p, d)), T(g, e), N(g, e);
  2625. }
  2626. function k() {
  2627. (m = t.selection.toOrientedRange()),
  2628. (h = t.session.addMarker(
  2629. m,
  2630. "ace_selection",
  2631. t.getSelectionStyle()
  2632. )),
  2633. t.clearSelection(),
  2634. t.isFocused() && t.renderer.$cursorLayer.setBlinking(!1),
  2635. clearInterval(v),
  2636. C(),
  2637. (v = setInterval(C, 20)),
  2638. (y = 0),
  2639. i.addListener(document, "mousemove", O);
  2640. }
  2641. function L() {
  2642. clearInterval(v),
  2643. t.session.removeMarker(h),
  2644. (h = null),
  2645. t.selection.fromOrientedRange(m),
  2646. t.isFocused() &&
  2647. !w &&
  2648. t.renderer.$cursorLayer.setBlinking(!t.getReadOnly()),
  2649. (m = null),
  2650. (g = null),
  2651. (y = 0),
  2652. (E = null),
  2653. (S = null),
  2654. i.removeListener(document, "mousemove", O);
  2655. }
  2656. function O() {
  2657. A == null &&
  2658. (A = setTimeout(function () {
  2659. A != null && h && L();
  2660. }, 20));
  2661. }
  2662. function M(e) {
  2663. var t = e.types;
  2664. return (
  2665. !t ||
  2666. Array.prototype.some.call(t, function (e) {
  2667. return e == "text/plain" || e == "Text";
  2668. })
  2669. );
  2670. }
  2671. function _(e) {
  2672. var t = ["copy", "copymove", "all", "uninitialized"],
  2673. n = ["move", "copymove", "linkmove", "all", "uninitialized"],
  2674. r = s.isMac ? e.altKey : e.ctrlKey,
  2675. i = "uninitialized";
  2676. try {
  2677. i = e.dataTransfer.effectAllowed.toLowerCase();
  2678. } catch (e) {}
  2679. var o = "none";
  2680. return (
  2681. r && t.indexOf(i) >= 0
  2682. ? (o = "copy")
  2683. : n.indexOf(i) >= 0
  2684. ? (o = "move")
  2685. : t.indexOf(i) >= 0 && (o = "copy"),
  2686. o
  2687. );
  2688. }
  2689. var t = e.editor,
  2690. n = r.createElement("img");
  2691. (n.src =
  2692. "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),
  2693. s.isOpera &&
  2694. (n.style.cssText =
  2695. "width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");
  2696. var f = [
  2697. "dragWait",
  2698. "dragWaitEnd",
  2699. "startDrag",
  2700. "dragReadyEnd",
  2701. "onMouseDrag",
  2702. ];
  2703. f.forEach(function (t) {
  2704. e[t] = this[t];
  2705. }, this),
  2706. t.addEventListener("mousedown", this.onMouseDown.bind(e));
  2707. var c = t.container,
  2708. h,
  2709. p,
  2710. d,
  2711. v,
  2712. m,
  2713. g,
  2714. y = 0,
  2715. b,
  2716. w,
  2717. E,
  2718. S,
  2719. x;
  2720. (this.onDragStart = function (e) {
  2721. if (this.cancelDrag || !c.draggable) {
  2722. var r = this;
  2723. return (
  2724. setTimeout(function () {
  2725. r.startSelect(), r.captureMouse(e);
  2726. }, 0),
  2727. e.preventDefault()
  2728. );
  2729. }
  2730. m = t.getSelectionRange();
  2731. var i = e.dataTransfer;
  2732. (i.effectAllowed = t.getReadOnly() ? "copy" : "copyMove"),
  2733. s.isOpera && (t.container.appendChild(n), (n.scrollTop = 0)),
  2734. i.setDragImage && i.setDragImage(n, 0, 0),
  2735. s.isOpera && t.container.removeChild(n),
  2736. i.clearData(),
  2737. i.setData("Text", t.session.getTextRange()),
  2738. (w = !0),
  2739. this.setState("drag");
  2740. }),
  2741. (this.onDragEnd = function (e) {
  2742. (c.draggable = !1), (w = !1), this.setState(null);
  2743. if (!t.getReadOnly()) {
  2744. var n = e.dataTransfer.dropEffect;
  2745. !b && n == "move" && t.session.remove(t.getSelectionRange()),
  2746. t.renderer.$cursorLayer.setBlinking(!0);
  2747. }
  2748. this.editor.unsetStyle("ace_dragging"),
  2749. this.editor.renderer.setCursorStyle("");
  2750. }),
  2751. (this.onDragEnter = function (e) {
  2752. if (t.getReadOnly() || !M(e.dataTransfer)) return;
  2753. return (
  2754. (p = e.clientX),
  2755. (d = e.clientY),
  2756. h || k(),
  2757. y++,
  2758. (e.dataTransfer.dropEffect = b = _(e)),
  2759. i.preventDefault(e)
  2760. );
  2761. }),
  2762. (this.onDragOver = function (e) {
  2763. if (t.getReadOnly() || !M(e.dataTransfer)) return;
  2764. return (
  2765. (p = e.clientX),
  2766. (d = e.clientY),
  2767. h || (k(), y++),
  2768. A !== null && (A = null),
  2769. (e.dataTransfer.dropEffect = b = _(e)),
  2770. i.preventDefault(e)
  2771. );
  2772. }),
  2773. (this.onDragLeave = function (e) {
  2774. y--;
  2775. if (y <= 0 && h) return L(), (b = null), i.preventDefault(e);
  2776. }),
  2777. (this.onDrop = function (e) {
  2778. if (!g) return;
  2779. var n = e.dataTransfer;
  2780. if (w)
  2781. switch (b) {
  2782. case "move":
  2783. m.contains(g.row, g.column)
  2784. ? (m = { start: g, end: g })
  2785. : (m = t.moveText(m, g));
  2786. break;
  2787. case "copy":
  2788. m = t.moveText(m, g, !0);
  2789. }
  2790. else {
  2791. var r = n.getData("Text");
  2792. (m = { start: g, end: t.session.insert(g, r) }),
  2793. t.focus(),
  2794. (b = null);
  2795. }
  2796. return L(), i.preventDefault(e);
  2797. }),
  2798. i.addListener(c, "dragstart", this.onDragStart.bind(e)),
  2799. i.addListener(c, "dragend", this.onDragEnd.bind(e)),
  2800. i.addListener(c, "dragenter", this.onDragEnter.bind(e)),
  2801. i.addListener(c, "dragover", this.onDragOver.bind(e)),
  2802. i.addListener(c, "dragleave", this.onDragLeave.bind(e)),
  2803. i.addListener(c, "drop", this.onDrop.bind(e));
  2804. var A = null;
  2805. }
  2806. function l(e, t, n, r) {
  2807. return Math.sqrt(Math.pow(n - e, 2) + Math.pow(r - t, 2));
  2808. }
  2809. var r = e("../lib/dom"),
  2810. i = e("../lib/event"),
  2811. s = e("../lib/useragent"),
  2812. o = 200,
  2813. u = 200,
  2814. a = 5;
  2815. (function () {
  2816. (this.dragWait = function () {
  2817. var e = Date.now() - this.mousedownEvent.time;
  2818. e > this.editor.getDragDelay() && this.startDrag();
  2819. }),
  2820. (this.dragWaitEnd = function () {
  2821. var e = this.editor.container;
  2822. (e.draggable = !1),
  2823. this.startSelect(this.mousedownEvent.getDocumentPosition()),
  2824. this.selectEnd();
  2825. }),
  2826. (this.dragReadyEnd = function (e) {
  2827. this.editor.renderer.$cursorLayer.setBlinking(
  2828. !this.editor.getReadOnly()
  2829. ),
  2830. this.editor.unsetStyle("ace_dragging"),
  2831. this.editor.renderer.setCursorStyle(""),
  2832. this.dragWaitEnd();
  2833. }),
  2834. (this.startDrag = function () {
  2835. this.cancelDrag = !1;
  2836. var e = this.editor,
  2837. t = e.container;
  2838. (t.draggable = !0),
  2839. e.renderer.$cursorLayer.setBlinking(!1),
  2840. e.setStyle("ace_dragging");
  2841. var n = s.isWin ? "default" : "move";
  2842. e.renderer.setCursorStyle(n), this.setState("dragReady");
  2843. }),
  2844. (this.onMouseDrag = function (e) {
  2845. var t = this.editor.container;
  2846. if (s.isIE && this.state == "dragReady") {
  2847. var n = l(
  2848. this.mousedownEvent.x,
  2849. this.mousedownEvent.y,
  2850. this.x,
  2851. this.y
  2852. );
  2853. n > 3 && t.dragDrop();
  2854. }
  2855. if (this.state === "dragWait") {
  2856. var n = l(
  2857. this.mousedownEvent.x,
  2858. this.mousedownEvent.y,
  2859. this.x,
  2860. this.y
  2861. );
  2862. n > 0 &&
  2863. ((t.draggable = !1),
  2864. this.startSelect(this.mousedownEvent.getDocumentPosition()));
  2865. }
  2866. }),
  2867. (this.onMouseDown = function (e) {
  2868. if (!this.$dragEnabled) return;
  2869. this.mousedownEvent = e;
  2870. var t = this.editor,
  2871. n = e.inSelection(),
  2872. r = e.getButton(),
  2873. i = e.domEvent.detail || 1;
  2874. if (i === 1 && r === 0 && n) {
  2875. if (
  2876. e.editor.inMultiSelectMode &&
  2877. (e.getAccelKey() || e.getShiftKey())
  2878. )
  2879. return;
  2880. this.mousedownEvent.time = Date.now();
  2881. var o = e.domEvent.target || e.domEvent.srcElement;
  2882. "unselectable" in o && (o.unselectable = "on");
  2883. if (t.getDragDelay()) {
  2884. if (s.isWebKit) {
  2885. this.cancelDrag = !0;
  2886. var u = t.container;
  2887. u.draggable = !0;
  2888. }
  2889. this.setState("dragWait");
  2890. } else this.startDrag();
  2891. this.captureMouse(e, this.onMouseDrag.bind(this)),
  2892. (e.defaultPrevented = !0);
  2893. }
  2894. });
  2895. }).call(f.prototype),
  2896. (t.DragdropHandler = f);
  2897. }
  2898. ),
  2899. define(
  2900. "ace/lib/net",
  2901. ["require", "exports", "module", "ace/lib/dom"],
  2902. function (e, t, n) {
  2903. "use strict";
  2904. var r = e("./dom");
  2905. (t.get = function (e, t) {
  2906. var n = new XMLHttpRequest();
  2907. n.open("GET", e, !0),
  2908. (n.onreadystatechange = function () {
  2909. n.readyState === 4 && t(n.responseText);
  2910. }),
  2911. n.send(null);
  2912. }),
  2913. (t.loadScript = function (e, t) {
  2914. var n = r.getDocumentHead(),
  2915. i = document.createElement("script");
  2916. (i.src = e),
  2917. n.appendChild(i),
  2918. (i.onload = i.onreadystatechange =
  2919. function (e, n) {
  2920. if (
  2921. n ||
  2922. !i.readyState ||
  2923. i.readyState == "loaded" ||
  2924. i.readyState == "complete"
  2925. )
  2926. (i = i.onload = i.onreadystatechange = null), n || t();
  2927. });
  2928. }),
  2929. (t.qualifyURL = function (e) {
  2930. var t = document.createElement("a");
  2931. return (t.href = e), t.href;
  2932. });
  2933. }
  2934. ),
  2935. define(
  2936. "ace/lib/event_emitter",
  2937. ["require", "exports", "module"],
  2938. function (e, t, n) {
  2939. "use strict";
  2940. var r = {},
  2941. i = function () {
  2942. this.propagationStopped = !0;
  2943. },
  2944. s = function () {
  2945. this.defaultPrevented = !0;
  2946. };
  2947. (r._emit = r._dispatchEvent =
  2948. function (e, t) {
  2949. this._eventRegistry || (this._eventRegistry = {}),
  2950. this._defaultHandlers || (this._defaultHandlers = {});
  2951. var n = this._eventRegistry[e] || [],
  2952. r = this._defaultHandlers[e];
  2953. if (!n.length && !r) return;
  2954. if (typeof t != "object" || !t) t = {};
  2955. t.type || (t.type = e),
  2956. t.stopPropagation || (t.stopPropagation = i),
  2957. t.preventDefault || (t.preventDefault = s),
  2958. (n = n.slice());
  2959. for (var o = 0; o < n.length; o++) {
  2960. n[o](t, this);
  2961. if (t.propagationStopped) break;
  2962. }
  2963. if (r && !t.defaultPrevented) return r(t, this);
  2964. }),
  2965. (r._signal = function (e, t) {
  2966. var n = (this._eventRegistry || {})[e];
  2967. if (!n) return;
  2968. n = n.slice();
  2969. for (var r = 0; r < n.length; r++) n[r](t, this);
  2970. }),
  2971. (r.once = function (e, t) {
  2972. var n = this;
  2973. this.addEventListener(e, function r() {
  2974. n.removeEventListener(e, r), t.apply(null, arguments);
  2975. });
  2976. if (!t)
  2977. return new Promise(function (e) {
  2978. t = e;
  2979. });
  2980. }),
  2981. (r.setDefaultHandler = function (e, t) {
  2982. var n = this._defaultHandlers;
  2983. n || (n = this._defaultHandlers = { _disabled_: {} });
  2984. if (n[e]) {
  2985. var r = n[e],
  2986. i = n._disabled_[e];
  2987. i || (n._disabled_[e] = i = []), i.push(r);
  2988. var s = i.indexOf(t);
  2989. s != -1 && i.splice(s, 1);
  2990. }
  2991. n[e] = t;
  2992. }),
  2993. (r.removeDefaultHandler = function (e, t) {
  2994. var n = this._defaultHandlers;
  2995. if (!n) return;
  2996. var r = n._disabled_[e];
  2997. if (n[e] == t) r && this.setDefaultHandler(e, r.pop());
  2998. else if (r) {
  2999. var i = r.indexOf(t);
  3000. i != -1 && r.splice(i, 1);
  3001. }
  3002. }),
  3003. (r.on = r.addEventListener =
  3004. function (e, t, n) {
  3005. this._eventRegistry = this._eventRegistry || {};
  3006. var r = this._eventRegistry[e];
  3007. return (
  3008. r || (r = this._eventRegistry[e] = []),
  3009. r.indexOf(t) == -1 && r[n ? "unshift" : "push"](t),
  3010. t
  3011. );
  3012. }),
  3013. (r.off =
  3014. r.removeListener =
  3015. r.removeEventListener =
  3016. function (e, t) {
  3017. this._eventRegistry = this._eventRegistry || {};
  3018. var n = this._eventRegistry[e];
  3019. if (!n) return;
  3020. var r = n.indexOf(t);
  3021. r !== -1 && n.splice(r, 1);
  3022. }),
  3023. (r.removeAllListeners = function (e) {
  3024. this._eventRegistry && (this._eventRegistry[e] = []);
  3025. }),
  3026. (t.EventEmitter = r);
  3027. }
  3028. ),
  3029. define(
  3030. "ace/lib/app_config",
  3031. ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"],
  3032. function (e, t, n) {
  3033. "no use strict";
  3034. function o(e) {
  3035. typeof console != "undefined" &&
  3036. console.warn &&
  3037. console.warn.apply(console, arguments);
  3038. }
  3039. function u(e, t) {
  3040. var n = new Error(e);
  3041. (n.data = t),
  3042. typeof console == "object" && console.error && console.error(n),
  3043. setTimeout(function () {
  3044. throw n;
  3045. });
  3046. }
  3047. var r = e("./oop"),
  3048. i = e("./event_emitter").EventEmitter,
  3049. s = {
  3050. setOptions: function (e) {
  3051. Object.keys(e).forEach(function (t) {
  3052. this.setOption(t, e[t]);
  3053. }, this);
  3054. },
  3055. getOptions: function (e) {
  3056. var t = {};
  3057. if (!e) {
  3058. var n = this.$options;
  3059. e = Object.keys(n).filter(function (e) {
  3060. return !n[e].hidden;
  3061. });
  3062. } else Array.isArray(e) || ((t = e), (e = Object.keys(t)));
  3063. return (
  3064. e.forEach(function (e) {
  3065. t[e] = this.getOption(e);
  3066. }, this),
  3067. t
  3068. );
  3069. },
  3070. setOption: function (e, t) {
  3071. if (this["$" + e] === t) return;
  3072. var n = this.$options[e];
  3073. if (!n) return o('misspelled option "' + e + '"');
  3074. if (n.forwardTo)
  3075. return this[n.forwardTo] && this[n.forwardTo].setOption(e, t);
  3076. n.handlesSet || (this["$" + e] = t),
  3077. n && n.set && n.set.call(this, t);
  3078. },
  3079. getOption: function (e) {
  3080. var t = this.$options[e];
  3081. return t
  3082. ? t.forwardTo
  3083. ? this[t.forwardTo] && this[t.forwardTo].getOption(e)
  3084. : t && t.get
  3085. ? t.get.call(this)
  3086. : this["$" + e]
  3087. : o('misspelled option "' + e + '"');
  3088. },
  3089. },
  3090. a = function () {
  3091. this.$defaultOptions = {};
  3092. };
  3093. (function () {
  3094. r.implement(this, i),
  3095. (this.defineOptions = function (e, t, n) {
  3096. return (
  3097. e.$options || (this.$defaultOptions[t] = e.$options = {}),
  3098. Object.keys(n).forEach(function (t) {
  3099. var r = n[t];
  3100. typeof r == "string" && (r = { forwardTo: r }),
  3101. r.name || (r.name = t),
  3102. (e.$options[r.name] = r),
  3103. "initialValue" in r && (e["$" + r.name] = r.initialValue);
  3104. }),
  3105. r.implement(e, s),
  3106. this
  3107. );
  3108. }),
  3109. (this.resetOptions = function (e) {
  3110. Object.keys(e.$options).forEach(function (t) {
  3111. var n = e.$options[t];
  3112. "value" in n && e.setOption(t, n.value);
  3113. });
  3114. }),
  3115. (this.setDefaultValue = function (e, t, n) {
  3116. var r = this.$defaultOptions[e] || (this.$defaultOptions[e] = {});
  3117. r[t] &&
  3118. (r.forwardTo
  3119. ? this.setDefaultValue(r.forwardTo, t, n)
  3120. : (r[t].value = n));
  3121. }),
  3122. (this.setDefaultValues = function (e, t) {
  3123. Object.keys(t).forEach(function (n) {
  3124. this.setDefaultValue(e, n, t[n]);
  3125. }, this);
  3126. }),
  3127. (this.warn = o),
  3128. (this.reportError = u);
  3129. }).call(a.prototype),
  3130. (t.AppConfig = a);
  3131. }
  3132. ),
  3133. define(
  3134. "ace/config",
  3135. [
  3136. "require",
  3137. "exports",
  3138. "module",
  3139. "ace/lib/lang",
  3140. "ace/lib/oop",
  3141. "ace/lib/net",
  3142. "ace/lib/app_config",
  3143. ],
  3144. function (e, t, n) {
  3145. "no use strict";
  3146. function l(r) {
  3147. if (!u || !u.document) return;
  3148. a.packaged =
  3149. r || e.packaged || n.packaged || (u.define && define.packaged);
  3150. var i = {},
  3151. s = "",
  3152. o = document.currentScript || document._currentScript,
  3153. f = (o && o.ownerDocument) || document,
  3154. l = f.getElementsByTagName("script");
  3155. for (var h = 0; h < l.length; h++) {
  3156. var p = l[h],
  3157. d = p.src || p.getAttribute("src");
  3158. if (!d) continue;
  3159. var v = p.attributes;
  3160. for (var m = 0, g = v.length; m < g; m++) {
  3161. var y = v[m];
  3162. y.name.indexOf("data-ace-") === 0 &&
  3163. (i[c(y.name.replace(/^data-ace-/, ""))] = y.value);
  3164. }
  3165. var b = d.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);
  3166. b && (s = b[1]);
  3167. }
  3168. s && ((i.base = i.base || s), (i.packaged = !0)),
  3169. (i.basePath = i.base),
  3170. (i.workerPath = i.workerPath || i.base),
  3171. (i.modePath = i.modePath || i.base),
  3172. (i.themePath = i.themePath || i.base),
  3173. delete i.base;
  3174. for (var w in i) typeof i[w] != "undefined" && t.set(w, i[w]);
  3175. }
  3176. function c(e) {
  3177. return e.replace(/-(.)/g, function (e, t) {
  3178. return t.toUpperCase();
  3179. });
  3180. }
  3181. var r = e("./lib/lang"),
  3182. i = e("./lib/oop"),
  3183. s = e("./lib/net"),
  3184. o = e("./lib/app_config").AppConfig;
  3185. n.exports = t = new o();
  3186. var u = (function () {
  3187. return this || (typeof window != "undefined" && window);
  3188. })(),
  3189. a = {
  3190. packaged: !1,
  3191. workerPath: null,
  3192. modePath: null,
  3193. themePath: null,
  3194. basePath: "",
  3195. suffix: ".js",
  3196. $moduleUrls: {},
  3197. };
  3198. (t.get = function (e) {
  3199. if (!a.hasOwnProperty(e)) throw new Error("Unknown config key: " + e);
  3200. return a[e];
  3201. }),
  3202. (t.set = function (e, t) {
  3203. if (!a.hasOwnProperty(e)) throw new Error("Unknown config key: " + e);
  3204. a[e] = t;
  3205. }),
  3206. (t.all = function () {
  3207. return r.copyObject(a);
  3208. }),
  3209. (t.$modes = {}),
  3210. (t.moduleUrl = function (e, t) {
  3211. if (a.$moduleUrls[e]) return a.$moduleUrls[e];
  3212. var n = e.split("/");
  3213. t = t || n[n.length - 2] || "";
  3214. var r = t == "snippets" ? "/" : "-",
  3215. i = n[n.length - 1];
  3216. if (t == "worker" && r == "-") {
  3217. var s = new RegExp("^" + t + "[\\-_]|[\\-_]" + t + "$", "g");
  3218. i = i.replace(s, "");
  3219. }
  3220. (!i || i == t) && n.length > 1 && (i = n[n.length - 2]);
  3221. var o = a[t + "Path"];
  3222. return (
  3223. o == null ? (o = a.basePath) : r == "/" && (t = r = ""),
  3224. o && o.slice(-1) != "/" && (o += "/"),
  3225. o + t + r + i + this.get("suffix")
  3226. );
  3227. }),
  3228. (t.setModuleUrl = function (e, t) {
  3229. return (a.$moduleUrls[e] = t);
  3230. }),
  3231. (t.$loading = {}),
  3232. (t.loadModule = function (n, r) {
  3233. var i, o;
  3234. Array.isArray(n) && ((o = n[0]), (n = n[1]));
  3235. try {
  3236. i = e(n);
  3237. } catch (u) {}
  3238. if (i && !t.$loading[n]) return r && r(i);
  3239. t.$loading[n] || (t.$loading[n] = []), t.$loading[n].push(r);
  3240. if (t.$loading[n].length > 1) return;
  3241. var a = function () {
  3242. e([n], function (e) {
  3243. t._emit("load.module", { name: n, module: e });
  3244. var r = t.$loading[n];
  3245. (t.$loading[n] = null),
  3246. r.forEach(function (t) {
  3247. t && t(e);
  3248. });
  3249. });
  3250. };
  3251. if (!t.get("packaged")) return a();
  3252. s.loadScript(t.moduleUrl(n, o), a), f();
  3253. });
  3254. var f = function () {
  3255. !a.basePath &&
  3256. !a.workerPath &&
  3257. !a.modePath &&
  3258. !a.themePath &&
  3259. !Object.keys(a.$moduleUrls).length &&
  3260. (console.error(
  3261. "Unable to infer path to ace from script src,",
  3262. "use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes",
  3263. "or with webpack use ace/webpack-resolver"
  3264. ),
  3265. (f = function () {}));
  3266. };
  3267. t.init = l;
  3268. }
  3269. ),
  3270. define(
  3271. "ace/mouse/mouse_handler",
  3272. [
  3273. "require",
  3274. "exports",
  3275. "module",
  3276. "ace/lib/event",
  3277. "ace/lib/useragent",
  3278. "ace/mouse/default_handlers",
  3279. "ace/mouse/default_gutter_handler",
  3280. "ace/mouse/mouse_event",
  3281. "ace/mouse/dragdrop_handler",
  3282. "ace/config",
  3283. ],
  3284. function (e, t, n) {
  3285. "use strict";
  3286. var r = e("../lib/event"),
  3287. i = e("../lib/useragent"),
  3288. s = e("./default_handlers").DefaultHandlers,
  3289. o = e("./default_gutter_handler").GutterHandler,
  3290. u = e("./mouse_event").MouseEvent,
  3291. a = e("./dragdrop_handler").DragdropHandler,
  3292. f = e("../config"),
  3293. l = function (e) {
  3294. var t = this;
  3295. (this.editor = e), new s(this), new o(this), new a(this);
  3296. var n = function (t) {
  3297. var n =
  3298. !document.hasFocus ||
  3299. !document.hasFocus() ||
  3300. (!e.isFocused() &&
  3301. document.activeElement ==
  3302. (e.textInput && e.textInput.getElement()));
  3303. n && window.focus(), e.focus();
  3304. },
  3305. u = e.renderer.getMouseEventTarget();
  3306. r.addListener(u, "click", this.onMouseEvent.bind(this, "click")),
  3307. r.addListener(
  3308. u,
  3309. "mousemove",
  3310. this.onMouseMove.bind(this, "mousemove")
  3311. ),
  3312. r.addMultiMouseDownListener(
  3313. [
  3314. u,
  3315. e.renderer.scrollBarV && e.renderer.scrollBarV.inner,
  3316. e.renderer.scrollBarH && e.renderer.scrollBarH.inner,
  3317. e.textInput && e.textInput.getElement(),
  3318. ].filter(Boolean),
  3319. [400, 300, 250],
  3320. this,
  3321. "onMouseEvent"
  3322. ),
  3323. r.addMouseWheelListener(
  3324. e.container,
  3325. this.onMouseWheel.bind(this, "mousewheel")
  3326. ),
  3327. r.addTouchMoveListener(
  3328. e.container,
  3329. this.onTouchMove.bind(this, "touchmove")
  3330. );
  3331. var f = e.renderer.$gutter;
  3332. r.addListener(
  3333. f,
  3334. "mousedown",
  3335. this.onMouseEvent.bind(this, "guttermousedown")
  3336. ),
  3337. r.addListener(
  3338. f,
  3339. "click",
  3340. this.onMouseEvent.bind(this, "gutterclick")
  3341. ),
  3342. r.addListener(
  3343. f,
  3344. "dblclick",
  3345. this.onMouseEvent.bind(this, "gutterdblclick")
  3346. ),
  3347. r.addListener(
  3348. f,
  3349. "mousemove",
  3350. this.onMouseEvent.bind(this, "guttermousemove")
  3351. ),
  3352. r.addListener(u, "mousedown", n),
  3353. r.addListener(f, "mousedown", n),
  3354. i.isIE &&
  3355. e.renderer.scrollBarV &&
  3356. (r.addListener(e.renderer.scrollBarV.element, "mousedown", n),
  3357. r.addListener(e.renderer.scrollBarH.element, "mousedown", n)),
  3358. e.on("mousemove", function (n) {
  3359. if (t.state || t.$dragDelay || !t.$dragEnabled) return;
  3360. var r = e.renderer.screenToTextCoordinates(n.x, n.y),
  3361. i = e.session.selection.getRange(),
  3362. s = e.renderer;
  3363. !i.isEmpty() && i.insideStart(r.row, r.column)
  3364. ? s.setCursorStyle("default")
  3365. : s.setCursorStyle("");
  3366. });
  3367. };
  3368. (function () {
  3369. (this.onMouseEvent = function (e, t) {
  3370. this.editor._emit(e, new u(t, this.editor));
  3371. }),
  3372. (this.onMouseMove = function (e, t) {
  3373. var n =
  3374. this.editor._eventRegistry &&
  3375. this.editor._eventRegistry.mousemove;
  3376. if (!n || !n.length) return;
  3377. this.editor._emit(e, new u(t, this.editor));
  3378. }),
  3379. (this.onMouseWheel = function (e, t) {
  3380. var n = new u(t, this.editor);
  3381. (n.speed = this.$scrollSpeed * 2),
  3382. (n.wheelX = t.wheelX),
  3383. (n.wheelY = t.wheelY),
  3384. this.editor._emit(e, n);
  3385. }),
  3386. (this.onTouchMove = function (e, t) {
  3387. var n = new u(t, this.editor);
  3388. (n.speed = 1),
  3389. (n.wheelX = t.wheelX),
  3390. (n.wheelY = t.wheelY),
  3391. this.editor._emit(e, n);
  3392. }),
  3393. (this.setState = function (e) {
  3394. this.state = e;
  3395. }),
  3396. (this.captureMouse = function (e, t) {
  3397. (this.x = e.x), (this.y = e.y), (this.isMousePressed = !0);
  3398. var n = this.editor,
  3399. s = this.editor.renderer;
  3400. s.$keepTextAreaAtCursor && (s.$keepTextAreaAtCursor = null);
  3401. var o = this,
  3402. a = function (e) {
  3403. if (!e) return;
  3404. if (i.isWebKit && !e.which && o.releaseMouse)
  3405. return o.releaseMouse();
  3406. (o.x = e.clientX),
  3407. (o.y = e.clientY),
  3408. t && t(e),
  3409. (o.mouseEvent = new u(e, o.editor)),
  3410. (o.$mouseMoved = !0);
  3411. },
  3412. f = function (e) {
  3413. n.off("beforeEndOperation", c),
  3414. clearInterval(h),
  3415. l(),
  3416. o[o.state + "End"] && o[o.state + "End"](e),
  3417. (o.state = ""),
  3418. s.$keepTextAreaAtCursor == null &&
  3419. ((s.$keepTextAreaAtCursor = !0), s.$moveTextAreaToCursor()),
  3420. (o.isMousePressed = !1),
  3421. (o.$onCaptureMouseMove = o.releaseMouse = null),
  3422. e && o.onMouseEvent("mouseup", e),
  3423. n.endOperation();
  3424. },
  3425. l = function () {
  3426. o[o.state] && o[o.state](), (o.$mouseMoved = !1);
  3427. };
  3428. if (i.isOldIE && e.domEvent.type == "dblclick")
  3429. return setTimeout(function () {
  3430. f(e);
  3431. });
  3432. var c = function (e) {
  3433. if (!o.releaseMouse) return;
  3434. n.curOp.command.name &&
  3435. n.curOp.selectionChanged &&
  3436. (o[o.state + "End"] && o[o.state + "End"](),
  3437. (o.state = ""),
  3438. o.releaseMouse());
  3439. };
  3440. n.on("beforeEndOperation", c),
  3441. n.startOperation({ command: { name: "mouse" } }),
  3442. (o.$onCaptureMouseMove = a),
  3443. (o.releaseMouse = r.capture(this.editor.container, a, f));
  3444. var h = setInterval(l, 20);
  3445. }),
  3446. (this.releaseMouse = null),
  3447. (this.cancelContextMenu = function () {
  3448. var e = function (t) {
  3449. if (t && t.domEvent && t.domEvent.type != "contextmenu") return;
  3450. this.editor.off("nativecontextmenu", e),
  3451. t && t.domEvent && r.stopEvent(t.domEvent);
  3452. }.bind(this);
  3453. setTimeout(e, 10), this.editor.on("nativecontextmenu", e);
  3454. });
  3455. }).call(l.prototype),
  3456. f.defineOptions(l.prototype, "mouseHandler", {
  3457. scrollSpeed: { initialValue: 2 },
  3458. dragDelay: { initialValue: i.isMac ? 150 : 0 },
  3459. dragEnabled: { initialValue: !0 },
  3460. focusTimeout: { initialValue: 0 },
  3461. tooltipFollowsMouse: { initialValue: !0 },
  3462. }),
  3463. (t.MouseHandler = l);
  3464. }
  3465. ),
  3466. define(
  3467. "ace/mouse/fold_handler",
  3468. ["require", "exports", "module", "ace/lib/dom"],
  3469. function (e, t, n) {
  3470. "use strict";
  3471. function i(e) {
  3472. e.on("click", function (t) {
  3473. var n = t.getDocumentPosition(),
  3474. i = e.session,
  3475. s = i.getFoldAt(n.row, n.column, 1);
  3476. s && (t.getAccelKey() ? i.removeFold(s) : i.expandFold(s), t.stop());
  3477. var o = t.domEvent && t.domEvent.target;
  3478. o &&
  3479. r.hasCssClass(o, "ace_inline_button") &&
  3480. r.hasCssClass(o, "ace_toggle_wrap") &&
  3481. (i.setOption("wrap", !0), e.renderer.scrollCursorIntoView());
  3482. }),
  3483. e.on("gutterclick", function (t) {
  3484. var n = e.renderer.$gutterLayer.getRegion(t);
  3485. if (n == "foldWidgets") {
  3486. var r = t.getDocumentPosition().row,
  3487. i = e.session;
  3488. i.foldWidgets &&
  3489. i.foldWidgets[r] &&
  3490. e.session.onFoldWidgetClick(r, t),
  3491. e.isFocused() || e.focus(),
  3492. t.stop();
  3493. }
  3494. }),
  3495. e.on("gutterdblclick", function (t) {
  3496. var n = e.renderer.$gutterLayer.getRegion(t);
  3497. if (n == "foldWidgets") {
  3498. var r = t.getDocumentPosition().row,
  3499. i = e.session,
  3500. s = i.getParentFoldRangeData(r, !0),
  3501. o = s.range || s.firstRange;
  3502. if (o) {
  3503. r = o.start.row;
  3504. var u = i.getFoldAt(r, i.getLine(r).length, 1);
  3505. u
  3506. ? i.removeFold(u)
  3507. : (i.addFold("...", o),
  3508. e.renderer.scrollCursorIntoView({
  3509. row: o.start.row,
  3510. column: 0,
  3511. }));
  3512. }
  3513. t.stop();
  3514. }
  3515. });
  3516. }
  3517. var r = e("../lib/dom");
  3518. t.FoldHandler = i;
  3519. }
  3520. ),
  3521. define(
  3522. "ace/keyboard/keybinding",
  3523. ["require", "exports", "module", "ace/lib/keys", "ace/lib/event"],
  3524. function (e, t, n) {
  3525. "use strict";
  3526. var r = e("../lib/keys"),
  3527. i = e("../lib/event"),
  3528. s = function (e) {
  3529. (this.$editor = e),
  3530. (this.$data = { editor: e }),
  3531. (this.$handlers = []),
  3532. this.setDefaultHandler(e.commands);
  3533. };
  3534. (function () {
  3535. (this.setDefaultHandler = function (e) {
  3536. this.removeKeyboardHandler(this.$defaultHandler),
  3537. (this.$defaultHandler = e),
  3538. this.addKeyboardHandler(e, 0);
  3539. }),
  3540. (this.setKeyboardHandler = function (e) {
  3541. var t = this.$handlers;
  3542. if (t[t.length - 1] == e) return;
  3543. while (t[t.length - 1] && t[t.length - 1] != this.$defaultHandler)
  3544. this.removeKeyboardHandler(t[t.length - 1]);
  3545. this.addKeyboardHandler(e, 1);
  3546. }),
  3547. (this.addKeyboardHandler = function (e, t) {
  3548. if (!e) return;
  3549. typeof e == "function" &&
  3550. !e.handleKeyboard &&
  3551. (e.handleKeyboard = e);
  3552. var n = this.$handlers.indexOf(e);
  3553. n != -1 && this.$handlers.splice(n, 1),
  3554. t == undefined
  3555. ? this.$handlers.push(e)
  3556. : this.$handlers.splice(t, 0, e),
  3557. n == -1 && e.attach && e.attach(this.$editor);
  3558. }),
  3559. (this.removeKeyboardHandler = function (e) {
  3560. var t = this.$handlers.indexOf(e);
  3561. return t == -1
  3562. ? !1
  3563. : (this.$handlers.splice(t, 1),
  3564. e.detach && e.detach(this.$editor),
  3565. !0);
  3566. }),
  3567. (this.getKeyboardHandler = function () {
  3568. return this.$handlers[this.$handlers.length - 1];
  3569. }),
  3570. (this.getStatusText = function () {
  3571. var e = this.$data,
  3572. t = e.editor;
  3573. return this.$handlers
  3574. .map(function (n) {
  3575. return (n.getStatusText && n.getStatusText(t, e)) || "";
  3576. })
  3577. .filter(Boolean)
  3578. .join(" ");
  3579. }),
  3580. (this.$callKeyboardHandlers = function (e, t, n, r) {
  3581. var s,
  3582. o = !1,
  3583. u = this.$editor.commands;
  3584. for (var a = this.$handlers.length; a--; ) {
  3585. s = this.$handlers[a].handleKeyboard(this.$data, e, t, n, r);
  3586. if (!s || !s.command) continue;
  3587. s.command == "null"
  3588. ? (o = !0)
  3589. : (o = u.exec(s.command, this.$editor, s.args, r)),
  3590. o &&
  3591. r &&
  3592. e != -1 &&
  3593. s.passEvent != 1 &&
  3594. s.command.passEvent != 1 &&
  3595. i.stopEvent(r);
  3596. if (o) break;
  3597. }
  3598. return (
  3599. !o &&
  3600. e == -1 &&
  3601. ((s = { command: "insertstring" }),
  3602. (o = u.exec("insertstring", this.$editor, t))),
  3603. o &&
  3604. this.$editor._signal &&
  3605. this.$editor._signal("keyboardActivity", s),
  3606. o
  3607. );
  3608. }),
  3609. (this.onCommandKey = function (e, t, n) {
  3610. var i = r.keyCodeToString(n);
  3611. this.$callKeyboardHandlers(t, i, n, e);
  3612. }),
  3613. (this.onTextInput = function (e) {
  3614. this.$callKeyboardHandlers(-1, e);
  3615. });
  3616. }).call(s.prototype),
  3617. (t.KeyBinding = s);
  3618. }
  3619. ),
  3620. define(
  3621. "ace/lib/bidiutil",
  3622. ["require", "exports", "module"],
  3623. function (e, t, n) {
  3624. "use strict";
  3625. function F(e, t, n, r) {
  3626. var i = s ? d : p,
  3627. c = null,
  3628. h = null,
  3629. v = null,
  3630. m = 0,
  3631. g = null,
  3632. y = null,
  3633. b = -1,
  3634. w = null,
  3635. E = null,
  3636. T = [];
  3637. if (!r) for (w = 0, r = []; w < n; w++) r[w] = R(e[w]);
  3638. (o = s), (u = !1), (a = !1), (f = !1), (l = !1);
  3639. for (E = 0; E < n; E++) {
  3640. (c = m),
  3641. (T[E] = h = q(e, r, T, E)),
  3642. (m = i[c][h]),
  3643. (g = m & 240),
  3644. (m &= 15),
  3645. (t[E] = v = i[m][5]);
  3646. if (g > 0)
  3647. if (g == 16) {
  3648. for (w = b; w < E; w++) t[w] = 1;
  3649. b = -1;
  3650. } else b = -1;
  3651. y = i[m][6];
  3652. if (y) b == -1 && (b = E);
  3653. else if (b > -1) {
  3654. for (w = b; w < E; w++) t[w] = v;
  3655. b = -1;
  3656. }
  3657. r[E] == S && (t[E] = 0), (o |= v);
  3658. }
  3659. if (l)
  3660. for (w = 0; w < n; w++)
  3661. if (r[w] == x) {
  3662. t[w] = s;
  3663. for (var C = w - 1; C >= 0; C--) {
  3664. if (r[C] != N) break;
  3665. t[C] = s;
  3666. }
  3667. }
  3668. }
  3669. function I(e, t, n) {
  3670. if (o < e) return;
  3671. if (e == 1 && s == m && !f) {
  3672. n.reverse();
  3673. return;
  3674. }
  3675. var r = n.length,
  3676. i = 0,
  3677. u,
  3678. a,
  3679. l,
  3680. c;
  3681. while (i < r) {
  3682. if (t[i] >= e) {
  3683. u = i + 1;
  3684. while (u < r && t[u] >= e) u++;
  3685. for (a = i, l = u - 1; a < l; a++, l--)
  3686. (c = n[a]), (n[a] = n[l]), (n[l] = c);
  3687. i = u;
  3688. }
  3689. i++;
  3690. }
  3691. }
  3692. function q(e, t, n, r) {
  3693. var i = t[r],
  3694. o,
  3695. c,
  3696. h,
  3697. p;
  3698. switch (i) {
  3699. case g:
  3700. case y:
  3701. u = !1;
  3702. case E:
  3703. case w:
  3704. return i;
  3705. case b:
  3706. return u ? w : b;
  3707. case T:
  3708. return (u = !0), (a = !0), y;
  3709. case N:
  3710. return E;
  3711. case C:
  3712. if (
  3713. r < 1 ||
  3714. r + 1 >= t.length ||
  3715. ((o = n[r - 1]) != b && o != w) ||
  3716. ((c = t[r + 1]) != b && c != w)
  3717. )
  3718. return E;
  3719. return u && (c = w), c == o ? c : E;
  3720. case k:
  3721. o = r > 0 ? n[r - 1] : S;
  3722. if (o == b && r + 1 < t.length && t[r + 1] == b) return b;
  3723. return E;
  3724. case L:
  3725. if (r > 0 && n[r - 1] == b) return b;
  3726. if (u) return E;
  3727. (p = r + 1), (h = t.length);
  3728. while (p < h && t[p] == L) p++;
  3729. if (p < h && t[p] == b) return b;
  3730. return E;
  3731. case A:
  3732. (h = t.length), (p = r + 1);
  3733. while (p < h && t[p] == A) p++;
  3734. if (p < h) {
  3735. var d = e[r],
  3736. v = (d >= 1425 && d <= 2303) || d == 64286;
  3737. o = t[p];
  3738. if (v && (o == y || o == T)) return y;
  3739. }
  3740. if (r < 1 || (o = t[r - 1]) == S) return E;
  3741. return n[r - 1];
  3742. case S:
  3743. return (u = !1), (f = !0), s;
  3744. case x:
  3745. return (l = !0), E;
  3746. case O:
  3747. case M:
  3748. case D:
  3749. case P:
  3750. case _:
  3751. u = !1;
  3752. case H:
  3753. return E;
  3754. }
  3755. }
  3756. function R(e) {
  3757. var t = e.charCodeAt(0),
  3758. n = t >> 8;
  3759. return n == 0
  3760. ? t > 191
  3761. ? g
  3762. : B[t]
  3763. : n == 5
  3764. ? /[\u0591-\u05f4]/.test(e)
  3765. ? y
  3766. : g
  3767. : n == 6
  3768. ? /[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)
  3769. ? A
  3770. : /[\u0660-\u0669\u066b-\u066c]/.test(e)
  3771. ? w
  3772. : t == 1642
  3773. ? L
  3774. : /[\u06f0-\u06f9]/.test(e)
  3775. ? b
  3776. : T
  3777. : n == 32 && t <= 8287
  3778. ? j[t & 255]
  3779. : n == 254
  3780. ? t >= 65136
  3781. ? T
  3782. : E
  3783. : E;
  3784. }
  3785. function U(e) {
  3786. return e >= "\u064b" && e <= "\u0655";
  3787. }
  3788. var r = ["\u0621", "\u0641"],
  3789. i = ["\u063a", "\u064a"],
  3790. s = 0,
  3791. o = 0,
  3792. u = !1,
  3793. a = !1,
  3794. f = !1,
  3795. l = !1,
  3796. c = !1,
  3797. h = !1,
  3798. p = [
  3799. [0, 3, 0, 1, 0, 0, 0],
  3800. [0, 3, 0, 1, 2, 2, 0],
  3801. [0, 3, 0, 17, 2, 0, 1],
  3802. [0, 3, 5, 5, 4, 1, 0],
  3803. [0, 3, 21, 21, 4, 0, 1],
  3804. [0, 3, 5, 5, 4, 2, 0],
  3805. ],
  3806. d = [
  3807. [2, 0, 1, 1, 0, 1, 0],
  3808. [2, 0, 1, 1, 0, 2, 0],
  3809. [2, 0, 2, 1, 3, 2, 0],
  3810. [2, 0, 2, 33, 3, 1, 1],
  3811. ],
  3812. v = 0,
  3813. m = 1,
  3814. g = 0,
  3815. y = 1,
  3816. b = 2,
  3817. w = 3,
  3818. E = 4,
  3819. S = 5,
  3820. x = 6,
  3821. T = 7,
  3822. N = 8,
  3823. C = 9,
  3824. k = 10,
  3825. L = 11,
  3826. A = 12,
  3827. O = 13,
  3828. M = 14,
  3829. _ = 15,
  3830. D = 16,
  3831. P = 17,
  3832. H = 18,
  3833. B = [
  3834. H,
  3835. H,
  3836. H,
  3837. H,
  3838. H,
  3839. H,
  3840. H,
  3841. H,
  3842. H,
  3843. x,
  3844. S,
  3845. x,
  3846. N,
  3847. S,
  3848. H,
  3849. H,
  3850. H,
  3851. H,
  3852. H,
  3853. H,
  3854. H,
  3855. H,
  3856. H,
  3857. H,
  3858. H,
  3859. H,
  3860. H,
  3861. H,
  3862. S,
  3863. S,
  3864. S,
  3865. x,
  3866. N,
  3867. E,
  3868. E,
  3869. L,
  3870. L,
  3871. L,
  3872. E,
  3873. E,
  3874. E,
  3875. E,
  3876. E,
  3877. k,
  3878. C,
  3879. k,
  3880. C,
  3881. C,
  3882. b,
  3883. b,
  3884. b,
  3885. b,
  3886. b,
  3887. b,
  3888. b,
  3889. b,
  3890. b,
  3891. b,
  3892. C,
  3893. E,
  3894. E,
  3895. E,
  3896. E,
  3897. E,
  3898. E,
  3899. g,
  3900. g,
  3901. g,
  3902. g,
  3903. g,
  3904. g,
  3905. g,
  3906. g,
  3907. g,
  3908. g,
  3909. g,
  3910. g,
  3911. g,
  3912. g,
  3913. g,
  3914. g,
  3915. g,
  3916. g,
  3917. g,
  3918. g,
  3919. g,
  3920. g,
  3921. g,
  3922. g,
  3923. g,
  3924. g,
  3925. E,
  3926. E,
  3927. E,
  3928. E,
  3929. E,
  3930. E,
  3931. g,
  3932. g,
  3933. g,
  3934. g,
  3935. g,
  3936. g,
  3937. g,
  3938. g,
  3939. g,
  3940. g,
  3941. g,
  3942. g,
  3943. g,
  3944. g,
  3945. g,
  3946. g,
  3947. g,
  3948. g,
  3949. g,
  3950. g,
  3951. g,
  3952. g,
  3953. g,
  3954. g,
  3955. g,
  3956. g,
  3957. E,
  3958. E,
  3959. E,
  3960. E,
  3961. H,
  3962. H,
  3963. H,
  3964. H,
  3965. H,
  3966. H,
  3967. S,
  3968. H,
  3969. H,
  3970. H,
  3971. H,
  3972. H,
  3973. H,
  3974. H,
  3975. H,
  3976. H,
  3977. H,
  3978. H,
  3979. H,
  3980. H,
  3981. H,
  3982. H,
  3983. H,
  3984. H,
  3985. H,
  3986. H,
  3987. H,
  3988. H,
  3989. H,
  3990. H,
  3991. H,
  3992. H,
  3993. H,
  3994. C,
  3995. E,
  3996. L,
  3997. L,
  3998. L,
  3999. L,
  4000. E,
  4001. E,
  4002. E,
  4003. E,
  4004. g,
  4005. E,
  4006. E,
  4007. H,
  4008. E,
  4009. E,
  4010. L,
  4011. L,
  4012. b,
  4013. b,
  4014. E,
  4015. g,
  4016. E,
  4017. E,
  4018. E,
  4019. b,
  4020. g,
  4021. E,
  4022. E,
  4023. E,
  4024. E,
  4025. E,
  4026. ],
  4027. j = [
  4028. N,
  4029. N,
  4030. N,
  4031. N,
  4032. N,
  4033. N,
  4034. N,
  4035. N,
  4036. N,
  4037. N,
  4038. N,
  4039. H,
  4040. H,
  4041. H,
  4042. g,
  4043. y,
  4044. E,
  4045. E,
  4046. E,
  4047. E,
  4048. E,
  4049. E,
  4050. E,
  4051. E,
  4052. E,
  4053. E,
  4054. E,
  4055. E,
  4056. E,
  4057. E,
  4058. E,
  4059. E,
  4060. E,
  4061. E,
  4062. E,
  4063. E,
  4064. E,
  4065. E,
  4066. E,
  4067. E,
  4068. N,
  4069. S,
  4070. O,
  4071. M,
  4072. _,
  4073. D,
  4074. P,
  4075. C,
  4076. L,
  4077. L,
  4078. L,
  4079. L,
  4080. L,
  4081. E,
  4082. E,
  4083. E,
  4084. E,
  4085. E,
  4086. E,
  4087. E,
  4088. E,
  4089. E,
  4090. E,
  4091. E,
  4092. E,
  4093. E,
  4094. E,
  4095. E,
  4096. C,
  4097. E,
  4098. E,
  4099. E,
  4100. E,
  4101. E,
  4102. E,
  4103. E,
  4104. E,
  4105. E,
  4106. E,
  4107. E,
  4108. E,
  4109. E,
  4110. E,
  4111. E,
  4112. E,
  4113. E,
  4114. E,
  4115. E,
  4116. E,
  4117. E,
  4118. E,
  4119. E,
  4120. E,
  4121. E,
  4122. E,
  4123. N,
  4124. ];
  4125. (t.L = g),
  4126. (t.R = y),
  4127. (t.EN = b),
  4128. (t.ON_R = 3),
  4129. (t.AN = 4),
  4130. (t.R_H = 5),
  4131. (t.B = 6),
  4132. (t.RLE = 7),
  4133. (t.DOT = "\u00b7"),
  4134. (t.doBidiReorder = function (e, n, r) {
  4135. if (e.length < 2) return {};
  4136. var i = e.split(""),
  4137. o = new Array(i.length),
  4138. u = new Array(i.length),
  4139. a = [];
  4140. (s = r ? m : v), F(i, a, i.length, n);
  4141. for (var f = 0; f < o.length; o[f] = f, f++);
  4142. I(2, a, o), I(1, a, o);
  4143. for (var f = 0; f < o.length - 1; f++)
  4144. n[f] === w
  4145. ? (a[f] = t.AN)
  4146. : a[f] === y &&
  4147. ((n[f] > T && n[f] < O) || n[f] === E || n[f] === H)
  4148. ? (a[f] = t.ON_R)
  4149. : f > 0 &&
  4150. i[f - 1] === "\u0644" &&
  4151. /\u0622|\u0623|\u0625|\u0627/.test(i[f]) &&
  4152. ((a[f - 1] = a[f] = t.R_H), f++);
  4153. i[i.length - 1] === t.DOT && (a[i.length - 1] = t.B),
  4154. i[0] === "\u202b" && (a[0] = t.RLE);
  4155. for (var f = 0; f < o.length; f++) u[f] = a[o[f]];
  4156. return { logicalFromVisual: o, bidiLevels: u };
  4157. }),
  4158. (t.hasBidiCharacters = function (e, t) {
  4159. var n = !1;
  4160. for (var r = 0; r < e.length; r++)
  4161. (t[r] = R(e.charAt(r))),
  4162. !n && (t[r] == y || t[r] == T || t[r] == w) && (n = !0);
  4163. return n;
  4164. }),
  4165. (t.getVisualFromLogicalIdx = function (e, t) {
  4166. for (var n = 0; n < t.logicalFromVisual.length; n++)
  4167. if (t.logicalFromVisual[n] == e) return n;
  4168. return 0;
  4169. });
  4170. }
  4171. ),
  4172. define(
  4173. "ace/bidihandler",
  4174. ["require", "exports", "module", "ace/lib/bidiutil", "ace/lib/lang"],
  4175. function (e, t, n) {
  4176. "use strict";
  4177. var r = e("./lib/bidiutil"),
  4178. i = e("./lib/lang"),
  4179. s = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,
  4180. o = function (e) {
  4181. (this.session = e),
  4182. (this.bidiMap = {}),
  4183. (this.currentRow = null),
  4184. (this.bidiUtil = r),
  4185. (this.charWidths = []),
  4186. (this.EOL = "\u00ac"),
  4187. (this.showInvisibles = !0),
  4188. (this.isRtlDir = !1),
  4189. (this.line = ""),
  4190. (this.wrapIndent = 0),
  4191. (this.EOF = "\u00b6"),
  4192. (this.RLE = "\u202b"),
  4193. (this.contentWidth = 0),
  4194. (this.fontMetrics = null),
  4195. (this.rtlLineOffset = 0),
  4196. (this.wrapOffset = 0),
  4197. (this.isMoveLeftOperation = !1),
  4198. (this.seenBidi = s.test(e.getValue()));
  4199. };
  4200. (function () {
  4201. (this.isBidiRow = function (e, t, n) {
  4202. return this.seenBidi
  4203. ? (e !== this.currentRow &&
  4204. ((this.currentRow = e),
  4205. this.updateRowLine(t, n),
  4206. this.updateBidiMap()),
  4207. this.bidiMap.bidiLevels)
  4208. : !1;
  4209. }),
  4210. (this.onChange = function (e) {
  4211. this.seenBidi
  4212. ? (this.currentRow = null)
  4213. : e.action == "insert" &&
  4214. s.test(e.lines.join("\n")) &&
  4215. ((this.seenBidi = !0), (this.currentRow = null));
  4216. }),
  4217. (this.getDocumentRow = function () {
  4218. var e = 0,
  4219. t = this.session.$screenRowCache;
  4220. if (t.length) {
  4221. var n = this.session.$getRowCacheIndex(t, this.currentRow);
  4222. n >= 0 && (e = this.session.$docRowCache[n]);
  4223. }
  4224. return e;
  4225. }),
  4226. (this.getSplitIndex = function () {
  4227. var e = 0,
  4228. t = this.session.$screenRowCache;
  4229. if (t.length) {
  4230. var n,
  4231. r = this.session.$getRowCacheIndex(t, this.currentRow);
  4232. while (this.currentRow - e > 0) {
  4233. n = this.session.$getRowCacheIndex(t, this.currentRow - e - 1);
  4234. if (n !== r) break;
  4235. (r = n), e++;
  4236. }
  4237. } else e = this.currentRow;
  4238. return e;
  4239. }),
  4240. (this.updateRowLine = function (e, t) {
  4241. e === undefined && (e = this.getDocumentRow());
  4242. var n = e === this.session.getLength() - 1,
  4243. s = n ? this.EOF : this.EOL;
  4244. (this.wrapIndent = 0),
  4245. (this.line = this.session.getLine(e)),
  4246. (this.isRtlDir = this.line.charAt(0) === this.RLE);
  4247. if (this.session.$useWrapMode) {
  4248. var o = this.session.$wrapData[e];
  4249. o &&
  4250. (t === undefined && (t = this.getSplitIndex()),
  4251. t > 0 && o.length
  4252. ? ((this.wrapIndent = o.indent),
  4253. (this.wrapOffset = this.wrapIndent * this.charWidths[r.L]),
  4254. (this.line =
  4255. t < o.length
  4256. ? this.line.substring(o[t - 1], o[t])
  4257. : this.line.substring(o[o.length - 1])))
  4258. : (this.line = this.line.substring(0, o[t]))),
  4259. t == o.length && (this.line += this.showInvisibles ? s : r.DOT);
  4260. } else this.line += this.showInvisibles ? s : r.DOT;
  4261. var u = this.session,
  4262. a = 0,
  4263. f;
  4264. (this.line = this.line.replace(
  4265. /\t|[\u1100-\u2029, \u202F-\uFFE6]/g,
  4266. function (e, t) {
  4267. return e === " " || u.isFullWidth(e.charCodeAt(0))
  4268. ? ((f = e === " " ? u.getScreenTabSize(t + a) : 2),
  4269. (a += f - 1),
  4270. i.stringRepeat(r.DOT, f))
  4271. : e;
  4272. }
  4273. )),
  4274. this.isRtlDir &&
  4275. ((this.fontMetrics.$main.innerHTML =
  4276. this.line.charAt(this.line.length - 1) == r.DOT
  4277. ? this.line.substr(0, this.line.length - 1)
  4278. : this.line),
  4279. (this.rtlLineOffset =
  4280. this.contentWidth -
  4281. this.fontMetrics.$main.getBoundingClientRect().width));
  4282. }),
  4283. (this.updateBidiMap = function () {
  4284. var e = [];
  4285. r.hasBidiCharacters(this.line, e) || this.isRtlDir
  4286. ? (this.bidiMap = r.doBidiReorder(this.line, e, this.isRtlDir))
  4287. : (this.bidiMap = {});
  4288. }),
  4289. (this.markAsDirty = function () {
  4290. this.currentRow = null;
  4291. }),
  4292. (this.updateCharacterWidths = function (e) {
  4293. if (this.characterWidth === e.$characterSize.width) return;
  4294. this.fontMetrics = e;
  4295. var t = (this.characterWidth = e.$characterSize.width),
  4296. n = e.$measureCharWidth("\u05d4");
  4297. (this.charWidths[r.L] =
  4298. this.charWidths[r.EN] =
  4299. this.charWidths[r.ON_R] =
  4300. t),
  4301. (this.charWidths[r.R] = this.charWidths[r.AN] = n),
  4302. (this.charWidths[r.R_H] = n * 0.45),
  4303. (this.charWidths[r.B] = this.charWidths[r.RLE] = 0),
  4304. (this.currentRow = null);
  4305. }),
  4306. (this.setShowInvisibles = function (e) {
  4307. (this.showInvisibles = e), (this.currentRow = null);
  4308. }),
  4309. (this.setEolChar = function (e) {
  4310. this.EOL = e;
  4311. }),
  4312. (this.setContentWidth = function (e) {
  4313. this.contentWidth = e;
  4314. }),
  4315. (this.isRtlLine = function (e) {
  4316. return e != undefined
  4317. ? this.session.getLine(e).charAt(0) == this.RLE
  4318. : this.isRtlDir;
  4319. }),
  4320. (this.setRtlDirection = function (e, t) {
  4321. var n = e.getCursorPosition();
  4322. for (var r = e.selection.getSelectionAnchor().row; r <= n.row; r++)
  4323. !t &&
  4324. e.session.getLine(r).charAt(0) === e.session.$bidiHandler.RLE
  4325. ? e.session.doc.removeInLine(r, 0, 1)
  4326. : t &&
  4327. e.session.getLine(r).charAt(0) !==
  4328. e.session.$bidiHandler.RLE &&
  4329. e.session.doc.insert(
  4330. { column: 0, row: r },
  4331. e.session.$bidiHandler.RLE
  4332. );
  4333. }),
  4334. (this.getPosLeft = function (e) {
  4335. e -= this.wrapIndent;
  4336. var t = this.line.charAt(0) === this.RLE ? 1 : 0,
  4337. n = e > t ? (this.session.getOverwrite() ? e : e - 1) : t,
  4338. i = r.getVisualFromLogicalIdx(n, this.bidiMap),
  4339. s = this.bidiMap.bidiLevels,
  4340. o = 0;
  4341. !this.session.getOverwrite() && e <= t && s[i] % 2 !== 0 && i++;
  4342. for (var u = 0; u < i; u++) o += this.charWidths[s[u]];
  4343. return (
  4344. !this.session.getOverwrite() &&
  4345. e > t &&
  4346. s[i] % 2 === 0 &&
  4347. (o += this.charWidths[s[i]]),
  4348. this.wrapIndent &&
  4349. (o += this.isRtlDir ? -1 * this.wrapOffset : this.wrapOffset),
  4350. this.isRtlDir && (o += this.rtlLineOffset),
  4351. o
  4352. );
  4353. }),
  4354. (this.getSelections = function (e, t) {
  4355. var n = this.bidiMap,
  4356. r = n.bidiLevels,
  4357. i,
  4358. s = [],
  4359. o = 0,
  4360. u = Math.min(e, t) - this.wrapIndent,
  4361. a = Math.max(e, t) - this.wrapIndent,
  4362. f = !1,
  4363. l = !1,
  4364. c = 0;
  4365. this.wrapIndent &&
  4366. (o += this.isRtlDir ? -1 * this.wrapOffset : this.wrapOffset);
  4367. for (var h, p = 0; p < r.length; p++)
  4368. (h = n.logicalFromVisual[p]),
  4369. (i = r[p]),
  4370. (f = h >= u && h < a),
  4371. f && !l
  4372. ? (c = o)
  4373. : !f && l && s.push({ left: c, width: o - c }),
  4374. (o += this.charWidths[i]),
  4375. (l = f);
  4376. f && p === r.length && s.push({ left: c, width: o - c });
  4377. if (this.isRtlDir)
  4378. for (var d = 0; d < s.length; d++)
  4379. s[d].left += this.rtlLineOffset;
  4380. return s;
  4381. }),
  4382. (this.offsetToCol = function (e) {
  4383. this.isRtlDir && (e -= this.rtlLineOffset);
  4384. var t = 0,
  4385. e = Math.max(e, 0),
  4386. n = 0,
  4387. r = 0,
  4388. i = this.bidiMap.bidiLevels,
  4389. s = this.charWidths[i[r]];
  4390. this.wrapIndent &&
  4391. (e -= this.isRtlDir ? -1 * this.wrapOffset : this.wrapOffset);
  4392. while (e > n + s / 2) {
  4393. n += s;
  4394. if (r === i.length - 1) {
  4395. s = 0;
  4396. break;
  4397. }
  4398. s = this.charWidths[i[++r]];
  4399. }
  4400. return (
  4401. r > 0 && i[r - 1] % 2 !== 0 && i[r] % 2 === 0
  4402. ? (e < n && r--, (t = this.bidiMap.logicalFromVisual[r]))
  4403. : r > 0 && i[r - 1] % 2 === 0 && i[r] % 2 !== 0
  4404. ? (t =
  4405. 1 +
  4406. (e > n
  4407. ? this.bidiMap.logicalFromVisual[r]
  4408. : this.bidiMap.logicalFromVisual[r - 1]))
  4409. : (this.isRtlDir &&
  4410. r === i.length - 1 &&
  4411. s === 0 &&
  4412. i[r - 1] % 2 === 0) ||
  4413. (!this.isRtlDir && r === 0 && i[r] % 2 !== 0)
  4414. ? (t = 1 + this.bidiMap.logicalFromVisual[r])
  4415. : (r > 0 && i[r - 1] % 2 !== 0 && s !== 0 && r--,
  4416. (t = this.bidiMap.logicalFromVisual[r])),
  4417. t === 0 && this.isRtlDir && t++,
  4418. t + this.wrapIndent
  4419. );
  4420. });
  4421. }).call(o.prototype),
  4422. (t.BidiHandler = o);
  4423. }
  4424. ),
  4425. define(
  4426. "ace/selection",
  4427. [
  4428. "require",
  4429. "exports",
  4430. "module",
  4431. "ace/lib/oop",
  4432. "ace/lib/lang",
  4433. "ace/lib/event_emitter",
  4434. "ace/range",
  4435. ],
  4436. function (e, t, n) {
  4437. "use strict";
  4438. var r = e("./lib/oop"),
  4439. i = e("./lib/lang"),
  4440. s = e("./lib/event_emitter").EventEmitter,
  4441. o = e("./range").Range,
  4442. u = function (e) {
  4443. (this.session = e),
  4444. (this.doc = e.getDocument()),
  4445. this.clearSelection(),
  4446. (this.cursor = this.lead = this.doc.createAnchor(0, 0)),
  4447. (this.anchor = this.doc.createAnchor(0, 0)),
  4448. (this.$silent = !1);
  4449. var t = this;
  4450. this.cursor.on("change", function (e) {
  4451. (t.$cursorChanged = !0),
  4452. t.$silent || t._emit("changeCursor"),
  4453. !t.$isEmpty && !t.$silent && t._emit("changeSelection"),
  4454. !t.$keepDesiredColumnOnChange &&
  4455. e.old.column != e.value.column &&
  4456. (t.$desiredColumn = null);
  4457. }),
  4458. this.anchor.on("change", function () {
  4459. (t.$anchorChanged = !0),
  4460. !t.$isEmpty && !t.$silent && t._emit("changeSelection");
  4461. });
  4462. };
  4463. (function () {
  4464. r.implement(this, s),
  4465. (this.isEmpty = function () {
  4466. return (
  4467. this.$isEmpty ||
  4468. (this.anchor.row == this.lead.row &&
  4469. this.anchor.column == this.lead.column)
  4470. );
  4471. }),
  4472. (this.isMultiLine = function () {
  4473. return !this.$isEmpty && this.anchor.row != this.cursor.row;
  4474. }),
  4475. (this.getCursor = function () {
  4476. return this.lead.getPosition();
  4477. }),
  4478. (this.setSelectionAnchor = function (e, t) {
  4479. (this.$isEmpty = !1), this.anchor.setPosition(e, t);
  4480. }),
  4481. (this.getAnchor = this.getSelectionAnchor =
  4482. function () {
  4483. return this.$isEmpty
  4484. ? this.getSelectionLead()
  4485. : this.anchor.getPosition();
  4486. }),
  4487. (this.getSelectionLead = function () {
  4488. return this.lead.getPosition();
  4489. }),
  4490. (this.isBackwards = function () {
  4491. var e = this.anchor,
  4492. t = this.lead;
  4493. return e.row > t.row || (e.row == t.row && e.column > t.column);
  4494. }),
  4495. (this.getRange = function () {
  4496. var e = this.anchor,
  4497. t = this.lead;
  4498. return this.$isEmpty
  4499. ? o.fromPoints(t, t)
  4500. : this.isBackwards()
  4501. ? o.fromPoints(t, e)
  4502. : o.fromPoints(e, t);
  4503. }),
  4504. (this.clearSelection = function () {
  4505. this.$isEmpty ||
  4506. ((this.$isEmpty = !0), this._emit("changeSelection"));
  4507. }),
  4508. (this.selectAll = function () {
  4509. this.$setSelection(0, 0, Number.MAX_VALUE, Number.MAX_VALUE);
  4510. }),
  4511. (this.setRange = this.setSelectionRange =
  4512. function (e, t) {
  4513. var n = t ? e.end : e.start,
  4514. r = t ? e.start : e.end;
  4515. this.$setSelection(n.row, n.column, r.row, r.column);
  4516. }),
  4517. (this.$setSelection = function (e, t, n, r) {
  4518. var i = this.$isEmpty,
  4519. s = this.inMultiSelectMode;
  4520. (this.$silent = !0),
  4521. (this.$cursorChanged = this.$anchorChanged = !1),
  4522. this.anchor.setPosition(e, t),
  4523. this.cursor.setPosition(n, r),
  4524. (this.$isEmpty = !o.comparePoints(this.anchor, this.cursor)),
  4525. (this.$silent = !1),
  4526. this.$cursorChanged && this._emit("changeCursor"),
  4527. (this.$cursorChanged ||
  4528. this.$anchorChanged ||
  4529. i != this.$isEmpty ||
  4530. s) &&
  4531. this._emit("changeSelection");
  4532. }),
  4533. (this.$moveSelection = function (e) {
  4534. var t = this.lead;
  4535. this.$isEmpty && this.setSelectionAnchor(t.row, t.column),
  4536. e.call(this);
  4537. }),
  4538. (this.selectTo = function (e, t) {
  4539. this.$moveSelection(function () {
  4540. this.moveCursorTo(e, t);
  4541. });
  4542. }),
  4543. (this.selectToPosition = function (e) {
  4544. this.$moveSelection(function () {
  4545. this.moveCursorToPosition(e);
  4546. });
  4547. }),
  4548. (this.moveTo = function (e, t) {
  4549. this.clearSelection(), this.moveCursorTo(e, t);
  4550. }),
  4551. (this.moveToPosition = function (e) {
  4552. this.clearSelection(), this.moveCursorToPosition(e);
  4553. }),
  4554. (this.selectUp = function () {
  4555. this.$moveSelection(this.moveCursorUp);
  4556. }),
  4557. (this.selectDown = function () {
  4558. this.$moveSelection(this.moveCursorDown);
  4559. }),
  4560. (this.selectRight = function () {
  4561. this.$moveSelection(this.moveCursorRight);
  4562. }),
  4563. (this.selectLeft = function () {
  4564. this.$moveSelection(this.moveCursorLeft);
  4565. }),
  4566. (this.selectLineStart = function () {
  4567. this.$moveSelection(this.moveCursorLineStart);
  4568. }),
  4569. (this.selectLineEnd = function () {
  4570. this.$moveSelection(this.moveCursorLineEnd);
  4571. }),
  4572. (this.selectFileEnd = function () {
  4573. this.$moveSelection(this.moveCursorFileEnd);
  4574. }),
  4575. (this.selectFileStart = function () {
  4576. this.$moveSelection(this.moveCursorFileStart);
  4577. }),
  4578. (this.selectWordRight = function () {
  4579. this.$moveSelection(this.moveCursorWordRight);
  4580. }),
  4581. (this.selectWordLeft = function () {
  4582. this.$moveSelection(this.moveCursorWordLeft);
  4583. }),
  4584. (this.getWordRange = function (e, t) {
  4585. if (typeof t == "undefined") {
  4586. var n = e || this.lead;
  4587. (e = n.row), (t = n.column);
  4588. }
  4589. return this.session.getWordRange(e, t);
  4590. }),
  4591. (this.selectWord = function () {
  4592. this.setSelectionRange(this.getWordRange());
  4593. }),
  4594. (this.selectAWord = function () {
  4595. var e = this.getCursor(),
  4596. t = this.session.getAWordRange(e.row, e.column);
  4597. this.setSelectionRange(t);
  4598. }),
  4599. (this.getLineRange = function (e, t) {
  4600. var n = typeof e == "number" ? e : this.lead.row,
  4601. r,
  4602. i = this.session.getFoldLine(n);
  4603. return (
  4604. i ? ((n = i.start.row), (r = i.end.row)) : (r = n),
  4605. t === !0
  4606. ? new o(n, 0, r, this.session.getLine(r).length)
  4607. : new o(n, 0, r + 1, 0)
  4608. );
  4609. }),
  4610. (this.selectLine = function () {
  4611. this.setSelectionRange(this.getLineRange());
  4612. }),
  4613. (this.moveCursorUp = function () {
  4614. this.moveCursorBy(-1, 0);
  4615. }),
  4616. (this.moveCursorDown = function () {
  4617. this.moveCursorBy(1, 0);
  4618. }),
  4619. (this.wouldMoveIntoSoftTab = function (e, t, n) {
  4620. var r = e.column,
  4621. i = e.column + t;
  4622. return (
  4623. n < 0 && ((r = e.column - t), (i = e.column)),
  4624. this.session.isTabStop(e) &&
  4625. this.doc.getLine(e.row).slice(r, i).split(" ").length - 1 == t
  4626. );
  4627. }),
  4628. (this.moveCursorLeft = function () {
  4629. var e = this.lead.getPosition(),
  4630. t;
  4631. if ((t = this.session.getFoldAt(e.row, e.column, -1)))
  4632. this.moveCursorTo(t.start.row, t.start.column);
  4633. else if (e.column === 0)
  4634. e.row > 0 &&
  4635. this.moveCursorTo(
  4636. e.row - 1,
  4637. this.doc.getLine(e.row - 1).length
  4638. );
  4639. else {
  4640. var n = this.session.getTabSize();
  4641. this.wouldMoveIntoSoftTab(e, n, -1) &&
  4642. !this.session.getNavigateWithinSoftTabs()
  4643. ? this.moveCursorBy(0, -n)
  4644. : this.moveCursorBy(0, -1);
  4645. }
  4646. }),
  4647. (this.moveCursorRight = function () {
  4648. var e = this.lead.getPosition(),
  4649. t;
  4650. if ((t = this.session.getFoldAt(e.row, e.column, 1)))
  4651. this.moveCursorTo(t.end.row, t.end.column);
  4652. else if (this.lead.column == this.doc.getLine(this.lead.row).length)
  4653. this.lead.row < this.doc.getLength() - 1 &&
  4654. this.moveCursorTo(this.lead.row + 1, 0);
  4655. else {
  4656. var n = this.session.getTabSize(),
  4657. e = this.lead;
  4658. this.wouldMoveIntoSoftTab(e, n, 1) &&
  4659. !this.session.getNavigateWithinSoftTabs()
  4660. ? this.moveCursorBy(0, n)
  4661. : this.moveCursorBy(0, 1);
  4662. }
  4663. }),
  4664. (this.moveCursorLineStart = function () {
  4665. var e = this.lead.row,
  4666. t = this.lead.column,
  4667. n = this.session.documentToScreenRow(e, t),
  4668. r = this.session.screenToDocumentPosition(n, 0),
  4669. i = this.session.getDisplayLine(e, null, r.row, r.column),
  4670. s = i.match(/^\s*/);
  4671. s[0].length != t &&
  4672. !this.session.$useEmacsStyleLineStart &&
  4673. (r.column += s[0].length),
  4674. this.moveCursorToPosition(r);
  4675. }),
  4676. (this.moveCursorLineEnd = function () {
  4677. var e = this.lead,
  4678. t = this.session.getDocumentLastRowColumnPosition(
  4679. e.row,
  4680. e.column
  4681. );
  4682. if (this.lead.column == t.column) {
  4683. var n = this.session.getLine(t.row);
  4684. if (t.column == n.length) {
  4685. var r = n.search(/\s+$/);
  4686. r > 0 && (t.column = r);
  4687. }
  4688. }
  4689. this.moveCursorTo(t.row, t.column);
  4690. }),
  4691. (this.moveCursorFileEnd = function () {
  4692. var e = this.doc.getLength() - 1,
  4693. t = this.doc.getLine(e).length;
  4694. this.moveCursorTo(e, t);
  4695. }),
  4696. (this.moveCursorFileStart = function () {
  4697. this.moveCursorTo(0, 0);
  4698. }),
  4699. (this.moveCursorLongWordRight = function () {
  4700. var e = this.lead.row,
  4701. t = this.lead.column,
  4702. n = this.doc.getLine(e),
  4703. r = n.substring(t);
  4704. (this.session.nonTokenRe.lastIndex = 0),
  4705. (this.session.tokenRe.lastIndex = 0);
  4706. var i = this.session.getFoldAt(e, t, 1);
  4707. if (i) {
  4708. this.moveCursorTo(i.end.row, i.end.column);
  4709. return;
  4710. }
  4711. this.session.nonTokenRe.exec(r) &&
  4712. ((t += this.session.nonTokenRe.lastIndex),
  4713. (this.session.nonTokenRe.lastIndex = 0),
  4714. (r = n.substring(t)));
  4715. if (t >= n.length) {
  4716. this.moveCursorTo(e, n.length),
  4717. this.moveCursorRight(),
  4718. e < this.doc.getLength() - 1 && this.moveCursorWordRight();
  4719. return;
  4720. }
  4721. this.session.tokenRe.exec(r) &&
  4722. ((t += this.session.tokenRe.lastIndex),
  4723. (this.session.tokenRe.lastIndex = 0)),
  4724. this.moveCursorTo(e, t);
  4725. }),
  4726. (this.moveCursorLongWordLeft = function () {
  4727. var e = this.lead.row,
  4728. t = this.lead.column,
  4729. n;
  4730. if ((n = this.session.getFoldAt(e, t, -1))) {
  4731. this.moveCursorTo(n.start.row, n.start.column);
  4732. return;
  4733. }
  4734. var r = this.session.getFoldStringAt(e, t, -1);
  4735. r == null && (r = this.doc.getLine(e).substring(0, t));
  4736. var s = i.stringReverse(r);
  4737. (this.session.nonTokenRe.lastIndex = 0),
  4738. (this.session.tokenRe.lastIndex = 0),
  4739. this.session.nonTokenRe.exec(s) &&
  4740. ((t -= this.session.nonTokenRe.lastIndex),
  4741. (s = s.slice(this.session.nonTokenRe.lastIndex)),
  4742. (this.session.nonTokenRe.lastIndex = 0));
  4743. if (t <= 0) {
  4744. this.moveCursorTo(e, 0),
  4745. this.moveCursorLeft(),
  4746. e > 0 && this.moveCursorWordLeft();
  4747. return;
  4748. }
  4749. this.session.tokenRe.exec(s) &&
  4750. ((t -= this.session.tokenRe.lastIndex),
  4751. (this.session.tokenRe.lastIndex = 0)),
  4752. this.moveCursorTo(e, t);
  4753. }),
  4754. (this.$shortWordEndIndex = function (e) {
  4755. var t = 0,
  4756. n,
  4757. r = /\s/,
  4758. i = this.session.tokenRe;
  4759. i.lastIndex = 0;
  4760. if (this.session.tokenRe.exec(e))
  4761. t = this.session.tokenRe.lastIndex;
  4762. else {
  4763. while ((n = e[t]) && r.test(n)) t++;
  4764. if (t < 1) {
  4765. i.lastIndex = 0;
  4766. while ((n = e[t]) && !i.test(n)) {
  4767. (i.lastIndex = 0), t++;
  4768. if (r.test(n)) {
  4769. if (t > 2) {
  4770. t--;
  4771. break;
  4772. }
  4773. while ((n = e[t]) && r.test(n)) t++;
  4774. if (t > 2) break;
  4775. }
  4776. }
  4777. }
  4778. }
  4779. return (i.lastIndex = 0), t;
  4780. }),
  4781. (this.moveCursorShortWordRight = function () {
  4782. var e = this.lead.row,
  4783. t = this.lead.column,
  4784. n = this.doc.getLine(e),
  4785. r = n.substring(t),
  4786. i = this.session.getFoldAt(e, t, 1);
  4787. if (i) return this.moveCursorTo(i.end.row, i.end.column);
  4788. if (t == n.length) {
  4789. var s = this.doc.getLength();
  4790. do e++, (r = this.doc.getLine(e));
  4791. while (e < s && /^\s*$/.test(r));
  4792. /^\s+/.test(r) || (r = ""), (t = 0);
  4793. }
  4794. var o = this.$shortWordEndIndex(r);
  4795. this.moveCursorTo(e, t + o);
  4796. }),
  4797. (this.moveCursorShortWordLeft = function () {
  4798. var e = this.lead.row,
  4799. t = this.lead.column,
  4800. n;
  4801. if ((n = this.session.getFoldAt(e, t, -1)))
  4802. return this.moveCursorTo(n.start.row, n.start.column);
  4803. var r = this.session.getLine(e).substring(0, t);
  4804. if (t === 0) {
  4805. do e--, (r = this.doc.getLine(e));
  4806. while (e > 0 && /^\s*$/.test(r));
  4807. (t = r.length), /\s+$/.test(r) || (r = "");
  4808. }
  4809. var s = i.stringReverse(r),
  4810. o = this.$shortWordEndIndex(s);
  4811. return this.moveCursorTo(e, t - o);
  4812. }),
  4813. (this.moveCursorWordRight = function () {
  4814. this.session.$selectLongWords
  4815. ? this.moveCursorLongWordRight()
  4816. : this.moveCursorShortWordRight();
  4817. }),
  4818. (this.moveCursorWordLeft = function () {
  4819. this.session.$selectLongWords
  4820. ? this.moveCursorLongWordLeft()
  4821. : this.moveCursorShortWordLeft();
  4822. }),
  4823. (this.moveCursorBy = function (e, t) {
  4824. var n = this.session.documentToScreenPosition(
  4825. this.lead.row,
  4826. this.lead.column
  4827. ),
  4828. r;
  4829. t === 0 &&
  4830. (e !== 0 &&
  4831. (this.session.$bidiHandler.isBidiRow(n.row, this.lead.row)
  4832. ? ((r = this.session.$bidiHandler.getPosLeft(n.column)),
  4833. (n.column = Math.round(
  4834. r / this.session.$bidiHandler.charWidths[0]
  4835. )))
  4836. : (r = n.column * this.session.$bidiHandler.charWidths[0])),
  4837. this.$desiredColumn
  4838. ? (n.column = this.$desiredColumn)
  4839. : (this.$desiredColumn = n.column));
  4840. var i = this.session.screenToDocumentPosition(
  4841. n.row + e,
  4842. n.column,
  4843. r
  4844. );
  4845. e !== 0 &&
  4846. t === 0 &&
  4847. i.row === this.lead.row &&
  4848. i.column === this.lead.column &&
  4849. this.session.lineWidgets &&
  4850. this.session.lineWidgets[i.row] &&
  4851. (i.row > 0 || e > 0) &&
  4852. i.row++,
  4853. this.moveCursorTo(i.row, i.column + t, t === 0);
  4854. }),
  4855. (this.moveCursorToPosition = function (e) {
  4856. this.moveCursorTo(e.row, e.column);
  4857. }),
  4858. (this.moveCursorTo = function (e, t, n) {
  4859. var r = this.session.getFoldAt(e, t, 1);
  4860. r && ((e = r.start.row), (t = r.start.column)),
  4861. (this.$keepDesiredColumnOnChange = !0);
  4862. var i = this.session.getLine(e);
  4863. /[\uDC00-\uDFFF]/.test(i.charAt(t)) &&
  4864. i.charAt(t - 1) &&
  4865. (this.lead.row == e && this.lead.column == t + 1
  4866. ? (t -= 1)
  4867. : (t += 1)),
  4868. this.lead.setPosition(e, t),
  4869. (this.$keepDesiredColumnOnChange = !1),
  4870. n || (this.$desiredColumn = null);
  4871. }),
  4872. (this.moveCursorToScreen = function (e, t, n) {
  4873. var r = this.session.screenToDocumentPosition(e, t);
  4874. this.moveCursorTo(r.row, r.column, n);
  4875. }),
  4876. (this.detach = function () {
  4877. this.lead.detach(),
  4878. this.anchor.detach(),
  4879. (this.session = this.doc = null);
  4880. }),
  4881. (this.fromOrientedRange = function (e) {
  4882. this.setSelectionRange(e, e.cursor == e.start),
  4883. (this.$desiredColumn = e.desiredColumn || this.$desiredColumn);
  4884. }),
  4885. (this.toOrientedRange = function (e) {
  4886. var t = this.getRange();
  4887. return (
  4888. e
  4889. ? ((e.start.column = t.start.column),
  4890. (e.start.row = t.start.row),
  4891. (e.end.column = t.end.column),
  4892. (e.end.row = t.end.row))
  4893. : (e = t),
  4894. (e.cursor = this.isBackwards() ? e.start : e.end),
  4895. (e.desiredColumn = this.$desiredColumn),
  4896. e
  4897. );
  4898. }),
  4899. (this.getRangeOfMovements = function (e) {
  4900. var t = this.getCursor();
  4901. try {
  4902. e(this);
  4903. var n = this.getCursor();
  4904. return o.fromPoints(t, n);
  4905. } catch (r) {
  4906. return o.fromPoints(t, t);
  4907. } finally {
  4908. this.moveCursorToPosition(t);
  4909. }
  4910. }),
  4911. (this.toJSON = function () {
  4912. if (this.rangeCount)
  4913. var e = this.ranges.map(function (e) {
  4914. var t = e.clone();
  4915. return (t.isBackwards = e.cursor == e.start), t;
  4916. });
  4917. else {
  4918. var e = this.getRange();
  4919. e.isBackwards = this.isBackwards();
  4920. }
  4921. return e;
  4922. }),
  4923. (this.fromJSON = function (e) {
  4924. if (e.start == undefined) {
  4925. if (this.rangeList) {
  4926. this.toSingleRange(e[0]);
  4927. for (var t = e.length; t--; ) {
  4928. var n = o.fromPoints(e[t].start, e[t].end);
  4929. e[t].isBackwards && (n.cursor = n.start),
  4930. this.addRange(n, !0);
  4931. }
  4932. return;
  4933. }
  4934. e = e[0];
  4935. }
  4936. this.rangeList && this.toSingleRange(e),
  4937. this.setSelectionRange(e, e.isBackwards);
  4938. }),
  4939. (this.isEqual = function (e) {
  4940. if ((e.length || this.rangeCount) && e.length != this.rangeCount)
  4941. return !1;
  4942. if (!e.length || !this.ranges) return this.getRange().isEqual(e);
  4943. for (var t = this.ranges.length; t--; )
  4944. if (!this.ranges[t].isEqual(e[t])) return !1;
  4945. return !0;
  4946. });
  4947. }).call(u.prototype),
  4948. (t.Selection = u);
  4949. }
  4950. ),
  4951. define(
  4952. "ace/tokenizer",
  4953. ["require", "exports", "module", "ace/config"],
  4954. function (e, t, n) {
  4955. "use strict";
  4956. var r = e("./config"),
  4957. i = 2e3,
  4958. s = function (e) {
  4959. (this.states = e), (this.regExps = {}), (this.matchMappings = {});
  4960. for (var t in this.states) {
  4961. var n = this.states[t],
  4962. r = [],
  4963. i = 0,
  4964. s = (this.matchMappings[t] = { defaultToken: "text" }),
  4965. o = "g",
  4966. u = [];
  4967. for (var a = 0; a < n.length; a++) {
  4968. var f = n[a];
  4969. f.defaultToken && (s.defaultToken = f.defaultToken),
  4970. f.caseInsensitive && (o = "gi");
  4971. if (f.regex == null) continue;
  4972. f.regex instanceof RegExp &&
  4973. (f.regex = f.regex.toString().slice(1, -1));
  4974. var l = f.regex,
  4975. c = new RegExp("(?:(" + l + ")|(.))").exec("a").length - 2;
  4976. Array.isArray(f.token)
  4977. ? f.token.length == 1 || c == 1
  4978. ? (f.token = f.token[0])
  4979. : c - 1 != f.token.length
  4980. ? (this.reportError(
  4981. "number of classes and regexp groups doesn't match",
  4982. { rule: f, groupCount: c - 1 }
  4983. ),
  4984. (f.token = f.token[0]))
  4985. : ((f.tokenArray = f.token),
  4986. (f.token = null),
  4987. (f.onMatch = this.$arrayTokens))
  4988. : typeof f.token == "function" &&
  4989. !f.onMatch &&
  4990. (c > 1
  4991. ? (f.onMatch = this.$applyToken)
  4992. : (f.onMatch = f.token)),
  4993. c > 1 &&
  4994. (/\\\d/.test(f.regex)
  4995. ? (l = f.regex.replace(/\\([0-9]+)/g, function (e, t) {
  4996. return "\\" + (parseInt(t, 10) + i + 1);
  4997. }))
  4998. : ((c = 1), (l = this.removeCapturingGroups(f.regex))),
  4999. !f.splitRegex && typeof f.token != "string" && u.push(f)),
  5000. (s[i] = a),
  5001. (i += c),
  5002. r.push(l),
  5003. f.onMatch || (f.onMatch = null);
  5004. }
  5005. r.length || ((s[0] = 0), r.push("$")),
  5006. u.forEach(function (e) {
  5007. e.splitRegex = this.createSplitterRegexp(e.regex, o);
  5008. }, this),
  5009. (this.regExps[t] = new RegExp("(" + r.join(")|(") + ")|($)", o));
  5010. }
  5011. };
  5012. (function () {
  5013. (this.$setMaxTokenCount = function (e) {
  5014. i = e | 0;
  5015. }),
  5016. (this.$applyToken = function (e) {
  5017. var t = this.splitRegex.exec(e).slice(1),
  5018. n = this.token.apply(this, t);
  5019. if (typeof n == "string") return [{ type: n, value: e }];
  5020. var r = [];
  5021. for (var i = 0, s = n.length; i < s; i++)
  5022. t[i] && (r[r.length] = { type: n[i], value: t[i] });
  5023. return r;
  5024. }),
  5025. (this.$arrayTokens = function (e) {
  5026. if (!e) return [];
  5027. var t = this.splitRegex.exec(e);
  5028. if (!t) return "text";
  5029. var n = [],
  5030. r = this.tokenArray;
  5031. for (var i = 0, s = r.length; i < s; i++)
  5032. t[i + 1] && (n[n.length] = { type: r[i], value: t[i + 1] });
  5033. return n;
  5034. }),
  5035. (this.removeCapturingGroups = function (e) {
  5036. var t = e.replace(
  5037. /\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!]|(\()/g,
  5038. function (e, t) {
  5039. return t ? "(?:" : e;
  5040. }
  5041. );
  5042. return t;
  5043. }),
  5044. (this.createSplitterRegexp = function (e, t) {
  5045. if (e.indexOf("(?=") != -1) {
  5046. var n = 0,
  5047. r = !1,
  5048. i = {};
  5049. e.replace(
  5050. /(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,
  5051. function (e, t, s, o, u, a) {
  5052. return (
  5053. r
  5054. ? (r = u != "]")
  5055. : u
  5056. ? (r = !0)
  5057. : o
  5058. ? (n == i.stack && ((i.end = a + 1), (i.stack = -1)), n--)
  5059. : s &&
  5060. (n++, s.length != 1 && ((i.stack = n), (i.start = a))),
  5061. e
  5062. );
  5063. }
  5064. ),
  5065. i.end != null &&
  5066. /^\)*$/.test(e.substr(i.end)) &&
  5067. (e = e.substring(0, i.start) + e.substr(i.end));
  5068. }
  5069. return (
  5070. e.charAt(0) != "^" && (e = "^" + e),
  5071. e.charAt(e.length - 1) != "$" && (e += "$"),
  5072. new RegExp(e, (t || "").replace("g", ""))
  5073. );
  5074. }),
  5075. (this.getLineTokens = function (e, t) {
  5076. if (t && typeof t != "string") {
  5077. var n = t.slice(0);
  5078. (t = n[0]), t === "#tmp" && (n.shift(), (t = n.shift()));
  5079. } else var n = [];
  5080. var r = t || "start",
  5081. s = this.states[r];
  5082. s || ((r = "start"), (s = this.states[r]));
  5083. var o = this.matchMappings[r],
  5084. u = this.regExps[r];
  5085. u.lastIndex = 0;
  5086. var a,
  5087. f = [],
  5088. l = 0,
  5089. c = 0,
  5090. h = { type: null, value: "" };
  5091. while ((a = u.exec(e))) {
  5092. var p = o.defaultToken,
  5093. d = null,
  5094. v = a[0],
  5095. m = u.lastIndex;
  5096. if (m - v.length > l) {
  5097. var g = e.substring(l, m - v.length);
  5098. h.type == p
  5099. ? (h.value += g)
  5100. : (h.type && f.push(h), (h = { type: p, value: g }));
  5101. }
  5102. for (var y = 0; y < a.length - 2; y++) {
  5103. if (a[y + 1] === undefined) continue;
  5104. (d = s[o[y]]),
  5105. d.onMatch ? (p = d.onMatch(v, r, n, e)) : (p = d.token),
  5106. d.next &&
  5107. (typeof d.next == "string"
  5108. ? (r = d.next)
  5109. : (r = d.next(r, n)),
  5110. (s = this.states[r]),
  5111. s ||
  5112. (this.reportError("state doesn't exist", r),
  5113. (r = "start"),
  5114. (s = this.states[r])),
  5115. (o = this.matchMappings[r]),
  5116. (l = m),
  5117. (u = this.regExps[r]),
  5118. (u.lastIndex = m)),
  5119. d.consumeLineEnd && (l = m);
  5120. break;
  5121. }
  5122. if (v)
  5123. if (typeof p == "string")
  5124. (!!d && d.merge === !1) || h.type !== p
  5125. ? (h.type && f.push(h), (h = { type: p, value: v }))
  5126. : (h.value += v);
  5127. else if (p) {
  5128. h.type && f.push(h), (h = { type: null, value: "" });
  5129. for (var y = 0; y < p.length; y++) f.push(p[y]);
  5130. }
  5131. if (l == e.length) break;
  5132. l = m;
  5133. if (c++ > i) {
  5134. c > 2 * e.length &&
  5135. this.reportError("infinite loop with in ace tokenizer", {
  5136. startState: t,
  5137. line: e,
  5138. });
  5139. while (l < e.length)
  5140. h.type && f.push(h),
  5141. (h = {
  5142. value: e.substring(l, (l += 2e3)),
  5143. type: "overflow",
  5144. });
  5145. (r = "start"), (n = []);
  5146. break;
  5147. }
  5148. }
  5149. return (
  5150. h.type && f.push(h),
  5151. n.length > 1 && n[0] !== r && n.unshift("#tmp", r),
  5152. { tokens: f, state: n.length ? n : r }
  5153. );
  5154. }),
  5155. (this.reportError = r.reportError);
  5156. }).call(s.prototype),
  5157. (t.Tokenizer = s);
  5158. }
  5159. ),
  5160. define(
  5161. "ace/mode/text_highlight_rules",
  5162. ["require", "exports", "module", "ace/lib/lang"],
  5163. function (e, t, n) {
  5164. "use strict";
  5165. var r = e("../lib/lang"),
  5166. i = function () {
  5167. this.$rules = {
  5168. start: [
  5169. { token: "empty_line", regex: "^$" },
  5170. { defaultToken: "text" },
  5171. ],
  5172. };
  5173. };
  5174. (function () {
  5175. (this.addRules = function (e, t) {
  5176. if (!t) {
  5177. for (var n in e) this.$rules[n] = e[n];
  5178. return;
  5179. }
  5180. for (var n in e) {
  5181. var r = e[n];
  5182. for (var i = 0; i < r.length; i++) {
  5183. var s = r[i];
  5184. if (s.next || s.onMatch)
  5185. typeof s.next == "string" &&
  5186. s.next.indexOf(t) !== 0 &&
  5187. (s.next = t + s.next),
  5188. s.nextState &&
  5189. s.nextState.indexOf(t) !== 0 &&
  5190. (s.nextState = t + s.nextState);
  5191. }
  5192. this.$rules[t + n] = r;
  5193. }
  5194. }),
  5195. (this.getRules = function () {
  5196. return this.$rules;
  5197. }),
  5198. (this.embedRules = function (e, t, n, i, s) {
  5199. var o = typeof e == "function" ? new e().getRules() : e;
  5200. if (i) for (var u = 0; u < i.length; u++) i[u] = t + i[u];
  5201. else {
  5202. i = [];
  5203. for (var a in o) i.push(t + a);
  5204. }
  5205. this.addRules(o, t);
  5206. if (n) {
  5207. var f = Array.prototype[s ? "push" : "unshift"];
  5208. for (var u = 0; u < i.length; u++)
  5209. f.apply(this.$rules[i[u]], r.deepCopy(n));
  5210. }
  5211. this.$embeds || (this.$embeds = []), this.$embeds.push(t);
  5212. }),
  5213. (this.getEmbeds = function () {
  5214. return this.$embeds;
  5215. });
  5216. var e = function (e, t) {
  5217. return (
  5218. (e != "start" || t.length) && t.unshift(this.nextState, e),
  5219. this.nextState
  5220. );
  5221. },
  5222. t = function (e, t) {
  5223. return t.shift(), t.shift() || "start";
  5224. };
  5225. (this.normalizeRules = function () {
  5226. function i(s) {
  5227. var o = r[s];
  5228. o.processed = !0;
  5229. for (var u = 0; u < o.length; u++) {
  5230. var a = o[u],
  5231. f = null;
  5232. Array.isArray(a) && ((f = a), (a = {})),
  5233. !a.regex &&
  5234. a.start &&
  5235. ((a.regex = a.start),
  5236. a.next || (a.next = []),
  5237. a.next.push(
  5238. { defaultToken: a.token },
  5239. {
  5240. token: a.token + ".end",
  5241. regex: a.end || a.start,
  5242. next: "pop",
  5243. }
  5244. ),
  5245. (a.token = a.token + ".start"),
  5246. (a.push = !0));
  5247. var l = a.next || a.push;
  5248. if (l && Array.isArray(l)) {
  5249. var c = a.stateName;
  5250. c ||
  5251. ((c = a.token),
  5252. typeof c != "string" && (c = c[0] || ""),
  5253. r[c] && (c += n++)),
  5254. (r[c] = l),
  5255. (a.next = c),
  5256. i(c);
  5257. } else l == "pop" && (a.next = t);
  5258. a.push &&
  5259. ((a.nextState = a.next || a.push), (a.next = e), delete a.push);
  5260. if (a.rules)
  5261. for (var h in a.rules)
  5262. r[h]
  5263. ? r[h].push && r[h].push.apply(r[h], a.rules[h])
  5264. : (r[h] = a.rules[h]);
  5265. var p = typeof a == "string" ? a : a.include;
  5266. p &&
  5267. (Array.isArray(p)
  5268. ? (f = p.map(function (e) {
  5269. return r[e];
  5270. }))
  5271. : (f = r[p]));
  5272. if (f) {
  5273. var d = [u, 1].concat(f);
  5274. a.noEscape &&
  5275. (d = d.filter(function (e) {
  5276. return !e.next;
  5277. })),
  5278. o.splice.apply(o, d),
  5279. u--;
  5280. }
  5281. a.keywordMap &&
  5282. ((a.token = this.createKeywordMapper(
  5283. a.keywordMap,
  5284. a.defaultToken || "text",
  5285. a.caseInsensitive
  5286. )),
  5287. delete a.defaultToken);
  5288. }
  5289. }
  5290. var n = 0,
  5291. r = this.$rules;
  5292. Object.keys(r).forEach(i, this);
  5293. }),
  5294. (this.createKeywordMapper = function (e, t, n, r) {
  5295. var i = Object.create(null);
  5296. return (
  5297. Object.keys(e).forEach(function (t) {
  5298. var s = e[t];
  5299. n && (s = s.toLowerCase());
  5300. var o = s.split(r || "|");
  5301. for (var u = o.length; u--; ) i[o[u]] = t;
  5302. }),
  5303. Object.getPrototypeOf(i) && (i.__proto__ = null),
  5304. (this.$keywordList = Object.keys(i)),
  5305. (e = null),
  5306. n
  5307. ? function (e) {
  5308. return i[e.toLowerCase()] || t;
  5309. }
  5310. : function (e) {
  5311. return i[e] || t;
  5312. }
  5313. );
  5314. }),
  5315. (this.getKeywords = function () {
  5316. return this.$keywords;
  5317. });
  5318. }).call(i.prototype),
  5319. (t.TextHighlightRules = i);
  5320. }
  5321. ),
  5322. define(
  5323. "ace/mode/behaviour",
  5324. ["require", "exports", "module"],
  5325. function (e, t, n) {
  5326. "use strict";
  5327. var r = function () {
  5328. this.$behaviours = {};
  5329. };
  5330. (function () {
  5331. (this.add = function (e, t, n) {
  5332. switch (undefined) {
  5333. case this.$behaviours:
  5334. this.$behaviours = {};
  5335. case this.$behaviours[e]:
  5336. this.$behaviours[e] = {};
  5337. }
  5338. this.$behaviours[e][t] = n;
  5339. }),
  5340. (this.addBehaviours = function (e) {
  5341. for (var t in e) for (var n in e[t]) this.add(t, n, e[t][n]);
  5342. }),
  5343. (this.remove = function (e) {
  5344. this.$behaviours &&
  5345. this.$behaviours[e] &&
  5346. delete this.$behaviours[e];
  5347. }),
  5348. (this.inherit = function (e, t) {
  5349. if (typeof e == "function") var n = new e().getBehaviours(t);
  5350. else var n = e.getBehaviours(t);
  5351. this.addBehaviours(n);
  5352. }),
  5353. (this.getBehaviours = function (e) {
  5354. if (!e) return this.$behaviours;
  5355. var t = {};
  5356. for (var n = 0; n < e.length; n++)
  5357. this.$behaviours[e[n]] && (t[e[n]] = this.$behaviours[e[n]]);
  5358. return t;
  5359. });
  5360. }).call(r.prototype),
  5361. (t.Behaviour = r);
  5362. }
  5363. ),
  5364. define(
  5365. "ace/token_iterator",
  5366. ["require", "exports", "module", "ace/range"],
  5367. function (e, t, n) {
  5368. "use strict";
  5369. var r = e("./range").Range,
  5370. i = function (e, t, n) {
  5371. (this.$session = e),
  5372. (this.$row = t),
  5373. (this.$rowTokens = e.getTokens(t));
  5374. var r = e.getTokenAt(t, n);
  5375. this.$tokenIndex = r ? r.index : -1;
  5376. };
  5377. (function () {
  5378. (this.stepBackward = function () {
  5379. this.$tokenIndex -= 1;
  5380. while (this.$tokenIndex < 0) {
  5381. this.$row -= 1;
  5382. if (this.$row < 0) return (this.$row = 0), null;
  5383. (this.$rowTokens = this.$session.getTokens(this.$row)),
  5384. (this.$tokenIndex = this.$rowTokens.length - 1);
  5385. }
  5386. return this.$rowTokens[this.$tokenIndex];
  5387. }),
  5388. (this.stepForward = function () {
  5389. this.$tokenIndex += 1;
  5390. var e;
  5391. while (this.$tokenIndex >= this.$rowTokens.length) {
  5392. (this.$row += 1), e || (e = this.$session.getLength());
  5393. if (this.$row >= e) return (this.$row = e - 1), null;
  5394. (this.$rowTokens = this.$session.getTokens(this.$row)),
  5395. (this.$tokenIndex = 0);
  5396. }
  5397. return this.$rowTokens[this.$tokenIndex];
  5398. }),
  5399. (this.getCurrentToken = function () {
  5400. return this.$rowTokens[this.$tokenIndex];
  5401. }),
  5402. (this.getCurrentTokenRow = function () {
  5403. return this.$row;
  5404. }),
  5405. (this.getCurrentTokenColumn = function () {
  5406. var e = this.$rowTokens,
  5407. t = this.$tokenIndex,
  5408. n = e[t].start;
  5409. if (n !== undefined) return n;
  5410. n = 0;
  5411. while (t > 0) (t -= 1), (n += e[t].value.length);
  5412. return n;
  5413. }),
  5414. (this.getCurrentTokenPosition = function () {
  5415. return { row: this.$row, column: this.getCurrentTokenColumn() };
  5416. }),
  5417. (this.getCurrentTokenRange = function () {
  5418. var e = this.$rowTokens[this.$tokenIndex],
  5419. t = this.getCurrentTokenColumn();
  5420. return new r(this.$row, t, this.$row, t + e.value.length);
  5421. });
  5422. }).call(i.prototype),
  5423. (t.TokenIterator = i);
  5424. }
  5425. ),
  5426. define(
  5427. "ace/mode/behaviour/cstyle",
  5428. [
  5429. "require",
  5430. "exports",
  5431. "module",
  5432. "ace/lib/oop",
  5433. "ace/mode/behaviour",
  5434. "ace/token_iterator",
  5435. "ace/lib/lang",
  5436. ],
  5437. function (e, t, n) {
  5438. "use strict";
  5439. var r = e("../../lib/oop"),
  5440. i = e("../behaviour").Behaviour,
  5441. s = e("../../token_iterator").TokenIterator,
  5442. o = e("../../lib/lang"),
  5443. u = ["text", "paren.rparen", "punctuation.operator"],
  5444. a = ["text", "paren.rparen", "punctuation.operator", "comment"],
  5445. f,
  5446. l = {},
  5447. c = { '"': '"', "'": "'" },
  5448. h = function (e) {
  5449. var t = -1;
  5450. e.multiSelect &&
  5451. ((t = e.selection.index),
  5452. l.rangeCount != e.multiSelect.rangeCount &&
  5453. (l = { rangeCount: e.multiSelect.rangeCount }));
  5454. if (l[t]) return (f = l[t]);
  5455. f = l[t] = {
  5456. autoInsertedBrackets: 0,
  5457. autoInsertedRow: -1,
  5458. autoInsertedLineEnd: "",
  5459. maybeInsertedBrackets: 0,
  5460. maybeInsertedRow: -1,
  5461. maybeInsertedLineStart: "",
  5462. maybeInsertedLineEnd: "",
  5463. };
  5464. },
  5465. p = function (e, t, n, r) {
  5466. var i = e.end.row - e.start.row;
  5467. return {
  5468. text: n + t + r,
  5469. selection: [0, e.start.column + 1, i, e.end.column + (i ? 0 : 1)],
  5470. };
  5471. },
  5472. d = function (e) {
  5473. this.add("braces", "insertion", function (t, n, r, i, s) {
  5474. var u = r.getCursorPosition(),
  5475. a = i.doc.getLine(u.row);
  5476. if (s == "{") {
  5477. h(r);
  5478. var l = r.getSelectionRange(),
  5479. c = i.doc.getTextRange(l);
  5480. if (c !== "" && c !== "{" && r.getWrapBehavioursEnabled())
  5481. return p(l, c, "{", "}");
  5482. if (d.isSaneInsertion(r, i))
  5483. return /[\]\}\)]/.test(a[u.column]) ||
  5484. r.inMultiSelectMode ||
  5485. (e && e.braces)
  5486. ? (d.recordAutoInsert(r, i, "}"),
  5487. { text: "{}", selection: [1, 1] })
  5488. : (d.recordMaybeInsert(r, i, "{"),
  5489. { text: "{", selection: [1, 1] });
  5490. } else if (s == "}") {
  5491. h(r);
  5492. var v = a.substring(u.column, u.column + 1);
  5493. if (v == "}") {
  5494. var m = i.$findOpeningBracket("}", {
  5495. column: u.column + 1,
  5496. row: u.row,
  5497. });
  5498. if (m !== null && d.isAutoInsertedClosing(u, a, s))
  5499. return (
  5500. d.popAutoInsertedClosing(), { text: "", selection: [1, 1] }
  5501. );
  5502. }
  5503. } else {
  5504. if (s == "\n" || s == "\r\n") {
  5505. h(r);
  5506. var g = "";
  5507. d.isMaybeInsertedClosing(u, a) &&
  5508. ((g = o.stringRepeat("}", f.maybeInsertedBrackets)),
  5509. d.clearMaybeInsertedClosing());
  5510. var v = a.substring(u.column, u.column + 1);
  5511. if (v === "}") {
  5512. var y = i.findMatchingBracket(
  5513. { row: u.row, column: u.column + 1 },
  5514. "}"
  5515. );
  5516. if (!y) return null;
  5517. var b = this.$getIndent(i.getLine(y.row));
  5518. } else {
  5519. if (!g) {
  5520. d.clearMaybeInsertedClosing();
  5521. return;
  5522. }
  5523. var b = this.$getIndent(a);
  5524. }
  5525. var w = b + i.getTabString();
  5526. return {
  5527. text: "\n" + w + "\n" + b + g,
  5528. selection: [1, w.length, 1, w.length],
  5529. };
  5530. }
  5531. d.clearMaybeInsertedClosing();
  5532. }
  5533. }),
  5534. this.add("braces", "deletion", function (e, t, n, r, i) {
  5535. var s = r.doc.getTextRange(i);
  5536. if (!i.isMultiLine() && s == "{") {
  5537. h(n);
  5538. var o = r.doc.getLine(i.start.row),
  5539. u = o.substring(i.end.column, i.end.column + 1);
  5540. if (u == "}") return i.end.column++, i;
  5541. f.maybeInsertedBrackets--;
  5542. }
  5543. }),
  5544. this.add("parens", "insertion", function (e, t, n, r, i) {
  5545. if (i == "(") {
  5546. h(n);
  5547. var s = n.getSelectionRange(),
  5548. o = r.doc.getTextRange(s);
  5549. if (o !== "" && n.getWrapBehavioursEnabled())
  5550. return p(s, o, "(", ")");
  5551. if (d.isSaneInsertion(n, r))
  5552. return (
  5553. d.recordAutoInsert(n, r, ")"),
  5554. { text: "()", selection: [1, 1] }
  5555. );
  5556. } else if (i == ")") {
  5557. h(n);
  5558. var u = n.getCursorPosition(),
  5559. a = r.doc.getLine(u.row),
  5560. f = a.substring(u.column, u.column + 1);
  5561. if (f == ")") {
  5562. var l = r.$findOpeningBracket(")", {
  5563. column: u.column + 1,
  5564. row: u.row,
  5565. });
  5566. if (l !== null && d.isAutoInsertedClosing(u, a, i))
  5567. return (
  5568. d.popAutoInsertedClosing(),
  5569. { text: "", selection: [1, 1] }
  5570. );
  5571. }
  5572. }
  5573. }),
  5574. this.add("parens", "deletion", function (e, t, n, r, i) {
  5575. var s = r.doc.getTextRange(i);
  5576. if (!i.isMultiLine() && s == "(") {
  5577. h(n);
  5578. var o = r.doc.getLine(i.start.row),
  5579. u = o.substring(i.start.column + 1, i.start.column + 2);
  5580. if (u == ")") return i.end.column++, i;
  5581. }
  5582. }),
  5583. this.add("brackets", "insertion", function (e, t, n, r, i) {
  5584. if (i == "[") {
  5585. h(n);
  5586. var s = n.getSelectionRange(),
  5587. o = r.doc.getTextRange(s);
  5588. if (o !== "" && n.getWrapBehavioursEnabled())
  5589. return p(s, o, "[", "]");
  5590. if (d.isSaneInsertion(n, r))
  5591. return (
  5592. d.recordAutoInsert(n, r, "]"),
  5593. { text: "[]", selection: [1, 1] }
  5594. );
  5595. } else if (i == "]") {
  5596. h(n);
  5597. var u = n.getCursorPosition(),
  5598. a = r.doc.getLine(u.row),
  5599. f = a.substring(u.column, u.column + 1);
  5600. if (f == "]") {
  5601. var l = r.$findOpeningBracket("]", {
  5602. column: u.column + 1,
  5603. row: u.row,
  5604. });
  5605. if (l !== null && d.isAutoInsertedClosing(u, a, i))
  5606. return (
  5607. d.popAutoInsertedClosing(),
  5608. { text: "", selection: [1, 1] }
  5609. );
  5610. }
  5611. }
  5612. }),
  5613. this.add("brackets", "deletion", function (e, t, n, r, i) {
  5614. var s = r.doc.getTextRange(i);
  5615. if (!i.isMultiLine() && s == "[") {
  5616. h(n);
  5617. var o = r.doc.getLine(i.start.row),
  5618. u = o.substring(i.start.column + 1, i.start.column + 2);
  5619. if (u == "]") return i.end.column++, i;
  5620. }
  5621. }),
  5622. this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
  5623. var s = r.$mode.$quotes || c;
  5624. if (i.length == 1 && s[i]) {
  5625. if (
  5626. this.lineCommentStart &&
  5627. this.lineCommentStart.indexOf(i) != -1
  5628. )
  5629. return;
  5630. h(n);
  5631. var o = i,
  5632. u = n.getSelectionRange(),
  5633. a = r.doc.getTextRange(u);
  5634. if (
  5635. a !== "" &&
  5636. (a.length != 1 || !s[a]) &&
  5637. n.getWrapBehavioursEnabled()
  5638. )
  5639. return p(u, a, o, o);
  5640. if (!a) {
  5641. var f = n.getCursorPosition(),
  5642. l = r.doc.getLine(f.row),
  5643. d = l.substring(f.column - 1, f.column),
  5644. v = l.substring(f.column, f.column + 1),
  5645. m = r.getTokenAt(f.row, f.column),
  5646. g = r.getTokenAt(f.row, f.column + 1);
  5647. if (d == "\\" && m && /escape/.test(m.type)) return null;
  5648. var y = m && /string|escape/.test(m.type),
  5649. b = !g || /string|escape/.test(g.type),
  5650. w;
  5651. if (v == o)
  5652. (w = y !== b), w && /string\.end/.test(g.type) && (w = !1);
  5653. else {
  5654. if (y && !b) return null;
  5655. if (y && b) return null;
  5656. var E = r.$mode.tokenRe;
  5657. E.lastIndex = 0;
  5658. var S = E.test(d);
  5659. E.lastIndex = 0;
  5660. var x = E.test(d);
  5661. if (S || x) return null;
  5662. if (v && !/[\s;,.})\]\\]/.test(v)) return null;
  5663. w = !0;
  5664. }
  5665. return { text: w ? o + o : "", selection: [1, 1] };
  5666. }
  5667. }
  5668. }),
  5669. this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
  5670. var s = r.$mode.$quotes || c,
  5671. o = r.doc.getTextRange(i);
  5672. if (!i.isMultiLine() && s.hasOwnProperty(o)) {
  5673. h(n);
  5674. var u = r.doc.getLine(i.start.row),
  5675. a = u.substring(i.start.column + 1, i.start.column + 2);
  5676. if (a == o) return i.end.column++, i;
  5677. }
  5678. });
  5679. };
  5680. (d.isSaneInsertion = function (e, t) {
  5681. var n = e.getCursorPosition(),
  5682. r = new s(t, n.row, n.column);
  5683. if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
  5684. var i = new s(t, n.row, n.column + 1);
  5685. if (!this.$matchTokenType(i.getCurrentToken() || "text", u))
  5686. return !1;
  5687. }
  5688. return (
  5689. r.stepForward(),
  5690. r.getCurrentTokenRow() !== n.row ||
  5691. this.$matchTokenType(r.getCurrentToken() || "text", a)
  5692. );
  5693. }),
  5694. (d.$matchTokenType = function (e, t) {
  5695. return t.indexOf(e.type || e) > -1;
  5696. }),
  5697. (d.recordAutoInsert = function (e, t, n) {
  5698. var r = e.getCursorPosition(),
  5699. i = t.doc.getLine(r.row);
  5700. this.isAutoInsertedClosing(r, i, f.autoInsertedLineEnd[0]) ||
  5701. (f.autoInsertedBrackets = 0),
  5702. (f.autoInsertedRow = r.row),
  5703. (f.autoInsertedLineEnd = n + i.substr(r.column)),
  5704. f.autoInsertedBrackets++;
  5705. }),
  5706. (d.recordMaybeInsert = function (e, t, n) {
  5707. var r = e.getCursorPosition(),
  5708. i = t.doc.getLine(r.row);
  5709. this.isMaybeInsertedClosing(r, i) || (f.maybeInsertedBrackets = 0),
  5710. (f.maybeInsertedRow = r.row),
  5711. (f.maybeInsertedLineStart = i.substr(0, r.column) + n),
  5712. (f.maybeInsertedLineEnd = i.substr(r.column)),
  5713. f.maybeInsertedBrackets++;
  5714. }),
  5715. (d.isAutoInsertedClosing = function (e, t, n) {
  5716. return (
  5717. f.autoInsertedBrackets > 0 &&
  5718. e.row === f.autoInsertedRow &&
  5719. n === f.autoInsertedLineEnd[0] &&
  5720. t.substr(e.column) === f.autoInsertedLineEnd
  5721. );
  5722. }),
  5723. (d.isMaybeInsertedClosing = function (e, t) {
  5724. return (
  5725. f.maybeInsertedBrackets > 0 &&
  5726. e.row === f.maybeInsertedRow &&
  5727. t.substr(e.column) === f.maybeInsertedLineEnd &&
  5728. t.substr(0, e.column) == f.maybeInsertedLineStart
  5729. );
  5730. }),
  5731. (d.popAutoInsertedClosing = function () {
  5732. (f.autoInsertedLineEnd = f.autoInsertedLineEnd.substr(1)),
  5733. f.autoInsertedBrackets--;
  5734. }),
  5735. (d.clearMaybeInsertedClosing = function () {
  5736. f && ((f.maybeInsertedBrackets = 0), (f.maybeInsertedRow = -1));
  5737. }),
  5738. r.inherits(d, i),
  5739. (t.CstyleBehaviour = d);
  5740. }
  5741. ),
  5742. define("ace/unicode", ["require", "exports", "module"], function (e, t, n) {
  5743. "use strict";
  5744. var r = [
  5745. 48, 9, 8, 25, 5, 0, 2, 25, 48, 0, 11, 0, 5, 0, 6, 22, 2, 30, 2, 457, 5,
  5746. 11, 15, 4, 8, 0, 2, 0, 18, 116, 2, 1, 3, 3, 9, 0, 2, 2, 2, 0, 2, 19, 2,
  5747. 82, 2, 138, 2, 4, 3, 155, 12, 37, 3, 0, 8, 38, 10, 44, 2, 0, 2, 1, 2, 1,
  5748. 2, 0, 9, 26, 6, 2, 30, 10, 7, 61, 2, 9, 5, 101, 2, 7, 3, 9, 2, 18, 3, 0,
  5749. 17, 58, 3, 100, 15, 53, 5, 0, 6, 45, 211, 57, 3, 18, 2, 5, 3, 11, 3, 9,
  5750. 2, 1, 7, 6, 2, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 0, 4, 3, 3, 8, 3, 1, 3, 3,
  5751. 9, 0, 5, 1, 2, 4, 3, 11, 16, 2, 2, 5, 5, 1, 3, 21, 2, 6, 2, 1, 2, 1, 2,
  5752. 1, 3, 0, 2, 4, 5, 1, 3, 2, 4, 0, 8, 3, 2, 0, 8, 15, 12, 2, 2, 8, 2, 2,
  5753. 2, 21, 2, 6, 2, 1, 2, 4, 3, 9, 2, 2, 2, 2, 3, 0, 16, 3, 3, 9, 18, 2, 2,
  5754. 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 3, 8, 3, 1, 3, 2, 9, 1, 5, 1, 2, 4, 3,
  5755. 9, 2, 0, 17, 1, 2, 5, 4, 2, 2, 3, 4, 1, 2, 0, 2, 1, 4, 1, 4, 2, 4, 11,
  5756. 5, 4, 4, 2, 2, 3, 3, 0, 7, 0, 15, 9, 18, 2, 2, 7, 2, 2, 2, 22, 2, 9, 2,
  5757. 4, 4, 7, 2, 2, 2, 3, 8, 1, 2, 1, 7, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22,
  5758. 2, 9, 2, 4, 3, 8, 2, 2, 2, 3, 8, 1, 8, 0, 2, 3, 3, 9, 19, 1, 2, 7, 2, 2,
  5759. 2, 22, 2, 15, 4, 7, 2, 2, 2, 3, 10, 0, 9, 3, 3, 9, 11, 5, 3, 1, 2, 17,
  5760. 4, 23, 2, 8, 2, 0, 3, 6, 4, 0, 5, 5, 2, 0, 2, 7, 19, 1, 14, 57, 6, 14,
  5761. 2, 9, 40, 1, 2, 0, 3, 1, 2, 0, 3, 0, 7, 3, 2, 6, 2, 2, 2, 0, 2, 0, 3, 1,
  5762. 2, 12, 2, 2, 3, 4, 2, 0, 2, 5, 3, 9, 3, 1, 35, 0, 24, 1, 7, 9, 12, 0, 2,
  5763. 0, 2, 0, 5, 9, 2, 35, 5, 19, 2, 5, 5, 7, 2, 35, 10, 0, 58, 73, 7, 77, 3,
  5764. 37, 11, 42, 2, 0, 4, 328, 2, 3, 3, 6, 2, 0, 2, 3, 3, 40, 2, 3, 3, 32, 2,
  5765. 3, 3, 6, 2, 0, 2, 3, 3, 14, 2, 56, 2, 3, 3, 66, 5, 0, 33, 15, 17, 84,
  5766. 13, 619, 3, 16, 2, 25, 6, 74, 22, 12, 2, 6, 12, 20, 12, 19, 13, 12, 2,
  5767. 2, 2, 1, 13, 51, 3, 29, 4, 0, 5, 1, 3, 9, 34, 2, 3, 9, 7, 87, 9, 42, 6,
  5768. 69, 11, 28, 4, 11, 5, 11, 11, 39, 3, 4, 12, 43, 5, 25, 7, 10, 38, 27, 5,
  5769. 62, 2, 28, 3, 10, 7, 9, 14, 0, 89, 75, 5, 9, 18, 8, 13, 42, 4, 11, 71,
  5770. 55, 9, 9, 4, 48, 83, 2, 2, 30, 14, 230, 23, 280, 3, 5, 3, 37, 3, 5, 3,
  5771. 7, 2, 0, 2, 0, 2, 0, 2, 30, 3, 52, 2, 6, 2, 0, 4, 2, 2, 6, 4, 3, 3, 5,
  5772. 5, 12, 6, 2, 2, 6, 67, 1, 20, 0, 29, 0, 14, 0, 17, 4, 60, 12, 5, 0, 4,
  5773. 11, 18, 0, 5, 0, 3, 9, 2, 0, 4, 4, 7, 0, 2, 0, 2, 0, 2, 3, 2, 10, 3, 3,
  5774. 6, 4, 5, 0, 53, 1, 2684, 46, 2, 46, 2, 132, 7, 6, 15, 37, 11, 53, 10, 0,
  5775. 17, 22, 10, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 31, 48, 0,
  5776. 470, 1, 36, 5, 2, 4, 6, 1, 5, 85, 3, 1, 3, 2, 2, 89, 2, 3, 6, 40, 4, 93,
  5777. 18, 23, 57, 15, 513, 6581, 75, 20939, 53, 1164, 68, 45, 3, 268, 4, 27,
  5778. 21, 31, 3, 13, 13, 1, 2, 24, 9, 69, 11, 1, 38, 8, 3, 102, 3, 1, 111, 44,
  5779. 25, 51, 13, 68, 12, 9, 7, 23, 4, 0, 5, 45, 3, 35, 13, 28, 4, 64, 15, 10,
  5780. 39, 54, 10, 13, 3, 9, 7, 22, 4, 1, 5, 66, 25, 2, 227, 42, 2, 1, 3, 9, 7,
  5781. 11171, 13, 22, 5, 48, 8453, 301, 3, 61, 3, 105, 39, 6, 13, 4, 6, 11, 2,
  5782. 12, 2, 4, 2, 0, 2, 1, 2, 1, 2, 107, 34, 362, 19, 63, 3, 53, 41, 11, 5,
  5783. 15, 17, 6, 13, 1, 25, 2, 33, 4, 2, 134, 20, 9, 8, 25, 5, 0, 2, 25, 12,
  5784. 88, 4, 5, 3, 5, 3, 5, 3, 2,
  5785. ],
  5786. i = 0,
  5787. s = [];
  5788. for (var o = 0; o < r.length; o += 2)
  5789. s.push((i += r[o])), r[o + 1] && s.push(45, (i += r[o + 1]));
  5790. t.wordChars = String.fromCharCode.apply(null, s);
  5791. }),
  5792. define(
  5793. "ace/mode/text",
  5794. [
  5795. "require",
  5796. "exports",
  5797. "module",
  5798. "ace/config",
  5799. "ace/tokenizer",
  5800. "ace/mode/text_highlight_rules",
  5801. "ace/mode/behaviour/cstyle",
  5802. "ace/unicode",
  5803. "ace/lib/lang",
  5804. "ace/token_iterator",
  5805. "ace/range",
  5806. ],
  5807. function (e, t, n) {
  5808. "use strict";
  5809. var r = e("../config"),
  5810. i = e("../tokenizer").Tokenizer,
  5811. s = e("./text_highlight_rules").TextHighlightRules,
  5812. o = e("./behaviour/cstyle").CstyleBehaviour,
  5813. u = e("../unicode"),
  5814. a = e("../lib/lang"),
  5815. f = e("../token_iterator").TokenIterator,
  5816. l = e("../range").Range,
  5817. c = function () {
  5818. this.HighlightRules = s;
  5819. };
  5820. (function () {
  5821. (this.$defaultBehaviour = new o()),
  5822. (this.tokenRe = new RegExp("^[" + u.wordChars + "\\$_]+", "g")),
  5823. (this.nonTokenRe = new RegExp(
  5824. "^(?:[^" + u.wordChars + "\\$_]|\\s])+",
  5825. "g"
  5826. )),
  5827. (this.getTokenizer = function () {
  5828. return (
  5829. this.$tokenizer ||
  5830. ((this.$highlightRules =
  5831. this.$highlightRules ||
  5832. new this.HighlightRules(this.$highlightRuleConfig)),
  5833. (this.$tokenizer = new i(this.$highlightRules.getRules()))),
  5834. this.$tokenizer
  5835. );
  5836. }),
  5837. (this.lineCommentStart = ""),
  5838. (this.blockComment = ""),
  5839. (this.toggleCommentLines = function (e, t, n, r) {
  5840. function w(e) {
  5841. for (var t = n; t <= r; t++) e(i.getLine(t), t);
  5842. }
  5843. var i = t.doc,
  5844. s = !0,
  5845. o = !0,
  5846. u = Infinity,
  5847. f = t.getTabSize(),
  5848. l = !1;
  5849. if (!this.lineCommentStart) {
  5850. if (!this.blockComment) return !1;
  5851. var c = this.blockComment.start,
  5852. h = this.blockComment.end,
  5853. p = new RegExp("^(\\s*)(?:" + a.escapeRegExp(c) + ")"),
  5854. d = new RegExp("(?:" + a.escapeRegExp(h) + ")\\s*$"),
  5855. v = function (e, t) {
  5856. if (g(e, t)) return;
  5857. if (!s || /\S/.test(e))
  5858. i.insertInLine({ row: t, column: e.length }, h),
  5859. i.insertInLine({ row: t, column: u }, c);
  5860. },
  5861. m = function (e, t) {
  5862. var n;
  5863. (n = e.match(d)) &&
  5864. i.removeInLine(t, e.length - n[0].length, e.length),
  5865. (n = e.match(p)) &&
  5866. i.removeInLine(t, n[1].length, n[0].length);
  5867. },
  5868. g = function (e, n) {
  5869. if (p.test(e)) return !0;
  5870. var r = t.getTokens(n);
  5871. for (var i = 0; i < r.length; i++)
  5872. if (r[i].type === "comment") return !0;
  5873. };
  5874. } else {
  5875. if (Array.isArray(this.lineCommentStart))
  5876. var p = this.lineCommentStart.map(a.escapeRegExp).join("|"),
  5877. c = this.lineCommentStart[0];
  5878. else
  5879. var p = a.escapeRegExp(this.lineCommentStart),
  5880. c = this.lineCommentStart;
  5881. (p = new RegExp("^(\\s*)(?:" + p + ") ?")),
  5882. (l = t.getUseSoftTabs());
  5883. var m = function (e, t) {
  5884. var n = e.match(p);
  5885. if (!n) return;
  5886. var r = n[1].length,
  5887. s = n[0].length;
  5888. !b(e, r, s) && n[0][s - 1] == " " && s--,
  5889. i.removeInLine(t, r, s);
  5890. },
  5891. y = c + " ",
  5892. v = function (e, t) {
  5893. if (!s || /\S/.test(e))
  5894. b(e, u, u)
  5895. ? i.insertInLine({ row: t, column: u }, y)
  5896. : i.insertInLine({ row: t, column: u }, c);
  5897. },
  5898. g = function (e, t) {
  5899. return p.test(e);
  5900. },
  5901. b = function (e, t, n) {
  5902. var r = 0;
  5903. while (t-- && e.charAt(t) == " ") r++;
  5904. if (r % f != 0) return !1;
  5905. var r = 0;
  5906. while (e.charAt(n++) == " ") r++;
  5907. return f > 2 ? r % f != f - 1 : r % f == 0;
  5908. };
  5909. }
  5910. var E = Infinity;
  5911. w(function (e, t) {
  5912. var n = e.search(/\S/);
  5913. n !== -1
  5914. ? (n < u && (u = n), o && !g(e, t) && (o = !1))
  5915. : E > e.length && (E = e.length);
  5916. }),
  5917. u == Infinity && ((u = E), (s = !1), (o = !1)),
  5918. l && u % f != 0 && (u = Math.floor(u / f) * f),
  5919. w(o ? m : v);
  5920. }),
  5921. (this.toggleBlockComment = function (e, t, n, r) {
  5922. var i = this.blockComment;
  5923. if (!i) return;
  5924. !i.start && i[0] && (i = i[0]);
  5925. var s = new f(t, r.row, r.column),
  5926. o = s.getCurrentToken(),
  5927. u = t.selection,
  5928. a = t.selection.toOrientedRange(),
  5929. c,
  5930. h;
  5931. if (o && /comment/.test(o.type)) {
  5932. var p, d;
  5933. while (o && /comment/.test(o.type)) {
  5934. var v = o.value.indexOf(i.start);
  5935. if (v != -1) {
  5936. var m = s.getCurrentTokenRow(),
  5937. g = s.getCurrentTokenColumn() + v;
  5938. p = new l(m, g, m, g + i.start.length);
  5939. break;
  5940. }
  5941. o = s.stepBackward();
  5942. }
  5943. var s = new f(t, r.row, r.column),
  5944. o = s.getCurrentToken();
  5945. while (o && /comment/.test(o.type)) {
  5946. var v = o.value.indexOf(i.end);
  5947. if (v != -1) {
  5948. var m = s.getCurrentTokenRow(),
  5949. g = s.getCurrentTokenColumn() + v;
  5950. d = new l(m, g, m, g + i.end.length);
  5951. break;
  5952. }
  5953. o = s.stepForward();
  5954. }
  5955. d && t.remove(d),
  5956. p && (t.remove(p), (c = p.start.row), (h = -i.start.length));
  5957. } else
  5958. (h = i.start.length),
  5959. (c = n.start.row),
  5960. t.insert(n.end, i.end),
  5961. t.insert(n.start, i.start);
  5962. a.start.row == c && (a.start.column += h),
  5963. a.end.row == c && (a.end.column += h),
  5964. t.selection.fromOrientedRange(a);
  5965. }),
  5966. (this.getNextLineIndent = function (e, t, n) {
  5967. return this.$getIndent(t);
  5968. }),
  5969. (this.checkOutdent = function (e, t, n) {
  5970. return !1;
  5971. }),
  5972. (this.autoOutdent = function (e, t, n) {}),
  5973. (this.$getIndent = function (e) {
  5974. return e.match(/^\s*/)[0];
  5975. }),
  5976. (this.createWorker = function (e) {
  5977. return null;
  5978. }),
  5979. (this.createModeDelegates = function (e) {
  5980. (this.$embeds = []), (this.$modes = {});
  5981. for (var t in e)
  5982. if (e[t]) {
  5983. var n = e[t],
  5984. i = n.prototype.$id,
  5985. s = r.$modes[i];
  5986. s || (r.$modes[i] = s = new n()),
  5987. r.$modes[t] || (r.$modes[t] = s),
  5988. this.$embeds.push(t),
  5989. (this.$modes[t] = s);
  5990. }
  5991. var o = [
  5992. "toggleBlockComment",
  5993. "toggleCommentLines",
  5994. "getNextLineIndent",
  5995. "checkOutdent",
  5996. "autoOutdent",
  5997. "transformAction",
  5998. "getCompletions",
  5999. ];
  6000. for (var t = 0; t < o.length; t++)
  6001. (function (e) {
  6002. var n = o[t],
  6003. r = e[n];
  6004. e[o[t]] = function () {
  6005. return this.$delegator(n, arguments, r);
  6006. };
  6007. })(this);
  6008. }),
  6009. (this.$delegator = function (e, t, n) {
  6010. var r = t[0];
  6011. if (typeof r != "string") {
  6012. if (Array.isArray(r[2])) {
  6013. var i = r[2][r[2].length - 1],
  6014. s = this.$modes[i];
  6015. if (s) return s[e].apply(s, [r[1]].concat([].slice.call(t, 1)));
  6016. }
  6017. r = r[0];
  6018. }
  6019. for (var o = 0; o < this.$embeds.length; o++) {
  6020. if (!this.$modes[this.$embeds[o]]) continue;
  6021. var u = r.split(this.$embeds[o]);
  6022. if (!u[0] && u[1]) {
  6023. t[0] = u[1];
  6024. var s = this.$modes[this.$embeds[o]];
  6025. return s[e].apply(s, t);
  6026. }
  6027. }
  6028. var a = n.apply(this, t);
  6029. return n ? a : undefined;
  6030. }),
  6031. (this.transformAction = function (e, t, n, r, i) {
  6032. if (this.$behaviour) {
  6033. var s = this.$behaviour.getBehaviours();
  6034. for (var o in s)
  6035. if (s[o][t]) {
  6036. var u = s[o][t].apply(this, arguments);
  6037. if (u) return u;
  6038. }
  6039. }
  6040. }),
  6041. (this.getKeywords = function (e) {
  6042. if (!this.completionKeywords) {
  6043. var t = this.$tokenizer.rules,
  6044. n = [];
  6045. for (var r in t) {
  6046. var i = t[r];
  6047. for (var s = 0, o = i.length; s < o; s++)
  6048. if (typeof i[s].token == "string")
  6049. /keyword|support|storage/.test(i[s].token) &&
  6050. n.push(i[s].regex);
  6051. else if (typeof i[s].token == "object")
  6052. for (var u = 0, a = i[s].token.length; u < a; u++)
  6053. if (/keyword|support|storage/.test(i[s].token[u])) {
  6054. var r = i[s].regex.match(/\(.+?\)/g)[u];
  6055. n.push(r.substr(1, r.length - 2));
  6056. }
  6057. }
  6058. this.completionKeywords = n;
  6059. }
  6060. return e ? n.concat(this.$keywordList || []) : this.$keywordList;
  6061. }),
  6062. (this.$createKeywordList = function () {
  6063. return (
  6064. this.$highlightRules || this.getTokenizer(),
  6065. (this.$keywordList = this.$highlightRules.$keywordList || [])
  6066. );
  6067. }),
  6068. (this.getCompletions = function (e, t, n, r) {
  6069. var i = this.$keywordList || this.$createKeywordList();
  6070. return i.map(function (e) {
  6071. return { name: e, value: e, score: 0, meta: "keyword" };
  6072. });
  6073. }),
  6074. (this.$id = "ace/mode/text");
  6075. }).call(c.prototype),
  6076. (t.Mode = c);
  6077. }
  6078. ),
  6079. define(
  6080. "ace/apply_delta",
  6081. ["require", "exports", "module"],
  6082. function (e, t, n) {
  6083. "use strict";
  6084. function r(e, t) {
  6085. throw (console.log("Invalid Delta:", e), "Invalid Delta: " + t);
  6086. }
  6087. function i(e, t) {
  6088. return (
  6089. t.row >= 0 &&
  6090. t.row < e.length &&
  6091. t.column >= 0 &&
  6092. t.column <= e[t.row].length
  6093. );
  6094. }
  6095. function s(e, t) {
  6096. t.action != "insert" &&
  6097. t.action != "remove" &&
  6098. r(t, "delta.action must be 'insert' or 'remove'"),
  6099. t.lines instanceof Array || r(t, "delta.lines must be an Array"),
  6100. (!t.start || !t.end) && r(t, "delta.start/end must be an present");
  6101. var n = t.start;
  6102. i(e, t.start) || r(t, "delta.start must be contained in document");
  6103. var s = t.end;
  6104. t.action == "remove" &&
  6105. !i(e, s) &&
  6106. r(t, "delta.end must contained in document for 'remove' actions");
  6107. var o = s.row - n.row,
  6108. u = s.column - (o == 0 ? n.column : 0);
  6109. (o != t.lines.length - 1 || t.lines[o].length != u) &&
  6110. r(t, "delta.range must match delta lines");
  6111. }
  6112. t.applyDelta = function (e, t, n) {
  6113. var r = t.start.row,
  6114. i = t.start.column,
  6115. s = e[r] || "";
  6116. switch (t.action) {
  6117. case "insert":
  6118. var o = t.lines;
  6119. if (o.length === 1)
  6120. e[r] = s.substring(0, i) + t.lines[0] + s.substring(i);
  6121. else {
  6122. var u = [r, 1].concat(t.lines);
  6123. e.splice.apply(e, u),
  6124. (e[r] = s.substring(0, i) + e[r]),
  6125. (e[r + t.lines.length - 1] += s.substring(i));
  6126. }
  6127. break;
  6128. case "remove":
  6129. var a = t.end.column,
  6130. f = t.end.row;
  6131. r === f
  6132. ? (e[r] = s.substring(0, i) + s.substring(a))
  6133. : e.splice(r, f - r + 1, s.substring(0, i) + e[f].substring(a));
  6134. }
  6135. };
  6136. }
  6137. ),
  6138. define(
  6139. "ace/anchor",
  6140. ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"],
  6141. function (e, t, n) {
  6142. "use strict";
  6143. var r = e("./lib/oop"),
  6144. i = e("./lib/event_emitter").EventEmitter,
  6145. s = (t.Anchor = function (e, t, n) {
  6146. (this.$onChange = this.onChange.bind(this)),
  6147. this.attach(e),
  6148. typeof n == "undefined"
  6149. ? this.setPosition(t.row, t.column)
  6150. : this.setPosition(t, n);
  6151. });
  6152. (function () {
  6153. function e(e, t, n) {
  6154. var r = n ? e.column <= t.column : e.column < t.column;
  6155. return e.row < t.row || (e.row == t.row && r);
  6156. }
  6157. function t(t, n, r) {
  6158. var i = t.action == "insert",
  6159. s = (i ? 1 : -1) * (t.end.row - t.start.row),
  6160. o = (i ? 1 : -1) * (t.end.column - t.start.column),
  6161. u = t.start,
  6162. a = i ? u : t.end;
  6163. return e(n, u, r)
  6164. ? { row: n.row, column: n.column }
  6165. : e(a, n, !r)
  6166. ? { row: n.row + s, column: n.column + (n.row == a.row ? o : 0) }
  6167. : { row: u.row, column: u.column };
  6168. }
  6169. r.implement(this, i),
  6170. (this.getPosition = function () {
  6171. return this.$clipPositionToDocument(this.row, this.column);
  6172. }),
  6173. (this.getDocument = function () {
  6174. return this.document;
  6175. }),
  6176. (this.$insertRight = !1),
  6177. (this.onChange = function (e) {
  6178. if (e.start.row == e.end.row && e.start.row != this.row) return;
  6179. if (e.start.row > this.row) return;
  6180. var n = t(
  6181. e,
  6182. { row: this.row, column: this.column },
  6183. this.$insertRight
  6184. );
  6185. this.setPosition(n.row, n.column, !0);
  6186. }),
  6187. (this.setPosition = function (e, t, n) {
  6188. var r;
  6189. n
  6190. ? (r = { row: e, column: t })
  6191. : (r = this.$clipPositionToDocument(e, t));
  6192. if (this.row == r.row && this.column == r.column) return;
  6193. var i = { row: this.row, column: this.column };
  6194. (this.row = r.row),
  6195. (this.column = r.column),
  6196. this._signal("change", { old: i, value: r });
  6197. }),
  6198. (this.detach = function () {
  6199. this.document.removeEventListener("change", this.$onChange);
  6200. }),
  6201. (this.attach = function (e) {
  6202. (this.document = e || this.document),
  6203. this.document.on("change", this.$onChange);
  6204. }),
  6205. (this.$clipPositionToDocument = function (e, t) {
  6206. var n = {};
  6207. return (
  6208. e >= this.document.getLength()
  6209. ? ((n.row = Math.max(0, this.document.getLength() - 1)),
  6210. (n.column = this.document.getLine(n.row).length))
  6211. : e < 0
  6212. ? ((n.row = 0), (n.column = 0))
  6213. : ((n.row = e),
  6214. (n.column = Math.min(
  6215. this.document.getLine(n.row).length,
  6216. Math.max(0, t)
  6217. ))),
  6218. t < 0 && (n.column = 0),
  6219. n
  6220. );
  6221. });
  6222. }).call(s.prototype);
  6223. }
  6224. ),
  6225. define(
  6226. "ace/document",
  6227. [
  6228. "require",
  6229. "exports",
  6230. "module",
  6231. "ace/lib/oop",
  6232. "ace/apply_delta",
  6233. "ace/lib/event_emitter",
  6234. "ace/range",
  6235. "ace/anchor",
  6236. ],
  6237. function (e, t, n) {
  6238. "use strict";
  6239. var r = e("./lib/oop"),
  6240. i = e("./apply_delta").applyDelta,
  6241. s = e("./lib/event_emitter").EventEmitter,
  6242. o = e("./range").Range,
  6243. u = e("./anchor").Anchor,
  6244. a = function (e) {
  6245. (this.$lines = [""]),
  6246. e.length === 0
  6247. ? (this.$lines = [""])
  6248. : Array.isArray(e)
  6249. ? this.insertMergedLines({ row: 0, column: 0 }, e)
  6250. : this.insert({ row: 0, column: 0 }, e);
  6251. };
  6252. (function () {
  6253. r.implement(this, s),
  6254. (this.setValue = function (e) {
  6255. var t = this.getLength() - 1;
  6256. this.remove(new o(0, 0, t, this.getLine(t).length)),
  6257. this.insert({ row: 0, column: 0 }, e);
  6258. }),
  6259. (this.getValue = function () {
  6260. return this.getAllLines().join(this.getNewLineCharacter());
  6261. }),
  6262. (this.createAnchor = function (e, t) {
  6263. return new u(this, e, t);
  6264. }),
  6265. "aaa".split(/a/).length === 0
  6266. ? (this.$split = function (e) {
  6267. return e.replace(/\r\n|\r/g, "\n").split("\n");
  6268. })
  6269. : (this.$split = function (e) {
  6270. return e.split(/\r\n|\r|\n/);
  6271. }),
  6272. (this.$detectNewLine = function (e) {
  6273. var t = e.match(/^.*?(\r\n|\r|\n)/m);
  6274. (this.$autoNewLine = t ? t[1] : "\n"),
  6275. this._signal("changeNewLineMode");
  6276. }),
  6277. (this.getNewLineCharacter = function () {
  6278. switch (this.$newLineMode) {
  6279. case "windows":
  6280. return "\r\n";
  6281. case "unix":
  6282. return "\n";
  6283. default:
  6284. return this.$autoNewLine || "\n";
  6285. }
  6286. }),
  6287. (this.$autoNewLine = ""),
  6288. (this.$newLineMode = "auto"),
  6289. (this.setNewLineMode = function (e) {
  6290. if (this.$newLineMode === e) return;
  6291. (this.$newLineMode = e), this._signal("changeNewLineMode");
  6292. }),
  6293. (this.getNewLineMode = function () {
  6294. return this.$newLineMode;
  6295. }),
  6296. (this.isNewLine = function (e) {
  6297. return e == "\r\n" || e == "\r" || e == "\n";
  6298. }),
  6299. (this.getLine = function (e) {
  6300. return this.$lines[e] || "";
  6301. }),
  6302. (this.getLines = function (e, t) {
  6303. return this.$lines.slice(e, t + 1);
  6304. }),
  6305. (this.getAllLines = function () {
  6306. return this.getLines(0, this.getLength());
  6307. }),
  6308. (this.getLength = function () {
  6309. return this.$lines.length;
  6310. }),
  6311. (this.getTextRange = function (e) {
  6312. return this.getLinesForRange(e).join(this.getNewLineCharacter());
  6313. }),
  6314. (this.getLinesForRange = function (e) {
  6315. var t;
  6316. if (e.start.row === e.end.row)
  6317. t = [
  6318. this.getLine(e.start.row).substring(
  6319. e.start.column,
  6320. e.end.column
  6321. ),
  6322. ];
  6323. else {
  6324. (t = this.getLines(e.start.row, e.end.row)),
  6325. (t[0] = (t[0] || "").substring(e.start.column));
  6326. var n = t.length - 1;
  6327. e.end.row - e.start.row == n &&
  6328. (t[n] = t[n].substring(0, e.end.column));
  6329. }
  6330. return t;
  6331. }),
  6332. (this.insertLines = function (e, t) {
  6333. return (
  6334. console.warn(
  6335. "Use of document.insertLines is deprecated. Use the insertFullLines method instead."
  6336. ),
  6337. this.insertFullLines(e, t)
  6338. );
  6339. }),
  6340. (this.removeLines = function (e, t) {
  6341. return (
  6342. console.warn(
  6343. "Use of document.removeLines is deprecated. Use the removeFullLines method instead."
  6344. ),
  6345. this.removeFullLines(e, t)
  6346. );
  6347. }),
  6348. (this.insertNewLine = function (e) {
  6349. return (
  6350. console.warn(
  6351. "Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."
  6352. ),
  6353. this.insertMergedLines(e, ["", ""])
  6354. );
  6355. }),
  6356. (this.insert = function (e, t) {
  6357. return (
  6358. this.getLength() <= 1 && this.$detectNewLine(t),
  6359. this.insertMergedLines(e, this.$split(t))
  6360. );
  6361. }),
  6362. (this.insertInLine = function (e, t) {
  6363. var n = this.clippedPos(e.row, e.column),
  6364. r = this.pos(e.row, e.column + t.length);
  6365. return (
  6366. this.applyDelta(
  6367. { start: n, end: r, action: "insert", lines: [t] },
  6368. !0
  6369. ),
  6370. this.clonePos(r)
  6371. );
  6372. }),
  6373. (this.clippedPos = function (e, t) {
  6374. var n = this.getLength();
  6375. e === undefined
  6376. ? (e = n)
  6377. : e < 0
  6378. ? (e = 0)
  6379. : e >= n && ((e = n - 1), (t = undefined));
  6380. var r = this.getLine(e);
  6381. return (
  6382. t == undefined && (t = r.length),
  6383. (t = Math.min(Math.max(t, 0), r.length)),
  6384. { row: e, column: t }
  6385. );
  6386. }),
  6387. (this.clonePos = function (e) {
  6388. return { row: e.row, column: e.column };
  6389. }),
  6390. (this.pos = function (e, t) {
  6391. return { row: e, column: t };
  6392. }),
  6393. (this.$clipPosition = function (e) {
  6394. var t = this.getLength();
  6395. return (
  6396. e.row >= t
  6397. ? ((e.row = Math.max(0, t - 1)),
  6398. (e.column = this.getLine(t - 1).length))
  6399. : ((e.row = Math.max(0, e.row)),
  6400. (e.column = Math.min(
  6401. Math.max(e.column, 0),
  6402. this.getLine(e.row).length
  6403. ))),
  6404. e
  6405. );
  6406. }),
  6407. (this.insertFullLines = function (e, t) {
  6408. e = Math.min(Math.max(e, 0), this.getLength());
  6409. var n = 0;
  6410. e < this.getLength()
  6411. ? ((t = t.concat([""])), (n = 0))
  6412. : ((t = [""].concat(t)), e--, (n = this.$lines[e].length)),
  6413. this.insertMergedLines({ row: e, column: n }, t);
  6414. }),
  6415. (this.insertMergedLines = function (e, t) {
  6416. var n = this.clippedPos(e.row, e.column),
  6417. r = {
  6418. row: n.row + t.length - 1,
  6419. column: (t.length == 1 ? n.column : 0) + t[t.length - 1].length,
  6420. };
  6421. return (
  6422. this.applyDelta({ start: n, end: r, action: "insert", lines: t }),
  6423. this.clonePos(r)
  6424. );
  6425. }),
  6426. (this.remove = function (e) {
  6427. var t = this.clippedPos(e.start.row, e.start.column),
  6428. n = this.clippedPos(e.end.row, e.end.column);
  6429. return (
  6430. this.applyDelta({
  6431. start: t,
  6432. end: n,
  6433. action: "remove",
  6434. lines: this.getLinesForRange({ start: t, end: n }),
  6435. }),
  6436. this.clonePos(t)
  6437. );
  6438. }),
  6439. (this.removeInLine = function (e, t, n) {
  6440. var r = this.clippedPos(e, t),
  6441. i = this.clippedPos(e, n);
  6442. return (
  6443. this.applyDelta(
  6444. {
  6445. start: r,
  6446. end: i,
  6447. action: "remove",
  6448. lines: this.getLinesForRange({ start: r, end: i }),
  6449. },
  6450. !0
  6451. ),
  6452. this.clonePos(r)
  6453. );
  6454. }),
  6455. (this.removeFullLines = function (e, t) {
  6456. (e = Math.min(Math.max(0, e), this.getLength() - 1)),
  6457. (t = Math.min(Math.max(0, t), this.getLength() - 1));
  6458. var n = t == this.getLength() - 1 && e > 0,
  6459. r = t < this.getLength() - 1,
  6460. i = n ? e - 1 : e,
  6461. s = n ? this.getLine(i).length : 0,
  6462. u = r ? t + 1 : t,
  6463. a = r ? 0 : this.getLine(u).length,
  6464. f = new o(i, s, u, a),
  6465. l = this.$lines.slice(e, t + 1);
  6466. return (
  6467. this.applyDelta({
  6468. start: f.start,
  6469. end: f.end,
  6470. action: "remove",
  6471. lines: this.getLinesForRange(f),
  6472. }),
  6473. l
  6474. );
  6475. }),
  6476. (this.removeNewLine = function (e) {
  6477. e < this.getLength() - 1 &&
  6478. e >= 0 &&
  6479. this.applyDelta({
  6480. start: this.pos(e, this.getLine(e).length),
  6481. end: this.pos(e + 1, 0),
  6482. action: "remove",
  6483. lines: ["", ""],
  6484. });
  6485. }),
  6486. (this.replace = function (e, t) {
  6487. e instanceof o || (e = o.fromPoints(e.start, e.end));
  6488. if (t.length === 0 && e.isEmpty()) return e.start;
  6489. if (t == this.getTextRange(e)) return e.end;
  6490. this.remove(e);
  6491. var n;
  6492. return t ? (n = this.insert(e.start, t)) : (n = e.start), n;
  6493. }),
  6494. (this.applyDeltas = function (e) {
  6495. for (var t = 0; t < e.length; t++) this.applyDelta(e[t]);
  6496. }),
  6497. (this.revertDeltas = function (e) {
  6498. for (var t = e.length - 1; t >= 0; t--) this.revertDelta(e[t]);
  6499. }),
  6500. (this.applyDelta = function (e, t) {
  6501. var n = e.action == "insert";
  6502. if (
  6503. n
  6504. ? e.lines.length <= 1 && !e.lines[0]
  6505. : !o.comparePoints(e.start, e.end)
  6506. )
  6507. return;
  6508. n && e.lines.length > 2e4
  6509. ? this.$splitAndapplyLargeDelta(e, 2e4)
  6510. : (i(this.$lines, e, t), this._signal("change", e));
  6511. }),
  6512. (this.$splitAndapplyLargeDelta = function (e, t) {
  6513. var n = e.lines,
  6514. r = n.length - t + 1,
  6515. i = e.start.row,
  6516. s = e.start.column;
  6517. for (var o = 0, u = 0; o < r; o = u) {
  6518. u += t - 1;
  6519. var a = n.slice(o, u);
  6520. a.push(""),
  6521. this.applyDelta(
  6522. {
  6523. start: this.pos(i + o, s),
  6524. end: this.pos(i + u, (s = 0)),
  6525. action: e.action,
  6526. lines: a,
  6527. },
  6528. !0
  6529. );
  6530. }
  6531. (e.lines = n.slice(o)),
  6532. (e.start.row = i + o),
  6533. (e.start.column = s),
  6534. this.applyDelta(e, !0);
  6535. }),
  6536. (this.revertDelta = function (e) {
  6537. this.applyDelta({
  6538. start: this.clonePos(e.start),
  6539. end: this.clonePos(e.end),
  6540. action: e.action == "insert" ? "remove" : "insert",
  6541. lines: e.lines.slice(),
  6542. });
  6543. }),
  6544. (this.indexToPosition = function (e, t) {
  6545. var n = this.$lines || this.getAllLines(),
  6546. r = this.getNewLineCharacter().length;
  6547. for (var i = t || 0, s = n.length; i < s; i++) {
  6548. e -= n[i].length + r;
  6549. if (e < 0) return { row: i, column: e + n[i].length + r };
  6550. }
  6551. return { row: s - 1, column: e + n[s - 1].length + r };
  6552. }),
  6553. (this.positionToIndex = function (e, t) {
  6554. var n = this.$lines || this.getAllLines(),
  6555. r = this.getNewLineCharacter().length,
  6556. i = 0,
  6557. s = Math.min(e.row, n.length);
  6558. for (var o = t || 0; o < s; ++o) i += n[o].length + r;
  6559. return i + e.column;
  6560. });
  6561. }).call(a.prototype),
  6562. (t.Document = a);
  6563. }
  6564. ),
  6565. define(
  6566. "ace/background_tokenizer",
  6567. ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"],
  6568. function (e, t, n) {
  6569. "use strict";
  6570. var r = e("./lib/oop"),
  6571. i = e("./lib/event_emitter").EventEmitter,
  6572. s = function (e, t) {
  6573. (this.running = !1),
  6574. (this.lines = []),
  6575. (this.states = []),
  6576. (this.currentLine = 0),
  6577. (this.tokenizer = e);
  6578. var n = this;
  6579. this.$worker = function () {
  6580. if (!n.running) return;
  6581. var e = new Date(),
  6582. t = n.currentLine,
  6583. r = -1,
  6584. i = n.doc,
  6585. s = t;
  6586. while (n.lines[t]) t++;
  6587. var o = i.getLength(),
  6588. u = 0;
  6589. n.running = !1;
  6590. while (t < o) {
  6591. n.$tokenizeRow(t), (r = t);
  6592. do t++;
  6593. while (n.lines[t]);
  6594. u++;
  6595. if (u % 5 === 0 && new Date() - e > 20) {
  6596. n.running = setTimeout(n.$worker, 20);
  6597. break;
  6598. }
  6599. }
  6600. (n.currentLine = t),
  6601. r == -1 && (r = t),
  6602. s <= r && n.fireUpdateEvent(s, r);
  6603. };
  6604. };
  6605. (function () {
  6606. r.implement(this, i),
  6607. (this.setTokenizer = function (e) {
  6608. (this.tokenizer = e),
  6609. (this.lines = []),
  6610. (this.states = []),
  6611. this.start(0);
  6612. }),
  6613. (this.setDocument = function (e) {
  6614. (this.doc = e), (this.lines = []), (this.states = []), this.stop();
  6615. }),
  6616. (this.fireUpdateEvent = function (e, t) {
  6617. var n = { first: e, last: t };
  6618. this._signal("update", { data: n });
  6619. }),
  6620. (this.start = function (e) {
  6621. (this.currentLine = Math.min(
  6622. e || 0,
  6623. this.currentLine,
  6624. this.doc.getLength()
  6625. )),
  6626. this.lines.splice(this.currentLine, this.lines.length),
  6627. this.states.splice(this.currentLine, this.states.length),
  6628. this.stop(),
  6629. (this.running = setTimeout(this.$worker, 700));
  6630. }),
  6631. (this.scheduleStart = function () {
  6632. this.running || (this.running = setTimeout(this.$worker, 700));
  6633. }),
  6634. (this.$updateOnChange = function (e) {
  6635. var t = e.start.row,
  6636. n = e.end.row - t;
  6637. if (n === 0) this.lines[t] = null;
  6638. else if (e.action == "remove")
  6639. this.lines.splice(t, n + 1, null),
  6640. this.states.splice(t, n + 1, null);
  6641. else {
  6642. var r = Array(n + 1);
  6643. r.unshift(t, 1),
  6644. this.lines.splice.apply(this.lines, r),
  6645. this.states.splice.apply(this.states, r);
  6646. }
  6647. (this.currentLine = Math.min(
  6648. t,
  6649. this.currentLine,
  6650. this.doc.getLength()
  6651. )),
  6652. this.stop();
  6653. }),
  6654. (this.stop = function () {
  6655. this.running && clearTimeout(this.running), (this.running = !1);
  6656. }),
  6657. (this.getTokens = function (e) {
  6658. return this.lines[e] || this.$tokenizeRow(e);
  6659. }),
  6660. (this.getState = function (e) {
  6661. return (
  6662. this.currentLine == e && this.$tokenizeRow(e),
  6663. this.states[e] || "start"
  6664. );
  6665. }),
  6666. (this.$tokenizeRow = function (e) {
  6667. var t = this.doc.getLine(e),
  6668. n = this.states[e - 1],
  6669. r = this.tokenizer.getLineTokens(t, n, e);
  6670. return (
  6671. this.states[e] + "" != r.state + ""
  6672. ? ((this.states[e] = r.state),
  6673. (this.lines[e + 1] = null),
  6674. this.currentLine > e + 1 && (this.currentLine = e + 1))
  6675. : this.currentLine == e && (this.currentLine = e + 1),
  6676. (this.lines[e] = r.tokens)
  6677. );
  6678. });
  6679. }).call(s.prototype),
  6680. (t.BackgroundTokenizer = s);
  6681. }
  6682. ),
  6683. define(
  6684. "ace/search_highlight",
  6685. [
  6686. "require",
  6687. "exports",
  6688. "module",
  6689. "ace/lib/lang",
  6690. "ace/lib/oop",
  6691. "ace/range",
  6692. ],
  6693. function (e, t, n) {
  6694. "use strict";
  6695. var r = e("./lib/lang"),
  6696. i = e("./lib/oop"),
  6697. s = e("./range").Range,
  6698. o = function (e, t, n) {
  6699. this.setRegexp(e), (this.clazz = t), (this.type = n || "text");
  6700. };
  6701. (function () {
  6702. (this.MAX_RANGES = 500),
  6703. (this.setRegexp = function (e) {
  6704. if (this.regExp + "" == e + "") return;
  6705. (this.regExp = e), (this.cache = []);
  6706. }),
  6707. (this.update = function (e, t, n, i) {
  6708. if (!this.regExp) return;
  6709. var o = i.firstRow,
  6710. u = i.lastRow;
  6711. for (var a = o; a <= u; a++) {
  6712. var f = this.cache[a];
  6713. f == null &&
  6714. ((f = r.getMatchOffsets(n.getLine(a), this.regExp)),
  6715. f.length > this.MAX_RANGES && (f = f.slice(0, this.MAX_RANGES)),
  6716. (f = f.map(function (e) {
  6717. return new s(a, e.offset, a, e.offset + e.length);
  6718. })),
  6719. (this.cache[a] = f.length ? f : ""));
  6720. for (var l = f.length; l--; )
  6721. t.drawSingleLineMarker(e, f[l].toScreenRange(n), this.clazz, i);
  6722. }
  6723. });
  6724. }).call(o.prototype),
  6725. (t.SearchHighlight = o);
  6726. }
  6727. ),
  6728. define(
  6729. "ace/edit_session/fold_line",
  6730. ["require", "exports", "module", "ace/range"],
  6731. function (e, t, n) {
  6732. "use strict";
  6733. function i(e, t) {
  6734. (this.foldData = e),
  6735. Array.isArray(t) ? (this.folds = t) : (t = this.folds = [t]);
  6736. var n = t[t.length - 1];
  6737. (this.range = new r(
  6738. t[0].start.row,
  6739. t[0].start.column,
  6740. n.end.row,
  6741. n.end.column
  6742. )),
  6743. (this.start = this.range.start),
  6744. (this.end = this.range.end),
  6745. this.folds.forEach(function (e) {
  6746. e.setFoldLine(this);
  6747. }, this);
  6748. }
  6749. var r = e("../range").Range;
  6750. (function () {
  6751. (this.shiftRow = function (e) {
  6752. (this.start.row += e),
  6753. (this.end.row += e),
  6754. this.folds.forEach(function (t) {
  6755. (t.start.row += e), (t.end.row += e);
  6756. });
  6757. }),
  6758. (this.addFold = function (e) {
  6759. if (e.sameRow) {
  6760. if (e.start.row < this.startRow || e.endRow > this.endRow)
  6761. throw new Error(
  6762. "Can't add a fold to this FoldLine as it has no connection"
  6763. );
  6764. this.folds.push(e),
  6765. this.folds.sort(function (e, t) {
  6766. return -e.range.compareEnd(t.start.row, t.start.column);
  6767. }),
  6768. this.range.compareEnd(e.start.row, e.start.column) > 0
  6769. ? ((this.end.row = e.end.row),
  6770. (this.end.column = e.end.column))
  6771. : this.range.compareStart(e.end.row, e.end.column) < 0 &&
  6772. ((this.start.row = e.start.row),
  6773. (this.start.column = e.start.column));
  6774. } else if (e.start.row == this.end.row)
  6775. this.folds.push(e),
  6776. (this.end.row = e.end.row),
  6777. (this.end.column = e.end.column);
  6778. else {
  6779. if (e.end.row != this.start.row)
  6780. throw new Error(
  6781. "Trying to add fold to FoldRow that doesn't have a matching row"
  6782. );
  6783. this.folds.unshift(e),
  6784. (this.start.row = e.start.row),
  6785. (this.start.column = e.start.column);
  6786. }
  6787. e.foldLine = this;
  6788. }),
  6789. (this.containsRow = function (e) {
  6790. return e >= this.start.row && e <= this.end.row;
  6791. }),
  6792. (this.walk = function (e, t, n) {
  6793. var r = 0,
  6794. i = this.folds,
  6795. s,
  6796. o,
  6797. u,
  6798. a = !0;
  6799. t == null && ((t = this.end.row), (n = this.end.column));
  6800. for (var f = 0; f < i.length; f++) {
  6801. (s = i[f]), (o = s.range.compareStart(t, n));
  6802. if (o == -1) {
  6803. e(null, t, n, r, a);
  6804. return;
  6805. }
  6806. (u = e(null, s.start.row, s.start.column, r, a)),
  6807. (u = !u && e(s.placeholder, s.start.row, s.start.column, r));
  6808. if (u || o === 0) return;
  6809. (a = !s.sameRow), (r = s.end.column);
  6810. }
  6811. e(null, t, n, r, a);
  6812. }),
  6813. (this.getNextFoldTo = function (e, t) {
  6814. var n, r;
  6815. for (var i = 0; i < this.folds.length; i++) {
  6816. (n = this.folds[i]), (r = n.range.compareEnd(e, t));
  6817. if (r == -1) return { fold: n, kind: "after" };
  6818. if (r === 0) return { fold: n, kind: "inside" };
  6819. }
  6820. return null;
  6821. }),
  6822. (this.addRemoveChars = function (e, t, n) {
  6823. var r = this.getNextFoldTo(e, t),
  6824. i,
  6825. s;
  6826. if (r) {
  6827. i = r.fold;
  6828. if (r.kind == "inside" && i.start.column != t && i.start.row != e)
  6829. window.console && window.console.log(e, t, i);
  6830. else if (i.start.row == e) {
  6831. s = this.folds;
  6832. var o = s.indexOf(i);
  6833. o === 0 && (this.start.column += n);
  6834. for (o; o < s.length; o++) {
  6835. (i = s[o]), (i.start.column += n);
  6836. if (!i.sameRow) return;
  6837. i.end.column += n;
  6838. }
  6839. this.end.column += n;
  6840. }
  6841. }
  6842. }),
  6843. (this.split = function (e, t) {
  6844. var n = this.getNextFoldTo(e, t);
  6845. if (!n || n.kind == "inside") return null;
  6846. var r = n.fold,
  6847. s = this.folds,
  6848. o = this.foldData,
  6849. u = s.indexOf(r),
  6850. a = s[u - 1];
  6851. (this.end.row = a.end.row),
  6852. (this.end.column = a.end.column),
  6853. (s = s.splice(u, s.length - u));
  6854. var f = new i(o, s);
  6855. return o.splice(o.indexOf(this) + 1, 0, f), f;
  6856. }),
  6857. (this.merge = function (e) {
  6858. var t = e.folds;
  6859. for (var n = 0; n < t.length; n++) this.addFold(t[n]);
  6860. var r = this.foldData;
  6861. r.splice(r.indexOf(e), 1);
  6862. }),
  6863. (this.toString = function () {
  6864. var e = [this.range.toString() + ": ["];
  6865. return (
  6866. this.folds.forEach(function (t) {
  6867. e.push(" " + t.toString());
  6868. }),
  6869. e.push("]"),
  6870. e.join("\n")
  6871. );
  6872. }),
  6873. (this.idxToPosition = function (e) {
  6874. var t = 0;
  6875. for (var n = 0; n < this.folds.length; n++) {
  6876. var r = this.folds[n];
  6877. e -= r.start.column - t;
  6878. if (e < 0)
  6879. return { row: r.start.row, column: r.start.column + e };
  6880. e -= r.placeholder.length;
  6881. if (e < 0) return r.start;
  6882. t = r.end.column;
  6883. }
  6884. return { row: this.end.row, column: this.end.column + e };
  6885. });
  6886. }).call(i.prototype),
  6887. (t.FoldLine = i);
  6888. }
  6889. ),
  6890. define(
  6891. "ace/range_list",
  6892. ["require", "exports", "module", "ace/range"],
  6893. function (e, t, n) {
  6894. "use strict";
  6895. var r = e("./range").Range,
  6896. i = r.comparePoints,
  6897. s = function () {
  6898. this.ranges = [];
  6899. };
  6900. (function () {
  6901. (this.comparePoints = i),
  6902. (this.pointIndex = function (e, t, n) {
  6903. var r = this.ranges;
  6904. for (var s = n || 0; s < r.length; s++) {
  6905. var o = r[s],
  6906. u = i(e, o.end);
  6907. if (u > 0) continue;
  6908. var a = i(e, o.start);
  6909. return u === 0
  6910. ? t && a !== 0
  6911. ? -s - 2
  6912. : s
  6913. : a > 0 || (a === 0 && !t)
  6914. ? s
  6915. : -s - 1;
  6916. }
  6917. return -s - 1;
  6918. }),
  6919. (this.add = function (e) {
  6920. var t = !e.isEmpty(),
  6921. n = this.pointIndex(e.start, t);
  6922. n < 0 && (n = -n - 1);
  6923. var r = this.pointIndex(e.end, t, n);
  6924. return r < 0 ? (r = -r - 1) : r++, this.ranges.splice(n, r - n, e);
  6925. }),
  6926. (this.addList = function (e) {
  6927. var t = [];
  6928. for (var n = e.length; n--; ) t.push.apply(t, this.add(e[n]));
  6929. return t;
  6930. }),
  6931. (this.substractPoint = function (e) {
  6932. var t = this.pointIndex(e);
  6933. if (t >= 0) return this.ranges.splice(t, 1);
  6934. }),
  6935. (this.merge = function () {
  6936. var e = [],
  6937. t = this.ranges;
  6938. t = t.sort(function (e, t) {
  6939. return i(e.start, t.start);
  6940. });
  6941. var n = t[0],
  6942. r;
  6943. for (var s = 1; s < t.length; s++) {
  6944. (r = n), (n = t[s]);
  6945. var o = i(r.end, n.start);
  6946. if (o < 0) continue;
  6947. if (o == 0 && !r.isEmpty() && !n.isEmpty()) continue;
  6948. i(r.end, n.end) < 0 &&
  6949. ((r.end.row = n.end.row), (r.end.column = n.end.column)),
  6950. t.splice(s, 1),
  6951. e.push(n),
  6952. (n = r),
  6953. s--;
  6954. }
  6955. return (this.ranges = t), e;
  6956. }),
  6957. (this.contains = function (e, t) {
  6958. return this.pointIndex({ row: e, column: t }) >= 0;
  6959. }),
  6960. (this.containsPoint = function (e) {
  6961. return this.pointIndex(e) >= 0;
  6962. }),
  6963. (this.rangeAtPoint = function (e) {
  6964. var t = this.pointIndex(e);
  6965. if (t >= 0) return this.ranges[t];
  6966. }),
  6967. (this.clipRows = function (e, t) {
  6968. var n = this.ranges;
  6969. if (n[0].start.row > t || n[n.length - 1].start.row < e) return [];
  6970. var r = this.pointIndex({ row: e, column: 0 });
  6971. r < 0 && (r = -r - 1);
  6972. var i = this.pointIndex({ row: t, column: 0 }, r);
  6973. i < 0 && (i = -i - 1);
  6974. var s = [];
  6975. for (var o = r; o < i; o++) s.push(n[o]);
  6976. return s;
  6977. }),
  6978. (this.removeAll = function () {
  6979. return this.ranges.splice(0, this.ranges.length);
  6980. }),
  6981. (this.attach = function (e) {
  6982. this.session && this.detach(),
  6983. (this.session = e),
  6984. (this.onChange = this.$onChange.bind(this)),
  6985. this.session.on("change", this.onChange);
  6986. }),
  6987. (this.detach = function () {
  6988. if (!this.session) return;
  6989. this.session.removeListener("change", this.onChange),
  6990. (this.session = null);
  6991. }),
  6992. (this.$onChange = function (e) {
  6993. var t = e.start,
  6994. n = e.end,
  6995. r = t.row,
  6996. i = n.row,
  6997. s = this.ranges;
  6998. for (var o = 0, u = s.length; o < u; o++) {
  6999. var a = s[o];
  7000. if (a.end.row >= r) break;
  7001. }
  7002. if (e.action == "insert") {
  7003. var f = i - r,
  7004. l = -t.column + n.column;
  7005. for (; o < u; o++) {
  7006. var a = s[o];
  7007. if (a.start.row > r) break;
  7008. a.start.row == r &&
  7009. a.start.column >= t.column &&
  7010. (a.start.column != t.column || !this.$insertRight) &&
  7011. ((a.start.column += l), (a.start.row += f));
  7012. if (a.end.row == r && a.end.column >= t.column) {
  7013. if (a.end.column == t.column && this.$insertRight) continue;
  7014. a.end.column == t.column &&
  7015. l > 0 &&
  7016. o < u - 1 &&
  7017. a.end.column > a.start.column &&
  7018. a.end.column == s[o + 1].start.column &&
  7019. (a.end.column -= l),
  7020. (a.end.column += l),
  7021. (a.end.row += f);
  7022. }
  7023. }
  7024. } else {
  7025. var f = r - i,
  7026. l = t.column - n.column;
  7027. for (; o < u; o++) {
  7028. var a = s[o];
  7029. if (a.start.row > i) break;
  7030. if (
  7031. a.end.row < i &&
  7032. (r < a.end.row || (r == a.end.row && t.column < a.end.column))
  7033. )
  7034. (a.end.row = r), (a.end.column = t.column);
  7035. else if (a.end.row == i)
  7036. if (a.end.column <= n.column) {
  7037. if (f || a.end.column > t.column)
  7038. (a.end.column = t.column), (a.end.row = t.row);
  7039. } else (a.end.column += l), (a.end.row += f);
  7040. else a.end.row > i && (a.end.row += f);
  7041. if (
  7042. a.start.row < i &&
  7043. (r < a.start.row ||
  7044. (r == a.start.row && t.column < a.start.column))
  7045. )
  7046. (a.start.row = r), (a.start.column = t.column);
  7047. else if (a.start.row == i)
  7048. if (a.start.column <= n.column) {
  7049. if (f || a.start.column > t.column)
  7050. (a.start.column = t.column), (a.start.row = t.row);
  7051. } else (a.start.column += l), (a.start.row += f);
  7052. else a.start.row > i && (a.start.row += f);
  7053. }
  7054. }
  7055. if (f != 0 && o < u)
  7056. for (; o < u; o++) {
  7057. var a = s[o];
  7058. (a.start.row += f), (a.end.row += f);
  7059. }
  7060. });
  7061. }).call(s.prototype),
  7062. (t.RangeList = s);
  7063. }
  7064. ),
  7065. define(
  7066. "ace/edit_session/fold",
  7067. [
  7068. "require",
  7069. "exports",
  7070. "module",
  7071. "ace/range",
  7072. "ace/range_list",
  7073. "ace/lib/oop",
  7074. ],
  7075. function (e, t, n) {
  7076. "use strict";
  7077. function u(e, t) {
  7078. (e.row -= t.row), e.row == 0 && (e.column -= t.column);
  7079. }
  7080. function a(e, t) {
  7081. u(e.start, t), u(e.end, t);
  7082. }
  7083. function f(e, t) {
  7084. e.row == 0 && (e.column += t.column), (e.row += t.row);
  7085. }
  7086. function l(e, t) {
  7087. f(e.start, t), f(e.end, t);
  7088. }
  7089. var r = e("../range").Range,
  7090. i = e("../range_list").RangeList,
  7091. s = e("../lib/oop"),
  7092. o = (t.Fold = function (e, t) {
  7093. (this.foldLine = null),
  7094. (this.placeholder = t),
  7095. (this.range = e),
  7096. (this.start = e.start),
  7097. (this.end = e.end),
  7098. (this.sameRow = e.start.row == e.end.row),
  7099. (this.subFolds = this.ranges = []);
  7100. });
  7101. s.inherits(o, i),
  7102. function () {
  7103. (this.toString = function () {
  7104. return '"' + this.placeholder + '" ' + this.range.toString();
  7105. }),
  7106. (this.setFoldLine = function (e) {
  7107. (this.foldLine = e),
  7108. this.subFolds.forEach(function (t) {
  7109. t.setFoldLine(e);
  7110. });
  7111. }),
  7112. (this.clone = function () {
  7113. var e = this.range.clone(),
  7114. t = new o(e, this.placeholder);
  7115. return (
  7116. this.subFolds.forEach(function (e) {
  7117. t.subFolds.push(e.clone());
  7118. }),
  7119. (t.collapseChildren = this.collapseChildren),
  7120. t
  7121. );
  7122. }),
  7123. (this.addSubFold = function (e) {
  7124. if (this.range.isEqual(e)) return;
  7125. if (!this.range.containsRange(e))
  7126. throw new Error(
  7127. "A fold can't intersect already existing fold" +
  7128. e.range +
  7129. this.range
  7130. );
  7131. a(e, this.start);
  7132. var t = e.start.row,
  7133. n = e.start.column;
  7134. for (var r = 0, i = -1; r < this.subFolds.length; r++) {
  7135. i = this.subFolds[r].range.compare(t, n);
  7136. if (i != 1) break;
  7137. }
  7138. var s = this.subFolds[r];
  7139. if (i == 0) return s.addSubFold(e);
  7140. var t = e.range.end.row,
  7141. n = e.range.end.column;
  7142. for (var o = r, i = -1; o < this.subFolds.length; o++) {
  7143. i = this.subFolds[o].range.compare(t, n);
  7144. if (i != 1) break;
  7145. }
  7146. var u = this.subFolds[o];
  7147. if (i == 0)
  7148. throw new Error(
  7149. "A fold can't intersect already existing fold" +
  7150. e.range +
  7151. this.range
  7152. );
  7153. var f = this.subFolds.splice(r, o - r, e);
  7154. return e.setFoldLine(this.foldLine), e;
  7155. }),
  7156. (this.restoreRange = function (e) {
  7157. return l(e, this.start);
  7158. });
  7159. }.call(o.prototype);
  7160. }
  7161. ),
  7162. define(
  7163. "ace/edit_session/folding",
  7164. [
  7165. "require",
  7166. "exports",
  7167. "module",
  7168. "ace/range",
  7169. "ace/edit_session/fold_line",
  7170. "ace/edit_session/fold",
  7171. "ace/token_iterator",
  7172. ],
  7173. function (e, t, n) {
  7174. "use strict";
  7175. function u() {
  7176. (this.getFoldAt = function (e, t, n) {
  7177. var r = this.getFoldLine(e);
  7178. if (!r) return null;
  7179. var i = r.folds;
  7180. for (var s = 0; s < i.length; s++) {
  7181. var o = i[s];
  7182. if (o.range.contains(e, t)) {
  7183. if (n == 1 && o.range.isEnd(e, t)) continue;
  7184. if (n == -1 && o.range.isStart(e, t)) continue;
  7185. return o;
  7186. }
  7187. }
  7188. }),
  7189. (this.getFoldsInRange = function (e) {
  7190. var t = e.start,
  7191. n = e.end,
  7192. r = this.$foldData,
  7193. i = [];
  7194. (t.column += 1), (n.column -= 1);
  7195. for (var s = 0; s < r.length; s++) {
  7196. var o = r[s].range.compareRange(e);
  7197. if (o == 2) continue;
  7198. if (o == -2) break;
  7199. var u = r[s].folds;
  7200. for (var a = 0; a < u.length; a++) {
  7201. var f = u[a];
  7202. o = f.range.compareRange(e);
  7203. if (o == -2) break;
  7204. if (o == 2) continue;
  7205. if (o == 42) break;
  7206. i.push(f);
  7207. }
  7208. }
  7209. return (t.column -= 1), (n.column += 1), i;
  7210. }),
  7211. (this.getFoldsInRangeList = function (e) {
  7212. if (Array.isArray(e)) {
  7213. var t = [];
  7214. e.forEach(function (e) {
  7215. t = t.concat(this.getFoldsInRange(e));
  7216. }, this);
  7217. } else var t = this.getFoldsInRange(e);
  7218. return t;
  7219. }),
  7220. (this.getAllFolds = function () {
  7221. var e = [],
  7222. t = this.$foldData;
  7223. for (var n = 0; n < t.length; n++)
  7224. for (var r = 0; r < t[n].folds.length; r++) e.push(t[n].folds[r]);
  7225. return e;
  7226. }),
  7227. (this.getFoldStringAt = function (e, t, n, r) {
  7228. r = r || this.getFoldLine(e);
  7229. if (!r) return null;
  7230. var i = { end: { column: 0 } },
  7231. s,
  7232. o;
  7233. for (var u = 0; u < r.folds.length; u++) {
  7234. o = r.folds[u];
  7235. var a = o.range.compareEnd(e, t);
  7236. if (a == -1) {
  7237. s = this.getLine(o.start.row).substring(
  7238. i.end.column,
  7239. o.start.column
  7240. );
  7241. break;
  7242. }
  7243. if (a === 0) return null;
  7244. i = o;
  7245. }
  7246. return (
  7247. s || (s = this.getLine(o.start.row).substring(i.end.column)),
  7248. n == -1
  7249. ? s.substring(0, t - i.end.column)
  7250. : n == 1
  7251. ? s.substring(t - i.end.column)
  7252. : s
  7253. );
  7254. }),
  7255. (this.getFoldLine = function (e, t) {
  7256. var n = this.$foldData,
  7257. r = 0;
  7258. t && (r = n.indexOf(t)), r == -1 && (r = 0);
  7259. for (r; r < n.length; r++) {
  7260. var i = n[r];
  7261. if (i.start.row <= e && i.end.row >= e) return i;
  7262. if (i.end.row > e) return null;
  7263. }
  7264. return null;
  7265. }),
  7266. (this.getNextFoldLine = function (e, t) {
  7267. var n = this.$foldData,
  7268. r = 0;
  7269. t && (r = n.indexOf(t)), r == -1 && (r = 0);
  7270. for (r; r < n.length; r++) {
  7271. var i = n[r];
  7272. if (i.end.row >= e) return i;
  7273. }
  7274. return null;
  7275. }),
  7276. (this.getFoldedRowCount = function (e, t) {
  7277. var n = this.$foldData,
  7278. r = t - e + 1;
  7279. for (var i = 0; i < n.length; i++) {
  7280. var s = n[i],
  7281. o = s.end.row,
  7282. u = s.start.row;
  7283. if (o >= t) {
  7284. u < t && (u >= e ? (r -= t - u) : (r = 0));
  7285. break;
  7286. }
  7287. o >= e && (u >= e ? (r -= o - u) : (r -= o - e + 1));
  7288. }
  7289. return r;
  7290. }),
  7291. (this.$addFoldLine = function (e) {
  7292. return (
  7293. this.$foldData.push(e),
  7294. this.$foldData.sort(function (e, t) {
  7295. return e.start.row - t.start.row;
  7296. }),
  7297. e
  7298. );
  7299. }),
  7300. (this.addFold = function (e, t) {
  7301. var n = this.$foldData,
  7302. r = !1,
  7303. o;
  7304. e instanceof s
  7305. ? (o = e)
  7306. : ((o = new s(t, e)), (o.collapseChildren = t.collapseChildren)),
  7307. this.$clipRangeToDocument(o.range);
  7308. var u = o.start.row,
  7309. a = o.start.column,
  7310. f = o.end.row,
  7311. l = o.end.column;
  7312. if (u < f || (u == f && a <= l - 2)) {
  7313. var c = this.getFoldAt(u, a, 1),
  7314. h = this.getFoldAt(f, l, -1);
  7315. if (c && h == c) return c.addSubFold(o);
  7316. c && !c.range.isStart(u, a) && this.removeFold(c),
  7317. h && !h.range.isEnd(f, l) && this.removeFold(h);
  7318. var p = this.getFoldsInRange(o.range);
  7319. p.length > 0 &&
  7320. (this.removeFolds(p),
  7321. p.forEach(function (e) {
  7322. o.addSubFold(e);
  7323. }));
  7324. for (var d = 0; d < n.length; d++) {
  7325. var v = n[d];
  7326. if (f == v.start.row) {
  7327. v.addFold(o), (r = !0);
  7328. break;
  7329. }
  7330. if (u == v.end.row) {
  7331. v.addFold(o), (r = !0);
  7332. if (!o.sameRow) {
  7333. var m = n[d + 1];
  7334. if (m && m.start.row == f) {
  7335. v.merge(m);
  7336. break;
  7337. }
  7338. }
  7339. break;
  7340. }
  7341. if (f <= v.start.row) break;
  7342. }
  7343. return (
  7344. r || (v = this.$addFoldLine(new i(this.$foldData, o))),
  7345. this.$useWrapMode
  7346. ? this.$updateWrapData(v.start.row, v.start.row)
  7347. : this.$updateRowLengthCache(v.start.row, v.start.row),
  7348. (this.$modified = !0),
  7349. this._signal("changeFold", { data: o, action: "add" }),
  7350. o
  7351. );
  7352. }
  7353. throw new Error("The range has to be at least 2 characters width");
  7354. }),
  7355. (this.addFolds = function (e) {
  7356. e.forEach(function (e) {
  7357. this.addFold(e);
  7358. }, this);
  7359. }),
  7360. (this.removeFold = function (e) {
  7361. var t = e.foldLine,
  7362. n = t.start.row,
  7363. r = t.end.row,
  7364. i = this.$foldData,
  7365. s = t.folds;
  7366. if (s.length == 1) i.splice(i.indexOf(t), 1);
  7367. else if (t.range.isEnd(e.end.row, e.end.column))
  7368. s.pop(),
  7369. (t.end.row = s[s.length - 1].end.row),
  7370. (t.end.column = s[s.length - 1].end.column);
  7371. else if (t.range.isStart(e.start.row, e.start.column))
  7372. s.shift(),
  7373. (t.start.row = s[0].start.row),
  7374. (t.start.column = s[0].start.column);
  7375. else if (e.sameRow) s.splice(s.indexOf(e), 1);
  7376. else {
  7377. var o = t.split(e.start.row, e.start.column);
  7378. (s = o.folds),
  7379. s.shift(),
  7380. (o.start.row = s[0].start.row),
  7381. (o.start.column = s[0].start.column);
  7382. }
  7383. this.$updating ||
  7384. (this.$useWrapMode
  7385. ? this.$updateWrapData(n, r)
  7386. : this.$updateRowLengthCache(n, r)),
  7387. (this.$modified = !0),
  7388. this._signal("changeFold", { data: e, action: "remove" });
  7389. }),
  7390. (this.removeFolds = function (e) {
  7391. var t = [];
  7392. for (var n = 0; n < e.length; n++) t.push(e[n]);
  7393. t.forEach(function (e) {
  7394. this.removeFold(e);
  7395. }, this),
  7396. (this.$modified = !0);
  7397. }),
  7398. (this.expandFold = function (e) {
  7399. this.removeFold(e),
  7400. e.subFolds.forEach(function (t) {
  7401. e.restoreRange(t), this.addFold(t);
  7402. }, this),
  7403. e.collapseChildren > 0 &&
  7404. this.foldAll(
  7405. e.start.row + 1,
  7406. e.end.row,
  7407. e.collapseChildren - 1
  7408. ),
  7409. (e.subFolds = []);
  7410. }),
  7411. (this.expandFolds = function (e) {
  7412. e.forEach(function (e) {
  7413. this.expandFold(e);
  7414. }, this);
  7415. }),
  7416. (this.unfold = function (e, t) {
  7417. var n, i;
  7418. e == null
  7419. ? ((n = new r(0, 0, this.getLength(), 0)), (t = !0))
  7420. : typeof e == "number"
  7421. ? (n = new r(e, 0, e, this.getLine(e).length))
  7422. : "row" in e
  7423. ? (n = r.fromPoints(e, e))
  7424. : (n = e),
  7425. (i = this.getFoldsInRangeList(n));
  7426. if (t) this.removeFolds(i);
  7427. else {
  7428. var s = i;
  7429. while (s.length)
  7430. this.expandFolds(s), (s = this.getFoldsInRangeList(n));
  7431. }
  7432. if (i.length) return i;
  7433. }),
  7434. (this.isRowFolded = function (e, t) {
  7435. return !!this.getFoldLine(e, t);
  7436. }),
  7437. (this.getRowFoldEnd = function (e, t) {
  7438. var n = this.getFoldLine(e, t);
  7439. return n ? n.end.row : e;
  7440. }),
  7441. (this.getRowFoldStart = function (e, t) {
  7442. var n = this.getFoldLine(e, t);
  7443. return n ? n.start.row : e;
  7444. }),
  7445. (this.getFoldDisplayLine = function (e, t, n, r, i) {
  7446. r == null && (r = e.start.row),
  7447. i == null && (i = 0),
  7448. t == null && (t = e.end.row),
  7449. n == null && (n = this.getLine(t).length);
  7450. var s = this.doc,
  7451. o = "";
  7452. return (
  7453. e.walk(
  7454. function (e, t, n, u) {
  7455. if (t < r) return;
  7456. if (t == r) {
  7457. if (n < i) return;
  7458. u = Math.max(i, u);
  7459. }
  7460. e != null ? (o += e) : (o += s.getLine(t).substring(u, n));
  7461. },
  7462. t,
  7463. n
  7464. ),
  7465. o
  7466. );
  7467. }),
  7468. (this.getDisplayLine = function (e, t, n, r) {
  7469. var i = this.getFoldLine(e);
  7470. if (!i) {
  7471. var s;
  7472. return (
  7473. (s = this.doc.getLine(e)), s.substring(r || 0, t || s.length)
  7474. );
  7475. }
  7476. return this.getFoldDisplayLine(i, e, t, n, r);
  7477. }),
  7478. (this.$cloneFoldData = function () {
  7479. var e = [];
  7480. return (
  7481. (e = this.$foldData.map(function (t) {
  7482. var n = t.folds.map(function (e) {
  7483. return e.clone();
  7484. });
  7485. return new i(e, n);
  7486. })),
  7487. e
  7488. );
  7489. }),
  7490. (this.toggleFold = function (e) {
  7491. var t = this.selection,
  7492. n = t.getRange(),
  7493. r,
  7494. i;
  7495. if (n.isEmpty()) {
  7496. var s = n.start;
  7497. r = this.getFoldAt(s.row, s.column);
  7498. if (r) {
  7499. this.expandFold(r);
  7500. return;
  7501. }
  7502. (i = this.findMatchingBracket(s))
  7503. ? n.comparePoint(i) == 1
  7504. ? (n.end = i)
  7505. : ((n.start = i), n.start.column++, n.end.column--)
  7506. : (i = this.findMatchingBracket({
  7507. row: s.row,
  7508. column: s.column + 1,
  7509. }))
  7510. ? (n.comparePoint(i) == 1 ? (n.end = i) : (n.start = i),
  7511. n.start.column++)
  7512. : (n = this.getCommentFoldRange(s.row, s.column) || n);
  7513. } else {
  7514. var o = this.getFoldsInRange(n);
  7515. if (e && o.length) {
  7516. this.expandFolds(o);
  7517. return;
  7518. }
  7519. o.length == 1 && (r = o[0]);
  7520. }
  7521. r || (r = this.getFoldAt(n.start.row, n.start.column));
  7522. if (r && r.range.toString() == n.toString()) {
  7523. this.expandFold(r);
  7524. return;
  7525. }
  7526. var u = "...";
  7527. if (!n.isMultiLine()) {
  7528. u = this.getTextRange(n);
  7529. if (u.length < 4) return;
  7530. u = u.trim().substring(0, 2) + "..";
  7531. }
  7532. this.addFold(u, n);
  7533. }),
  7534. (this.getCommentFoldRange = function (e, t, n) {
  7535. var i = new o(this, e, t),
  7536. s = i.getCurrentToken(),
  7537. u = s.type;
  7538. if (s && /^comment|string/.test(u)) {
  7539. (u = u.match(/comment|string/)[0]),
  7540. u == "comment" && (u += "|doc-start");
  7541. var a = new RegExp(u),
  7542. f = new r();
  7543. if (n != 1) {
  7544. do s = i.stepBackward();
  7545. while (s && a.test(s.type));
  7546. i.stepForward();
  7547. }
  7548. (f.start.row = i.getCurrentTokenRow()),
  7549. (f.start.column = i.getCurrentTokenColumn() + 2),
  7550. (i = new o(this, e, t));
  7551. if (n != -1) {
  7552. var l = -1;
  7553. do {
  7554. s = i.stepForward();
  7555. if (l == -1) {
  7556. var c = this.getState(i.$row);
  7557. a.test(c) || (l = i.$row);
  7558. } else if (i.$row > l) break;
  7559. } while (s && a.test(s.type));
  7560. s = i.stepBackward();
  7561. } else s = i.getCurrentToken();
  7562. return (
  7563. (f.end.row = i.getCurrentTokenRow()),
  7564. (f.end.column = i.getCurrentTokenColumn() + s.value.length - 2),
  7565. f
  7566. );
  7567. }
  7568. }),
  7569. (this.foldAll = function (e, t, n) {
  7570. n == undefined && (n = 1e5);
  7571. var r = this.foldWidgets;
  7572. if (!r) return;
  7573. (t = t || this.getLength()), (e = e || 0);
  7574. for (var i = e; i < t; i++) {
  7575. r[i] == null && (r[i] = this.getFoldWidget(i));
  7576. if (r[i] != "start") continue;
  7577. var s = this.getFoldWidgetRange(i);
  7578. if (s && s.isMultiLine() && s.end.row <= t && s.start.row >= e) {
  7579. i = s.end.row;
  7580. try {
  7581. var o = this.addFold("...", s);
  7582. o && (o.collapseChildren = n);
  7583. } catch (u) {}
  7584. }
  7585. }
  7586. }),
  7587. (this.$foldStyles = { manual: 1, markbegin: 1, markbeginend: 1 }),
  7588. (this.$foldStyle = "markbegin"),
  7589. (this.setFoldStyle = function (e) {
  7590. if (!this.$foldStyles[e])
  7591. throw new Error(
  7592. "invalid fold style: " +
  7593. e +
  7594. "[" +
  7595. Object.keys(this.$foldStyles).join(", ") +
  7596. "]"
  7597. );
  7598. if (this.$foldStyle == e) return;
  7599. (this.$foldStyle = e), e == "manual" && this.unfold();
  7600. var t = this.$foldMode;
  7601. this.$setFolding(null), this.$setFolding(t);
  7602. }),
  7603. (this.$setFolding = function (e) {
  7604. if (this.$foldMode == e) return;
  7605. (this.$foldMode = e),
  7606. this.off("change", this.$updateFoldWidgets),
  7607. this.off("tokenizerUpdate", this.$tokenizerUpdateFoldWidgets),
  7608. this._signal("changeAnnotation");
  7609. if (!e || this.$foldStyle == "manual") {
  7610. this.foldWidgets = null;
  7611. return;
  7612. }
  7613. (this.foldWidgets = []),
  7614. (this.getFoldWidget = e.getFoldWidget.bind(
  7615. e,
  7616. this,
  7617. this.$foldStyle
  7618. )),
  7619. (this.getFoldWidgetRange = e.getFoldWidgetRange.bind(
  7620. e,
  7621. this,
  7622. this.$foldStyle
  7623. )),
  7624. (this.$updateFoldWidgets = this.updateFoldWidgets.bind(this)),
  7625. (this.$tokenizerUpdateFoldWidgets =
  7626. this.tokenizerUpdateFoldWidgets.bind(this)),
  7627. this.on("change", this.$updateFoldWidgets),
  7628. this.on("tokenizerUpdate", this.$tokenizerUpdateFoldWidgets);
  7629. }),
  7630. (this.getParentFoldRangeData = function (e, t) {
  7631. var n = this.foldWidgets;
  7632. if (!n || (t && n[e])) return {};
  7633. var r = e - 1,
  7634. i;
  7635. while (r >= 0) {
  7636. var s = n[r];
  7637. s == null && (s = n[r] = this.getFoldWidget(r));
  7638. if (s == "start") {
  7639. var o = this.getFoldWidgetRange(r);
  7640. i || (i = o);
  7641. if (o && o.end.row >= e) break;
  7642. }
  7643. r--;
  7644. }
  7645. return { range: r !== -1 && o, firstRange: i };
  7646. }),
  7647. (this.onFoldWidgetClick = function (e, t) {
  7648. t = t.domEvent;
  7649. var n = {
  7650. children: t.shiftKey,
  7651. all: t.ctrlKey || t.metaKey,
  7652. siblings: t.altKey,
  7653. },
  7654. r = this.$toggleFoldWidget(e, n);
  7655. if (!r) {
  7656. var i = t.target || t.srcElement;
  7657. i &&
  7658. /ace_fold-widget/.test(i.className) &&
  7659. (i.className += " ace_invalid");
  7660. }
  7661. }),
  7662. (this.$toggleFoldWidget = function (e, t) {
  7663. if (!this.getFoldWidget) return;
  7664. var n = this.getFoldWidget(e),
  7665. r = this.getLine(e),
  7666. i = n === "end" ? -1 : 1,
  7667. s = this.getFoldAt(e, i === -1 ? 0 : r.length, i);
  7668. if (s)
  7669. return (
  7670. t.children || t.all ? this.removeFold(s) : this.expandFold(s), s
  7671. );
  7672. var o = this.getFoldWidgetRange(e, !0);
  7673. if (o && !o.isMultiLine()) {
  7674. s = this.getFoldAt(o.start.row, o.start.column, 1);
  7675. if (s && o.isEqual(s.range)) return this.removeFold(s), s;
  7676. }
  7677. if (t.siblings) {
  7678. var u = this.getParentFoldRangeData(e);
  7679. if (u.range)
  7680. var a = u.range.start.row + 1,
  7681. f = u.range.end.row;
  7682. this.foldAll(a, f, t.all ? 1e4 : 0);
  7683. } else
  7684. t.children
  7685. ? ((f = o ? o.end.row : this.getLength()),
  7686. this.foldAll(e + 1, f, t.all ? 1e4 : 0))
  7687. : o &&
  7688. (t.all && (o.collapseChildren = 1e4), this.addFold("...", o));
  7689. return o;
  7690. }),
  7691. (this.toggleFoldWidget = function (e) {
  7692. var t = this.selection.getCursor().row;
  7693. t = this.getRowFoldStart(t);
  7694. var n = this.$toggleFoldWidget(t, {});
  7695. if (n) return;
  7696. var r = this.getParentFoldRangeData(t, !0);
  7697. n = r.range || r.firstRange;
  7698. if (n) {
  7699. t = n.start.row;
  7700. var i = this.getFoldAt(t, this.getLine(t).length, 1);
  7701. i ? this.removeFold(i) : this.addFold("...", n);
  7702. }
  7703. }),
  7704. (this.updateFoldWidgets = function (e) {
  7705. var t = e.start.row,
  7706. n = e.end.row - t;
  7707. if (n === 0) this.foldWidgets[t] = null;
  7708. else if (e.action == "remove")
  7709. this.foldWidgets.splice(t, n + 1, null);
  7710. else {
  7711. var r = Array(n + 1);
  7712. r.unshift(t, 1),
  7713. this.foldWidgets.splice.apply(this.foldWidgets, r);
  7714. }
  7715. }),
  7716. (this.tokenizerUpdateFoldWidgets = function (e) {
  7717. var t = e.data;
  7718. t.first != t.last &&
  7719. this.foldWidgets.length > t.first &&
  7720. this.foldWidgets.splice(t.first, this.foldWidgets.length);
  7721. });
  7722. }
  7723. var r = e("../range").Range,
  7724. i = e("./fold_line").FoldLine,
  7725. s = e("./fold").Fold,
  7726. o = e("../token_iterator").TokenIterator;
  7727. t.Folding = u;
  7728. }
  7729. ),
  7730. define(
  7731. "ace/edit_session/bracket_match",
  7732. ["require", "exports", "module", "ace/token_iterator", "ace/range"],
  7733. function (e, t, n) {
  7734. "use strict";
  7735. function s() {
  7736. (this.findMatchingBracket = function (e, t) {
  7737. if (e.column == 0) return null;
  7738. var n = t || this.getLine(e.row).charAt(e.column - 1);
  7739. if (n == "") return null;
  7740. var r = n.match(/([\(\[\{])|([\)\]\}])/);
  7741. return r
  7742. ? r[1]
  7743. ? this.$findClosingBracket(r[1], e)
  7744. : this.$findOpeningBracket(r[2], e)
  7745. : null;
  7746. }),
  7747. (this.getBracketRange = function (e) {
  7748. var t = this.getLine(e.row),
  7749. n = !0,
  7750. r,
  7751. s = t.charAt(e.column - 1),
  7752. o = s && s.match(/([\(\[\{])|([\)\]\}])/);
  7753. o ||
  7754. ((s = t.charAt(e.column)),
  7755. (e = { row: e.row, column: e.column + 1 }),
  7756. (o = s && s.match(/([\(\[\{])|([\)\]\}])/)),
  7757. (n = !1));
  7758. if (!o) return null;
  7759. if (o[1]) {
  7760. var u = this.$findClosingBracket(o[1], e);
  7761. if (!u) return null;
  7762. (r = i.fromPoints(e, u)),
  7763. n || (r.end.column++, r.start.column--),
  7764. (r.cursor = r.end);
  7765. } else {
  7766. var u = this.$findOpeningBracket(o[2], e);
  7767. if (!u) return null;
  7768. (r = i.fromPoints(u, e)),
  7769. n || (r.start.column++, r.end.column--),
  7770. (r.cursor = r.start);
  7771. }
  7772. return r;
  7773. }),
  7774. (this.$brackets = {
  7775. ")": "(",
  7776. "(": ")",
  7777. "]": "[",
  7778. "[": "]",
  7779. "{": "}",
  7780. "}": "{",
  7781. }),
  7782. (this.$findOpeningBracket = function (e, t, n) {
  7783. var i = this.$brackets[e],
  7784. s = 1,
  7785. o = new r(this, t.row, t.column),
  7786. u = o.getCurrentToken();
  7787. u || (u = o.stepForward());
  7788. if (!u) return;
  7789. n ||
  7790. (n = new RegExp(
  7791. "(\\.?" +
  7792. u.type
  7793. .replace(".", "\\.")
  7794. .replace("rparen", ".paren")
  7795. .replace(/\b(?:end)\b/, "(?:start|begin|end)") +
  7796. ")+"
  7797. ));
  7798. var a = t.column - o.getCurrentTokenColumn() - 2,
  7799. f = u.value;
  7800. for (;;) {
  7801. while (a >= 0) {
  7802. var l = f.charAt(a);
  7803. if (l == i) {
  7804. s -= 1;
  7805. if (s == 0)
  7806. return {
  7807. row: o.getCurrentTokenRow(),
  7808. column: a + o.getCurrentTokenColumn(),
  7809. };
  7810. } else l == e && (s += 1);
  7811. a -= 1;
  7812. }
  7813. do u = o.stepBackward();
  7814. while (u && !n.test(u.type));
  7815. if (u == null) break;
  7816. (f = u.value), (a = f.length - 1);
  7817. }
  7818. return null;
  7819. }),
  7820. (this.$findClosingBracket = function (e, t, n) {
  7821. var i = this.$brackets[e],
  7822. s = 1,
  7823. o = new r(this, t.row, t.column),
  7824. u = o.getCurrentToken();
  7825. u || (u = o.stepForward());
  7826. if (!u) return;
  7827. n ||
  7828. (n = new RegExp(
  7829. "(\\.?" +
  7830. u.type
  7831. .replace(".", "\\.")
  7832. .replace("lparen", ".paren")
  7833. .replace(/\b(?:start|begin)\b/, "(?:start|begin|end)") +
  7834. ")+"
  7835. ));
  7836. var a = t.column - o.getCurrentTokenColumn();
  7837. for (;;) {
  7838. var f = u.value,
  7839. l = f.length;
  7840. while (a < l) {
  7841. var c = f.charAt(a);
  7842. if (c == i) {
  7843. s -= 1;
  7844. if (s == 0)
  7845. return {
  7846. row: o.getCurrentTokenRow(),
  7847. column: a + o.getCurrentTokenColumn(),
  7848. };
  7849. } else c == e && (s += 1);
  7850. a += 1;
  7851. }
  7852. do u = o.stepForward();
  7853. while (u && !n.test(u.type));
  7854. if (u == null) break;
  7855. a = 0;
  7856. }
  7857. return null;
  7858. });
  7859. }
  7860. var r = e("../token_iterator").TokenIterator,
  7861. i = e("../range").Range;
  7862. t.BracketMatch = s;
  7863. }
  7864. ),
  7865. define(
  7866. "ace/edit_session",
  7867. [
  7868. "require",
  7869. "exports",
  7870. "module",
  7871. "ace/lib/oop",
  7872. "ace/lib/lang",
  7873. "ace/bidihandler",
  7874. "ace/config",
  7875. "ace/lib/event_emitter",
  7876. "ace/selection",
  7877. "ace/mode/text",
  7878. "ace/range",
  7879. "ace/document",
  7880. "ace/background_tokenizer",
  7881. "ace/search_highlight",
  7882. "ace/edit_session/folding",
  7883. "ace/edit_session/bracket_match",
  7884. ],
  7885. function (e, t, n) {
  7886. "use strict";
  7887. var r = e("./lib/oop"),
  7888. i = e("./lib/lang"),
  7889. s = e("./bidihandler").BidiHandler,
  7890. o = e("./config"),
  7891. u = e("./lib/event_emitter").EventEmitter,
  7892. a = e("./selection").Selection,
  7893. f = e("./mode/text").Mode,
  7894. l = e("./range").Range,
  7895. c = e("./document").Document,
  7896. h = e("./background_tokenizer").BackgroundTokenizer,
  7897. p = e("./search_highlight").SearchHighlight,
  7898. d = function (e, t) {
  7899. (this.$breakpoints = []),
  7900. (this.$decorations = []),
  7901. (this.$frontMarkers = {}),
  7902. (this.$backMarkers = {}),
  7903. (this.$markerId = 1),
  7904. (this.$undoSelect = !0),
  7905. (this.$foldData = []),
  7906. (this.id = "session" + ++d.$uid),
  7907. (this.$foldData.toString = function () {
  7908. return this.join("\n");
  7909. }),
  7910. this.on("changeFold", this.onChangeFold.bind(this)),
  7911. (this.$onChange = this.onChange.bind(this));
  7912. if (typeof e != "object" || !e.getLine) e = new c(e);
  7913. this.setDocument(e),
  7914. (this.selection = new a(this)),
  7915. (this.$bidiHandler = new s(this)),
  7916. o.resetOptions(this),
  7917. this.setMode(t),
  7918. o._signal("session", this);
  7919. };
  7920. (d.$uid = 0),
  7921. function () {
  7922. function m(e) {
  7923. return e < 4352
  7924. ? !1
  7925. : (e >= 4352 && e <= 4447) ||
  7926. (e >= 4515 && e <= 4519) ||
  7927. (e >= 4602 && e <= 4607) ||
  7928. (e >= 9001 && e <= 9002) ||
  7929. (e >= 11904 && e <= 11929) ||
  7930. (e >= 11931 && e <= 12019) ||
  7931. (e >= 12032 && e <= 12245) ||
  7932. (e >= 12272 && e <= 12283) ||
  7933. (e >= 12288 && e <= 12350) ||
  7934. (e >= 12353 && e <= 12438) ||
  7935. (e >= 12441 && e <= 12543) ||
  7936. (e >= 12549 && e <= 12589) ||
  7937. (e >= 12593 && e <= 12686) ||
  7938. (e >= 12688 && e <= 12730) ||
  7939. (e >= 12736 && e <= 12771) ||
  7940. (e >= 12784 && e <= 12830) ||
  7941. (e >= 12832 && e <= 12871) ||
  7942. (e >= 12880 && e <= 13054) ||
  7943. (e >= 13056 && e <= 19903) ||
  7944. (e >= 19968 && e <= 42124) ||
  7945. (e >= 42128 && e <= 42182) ||
  7946. (e >= 43360 && e <= 43388) ||
  7947. (e >= 44032 && e <= 55203) ||
  7948. (e >= 55216 && e <= 55238) ||
  7949. (e >= 55243 && e <= 55291) ||
  7950. (e >= 63744 && e <= 64255) ||
  7951. (e >= 65040 && e <= 65049) ||
  7952. (e >= 65072 && e <= 65106) ||
  7953. (e >= 65108 && e <= 65126) ||
  7954. (e >= 65128 && e <= 65131) ||
  7955. (e >= 65281 && e <= 65376) ||
  7956. (e >= 65504 && e <= 65510);
  7957. }
  7958. r.implement(this, u),
  7959. (this.setDocument = function (e) {
  7960. this.doc && this.doc.removeListener("change", this.$onChange),
  7961. (this.doc = e),
  7962. e.on("change", this.$onChange),
  7963. this.bgTokenizer &&
  7964. this.bgTokenizer.setDocument(this.getDocument()),
  7965. this.resetCaches();
  7966. }),
  7967. (this.getDocument = function () {
  7968. return this.doc;
  7969. }),
  7970. (this.$resetRowCache = function (e) {
  7971. if (!e) {
  7972. (this.$docRowCache = []), (this.$screenRowCache = []);
  7973. return;
  7974. }
  7975. var t = this.$docRowCache.length,
  7976. n = this.$getRowCacheIndex(this.$docRowCache, e) + 1;
  7977. t > n &&
  7978. (this.$docRowCache.splice(n, t),
  7979. this.$screenRowCache.splice(n, t));
  7980. }),
  7981. (this.$getRowCacheIndex = function (e, t) {
  7982. var n = 0,
  7983. r = e.length - 1;
  7984. while (n <= r) {
  7985. var i = (n + r) >> 1,
  7986. s = e[i];
  7987. if (t > s) n = i + 1;
  7988. else {
  7989. if (!(t < s)) return i;
  7990. r = i - 1;
  7991. }
  7992. }
  7993. return n - 1;
  7994. }),
  7995. (this.resetCaches = function () {
  7996. (this.$modified = !0),
  7997. (this.$wrapData = []),
  7998. (this.$rowLengthCache = []),
  7999. this.$resetRowCache(0),
  8000. this.bgTokenizer && this.bgTokenizer.start(0);
  8001. }),
  8002. (this.onChangeFold = function (e) {
  8003. var t = e.data;
  8004. this.$resetRowCache(t.start.row);
  8005. }),
  8006. (this.onChange = function (e) {
  8007. (this.$modified = !0),
  8008. this.$bidiHandler.onChange(e),
  8009. this.$resetRowCache(e.start.row);
  8010. var t = this.$updateInternalDataOnChange(e);
  8011. !this.$fromUndo &&
  8012. this.$undoManager &&
  8013. (t &&
  8014. t.length &&
  8015. (this.$undoManager.add(
  8016. { action: "removeFolds", folds: t },
  8017. this.mergeUndoDeltas
  8018. ),
  8019. (this.mergeUndoDeltas = !0)),
  8020. this.$undoManager.add(e, this.mergeUndoDeltas),
  8021. (this.mergeUndoDeltas = !0),
  8022. this.$informUndoManager.schedule()),
  8023. this.bgTokenizer && this.bgTokenizer.$updateOnChange(e),
  8024. this._signal("change", e);
  8025. }),
  8026. (this.setValue = function (e) {
  8027. this.doc.setValue(e),
  8028. this.selection.moveTo(0, 0),
  8029. this.$resetRowCache(0),
  8030. this.setUndoManager(this.$undoManager),
  8031. this.getUndoManager().reset();
  8032. }),
  8033. (this.getValue = this.toString =
  8034. function () {
  8035. return this.doc.getValue();
  8036. }),
  8037. (this.getSelection = function () {
  8038. return this.selection;
  8039. }),
  8040. (this.getState = function (e) {
  8041. return this.bgTokenizer.getState(e);
  8042. }),
  8043. (this.getTokens = function (e) {
  8044. return this.bgTokenizer.getTokens(e);
  8045. }),
  8046. (this.getTokenAt = function (e, t) {
  8047. var n = this.bgTokenizer.getTokens(e),
  8048. r,
  8049. i = 0;
  8050. if (t == null) {
  8051. var s = n.length - 1;
  8052. i = this.getLine(e).length;
  8053. } else
  8054. for (var s = 0; s < n.length; s++) {
  8055. i += n[s].value.length;
  8056. if (i >= t) break;
  8057. }
  8058. return (
  8059. (r = n[s]),
  8060. r ? ((r.index = s), (r.start = i - r.value.length), r) : null
  8061. );
  8062. }),
  8063. (this.setUndoManager = function (e) {
  8064. (this.$undoManager = e),
  8065. this.$informUndoManager && this.$informUndoManager.cancel();
  8066. if (e) {
  8067. var t = this;
  8068. e.addSession(this),
  8069. (this.$syncInformUndoManager = function () {
  8070. t.$informUndoManager.cancel(), (t.mergeUndoDeltas = !1);
  8071. }),
  8072. (this.$informUndoManager = i.delayedCall(
  8073. this.$syncInformUndoManager
  8074. ));
  8075. } else this.$syncInformUndoManager = function () {};
  8076. }),
  8077. (this.markUndoGroup = function () {
  8078. this.$syncInformUndoManager && this.$syncInformUndoManager();
  8079. }),
  8080. (this.$defaultUndoManager = {
  8081. undo: function () {},
  8082. redo: function () {},
  8083. reset: function () {},
  8084. add: function () {},
  8085. addSelection: function () {},
  8086. startNewGroup: function () {},
  8087. addSession: function () {},
  8088. }),
  8089. (this.getUndoManager = function () {
  8090. return this.$undoManager || this.$defaultUndoManager;
  8091. }),
  8092. (this.getTabString = function () {
  8093. return this.getUseSoftTabs()
  8094. ? i.stringRepeat(" ", this.getTabSize())
  8095. : " ";
  8096. }),
  8097. (this.setUseSoftTabs = function (e) {
  8098. this.setOption("useSoftTabs", e);
  8099. }),
  8100. (this.getUseSoftTabs = function () {
  8101. return this.$useSoftTabs && !this.$mode.$indentWithTabs;
  8102. }),
  8103. (this.setTabSize = function (e) {
  8104. this.setOption("tabSize", e);
  8105. }),
  8106. (this.getTabSize = function () {
  8107. return this.$tabSize;
  8108. }),
  8109. (this.isTabStop = function (e) {
  8110. return this.$useSoftTabs && e.column % this.$tabSize === 0;
  8111. }),
  8112. (this.setNavigateWithinSoftTabs = function (e) {
  8113. this.setOption("navigateWithinSoftTabs", e);
  8114. }),
  8115. (this.getNavigateWithinSoftTabs = function () {
  8116. return this.$navigateWithinSoftTabs;
  8117. }),
  8118. (this.$overwrite = !1),
  8119. (this.setOverwrite = function (e) {
  8120. this.setOption("overwrite", e);
  8121. }),
  8122. (this.getOverwrite = function () {
  8123. return this.$overwrite;
  8124. }),
  8125. (this.toggleOverwrite = function () {
  8126. this.setOverwrite(!this.$overwrite);
  8127. }),
  8128. (this.addGutterDecoration = function (e, t) {
  8129. this.$decorations[e] || (this.$decorations[e] = ""),
  8130. (this.$decorations[e] += " " + t),
  8131. this._signal("changeBreakpoint", {});
  8132. }),
  8133. (this.removeGutterDecoration = function (e, t) {
  8134. (this.$decorations[e] = (this.$decorations[e] || "").replace(
  8135. " " + t,
  8136. ""
  8137. )),
  8138. this._signal("changeBreakpoint", {});
  8139. }),
  8140. (this.getBreakpoints = function () {
  8141. return this.$breakpoints;
  8142. }),
  8143. (this.setBreakpoints = function (e) {
  8144. this.$breakpoints = [];
  8145. for (var t = 0; t < e.length; t++)
  8146. this.$breakpoints[e[t]] = "ace_breakpoint";
  8147. this._signal("changeBreakpoint", {});
  8148. }),
  8149. (this.clearBreakpoints = function () {
  8150. (this.$breakpoints = []), this._signal("changeBreakpoint", {});
  8151. }),
  8152. (this.setBreakpoint = function (e, t) {
  8153. t === undefined && (t = "ace_breakpoint"),
  8154. t ? (this.$breakpoints[e] = t) : delete this.$breakpoints[e],
  8155. this._signal("changeBreakpoint", {});
  8156. }),
  8157. (this.clearBreakpoint = function (e) {
  8158. delete this.$breakpoints[e], this._signal("changeBreakpoint", {});
  8159. }),
  8160. (this.addMarker = function (e, t, n, r) {
  8161. var i = this.$markerId++,
  8162. s = {
  8163. range: e,
  8164. type: n || "line",
  8165. renderer: typeof n == "function" ? n : null,
  8166. clazz: t,
  8167. inFront: !!r,
  8168. id: i,
  8169. };
  8170. return (
  8171. r
  8172. ? ((this.$frontMarkers[i] = s),
  8173. this._signal("changeFrontMarker"))
  8174. : ((this.$backMarkers[i] = s),
  8175. this._signal("changeBackMarker")),
  8176. i
  8177. );
  8178. }),
  8179. (this.addDynamicMarker = function (e, t) {
  8180. if (!e.update) return;
  8181. var n = this.$markerId++;
  8182. return (
  8183. (e.id = n),
  8184. (e.inFront = !!t),
  8185. t
  8186. ? ((this.$frontMarkers[n] = e),
  8187. this._signal("changeFrontMarker"))
  8188. : ((this.$backMarkers[n] = e),
  8189. this._signal("changeBackMarker")),
  8190. e
  8191. );
  8192. }),
  8193. (this.removeMarker = function (e) {
  8194. var t = this.$frontMarkers[e] || this.$backMarkers[e];
  8195. if (!t) return;
  8196. var n = t.inFront ? this.$frontMarkers : this.$backMarkers;
  8197. delete n[e],
  8198. this._signal(
  8199. t.inFront ? "changeFrontMarker" : "changeBackMarker"
  8200. );
  8201. }),
  8202. (this.getMarkers = function (e) {
  8203. return e ? this.$frontMarkers : this.$backMarkers;
  8204. }),
  8205. (this.highlight = function (e) {
  8206. if (!this.$searchHighlight) {
  8207. var t = new p(null, "ace_selected-word", "text");
  8208. this.$searchHighlight = this.addDynamicMarker(t);
  8209. }
  8210. this.$searchHighlight.setRegexp(e);
  8211. }),
  8212. (this.highlightLines = function (e, t, n, r) {
  8213. typeof t != "number" && ((n = t), (t = e)), n || (n = "ace_step");
  8214. var i = new l(e, 0, t, Infinity);
  8215. return (i.id = this.addMarker(i, n, "fullLine", r)), i;
  8216. }),
  8217. (this.setAnnotations = function (e) {
  8218. (this.$annotations = e), this._signal("changeAnnotation", {});
  8219. }),
  8220. (this.getAnnotations = function () {
  8221. return this.$annotations || [];
  8222. }),
  8223. (this.clearAnnotations = function () {
  8224. this.setAnnotations([]);
  8225. }),
  8226. (this.$detectNewLine = function (e) {
  8227. var t = e.match(/^.*?(\r?\n)/m);
  8228. t ? (this.$autoNewLine = t[1]) : (this.$autoNewLine = "\n");
  8229. }),
  8230. (this.getWordRange = function (e, t) {
  8231. var n = this.getLine(e),
  8232. r = !1;
  8233. t > 0 && (r = !!n.charAt(t - 1).match(this.tokenRe)),
  8234. r || (r = !!n.charAt(t).match(this.tokenRe));
  8235. if (r) var i = this.tokenRe;
  8236. else if (/^\s+$/.test(n.slice(t - 1, t + 1))) var i = /\s/;
  8237. else var i = this.nonTokenRe;
  8238. var s = t;
  8239. if (s > 0) {
  8240. do s--;
  8241. while (s >= 0 && n.charAt(s).match(i));
  8242. s++;
  8243. }
  8244. var o = t;
  8245. while (o < n.length && n.charAt(o).match(i)) o++;
  8246. return new l(e, s, e, o);
  8247. }),
  8248. (this.getAWordRange = function (e, t) {
  8249. var n = this.getWordRange(e, t),
  8250. r = this.getLine(n.end.row);
  8251. while (r.charAt(n.end.column).match(/[ \t]/)) n.end.column += 1;
  8252. return n;
  8253. }),
  8254. (this.setNewLineMode = function (e) {
  8255. this.doc.setNewLineMode(e);
  8256. }),
  8257. (this.getNewLineMode = function () {
  8258. return this.doc.getNewLineMode();
  8259. }),
  8260. (this.setUseWorker = function (e) {
  8261. this.setOption("useWorker", e);
  8262. }),
  8263. (this.getUseWorker = function () {
  8264. return this.$useWorker;
  8265. }),
  8266. (this.onReloadTokenizer = function (e) {
  8267. var t = e.data;
  8268. this.bgTokenizer.start(t.first),
  8269. this._signal("tokenizerUpdate", e);
  8270. }),
  8271. (this.$modes = o.$modes),
  8272. (this.$mode = null),
  8273. (this.$modeId = null),
  8274. (this.setMode = function (e, t) {
  8275. if (e && typeof e == "object") {
  8276. if (e.getTokenizer) return this.$onChangeMode(e);
  8277. var n = e,
  8278. r = n.path;
  8279. } else r = e || "ace/mode/text";
  8280. this.$modes["ace/mode/text"] ||
  8281. (this.$modes["ace/mode/text"] = new f());
  8282. if (this.$modes[r] && !n) {
  8283. this.$onChangeMode(this.$modes[r]), t && t();
  8284. return;
  8285. }
  8286. (this.$modeId = r),
  8287. o.loadModule(
  8288. ["mode", r],
  8289. function (e) {
  8290. if (this.$modeId !== r) return t && t();
  8291. this.$modes[r] && !n
  8292. ? this.$onChangeMode(this.$modes[r])
  8293. : e &&
  8294. e.Mode &&
  8295. ((e = new e.Mode(n)),
  8296. n || ((this.$modes[r] = e), (e.$id = r)),
  8297. this.$onChangeMode(e)),
  8298. t && t();
  8299. }.bind(this)
  8300. ),
  8301. this.$mode ||
  8302. this.$onChangeMode(this.$modes["ace/mode/text"], !0);
  8303. }),
  8304. (this.$onChangeMode = function (e, t) {
  8305. t || (this.$modeId = e.$id);
  8306. if (this.$mode === e) return;
  8307. (this.$mode = e),
  8308. this.$stopWorker(),
  8309. this.$useWorker && this.$startWorker();
  8310. var n = e.getTokenizer();
  8311. if (n.addEventListener !== undefined) {
  8312. var r = this.onReloadTokenizer.bind(this);
  8313. n.addEventListener("update", r);
  8314. }
  8315. if (!this.bgTokenizer) {
  8316. this.bgTokenizer = new h(n);
  8317. var i = this;
  8318. this.bgTokenizer.addEventListener("update", function (e) {
  8319. i._signal("tokenizerUpdate", e);
  8320. });
  8321. } else this.bgTokenizer.setTokenizer(n);
  8322. this.bgTokenizer.setDocument(this.getDocument()),
  8323. (this.tokenRe = e.tokenRe),
  8324. (this.nonTokenRe = e.nonTokenRe),
  8325. t ||
  8326. (e.attachToSession && e.attachToSession(this),
  8327. this.$options.wrapMethod.set.call(this, this.$wrapMethod),
  8328. this.$setFolding(e.foldingRules),
  8329. this.bgTokenizer.start(0),
  8330. this._emit("changeMode"));
  8331. }),
  8332. (this.$stopWorker = function () {
  8333. this.$worker && (this.$worker.terminate(), (this.$worker = null));
  8334. }),
  8335. (this.$startWorker = function () {
  8336. try {
  8337. this.$worker = this.$mode.createWorker(this);
  8338. } catch (e) {
  8339. o.warn("Could not load worker", e), (this.$worker = null);
  8340. }
  8341. }),
  8342. (this.getMode = function () {
  8343. return this.$mode;
  8344. }),
  8345. (this.$scrollTop = 0),
  8346. (this.setScrollTop = function (e) {
  8347. if (this.$scrollTop === e || isNaN(e)) return;
  8348. (this.$scrollTop = e), this._signal("changeScrollTop", e);
  8349. }),
  8350. (this.getScrollTop = function () {
  8351. return this.$scrollTop;
  8352. }),
  8353. (this.$scrollLeft = 0),
  8354. (this.setScrollLeft = function (e) {
  8355. if (this.$scrollLeft === e || isNaN(e)) return;
  8356. (this.$scrollLeft = e), this._signal("changeScrollLeft", e);
  8357. }),
  8358. (this.getScrollLeft = function () {
  8359. return this.$scrollLeft;
  8360. }),
  8361. (this.getScreenWidth = function () {
  8362. return (
  8363. this.$computeWidth(),
  8364. this.lineWidgets
  8365. ? Math.max(this.getLineWidgetMaxWidth(), this.screenWidth)
  8366. : this.screenWidth
  8367. );
  8368. }),
  8369. (this.getLineWidgetMaxWidth = function () {
  8370. if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth;
  8371. var e = 0;
  8372. return (
  8373. this.lineWidgets.forEach(function (t) {
  8374. t && t.screenWidth > e && (e = t.screenWidth);
  8375. }),
  8376. (this.lineWidgetWidth = e)
  8377. );
  8378. }),
  8379. (this.$computeWidth = function (e) {
  8380. if (this.$modified || e) {
  8381. this.$modified = !1;
  8382. if (this.$useWrapMode)
  8383. return (this.screenWidth = this.$wrapLimit);
  8384. var t = this.doc.getAllLines(),
  8385. n = this.$rowLengthCache,
  8386. r = 0,
  8387. i = 0,
  8388. s = this.$foldData[i],
  8389. o = s ? s.start.row : Infinity,
  8390. u = t.length;
  8391. for (var a = 0; a < u; a++) {
  8392. if (a > o) {
  8393. a = s.end.row + 1;
  8394. if (a >= u) break;
  8395. (s = this.$foldData[i++]), (o = s ? s.start.row : Infinity);
  8396. }
  8397. n[a] == null && (n[a] = this.$getStringScreenWidth(t[a])[0]),
  8398. n[a] > r && (r = n[a]);
  8399. }
  8400. this.screenWidth = r;
  8401. }
  8402. }),
  8403. (this.getLine = function (e) {
  8404. return this.doc.getLine(e);
  8405. }),
  8406. (this.getLines = function (e, t) {
  8407. return this.doc.getLines(e, t);
  8408. }),
  8409. (this.getLength = function () {
  8410. return this.doc.getLength();
  8411. }),
  8412. (this.getTextRange = function (e) {
  8413. return this.doc.getTextRange(e || this.selection.getRange());
  8414. }),
  8415. (this.insert = function (e, t) {
  8416. return this.doc.insert(e, t);
  8417. }),
  8418. (this.remove = function (e) {
  8419. return this.doc.remove(e);
  8420. }),
  8421. (this.removeFullLines = function (e, t) {
  8422. return this.doc.removeFullLines(e, t);
  8423. }),
  8424. (this.undoChanges = function (e, t) {
  8425. if (!e.length) return;
  8426. this.$fromUndo = !0;
  8427. for (var n = e.length - 1; n != -1; n--) {
  8428. var r = e[n];
  8429. r.action == "insert" || r.action == "remove"
  8430. ? this.doc.revertDelta(r)
  8431. : r.folds && this.addFolds(r.folds);
  8432. }
  8433. !t &&
  8434. this.$undoSelect &&
  8435. (e.selectionBefore
  8436. ? this.selection.fromJSON(e.selectionBefore)
  8437. : this.selection.setRange(this.$getUndoSelection(e, !0))),
  8438. (this.$fromUndo = !1);
  8439. }),
  8440. (this.redoChanges = function (e, t) {
  8441. if (!e.length) return;
  8442. this.$fromUndo = !0;
  8443. for (var n = 0; n < e.length; n++) {
  8444. var r = e[n];
  8445. (r.action == "insert" || r.action == "remove") &&
  8446. this.doc.applyDelta(r);
  8447. }
  8448. !t &&
  8449. this.$undoSelect &&
  8450. (e.selectionAfter
  8451. ? this.selection.fromJSON(e.selectionAfter)
  8452. : this.selection.setRange(this.$getUndoSelection(e, !1))),
  8453. (this.$fromUndo = !1);
  8454. }),
  8455. (this.setUndoSelect = function (e) {
  8456. this.$undoSelect = e;
  8457. }),
  8458. (this.$getUndoSelection = function (e, t) {
  8459. function n(e) {
  8460. return t ? e.action !== "insert" : e.action === "insert";
  8461. }
  8462. var r, i, s;
  8463. for (var o = 0; o < e.length; o++) {
  8464. var u = e[o];
  8465. if (!u.start) continue;
  8466. if (!r) {
  8467. n(u)
  8468. ? ((r = l.fromPoints(u.start, u.end)), (s = !0))
  8469. : ((r = l.fromPoints(u.start, u.start)), (s = !1));
  8470. continue;
  8471. }
  8472. n(u)
  8473. ? ((i = u.start),
  8474. r.compare(i.row, i.column) == -1 && r.setStart(i),
  8475. (i = u.end),
  8476. r.compare(i.row, i.column) == 1 && r.setEnd(i),
  8477. (s = !0))
  8478. : ((i = u.start),
  8479. r.compare(i.row, i.column) == -1 &&
  8480. (r = l.fromPoints(u.start, u.start)),
  8481. (s = !1));
  8482. }
  8483. return r;
  8484. }),
  8485. (this.replace = function (e, t) {
  8486. return this.doc.replace(e, t);
  8487. }),
  8488. (this.moveText = function (e, t, n) {
  8489. var r = this.getTextRange(e),
  8490. i = this.getFoldsInRange(e),
  8491. s = l.fromPoints(t, t);
  8492. if (!n) {
  8493. this.remove(e);
  8494. var o = e.start.row - e.end.row,
  8495. u = o ? -e.end.column : e.start.column - e.end.column;
  8496. u &&
  8497. (s.start.row == e.end.row &&
  8498. s.start.column > e.end.column &&
  8499. (s.start.column += u),
  8500. s.end.row == e.end.row &&
  8501. s.end.column > e.end.column &&
  8502. (s.end.column += u)),
  8503. o &&
  8504. s.start.row >= e.end.row &&
  8505. ((s.start.row += o), (s.end.row += o));
  8506. }
  8507. s.end = this.insert(s.start, r);
  8508. if (i.length) {
  8509. var a = e.start,
  8510. f = s.start,
  8511. o = f.row - a.row,
  8512. u = f.column - a.column;
  8513. this.addFolds(
  8514. i.map(function (e) {
  8515. return (
  8516. (e = e.clone()),
  8517. e.start.row == a.row && (e.start.column += u),
  8518. e.end.row == a.row && (e.end.column += u),
  8519. (e.start.row += o),
  8520. (e.end.row += o),
  8521. e
  8522. );
  8523. })
  8524. );
  8525. }
  8526. return s;
  8527. }),
  8528. (this.indentRows = function (e, t, n) {
  8529. n = n.replace(/\t/g, this.getTabString());
  8530. for (var r = e; r <= t; r++)
  8531. this.doc.insertInLine({ row: r, column: 0 }, n);
  8532. }),
  8533. (this.outdentRows = function (e) {
  8534. var t = e.collapseRows(),
  8535. n = new l(0, 0, 0, 0),
  8536. r = this.getTabSize();
  8537. for (var i = t.start.row; i <= t.end.row; ++i) {
  8538. var s = this.getLine(i);
  8539. (n.start.row = i), (n.end.row = i);
  8540. for (var o = 0; o < r; ++o) if (s.charAt(o) != " ") break;
  8541. o < r && s.charAt(o) == " "
  8542. ? ((n.start.column = o), (n.end.column = o + 1))
  8543. : ((n.start.column = 0), (n.end.column = o)),
  8544. this.remove(n);
  8545. }
  8546. }),
  8547. (this.$moveLines = function (e, t, n) {
  8548. (e = this.getRowFoldStart(e)), (t = this.getRowFoldEnd(t));
  8549. if (n < 0) {
  8550. var r = this.getRowFoldStart(e + n);
  8551. if (r < 0) return 0;
  8552. var i = r - e;
  8553. } else if (n > 0) {
  8554. var r = this.getRowFoldEnd(t + n);
  8555. if (r > this.doc.getLength() - 1) return 0;
  8556. var i = r - t;
  8557. } else {
  8558. (e = this.$clipRowToDocument(e)),
  8559. (t = this.$clipRowToDocument(t));
  8560. var i = t - e + 1;
  8561. }
  8562. var s = new l(e, 0, t, Number.MAX_VALUE),
  8563. o = this.getFoldsInRange(s).map(function (e) {
  8564. return (
  8565. (e = e.clone()), (e.start.row += i), (e.end.row += i), e
  8566. );
  8567. }),
  8568. u =
  8569. n == 0
  8570. ? this.doc.getLines(e, t)
  8571. : this.doc.removeFullLines(e, t);
  8572. return (
  8573. this.doc.insertFullLines(e + i, u),
  8574. o.length && this.addFolds(o),
  8575. i
  8576. );
  8577. }),
  8578. (this.moveLinesUp = function (e, t) {
  8579. return this.$moveLines(e, t, -1);
  8580. }),
  8581. (this.moveLinesDown = function (e, t) {
  8582. return this.$moveLines(e, t, 1);
  8583. }),
  8584. (this.duplicateLines = function (e, t) {
  8585. return this.$moveLines(e, t, 0);
  8586. }),
  8587. (this.$clipRowToDocument = function (e) {
  8588. return Math.max(0, Math.min(e, this.doc.getLength() - 1));
  8589. }),
  8590. (this.$clipColumnToRow = function (e, t) {
  8591. return t < 0 ? 0 : Math.min(this.doc.getLine(e).length, t);
  8592. }),
  8593. (this.$clipPositionToDocument = function (e, t) {
  8594. t = Math.max(0, t);
  8595. if (e < 0) (e = 0), (t = 0);
  8596. else {
  8597. var n = this.doc.getLength();
  8598. e >= n
  8599. ? ((e = n - 1), (t = this.doc.getLine(n - 1).length))
  8600. : (t = Math.min(this.doc.getLine(e).length, t));
  8601. }
  8602. return { row: e, column: t };
  8603. }),
  8604. (this.$clipRangeToDocument = function (e) {
  8605. e.start.row < 0
  8606. ? ((e.start.row = 0), (e.start.column = 0))
  8607. : (e.start.column = this.$clipColumnToRow(
  8608. e.start.row,
  8609. e.start.column
  8610. ));
  8611. var t = this.doc.getLength() - 1;
  8612. return (
  8613. e.end.row > t
  8614. ? ((e.end.row = t),
  8615. (e.end.column = this.doc.getLine(t).length))
  8616. : (e.end.column = this.$clipColumnToRow(
  8617. e.end.row,
  8618. e.end.column
  8619. )),
  8620. e
  8621. );
  8622. }),
  8623. (this.$wrapLimit = 80),
  8624. (this.$useWrapMode = !1),
  8625. (this.$wrapLimitRange = { min: null, max: null }),
  8626. (this.setUseWrapMode = function (e) {
  8627. if (e != this.$useWrapMode) {
  8628. (this.$useWrapMode = e),
  8629. (this.$modified = !0),
  8630. this.$resetRowCache(0);
  8631. if (e) {
  8632. var t = this.getLength();
  8633. (this.$wrapData = Array(t)), this.$updateWrapData(0, t - 1);
  8634. }
  8635. this._signal("changeWrapMode");
  8636. }
  8637. }),
  8638. (this.getUseWrapMode = function () {
  8639. return this.$useWrapMode;
  8640. }),
  8641. (this.setWrapLimitRange = function (e, t) {
  8642. if (
  8643. this.$wrapLimitRange.min !== e ||
  8644. this.$wrapLimitRange.max !== t
  8645. )
  8646. (this.$wrapLimitRange = { min: e, max: t }),
  8647. (this.$modified = !0),
  8648. this.$bidiHandler.markAsDirty(),
  8649. this.$useWrapMode && this._signal("changeWrapMode");
  8650. }),
  8651. (this.adjustWrapLimit = function (e, t) {
  8652. var n = this.$wrapLimitRange;
  8653. n.max < 0 && (n = { min: t, max: t });
  8654. var r = this.$constrainWrapLimit(e, n.min, n.max);
  8655. return r != this.$wrapLimit && r > 1
  8656. ? ((this.$wrapLimit = r),
  8657. (this.$modified = !0),
  8658. this.$useWrapMode &&
  8659. (this.$updateWrapData(0, this.getLength() - 1),
  8660. this.$resetRowCache(0),
  8661. this._signal("changeWrapLimit")),
  8662. !0)
  8663. : !1;
  8664. }),
  8665. (this.$constrainWrapLimit = function (e, t, n) {
  8666. return t && (e = Math.max(t, e)), n && (e = Math.min(n, e)), e;
  8667. }),
  8668. (this.getWrapLimit = function () {
  8669. return this.$wrapLimit;
  8670. }),
  8671. (this.setWrapLimit = function (e) {
  8672. this.setWrapLimitRange(e, e);
  8673. }),
  8674. (this.getWrapLimitRange = function () {
  8675. return {
  8676. min: this.$wrapLimitRange.min,
  8677. max: this.$wrapLimitRange.max,
  8678. };
  8679. }),
  8680. (this.$updateInternalDataOnChange = function (e) {
  8681. var t = this.$useWrapMode,
  8682. n = e.action,
  8683. r = e.start,
  8684. i = e.end,
  8685. s = r.row,
  8686. o = i.row,
  8687. u = o - s,
  8688. a = null;
  8689. this.$updating = !0;
  8690. if (u != 0)
  8691. if (n === "remove") {
  8692. this[t ? "$wrapData" : "$rowLengthCache"].splice(s, u);
  8693. var f = this.$foldData;
  8694. (a = this.getFoldsInRange(e)), this.removeFolds(a);
  8695. var l = this.getFoldLine(i.row),
  8696. c = 0;
  8697. if (l) {
  8698. l.addRemoveChars(i.row, i.column, r.column - i.column),
  8699. l.shiftRow(-u);
  8700. var h = this.getFoldLine(s);
  8701. h && h !== l && (h.merge(l), (l = h)),
  8702. (c = f.indexOf(l) + 1);
  8703. }
  8704. for (c; c < f.length; c++) {
  8705. var l = f[c];
  8706. l.start.row >= i.row && l.shiftRow(-u);
  8707. }
  8708. o = s;
  8709. } else {
  8710. var p = Array(u);
  8711. p.unshift(s, 0);
  8712. var d = t ? this.$wrapData : this.$rowLengthCache;
  8713. d.splice.apply(d, p);
  8714. var f = this.$foldData,
  8715. l = this.getFoldLine(s),
  8716. c = 0;
  8717. if (l) {
  8718. var v = l.range.compareInside(r.row, r.column);
  8719. v == 0
  8720. ? ((l = l.split(r.row, r.column)),
  8721. l &&
  8722. (l.shiftRow(u),
  8723. l.addRemoveChars(o, 0, i.column - r.column)))
  8724. : v == -1 &&
  8725. (l.addRemoveChars(s, 0, i.column - r.column),
  8726. l.shiftRow(u)),
  8727. (c = f.indexOf(l) + 1);
  8728. }
  8729. for (c; c < f.length; c++) {
  8730. var l = f[c];
  8731. l.start.row >= s && l.shiftRow(u);
  8732. }
  8733. }
  8734. else {
  8735. (u = Math.abs(e.start.column - e.end.column)),
  8736. n === "remove" &&
  8737. ((a = this.getFoldsInRange(e)),
  8738. this.removeFolds(a),
  8739. (u = -u));
  8740. var l = this.getFoldLine(s);
  8741. l && l.addRemoveChars(s, r.column, u);
  8742. }
  8743. return (
  8744. t &&
  8745. this.$wrapData.length != this.doc.getLength() &&
  8746. console.error(
  8747. "doc.getLength() and $wrapData.length have to be the same!"
  8748. ),
  8749. (this.$updating = !1),
  8750. t
  8751. ? this.$updateWrapData(s, o)
  8752. : this.$updateRowLengthCache(s, o),
  8753. a
  8754. );
  8755. }),
  8756. (this.$updateRowLengthCache = function (e, t, n) {
  8757. (this.$rowLengthCache[e] = null),
  8758. (this.$rowLengthCache[t] = null);
  8759. }),
  8760. (this.$updateWrapData = function (e, t) {
  8761. var r = this.doc.getAllLines(),
  8762. i = this.getTabSize(),
  8763. o = this.$wrapData,
  8764. u = this.$wrapLimit,
  8765. a,
  8766. f,
  8767. l = e;
  8768. t = Math.min(t, r.length - 1);
  8769. while (l <= t)
  8770. (f = this.getFoldLine(l, f)),
  8771. f
  8772. ? ((a = []),
  8773. f.walk(
  8774. function (e, t, i, o) {
  8775. var u;
  8776. if (e != null) {
  8777. (u = this.$getDisplayTokens(e, a.length)),
  8778. (u[0] = n);
  8779. for (var f = 1; f < u.length; f++) u[f] = s;
  8780. } else
  8781. u = this.$getDisplayTokens(
  8782. r[t].substring(o, i),
  8783. a.length
  8784. );
  8785. a = a.concat(u);
  8786. }.bind(this),
  8787. f.end.row,
  8788. r[f.end.row].length + 1
  8789. ),
  8790. (o[f.start.row] = this.$computeWrapSplits(a, u, i)),
  8791. (l = f.end.row + 1))
  8792. : ((a = this.$getDisplayTokens(r[l])),
  8793. (o[l] = this.$computeWrapSplits(a, u, i)),
  8794. l++);
  8795. });
  8796. var e = 1,
  8797. t = 2,
  8798. n = 3,
  8799. s = 4,
  8800. a = 9,
  8801. c = 10,
  8802. d = 11,
  8803. v = 12;
  8804. (this.$computeWrapSplits = function (e, r, i) {
  8805. function g() {
  8806. var t = 0;
  8807. if (m === 0) return t;
  8808. if (p)
  8809. for (var n = 0; n < e.length; n++) {
  8810. var r = e[n];
  8811. if (r == c) t += 1;
  8812. else {
  8813. if (r != d) {
  8814. if (r == v) continue;
  8815. break;
  8816. }
  8817. t += i;
  8818. }
  8819. }
  8820. return h && p !== !1 && (t += i), Math.min(t, m);
  8821. }
  8822. function y(t) {
  8823. var n = t - f;
  8824. for (var r = f; r < t; r++) {
  8825. var i = e[r];
  8826. if (i === 12 || i === 2) n -= 1;
  8827. }
  8828. o.length || ((b = g()), (o.indent = b)),
  8829. (l += n),
  8830. o.push(l),
  8831. (f = t);
  8832. }
  8833. if (e.length == 0) return [];
  8834. var o = [],
  8835. u = e.length,
  8836. f = 0,
  8837. l = 0,
  8838. h = this.$wrapAsCode,
  8839. p = this.$indentedSoftWrap,
  8840. m = r <= Math.max(2 * i, 8) || p === !1 ? 0 : Math.floor(r / 2),
  8841. b = 0;
  8842. while (u - f > r - b) {
  8843. var w = f + r - b;
  8844. if (e[w - 1] >= c && e[w] >= c) {
  8845. y(w);
  8846. continue;
  8847. }
  8848. if (e[w] == n || e[w] == s) {
  8849. for (w; w != f - 1; w--) if (e[w] == n) break;
  8850. if (w > f) {
  8851. y(w);
  8852. continue;
  8853. }
  8854. w = f + r;
  8855. for (w; w < e.length; w++) if (e[w] != s) break;
  8856. if (w == e.length) break;
  8857. y(w);
  8858. continue;
  8859. }
  8860. var E = Math.max(w - (r - (r >> 2)), f - 1);
  8861. while (w > E && e[w] < n) w--;
  8862. if (h) {
  8863. while (w > E && e[w] < n) w--;
  8864. while (w > E && e[w] == a) w--;
  8865. } else while (w > E && e[w] < c) w--;
  8866. if (w > E) {
  8867. y(++w);
  8868. continue;
  8869. }
  8870. (w = f + r), e[w] == t && w--, y(w - b);
  8871. }
  8872. return o;
  8873. }),
  8874. (this.$getDisplayTokens = function (n, r) {
  8875. var i = [],
  8876. s;
  8877. r = r || 0;
  8878. for (var o = 0; o < n.length; o++) {
  8879. var u = n.charCodeAt(o);
  8880. if (u == 9) {
  8881. (s = this.getScreenTabSize(i.length + r)), i.push(d);
  8882. for (var f = 1; f < s; f++) i.push(v);
  8883. } else
  8884. u == 32
  8885. ? i.push(c)
  8886. : (u > 39 && u < 48) || (u > 57 && u < 64)
  8887. ? i.push(a)
  8888. : u >= 4352 && m(u)
  8889. ? i.push(e, t)
  8890. : i.push(e);
  8891. }
  8892. return i;
  8893. }),
  8894. (this.$getStringScreenWidth = function (e, t, n) {
  8895. if (t == 0) return [0, 0];
  8896. t == null && (t = Infinity), (n = n || 0);
  8897. var r, i;
  8898. for (i = 0; i < e.length; i++) {
  8899. (r = e.charCodeAt(i)),
  8900. r == 9
  8901. ? (n += this.getScreenTabSize(n))
  8902. : r >= 4352 && m(r)
  8903. ? (n += 2)
  8904. : (n += 1);
  8905. if (n > t) break;
  8906. }
  8907. return [n, i];
  8908. }),
  8909. (this.lineWidgets = null),
  8910. (this.getRowLength = function (e) {
  8911. if (this.lineWidgets)
  8912. var t =
  8913. (this.lineWidgets[e] && this.lineWidgets[e].rowCount) || 0;
  8914. else t = 0;
  8915. return !this.$useWrapMode || !this.$wrapData[e]
  8916. ? 1 + t
  8917. : this.$wrapData[e].length + 1 + t;
  8918. }),
  8919. (this.getRowLineCount = function (e) {
  8920. return !this.$useWrapMode || !this.$wrapData[e]
  8921. ? 1
  8922. : this.$wrapData[e].length + 1;
  8923. }),
  8924. (this.getRowWrapIndent = function (e) {
  8925. if (this.$useWrapMode) {
  8926. var t = this.screenToDocumentPosition(e, Number.MAX_VALUE),
  8927. n = this.$wrapData[t.row];
  8928. return n.length && n[0] < t.column ? n.indent : 0;
  8929. }
  8930. return 0;
  8931. }),
  8932. (this.getScreenLastRowColumn = function (e) {
  8933. var t = this.screenToDocumentPosition(e, Number.MAX_VALUE);
  8934. return this.documentToScreenColumn(t.row, t.column);
  8935. }),
  8936. (this.getDocumentLastRowColumn = function (e, t) {
  8937. var n = this.documentToScreenRow(e, t);
  8938. return this.getScreenLastRowColumn(n);
  8939. }),
  8940. (this.getDocumentLastRowColumnPosition = function (e, t) {
  8941. var n = this.documentToScreenRow(e, t);
  8942. return this.screenToDocumentPosition(n, Number.MAX_VALUE / 10);
  8943. }),
  8944. (this.getRowSplitData = function (e) {
  8945. return this.$useWrapMode ? this.$wrapData[e] : undefined;
  8946. }),
  8947. (this.getScreenTabSize = function (e) {
  8948. return this.$tabSize - (e % this.$tabSize);
  8949. }),
  8950. (this.screenToDocumentRow = function (e, t) {
  8951. return this.screenToDocumentPosition(e, t).row;
  8952. }),
  8953. (this.screenToDocumentColumn = function (e, t) {
  8954. return this.screenToDocumentPosition(e, t).column;
  8955. }),
  8956. (this.screenToDocumentPosition = function (e, t, n) {
  8957. if (e < 0) return { row: 0, column: 0 };
  8958. var r,
  8959. i = 0,
  8960. s = 0,
  8961. o,
  8962. u = 0,
  8963. a = 0,
  8964. f = this.$screenRowCache,
  8965. l = this.$getRowCacheIndex(f, e),
  8966. c = f.length;
  8967. if (c && l >= 0)
  8968. var u = f[l],
  8969. i = this.$docRowCache[l],
  8970. h = e > f[c - 1];
  8971. else var h = !c;
  8972. var p = this.getLength() - 1,
  8973. d = this.getNextFoldLine(i),
  8974. v = d ? d.start.row : Infinity;
  8975. while (u <= e) {
  8976. a = this.getRowLength(i);
  8977. if (u + a > e || i >= p) break;
  8978. (u += a),
  8979. i++,
  8980. i > v &&
  8981. ((i = d.end.row + 1),
  8982. (d = this.getNextFoldLine(i, d)),
  8983. (v = d ? d.start.row : Infinity)),
  8984. h &&
  8985. (this.$docRowCache.push(i), this.$screenRowCache.push(u));
  8986. }
  8987. if (d && d.start.row <= i)
  8988. (r = this.getFoldDisplayLine(d)), (i = d.start.row);
  8989. else {
  8990. if (u + a <= e || i > p)
  8991. return { row: p, column: this.getLine(p).length };
  8992. (r = this.getLine(i)), (d = null);
  8993. }
  8994. var m = 0,
  8995. g = Math.floor(e - u);
  8996. if (this.$useWrapMode) {
  8997. var y = this.$wrapData[i];
  8998. y &&
  8999. ((o = y[g]),
  9000. g > 0 &&
  9001. y.length &&
  9002. ((m = y.indent),
  9003. (s = y[g - 1] || y[y.length - 1]),
  9004. (r = r.substring(s))));
  9005. }
  9006. return (
  9007. n !== undefined &&
  9008. this.$bidiHandler.isBidiRow(u + g, i, g) &&
  9009. (t = this.$bidiHandler.offsetToCol(n)),
  9010. (s += this.$getStringScreenWidth(r, t - m)[1]),
  9011. this.$useWrapMode && s >= o && (s = o - 1),
  9012. d ? d.idxToPosition(s) : { row: i, column: s }
  9013. );
  9014. }),
  9015. (this.documentToScreenPosition = function (e, t) {
  9016. if (typeof t == "undefined")
  9017. var n = this.$clipPositionToDocument(e.row, e.column);
  9018. else n = this.$clipPositionToDocument(e, t);
  9019. (e = n.row), (t = n.column);
  9020. var r = 0,
  9021. i = null,
  9022. s = null;
  9023. (s = this.getFoldAt(e, t, 1)),
  9024. s && ((e = s.start.row), (t = s.start.column));
  9025. var o,
  9026. u = 0,
  9027. a = this.$docRowCache,
  9028. f = this.$getRowCacheIndex(a, e),
  9029. l = a.length;
  9030. if (l && f >= 0)
  9031. var u = a[f],
  9032. r = this.$screenRowCache[f],
  9033. c = e > a[l - 1];
  9034. else var c = !l;
  9035. var h = this.getNextFoldLine(u),
  9036. p = h ? h.start.row : Infinity;
  9037. while (u < e) {
  9038. if (u >= p) {
  9039. o = h.end.row + 1;
  9040. if (o > e) break;
  9041. (h = this.getNextFoldLine(o, h)),
  9042. (p = h ? h.start.row : Infinity);
  9043. } else o = u + 1;
  9044. (r += this.getRowLength(u)),
  9045. (u = o),
  9046. c &&
  9047. (this.$docRowCache.push(u), this.$screenRowCache.push(r));
  9048. }
  9049. var d = "";
  9050. h && u >= p
  9051. ? ((d = this.getFoldDisplayLine(h, e, t)), (i = h.start.row))
  9052. : ((d = this.getLine(e).substring(0, t)), (i = e));
  9053. var v = 0;
  9054. if (this.$useWrapMode) {
  9055. var m = this.$wrapData[i];
  9056. if (m) {
  9057. var g = 0;
  9058. while (d.length >= m[g]) r++, g++;
  9059. (d = d.substring(m[g - 1] || 0, d.length)),
  9060. (v = g > 0 ? m.indent : 0);
  9061. }
  9062. }
  9063. return { row: r, column: v + this.$getStringScreenWidth(d)[0] };
  9064. }),
  9065. (this.documentToScreenColumn = function (e, t) {
  9066. return this.documentToScreenPosition(e, t).column;
  9067. }),
  9068. (this.documentToScreenRow = function (e, t) {
  9069. return this.documentToScreenPosition(e, t).row;
  9070. }),
  9071. (this.getScreenLength = function () {
  9072. var e = 0,
  9073. t = null;
  9074. if (!this.$useWrapMode) {
  9075. e = this.getLength();
  9076. var n = this.$foldData;
  9077. for (var r = 0; r < n.length; r++)
  9078. (t = n[r]), (e -= t.end.row - t.start.row);
  9079. } else {
  9080. var i = this.$wrapData.length,
  9081. s = 0,
  9082. r = 0,
  9083. t = this.$foldData[r++],
  9084. o = t ? t.start.row : Infinity;
  9085. while (s < i) {
  9086. var u = this.$wrapData[s];
  9087. (e += u ? u.length + 1 : 1),
  9088. s++,
  9089. s > o &&
  9090. ((s = t.end.row + 1),
  9091. (t = this.$foldData[r++]),
  9092. (o = t ? t.start.row : Infinity));
  9093. }
  9094. }
  9095. return (
  9096. this.lineWidgets && (e += this.$getWidgetScreenLength()), e
  9097. );
  9098. }),
  9099. (this.$setFontMetrics = function (e) {
  9100. if (!this.$enableVarChar) return;
  9101. this.$getStringScreenWidth = function (t, n, r) {
  9102. if (n === 0) return [0, 0];
  9103. n || (n = Infinity), (r = r || 0);
  9104. var i, s;
  9105. for (s = 0; s < t.length; s++) {
  9106. (i = t.charAt(s)),
  9107. i === " "
  9108. ? (r += this.getScreenTabSize(r))
  9109. : (r += e.getCharacterWidth(i));
  9110. if (r > n) break;
  9111. }
  9112. return [r, s];
  9113. };
  9114. }),
  9115. (this.destroy = function () {
  9116. this.bgTokenizer &&
  9117. (this.bgTokenizer.setDocument(null), (this.bgTokenizer = null)),
  9118. this.$stopWorker();
  9119. }),
  9120. (this.isFullWidth = m);
  9121. }.call(d.prototype),
  9122. e("./edit_session/folding").Folding.call(d.prototype),
  9123. e("./edit_session/bracket_match").BracketMatch.call(d.prototype),
  9124. o.defineOptions(d.prototype, "session", {
  9125. wrap: {
  9126. set: function (e) {
  9127. !e || e == "off"
  9128. ? (e = !1)
  9129. : e == "free"
  9130. ? (e = !0)
  9131. : e == "printMargin"
  9132. ? (e = -1)
  9133. : typeof e == "string" && (e = parseInt(e, 10) || !1);
  9134. if (this.$wrap == e) return;
  9135. this.$wrap = e;
  9136. if (!e) this.setUseWrapMode(!1);
  9137. else {
  9138. var t = typeof e == "number" ? e : null;
  9139. this.setWrapLimitRange(t, t), this.setUseWrapMode(!0);
  9140. }
  9141. },
  9142. get: function () {
  9143. return this.getUseWrapMode()
  9144. ? this.$wrap == -1
  9145. ? "printMargin"
  9146. : this.getWrapLimitRange().min
  9147. ? this.$wrap
  9148. : "free"
  9149. : "off";
  9150. },
  9151. handlesSet: !0,
  9152. },
  9153. wrapMethod: {
  9154. set: function (e) {
  9155. (e = e == "auto" ? this.$mode.type != "text" : e != "text"),
  9156. e != this.$wrapAsCode &&
  9157. ((this.$wrapAsCode = e),
  9158. this.$useWrapMode &&
  9159. ((this.$useWrapMode = !1), this.setUseWrapMode(!0)));
  9160. },
  9161. initialValue: "auto",
  9162. },
  9163. indentedSoftWrap: {
  9164. set: function () {
  9165. this.$useWrapMode &&
  9166. ((this.$useWrapMode = !1), this.setUseWrapMode(!0));
  9167. },
  9168. initialValue: !0,
  9169. },
  9170. firstLineNumber: {
  9171. set: function () {
  9172. this._signal("changeBreakpoint");
  9173. },
  9174. initialValue: 1,
  9175. },
  9176. useWorker: {
  9177. set: function (e) {
  9178. (this.$useWorker = e),
  9179. this.$stopWorker(),
  9180. e && this.$startWorker();
  9181. },
  9182. initialValue: !0,
  9183. },
  9184. useSoftTabs: { initialValue: !0 },
  9185. tabSize: {
  9186. set: function (e) {
  9187. if (isNaN(e) || this.$tabSize === e) return;
  9188. (this.$modified = !0),
  9189. (this.$rowLengthCache = []),
  9190. (this.$tabSize = e),
  9191. this._signal("changeTabSize");
  9192. },
  9193. initialValue: 4,
  9194. handlesSet: !0,
  9195. },
  9196. navigateWithinSoftTabs: { initialValue: !1 },
  9197. foldStyle: {
  9198. set: function (e) {
  9199. this.setFoldStyle(e);
  9200. },
  9201. handlesSet: !0,
  9202. },
  9203. overwrite: {
  9204. set: function (e) {
  9205. this._signal("changeOverwrite");
  9206. },
  9207. initialValue: !1,
  9208. },
  9209. newLineMode: {
  9210. set: function (e) {
  9211. this.doc.setNewLineMode(e);
  9212. },
  9213. get: function () {
  9214. return this.doc.getNewLineMode();
  9215. },
  9216. handlesSet: !0,
  9217. },
  9218. mode: {
  9219. set: function (e) {
  9220. this.setMode(e);
  9221. },
  9222. get: function () {
  9223. return this.$modeId;
  9224. },
  9225. handlesSet: !0,
  9226. },
  9227. }),
  9228. (t.EditSession = d);
  9229. }
  9230. ),
  9231. define(
  9232. "ace/search",
  9233. [
  9234. "require",
  9235. "exports",
  9236. "module",
  9237. "ace/lib/lang",
  9238. "ace/lib/oop",
  9239. "ace/range",
  9240. ],
  9241. function (e, t, n) {
  9242. "use strict";
  9243. function u(e, t) {
  9244. function n(e) {
  9245. return /\w/.test(e) || t.regExp ? "\\b" : "";
  9246. }
  9247. return n(e[0]) + e + n(e[e.length - 1]);
  9248. }
  9249. var r = e("./lib/lang"),
  9250. i = e("./lib/oop"),
  9251. s = e("./range").Range,
  9252. o = function () {
  9253. this.$options = {};
  9254. };
  9255. (function () {
  9256. (this.set = function (e) {
  9257. return i.mixin(this.$options, e), this;
  9258. }),
  9259. (this.getOptions = function () {
  9260. return r.copyObject(this.$options);
  9261. }),
  9262. (this.setOptions = function (e) {
  9263. this.$options = e;
  9264. }),
  9265. (this.find = function (e) {
  9266. var t = this.$options,
  9267. n = this.$matchIterator(e, t);
  9268. if (!n) return !1;
  9269. var r = null;
  9270. return (
  9271. n.forEach(function (e, n, i, o) {
  9272. return (
  9273. (r = new s(e, n, i, o)),
  9274. n == o &&
  9275. t.start &&
  9276. t.start.start &&
  9277. t.skipCurrent != 0 &&
  9278. r.isEqual(t.start)
  9279. ? ((r = null), !1)
  9280. : !0
  9281. );
  9282. }),
  9283. r
  9284. );
  9285. }),
  9286. (this.findAll = function (e) {
  9287. var t = this.$options;
  9288. if (!t.needle) return [];
  9289. this.$assembleRegExp(t);
  9290. var n = t.range,
  9291. i = n ? e.getLines(n.start.row, n.end.row) : e.doc.getAllLines(),
  9292. o = [],
  9293. u = t.re;
  9294. if (t.$isMultiLine) {
  9295. var a = u.length,
  9296. f = i.length - a,
  9297. l;
  9298. e: for (var c = u.offset || 0; c <= f; c++) {
  9299. for (var h = 0; h < a; h++)
  9300. if (i[c + h].search(u[h]) == -1) continue e;
  9301. var p = i[c],
  9302. d = i[c + a - 1],
  9303. v = p.length - p.match(u[0])[0].length,
  9304. m = d.match(u[a - 1])[0].length;
  9305. if (l && l.end.row === c && l.end.column > v) continue;
  9306. o.push((l = new s(c, v, c + a - 1, m))),
  9307. a > 2 && (c = c + a - 2);
  9308. }
  9309. } else
  9310. for (var g = 0; g < i.length; g++) {
  9311. var y = r.getMatchOffsets(i[g], u);
  9312. for (var h = 0; h < y.length; h++) {
  9313. var b = y[h];
  9314. o.push(new s(g, b.offset, g, b.offset + b.length));
  9315. }
  9316. }
  9317. if (n) {
  9318. var w = n.start.column,
  9319. E = n.start.column,
  9320. g = 0,
  9321. h = o.length - 1;
  9322. while (
  9323. g < h &&
  9324. o[g].start.column < w &&
  9325. o[g].start.row == n.start.row
  9326. )
  9327. g++;
  9328. while (g < h && o[h].end.column > E && o[h].end.row == n.end.row)
  9329. h--;
  9330. o = o.slice(g, h + 1);
  9331. for (g = 0, h = o.length; g < h; g++)
  9332. (o[g].start.row += n.start.row), (o[g].end.row += n.start.row);
  9333. }
  9334. return o;
  9335. }),
  9336. (this.replace = function (e, t) {
  9337. var n = this.$options,
  9338. r = this.$assembleRegExp(n);
  9339. if (n.$isMultiLine) return t;
  9340. if (!r) return;
  9341. var i = r.exec(e);
  9342. if (!i || i[0].length != e.length) return null;
  9343. t = e.replace(r, t);
  9344. if (n.preserveCase) {
  9345. t = t.split("");
  9346. for (var s = Math.min(e.length, e.length); s--; ) {
  9347. var o = e[s];
  9348. o && o.toLowerCase() != o
  9349. ? (t[s] = t[s].toUpperCase())
  9350. : (t[s] = t[s].toLowerCase());
  9351. }
  9352. t = t.join("");
  9353. }
  9354. return t;
  9355. }),
  9356. (this.$assembleRegExp = function (e, t) {
  9357. if (e.needle instanceof RegExp) return (e.re = e.needle);
  9358. var n = e.needle;
  9359. if (!e.needle) return (e.re = !1);
  9360. e.regExp || (n = r.escapeRegExp(n)), e.wholeWord && (n = u(n, e));
  9361. var i = e.caseSensitive ? "gm" : "gmi";
  9362. e.$isMultiLine = !t && /[\n\r]/.test(n);
  9363. if (e.$isMultiLine)
  9364. return (e.re = this.$assembleMultilineRegExp(n, i));
  9365. try {
  9366. var s = new RegExp(n, i);
  9367. } catch (o) {
  9368. s = !1;
  9369. }
  9370. return (e.re = s);
  9371. }),
  9372. (this.$assembleMultilineRegExp = function (e, t) {
  9373. var n = e.replace(/\r\n|\r|\n/g, "$\n^").split("\n"),
  9374. r = [];
  9375. for (var i = 0; i < n.length; i++)
  9376. try {
  9377. r.push(new RegExp(n[i], t));
  9378. } catch (s) {
  9379. return !1;
  9380. }
  9381. return r;
  9382. }),
  9383. (this.$matchIterator = function (e, t) {
  9384. var n = this.$assembleRegExp(t);
  9385. if (!n) return !1;
  9386. var r = t.backwards == 1,
  9387. i = t.skipCurrent != 0,
  9388. s = t.range,
  9389. o = t.start;
  9390. o || (o = s ? s[r ? "end" : "start"] : e.selection.getRange()),
  9391. o.start && (o = o[i != r ? "end" : "start"]);
  9392. var u = s ? s.start.row : 0,
  9393. a = s ? s.end.row : e.getLength() - 1;
  9394. if (r)
  9395. var f = function (e) {
  9396. var n = o.row;
  9397. if (c(n, o.column, e)) return;
  9398. for (n--; n >= u; n--) if (c(n, Number.MAX_VALUE, e)) return;
  9399. if (t.wrap == 0) return;
  9400. for (n = a, u = o.row; n >= u; n--)
  9401. if (c(n, Number.MAX_VALUE, e)) return;
  9402. };
  9403. else
  9404. var f = function (e) {
  9405. var n = o.row;
  9406. if (c(n, o.column, e)) return;
  9407. for (n += 1; n <= a; n++) if (c(n, 0, e)) return;
  9408. if (t.wrap == 0) return;
  9409. for (n = u, a = o.row; n <= a; n++) if (c(n, 0, e)) return;
  9410. };
  9411. if (t.$isMultiLine)
  9412. var l = n.length,
  9413. c = function (t, i, s) {
  9414. var o = r ? t - l + 1 : t;
  9415. if (o < 0) return;
  9416. var u = e.getLine(o),
  9417. a = u.search(n[0]);
  9418. if ((!r && a < i) || a === -1) return;
  9419. for (var f = 1; f < l; f++) {
  9420. u = e.getLine(o + f);
  9421. if (u.search(n[f]) == -1) return;
  9422. }
  9423. var c = u.match(n[l - 1])[0].length;
  9424. if (r && c > i) return;
  9425. if (s(o, a, o + l - 1, c)) return !0;
  9426. };
  9427. else if (r)
  9428. var c = function (t, r, i) {
  9429. var s = e.getLine(t),
  9430. o = [],
  9431. u,
  9432. a = 0;
  9433. n.lastIndex = 0;
  9434. while ((u = n.exec(s))) {
  9435. var f = u[0].length;
  9436. a = u.index;
  9437. if (!f) {
  9438. if (a >= s.length) break;
  9439. n.lastIndex = a += 1;
  9440. }
  9441. if (u.index + f > r) break;
  9442. o.push(u.index, f);
  9443. }
  9444. for (var l = o.length - 1; l >= 0; l -= 2) {
  9445. var c = o[l - 1],
  9446. f = o[l];
  9447. if (i(t, c, t, c + f)) return !0;
  9448. }
  9449. };
  9450. else
  9451. var c = function (t, r, i) {
  9452. var s = e.getLine(t),
  9453. o,
  9454. u;
  9455. n.lastIndex = r;
  9456. while ((u = n.exec(s))) {
  9457. var a = u[0].length;
  9458. o = u.index;
  9459. if (i(t, o, t, o + a)) return !0;
  9460. if (!a) {
  9461. n.lastIndex = o += 1;
  9462. if (o >= s.length) return !1;
  9463. }
  9464. }
  9465. };
  9466. return { forEach: f };
  9467. });
  9468. }).call(o.prototype),
  9469. (t.Search = o);
  9470. }
  9471. ),
  9472. define(
  9473. "ace/keyboard/hash_handler",
  9474. ["require", "exports", "module", "ace/lib/keys", "ace/lib/useragent"],
  9475. function (e, t, n) {
  9476. "use strict";
  9477. function o(e, t) {
  9478. (this.platform = t || (i.isMac ? "mac" : "win")),
  9479. (this.commands = {}),
  9480. (this.commandKeyBinding = {}),
  9481. this.addCommands(e),
  9482. (this.$singleCommand = !0);
  9483. }
  9484. function u(e, t) {
  9485. o.call(this, e, t), (this.$singleCommand = !1);
  9486. }
  9487. var r = e("../lib/keys"),
  9488. i = e("../lib/useragent"),
  9489. s = r.KEY_MODS;
  9490. (u.prototype = o.prototype),
  9491. function () {
  9492. function e(e) {
  9493. return (
  9494. (typeof e == "object" && e.bindKey && e.bindKey.position) ||
  9495. (e.isDefault ? -100 : 0)
  9496. );
  9497. }
  9498. (this.addCommand = function (e) {
  9499. this.commands[e.name] && this.removeCommand(e),
  9500. (this.commands[e.name] = e),
  9501. e.bindKey && this._buildKeyHash(e);
  9502. }),
  9503. (this.removeCommand = function (e, t) {
  9504. var n = e && (typeof e == "string" ? e : e.name);
  9505. (e = this.commands[n]), t || delete this.commands[n];
  9506. var r = this.commandKeyBinding;
  9507. for (var i in r) {
  9508. var s = r[i];
  9509. if (s == e) delete r[i];
  9510. else if (Array.isArray(s)) {
  9511. var o = s.indexOf(e);
  9512. o != -1 && (s.splice(o, 1), s.length == 1 && (r[i] = s[0]));
  9513. }
  9514. }
  9515. }),
  9516. (this.bindKey = function (e, t, n) {
  9517. typeof e == "object" &&
  9518. e &&
  9519. (n == undefined && (n = e.position), (e = e[this.platform]));
  9520. if (!e) return;
  9521. if (typeof t == "function")
  9522. return this.addCommand({
  9523. exec: t,
  9524. bindKey: e,
  9525. name: t.name || e,
  9526. });
  9527. e.split("|").forEach(function (e) {
  9528. var r = "";
  9529. if (e.indexOf(" ") != -1) {
  9530. var i = e.split(/\s+/);
  9531. (e = i.pop()),
  9532. i.forEach(function (e) {
  9533. var t = this.parseKeys(e),
  9534. n = s[t.hashId] + t.key;
  9535. (r += (r ? " " : "") + n),
  9536. this._addCommandToBinding(r, "chainKeys");
  9537. }, this),
  9538. (r += " ");
  9539. }
  9540. var o = this.parseKeys(e),
  9541. u = s[o.hashId] + o.key;
  9542. this._addCommandToBinding(r + u, t, n);
  9543. }, this);
  9544. }),
  9545. (this._addCommandToBinding = function (t, n, r) {
  9546. var i = this.commandKeyBinding,
  9547. s;
  9548. if (!n) delete i[t];
  9549. else if (!i[t] || this.$singleCommand) i[t] = n;
  9550. else {
  9551. Array.isArray(i[t])
  9552. ? (s = i[t].indexOf(n)) != -1 && i[t].splice(s, 1)
  9553. : (i[t] = [i[t]]),
  9554. typeof r != "number" && (r = e(n));
  9555. var o = i[t];
  9556. for (s = 0; s < o.length; s++) {
  9557. var u = o[s],
  9558. a = e(u);
  9559. if (a > r) break;
  9560. }
  9561. o.splice(s, 0, n);
  9562. }
  9563. }),
  9564. (this.addCommands = function (e) {
  9565. e &&
  9566. Object.keys(e).forEach(function (t) {
  9567. var n = e[t];
  9568. if (!n) return;
  9569. if (typeof n == "string") return this.bindKey(n, t);
  9570. typeof n == "function" && (n = { exec: n });
  9571. if (typeof n != "object") return;
  9572. n.name || (n.name = t), this.addCommand(n);
  9573. }, this);
  9574. }),
  9575. (this.removeCommands = function (e) {
  9576. Object.keys(e).forEach(function (t) {
  9577. this.removeCommand(e[t]);
  9578. }, this);
  9579. }),
  9580. (this.bindKeys = function (e) {
  9581. Object.keys(e).forEach(function (t) {
  9582. this.bindKey(t, e[t]);
  9583. }, this);
  9584. }),
  9585. (this._buildKeyHash = function (e) {
  9586. this.bindKey(e.bindKey, e);
  9587. }),
  9588. (this.parseKeys = function (e) {
  9589. var t = e
  9590. .toLowerCase()
  9591. .split(/[\-\+]([\-\+])?/)
  9592. .filter(function (e) {
  9593. return e;
  9594. }),
  9595. n = t.pop(),
  9596. i = r[n];
  9597. if (r.FUNCTION_KEYS[i]) n = r.FUNCTION_KEYS[i].toLowerCase();
  9598. else {
  9599. if (!t.length) return { key: n, hashId: -1 };
  9600. if (t.length == 1 && t[0] == "shift")
  9601. return { key: n.toUpperCase(), hashId: -1 };
  9602. }
  9603. var s = 0;
  9604. for (var o = t.length; o--; ) {
  9605. var u = r.KEY_MODS[t[o]];
  9606. if (u == null)
  9607. return (
  9608. typeof console != "undefined" &&
  9609. console.error("invalid modifier " + t[o] + " in " + e),
  9610. !1
  9611. );
  9612. s |= u;
  9613. }
  9614. return { key: n, hashId: s };
  9615. }),
  9616. (this.findKeyCommand = function (t, n) {
  9617. var r = s[t] + n;
  9618. return this.commandKeyBinding[r];
  9619. }),
  9620. (this.handleKeyboard = function (e, t, n, r) {
  9621. if (r < 0) return;
  9622. var i = s[t] + n,
  9623. o = this.commandKeyBinding[i];
  9624. e.$keyChain &&
  9625. ((e.$keyChain += " " + i),
  9626. (o = this.commandKeyBinding[e.$keyChain] || o));
  9627. if (o)
  9628. if (o == "chainKeys" || o[o.length - 1] == "chainKeys")
  9629. return (e.$keyChain = e.$keyChain || i), { command: "null" };
  9630. if (e.$keyChain)
  9631. if ((!!t && t != 4) || n.length != 1) {
  9632. if (t == -1 || r > 0) e.$keyChain = "";
  9633. } else e.$keyChain = e.$keyChain.slice(0, -i.length - 1);
  9634. return { command: o };
  9635. }),
  9636. (this.getStatusText = function (e, t) {
  9637. return t.$keyChain || "";
  9638. });
  9639. }.call(o.prototype),
  9640. (t.HashHandler = o),
  9641. (t.MultiHashHandler = u);
  9642. }
  9643. ),
  9644. define(
  9645. "ace/commands/command_manager",
  9646. [
  9647. "require",
  9648. "exports",
  9649. "module",
  9650. "ace/lib/oop",
  9651. "ace/keyboard/hash_handler",
  9652. "ace/lib/event_emitter",
  9653. ],
  9654. function (e, t, n) {
  9655. "use strict";
  9656. var r = e("../lib/oop"),
  9657. i = e("../keyboard/hash_handler").MultiHashHandler,
  9658. s = e("../lib/event_emitter").EventEmitter,
  9659. o = function (e, t) {
  9660. i.call(this, t, e),
  9661. (this.byName = this.commands),
  9662. this.setDefaultHandler("exec", function (e) {
  9663. return e.command.exec(e.editor, e.args || {});
  9664. });
  9665. };
  9666. r.inherits(o, i),
  9667. function () {
  9668. r.implement(this, s),
  9669. (this.exec = function (e, t, n) {
  9670. if (Array.isArray(e)) {
  9671. for (var r = e.length; r--; )
  9672. if (this.exec(e[r], t, n)) return !0;
  9673. return !1;
  9674. }
  9675. typeof e == "string" && (e = this.commands[e]);
  9676. if (!e) return !1;
  9677. if (t && t.$readOnly && !e.readOnly) return !1;
  9678. if (
  9679. this.$checkCommandState != 0 &&
  9680. e.isAvailable &&
  9681. !e.isAvailable(t)
  9682. )
  9683. return !1;
  9684. var i = { editor: t, command: e, args: n };
  9685. return (
  9686. (i.returnValue = this._emit("exec", i)),
  9687. this._signal("afterExec", i),
  9688. i.returnValue === !1 ? !1 : !0
  9689. );
  9690. }),
  9691. (this.toggleRecording = function (e) {
  9692. if (this.$inReplay) return;
  9693. return (
  9694. e && e._emit("changeStatus"),
  9695. this.recording
  9696. ? (this.macro.pop(),
  9697. this.removeEventListener("exec", this.$addCommandToMacro),
  9698. this.macro.length || (this.macro = this.oldMacro),
  9699. (this.recording = !1))
  9700. : (this.$addCommandToMacro ||
  9701. (this.$addCommandToMacro = function (e) {
  9702. this.macro.push([e.command, e.args]);
  9703. }.bind(this)),
  9704. (this.oldMacro = this.macro),
  9705. (this.macro = []),
  9706. this.on("exec", this.$addCommandToMacro),
  9707. (this.recording = !0))
  9708. );
  9709. }),
  9710. (this.replay = function (e) {
  9711. if (this.$inReplay || !this.macro) return;
  9712. if (this.recording) return this.toggleRecording(e);
  9713. try {
  9714. (this.$inReplay = !0),
  9715. this.macro.forEach(function (t) {
  9716. typeof t == "string"
  9717. ? this.exec(t, e)
  9718. : this.exec(t[0], e, t[1]);
  9719. }, this);
  9720. } finally {
  9721. this.$inReplay = !1;
  9722. }
  9723. }),
  9724. (this.trimMacro = function (e) {
  9725. return e.map(function (e) {
  9726. return (
  9727. typeof e[0] != "string" && (e[0] = e[0].name),
  9728. e[1] || (e = e[0]),
  9729. e
  9730. );
  9731. });
  9732. });
  9733. }.call(o.prototype),
  9734. (t.CommandManager = o);
  9735. }
  9736. ),
  9737. define(
  9738. "ace/commands/default_commands",
  9739. ["require", "exports", "module", "ace/lib/lang", "ace/config", "ace/range"],
  9740. function (e, t, n) {
  9741. "use strict";
  9742. function o(e, t) {
  9743. return { win: e, mac: t };
  9744. }
  9745. var r = e("../lib/lang"),
  9746. i = e("../config"),
  9747. s = e("../range").Range;
  9748. t.commands = [
  9749. {
  9750. name: "showSettingsMenu",
  9751. bindKey: o("Ctrl-,", "Command-,"),
  9752. exec: function (e) {
  9753. i.loadModule("ace/ext/settings_menu", function (t) {
  9754. t.init(e), e.showSettingsMenu();
  9755. });
  9756. },
  9757. readOnly: !0,
  9758. },
  9759. {
  9760. name: "goToNextError",
  9761. bindKey: o("Alt-E", "F4"),
  9762. exec: function (e) {
  9763. i.loadModule("./ext/error_marker", function (t) {
  9764. t.showErrorMarker(e, 1);
  9765. });
  9766. },
  9767. scrollIntoView: "animate",
  9768. readOnly: !0,
  9769. },
  9770. {
  9771. name: "goToPreviousError",
  9772. bindKey: o("Alt-Shift-E", "Shift-F4"),
  9773. exec: function (e) {
  9774. i.loadModule("./ext/error_marker", function (t) {
  9775. t.showErrorMarker(e, -1);
  9776. });
  9777. },
  9778. scrollIntoView: "animate",
  9779. readOnly: !0,
  9780. },
  9781. {
  9782. name: "selectall",
  9783. bindKey: o("Ctrl-A", "Command-A"),
  9784. exec: function (e) {
  9785. e.selectAll();
  9786. },
  9787. readOnly: !0,
  9788. },
  9789. {
  9790. name: "centerselection",
  9791. bindKey: o(null, "Ctrl-L"),
  9792. exec: function (e) {
  9793. e.centerSelection();
  9794. },
  9795. readOnly: !0,
  9796. },
  9797. {
  9798. name: "gotoline",
  9799. bindKey: o("Ctrl-L", "Command-L"),
  9800. exec: function (e, t) {
  9801. typeof t != "number" &&
  9802. (t = parseInt(prompt("Enter line number:"), 10)),
  9803. isNaN(t) || e.gotoLine(t);
  9804. },
  9805. readOnly: !0,
  9806. },
  9807. {
  9808. name: "fold",
  9809. bindKey: o("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"),
  9810. exec: function (e) {
  9811. e.session.toggleFold(!1);
  9812. },
  9813. multiSelectAction: "forEach",
  9814. scrollIntoView: "center",
  9815. readOnly: !0,
  9816. },
  9817. {
  9818. name: "unfold",
  9819. bindKey: o(
  9820. "Alt-Shift-L|Ctrl-Shift-F1",
  9821. "Command-Alt-Shift-L|Command-Shift-F1"
  9822. ),
  9823. exec: function (e) {
  9824. e.session.toggleFold(!0);
  9825. },
  9826. multiSelectAction: "forEach",
  9827. scrollIntoView: "center",
  9828. readOnly: !0,
  9829. },
  9830. {
  9831. name: "toggleFoldWidget",
  9832. bindKey: o("F2", "F2"),
  9833. exec: function (e) {
  9834. e.session.toggleFoldWidget();
  9835. },
  9836. multiSelectAction: "forEach",
  9837. scrollIntoView: "center",
  9838. readOnly: !0,
  9839. },
  9840. {
  9841. name: "toggleParentFoldWidget",
  9842. bindKey: o("Alt-F2", "Alt-F2"),
  9843. exec: function (e) {
  9844. e.session.toggleFoldWidget(!0);
  9845. },
  9846. multiSelectAction: "forEach",
  9847. scrollIntoView: "center",
  9848. readOnly: !0,
  9849. },
  9850. {
  9851. name: "foldall",
  9852. bindKey: o(null, "Ctrl-Command-Option-0"),
  9853. exec: function (e) {
  9854. e.session.foldAll();
  9855. },
  9856. scrollIntoView: "center",
  9857. readOnly: !0,
  9858. },
  9859. {
  9860. name: "foldOther",
  9861. bindKey: o("Alt-0", "Command-Option-0"),
  9862. exec: function (e) {
  9863. e.session.foldAll(), e.session.unfold(e.selection.getAllRanges());
  9864. },
  9865. scrollIntoView: "center",
  9866. readOnly: !0,
  9867. },
  9868. {
  9869. name: "unfoldall",
  9870. bindKey: o("Alt-Shift-0", "Command-Option-Shift-0"),
  9871. exec: function (e) {
  9872. e.session.unfold();
  9873. },
  9874. scrollIntoView: "center",
  9875. readOnly: !0,
  9876. },
  9877. {
  9878. name: "findnext",
  9879. bindKey: o("Ctrl-K", "Command-G"),
  9880. exec: function (e) {
  9881. e.findNext();
  9882. },
  9883. multiSelectAction: "forEach",
  9884. scrollIntoView: "center",
  9885. readOnly: !0,
  9886. },
  9887. {
  9888. name: "findprevious",
  9889. bindKey: o("Ctrl-Shift-K", "Command-Shift-G"),
  9890. exec: function (e) {
  9891. e.findPrevious();
  9892. },
  9893. multiSelectAction: "forEach",
  9894. scrollIntoView: "center",
  9895. readOnly: !0,
  9896. },
  9897. {
  9898. name: "selectOrFindNext",
  9899. bindKey: o("Alt-K", "Ctrl-G"),
  9900. exec: function (e) {
  9901. e.selection.isEmpty() ? e.selection.selectWord() : e.findNext();
  9902. },
  9903. readOnly: !0,
  9904. },
  9905. {
  9906. name: "selectOrFindPrevious",
  9907. bindKey: o("Alt-Shift-K", "Ctrl-Shift-G"),
  9908. exec: function (e) {
  9909. e.selection.isEmpty() ? e.selection.selectWord() : e.findPrevious();
  9910. },
  9911. readOnly: !0,
  9912. },
  9913. {
  9914. name: "find",
  9915. bindKey: o("Ctrl-F", "Command-F"),
  9916. exec: function (e) {
  9917. i.loadModule("ace/ext/searchbox", function (t) {
  9918. t.Search(e);
  9919. });
  9920. },
  9921. readOnly: !0,
  9922. },
  9923. {
  9924. name: "overwrite",
  9925. bindKey: "Insert",
  9926. exec: function (e) {
  9927. e.toggleOverwrite();
  9928. },
  9929. readOnly: !0,
  9930. },
  9931. {
  9932. name: "selecttostart",
  9933. bindKey: o("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"),
  9934. exec: function (e) {
  9935. e.getSelection().selectFileStart();
  9936. },
  9937. multiSelectAction: "forEach",
  9938. readOnly: !0,
  9939. scrollIntoView: "animate",
  9940. aceCommandGroup: "fileJump",
  9941. },
  9942. {
  9943. name: "gotostart",
  9944. bindKey: o("Ctrl-Home", "Command-Home|Command-Up"),
  9945. exec: function (e) {
  9946. e.navigateFileStart();
  9947. },
  9948. multiSelectAction: "forEach",
  9949. readOnly: !0,
  9950. scrollIntoView: "animate",
  9951. aceCommandGroup: "fileJump",
  9952. },
  9953. {
  9954. name: "selectup",
  9955. bindKey: o("Shift-Up", "Shift-Up|Ctrl-Shift-P"),
  9956. exec: function (e) {
  9957. e.getSelection().selectUp();
  9958. },
  9959. multiSelectAction: "forEach",
  9960. scrollIntoView: "cursor",
  9961. readOnly: !0,
  9962. },
  9963. {
  9964. name: "golineup",
  9965. bindKey: o("Up", "Up|Ctrl-P"),
  9966. exec: function (e, t) {
  9967. e.navigateUp(t.times);
  9968. },
  9969. multiSelectAction: "forEach",
  9970. scrollIntoView: "cursor",
  9971. readOnly: !0,
  9972. },
  9973. {
  9974. name: "selecttoend",
  9975. bindKey: o("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"),
  9976. exec: function (e) {
  9977. e.getSelection().selectFileEnd();
  9978. },
  9979. multiSelectAction: "forEach",
  9980. readOnly: !0,
  9981. scrollIntoView: "animate",
  9982. aceCommandGroup: "fileJump",
  9983. },
  9984. {
  9985. name: "gotoend",
  9986. bindKey: o("Ctrl-End", "Command-End|Command-Down"),
  9987. exec: function (e) {
  9988. e.navigateFileEnd();
  9989. },
  9990. multiSelectAction: "forEach",
  9991. readOnly: !0,
  9992. scrollIntoView: "animate",
  9993. aceCommandGroup: "fileJump",
  9994. },
  9995. {
  9996. name: "selectdown",
  9997. bindKey: o("Shift-Down", "Shift-Down|Ctrl-Shift-N"),
  9998. exec: function (e) {
  9999. e.getSelection().selectDown();
  10000. },
  10001. multiSelectAction: "forEach",
  10002. scrollIntoView: "cursor",
  10003. readOnly: !0,
  10004. },
  10005. {
  10006. name: "golinedown",
  10007. bindKey: o("Down", "Down|Ctrl-N"),
  10008. exec: function (e, t) {
  10009. e.navigateDown(t.times);
  10010. },
  10011. multiSelectAction: "forEach",
  10012. scrollIntoView: "cursor",
  10013. readOnly: !0,
  10014. },
  10015. {
  10016. name: "selectwordleft",
  10017. bindKey: o("Ctrl-Shift-Left", "Option-Shift-Left"),
  10018. exec: function (e) {
  10019. e.getSelection().selectWordLeft();
  10020. },
  10021. multiSelectAction: "forEach",
  10022. scrollIntoView: "cursor",
  10023. readOnly: !0,
  10024. },
  10025. {
  10026. name: "gotowordleft",
  10027. bindKey: o("Ctrl-Left", "Option-Left"),
  10028. exec: function (e) {
  10029. e.navigateWordLeft();
  10030. },
  10031. multiSelectAction: "forEach",
  10032. scrollIntoView: "cursor",
  10033. readOnly: !0,
  10034. },
  10035. {
  10036. name: "selecttolinestart",
  10037. bindKey: o("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"),
  10038. exec: function (e) {
  10039. e.getSelection().selectLineStart();
  10040. },
  10041. multiSelectAction: "forEach",
  10042. scrollIntoView: "cursor",
  10043. readOnly: !0,
  10044. },
  10045. {
  10046. name: "gotolinestart",
  10047. bindKey: o("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
  10048. exec: function (e) {
  10049. e.navigateLineStart();
  10050. },
  10051. multiSelectAction: "forEach",
  10052. scrollIntoView: "cursor",
  10053. readOnly: !0,
  10054. },
  10055. {
  10056. name: "selectleft",
  10057. bindKey: o("Shift-Left", "Shift-Left|Ctrl-Shift-B"),
  10058. exec: function (e) {
  10059. e.getSelection().selectLeft();
  10060. },
  10061. multiSelectAction: "forEach",
  10062. scrollIntoView: "cursor",
  10063. readOnly: !0,
  10064. },
  10065. {
  10066. name: "gotoleft",
  10067. bindKey: o("Left", "Left|Ctrl-B"),
  10068. exec: function (e, t) {
  10069. e.navigateLeft(t.times);
  10070. },
  10071. multiSelectAction: "forEach",
  10072. scrollIntoView: "cursor",
  10073. readOnly: !0,
  10074. },
  10075. {
  10076. name: "selectwordright",
  10077. bindKey: o("Ctrl-Shift-Right", "Option-Shift-Right"),
  10078. exec: function (e) {
  10079. e.getSelection().selectWordRight();
  10080. },
  10081. multiSelectAction: "forEach",
  10082. scrollIntoView: "cursor",
  10083. readOnly: !0,
  10084. },
  10085. {
  10086. name: "gotowordright",
  10087. bindKey: o("Ctrl-Right", "Option-Right"),
  10088. exec: function (e) {
  10089. e.navigateWordRight();
  10090. },
  10091. multiSelectAction: "forEach",
  10092. scrollIntoView: "cursor",
  10093. readOnly: !0,
  10094. },
  10095. {
  10096. name: "selecttolineend",
  10097. bindKey: o(
  10098. "Alt-Shift-Right",
  10099. "Command-Shift-Right|Shift-End|Ctrl-Shift-E"
  10100. ),
  10101. exec: function (e) {
  10102. e.getSelection().selectLineEnd();
  10103. },
  10104. multiSelectAction: "forEach",
  10105. scrollIntoView: "cursor",
  10106. readOnly: !0,
  10107. },
  10108. {
  10109. name: "gotolineend",
  10110. bindKey: o("Alt-Right|End", "Command-Right|End|Ctrl-E"),
  10111. exec: function (e) {
  10112. e.navigateLineEnd();
  10113. },
  10114. multiSelectAction: "forEach",
  10115. scrollIntoView: "cursor",
  10116. readOnly: !0,
  10117. },
  10118. {
  10119. name: "selectright",
  10120. bindKey: o("Shift-Right", "Shift-Right"),
  10121. exec: function (e) {
  10122. e.getSelection().selectRight();
  10123. },
  10124. multiSelectAction: "forEach",
  10125. scrollIntoView: "cursor",
  10126. readOnly: !0,
  10127. },
  10128. {
  10129. name: "gotoright",
  10130. bindKey: o("Right", "Right|Ctrl-F"),
  10131. exec: function (e, t) {
  10132. e.navigateRight(t.times);
  10133. },
  10134. multiSelectAction: "forEach",
  10135. scrollIntoView: "cursor",
  10136. readOnly: !0,
  10137. },
  10138. {
  10139. name: "selectpagedown",
  10140. bindKey: "Shift-PageDown",
  10141. exec: function (e) {
  10142. e.selectPageDown();
  10143. },
  10144. readOnly: !0,
  10145. },
  10146. {
  10147. name: "pagedown",
  10148. bindKey: o(null, "Option-PageDown"),
  10149. exec: function (e) {
  10150. e.scrollPageDown();
  10151. },
  10152. readOnly: !0,
  10153. },
  10154. {
  10155. name: "gotopagedown",
  10156. bindKey: o("PageDown", "PageDown|Ctrl-V"),
  10157. exec: function (e) {
  10158. e.gotoPageDown();
  10159. },
  10160. readOnly: !0,
  10161. },
  10162. {
  10163. name: "selectpageup",
  10164. bindKey: "Shift-PageUp",
  10165. exec: function (e) {
  10166. e.selectPageUp();
  10167. },
  10168. readOnly: !0,
  10169. },
  10170. {
  10171. name: "pageup",
  10172. bindKey: o(null, "Option-PageUp"),
  10173. exec: function (e) {
  10174. e.scrollPageUp();
  10175. },
  10176. readOnly: !0,
  10177. },
  10178. {
  10179. name: "gotopageup",
  10180. bindKey: "PageUp",
  10181. exec: function (e) {
  10182. e.gotoPageUp();
  10183. },
  10184. readOnly: !0,
  10185. },
  10186. {
  10187. name: "scrollup",
  10188. bindKey: o("Ctrl-Up", null),
  10189. exec: function (e) {
  10190. e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight);
  10191. },
  10192. readOnly: !0,
  10193. },
  10194. {
  10195. name: "scrolldown",
  10196. bindKey: o("Ctrl-Down", null),
  10197. exec: function (e) {
  10198. e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight);
  10199. },
  10200. readOnly: !0,
  10201. },
  10202. {
  10203. name: "selectlinestart",
  10204. bindKey: "Shift-Home",
  10205. exec: function (e) {
  10206. e.getSelection().selectLineStart();
  10207. },
  10208. multiSelectAction: "forEach",
  10209. scrollIntoView: "cursor",
  10210. readOnly: !0,
  10211. },
  10212. {
  10213. name: "selectlineend",
  10214. bindKey: "Shift-End",
  10215. exec: function (e) {
  10216. e.getSelection().selectLineEnd();
  10217. },
  10218. multiSelectAction: "forEach",
  10219. scrollIntoView: "cursor",
  10220. readOnly: !0,
  10221. },
  10222. {
  10223. name: "togglerecording",
  10224. bindKey: o("Ctrl-Alt-E", "Command-Option-E"),
  10225. exec: function (e) {
  10226. e.commands.toggleRecording(e);
  10227. },
  10228. readOnly: !0,
  10229. },
  10230. {
  10231. name: "replaymacro",
  10232. bindKey: o("Ctrl-Shift-E", "Command-Shift-E"),
  10233. exec: function (e) {
  10234. e.commands.replay(e);
  10235. },
  10236. readOnly: !0,
  10237. },
  10238. {
  10239. name: "jumptomatching",
  10240. bindKey: o("Ctrl-P", "Ctrl-P"),
  10241. exec: function (e) {
  10242. e.jumpToMatching();
  10243. },
  10244. multiSelectAction: "forEach",
  10245. scrollIntoView: "animate",
  10246. readOnly: !0,
  10247. },
  10248. {
  10249. name: "selecttomatching",
  10250. bindKey: o("Ctrl-Shift-P", "Ctrl-Shift-P"),
  10251. exec: function (e) {
  10252. e.jumpToMatching(!0);
  10253. },
  10254. multiSelectAction: "forEach",
  10255. scrollIntoView: "animate",
  10256. readOnly: !0,
  10257. },
  10258. {
  10259. name: "expandToMatching",
  10260. bindKey: o("Ctrl-Shift-M", "Ctrl-Shift-M"),
  10261. exec: function (e) {
  10262. e.jumpToMatching(!0, !0);
  10263. },
  10264. multiSelectAction: "forEach",
  10265. scrollIntoView: "animate",
  10266. readOnly: !0,
  10267. },
  10268. {
  10269. name: "passKeysToBrowser",
  10270. bindKey: o(null, null),
  10271. exec: function () {},
  10272. passEvent: !0,
  10273. readOnly: !0,
  10274. },
  10275. { name: "copy", exec: function (e) {}, readOnly: !0 },
  10276. {
  10277. name: "cut",
  10278. exec: function (e) {
  10279. var t = e.$copyWithEmptySelection && e.selection.isEmpty(),
  10280. n = t ? e.selection.getLineRange() : e.selection.getRange();
  10281. e._emit("cut", n),
  10282. n.isEmpty() || e.session.remove(n),
  10283. e.clearSelection();
  10284. },
  10285. scrollIntoView: "cursor",
  10286. multiSelectAction: "forEach",
  10287. },
  10288. {
  10289. name: "paste",
  10290. exec: function (e, t) {
  10291. e.$handlePaste(t);
  10292. },
  10293. scrollIntoView: "cursor",
  10294. },
  10295. {
  10296. name: "removeline",
  10297. bindKey: o("Ctrl-D", "Command-D"),
  10298. exec: function (e) {
  10299. e.removeLines();
  10300. },
  10301. scrollIntoView: "cursor",
  10302. multiSelectAction: "forEachLine",
  10303. },
  10304. {
  10305. name: "duplicateSelection",
  10306. bindKey: o("Ctrl-Shift-D", "Command-Shift-D"),
  10307. exec: function (e) {
  10308. e.duplicateSelection();
  10309. },
  10310. scrollIntoView: "cursor",
  10311. multiSelectAction: "forEach",
  10312. },
  10313. {
  10314. name: "sortlines",
  10315. bindKey: o("Ctrl-Alt-S", "Command-Alt-S"),
  10316. exec: function (e) {
  10317. e.sortLines();
  10318. },
  10319. scrollIntoView: "selection",
  10320. multiSelectAction: "forEachLine",
  10321. },
  10322. {
  10323. name: "togglecomment",
  10324. bindKey: o("Ctrl-/", "Command-/"),
  10325. exec: function (e) {
  10326. e.toggleCommentLines();
  10327. },
  10328. multiSelectAction: "forEachLine",
  10329. scrollIntoView: "selectionPart",
  10330. },
  10331. {
  10332. name: "toggleBlockComment",
  10333. bindKey: o("Ctrl-Shift-/", "Command-Shift-/"),
  10334. exec: function (e) {
  10335. e.toggleBlockComment();
  10336. },
  10337. multiSelectAction: "forEach",
  10338. scrollIntoView: "selectionPart",
  10339. },
  10340. {
  10341. name: "modifyNumberUp",
  10342. bindKey: o("Ctrl-Shift-Up", "Alt-Shift-Up"),
  10343. exec: function (e) {
  10344. e.modifyNumber(1);
  10345. },
  10346. scrollIntoView: "cursor",
  10347. multiSelectAction: "forEach",
  10348. },
  10349. {
  10350. name: "modifyNumberDown",
  10351. bindKey: o("Ctrl-Shift-Down", "Alt-Shift-Down"),
  10352. exec: function (e) {
  10353. e.modifyNumber(-1);
  10354. },
  10355. scrollIntoView: "cursor",
  10356. multiSelectAction: "forEach",
  10357. },
  10358. {
  10359. name: "replace",
  10360. bindKey: o("Ctrl-H", "Command-Option-F"),
  10361. exec: function (e) {
  10362. i.loadModule("ace/ext/searchbox", function (t) {
  10363. t.Search(e, !0);
  10364. });
  10365. },
  10366. },
  10367. {
  10368. name: "undo",
  10369. bindKey: o("Ctrl-Z", "Command-Z"),
  10370. exec: function (e) {
  10371. e.undo();
  10372. },
  10373. },
  10374. {
  10375. name: "redo",
  10376. bindKey: o("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"),
  10377. exec: function (e) {
  10378. e.redo();
  10379. },
  10380. },
  10381. {
  10382. name: "copylinesup",
  10383. bindKey: o("Alt-Shift-Up", "Command-Option-Up"),
  10384. exec: function (e) {
  10385. e.copyLinesUp();
  10386. },
  10387. scrollIntoView: "cursor",
  10388. },
  10389. {
  10390. name: "movelinesup",
  10391. bindKey: o("Alt-Up", "Option-Up"),
  10392. exec: function (e) {
  10393. e.moveLinesUp();
  10394. },
  10395. scrollIntoView: "cursor",
  10396. },
  10397. {
  10398. name: "copylinesdown",
  10399. bindKey: o("Alt-Shift-Down", "Command-Option-Down"),
  10400. exec: function (e) {
  10401. e.copyLinesDown();
  10402. },
  10403. scrollIntoView: "cursor",
  10404. },
  10405. {
  10406. name: "movelinesdown",
  10407. bindKey: o("Alt-Down", "Option-Down"),
  10408. exec: function (e) {
  10409. e.moveLinesDown();
  10410. },
  10411. scrollIntoView: "cursor",
  10412. },
  10413. {
  10414. name: "del",
  10415. bindKey: o("Delete", "Delete|Ctrl-D|Shift-Delete"),
  10416. exec: function (e) {
  10417. e.remove("right");
  10418. },
  10419. multiSelectAction: "forEach",
  10420. scrollIntoView: "cursor",
  10421. },
  10422. {
  10423. name: "backspace",
  10424. bindKey: o(
  10425. "Shift-Backspace|Backspace",
  10426. "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"
  10427. ),
  10428. exec: function (e) {
  10429. e.remove("left");
  10430. },
  10431. multiSelectAction: "forEach",
  10432. scrollIntoView: "cursor",
  10433. },
  10434. {
  10435. name: "cut_or_delete",
  10436. bindKey: o("Shift-Delete", null),
  10437. exec: function (e) {
  10438. if (!e.selection.isEmpty()) return !1;
  10439. e.remove("left");
  10440. },
  10441. multiSelectAction: "forEach",
  10442. scrollIntoView: "cursor",
  10443. },
  10444. {
  10445. name: "removetolinestart",
  10446. bindKey: o("Alt-Backspace", "Command-Backspace"),
  10447. exec: function (e) {
  10448. e.removeToLineStart();
  10449. },
  10450. multiSelectAction: "forEach",
  10451. scrollIntoView: "cursor",
  10452. },
  10453. {
  10454. name: "removetolineend",
  10455. bindKey: o("Alt-Delete", "Ctrl-K|Command-Delete"),
  10456. exec: function (e) {
  10457. e.removeToLineEnd();
  10458. },
  10459. multiSelectAction: "forEach",
  10460. scrollIntoView: "cursor",
  10461. },
  10462. {
  10463. name: "removetolinestarthard",
  10464. bindKey: o("Ctrl-Shift-Backspace", null),
  10465. exec: function (e) {
  10466. var t = e.selection.getRange();
  10467. (t.start.column = 0), e.session.remove(t);
  10468. },
  10469. multiSelectAction: "forEach",
  10470. scrollIntoView: "cursor",
  10471. },
  10472. {
  10473. name: "removetolineendhard",
  10474. bindKey: o("Ctrl-Shift-Delete", null),
  10475. exec: function (e) {
  10476. var t = e.selection.getRange();
  10477. (t.end.column = Number.MAX_VALUE), e.session.remove(t);
  10478. },
  10479. multiSelectAction: "forEach",
  10480. scrollIntoView: "cursor",
  10481. },
  10482. {
  10483. name: "removewordleft",
  10484. bindKey: o("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
  10485. exec: function (e) {
  10486. e.removeWordLeft();
  10487. },
  10488. multiSelectAction: "forEach",
  10489. scrollIntoView: "cursor",
  10490. },
  10491. {
  10492. name: "removewordright",
  10493. bindKey: o("Ctrl-Delete", "Alt-Delete"),
  10494. exec: function (e) {
  10495. e.removeWordRight();
  10496. },
  10497. multiSelectAction: "forEach",
  10498. scrollIntoView: "cursor",
  10499. },
  10500. {
  10501. name: "outdent",
  10502. bindKey: o("Shift-Tab", "Shift-Tab"),
  10503. exec: function (e) {
  10504. e.blockOutdent();
  10505. },
  10506. multiSelectAction: "forEach",
  10507. scrollIntoView: "selectionPart",
  10508. },
  10509. {
  10510. name: "indent",
  10511. bindKey: o("Tab", "Tab"),
  10512. exec: function (e) {
  10513. e.indent();
  10514. },
  10515. multiSelectAction: "forEach",
  10516. scrollIntoView: "selectionPart",
  10517. },
  10518. {
  10519. name: "blockoutdent",
  10520. bindKey: o("Ctrl-[", "Ctrl-["),
  10521. exec: function (e) {
  10522. e.blockOutdent();
  10523. },
  10524. multiSelectAction: "forEachLine",
  10525. scrollIntoView: "selectionPart",
  10526. },
  10527. {
  10528. name: "blockindent",
  10529. bindKey: o("Ctrl-]", "Ctrl-]"),
  10530. exec: function (e) {
  10531. e.blockIndent();
  10532. },
  10533. multiSelectAction: "forEachLine",
  10534. scrollIntoView: "selectionPart",
  10535. },
  10536. {
  10537. name: "insertstring",
  10538. exec: function (e, t) {
  10539. e.insert(t);
  10540. },
  10541. multiSelectAction: "forEach",
  10542. scrollIntoView: "cursor",
  10543. },
  10544. {
  10545. name: "inserttext",
  10546. exec: function (e, t) {
  10547. e.insert(r.stringRepeat(t.text || "", t.times || 1));
  10548. },
  10549. multiSelectAction: "forEach",
  10550. scrollIntoView: "cursor",
  10551. },
  10552. {
  10553. name: "splitline",
  10554. bindKey: o(null, "Ctrl-O"),
  10555. exec: function (e) {
  10556. e.splitLine();
  10557. },
  10558. multiSelectAction: "forEach",
  10559. scrollIntoView: "cursor",
  10560. },
  10561. {
  10562. name: "transposeletters",
  10563. bindKey: o("Alt-Shift-X", "Ctrl-T"),
  10564. exec: function (e) {
  10565. e.transposeLetters();
  10566. },
  10567. multiSelectAction: function (e) {
  10568. e.transposeSelections(1);
  10569. },
  10570. scrollIntoView: "cursor",
  10571. },
  10572. {
  10573. name: "touppercase",
  10574. bindKey: o("Ctrl-U", "Ctrl-U"),
  10575. exec: function (e) {
  10576. e.toUpperCase();
  10577. },
  10578. multiSelectAction: "forEach",
  10579. scrollIntoView: "cursor",
  10580. },
  10581. {
  10582. name: "tolowercase",
  10583. bindKey: o("Ctrl-Shift-U", "Ctrl-Shift-U"),
  10584. exec: function (e) {
  10585. e.toLowerCase();
  10586. },
  10587. multiSelectAction: "forEach",
  10588. scrollIntoView: "cursor",
  10589. },
  10590. {
  10591. name: "expandtoline",
  10592. bindKey: o("Ctrl-Shift-L", "Command-Shift-L"),
  10593. exec: function (e) {
  10594. var t = e.selection.getRange();
  10595. (t.start.column = t.end.column = 0),
  10596. t.end.row++,
  10597. e.selection.setRange(t, !1);
  10598. },
  10599. multiSelectAction: "forEach",
  10600. scrollIntoView: "cursor",
  10601. readOnly: !0,
  10602. },
  10603. {
  10604. name: "joinlines",
  10605. bindKey: o(null, null),
  10606. exec: function (e) {
  10607. var t = e.selection.isBackwards(),
  10608. n = t
  10609. ? e.selection.getSelectionLead()
  10610. : e.selection.getSelectionAnchor(),
  10611. i = t
  10612. ? e.selection.getSelectionAnchor()
  10613. : e.selection.getSelectionLead(),
  10614. o = e.session.doc.getLine(n.row).length,
  10615. u = e.session.doc.getTextRange(e.selection.getRange()),
  10616. a = u.replace(/\n\s*/, " ").length,
  10617. f = e.session.doc.getLine(n.row);
  10618. for (var l = n.row + 1; l <= i.row + 1; l++) {
  10619. var c = r.stringTrimLeft(
  10620. r.stringTrimRight(e.session.doc.getLine(l))
  10621. );
  10622. c.length !== 0 && (c = " " + c), (f += c);
  10623. }
  10624. i.row + 1 < e.session.doc.getLength() - 1 &&
  10625. (f += e.session.doc.getNewLineCharacter()),
  10626. e.clearSelection(),
  10627. e.session.doc.replace(new s(n.row, 0, i.row + 2, 0), f),
  10628. a > 0
  10629. ? (e.selection.moveCursorTo(n.row, n.column),
  10630. e.selection.selectTo(n.row, n.column + a))
  10631. : ((o = e.session.doc.getLine(n.row).length > o ? o + 1 : o),
  10632. e.selection.moveCursorTo(n.row, o));
  10633. },
  10634. multiSelectAction: "forEach",
  10635. readOnly: !0,
  10636. },
  10637. {
  10638. name: "invertSelection",
  10639. bindKey: o(null, null),
  10640. exec: function (e) {
  10641. var t = e.session.doc.getLength() - 1,
  10642. n = e.session.doc.getLine(t).length,
  10643. r = e.selection.rangeList.ranges,
  10644. i = [];
  10645. r.length < 1 && (r = [e.selection.getRange()]);
  10646. for (var o = 0; o < r.length; o++)
  10647. o == r.length - 1 &&
  10648. (r[o].end.row !== t || r[o].end.column !== n) &&
  10649. i.push(new s(r[o].end.row, r[o].end.column, t, n)),
  10650. o === 0
  10651. ? (r[o].start.row !== 0 || r[o].start.column !== 0) &&
  10652. i.push(new s(0, 0, r[o].start.row, r[o].start.column))
  10653. : i.push(
  10654. new s(
  10655. r[o - 1].end.row,
  10656. r[o - 1].end.column,
  10657. r[o].start.row,
  10658. r[o].start.column
  10659. )
  10660. );
  10661. e.exitMultiSelectMode(), e.clearSelection();
  10662. for (var o = 0; o < i.length; o++) e.selection.addRange(i[o], !1);
  10663. },
  10664. readOnly: !0,
  10665. scrollIntoView: "none",
  10666. },
  10667. ];
  10668. }
  10669. ),
  10670. define("ace/clipboard", ["require", "exports", "module"], function (e, t, n) {
  10671. "use strict";
  10672. n.exports = { lineMode: !1 };
  10673. }),
  10674. define(
  10675. "ace/editor",
  10676. [
  10677. "require",
  10678. "exports",
  10679. "module",
  10680. "ace/lib/fixoldbrowsers",
  10681. "ace/lib/oop",
  10682. "ace/lib/dom",
  10683. "ace/lib/lang",
  10684. "ace/lib/useragent",
  10685. "ace/keyboard/textinput",
  10686. "ace/mouse/mouse_handler",
  10687. "ace/mouse/fold_handler",
  10688. "ace/keyboard/keybinding",
  10689. "ace/edit_session",
  10690. "ace/search",
  10691. "ace/range",
  10692. "ace/lib/event_emitter",
  10693. "ace/commands/command_manager",
  10694. "ace/commands/default_commands",
  10695. "ace/config",
  10696. "ace/token_iterator",
  10697. "ace/clipboard",
  10698. ],
  10699. function (e, t, n) {
  10700. "use strict";
  10701. e("./lib/fixoldbrowsers");
  10702. var r = e("./lib/oop"),
  10703. i = e("./lib/dom"),
  10704. s = e("./lib/lang"),
  10705. o = e("./lib/useragent"),
  10706. u = e("./keyboard/textinput").TextInput,
  10707. a = e("./mouse/mouse_handler").MouseHandler,
  10708. f = e("./mouse/fold_handler").FoldHandler,
  10709. l = e("./keyboard/keybinding").KeyBinding,
  10710. c = e("./edit_session").EditSession,
  10711. h = e("./search").Search,
  10712. p = e("./range").Range,
  10713. d = e("./lib/event_emitter").EventEmitter,
  10714. v = e("./commands/command_manager").CommandManager,
  10715. m = e("./commands/default_commands").commands,
  10716. g = e("./config"),
  10717. y = e("./token_iterator").TokenIterator,
  10718. b = e("./clipboard"),
  10719. w = function (e, t, n) {
  10720. var r = e.getContainerElement();
  10721. (this.container = r),
  10722. (this.renderer = e),
  10723. (this.id = "editor" + ++w.$uid),
  10724. (this.commands = new v(o.isMac ? "mac" : "win", m)),
  10725. typeof document == "object" &&
  10726. ((this.textInput = new u(e.getTextAreaContainer(), this)),
  10727. (this.renderer.textarea = this.textInput.getElement()),
  10728. (this.$mouseHandler = new a(this)),
  10729. new f(this)),
  10730. (this.keyBinding = new l(this)),
  10731. (this.$search = new h().set({ wrap: !0 })),
  10732. (this.$historyTracker = this.$historyTracker.bind(this)),
  10733. this.commands.on("exec", this.$historyTracker),
  10734. this.$initOperationListeners(),
  10735. (this._$emitInputEvent = s.delayedCall(
  10736. function () {
  10737. this._signal("input", {}),
  10738. this.session &&
  10739. this.session.bgTokenizer &&
  10740. this.session.bgTokenizer.scheduleStart();
  10741. }.bind(this)
  10742. )),
  10743. this.on("change", function (e, t) {
  10744. t._$emitInputEvent.schedule(31);
  10745. }),
  10746. this.setSession(t || (n && n.session) || new c("")),
  10747. g.resetOptions(this),
  10748. n && this.setOptions(n),
  10749. g._signal("editor", this);
  10750. };
  10751. (w.$uid = 0),
  10752. function () {
  10753. r.implement(this, d),
  10754. (this.$initOperationListeners = function () {
  10755. this.commands.on("exec", this.startOperation.bind(this), !0),
  10756. this.commands.on("afterExec", this.endOperation.bind(this), !0),
  10757. (this.$opResetTimer = s.delayedCall(
  10758. this.endOperation.bind(this, !0)
  10759. )),
  10760. this.on(
  10761. "change",
  10762. function () {
  10763. this.curOp ||
  10764. (this.startOperation(),
  10765. (this.curOp.selectionBefore = this.$lastSel)),
  10766. (this.curOp.docChanged = !0);
  10767. }.bind(this),
  10768. !0
  10769. ),
  10770. this.on(
  10771. "changeSelection",
  10772. function () {
  10773. this.curOp ||
  10774. (this.startOperation(),
  10775. (this.curOp.selectionBefore = this.$lastSel)),
  10776. (this.curOp.selectionChanged = !0);
  10777. }.bind(this),
  10778. !0
  10779. );
  10780. }),
  10781. (this.curOp = null),
  10782. (this.prevOp = {}),
  10783. (this.startOperation = function (e) {
  10784. if (this.curOp) {
  10785. if (!e || this.curOp.command) return;
  10786. this.prevOp = this.curOp;
  10787. }
  10788. e || ((this.previousCommand = null), (e = {})),
  10789. this.$opResetTimer.schedule(),
  10790. (this.curOp = this.session.curOp =
  10791. {
  10792. command: e.command || {},
  10793. args: e.args,
  10794. scrollTop: this.renderer.scrollTop,
  10795. }),
  10796. (this.curOp.selectionBefore = this.selection.toJSON());
  10797. }),
  10798. (this.endOperation = function (e) {
  10799. if (this.curOp) {
  10800. if (e && e.returnValue === !1) return (this.curOp = null);
  10801. if (
  10802. e == 1 &&
  10803. this.curOp.command &&
  10804. this.curOp.command.name == "mouse"
  10805. )
  10806. return;
  10807. this._signal("beforeEndOperation");
  10808. if (!this.curOp) return;
  10809. var t = this.curOp.command,
  10810. n = t && t.scrollIntoView;
  10811. if (n) {
  10812. switch (n) {
  10813. case "center-animate":
  10814. n = "animate";
  10815. case "center":
  10816. this.renderer.scrollCursorIntoView(null, 0.5);
  10817. break;
  10818. case "animate":
  10819. case "cursor":
  10820. this.renderer.scrollCursorIntoView();
  10821. break;
  10822. case "selectionPart":
  10823. var r = this.selection.getRange(),
  10824. i = this.renderer.layerConfig;
  10825. (r.start.row >= i.lastRow || r.end.row <= i.firstRow) &&
  10826. this.renderer.scrollSelectionIntoView(
  10827. this.selection.anchor,
  10828. this.selection.lead
  10829. );
  10830. break;
  10831. default:
  10832. }
  10833. n == "animate" &&
  10834. this.renderer.animateScrolling(this.curOp.scrollTop);
  10835. }
  10836. var s = this.selection.toJSON();
  10837. (this.curOp.selectionAfter = s),
  10838. (this.$lastSel = this.selection.toJSON()),
  10839. this.session.getUndoManager().addSelection(s),
  10840. (this.prevOp = this.curOp),
  10841. (this.curOp = null);
  10842. }
  10843. }),
  10844. (this.$mergeableCommands = ["backspace", "del", "insertstring"]),
  10845. (this.$historyTracker = function (e) {
  10846. if (!this.$mergeUndoDeltas) return;
  10847. var t = this.prevOp,
  10848. n = this.$mergeableCommands,
  10849. r = t.command && e.command.name == t.command.name;
  10850. if (e.command.name == "insertstring") {
  10851. var i = e.args;
  10852. this.mergeNextCommand === undefined &&
  10853. (this.mergeNextCommand = !0),
  10854. (r =
  10855. r &&
  10856. this.mergeNextCommand &&
  10857. (!/\s/.test(i) || /\s/.test(t.args))),
  10858. (this.mergeNextCommand = !0);
  10859. } else r = r && n.indexOf(e.command.name) !== -1;
  10860. this.$mergeUndoDeltas != "always" &&
  10861. Date.now() - this.sequenceStartTime > 2e3 &&
  10862. (r = !1),
  10863. r
  10864. ? (this.session.mergeUndoDeltas = !0)
  10865. : n.indexOf(e.command.name) !== -1 &&
  10866. (this.sequenceStartTime = Date.now());
  10867. }),
  10868. (this.setKeyboardHandler = function (e, t) {
  10869. if (e && typeof e == "string" && e != "ace") {
  10870. this.$keybindingId = e;
  10871. var n = this;
  10872. g.loadModule(["keybinding", e], function (r) {
  10873. n.$keybindingId == e &&
  10874. n.keyBinding.setKeyboardHandler(r && r.handler),
  10875. t && t();
  10876. });
  10877. } else
  10878. (this.$keybindingId = null),
  10879. this.keyBinding.setKeyboardHandler(e),
  10880. t && t();
  10881. }),
  10882. (this.getKeyboardHandler = function () {
  10883. return this.keyBinding.getKeyboardHandler();
  10884. }),
  10885. (this.setSession = function (e) {
  10886. if (this.session == e) return;
  10887. this.curOp && this.endOperation(), (this.curOp = {});
  10888. var t = this.session;
  10889. if (t) {
  10890. this.session.off("change", this.$onDocumentChange),
  10891. this.session.off("changeMode", this.$onChangeMode),
  10892. this.session.off("tokenizerUpdate", this.$onTokenizerUpdate),
  10893. this.session.off("changeTabSize", this.$onChangeTabSize),
  10894. this.session.off("changeWrapLimit", this.$onChangeWrapLimit),
  10895. this.session.off("changeWrapMode", this.$onChangeWrapMode),
  10896. this.session.off("changeFold", this.$onChangeFold),
  10897. this.session.off(
  10898. "changeFrontMarker",
  10899. this.$onChangeFrontMarker
  10900. ),
  10901. this.session.off(
  10902. "changeBackMarker",
  10903. this.$onChangeBackMarker
  10904. ),
  10905. this.session.off(
  10906. "changeBreakpoint",
  10907. this.$onChangeBreakpoint
  10908. ),
  10909. this.session.off(
  10910. "changeAnnotation",
  10911. this.$onChangeAnnotation
  10912. ),
  10913. this.session.off("changeOverwrite", this.$onCursorChange),
  10914. this.session.off("changeScrollTop", this.$onScrollTopChange),
  10915. this.session.off(
  10916. "changeScrollLeft",
  10917. this.$onScrollLeftChange
  10918. );
  10919. var n = this.session.getSelection();
  10920. n.off("changeCursor", this.$onCursorChange),
  10921. n.off("changeSelection", this.$onSelectionChange);
  10922. }
  10923. (this.session = e),
  10924. e
  10925. ? ((this.$onDocumentChange =
  10926. this.onDocumentChange.bind(this)),
  10927. e.on("change", this.$onDocumentChange),
  10928. this.renderer.setSession(e),
  10929. (this.$onChangeMode = this.onChangeMode.bind(this)),
  10930. e.on("changeMode", this.$onChangeMode),
  10931. (this.$onTokenizerUpdate =
  10932. this.onTokenizerUpdate.bind(this)),
  10933. e.on("tokenizerUpdate", this.$onTokenizerUpdate),
  10934. (this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(
  10935. this.renderer
  10936. )),
  10937. e.on("changeTabSize", this.$onChangeTabSize),
  10938. (this.$onChangeWrapLimit =
  10939. this.onChangeWrapLimit.bind(this)),
  10940. e.on("changeWrapLimit", this.$onChangeWrapLimit),
  10941. (this.$onChangeWrapMode = this.onChangeWrapMode.bind(this)),
  10942. e.on("changeWrapMode", this.$onChangeWrapMode),
  10943. (this.$onChangeFold = this.onChangeFold.bind(this)),
  10944. e.on("changeFold", this.$onChangeFold),
  10945. (this.$onChangeFrontMarker =
  10946. this.onChangeFrontMarker.bind(this)),
  10947. this.session.on(
  10948. "changeFrontMarker",
  10949. this.$onChangeFrontMarker
  10950. ),
  10951. (this.$onChangeBackMarker =
  10952. this.onChangeBackMarker.bind(this)),
  10953. this.session.on(
  10954. "changeBackMarker",
  10955. this.$onChangeBackMarker
  10956. ),
  10957. (this.$onChangeBreakpoint =
  10958. this.onChangeBreakpoint.bind(this)),
  10959. this.session.on(
  10960. "changeBreakpoint",
  10961. this.$onChangeBreakpoint
  10962. ),
  10963. (this.$onChangeAnnotation =
  10964. this.onChangeAnnotation.bind(this)),
  10965. this.session.on(
  10966. "changeAnnotation",
  10967. this.$onChangeAnnotation
  10968. ),
  10969. (this.$onCursorChange = this.onCursorChange.bind(this)),
  10970. this.session.on("changeOverwrite", this.$onCursorChange),
  10971. (this.$onScrollTopChange =
  10972. this.onScrollTopChange.bind(this)),
  10973. this.session.on("changeScrollTop", this.$onScrollTopChange),
  10974. (this.$onScrollLeftChange =
  10975. this.onScrollLeftChange.bind(this)),
  10976. this.session.on(
  10977. "changeScrollLeft",
  10978. this.$onScrollLeftChange
  10979. ),
  10980. (this.selection = e.getSelection()),
  10981. this.selection.on("changeCursor", this.$onCursorChange),
  10982. (this.$onSelectionChange =
  10983. this.onSelectionChange.bind(this)),
  10984. this.selection.on(
  10985. "changeSelection",
  10986. this.$onSelectionChange
  10987. ),
  10988. this.onChangeMode(),
  10989. this.onCursorChange(),
  10990. this.onScrollTopChange(),
  10991. this.onScrollLeftChange(),
  10992. this.onSelectionChange(),
  10993. this.onChangeFrontMarker(),
  10994. this.onChangeBackMarker(),
  10995. this.onChangeBreakpoint(),
  10996. this.onChangeAnnotation(),
  10997. this.session.getUseWrapMode() &&
  10998. this.renderer.adjustWrapLimit(),
  10999. this.renderer.updateFull())
  11000. : ((this.selection = null), this.renderer.setSession(e)),
  11001. this._signal("changeSession", { session: e, oldSession: t }),
  11002. (this.curOp = null),
  11003. t && t._signal("changeEditor", { oldEditor: this }),
  11004. e && e._signal("changeEditor", { editor: this }),
  11005. e && e.bgTokenizer && e.bgTokenizer.scheduleStart();
  11006. }),
  11007. (this.getSession = function () {
  11008. return this.session;
  11009. }),
  11010. (this.setValue = function (e, t) {
  11011. return (
  11012. this.session.doc.setValue(e),
  11013. t
  11014. ? t == 1
  11015. ? this.navigateFileEnd()
  11016. : t == -1 && this.navigateFileStart()
  11017. : this.selectAll(),
  11018. e
  11019. );
  11020. }),
  11021. (this.getValue = function () {
  11022. return this.session.getValue();
  11023. }),
  11024. (this.getSelection = function () {
  11025. return this.selection;
  11026. }),
  11027. (this.resize = function (e) {
  11028. this.renderer.onResize(e);
  11029. }),
  11030. (this.setTheme = function (e, t) {
  11031. this.renderer.setTheme(e, t);
  11032. }),
  11033. (this.getTheme = function () {
  11034. return this.renderer.getTheme();
  11035. }),
  11036. (this.setStyle = function (e) {
  11037. this.renderer.setStyle(e);
  11038. }),
  11039. (this.unsetStyle = function (e) {
  11040. this.renderer.unsetStyle(e);
  11041. }),
  11042. (this.getFontSize = function () {
  11043. return (
  11044. this.getOption("fontSize") ||
  11045. i.computedStyle(this.container).fontSize
  11046. );
  11047. }),
  11048. (this.setFontSize = function (e) {
  11049. this.setOption("fontSize", e);
  11050. }),
  11051. (this.$highlightBrackets = function () {
  11052. this.session.$bracketHighlight &&
  11053. (this.session.removeMarker(this.session.$bracketHighlight),
  11054. (this.session.$bracketHighlight = null));
  11055. if (this.$highlightPending) return;
  11056. var e = this;
  11057. (this.$highlightPending = !0),
  11058. setTimeout(function () {
  11059. e.$highlightPending = !1;
  11060. var t = e.session;
  11061. if (!t || !t.bgTokenizer) return;
  11062. var n = t.findMatchingBracket(e.getCursorPosition());
  11063. if (n) var r = new p(n.row, n.column, n.row, n.column + 1);
  11064. else if (t.$mode.getMatching)
  11065. var r = t.$mode.getMatching(e.session);
  11066. r &&
  11067. (t.$bracketHighlight = t.addMarker(
  11068. r,
  11069. "ace_bracket",
  11070. "text"
  11071. ));
  11072. }, 50);
  11073. }),
  11074. (this.$highlightTags = function () {
  11075. if (this.$highlightTagPending) return;
  11076. var e = this;
  11077. (this.$highlightTagPending = !0),
  11078. setTimeout(function () {
  11079. e.$highlightTagPending = !1;
  11080. var t = e.session;
  11081. if (!t || !t.bgTokenizer) return;
  11082. var n = e.getCursorPosition(),
  11083. r = new y(e.session, n.row, n.column),
  11084. i = r.getCurrentToken();
  11085. if (!i || !/\b(?:tag-open|tag-name)/.test(i.type)) {
  11086. t.removeMarker(t.$tagHighlight), (t.$tagHighlight = null);
  11087. return;
  11088. }
  11089. if (i.type.indexOf("tag-open") != -1) {
  11090. i = r.stepForward();
  11091. if (!i) return;
  11092. }
  11093. var s = i.value,
  11094. o = 0,
  11095. u = r.stepBackward();
  11096. if (u.value == "<") {
  11097. do
  11098. (u = i),
  11099. (i = r.stepForward()),
  11100. i &&
  11101. i.value === s &&
  11102. i.type.indexOf("tag-name") !== -1 &&
  11103. (u.value === "<" ? o++ : u.value === "</" && o--);
  11104. while (i && o >= 0);
  11105. } else {
  11106. do
  11107. (i = u),
  11108. (u = r.stepBackward()),
  11109. i &&
  11110. i.value === s &&
  11111. i.type.indexOf("tag-name") !== -1 &&
  11112. (u.value === "<" ? o++ : u.value === "</" && o--);
  11113. while (u && o <= 0);
  11114. r.stepForward();
  11115. }
  11116. if (!i) {
  11117. t.removeMarker(t.$tagHighlight), (t.$tagHighlight = null);
  11118. return;
  11119. }
  11120. var a = r.getCurrentTokenRow(),
  11121. f = r.getCurrentTokenColumn(),
  11122. l = new p(a, f, a, f + i.value.length),
  11123. c = t.$backMarkers[t.$tagHighlight];
  11124. t.$tagHighlight &&
  11125. c != undefined &&
  11126. l.compareRange(c.range) !== 0 &&
  11127. (t.removeMarker(t.$tagHighlight), (t.$tagHighlight = null)),
  11128. t.$tagHighlight ||
  11129. (t.$tagHighlight = t.addMarker(l, "ace_bracket", "text"));
  11130. }, 50);
  11131. }),
  11132. (this.focus = function () {
  11133. var e = this;
  11134. setTimeout(function () {
  11135. e.isFocused() || e.textInput.focus();
  11136. }),
  11137. this.textInput.focus();
  11138. }),
  11139. (this.isFocused = function () {
  11140. return this.textInput.isFocused();
  11141. }),
  11142. (this.blur = function () {
  11143. this.textInput.blur();
  11144. }),
  11145. (this.onFocus = function (e) {
  11146. if (this.$isFocused) return;
  11147. (this.$isFocused = !0),
  11148. this.renderer.showCursor(),
  11149. this.renderer.visualizeFocus(),
  11150. this._emit("focus", e);
  11151. }),
  11152. (this.onBlur = function (e) {
  11153. if (!this.$isFocused) return;
  11154. (this.$isFocused = !1),
  11155. this.renderer.hideCursor(),
  11156. this.renderer.visualizeBlur(),
  11157. this._emit("blur", e);
  11158. }),
  11159. (this.$cursorChange = function () {
  11160. this.renderer.updateCursor();
  11161. }),
  11162. (this.onDocumentChange = function (e) {
  11163. var t = this.session.$useWrapMode,
  11164. n = e.start.row == e.end.row ? e.end.row : Infinity;
  11165. this.renderer.updateLines(e.start.row, n, t),
  11166. this._signal("change", e),
  11167. this.$cursorChange(),
  11168. this.$updateHighlightActiveLine();
  11169. }),
  11170. (this.onTokenizerUpdate = function (e) {
  11171. var t = e.data;
  11172. this.renderer.updateLines(t.first, t.last);
  11173. }),
  11174. (this.onScrollTopChange = function () {
  11175. this.renderer.scrollToY(this.session.getScrollTop());
  11176. }),
  11177. (this.onScrollLeftChange = function () {
  11178. this.renderer.scrollToX(this.session.getScrollLeft());
  11179. }),
  11180. (this.onCursorChange = function () {
  11181. this.$cursorChange(),
  11182. this.$highlightBrackets(),
  11183. this.$highlightTags(),
  11184. this.$updateHighlightActiveLine(),
  11185. this._signal("changeSelection");
  11186. }),
  11187. (this.$updateHighlightActiveLine = function () {
  11188. var e = this.getSession(),
  11189. t;
  11190. if (this.$highlightActiveLine) {
  11191. if (
  11192. this.$selectionStyle != "line" ||
  11193. !this.selection.isMultiLine()
  11194. )
  11195. t = this.getCursorPosition();
  11196. this.renderer.theme &&
  11197. this.renderer.theme.$selectionColorConflict &&
  11198. !this.selection.isEmpty() &&
  11199. (t = !1),
  11200. this.renderer.$maxLines &&
  11201. this.session.getLength() === 1 &&
  11202. !(this.renderer.$minLines > 1) &&
  11203. (t = !1);
  11204. }
  11205. if (e.$highlightLineMarker && !t)
  11206. e.removeMarker(e.$highlightLineMarker.id),
  11207. (e.$highlightLineMarker = null);
  11208. else if (!e.$highlightLineMarker && t) {
  11209. var n = new p(t.row, t.column, t.row, Infinity);
  11210. (n.id = e.addMarker(n, "ace_active-line", "screenLine")),
  11211. (e.$highlightLineMarker = n);
  11212. } else
  11213. t &&
  11214. ((e.$highlightLineMarker.start.row = t.row),
  11215. (e.$highlightLineMarker.end.row = t.row),
  11216. (e.$highlightLineMarker.start.column = t.column),
  11217. e._signal("changeBackMarker"));
  11218. }),
  11219. (this.onSelectionChange = function (e) {
  11220. var t = this.session;
  11221. t.$selectionMarker && t.removeMarker(t.$selectionMarker),
  11222. (t.$selectionMarker = null);
  11223. if (!this.selection.isEmpty()) {
  11224. var n = this.selection.getRange(),
  11225. r = this.getSelectionStyle();
  11226. t.$selectionMarker = t.addMarker(n, "ace_selection", r);
  11227. } else this.$updateHighlightActiveLine();
  11228. var i =
  11229. this.$highlightSelectedWord &&
  11230. this.$getSelectionHighLightRegexp();
  11231. this.session.highlight(i), this._signal("changeSelection");
  11232. }),
  11233. (this.$getSelectionHighLightRegexp = function () {
  11234. var e = this.session,
  11235. t = this.getSelectionRange();
  11236. if (t.isEmpty() || t.isMultiLine()) return;
  11237. var n = t.start.column,
  11238. r = t.end.column,
  11239. i = e.getLine(t.start.row),
  11240. s = i.substring(n, r);
  11241. if (s.length > 5e3 || !/[\w\d]/.test(s)) return;
  11242. var o = this.$search.$assembleRegExp({
  11243. wholeWord: !0,
  11244. caseSensitive: !0,
  11245. needle: s,
  11246. }),
  11247. u = i.substring(n - 1, r + 1);
  11248. if (!o.test(u)) return;
  11249. return o;
  11250. }),
  11251. (this.onChangeFrontMarker = function () {
  11252. this.renderer.updateFrontMarkers();
  11253. }),
  11254. (this.onChangeBackMarker = function () {
  11255. this.renderer.updateBackMarkers();
  11256. }),
  11257. (this.onChangeBreakpoint = function () {
  11258. this.renderer.updateBreakpoints();
  11259. }),
  11260. (this.onChangeAnnotation = function () {
  11261. this.renderer.setAnnotations(this.session.getAnnotations());
  11262. }),
  11263. (this.onChangeMode = function (e) {
  11264. this.renderer.updateText(), this._emit("changeMode", e);
  11265. }),
  11266. (this.onChangeWrapLimit = function () {
  11267. this.renderer.updateFull();
  11268. }),
  11269. (this.onChangeWrapMode = function () {
  11270. this.renderer.onResize(!0);
  11271. }),
  11272. (this.onChangeFold = function () {
  11273. this.$updateHighlightActiveLine(), this.renderer.updateFull();
  11274. }),
  11275. (this.getSelectedText = function () {
  11276. return this.session.getTextRange(this.getSelectionRange());
  11277. }),
  11278. (this.getCopyText = function () {
  11279. var e = this.getSelectedText(),
  11280. t = this.session.doc.getNewLineCharacter(),
  11281. n = !1;
  11282. if (!e && this.$copyWithEmptySelection) {
  11283. n = !0;
  11284. var r = this.selection.getAllRanges();
  11285. for (var i = 0; i < r.length; i++) {
  11286. var s = r[i];
  11287. if (i && r[i - 1].start.row == s.start.row) continue;
  11288. e += this.session.getLine(s.start.row) + t;
  11289. }
  11290. }
  11291. var o = { text: e };
  11292. return (
  11293. this._signal("copy", o), (b.lineMode = n ? o.text : ""), o.text
  11294. );
  11295. }),
  11296. (this.onCopy = function () {
  11297. this.commands.exec("copy", this);
  11298. }),
  11299. (this.onCut = function () {
  11300. this.commands.exec("cut", this);
  11301. }),
  11302. (this.onPaste = function (e, t) {
  11303. var n = { text: e, event: t };
  11304. this.commands.exec("paste", this, n);
  11305. }),
  11306. (this.$handlePaste = function (e) {
  11307. typeof e == "string" && (e = { text: e }),
  11308. this._signal("paste", e);
  11309. var t = e.text,
  11310. n = t == b.lineMode,
  11311. r = this.session;
  11312. if (!this.inMultiSelectMode || this.inVirtualSelectionMode)
  11313. n
  11314. ? r.insert({ row: this.selection.lead.row, column: 0 }, t)
  11315. : this.insert(t);
  11316. else if (n)
  11317. this.selection.rangeList.ranges.forEach(function (e) {
  11318. r.insert({ row: e.start.row, column: 0 }, t);
  11319. });
  11320. else {
  11321. var i = t.split(/\r\n|\r|\n/),
  11322. s = this.selection.rangeList.ranges;
  11323. if (i.length > s.length || i.length < 2 || !i[1])
  11324. return this.commands.exec("insertstring", this, t);
  11325. for (var o = s.length; o--; ) {
  11326. var u = s[o];
  11327. u.isEmpty() || r.remove(u), r.insert(u.start, i[o]);
  11328. }
  11329. }
  11330. }),
  11331. (this.execCommand = function (e, t) {
  11332. return this.commands.exec(e, this, t);
  11333. }),
  11334. (this.insert = function (e, t) {
  11335. var n = this.session,
  11336. r = n.getMode(),
  11337. i = this.getCursorPosition();
  11338. if (this.getBehavioursEnabled() && !t) {
  11339. var s = r.transformAction(
  11340. n.getState(i.row),
  11341. "insertion",
  11342. this,
  11343. n,
  11344. e
  11345. );
  11346. s &&
  11347. (e !== s.text &&
  11348. (this.inVirtualSelectionMode ||
  11349. ((this.session.mergeUndoDeltas = !1),
  11350. (this.mergeNextCommand = !1))),
  11351. (e = s.text));
  11352. }
  11353. e == " " && (e = this.session.getTabString());
  11354. if (!this.selection.isEmpty()) {
  11355. var o = this.getSelectionRange();
  11356. (i = this.session.remove(o)), this.clearSelection();
  11357. } else if (this.session.getOverwrite() && e.indexOf("\n") == -1) {
  11358. var o = new p.fromPoints(i, i);
  11359. (o.end.column += e.length), this.session.remove(o);
  11360. }
  11361. if (e == "\n" || e == "\r\n") {
  11362. var u = n.getLine(i.row);
  11363. if (i.column > u.search(/\S|$/)) {
  11364. var a = u.substr(i.column).search(/\S|$/);
  11365. n.doc.removeInLine(i.row, i.column, i.column + a);
  11366. }
  11367. }
  11368. this.clearSelection();
  11369. var f = i.column,
  11370. l = n.getState(i.row),
  11371. u = n.getLine(i.row),
  11372. c = r.checkOutdent(l, u, e),
  11373. h = n.insert(i, e);
  11374. s &&
  11375. s.selection &&
  11376. (s.selection.length == 2
  11377. ? this.selection.setSelectionRange(
  11378. new p(
  11379. i.row,
  11380. f + s.selection[0],
  11381. i.row,
  11382. f + s.selection[1]
  11383. )
  11384. )
  11385. : this.selection.setSelectionRange(
  11386. new p(
  11387. i.row + s.selection[0],
  11388. s.selection[1],
  11389. i.row + s.selection[2],
  11390. s.selection[3]
  11391. )
  11392. ));
  11393. if (n.getDocument().isNewLine(e)) {
  11394. var d = r.getNextLineIndent(
  11395. l,
  11396. u.slice(0, i.column),
  11397. n.getTabString()
  11398. );
  11399. n.insert({ row: i.row + 1, column: 0 }, d);
  11400. }
  11401. c && r.autoOutdent(l, n, i.row);
  11402. }),
  11403. (this.onTextInput = function (e, t) {
  11404. if (!t) return this.keyBinding.onTextInput(e);
  11405. this.startOperation({ command: { name: "insertstring" } });
  11406. var n = this.applyComposition.bind(this, e, t);
  11407. this.selection.rangeCount ? this.forEachSelection(n) : n(),
  11408. this.endOperation();
  11409. }),
  11410. (this.applyComposition = function (e, t) {
  11411. if (t.extendLeft || t.extendRight) {
  11412. var n = this.selection.getRange();
  11413. (n.start.column -= t.extendLeft),
  11414. (n.end.column += t.extendRight),
  11415. this.selection.setRange(n),
  11416. !e && !n.isEmpty() && this.remove();
  11417. }
  11418. (e || !this.selection.isEmpty()) && this.insert(e, !0);
  11419. if (t.restoreStart || t.restoreEnd) {
  11420. var n = this.selection.getRange();
  11421. (n.start.column -= t.restoreStart),
  11422. (n.end.column -= t.restoreEnd),
  11423. this.selection.setRange(n);
  11424. }
  11425. }),
  11426. (this.onCommandKey = function (e, t, n) {
  11427. this.keyBinding.onCommandKey(e, t, n);
  11428. }),
  11429. (this.setOverwrite = function (e) {
  11430. this.session.setOverwrite(e);
  11431. }),
  11432. (this.getOverwrite = function () {
  11433. return this.session.getOverwrite();
  11434. }),
  11435. (this.toggleOverwrite = function () {
  11436. this.session.toggleOverwrite();
  11437. }),
  11438. (this.setScrollSpeed = function (e) {
  11439. this.setOption("scrollSpeed", e);
  11440. }),
  11441. (this.getScrollSpeed = function () {
  11442. return this.getOption("scrollSpeed");
  11443. }),
  11444. (this.setDragDelay = function (e) {
  11445. this.setOption("dragDelay", e);
  11446. }),
  11447. (this.getDragDelay = function () {
  11448. return this.getOption("dragDelay");
  11449. }),
  11450. (this.setSelectionStyle = function (e) {
  11451. this.setOption("selectionStyle", e);
  11452. }),
  11453. (this.getSelectionStyle = function () {
  11454. return this.getOption("selectionStyle");
  11455. }),
  11456. (this.setHighlightActiveLine = function (e) {
  11457. this.setOption("highlightActiveLine", e);
  11458. }),
  11459. (this.getHighlightActiveLine = function () {
  11460. return this.getOption("highlightActiveLine");
  11461. }),
  11462. (this.setHighlightGutterLine = function (e) {
  11463. this.setOption("highlightGutterLine", e);
  11464. }),
  11465. (this.getHighlightGutterLine = function () {
  11466. return this.getOption("highlightGutterLine");
  11467. }),
  11468. (this.setHighlightSelectedWord = function (e) {
  11469. this.setOption("highlightSelectedWord", e);
  11470. }),
  11471. (this.getHighlightSelectedWord = function () {
  11472. return this.$highlightSelectedWord;
  11473. }),
  11474. (this.setAnimatedScroll = function (e) {
  11475. this.renderer.setAnimatedScroll(e);
  11476. }),
  11477. (this.getAnimatedScroll = function () {
  11478. return this.renderer.getAnimatedScroll();
  11479. }),
  11480. (this.setShowInvisibles = function (e) {
  11481. this.renderer.setShowInvisibles(e);
  11482. }),
  11483. (this.getShowInvisibles = function () {
  11484. return this.renderer.getShowInvisibles();
  11485. }),
  11486. (this.setDisplayIndentGuides = function (e) {
  11487. this.renderer.setDisplayIndentGuides(e);
  11488. }),
  11489. (this.getDisplayIndentGuides = function () {
  11490. return this.renderer.getDisplayIndentGuides();
  11491. }),
  11492. (this.setShowPrintMargin = function (e) {
  11493. this.renderer.setShowPrintMargin(e);
  11494. }),
  11495. (this.getShowPrintMargin = function () {
  11496. return this.renderer.getShowPrintMargin();
  11497. }),
  11498. (this.setPrintMarginColumn = function (e) {
  11499. this.renderer.setPrintMarginColumn(e);
  11500. }),
  11501. (this.getPrintMarginColumn = function () {
  11502. return this.renderer.getPrintMarginColumn();
  11503. }),
  11504. (this.setReadOnly = function (e) {
  11505. this.setOption("readOnly", e);
  11506. }),
  11507. (this.getReadOnly = function () {
  11508. return this.getOption("readOnly");
  11509. }),
  11510. (this.setBehavioursEnabled = function (e) {
  11511. this.setOption("behavioursEnabled", e);
  11512. }),
  11513. (this.getBehavioursEnabled = function () {
  11514. return this.getOption("behavioursEnabled");
  11515. }),
  11516. (this.setWrapBehavioursEnabled = function (e) {
  11517. this.setOption("wrapBehavioursEnabled", e);
  11518. }),
  11519. (this.getWrapBehavioursEnabled = function () {
  11520. return this.getOption("wrapBehavioursEnabled");
  11521. }),
  11522. (this.setShowFoldWidgets = function (e) {
  11523. this.setOption("showFoldWidgets", e);
  11524. }),
  11525. (this.getShowFoldWidgets = function () {
  11526. return this.getOption("showFoldWidgets");
  11527. }),
  11528. (this.setFadeFoldWidgets = function (e) {
  11529. this.setOption("fadeFoldWidgets", e);
  11530. }),
  11531. (this.getFadeFoldWidgets = function () {
  11532. return this.getOption("fadeFoldWidgets");
  11533. }),
  11534. (this.remove = function (e) {
  11535. this.selection.isEmpty() &&
  11536. (e == "left"
  11537. ? this.selection.selectLeft()
  11538. : this.selection.selectRight());
  11539. var t = this.getSelectionRange();
  11540. if (this.getBehavioursEnabled()) {
  11541. var n = this.session,
  11542. r = n.getState(t.start.row),
  11543. i = n.getMode().transformAction(r, "deletion", this, n, t);
  11544. if (t.end.column === 0) {
  11545. var s = n.getTextRange(t);
  11546. if (s[s.length - 1] == "\n") {
  11547. var o = n.getLine(t.end.row);
  11548. /^\s+$/.test(o) && (t.end.column = o.length);
  11549. }
  11550. }
  11551. i && (t = i);
  11552. }
  11553. this.session.remove(t), this.clearSelection();
  11554. }),
  11555. (this.removeWordRight = function () {
  11556. this.selection.isEmpty() && this.selection.selectWordRight(),
  11557. this.session.remove(this.getSelectionRange()),
  11558. this.clearSelection();
  11559. }),
  11560. (this.removeWordLeft = function () {
  11561. this.selection.isEmpty() && this.selection.selectWordLeft(),
  11562. this.session.remove(this.getSelectionRange()),
  11563. this.clearSelection();
  11564. }),
  11565. (this.removeToLineStart = function () {
  11566. this.selection.isEmpty() && this.selection.selectLineStart(),
  11567. this.session.remove(this.getSelectionRange()),
  11568. this.clearSelection();
  11569. }),
  11570. (this.removeToLineEnd = function () {
  11571. this.selection.isEmpty() && this.selection.selectLineEnd();
  11572. var e = this.getSelectionRange();
  11573. e.start.column == e.end.column &&
  11574. e.start.row == e.end.row &&
  11575. ((e.end.column = 0), e.end.row++),
  11576. this.session.remove(e),
  11577. this.clearSelection();
  11578. }),
  11579. (this.splitLine = function () {
  11580. this.selection.isEmpty() ||
  11581. (this.session.remove(this.getSelectionRange()),
  11582. this.clearSelection());
  11583. var e = this.getCursorPosition();
  11584. this.insert("\n"), this.moveCursorToPosition(e);
  11585. }),
  11586. (this.transposeLetters = function () {
  11587. if (!this.selection.isEmpty()) return;
  11588. var e = this.getCursorPosition(),
  11589. t = e.column;
  11590. if (t === 0) return;
  11591. var n = this.session.getLine(e.row),
  11592. r,
  11593. i;
  11594. t < n.length
  11595. ? ((r = n.charAt(t) + n.charAt(t - 1)),
  11596. (i = new p(e.row, t - 1, e.row, t + 1)))
  11597. : ((r = n.charAt(t - 1) + n.charAt(t - 2)),
  11598. (i = new p(e.row, t - 2, e.row, t))),
  11599. this.session.replace(i, r),
  11600. this.session.selection.moveToPosition(i.end);
  11601. }),
  11602. (this.toLowerCase = function () {
  11603. var e = this.getSelectionRange();
  11604. this.selection.isEmpty() && this.selection.selectWord();
  11605. var t = this.getSelectionRange(),
  11606. n = this.session.getTextRange(t);
  11607. this.session.replace(t, n.toLowerCase()),
  11608. this.selection.setSelectionRange(e);
  11609. }),
  11610. (this.toUpperCase = function () {
  11611. var e = this.getSelectionRange();
  11612. this.selection.isEmpty() && this.selection.selectWord();
  11613. var t = this.getSelectionRange(),
  11614. n = this.session.getTextRange(t);
  11615. this.session.replace(t, n.toUpperCase()),
  11616. this.selection.setSelectionRange(e);
  11617. }),
  11618. (this.indent = function () {
  11619. var e = this.session,
  11620. t = this.getSelectionRange();
  11621. if (t.start.row < t.end.row) {
  11622. var n = this.$getSelectedRows();
  11623. e.indentRows(n.first, n.last, " ");
  11624. return;
  11625. }
  11626. if (t.start.column < t.end.column) {
  11627. var r = e.getTextRange(t);
  11628. if (!/^\s+$/.test(r)) {
  11629. var n = this.$getSelectedRows();
  11630. e.indentRows(n.first, n.last, " ");
  11631. return;
  11632. }
  11633. }
  11634. var i = e.getLine(t.start.row),
  11635. o = t.start,
  11636. u = e.getTabSize(),
  11637. a = e.documentToScreenColumn(o.row, o.column);
  11638. if (this.session.getUseSoftTabs())
  11639. var f = u - (a % u),
  11640. l = s.stringRepeat(" ", f);
  11641. else {
  11642. var f = a % u;
  11643. while (i[t.start.column - 1] == " " && f) t.start.column--, f--;
  11644. this.selection.setSelectionRange(t), (l = " ");
  11645. }
  11646. return this.insert(l);
  11647. }),
  11648. (this.blockIndent = function () {
  11649. var e = this.$getSelectedRows();
  11650. this.session.indentRows(e.first, e.last, " ");
  11651. }),
  11652. (this.blockOutdent = function () {
  11653. var e = this.session.getSelection();
  11654. this.session.outdentRows(e.getRange());
  11655. }),
  11656. (this.sortLines = function () {
  11657. var e = this.$getSelectedRows(),
  11658. t = this.session,
  11659. n = [];
  11660. for (var r = e.first; r <= e.last; r++) n.push(t.getLine(r));
  11661. n.sort(function (e, t) {
  11662. return e.toLowerCase() < t.toLowerCase()
  11663. ? -1
  11664. : e.toLowerCase() > t.toLowerCase()
  11665. ? 1
  11666. : 0;
  11667. });
  11668. var i = new p(0, 0, 0, 0);
  11669. for (var r = e.first; r <= e.last; r++) {
  11670. var s = t.getLine(r);
  11671. (i.start.row = r),
  11672. (i.end.row = r),
  11673. (i.end.column = s.length),
  11674. t.replace(i, n[r - e.first]);
  11675. }
  11676. }),
  11677. (this.toggleCommentLines = function () {
  11678. var e = this.session.getState(this.getCursorPosition().row),
  11679. t = this.$getSelectedRows();
  11680. this.session
  11681. .getMode()
  11682. .toggleCommentLines(e, this.session, t.first, t.last);
  11683. }),
  11684. (this.toggleBlockComment = function () {
  11685. var e = this.getCursorPosition(),
  11686. t = this.session.getState(e.row),
  11687. n = this.getSelectionRange();
  11688. this.session.getMode().toggleBlockComment(t, this.session, n, e);
  11689. }),
  11690. (this.getNumberAt = function (e, t) {
  11691. var n = /[\-]?[0-9]+(?:\.[0-9]+)?/g;
  11692. n.lastIndex = 0;
  11693. var r = this.session.getLine(e);
  11694. while (n.lastIndex < t) {
  11695. var i = n.exec(r);
  11696. if (i.index <= t && i.index + i[0].length >= t) {
  11697. var s = {
  11698. value: i[0],
  11699. start: i.index,
  11700. end: i.index + i[0].length,
  11701. };
  11702. return s;
  11703. }
  11704. }
  11705. return null;
  11706. }),
  11707. (this.modifyNumber = function (e) {
  11708. var t = this.selection.getCursor().row,
  11709. n = this.selection.getCursor().column,
  11710. r = new p(t, n - 1, t, n),
  11711. i = this.session.getTextRange(r);
  11712. if (!isNaN(parseFloat(i)) && isFinite(i)) {
  11713. var s = this.getNumberAt(t, n);
  11714. if (s) {
  11715. var o =
  11716. s.value.indexOf(".") >= 0
  11717. ? s.start + s.value.indexOf(".") + 1
  11718. : s.end,
  11719. u = s.start + s.value.length - o,
  11720. a = parseFloat(s.value);
  11721. (a *= Math.pow(10, u)),
  11722. o !== s.end && n < o
  11723. ? (e *= Math.pow(10, s.end - n - 1))
  11724. : (e *= Math.pow(10, s.end - n)),
  11725. (a += e),
  11726. (a /= Math.pow(10, u));
  11727. var f = a.toFixed(u),
  11728. l = new p(t, s.start, t, s.end);
  11729. this.session.replace(l, f),
  11730. this.moveCursorTo(
  11731. t,
  11732. Math.max(s.start + 1, n + f.length - s.value.length)
  11733. );
  11734. }
  11735. } else this.toggleWord();
  11736. }),
  11737. (this.$toggleWordPairs = [
  11738. ["first", "last"],
  11739. ["true", "false"],
  11740. ["yes", "no"],
  11741. ["width", "height"],
  11742. ["top", "bottom"],
  11743. ["right", "left"],
  11744. ["on", "off"],
  11745. ["x", "y"],
  11746. ["get", "set"],
  11747. ["max", "min"],
  11748. ["horizontal", "vertical"],
  11749. ["show", "hide"],
  11750. ["add", "remove"],
  11751. ["up", "down"],
  11752. ["before", "after"],
  11753. ["even", "odd"],
  11754. ["inside", "outside"],
  11755. ["next", "previous"],
  11756. ["increase", "decrease"],
  11757. ["attach", "detach"],
  11758. ["&&", "||"],
  11759. ["==", "!="],
  11760. ]),
  11761. (this.toggleWord = function () {
  11762. var e = this.selection.getCursor().row,
  11763. t = this.selection.getCursor().column;
  11764. this.selection.selectWord();
  11765. var n = this.getSelectedText(),
  11766. r = this.selection.getWordRange().start.column,
  11767. i = n
  11768. .replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g, "$1 ")
  11769. .split(/\s/),
  11770. o = t - r - 1;
  11771. o < 0 && (o = 0);
  11772. var u = 0,
  11773. a = 0,
  11774. f = this;
  11775. n.match(/[A-Za-z0-9_]+/) &&
  11776. i.forEach(function (t, i) {
  11777. (a = u + t.length),
  11778. o >= u &&
  11779. o <= a &&
  11780. ((n = t),
  11781. f.selection.clearSelection(),
  11782. f.moveCursorTo(e, u + r),
  11783. f.selection.selectTo(e, a + r)),
  11784. (u = a);
  11785. });
  11786. var l = this.$toggleWordPairs,
  11787. c;
  11788. for (var h = 0; h < l.length; h++) {
  11789. var p = l[h];
  11790. for (var d = 0; d <= 1; d++) {
  11791. var v = +!d,
  11792. m = n.match(
  11793. new RegExp(
  11794. "^\\s?_?(" + s.escapeRegExp(p[d]) + ")\\s?$",
  11795. "i"
  11796. )
  11797. );
  11798. if (m) {
  11799. var g = n.match(
  11800. new RegExp(
  11801. "([_]|^|\\s)(" + s.escapeRegExp(m[1]) + ")($|\\s)",
  11802. "g"
  11803. )
  11804. );
  11805. g &&
  11806. ((c = n.replace(
  11807. new RegExp(s.escapeRegExp(p[d]), "i"),
  11808. function (e) {
  11809. var t = p[v];
  11810. return (
  11811. e.toUpperCase() == e
  11812. ? (t = t.toUpperCase())
  11813. : e.charAt(0).toUpperCase() == e.charAt(0) &&
  11814. (t =
  11815. t.substr(0, 0) +
  11816. p[v].charAt(0).toUpperCase() +
  11817. t.substr(1)),
  11818. t
  11819. );
  11820. }
  11821. )),
  11822. this.insert(c),
  11823. (c = ""));
  11824. }
  11825. }
  11826. }
  11827. }),
  11828. (this.removeLines = function () {
  11829. var e = this.$getSelectedRows();
  11830. this.session.removeFullLines(e.first, e.last),
  11831. this.clearSelection();
  11832. }),
  11833. (this.duplicateSelection = function () {
  11834. var e = this.selection,
  11835. t = this.session,
  11836. n = e.getRange(),
  11837. r = e.isBackwards();
  11838. if (n.isEmpty()) {
  11839. var i = n.start.row;
  11840. t.duplicateLines(i, i);
  11841. } else {
  11842. var s = r ? n.start : n.end,
  11843. o = t.insert(s, t.getTextRange(n), !1);
  11844. (n.start = s), (n.end = o), e.setSelectionRange(n, r);
  11845. }
  11846. }),
  11847. (this.moveLinesDown = function () {
  11848. this.$moveLines(1, !1);
  11849. }),
  11850. (this.moveLinesUp = function () {
  11851. this.$moveLines(-1, !1);
  11852. }),
  11853. (this.moveText = function (e, t, n) {
  11854. return this.session.moveText(e, t, n);
  11855. }),
  11856. (this.copyLinesUp = function () {
  11857. this.$moveLines(-1, !0);
  11858. }),
  11859. (this.copyLinesDown = function () {
  11860. this.$moveLines(1, !0);
  11861. }),
  11862. (this.$moveLines = function (e, t) {
  11863. var n,
  11864. r,
  11865. i = this.selection;
  11866. if (!i.inMultiSelectMode || this.inVirtualSelectionMode) {
  11867. var s = i.toOrientedRange();
  11868. (n = this.$getSelectedRows(s)),
  11869. (r = this.session.$moveLines(n.first, n.last, t ? 0 : e)),
  11870. t && e == -1 && (r = 0),
  11871. s.moveBy(r, 0),
  11872. i.fromOrientedRange(s);
  11873. } else {
  11874. var o = i.rangeList.ranges;
  11875. i.rangeList.detach(this.session),
  11876. (this.inVirtualSelectionMode = !0);
  11877. var u = 0,
  11878. a = 0,
  11879. f = o.length;
  11880. for (var l = 0; l < f; l++) {
  11881. var c = l;
  11882. o[l].moveBy(u, 0), (n = this.$getSelectedRows(o[l]));
  11883. var h = n.first,
  11884. p = n.last;
  11885. while (++l < f) {
  11886. a && o[l].moveBy(a, 0);
  11887. var d = this.$getSelectedRows(o[l]);
  11888. if (t && d.first != p) break;
  11889. if (!t && d.first > p + 1) break;
  11890. p = d.last;
  11891. }
  11892. l--,
  11893. (u = this.session.$moveLines(h, p, t ? 0 : e)),
  11894. t && e == -1 && (c = l + 1);
  11895. while (c <= l) o[c].moveBy(u, 0), c++;
  11896. t || (u = 0), (a += u);
  11897. }
  11898. i.fromOrientedRange(i.ranges[0]),
  11899. i.rangeList.attach(this.session),
  11900. (this.inVirtualSelectionMode = !1);
  11901. }
  11902. }),
  11903. (this.$getSelectedRows = function (e) {
  11904. return (
  11905. (e = (e || this.getSelectionRange()).collapseRows()),
  11906. {
  11907. first: this.session.getRowFoldStart(e.start.row),
  11908. last: this.session.getRowFoldEnd(e.end.row),
  11909. }
  11910. );
  11911. }),
  11912. (this.onCompositionStart = function (e) {
  11913. this.renderer.showComposition(e);
  11914. }),
  11915. (this.onCompositionUpdate = function (e) {
  11916. this.renderer.setCompositionText(e);
  11917. }),
  11918. (this.onCompositionEnd = function () {
  11919. this.renderer.hideComposition();
  11920. }),
  11921. (this.getFirstVisibleRow = function () {
  11922. return this.renderer.getFirstVisibleRow();
  11923. }),
  11924. (this.getLastVisibleRow = function () {
  11925. return this.renderer.getLastVisibleRow();
  11926. }),
  11927. (this.isRowVisible = function (e) {
  11928. return (
  11929. e >= this.getFirstVisibleRow() && e <= this.getLastVisibleRow()
  11930. );
  11931. }),
  11932. (this.isRowFullyVisible = function (e) {
  11933. return (
  11934. e >= this.renderer.getFirstFullyVisibleRow() &&
  11935. e <= this.renderer.getLastFullyVisibleRow()
  11936. );
  11937. }),
  11938. (this.$getVisibleRowCount = function () {
  11939. return (
  11940. this.renderer.getScrollBottomRow() -
  11941. this.renderer.getScrollTopRow() +
  11942. 1
  11943. );
  11944. }),
  11945. (this.$moveByPage = function (e, t) {
  11946. var n = this.renderer,
  11947. r = this.renderer.layerConfig,
  11948. i = e * Math.floor(r.height / r.lineHeight);
  11949. t === !0
  11950. ? this.selection.$moveSelection(function () {
  11951. this.moveCursorBy(i, 0);
  11952. })
  11953. : t === !1 &&
  11954. (this.selection.moveCursorBy(i, 0),
  11955. this.selection.clearSelection());
  11956. var s = n.scrollTop;
  11957. n.scrollBy(0, i * r.lineHeight),
  11958. t != null && n.scrollCursorIntoView(null, 0.5),
  11959. n.animateScrolling(s);
  11960. }),
  11961. (this.selectPageDown = function () {
  11962. this.$moveByPage(1, !0);
  11963. }),
  11964. (this.selectPageUp = function () {
  11965. this.$moveByPage(-1, !0);
  11966. }),
  11967. (this.gotoPageDown = function () {
  11968. this.$moveByPage(1, !1);
  11969. }),
  11970. (this.gotoPageUp = function () {
  11971. this.$moveByPage(-1, !1);
  11972. }),
  11973. (this.scrollPageDown = function () {
  11974. this.$moveByPage(1);
  11975. }),
  11976. (this.scrollPageUp = function () {
  11977. this.$moveByPage(-1);
  11978. }),
  11979. (this.scrollToRow = function (e) {
  11980. this.renderer.scrollToRow(e);
  11981. }),
  11982. (this.scrollToLine = function (e, t, n, r) {
  11983. this.renderer.scrollToLine(e, t, n, r);
  11984. }),
  11985. (this.centerSelection = function () {
  11986. var e = this.getSelectionRange(),
  11987. t = {
  11988. row: Math.floor(e.start.row + (e.end.row - e.start.row) / 2),
  11989. column: Math.floor(
  11990. e.start.column + (e.end.column - e.start.column) / 2
  11991. ),
  11992. };
  11993. this.renderer.alignCursor(t, 0.5);
  11994. }),
  11995. (this.getCursorPosition = function () {
  11996. return this.selection.getCursor();
  11997. }),
  11998. (this.getCursorPositionScreen = function () {
  11999. return this.session.documentToScreenPosition(
  12000. this.getCursorPosition()
  12001. );
  12002. }),
  12003. (this.getSelectionRange = function () {
  12004. return this.selection.getRange();
  12005. }),
  12006. (this.selectAll = function () {
  12007. this.selection.selectAll();
  12008. }),
  12009. (this.clearSelection = function () {
  12010. this.selection.clearSelection();
  12011. }),
  12012. (this.moveCursorTo = function (e, t) {
  12013. this.selection.moveCursorTo(e, t);
  12014. }),
  12015. (this.moveCursorToPosition = function (e) {
  12016. this.selection.moveCursorToPosition(e);
  12017. }),
  12018. (this.jumpToMatching = function (e, t) {
  12019. var n = this.getCursorPosition(),
  12020. r = new y(this.session, n.row, n.column),
  12021. i = r.getCurrentToken(),
  12022. s = i || r.stepForward();
  12023. if (!s) return;
  12024. var o,
  12025. u = !1,
  12026. a = {},
  12027. f = n.column - s.start,
  12028. l,
  12029. c = {
  12030. ")": "(",
  12031. "(": "(",
  12032. "]": "[",
  12033. "[": "[",
  12034. "{": "{",
  12035. "}": "{",
  12036. };
  12037. do {
  12038. if (s.value.match(/[{}()\[\]]/g))
  12039. for (; f < s.value.length && !u; f++) {
  12040. if (!c[s.value[f]]) continue;
  12041. (l =
  12042. c[s.value[f]] + "." + s.type.replace("rparen", "lparen")),
  12043. isNaN(a[l]) && (a[l] = 0);
  12044. switch (s.value[f]) {
  12045. case "(":
  12046. case "[":
  12047. case "{":
  12048. a[l]++;
  12049. break;
  12050. case ")":
  12051. case "]":
  12052. case "}":
  12053. a[l]--, a[l] === -1 && ((o = "bracket"), (u = !0));
  12054. }
  12055. }
  12056. else
  12057. s.type.indexOf("tag-name") !== -1 &&
  12058. (isNaN(a[s.value]) && (a[s.value] = 0),
  12059. i.value === "<"
  12060. ? a[s.value]++
  12061. : i.value === "</" && a[s.value]--,
  12062. a[s.value] === -1 && ((o = "tag"), (u = !0)));
  12063. u || ((i = s), (s = r.stepForward()), (f = 0));
  12064. } while (s && !u);
  12065. if (!o) return;
  12066. var h, d;
  12067. if (o === "bracket") {
  12068. h = this.session.getBracketRange(n);
  12069. if (!h) {
  12070. (h = new p(
  12071. r.getCurrentTokenRow(),
  12072. r.getCurrentTokenColumn() + f - 1,
  12073. r.getCurrentTokenRow(),
  12074. r.getCurrentTokenColumn() + f - 1
  12075. )),
  12076. (d = h.start);
  12077. if (
  12078. t ||
  12079. (d.row === n.row && Math.abs(d.column - n.column) < 2)
  12080. )
  12081. h = this.session.getBracketRange(d);
  12082. }
  12083. } else if (o === "tag") {
  12084. if (!s || s.type.indexOf("tag-name") === -1) return;
  12085. var v = s.value;
  12086. h = new p(
  12087. r.getCurrentTokenRow(),
  12088. r.getCurrentTokenColumn() - 2,
  12089. r.getCurrentTokenRow(),
  12090. r.getCurrentTokenColumn() - 2
  12091. );
  12092. if (h.compare(n.row, n.column) === 0) {
  12093. u = !1;
  12094. do
  12095. (s = i),
  12096. (i = r.stepBackward()),
  12097. i &&
  12098. (i.type.indexOf("tag-close") !== -1 &&
  12099. h.setEnd(
  12100. r.getCurrentTokenRow(),
  12101. r.getCurrentTokenColumn() + 1
  12102. ),
  12103. s.value === v &&
  12104. s.type.indexOf("tag-name") !== -1 &&
  12105. (i.value === "<"
  12106. ? a[v]++
  12107. : i.value === "</" && a[v]--,
  12108. a[v] === 0 && (u = !0)));
  12109. while (i && !u);
  12110. }
  12111. s &&
  12112. s.type.indexOf("tag-name") &&
  12113. ((d = h.start),
  12114. d.row == n.row &&
  12115. Math.abs(d.column - n.column) < 2 &&
  12116. (d = h.end));
  12117. }
  12118. (d = (h && h.cursor) || d),
  12119. d &&
  12120. (e
  12121. ? h && t
  12122. ? this.selection.setRange(h)
  12123. : h && h.isEqual(this.getSelectionRange())
  12124. ? this.clearSelection()
  12125. : this.selection.selectTo(d.row, d.column)
  12126. : this.selection.moveTo(d.row, d.column));
  12127. }),
  12128. (this.gotoLine = function (e, t, n) {
  12129. this.selection.clearSelection(),
  12130. this.session.unfold({ row: e - 1, column: t || 0 }),
  12131. this.exitMultiSelectMode && this.exitMultiSelectMode(),
  12132. this.moveCursorTo(e - 1, t || 0),
  12133. this.isRowFullyVisible(e - 1) ||
  12134. this.scrollToLine(e - 1, !0, n);
  12135. }),
  12136. (this.navigateTo = function (e, t) {
  12137. this.selection.moveTo(e, t);
  12138. }),
  12139. (this.navigateUp = function (e) {
  12140. if (
  12141. this.selection.isMultiLine() &&
  12142. !this.selection.isBackwards()
  12143. ) {
  12144. var t = this.selection.anchor.getPosition();
  12145. return this.moveCursorToPosition(t);
  12146. }
  12147. this.selection.clearSelection(),
  12148. this.selection.moveCursorBy(-e || -1, 0);
  12149. }),
  12150. (this.navigateDown = function (e) {
  12151. if (
  12152. this.selection.isMultiLine() &&
  12153. this.selection.isBackwards()
  12154. ) {
  12155. var t = this.selection.anchor.getPosition();
  12156. return this.moveCursorToPosition(t);
  12157. }
  12158. this.selection.clearSelection(),
  12159. this.selection.moveCursorBy(e || 1, 0);
  12160. }),
  12161. (this.navigateLeft = function (e) {
  12162. if (!this.selection.isEmpty()) {
  12163. var t = this.getSelectionRange().start;
  12164. this.moveCursorToPosition(t);
  12165. } else {
  12166. e = e || 1;
  12167. while (e--) this.selection.moveCursorLeft();
  12168. }
  12169. this.clearSelection();
  12170. }),
  12171. (this.navigateRight = function (e) {
  12172. if (!this.selection.isEmpty()) {
  12173. var t = this.getSelectionRange().end;
  12174. this.moveCursorToPosition(t);
  12175. } else {
  12176. e = e || 1;
  12177. while (e--) this.selection.moveCursorRight();
  12178. }
  12179. this.clearSelection();
  12180. }),
  12181. (this.navigateLineStart = function () {
  12182. this.selection.moveCursorLineStart(), this.clearSelection();
  12183. }),
  12184. (this.navigateLineEnd = function () {
  12185. this.selection.moveCursorLineEnd(), this.clearSelection();
  12186. }),
  12187. (this.navigateFileEnd = function () {
  12188. this.selection.moveCursorFileEnd(), this.clearSelection();
  12189. }),
  12190. (this.navigateFileStart = function () {
  12191. this.selection.moveCursorFileStart(), this.clearSelection();
  12192. }),
  12193. (this.navigateWordRight = function () {
  12194. this.selection.moveCursorWordRight(), this.clearSelection();
  12195. }),
  12196. (this.navigateWordLeft = function () {
  12197. this.selection.moveCursorWordLeft(), this.clearSelection();
  12198. }),
  12199. (this.replace = function (e, t) {
  12200. t && this.$search.set(t);
  12201. var n = this.$search.find(this.session),
  12202. r = 0;
  12203. return n
  12204. ? (this.$tryReplace(n, e) && (r = 1),
  12205. this.selection.setSelectionRange(n),
  12206. this.renderer.scrollSelectionIntoView(n.start, n.end),
  12207. r)
  12208. : r;
  12209. }),
  12210. (this.replaceAll = function (e, t) {
  12211. t && this.$search.set(t);
  12212. var n = this.$search.findAll(this.session),
  12213. r = 0;
  12214. if (!n.length) return r;
  12215. var i = this.getSelectionRange();
  12216. this.selection.moveTo(0, 0);
  12217. for (var s = n.length - 1; s >= 0; --s)
  12218. this.$tryReplace(n[s], e) && r++;
  12219. return this.selection.setSelectionRange(i), r;
  12220. }),
  12221. (this.$tryReplace = function (e, t) {
  12222. var n = this.session.getTextRange(e);
  12223. return (
  12224. (t = this.$search.replace(n, t)),
  12225. t !== null ? ((e.end = this.session.replace(e, t)), e) : null
  12226. );
  12227. }),
  12228. (this.getLastSearchOptions = function () {
  12229. return this.$search.getOptions();
  12230. }),
  12231. (this.find = function (e, t, n) {
  12232. t || (t = {}),
  12233. typeof e == "string" || e instanceof RegExp
  12234. ? (t.needle = e)
  12235. : typeof e == "object" && r.mixin(t, e);
  12236. var i = this.selection.getRange();
  12237. t.needle == null &&
  12238. ((e =
  12239. this.session.getTextRange(i) || this.$search.$options.needle),
  12240. e ||
  12241. ((i = this.session.getWordRange(i.start.row, i.start.column)),
  12242. (e = this.session.getTextRange(i))),
  12243. this.$search.set({ needle: e })),
  12244. this.$search.set(t),
  12245. t.start || this.$search.set({ start: i });
  12246. var s = this.$search.find(this.session);
  12247. if (t.preventScroll) return s;
  12248. if (s) return this.revealRange(s, n), s;
  12249. t.backwards ? (i.start = i.end) : (i.end = i.start),
  12250. this.selection.setRange(i);
  12251. }),
  12252. (this.findNext = function (e, t) {
  12253. this.find({ skipCurrent: !0, backwards: !1 }, e, t);
  12254. }),
  12255. (this.findPrevious = function (e, t) {
  12256. this.find(e, { skipCurrent: !0, backwards: !0 }, t);
  12257. }),
  12258. (this.revealRange = function (e, t) {
  12259. this.session.unfold(e), this.selection.setSelectionRange(e);
  12260. var n = this.renderer.scrollTop;
  12261. this.renderer.scrollSelectionIntoView(e.start, e.end, 0.5),
  12262. t !== !1 && this.renderer.animateScrolling(n);
  12263. }),
  12264. (this.undo = function () {
  12265. this.session.getUndoManager().undo(this.session),
  12266. this.renderer.scrollCursorIntoView(null, 0.5);
  12267. }),
  12268. (this.redo = function () {
  12269. this.session.getUndoManager().redo(this.session),
  12270. this.renderer.scrollCursorIntoView(null, 0.5);
  12271. }),
  12272. (this.destroy = function () {
  12273. this.renderer.destroy(),
  12274. this._signal("destroy", this),
  12275. this.session && this.session.destroy();
  12276. }),
  12277. (this.setAutoScrollEditorIntoView = function (e) {
  12278. if (!e) return;
  12279. var t,
  12280. n = this,
  12281. r = !1;
  12282. this.$scrollAnchor ||
  12283. (this.$scrollAnchor = document.createElement("div"));
  12284. var i = this.$scrollAnchor;
  12285. (i.style.cssText = "position:absolute"),
  12286. this.container.insertBefore(i, this.container.firstChild);
  12287. var s = this.on("changeSelection", function () {
  12288. r = !0;
  12289. }),
  12290. o = this.renderer.on("beforeRender", function () {
  12291. r && (t = n.renderer.container.getBoundingClientRect());
  12292. }),
  12293. u = this.renderer.on("afterRender", function () {
  12294. if (
  12295. r &&
  12296. t &&
  12297. (n.isFocused() || (n.searchBox && n.searchBox.isFocused()))
  12298. ) {
  12299. var e = n.renderer,
  12300. s = e.$cursorLayer.$pixelPos,
  12301. o = e.layerConfig,
  12302. u = s.top - o.offset;
  12303. s.top >= 0 && u + t.top < 0
  12304. ? (r = !0)
  12305. : s.top < o.height &&
  12306. s.top + t.top + o.lineHeight > window.innerHeight
  12307. ? (r = !1)
  12308. : (r = null),
  12309. r != null &&
  12310. ((i.style.top = u + "px"),
  12311. (i.style.left = s.left + "px"),
  12312. (i.style.height = o.lineHeight + "px"),
  12313. i.scrollIntoView(r)),
  12314. (r = t = null);
  12315. }
  12316. });
  12317. this.setAutoScrollEditorIntoView = function (e) {
  12318. if (e) return;
  12319. delete this.setAutoScrollEditorIntoView,
  12320. this.off("changeSelection", s),
  12321. this.renderer.off("afterRender", u),
  12322. this.renderer.off("beforeRender", o);
  12323. };
  12324. }),
  12325. (this.$resetCursorStyle = function () {
  12326. var e = this.$cursorStyle || "ace",
  12327. t = this.renderer.$cursorLayer;
  12328. if (!t) return;
  12329. t.setSmoothBlinking(/smooth/.test(e)),
  12330. (t.isBlinking = !this.$readOnly && e != "wide"),
  12331. i.setCssClass(t.element, "ace_slim-cursors", /slim/.test(e));
  12332. });
  12333. }.call(w.prototype),
  12334. g.defineOptions(w.prototype, "editor", {
  12335. selectionStyle: {
  12336. set: function (e) {
  12337. this.onSelectionChange(),
  12338. this._signal("changeSelectionStyle", { data: e });
  12339. },
  12340. initialValue: "line",
  12341. },
  12342. highlightActiveLine: {
  12343. set: function () {
  12344. this.$updateHighlightActiveLine();
  12345. },
  12346. initialValue: !0,
  12347. },
  12348. highlightSelectedWord: {
  12349. set: function (e) {
  12350. this.$onSelectionChange();
  12351. },
  12352. initialValue: !0,
  12353. },
  12354. readOnly: {
  12355. set: function (e) {
  12356. this.textInput.setReadOnly(e), this.$resetCursorStyle();
  12357. },
  12358. initialValue: !1,
  12359. },
  12360. copyWithEmptySelection: {
  12361. set: function (e) {
  12362. this.textInput.setCopyWithEmptySelection(e);
  12363. },
  12364. initialValue: !1,
  12365. },
  12366. cursorStyle: {
  12367. set: function (e) {
  12368. this.$resetCursorStyle();
  12369. },
  12370. values: ["ace", "slim", "smooth", "wide"],
  12371. initialValue: "ace",
  12372. },
  12373. mergeUndoDeltas: { values: [!1, !0, "always"], initialValue: !0 },
  12374. behavioursEnabled: { initialValue: !0 },
  12375. wrapBehavioursEnabled: { initialValue: !0 },
  12376. autoScrollEditorIntoView: {
  12377. set: function (e) {
  12378. this.setAutoScrollEditorIntoView(e);
  12379. },
  12380. },
  12381. keyboardHandler: {
  12382. set: function (e) {
  12383. this.setKeyboardHandler(e);
  12384. },
  12385. get: function () {
  12386. return this.$keybindingId;
  12387. },
  12388. handlesSet: !0,
  12389. },
  12390. value: {
  12391. set: function (e) {
  12392. this.session.setValue(e);
  12393. },
  12394. get: function () {
  12395. return this.getValue();
  12396. },
  12397. handlesSet: !0,
  12398. hidden: !0,
  12399. },
  12400. session: {
  12401. set: function (e) {
  12402. this.setSession(e);
  12403. },
  12404. get: function () {
  12405. return this.session;
  12406. },
  12407. handlesSet: !0,
  12408. hidden: !0,
  12409. },
  12410. showLineNumbers: {
  12411. set: function (e) {
  12412. this.renderer.$gutterLayer.setShowLineNumbers(e),
  12413. this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),
  12414. e && this.$relativeLineNumbers
  12415. ? E.attach(this)
  12416. : E.detach(this);
  12417. },
  12418. initialValue: !0,
  12419. },
  12420. relativeLineNumbers: {
  12421. set: function (e) {
  12422. this.$showLineNumbers && e ? E.attach(this) : E.detach(this);
  12423. },
  12424. },
  12425. hScrollBarAlwaysVisible: "renderer",
  12426. vScrollBarAlwaysVisible: "renderer",
  12427. highlightGutterLine: "renderer",
  12428. animatedScroll: "renderer",
  12429. showInvisibles: "renderer",
  12430. showPrintMargin: "renderer",
  12431. printMarginColumn: "renderer",
  12432. printMargin: "renderer",
  12433. fadeFoldWidgets: "renderer",
  12434. showFoldWidgets: "renderer",
  12435. displayIndentGuides: "renderer",
  12436. showGutter: "renderer",
  12437. fontSize: "renderer",
  12438. fontFamily: "renderer",
  12439. maxLines: "renderer",
  12440. minLines: "renderer",
  12441. scrollPastEnd: "renderer",
  12442. fixedWidthGutter: "renderer",
  12443. theme: "renderer",
  12444. hasCssTransforms: "renderer",
  12445. maxPixelHeight: "renderer",
  12446. useTextareaForIME: "renderer",
  12447. scrollSpeed: "$mouseHandler",
  12448. dragDelay: "$mouseHandler",
  12449. dragEnabled: "$mouseHandler",
  12450. focusTimeout: "$mouseHandler",
  12451. tooltipFollowsMouse: "$mouseHandler",
  12452. firstLineNumber: "session",
  12453. overwrite: "session",
  12454. newLineMode: "session",
  12455. useWorker: "session",
  12456. useSoftTabs: "session",
  12457. navigateWithinSoftTabs: "session",
  12458. tabSize: "session",
  12459. wrap: "session",
  12460. indentedSoftWrap: "session",
  12461. foldStyle: "session",
  12462. mode: "session",
  12463. });
  12464. var E = {
  12465. getText: function (e, t) {
  12466. return (
  12467. (Math.abs(e.selection.lead.row - t) ||
  12468. t + 1 + (t < 9 ? "\u00b7" : "")) + ""
  12469. );
  12470. },
  12471. getWidth: function (e, t, n) {
  12472. return (
  12473. Math.max(
  12474. t.toString().length,
  12475. (n.lastRow + 1).toString().length,
  12476. 2
  12477. ) * n.characterWidth
  12478. );
  12479. },
  12480. update: function (e, t) {
  12481. t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER);
  12482. },
  12483. attach: function (e) {
  12484. (e.renderer.$gutterLayer.$renderer = this),
  12485. e.on("changeSelection", this.update),
  12486. this.update(null, e);
  12487. },
  12488. detach: function (e) {
  12489. e.renderer.$gutterLayer.$renderer == this &&
  12490. (e.renderer.$gutterLayer.$renderer = null),
  12491. e.off("changeSelection", this.update),
  12492. this.update(null, e);
  12493. },
  12494. };
  12495. t.Editor = w;
  12496. }
  12497. ),
  12498. define(
  12499. "ace/undomanager",
  12500. ["require", "exports", "module", "ace/range"],
  12501. function (e, t, n) {
  12502. "use strict";
  12503. function i(e, t) {
  12504. for (var n = t; n--; ) {
  12505. var r = e[n];
  12506. if (r && !r[0].ignore) {
  12507. while (n < t - 1) {
  12508. var i = d(e[n], e[n + 1]);
  12509. (e[n] = i[0]), (e[n + 1] = i[1]), n++;
  12510. }
  12511. return !0;
  12512. }
  12513. }
  12514. }
  12515. function a(e) {
  12516. var t = e.action == "insert",
  12517. n = e.start,
  12518. r = e.end,
  12519. i = (r.row - n.row) * (t ? 1 : -1),
  12520. s = (r.column - n.column) * (t ? 1 : -1);
  12521. t && (r = n);
  12522. for (var o in this.marks) {
  12523. var a = this.marks[o],
  12524. f = u(a, n);
  12525. if (f < 0) continue;
  12526. if (f === 0 && t) {
  12527. if (a.bias != 1) {
  12528. a.bias == -1;
  12529. continue;
  12530. }
  12531. f = 1;
  12532. }
  12533. var l = t ? f : u(a, r);
  12534. if (l > 0) {
  12535. (a.row += i), (a.column += a.row == r.row ? s : 0);
  12536. continue;
  12537. }
  12538. !t &&
  12539. l <= 0 &&
  12540. ((a.row = n.row), (a.column = n.column), l === 0 && (a.bias = 1));
  12541. }
  12542. }
  12543. function f(e) {
  12544. return { row: e.row, column: e.column };
  12545. }
  12546. function l(e) {
  12547. return {
  12548. start: f(e.start),
  12549. end: f(e.end),
  12550. action: e.action,
  12551. lines: e.lines.slice(),
  12552. };
  12553. }
  12554. function c(e) {
  12555. e = e || this;
  12556. if (Array.isArray(e)) return e.map(c).join("\n");
  12557. var t = "";
  12558. e.action
  12559. ? ((t = e.action == "insert" ? "+" : "-"), (t += "[" + e.lines + "]"))
  12560. : e.value &&
  12561. (Array.isArray(e.value)
  12562. ? (t = e.value.map(h).join("\n"))
  12563. : (t = h(e.value))),
  12564. e.start && (t += h(e));
  12565. if (e.id || e.rev) t += " (" + (e.id || e.rev) + ")";
  12566. return t;
  12567. }
  12568. function h(e) {
  12569. return (
  12570. e.start.row +
  12571. ":" +
  12572. e.start.column +
  12573. "=>" +
  12574. e.end.row +
  12575. ":" +
  12576. e.end.column
  12577. );
  12578. }
  12579. function p(e, t) {
  12580. var n = e.action == "insert",
  12581. r = t.action == "insert";
  12582. if (n && r)
  12583. if (o(t.start, e.end) >= 0) m(t, e, -1);
  12584. else {
  12585. if (!(o(t.start, e.start) <= 0)) return null;
  12586. m(e, t, 1);
  12587. }
  12588. else if (n && !r)
  12589. if (o(t.start, e.end) >= 0) m(t, e, -1);
  12590. else {
  12591. if (!(o(t.end, e.start) <= 0)) return null;
  12592. m(e, t, -1);
  12593. }
  12594. else if (!n && r)
  12595. if (o(t.start, e.start) >= 0) m(t, e, 1);
  12596. else {
  12597. if (!(o(t.start, e.start) <= 0)) return null;
  12598. m(e, t, 1);
  12599. }
  12600. else if (!n && !r)
  12601. if (o(t.start, e.start) >= 0) m(t, e, 1);
  12602. else {
  12603. if (!(o(t.end, e.start) <= 0)) return null;
  12604. m(e, t, -1);
  12605. }
  12606. return [t, e];
  12607. }
  12608. function d(e, t) {
  12609. for (var n = e.length; n--; )
  12610. for (var r = 0; r < t.length; r++)
  12611. if (!p(e[n], t[r])) {
  12612. while (n < e.length) {
  12613. while (r--) p(t[r], e[n]);
  12614. (r = t.length), n++;
  12615. }
  12616. return [e, t];
  12617. }
  12618. return (
  12619. (e.selectionBefore =
  12620. t.selectionBefore =
  12621. e.selectionAfter =
  12622. t.selectionAfter =
  12623. null),
  12624. [t, e]
  12625. );
  12626. }
  12627. function v(e, t) {
  12628. var n = e.action == "insert",
  12629. r = t.action == "insert";
  12630. if (n && r) o(e.start, t.start) < 0 ? m(t, e, 1) : m(e, t, 1);
  12631. else if (n && !r)
  12632. o(e.start, t.end) >= 0
  12633. ? m(e, t, -1)
  12634. : o(e.start, t.start) <= 0
  12635. ? m(t, e, 1)
  12636. : (m(e, s.fromPoints(t.start, e.start), -1), m(t, e, 1));
  12637. else if (!n && r)
  12638. o(t.start, e.end) >= 0
  12639. ? m(t, e, -1)
  12640. : o(t.start, e.start) <= 0
  12641. ? m(e, t, 1)
  12642. : (m(t, s.fromPoints(e.start, t.start), -1), m(e, t, 1));
  12643. else if (!n && !r)
  12644. if (o(t.start, e.end) >= 0) m(t, e, -1);
  12645. else {
  12646. if (!(o(t.end, e.start) <= 0)) {
  12647. var i, u;
  12648. return (
  12649. o(e.start, t.start) < 0 && ((i = e), (e = y(e, t.start))),
  12650. o(e.end, t.end) > 0 && (u = y(e, t.end)),
  12651. g(t.end, e.start, e.end, -1),
  12652. u &&
  12653. !i &&
  12654. ((e.lines = u.lines),
  12655. (e.start = u.start),
  12656. (e.end = u.end),
  12657. (u = e)),
  12658. [t, i, u].filter(Boolean)
  12659. );
  12660. }
  12661. m(e, t, -1);
  12662. }
  12663. return [t, e];
  12664. }
  12665. function m(e, t, n) {
  12666. g(e.start, t.start, t.end, n), g(e.end, t.start, t.end, n);
  12667. }
  12668. function g(e, t, n, r) {
  12669. e.row == (r == 1 ? t : n).row &&
  12670. (e.column += r * (n.column - t.column)),
  12671. (e.row += r * (n.row - t.row));
  12672. }
  12673. function y(e, t) {
  12674. var n = e.lines,
  12675. r = e.end;
  12676. e.end = f(t);
  12677. var i = e.end.row - e.start.row,
  12678. s = n.splice(i, n.length),
  12679. o = i ? t.column : t.column - e.start.column;
  12680. n.push(s[0].substring(0, o)), (s[0] = s[0].substr(o));
  12681. var u = { start: f(t), end: r, lines: s, action: e.action };
  12682. return u;
  12683. }
  12684. function b(e, t) {
  12685. t = l(t);
  12686. for (var n = e.length; n--; ) {
  12687. var r = e[n];
  12688. for (var i = 0; i < r.length; i++) {
  12689. var s = r[i],
  12690. o = v(s, t);
  12691. (t = o[0]),
  12692. o.length != 2 &&
  12693. (o[2]
  12694. ? (r.splice(i + 1, 1, o[1], o[2]), i++)
  12695. : o[1] || (r.splice(i, 1), i--));
  12696. }
  12697. r.length || e.splice(n, 1);
  12698. }
  12699. return e;
  12700. }
  12701. function w(e, t) {
  12702. for (var n = 0; n < t.length; n++) {
  12703. var r = t[n];
  12704. for (var i = 0; i < r.length; i++) b(e, r[i]);
  12705. }
  12706. }
  12707. var r = function () {
  12708. (this.$maxRev = 0), (this.$fromUndo = !1), this.reset();
  12709. };
  12710. (function () {
  12711. (this.addSession = function (e) {
  12712. this.$session = e;
  12713. }),
  12714. (this.add = function (e, t, n) {
  12715. if (this.$fromUndo) return;
  12716. if (e == this.$lastDelta) return;
  12717. if (t === !1 || !this.lastDeltas)
  12718. (this.lastDeltas = []),
  12719. this.$undoStack.push(this.lastDeltas),
  12720. (e.id = this.$rev = ++this.$maxRev);
  12721. if (e.action == "remove" || e.action == "insert")
  12722. this.$lastDelta = e;
  12723. this.lastDeltas.push(e);
  12724. }),
  12725. (this.addSelection = function (e, t) {
  12726. this.selections.push({ value: e, rev: t || this.$rev });
  12727. }),
  12728. (this.startNewGroup = function () {
  12729. return (this.lastDeltas = null), this.$rev;
  12730. }),
  12731. (this.markIgnored = function (e, t) {
  12732. t == null && (t = this.$rev + 1);
  12733. var n = this.$undoStack;
  12734. for (var r = n.length; r--; ) {
  12735. var i = n[r][0];
  12736. if (i.id <= e) break;
  12737. i.id < t && (i.ignore = !0);
  12738. }
  12739. this.lastDeltas = null;
  12740. }),
  12741. (this.getSelection = function (e, t) {
  12742. var n = this.selections;
  12743. for (var r = n.length; r--; ) {
  12744. var i = n[r];
  12745. if (i.rev < e) return t && (i = n[r + 1]), i;
  12746. }
  12747. }),
  12748. (this.getRevision = function () {
  12749. return this.$rev;
  12750. }),
  12751. (this.getDeltas = function (e, t) {
  12752. t == null && (t = this.$rev + 1);
  12753. var n = this.$undoStack,
  12754. r = null,
  12755. i = 0;
  12756. for (var s = n.length; s--; ) {
  12757. var o = n[s][0];
  12758. o.id < t && !r && (r = s + 1);
  12759. if (o.id <= e) {
  12760. i = s + 1;
  12761. break;
  12762. }
  12763. }
  12764. return n.slice(i, r);
  12765. }),
  12766. (this.getChangedRanges = function (e, t) {
  12767. t == null && (t = this.$rev + 1);
  12768. }),
  12769. (this.getChangedLines = function (e, t) {
  12770. t == null && (t = this.$rev + 1);
  12771. }),
  12772. (this.undo = function (e, t) {
  12773. this.lastDeltas = null;
  12774. var n = this.$undoStack;
  12775. if (!i(n, n.length)) return;
  12776. e || (e = this.$session),
  12777. this.$redoStackBaseRev !== this.$rev &&
  12778. this.$redoStack.length &&
  12779. (this.$redoStack = []),
  12780. (this.$fromUndo = !0);
  12781. var r = n.pop(),
  12782. s = null;
  12783. return (
  12784. r &&
  12785. r.length &&
  12786. ((s = e.undoChanges(r, t)),
  12787. this.$redoStack.push(r),
  12788. this.$syncRev()),
  12789. (this.$fromUndo = !1),
  12790. s
  12791. );
  12792. }),
  12793. (this.redo = function (e, t) {
  12794. (this.lastDeltas = null),
  12795. e || (e = this.$session),
  12796. (this.$fromUndo = !0);
  12797. if (this.$redoStackBaseRev != this.$rev) {
  12798. var n = this.getDeltas(this.$redoStackBaseRev, this.$rev + 1);
  12799. w(this.$redoStack, n),
  12800. (this.$redoStackBaseRev = this.$rev),
  12801. this.$redoStack.forEach(function (e) {
  12802. e[0].id = ++this.$maxRev;
  12803. }, this);
  12804. }
  12805. var r = this.$redoStack.pop(),
  12806. i = null;
  12807. return (
  12808. r &&
  12809. ((i = e.redoChanges(r, t)),
  12810. this.$undoStack.push(r),
  12811. this.$syncRev()),
  12812. (this.$fromUndo = !1),
  12813. i
  12814. );
  12815. }),
  12816. (this.$syncRev = function () {
  12817. var e = this.$undoStack,
  12818. t = e[e.length - 1],
  12819. n = (t && t[0].id) || 0;
  12820. (this.$redoStackBaseRev = n), (this.$rev = n);
  12821. }),
  12822. (this.reset = function () {
  12823. (this.lastDeltas = null),
  12824. (this.$lastDelta = null),
  12825. (this.$undoStack = []),
  12826. (this.$redoStack = []),
  12827. (this.$rev = 0),
  12828. (this.mark = 0),
  12829. (this.$redoStackBaseRev = this.$rev),
  12830. (this.selections = []);
  12831. }),
  12832. (this.canUndo = function () {
  12833. return this.$undoStack.length > 0;
  12834. }),
  12835. (this.canRedo = function () {
  12836. return this.$redoStack.length > 0;
  12837. }),
  12838. (this.bookmark = function (e) {
  12839. e == undefined && (e = this.$rev), (this.mark = e);
  12840. }),
  12841. (this.isAtBookmark = function () {
  12842. return this.$rev === this.mark;
  12843. }),
  12844. (this.toJSON = function () {}),
  12845. (this.fromJSON = function () {}),
  12846. (this.hasUndo = this.canUndo),
  12847. (this.hasRedo = this.canRedo),
  12848. (this.isClean = this.isAtBookmark),
  12849. (this.markClean = this.bookmark),
  12850. (this.$prettyPrint = function (e) {
  12851. return e
  12852. ? c(e)
  12853. : c(this.$undoStack) + "\n---\n" + c(this.$redoStack);
  12854. });
  12855. }).call(r.prototype);
  12856. var s = e("./range").Range,
  12857. o = s.comparePoints,
  12858. u = s.comparePoints;
  12859. t.UndoManager = r;
  12860. }
  12861. ),
  12862. define(
  12863. "ace/layer/lines",
  12864. ["require", "exports", "module", "ace/lib/dom"],
  12865. function (e, t, n) {
  12866. "use strict";
  12867. var r = e("../lib/dom"),
  12868. i = function (e, t) {
  12869. (this.element = e),
  12870. (this.canvasHeight = t || 5e5),
  12871. (this.element.style.height = this.canvasHeight * 2 + "px"),
  12872. (this.cells = []),
  12873. (this.cellCache = []),
  12874. (this.$offsetCoefficient = 0);
  12875. };
  12876. (function () {
  12877. (this.moveContainer = function (e) {
  12878. r.translate(
  12879. this.element,
  12880. 0,
  12881. -((e.firstRowScreen * e.lineHeight) % this.canvasHeight) -
  12882. e.offset * this.$offsetCoefficient
  12883. );
  12884. }),
  12885. (this.pageChanged = function (e, t) {
  12886. return (
  12887. Math.floor(
  12888. (e.firstRowScreen * e.lineHeight) / this.canvasHeight
  12889. ) !==
  12890. Math.floor((t.firstRowScreen * t.lineHeight) / this.canvasHeight)
  12891. );
  12892. }),
  12893. (this.computeLineTop = function (e, t, n) {
  12894. var r = t.firstRowScreen * t.lineHeight,
  12895. i = Math.floor(r / this.canvasHeight),
  12896. s = n.documentToScreenRow(e, 0) * t.lineHeight;
  12897. return s - i * this.canvasHeight;
  12898. }),
  12899. (this.computeLineHeight = function (e, t, n) {
  12900. return t.lineHeight * n.getRowLength(e);
  12901. }),
  12902. (this.getLength = function () {
  12903. return this.cells.length;
  12904. }),
  12905. (this.get = function (e) {
  12906. return this.cells[e];
  12907. }),
  12908. (this.shift = function () {
  12909. this.$cacheCell(this.cells.shift());
  12910. }),
  12911. (this.pop = function () {
  12912. this.$cacheCell(this.cells.pop());
  12913. }),
  12914. (this.push = function (e) {
  12915. if (Array.isArray(e)) {
  12916. this.cells.push.apply(this.cells, e);
  12917. var t = r.createFragment(this.element);
  12918. for (var n = 0; n < e.length; n++) t.appendChild(e[n].element);
  12919. this.element.appendChild(t);
  12920. } else this.cells.push(e), this.element.appendChild(e.element);
  12921. }),
  12922. (this.unshift = function (e) {
  12923. if (Array.isArray(e)) {
  12924. this.cells.unshift.apply(this.cells, e);
  12925. var t = r.createFragment(this.element);
  12926. for (var n = 0; n < e.length; n++) t.appendChild(e[n].element);
  12927. this.element.firstChild
  12928. ? this.element.insertBefore(t, this.element.firstChild)
  12929. : this.element.appendChild(t);
  12930. } else
  12931. this.cells.unshift(e),
  12932. this.element.insertAdjacentElement("afterbegin", e.element);
  12933. }),
  12934. (this.last = function () {
  12935. return this.cells.length ? this.cells[this.cells.length - 1] : null;
  12936. }),
  12937. (this.$cacheCell = function (e) {
  12938. if (!e) return;
  12939. e.element.remove(), this.cellCache.push(e);
  12940. }),
  12941. (this.createCell = function (e, t, n, i) {
  12942. var s = this.cellCache.pop();
  12943. if (!s) {
  12944. var o = r.createElement("div");
  12945. i && i(o),
  12946. this.element.appendChild(o),
  12947. (s = { element: o, text: "", row: e });
  12948. }
  12949. return (s.row = e), s;
  12950. });
  12951. }).call(i.prototype),
  12952. (t.Lines = i);
  12953. }
  12954. ),
  12955. define(
  12956. "ace/layer/gutter",
  12957. [
  12958. "require",
  12959. "exports",
  12960. "module",
  12961. "ace/lib/dom",
  12962. "ace/lib/oop",
  12963. "ace/lib/lang",
  12964. "ace/lib/event_emitter",
  12965. "ace/layer/lines",
  12966. ],
  12967. function (e, t, n) {
  12968. "use strict";
  12969. function f(e) {
  12970. var t = document.createTextNode("");
  12971. e.appendChild(t);
  12972. var n = r.createElement("span");
  12973. return e.appendChild(n), e;
  12974. }
  12975. var r = e("../lib/dom"),
  12976. i = e("../lib/oop"),
  12977. s = e("../lib/lang"),
  12978. o = e("../lib/event_emitter").EventEmitter,
  12979. u = e("./lines").Lines,
  12980. a = function (e) {
  12981. (this.element = r.createElement("div")),
  12982. (this.element.className = "ace_layer ace_gutter-layer"),
  12983. e.appendChild(this.element),
  12984. this.setShowFoldWidgets(this.$showFoldWidgets),
  12985. (this.gutterWidth = 0),
  12986. (this.$annotations = []),
  12987. (this.$updateAnnotations = this.$updateAnnotations.bind(this)),
  12988. (this.$lines = new u(this.element)),
  12989. (this.$lines.$offsetCoefficient = 1);
  12990. };
  12991. (function () {
  12992. i.implement(this, o),
  12993. (this.setSession = function (e) {
  12994. this.session &&
  12995. this.session.removeEventListener(
  12996. "change",
  12997. this.$updateAnnotations
  12998. ),
  12999. (this.session = e),
  13000. e && e.on("change", this.$updateAnnotations);
  13001. }),
  13002. (this.addGutterDecoration = function (e, t) {
  13003. window.console &&
  13004. console.warn &&
  13005. console.warn("deprecated use session.addGutterDecoration"),
  13006. this.session.addGutterDecoration(e, t);
  13007. }),
  13008. (this.removeGutterDecoration = function (e, t) {
  13009. window.console &&
  13010. console.warn &&
  13011. console.warn("deprecated use session.removeGutterDecoration"),
  13012. this.session.removeGutterDecoration(e, t);
  13013. }),
  13014. (this.setAnnotations = function (e) {
  13015. this.$annotations = [];
  13016. for (var t = 0; t < e.length; t++) {
  13017. var n = e[t],
  13018. r = n.row,
  13019. i = this.$annotations[r];
  13020. i || (i = this.$annotations[r] = { text: [] });
  13021. var o = n.text;
  13022. (o = o ? s.escapeHTML(o) : n.html || ""),
  13023. i.text.indexOf(o) === -1 && i.text.push(o);
  13024. var u = n.type;
  13025. u == "error"
  13026. ? (i.className = " ace_error")
  13027. : u == "warning" && i.className != " ace_error"
  13028. ? (i.className = " ace_warning")
  13029. : u == "info" && !i.className && (i.className = " ace_info");
  13030. }
  13031. }),
  13032. (this.$updateAnnotations = function (e) {
  13033. if (!this.$annotations.length) return;
  13034. var t = e.start.row,
  13035. n = e.end.row - t;
  13036. if (n !== 0)
  13037. if (e.action == "remove")
  13038. this.$annotations.splice(t, n + 1, null);
  13039. else {
  13040. var r = new Array(n + 1);
  13041. r.unshift(t, 1),
  13042. this.$annotations.splice.apply(this.$annotations, r);
  13043. }
  13044. }),
  13045. (this.update = function (e) {
  13046. this.config = e;
  13047. var t = this.session,
  13048. n = e.firstRow,
  13049. r = Math.min(e.lastRow + e.gutterOffset, t.getLength() - 1);
  13050. (this.oldLastRow = r),
  13051. (this.config = e),
  13052. this.$lines.moveContainer(e),
  13053. this.$updateCursorRow();
  13054. var i = t.getNextFoldLine(n),
  13055. s = i ? i.start.row : Infinity,
  13056. o = null,
  13057. u = -1,
  13058. a = n;
  13059. for (;;) {
  13060. a > s &&
  13061. ((a = i.end.row + 1),
  13062. (i = t.getNextFoldLine(a, i)),
  13063. (s = i ? i.start.row : Infinity));
  13064. if (a > r) {
  13065. while (this.$lines.getLength() > u + 1) this.$lines.pop();
  13066. break;
  13067. }
  13068. (o = this.$lines.get(++u)),
  13069. o
  13070. ? (o.row = a)
  13071. : ((o = this.$lines.createCell(a, e, this.session, f)),
  13072. this.$lines.push(o)),
  13073. this.$renderCell(o, e, i, a),
  13074. a++;
  13075. }
  13076. this._signal("afterRender"), this.$updateGutterWidth(e);
  13077. }),
  13078. (this.$updateGutterWidth = function (e) {
  13079. var t = this.session,
  13080. n = t.gutterRenderer || this.$renderer,
  13081. r = t.$firstLineNumber,
  13082. i = this.$lines.last() ? this.$lines.last().text : "";
  13083. if (this.$fixedWidth || t.$useWrapMode) i = t.getLength() + r - 1;
  13084. var s = n
  13085. ? n.getWidth(t, i, e)
  13086. : i.toString().length * e.characterWidth,
  13087. o = this.$padding || this.$computePadding();
  13088. (s += o.left + o.right),
  13089. s !== this.gutterWidth &&
  13090. !isNaN(s) &&
  13091. ((this.gutterWidth = s),
  13092. (this.element.parentNode.style.width =
  13093. this.element.style.width =
  13094. Math.ceil(this.gutterWidth) + "px"),
  13095. this._signal("changeGutterWidth", s));
  13096. }),
  13097. (this.$updateCursorRow = function () {
  13098. if (!this.$highlightGutterLine) return;
  13099. var e = this.session.selection.getCursor();
  13100. if (this.$cursorRow === e.row) return;
  13101. this.$cursorRow = e.row;
  13102. }),
  13103. (this.updateLineHighlight = function () {
  13104. if (!this.$highlightGutterLine) return;
  13105. var e = this.session.selection.cursor.row;
  13106. this.$cursorRow = e;
  13107. if (this.$cursorCell && this.$cursorCell.row == e) return;
  13108. this.$cursorCell &&
  13109. (this.$cursorCell.element.className =
  13110. this.$cursorCell.element.className.replace(
  13111. "ace_gutter-active-line ",
  13112. ""
  13113. ));
  13114. var t = this.$lines.cells;
  13115. this.$cursorCell = null;
  13116. for (var n = 0; n < t.length; n++) {
  13117. var r = t[n];
  13118. if (r.row >= this.$cursorRow) {
  13119. if (r.row > this.$cursorRow) {
  13120. var i = this.session.getFoldLine(this.$cursorRow);
  13121. if (!(n > 0 && i && i.start.row == t[n - 1].row)) break;
  13122. r = t[n - 1];
  13123. }
  13124. (r.element.className =
  13125. "ace_gutter-active-line " + r.element.className),
  13126. (this.$cursorCell = r);
  13127. break;
  13128. }
  13129. }
  13130. }),
  13131. (this.scrollLines = function (e) {
  13132. var t = this.config;
  13133. (this.config = e), this.$updateCursorRow();
  13134. if (this.$lines.pageChanged(t, e)) return this.update(e);
  13135. this.$lines.moveContainer(e);
  13136. var n = Math.min(
  13137. e.lastRow + e.gutterOffset,
  13138. this.session.getLength() - 1
  13139. ),
  13140. r = this.oldLastRow;
  13141. this.oldLastRow = n;
  13142. if (!t || r < e.firstRow) return this.update(e);
  13143. if (n < t.firstRow) return this.update(e);
  13144. if (t.firstRow < e.firstRow)
  13145. for (
  13146. var i = this.session.getFoldedRowCount(
  13147. t.firstRow,
  13148. e.firstRow - 1
  13149. );
  13150. i > 0;
  13151. i--
  13152. )
  13153. this.$lines.shift();
  13154. if (r > n)
  13155. for (var i = this.session.getFoldedRowCount(n + 1, r); i > 0; i--)
  13156. this.$lines.pop();
  13157. e.firstRow < t.firstRow &&
  13158. this.$lines.unshift(
  13159. this.$renderLines(e, e.firstRow, t.firstRow - 1)
  13160. ),
  13161. n > r && this.$lines.push(this.$renderLines(e, r + 1, n)),
  13162. this.updateLineHighlight(),
  13163. this._signal("afterRender"),
  13164. this.$updateGutterWidth(e);
  13165. }),
  13166. (this.$renderLines = function (e, t, n) {
  13167. var r = [],
  13168. i = t,
  13169. s = this.session.getNextFoldLine(i),
  13170. o = s ? s.start.row : Infinity;
  13171. for (;;) {
  13172. i > o &&
  13173. ((i = s.end.row + 1),
  13174. (s = this.session.getNextFoldLine(i, s)),
  13175. (o = s ? s.start.row : Infinity));
  13176. if (i > n) break;
  13177. var u = this.$lines.createCell(i, e, this.session, f);
  13178. this.$renderCell(u, e, s, i), r.push(u), i++;
  13179. }
  13180. return r;
  13181. }),
  13182. (this.$renderCell = function (e, t, n, i) {
  13183. var s = e.element,
  13184. o = this.session,
  13185. u = s.childNodes[0],
  13186. a = s.childNodes[1],
  13187. f = o.$firstLineNumber,
  13188. l = o.$breakpoints,
  13189. c = o.$decorations,
  13190. h = o.gutterRenderer || this.$renderer,
  13191. p = this.$showFoldWidgets && o.foldWidgets,
  13192. d = n ? n.start.row : Number.MAX_VALUE,
  13193. v = "ace_gutter-cell ";
  13194. this.$highlightGutterLine &&
  13195. (i == this.$cursorRow ||
  13196. (n &&
  13197. i < this.$cursorRow &&
  13198. i >= d &&
  13199. this.$cursorRow <= n.end.row)) &&
  13200. ((v += "ace_gutter-active-line "),
  13201. this.$cursorCell != e &&
  13202. (this.$cursorCell &&
  13203. (this.$cursorCell.element.className =
  13204. this.$cursorCell.element.className.replace(
  13205. "ace_gutter-active-line ",
  13206. ""
  13207. )),
  13208. (this.$cursorCell = e))),
  13209. l[i] && (v += l[i]),
  13210. c[i] && (v += c[i]),
  13211. this.$annotations[i] && (v += this.$annotations[i].className),
  13212. s.className != v && (s.className = v);
  13213. if (p) {
  13214. var m = p[i];
  13215. m == null && (m = p[i] = o.getFoldWidget(i));
  13216. }
  13217. if (m) {
  13218. var v = "ace_fold-widget ace_" + m;
  13219. m == "start" && i == d && i < n.end.row
  13220. ? (v += " ace_closed")
  13221. : (v += " ace_open"),
  13222. a.className != v && (a.className = v);
  13223. var g = t.lineHeight + "px";
  13224. r.setStyle(a.style, "height", g),
  13225. r.setStyle(a.style, "display", "inline-block");
  13226. } else a && r.setStyle(a.style, "display", "none");
  13227. var y = (h ? h.getText(o, i) : i + f).toString();
  13228. return (
  13229. y !== u.data && (u.data = y),
  13230. r.setStyle(
  13231. e.element.style,
  13232. "height",
  13233. this.$lines.computeLineHeight(i, t, o) + "px"
  13234. ),
  13235. r.setStyle(
  13236. e.element.style,
  13237. "top",
  13238. this.$lines.computeLineTop(i, t, o) + "px"
  13239. ),
  13240. (e.text = y),
  13241. e
  13242. );
  13243. }),
  13244. (this.$fixedWidth = !1),
  13245. (this.$highlightGutterLine = !0),
  13246. (this.$renderer = ""),
  13247. (this.setHighlightGutterLine = function (e) {
  13248. this.$highlightGutterLine = e;
  13249. }),
  13250. (this.$showLineNumbers = !0),
  13251. (this.$renderer = ""),
  13252. (this.setShowLineNumbers = function (e) {
  13253. this.$renderer = !e && {
  13254. getWidth: function () {
  13255. return 0;
  13256. },
  13257. getText: function () {
  13258. return "";
  13259. },
  13260. };
  13261. }),
  13262. (this.getShowLineNumbers = function () {
  13263. return this.$showLineNumbers;
  13264. }),
  13265. (this.$showFoldWidgets = !0),
  13266. (this.setShowFoldWidgets = function (e) {
  13267. e
  13268. ? r.addCssClass(this.element, "ace_folding-enabled")
  13269. : r.removeCssClass(this.element, "ace_folding-enabled"),
  13270. (this.$showFoldWidgets = e),
  13271. (this.$padding = null);
  13272. }),
  13273. (this.getShowFoldWidgets = function () {
  13274. return this.$showFoldWidgets;
  13275. }),
  13276. (this.$computePadding = function () {
  13277. if (!this.element.firstChild) return { left: 0, right: 0 };
  13278. var e = r.computedStyle(this.element.firstChild);
  13279. return (
  13280. (this.$padding = {}),
  13281. (this.$padding.left =
  13282. (parseInt(e.borderLeftWidth) || 0) +
  13283. (parseInt(e.paddingLeft) || 0) +
  13284. 1),
  13285. (this.$padding.right =
  13286. (parseInt(e.borderRightWidth) || 0) +
  13287. (parseInt(e.paddingRight) || 0)),
  13288. this.$padding
  13289. );
  13290. }),
  13291. (this.getRegion = function (e) {
  13292. var t = this.$padding || this.$computePadding(),
  13293. n = this.element.getBoundingClientRect();
  13294. if (e.x < t.left + n.left) return "markers";
  13295. if (this.$showFoldWidgets && e.x > n.right - t.right)
  13296. return "foldWidgets";
  13297. });
  13298. }).call(a.prototype),
  13299. (t.Gutter = a);
  13300. }
  13301. ),
  13302. define(
  13303. "ace/layer/marker",
  13304. ["require", "exports", "module", "ace/range", "ace/lib/dom"],
  13305. function (e, t, n) {
  13306. "use strict";
  13307. var r = e("../range").Range,
  13308. i = e("../lib/dom"),
  13309. s = function (e) {
  13310. (this.element = i.createElement("div")),
  13311. (this.element.className = "ace_layer ace_marker-layer"),
  13312. e.appendChild(this.element);
  13313. };
  13314. (function () {
  13315. function e(e, t, n, r) {
  13316. return (e ? 1 : 0) | (t ? 2 : 0) | (n ? 4 : 0) | (r ? 8 : 0);
  13317. }
  13318. (this.$padding = 0),
  13319. (this.setPadding = function (e) {
  13320. this.$padding = e;
  13321. }),
  13322. (this.setSession = function (e) {
  13323. this.session = e;
  13324. }),
  13325. (this.setMarkers = function (e) {
  13326. this.markers = e;
  13327. }),
  13328. (this.elt = function (e, t) {
  13329. var n = this.i != -1 && this.element.childNodes[this.i];
  13330. n
  13331. ? this.i++
  13332. : ((n = document.createElement("div")),
  13333. this.element.appendChild(n),
  13334. (this.i = -1)),
  13335. (n.style.cssText = t),
  13336. (n.className = e);
  13337. }),
  13338. (this.update = function (e) {
  13339. if (!e) return;
  13340. (this.config = e), (this.i = 0);
  13341. var t;
  13342. for (var n in this.markers) {
  13343. var r = this.markers[n];
  13344. if (!r.range) {
  13345. r.update(t, this, this.session, e);
  13346. continue;
  13347. }
  13348. var i = r.range.clipRows(e.firstRow, e.lastRow);
  13349. if (i.isEmpty()) continue;
  13350. i = i.toScreenRange(this.session);
  13351. if (r.renderer) {
  13352. var s = this.$getTop(i.start.row, e),
  13353. o = this.$padding + i.start.column * e.characterWidth;
  13354. r.renderer(t, i, o, s, e);
  13355. } else
  13356. r.type == "fullLine"
  13357. ? this.drawFullLineMarker(t, i, r.clazz, e)
  13358. : r.type == "screenLine"
  13359. ? this.drawScreenLineMarker(t, i, r.clazz, e)
  13360. : i.isMultiLine()
  13361. ? r.type == "text"
  13362. ? this.drawTextMarker(t, i, r.clazz, e)
  13363. : this.drawMultiLineMarker(t, i, r.clazz, e)
  13364. : this.drawSingleLineMarker(
  13365. t,
  13366. i,
  13367. r.clazz + " ace_start" + " ace_br15",
  13368. e
  13369. );
  13370. }
  13371. if (this.i != -1)
  13372. while (this.i < this.element.childElementCount)
  13373. this.element.removeChild(this.element.lastChild);
  13374. }),
  13375. (this.$getTop = function (e, t) {
  13376. return (e - t.firstRowScreen) * t.lineHeight;
  13377. }),
  13378. (this.drawTextMarker = function (t, n, i, s, o) {
  13379. var u = this.session,
  13380. a = n.start.row,
  13381. f = n.end.row,
  13382. l = a,
  13383. c = 0,
  13384. h = 0,
  13385. p = u.getScreenLastRowColumn(l),
  13386. d = new r(l, n.start.column, l, h);
  13387. for (; l <= f; l++)
  13388. (d.start.row = d.end.row = l),
  13389. (d.start.column =
  13390. l == a ? n.start.column : u.getRowWrapIndent(l)),
  13391. (d.end.column = p),
  13392. (c = h),
  13393. (h = p),
  13394. (p =
  13395. l + 1 < f
  13396. ? u.getScreenLastRowColumn(l + 1)
  13397. : l == f
  13398. ? 0
  13399. : n.end.column),
  13400. this.drawSingleLineMarker(
  13401. t,
  13402. d,
  13403. i +
  13404. (l == a ? " ace_start" : "") +
  13405. " ace_br" +
  13406. e(
  13407. l == a || (l == a + 1 && n.start.column),
  13408. c < h,
  13409. h > p,
  13410. l == f
  13411. ),
  13412. s,
  13413. l == f ? 0 : 1,
  13414. o
  13415. );
  13416. }),
  13417. (this.drawMultiLineMarker = function (e, t, n, r, i) {
  13418. var s = this.$padding,
  13419. o = r.lineHeight,
  13420. u = this.$getTop(t.start.row, r),
  13421. a = s + t.start.column * r.characterWidth;
  13422. i = i || "";
  13423. if (this.session.$bidiHandler.isBidiRow(t.start.row)) {
  13424. var f = t.clone();
  13425. (f.end.row = f.start.row),
  13426. (f.end.column = this.session.getLine(f.start.row).length),
  13427. this.drawBidiSingleLineMarker(
  13428. e,
  13429. f,
  13430. n + " ace_br1 ace_start",
  13431. r,
  13432. null,
  13433. i
  13434. );
  13435. } else
  13436. this.elt(
  13437. n + " ace_br1 ace_start",
  13438. "height:" +
  13439. o +
  13440. "px;" +
  13441. "right:0;" +
  13442. "top:" +
  13443. u +
  13444. "px;left:" +
  13445. a +
  13446. "px;" +
  13447. (i || "")
  13448. );
  13449. if (this.session.$bidiHandler.isBidiRow(t.end.row)) {
  13450. var f = t.clone();
  13451. (f.start.row = f.end.row),
  13452. (f.start.column = 0),
  13453. this.drawBidiSingleLineMarker(
  13454. e,
  13455. f,
  13456. n + " ace_br12",
  13457. r,
  13458. null,
  13459. i
  13460. );
  13461. } else {
  13462. u = this.$getTop(t.end.row, r);
  13463. var l = t.end.column * r.characterWidth;
  13464. this.elt(
  13465. n + " ace_br12",
  13466. "height:" +
  13467. o +
  13468. "px;" +
  13469. "width:" +
  13470. l +
  13471. "px;" +
  13472. "top:" +
  13473. u +
  13474. "px;" +
  13475. "left:" +
  13476. s +
  13477. "px;" +
  13478. (i || "")
  13479. );
  13480. }
  13481. o = (t.end.row - t.start.row - 1) * r.lineHeight;
  13482. if (o <= 0) return;
  13483. u = this.$getTop(t.start.row + 1, r);
  13484. var c = (t.start.column ? 1 : 0) | (t.end.column ? 0 : 8);
  13485. this.elt(
  13486. n + (c ? " ace_br" + c : ""),
  13487. "height:" +
  13488. o +
  13489. "px;" +
  13490. "right:0;" +
  13491. "top:" +
  13492. u +
  13493. "px;" +
  13494. "left:" +
  13495. s +
  13496. "px;" +
  13497. (i || "")
  13498. );
  13499. }),
  13500. (this.drawSingleLineMarker = function (e, t, n, r, i, s) {
  13501. if (this.session.$bidiHandler.isBidiRow(t.start.row))
  13502. return this.drawBidiSingleLineMarker(e, t, n, r, i, s);
  13503. var o = r.lineHeight,
  13504. u = (t.end.column + (i || 0) - t.start.column) * r.characterWidth,
  13505. a = this.$getTop(t.start.row, r),
  13506. f = this.$padding + t.start.column * r.characterWidth;
  13507. this.elt(
  13508. n,
  13509. "height:" +
  13510. o +
  13511. "px;" +
  13512. "width:" +
  13513. u +
  13514. "px;" +
  13515. "top:" +
  13516. a +
  13517. "px;" +
  13518. "left:" +
  13519. f +
  13520. "px;" +
  13521. (s || "")
  13522. );
  13523. }),
  13524. (this.drawBidiSingleLineMarker = function (e, t, n, r, i, s) {
  13525. var o = r.lineHeight,
  13526. u = this.$getTop(t.start.row, r),
  13527. a = this.$padding,
  13528. f = this.session.$bidiHandler.getSelections(
  13529. t.start.column,
  13530. t.end.column
  13531. );
  13532. f.forEach(function (e) {
  13533. this.elt(
  13534. n,
  13535. "height:" +
  13536. o +
  13537. "px;" +
  13538. "width:" +
  13539. e.width +
  13540. (i || 0) +
  13541. "px;" +
  13542. "top:" +
  13543. u +
  13544. "px;" +
  13545. "left:" +
  13546. (a + e.left) +
  13547. "px;" +
  13548. (s || "")
  13549. );
  13550. }, this);
  13551. }),
  13552. (this.drawFullLineMarker = function (e, t, n, r, i) {
  13553. var s = this.$getTop(t.start.row, r),
  13554. o = r.lineHeight;
  13555. t.start.row != t.end.row && (o += this.$getTop(t.end.row, r) - s),
  13556. this.elt(
  13557. n,
  13558. "height:" +
  13559. o +
  13560. "px;" +
  13561. "top:" +
  13562. s +
  13563. "px;" +
  13564. "left:0;right:0;" +
  13565. (i || "")
  13566. );
  13567. }),
  13568. (this.drawScreenLineMarker = function (e, t, n, r, i) {
  13569. var s = this.$getTop(t.start.row, r),
  13570. o = r.lineHeight;
  13571. this.elt(
  13572. n,
  13573. "height:" +
  13574. o +
  13575. "px;" +
  13576. "top:" +
  13577. s +
  13578. "px;" +
  13579. "left:0;right:0;" +
  13580. (i || "")
  13581. );
  13582. });
  13583. }).call(s.prototype),
  13584. (t.Marker = s);
  13585. }
  13586. ),
  13587. define(
  13588. "ace/layer/text",
  13589. [
  13590. "require",
  13591. "exports",
  13592. "module",
  13593. "ace/lib/oop",
  13594. "ace/lib/dom",
  13595. "ace/lib/lang",
  13596. "ace/layer/lines",
  13597. "ace/lib/event_emitter",
  13598. ],
  13599. function (e, t, n) {
  13600. "use strict";
  13601. var r = e("../lib/oop"),
  13602. i = e("../lib/dom"),
  13603. s = e("../lib/lang"),
  13604. o = e("./lines").Lines,
  13605. u = e("../lib/event_emitter").EventEmitter,
  13606. a = function (e) {
  13607. (this.dom = i),
  13608. (this.element = this.dom.createElement("div")),
  13609. (this.element.className = "ace_layer ace_text-layer"),
  13610. e.appendChild(this.element),
  13611. (this.$updateEolChar = this.$updateEolChar.bind(this)),
  13612. (this.$lines = new o(this.element));
  13613. };
  13614. (function () {
  13615. r.implement(this, u),
  13616. (this.EOF_CHAR = "\u00b6"),
  13617. (this.EOL_CHAR_LF = "\u00ac"),
  13618. (this.EOL_CHAR_CRLF = "\u00a4"),
  13619. (this.EOL_CHAR = this.EOL_CHAR_LF),
  13620. (this.TAB_CHAR = "\u2014"),
  13621. (this.SPACE_CHAR = "\u00b7"),
  13622. (this.$padding = 0),
  13623. (this.MAX_LINE_LENGTH = 1e4),
  13624. (this.$updateEolChar = function () {
  13625. var e = this.session.doc,
  13626. t =
  13627. e.getNewLineCharacter() == "\n" &&
  13628. e.getNewLineMode() != "windows",
  13629. n = t ? this.EOL_CHAR_LF : this.EOL_CHAR_CRLF;
  13630. if (this.EOL_CHAR != n) return (this.EOL_CHAR = n), !0;
  13631. }),
  13632. (this.setPadding = function (e) {
  13633. (this.$padding = e), (this.element.style.margin = "0 " + e + "px");
  13634. }),
  13635. (this.getLineHeight = function () {
  13636. return this.$fontMetrics.$characterSize.height || 0;
  13637. }),
  13638. (this.getCharacterWidth = function () {
  13639. return this.$fontMetrics.$characterSize.width || 0;
  13640. }),
  13641. (this.$setFontMetrics = function (e) {
  13642. (this.$fontMetrics = e),
  13643. this.$fontMetrics.on(
  13644. "changeCharacterSize",
  13645. function (e) {
  13646. this._signal("changeCharacterSize", e);
  13647. }.bind(this)
  13648. ),
  13649. this.$pollSizeChanges();
  13650. }),
  13651. (this.checkForSizeChanges = function () {
  13652. this.$fontMetrics.checkForSizeChanges();
  13653. }),
  13654. (this.$pollSizeChanges = function () {
  13655. return (this.$pollSizeChangesTimer =
  13656. this.$fontMetrics.$pollSizeChanges());
  13657. }),
  13658. (this.setSession = function (e) {
  13659. (this.session = e), e && this.$computeTabString();
  13660. }),
  13661. (this.showInvisibles = !1),
  13662. (this.setShowInvisibles = function (e) {
  13663. return this.showInvisibles == e
  13664. ? !1
  13665. : ((this.showInvisibles = e), this.$computeTabString(), !0);
  13666. }),
  13667. (this.displayIndentGuides = !0),
  13668. (this.setDisplayIndentGuides = function (e) {
  13669. return this.displayIndentGuides == e
  13670. ? !1
  13671. : ((this.displayIndentGuides = e), this.$computeTabString(), !0);
  13672. }),
  13673. (this.$tabStrings = []),
  13674. (this.onChangeTabSize = this.$computeTabString =
  13675. function () {
  13676. var e = this.session.getTabSize();
  13677. this.tabSize = e;
  13678. var t = (this.$tabStrings = [0]);
  13679. for (var n = 1; n < e + 1; n++)
  13680. if (this.showInvisibles) {
  13681. var r = this.dom.createElement("span");
  13682. (r.className = "ace_invisible ace_invisible_tab"),
  13683. (r.textContent = s.stringRepeat(this.TAB_CHAR, n)),
  13684. t.push(r);
  13685. } else
  13686. t.push(
  13687. this.dom.createTextNode(
  13688. s.stringRepeat(" ", n),
  13689. this.element
  13690. )
  13691. );
  13692. if (this.displayIndentGuides) {
  13693. this.$indentGuideRe = /\s\S| \t|\t |\s$/;
  13694. var i = "ace_indent-guide",
  13695. o = "",
  13696. u = "";
  13697. if (this.showInvisibles) {
  13698. (i += " ace_invisible"),
  13699. (o = " ace_invisible_space"),
  13700. (u = " ace_invisible_tab");
  13701. var a = s.stringRepeat(this.SPACE_CHAR, this.tabSize),
  13702. f = s.stringRepeat(this.TAB_CHAR, this.tabSize);
  13703. } else
  13704. var a = s.stringRepeat(" ", this.tabSize),
  13705. f = a;
  13706. var r = this.dom.createElement("span");
  13707. (r.className = i + o),
  13708. (r.textContent = a),
  13709. (this.$tabStrings[" "] = r);
  13710. var r = this.dom.createElement("span");
  13711. (r.className = i + u),
  13712. (r.textContent = f),
  13713. (this.$tabStrings[" "] = r);
  13714. }
  13715. }),
  13716. (this.updateLines = function (e, t, n) {
  13717. if (
  13718. this.config.lastRow != e.lastRow ||
  13719. this.config.firstRow != e.firstRow
  13720. )
  13721. return this.update(e);
  13722. this.config = e;
  13723. var r = Math.max(t, e.firstRow),
  13724. i = Math.min(n, e.lastRow),
  13725. s = this.element.childNodes,
  13726. o = 0;
  13727. for (var u = e.firstRow; u < r; u++) {
  13728. var a = this.session.getFoldLine(u);
  13729. if (a) {
  13730. if (a.containsRow(r)) {
  13731. r = a.start.row;
  13732. break;
  13733. }
  13734. u = a.end.row;
  13735. }
  13736. o++;
  13737. }
  13738. var f = !1,
  13739. u = r,
  13740. a = this.session.getNextFoldLine(u),
  13741. l = a ? a.start.row : Infinity;
  13742. for (;;) {
  13743. u > l &&
  13744. ((u = a.end.row + 1),
  13745. (a = this.session.getNextFoldLine(u, a)),
  13746. (l = a ? a.start.row : Infinity));
  13747. if (u > i) break;
  13748. var c = s[o++];
  13749. if (c) {
  13750. this.dom.removeChildren(c),
  13751. this.$renderLine(c, u, u == l ? a : !1);
  13752. var h = e.lineHeight * this.session.getRowLength(u) + "px";
  13753. c.style.height != h && ((f = !0), (c.style.height = h));
  13754. }
  13755. u++;
  13756. }
  13757. if (f)
  13758. while (o < this.$lines.cells.length) {
  13759. var p = this.$lines.cells[o++];
  13760. p.element.style.top =
  13761. this.$lines.computeLineTop(p.row, e, this.session) + "px";
  13762. }
  13763. }),
  13764. (this.scrollLines = function (e) {
  13765. var t = this.config;
  13766. this.config = e;
  13767. if (this.$lines.pageChanged(t, e)) return this.update(e);
  13768. this.$lines.moveContainer(e);
  13769. var n = e.lastRow,
  13770. r = t ? t.lastRow : -1;
  13771. if (!t || r < e.firstRow) return this.update(e);
  13772. if (n < t.firstRow) return this.update(e);
  13773. if (!t || t.lastRow < e.firstRow) return this.update(e);
  13774. if (e.lastRow < t.firstRow) return this.update(e);
  13775. if (t.firstRow < e.firstRow)
  13776. for (
  13777. var i = this.session.getFoldedRowCount(
  13778. t.firstRow,
  13779. e.firstRow - 1
  13780. );
  13781. i > 0;
  13782. i--
  13783. )
  13784. this.$lines.shift();
  13785. if (t.lastRow > e.lastRow)
  13786. for (
  13787. var i = this.session.getFoldedRowCount(
  13788. e.lastRow + 1,
  13789. t.lastRow
  13790. );
  13791. i > 0;
  13792. i--
  13793. )
  13794. this.$lines.pop();
  13795. e.firstRow < t.firstRow &&
  13796. this.$lines.unshift(
  13797. this.$renderLinesFragment(e, e.firstRow, t.firstRow - 1)
  13798. ),
  13799. e.lastRow > t.lastRow &&
  13800. this.$lines.push(
  13801. this.$renderLinesFragment(e, t.lastRow + 1, e.lastRow)
  13802. );
  13803. }),
  13804. (this.$renderLinesFragment = function (e, t, n) {
  13805. var r = [],
  13806. s = t,
  13807. o = this.session.getNextFoldLine(s),
  13808. u = o ? o.start.row : Infinity;
  13809. for (;;) {
  13810. s > u &&
  13811. ((s = o.end.row + 1),
  13812. (o = this.session.getNextFoldLine(s, o)),
  13813. (u = o ? o.start.row : Infinity));
  13814. if (s > n) break;
  13815. var a = this.$lines.createCell(s, e, this.session),
  13816. f = a.element;
  13817. this.dom.removeChildren(f),
  13818. i.setStyle(
  13819. f.style,
  13820. "height",
  13821. this.$lines.computeLineHeight(s, e, this.session) + "px"
  13822. ),
  13823. i.setStyle(
  13824. f.style,
  13825. "top",
  13826. this.$lines.computeLineTop(s, e, this.session) + "px"
  13827. ),
  13828. this.$renderLine(f, s, s == u ? o : !1),
  13829. this.$useLineGroups()
  13830. ? (f.className = "ace_line_group")
  13831. : (f.className = "ace_line"),
  13832. r.push(a),
  13833. s++;
  13834. }
  13835. return r;
  13836. }),
  13837. (this.update = function (e) {
  13838. this.$lines.moveContainer(e), (this.config = e);
  13839. var t = e.firstRow,
  13840. n = e.lastRow,
  13841. r = this.$lines;
  13842. while (r.getLength()) r.pop();
  13843. r.push(this.$renderLinesFragment(e, t, n));
  13844. }),
  13845. (this.$textToken = { text: !0, rparen: !0, lparen: !0 }),
  13846. (this.$renderToken = function (e, t, n, r) {
  13847. var o = this,
  13848. u =
  13849. /(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,
  13850. a = this.dom.createFragment(this.element),
  13851. f,
  13852. l = 0;
  13853. while ((f = u.exec(r))) {
  13854. var c = f[1],
  13855. h = f[2],
  13856. p = f[3],
  13857. d = f[4],
  13858. v = f[5];
  13859. if (!o.showInvisibles && h) continue;
  13860. var m = l != f.index ? r.slice(l, f.index) : "";
  13861. (l = f.index + f[0].length),
  13862. m && a.appendChild(this.dom.createTextNode(m, this.element));
  13863. if (c) {
  13864. var g = o.session.getScreenTabSize(t + f.index);
  13865. a.appendChild(o.$tabStrings[g].cloneNode(!0)), (t += g - 1);
  13866. } else if (h)
  13867. if (o.showInvisibles) {
  13868. var y = this.dom.createElement("span");
  13869. (y.className = "ace_invisible ace_invisible_space"),
  13870. (y.textContent = s.stringRepeat(o.SPACE_CHAR, h.length)),
  13871. a.appendChild(y);
  13872. } else a.appendChild(this.com.createTextNode(h, this.element));
  13873. else if (p) {
  13874. var y = this.dom.createElement("span");
  13875. (y.className = "ace_invisible ace_invisible_space ace_invalid"),
  13876. (y.textContent = s.stringRepeat(o.SPACE_CHAR, p.length)),
  13877. a.appendChild(y);
  13878. } else if (d) {
  13879. var b = o.showInvisibles ? o.SPACE_CHAR : "";
  13880. t += 1;
  13881. var y = this.dom.createElement("span");
  13882. (y.style.width = o.config.characterWidth * 2 + "px"),
  13883. (y.className = o.showInvisibles
  13884. ? "ace_cjk ace_invisible ace_invisible_space"
  13885. : "ace_cjk"),
  13886. (y.textContent = o.showInvisibles ? o.SPACE_CHAR : ""),
  13887. a.appendChild(y);
  13888. } else if (v) {
  13889. t += 1;
  13890. var y = i.createElement("span");
  13891. (y.style.width = o.config.characterWidth * 2 + "px"),
  13892. (y.className = "ace_cjk"),
  13893. (y.textContent = v),
  13894. a.appendChild(y);
  13895. }
  13896. }
  13897. a.appendChild(
  13898. this.dom.createTextNode(l ? r.slice(l) : r, this.element)
  13899. );
  13900. if (!this.$textToken[n.type]) {
  13901. var w = "ace_" + n.type.replace(/\./g, " ace_"),
  13902. y = this.dom.createElement("span");
  13903. n.type == "fold" &&
  13904. (y.style.width =
  13905. n.value.length * this.config.characterWidth + "px"),
  13906. (y.className = w),
  13907. y.appendChild(a),
  13908. e.appendChild(y);
  13909. } else e.appendChild(a);
  13910. return t + r.length;
  13911. }),
  13912. (this.renderIndentGuide = function (e, t, n) {
  13913. var r = t.search(this.$indentGuideRe);
  13914. if (r <= 0 || r >= n) return t;
  13915. if (t[0] == " ") {
  13916. r -= r % this.tabSize;
  13917. var i = r / this.tabSize;
  13918. for (var s = 0; s < i; s++)
  13919. e.appendChild(this.$tabStrings[" "].cloneNode(!0));
  13920. return t.substr(r);
  13921. }
  13922. if (t[0] == " ") {
  13923. for (var s = 0; s < r; s++)
  13924. e.appendChild(this.$tabStrings[" "].cloneNode(!0));
  13925. return t.substr(r);
  13926. }
  13927. return t;
  13928. }),
  13929. (this.$createLineElement = function (e) {
  13930. var t = this.dom.createElement("div");
  13931. return (
  13932. (t.className = "ace_line"),
  13933. (t.style.height = this.config.lineHeight + "px"),
  13934. t
  13935. );
  13936. }),
  13937. (this.$renderWrappedLine = function (e, t, n) {
  13938. var r = 0,
  13939. i = 0,
  13940. o = n[0],
  13941. u = 0,
  13942. a = this.$createLineElement();
  13943. e.appendChild(a);
  13944. for (var f = 0; f < t.length; f++) {
  13945. var l = t[f],
  13946. c = l.value;
  13947. if (f == 0 && this.displayIndentGuides) {
  13948. (r = c.length), (c = this.renderIndentGuide(a, c, o));
  13949. if (!c) continue;
  13950. r -= c.length;
  13951. }
  13952. if (r + c.length < o)
  13953. (u = this.$renderToken(a, u, l, c)), (r += c.length);
  13954. else {
  13955. while (r + c.length >= o)
  13956. (u = this.$renderToken(a, u, l, c.substring(0, o - r))),
  13957. (c = c.substring(o - r)),
  13958. (r = o),
  13959. (a = this.$createLineElement()),
  13960. e.appendChild(a),
  13961. a.appendChild(
  13962. this.dom.createTextNode(
  13963. s.stringRepeat("\u00a0", n.indent),
  13964. this.element
  13965. )
  13966. ),
  13967. i++,
  13968. (u = 0),
  13969. (o = n[i] || Number.MAX_VALUE);
  13970. c.length != 0 &&
  13971. ((r += c.length), (u = this.$renderToken(a, u, l, c)));
  13972. }
  13973. }
  13974. }),
  13975. (this.$renderSimpleLine = function (e, t) {
  13976. var n = 0,
  13977. r = t[0],
  13978. i = r.value;
  13979. this.displayIndentGuides && (i = this.renderIndentGuide(e, i)),
  13980. i && (n = this.$renderToken(e, n, r, i));
  13981. for (var s = 1; s < t.length; s++) {
  13982. (r = t[s]), (i = r.value);
  13983. if (n + i.length > this.MAX_LINE_LENGTH)
  13984. return this.$renderOverflowMessage(e, n, r, i);
  13985. n = this.$renderToken(e, n, r, i);
  13986. }
  13987. }),
  13988. (this.$renderOverflowMessage = function (e, t, n, r) {
  13989. this.$renderToken(e, t, n, r.slice(0, this.MAX_LINE_LENGTH - t));
  13990. var i = this.dom.createElement("span");
  13991. (i.className = "ace_inline_button ace_keyword ace_toggle_wrap"),
  13992. (i.style.position = "absolute"),
  13993. (i.style.right = "0"),
  13994. (i.textContent = "<click to see more...>"),
  13995. e.appendChild(i);
  13996. }),
  13997. (this.$renderLine = function (e, t, n) {
  13998. !n && n != 0 && (n = this.session.getFoldLine(t));
  13999. if (n) var r = this.$getFoldLineTokens(t, n);
  14000. else var r = this.session.getTokens(t);
  14001. var i = e;
  14002. if (r.length) {
  14003. var s = this.session.getRowSplitData(t);
  14004. if (s && s.length) {
  14005. this.$renderWrappedLine(e, r, s);
  14006. var i = e.lastChild;
  14007. } else {
  14008. var i = e;
  14009. this.$useLineGroups() &&
  14010. ((i = this.$createLineElement()), e.appendChild(i)),
  14011. this.$renderSimpleLine(i, r);
  14012. }
  14013. } else
  14014. this.$useLineGroups() &&
  14015. ((i = this.$createLineElement()), e.appendChild(i));
  14016. if (this.showInvisibles && i) {
  14017. n && (t = n.end.row);
  14018. var o = this.dom.createElement("span");
  14019. (o.className = "ace_invisible ace_invisible_eol"),
  14020. (o.textContent =
  14021. t == this.session.getLength() - 1
  14022. ? this.EOF_CHAR
  14023. : this.EOL_CHAR),
  14024. i.appendChild(o);
  14025. }
  14026. }),
  14027. (this.$getFoldLineTokens = function (e, t) {
  14028. function i(e, t, n) {
  14029. var i = 0,
  14030. s = 0;
  14031. while (s + e[i].value.length < t) {
  14032. (s += e[i].value.length), i++;
  14033. if (i == e.length) return;
  14034. }
  14035. if (s != t) {
  14036. var o = e[i].value.substring(t - s);
  14037. o.length > n - t && (o = o.substring(0, n - t)),
  14038. r.push({ type: e[i].type, value: o }),
  14039. (s = t + o.length),
  14040. (i += 1);
  14041. }
  14042. while (s < n && i < e.length) {
  14043. var o = e[i].value;
  14044. o.length + s > n
  14045. ? r.push({ type: e[i].type, value: o.substring(0, n - s) })
  14046. : r.push(e[i]),
  14047. (s += o.length),
  14048. (i += 1);
  14049. }
  14050. }
  14051. var n = this.session,
  14052. r = [],
  14053. s = n.getTokens(e);
  14054. return (
  14055. t.walk(
  14056. function (e, t, o, u, a) {
  14057. e != null
  14058. ? r.push({ type: "fold", value: e })
  14059. : (a && (s = n.getTokens(t)), s.length && i(s, u, o));
  14060. },
  14061. t.end.row,
  14062. this.session.getLine(t.end.row).length
  14063. ),
  14064. r
  14065. );
  14066. }),
  14067. (this.$useLineGroups = function () {
  14068. return this.session.getUseWrapMode();
  14069. }),
  14070. (this.destroy = function () {});
  14071. }).call(a.prototype),
  14072. (t.Text = a);
  14073. }
  14074. ),
  14075. define(
  14076. "ace/layer/cursor",
  14077. ["require", "exports", "module", "ace/lib/dom"],
  14078. function (e, t, n) {
  14079. "use strict";
  14080. var r = e("../lib/dom"),
  14081. i = function (e) {
  14082. (this.element = r.createElement("div")),
  14083. (this.element.className = "ace_layer ace_cursor-layer"),
  14084. e.appendChild(this.element),
  14085. (this.isVisible = !1),
  14086. (this.isBlinking = !0),
  14087. (this.blinkInterval = 1e3),
  14088. (this.smoothBlinking = !1),
  14089. (this.cursors = []),
  14090. (this.cursor = this.addCursor()),
  14091. r.addCssClass(this.element, "ace_hidden-cursors"),
  14092. (this.$updateCursors = this.$updateOpacity.bind(this));
  14093. };
  14094. (function () {
  14095. (this.$updateOpacity = function (e) {
  14096. var t = this.cursors;
  14097. for (var n = t.length; n--; )
  14098. r.setStyle(t[n].style, "opacity", e ? "" : "0");
  14099. }),
  14100. (this.$startCssAnimation = function () {
  14101. var e = this.cursors;
  14102. for (var t = e.length; t--; )
  14103. e[t].style.animationDuration = this.blinkInterval + "ms";
  14104. setTimeout(
  14105. function () {
  14106. r.addCssClass(this.element, "ace_animate-blinking");
  14107. }.bind(this)
  14108. );
  14109. }),
  14110. (this.$stopCssAnimation = function () {
  14111. r.removeCssClass(this.element, "ace_animate-blinking");
  14112. }),
  14113. (this.$padding = 0),
  14114. (this.setPadding = function (e) {
  14115. this.$padding = e;
  14116. }),
  14117. (this.setSession = function (e) {
  14118. this.session = e;
  14119. }),
  14120. (this.setBlinking = function (e) {
  14121. e != this.isBlinking &&
  14122. ((this.isBlinking = e), this.restartTimer());
  14123. }),
  14124. (this.setBlinkInterval = function (e) {
  14125. e != this.blinkInterval &&
  14126. ((this.blinkInterval = e), this.restartTimer());
  14127. }),
  14128. (this.setSmoothBlinking = function (e) {
  14129. e != this.smoothBlinking &&
  14130. ((this.smoothBlinking = e),
  14131. r.setCssClass(this.element, "ace_smooth-blinking", e),
  14132. this.$updateCursors(!0),
  14133. this.restartTimer());
  14134. }),
  14135. (this.addCursor = function () {
  14136. var e = r.createElement("div");
  14137. return (
  14138. (e.className = "ace_cursor"),
  14139. this.element.appendChild(e),
  14140. this.cursors.push(e),
  14141. e
  14142. );
  14143. }),
  14144. (this.removeCursor = function () {
  14145. if (this.cursors.length > 1) {
  14146. var e = this.cursors.pop();
  14147. return e.parentNode.removeChild(e), e;
  14148. }
  14149. }),
  14150. (this.hideCursor = function () {
  14151. (this.isVisible = !1),
  14152. r.addCssClass(this.element, "ace_hidden-cursors"),
  14153. this.restartTimer();
  14154. }),
  14155. (this.showCursor = function () {
  14156. (this.isVisible = !0),
  14157. r.removeCssClass(this.element, "ace_hidden-cursors"),
  14158. this.restartTimer();
  14159. }),
  14160. (this.restartTimer = function () {
  14161. var e = this.$updateCursors;
  14162. clearInterval(this.intervalId),
  14163. clearTimeout(this.timeoutId),
  14164. this.$stopCssAnimation(),
  14165. this.smoothBlinking &&
  14166. r.removeCssClass(this.element, "ace_smooth-blinking"),
  14167. e(!0);
  14168. if (!this.isBlinking || !this.blinkInterval || !this.isVisible) {
  14169. this.$stopCssAnimation();
  14170. return;
  14171. }
  14172. this.smoothBlinking &&
  14173. setTimeout(
  14174. function () {
  14175. r.addCssClass(this.element, "ace_smooth-blinking");
  14176. }.bind(this)
  14177. );
  14178. if (r.HAS_CSS_ANIMATION) this.$startCssAnimation();
  14179. else {
  14180. var t = function () {
  14181. this.timeoutId = setTimeout(function () {
  14182. e(!1);
  14183. }, 0.6 * this.blinkInterval);
  14184. }.bind(this);
  14185. (this.intervalId = setInterval(function () {
  14186. e(!0), t();
  14187. }, this.blinkInterval)),
  14188. t();
  14189. }
  14190. }),
  14191. (this.getPixelPosition = function (e, t) {
  14192. if (!this.config || !this.session) return { left: 0, top: 0 };
  14193. e || (e = this.session.selection.getCursor());
  14194. var n = this.session.documentToScreenPosition(e),
  14195. r =
  14196. this.$padding +
  14197. (this.session.$bidiHandler.isBidiRow(n.row, e.row)
  14198. ? this.session.$bidiHandler.getPosLeft(n.column)
  14199. : n.column * this.config.characterWidth),
  14200. i =
  14201. (n.row - (t ? this.config.firstRowScreen : 0)) *
  14202. this.config.lineHeight;
  14203. return { left: r, top: i };
  14204. }),
  14205. (this.isCursorInView = function (e, t) {
  14206. return e.top >= 0 && e.top < t.maxHeight;
  14207. }),
  14208. (this.update = function (e) {
  14209. this.config = e;
  14210. var t = this.session.$selectionMarkers,
  14211. n = 0,
  14212. i = 0;
  14213. if (t === undefined || t.length === 0) t = [{ cursor: null }];
  14214. for (var n = 0, s = t.length; n < s; n++) {
  14215. var o = this.getPixelPosition(t[n].cursor, !0);
  14216. if ((o.top > e.height + e.offset || o.top < 0) && n > 1) continue;
  14217. var u = this.cursors[i++] || this.addCursor(),
  14218. a = u.style;
  14219. this.drawCursor
  14220. ? this.drawCursor(u, o, e, t[n], this.session)
  14221. : this.isCursorInView(o, e)
  14222. ? (r.setStyle(a, "display", "block"),
  14223. r.translate(u, o.left, o.top),
  14224. r.setStyle(a, "width", Math.round(e.characterWidth) + "px"),
  14225. r.setStyle(a, "height", e.lineHeight + "px"))
  14226. : r.setStyle(a, "display", "none");
  14227. }
  14228. while (this.cursors.length > i) this.removeCursor();
  14229. var f = this.session.getOverwrite();
  14230. this.$setOverwrite(f), (this.$pixelPos = o), this.restartTimer();
  14231. }),
  14232. (this.drawCursor = null),
  14233. (this.$setOverwrite = function (e) {
  14234. e != this.overwrite &&
  14235. ((this.overwrite = e),
  14236. e
  14237. ? r.addCssClass(this.element, "ace_overwrite-cursors")
  14238. : r.removeCssClass(this.element, "ace_overwrite-cursors"));
  14239. }),
  14240. (this.destroy = function () {
  14241. clearInterval(this.intervalId), clearTimeout(this.timeoutId);
  14242. });
  14243. }).call(i.prototype),
  14244. (t.Cursor = i);
  14245. }
  14246. ),
  14247. define(
  14248. "ace/scrollbar",
  14249. [
  14250. "require",
  14251. "exports",
  14252. "module",
  14253. "ace/lib/oop",
  14254. "ace/lib/dom",
  14255. "ace/lib/event",
  14256. "ace/lib/event_emitter",
  14257. ],
  14258. function (e, t, n) {
  14259. "use strict";
  14260. var r = e("./lib/oop"),
  14261. i = e("./lib/dom"),
  14262. s = e("./lib/event"),
  14263. o = e("./lib/event_emitter").EventEmitter,
  14264. u = 32768,
  14265. a = function (e) {
  14266. (this.element = i.createElement("div")),
  14267. (this.element.className =
  14268. "ace_scrollbar ace_scrollbar" + this.classSuffix),
  14269. (this.inner = i.createElement("div")),
  14270. (this.inner.className = "ace_scrollbar-inner"),
  14271. this.element.appendChild(this.inner),
  14272. e.appendChild(this.element),
  14273. this.setVisible(!1),
  14274. (this.skipEvent = !1),
  14275. s.addListener(this.element, "scroll", this.onScroll.bind(this)),
  14276. s.addListener(this.element, "mousedown", s.preventDefault);
  14277. };
  14278. (function () {
  14279. r.implement(this, o),
  14280. (this.setVisible = function (e) {
  14281. (this.element.style.display = e ? "" : "none"),
  14282. (this.isVisible = e),
  14283. (this.coeff = 1);
  14284. });
  14285. }).call(a.prototype);
  14286. var f = function (e, t) {
  14287. a.call(this, e),
  14288. (this.scrollTop = 0),
  14289. (this.scrollHeight = 0),
  14290. (t.$scrollbarWidth = this.width = i.scrollbarWidth(e.ownerDocument)),
  14291. (this.inner.style.width = this.element.style.width =
  14292. (this.width || 15) + 5 + "px"),
  14293. (this.$minWidth = 0);
  14294. };
  14295. r.inherits(f, a),
  14296. function () {
  14297. (this.classSuffix = "-v"),
  14298. (this.onScroll = function () {
  14299. if (!this.skipEvent) {
  14300. this.scrollTop = this.element.scrollTop;
  14301. if (this.coeff != 1) {
  14302. var e = this.element.clientHeight / this.scrollHeight;
  14303. this.scrollTop =
  14304. (this.scrollTop * (1 - e)) / (this.coeff - e);
  14305. }
  14306. this._emit("scroll", { data: this.scrollTop });
  14307. }
  14308. this.skipEvent = !1;
  14309. }),
  14310. (this.getWidth = function () {
  14311. return Math.max(
  14312. this.isVisible ? this.width : 0,
  14313. this.$minWidth || 0
  14314. );
  14315. }),
  14316. (this.setHeight = function (e) {
  14317. this.element.style.height = e + "px";
  14318. }),
  14319. (this.setInnerHeight = this.setScrollHeight =
  14320. function (e) {
  14321. (this.scrollHeight = e),
  14322. e > u
  14323. ? ((this.coeff = u / e), (e = u))
  14324. : this.coeff != 1 && (this.coeff = 1),
  14325. (this.inner.style.height = e + "px");
  14326. }),
  14327. (this.setScrollTop = function (e) {
  14328. this.scrollTop != e &&
  14329. ((this.skipEvent = !0),
  14330. (this.scrollTop = e),
  14331. (this.element.scrollTop = e * this.coeff));
  14332. });
  14333. }.call(f.prototype);
  14334. var l = function (e, t) {
  14335. a.call(this, e),
  14336. (this.scrollLeft = 0),
  14337. (this.height = t.$scrollbarWidth),
  14338. (this.inner.style.height = this.element.style.height =
  14339. (this.height || 15) + 5 + "px");
  14340. };
  14341. r.inherits(l, a),
  14342. function () {
  14343. (this.classSuffix = "-h"),
  14344. (this.onScroll = function () {
  14345. this.skipEvent ||
  14346. ((this.scrollLeft = this.element.scrollLeft),
  14347. this._emit("scroll", { data: this.scrollLeft })),
  14348. (this.skipEvent = !1);
  14349. }),
  14350. (this.getHeight = function () {
  14351. return this.isVisible ? this.height : 0;
  14352. }),
  14353. (this.setWidth = function (e) {
  14354. this.element.style.width = e + "px";
  14355. }),
  14356. (this.setInnerWidth = function (e) {
  14357. this.inner.style.width = e + "px";
  14358. }),
  14359. (this.setScrollWidth = function (e) {
  14360. this.inner.style.width = e + "px";
  14361. }),
  14362. (this.setScrollLeft = function (e) {
  14363. this.scrollLeft != e &&
  14364. ((this.skipEvent = !0),
  14365. (this.scrollLeft = this.element.scrollLeft = e));
  14366. });
  14367. }.call(l.prototype),
  14368. (t.ScrollBar = f),
  14369. (t.ScrollBarV = f),
  14370. (t.ScrollBarH = l),
  14371. (t.VScrollBar = f),
  14372. (t.HScrollBar = l);
  14373. }
  14374. ),
  14375. define(
  14376. "ace/renderloop",
  14377. ["require", "exports", "module", "ace/lib/event"],
  14378. function (e, t, n) {
  14379. "use strict";
  14380. var r = e("./lib/event"),
  14381. i = function (e, t) {
  14382. (this.onRender = e),
  14383. (this.pending = !1),
  14384. (this.changes = 0),
  14385. (this.$recursionLimit = 2),
  14386. (this.window = t || window);
  14387. var n = this;
  14388. this._flush = function (e) {
  14389. n.pending = !1;
  14390. var t = n.changes;
  14391. t && (r.blockIdle(100), (n.changes = 0), n.onRender(t));
  14392. if (n.changes) {
  14393. if (n.$recursionLimit-- < 0) return;
  14394. n.schedule();
  14395. } else n.$recursionLimit = 2;
  14396. };
  14397. };
  14398. (function () {
  14399. (this.schedule = function (e) {
  14400. (this.changes = this.changes | e),
  14401. this.changes &&
  14402. !this.pending &&
  14403. (r.nextFrame(this._flush), (this.pending = !0));
  14404. }),
  14405. (this.clear = function (e) {
  14406. var t = this.changes;
  14407. return (this.changes = 0), t;
  14408. });
  14409. }).call(i.prototype),
  14410. (t.RenderLoop = i);
  14411. }
  14412. ),
  14413. define(
  14414. "ace/layer/font_metrics",
  14415. [
  14416. "require",
  14417. "exports",
  14418. "module",
  14419. "ace/lib/oop",
  14420. "ace/lib/dom",
  14421. "ace/lib/lang",
  14422. "ace/lib/event",
  14423. "ace/lib/useragent",
  14424. "ace/lib/event_emitter",
  14425. ],
  14426. function (e, t, n) {
  14427. var r = e("../lib/oop"),
  14428. i = e("../lib/dom"),
  14429. s = e("../lib/lang"),
  14430. o = e("../lib/event"),
  14431. u = e("../lib/useragent"),
  14432. a = e("../lib/event_emitter").EventEmitter,
  14433. f = 256,
  14434. l = typeof ResizeObserver == "function",
  14435. c = 200,
  14436. h = (t.FontMetrics = function (e) {
  14437. (this.el = i.createElement("div")),
  14438. this.$setMeasureNodeStyles(this.el.style, !0),
  14439. (this.$main = i.createElement("div")),
  14440. this.$setMeasureNodeStyles(this.$main.style),
  14441. (this.$measureNode = i.createElement("div")),
  14442. this.$setMeasureNodeStyles(this.$measureNode.style),
  14443. this.el.appendChild(this.$main),
  14444. this.el.appendChild(this.$measureNode),
  14445. e.appendChild(this.el),
  14446. (this.$measureNode.innerHTML = s.stringRepeat("X", f)),
  14447. (this.$characterSize = { width: 0, height: 0 }),
  14448. l ? this.$addObserver() : this.checkForSizeChanges();
  14449. });
  14450. (function () {
  14451. r.implement(this, a),
  14452. (this.$characterSize = { width: 0, height: 0 }),
  14453. (this.$setMeasureNodeStyles = function (e, t) {
  14454. (e.width = e.height = "auto"),
  14455. (e.left = e.top = "0px"),
  14456. (e.visibility = "hidden"),
  14457. (e.position = "absolute"),
  14458. (e.whiteSpace = "pre"),
  14459. u.isIE < 8
  14460. ? (e["font-family"] = "inherit")
  14461. : (e.font = "inherit"),
  14462. (e.overflow = t ? "hidden" : "visible");
  14463. }),
  14464. (this.checkForSizeChanges = function (e) {
  14465. e === undefined && (e = this.$measureSizes());
  14466. if (
  14467. e &&
  14468. (this.$characterSize.width !== e.width ||
  14469. this.$characterSize.height !== e.height)
  14470. ) {
  14471. this.$measureNode.style.fontWeight = "bold";
  14472. var t = this.$measureSizes();
  14473. (this.$measureNode.style.fontWeight = ""),
  14474. (this.$characterSize = e),
  14475. (this.charSizes = Object.create(null)),
  14476. (this.allowBoldFonts =
  14477. t && t.width === e.width && t.height === e.height),
  14478. this._emit("changeCharacterSize", { data: e });
  14479. }
  14480. }),
  14481. (this.$addObserver = function () {
  14482. var e = this;
  14483. (this.$observer = new window.ResizeObserver(function (t) {
  14484. var n = t[0].contentRect;
  14485. e.checkForSizeChanges({ height: n.height, width: n.width / f });
  14486. })),
  14487. this.$observer.observe(this.$measureNode);
  14488. }),
  14489. (this.$pollSizeChanges = function () {
  14490. if (this.$pollSizeChangesTimer || this.$observer)
  14491. return this.$pollSizeChangesTimer;
  14492. var e = this;
  14493. return (this.$pollSizeChangesTimer = o.onIdle(function t() {
  14494. e.checkForSizeChanges(), o.onIdle(t, 500);
  14495. }, 500));
  14496. }),
  14497. (this.setPolling = function (e) {
  14498. e
  14499. ? this.$pollSizeChanges()
  14500. : this.$pollSizeChangesTimer &&
  14501. (clearInterval(this.$pollSizeChangesTimer),
  14502. (this.$pollSizeChangesTimer = 0));
  14503. }),
  14504. (this.$measureSizes = function (e) {
  14505. var t = {
  14506. height: (e || this.$measureNode).clientHeight,
  14507. width: (e || this.$measureNode).clientWidth / f,
  14508. };
  14509. return t.width === 0 || t.height === 0 ? null : t;
  14510. }),
  14511. (this.$measureCharWidth = function (e) {
  14512. this.$main.innerHTML = s.stringRepeat(e, f);
  14513. var t = this.$main.getBoundingClientRect();
  14514. return t.width / f;
  14515. }),
  14516. (this.getCharacterWidth = function (e) {
  14517. var t = this.charSizes[e];
  14518. return (
  14519. t === undefined &&
  14520. (t = this.charSizes[e] =
  14521. this.$measureCharWidth(e) / this.$characterSize.width),
  14522. t
  14523. );
  14524. }),
  14525. (this.destroy = function () {
  14526. clearInterval(this.$pollSizeChangesTimer),
  14527. this.$observer && this.$observer.disconnect(),
  14528. this.el &&
  14529. this.el.parentNode &&
  14530. this.el.parentNode.removeChild(this.el);
  14531. }),
  14532. (this.$getZoom = function e(t) {
  14533. return t
  14534. ? (window.getComputedStyle(t).zoom || 1) * e(t.parentElement)
  14535. : 1;
  14536. }),
  14537. (this.$initTransformMeasureNodes = function () {
  14538. var e = function (e, t) {
  14539. return [
  14540. "div",
  14541. {
  14542. style: "position: absolute;top:" + e + "px;left:" + t + "px;",
  14543. },
  14544. ];
  14545. };
  14546. this.els = i.buildDom(
  14547. [e(0, 0), e(c, 0), e(0, c), e(c, c)],
  14548. this.el
  14549. );
  14550. }),
  14551. (this.transformCoordinates = function (e, t) {
  14552. function r(e, t, n) {
  14553. var r = e[1] * t[0] - e[0] * t[1];
  14554. return [
  14555. (-t[1] * n[0] + t[0] * n[1]) / r,
  14556. (+e[1] * n[0] - e[0] * n[1]) / r,
  14557. ];
  14558. }
  14559. function i(e, t) {
  14560. return [e[0] - t[0], e[1] - t[1]];
  14561. }
  14562. function s(e, t) {
  14563. return [e[0] + t[0], e[1] + t[1]];
  14564. }
  14565. function o(e, t) {
  14566. return [e * t[0], e * t[1]];
  14567. }
  14568. function u(e) {
  14569. var t = e.getBoundingClientRect();
  14570. return [t.left, t.top];
  14571. }
  14572. if (e) {
  14573. var n = this.$getZoom(this.el);
  14574. e = o(1 / n, e);
  14575. }
  14576. this.els || this.$initTransformMeasureNodes();
  14577. var a = u(this.els[0]),
  14578. f = u(this.els[1]),
  14579. l = u(this.els[2]),
  14580. h = u(this.els[3]),
  14581. p = r(i(h, f), i(h, l), i(s(f, l), s(h, a))),
  14582. d = o(1 + p[0], i(f, a)),
  14583. v = o(1 + p[1], i(l, a));
  14584. if (t) {
  14585. var m = t,
  14586. g = (p[0] * m[0]) / c + (p[1] * m[1]) / c + 1,
  14587. y = s(o(m[0], d), o(m[1], v));
  14588. return s(o(1 / g / c, y), a);
  14589. }
  14590. var b = i(e, a),
  14591. w = r(i(d, o(p[0], b)), i(v, o(p[1], b)), b);
  14592. return o(c, w);
  14593. });
  14594. }).call(h.prototype);
  14595. }
  14596. ),
  14597. define(
  14598. "ace/virtual_renderer",
  14599. [
  14600. "require",
  14601. "exports",
  14602. "module",
  14603. "ace/lib/oop",
  14604. "ace/lib/dom",
  14605. "ace/config",
  14606. "ace/layer/gutter",
  14607. "ace/layer/marker",
  14608. "ace/layer/text",
  14609. "ace/layer/cursor",
  14610. "ace/scrollbar",
  14611. "ace/scrollbar",
  14612. "ace/renderloop",
  14613. "ace/layer/font_metrics",
  14614. "ace/lib/event_emitter",
  14615. "ace/lib/useragent",
  14616. ],
  14617. function (e, t, n) {
  14618. "use strict";
  14619. var r = e("./lib/oop"),
  14620. i = e("./lib/dom"),
  14621. s = e("./config"),
  14622. o = e("./layer/gutter").Gutter,
  14623. u = e("./layer/marker").Marker,
  14624. a = e("./layer/text").Text,
  14625. f = e("./layer/cursor").Cursor,
  14626. l = e("./scrollbar").HScrollBar,
  14627. c = e("./scrollbar").VScrollBar,
  14628. h = e("./renderloop").RenderLoop,
  14629. p = e("./layer/font_metrics").FontMetrics,
  14630. d = e("./lib/event_emitter").EventEmitter,
  14631. v =
  14632. '.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}',
  14633. m = e("./lib/useragent"),
  14634. g = m.isIE;
  14635. i.importCssString(v, "ace_editor.css");
  14636. var y = function (e, t) {
  14637. var n = this;
  14638. (this.container = e || i.createElement("div")),
  14639. i.addCssClass(this.container, "ace_editor"),
  14640. i.HI_DPI && i.addCssClass(this.container, "ace_hidpi"),
  14641. this.setTheme(t),
  14642. (this.$gutter = i.createElement("div")),
  14643. (this.$gutter.className = "ace_gutter"),
  14644. this.container.appendChild(this.$gutter),
  14645. this.$gutter.setAttribute("aria-hidden", !0),
  14646. (this.scroller = i.createElement("div")),
  14647. (this.scroller.className = "ace_scroller"),
  14648. this.container.appendChild(this.scroller),
  14649. (this.content = i.createElement("div")),
  14650. (this.content.className = "ace_content"),
  14651. this.scroller.appendChild(this.content),
  14652. (this.$gutterLayer = new o(this.$gutter)),
  14653. this.$gutterLayer.on(
  14654. "changeGutterWidth",
  14655. this.onGutterResize.bind(this)
  14656. ),
  14657. (this.$markerBack = new u(this.content));
  14658. var r = (this.$textLayer = new a(this.content));
  14659. (this.canvas = r.element),
  14660. (this.$markerFront = new u(this.content)),
  14661. (this.$cursorLayer = new f(this.content)),
  14662. (this.$horizScroll = !1),
  14663. (this.$vScroll = !1),
  14664. (this.scrollBar = this.scrollBarV = new c(this.container, this)),
  14665. (this.scrollBarH = new l(this.container, this)),
  14666. this.scrollBarV.addEventListener("scroll", function (e) {
  14667. n.$scrollAnimation ||
  14668. n.session.setScrollTop(e.data - n.scrollMargin.top);
  14669. }),
  14670. this.scrollBarH.addEventListener("scroll", function (e) {
  14671. n.$scrollAnimation ||
  14672. n.session.setScrollLeft(e.data - n.scrollMargin.left);
  14673. }),
  14674. (this.scrollTop = 0),
  14675. (this.scrollLeft = 0),
  14676. (this.cursorPos = { row: 0, column: 0 }),
  14677. (this.$fontMetrics = new p(this.container)),
  14678. this.$textLayer.$setFontMetrics(this.$fontMetrics),
  14679. this.$textLayer.addEventListener("changeCharacterSize", function (e) {
  14680. n.updateCharacterSize(),
  14681. n.onResize(!0, n.gutterWidth, n.$size.width, n.$size.height),
  14682. n._signal("changeCharacterSize", e);
  14683. }),
  14684. (this.$size = {
  14685. width: 0,
  14686. height: 0,
  14687. scrollerHeight: 0,
  14688. scrollerWidth: 0,
  14689. $dirty: !0,
  14690. }),
  14691. (this.layerConfig = {
  14692. width: 1,
  14693. padding: 0,
  14694. firstRow: 0,
  14695. firstRowScreen: 0,
  14696. lastRow: 0,
  14697. lineHeight: 0,
  14698. characterWidth: 0,
  14699. minHeight: 1,
  14700. maxHeight: 1,
  14701. offset: 0,
  14702. height: 1,
  14703. gutterOffset: 1,
  14704. }),
  14705. (this.scrollMargin = {
  14706. left: 0,
  14707. right: 0,
  14708. top: 0,
  14709. bottom: 0,
  14710. v: 0,
  14711. h: 0,
  14712. }),
  14713. (this.margin = { left: 0, right: 0, top: 0, bottom: 0, v: 0, h: 0 }),
  14714. (this.$keepTextAreaAtCursor = !m.isIOS),
  14715. (this.$loop = new h(
  14716. this.$renderChanges.bind(this),
  14717. this.container.ownerDocument.defaultView
  14718. )),
  14719. this.$loop.schedule(this.CHANGE_FULL),
  14720. this.updateCharacterSize(),
  14721. this.setPadding(4),
  14722. s.resetOptions(this),
  14723. s._emit("renderer", this);
  14724. };
  14725. (function () {
  14726. (this.CHANGE_CURSOR = 1),
  14727. (this.CHANGE_MARKER = 2),
  14728. (this.CHANGE_GUTTER = 4),
  14729. (this.CHANGE_SCROLL = 8),
  14730. (this.CHANGE_LINES = 16),
  14731. (this.CHANGE_TEXT = 32),
  14732. (this.CHANGE_SIZE = 64),
  14733. (this.CHANGE_MARKER_BACK = 128),
  14734. (this.CHANGE_MARKER_FRONT = 256),
  14735. (this.CHANGE_FULL = 512),
  14736. (this.CHANGE_H_SCROLL = 1024),
  14737. r.implement(this, d),
  14738. (this.updateCharacterSize = function () {
  14739. this.$textLayer.allowBoldFonts != this.$allowBoldFonts &&
  14740. ((this.$allowBoldFonts = this.$textLayer.allowBoldFonts),
  14741. this.setStyle("ace_nobold", !this.$allowBoldFonts)),
  14742. (this.layerConfig.characterWidth = this.characterWidth =
  14743. this.$textLayer.getCharacterWidth()),
  14744. (this.layerConfig.lineHeight = this.lineHeight =
  14745. this.$textLayer.getLineHeight()),
  14746. this.$updatePrintMargin();
  14747. }),
  14748. (this.setSession = function (e) {
  14749. this.session &&
  14750. this.session.doc.off(
  14751. "changeNewLineMode",
  14752. this.onChangeNewLineMode
  14753. ),
  14754. (this.session = e),
  14755. e &&
  14756. this.scrollMargin.top &&
  14757. e.getScrollTop() <= 0 &&
  14758. e.setScrollTop(-this.scrollMargin.top),
  14759. this.$cursorLayer.setSession(e),
  14760. this.$markerBack.setSession(e),
  14761. this.$markerFront.setSession(e),
  14762. this.$gutterLayer.setSession(e),
  14763. this.$textLayer.setSession(e);
  14764. if (!e) return;
  14765. this.$loop.schedule(this.CHANGE_FULL),
  14766. this.session.$setFontMetrics(this.$fontMetrics),
  14767. (this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null),
  14768. (this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this)),
  14769. this.onChangeNewLineMode(),
  14770. this.session.doc.on(
  14771. "changeNewLineMode",
  14772. this.onChangeNewLineMode
  14773. );
  14774. }),
  14775. (this.updateLines = function (e, t, n) {
  14776. t === undefined && (t = Infinity),
  14777. this.$changedLines
  14778. ? (this.$changedLines.firstRow > e &&
  14779. (this.$changedLines.firstRow = e),
  14780. this.$changedLines.lastRow < t &&
  14781. (this.$changedLines.lastRow = t))
  14782. : (this.$changedLines = { firstRow: e, lastRow: t });
  14783. if (this.$changedLines.lastRow < this.layerConfig.firstRow) {
  14784. if (!n) return;
  14785. this.$changedLines.lastRow = this.layerConfig.lastRow;
  14786. }
  14787. if (this.$changedLines.firstRow > this.layerConfig.lastRow) return;
  14788. this.$loop.schedule(this.CHANGE_LINES);
  14789. }),
  14790. (this.onChangeNewLineMode = function () {
  14791. this.$loop.schedule(this.CHANGE_TEXT),
  14792. this.$textLayer.$updateEolChar(),
  14793. this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR);
  14794. }),
  14795. (this.onChangeTabSize = function () {
  14796. this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER),
  14797. this.$textLayer.onChangeTabSize();
  14798. }),
  14799. (this.updateText = function () {
  14800. this.$loop.schedule(this.CHANGE_TEXT);
  14801. }),
  14802. (this.updateFull = function (e) {
  14803. e
  14804. ? this.$renderChanges(this.CHANGE_FULL, !0)
  14805. : this.$loop.schedule(this.CHANGE_FULL);
  14806. }),
  14807. (this.updateFontSize = function () {
  14808. this.$textLayer.checkForSizeChanges();
  14809. }),
  14810. (this.$changes = 0),
  14811. (this.$updateSizeAsync = function () {
  14812. this.$loop.pending ? (this.$size.$dirty = !0) : this.onResize();
  14813. }),
  14814. (this.onResize = function (e, t, n, r) {
  14815. if (this.resizing > 2) return;
  14816. this.resizing > 0 ? this.resizing++ : (this.resizing = e ? 1 : 0);
  14817. var i = this.container;
  14818. r || (r = i.clientHeight || i.scrollHeight),
  14819. n || (n = i.clientWidth || i.scrollWidth);
  14820. var s = this.$updateCachedSize(e, t, n, r);
  14821. if (!this.$size.scrollerHeight || (!n && !r))
  14822. return (this.resizing = 0);
  14823. e && (this.$gutterLayer.$padding = null),
  14824. e
  14825. ? this.$renderChanges(s | this.$changes, !0)
  14826. : this.$loop.schedule(s | this.$changes),
  14827. this.resizing && (this.resizing = 0),
  14828. (this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null);
  14829. }),
  14830. (this.$updateCachedSize = function (e, t, n, r) {
  14831. r -= this.$extraHeight || 0;
  14832. var s = 0,
  14833. o = this.$size,
  14834. u = {
  14835. width: o.width,
  14836. height: o.height,
  14837. scrollerHeight: o.scrollerHeight,
  14838. scrollerWidth: o.scrollerWidth,
  14839. };
  14840. r &&
  14841. (e || o.height != r) &&
  14842. ((o.height = r),
  14843. (s |= this.CHANGE_SIZE),
  14844. (o.scrollerHeight = o.height),
  14845. this.$horizScroll &&
  14846. (o.scrollerHeight -= this.scrollBarH.getHeight()),
  14847. (this.scrollBarV.element.style.bottom =
  14848. this.scrollBarH.getHeight() + "px"),
  14849. (s |= this.CHANGE_SCROLL));
  14850. if (n && (e || o.width != n)) {
  14851. (s |= this.CHANGE_SIZE),
  14852. (o.width = n),
  14853. t == null &&
  14854. (t = this.$showGutter ? this.$gutter.offsetWidth : 0),
  14855. (this.gutterWidth = t),
  14856. i.setStyle(this.scrollBarH.element.style, "left", t + "px"),
  14857. i.setStyle(
  14858. this.scroller.style,
  14859. "left",
  14860. t + this.margin.left + "px"
  14861. ),
  14862. (o.scrollerWidth = Math.max(
  14863. 0,
  14864. n - t - this.scrollBarV.getWidth() - this.margin.h
  14865. )),
  14866. i.setStyle(this.$gutter.style, "left", this.margin.left + "px");
  14867. var a = this.scrollBarV.getWidth() + "px";
  14868. i.setStyle(this.scrollBarH.element.style, "right", a),
  14869. i.setStyle(this.scroller.style, "right", a),
  14870. i.setStyle(
  14871. this.scroller.style,
  14872. "bottom",
  14873. this.scrollBarH.getHeight()
  14874. );
  14875. if (
  14876. (this.session &&
  14877. this.session.getUseWrapMode() &&
  14878. this.adjustWrapLimit()) ||
  14879. e
  14880. )
  14881. s |= this.CHANGE_FULL;
  14882. }
  14883. return (o.$dirty = !n || !r), s && this._signal("resize", u), s;
  14884. }),
  14885. (this.onGutterResize = function (e) {
  14886. var t = this.$showGutter ? e : 0;
  14887. t != this.gutterWidth &&
  14888. (this.$changes |= this.$updateCachedSize(
  14889. !0,
  14890. t,
  14891. this.$size.width,
  14892. this.$size.height
  14893. )),
  14894. this.session.getUseWrapMode() && this.adjustWrapLimit()
  14895. ? this.$loop.schedule(this.CHANGE_FULL)
  14896. : this.$size.$dirty
  14897. ? this.$loop.schedule(this.CHANGE_FULL)
  14898. : this.$computeLayerConfig();
  14899. }),
  14900. (this.adjustWrapLimit = function () {
  14901. var e = this.$size.scrollerWidth - this.$padding * 2,
  14902. t = Math.floor(e / this.characterWidth);
  14903. return this.session.adjustWrapLimit(
  14904. t,
  14905. this.$showPrintMargin && this.$printMarginColumn
  14906. );
  14907. }),
  14908. (this.setAnimatedScroll = function (e) {
  14909. this.setOption("animatedScroll", e);
  14910. }),
  14911. (this.getAnimatedScroll = function () {
  14912. return this.$animatedScroll;
  14913. }),
  14914. (this.setShowInvisibles = function (e) {
  14915. this.setOption("showInvisibles", e),
  14916. this.session.$bidiHandler.setShowInvisibles(e);
  14917. }),
  14918. (this.getShowInvisibles = function () {
  14919. return this.getOption("showInvisibles");
  14920. }),
  14921. (this.getDisplayIndentGuides = function () {
  14922. return this.getOption("displayIndentGuides");
  14923. }),
  14924. (this.setDisplayIndentGuides = function (e) {
  14925. this.setOption("displayIndentGuides", e);
  14926. }),
  14927. (this.setShowPrintMargin = function (e) {
  14928. this.setOption("showPrintMargin", e);
  14929. }),
  14930. (this.getShowPrintMargin = function () {
  14931. return this.getOption("showPrintMargin");
  14932. }),
  14933. (this.setPrintMarginColumn = function (e) {
  14934. this.setOption("printMarginColumn", e);
  14935. }),
  14936. (this.getPrintMarginColumn = function () {
  14937. return this.getOption("printMarginColumn");
  14938. }),
  14939. (this.getShowGutter = function () {
  14940. return this.getOption("showGutter");
  14941. }),
  14942. (this.setShowGutter = function (e) {
  14943. return this.setOption("showGutter", e);
  14944. }),
  14945. (this.getFadeFoldWidgets = function () {
  14946. return this.getOption("fadeFoldWidgets");
  14947. }),
  14948. (this.setFadeFoldWidgets = function (e) {
  14949. this.setOption("fadeFoldWidgets", e);
  14950. }),
  14951. (this.setHighlightGutterLine = function (e) {
  14952. this.setOption("highlightGutterLine", e);
  14953. }),
  14954. (this.getHighlightGutterLine = function () {
  14955. return this.getOption("highlightGutterLine");
  14956. }),
  14957. (this.$updatePrintMargin = function () {
  14958. if (!this.$showPrintMargin && !this.$printMarginEl) return;
  14959. if (!this.$printMarginEl) {
  14960. var e = i.createElement("div");
  14961. (e.className = "ace_layer ace_print-margin-layer"),
  14962. (this.$printMarginEl = i.createElement("div")),
  14963. (this.$printMarginEl.className = "ace_print-margin"),
  14964. e.appendChild(this.$printMarginEl),
  14965. this.content.insertBefore(e, this.content.firstChild);
  14966. }
  14967. var t = this.$printMarginEl.style;
  14968. (t.left =
  14969. Math.round(
  14970. this.characterWidth * this.$printMarginColumn + this.$padding
  14971. ) + "px"),
  14972. (t.visibility = this.$showPrintMargin ? "visible" : "hidden"),
  14973. this.session &&
  14974. this.session.$wrap == -1 &&
  14975. this.adjustWrapLimit();
  14976. }),
  14977. (this.getContainerElement = function () {
  14978. return this.container;
  14979. }),
  14980. (this.getMouseEventTarget = function () {
  14981. return this.scroller;
  14982. }),
  14983. (this.getTextAreaContainer = function () {
  14984. return this.container;
  14985. }),
  14986. (this.$moveTextAreaToCursor = function () {
  14987. var e = this.textarea.style;
  14988. if (!this.$keepTextAreaAtCursor) {
  14989. i.translate(this.textarea, -100, 0);
  14990. return;
  14991. }
  14992. var t = this.$cursorLayer.$pixelPos;
  14993. if (!t) return;
  14994. var n = this.$composition;
  14995. n &&
  14996. n.markerRange &&
  14997. (t = this.$cursorLayer.getPixelPosition(n.markerRange.start, !0));
  14998. var r = this.layerConfig,
  14999. s = t.top,
  15000. o = t.left;
  15001. s -= r.offset;
  15002. var u = n && n.useTextareaForIME ? this.lineHeight : g ? 0 : 1;
  15003. if (s < 0 || s > r.height - u) {
  15004. i.translate(this.textarea, 0, 0);
  15005. return;
  15006. }
  15007. var a = 1;
  15008. if (!n) s += this.lineHeight;
  15009. else if (n.useTextareaForIME) {
  15010. var f = this.textarea.value;
  15011. (a =
  15012. this.characterWidth * this.session.$getStringScreenWidth(f)[0]),
  15013. (u += 2);
  15014. } else s += this.lineHeight + 2;
  15015. (o -= this.scrollLeft),
  15016. o > this.$size.scrollerWidth - a &&
  15017. (o = this.$size.scrollerWidth - a),
  15018. (o += this.gutterWidth + this.margin.left),
  15019. i.setStyle(e, "height", u + "px"),
  15020. i.setStyle(e, "width", a + "px"),
  15021. i.translate(
  15022. this.textarea,
  15023. Math.min(o, this.$size.scrollerWidth - a),
  15024. Math.min(s, this.$size.height - u)
  15025. );
  15026. }),
  15027. (this.getFirstVisibleRow = function () {
  15028. return this.layerConfig.firstRow;
  15029. }),
  15030. (this.getFirstFullyVisibleRow = function () {
  15031. return (
  15032. this.layerConfig.firstRow +
  15033. (this.layerConfig.offset === 0 ? 0 : 1)
  15034. );
  15035. }),
  15036. (this.getLastFullyVisibleRow = function () {
  15037. var e = this.layerConfig,
  15038. t = e.lastRow,
  15039. n = this.session.documentToScreenRow(t, 0) * e.lineHeight;
  15040. return n - this.session.getScrollTop() > e.height - e.lineHeight
  15041. ? t - 1
  15042. : t;
  15043. }),
  15044. (this.getLastVisibleRow = function () {
  15045. return this.layerConfig.lastRow;
  15046. }),
  15047. (this.$padding = null),
  15048. (this.setPadding = function (e) {
  15049. (this.$padding = e),
  15050. this.$textLayer.setPadding(e),
  15051. this.$cursorLayer.setPadding(e),
  15052. this.$markerFront.setPadding(e),
  15053. this.$markerBack.setPadding(e),
  15054. this.$loop.schedule(this.CHANGE_FULL),
  15055. this.$updatePrintMargin();
  15056. }),
  15057. (this.setScrollMargin = function (e, t, n, r) {
  15058. var i = this.scrollMargin;
  15059. (i.top = e | 0),
  15060. (i.bottom = t | 0),
  15061. (i.right = r | 0),
  15062. (i.left = n | 0),
  15063. (i.v = i.top + i.bottom),
  15064. (i.h = i.left + i.right),
  15065. i.top &&
  15066. this.scrollTop <= 0 &&
  15067. this.session &&
  15068. this.session.setScrollTop(-i.top),
  15069. this.updateFull();
  15070. }),
  15071. (this.setMargin = function (e, t, n, r) {
  15072. var i = this.margin;
  15073. (i.top = e | 0),
  15074. (i.bottom = t | 0),
  15075. (i.right = r | 0),
  15076. (i.left = n | 0),
  15077. (i.v = i.top + i.bottom),
  15078. (i.h = i.left + i.right),
  15079. this.$updateCachedSize(
  15080. !0,
  15081. this.gutterWidth,
  15082. this.$size.width,
  15083. this.$size.height
  15084. ),
  15085. this.updateFull();
  15086. }),
  15087. (this.getHScrollBarAlwaysVisible = function () {
  15088. return this.$hScrollBarAlwaysVisible;
  15089. }),
  15090. (this.setHScrollBarAlwaysVisible = function (e) {
  15091. this.setOption("hScrollBarAlwaysVisible", e);
  15092. }),
  15093. (this.getVScrollBarAlwaysVisible = function () {
  15094. return this.$vScrollBarAlwaysVisible;
  15095. }),
  15096. (this.setVScrollBarAlwaysVisible = function (e) {
  15097. this.setOption("vScrollBarAlwaysVisible", e);
  15098. }),
  15099. (this.$updateScrollBarV = function () {
  15100. var e = this.layerConfig.maxHeight,
  15101. t = this.$size.scrollerHeight;
  15102. !this.$maxLines &&
  15103. this.$scrollPastEnd &&
  15104. ((e -= (t - this.lineHeight) * this.$scrollPastEnd),
  15105. this.scrollTop > e - t &&
  15106. ((e = this.scrollTop + t), (this.scrollBarV.scrollTop = null))),
  15107. this.scrollBarV.setScrollHeight(e + this.scrollMargin.v),
  15108. this.scrollBarV.setScrollTop(
  15109. this.scrollTop + this.scrollMargin.top
  15110. );
  15111. }),
  15112. (this.$updateScrollBarH = function () {
  15113. this.scrollBarH.setScrollWidth(
  15114. this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h
  15115. ),
  15116. this.scrollBarH.setScrollLeft(
  15117. this.scrollLeft + this.scrollMargin.left
  15118. );
  15119. }),
  15120. (this.$frozen = !1),
  15121. (this.freeze = function () {
  15122. this.$frozen = !0;
  15123. }),
  15124. (this.unfreeze = function () {
  15125. this.$frozen = !1;
  15126. }),
  15127. (this.$renderChanges = function (e, t) {
  15128. this.$changes && ((e |= this.$changes), (this.$changes = 0));
  15129. if (
  15130. !this.session ||
  15131. !this.container.offsetWidth ||
  15132. this.$frozen ||
  15133. (!e && !t)
  15134. ) {
  15135. this.$changes |= e;
  15136. return;
  15137. }
  15138. if (this.$size.$dirty)
  15139. return (this.$changes |= e), this.onResize(!0);
  15140. this.lineHeight || this.$textLayer.checkForSizeChanges(),
  15141. this._signal("beforeRender"),
  15142. this.session &&
  15143. this.session.$bidiHandler &&
  15144. this.session.$bidiHandler.updateCharacterWidths(
  15145. this.$fontMetrics
  15146. );
  15147. var n = this.layerConfig;
  15148. if (
  15149. e & this.CHANGE_FULL ||
  15150. e & this.CHANGE_SIZE ||
  15151. e & this.CHANGE_TEXT ||
  15152. e & this.CHANGE_LINES ||
  15153. e & this.CHANGE_SCROLL ||
  15154. e & this.CHANGE_H_SCROLL
  15155. ) {
  15156. e |= this.$computeLayerConfig() | this.$loop.clear();
  15157. if (
  15158. n.firstRow != this.layerConfig.firstRow &&
  15159. n.firstRowScreen == this.layerConfig.firstRowScreen
  15160. ) {
  15161. var r =
  15162. this.scrollTop +
  15163. (n.firstRow - this.layerConfig.firstRow) * this.lineHeight;
  15164. r > 0 &&
  15165. ((this.scrollTop = r),
  15166. (e |= this.CHANGE_SCROLL),
  15167. (e |= this.$computeLayerConfig() | this.$loop.clear()));
  15168. }
  15169. (n = this.layerConfig),
  15170. this.$updateScrollBarV(),
  15171. e & this.CHANGE_H_SCROLL && this.$updateScrollBarH(),
  15172. i.translate(this.content, -this.scrollLeft, -n.offset);
  15173. var s = n.width + 2 * this.$padding + "px",
  15174. o = n.minHeight + "px";
  15175. i.setStyle(this.content.style, "width", s),
  15176. i.setStyle(this.content.style, "height", o);
  15177. }
  15178. e & this.CHANGE_H_SCROLL &&
  15179. (i.translate(this.content, -this.scrollLeft, -n.offset),
  15180. (this.scroller.className =
  15181. this.scrollLeft <= 0
  15182. ? "ace_scroller"
  15183. : "ace_scroller ace_scroll-left"));
  15184. if (e & this.CHANGE_FULL) {
  15185. this.$textLayer.update(n),
  15186. this.$showGutter && this.$gutterLayer.update(n),
  15187. this.$markerBack.update(n),
  15188. this.$markerFront.update(n),
  15189. this.$cursorLayer.update(n),
  15190. this.$moveTextAreaToCursor(),
  15191. this._signal("afterRender");
  15192. return;
  15193. }
  15194. if (e & this.CHANGE_SCROLL) {
  15195. e & this.CHANGE_TEXT || e & this.CHANGE_LINES
  15196. ? this.$textLayer.update(n)
  15197. : this.$textLayer.scrollLines(n),
  15198. this.$showGutter &&
  15199. (e & this.CHANGE_GUTTER || e & this.CHANGE_LINES
  15200. ? this.$gutterLayer.update(n)
  15201. : this.$gutterLayer.scrollLines(n)),
  15202. this.$markerBack.update(n),
  15203. this.$markerFront.update(n),
  15204. this.$cursorLayer.update(n),
  15205. this.$moveTextAreaToCursor(),
  15206. this._signal("afterRender");
  15207. return;
  15208. }
  15209. e & this.CHANGE_TEXT
  15210. ? (this.$textLayer.update(n),
  15211. this.$showGutter && this.$gutterLayer.update(n))
  15212. : e & this.CHANGE_LINES
  15213. ? (this.$updateLines() ||
  15214. (e & this.CHANGE_GUTTER && this.$showGutter)) &&
  15215. this.$gutterLayer.update(n)
  15216. : e & this.CHANGE_TEXT || e & this.CHANGE_GUTTER
  15217. ? this.$showGutter && this.$gutterLayer.update(n)
  15218. : e & this.CHANGE_CURSOR &&
  15219. this.$highlightGutterLine &&
  15220. this.$gutterLayer.updateLineHighlight(n),
  15221. e & this.CHANGE_CURSOR &&
  15222. (this.$cursorLayer.update(n), this.$moveTextAreaToCursor()),
  15223. e & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT) &&
  15224. this.$markerFront.update(n),
  15225. e & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK) &&
  15226. this.$markerBack.update(n),
  15227. this._signal("afterRender");
  15228. }),
  15229. (this.$autosize = function () {
  15230. var e = this.session.getScreenLength() * this.lineHeight,
  15231. t = this.$maxLines * this.lineHeight,
  15232. n =
  15233. Math.min(
  15234. t,
  15235. Math.max((this.$minLines || 1) * this.lineHeight, e)
  15236. ) +
  15237. this.scrollMargin.v +
  15238. (this.$extraHeight || 0);
  15239. this.$horizScroll && (n += this.scrollBarH.getHeight()),
  15240. this.$maxPixelHeight &&
  15241. n > this.$maxPixelHeight &&
  15242. (n = this.$maxPixelHeight);
  15243. var r = n <= 2 * this.lineHeight,
  15244. i = !r && e > t;
  15245. if (
  15246. n != this.desiredHeight ||
  15247. this.$size.height != this.desiredHeight ||
  15248. i != this.$vScroll
  15249. ) {
  15250. i != this.$vScroll &&
  15251. ((this.$vScroll = i), this.scrollBarV.setVisible(i));
  15252. var s = this.container.clientWidth;
  15253. (this.container.style.height = n + "px"),
  15254. this.$updateCachedSize(!0, this.$gutterWidth, s, n),
  15255. (this.desiredHeight = n),
  15256. this._signal("autosize");
  15257. }
  15258. }),
  15259. (this.$computeLayerConfig = function () {
  15260. var e = this.session,
  15261. t = this.$size,
  15262. n = t.height <= 2 * this.lineHeight,
  15263. r = this.session.getScreenLength(),
  15264. i = r * this.lineHeight,
  15265. s = this.$getLongestLine(),
  15266. o =
  15267. !n &&
  15268. (this.$hScrollBarAlwaysVisible ||
  15269. t.scrollerWidth - s - 2 * this.$padding < 0),
  15270. u = this.$horizScroll !== o;
  15271. u && ((this.$horizScroll = o), this.scrollBarH.setVisible(o));
  15272. var a = this.$vScroll;
  15273. this.$maxLines && this.lineHeight > 1 && this.$autosize();
  15274. var f = t.scrollerHeight + this.lineHeight,
  15275. l =
  15276. !this.$maxLines && this.$scrollPastEnd
  15277. ? (t.scrollerHeight - this.lineHeight) * this.$scrollPastEnd
  15278. : 0;
  15279. i += l;
  15280. var c = this.scrollMargin;
  15281. this.session.setScrollTop(
  15282. Math.max(
  15283. -c.top,
  15284. Math.min(this.scrollTop, i - t.scrollerHeight + c.bottom)
  15285. )
  15286. ),
  15287. this.session.setScrollLeft(
  15288. Math.max(
  15289. -c.left,
  15290. Math.min(
  15291. this.scrollLeft,
  15292. s + 2 * this.$padding - t.scrollerWidth + c.right
  15293. )
  15294. )
  15295. );
  15296. var h =
  15297. !n &&
  15298. (this.$vScrollBarAlwaysVisible ||
  15299. t.scrollerHeight - i + l < 0 ||
  15300. this.scrollTop > c.top),
  15301. p = a !== h;
  15302. p && ((this.$vScroll = h), this.scrollBarV.setVisible(h));
  15303. var d = this.scrollTop % this.lineHeight,
  15304. v = Math.ceil(f / this.lineHeight) - 1,
  15305. m = Math.max(
  15306. 0,
  15307. Math.round((this.scrollTop - d) / this.lineHeight)
  15308. ),
  15309. g = m + v,
  15310. y,
  15311. b,
  15312. w = this.lineHeight;
  15313. m = e.screenToDocumentRow(m, 0);
  15314. var E = e.getFoldLine(m);
  15315. E && (m = E.start.row),
  15316. (y = e.documentToScreenRow(m, 0)),
  15317. (b = e.getRowLength(m) * w),
  15318. (g = Math.min(e.screenToDocumentRow(g, 0), e.getLength() - 1)),
  15319. (f = t.scrollerHeight + e.getRowLength(g) * w + b),
  15320. (d = this.scrollTop - y * w);
  15321. var S = 0;
  15322. if (this.layerConfig.width != s || u) S = this.CHANGE_H_SCROLL;
  15323. if (u || p)
  15324. (S = this.$updateCachedSize(
  15325. !0,
  15326. this.gutterWidth,
  15327. t.width,
  15328. t.height
  15329. )),
  15330. this._signal("scrollbarVisibilityChanged"),
  15331. p && (s = this.$getLongestLine());
  15332. return (
  15333. (this.layerConfig = {
  15334. width: s,
  15335. padding: this.$padding,
  15336. firstRow: m,
  15337. firstRowScreen: y,
  15338. lastRow: g,
  15339. lineHeight: w,
  15340. characterWidth: this.characterWidth,
  15341. minHeight: f,
  15342. maxHeight: i,
  15343. offset: d,
  15344. gutterOffset: w
  15345. ? Math.max(
  15346. 0,
  15347. Math.ceil((d + t.height - t.scrollerHeight) / w)
  15348. )
  15349. : 0,
  15350. height: this.$size.scrollerHeight,
  15351. }),
  15352. this.session.$bidiHandler &&
  15353. this.session.$bidiHandler.setContentWidth(s - this.$padding),
  15354. S
  15355. );
  15356. }),
  15357. (this.$updateLines = function () {
  15358. if (!this.$changedLines) return;
  15359. var e = this.$changedLines.firstRow,
  15360. t = this.$changedLines.lastRow;
  15361. this.$changedLines = null;
  15362. var n = this.layerConfig;
  15363. if (e > n.lastRow + 1) return;
  15364. if (t < n.firstRow) return;
  15365. if (t === Infinity) {
  15366. this.$showGutter && this.$gutterLayer.update(n),
  15367. this.$textLayer.update(n);
  15368. return;
  15369. }
  15370. return this.$textLayer.updateLines(n, e, t), !0;
  15371. }),
  15372. (this.$getLongestLine = function () {
  15373. var e = this.session.getScreenWidth();
  15374. return (
  15375. this.showInvisibles && !this.session.$useWrapMode && (e += 1),
  15376. this.$textLayer &&
  15377. e > this.$textLayer.MAX_LINE_LENGTH &&
  15378. (e = this.$textLayer.MAX_LINE_LENGTH + 30),
  15379. Math.max(
  15380. this.$size.scrollerWidth - 2 * this.$padding,
  15381. Math.round(e * this.characterWidth)
  15382. )
  15383. );
  15384. }),
  15385. (this.updateFrontMarkers = function () {
  15386. this.$markerFront.setMarkers(this.session.getMarkers(!0)),
  15387. this.$loop.schedule(this.CHANGE_MARKER_FRONT);
  15388. }),
  15389. (this.updateBackMarkers = function () {
  15390. this.$markerBack.setMarkers(this.session.getMarkers()),
  15391. this.$loop.schedule(this.CHANGE_MARKER_BACK);
  15392. }),
  15393. (this.addGutterDecoration = function (e, t) {
  15394. this.$gutterLayer.addGutterDecoration(e, t);
  15395. }),
  15396. (this.removeGutterDecoration = function (e, t) {
  15397. this.$gutterLayer.removeGutterDecoration(e, t);
  15398. }),
  15399. (this.updateBreakpoints = function (e) {
  15400. this.$loop.schedule(this.CHANGE_GUTTER);
  15401. }),
  15402. (this.setAnnotations = function (e) {
  15403. this.$gutterLayer.setAnnotations(e),
  15404. this.$loop.schedule(this.CHANGE_GUTTER);
  15405. }),
  15406. (this.updateCursor = function () {
  15407. this.$loop.schedule(this.CHANGE_CURSOR);
  15408. }),
  15409. (this.hideCursor = function () {
  15410. this.$cursorLayer.hideCursor();
  15411. }),
  15412. (this.showCursor = function () {
  15413. this.$cursorLayer.showCursor();
  15414. }),
  15415. (this.scrollSelectionIntoView = function (e, t, n) {
  15416. this.scrollCursorIntoView(e, n), this.scrollCursorIntoView(t, n);
  15417. }),
  15418. (this.scrollCursorIntoView = function (e, t, n) {
  15419. if (this.$size.scrollerHeight === 0) return;
  15420. var r = this.$cursorLayer.getPixelPosition(e),
  15421. i = r.left,
  15422. s = r.top,
  15423. o = (n && n.top) || 0,
  15424. u = (n && n.bottom) || 0,
  15425. a = this.$scrollAnimation
  15426. ? this.session.getScrollTop()
  15427. : this.scrollTop;
  15428. a + o > s
  15429. ? (t &&
  15430. a + o > s + this.lineHeight &&
  15431. (s -= t * this.$size.scrollerHeight),
  15432. s === 0 && (s = -this.scrollMargin.top),
  15433. this.session.setScrollTop(s))
  15434. : a + this.$size.scrollerHeight - u < s + this.lineHeight &&
  15435. (t &&
  15436. a + this.$size.scrollerHeight - u < s - this.lineHeight &&
  15437. (s += t * this.$size.scrollerHeight),
  15438. this.session.setScrollTop(
  15439. s + this.lineHeight + u - this.$size.scrollerHeight
  15440. ));
  15441. var f = this.scrollLeft;
  15442. f > i
  15443. ? (i < this.$padding + 2 * this.layerConfig.characterWidth &&
  15444. (i = -this.scrollMargin.left),
  15445. this.session.setScrollLeft(i))
  15446. : f + this.$size.scrollerWidth < i + this.characterWidth
  15447. ? this.session.setScrollLeft(
  15448. Math.round(i + this.characterWidth - this.$size.scrollerWidth)
  15449. )
  15450. : f <= this.$padding &&
  15451. i - f < this.characterWidth &&
  15452. this.session.setScrollLeft(0);
  15453. }),
  15454. (this.getScrollTop = function () {
  15455. return this.session.getScrollTop();
  15456. }),
  15457. (this.getScrollLeft = function () {
  15458. return this.session.getScrollLeft();
  15459. }),
  15460. (this.getScrollTopRow = function () {
  15461. return this.scrollTop / this.lineHeight;
  15462. }),
  15463. (this.getScrollBottomRow = function () {
  15464. return Math.max(
  15465. 0,
  15466. Math.floor(
  15467. (this.scrollTop + this.$size.scrollerHeight) / this.lineHeight
  15468. ) - 1
  15469. );
  15470. }),
  15471. (this.scrollToRow = function (e) {
  15472. this.session.setScrollTop(e * this.lineHeight);
  15473. }),
  15474. (this.alignCursor = function (e, t) {
  15475. typeof e == "number" && (e = { row: e, column: 0 });
  15476. var n = this.$cursorLayer.getPixelPosition(e),
  15477. r = this.$size.scrollerHeight - this.lineHeight,
  15478. i = n.top - r * (t || 0);
  15479. return this.session.setScrollTop(i), i;
  15480. }),
  15481. (this.STEPS = 8),
  15482. (this.$calcSteps = function (e, t) {
  15483. var n = 0,
  15484. r = this.STEPS,
  15485. i = [],
  15486. s = function (e, t, n) {
  15487. return n * (Math.pow(e - 1, 3) + 1) + t;
  15488. };
  15489. for (n = 0; n < r; ++n) i.push(s(n / this.STEPS, e, t - e));
  15490. return i;
  15491. }),
  15492. (this.scrollToLine = function (e, t, n, r) {
  15493. var i = this.$cursorLayer.getPixelPosition({ row: e, column: 0 }),
  15494. s = i.top;
  15495. t && (s -= this.$size.scrollerHeight / 2);
  15496. var o = this.scrollTop;
  15497. this.session.setScrollTop(s),
  15498. n !== !1 && this.animateScrolling(o, r);
  15499. }),
  15500. (this.animateScrolling = function (e, t) {
  15501. var n = this.scrollTop;
  15502. if (!this.$animatedScroll) return;
  15503. var r = this;
  15504. if (e == n) return;
  15505. if (this.$scrollAnimation) {
  15506. var i = this.$scrollAnimation.steps;
  15507. if (i.length) {
  15508. e = i[0];
  15509. if (e == n) return;
  15510. }
  15511. }
  15512. var s = r.$calcSteps(e, n);
  15513. (this.$scrollAnimation = { from: e, to: n, steps: s }),
  15514. clearInterval(this.$timer),
  15515. r.session.setScrollTop(s.shift()),
  15516. (r.session.$scrollTop = n),
  15517. (this.$timer = setInterval(function () {
  15518. s.length
  15519. ? (r.session.setScrollTop(s.shift()),
  15520. (r.session.$scrollTop = n))
  15521. : n != null
  15522. ? ((r.session.$scrollTop = -1),
  15523. r.session.setScrollTop(n),
  15524. (n = null))
  15525. : ((r.$timer = clearInterval(r.$timer)),
  15526. (r.$scrollAnimation = null),
  15527. t && t());
  15528. }, 10));
  15529. }),
  15530. (this.scrollToY = function (e) {
  15531. this.scrollTop !== e &&
  15532. (this.$loop.schedule(this.CHANGE_SCROLL), (this.scrollTop = e));
  15533. }),
  15534. (this.scrollToX = function (e) {
  15535. this.scrollLeft !== e && (this.scrollLeft = e),
  15536. this.$loop.schedule(this.CHANGE_H_SCROLL);
  15537. }),
  15538. (this.scrollTo = function (e, t) {
  15539. this.session.setScrollTop(t), this.session.setScrollLeft(t);
  15540. }),
  15541. (this.scrollBy = function (e, t) {
  15542. t && this.session.setScrollTop(this.session.getScrollTop() + t),
  15543. e && this.session.setScrollLeft(this.session.getScrollLeft() + e);
  15544. }),
  15545. (this.isScrollableBy = function (e, t) {
  15546. if (
  15547. t < 0 &&
  15548. this.session.getScrollTop() >= 1 - this.scrollMargin.top
  15549. )
  15550. return !0;
  15551. if (
  15552. t > 0 &&
  15553. this.session.getScrollTop() +
  15554. this.$size.scrollerHeight -
  15555. this.layerConfig.maxHeight <
  15556. -1 + this.scrollMargin.bottom
  15557. )
  15558. return !0;
  15559. if (
  15560. e < 0 &&
  15561. this.session.getScrollLeft() >= 1 - this.scrollMargin.left
  15562. )
  15563. return !0;
  15564. if (
  15565. e > 0 &&
  15566. this.session.getScrollLeft() +
  15567. this.$size.scrollerWidth -
  15568. this.layerConfig.width <
  15569. -1 + this.scrollMargin.right
  15570. )
  15571. return !0;
  15572. }),
  15573. (this.pixelToScreenCoordinates = function (e, t) {
  15574. var n;
  15575. if (this.$hasCssTransforms) {
  15576. n = { top: 0, left: 0 };
  15577. var r = this.$fontMetrics.transformCoordinates([e, t]);
  15578. (e = r[1] - this.gutterWidth - this.margin.left), (t = r[0]);
  15579. } else n = this.scroller.getBoundingClientRect();
  15580. var i = e + this.scrollLeft - n.left - this.$padding,
  15581. s = i / this.characterWidth,
  15582. o = Math.floor((t + this.scrollTop - n.top) / this.lineHeight),
  15583. u = this.$blockCursor ? Math.floor(s) : Math.round(s);
  15584. return { row: o, column: u, side: s - u > 0 ? 1 : -1, offsetX: i };
  15585. }),
  15586. (this.screenToTextCoordinates = function (e, t) {
  15587. var n;
  15588. if (this.$hasCssTransforms) {
  15589. n = { top: 0, left: 0 };
  15590. var r = this.$fontMetrics.transformCoordinates([e, t]);
  15591. (e = r[1] - this.gutterWidth - this.margin.left), (t = r[0]);
  15592. } else n = this.scroller.getBoundingClientRect();
  15593. var i = e + this.scrollLeft - n.left - this.$padding,
  15594. s = i / this.characterWidth,
  15595. o = this.$blockCursor ? Math.floor(s) : Math.round(s),
  15596. u = Math.floor((t + this.scrollTop - n.top) / this.lineHeight);
  15597. return this.session.screenToDocumentPosition(u, Math.max(o, 0), i);
  15598. }),
  15599. (this.textToScreenCoordinates = function (e, t) {
  15600. var n = this.scroller.getBoundingClientRect(),
  15601. r = this.session.documentToScreenPosition(e, t),
  15602. i =
  15603. this.$padding +
  15604. (this.session.$bidiHandler.isBidiRow(r.row, e)
  15605. ? this.session.$bidiHandler.getPosLeft(r.column)
  15606. : Math.round(r.column * this.characterWidth)),
  15607. s = r.row * this.lineHeight;
  15608. return {
  15609. pageX: n.left + i - this.scrollLeft,
  15610. pageY: n.top + s - this.scrollTop,
  15611. };
  15612. }),
  15613. (this.visualizeFocus = function () {
  15614. i.addCssClass(this.container, "ace_focus");
  15615. }),
  15616. (this.visualizeBlur = function () {
  15617. i.removeCssClass(this.container, "ace_focus");
  15618. }),
  15619. (this.showComposition = function (e) {
  15620. (this.$composition = e),
  15621. e.cssText ||
  15622. ((e.cssText = this.textarea.style.cssText),
  15623. (e.keepTextAreaAtCursor = this.$keepTextAreaAtCursor)),
  15624. (e.useTextareaForIME = this.$useTextareaForIME),
  15625. this.$useTextareaForIME
  15626. ? ((this.$keepTextAreaAtCursor = !0),
  15627. i.addCssClass(this.textarea, "ace_composition"),
  15628. (this.textarea.style.cssText = ""),
  15629. this.$moveTextAreaToCursor(),
  15630. (this.$cursorLayer.element.style.display = "none"))
  15631. : (e.markerId = this.session.addMarker(
  15632. e.markerRange,
  15633. "ace_composition_marker",
  15634. "text"
  15635. ));
  15636. }),
  15637. (this.setCompositionText = function (e) {
  15638. var t = this.session.selection.cursor;
  15639. this.addToken(e, "composition_placeholder", t.row, t.column),
  15640. this.$moveTextAreaToCursor();
  15641. }),
  15642. (this.hideComposition = function () {
  15643. if (!this.$composition) return;
  15644. this.$composition.markerId &&
  15645. this.session.removeMarker(this.$composition.markerId),
  15646. i.removeCssClass(this.textarea, "ace_composition"),
  15647. (this.$keepTextAreaAtCursor =
  15648. this.$composition.keepTextAreaAtCursor),
  15649. (this.textarea.style.cssText = this.$composition.cssText),
  15650. (this.$composition = null),
  15651. (this.$cursorLayer.element.style.display = "");
  15652. }),
  15653. (this.addToken = function (e, t, n, r) {
  15654. var i = this.session;
  15655. i.bgTokenizer.lines[n] = null;
  15656. var s = { type: t, value: e },
  15657. o = i.getTokens(n);
  15658. if (r == null) o.push(s);
  15659. else {
  15660. var u = 0;
  15661. for (var a = 0; a < o.length; a++) {
  15662. var f = o[a];
  15663. u += f.value.length;
  15664. if (r <= u) {
  15665. var l = f.value.length - (u - r),
  15666. c = f.value.slice(0, l),
  15667. h = f.value.slice(l);
  15668. o.splice(a, 1, { type: f.type, value: c }, s, {
  15669. type: f.type,
  15670. value: h,
  15671. });
  15672. break;
  15673. }
  15674. }
  15675. }
  15676. this.updateLines(n, n);
  15677. }),
  15678. (this.setTheme = function (e, t) {
  15679. function o(r) {
  15680. if (n.$themeId != e) return t && t();
  15681. if (!r || !r.cssClass)
  15682. throw new Error(
  15683. "couldn't load module " + e + " or it didn't call define"
  15684. );
  15685. r.$id && (n.$themeId = r.$id),
  15686. i.importCssString(r.cssText, r.cssClass, n.container),
  15687. n.theme && i.removeCssClass(n.container, n.theme.cssClass);
  15688. var s =
  15689. "padding" in r
  15690. ? r.padding
  15691. : "padding" in (n.theme || {})
  15692. ? 4
  15693. : n.$padding;
  15694. n.$padding && s != n.$padding && n.setPadding(s),
  15695. (n.$theme = r.cssClass),
  15696. (n.theme = r),
  15697. i.addCssClass(n.container, r.cssClass),
  15698. i.setCssClass(n.container, "ace_dark", r.isDark),
  15699. n.$size && ((n.$size.width = 0), n.$updateSizeAsync()),
  15700. n._dispatchEvent("themeLoaded", { theme: r }),
  15701. t && t();
  15702. }
  15703. var n = this;
  15704. (this.$themeId = e), n._dispatchEvent("themeChange", { theme: e });
  15705. if (!e || typeof e == "string") {
  15706. var r = e || this.$options.theme.initialValue;
  15707. s.loadModule(["theme", r], o);
  15708. } else o(e);
  15709. }),
  15710. (this.getTheme = function () {
  15711. return this.$themeId;
  15712. }),
  15713. (this.setStyle = function (e, t) {
  15714. i.setCssClass(this.container, e, t !== !1);
  15715. }),
  15716. (this.unsetStyle = function (e) {
  15717. i.removeCssClass(this.container, e);
  15718. }),
  15719. (this.setCursorStyle = function (e) {
  15720. i.setStyle(this.scroller.style, "cursor", e);
  15721. }),
  15722. (this.setMouseCursor = function (e) {
  15723. i.setStyle(this.scroller.style, "cursor", e);
  15724. }),
  15725. (this.attachToShadowRoot = function () {
  15726. i.importCssString(v, "ace_editor.css", this.container);
  15727. }),
  15728. (this.destroy = function () {
  15729. this.$fontMetrics.destroy(), this.$cursorLayer.destroy();
  15730. });
  15731. }).call(y.prototype),
  15732. s.defineOptions(y.prototype, "renderer", {
  15733. animatedScroll: { initialValue: !1 },
  15734. showInvisibles: {
  15735. set: function (e) {
  15736. this.$textLayer.setShowInvisibles(e) &&
  15737. this.$loop.schedule(this.CHANGE_TEXT);
  15738. },
  15739. initialValue: !1,
  15740. },
  15741. showPrintMargin: {
  15742. set: function () {
  15743. this.$updatePrintMargin();
  15744. },
  15745. initialValue: !0,
  15746. },
  15747. printMarginColumn: {
  15748. set: function () {
  15749. this.$updatePrintMargin();
  15750. },
  15751. initialValue: 80,
  15752. },
  15753. printMargin: {
  15754. set: function (e) {
  15755. typeof e == "number" && (this.$printMarginColumn = e),
  15756. (this.$showPrintMargin = !!e),
  15757. this.$updatePrintMargin();
  15758. },
  15759. get: function () {
  15760. return this.$showPrintMargin && this.$printMarginColumn;
  15761. },
  15762. },
  15763. showGutter: {
  15764. set: function (e) {
  15765. (this.$gutter.style.display = e ? "block" : "none"),
  15766. this.$loop.schedule(this.CHANGE_FULL),
  15767. this.onGutterResize();
  15768. },
  15769. initialValue: !0,
  15770. },
  15771. fadeFoldWidgets: {
  15772. set: function (e) {
  15773. i.setCssClass(this.$gutter, "ace_fade-fold-widgets", e);
  15774. },
  15775. initialValue: !1,
  15776. },
  15777. showFoldWidgets: {
  15778. set: function (e) {
  15779. this.$gutterLayer.setShowFoldWidgets(e),
  15780. this.$loop.schedule(this.CHANGE_GUTTER);
  15781. },
  15782. initialValue: !0,
  15783. },
  15784. displayIndentGuides: {
  15785. set: function (e) {
  15786. this.$textLayer.setDisplayIndentGuides(e) &&
  15787. this.$loop.schedule(this.CHANGE_TEXT);
  15788. },
  15789. initialValue: !0,
  15790. },
  15791. highlightGutterLine: {
  15792. set: function (e) {
  15793. this.$gutterLayer.setHighlightGutterLine(e),
  15794. this.$loop.schedule(this.CHANGE_GUTTER);
  15795. },
  15796. initialValue: !0,
  15797. },
  15798. hScrollBarAlwaysVisible: {
  15799. set: function (e) {
  15800. (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) &&
  15801. this.$loop.schedule(this.CHANGE_SCROLL);
  15802. },
  15803. initialValue: !1,
  15804. },
  15805. vScrollBarAlwaysVisible: {
  15806. set: function (e) {
  15807. (!this.$vScrollBarAlwaysVisible || !this.$vScroll) &&
  15808. this.$loop.schedule(this.CHANGE_SCROLL);
  15809. },
  15810. initialValue: !1,
  15811. },
  15812. fontSize: {
  15813. set: function (e) {
  15814. typeof e == "number" && (e += "px"),
  15815. (this.container.style.fontSize = e),
  15816. this.updateFontSize();
  15817. },
  15818. initialValue: 12,
  15819. },
  15820. fontFamily: {
  15821. set: function (e) {
  15822. (this.container.style.fontFamily = e), this.updateFontSize();
  15823. },
  15824. },
  15825. maxLines: {
  15826. set: function (e) {
  15827. this.updateFull();
  15828. },
  15829. },
  15830. minLines: {
  15831. set: function (e) {
  15832. this.$minLines < 562949953421311 || (this.$minLines = 0),
  15833. this.updateFull();
  15834. },
  15835. },
  15836. maxPixelHeight: {
  15837. set: function (e) {
  15838. this.updateFull();
  15839. },
  15840. initialValue: 0,
  15841. },
  15842. scrollPastEnd: {
  15843. set: function (e) {
  15844. e = +e || 0;
  15845. if (this.$scrollPastEnd == e) return;
  15846. (this.$scrollPastEnd = e),
  15847. this.$loop.schedule(this.CHANGE_SCROLL);
  15848. },
  15849. initialValue: 0,
  15850. handlesSet: !0,
  15851. },
  15852. fixedWidthGutter: {
  15853. set: function (e) {
  15854. (this.$gutterLayer.$fixedWidth = !!e),
  15855. this.$loop.schedule(this.CHANGE_GUTTER);
  15856. },
  15857. },
  15858. theme: {
  15859. set: function (e) {
  15860. this.setTheme(e);
  15861. },
  15862. get: function () {
  15863. return this.$themeId || this.theme;
  15864. },
  15865. initialValue: "./theme/textmate",
  15866. handlesSet: !0,
  15867. },
  15868. hasCssTransforms: {},
  15869. useTextareaForIME: { initialValue: !m.isMobile && !m.isIE },
  15870. }),
  15871. (t.VirtualRenderer = y);
  15872. }
  15873. ),
  15874. define(
  15875. "ace/worker/worker_client",
  15876. [
  15877. "require",
  15878. "exports",
  15879. "module",
  15880. "ace/lib/oop",
  15881. "ace/lib/net",
  15882. "ace/lib/event_emitter",
  15883. "ace/config",
  15884. ],
  15885. function (e, t, n) {
  15886. "use strict";
  15887. function u(e) {
  15888. var t = "importScripts('" + i.qualifyURL(e) + "');";
  15889. try {
  15890. return new Blob([t], { type: "application/javascript" });
  15891. } catch (n) {
  15892. var r =
  15893. window.BlobBuilder ||
  15894. window.WebKitBlobBuilder ||
  15895. window.MozBlobBuilder,
  15896. s = new r();
  15897. return s.append(t), s.getBlob("application/javascript");
  15898. }
  15899. }
  15900. function a(e) {
  15901. if (typeof Worker == "undefined")
  15902. return { postMessage: function () {}, terminate: function () {} };
  15903. var t = u(e),
  15904. n = window.URL || window.webkitURL,
  15905. r = n.createObjectURL(t);
  15906. return new Worker(r);
  15907. }
  15908. var r = e("../lib/oop"),
  15909. i = e("../lib/net"),
  15910. s = e("../lib/event_emitter").EventEmitter,
  15911. o = e("../config"),
  15912. f = function (t, n, r, i, s) {
  15913. (this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this)),
  15914. (this.changeListener = this.changeListener.bind(this)),
  15915. (this.onMessage = this.onMessage.bind(this)),
  15916. e.nameToUrl && !e.toUrl && (e.toUrl = e.nameToUrl);
  15917. if (o.get("packaged") || !e.toUrl) i = i || o.moduleUrl(n, "worker");
  15918. else {
  15919. var u = this.$normalizePath;
  15920. i = i || u(e.toUrl("ace/worker/worker.js", null, "_"));
  15921. var f = {};
  15922. t.forEach(function (t) {
  15923. f[t] = u(e.toUrl(t, null, "_").replace(/(\.js)?(\?.*)?$/, ""));
  15924. });
  15925. }
  15926. (this.$worker = a(i)),
  15927. s && this.send("importScripts", s),
  15928. this.$worker.postMessage({
  15929. init: !0,
  15930. tlns: f,
  15931. module: n,
  15932. classname: r,
  15933. }),
  15934. (this.callbackId = 1),
  15935. (this.callbacks = {}),
  15936. (this.$worker.onmessage = this.onMessage);
  15937. };
  15938. (function () {
  15939. r.implement(this, s),
  15940. (this.onMessage = function (e) {
  15941. var t = e.data;
  15942. switch (t.type) {
  15943. case "event":
  15944. this._signal(t.name, { data: t.data });
  15945. break;
  15946. case "call":
  15947. var n = this.callbacks[t.id];
  15948. n && (n(t.data), delete this.callbacks[t.id]);
  15949. break;
  15950. case "error":
  15951. this.reportError(t.data);
  15952. break;
  15953. case "log":
  15954. window.console &&
  15955. console.log &&
  15956. console.log.apply(console, t.data);
  15957. }
  15958. }),
  15959. (this.reportError = function (e) {
  15960. window.console && console.error && console.error(e);
  15961. }),
  15962. (this.$normalizePath = function (e) {
  15963. return i.qualifyURL(e);
  15964. }),
  15965. (this.terminate = function () {
  15966. this._signal("terminate", {}),
  15967. (this.deltaQueue = null),
  15968. this.$worker.terminate(),
  15969. (this.$worker = null),
  15970. this.$doc && this.$doc.off("change", this.changeListener),
  15971. (this.$doc = null);
  15972. }),
  15973. (this.send = function (e, t) {
  15974. this.$worker.postMessage({ command: e, args: t });
  15975. }),
  15976. (this.call = function (e, t, n) {
  15977. if (n) {
  15978. var r = this.callbackId++;
  15979. (this.callbacks[r] = n), t.push(r);
  15980. }
  15981. this.send(e, t);
  15982. }),
  15983. (this.emit = function (e, t) {
  15984. try {
  15985. t.data &&
  15986. t.data.err &&
  15987. (t.data.err = {
  15988. message: t.data.err.message,
  15989. stack: t.data.err.stack,
  15990. code: t.data.err.code,
  15991. }),
  15992. this.$worker.postMessage({ event: e, data: { data: t.data } });
  15993. } catch (n) {
  15994. console.error(n.stack);
  15995. }
  15996. }),
  15997. (this.attachToDocument = function (e) {
  15998. this.$doc && this.terminate(),
  15999. (this.$doc = e),
  16000. this.call("setValue", [e.getValue()]),
  16001. e.on("change", this.changeListener);
  16002. }),
  16003. (this.changeListener = function (e) {
  16004. this.deltaQueue ||
  16005. ((this.deltaQueue = []), setTimeout(this.$sendDeltaQueue, 0)),
  16006. e.action == "insert"
  16007. ? this.deltaQueue.push(e.start, e.lines)
  16008. : this.deltaQueue.push(e.start, e.end);
  16009. }),
  16010. (this.$sendDeltaQueue = function () {
  16011. var e = this.deltaQueue;
  16012. if (!e) return;
  16013. (this.deltaQueue = null),
  16014. e.length > 50 && e.length > this.$doc.getLength() >> 1
  16015. ? this.call("setValue", [this.$doc.getValue()])
  16016. : this.emit("change", { data: e });
  16017. });
  16018. }).call(f.prototype);
  16019. var l = function (e, t, n) {
  16020. (this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this)),
  16021. (this.changeListener = this.changeListener.bind(this)),
  16022. (this.callbackId = 1),
  16023. (this.callbacks = {}),
  16024. (this.messageBuffer = []);
  16025. var r = null,
  16026. i = !1,
  16027. u = Object.create(s),
  16028. a = this;
  16029. (this.$worker = {}),
  16030. (this.$worker.terminate = function () {}),
  16031. (this.$worker.postMessage = function (e) {
  16032. a.messageBuffer.push(e), r && (i ? setTimeout(f) : f());
  16033. }),
  16034. (this.setEmitSync = function (e) {
  16035. i = e;
  16036. });
  16037. var f = function () {
  16038. var e = a.messageBuffer.shift();
  16039. e.command
  16040. ? r[e.command].apply(r, e.args)
  16041. : e.event && u._signal(e.event, e.data);
  16042. };
  16043. (u.postMessage = function (e) {
  16044. a.onMessage({ data: e });
  16045. }),
  16046. (u.callback = function (e, t) {
  16047. this.postMessage({ type: "call", id: t, data: e });
  16048. }),
  16049. (u.emit = function (e, t) {
  16050. this.postMessage({ type: "event", name: e, data: t });
  16051. }),
  16052. o.loadModule(["worker", t], function (e) {
  16053. r = new e[n](u);
  16054. while (a.messageBuffer.length) f();
  16055. });
  16056. };
  16057. (l.prototype = f.prototype),
  16058. (t.UIWorkerClient = l),
  16059. (t.WorkerClient = f),
  16060. (t.createWorker = a);
  16061. }
  16062. ),
  16063. define(
  16064. "ace/placeholder",
  16065. [
  16066. "require",
  16067. "exports",
  16068. "module",
  16069. "ace/range",
  16070. "ace/lib/event_emitter",
  16071. "ace/lib/oop",
  16072. ],
  16073. function (e, t, n) {
  16074. "use strict";
  16075. var r = e("./range").Range,
  16076. i = e("./lib/event_emitter").EventEmitter,
  16077. s = e("./lib/oop"),
  16078. o = function (e, t, n, r, i, s) {
  16079. var o = this;
  16080. (this.length = t),
  16081. (this.session = e),
  16082. (this.doc = e.getDocument()),
  16083. (this.mainClass = i),
  16084. (this.othersClass = s),
  16085. (this.$onUpdate = this.onUpdate.bind(this)),
  16086. this.doc.on("change", this.$onUpdate),
  16087. (this.$others = r),
  16088. (this.$onCursorChange = function () {
  16089. setTimeout(function () {
  16090. o.onCursorChange();
  16091. });
  16092. }),
  16093. (this.$pos = n);
  16094. var u = e.getUndoManager().$undoStack ||
  16095. e.getUndoManager().$undostack || { length: -1 };
  16096. (this.$undoStackDepth = u.length),
  16097. this.setup(),
  16098. e.selection.on("changeCursor", this.$onCursorChange);
  16099. };
  16100. (function () {
  16101. s.implement(this, i),
  16102. (this.setup = function () {
  16103. var e = this,
  16104. t = this.doc,
  16105. n = this.session;
  16106. (this.selectionBefore = n.selection.toJSON()),
  16107. n.selection.inMultiSelectMode && n.selection.toSingleRange(),
  16108. (this.pos = t.createAnchor(this.$pos.row, this.$pos.column));
  16109. var i = this.pos;
  16110. (i.$insertRight = !0),
  16111. i.detach(),
  16112. (i.markerId = n.addMarker(
  16113. new r(i.row, i.column, i.row, i.column + this.length),
  16114. this.mainClass,
  16115. null,
  16116. !1
  16117. )),
  16118. (this.others = []),
  16119. this.$others.forEach(function (n) {
  16120. var r = t.createAnchor(n.row, n.column);
  16121. (r.$insertRight = !0), r.detach(), e.others.push(r);
  16122. }),
  16123. n.setUndoSelect(!1);
  16124. }),
  16125. (this.showOtherMarkers = function () {
  16126. if (this.othersActive) return;
  16127. var e = this.session,
  16128. t = this;
  16129. (this.othersActive = !0),
  16130. this.others.forEach(function (n) {
  16131. n.markerId = e.addMarker(
  16132. new r(n.row, n.column, n.row, n.column + t.length),
  16133. t.othersClass,
  16134. null,
  16135. !1
  16136. );
  16137. });
  16138. }),
  16139. (this.hideOtherMarkers = function () {
  16140. if (!this.othersActive) return;
  16141. this.othersActive = !1;
  16142. for (var e = 0; e < this.others.length; e++)
  16143. this.session.removeMarker(this.others[e].markerId);
  16144. }),
  16145. (this.onUpdate = function (e) {
  16146. if (this.$updating) return this.updateAnchors(e);
  16147. var t = e;
  16148. if (t.start.row !== t.end.row) return;
  16149. if (t.start.row !== this.pos.row) return;
  16150. this.$updating = !0;
  16151. var n =
  16152. e.action === "insert"
  16153. ? t.end.column - t.start.column
  16154. : t.start.column - t.end.column,
  16155. i =
  16156. t.start.column >= this.pos.column &&
  16157. t.start.column <= this.pos.column + this.length + 1,
  16158. s = t.start.column - this.pos.column;
  16159. this.updateAnchors(e), i && (this.length += n);
  16160. if (i && !this.session.$fromUndo)
  16161. if (e.action === "insert")
  16162. for (var o = this.others.length - 1; o >= 0; o--) {
  16163. var u = this.others[o],
  16164. a = { row: u.row, column: u.column + s };
  16165. this.doc.insertMergedLines(a, e.lines);
  16166. }
  16167. else if (e.action === "remove")
  16168. for (var o = this.others.length - 1; o >= 0; o--) {
  16169. var u = this.others[o],
  16170. a = { row: u.row, column: u.column + s };
  16171. this.doc.remove(new r(a.row, a.column, a.row, a.column - n));
  16172. }
  16173. (this.$updating = !1), this.updateMarkers();
  16174. }),
  16175. (this.updateAnchors = function (e) {
  16176. this.pos.onChange(e);
  16177. for (var t = this.others.length; t--; ) this.others[t].onChange(e);
  16178. this.updateMarkers();
  16179. }),
  16180. (this.updateMarkers = function () {
  16181. if (this.$updating) return;
  16182. var e = this,
  16183. t = this.session,
  16184. n = function (n, i) {
  16185. t.removeMarker(n.markerId),
  16186. (n.markerId = t.addMarker(
  16187. new r(n.row, n.column, n.row, n.column + e.length),
  16188. i,
  16189. null,
  16190. !1
  16191. ));
  16192. };
  16193. n(this.pos, this.mainClass);
  16194. for (var i = this.others.length; i--; )
  16195. n(this.others[i], this.othersClass);
  16196. }),
  16197. (this.onCursorChange = function (e) {
  16198. if (this.$updating || !this.session) return;
  16199. var t = this.session.selection.getCursor();
  16200. t.row === this.pos.row &&
  16201. t.column >= this.pos.column &&
  16202. t.column <= this.pos.column + this.length
  16203. ? (this.showOtherMarkers(), this._emit("cursorEnter", e))
  16204. : (this.hideOtherMarkers(), this._emit("cursorLeave", e));
  16205. }),
  16206. (this.detach = function () {
  16207. this.session.removeMarker(this.pos && this.pos.markerId),
  16208. this.hideOtherMarkers(),
  16209. this.doc.removeEventListener("change", this.$onUpdate),
  16210. this.session.selection.removeEventListener(
  16211. "changeCursor",
  16212. this.$onCursorChange
  16213. ),
  16214. this.session.setUndoSelect(!0),
  16215. (this.session = null);
  16216. }),
  16217. (this.cancel = function () {
  16218. if (this.$undoStackDepth === -1) return;
  16219. var e = this.session.getUndoManager(),
  16220. t = (e.$undoStack || e.$undostack).length - this.$undoStackDepth;
  16221. for (var n = 0; n < t; n++) e.undo(this.session, !0);
  16222. this.selectionBefore &&
  16223. this.session.selection.fromJSON(this.selectionBefore);
  16224. });
  16225. }).call(o.prototype),
  16226. (t.PlaceHolder = o);
  16227. }
  16228. ),
  16229. define(
  16230. "ace/mouse/multi_select_handler",
  16231. ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent"],
  16232. function (e, t, n) {
  16233. function s(e, t) {
  16234. return e.row == t.row && e.column == t.column;
  16235. }
  16236. function o(e) {
  16237. var t = e.domEvent,
  16238. n = t.altKey,
  16239. o = t.shiftKey,
  16240. u = t.ctrlKey,
  16241. a = e.getAccelKey(),
  16242. f = e.getButton();
  16243. u && i.isMac && (f = t.button);
  16244. if (e.editor.inMultiSelectMode && f == 2) {
  16245. e.editor.textInput.onContextMenu(e.domEvent);
  16246. return;
  16247. }
  16248. if (!u && !n && !a) {
  16249. f === 0 &&
  16250. e.editor.inMultiSelectMode &&
  16251. e.editor.exitMultiSelectMode();
  16252. return;
  16253. }
  16254. if (f !== 0) return;
  16255. var l = e.editor,
  16256. c = l.selection,
  16257. h = l.inMultiSelectMode,
  16258. p = e.getDocumentPosition(),
  16259. d = c.getCursor(),
  16260. v = e.inSelection() || (c.isEmpty() && s(p, d)),
  16261. m = e.x,
  16262. g = e.y,
  16263. y = function (e) {
  16264. (m = e.clientX), (g = e.clientY);
  16265. },
  16266. b = l.session,
  16267. w = l.renderer.pixelToScreenCoordinates(m, g),
  16268. E = w,
  16269. S;
  16270. if (l.$mouseHandler.$enableJumpToDef)
  16271. (u && n) || (a && n)
  16272. ? (S = o ? "block" : "add")
  16273. : n && l.$blockSelectEnabled && (S = "block");
  16274. else if (a && !n) {
  16275. S = "add";
  16276. if (!h && o) return;
  16277. } else n && l.$blockSelectEnabled && (S = "block");
  16278. S && i.isMac && t.ctrlKey && l.$mouseHandler.cancelContextMenu();
  16279. if (S == "add") {
  16280. if (!h && v) return;
  16281. if (!h) {
  16282. var x = c.toOrientedRange();
  16283. l.addSelectionMarker(x);
  16284. }
  16285. var T = c.rangeList.rangeAtPoint(p);
  16286. (l.inVirtualSelectionMode = !0),
  16287. o &&
  16288. ((T = null), (x = c.ranges[0] || x), l.removeSelectionMarker(x)),
  16289. l.once("mouseup", function () {
  16290. var e = c.toOrientedRange();
  16291. T && e.isEmpty() && s(T.cursor, e.cursor)
  16292. ? c.substractPoint(e.cursor)
  16293. : (o
  16294. ? c.substractPoint(x.cursor)
  16295. : x && (l.removeSelectionMarker(x), c.addRange(x)),
  16296. c.addRange(e)),
  16297. (l.inVirtualSelectionMode = !1);
  16298. });
  16299. } else if (S == "block") {
  16300. e.stop(), (l.inVirtualSelectionMode = !0);
  16301. var N,
  16302. C = [],
  16303. k = function () {
  16304. var e = l.renderer.pixelToScreenCoordinates(m, g),
  16305. t = b.screenToDocumentPosition(e.row, e.column, e.offsetX);
  16306. if (s(E, e) && s(t, c.lead)) return;
  16307. (E = e),
  16308. l.selection.moveToPosition(t),
  16309. l.renderer.scrollCursorIntoView(),
  16310. l.removeSelectionMarkers(C),
  16311. (C = c.rectangularRangeBlock(E, w)),
  16312. l.$mouseHandler.$clickSelection &&
  16313. C.length == 1 &&
  16314. C[0].isEmpty() &&
  16315. (C[0] = l.$mouseHandler.$clickSelection.clone()),
  16316. C.forEach(l.addSelectionMarker, l),
  16317. l.updateSelectionMarkers();
  16318. };
  16319. h && !a
  16320. ? c.toSingleRange()
  16321. : !h && a && ((N = c.toOrientedRange()), l.addSelectionMarker(N)),
  16322. o ? (w = b.documentToScreenPosition(c.lead)) : c.moveToPosition(p),
  16323. (E = { row: -1, column: -1 });
  16324. var L = function (e) {
  16325. k(),
  16326. clearInterval(O),
  16327. l.removeSelectionMarkers(C),
  16328. C.length || (C = [c.toOrientedRange()]),
  16329. N && (l.removeSelectionMarker(N), c.toSingleRange(N));
  16330. for (var t = 0; t < C.length; t++) c.addRange(C[t]);
  16331. (l.inVirtualSelectionMode = !1),
  16332. (l.$mouseHandler.$clickSelection = null);
  16333. },
  16334. A = k;
  16335. r.capture(l.container, y, L);
  16336. var O = setInterval(function () {
  16337. A();
  16338. }, 20);
  16339. return e.preventDefault();
  16340. }
  16341. }
  16342. var r = e("../lib/event"),
  16343. i = e("../lib/useragent");
  16344. t.onMouseDown = o;
  16345. }
  16346. ),
  16347. define(
  16348. "ace/commands/multi_select_commands",
  16349. ["require", "exports", "module", "ace/keyboard/hash_handler"],
  16350. function (e, t, n) {
  16351. (t.defaultCommands = [
  16352. {
  16353. name: "addCursorAbove",
  16354. exec: function (e) {
  16355. e.selectMoreLines(-1);
  16356. },
  16357. bindKey: { win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up" },
  16358. scrollIntoView: "cursor",
  16359. readOnly: !0,
  16360. },
  16361. {
  16362. name: "addCursorBelow",
  16363. exec: function (e) {
  16364. e.selectMoreLines(1);
  16365. },
  16366. bindKey: { win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down" },
  16367. scrollIntoView: "cursor",
  16368. readOnly: !0,
  16369. },
  16370. {
  16371. name: "addCursorAboveSkipCurrent",
  16372. exec: function (e) {
  16373. e.selectMoreLines(-1, !0);
  16374. },
  16375. bindKey: { win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up" },
  16376. scrollIntoView: "cursor",
  16377. readOnly: !0,
  16378. },
  16379. {
  16380. name: "addCursorBelowSkipCurrent",
  16381. exec: function (e) {
  16382. e.selectMoreLines(1, !0);
  16383. },
  16384. bindKey: { win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down" },
  16385. scrollIntoView: "cursor",
  16386. readOnly: !0,
  16387. },
  16388. {
  16389. name: "selectMoreBefore",
  16390. exec: function (e) {
  16391. e.selectMore(-1);
  16392. },
  16393. bindKey: { win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left" },
  16394. scrollIntoView: "cursor",
  16395. readOnly: !0,
  16396. },
  16397. {
  16398. name: "selectMoreAfter",
  16399. exec: function (e) {
  16400. e.selectMore(1);
  16401. },
  16402. bindKey: { win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right" },
  16403. scrollIntoView: "cursor",
  16404. readOnly: !0,
  16405. },
  16406. {
  16407. name: "selectNextBefore",
  16408. exec: function (e) {
  16409. e.selectMore(-1, !0);
  16410. },
  16411. bindKey: { win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left" },
  16412. scrollIntoView: "cursor",
  16413. readOnly: !0,
  16414. },
  16415. {
  16416. name: "selectNextAfter",
  16417. exec: function (e) {
  16418. e.selectMore(1, !0);
  16419. },
  16420. bindKey: { win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right" },
  16421. scrollIntoView: "cursor",
  16422. readOnly: !0,
  16423. },
  16424. {
  16425. name: "splitIntoLines",
  16426. exec: function (e) {
  16427. e.multiSelect.splitIntoLines();
  16428. },
  16429. bindKey: { win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L" },
  16430. readOnly: !0,
  16431. },
  16432. {
  16433. name: "alignCursors",
  16434. exec: function (e) {
  16435. e.alignCursors();
  16436. },
  16437. bindKey: { win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A" },
  16438. scrollIntoView: "cursor",
  16439. },
  16440. {
  16441. name: "findAll",
  16442. exec: function (e) {
  16443. e.findAll();
  16444. },
  16445. bindKey: { win: "Ctrl-Alt-K", mac: "Ctrl-Alt-G" },
  16446. scrollIntoView: "cursor",
  16447. readOnly: !0,
  16448. },
  16449. ]),
  16450. (t.multiSelectCommands = [
  16451. {
  16452. name: "singleSelection",
  16453. bindKey: "esc",
  16454. exec: function (e) {
  16455. e.exitMultiSelectMode();
  16456. },
  16457. scrollIntoView: "cursor",
  16458. readOnly: !0,
  16459. isAvailable: function (e) {
  16460. return e && e.inMultiSelectMode;
  16461. },
  16462. },
  16463. ]);
  16464. var r = e("../keyboard/hash_handler").HashHandler;
  16465. t.keyboardHandler = new r(t.multiSelectCommands);
  16466. }
  16467. ),
  16468. define(
  16469. "ace/multi_select",
  16470. [
  16471. "require",
  16472. "exports",
  16473. "module",
  16474. "ace/range_list",
  16475. "ace/range",
  16476. "ace/selection",
  16477. "ace/mouse/multi_select_handler",
  16478. "ace/lib/event",
  16479. "ace/lib/lang",
  16480. "ace/commands/multi_select_commands",
  16481. "ace/search",
  16482. "ace/edit_session",
  16483. "ace/editor",
  16484. "ace/config",
  16485. ],
  16486. function (e, t, n) {
  16487. function h(e, t, n) {
  16488. return (
  16489. (c.$options.wrap = !0),
  16490. (c.$options.needle = t),
  16491. (c.$options.backwards = n == -1),
  16492. c.find(e)
  16493. );
  16494. }
  16495. function v(e, t) {
  16496. return e.row == t.row && e.column == t.column;
  16497. }
  16498. function m(e) {
  16499. if (e.$multiselectOnSessionChange) return;
  16500. (e.$onAddRange = e.$onAddRange.bind(e)),
  16501. (e.$onRemoveRange = e.$onRemoveRange.bind(e)),
  16502. (e.$onMultiSelect = e.$onMultiSelect.bind(e)),
  16503. (e.$onSingleSelect = e.$onSingleSelect.bind(e)),
  16504. (e.$multiselectOnSessionChange = t.onSessionChange.bind(e)),
  16505. (e.$checkMultiselectChange = e.$checkMultiselectChange.bind(e)),
  16506. e.$multiselectOnSessionChange(e),
  16507. e.on("changeSession", e.$multiselectOnSessionChange),
  16508. e.on("mousedown", o),
  16509. e.commands.addCommands(f.defaultCommands),
  16510. g(e);
  16511. }
  16512. function g(e) {
  16513. function r(t) {
  16514. n && (e.renderer.setMouseCursor(""), (n = !1));
  16515. }
  16516. var t = e.textInput.getElement(),
  16517. n = !1;
  16518. u.addListener(t, "keydown", function (t) {
  16519. var i = t.keyCode == 18 && !(t.ctrlKey || t.shiftKey || t.metaKey);
  16520. e.$blockSelectEnabled && i
  16521. ? n || (e.renderer.setMouseCursor("crosshair"), (n = !0))
  16522. : n && r();
  16523. }),
  16524. u.addListener(t, "keyup", r),
  16525. u.addListener(t, "blur", r);
  16526. }
  16527. var r = e("./range_list").RangeList,
  16528. i = e("./range").Range,
  16529. s = e("./selection").Selection,
  16530. o = e("./mouse/multi_select_handler").onMouseDown,
  16531. u = e("./lib/event"),
  16532. a = e("./lib/lang"),
  16533. f = e("./commands/multi_select_commands");
  16534. t.commands = f.defaultCommands.concat(f.multiSelectCommands);
  16535. var l = e("./search").Search,
  16536. c = new l(),
  16537. p = e("./edit_session").EditSession;
  16538. (function () {
  16539. this.getSelectionMarkers = function () {
  16540. return this.$selectionMarkers;
  16541. };
  16542. }).call(p.prototype),
  16543. function () {
  16544. (this.ranges = null),
  16545. (this.rangeList = null),
  16546. (this.addRange = function (e, t) {
  16547. if (!e) return;
  16548. if (!this.inMultiSelectMode && this.rangeCount === 0) {
  16549. var n = this.toOrientedRange();
  16550. this.rangeList.add(n), this.rangeList.add(e);
  16551. if (this.rangeList.ranges.length != 2)
  16552. return (
  16553. this.rangeList.removeAll(), t || this.fromOrientedRange(e)
  16554. );
  16555. this.rangeList.removeAll(),
  16556. this.rangeList.add(n),
  16557. this.$onAddRange(n);
  16558. }
  16559. e.cursor || (e.cursor = e.end);
  16560. var r = this.rangeList.add(e);
  16561. return (
  16562. this.$onAddRange(e),
  16563. r.length && this.$onRemoveRange(r),
  16564. this.rangeCount > 1 &&
  16565. !this.inMultiSelectMode &&
  16566. (this._signal("multiSelect"),
  16567. (this.inMultiSelectMode = !0),
  16568. (this.session.$undoSelect = !1),
  16569. this.rangeList.attach(this.session)),
  16570. t || this.fromOrientedRange(e)
  16571. );
  16572. }),
  16573. (this.toSingleRange = function (e) {
  16574. e = e || this.ranges[0];
  16575. var t = this.rangeList.removeAll();
  16576. t.length && this.$onRemoveRange(t),
  16577. e && this.fromOrientedRange(e);
  16578. }),
  16579. (this.substractPoint = function (e) {
  16580. var t = this.rangeList.substractPoint(e);
  16581. if (t) return this.$onRemoveRange(t), t[0];
  16582. }),
  16583. (this.mergeOverlappingRanges = function () {
  16584. var e = this.rangeList.merge();
  16585. e.length && this.$onRemoveRange(e);
  16586. }),
  16587. (this.$onAddRange = function (e) {
  16588. (this.rangeCount = this.rangeList.ranges.length),
  16589. this.ranges.unshift(e),
  16590. this._signal("addRange", { range: e });
  16591. }),
  16592. (this.$onRemoveRange = function (e) {
  16593. this.rangeCount = this.rangeList.ranges.length;
  16594. if (this.rangeCount == 1 && this.inMultiSelectMode) {
  16595. var t = this.rangeList.ranges.pop();
  16596. e.push(t), (this.rangeCount = 0);
  16597. }
  16598. for (var n = e.length; n--; ) {
  16599. var r = this.ranges.indexOf(e[n]);
  16600. this.ranges.splice(r, 1);
  16601. }
  16602. this._signal("removeRange", { ranges: e }),
  16603. this.rangeCount === 0 &&
  16604. this.inMultiSelectMode &&
  16605. ((this.inMultiSelectMode = !1),
  16606. this._signal("singleSelect"),
  16607. (this.session.$undoSelect = !0),
  16608. this.rangeList.detach(this.session)),
  16609. (t = t || this.ranges[0]),
  16610. t && !t.isEqual(this.getRange()) && this.fromOrientedRange(t);
  16611. }),
  16612. (this.$initRangeList = function () {
  16613. if (this.rangeList) return;
  16614. (this.rangeList = new r()),
  16615. (this.ranges = []),
  16616. (this.rangeCount = 0);
  16617. }),
  16618. (this.getAllRanges = function () {
  16619. return this.rangeCount
  16620. ? this.rangeList.ranges.concat()
  16621. : [this.getRange()];
  16622. }),
  16623. (this.splitIntoLines = function () {
  16624. if (this.rangeCount > 1) {
  16625. var e = this.rangeList.ranges,
  16626. t = e[e.length - 1],
  16627. n = i.fromPoints(e[0].start, t.end);
  16628. this.toSingleRange(),
  16629. this.setSelectionRange(n, t.cursor == t.start);
  16630. } else {
  16631. var n = this.getRange(),
  16632. r = this.isBackwards(),
  16633. s = n.start.row,
  16634. o = n.end.row;
  16635. if (s == o) {
  16636. if (r)
  16637. var u = n.end,
  16638. a = n.start;
  16639. else
  16640. var u = n.start,
  16641. a = n.end;
  16642. this.addRange(i.fromPoints(a, a)),
  16643. this.addRange(i.fromPoints(u, u));
  16644. return;
  16645. }
  16646. var f = [],
  16647. l = this.getLineRange(s, !0);
  16648. (l.start.column = n.start.column), f.push(l);
  16649. for (var c = s + 1; c < o; c++)
  16650. f.push(this.getLineRange(c, !0));
  16651. (l = this.getLineRange(o, !0)),
  16652. (l.end.column = n.end.column),
  16653. f.push(l),
  16654. f.forEach(this.addRange, this);
  16655. }
  16656. }),
  16657. (this.toggleBlockSelection = function () {
  16658. if (this.rangeCount > 1) {
  16659. var e = this.rangeList.ranges,
  16660. t = e[e.length - 1],
  16661. n = i.fromPoints(e[0].start, t.end);
  16662. this.toSingleRange(),
  16663. this.setSelectionRange(n, t.cursor == t.start);
  16664. } else {
  16665. var r = this.session.documentToScreenPosition(this.cursor),
  16666. s = this.session.documentToScreenPosition(this.anchor),
  16667. o = this.rectangularRangeBlock(r, s);
  16668. o.forEach(this.addRange, this);
  16669. }
  16670. }),
  16671. (this.rectangularRangeBlock = function (e, t, n) {
  16672. var r = [],
  16673. s = e.column < t.column;
  16674. if (s)
  16675. var o = e.column,
  16676. u = t.column,
  16677. a = e.offsetX,
  16678. f = t.offsetX;
  16679. else
  16680. var o = t.column,
  16681. u = e.column,
  16682. a = t.offsetX,
  16683. f = e.offsetX;
  16684. var l = e.row < t.row;
  16685. if (l)
  16686. var c = e.row,
  16687. h = t.row;
  16688. else
  16689. var c = t.row,
  16690. h = e.row;
  16691. o < 0 && (o = 0), c < 0 && (c = 0), c == h && (n = !0);
  16692. var p;
  16693. for (var d = c; d <= h; d++) {
  16694. var m = i.fromPoints(
  16695. this.session.screenToDocumentPosition(d, o, a),
  16696. this.session.screenToDocumentPosition(d, u, f)
  16697. );
  16698. if (m.isEmpty()) {
  16699. if (p && v(m.end, p)) break;
  16700. p = m.end;
  16701. }
  16702. (m.cursor = s ? m.start : m.end), r.push(m);
  16703. }
  16704. l && r.reverse();
  16705. if (!n) {
  16706. var g = r.length - 1;
  16707. while (r[g].isEmpty() && g > 0) g--;
  16708. if (g > 0) {
  16709. var y = 0;
  16710. while (r[y].isEmpty()) y++;
  16711. }
  16712. for (var b = g; b >= y; b--) r[b].isEmpty() && r.splice(b, 1);
  16713. }
  16714. return r;
  16715. });
  16716. }.call(s.prototype);
  16717. var d = e("./editor").Editor;
  16718. (function () {
  16719. (this.updateSelectionMarkers = function () {
  16720. this.renderer.updateCursor(), this.renderer.updateBackMarkers();
  16721. }),
  16722. (this.addSelectionMarker = function (e) {
  16723. e.cursor || (e.cursor = e.end);
  16724. var t = this.getSelectionStyle();
  16725. return (
  16726. (e.marker = this.session.addMarker(e, "ace_selection", t)),
  16727. this.session.$selectionMarkers.push(e),
  16728. (this.session.selectionMarkerCount =
  16729. this.session.$selectionMarkers.length),
  16730. e
  16731. );
  16732. }),
  16733. (this.removeSelectionMarker = function (e) {
  16734. if (!e.marker) return;
  16735. this.session.removeMarker(e.marker);
  16736. var t = this.session.$selectionMarkers.indexOf(e);
  16737. t != -1 && this.session.$selectionMarkers.splice(t, 1),
  16738. (this.session.selectionMarkerCount =
  16739. this.session.$selectionMarkers.length);
  16740. }),
  16741. (this.removeSelectionMarkers = function (e) {
  16742. var t = this.session.$selectionMarkers;
  16743. for (var n = e.length; n--; ) {
  16744. var r = e[n];
  16745. if (!r.marker) continue;
  16746. this.session.removeMarker(r.marker);
  16747. var i = t.indexOf(r);
  16748. i != -1 && t.splice(i, 1);
  16749. }
  16750. this.session.selectionMarkerCount = t.length;
  16751. }),
  16752. (this.$onAddRange = function (e) {
  16753. this.addSelectionMarker(e.range),
  16754. this.renderer.updateCursor(),
  16755. this.renderer.updateBackMarkers();
  16756. }),
  16757. (this.$onRemoveRange = function (e) {
  16758. this.removeSelectionMarkers(e.ranges),
  16759. this.renderer.updateCursor(),
  16760. this.renderer.updateBackMarkers();
  16761. }),
  16762. (this.$onMultiSelect = function (e) {
  16763. if (this.inMultiSelectMode) return;
  16764. (this.inMultiSelectMode = !0),
  16765. this.setStyle("ace_multiselect"),
  16766. this.keyBinding.addKeyboardHandler(f.keyboardHandler),
  16767. this.commands.setDefaultHandler("exec", this.$onMultiSelectExec),
  16768. this.renderer.updateCursor(),
  16769. this.renderer.updateBackMarkers();
  16770. }),
  16771. (this.$onSingleSelect = function (e) {
  16772. if (this.session.multiSelect.inVirtualMode) return;
  16773. (this.inMultiSelectMode = !1),
  16774. this.unsetStyle("ace_multiselect"),
  16775. this.keyBinding.removeKeyboardHandler(f.keyboardHandler),
  16776. this.commands.removeDefaultHandler(
  16777. "exec",
  16778. this.$onMultiSelectExec
  16779. ),
  16780. this.renderer.updateCursor(),
  16781. this.renderer.updateBackMarkers(),
  16782. this._emit("changeSelection");
  16783. }),
  16784. (this.$onMultiSelectExec = function (e) {
  16785. var t = e.command,
  16786. n = e.editor;
  16787. if (!n.multiSelect) return;
  16788. if (!t.multiSelectAction) {
  16789. var r = t.exec(n, e.args || {});
  16790. n.multiSelect.addRange(n.multiSelect.toOrientedRange()),
  16791. n.multiSelect.mergeOverlappingRanges();
  16792. } else
  16793. t.multiSelectAction == "forEach"
  16794. ? (r = n.forEachSelection(t, e.args))
  16795. : t.multiSelectAction == "forEachLine"
  16796. ? (r = n.forEachSelection(t, e.args, !0))
  16797. : t.multiSelectAction == "single"
  16798. ? (n.exitMultiSelectMode(), (r = t.exec(n, e.args || {})))
  16799. : (r = t.multiSelectAction(n, e.args || {}));
  16800. return r;
  16801. }),
  16802. (this.forEachSelection = function (e, t, n) {
  16803. if (this.inVirtualSelectionMode) return;
  16804. var r = n && n.keepOrder,
  16805. i = n == 1 || (n && n.$byLines),
  16806. o = this.session,
  16807. u = this.selection,
  16808. a = u.rangeList,
  16809. f = (r ? u : a).ranges,
  16810. l;
  16811. if (!f.length)
  16812. return e.exec ? e.exec(this, t || {}) : e(this, t || {});
  16813. var c = u._eventRegistry;
  16814. u._eventRegistry = {};
  16815. var h = new s(o);
  16816. this.inVirtualSelectionMode = !0;
  16817. for (var p = f.length; p--; ) {
  16818. if (i) while (p > 0 && f[p].start.row == f[p - 1].end.row) p--;
  16819. h.fromOrientedRange(f[p]),
  16820. (h.index = p),
  16821. (this.selection = o.selection = h);
  16822. var d = e.exec ? e.exec(this, t || {}) : e(this, t || {});
  16823. !l && d !== undefined && (l = d), h.toOrientedRange(f[p]);
  16824. }
  16825. h.detach(),
  16826. (this.selection = o.selection = u),
  16827. (this.inVirtualSelectionMode = !1),
  16828. (u._eventRegistry = c),
  16829. u.mergeOverlappingRanges(),
  16830. u.ranges[0] && u.fromOrientedRange(u.ranges[0]);
  16831. var v = this.renderer.$scrollAnimation;
  16832. return (
  16833. this.onCursorChange(),
  16834. this.onSelectionChange(),
  16835. v && v.from == v.to && this.renderer.animateScrolling(v.from),
  16836. l
  16837. );
  16838. }),
  16839. (this.exitMultiSelectMode = function () {
  16840. if (!this.inMultiSelectMode || this.inVirtualSelectionMode) return;
  16841. this.multiSelect.toSingleRange();
  16842. }),
  16843. (this.getSelectedText = function () {
  16844. var e = "";
  16845. if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
  16846. var t = this.multiSelect.rangeList.ranges,
  16847. n = [];
  16848. for (var r = 0; r < t.length; r++)
  16849. n.push(this.session.getTextRange(t[r]));
  16850. var i = this.session.getDocument().getNewLineCharacter();
  16851. (e = n.join(i)),
  16852. e.length == (n.length - 1) * i.length && (e = "");
  16853. } else
  16854. this.selection.isEmpty() ||
  16855. (e = this.session.getTextRange(this.getSelectionRange()));
  16856. return e;
  16857. }),
  16858. (this.$checkMultiselectChange = function (e, t) {
  16859. if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
  16860. var n = this.multiSelect.ranges[0];
  16861. if (this.multiSelect.isEmpty() && t == this.multiSelect.anchor)
  16862. return;
  16863. var r =
  16864. t == this.multiSelect.anchor
  16865. ? n.cursor == n.start
  16866. ? n.end
  16867. : n.start
  16868. : n.cursor;
  16869. r.row != t.row ||
  16870. this.session.$clipPositionToDocument(r.row, r.column).column !=
  16871. t.column
  16872. ? this.multiSelect.toSingleRange(
  16873. this.multiSelect.toOrientedRange()
  16874. )
  16875. : this.multiSelect.mergeOverlappingRanges();
  16876. }
  16877. }),
  16878. (this.findAll = function (e, t, n) {
  16879. (t = t || {}), (t.needle = e || t.needle);
  16880. if (t.needle == undefined) {
  16881. var r = this.selection.isEmpty()
  16882. ? this.selection.getWordRange()
  16883. : this.selection.getRange();
  16884. t.needle = this.session.getTextRange(r);
  16885. }
  16886. this.$search.set(t);
  16887. var i = this.$search.findAll(this.session);
  16888. if (!i.length) return 0;
  16889. var s = this.multiSelect;
  16890. n || s.toSingleRange(i[0]);
  16891. for (var o = i.length; o--; ) s.addRange(i[o], !0);
  16892. return (
  16893. r && s.rangeList.rangeAtPoint(r.start) && s.addRange(r, !0),
  16894. i.length
  16895. );
  16896. }),
  16897. (this.selectMoreLines = function (e, t) {
  16898. var n = this.selection.toOrientedRange(),
  16899. r = n.cursor == n.end,
  16900. s = this.session.documentToScreenPosition(n.cursor);
  16901. this.selection.$desiredColumn &&
  16902. (s.column = this.selection.$desiredColumn);
  16903. var o = this.session.screenToDocumentPosition(s.row + e, s.column);
  16904. if (!n.isEmpty())
  16905. var u = this.session.documentToScreenPosition(
  16906. r ? n.end : n.start
  16907. ),
  16908. a = this.session.screenToDocumentPosition(u.row + e, u.column);
  16909. else var a = o;
  16910. if (r) {
  16911. var f = i.fromPoints(o, a);
  16912. f.cursor = f.start;
  16913. } else {
  16914. var f = i.fromPoints(a, o);
  16915. f.cursor = f.end;
  16916. }
  16917. f.desiredColumn = s.column;
  16918. if (!this.selection.inMultiSelectMode) this.selection.addRange(n);
  16919. else if (t) var l = n.cursor;
  16920. this.selection.addRange(f), l && this.selection.substractPoint(l);
  16921. }),
  16922. (this.transposeSelections = function (e) {
  16923. var t = this.session,
  16924. n = t.multiSelect,
  16925. r = n.ranges;
  16926. for (var i = r.length; i--; ) {
  16927. var s = r[i];
  16928. if (s.isEmpty()) {
  16929. var o = t.getWordRange(s.start.row, s.start.column);
  16930. (s.start.row = o.start.row),
  16931. (s.start.column = o.start.column),
  16932. (s.end.row = o.end.row),
  16933. (s.end.column = o.end.column);
  16934. }
  16935. }
  16936. n.mergeOverlappingRanges();
  16937. var u = [];
  16938. for (var i = r.length; i--; ) {
  16939. var s = r[i];
  16940. u.unshift(t.getTextRange(s));
  16941. }
  16942. e < 0 ? u.unshift(u.pop()) : u.push(u.shift());
  16943. for (var i = r.length; i--; ) {
  16944. var s = r[i],
  16945. o = s.clone();
  16946. t.replace(s, u[i]),
  16947. (s.start.row = o.start.row),
  16948. (s.start.column = o.start.column);
  16949. }
  16950. n.fromOrientedRange(n.ranges[0]);
  16951. }),
  16952. (this.selectMore = function (e, t, n) {
  16953. var r = this.session,
  16954. i = r.multiSelect,
  16955. s = i.toOrientedRange();
  16956. if (s.isEmpty()) {
  16957. (s = r.getWordRange(s.start.row, s.start.column)),
  16958. (s.cursor = e == -1 ? s.start : s.end),
  16959. this.multiSelect.addRange(s);
  16960. if (n) return;
  16961. }
  16962. var o = r.getTextRange(s),
  16963. u = h(r, o, e);
  16964. u &&
  16965. ((u.cursor = e == -1 ? u.start : u.end),
  16966. this.session.unfold(u),
  16967. this.multiSelect.addRange(u),
  16968. this.renderer.scrollCursorIntoView(null, 0.5)),
  16969. t && this.multiSelect.substractPoint(s.cursor);
  16970. }),
  16971. (this.alignCursors = function () {
  16972. var e = this.session,
  16973. t = e.multiSelect,
  16974. n = t.ranges,
  16975. r = -1,
  16976. s = n.filter(function (e) {
  16977. if (e.cursor.row == r) return !0;
  16978. r = e.cursor.row;
  16979. });
  16980. if (!n.length || s.length == n.length - 1) {
  16981. var o = this.selection.getRange(),
  16982. u = o.start.row,
  16983. f = o.end.row,
  16984. l = u == f;
  16985. if (l) {
  16986. var c = this.session.getLength(),
  16987. h;
  16988. do h = this.session.getLine(f);
  16989. while (/[=:]/.test(h) && ++f < c);
  16990. do h = this.session.getLine(u);
  16991. while (/[=:]/.test(h) && --u > 0);
  16992. u < 0 && (u = 0), f >= c && (f = c - 1);
  16993. }
  16994. var p = this.session.removeFullLines(u, f);
  16995. (p = this.$reAlignText(p, l)),
  16996. this.session.insert({ row: u, column: 0 }, p.join("\n") + "\n"),
  16997. l ||
  16998. ((o.start.column = 0),
  16999. (o.end.column = p[p.length - 1].length)),
  17000. this.selection.setRange(o);
  17001. } else {
  17002. s.forEach(function (e) {
  17003. t.substractPoint(e.cursor);
  17004. });
  17005. var d = 0,
  17006. v = Infinity,
  17007. m = n.map(function (t) {
  17008. var n = t.cursor,
  17009. r = e.getLine(n.row),
  17010. i = r.substr(n.column).search(/\S/g);
  17011. return (
  17012. i == -1 && (i = 0),
  17013. n.column > d && (d = n.column),
  17014. i < v && (v = i),
  17015. i
  17016. );
  17017. });
  17018. n.forEach(function (t, n) {
  17019. var r = t.cursor,
  17020. s = d - r.column,
  17021. o = m[n] - v;
  17022. s > o
  17023. ? e.insert(r, a.stringRepeat(" ", s - o))
  17024. : e.remove(new i(r.row, r.column, r.row, r.column - s + o)),
  17025. (t.start.column = t.end.column = d),
  17026. (t.start.row = t.end.row = r.row),
  17027. (t.cursor = t.end);
  17028. }),
  17029. t.fromOrientedRange(n[0]),
  17030. this.renderer.updateCursor(),
  17031. this.renderer.updateBackMarkers();
  17032. }
  17033. }),
  17034. (this.$reAlignText = function (e, t) {
  17035. function u(e) {
  17036. return a.stringRepeat(" ", e);
  17037. }
  17038. function f(e) {
  17039. return e[2]
  17040. ? u(i) +
  17041. e[2] +
  17042. u(s - e[2].length + o) +
  17043. e[4].replace(/^([=:])\s+/, "$1 ")
  17044. : e[0];
  17045. }
  17046. function l(e) {
  17047. return e[2]
  17048. ? u(i + s - e[2].length) +
  17049. e[2] +
  17050. u(o) +
  17051. e[4].replace(/^([=:])\s+/, "$1 ")
  17052. : e[0];
  17053. }
  17054. function c(e) {
  17055. return e[2]
  17056. ? u(i) + e[2] + u(o) + e[4].replace(/^([=:])\s+/, "$1 ")
  17057. : e[0];
  17058. }
  17059. var n = !0,
  17060. r = !0,
  17061. i,
  17062. s,
  17063. o;
  17064. return e
  17065. .map(function (e) {
  17066. var t = e.match(/(\s*)(.*?)(\s*)([=:].*)/);
  17067. return t
  17068. ? i == null
  17069. ? ((i = t[1].length),
  17070. (s = t[2].length),
  17071. (o = t[3].length),
  17072. t)
  17073. : (i + s + o != t[1].length + t[2].length + t[3].length &&
  17074. (r = !1),
  17075. i != t[1].length && (n = !1),
  17076. i > t[1].length && (i = t[1].length),
  17077. s < t[2].length && (s = t[2].length),
  17078. o > t[3].length && (o = t[3].length),
  17079. t)
  17080. : [e];
  17081. })
  17082. .map(t ? f : n ? (r ? l : f) : c);
  17083. });
  17084. }).call(d.prototype),
  17085. (t.onSessionChange = function (e) {
  17086. var t = e.session;
  17087. t &&
  17088. !t.multiSelect &&
  17089. ((t.$selectionMarkers = []),
  17090. t.selection.$initRangeList(),
  17091. (t.multiSelect = t.selection)),
  17092. (this.multiSelect = t && t.multiSelect);
  17093. var n = e.oldSession;
  17094. n &&
  17095. (n.multiSelect.off("addRange", this.$onAddRange),
  17096. n.multiSelect.off("removeRange", this.$onRemoveRange),
  17097. n.multiSelect.off("multiSelect", this.$onMultiSelect),
  17098. n.multiSelect.off("singleSelect", this.$onSingleSelect),
  17099. n.multiSelect.lead.off("change", this.$checkMultiselectChange),
  17100. n.multiSelect.anchor.off("change", this.$checkMultiselectChange)),
  17101. t &&
  17102. (t.multiSelect.on("addRange", this.$onAddRange),
  17103. t.multiSelect.on("removeRange", this.$onRemoveRange),
  17104. t.multiSelect.on("multiSelect", this.$onMultiSelect),
  17105. t.multiSelect.on("singleSelect", this.$onSingleSelect),
  17106. t.multiSelect.lead.on("change", this.$checkMultiselectChange),
  17107. t.multiSelect.anchor.on("change", this.$checkMultiselectChange)),
  17108. t &&
  17109. this.inMultiSelectMode != t.selection.inMultiSelectMode &&
  17110. (t.selection.inMultiSelectMode
  17111. ? this.$onMultiSelect()
  17112. : this.$onSingleSelect());
  17113. }),
  17114. (t.MultiSelect = m),
  17115. e("./config").defineOptions(d.prototype, "editor", {
  17116. enableMultiselect: {
  17117. set: function (e) {
  17118. m(this),
  17119. e
  17120. ? (this.on("changeSession", this.$multiselectOnSessionChange),
  17121. this.on("mousedown", o))
  17122. : (this.off(
  17123. "changeSession",
  17124. this.$multiselectOnSessionChange
  17125. ),
  17126. this.off("mousedown", o));
  17127. },
  17128. value: !0,
  17129. },
  17130. enableBlockSelect: {
  17131. set: function (e) {
  17132. this.$blockSelectEnabled = e;
  17133. },
  17134. value: !0,
  17135. },
  17136. });
  17137. }
  17138. ),
  17139. define(
  17140. "ace/mode/folding/fold_mode",
  17141. ["require", "exports", "module", "ace/range"],
  17142. function (e, t, n) {
  17143. "use strict";
  17144. var r = e("../../range").Range,
  17145. i = (t.FoldMode = function () {});
  17146. (function () {
  17147. (this.foldingStartMarker = null),
  17148. (this.foldingStopMarker = null),
  17149. (this.getFoldWidget = function (e, t, n) {
  17150. var r = e.getLine(n);
  17151. return this.foldingStartMarker.test(r)
  17152. ? "start"
  17153. : t == "markbeginend" &&
  17154. this.foldingStopMarker &&
  17155. this.foldingStopMarker.test(r)
  17156. ? "end"
  17157. : "";
  17158. }),
  17159. (this.getFoldWidgetRange = function (e, t, n) {
  17160. return null;
  17161. }),
  17162. (this.indentationBlock = function (e, t, n) {
  17163. var i = /\S/,
  17164. s = e.getLine(t),
  17165. o = s.search(i);
  17166. if (o == -1) return;
  17167. var u = n || s.length,
  17168. a = e.getLength(),
  17169. f = t,
  17170. l = t;
  17171. while (++t < a) {
  17172. var c = e.getLine(t).search(i);
  17173. if (c == -1) continue;
  17174. if (c <= o) break;
  17175. l = t;
  17176. }
  17177. if (l > f) {
  17178. var h = e.getLine(l).length;
  17179. return new r(f, u, l, h);
  17180. }
  17181. }),
  17182. (this.openingBracketBlock = function (e, t, n, i, s) {
  17183. var o = { row: n, column: i + 1 },
  17184. u = e.$findClosingBracket(t, o, s);
  17185. if (!u) return;
  17186. var a = e.foldWidgets[u.row];
  17187. return (
  17188. a == null && (a = e.getFoldWidget(u.row)),
  17189. a == "start" &&
  17190. u.row > o.row &&
  17191. (u.row--, (u.column = e.getLine(u.row).length)),
  17192. r.fromPoints(o, u)
  17193. );
  17194. }),
  17195. (this.closingBracketBlock = function (e, t, n, i, s) {
  17196. var o = { row: n, column: i },
  17197. u = e.$findOpeningBracket(t, o);
  17198. if (!u) return;
  17199. return u.column++, o.column--, r.fromPoints(u, o);
  17200. });
  17201. }).call(i.prototype);
  17202. }
  17203. ),
  17204. define(
  17205. "ace/theme/textmate",
  17206. ["require", "exports", "module", "ace/lib/dom"],
  17207. function (e, t, n) {
  17208. "use strict";
  17209. (t.isDark = !1),
  17210. (t.cssClass = "ace-tm"),
  17211. (t.cssText =
  17212. '.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}'),
  17213. (t.$id = "ace/theme/textmate");
  17214. var r = e("../lib/dom");
  17215. r.importCssString(t.cssText, t.cssClass);
  17216. }
  17217. ),
  17218. define(
  17219. "ace/line_widgets",
  17220. ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/range"],
  17221. function (e, t, n) {
  17222. "use strict";
  17223. function o(e) {
  17224. (this.session = e),
  17225. (this.session.widgetManager = this),
  17226. (this.session.getRowLength = this.getRowLength),
  17227. (this.session.$getWidgetScreenLength = this.$getWidgetScreenLength),
  17228. (this.updateOnChange = this.updateOnChange.bind(this)),
  17229. (this.renderWidgets = this.renderWidgets.bind(this)),
  17230. (this.measureWidgets = this.measureWidgets.bind(this)),
  17231. (this.session._changedWidgets = []),
  17232. (this.$onChangeEditor = this.$onChangeEditor.bind(this)),
  17233. this.session.on("change", this.updateOnChange),
  17234. this.session.on("changeFold", this.updateOnFold),
  17235. this.session.on("changeEditor", this.$onChangeEditor);
  17236. }
  17237. var r = e("./lib/oop"),
  17238. i = e("./lib/dom"),
  17239. s = e("./range").Range;
  17240. (function () {
  17241. (this.getRowLength = function (e) {
  17242. var t;
  17243. return (
  17244. this.lineWidgets
  17245. ? (t = (this.lineWidgets[e] && this.lineWidgets[e].rowCount) || 0)
  17246. : (t = 0),
  17247. !this.$useWrapMode || !this.$wrapData[e]
  17248. ? 1 + t
  17249. : this.$wrapData[e].length + 1 + t
  17250. );
  17251. }),
  17252. (this.$getWidgetScreenLength = function () {
  17253. var e = 0;
  17254. return (
  17255. this.lineWidgets.forEach(function (t) {
  17256. t && t.rowCount && !t.hidden && (e += t.rowCount);
  17257. }),
  17258. e
  17259. );
  17260. }),
  17261. (this.$onChangeEditor = function (e) {
  17262. this.attach(e.editor);
  17263. }),
  17264. (this.attach = function (e) {
  17265. e &&
  17266. e.widgetManager &&
  17267. e.widgetManager != this &&
  17268. e.widgetManager.detach();
  17269. if (this.editor == e) return;
  17270. this.detach(),
  17271. (this.editor = e),
  17272. e &&
  17273. ((e.widgetManager = this),
  17274. e.renderer.on("beforeRender", this.measureWidgets),
  17275. e.renderer.on("afterRender", this.renderWidgets));
  17276. }),
  17277. (this.detach = function (e) {
  17278. var t = this.editor;
  17279. if (!t) return;
  17280. (this.editor = null),
  17281. (t.widgetManager = null),
  17282. t.renderer.off("beforeRender", this.measureWidgets),
  17283. t.renderer.off("afterRender", this.renderWidgets);
  17284. var n = this.session.lineWidgets;
  17285. n &&
  17286. n.forEach(function (e) {
  17287. e &&
  17288. e.el &&
  17289. e.el.parentNode &&
  17290. ((e._inDocument = !1), e.el.parentNode.removeChild(e.el));
  17291. });
  17292. }),
  17293. (this.updateOnFold = function (e, t) {
  17294. var n = t.lineWidgets;
  17295. if (!n || !e.action) return;
  17296. var r = e.data,
  17297. i = r.start.row,
  17298. s = r.end.row,
  17299. o = e.action == "add";
  17300. for (var u = i + 1; u < s; u++) n[u] && (n[u].hidden = o);
  17301. n[s] &&
  17302. (o
  17303. ? n[i]
  17304. ? (n[s].hidden = o)
  17305. : (n[i] = n[s])
  17306. : (n[i] == n[s] && (n[i] = undefined), (n[s].hidden = o)));
  17307. }),
  17308. (this.updateOnChange = function (e) {
  17309. var t = this.session.lineWidgets;
  17310. if (!t) return;
  17311. var n = e.start.row,
  17312. r = e.end.row - n;
  17313. if (r !== 0)
  17314. if (e.action == "remove") {
  17315. var i = t.splice(n + 1, r);
  17316. i.forEach(function (e) {
  17317. e && this.removeLineWidget(e);
  17318. }, this),
  17319. this.$updateRows();
  17320. } else {
  17321. var s = new Array(r);
  17322. s.unshift(n, 0), t.splice.apply(t, s), this.$updateRows();
  17323. }
  17324. }),
  17325. (this.$updateRows = function () {
  17326. var e = this.session.lineWidgets;
  17327. if (!e) return;
  17328. var t = !0;
  17329. e.forEach(function (e, n) {
  17330. if (e) {
  17331. (t = !1), (e.row = n);
  17332. while (e.$oldWidget) (e.$oldWidget.row = n), (e = e.$oldWidget);
  17333. }
  17334. }),
  17335. t && (this.session.lineWidgets = null);
  17336. }),
  17337. (this.addLineWidget = function (e) {
  17338. this.session.lineWidgets ||
  17339. (this.session.lineWidgets = new Array(this.session.getLength()));
  17340. var t = this.session.lineWidgets[e.row];
  17341. t &&
  17342. ((e.$oldWidget = t),
  17343. t.el &&
  17344. t.el.parentNode &&
  17345. (t.el.parentNode.removeChild(t.el), (t._inDocument = !1))),
  17346. (this.session.lineWidgets[e.row] = e),
  17347. (e.session = this.session);
  17348. var n = this.editor.renderer;
  17349. e.html &&
  17350. !e.el &&
  17351. ((e.el = i.createElement("div")), (e.el.innerHTML = e.html)),
  17352. e.el &&
  17353. (i.addCssClass(e.el, "ace_lineWidgetContainer"),
  17354. (e.el.style.position = "absolute"),
  17355. (e.el.style.zIndex = 5),
  17356. n.container.appendChild(e.el),
  17357. (e._inDocument = !0)),
  17358. e.coverGutter || (e.el.style.zIndex = 3),
  17359. e.pixelHeight == null && (e.pixelHeight = e.el.offsetHeight),
  17360. e.rowCount == null &&
  17361. (e.rowCount = e.pixelHeight / n.layerConfig.lineHeight);
  17362. var r = this.session.getFoldAt(e.row, 0);
  17363. e.$fold = r;
  17364. if (r) {
  17365. var s = this.session.lineWidgets;
  17366. e.row == r.end.row && !s[r.start.row]
  17367. ? (s[r.start.row] = e)
  17368. : (e.hidden = !0);
  17369. }
  17370. return (
  17371. this.session._emit("changeFold", {
  17372. data: { start: { row: e.row } },
  17373. }),
  17374. this.$updateRows(),
  17375. this.renderWidgets(null, n),
  17376. this.onWidgetChanged(e),
  17377. e
  17378. );
  17379. }),
  17380. (this.removeLineWidget = function (e) {
  17381. (e._inDocument = !1),
  17382. (e.session = null),
  17383. e.el && e.el.parentNode && e.el.parentNode.removeChild(e.el);
  17384. if (e.editor && e.editor.destroy)
  17385. try {
  17386. e.editor.destroy();
  17387. } catch (t) {}
  17388. if (this.session.lineWidgets) {
  17389. var n = this.session.lineWidgets[e.row];
  17390. if (n == e)
  17391. (this.session.lineWidgets[e.row] = e.$oldWidget),
  17392. e.$oldWidget && this.onWidgetChanged(e.$oldWidget);
  17393. else
  17394. while (n) {
  17395. if (n.$oldWidget == e) {
  17396. n.$oldWidget = e.$oldWidget;
  17397. break;
  17398. }
  17399. n = n.$oldWidget;
  17400. }
  17401. }
  17402. this.session._emit("changeFold", {
  17403. data: { start: { row: e.row } },
  17404. }),
  17405. this.$updateRows();
  17406. }),
  17407. (this.getWidgetsAtRow = function (e) {
  17408. var t = this.session.lineWidgets,
  17409. n = t && t[e],
  17410. r = [];
  17411. while (n) r.push(n), (n = n.$oldWidget);
  17412. return r;
  17413. }),
  17414. (this.onWidgetChanged = function (e) {
  17415. this.session._changedWidgets.push(e),
  17416. this.editor && this.editor.renderer.updateFull();
  17417. }),
  17418. (this.measureWidgets = function (e, t) {
  17419. var n = this.session._changedWidgets,
  17420. r = t.layerConfig;
  17421. if (!n || !n.length) return;
  17422. var i = Infinity;
  17423. for (var s = 0; s < n.length; s++) {
  17424. var o = n[s];
  17425. if (!o || !o.el) continue;
  17426. if (o.session != this.session) continue;
  17427. if (!o._inDocument) {
  17428. if (this.session.lineWidgets[o.row] != o) continue;
  17429. (o._inDocument = !0), t.container.appendChild(o.el);
  17430. }
  17431. (o.h = o.el.offsetHeight),
  17432. o.fixedWidth ||
  17433. ((o.w = o.el.offsetWidth),
  17434. (o.screenWidth = Math.ceil(o.w / r.characterWidth)));
  17435. var u = o.h / r.lineHeight;
  17436. o.coverLine &&
  17437. ((u -= this.session.getRowLineCount(o.row)), u < 0 && (u = 0)),
  17438. o.rowCount != u && ((o.rowCount = u), o.row < i && (i = o.row));
  17439. }
  17440. i != Infinity &&
  17441. (this.session._emit("changeFold", {
  17442. data: { start: { row: i } },
  17443. }),
  17444. (this.session.lineWidgetWidth = null)),
  17445. (this.session._changedWidgets = []);
  17446. }),
  17447. (this.renderWidgets = function (e, t) {
  17448. var n = t.layerConfig,
  17449. r = this.session.lineWidgets;
  17450. if (!r) return;
  17451. var i = Math.min(this.firstRow, n.firstRow),
  17452. s = Math.max(this.lastRow, n.lastRow, r.length);
  17453. while (i > 0 && !r[i]) i--;
  17454. (this.firstRow = n.firstRow),
  17455. (this.lastRow = n.lastRow),
  17456. (t.$cursorLayer.config = n);
  17457. for (var o = i; o <= s; o++) {
  17458. var u = r[o];
  17459. if (!u || !u.el) continue;
  17460. if (u.hidden) {
  17461. u.el.style.top = -100 - (u.pixelHeight || 0) + "px";
  17462. continue;
  17463. }
  17464. u._inDocument ||
  17465. ((u._inDocument = !0), t.container.appendChild(u.el));
  17466. var a = t.$cursorLayer.getPixelPosition(
  17467. { row: o, column: 0 },
  17468. !0
  17469. ).top;
  17470. u.coverLine ||
  17471. (a += n.lineHeight * this.session.getRowLineCount(u.row)),
  17472. (u.el.style.top = a - n.offset + "px");
  17473. var f = u.coverGutter ? 0 : t.gutterWidth;
  17474. u.fixedWidth || (f -= t.scrollLeft),
  17475. (u.el.style.left = f + "px"),
  17476. u.fullWidth &&
  17477. u.screenWidth &&
  17478. (u.el.style.minWidth = n.width + 2 * n.padding + "px"),
  17479. u.fixedWidth
  17480. ? (u.el.style.right = t.scrollBar.getWidth() + "px")
  17481. : (u.el.style.right = "");
  17482. }
  17483. });
  17484. }).call(o.prototype),
  17485. (t.LineWidgets = o);
  17486. }
  17487. ),
  17488. define(
  17489. "ace/ext/error_marker",
  17490. [
  17491. "require",
  17492. "exports",
  17493. "module",
  17494. "ace/line_widgets",
  17495. "ace/lib/dom",
  17496. "ace/range",
  17497. ],
  17498. function (e, t, n) {
  17499. "use strict";
  17500. function o(e, t, n) {
  17501. var r = 0,
  17502. i = e.length - 1;
  17503. while (r <= i) {
  17504. var s = (r + i) >> 1,
  17505. o = n(t, e[s]);
  17506. if (o > 0) r = s + 1;
  17507. else {
  17508. if (!(o < 0)) return s;
  17509. i = s - 1;
  17510. }
  17511. }
  17512. return -(r + 1);
  17513. }
  17514. function u(e, t, n) {
  17515. var r = e.getAnnotations().sort(s.comparePoints);
  17516. if (!r.length) return;
  17517. var i = o(r, { row: t, column: -1 }, s.comparePoints);
  17518. i < 0 && (i = -i - 1),
  17519. i >= r.length
  17520. ? (i = n > 0 ? 0 : r.length - 1)
  17521. : i === 0 && n < 0 && (i = r.length - 1);
  17522. var u = r[i];
  17523. if (!u || !n) return;
  17524. if (u.row === t) {
  17525. do u = r[(i += n)];
  17526. while (u && u.row === t);
  17527. if (!u) return r.slice();
  17528. }
  17529. var a = [];
  17530. t = u.row;
  17531. do a[n < 0 ? "unshift" : "push"](u), (u = r[(i += n)]);
  17532. while (u && u.row == t);
  17533. return a.length && a;
  17534. }
  17535. var r = e("../line_widgets").LineWidgets,
  17536. i = e("../lib/dom"),
  17537. s = e("../range").Range;
  17538. (t.showErrorMarker = function (e, t) {
  17539. var n = e.session;
  17540. n.widgetManager ||
  17541. ((n.widgetManager = new r(n)), n.widgetManager.attach(e));
  17542. var s = e.getCursorPosition(),
  17543. o = s.row,
  17544. a = n.widgetManager.getWidgetsAtRow(o).filter(function (e) {
  17545. return e.type == "errorMarker";
  17546. })[0];
  17547. a ? a.destroy() : (o -= t);
  17548. var f = u(n, o, t),
  17549. l;
  17550. if (f) {
  17551. var c = f[0];
  17552. (s.column =
  17553. (c.pos && typeof c.column != "number" ? c.pos.sc : c.column) || 0),
  17554. (s.row = c.row),
  17555. (l = e.renderer.$gutterLayer.$annotations[s.row]);
  17556. } else {
  17557. if (a) return;
  17558. l = { text: ["Looks good!"], className: "ace_ok" };
  17559. }
  17560. e.session.unfold(s.row), e.selection.moveToPosition(s);
  17561. var h = {
  17562. row: s.row,
  17563. fixedWidth: !0,
  17564. coverGutter: !0,
  17565. el: i.createElement("div"),
  17566. type: "errorMarker",
  17567. },
  17568. p = h.el.appendChild(i.createElement("div")),
  17569. d = h.el.appendChild(i.createElement("div"));
  17570. d.className = "error_widget_arrow " + l.className;
  17571. var v = e.renderer.$cursorLayer.getPixelPosition(s).left;
  17572. (d.style.left = v + e.renderer.gutterWidth - 5 + "px"),
  17573. (h.el.className = "error_widget_wrapper"),
  17574. (p.className = "error_widget " + l.className),
  17575. (p.innerHTML = l.text.join("<br>")),
  17576. p.appendChild(i.createElement("div"));
  17577. var m = function (e, t, n) {
  17578. if (t === 0 && (n === "esc" || n === "return"))
  17579. return h.destroy(), { command: "null" };
  17580. };
  17581. (h.destroy = function () {
  17582. if (e.$mouseHandler.isMousePressed) return;
  17583. e.keyBinding.removeKeyboardHandler(m),
  17584. n.widgetManager.removeLineWidget(h),
  17585. e.off("changeSelection", h.destroy),
  17586. e.off("changeSession", h.destroy),
  17587. e.off("mouseup", h.destroy),
  17588. e.off("change", h.destroy);
  17589. }),
  17590. e.keyBinding.addKeyboardHandler(m),
  17591. e.on("changeSelection", h.destroy),
  17592. e.on("changeSession", h.destroy),
  17593. e.on("mouseup", h.destroy),
  17594. e.on("change", h.destroy),
  17595. e.session.widgetManager.addLineWidget(h),
  17596. (h.el.onmousedown = e.focus.bind(e)),
  17597. e.renderer.scrollCursorIntoView(null, 0.5, {
  17598. bottom: h.el.offsetHeight,
  17599. });
  17600. }),
  17601. i.importCssString(
  17602. " .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }",
  17603. ""
  17604. );
  17605. }
  17606. ),
  17607. define(
  17608. "ace/ace",
  17609. [
  17610. "require",
  17611. "exports",
  17612. "module",
  17613. "ace/lib/fixoldbrowsers",
  17614. "ace/lib/dom",
  17615. "ace/lib/event",
  17616. "ace/range",
  17617. "ace/editor",
  17618. "ace/edit_session",
  17619. "ace/undomanager",
  17620. "ace/virtual_renderer",
  17621. "ace/worker/worker_client",
  17622. "ace/keyboard/hash_handler",
  17623. "ace/placeholder",
  17624. "ace/multi_select",
  17625. "ace/mode/folding/fold_mode",
  17626. "ace/theme/textmate",
  17627. "ace/ext/error_marker",
  17628. "ace/config",
  17629. ],
  17630. function (e, t, n) {
  17631. "use strict";
  17632. e("./lib/fixoldbrowsers");
  17633. var r = e("./lib/dom"),
  17634. i = e("./lib/event"),
  17635. s = e("./range").Range,
  17636. o = e("./editor").Editor,
  17637. u = e("./edit_session").EditSession,
  17638. a = e("./undomanager").UndoManager,
  17639. f = e("./virtual_renderer").VirtualRenderer;
  17640. e("./worker/worker_client"),
  17641. e("./keyboard/hash_handler"),
  17642. e("./placeholder"),
  17643. e("./multi_select"),
  17644. e("./mode/folding/fold_mode"),
  17645. e("./theme/textmate"),
  17646. e("./ext/error_marker"),
  17647. (t.config = e("./config")),
  17648. (t.require = e),
  17649. typeof define == "function" && (t.define = define),
  17650. (t.edit = function (e, n) {
  17651. if (typeof e == "string") {
  17652. var s = e;
  17653. e = document.getElementById(s);
  17654. if (!e) throw new Error("ace.edit can't find div #" + s);
  17655. }
  17656. if (e && e.env && e.env.editor instanceof o) return e.env.editor;
  17657. var u = "";
  17658. if (e && /input|textarea/i.test(e.tagName)) {
  17659. var a = e;
  17660. (u = a.value),
  17661. (e = r.createElement("pre")),
  17662. a.parentNode.replaceChild(e, a);
  17663. } else e && ((u = e.textContent), (e.innerHTML = ""));
  17664. var l = t.createEditSession(u),
  17665. c = new o(new f(e), l, n),
  17666. h = { document: l, editor: c, onResize: c.resize.bind(c, null) };
  17667. return (
  17668. a && (h.textarea = a),
  17669. i.addListener(window, "resize", h.onResize),
  17670. c.on("destroy", function () {
  17671. i.removeListener(window, "resize", h.onResize),
  17672. (h.editor.container.env = null);
  17673. }),
  17674. (c.container.env = c.env = h),
  17675. c
  17676. );
  17677. }),
  17678. (t.createEditSession = function (e, t) {
  17679. var n = new u(e, t);
  17680. return n.setUndoManager(new a()), n;
  17681. }),
  17682. (t.Range = s),
  17683. (t.Editor = o),
  17684. (t.EditSession = u),
  17685. (t.UndoManager = a),
  17686. (t.VirtualRenderer = f),
  17687. (t.version = "1.4.2");
  17688. }
  17689. );
  17690. (function () {
  17691. window.require(["ace/ace"], function (a) {
  17692. if (a) {
  17693. a.config.init(true);
  17694. a.define = window.define;
  17695. }
  17696. if (!window.ace) window.ace = a;
  17697. for (var key in a) if (a.hasOwnProperty(key)) window.ace[key] = a[key];
  17698. window.ace["default"] = window.ace;
  17699. if (typeof module == "object" && typeof exports == "object" && module) {
  17700. module.exports = window.ace;
  17701. }
  17702. });
  17703. })();