blecsd 0.4.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +169 -147
  2. package/dist/blend-BZDmQFAm.d.ts +1215 -0
  3. package/dist/{border-DGNDfT6T.d.ts → border-Br-Jc027.d.ts} +2 -2
  4. package/dist/{cell-DwIu2ryP.d.ts → cell-5Ty_3yMs.d.ts} +1 -1
  5. package/dist/cellRenderer-D0-DJXWl.d.ts +374 -0
  6. package/dist/chunk-3PGACJB6.js +1 -0
  7. package/dist/{chunk-DNRXW56C.js → chunk-4EV3YS7F.js} +1 -1
  8. package/dist/chunk-4XW4WIPH.js +1 -0
  9. package/dist/chunk-7CLV3LTZ.js +4 -0
  10. package/dist/chunk-7ZFQO3OQ.js +1 -0
  11. package/dist/chunk-AM6IDSXI.js +1 -0
  12. package/dist/chunk-APPZ3YHO.js +0 -0
  13. package/dist/chunk-EHYOVHRL.js +2 -0
  14. package/dist/chunk-EKE2BXPS.js +1 -0
  15. package/dist/chunk-EOFT3PNU.js +1 -0
  16. package/dist/chunk-ESMSDY3P.js +1 -0
  17. package/dist/chunk-FJLSHFCF.js +1 -0
  18. package/dist/chunk-FUW7OD3H.js +1 -0
  19. package/dist/chunk-GIMWA5WA.js +1 -0
  20. package/dist/chunk-GRMSEMU7.js +1 -0
  21. package/dist/chunk-I7AUKTXE.js +1 -0
  22. package/dist/chunk-IXUFU6TE.js +3 -0
  23. package/dist/chunk-JB5KFQPD.js +1 -0
  24. package/dist/chunk-JCLNGU3K.js +1 -0
  25. package/dist/chunk-JN2OGNK3.js +1 -0
  26. package/dist/chunk-JRRJCATR.js +1 -0
  27. package/dist/chunk-JWIVZCKW.js +1 -0
  28. package/dist/chunk-K5UMVDQX.js +1 -0
  29. package/dist/chunk-KYNS3GBJ.js +2 -0
  30. package/dist/chunk-L4FIDOS6.js +1 -0
  31. package/dist/chunk-LIVVHEOU.js +1 -0
  32. package/dist/chunk-LNEISTXM.js +1 -0
  33. package/dist/chunk-M5FXA5FL.js +1 -0
  34. package/dist/chunk-MEJJLDEQ.js +1 -0
  35. package/dist/chunk-NYIMY4UV.js +1 -0
  36. package/dist/chunk-PQZTNWLA.js +1 -0
  37. package/dist/chunk-QS5QXZNJ.js +1 -0
  38. package/dist/chunk-SXOBHRXF.js +2 -0
  39. package/dist/chunk-T2EQLWMN.js +1 -0
  40. package/dist/chunk-T62UPG63.js +4 -0
  41. package/dist/chunk-TPBILYDM.js +10 -0
  42. package/dist/chunk-UWS6FIU5.js +1 -0
  43. package/dist/chunk-W64J7C25.js +4 -0
  44. package/dist/chunk-W6RELN6A.js +1 -0
  45. package/dist/chunk-XYMPBCYW.js +1 -0
  46. package/dist/chunk-ZAJI53SZ.js +1 -0
  47. package/dist/cli/init.js +1 -1
  48. package/dist/{componentStorage-CJTh-TPO.d.ts → componentStorage-CXJvx4Lt.d.ts} +2 -2
  49. package/dist/components/index.d.ts +7762 -7682
  50. package/dist/components/index.js +5 -1
  51. package/dist/core/index.d.ts +4851 -4261
  52. package/dist/core/index.js +1 -1
  53. package/dist/debug/index.d.ts +310 -84
  54. package/dist/debug/index.js +8 -1
  55. package/dist/{dirtyTracking-C4v8MmM9.d.ts → dirtyTracking-D0SQrEeo.d.ts} +2 -2
  56. package/dist/{doubleBuffer-CKQFmlPN.d.ts → doubleBuffer-d9yVNtj1.d.ts} +22 -2
  57. package/dist/errors/index.js +1 -1
  58. package/dist/{events-9ForpTfM.d.ts → events-CGqK6LGt.d.ts} +2 -2
  59. package/dist/{inputActions-Fyw14_Gm.d.ts → factories-vW7bn_He.d.ts} +21 -786
  60. package/dist/{gameLoop-CSTb7e0L.d.ts → gameLoop-C1AyRWyP.d.ts} +3 -3
  61. package/dist/index.d.ts +25 -1217
  62. package/dist/index.js +1 -3
  63. package/dist/input/index.d.ts +1 -1
  64. package/dist/input/index.js +1 -1
  65. package/dist/inputStream-BoFAEJ7g.d.ts +1385 -0
  66. package/dist/interactiveSystem-Dtv3xERg.d.ts +2292 -0
  67. package/dist/{keyParser-m7fWto6g.d.ts → keyParser-DReXe2j-.d.ts} +28 -28
  68. package/dist/{mouseParser-B7p5ow7K.d.ts → mouseParser-CTNGolIA.d.ts} +1 -1
  69. package/dist/{packedStore-BgvnEdE7.d.ts → packedStore-480t2X74.d.ts} +1 -1
  70. package/dist/panelMovement-DSLYdNOL.d.ts +1909 -0
  71. package/dist/{parser-iMHmQuUh.d.ts → parser-Q1YLXYpF.d.ts} +1 -1
  72. package/dist/positioning-DiUivJXa.d.ts +917 -0
  73. package/dist/{renderable-CwqGwrEV.d.ts → renderable-IbSJao5y.d.ts} +2 -2
  74. package/dist/{scheduler-DeeZleia.d.ts → scheduler-NbHT3-D2.d.ts} +1 -1
  75. package/dist/schemas/index.d.ts +6 -6
  76. package/dist/schemas/index.js +1 -1
  77. package/dist/style/index.d.ts +851 -0
  78. package/dist/style/index.js +1 -0
  79. package/dist/styleInheritance-CuRb5Dmp.d.ts +251 -0
  80. package/dist/systems/index.d.ts +786 -1882
  81. package/dist/systems/index.js +1 -1
  82. package/dist/terminal/index.d.ts +5542 -2460
  83. package/dist/terminal/index.js +1 -1
  84. package/dist/terminalBuffer-BbUz27qM.d.ts +691 -0
  85. package/dist/{terminus-14-bold-HWSPRLJD.js → terminus-14-bold-ZS4IH465.js} +1 -1
  86. package/dist/{terminus-14-normal-T3SWMH4D.js → terminus-14-normal-HD5N7F5W.js} +1 -1
  87. package/dist/testing/index.d.ts +923 -0
  88. package/dist/testing/index.js +7 -0
  89. package/dist/text/index.d.ts +263 -0
  90. package/dist/text/index.js +3 -0
  91. package/dist/textWrap-sY-PZzE7.d.ts +761 -0
  92. package/dist/{tilemap-BirMJdbu.d.ts → tilemap-ByvTsepD.d.ts} +5 -5
  93. package/dist/{types-CPB4CpbH.d.ts → types-B8LmNkzG.d.ts} +1 -1
  94. package/dist/utils/index.d.ts +829 -782
  95. package/dist/utils/index.js +32 -1
  96. package/dist/{virtualScrollback-D9uLFe8l.d.ts → virtualScrollback-CiooIebp.d.ts} +4 -4
  97. package/dist/virtualViewport-fIlbIGPt.d.ts +657 -0
  98. package/dist/{virtualizedLineStore-DwPEvPkk.d.ts → virtualizedLineStore-DfyhojPZ.d.ts} +1 -1
  99. package/dist/widgets/bigText.d.ts +13 -13
  100. package/dist/widgets/bigText.js +1 -1
  101. package/dist/widgets/fonts/index.d.ts +1 -1
  102. package/dist/widgets/fonts/index.js +1 -1
  103. package/dist/widgets/index.d.ts +1620 -910
  104. package/dist/widgets/index.js +24 -1
  105. package/package.json +23 -22
  106. package/dist/3d/index.d.ts +0 -5
  107. package/dist/3d/index.js +0 -1
  108. package/dist/audio/index.d.ts +0 -177
  109. package/dist/audio/index.js +0 -1
  110. package/dist/chunk-25OEBENM.js +0 -3
  111. package/dist/chunk-26STV7ZS.js +0 -1
  112. package/dist/chunk-2NMGUEFC.js +0 -4
  113. package/dist/chunk-35LCBY6P.js +0 -1
  114. package/dist/chunk-4PRDJTCM.js +0 -1
  115. package/dist/chunk-5PELJRUQ.js +0 -1
  116. package/dist/chunk-5VEKHA3B.js +0 -5
  117. package/dist/chunk-6KEM3OS2.js +0 -11
  118. package/dist/chunk-6XWY6GB7.js +0 -1
  119. package/dist/chunk-735KKTP3.js +0 -1
  120. package/dist/chunk-7SWJNDOL.js +0 -26
  121. package/dist/chunk-APKUNIMB.js +0 -1
  122. package/dist/chunk-CJCSZRV6.js +0 -1
  123. package/dist/chunk-DMBMCCLN.js +0 -1
  124. package/dist/chunk-DQTVJITR.js +0 -1
  125. package/dist/chunk-DSKQ5J4R.js +0 -1
  126. package/dist/chunk-E4CJRSND.js +0 -1
  127. package/dist/chunk-EF4DC6IN.js +0 -1
  128. package/dist/chunk-EJAKECSN.js +0 -1
  129. package/dist/chunk-FNQRUMFD.js +0 -1
  130. package/dist/chunk-GJ3RS2VG.js +0 -1
  131. package/dist/chunk-KTVEMB2I.js +0 -1
  132. package/dist/chunk-KYAPE44E.js +0 -8
  133. package/dist/chunk-LI4Y7TBZ.js +0 -1
  134. package/dist/chunk-NHOL4BN6.js +0 -1
  135. package/dist/chunk-NPNUUSIB.js +0 -1
  136. package/dist/chunk-NZ55KBM6.js +0 -1
  137. package/dist/chunk-OFRWGW2G.js +0 -1
  138. package/dist/chunk-OMMJ7B5P.js +0 -1
  139. package/dist/chunk-OMU5BSAS.js +0 -2
  140. package/dist/chunk-P3ZLIQJP.js +0 -1
  141. package/dist/chunk-PWI36BQJ.js +0 -1
  142. package/dist/chunk-QQMUDJ32.js +0 -2
  143. package/dist/chunk-R3ICZOE4.js +0 -1
  144. package/dist/chunk-RZ7FGVI6.js +0 -1
  145. package/dist/chunk-S6WS46FE.js +0 -1
  146. package/dist/chunk-TSARUU56.js +0 -1
  147. package/dist/chunk-WJRVUAZR.js +0 -33
  148. package/dist/chunk-WY5EZOOL.js +0 -1
  149. package/dist/chunk-YY6RZCZH.js +0 -4
  150. package/dist/chunk-ZPGJCHXH.js +0 -1
  151. package/dist/chunk-ZPL2J25N.js +0 -1
  152. package/dist/game/index.d.ts +0 -486
  153. package/dist/game/index.js +0 -1
  154. package/dist/index-DBS5Uefn.d.ts +0 -3156
  155. package/dist/viewport3d-xI33-_wq.d.ts +0 -182
  156. package/dist/virtualViewport-DTSN6jFk.d.ts +0 -1856
@@ -1 +1,32 @@
1
- export{Ha as AMBIGUOUS_RANGES,le as AlignmentSchema,Qd as AttrFlags,f as BOX_ASCII,e as BOX_BOLD,g as BOX_DASHED,c as BOX_DOUBLE,d as BOX_ROUNDED,b as BOX_SINGLE,za as COMBINING_RANGES,Aa as COMBINING_SET,Ib as DEFAULT_BATCH_SIZE,P as DEFAULT_COLLAPSE_THRESHOLD,O as DEFAULT_CONTEXT,Kc as DEFAULT_HIGHLIGHT_BATCH,gd as DEFAULT_PARSE_BATCH,xe as DEFAULT_SEARCH_BATCH,we as DEFAULT_TIMEOUT,Ia as EMOJI_WIDE_RANGES,Lc as EMPTY_STATE,Fa as FULLWIDTH_RANGES,Tc as GRAMMARS,Pc as GRAMMAR_GO,Mc as GRAMMAR_JAVASCRIPT,Rc as GRAMMAR_JSON,Sc as GRAMMAR_PLAINTEXT,Nc as GRAMMAR_PYTHON,Oc as GRAMMAR_RUST,Qc as GRAMMAR_SHELL,fa as HIGH_SURROGATE_END,ea as HIGH_SURROGATE_START,sd as LEAF_MAX_SIZE,td as LEAF_MIN_SIZE,ha as LOW_SURROGATE_END,ga as LOW_SURROGATE_START,ud as MAX_DEPTH,Hb as MAX_PARAGRAPH_CHUNK,ve as ParsedContentSchema,vb as TerminalWidthProfileSchema,ue as TextSegmentSchema,Ea as WIDE_RANGES,ze as WORD_BOUNDARY_AFTER,ye as WORD_BOUNDARY_BEFORE,ub as WidthOverrideSchema,Ga as ZERO_WIDTH_RANGES,Wb as addFoldRegion,Kd as append,ne as attrToTag,Sd as attrsToStyle,re as attrsToTags,Ae as boyerMooreHorspool,n as bufferToString,w as buildLineIndex,x as buildLineIndexFromLengths,wb as buildTestCorpus,pb as centerByWidth,Bd as charAt,xa as charAtCodePoint,gb as charWidth,hb as charWidthAt,sa as characters,a as charsetToBoxChars,E as clampCursor,fe as cleanTags,S as clearDiffCache,Vc as clearHighlightCache,zc as clearLazyContent,kd as clearMarkdownCache,He as clearSearchCache,zb as clearWidthOverrides,Kb as clearWrapCache,oa as codePointAt,ta as codePointLength,na as codePointToSurrogatePair,fb as codePointWidth,qa as codePoints,V as collapseChunk,Y as collapseUnchanged,me as colorToTag,rb as columnAtIndex,Q as computeDiff,T as computeDiffCached,Dc as computeDigitWidth,Ec as computeGutterWidth,Hc as computeVisibleGutter,cd as continueHighlight,Ob as continueWrap,Cc as createArraySource,h as createCellBuffer,o as createCoalescer,A as createCursor,R as createDiffCache,wd as createEmptyRope,Vb as createFoldState,Fc as createGutterConfig,Uc as createHighlightCache,vc as createLazyContent,jd as createMarkdownCache,C as createNavConfig,vd as createRope,Ge as createSearchCache,he as createTaggedText,B as createViewport,Jb as createWrapCache,ce as decodeStyleAttr,t as deleteChange,Md as deleteRange,v as destroyCoalescer,dd as detectLanguage,ed as detectLanguageFromContent,Ya as dropUnicode,be as encodeStyleAttr,da as encoding,D as ensureCursorVisible,ge as escapeTags,yc as evictChunks,X as expandAll,U as expandChunk,l as fillRect,Eb as filterByCategory,qc as findAllFiles,pc as findFile,Ne as findNearestMatch,q as flushChanges,$b as foldAll,bc as foldAtDepth,Yb as foldRegion,Gc as formatLineNumber,Gb as formatTestReport,pa as fromCodePoint,pe as generateCloseTags,oe as generateTags,dc as getAllFoldRegions,Fb as getCategories,Ma as getCharWidth,r as getCoalescingState,Da as getCombiningCharCount,ca as getDiffStats,cc as getFoldAtLine,hc as getFoldStats,fd as getGrammarByName,Xc as getHighlightStats,xb as getKnownBadSequences,Ac as getLazyContentState,wc as getLazyLines,xd as getLength,Hd as getLine,zd as getLineCount,Gd as getLineEnd,Ed as getLineForIndex,Fd as getLineStart,Id as getLines,qd as getMarkdownLineCount,rd as getMarkdownStats,Me as getMatchAt,Pe as getMatchStatus,yd as getNewlineCount,Ke as getNextMatch,Ab as getOverrideCount,Bb as getOverrideWidth,Le as getPreviousMatch,$ as getSideBySideView,Od as getStats,Dd as getText,_ as getTotalLineCount,Z as getVisibleDiffLines,ec as getVisibleFoldLines,pd as getVisibleMarkdown,Oe as getVisibleMatches,Ub as getWrapCacheStats,L as goToEnd,H as goToLine,K as goToStart,Qa as graphemeAt,Na as graphemeClusters,Pa as graphemeCount,Sa as graphemeWidth,tc as groupBy,Ic as gutterWidthChanged,Wa as hasGraphemeSegmenter,ke as hasTags,sb as hasWideChars,tb as hasZeroWidthChars,bd as highlightVisibleFirst,ad as highlightWithCache,qb as indexAtColumn,Jd as insert,s as insertChange,yb as installWidthOverrides,Rb as invalidateAll,_c as invalidateAllLines,Zc as invalidateLine,Yc as invalidateLines,md as invalidateMarkdownLines,Qb as invalidateParagraph,Pb as invalidateRange,La as isAmbiguousChar,wa as isAstral,va as isBMP,Ba as isCombiningChar,Ca as isCombiningCharBinarySearch,Ad as isEmpty,ia as isHighSurrogate,ja as isLowSurrogate,Bc as isRangeLoaded,la as isSurrogate,ka as isSurrogateCode,ua as isValidCodePoint,Ja as isWideChar,Ka as isZeroWidthChar,y as lineForOffset,Sb as lineToPosition,Cb as measureWidthWithOverrides,jc as merge,ie as mergeSegments,G as moveCursorDown,M as moveCursorLeft,N as moveCursorRight,F as moveCursorUp,bb as normalizeNFC,cb as normalizeNFD,db as normalizeNFKC,eb as normalizeNFKD,z as offsetForLine,gc as originalToVisibleLine,nb as padEndByWidth,ob as padStartByWidth,J as pageDown,I as pageUp,hd as parseInline,id as parseMarkdown,ld as parseMarkdownCached,de as parseTags,ba as parseUnifiedDiff,te as parsedToTaggedText,uc as partition,Tb as positionToLine,Be as positionToLineColumn,xc as prefetchAround,Ld as prepend,p as queueChange,Xb as removeFoldRegion,nd as renderBlock,i as renderBox,Jc as renderGutterBlock,j as renderHLine,od as renderMarkdown,m as renderText,k as renderVLine,u as replaceChange,Nd as replaceRange,Lb as resizeWrapCache,Xa as reverseGraphemes,Db as runWidthTests,Td as sattr,Zd as sattrAddFlag,Wd as sattrCopy,ae as sattrEmpty,Vd as sattrEqual,Ud as sattrFromStyleData,Yd as sattrHasFlag,$d as sattrInvert,Xd as sattrMerge,_d as sattrRemoveFlag,Ee as search,Fe as searchBatch,Ce as searchLiteral,De as searchRegex,Qe as searchReverse,Je as searchWithCache,se as segmentToTaggedText,Wc as setGrammar,kc as shallowMerge,kb as sliceByWidth,Ua as sliceByWidthGrapheme,ya as sliceCodePoints,Ra as sliceGraphemes,oc as sortBy,mc as sortByIndex,lc as sortByName,nc as sortByPriority,jb as strWidth,ib as stringWidth,Ta as stringWidthGrapheme,$a as stripCombining,ab as stripControl,ee as stripTags,_a as stripZeroWidth,Rd as styleToAttrs,Cd as substring,ma as surrogatePairToCodePoint,je as taggedLength,Za as toAscii,ra as toCodePoints,Oa as toGraphemes,aa as toUnifiedDiff,W as toggleChunk,_b as toggleFold,$c as tokenizeLine,lb as truncateByWidth,mb as truncateWithEllipsis,Va as truncateWithEllipsisGrapheme,ac as unfoldAll,Zb as unfoldRegion,rc as unique,sc as uniqueBy,Ie as updateSearchQuery,ic as updateTotalLines,Pd as verify,fc as visibleToOriginalLine,Nb as wrapVisibleFirst,Mb as wrapWithCache,qe as wrapWithTags}from'../chunk-WJRVUAZR.js';export{a as FuzzyOptionsSchema,h as formatDate,f as fuzzyFilter,b as fuzzyMatch,c as fuzzySearch,d as fuzzySearchBy,g as fuzzyTest,e as highlightMatch,i as unixTimestamp,j as unixTimestampMs}from'../chunk-6PX5R326.js';export{d as COMPRESSION_RATIO,a as DEFAULT_CHUNK_SIZE,b as DEFAULT_MAX_CACHED,c as DEFAULT_MAX_MEMORY,g as appendLine,h as appendLines,f as clearScrollback,u as compressOldChunks,e as createScrollbackBuffer,v as decompressAll,s as exportToText,j as getLineRange,q as getMemoryUsage,i as getScrollbackLine,p as getScrollbackStats,k as getVisibleLines,l as jumpToLine,r as loadFromText,m as scrollBy,o as scrollToBottom,n as scrollToTop,t as trimToLineCount}from'../chunk-JHCKPCUH.js';export{e as CHUNKED_THRESHOLD,a as LineIndexSchema,b as LineRangeParamsSchema,d as TrimParamsSchema,c as VisibleLinesParamsSchema,n as appendLinesToStore,m as appendToStore,h as createEmptyLineStore,f as createLineStore,g as createLineStoreFromLines,u as exportContent,v as exportLineRange,p as getByteSize,i as getLineAtIndex,s as getLineForOffset,j as getLineInfo,o as getLineStoreLineCount,k as getLineStoreRange,l as getLineStoreVisibleLines,t as getOffsetForLine,r as getStoreStats,q as isStoreEmpty,w as trimLineStore}from'../chunk-VOCM5T2G.js';export{m as createComponentStore,n as createSparseStore,o as createTypedArrayPool,p as estimateMemoryUsage,q as getComponentMemoryReport,r as isWithinMemoryBounds}from'../chunk-RJULLVTH.js';import'../chunk-ZPGJCHXH.js';export{d as alignLine,b as getVisibleWidth,g as padHeight,a as stripAnsi,c as truncate,e as wordWrap,f as wrapText}from'../chunk-NPDPBAW6.js';export{r as colorToHex,q as hexToColor,o as packColor,s as parseColor,p as unpackColor}from'../chunk-P3ZLIQJP.js';import'../chunk-5PELJRUQ.js';
1
+ import {a as a$1,e as e$1,g as g$2,d as d$1,f as f$1,c as c$1,b as b$2,j as j$4,i as i$3,h as h$3}from'../chunk-6PX5R326.js';export{a as FuzzyOptionsSchema,h as formatDate,f as fuzzyFilter,b as fuzzyMatch,d as fuzzySearchBy,c as fuzzySearchFn,g as fuzzyTest,e as highlightMatch,i as unixTimestamp,j as unixTimestampMs}from'../chunk-6PX5R326.js';import {b as b$1,d,c,g as g$1,e,f,a,l,n,h,m,k as k$1,j as j$1,i,L as L$1,w as w$2,K as K$1,u as u$2,E as E$1,A as A$1,C,B as B$1,t as t$2,y as y$1,x as x$1,H as H$1,G as G$1,v as v$3,D as D$1,z as z$2,J as J$1,I,F as F$1,s as s$2,r as r$3}from'../chunk-KYNS3GBJ.js';export{f as BOX_ASCII,e as BOX_BOLD,g as BOX_DASHED,c as BOX_DOUBLE,d as BOX_ROUNDED,b as BOX_SINGLE,o as LEAF_MAX_SIZE,p as LEAF_MIN_SIZE,q as MAX_DEPTH,G as append,l as boxFillRect,n as bufferToString,x as charAt,a as charsetToBoxChars,h as createCellBuffer,s as createEmptyRope,r as createRope,I as deleteRange,t as getLength,D as getLine,v as getLineCount,C as getLineEnd,A as getLineForIndex,B as getLineStart,E as getLines,u as getNewlineCount,K as getStats,z as getText,F as insert,w as isEmpty,H as prepend,i as renderBox,j as renderHLine,m as renderText,k as renderVLine,J as replaceRange,y as substring,L as verify}from'../chunk-KYNS3GBJ.js';import {v as v$4,u as u$3,q as q$3,p as p$2,k as k$3,t as t$3,f as f$3,r as r$4,s as s$3,l as l$2,o as o$2,n as n$3,m as m$3,j as j$3,i as i$2,h as h$2,g as g$4,e as e$3}from'../chunk-JHCKPCUH.js';export{d as COMPRESSION_RATIO,a as DEFAULT_CHUNK_SIZE,b as DEFAULT_MAX_CACHED,c as DEFAULT_MAX_MEMORY,g as appendLine,h as appendLines,f as clearScrollback,u as compressOldChunks,e as createScrollbackBuffer,v as decompressAll,s as exportToText,j as getLineRange,q as getMemoryUsage,i as getScrollbackLine,p as getScrollbackStats,k as getVisibleLines,l as jumpToLine,r as loadFromText,m as scrollbackScrollBy,o as scrollbackScrollToBottom,n as scrollbackScrollToTop,t as trimToLineCount}from'../chunk-JHCKPCUH.js';import {c as c$2,d as d$2,b as b$3,a as a$2,e as e$2,w as w$1,q as q$2,p as p$1,r as r$2,v as v$2,u as u$1,l as l$1,j as j$2,t as t$1,s as s$1,o as o$1,k as k$2,i as i$1,n as n$2,m as m$2,h as h$1,g as g$3,f as f$2}from'../chunk-VOCM5T2G.js';export{e as CHUNKED_THRESHOLD,a as LineIndexSchema,b as LineRangeParamsSchema,d as TrimParamsSchema,c as VisibleLinesParamsSchema,n as appendLinesToStore,m as appendToStore,h as createEmptyLineStore,f as createLineStore,g as createLineStoreFromLines,u as exportContent,v as exportLineRange,p as getByteSize,i as getLineAtIndex,s as getLineForOffset,j as getLineInfo,o as getLineStoreLineCount,k as getLineStoreRange,l as getLineStoreVisibleLines,t as getOffsetForLine,r as getStoreStats,q as isStoreEmpty,w as trimLineStore}from'../chunk-VOCM5T2G.js';import {r as r$1,p,q as q$1,o,n as n$1,m as m$1}from'../chunk-RJULLVTH.js';export{m as createComponentStore,n as createSparseStore,o as createTypedArrayPool,p as estimateMemoryUsage,q as getComponentMemoryReport,r as isWithinMemoryBounds}from'../chunk-RJULLVTH.js';import'../chunk-EOFT3PNU.js';import {g as g$5,a as a$3,b as b$4,d as d$3,c as c$3,f as f$4,e as e$4}from'../chunk-NPDPBAW6.js';export{d as alignLine,b as getVisibleWidth,g as padHeight,a as stripAnsi,c as truncate,e as wordWrap,f as wrapText}from'../chunk-NPDPBAW6.js';import {v as v$1,s,r,t,u}from'../chunk-7ZFQO3OQ.js';export{u as colorToHex,t as hexToColor,r as packColor,v as parseColor,s as unpackColor}from'../chunk-7ZFQO3OQ.js';import'../chunk-I7AUKTXE.js';import {z as z$1}from'zod';import*as ys from'fs';import*as P from'path';var Cl={maxDelayMs:16,maxBatchSize:100,immediateCursor:true};function go(e,t){return {config:{...Cl,...t},pending:[],flushCallback:e,flushTimer:null,totalProcessed:0,totalFlushes:0}}function xo(e,t){if(e.pending.push(t),e.pending.length>=e.config.maxBatchSize){K(e);return}e.flushTimer||(e.flushTimer=setTimeout(()=>{K(e);},e.config.maxDelayMs));}function K(e){if(e.flushTimer&&(clearTimeout(e.flushTimer),e.flushTimer=null),e.pending.length===0)return;let t=[...e.pending];e.pending=[];let n=Sl(t),r=t.length>1?(t[t.length-1]?.timestamp??0)-(t[0]?.timestamp??0):0,o={dirtyRegion:n,changeCount:t.length,timeSpanMs:r,changes:t};return e.totalProcessed+=t.length,e.totalFlushes++,e.flushCallback&&e.flushCallback(o),o}function bo(e){return {config:e.config,pendingCount:e.pending.length,flushScheduled:e.flushTimer!==null,totalProcessed:e.totalProcessed,totalFlushes:e.totalFlushes,avgChangesPerFlush:e.totalFlushes>0?e.totalProcessed/e.totalFlushes:0}}function yo(e,t,n){return {startLine:e,startColumn:t,endLine:e,endColumn:t,text:n,timestamp:Date.now()}}function Co(e,t,n,r){return {startLine:e,startColumn:t,endLine:n,endColumn:r,text:"",timestamp:Date.now()}}function So(e,t,n,r,o){return {startLine:e,startColumn:t,endLine:n,endColumn:r,text:o,timestamp:Date.now()}}function To(e){let t=K(e);return e.flushCallback=null,t}function Sl(e){if(e.length===0)return {startLine:0,endLine:0,lineCountChanged:false,lineDelta:0};let t=Number.POSITIVE_INFINITY,n=0,r=0;for(let o of e){t=Math.min(t,o.startLine),n=Math.max(n,o.endLine);let i=0;for(let s=0;s<o.text.length;s++)o.text[s]===`
2
+ `&&i++;let a=o.endLine-o.startLine;r+=i-a,n=Math.max(n,o.startLine+i);}return {startLine:t===Number.POSITIVE_INFINITY?0:t,endLine:n,lineCountChanged:r!==0,lineDelta:r}}var ve={scrollPadding:5,horizontalPadding:5,lineWrap:true,tabWidth:4};function Lo(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
3
+ `&&t.push(n+1);return {offsets:t,lineCount:t.length}}function ko(e){let t=[0],n=0;for(let r=0;r<e.length-1;r++)n+=e[r]??0,t.push(n);return {offsets:t,lineCount:e.length}}function Ao(e,t){let n=e.offsets,r=0,o=n.length-1;for(;r<=o;){let i=r+o>>>1;(n[i]??0)<=t?r=i+1:o=i-1;}return Math.max(0,r-1)}function Ro(e,t){return t<0||t>=e.lineCount?-1:e.offsets[t]??-1}function q(e=0,t=0){return {line:Math.max(0,e),column:Math.max(0,t)}}function Mo(e=0,t=24,n=0,r=80){return {topLine:Math.max(0,e),height:Math.max(1,t),leftColumn:Math.max(0,n),width:Math.max(1,r)}}function Wo(e){return {...ve,...e}}function D(e,t,n,r){let o={...ve,...r},{topLine:i,leftColumn:a}=t,s=false,l=e.line-t.height+1+o.scrollPadding,u=e.line-o.scrollPadding;i>u&&(i=Math.max(0,u),s=true),i<l&&(i=Math.min(Math.max(0,n-t.height),Math.max(0,l)),s=true);let d=e.column-t.width+1+o.horizontalPadding,c=e.column-o.horizontalPadding;return a>c&&(a=Math.max(0,c),s=true),a<d&&(a=Math.max(0,d),s=true),s?{viewport:{...t,topLine:i,leftColumn:a},scrolled:true}:{viewport:t,scrolled:false}}function fe(e,t,n){let r=Math.max(0,Math.min(e.line,t-1)),o=r<t?n(r):0,i=Math.max(0,Math.min(e.column,o));return {line:r,column:i}}function Fe(e,t,n,r,o){let i=q(e.line-t,e.column),a=fe(i,r,()=>e.column),{viewport:s,scrolled:l}=D(a,n,r,o);return {cursor:a,viewport:s,scrolled:l}}function Oe(e,t,n,r,o){let i=q(e.line+t,e.column),a=fe(i,r,()=>e.column),{viewport:s,scrolled:l}=D(a,n,r,o);return {cursor:a,viewport:s,scrolled:l}}function pe(e,t,n,r){let o=Math.max(0,Math.min(e,n-1)),i=q(o,0),{viewport:a,scrolled:s}=D(i,t,n,r);return {cursor:i,viewport:a,scrolled:s}}function Eo(e,t,n,r){return Fe(e,t.height-1,t,n,r)}function wo(e,t,n,r){return Oe(e,t.height-1,t,n,r)}function Io(e,t,n){return pe(0,e,t,n)}function Do(e,t,n){return pe(t-1,e,t,n)}function _o(e,t,n,r,o,i){let a={...ve,...i},{line:s,column:l}=e;l-=t,l<0&&a.lineWrap&&s>0?(s--,l=o(s)):l=Math.max(0,l);let u={line:s,column:l},{viewport:d,scrolled:c}=D(u,n,r,i);return {cursor:u,viewport:d,scrolled:c}}function Po(e,t,n,r,o,i){let a={...ve,...i},{line:s,column:l}=e,u=o(s);l+=t,l>u&&a.lineWrap&&s<r-1?(s++,l=0):l=Math.min(l,u);let d={line:s,column:l},{viewport:c,scrolled:p}=D(d,n,r,i);return {cursor:d,viewport:c,scrolled:p}}var vo=3,Fo=10;function ps(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r|0;}return t}function Tl(e,t){let n=e.length,r=t.length,o=n+r,i=Wl(e,t);if(i)return i;let a=El(e,t,o);return Ll(a.trace,e,t,a.offset)}function Ll(e,t,n,r){let o=[],i=t.length,a=n.length;for(let s=e.length-1;s>=0;s--){let l=e[s]??[],u=i-a,d=Dl(u,s,l,r),c=l[d+r]??0,p=c-d,f=_l(o,t,i,a,c,p);i=f.x,a=f.y;let m=Pl(o,t,n,s,i,a,c);i=m.x,a=m.y;}return o}function kl(e,t){let n=e.length,r=t.length,o=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let i=1;i<=n;i++){let a=o[i];if(a)for(let s=1;s<=r;s++)e[i-1]===t[s-1]?a[s]=(o[i-1]?.[s-1]??0)+1:a[s]=Math.max(o[i-1]?.[s]??0,a[s-1]??0);}return o}function Al(e,t,n){let r=[],o=t.length,i=n.length,a=[];for(;o>0||i>0;){let s=Hl(e,t,n,o,i);a.unshift(s.op),o=s.nextI,i=s.nextJ;}for(let s of a)r.push({type:s.type,content:s.line,oldLineNo:s.oldNo,newLineNo:s.newNo});return r}function Rl(e,t){let n=e.length,r=t.length;if(n>100||r>100)return Tl(e,t);let o=kl(e,t);return Al(o,e,t)}function Ml(e,t,n){if(e.length===0)return [];let r=[],o=[],i=0,a=1,s=1,l=0,u=0;function d(){if(o.length===0)return;let c=o.filter(f=>f.type==="remove"||f.type==="context").length,p=o.filter(f=>f.type==="add"||f.type==="context").length;r.push({id:i++,oldStart:a,oldCount:c,newStart:s,newCount:p,lines:o,collapsed:false,contextBefore:u,contextAfter:l}),a+=c,s+=p,o=[],u=0;}for(let c of e)if(c.type==="context")if(l++,l>t*2+n){let p=o.slice(-t);o=o.slice(0,-t),o.length>0&&(l=t,d()),o=[...p,c],u=p.length+1,l=1;}else o.push(c);else l=0,o.push(c);return d(),r}function Ne(e,t,n={}){let r=performance.now(),o=n.contextLines??3,i=n.collapseThreshold??10,{oldLines:a,newLines:s}=vl(e,t),l=Rl(a,s),u=Ml(l,o,i);n.initiallyCollapsed&&Fl(u);let d=Ol(l);return {chunks:u,additions:d.additions,deletions:d.deletions,contextLines:d.contextLines,computeTimeMs:performance.now()-r}}function Oo(){return {oldHash:0,newHash:0,result:null,expandedChunks:new Set}}function Bo(e){e.oldHash=0,e.newHash=0,e.result=null,e.expandedChunks.clear();}function No(e,t,n,r={}){let o=ps(t),i=ps(n);if(e.oldHash===o&&e.newHash===i&&e.result)return e.result;let a=Ne(t,n,r);e.oldHash=o,e.newHash=i,e.result=a;for(let s of a.chunks)e.expandedChunks.has(s.id)&&(s.collapsed=false);return a}function He(e,t,n){let r=t.chunks.find(o=>o.id===n);r&&(r.collapsed=false,e.expandedChunks.add(n));}function Ge(e,t,n){let r=t.chunks.find(o=>o.id===n);r&&(r.collapsed=true,e.expandedChunks.delete(n));}function Ho(e,t,n){let r=t.chunks.find(o=>o.id===n);return r?r.collapsed?(He(e,t,n),false):(Ge(e,t,n),true):false}function Go(e,t){for(let n of t.chunks)n.collapsed=false,e.expandedChunks.add(n.id);}function zo(e,t){for(let n of t.chunks)n.lines.some(o=>o.type==="add"||o.type==="remove")||(n.collapsed=true,e.expandedChunks.delete(n.id));}function Uo(e,t,n){let r=[];for(let s of e.chunks)if(s.collapsed)r.push({line:{type:"header",content:`... ${s.lines.length} lines hidden ...`},chunkId:s.id,collapsed:true});else for(let l of s.lines)r.push({line:l,chunkId:s.id,collapsed:false});let o=Math.max(0,t),i=Math.min(r.length,t+n),a=r.slice(o,i);return {lines:a.map(s=>s.line),startIndex:o,totalLines:r.length,chunkInfo:a.map(s=>({chunkId:s.chunkId,collapsed:s.collapsed}))}}function Vo(e){let t=0;for(let n of e.chunks)n.collapsed?t+=1:t+=n.lines.length;return t}function jo(e,t,n){let r=Bl(e),o=Math.max(0,t),i=Math.min(r.length,t+n);return r.slice(o,i)}function $o(e,t="a",n="b"){let r=[];r.push(`--- ${t}`),r.push(`+++ ${n}`);for(let o of e.chunks){r.push(`@@ -${o.oldStart},${o.oldCount} +${o.newStart},${o.newCount} @@`);for(let i of o.lines){let a=i.type==="add"?"+":i.type==="remove"?"-":" ";r.push(a+i.content);}}return r.join(`
4
+ `)}function Ko(e){let t=performance.now(),n=e.split(`
5
+ `),r=[],o=null,i=[],a=0,s=0,l=0,u=0,d=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;for(let c of n){if(c.startsWith("---")||c.startsWith("+++"))continue;let p=d.exec(c);if(p){let m=Nl(p,a);a+=1;let h=hs(r,o,i);o=m,i=h;continue}if(!o)continue;let f=Gl(c);f&&(i.push(f.line),s+=f.additions,l+=f.deletions,u+=f.contextLines);}return hs(r,o,i),{chunks:r,additions:s,deletions:l,contextLines:u,computeTimeMs:performance.now()-t}}function Wl(e,t){let n=e.length,r=t.length;return n===0&&r===0?[]:n===0?t.map((o,i)=>({type:"add",content:o,newLineNo:i+1})):r===0?e.map((o,i)=>({type:"remove",content:o,oldLineNo:i+1})):null}function El(e,t,n){let r=e.length,o=t.length,i=2*n+1,a=new Array(i).fill(0),s=n,l=[];e:for(let u=0;u<=n;u++){l.push(a.slice());for(let d=-u;d<=u;d+=2){let c=wl(a,d,u,s),p=Il(e,t,c,d);if(a[d+s]=p.x,p.x>=r&&p.y>=o)break e}}return {trace:l,offset:s}}function wl(e,t,n,r){return t===-n||t!==n&&(e[t-1+r]??0)<(e[t+1+r]??0)?e[t+1+r]??0:(e[t-1+r]??0)+1}function Il(e,t,n,r){let o=n,i=o-r;for(;o<e.length&&i<t.length&&e[o]===t[i];)o++,i++;return {x:o,y:i}}function Dl(e,t,n,r){return e===-t||e!==t&&(n[e-1+r]??0)<(n[e+1+r]??0)?e+1:e-1}function _l(e,t,n,r,o,i){let a=n,s=r;for(;a>o&&s>i;)a--,s--,e.unshift({type:"context",content:t[a]??"",oldLineNo:a+1,newLineNo:s+1});return {x:a,y:s}}function Pl(e,t,n,r,o,i,a){if(r<=0)return {x:o,y:i};if(o===a){let l=i-1;return e.unshift({type:"add",content:n[l]??"",newLineNo:l+1}),{x:o,y:l}}let s=o-1;return e.unshift({type:"remove",content:t[s]??"",oldLineNo:s+1}),{x:s,y:i}}function vl(e,t){return {oldLines:e===""?[]:e.split(`
6
+ `),newLines:t===""?[]:t.split(`
7
+ `)}}function Fl(e){for(let t of e)t.lines.some(r=>r.type==="add"||r.type==="remove")||(t.collapsed=true);}function Ol(e){let t=0,n=0,r=0;for(let o of e)o.type==="add"?t++:o.type==="remove"?n++:o.type==="context"&&r++;return {additions:t,deletions:n,contextLines:r}}function Bl(e){let t=[];for(let n of e.chunks){if(n.collapsed){t.push({left:void 0,right:void 0});continue}let r=[],o=[];for(let i of n.lines){if(i.type==="context"){ms(t,r,o),t.push({left:Be(i,"context","left"),right:Be(i,"context","right")});continue}if(i.type==="remove"){r.push(i);continue}i.type==="add"&&o.push(i);}ms(t,r,o);}return t}function ms(e,t,n){for(;t.length>0||n.length>0;){let r=t.shift(),o=n.shift();e.push({left:r?Be(r,"remove","left"):void 0,right:o?Be(o,"add","right"):void 0});}}function Be(e,t,n){return {lineNo:(n==="left"?e.oldLineNo:e.newLineNo)??0,content:e.content,type:t}}function Nl(e,t){return {id:t,oldStart:parseInt(e[1]??"0",10),oldCount:parseInt(e[2]??"1",10),newStart:parseInt(e[3]??"0",10),newCount:parseInt(e[4]??"1",10),lines:[],collapsed:false,contextBefore:0,contextAfter:0}}function Hl(e,t,n,r,o){let i=r>0?t[r-1]:void 0,a=o>0?n[o-1]:void 0;return i!==void 0&&a!==void 0&&i===a?{op:{type:"context",line:i,oldNo:r,newNo:o},nextI:r-1,nextJ:o-1}:a!==void 0&&(r===0||(e[r]?.[o-1]??0)>=(e[r-1]?.[o]??0))?{op:{type:"add",line:a,newNo:o},nextI:r,nextJ:o-1}:{op:{type:"remove",line:i??"",oldNo:r},nextI:r-1,nextJ:o}}function hs(e,t,n){return !t||n.length===0?n:(e.push({...t,lines:n}),[])}function Gl(e){return e.startsWith("+")?{line:{type:"add",content:e.slice(1)},additions:1,deletions:0,contextLines:0}:e.startsWith("-")?{line:{type:"remove",content:e.slice(1)},additions:0,deletions:1,contextLines:0}:e.startsWith(" ")?{line:{type:"context",content:e.slice(1)},additions:0,deletions:0,contextLines:1}:null}function qo(e){return {additions:e.additions,deletions:e.deletions,totalChanges:e.additions+e.deletions,chunks:e.chunks.length,collapsedChunks:e.chunks.filter(t=>t.collapsed).length}}var ze=55296,Ue=56319,Ve=56320,je=57343;function me(e){return e>=55296&&e<=56319}function he(e){return e>=56320&&e<=57343}function N(e){return e>=55296&&e<=57343}function $e(e,t){if(t<0||t>=e.length)return false;let n=e.charCodeAt(t);return N(n)}function Ke(e,t){if(!me(e))throw new Error(`Invalid high surrogate: 0x${e.toString(16)}`);if(!he(t))throw new Error(`Invalid low surrogate: 0x${t.toString(16)}`);return (e-55296)*1024+(t-56320)+65536}function qe(e){if(e<=65535)throw new Error(`Code point 0x${e.toString(16)} doesn't need surrogate encoding`);if(e>1114111)throw new Error(`Invalid code point: 0x${e.toString(16)} (exceeds U+10FFFF)`);let t=e-65536,n=(t>>10)+55296,r=(t&1023)+56320;return [n,r]}function Ze(e,t){if(t<0||t>=e.length)return -1;let n=e.codePointAt(t);return n===void 0?-1:n}function Xe(...e){return String.fromCodePoint(...e)}function*ge(e){for(let t of e){let n=t.codePointAt(0);n!==void 0&&(yield n);}}function xe(e){return [...ge(e)]}function*Ye(e){for(let t of e)yield t;}function Je(e){let t=0;for(let n of e)t++;return t}function Qe(e){return !(e<0||e>1114111||e>=55296&&e<=57343)}function et(e){return e>=0&&e<=65535}function Z(e){return e>=65536&&e<=1114111}function tt(e,t){if(t<0)return "";let n=0;for(let r of e){if(n===t)return r;n++;}return ""}function nt(e,t,n){let r=t<0?0:t,o="",i=0;for(let a of e){if(n!==void 0&&i>=n)break;i>=r&&(o+=a),i++;}return o}var X=[[768,879],[6832,6911],[7616,7679],[8400,8447],[65056,65071],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1552,1562],[1611,1631],[1648,1648],[1750,1756],[1759,1764],[1767,1768],[1770,1773],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2260,2273],[2275,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2901,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6159,6159],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[65024,65039],[917760,917999]],Y=new Set((function*(){for(let[e,t]of X)for(let n=e;n<=t;n++)yield n;})());function zl(e,t){let n=0,r=t.length-1;for(;n<=r;){let o=Math.floor((n+r)/2),i=t[o];if(!i)break;let[a,s]=i;if(e<a)r=o-1;else if(e>s)n=o+1;else return true}return false}function H(e){return e<768?false:Y.has(e)}function rt(e){return e<768?false:zl(e,X)}function ot(){return Y.size}var be=[[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12352,12447],[12448,12543],[12544,12591],[12592,12687],[12688,12703],[12704,12735],[12736,12783],[12784,12799],[12800,13055],[13056,13311],[13312,19903],[19968,40959],[40960,42127],[42128,42191],[44032,55203],[63744,64255],[65040,65055],[65072,65103],[65104,65135],[65280,65376],[65504,65510],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[194560,195103],[196608,201551],[201552,205743]],at=[[65281,65374],[65504,65510]],ye=[[0,31],[127,159],[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1552,1562],[1611,1631],[1648,1648],[1750,1756],[1759,1764],[1767,1768],[1770,1773],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2260,2273],[2275,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[6832,6845],[6846,6846],[6847,6848],[7616,7679],[8203,8207],[8288,8292],[8294,8303],[8400,8447],[65024,65039],[65056,65071],[65279,65279],[917760,917999]],Ce=[[161,161],[164,164],[167,168],[170,170],[173,174],[176,180],[182,186],[188,191],[198,198],[208,208],[215,216],[222,225],[230,230],[232,234],[236,237],[240,240],[242,243],[247,250],[252,252],[254,254],[913,929],[931,937],[945,961],[963,969],[1025,1025],[1040,1103],[1105,1105],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175]],Se=[[127744,128511],[128512,128591],[128640,128767],[129280,129535],[129536,129647],[129648,129791]];function it(e,t){let n=0,r=t.length-1;for(;n<=r;){let o=Math.floor((n+r)/2),i=t[o];if(!i)break;let[a,s]=i;if(e<a)r=o-1;else if(e>s)n=o+1;else return true}return false}function R(e){return e<4352?false:!!(it(e,be)||it(e,Se))}function S(e){return it(e,ye)}function Te(e){return it(e,Ce)}function g(e,t=false){return S(e)?0:R(e)||t&&Te(e)?2:1}var gs=typeof Intl<"u"&&"Segmenter"in Intl,Zo=null;function xs(){return gs?(Zo||(Zo=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Zo):null}function*T(e){if(e.length===0)return;let t=xs();if(t)for(let n of t.segment(e))yield n.segment;else for(let n of e)yield n;}function Le(e){return [...T(e)]}function st(e){if(e.length===0)return 0;let t=xs();if(t){let r=0;for(let o of t.segment(e))r++;return r}let n=0;for(let r of e)n++;return n}function lt(e,t){if(t<0)return;let n=0;for(let r of T(e)){if(n===t)return r;n++;}}function ut(e,t,n){let r=t<0?0:t,o="",i=0;for(let a of T(e)){if(n!==void 0&&i>=n)break;i>=r&&(o+=a),i++;}return o}function ee(e){if(e.length===0)return 0;let t=e.codePointAt(0);return t===void 0?0:Ul(e)?2:g(t)}function Ul(e){if(e.length===0)return false;let t=e.codePointAt(0);return t===void 0?false:!!(t>=127462&&t<=127487||t>=127744&&t<=129535||t>=129536&&t<=129791||t>=9728&&t<=9983||t>=9984&&t<=10175||e.includes("\uFE0F")||e.includes("\u200D"))}function J(e){let t=0;for(let n of T(e))t+=ee(n);return t}function Q(e,t){let n=0,r="";for(let o of T(e)){let i=ee(o);if(n+i>t)return {text:r,width:n,truncated:true};n+=i,r+=o;}return {text:r,width:n,truncated:false}}function dt(e,t,n="\u2026"){if(J(e)<=t)return e;let o=J(n);if(o>=t)return Q(n,t).text;let i=t-o;return Q(e,i).text+n}function ct(){return gs}function ft(e){return Le(e).reverse().join("")}var Vl={replacement:"?",dropWide:true,dropCombining:true,dropAstral:true,dropZeroWidth:true,dropControl:false};function bs(e){return e>=0&&e<=31?e!==9&&e!==10&&e!==13:e===127||e>=128&&e<=159}function jl(e){return e===9||e===10||e===13}function $l(e,t,n){return n&&S(t)?jl(t)?e:"":null}function Kl(e,t,n,r,o){return Z(t)?n||r&&R(t)?o:e:null}function ql(e,t,n){if(N(t))return n.replacement;if(H(t))return n.dropCombining?"":e;if(bs(t))return n.dropControl?"":e;let r=$l(e,t,n.dropZeroWidth);if(r!==null)return r;let o=Kl(e,t,n.dropAstral,n.dropWide,n.replacement);return o!==null?o:n.dropWide&&R(t)?n.replacement:e}function pt(e,t){let n={...Vl,...t},r="";for(let o of e){let i=o.codePointAt(0);if(i===void 0){r+=n.replacement;continue}r+=ql(o,i,n);}return r}function mt(e,t="?"){let n="";for(let r of e){let o=r.codePointAt(0);if(o===void 0){n+=t;continue}o>=32&&o<=126||o===9||o===10||o===13?n+=r:n+=t;}return n}function ht(e){let t="";for(let n of e){let r=n.codePointAt(0);r!==void 0&&!S(r)&&(t+=n);}return t}function gt(e){let t="";for(let n of e){let r=n.codePointAt(0);r!==void 0&&!H(r)&&(t+=n);}return t}function xt(e){let t="";for(let n of e){let r=n.codePointAt(0);r!==void 0&&!bs(r)&&(t+=n);}return t}function ke(e){return e.normalize("NFC")}function bt(e){return e.normalize("NFD")}function yt(e){return e.normalize("NFKC")}function Ct(e){return e.normalize("NFKD")}function St(e,t=false){return g(e,t)}function _(e,t=false){if(e.length===0)return 0;let n=e.codePointAt(0);return n===void 0?0:g(n,t)}function Tt(e,t,n=false){if(t<0)return -1;let r=0;for(let o of e){if(r===t){let i=o.codePointAt(0);return i===void 0?0:g(i,n)}r++;}return -1}var Lt=8,kt=9;function x(e,t){let n=t?.tabWidth??Lt,r=t?.ambiguousAsWide??false,o=0;for(let i of e){let a=i.codePointAt(0);if(a!==void 0){if(a===kt){let s=o%n;o+=n-s;continue}o+=g(a,r);}}return o}function At(e,t){return x(e,t)}function Ae(e,t,n){let r=n?.ambiguousAsWide??false,o=n?.tabWidth??Lt,i=0,a="";for(let s of e){let l=s.codePointAt(0);if(l===void 0)continue;let u;if(l===kt){let d=i%o;u=o-d;}else u=g(l,r);if(i+u>t)return {text:a,width:i,truncated:true};i+=u,a+=s;}return {text:a,width:i,truncated:false}}function G(e,t,n){return Ae(e,t,n).text}function Rt(e,t,n="\u2026",r){if(x(e,r)<=t)return e;let i=x(n,r);if(i>=t)return G(n,t,r);let a=t-i;return G(e,a,r)+n}function Mt(e,t,n=" ",r){let o=x(e,r);if(o>=t)return e;let i=_(n,r?.ambiguousAsWide);if(i===0)return e;let a=t-o,s=Math.floor(a/i);return e+n.repeat(s)}function Wt(e,t,n=" ",r){let o=x(e,r);if(o>=t)return e;let i=_(n,r?.ambiguousAsWide);if(i===0)return e;let a=t-o,s=Math.floor(a/i);return n.repeat(s)+e}function Et(e,t,n=" ",r){let o=x(e,r);if(o>=t)return e;let i=_(n,r?.ambiguousAsWide);if(i===0)return e;let a=t-o,s=Math.floor(a/2),l=a-s,u=Math.floor(s/i),d=Math.floor(l/i);return n.repeat(u)+e+n.repeat(d)}function wt(e,t,n){let r=n?.ambiguousAsWide??false,o=n?.tabWidth??Lt;if(t<0)return -1;let i=0,a=0;for(let s of e){let l=s.codePointAt(0);if(l===void 0){a++;continue}let u;if(l===kt){let d=i%o;u=o-d;}else u=g(l,r);if(t>=i&&t<i+u||u===0&&t===i)return a;i+=u,a++;}return -1}function It(e,t,n){let r=n?.ambiguousAsWide??false,o=n?.tabWidth??Lt;if(t<0)return -1;let i=0,a=0;for(let s of e){if(a===t)return i;let l=s.codePointAt(0);if(l===void 0){a++;continue}let u;if(l===kt){let d=i%o;u=o-d;}else u=g(l,r);i+=u,a++;}return -1}function Re(e){for(let t of e){let n=t.codePointAt(0);if(n!==void 0&&g(n)===2)return true}return false}function Dt(e){for(let t of e){let n=t.codePointAt(0);if(n!==void 0&&S(n))return true}return false}var _t=z$1.object({codePoint:z$1.number().int().nonnegative(),width:z$1.number().int().min(0).max(2)}),Pt=z$1.object({terminal:z$1.string().min(1),overrides:z$1.array(_t)});function Xo(){return [{label:"Family emoji (ZWJ sequence)",input:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",expectedWidth:2,category:"emoji-zwj",notes:"Most terminals render as single 2-wide glyph, some render 8-wide"},{label:"Couple with heart (ZWJ)",input:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F468}",expectedWidth:2,category:"emoji-zwj",notes:"ZWJ joins three characters into one grapheme"},{label:"Person with white hair (ZWJ)",input:"\u{1F9D1}\u200D\u{1F9B3}",expectedWidth:2,category:"emoji-zwj"},{label:"Pirate flag (ZWJ)",input:"\u{1F3F4}\u200D\u2620\uFE0F",expectedWidth:2,category:"emoji-zwj"},{label:"ZWJ character alone",input:"\u200D",expectedWidth:0,category:"emoji-zwj"},{label:"US flag (regional indicators)",input:"\u{1F1FA}\u{1F1F8}",expectedWidth:2,category:"regional-indicators",notes:"Two regional indicators form a flag"},{label:"Japan flag",input:"\u{1F1EF}\u{1F1F5}",expectedWidth:2,category:"regional-indicators"},{label:"Single regional indicator",input:"\u{1F1FA}",expectedWidth:2,category:"regional-indicators",notes:"Unpaired regional indicators vary by terminal"},{label:"Text presentation (VS15)",input:"\u2764\uFE0E",expectedWidth:1,category:"variation-selectors",notes:"VS15 forces text presentation (narrow)"},{label:"Emoji presentation (VS16)",input:"\u2764\uFE0F",expectedWidth:2,category:"variation-selectors",notes:"VS16 forces emoji presentation (wide)"},{label:"Number sign with VS16",input:"#\uFE0F\u20E3",expectedWidth:2,category:"variation-selectors",notes:"Keycap sequence"},{label:"Variation selector alone",input:"\uFE0F",expectedWidth:0,category:"variation-selectors"},{label:"CJK ideograph (U+4E2D)",input:"\u4E2D",expectedWidth:2,category:"cjk"},{label:'CJK string "\u4E2D\u6587\u6D4B\u8BD5"',input:"\u4E2D\u6587\u6D4B\u8BD5",expectedWidth:8,category:"cjk"},{label:"Hangul syllable (\uAC00)",input:"\uAC00",expectedWidth:2,category:"cjk"},{label:"Katakana (\u30AB\u30BF\u30AB\u30CA)",input:"\u30AB\u30BF\u30AB\u30CA",expectedWidth:8,category:"cjk"},{label:"CJK compatibility ideograph",input:"\uF900",expectedWidth:2,category:"cjk"},{label:"Latin a + combining acute",input:"a\u0301",expectedWidth:1,category:"combining"},{label:"Multiple combining marks (Zalgo-style)",input:"a\u0300\u0301\u0302\u0303",expectedWidth:1,category:"combining",notes:"All combining marks are zero-width"},{label:"Devanagari with combining",input:"\u0915\u094D\u0937",expectedWidth:2,category:"combining",notes:"Consonant cluster"},{label:"Korean jamo with combining",input:"\u1100\u1161",expectedWidth:2,category:"combining",notes:"Lead + vowel jamo"},{label:"Single tab",input:" ",expectedWidth:8,category:"tabs",notes:"Default tab width is 8"},{label:"Tab after 3 chars",input:"abc ",expectedWidth:8,category:"tabs",notes:"Tab extends to next 8-column boundary"},{label:"Null character",input:"\0",expectedWidth:0,category:"control"},{label:"Bell character",input:"\x07",expectedWidth:0,category:"control"},{label:"Backspace",input:"\b",expectedWidth:0,category:"control"},{label:"Soft hyphen",input:"\xAD",expectedWidth:1,category:"control",notes:"Soft hyphen is technically a format character but width=1 in most terminals"},{label:"Fullwidth A",input:"\uFF21",expectedWidth:2,category:"fullwidth"},{label:"Fullwidth digits",input:"\uFF10\uFF11\uFF12",expectedWidth:6,category:"fullwidth"},{label:"Fullwidth exclamation mark",input:"\uFF01",expectedWidth:2,category:"fullwidth"},{label:"Halfwidth katakana",input:"\uFF66",expectedWidth:1,category:"halfwidth"},{label:"Halfwidth Hangul",input:"\uFFA0",expectedWidth:1,category:"halfwidth"},{label:"Greek alpha",input:"\u03B1",expectedWidth:1,category:"ambiguous",notes:"Ambiguous width - 1 in Western locale, 2 in CJK locale"},{label:"Box drawing (light horizontal)",input:"\u2500",expectedWidth:1,category:"ambiguous"},{label:"Bullet (\u2022)",input:"\u2022",expectedWidth:1,category:"ambiguous"},{label:"Musical symbol (U+1D11E)",input:"\u{1D11E}",expectedWidth:1,category:"surrogate-pairs"},{label:"Emoji face (U+1F600)",input:"\u{1F600}",expectedWidth:2,category:"surrogate-pairs"},{label:"Skin tone modifier (U+1F3FD)",input:"\u{1F44B}\u{1F3FD}",expectedWidth:2,category:"surrogate-pairs",notes:"Waving hand + medium skin tone"},{label:"ASCII + CJK mixed",input:"Hello\u4E16\u754C",expectedWidth:9,category:"mixed"},{label:"Emoji + text mixed",input:"\u{1F389} Party!",expectedWidth:9,category:"mixed"},{label:"Empty string",input:"",expectedWidth:0,category:"mixed"},{label:"Newline only",input:`
8
+ `,expectedWidth:0,category:"mixed"}]}function Yo(){return [{label:"Family ZWJ emoji",input:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",expectedWidth:2,terminalWidths:{"xterm-256color":8,kitty:2,alacritty:2,wezterm:2,"gnome-terminal":2,iterm2:2,"windows-terminal":2},severity:"major"},{label:"Flag sequence (regional indicators)",input:"\u{1F1FA}\u{1F1F8}",expectedWidth:2,terminalWidths:{"xterm-256color":4,kitty:2,alacritty:2,wezterm:2,iterm2:2},severity:"major"},{label:"Unpaired regional indicator",input:"\u{1F1FA}",expectedWidth:2,terminalWidths:{"xterm-256color":2,kitty:1,alacritty:2},severity:"minor"},{label:"Skin tone emoji",input:"\u{1F44B}\u{1F3FD}",expectedWidth:2,terminalWidths:{"xterm-256color":4,kitty:2,alacritty:2,iterm2:2},severity:"major"},{label:"VS16 heart emoji",input:"\u2764\uFE0F",expectedWidth:2,terminalWidths:{"xterm-256color":1,kitty:2,alacritty:2,iterm2:2},severity:"minor"},{label:"Keycap sequence #\uFE0F\u20E3",input:"#\uFE0F\u20E3",expectedWidth:2,terminalWidths:{"xterm-256color":2,kitty:2,alacritty:1},severity:"minor"},{label:"Devanagari conjunct",input:"\u0915\u094D\u0937",expectedWidth:2,terminalWidths:{"xterm-256color":1,kitty:2,alacritty:1},severity:"minor"},{label:"Zalgo text (heavy combining)",input:"a\u0300\u0301\u0302\u0303\u0304\u0305\u0306\u0307",expectedWidth:1,terminalWidths:{"xterm-256color":1,kitty:1,alacritty:1},severity:"critical"}]}var ne=new Map;function Jo(e){let t=Pt.parse(e);for(let n of t.overrides)ne.set(n.codePoint,n.width);}function Qo(){ne.clear();}function ei(){return ne.size}function ti(e){return ne.get(e)??null}function ni(e,t){if(ne.size===0)return x(e,t);let n=t?.tabWidth??8,r=0,o=0;for(let i=0;i<e.length;i++){let a=e.codePointAt(i);if(a===void 0)continue;if(a===10){o=0;continue}if(a===9){let l=n-o%n;r+=l,o+=l;continue}let s=ne.get(a);if(s!==void 0)r+=s,o+=s;else {let l=g(a);r+=l,o+=l;}a>65535&&i++;}return r}function ri(e,t){let n=[],r=0;for(let o of e){let i=x(o.input,t);i===o.expectedWidth?r++:n.push({testCase:o,actualWidth:i});}return {total:e.length,passed:r,failed:n.length,failures:n}}function oi(e,t){return e.filter(n=>n.category===t)}function ii(e){let t=new Set;for(let n of e)t.add(n.category);return [...t]}function ai(e){let t=[];if(t.push(`Width Test Results: ${e.passed}/${e.total} passed`),t.push(""),e.failures.length===0)return t.push("All tests passed!"),t.join(`
9
+ `);t.push(`Failures (${e.failed}):`);for(let n of e.failures)t.push(` [${n.testCase.category}] ${n.testCase.label}`),t.push(` Expected: ${n.testCase.expectedWidth}, Got: ${n.actualWidth}`),t.push(` Input: ${JSON.stringify(n.testCase.input)}`),n.testCase.notes&&t.push(` Note: ${n.testCase.notes}`);return t.join(`
10
+ `)}var si=1e3,vt=100;function Ft(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t^e.charCodeAt(n);return t>>>0}function li(e){return {width:e,entries:new Map,dirty:new Set,totalLines:0,lineOffsets:[],fullInvalidate:true}}function ui(e){e.entries.clear(),e.dirty.clear(),e.totalLines=0,e.lineOffsets.length=0,e.fullInvalidate=true;}function di(e,t){if(e.width!==t){e.width=t,e.fullInvalidate=true;for(let[n]of e.entries)e.dirty.add(n);}}function Zl(e,t,n,r){if(t<=0)return {lines:[""],breakPoints:[0]};if(e.length===0)return {lines:[""],breakPoints:[0]};let o=Xl();for(let i=0;i<=e.length;i++)nu(o,e,i,t,n,r);return {lines:o.lines,breakPoints:o.breakPoints}}function Xl(){return {lines:[],breakPoints:[0],lineStart:0,lineWidth:0,wordWidth:0,lastBreakable:-1,lastBreakableWidth:0}}function Yl(e,t,n,r){let o=t.slice(e.lineStart,n);(o.length>0||e.lines.length===0)&&(e.lines.push(o),r||e.breakPoints.push(n+1)),Jl(e,n+1);}function Jl(e,t){e.lineStart=t,e.lineWidth=0,e.wordWidth=0,e.lastBreakable=-1,e.lastBreakableWidth=0;}function Ql(e,t,n){e.lastBreakable=t,e.lastBreakableWidth=e.lineWidth,e.wordWidth=0,e.lineWidth+=n;}function eu(e,t){e.wordWidth+=t,e.lineWidth+=t;}function tu(e,t,n,r,o,i){if(e.lastBreakable>=e.lineStart&&!i){let a=t.slice(e.lineStart,e.lastBreakable);e.lines.push(a),e.breakPoints.push(e.lastBreakable+1),e.lineStart=e.lastBreakable+1,e.lineWidth=e.lineWidth-e.lastBreakableWidth-1,e.lastBreakable=-1;return}if(i||e.wordWidth>o){let a=t.slice(e.lineStart,n);e.lines.push(a),e.breakPoints.push(n),e.lineStart=n,e.lineWidth=r,e.wordWidth=r,e.lastBreakable=-1;}}function nu(e,t,n,r,o,i){let a=n<t.length?t[n]:void 0,s=n===t.length;if(a===`
11
+ `||s){Yl(e,t,n,s);return}let u=i?x(a??""):1;a===" "||a===" "?Ql(e,n,u):eu(e,u),e.lineWidth>r&&tu(e,t,n,u,r,o);}function ci(e,t,n,r){let{lines:o,breakPoints:i}=Zl(e,t,n,r);return {text:e,hash:Ft(e),width:t,lines:o,breakPoints:i}}function fi(e,t,n){let r=n?.width??e.width,o=n?.breakWord??false,i=n?.unicodeWidth??true,a=t.split(`
12
+ `),s=[];e.lineOffsets.length=0;let l=0;for(let u=0;u<a.length;u++){let d=a[u];if(d===void 0)continue;e.lineOffsets.push(l);let c=e.entries.get(u),p=Ft(d);if(c&&c.hash===p&&c.width===r&&!e.dirty.has(u)&&!e.fullInvalidate){s.push(...c.lines),l+=c.lines.length;continue}let f=ci(d,r,o,i);e.entries.set(u,f),e.dirty.delete(u),s.push(...f.lines),l+=f.lines.length;}e.totalLines=l,e.fullInvalidate=false;for(let[u]of e.entries)u>=a.length&&e.entries.delete(u);return s}function pi(e,t,n,r,o){let i=performance.now(),a=o?.width??e.width,s=o?.breakWord??false,l=o?.unicodeWidth??true,u=t.split(`
13
+ `),d=[],c=ru(e,n),p=c.currentLine,f=c.targetParagraph,m=0,h=u.length;for(let C=f;C<h&&p<r;C++){let fs=u[C];if(fs===void 0)continue;let yl=ou(e,C,fs,a,s,l);p=iu(d,yl.lines,p,n,r),m=C+1;}let $=performance.now()-i;return {lines:d,hasMore:m<h,nextParagraph:m,timeMs:$}}function ru(e,t){let n=0,r=0;if(e.lineOffsets.length===0||e.fullInvalidate)return {targetParagraph:n,currentLine:r};for(let o=0;o<e.lineOffsets.length;o++){let i=e.lineOffsets[o];if(i!==void 0&&i<=t)n=o,r=i;else break}return {targetParagraph:n,currentLine:r}}function ou(e,t,n,r,o,i){let a=e.entries.get(t),s=Ft(n);if(a&&a.hash===s&&a.width===r&&!e.dirty.has(t)&&!e.fullInvalidate)return a;let l=ci(n,r,o,i);return e.entries.set(t,l),e.dirty.delete(t),l}function iu(e,t,n,r,o){let i=n;for(let a=0;a<t.length;a++){if(i>=r&&i<o){let s=t[a];s!==void 0&&e.push(s);}i++;}return i}function mi(e,t,n,r=vt,o){let i=performance.now(),a=o?.width??e.width,s=o?.breakWord??false,l=o?.unicodeWidth??true,u=t.split(`
14
+ `),d=[],c=Math.min(n+r,u.length);for(let f=n;f<c;f++){let m=u[f];if(m===void 0)continue;let h=e.entries.get(f),$=Ft(m),C;h&&h.hash===$&&h.width===a&&!e.dirty.has(f)&&!e.fullInvalidate?C=h:(C=ci(m,a,s,l),e.entries.set(f,C),e.dirty.delete(f)),d.push(...C.lines);}let p=performance.now()-i;return {lines:d,hasMore:c<u.length,nextParagraph:c,timeMs:p}}function hi(e,t,n){for(let r=t;r<n;r++)e.dirty.add(r);}function gi(e,t){e.dirty.add(t);}function xi(e){e.fullInvalidate=true;}function bi(e,t){if(t<0||t>=e.totalLines)return;let n=0,r=e.lineOffsets.length-1,o=0;for(;n<=r;){let u=Math.floor((n+r)/2),d=e.lineOffsets[u];if(d===void 0)break;d<=t?(o=u,n=u+1):r=u-1;}let i=e.lineOffsets[o]??0,a=t-i,l=e.entries.get(o)?.breakPoints[a]??0;return {paragraph:o,lineInParagraph:a,charOffset:l}}function yi(e,t,n=0){if(t<0||t>=e.lineOffsets.length)return -1;let r=e.lineOffsets[t];return r===void 0?-1:r+n}function Ci(e){return {cachedParagraphs:e.entries.size,dirtyParagraphs:e.dirty.size,totalLines:e.totalLines,width:e.width,fullInvalidate:e.fullInvalidate}}var au={minFoldableLines:2,labelTemplate:"... {count} lines",maxDepth:10};function Si(e,t){return {config:{...au,...t},regions:new Map,totalDocumentLines:e,nextId:0}}function Ti(e,t,n,r){let o=n-t;if(o<e.config.minFoldableLines||t<0||n>=e.totalDocumentLines||t>=n)return;let i=`fold-${e.nextId++}`,a=su(e,t,n);if(a>=e.config.maxDepth)return;let s=r??e.config.labelTemplate.replace("{count}",String(o)),l={id:i,startLine:t,endLine:n,folded:false,label:s,depth:a};return e.regions.set(i,l),i}function Li(e,t){return e.regions.delete(t)}function ki(e,t){let n=e.regions.get(t);return !n||n.folded?false:(e.regions.set(t,{...n,folded:true}),true)}function Ai(e,t){let n=e.regions.get(t);return !n||!n.folded?false:(e.regions.set(t,{...n,folded:false}),true)}function Ri(e,t){let n=e.regions.get(t);if(!n)return;let r=!n.folded;return e.regions.set(t,{...n,folded:r}),r}function Mi(e){let t=0;for(let[n,r]of e.regions)r.folded||(e.regions.set(n,{...r,folded:true}),t++);return t}function Wi(e){let t=0;for(let[n,r]of e.regions)r.folded&&(e.regions.set(n,{...r,folded:false}),t++);return t}function Ei(e,t){let n=0;for(let[r,o]of e.regions)o.depth>=t&&!o.folded&&(e.regions.set(r,{...o,folded:true}),n++);return n}function wi(e,t){let n;for(let r of e.regions.values())t>=r.startLine&&t<=r.endLine&&(!n||r.depth>n.depth)&&(n=r);return n}function Ii(e){return Array.from(e.regions.values()).sort((t,n)=>t.startLine-n.startLine)}function Di(e,t,n){let r=Bt(e),o=[],i=0,a=0;for(;i<t&&a<e.totalDocumentLines;){let s=Ot(r,a);s?(i++,a=s.endLine+1):(i++,a++);}for(;o.length<n&&a<e.totalDocumentLines;){let s=Ot(r,a);s?(o.push({originalLine:s.startLine,isFoldPlaceholder:true,foldId:s.id,foldLabel:s.label,hiddenLines:s.endLine-s.startLine}),a=s.endLine+1):(o.push({originalLine:a,isFoldPlaceholder:false,foldId:void 0,foldLabel:void 0,hiddenLines:0}),a++);}return o}function _i(e,t){let n=Bt(e),r=0,o=0;for(;r<t&&o<e.totalDocumentLines;){let i=Ot(n,o);i?(r++,o=i.endLine+1):(r++,o++);}return o}function Pi(e,t){let n=Bt(e),r=0,o=0;for(;o<t&&o<e.totalDocumentLines;){let i=Ot(n,o);if(i){if(r++,t>i.startLine&&t<=i.endLine)return -1;o=i.endLine+1;}else r++,o++;}return r}function vi(e){let t=0,n=0,r=0,o=Bt(e);for(let i of o)t++,n+=i.endLine-i.startLine;for(let i of e.regions.values())i.depth>r&&(r=i.depth),i.folded&&(t=Math.max(t,t));return {totalRegions:e.regions.size,foldedRegions:t,hiddenLines:n,visibleLines:e.totalDocumentLines-n,maxDepth:r}}function Fi(e,t){e.totalDocumentLines=t;for(let[n,r]of e.regions)(r.startLine>=t||r.endLine>=t)&&e.regions.delete(n);}function su(e,t,n){let r=0;for(let o of e.regions.values())o.startLine<=t&&o.endLine>=n&&(r=Math.max(r,o.depth+1));return r}function Bt(e){let t=[];for(let r of e.regions.values())r.folded&&t.push({id:r.id,startLine:r.startLine,endLine:r.endLine,label:r.label});t.sort((r,o)=>r.startLine-o.startLine);let n=[];for(let r of t){let o=n[n.length-1];if(o&&r.startLine<=o.endLine){r.endLine>o.endLine&&(n[n.length-1]={...o,endLine:r.endLine});continue}n.push(r);}return n}function Ot(e,t){let n=0,r=e.length-1;for(;n<=r;){let o=n+r>>>1,i=e[o];if(!i)break;if(t<i.startLine)r=o-1;else if(t>i.endLine)n=o+1;else return i}}function Nt(e,t){let n={...e};for(let r in t)if(Object.hasOwn(t,r)){let o=t[r],i=n[r];o!==null&&typeof o=="object"&&!Array.isArray(o)&&i!==null&&typeof i=="object"&&!Array.isArray(i)?n[r]=Nt(i,o):n[r]=o;}return n}function Oi(e,t){return {...e,...t}}function Bi(e){return [...e].sort((t,n)=>{let r=t.name.startsWith("."),o=n.name.startsWith(".");return r&&!o?1:!r&&o?-1:t.name.toLowerCase().localeCompare(n.name.toLowerCase())})}function Ni(e){return [...e].sort((t,n)=>t.index-n.index)}function Hi(e){return [...e].sort((t,n)=>n.priority-t.priority)}function Gi(e,t,n=false){return [...e].sort((r,o)=>{let i=t(r),a=t(o),s;return typeof i=="string"&&typeof a=="string"?s=i.localeCompare(a):s=i-a,n?-s:s})}var Cs=new Set(["node_modules",".git",".svn",".hg","dist","build","coverage",".cache",".next","__pycache__"]);function zi(e,t,n){let r=n?.maxDepth??10,o=new Set([...Cs,...n?.excludeDirs??[]]);function i(a,s){if(s>r)return null;let l=Ss(a);if(!l)return null;let u=lu(l,a,t);return u||uu(l,a,s,r,o,i)}return i(P.resolve(e),0)}function Ui(e,t,n){let r=n?.maxDepth??10,o=new Set([...Cs,...n?.excludeDirs??[]]),i=n?.maxResults??Number.POSITIVE_INFINITY,a=[];function s(l,u){if(u>r||a.length>=i)return;let d=Ss(l);d&&(du(d,l,t,a,i),cu(d,l,u,r,o,a,i,s));}return s(P.resolve(e),0),a}function Ss(e){try{return ys.readdirSync(e,{withFileTypes:!0})}catch{return null}}function lu(e,t,n){for(let r of e)if(r.name===n&&r.isFile())return P.join(t,r.name);return null}function uu(e,t,n,r,o,i){for(let a of e){if(!a.isDirectory()||o.has(a.name))continue;let s=i(P.join(t,a.name),n+1);if(s)return s}return null}function du(e,t,n,r,o){for(let i of e){if(r.length>=o)return;i.name===n&&i.isFile()&&r.push(P.join(t,i.name));}}function cu(e,t,n,r,o,i,a,s){for(let l of e){if(i.length>=a)return;!l.isDirectory()||o.has(l.name)||s(P.join(t,l.name),n+1);}}function Vi(e){return [...new Set(e)]}function ji(e,t){let n=new Set,r=[];for(let o of e){let i=t(o);n.has(i)||(n.add(i),r.push(o));}return r}function $i(e,t){let n=new Map;for(let r of e){let o=t(r),i=n.get(o);i?i.push(r):n.set(o,[r]);}return n}function Ki(e,t){let n=[],r=[];for(let o of e)t(o)?n.push(o):r.push(o);return [n,r]}var fu={chunkSize:1e3,maxCachedChunks:50,readAheadLines:500,readBehindLines:200,maxMemoryBytes:104857600};function qi(e,t){return {config:{...fu,...t},source:e,chunks:new Map,accessOrder:[],hits:0,misses:0}}function Zi(e,t,n){let r={start:Math.max(0,t),end:Math.min(n,e.source.totalLines)},o=[],i=e.config.chunkSize,a=Math.floor(r.start/i),s=Math.floor(Math.max(0,r.end-1)/i);for(let l=a;l<=s;l++){let u=Ts(e,l);if(!u)continue;let d=l*i,c=Math.max(0,r.start-d),p=Math.min(u.lines.length,r.end-d);for(let f=c;f<p;f++){let m=u.lines[f];m!==void 0&&o.push(m);}}return o}function Xi(e,t,n){let{readAheadLines:r,readBehindLines:o,chunkSize:i}=e.config,a=Math.max(0,t-o),s=Math.min(e.source.totalLines,n+r),l=Math.floor(a/i),u=Math.floor(Math.max(0,s-1)/i);for(let d=l;d<=u;d++)Ts(e,d);}function Ht(e,t){let n=t??e.config.maxCachedChunks,r=0;for(;e.chunks.size>n&&e.accessOrder.length>0;){let o=e.accessOrder.shift();if(o===void 0)break;e.chunks.has(o)&&(e.chunks.delete(o),r++);}return r}function Yi(e){e.chunks.clear(),e.accessOrder=[],e.hits=0,e.misses=0;}function Ji(e){let t=0;for(let r of e.chunks.values())t+=r.byteSize;let n=e.hits+e.misses;return {config:e.config,totalLines:e.source.totalLines,loadedChunks:e.chunks.size,memoryUsage:t,hitRate:n>0?e.hits/n:0}}function Qi(e,t,n){let r=e.config.chunkSize,o=Math.floor(t/r),i=Math.floor(Math.max(0,n-1)/r);for(let a=o;a<=i;a++)if(!e.chunks.has(a))return false;return true}function ea(e){return {totalLines:e.length,isExactCount:true,loadRange:(t,n)=>e.slice(t,n)}}function Ts(e,t){let n=e.chunks.get(t);if(n)return e.hits++,pu(e,t),{...n,lastAccessedAt:Date.now()};e.misses++;let r=e.config.chunkSize,o=t*r,i=Math.min(o+r,e.source.totalLines);if(o>=e.source.totalLines)return;e.chunks.size>=e.config.maxCachedChunks&&Ht(e,e.config.maxCachedChunks-1);let a=e.source.loadRange(o,i),s=0;for(let u of a)s+=u.length*2;let l={index:t,startLine:o,endLine:i,lines:a,byteSize:s,lastAccessedAt:Date.now()};return e.chunks.set(t,l),e.accessOrder.push(t),l}function pu(e,t){let n=e.accessOrder.indexOf(t);n>=0&&e.accessOrder.splice(n,1),e.accessOrder.push(t);}var ta={mode:"absolute",minWidth:3,rightPadding:1,padChar:" ",separator:"\u2502",highlightCurrent:true};function re(e,t){if(e<=0)return t;let n=Math.floor(Math.log10(e))+1;return Math.max(n,t)}function Gt(e,t){let n={...ta,...t};return e+n.rightPadding+1}function na(e){return {...ta,...e}}function zt(e,t,n,r){let o=e===t;if(r==="absolute")return String(e).padStart(n," ");if(r==="relative"){if(o)return String(e).padStart(n," ");let a=Math.abs(e-t);return String(a).padStart(n," ")}if(o)return String(e).padStart(n," ");let i=Math.abs(e-t);return String(i).padStart(n," ")}function ra(e,t,n,r,o){let i={...ta,...o},a=re(e,i.minWidth),s=Gt(a,i),l=[],u=Math.min(t+n,e);for(let d=t;d<u;d++){let c=d+1,p=c===r,m=zt(c,r,a,i.mode)+i.padChar.repeat(i.rightPadding)+i.separator;l.push({text:m,isCurrent:p,lineNumber:c,width:s});}return {lines:l,gutterWidth:s,digitWidth:a,totalLines:e}}function oa(e,t,n=3){return re(e,n)!==re(t,n)}function ia(e,t,n,r="\x1B[0m"){return e.lines.map(o=>`${o.isCurrent?t:n}${o.text}${r}`)}function oe(e){return {grammar:e,entries:new Map,dirty:new Set,lineCount:0,fullInvalidate:true}}function Ut(e){e.entries.clear(),e.dirty.clear(),e.lineCount=0,e.fullInvalidate=true;}function ie(e,t){if(e.grammar.name!==t.name){e.grammar=t,e.fullInvalidate=true;for(let n=0;n<e.lineCount;n++)e.dirty.add(n);}}function Vt(e){return {cachedLines:e.entries.size,dirtyLines:e.dirty.size,grammar:e.grammar.name,lineCount:e.lineCount,fullInvalidate:e.fullInvalidate}}function jt(e,t,n){for(let r=t;r<n;r++)e.dirty.add(r);}function $t(e,t){e.dirty.add(t);}function Kt(e){e.fullInvalidate=true;for(let t=0;t<e.lineCount;t++)e.dirty.add(t);}var ae=100,v={inString:null,inComment:false,templateDepth:0,commentDepth:0};var L={name:"rust",extensions:[".rs"],keywords:new Set(["as","async","await","break","const","continue","crate","dyn","else","enum","extern","false","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","Self","static","struct","super","trait","true","type","union","unsafe","use","where","while","macro_rules"]),builtins:new Set(["Option","Some","None","Result","Ok","Err","Box","Vec","String","HashMap","HashSet","Rc","Arc","RefCell","Cell","Mutex","RwLock","println","eprintln","print","eprint","format","panic","assert","assert_eq","assert_ne","debug_assert","todo","unimplemented","unreachable","cfg","derive"]),types:new Set(["bool","char","str","u8","u16","u32","u64","u128","usize","i8","i16","i32","i64","i128","isize","f32","f64","()"]),constants:new Set(["true","false"]),operators:/[+\-*/%=<>!&|^~?:@]+/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",stringDelimiters:['"'],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?(?:_?(?:u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize|f32|f64))?)\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:true},M={name:"go",extensions:[".go"],keywords:new Set(["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"]),builtins:new Set(["append","cap","close","complex","copy","delete","imag","len","make","new","panic","print","println","real","recover"]),types:new Set(["bool","byte","complex64","complex128","error","float32","float64","int","int8","int16","int32","int64","rune","string","uint","uint8","uint16","uint32","uint64","uintptr"]),constants:new Set(["true","false","nil","iota"]),operators:/[+\-*/%=<>!&|^~:]+/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",stringDelimiters:['"',"'","`"],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?i?)\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false};var b={name:"javascript",extensions:[".js",".jsx",".ts",".tsx",".mjs",".cjs"],keywords:new Set(["async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","finally","for","from","function","if","implements","import","in","instanceof","interface","let","new","of","package","private","protected","public","return","static","super","switch","this","throw","try","type","typeof","var","void","while","with","yield","as","is","keyof","readonly","declare","namespace","abstract","satisfies"]),builtins:new Set(["Array","Boolean","Date","Error","Function","JSON","Math","Number","Object","Promise","RegExp","String","Symbol","Map","Set","WeakMap","WeakSet","console","window","document","globalThis","process","require","module","exports","Buffer","setTimeout","setInterval","clearTimeout","clearInterval","fetch","Response","Request","Headers","URL","URLSearchParams","FormData","Blob","File","FileReader","Intl","Proxy","Reflect","BigInt"]),types:new Set(["any","boolean","number","string","void","never","unknown","null","undefined","object","symbol","bigint"]),constants:new Set(["true","false","null","undefined","NaN","Infinity"]),operators:/[+\-*/%=<>!&|^~?:]+/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",stringDelimiters:["'",'"'],templateLiteralStart:"`",templateLiteralEnd:"`",numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?n?)\b/,identifierPattern:/[a-zA-Z_$][a-zA-Z0-9_$]*/,nestedComments:false},y={name:"python",extensions:[".py",".pyw",".pyi"],keywords:new Set(["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield","match","case"]),builtins:new Set(["abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__"]),types:new Set(["int","float","str","bool","list","dict","set","tuple","bytes","None"]),constants:new Set(["True","False","None","Ellipsis","NotImplemented","__debug__"]),operators:/[+\-*/%=<>!@&|^~:]+/,lineComment:"#",blockCommentStart:null,blockCommentEnd:null,stringDelimiters:["'",'"',"'''",'"""'],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?[jJ]?)\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false};var W={name:"shell",extensions:[".sh",".bash",".zsh",".fish"],keywords:new Set(["if","then","else","elif","fi","case","esac","for","while","until","do","done","in","function","select","time","coproc","return","exit","break","continue","local","declare","typeset","readonly","export","unset","shift","source","alias","unalias"]),builtins:new Set(["echo","printf","read","cd","pwd","pushd","popd","dirs","set","shopt","test","eval","exec","trap","wait","kill","jobs","fg","bg","suspend","disown","builtin","command","type","hash","help","let","true","false","getopts","bind","complete","compgen","compopt","caller","enable","mapfile","readarray","ulimit","umask"]),types:new Set([]),constants:new Set(["true","false"]),operators:/[+\-*/%=<>!&|^~?:;]+/,lineComment:"#",blockCommentStart:null,blockCommentEnd:null,stringDelimiters:['"',"'"],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b\d+\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false},F={name:"json",extensions:[".json",".jsonc",".json5"],keywords:new Set([]),builtins:new Set([]),types:new Set([]),constants:new Set(["true","false","null"]),operators:/[:]/,lineComment:null,blockCommentStart:null,blockCommentEnd:null,stringDelimiters:['"'],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b-?(?:\d+)?\.?\d+(?:[eE][+-]?\d+)?\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false},k={name:"plaintext",extensions:[".txt",".text"],keywords:new Set([]),builtins:new Set([]),types:new Set([]),constants:new Set([]),operators:/(?!)/,lineComment:null,blockCommentStart:null,blockCommentEnd:null,stringDelimiters:[],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/(?!)/,identifierPattern:/(?!)/,nestedComments:false},O=[b,y,L,M,W,F,k];function z(e,t){return e.inString===t.inString&&e.inComment===t.inComment&&e.templateDepth===t.templateDepth&&e.commentDepth===t.commentDepth}function A(e,t,n){let o=gu(e,t,n,[]),i=xu(e),a=mu(i);for(;o.pos<t.length;)hu(o,a)||o.pos++;return {text:t,tokens:o.tokens,startState:n,endState:o.state}}function mu(e){return [bu,yu,Cu,Su,Tu,Lu,ku,t=>Au(t,e),Eu,wu,Iu,Du]}function hu(e,t){for(let n of t)if(n(e))return true;return false}function gu(e,t,n,r){return {grammar:e,line:t,tokens:r,pos:0,state:{...n},addToken:(o,i,a)=>{a>i&&r.push({type:o,start:i,end:a,text:t.slice(i,a)});},startsWithAt:(o,i)=>t.slice(i,i+o.length)===o}}function xu(e){return [...e.stringDelimiters].sort((t,n)=>n.length-t.length)}function bu(e){if(e.state.inString===null)return false;let t=e.state.inString,n=e.pos;for(;e.pos<e.line.length;){let r=e.line[e.pos];if(r==="\\"&&e.pos+1<e.line.length)e.pos+=2;else if(t.length===3&&e.startsWithAt(t,e.pos)||t.length===1&&r===t){e.pos+=t.length,e.state={...e.state,inString:null};break}else e.pos++;}return e.addToken("string",n,e.pos),true}function yu(e){if(!e.state.inComment||!e.grammar.blockCommentEnd)return false;let t=e.pos;for(;e.pos<e.line.length;)if(e.grammar.nestedComments&&e.grammar.blockCommentStart&&e.startsWithAt(e.grammar.blockCommentStart,e.pos))e.state={...e.state,commentDepth:e.state.commentDepth+1},e.pos+=e.grammar.blockCommentStart.length;else if(e.startsWithAt(e.grammar.blockCommentEnd,e.pos))if(e.grammar.nestedComments&&e.state.commentDepth>0)e.state={...e.state,commentDepth:e.state.commentDepth-1},e.pos+=e.grammar.blockCommentEnd.length;else {e.pos+=e.grammar.blockCommentEnd.length,e.state={...e.state,inComment:false,commentDepth:0};break}else e.pos++;return e.addToken("comment",t,e.pos),true}function Cu(e){if(e.state.templateDepth<=0||!e.grammar.templateLiteralEnd)return false;let t=e.pos;for(;e.pos<e.line.length;)if(e.line[e.pos]==="\\"&&e.pos+1<e.line.length)e.pos+=2;else if(e.startsWithAt("${",e.pos)){e.addToken("string",t,e.pos),e.pos+=2,e.addToken("punctuation",e.pos-2,e.pos);break}else if(e.startsWithAt(e.grammar.templateLiteralEnd,e.pos)){e.pos+=e.grammar.templateLiteralEnd.length,e.state={...e.state,templateDepth:e.state.templateDepth-1};break}else e.pos++;return e.pos>t&&e.addToken("string",t,e.pos),true}function Su(e){if(!/\s/.test(e.line[e.pos]||""))return false;let t=e.pos;for(;e.pos<e.line.length&&/\s/.test(e.line[e.pos]||"");)e.pos++;return e.addToken("text",t,e.pos),true}function Tu(e){return !e.grammar.lineComment||!e.startsWithAt(e.grammar.lineComment,e.pos)?false:(e.addToken("comment",e.pos,e.line.length),e.pos=e.line.length,true)}function Lu(e){if(!e.grammar.blockCommentStart||!e.startsWithAt(e.grammar.blockCommentStart,e.pos))return false;let t=e.pos;return Ru(e)||(e.state={...e.state,inComment:true}),e.addToken("comment",t,e.pos),true}function ku(e){if(!e.grammar.templateLiteralStart||!e.startsWithAt(e.grammar.templateLiteralStart,e.pos))return false;let t=e.pos;for(e.pos+=e.grammar.templateLiteralStart.length;e.pos<e.line.length&&e.grammar.templateLiteralEnd;)if(e.line[e.pos]==="\\"&&e.pos+1<e.line.length)e.pos+=2;else if(e.startsWithAt("${",e.pos)){e.addToken("string",t,e.pos),e.pos+=2,e.addToken("punctuation",e.pos-2,e.pos),e.state={...e.state,templateDepth:e.state.templateDepth+1};break}else if(e.startsWithAt(e.grammar.templateLiteralEnd,e.pos)){e.pos+=e.grammar.templateLiteralEnd.length,e.addToken("string",t,e.pos);break}else e.pos++;return e.pos>=e.line.length&&e.pos>t+1&&(e.state={...e.state,templateDepth:e.state.templateDepth+1},e.addToken("string",t,e.pos)),true}function Au(e,t){let n=Mu(e,t);if(!n)return false;let r=e.pos;return e.pos+=n.length,Wu(e,n),e.pos>=e.line.length&&n.length===3&&(e.state={...e.state,inString:n}),e.addToken("string",r,e.pos),true}function Ru(e){if(!e.grammar.blockCommentStart||!e.grammar.blockCommentEnd)return false;for(e.pos+=e.grammar.blockCommentStart.length;e.pos<e.line.length;){if(e.grammar.nestedComments&&e.startsWithAt(e.grammar.blockCommentStart,e.pos)){e.state={...e.state,commentDepth:e.state.commentDepth+1},e.pos+=e.grammar.blockCommentStart.length;continue}if(e.startsWithAt(e.grammar.blockCommentEnd,e.pos)){if(e.grammar.nestedComments&&e.state.commentDepth>0){e.state={...e.state,commentDepth:e.state.commentDepth-1},e.pos+=e.grammar.blockCommentEnd.length;continue}return e.pos+=e.grammar.blockCommentEnd.length,true}e.pos++;}return false}function Mu(e,t){for(let n of t)if(e.startsWithAt(n,e.pos))return n;return null}function Wu(e,t){for(;e.pos<e.line.length;){if(e.line[e.pos]==="\\"&&e.pos+1<e.line.length){e.pos+=2;continue}if(t.length===3&&e.startsWithAt(t,e.pos)||t.length===1&&e.line[e.pos]===t){e.pos+=t.length;break}e.pos++;}}function Eu(e){let t=e.grammar.numberPattern.exec(e.line.slice(e.pos));return !t||t.index!==0?false:(e.addToken("number",e.pos,e.pos+t[0].length),e.pos+=t[0].length,true)}function wu(e){let t=e.grammar.identifierPattern.exec(e.line.slice(e.pos));if(!t||t.index!==0)return false;let n=t[0],r="identifier";return e.grammar.keywords.has(n)?r="keyword":e.grammar.constants.has(n)?r="constant":e.grammar.builtins.has(n)?r="builtin":(e.grammar.types.has(n)||/^[A-Z]/.test(n))&&(r="type"),e.line.slice(e.pos+n.length).trimStart().startsWith("(")&&r==="identifier"&&(r="function"),e.addToken(r,e.pos,e.pos+n.length),e.pos+=n.length,true}function Iu(e){let t=e.grammar.operators.exec(e.line.slice(e.pos));return !t||t.index!==0?false:(e.addToken("operator",e.pos,e.pos+t[0].length),e.pos+=t[0].length,true)}function Du(e){let t=e.line[e.pos]||"";return /[()[\]{},;.]/.test(t)?(e.addToken("punctuation",e.pos,e.pos+1),e.pos++,true):false}function se(e,t){let n=t.split(`
15
+ `);e.lineCount=n.length,e.fullInvalidate&&(e.entries.clear(),e.dirty.clear(),e.fullInvalidate=false);let r=[],o=v;for(let i=0;i<n.length;i++){let a=n[i]??"",s=e.entries.get(i);if(s&&s.text===a&&z(s.startState,o)&&!e.dirty.has(i))r.push(s),o=s.endState;else {let l=A(e.grammar,a,o);e.entries.set(i,l),e.dirty.delete(i),r.push(l),o=l.endState;let u=e.entries.get(i+1);u&&!z(o,u.startState)&&e.dirty.add(i+1);}}return r}function qt(e,t,n,r){let o=performance.now(),i=t.split(`
16
+ `);e.lineCount=i.length;let a=Math.max(0,n),s=Math.min(i.length,r);e.fullInvalidate&&(e.entries.clear(),e.dirty.clear(),e.fullInvalidate=false);let l=v;for(let p=0;p<a;p++){let f=i[p]??"",m=e.entries.get(p);if(m&&m.text===f&&z(m.startState,l)&&!e.dirty.has(p))l=m.endState;else {let h=A(e.grammar,f,l);e.entries.set(p,h),e.dirty.delete(p),l=h.endState;}}let u=[];for(let p=a;p<s;p++){let f=i[p]??"",m=e.entries.get(p);if(m&&m.text===f&&z(m.startState,l)&&!e.dirty.has(p))u.push(m),l=m.endState;else {let h=A(e.grammar,f,l);e.entries.set(p,h),e.dirty.delete(p),u.push(h),l=h.endState;}}let d=s<i.length,c=performance.now()-o;return {lines:u,hasMore:d,nextLine:s,timeMs:c}}function Zt(e,t,n,r=100){let o=performance.now(),i=t.split(`
17
+ `);e.lineCount=i.length;let a=Math.max(0,Math.min(n,i.length)),s=Math.min(a+r,i.length),l=v,u=e.entries.get(a-1);if(a>0&&u)l=u.endState;else if(a>0)for(let f=0;f<a;f++){let m=i[f]??"",h=e.entries.get(f);if(h&&h.text===m&&z(h.startState,l))l=h.endState;else {let $=A(e.grammar,m,l);e.entries.set(f,$),l=$.endState;}}let d=[];for(let f=a;f<s;f++){let m=i[f]??"",h=A(e.grammar,m,l);e.entries.set(f,h),e.dirty.delete(f),d.push(h),l=h.endState;}let c=s<i.length,p=performance.now()-o;return {lines:d,hasMore:c,nextLine:s,timeMs:p}}function le(e){let t=e.slice(e.lastIndexOf(".")).toLowerCase();for(let n of O)if(n.extensions.includes(t))return n;return k}function Xt(e){let t=e.split(`
18
+ `)[0]||"";if(t.startsWith("#!")){if(/python/.test(t))return y;if(/node|deno|bun/.test(t))return b;if(/bash|sh|zsh/.test(t))return W}return /^package\s+\w+/.test(t)?M:/^(use\s+|mod\s+|fn\s+|struct\s+|impl\s+|pub\s+)/.test(t)?L:/^(import|from|def|class)\s+/.test(t)?y:/^(import|export|const|let|var|function|class)\s+/.test(t)?b:/^\s*\{/.test(t)?F:k}function ue(e){let t=e.toLowerCase();for(let n of O)if(n.name===t)return n;return t==="ts"||t==="typescript"||t==="tsx"||t==="jsx"?b:t==="py"?y:t==="rs"?L:t==="bash"||t==="sh"||t==="zsh"?W:k}var sa=100,As=/^(#{1,6})\s+(.+)$/,Rs=/^(`{3,}|~{3,})(\w*)?$/,Ms=/^([-*_])\s*\1\s*\1\s*(\1|\s)*$/,Yt=/^(\s*)[-*+]\s+(.*)$/,Jt=/^(\s*)(\d+)[.)]\s+(.*)$/,_u=/^\[([ xX])\]\s+(.*)$/,aa=/^>\s?(.*)$/,Pu=/^\|?[\s:-]+\|[\s:|+-]+\|?$/,Ls=/^\|(.+)\|$/;function B(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return t}function E(e){let t=[],n=e,r=0;for(;r<n.length;){let o=Fu(n.slice(r));if(o){r>0&&(t.push({type:"text",content:n.slice(0,r)}),n=n.slice(r),r=0),t.push(o.element),n=n.slice(o.length);continue}r++;}return n.length>0&&t.push({type:"text",content:n}),t}var vu=[Ou,Bu,Nu,Hu,Gu,zu];function Fu(e){for(let t of vu){let n=t(e);if(n)return n}return null}function Ou(e){let t=e.match(/^`([^`]+)`/);return t?{element:{type:"code",content:t[1]??""},length:t[0].length}:null}function Bu(e){let t=e.match(/^(\*\*|__)(.+?)\1/);if(!t)return null;let n=t[2]??"";return {element:{type:"bold",content:n,children:E(n)},length:t[0].length}}function Nu(e){let t=e.match(/^(\*|_)(.+?)\1/);if(!t)return null;let n=t[2]??"";return {element:{type:"italic",content:n,children:E(n)},length:t[0].length}}function Hu(e){let t=e.match(/^\[([^\]]+)\]\(([^)]+)\)/);return t?{element:{type:"link",content:t[1]??"",href:t[2]??""},length:t[0].length}:null}function Gu(e){let t=e.match(/^!\[([^\]]*)\]\(([^)]+)\)/);return t?{element:{type:"image",content:t[1]??"",href:t[2]??""},length:t[0].length}:null}function zu(e){let t=e.match(/^~~(.+?)~~/);return t?{element:{type:"strikethrough",content:t[1]??""},length:t[0].length}:null}function Me(e){let t=performance.now(),n=e.split(`
19
+ `),r=[],o=0;for(;o<n.length;){let i=n[o];if(i===void 0){o++;continue}if(i.trim()===""){o++;continue}let a=Vu(n,o);if(a){r.push(a.block),o=a.nextIndex;continue}o++;}return {blocks:r,parseTimeMs:performance.now()-t}}var Uu=[ju,$u,Ku,qu,Zu,Xu,Yu];function Vu(e,t){for(let n of Uu){let r=n(e,t);if(r)return r}return null}function ju(e,t){let n=e[t];if(n===void 0)return null;let r=n.match(As);if(!r)return null;let o=r[2]??"";return {block:{type:"heading",source:n,lineStart:t,lineEnd:t+1,hash:B(n),data:{kind:"heading",level:r[1]?.length??1,text:o,inline:E(o)}},nextIndex:t+1}}function $u(e,t){let n=e[t];return n===void 0||!Ms.test(n)?null:{block:{type:"hr",source:n,lineStart:t,lineEnd:t+1,hash:B(n),data:{kind:"hr"}},nextIndex:t+1}}function Ku(e,t){let n=e[t];if(n===void 0)return null;let r=n.match(Rs);if(!r)return null;let o=r[1]??"",i=r[2]??"",a=[],s=t,l=t+1;for(;l<e.length;){let d=e[l];if(d===void 0)break;if(d.startsWith(o)&&d.trim()===o){l++;break}a.push(d),l++;}let u=a.join(`
20
+ `);return {block:{type:"code",source:e.slice(s,l).join(`
21
+ `),lineStart:s,lineEnd:l,hash:B(u+i),data:{kind:"code",language:i||le("code.txt").name||"",code:u}},nextIndex:l}}function qu(e,t){let n=e[t];if(n===void 0||!aa.test(n))return null;let r=[],o=t,i=t;for(;i<e.length;){let l=e[i];if(l===void 0)break;let u=l.match(aa);if(!u&&l.trim()!=="")break;r.push(u?u[1]??"":""),i++;}let a=r.join(`
22
+ `),s=Me(a);return {block:{type:"blockquote",source:e.slice(o,i).join(`
23
+ `),lineStart:o,lineEnd:i,hash:B(a),data:{kind:"blockquote",content:a,blocks:s.blocks}},nextIndex:i}}function Zu(e,t){let n=e[t],r=e[t+1];if(n===void 0||r===void 0||!Ls.test(n)||!Pu.test(r))return null;let o=t,i=ks(n),a=Ju(r),s=[],l=t+2;for(;l<e.length;){let u=e[l];if(u===void 0||!Ls.test(u))break;s.push(ks(u)),l++;}return {block:{type:"table",source:e.slice(o,l).join(`
24
+ `),lineStart:o,lineEnd:l,hash:B(e.slice(o,l).join(`
25
+ `)),data:{kind:"table",headers:i,alignments:a,rows:s}},nextIndex:l}}function Xu(e,t){let n=e[t];if(n===void 0)return null;let r=ed(n);if(!r)return null;let o=t,i=td(e,t,r.ordered);return {block:{type:"list",source:e.slice(o,i.nextIndex).join(`
26
+ `),lineStart:o,lineEnd:i.nextIndex,hash:B(e.slice(o,i.nextIndex).join(`
27
+ `)),data:{kind:"list",ordered:r.ordered,start:r.start,items:i.items}},nextIndex:i.nextIndex}}function Yu(e,t){let n=[],r=t,o=t;for(;o<e.length;){let a=e[o];if(a===void 0||a.trim()===""||n.length>0&&rd(a))break;n.push(a),o++;}if(n.length===0)return null;let i=n.join(" ");return {block:{type:"paragraph",source:n.join(`
28
+ `),lineStart:r,lineEnd:o,hash:B(i),data:{kind:"paragraph",text:i,inline:E(i)}},nextIndex:o}}function ks(e){return Ws(e).map(t=>{let n=t.trim();return {content:n,inline:E(n)}})}function Ju(e){return Ws(e).map(t=>{let n=t.trim();return n.startsWith(":")&&n.endsWith(":")?"center":n.endsWith(":")?"right":n.startsWith(":")?"left":null})}function Ws(e){return e.slice(1,-1).split("|")}function Qu(e,t,n){let r=e[t];return r===void 0?false:n?Jt.test(r):Yt.test(r)}function ed(e){let t=e.match(Yt),n=e.match(Jt);return !t&&!n?null:{ordered:!!n,start:n?parseInt(n[2]??"1",10):void 0}}function td(e,t,n){let r=[],o=t;for(;o<e.length;){let i=e[o];if(i===void 0)break;let a=n?i.match(Jt):i.match(Yt);if(!a&&i.trim()===""){if(!Qu(e,o+1,n))break;o++;continue}if(!a)break;r.push(nd(a,n)),o++;}return {items:r,nextIndex:o}}function nd(e,t){let n=(e[1]??"").length,r=t?e[3]??"":e[2]??"",o=r.match(_u),i=o?o[2]??"":r;return {content:i,inline:E(i),indent:n,checked:o?o[1]?.toLowerCase()==="x":void 0}}function rd(e){return As.test(e)||Ms.test(e)||Rs.test(e)||Yt.test(e)||Jt.test(e)||aa.test(e)}function la(){return {blocks:new Map,sourceHash:0,highlightCaches:new Map,renderedLines:null}}function ua(e){e.blocks.clear(),e.sourceHash=0,e.highlightCaches.clear(),e.renderedLines=null;}function da(e,t){let n=B(t);if(e.sourceHash===n&&e.renderedLines)return {blocks:Array.from(e.blocks.values()),parseTimeMs:0};let r=Me(t);e.blocks.clear();for(let o of r.blocks){let i=`${o.lineStart}-${o.lineEnd}`;e.blocks.set(i,o);}return e.sourceHash=n,e.renderedLines=null,r}function ca(e,t,n){for(let[r,o]of e.blocks)o.lineStart<n&&o.lineEnd>t&&e.blocks.delete(r);e.renderedLines=null;}function We(e,t){let n=[],r={},o=od[e.data.kind];return o&&o(e,t,n,r),n}function Ee(e,t){if(t.renderedLines)return t.renderedLines;let n=[],r=0;for(let[o,i]of e.blocks.entries()){let a=We(i,t);for(let s of a)n.push({...s,blockIndex:o}),r++;o<e.blocks.length-1&&(n.push({content:"",style:{},blockIndex:o,lineInBlock:-1}),r++);}return t.renderedLines=n,n}var od={heading:id,paragraph:ad,code:sd,list:ld,table:ud,blockquote:dd,hr:cd,html:fd};function id(e,t,n,r){let o=e.data;o.kind==="heading"&&n.push({content:`${"#".repeat(o.level)} ${o.text}`,style:{bold:true},blockIndex:0,lineInBlock:0});}function ad(e,t,n,r){let o=e.data;o.kind==="paragraph"&&n.push({content:o.text,style:r,blockIndex:0,lineInBlock:0});}function sd(e,t,n,r){let o=e.data;if(o.kind!=="code")return;let i=ue(o.language||"plaintext"),a=t.highlightCaches.get(e.hash.toString());a?a.grammar.name!==i.name&&ie(a,i):(a=oe(i),t.highlightCaches.set(e.hash.toString(),a)),se(a,o.code);for(let[s,l]of o.code.split(`
29
+ `).entries())n.push({content:l,style:{dim:true},blockIndex:0,lineInBlock:s});}function ld(e,t,n,r){let o=e.data;if(o.kind==="list")for(let[i,a]of o.items.entries()){let s=o.ordered?`${(o.start||1)+i}. `:`${" ".repeat(a.indent/2)}- `,l=a.checked!==void 0?a.checked?"[x] ":"[ ] ":"";n.push({content:s+l+a.content,style:r,blockIndex:0,lineInBlock:i});}}function ud(e,t,n,r){let o=e.data;if(o.kind!=="table")return;let i=o.headers.map(s=>s.content).join(" | ");n.push({content:`| ${i} |`,style:{bold:true},blockIndex:0,lineInBlock:0});let a=o.headers.map((s,l)=>{let u=o.alignments[l];return u==="center"?":---:":u==="right"?"---:":u==="left"?":---":"---"}).join(" | ");n.push({content:`| ${a} |`,style:r,blockIndex:0,lineInBlock:1});for(let[s,l]of o.rows.entries()){let u=l.map(d=>d.content).join(" | ");n.push({content:`| ${u} |`,style:r,blockIndex:0,lineInBlock:s+2});}}function dd(e,t,n,r){let o=e.data;if(o.kind==="blockquote"){for(let i of o.blocks){let a=We(i,t);for(let s of a)n.push({...s,content:`> ${s.content}`,style:{...s.style,italic:true}});}n.length===0&&n.push({content:">",style:{italic:true},blockIndex:0,lineInBlock:0});}}function cd(e,t,n,r){e.data.kind==="hr"&&n.push({content:"---",style:{dim:true},blockIndex:0,lineInBlock:0});}function fd(e,t,n,r){let o=e.data;if(o.kind==="html")for(let[i,a]of o.html.split(`
30
+ `).entries())n.push({content:a,style:{dim:true},blockIndex:0,lineInBlock:i});}function fa(e,t,n,r){let o=Ee(e,t),i=Math.min(n+r,o.length);return {lines:o.slice(n,i),totalLines:o.length,startIndex:n,endIndex:i}}function pa(e,t){return Ee(e,t).length}function ma(e){let t=0,n=0,r=0,o=0,i=0,a=0;for(let s of e.blocks){switch(a+=s.lineEnd-s.lineStart,s.type){case "heading":t++;break;case "code":n++;break;case "list":r++;break;case "table":o++;break}let l=u=>{let d=0;for(let c of u)c.type==="link"&&d++,c.children&&(d+=l(c.children));return d};(s.data.kind==="paragraph"||s.data.kind==="heading")&&(i+=l(s.data.inline));}return {blockCount:e.blocks.length,lineCount:a,headingCount:t,codeBlockCount:n,listCount:r,tableCount:o,linkCount:i}}var Es=Object.freeze({renderBox:i,renderHLine:j$1,renderVLine:k$1,renderText:m,createCellBuffer:h,bufferToString:n,boxFillRect:l,charsetToBoxChars:a,BOX_ASCII:f,BOX_BOLD:e,BOX_DASHED:g$1,BOX_DOUBLE:c,BOX_ROUNDED:d,BOX_SINGLE:b$1});var ws=Object.freeze({createCoalescer:go,queueChange:xo,flushChanges:K,insertChange:yo,deleteChange:Co,replaceChange:So,getCoalescingState:bo,destroyCoalescer:To});var Is=Object.freeze({colorToHex:u,hexToColor:t,packColor:r,unpackColor:s,parseColor:v$1});var Ds=Object.freeze({createComponentStore:m$1,createSparseStore:n$1,createTypedArrayPool:o,getComponentMemoryReport:q$1,estimateMemoryUsage:p,isWithinMemoryBounds:r$1});var _s=Object.freeze({createCursor:q,moveCursorUp:Fe,moveCursorDown:Oe,moveCursorLeft:_o,moveCursorRight:Po,goToLine:pe,goToStart:Io,goToEnd:Do,pageUp:Eo,pageDown:wo,clampCursor:fe,ensureCursorVisible:D,createViewport:Mo,createNavConfig:Wo,buildLineIndex:Lo,buildLineIndexFromLengths:ko,lineForOffset:Ao,offsetForLine:Ro});var Ps=Object.freeze({computeDiff:Ne,computeDiffCached:No,getDiffStats:qo,getSideBySideView:jo,parseUnifiedDiff:Ko,toUnifiedDiff:$o,createDiffCache:Oo,clearDiffCache:Bo,collapseUnchanged:zo,collapseChunk:Ge,expandChunk:He,expandAll:Go,toggleChunk:Ho,getVisibleDiffLines:Uo,getTotalLineCount:Vo,DEFAULT_CONTEXT:3,DEFAULT_COLLAPSE_THRESHOLD:10});var ha=["\xC7","\xFC","\xE9","\xE2","\xE4","\xE0","\xE5","\xE7","\xEA","\xEB","\xE8","\xEF","\xEE","\xEC","\xC4","\xC5","\xC9","\xE6","\xC6","\xF4","\xF6","\xF2","\xFB","\xF9","\xFF","\xD6","\xDC","\xA2","\xA3","\xA5","\u20A7","\u0192","\xE1","\xED","\xF3","\xFA","\xF1","\xD1","\xAA","\xBA","\xBF","\u2310","\xAC","\xBD","\xBC","\xA1","\xAB","\xBB","\u2591","\u2592","\u2593","\u2502","\u2524","\u2561","\u2562","\u2556","\u2555","\u2563","\u2551","\u2557","\u255D","\u255C","\u255B","\u2510","\u2514","\u2534","\u252C","\u251C","\u2500","\u253C","\u255E","\u255F","\u255A","\u2554","\u2569","\u2566","\u2560","\u2550","\u256C","\u2567","\u2568","\u2564","\u2565","\u2559","\u2558","\u2552","\u2553","\u256B","\u256A","\u2518","\u250C","\u2588","\u2584","\u258C","\u2590","\u2580","\u03B1","\xDF","\u0393","\u03C0","\u03A3","\u03C3","\xB5","\u03C4","\u03A6","\u0398","\u03A9","\u03B4","\u221E","\u03C6","\u03B5","\u2229","\u2261","\xB1","\u2265","\u2264","\u2320","\u2321","\xF7","\u2248","\xB0","\u2219","\xB7","\u221A","\u207F","\xB2","\u25A0","\xA0"],we=["\0","\u263A","\u263B","\u2665","\u2666","\u2663","\u2660","\u2022","\u25D8","\u25CB","\u25D9","\u2642","\u2640","\u266A","\u266B","\u263C","\u25BA","\u25C4","\u2195","\u203C","\xB6","\xA7","\u25AC","\u21A8","\u2191","\u2193","\u2192","\u2190","\u221F","\u2194","\u25B2","\u25BC"],ga=["\xC7","\xFC","\xE9","\xE2","\xE4","\xE0","\xE5","\xE7","\xEA","\xEB","\xE8","\xEF","\xEE","\xEC","\xC4","\xC5","\xC9","\xE6","\xC6","\xF4","\xF6","\xF2","\xFB","\xF9","\xFF","\xD6","\xDC","\xF8","\xA3","\xD8","\xD7","\u0192","\xE1","\xED","\xF3","\xFA","\xF1","\xD1","\xAA","\xBA","\xBF","\xAE","\xAC","\xBD","\xBC","\xA1","\xAB","\xBB","\u2591","\u2592","\u2593","\u2502","\u2524","\xC1","\xC2","\xC0","\xA9","\u2563","\u2551","\u2557","\u255D","\xA2","\xA5","\u2510","\u2514","\u2534","\u252C","\u251C","\u2500","\u253C","\xE3","\xC3","\u255A","\u2554","\u2569","\u2566","\u2560","\u2550","\u256C","\xA4","\xF0","\xD0","\xCA","\xCB","\xC8","\u0131","\xCD","\xCE","\xCF","\u2518","\u250C","\u2588","\u2584","\xA6","\xCC","\u2580","\xD3","\xDF","\xD4","\xD2","\xF5","\xD5","\xB5","\xFE","\xDE","\xDA","\xDB","\xD9","\xFD","\xDD","\xAF","\xB4","\xAD","\xB1","\u2017","\xBE","\xB6","\xA7","\xF7","\xB8","\xB0","\xA8","\xB7","\xB9","\xB3","\xB2","\u25A0","\xA0"],xa=["\u0410","\u0411","\u0412","\u0413","\u0414","\u0415","\u0416","\u0417","\u0418","\u0419","\u041A","\u041B","\u041C","\u041D","\u041E","\u041F","\u0420","\u0421","\u0422","\u0423","\u0424","\u0425","\u0426","\u0427","\u0428","\u0429","\u042A","\u042B","\u042C","\u042D","\u042E","\u042F","\u0430","\u0431","\u0432","\u0433","\u0434","\u0435","\u0436","\u0437","\u0438","\u0439","\u043A","\u043B","\u043C","\u043D","\u043E","\u043F","\u2591","\u2592","\u2593","\u2502","\u2524","\u2561","\u2562","\u2556","\u2555","\u2563","\u2551","\u2557","\u255D","\u255C","\u255B","\u2510","\u2514","\u2534","\u252C","\u251C","\u2500","\u253C","\u255E","\u255F","\u255A","\u2554","\u2569","\u2566","\u2560","\u2550","\u256C","\u2567","\u2568","\u2564","\u2565","\u2559","\u2558","\u2552","\u2553","\u256B","\u256A","\u2518","\u250C","\u2588","\u2584","\u258C","\u2590","\u2580","\u0440","\u0441","\u0442","\u0443","\u0444","\u0445","\u0446","\u0447","\u0448","\u0449","\u044A","\u044B","\u044C","\u044D","\u044E","\u044F","\u0401","\u0451","\u0404","\u0454","\u0407","\u0457","\u040E","\u045E","\xB0","\u2219","\xB7","\u221A","\u2116","\xA4","\u25A0","\xA0"],ba=["\u20AC","\x81","\u201A","\u0192","\u201E","\u2026","\u2020","\u2021","\u02C6","\u2030","\u0160","\u2039","\u0152","\x8D","\u017D","\x8F","\x90","\u2018","\u2019","\u201C","\u201D","\u2022","\u2013","\u2014","\u02DC","\u2122","\u0161","\u203A","\u0153","\x9D","\u017E","\u0178","\xA0","\xA1","\xA2","\xA3","\xA4","\xA5","\xA6","\xA7","\xA8","\xA9","\xAA","\xAB","\xAC","\xAD","\xAE","\xAF","\xB0","\xB1","\xB2","\xB3","\xB4","\xB5","\xB6","\xB7","\xB8","\xB9","\xBA","\xBB","\xBC","\xBD","\xBE","\xBF","\xC0","\xC1","\xC2","\xC3","\xC4","\xC5","\xC6","\xC7","\xC8","\xC9","\xCA","\xCB","\xCC","\xCD","\xCE","\xCF","\xD0","\xD1","\xD2","\xD3","\xD4","\xD5","\xD6","\xD7","\xD8","\xD9","\xDA","\xDB","\xDC","\xDD","\xDE","\xDF","\xE0","\xE1","\xE2","\xE3","\xE4","\xE5","\xE6","\xE7","\xE8","\xE9","\xEA","\xEB","\xEC","\xED","\xEE","\xEF","\xF0","\xF1","\xF2","\xF3","\xF4","\xF5","\xF6","\xF7","\xF8","\xF9","\xFA","\xFB","\xFC","\xFD","\xFE","\xFF"],ya={cp437:ha,cp850:ga,cp866:xa,cp1252:ba},vs={cp437:we,cp850:void 0,cp866:void 0,cp1252:void 0};var w=z$1.enum(["cp437","cp850","cp866","cp1252"]),Ca=z$1.enum(["replace","skip","error"]),Os=z$1.object({codepage:w,unmappable:Ca.default("replace"),replacement:z$1.string().default("\uFFFD"),interpretControlChars:z$1.boolean().default(false)}).strict(),Bs=128,Ns=32,pd=128,Hs=255;function md(e,t){let n=new Map;for(let r=0;r<e.length;r++){let o=e[r];o&&n.set(o,Bs+r);}if(t)for(let r=0;r<t.length;r++){let o=t[r];o&&o!=="\0"&&n.set(o,r);}for(let r=0;r<Ns;r++)n.set(String.fromCharCode(r),r);for(let r=32;r<=126;r++)n.set(String.fromCharCode(r),r);return n.set("\x7F",127),n}var Fs=new Map;function Gs(e){let t=Fs.get(e);if(t)return t;let n=ya[e],r=vs[e];if(!n)throw new Error(`Unknown codepage: ${e}`);let o=md(n,r);return Fs.set(e,o),o}function Qt(e,t,n){let r=w.parse(t);if(e<0||e>Hs)throw new RangeError(`Byte value must be 0-255, got: ${e}`);let o=e|0;if(o<Ns){if(n?.interpretControlChars&&r==="cp437"){let l=we[o];if(l)return l}return String.fromCharCode(o)}if(o<pd)return String.fromCharCode(o);let i=ya[r];if(!i)throw new Error(`Unknown codepage: ${r}`);let a=o-Bs,s=i[a];return s||(n?.replacement??"\uFFFD")}function zs(e,t){let n=w.parse(t),r=Gs(n),i=[...e][0];if(i)return r.get(i)}function Us(e,t,n){let r=w.parse(t),o={replacement:"\uFFFD",interpretControlChars:false,...n},i=[];for(let a=0;a<e.length;a++){let s=e[a];if(s===void 0)continue;let l=Qt(s,r,o);i.push(l);}return i.join("")}function Vs(e,t,n){let r=w.parse(t),o={unmappable:"replace",replacement:"?",...n},i=Gs(r),a=[],s=[...e];for(let l=0;l<s.length;l++){let u=s[l];if(!u)continue;let d=i.get(u);if(d!==void 0){a.push(d);continue}switch(o.unmappable){case "error":throw new Error(`Character '${u}' (U+${u.codePointAt(0)?.toString(16).toUpperCase().padStart(4,"0")}) cannot be encoded in ${r}`);case "skip":break;default:{let c=o.replacement??"?",p=i.get(c);p!==void 0?a.push(p):a.push(63);break}}}return Buffer.from(a)}function js(e){return w.safeParse(e).success}function $s(){return ["cp437","cp850","cp866","cp1252"]}function Ks(e,t){let n=w.parse(e),r=[];for(let o=0;o<=Hs;o++)r.push(Qt(o,n,t));return r}var qs=Object.freeze({byteToChar:Qt,charToByte:zs,bufferToString:Us,stringToBuffer:Vs,isCodePageSupported:js,getSupportedCodePages:$s,getCodePageMap:Ks,CodePageSchema:w,UnmappableModeSchema:Ca,ConversionOptionsSchema:Os,CP437_CONTROL_CHARS:we,CP437_HIGH_BYTES:ha,CP850_HIGH_BYTES:ga,CP866_HIGH_BYTES:xa,CP1252_HIGH_BYTES:ba});var Zs=Object.freeze({wrapWithCache:fi,wrapVisibleFirst:pi,continueWrap:mi,createWrapCache:li,clearWrapCache:ui,resizeWrapCache:di,invalidateAll:xi,invalidateRange:hi,invalidateParagraph:gi,lineToPosition:bi,positionToLine:yi,getWrapCacheStats:Ci,DEFAULT_BATCH_SIZE:vt,MAX_PARAGRAPH_CHUNK:si});var Xs=Object.freeze({createFoldState:Si,addFoldRegion:Ti,removeFoldRegion:Li,foldRegion:ki,unfoldRegion:Ai,toggleFold:Ri,foldAll:Mi,unfoldAll:Wi,foldAtDepth:Ei,getVisibleFoldLines:Di,getAllFoldRegions:Ii,getFoldAtLine:wi,getFoldStats:vi,originalToVisibleLine:Pi,visibleToOriginalLine:_i,updateTotalLines:Fi});var Ys=Object.freeze({fuzzyMatch:b$2,search:c$1,fuzzyFilter:f$1,fuzzySearchBy:d$1,fuzzyTest:g$2,highlightMatch:e$1,FuzzyOptionsSchema:a$1});var Js=Object.freeze({computeGutterWidth:Gt,computeVisibleGutter:ra,formatLineNumber:zt,renderGutterBlock:ia,createGutterConfig:na,computeDigitWidth:re,gutterWidthChanged:oa});var Qs=Object.freeze({findFile:zi,findAllFiles:Ui,groupBy:$i,merge:Nt,shallowMerge:Oi,partition:Ki,unique:Vi,uniqueBy:ji,sortBy:Gi,sortByIndex:Ni,sortByName:Bi,sortByPriority:Hi});var el=Object.freeze({createLazyContent:qi,createArraySource:ea,getLazyLines:Zi,prefetchAround:Xi,evictChunks:Ht,isRangeLoaded:Qi,getLazyContentState:Ji,clearLazyContent:Yi});var tl=Object.freeze({createLineStore:f$2,createLineStoreFromLines:g$3,createEmptyLineStore:h$1,appendToStore:m$2,appendLines:n$2,getLineAtIndex:i$1,getLineRange:k$2,getLineCount:o$1,getLineForOffset:s$1,getOffsetForLine:t$1,getLineInfo:j$2,getVisibleLines:l$1,exportContent:u$1,exportLineRange:v$2,getStoreStats:r$2,getByteSize:p$1,isStoreEmpty:q$2,trimToLineCount:w$1,CHUNKED_THRESHOLD:e$2,LineIndexSchema:a$2,LineRangeParamsSchema:b$3,TrimParamsSchema:d$2,VisibleLinesParamsSchema:c$2});var nl=Object.freeze({parseMarkdown:Me,renderMarkdown:Ee,getVisibleMarkdown:fa,parseMarkdownCached:da,createMarkdownCache:la,clearMarkdownCache:ua,invalidateLines:ca,parseInline:E,renderBlock:We,getMarkdownStats:ma,getTotalLineCount:pa,DEFAULT_PARSE_BATCH:sa});var rl=Object.freeze({createRope:r$3,createEmptyRope:s$2,insert:F$1,deleteRange:I,replaceRange:J$1,getText:z$2,getLine:D$1,getLineCount:v$3,append:G$1,prepend:H$1,charAt:x$1,substring:y$1,getLength:t$2,getLineStart:B$1,getLineEnd:C,getLineForIndex:A$1,getLines:E$1,getNewlineCount:u$2,getStats:K$1,isEmpty:w$2,verify:L$1,LEAF_MAX_SIZE:512,LEAF_MIN_SIZE:256,MAX_DEPTH:48});var en=(u=>(u[u.NONE=0]="NONE",u[u.BOLD=1]="BOLD",u[u.UNDERLINE=2]="UNDERLINE",u[u.BLINK=4]="BLINK",u[u.INVERSE=8]="INVERSE",u[u.INVISIBLE=16]="INVISIBLE",u[u.DIM=32]="DIM",u[u.ITALIC=64]="ITALIC",u[u.STRIKETHROUGH=128]="STRIKETHROUGH",u))(en||{});function De(e){let t=0;return e.bold&&(t|=1),e.underline&&(t|=2),e.blink&&(t|=4),e.inverse&&(t|=8),e.invisible&&(t|=16),e.dim&&(t|=32),e.italic&&(t|=64),e.strikethrough&&(t|=128),t}function Sa(e){return {bold:(e&1)!==0,underline:(e&2)!==0,blink:(e&4)!==0,inverse:(e&8)!==0,invisible:(e&16)!==0,dim:(e&32)!==0,italic:(e&64)!==0,strikethrough:(e&128)!==0}}function Ta(e,t=4294967295,n=0){return {fg:e.fg??t,bg:e.bg??n,attrs:De(e)}}function La(e){return {fg:e.fg,bg:e.bg,attrs:De(e)}}function ka(e,t){return e.fg===t.fg&&e.bg===t.bg&&e.attrs===t.attrs}function Aa(e){return {fg:e.fg,bg:e.bg,attrs:e.attrs}}function Ra(e,t){return {fg:t.fg??e.fg,bg:t.bg??e.bg,attrs:t.attrs!==void 0?t.attrs:e.attrs}}function Ma(e,t){return (e.attrs&t)!==0}function Wa(e,t){return {fg:e.fg,bg:e.bg,attrs:e.attrs|t}}function Ea(e,t){return {fg:e.fg,bg:e.bg,attrs:e.attrs&~t}}function wa(e){return {fg:e.bg,bg:e.fg,attrs:e.attrs}}function Ia(){return {fg:4294967295,bg:0,attrs:0}}function Da(e){let t=BigInt(e.fg>>>0),n=BigInt(e.bg>>>0)<<32n,r=BigInt(e.attrs)<<64n;return t|n|r}function _a(e){let t=Number(e&0xffffffffn),n=Number(e>>32n&0xffffffffn),r=Number(e>>64n&0xffn);return {fg:t,bg:n,attrs:r}}var ol=Object.freeze({create:Ta,encodeStyleAttr:Da,decodeStyleAttr:_a,sattrMerge:Ra,sattrEqual:ka,sattrInvert:wa,sattrCopy:Aa,sattrEmpty:Ia,sattrAddFlag:Wa,sattrRemoveFlag:Ea,sattrHasFlag:Ma,sattrFromStyleData:La,attrsToStyle:Sa,styleToAttrs:De,AttrFlags:en});var il=Object.freeze({createScrollbackBuffer:e$3,appendLine:g$4,appendLines:h$2,getLine:i$2,getLineRange:j$3,scrollbackScrollBy:m$3,scrollbackScrollToTop:n$3,scrollbackScrollToBottom:o$2,jumpToLine:l$2,exportToText:s$3,loadFromText:r$4,clearScrollback:f$3,trimToLineCount:t$3,getVisibleLines:k$3,getScrollbackStats:p$2,getMemoryUsage:q$3,compressOldChunks:u$3,decompressAll:v$4,DEFAULT_CHUNK_SIZE:1e3,DEFAULT_MAX_CACHED:100,DEFAULT_MAX_MEMORY:209715200,COMPRESSION_RATIO:.5});var al=Object.freeze({highlightWithCache:se,createHighlightCache:oe,tokenizeLine:A,detectLanguage:le,setGrammar:ie,clearHighlightCache:Ut,highlightVisibleFirst:qt,continueHighlight:Zt,invalidateLine:$t,invalidateLines:jt,invalidateAllLines:Kt,getHighlightStats:Vt,detectLanguageFromContent:Xt,getGrammarByName:ue,GRAMMAR_JAVASCRIPT:b,GRAMMAR_PYTHON:y,GRAMMAR_RUST:L,GRAMMAR_GO:M,GRAMMAR_JSON:F,GRAMMAR_SHELL:W,GRAMMAR_PLAINTEXT:k,GRAMMARS:O,EMPTY_STATE:v,DEFAULT_HIGHLIGHT_BATCH:100});var V=4294967295,j=0,de=/\{(\/?[a-zA-Z0-9_#-]+|\/)\}/g,tn="\0LBRACE\0",nn="\0RBRACE\0",Pa={black:255,red:4278190335,green:16711935,yellow:4294902015,blue:65535,magenta:4278255615,cyan:16777215,white:4294967295,"bright-black":2155905279,gray:2155905279,grey:2155905279,"bright-red":4286611711,"bright-green":2164228351,"bright-yellow":4294934783,"bright-blue":2155937791,"bright-magenta":4286644223,"bright-cyan":2164260863,"bright-white":4294967295,orange:4289003775,pink:4290825215,purple:2147516671,brown:2771004159,lime:852308735,navy:33023,teal:8421631,olive:2155872511,maroon:2147483903,aqua:16777215,silver:3233857791,default:0,transparent:0},sl={bold:1,underline:2,ul:2,blink:4,inverse:8,invisible:16,hidden:16,dim:32,italic:64,strikethrough:128,strike:128},ll={left:"left",center:"center",right:"right"};function hd(e){let t=e.startsWith("#")?e.slice(1):e;if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(t))return null;let n,r,o;if(t.length===3){let i=t[0]??"0",a=t[1]??"0",s=t[2]??"0";n=Number.parseInt(i+i,16),r=Number.parseInt(a+a,16),o=Number.parseInt(s+s,16);}else n=Number.parseInt(t.slice(0,2),16),r=Number.parseInt(t.slice(2,4),16),o=Number.parseInt(t.slice(4,6),16);return (n<<24|r<<16|o<<8|255)>>>0}function Fa(e){let t=e.toLowerCase();if(t in Pa)return Pa[t]??null;let n=hd(e);if(n!==null)return n;let r=Number.parseInt(e,10);return !Number.isNaN(r)&&r>=0&&r<=255?gd(r):null}function gd(e){if(e<8)return [255,2147483903,8388863,2155872511,33023,2147516671,8421631,3233857791][e]??255;if(e<16)return [2155905279,4278190335,16711935,4294902015,65535,4278255615,16777215,4294967295][e-8]??2155905279;if(e<232){let n=e-16,r=Math.floor(n/36)*51,o=Math.floor(n/6)%6*51,i=n%6*51;return (r<<24|o<<16|i<<8|255)>>>0}let t=(e-232)*10+8;return (t<<24|t<<16|t<<8|255)>>>0}function xd(){return {fg:[],bg:[],attrs:new Map}}function bd(e,t){e.fg=V,e.bg=j,e.attrs=0,t.fg=[],t.bg=[],t.attrs.clear();}function yd(e,t,n){n.attrs.get(e)?.pop()?.prevValue?t.attrs|=e:t.attrs&=~e;}function Cd(e,t,n,r){let o=r.attrs.get(e);o||(o=[],r.attrs.set(e,o)),o.push({type:"attr",prevValue:n.attrs&e,tagName:t}),n.attrs|=e;}function Sd(e,t,n,r){if(!(e in sl))return false;let o=sl[e];return o===void 0?false:(t?yd(o,n,r):Cd(o,e,n,r),true)}function Td(e,t,n,r){let o=e.match(/^(.+)-fg$/);if(!o?.[1])return false;if(t)if(r.fg.length>0){let i=r.fg.pop();i&&(n.fg=i.prevValue);}else n.fg=V;else {let i=Fa(o[1]);i!==null&&(r.fg.push({type:"fg",prevValue:n.fg,tagName:e}),n.fg=i);}return true}function Ld(e,t,n,r){let o=e.match(/^(.+)-bg$/);if(!o?.[1])return false;if(t)if(r.bg.length>0){let i=r.bg.pop();i&&(n.bg=i.prevValue);}else n.bg=j;else {let i=Fa(o[1]);i!==null&&(r.bg.push({type:"bg",prevValue:n.bg,tagName:e}),n.bg=i);}return true}function kd(e,t,n,r){if(t)return false;let o=Fa(e);return o===null?false:(r.fg.push({type:"fg",prevValue:n.fg,tagName:e}),n.fg=o,true)}function Ad(e,t,n){if(e==="/")return bd(t,n),null;let r=e.startsWith("/"),o=r?e.slice(1):e;return o in ll?ll[o]??null:(Sd(o,r,t,n)||Td(o,r,t,n)||Ld(o,r,t,n)||kd(o,r,t,n),null)}function Oa(e){let t=[],n="left",r="",o=e.replace(/\{\{/g,tn).replace(/\}\}/g,nn),i={fg:V,bg:j,attrs:0},a=xd(),s=0,l;for(de.lastIndex=0;(l=de.exec(o))!==null;){if(l.index>s){let d=ul(o.slice(s,l.index));r=dl(t,i,d,r);}let u=l[1];if(u!==void 0){let d=Ad(u,i,a);d!==null&&(n=d);}s=de.lastIndex;}if(s<o.length){let u=ul(o.slice(s));r=dl(t,i,u,r);}return t.length===0&&e.length===0?{segments:[],alignment:n,plainText:""}:{segments:t,alignment:n,plainText:r}}function ul(e){return e.replaceAll(tn,"{").replaceAll(nn,"}")}function dl(e,t,n,r){return n.length===0?r:(e.push({text:n,fg:t.fg,bg:t.bg,attrs:t.attrs}),r+n)}function _e(e){return e.replace(/\{\{/g,tn).replace(/\}\}/g,nn).replace(de,"").replaceAll(tn,"{").replaceAll(nn,"}")}function Ba(e){return _e(e).trim()}function ce(e){return e.replace(/\{/g,"{{").replace(/\}/g,"}}")}function Na(e,t){let n=[];if(t.bold&&n.push("{bold}"),t.underline&&n.push("{underline}"),t.blink&&n.push("{blink}"),t.inverse&&n.push("{inverse}"),t.invisible&&n.push("{invisible}"),t.dim&&n.push("{dim}"),t.italic&&n.push("{italic}"),t.strikethrough&&n.push("{strikethrough}"),t.fg!==void 0&&t.fg!==V){let o=va(t.fg);n.push(`{#${o}-fg}`);}if(t.bg!==void 0&&t.bg!==j){let o=va(t.bg);n.push(`{#${o}-bg}`);}let r=ce(e);return n.length===0?r:`${n.join("")}${r}{/}`}function va(e){let t=e>>>24&255,n=e>>>16&255,r=e>>>8&255;return t.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")+r.toString(16).padStart(2,"0")}function Ha(e){if(e.length===0)return [];let t=e[0];if(!t)return [];let n=[],r={...t};for(let o=1;o<e.length;o++){let i=e[o];i&&(i.fg===r.fg&&i.bg===r.bg&&i.attrs===r.attrs?r={...r,text:r.text+i.text}:(n.push(r),r={...i}));}return n.push(r),n}function Ga(e){return _e(e).length}function za(e){let t=e.replace(/\{\{/g,"").replace(/\}\}/g,"");return de.lastIndex=0,de.test(t)}var rn=z$1.enum(["left","center","right"]);function U(e,t){for(let[r,o]of Object.entries(Pa))if(o===e)return `{${r}-${t}}`;return `{#${va(e)}-${t}}`}function Ua(e){return e&1?"{bold}":e&2?"{underline}":e&4?"{blink}":e&8?"{inverse}":e&16?"{invisible}":e&32?"{dim}":e&64?"{italic}":e&128?"{strikethrough}":""}function Va(e){let t=[];return e.bold&&t.push("{bold}"),e.underline&&t.push("{underline}"),e.blink&&t.push("{blink}"),e.inverse&&t.push("{inverse}"),e.invisible&&t.push("{invisible}"),e.dim&&t.push("{dim}"),e.italic&&t.push("{italic}"),e.strikethrough&&t.push("{strikethrough}"),e.fg!==void 0&&e.fg!==V&&t.push(U(e.fg,"fg")),e.bg!==void 0&&e.bg!==j&&t.push(U(e.bg,"bg")),t}function ja(e){let t=[];return e.bg!==void 0&&e.bg!==j&&t.push("{/bg}"),e.fg!==void 0&&e.fg!==V&&t.push("{/fg}"),e.strikethrough&&t.push("{/strikethrough}"),e.italic&&t.push("{/italic}"),e.dim&&t.push("{/dim}"),e.invisible&&t.push("{/invisible}"),e.inverse&&t.push("{/inverse}"),e.blink&&t.push("{/blink}"),e.underline&&t.push("{/underline}"),e.bold&&t.push("{/bold}"),t}function $a(e,t,n){let r=ce(e),o=t.join(""),i=n?n.join(""):"{/}";return `${o}${r}${i}`}function on(e){let t=[];return e&1&&t.push("{bold}"),e&2&&t.push("{underline}"),e&4&&t.push("{blink}"),e&8&&t.push("{inverse}"),e&16&&t.push("{invisible}"),e&32&&t.push("{dim}"),e&64&&t.push("{italic}"),e&128&&t.push("{strikethrough}"),t}function an(e){let t=[],n=on(e.attrs);t.push(...n),e.fg!==V&&t.push(U(e.fg,"fg")),e.bg!==j&&t.push(U(e.bg,"bg"));let r=ce(e.text);return t.length===0?r:`${t.join("")}${r}{/}`}function Ka(e){let t=[];e.alignment!=="left"&&t.push(`{${e.alignment}}`);for(let n of e.segments)t.push(an(n));return t.join("")}var sn=z$1.object({text:z$1.string(),fg:z$1.number(),bg:z$1.number(),attrs:z$1.number()}),qa=z$1.object({segments:z$1.array(sn),alignment:rn,plainText:z$1.string()});var cl=Object.freeze({parseTags:Oa,stripTags:_e,hasTags:za,escapeTags:ce,cleanTags:Ba,wrapWithTags:$a,createTaggedText:Na,parsedToTaggedText:Ka,segmentToTaggedText:an,taggedLength:Ga,mergeSegments:Ha,generateTags:Va,generateCloseTags:ja,colorToTag:U,attrToTag:Ua,attrsToTags:on,AlignmentSchema:rn,ParsedContentSchema:qa,TextSegmentSchema:sn});var Xa=5e3,Ya=1e5,Ja=/(?:^|[^\w])/,Qa=/(?:$|[^\w])/;function Rd(e){let t=new Map,n=e.length;for(let r=0;r<n-1;r++){let o=e[r];o!==void 0&&t.set(o,n-1-r);}return t}function ln(e,t,n=true,r=0){if(t.length===0)return [];let o=n?e:e.toLowerCase(),i=n?t:t.toLowerCase(),a=o.length,s=i.length,l=[];if(s>a)return l;let u=Rd(i),d=r+s-1;for(;d<a;){let c=s-1,p=d;for(;c>=0&&o[p]===i[c];)c--,p--;if(c<0)l.push(p+1),d++;else {let f=o[d],m=f!==void 0?u.get(f)??s:s;d+=Math.max(1,m);}}return l}function Md(e){let t=0,n=Math.min(e.length,1e3);for(let r=0;r<n;r++){let o=e.charCodeAt(r);t=(t<<5)-t+o|0;}return t=(t<<5)-t+e.length|0,t}function es(e,t){let n=0,r=0;for(let o=0;o<t&&o<e.length;o++)e[o]===`
31
+ `&&(n++,r=o+1);return {line:n,column:t-r}}function fl(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
32
+ `&&t.push(n+1);return t}function Wd(e,t){let n=0,r=e.length-1;for(;n<r;){let o=Math.floor((n+r+1)/2),i=e[o];i!==void 0&&i<=t?n=o:r=o-1;}return n}function un(e,t,n={}){let r=performance.now(),o=n.caseSensitive??false,i=n.wholeWord??false,a=n.maxMatches,s=n.startPosition??0;if(t.length===0)return Za(t,r);let l=ln(e,t,o,s),u=fl(e),{matches:d,truncated:c}=wd(e,t,l,u,i,a);return {matches:d,totalCount:c?l.length:d.length,truncated:c,timedOut:false,timeMs:performance.now()-r,query:t}}function dn(e,t,n={}){let r=performance.now(),o=n.caseSensitive??false,i=n.maxMatches,a=n.timeout??5e3,s=n.startPosition??0;if(t.length===0)return Za(t,r);let l=Ed(t,o);if(!l)return Za(t,r);let u=fl(e),d=Dd(e,l,u,s,r+a,i);return {matches:d.matches,totalCount:d.matches.length,truncated:d.truncated,timedOut:d.timedOut,timeMs:performance.now()-r,query:t}}function Za(e,t){return {matches:[],totalCount:0,truncated:false,timedOut:false,timeMs:performance.now()-t,query:e}}function Ed(e,t){try{let n=t?"g":"gi";return new RegExp(e,n)}catch{return null}}function wd(e,t,n,r,o,i){let a=[],s=false;for(let l of n)if(!(o&&!Id(e,l,t.length))&&(a.push(pl(e,r,l,t.length)),i&&a.length>=i)){s=true;break}return {matches:a,truncated:s}}function Id(e,t,n){let r=t>0?e[t-1]:"",o=e[t+n]??"";return !(r&&/\w/.test(r)||o&&/\w/.test(o))}function pl(e,t,n,r){let o=Wd(t,n),i=t[o]??0,a=e.slice(n,n+r);return {start:n,end:n+r,line:o,column:n-i,text:a}}function Dd(e,t,n,r,o,i){let a=[],s=false,l=false,u=r;t.lastIndex=r;let d=t.exec(e);for(;d!==null;){if(a.length%1e3===0&&performance.now()>o){l=true;break}if(d.index===u&&(t.lastIndex=u+1),u=t.lastIndex,a.push(pl(e,n,d.index,d[0].length)),i&&a.length>=i){s=true;break}d=t.exec(e);}return {matches:a,truncated:s,timedOut:l}}function Pe(e,t,n={}){return n.regex?dn(e,t,n):un(e,t,n)}function cn(e,t,n,r=1e5,o={}){let i=performance.now();if(t.length===0||n>=e.length)return {matches:[],hasMore:false,nextPosition:e.length,timeMs:performance.now()-i};let a=Math.min(n+r,e.length),s=e.slice(0,a),u=Pe(s,t,{...o,startPosition:n}).matches.filter(c=>c.start>=n&&c.start<a),d=a<e.length;return {matches:u,hasMore:d,nextPosition:a,timeMs:performance.now()-i}}function ts(){return {query:"",options:{},matches:[],textHash:0,currentIndex:-1,complete:false,lastPosition:0}}function ns(e){e.query="",e.options={},e.matches=[],e.textHash=0,e.currentIndex=-1,e.complete=false,e.lastPosition=0;}function rs(e,t,n,r={}){let o=Md(t),i=e.query!==n,a=e.options.caseSensitive!==r.caseSensitive||e.options.wholeWord!==r.wholeWord||e.options.regex!==r.regex,s=e.textHash!==o;return i||a||s?(e.query=n,e.options=r,e.matches=[],e.textHash=o,e.currentIndex=-1,e.complete=false,e.lastPosition=0,true):false}function os(e,t,n=1e5){let r=performance.now();if(e.query.length===0)return {matches:e.matches,totalCount:0,truncated:false,timedOut:false,timeMs:performance.now()-r,query:e.query};if(e.complete)return {matches:e.matches,totalCount:e.matches.length,truncated:false,timedOut:false,timeMs:performance.now()-r,query:e.query};let o=cn(t,e.query,e.lastPosition,n,e.options);return e.matches.push(...o.matches),e.lastPosition=o.nextPosition,e.complete=!o.hasMore,{matches:e.matches,totalCount:e.matches.length,truncated:false,timedOut:false,timeMs:performance.now()-r,query:e.query}}function is(e){if(e.matches.length!==0)return e.currentIndex=(e.currentIndex+1)%e.matches.length,e.matches[e.currentIndex]}function as(e){if(e.matches.length!==0)return e.currentIndex=e.currentIndex<=0?e.matches.length-1:e.currentIndex-1,e.matches[e.currentIndex]}function ss(e,t){if(!(t<0||t>=e.matches.length))return e.currentIndex=t,e.matches[t]}function ls(e,t,n=true){if(e.matches.length===0)return;let r=0,o=e.matches.length-1;for(;r<o;){let s=Math.floor((r+o)/2),l=e.matches[s];l&&l.start<t?r=s+1:o=s;}let i=e.matches[r],a=r>0?e.matches[r-1]:void 0;if(n&&i)return e.currentIndex=r,{match:i,index:r};if(!n&&a)return e.currentIndex=r-1,{match:a,index:r-1};if(i)return e.currentIndex=r,{match:i,index:r};if(a)return e.currentIndex=r-1,{match:a,index:r-1}}function us(e,t,n){return e.matches.filter(r=>r.line>=t&&r.line<n)}function ds(e){return {current:e.currentIndex+1,total:e.matches.length,complete:e.complete}}function cs(e,t,n={}){let r=Pe(e,t,n);return {...r,matches:[...r.matches].reverse()}}var ml=Object.freeze({search:Pe,searchWithCache:os,createSearchCache:ts,getNextMatch:is,getPreviousMatch:as,getVisibleMatches:us,clearSearchCache:ns,updateSearchQuery:rs,searchBatch:cn,searchLiteral:un,searchRegex:dn,searchReverse:cs,boyerMooreHorspool:ln,findNearestMatch:ls,getMatchAt:ss,getMatchStatus:ds,positionToLineColumn:es,DEFAULT_SEARCH_BATCH:1e5,DEFAULT_TIMEOUT:5e3,WORD_BOUNDARY_BEFORE:Ja,WORD_BOUNDARY_AFTER:Qa});var hl=Object.freeze({wordWrap:e$4,wrapText:f$4,truncate:c$3,alignLine:d$3,getVisibleWidth:b$4,stripAnsi:a$3,padHeight:g$5});var gl=Object.freeze({formatDate:h$3,unixTimestamp:i$3,unixTimestampMs:j$4});var _d=Object.freeze({stringWidth:x,charWidth:_,charWidthAt:Tt,codePointWidth:St,graphemeWidth:ee,stringWidthGrapheme:J,strWidth:At,getCharWidth:g,hasWideChars:Re,hasZeroWidthChars:Dt,isWideChar:R,isZeroWidthChar:S,isAmbiguousChar:Te,isCombiningChar:H,isCombiningCharBinarySearch:rt,getCombiningCharCount:ot,truncateByWidth:G,sliceByWidth:Ae,sliceByWidthGrapheme:Q,truncateWithEllipsis:Rt,truncateWithEllipsisGrapheme:dt,padStartByWidth:Wt,padEndByWidth:Mt,centerByWidth:Et,columnAtIndex:It,indexAtColumn:wt,WIDE_RANGES:be,ZERO_WIDTH_RANGES:ye,AMBIGUOUS_RANGES:Ce,FULLWIDTH_RANGES:at,EMOJI_WIDE_RANGES:Se,COMBINING_RANGES:X,COMBINING_SET:Y}),Pd=Object.freeze({codePointAt:Ze,codePoints:ge,toCodePoints:xe,fromCodePoint:Xe,codePointLength:Je,charAtCodePoint:tt,characters:Ye,sliceCodePoints:nt,isValidCodePoint:Qe,isBMP:et,isAstral:Z}),vd=Object.freeze({graphemeClusters:T,toGraphemes:Le,graphemeAt:lt,graphemeCount:st,sliceGraphemes:ut,reverseGraphemes:ft,hasGraphemeSegmenter:ct}),Fd=Object.freeze({normalizeNFC:ke,normalizeNFD:bt,normalizeNFKC:yt,normalizeNFKD:Ct,dropUnicode:pt,toAscii:mt,stripCombining:gt,stripZeroWidth:ht,stripControl:xt}),Od=Object.freeze({codePointToSurrogatePair:qe,surrogatePairToCodePoint:Ke,isHighSurrogate:me,isLowSurrogate:he,isSurrogate:$e,isSurrogateCode:N,HIGH_SURROGATE_START:55296,HIGH_SURROGATE_END:56319,LOW_SURROGATE_START:56320,LOW_SURROGATE_END:57343}),xl=Object.freeze({width:_d,codePoint:Pd,grapheme:vd,normalize:Fd,surrogate:Od,stringWidth:x,charWidth:_,truncateByWidth:G,hasWideChars:Re,isWideChar:R,graphemeClusters:T,toCodePoints:xe,normalizeNFC:ke});var bl=Object.freeze({buildTestCorpus:Xo,runWidthTests:ri,formatTestReport:ai,installWidthOverrides:Jo,clearWidthOverrides:Qo,getOverrideWidth:ti,measureWidthWithOverrides:ni,getOverrideCount:ei,getKnownBadSequences:Yo,getCategories:ii,filterByCategory:oi,TerminalWidthProfileSchema:Pt,WidthOverrideSchema:_t});export{Ce as AMBIGUOUS_RANGES,rn as AlignmentSchema,en as AttrFlags,X as COMBINING_RANGES,Y as COMBINING_SET,vt as DEFAULT_BATCH_SIZE,Fo as DEFAULT_COLLAPSE_THRESHOLD,vo as DEFAULT_CONTEXT,ae as DEFAULT_HIGHLIGHT_BATCH,sa as DEFAULT_PARSE_BATCH,Ya as DEFAULT_SEARCH_BATCH,Xa as DEFAULT_TIMEOUT,Se as EMOJI_WIDE_RANGES,v as EMPTY_STATE,at as FULLWIDTH_RANGES,O as GRAMMARS,M as GRAMMAR_GO,b as GRAMMAR_JAVASCRIPT,F as GRAMMAR_JSON,k as GRAMMAR_PLAINTEXT,y as GRAMMAR_PYTHON,L as GRAMMAR_RUST,W as GRAMMAR_SHELL,Ue as HIGH_SURROGATE_END,ze as HIGH_SURROGATE_START,je as LOW_SURROGATE_END,Ve as LOW_SURROGATE_START,si as MAX_PARAGRAPH_CHUNK,qa as ParsedContentSchema,Pt as TerminalWidthProfileSchema,sn as TextSegmentSchema,be as WIDE_RANGES,Qa as WORD_BOUNDARY_AFTER,Ja as WORD_BOUNDARY_BEFORE,_t as WidthOverrideSchema,ye as ZERO_WIDTH_RANGES,Ti as addFoldRegion,Ua as attrToTag,Sa as attrsToStyle,on as attrsToTags,Es as boxRender,ln as boyerMooreHorspool,Lo as buildLineIndex,ko as buildLineIndexFromLengths,Xo as buildTestCorpus,Et as centerByWidth,ws as changeCoalesce,tt as charAtCodePoint,_ as charWidth,Tt as charWidthAt,Ye as characters,fe as clampCursor,Ba as cleanTags,Bo as clearDiffCache,Ut as clearHighlightCache,Yi as clearLazyContent,ua as clearMarkdownCache,ns as clearSearchCache,Qo as clearWidthOverrides,ui as clearWrapCache,Ze as codePointAt,Je as codePointLength,qe as codePointToSurrogatePair,St as codePointWidth,ge as codePoints,Ge as collapseChunk,zo as collapseUnchanged,U as colorToTag,Is as colors,It as columnAtIndex,Ds as componentStore,Ne as computeDiff,No as computeDiffCached,re as computeDigitWidth,Gt as computeGutterWidth,ra as computeVisibleGutter,Zt as continueHighlight,mi as continueWrap,ea as createArraySource,go as createCoalescer,q as createCursor,Oo as createDiffCache,Si as createFoldState,na as createGutterConfig,oe as createHighlightCache,qi as createLazyContent,la as createMarkdownCache,Wo as createNavConfig,ts as createSearchCache,Na as createTaggedText,Mo as createViewport,li as createWrapCache,_s as cursorNav,_a as decodeStyleAttr,Co as deleteChange,To as destroyCoalescer,le as detectLanguage,Xt as detectLanguageFromContent,Ps as diffRenderer,pt as dropUnicode,Da as encodeStyleAttr,qs as encoding,D as ensureCursorVisible,ce as escapeTags,Ht as evictChunks,Go as expandAll,He as expandChunk,Zs as fastWrap,oi as filterByCategory,Ui as findAllFiles,zi as findFile,ls as findNearestMatch,K as flushChanges,Xs as fold,Mi as foldAll,Ei as foldAtDepth,ki as foldRegion,zt as formatLineNumber,ai as formatTestReport,Xe as fromCodePoint,Ys as fuzzySearch,ja as generateCloseTags,Va as generateTags,Ii as getAllFoldRegions,ii as getCategories,g as getCharWidth,bo as getCoalescingState,ot as getCombiningCharCount,qo as getDiffStats,wi as getFoldAtLine,vi as getFoldStats,ue as getGrammarByName,Vt as getHighlightStats,Yo as getKnownBadSequences,Ji as getLazyContentState,Zi as getLazyLines,pa as getMarkdownLineCount,ma as getMarkdownStats,ss as getMatchAt,ds as getMatchStatus,is as getNextMatch,ei as getOverrideCount,ti as getOverrideWidth,as as getPreviousMatch,jo as getSideBySideView,Vo as getTotalLineCount,Uo as getVisibleDiffLines,Di as getVisibleFoldLines,fa as getVisibleMarkdown,us as getVisibleMatches,Ci as getWrapCacheStats,Do as goToEnd,pe as goToLine,Io as goToStart,lt as graphemeAt,T as graphemeClusters,st as graphemeCount,ee as graphemeWidth,$i as groupBy,Js as gutter,oa as gutterWidthChanged,ct as hasGraphemeSegmenter,za as hasTags,Re as hasWideChars,Dt as hasZeroWidthChars,Qs as helpers,qt as highlightVisibleFirst,se as highlightWithCache,wt as indexAtColumn,yo as insertChange,Jo as installWidthOverrides,xi as invalidateAll,Kt as invalidateAllLines,$t as invalidateLine,jt as invalidateLines,ca as invalidateMarkdownLines,gi as invalidateParagraph,hi as invalidateRange,Te as isAmbiguousChar,Z as isAstral,et as isBMP,H as isCombiningChar,rt as isCombiningCharBinarySearch,me as isHighSurrogate,he as isLowSurrogate,Qi as isRangeLoaded,$e as isSurrogate,N as isSurrogateCode,Qe as isValidCodePoint,R as isWideChar,S as isZeroWidthChar,el as lazyContent,Ao as lineForOffset,tl as lineStore,bi as lineToPosition,nl as markdownRenderer,ni as measureWidthWithOverrides,Nt as merge,Ha as mergeSegments,Oe as moveCursorDown,_o as moveCursorLeft,Po as moveCursorRight,Fe as moveCursorUp,ke as normalizeNFC,bt as normalizeNFD,yt as normalizeNFKC,Ct as normalizeNFKD,Ro as offsetForLine,Pi as originalToVisibleLine,Mt as padEndByWidth,Wt as padStartByWidth,wo as pageDown,Eo as pageUp,E as parseInline,Me as parseMarkdown,da as parseMarkdownCached,Oa as parseTags,Ko as parseUnifiedDiff,Ka as parsedToTaggedText,Ki as partition,yi as positionToLine,es as positionToLineColumn,Xi as prefetchAround,xo as queueChange,Li as removeFoldRegion,We as renderBlock,ia as renderGutterBlock,Ee as renderMarkdown,So as replaceChange,di as resizeWrapCache,ft as reverseGraphemes,rl as rope,ri as runWidthTests,ol as sattr,Wa as sattrAddFlag,Aa as sattrCopy,Ia as sattrEmpty,ka as sattrEqual,Ta as sattrFn,La as sattrFromStyleData,Ma as sattrHasFlag,wa as sattrInvert,Ra as sattrMerge,Ea as sattrRemoveFlag,il as scrollback,Pe as search,cn as searchBatch,un as searchLiteral,dn as searchRegex,cs as searchReverse,os as searchWithCache,an as segmentToTaggedText,ie as setGrammar,Oi as shallowMerge,Ae as sliceByWidth,Q as sliceByWidthGrapheme,nt as sliceCodePoints,ut as sliceGraphemes,Gi as sortBy,Ni as sortByIndex,Bi as sortByName,Hi as sortByPriority,At as strWidth,x as stringWidth,J as stringWidthGrapheme,gt as stripCombining,xt as stripControl,_e as stripTags,ht as stripZeroWidth,De as styleToAttrs,Ke as surrogatePairToCodePoint,al as syntaxHL,Ga as taggedLength,cl as tags,ml as textSearch,hl as textWrap,gl as time,mt as toAscii,xe as toCodePoints,Le as toGraphemes,$o as toUnifiedDiff,Ho as toggleChunk,Ri as toggleFold,A as tokenizeLine,G as truncateByWidth,Rt as truncateWithEllipsis,dt as truncateWithEllipsisGrapheme,Wi as unfoldAll,Ai as unfoldRegion,xl as unicode,Vi as unique,ji as uniqueBy,rs as updateSearchQuery,Fi as updateTotalLines,_i as visibleToOriginalLine,bl as widthHarness,pi as wrapVisibleFirst,fi as wrapWithCache,$a as wrapWithTags};
@@ -203,7 +203,7 @@ declare function jumpToLine(buffer: ScrollbackBuffer, lineIndex: number, context
203
203
  * @param viewportSize - Viewport size
204
204
  * @returns New visible range
205
205
  */
206
- declare function scrollBy(buffer: ScrollbackBuffer, currentLine: number, delta: number, viewportSize: number): LineRange;
206
+ declare function scrollbackScrollBy(buffer: ScrollbackBuffer, currentLine: number, delta: number, viewportSize: number): LineRange;
207
207
  /**
208
208
  * Scrolls to the top.
209
209
  *
@@ -211,7 +211,7 @@ declare function scrollBy(buffer: ScrollbackBuffer, currentLine: number, delta:
211
211
  * @param viewportSize - Viewport size
212
212
  * @returns Visible range at top
213
213
  */
214
- declare function scrollToTop(buffer: ScrollbackBuffer, viewportSize: number): LineRange;
214
+ declare function scrollbackScrollToTop(buffer: ScrollbackBuffer, viewportSize: number): LineRange;
215
215
  /**
216
216
  * Scrolls to the bottom.
217
217
  *
@@ -219,7 +219,7 @@ declare function scrollToTop(buffer: ScrollbackBuffer, viewportSize: number): Li
219
219
  * @param viewportSize - Viewport size
220
220
  * @returns Visible range at bottom
221
221
  */
222
- declare function scrollToBottom(buffer: ScrollbackBuffer, viewportSize: number): LineRange;
222
+ declare function scrollbackScrollToBottom(buffer: ScrollbackBuffer, viewportSize: number): LineRange;
223
223
  /**
224
224
  * Gets buffer statistics.
225
225
  *
@@ -271,4 +271,4 @@ declare function compressOldChunks(buffer: ScrollbackBuffer, keepUncompressed?:
271
271
  */
272
272
  declare function decompressAll(buffer: ScrollbackBuffer): void;
273
273
 
274
- export { COMPRESSION_RATIO as C, DEFAULT_CHUNK_SIZE as D, type LineRange as L, type ScrollbackBuffer as S, type Chunk as a, DEFAULT_MAX_CACHED as b, DEFAULT_MAX_MEMORY as c, type ScrollbackConfig as d, type ScrollbackLine as e, type ScrollbackStats as f, appendLine as g, appendLines as h, clearScrollback as i, compressOldChunks as j, createScrollbackBuffer as k, decompressAll as l, exportToText as m, getLineRange as n, getMemoryUsage as o, getLine as p, getScrollbackStats as q, getVisibleLines as r, jumpToLine as s, loadFromText as t, trimToLineCount as u, scrollBy as v, scrollToBottom as w, scrollToTop as x };
274
+ export { COMPRESSION_RATIO as C, DEFAULT_CHUNK_SIZE as D, type LineRange as L, type ScrollbackBuffer as S, appendLine as a, appendLines as b, createScrollbackBuffer as c, getLineRange as d, scrollbackScrollToTop as e, scrollbackScrollToBottom as f, getLine as g, exportToText as h, clearScrollback as i, jumpToLine as j, getVisibleLines as k, loadFromText as l, getScrollbackStats as m, getMemoryUsage as n, compressOldChunks as o, decompressAll as p, type Chunk as q, DEFAULT_MAX_CACHED as r, scrollbackScrollBy as s, trimToLineCount as t, DEFAULT_MAX_MEMORY as u, type ScrollbackConfig as v, type ScrollbackLine as w, type ScrollbackStats as x };