code-squad-cli 1.2.5 → 1.2.7

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.
@@ -3,6 +3,7 @@ export interface FileNode {
3
3
  path: string;
4
4
  name: string;
5
5
  type: 'file' | 'directory';
6
+ filtered?: boolean;
6
7
  children?: FileNode[];
7
8
  }
8
9
  export interface FilesResponse {
@@ -11,6 +12,7 @@ export interface FilesResponse {
11
12
  }
12
13
  export interface FlatFilesResponse {
13
14
  files: string[];
15
+ filteredDirs: string[];
14
16
  }
15
17
  declare const router: IRouter;
16
18
  export { router as filesRouter };
@@ -1,16 +1,25 @@
1
1
  import { Router } from 'express';
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
- const router = Router();
5
- // Default ignore patterns (similar to .gitignore behavior)
6
- const DEFAULT_IGNORES = [
4
+ // Patterns to filter for performance (O(1) lookup with Set)
5
+ // These are system directories that users don't directly edit
6
+ const FILTERED_PATTERNS = new Set([
7
+ // Package managers
7
8
  'node_modules',
9
+ 'vendor',
10
+ '.pnpm-store',
11
+ // VCS internal
8
12
  '.git',
9
13
  '.svn',
10
14
  '.hg',
15
+ // OS metadata
16
+ '.DS_Store',
17
+ 'Thumbs.db',
18
+ // Build output
11
19
  'dist',
12
20
  'build',
13
21
  'out',
22
+ // Cache directories
14
23
  '.cache',
15
24
  '.next',
16
25
  '.nuxt',
@@ -18,45 +27,11 @@ const DEFAULT_IGNORES = [
18
27
  '__pycache__',
19
28
  '.pytest_cache',
20
29
  'target',
21
- 'Cargo.lock',
22
- 'package-lock.json',
23
- 'pnpm-lock.yaml',
24
- 'yarn.lock',
25
- '.DS_Store',
26
- ];
27
- // Dotfiles that should be visible in the file tree
28
- const VISIBLE_DOTFILES = new Set([
29
- '.gitignore',
30
- '.gitattributes',
31
- '.env.example',
32
- '.env.local.example',
33
- '.eslintrc',
34
- '.eslintrc.js',
35
- '.eslintrc.cjs',
36
- '.eslintrc.json',
37
- '.eslintrc.yml',
38
- '.prettierrc',
39
- '.prettierrc.js',
40
- '.prettierrc.cjs',
41
- '.prettierrc.json',
42
- '.prettierrc.yml',
43
- '.editorconfig',
44
- '.npmrc',
45
- '.nvmrc',
46
- '.node-version',
47
- '.dockerignore',
48
- '.browserslistrc',
49
- '.babelrc',
50
- '.babelrc.js',
51
- '.babelrc.json',
52
30
  ]);
53
- function shouldIgnore(name) {
54
- if (name.startsWith('.')) {
55
- // Allow specific dotfiles
56
- return !VISIBLE_DOTFILES.has(name);
57
- }
58
- return DEFAULT_IGNORES.includes(name);
31
+ function isFiltered(name) {
32
+ return FILTERED_PATTERNS.has(name);
59
33
  }
34
+ const router = Router();
60
35
  function buildFileTree(rootPath, currentPath, maxDepth, depth = 0) {
61
36
  if (depth > maxDepth)
62
37
  return [];
@@ -71,40 +46,45 @@ function buildFileTree(rootPath, currentPath, maxDepth, depth = 0) {
71
46
  return a.name.localeCompare(b.name);
72
47
  });
73
48
  for (const entry of entries) {
74
- if (shouldIgnore(entry.name))
75
- continue;
76
49
  const fullPath = path.join(currentPath, entry.name);
77
50
  const relativePath = path.relative(rootPath, fullPath);
51
+ const filtered = isFiltered(entry.name);
78
52
  const node = {
79
53
  path: relativePath,
80
54
  name: entry.name,
81
55
  type: entry.isDirectory() ? 'directory' : 'file',
56
+ ...(filtered && { filtered: true }),
82
57
  };
83
- if (entry.isDirectory()) {
58
+ // Don't load children for filtered directories (performance)
59
+ if (entry.isDirectory() && !filtered) {
84
60
  node.children = buildFileTree(rootPath, fullPath, maxDepth, depth + 1);
85
61
  }
86
62
  nodes.push(node);
87
63
  }
88
64
  return nodes;
89
65
  }
90
- function collectFlatFiles(rootPath, currentPath, maxDepth, depth = 0) {
66
+ // Memory-efficient: pass result object through recursion to avoid intermediate arrays
67
+ function collectFlatFiles(rootPath, currentPath, maxDepth, depth = 0, result = { files: [], filteredDirs: [] }) {
91
68
  if (depth > maxDepth)
92
- return [];
69
+ return result;
93
70
  const entries = fs.readdirSync(currentPath, { withFileTypes: true });
94
- const files = [];
95
71
  for (const entry of entries) {
96
- if (shouldIgnore(entry.name))
97
- continue;
98
72
  const fullPath = path.join(currentPath, entry.name);
99
73
  const relativePath = path.relative(rootPath, fullPath);
74
+ if (isFiltered(entry.name)) {
75
+ if (entry.isDirectory()) {
76
+ result.filteredDirs.push(relativePath);
77
+ }
78
+ continue; // Don't traverse filtered directories
79
+ }
100
80
  if (entry.isFile()) {
101
- files.push(relativePath);
81
+ result.files.push(relativePath);
102
82
  }
103
83
  else if (entry.isDirectory()) {
104
- files.push(...collectFlatFiles(rootPath, fullPath, maxDepth, depth + 1));
84
+ collectFlatFiles(rootPath, fullPath, maxDepth, depth + 1, result);
105
85
  }
106
86
  }
107
- return files;
87
+ return result;
108
88
  }
109
89
  // GET /api/files - Get file tree structure
110
90
  router.get('/', (req, res) => {
@@ -119,10 +99,12 @@ router.get('/', (req, res) => {
119
99
  // GET /api/files/flat - Get flat list of all files
120
100
  router.get('/flat', (req, res) => {
121
101
  const state = req.app.locals.state;
122
- const files = collectFlatFiles(state.cwd, state.cwd, 10);
123
- files.sort();
102
+ const result = collectFlatFiles(state.cwd, state.cwd, 10);
103
+ result.files.sort();
104
+ result.filteredDirs.sort();
124
105
  const response = {
125
- files,
106
+ files: result.files,
107
+ filteredDirs: result.filteredDirs,
126
108
  };
127
109
  res.json(response);
128
110
  });
@@ -139,7 +139,7 @@ Error generating stack: `+o.message+`
139
139
  *
140
140
  * This source code is licensed under the MIT license found in the
141
141
  * LICENSE file in the root directory of this source tree.
142
- */var Do=M,Qg=Kg;function qg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yg=typeof Object.is=="function"?Object.is:qg,Xg=Qg.useSyncExternalStore,Jg=Do.useRef,Zg=Do.useEffect,e_=Do.useMemo,t_=Do.useDebugValue;Hf.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Jg(null);if(o.current===null){var l={hasValue:!1,value:null};o.current=l}else l=o.current;o=e_(function(){function a(p){if(!u){if(u=!0,c=p,p=r(p),i!==void 0&&l.hasValue){var y=l.value;if(i(y,p))return d=y}return d=p}if(y=d,Yg(c,p))return y;var v=r(p);return i!==void 0&&i(y,v)?(c=p,y):(c=p,d=v)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,i]);var s=Xg(e,o[0],o[1]);return Zg(function(){l.hasValue=!0,l.value=s},[s]),t_(s),s};Gf.exports=Hf;var n_=Gf.exports;const r_=Rc(n_),Qf={},{useDebugValue:i_}=zc,{useSyncExternalStoreWithSelector:o_}=r_;let Ju=!1;const l_=e=>e;function s_(e,t=l_,n){(Qf?"production":void 0)!=="production"&&n&&!Ju&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ju=!0);const r=o_(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return i_(r),r}const Zu=e=>{(Qf?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?jg(e):e,n=(r,i)=>s_(t,r,i);return Object.assign(n,t),n},xa=e=>e?Zu(e):Zu,No=xa(e=>({fileTree:[],flatFiles:[],expandedDirs:new Set,setFileTree:t=>e({fileTree:t}),setFlatFiles:t=>e({flatFiles:t}),toggleDir:t=>e(n=>{const r=new Set(n.expandedDirs);return r.has(t)?r.delete(t):r.add(t),{expandedDirs:r}}),currentFile:null,setCurrentFile:t=>e({currentFile:t,selection:null}),selection:null,setSelection:t=>e({selection:t}),clearSelection:()=>e({selection:null}),gitStatus:null,setGitStatus:t=>e({gitStatus:t}),showFuzzyFinder:!1,setShowFuzzyFinder:t=>e({showFuzzyFinder:t})})),Oo=xa(e=>({leftPanelVisible:!0,rightPanelVisible:!0,showOnlyGitChanged:!1,diffViewMode:"none",setLeftPanelVisible:t=>e({leftPanelVisible:t}),setRightPanelVisible:t=>e({rightPanelVisible:t}),toggleLeftPanel:()=>e(t=>({leftPanelVisible:!t.leftPanelVisible})),toggleRightPanel:()=>e(t=>({rightPanelVisible:!t.rightPanelVisible})),toggleAllPanels:()=>e(t=>{const n=t.leftPanelVisible||t.rightPanelVisible;return{leftPanelVisible:!n,rightPanelVisible:!n}}),setShowOnlyGitChanged:t=>e({showOnlyGitChanged:t}),toggleGitFilter:()=>e(t=>({showOnlyGitChanged:!t.showOnlyGitChanged})),setDiffViewMode:t=>e({diffViewMode:t}),cycleDiffViewMode:()=>e(t=>{const n=["none","inline","side-by-side"],i=(n.indexOf(t.diffViewMode)+1)%n.length;return{diffViewMode:n[i]}})})),at={async getFiles(){const e=await fetch("/api/files");if(!e.ok)throw new Error("Failed to fetch files");return e.json()},async getFlatFiles(){const e=await fetch("/api/files/flat");if(!e.ok)throw new Error("Failed to fetch flat files");return e.json()},async getFile(e){const t=await fetch(`/api/file?path=${encodeURIComponent(e)}`);if(!t.ok)throw new Error("Failed to fetch file");return t.json()},async getGitStatus(){const e=await fetch("/api/git/status");if(!e.ok)throw new Error("Failed to fetch git status");return e.json()},async getFileDiff(e){const t=await fetch(`/api/git/diff?path=${encodeURIComponent(e)}`);if(!t.ok){if(t.status===404)return{hunks:[],status:"modified"};throw new Error("Failed to fetch diff")}return t.json()},async submit(e,t){if(!(await fetch("/api/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:e,items:t})})).ok)throw new Error("Failed to submit")},async cancel(){if(!(await fetch("/api/cancel",{method:"POST"})).ok)throw new Error("Failed to cancel")}};function qf(e,t){return e.map(n=>{if(n.type==="file")return t.has(n.path)?n:null;const r=n.children?qf(n.children,t):[];return r.length>0?{...n,children:r}:null}).filter(n=>n!==null)}function a_(){const{fileTree:e,expandedDirs:t,toggleDir:n,setCurrentFile:r,gitStatus:i}=No(),{showOnlyGitChanged:o,toggleGitFilter:l}=Oo(),s=M.useCallback(async p=>{try{const y=await at.getFile(p);r(y)}catch(y){console.error("Failed to load file:",y)}},[r]),a=M.useMemo(()=>i!=null&&i.isGitRepo?new Set(i.unstaged.map(p=>p.path)):new Set,[i]),u=a.size,c=M.useMemo(()=>!o||a.size===0?e:qf(e,a),[e,o,a]),d=p=>{var y;return i!=null&&i.isGitRepo?((y=i.unstaged.find(v=>v.path===p))==null?void 0:y.status)??null:null},f=(p,y=0)=>{const v=p.type==="directory",L=t.has(p.path),g=d(p.path);return S.jsxs("div",{className:"tree-node",children:[S.jsxs("div",{className:`tree-item ${v?"tree-item-dir":"tree-item-file"} ${g?`git-${g}`:""}`,style:{paddingLeft:`${y*16+8}px`},onClick:()=>{v?n(p.path):s(p.path)},children:[S.jsx("span",{className:"tree-icon",children:v?L?S.jsx(kg,{size:14}):S.jsx(Cg,{size:14}):S.jsx(Pg,{size:14})}),v&&S.jsx("span",{className:"tree-folder-icon",children:L?S.jsx(Ag,{size:14}):S.jsx(Rg,{size:14})}),S.jsx("span",{className:"tree-name",children:p.name}),g&&S.jsx("span",{className:`git-badge git-badge-${g}`,children:g==="modified"?"M":g==="untracked"?"U":g==="deleted"?"D":"A"})]}),v&&L&&p.children&&S.jsx("div",{className:"tree-children",children:p.children.map(m=>f(m,y+1))})]},p.path)};return S.jsxs("div",{className:"file-tree",children:[S.jsxs("div",{className:"file-tree-header",children:[S.jsx("span",{children:"Files"}),(i==null?void 0:i.isGitRepo)&&u>0&&S.jsx("div",{className:"file-tree-header-actions",children:S.jsxs("button",{className:`filter-btn ${o?"active":""}`,onClick:l,title:"Show only changed files (Cmd+G)",children:[S.jsx(xg,{size:12}),S.jsx("span",{className:"count",children:u})]})})]}),S.jsx("div",{className:"file-tree-content",children:c.length===0?S.jsx("div",{className:"staging-list-empty",children:S.jsx("p",{className:"staging-hint",children:"No files to display"})}):c.map(p=>f(p))})]})}const u_="modulepreload",c_=function(e){return"/"+e},ec={},h=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),s=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(a=>{if(a=c_(a),a in ec)return;ec[a]=!0;const u=a.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":u_,u||(d.as="script"),d.crossOrigin="",d.href=a,s&&d.setAttribute("nonce",s),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}function o(l){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l}return i.then(l=>{for(const s of l||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};let ne=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function d_(e){return Ta(e)}function Ta(e){return Array.isArray(e)?f_(e):e instanceof RegExp?e:typeof e=="object"?p_(e):e}function f_(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ta(e[n]);return t}function p_(e){let t={};for(let n in e)t[n]=Ta(e[n]);return t}function Yf(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Xf(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Xf(e.substring(0,e.length-1)):e.substr(~t+1)}var hl=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,hi=class{static hasCaptures(e){return e===null?!1:(hl.lastIndex=0,hl.test(e))}static replaceCaptures(e,t,n){return e.replace(hl,(r,i,o,l)=>{let s=n[parseInt(i||o,10)];if(s){let a=t.substring(s.start,s.end);for(;a[0]===".";)a=a.substring(1);switch(l){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function Jf(e,t){return e<t?-1:e>t?1:0}function Zf(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let o=Jf(e[i],t[i]);if(o!==0)return o}return 0}return n-r}function tc(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ep(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var tp=class{constructor(e){w(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},ro=class{constructor(e,t,n){w(this,"_cachedMatchRoot",new tp(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(g_(e),t)}static createFromParsedTheme(e,t){return y_(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>h_(e.parent,i.parentScopes));return r?new np(r.fontStyle,r.foreground,r.background):null}},ml=class Ii{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Ii(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Ii(n,t[r]);return n}push(t){return new Ii(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function h_(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!m_(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function m_(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var np=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function g_(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i<o;i++){let l=t[i];if(!l.settings)continue;let s;if(typeof l.scope=="string"){let d=l.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),s=d.split(",")}else Array.isArray(l.scope)?s=l.scope:s=[""];let a=-1;if(typeof l.settings.fontStyle=="string"){a=0;let d=l.settings.fontStyle.split(" ");for(let f=0,p=d.length;f<p;f++)switch(d[f]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let u=null;typeof l.settings.foreground=="string"&&tc(l.settings.foreground)&&(u=l.settings.foreground);let c=null;typeof l.settings.background=="string"&&tc(l.settings.background)&&(c=l.settings.background);for(let d=0,f=s.length;d<f;d++){let y=s[d].trim().split(" "),v=y[y.length-1],L=null;y.length>1&&(L=y.slice(0,y.length-1),L.reverse()),n[r++]=new __(v,L,i,a,u,c)}}return n}var __=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},Ee=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Ee||{});function y_(e,t){e.sort((a,u)=>{let c=Jf(a.scope,u.scope);return c!==0||(c=Zf(a.parentScopes,u.parentScopes),c!==0)?c:a.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let a=e.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(i=a.background)}let o=new v_(t),l=new np(n,o.getId(r),o.getId(i)),s=new S_(new _s(0,null,-1,0,0),[]);for(let a=0,u=e.length;a<u;a++){let c=e[a];s.insert(0,c.scope,c.parentScopes,c.fontStyle,o.getId(c.foreground),o.getId(c.background))}return new ro(o,l,s)}var v_=class{constructor(e){w(this,"_isFrozen");w(this,"_lastColorId");w(this,"_id2color");w(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},E_=Object.freeze([]),_s=class rp{constructor(t,n,r,i,o){w(this,"scopeDepth");w(this,"parentScopes");w(this,"fontStyle");w(this,"foreground");w(this,"background");this.scopeDepth=t,this.parentScopes=n||E_,this.fontStyle=r,this.foreground=i,this.background=o}clone(){return new rp(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},S_=class ys{constructor(t,n=[],r={}){w(this,"_rulesWithParentScopes");this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ys._cmpBySpecificity),n}insert(t,n,r,i,o,l){if(n===""){this._doInsertHere(t,r,i,o,l);return}let s=n.indexOf("."),a,u;s===-1?(a=n,u=""):(a=n.substring(0,s),u=n.substring(s+1));let c;this._children.hasOwnProperty(a)?c=this._children[a]:(c=new ys(this._mainRule.clone(),_s.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,u,r,i,o,l)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let l=0,s=this._rulesWithParentScopes.length;l<s;l++){let a=this._rulesWithParentScopes[l];if(Zf(a.parentScopes,n)===0){a.acceptOverwrite(t,r,i,o);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new _s(t,n,r,i,o))}},Gn=class $e{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=$e.getLanguageId(t),r=$e.getTokenType(t),i=$e.getFontStyle(t),o=$e.getForeground(t),l=$e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:o,background:l})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,l,s){let a=$e.getLanguageId(t),u=$e.getTokenType(t),c=$e.containsBalancedBrackets(t)?1:0,d=$e.getFontStyle(t),f=$e.getForeground(t),p=$e.getBackground(t);return n!==0&&(a=n),r!==8&&(u=r),i!==null&&(c=i?1:0),o!==-1&&(d=o),l!==0&&(f=l),s!==0&&(p=s),(a<<0|u<<8|c<<10|d<<11|f<<15|p<<24)>>>0}};function io(e,t){const n=[],r=w_(e);let i=r.next();for(;i!==null;){let a=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=l();if(n.push({matcher:u,priority:a}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const a=o();return u=>!!a&&!a(u)}if(i==="("){i=r.next();const a=s();return i===")"&&(i=r.next()),a}if(nc(i)){const a=[];do a.push(i),i=r.next();while(nc(i));return u=>t(a,u)}return null}function l(){const a=[];let u=o();for(;u;)a.push(u),u=o();return c=>a.every(d=>d(c))}function s(){const a=[];let u=l();for(;u&&(a.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=l()}return c=>a.some(d=>d(c))}}function nc(e){return!!e&&!!e.match(/[\w\.:]+/)}function w_(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function ip(e){typeof e.dispose=="function"&&e.dispose()}var Fr=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},k_=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},C_=class{constructor(){w(this,"_references",[]);w(this,"_seenReferenceKeys",new Set);w(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},L_=class{constructor(e,t){w(this,"seenFullScopeRequests",new Set);w(this,"seenPartialScopeRequests",new Set);w(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Fr(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new C_;for(const n of e)P_(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Fr){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function P_(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Fr?Di({baseGrammar:o,selfGrammar:i},r):vs(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const l=n.injections(e.scopeName);if(l)for(const s of l)r.add(new Fr(s))}function vs(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];oo([r],t,n)}}function Di(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&oo(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&oo(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function oo(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Yf({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&oo(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const l=op(o);switch(l.kind){case 0:Di({...t,selfGrammar:t.baseGrammar},n);break;case 1:Di(t,n);break;case 2:vs(l.ruleName,{...t,repository:i},n);break;case 3:case 4:const s=l.scopeName===t.selfGrammar.scopeName?t.selfGrammar:l.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(s){const a={baseGrammar:t.baseGrammar,selfGrammar:s,repository:i};l.kind===4?vs(l.ruleName,a,n):Di(a,n)}else l.kind===4?n.add(new k_(l.scopeName,l.ruleName)):n.add(new Fr(l.scopeName));break}}}var A_=class{constructor(){w(this,"kind",0)}},R_=class{constructor(){w(this,"kind",1)}},x_=class{constructor(e){w(this,"kind",2);this.ruleName=e}},T_=class{constructor(e){w(this,"kind",3);this.scopeName=e}},I_=class{constructor(e,t){w(this,"kind",4);this.scopeName=e,this.ruleName=t}};function op(e){if(e==="$base")return new A_;if(e==="$self")return new R_;const t=e.indexOf("#");if(t===-1)return new T_(e);if(t===0)return new x_(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new I_(n,r)}}var D_=/\\(\d+)/,rc=/\\(\d+)/g,N_=-1,lp=-2;var Kr=class{constructor(e,t,n,r){w(this,"$location");w(this,"id");w(this,"_nameIsCapturing");w(this,"_name");w(this,"_contentNameIsCapturing");w(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=hi.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=hi.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Xf(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:hi.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:hi.replaceCaptures(this._contentName,e,t)}},O_=class extends Kr{constructor(t,n,r,i,o){super(t,n,r,i);w(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(t,n){throw new Error("Not supported!")}compile(t,n){throw new Error("Not supported!")}compileAG(t,n,r,i){throw new Error("Not supported!")}},M_=class extends Kr{constructor(t,n,r,i,o){super(t,n,r,null);w(this,"_match");w(this,"captures");w(this,"_cachedCompiledPatterns");this._match=new zr(i,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,n){n.push(this._match)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Br,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ic=class extends Kr{constructor(t,n,r,i,o){super(t,n,r,i);w(this,"hasMissingPatterns");w(this,"patterns");w(this,"_cachedCompiledPatterns");this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,n){for(const r of this.patterns)t.getRule(r).collectPatterns(t,n)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Br,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Es=class extends Kr{constructor(t,n,r,i,o,l,s,a,u,c){super(t,n,r,i);w(this,"_begin");w(this,"beginCaptures");w(this,"_end");w(this,"endHasBackReferences");w(this,"endCaptures");w(this,"applyEndPatternLast");w(this,"hasMissingPatterns");w(this,"patterns");w(this,"_cachedCompiledPatterns");this._begin=new zr(o,this.id),this.beginCaptures=l,this._end=new zr(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=u||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,n){return this._end.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t,n).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t,n).compileAG(t,r,i)}_getCachedCompiledPatterns(t,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Br;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},lo=class extends Kr{constructor(t,n,r,i,o,l,s,a,u){super(t,n,r,i);w(this,"_begin");w(this,"beginCaptures");w(this,"whileCaptures");w(this,"_while");w(this,"whileHasBackReferences");w(this,"hasMissingPatterns");w(this,"patterns");w(this,"_cachedCompiledPatterns");w(this,"_cachedCompiledWhilePatterns");this._begin=new zr(o,this.id),this.beginCaptures=l,this.whileCaptures=a,this._while=new zr(s,lp),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,n){return this._while.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Br;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,n){return this._getCachedCompiledWhilePatterns(t,n).compile(t)}compileWhileAG(t,n,r,i){return this._getCachedCompiledWhilePatterns(t,n).compileAG(t,r,i)}_getCachedCompiledWhilePatterns(t,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Br,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}},sp=class ye{static createCaptureRule(t,n,r,i,o){return t.registerRule(l=>new O_(n,l,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new M_(t.$vscodeTextmateLocation,t.id,t.name,t.match,ye._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Yf({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new ic(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,ye._compilePatterns(o,n,r))}return t.while?new lo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ye._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,ye._compileCaptures(t.whileCaptures||t.captures,n,r),ye._compilePatterns(t.patterns,n,r)):new Es(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ye._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,ye._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,ye._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const s=parseInt(l,10);s>o&&(o=s)}for(let l=0;l<=o;l++)i[l]=null;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const s=parseInt(l,10);let a=0;t[l].patterns&&(a=ye.getCompiledRuleId(t[l],n,r)),i[s]=ye.createCaptureRule(n,t[l].$vscodeTextmateLocation,t[l].name,t[l].contentName,a)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,l=t.length;o<l;o++){const s=t[o];let a=-1;if(s.include){const u=op(s.include);switch(u.kind){case 0:case 1:a=ye.getCompiledRuleId(r[s.include],n,r);break;case 2:let c=r[u.ruleName];c&&(a=ye.getCompiledRuleId(c,n,r));break;case 3:case 4:const d=u.scopeName,f=u.kind===4?u.ruleName:null,p=n.getExternalGrammar(d,r);if(p)if(f){let y=p.repository[f];y&&(a=ye.getCompiledRuleId(y,n,p.repository))}else a=ye.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=ye.getCompiledRuleId(s,n,r);if(a!==-1){const u=n.getRule(a);let c=!1;if((u instanceof ic||u instanceof Es||u instanceof lo)&&u.hasMissingPatterns&&u.patterns.length===0&&(c=!0),c)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},zr=class ap{constructor(t,n){w(this,"source");w(this,"ruleId");w(this,"hasAnchor");w(this,"hasBackReferences");w(this,"_anchorCache");if(t&&typeof t=="string"){const r=t.length;let i=0,o=[],l=!1;for(let s=0;s<r;s++)if(t.charAt(s)==="\\"&&s+1<r){const u=t.charAt(s+1);u==="z"?(o.push(t.substring(i,s)),o.push("$(?!\\n)(?<!\\n)"),i=s+2):(u==="A"||u==="G")&&(l=!0),s++}this.hasAnchor=l,i===0?this.source=t:(o.push(t.substring(i,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=D_.test(this.source):this.hasBackReferences=!1}clone(){return new ap(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return rc.lastIndex=0,this.source.replace(rc,(i,o)=>ep(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,l,s,a;for(o=0,l=this.source.length;o<l;o++)s=this.source.charAt(o),t[o]=s,n[o]=s,r[o]=s,i[o]=s,s==="\\"&&o+1<l&&(a=this.source.charAt(o+1),a==="A"?(t[o+1]="￿",n[o+1]="￿",r[o+1]="A",i[o+1]="A"):a==="G"?(t[o+1]="￿",n[o+1]="G",r[o+1]="￿",i[o+1]="G"):(t[o+1]=a,n[o+1]=a,r[o+1]=a,i[o+1]=a),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Br=class{constructor(){w(this,"_items");w(this,"_hasAnchors");w(this,"_cached");w(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new oc(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new oc(e,r,this._items.map(i=>i.ruleId))}},oc=class{constructor(e,t,n){w(this,"scanner");this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
142
+ */var Do=M,Qg=Kg;function qg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yg=typeof Object.is=="function"?Object.is:qg,Xg=Qg.useSyncExternalStore,Jg=Do.useRef,Zg=Do.useEffect,e_=Do.useMemo,t_=Do.useDebugValue;Hf.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Jg(null);if(o.current===null){var l={hasValue:!1,value:null};o.current=l}else l=o.current;o=e_(function(){function a(p){if(!u){if(u=!0,c=p,p=r(p),i!==void 0&&l.hasValue){var y=l.value;if(i(y,p))return d=y}return d=p}if(y=d,Yg(c,p))return y;var v=r(p);return i!==void 0&&i(y,v)?(c=p,y):(c=p,d=v)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,i]);var s=Xg(e,o[0],o[1]);return Zg(function(){l.hasValue=!0,l.value=s},[s]),t_(s),s};Gf.exports=Hf;var n_=Gf.exports;const r_=Rc(n_),Qf={},{useDebugValue:i_}=zc,{useSyncExternalStoreWithSelector:o_}=r_;let Ju=!1;const l_=e=>e;function s_(e,t=l_,n){(Qf?"production":void 0)!=="production"&&n&&!Ju&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ju=!0);const r=o_(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return i_(r),r}const Zu=e=>{(Qf?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?jg(e):e,n=(r,i)=>s_(t,r,i);return Object.assign(n,t),n},xa=e=>e?Zu(e):Zu,No=xa(e=>({fileTree:[],flatFiles:[],filteredDirs:[],expandedDirs:new Set,setFileTree:t=>e({fileTree:t}),setFlatFiles:(t,n)=>e({flatFiles:t,filteredDirs:n}),toggleDir:t=>e(n=>{const r=new Set(n.expandedDirs);return r.has(t)?r.delete(t):r.add(t),{expandedDirs:r}}),currentFile:null,setCurrentFile:t=>e({currentFile:t,selection:null}),selection:null,setSelection:t=>e({selection:t}),clearSelection:()=>e({selection:null}),gitStatus:null,setGitStatus:t=>e({gitStatus:t}),showFuzzyFinder:!1,setShowFuzzyFinder:t=>e({showFuzzyFinder:t})})),Oo=xa(e=>({leftPanelVisible:!0,rightPanelVisible:!0,showOnlyGitChanged:!1,diffViewMode:"none",setLeftPanelVisible:t=>e({leftPanelVisible:t}),setRightPanelVisible:t=>e({rightPanelVisible:t}),toggleLeftPanel:()=>e(t=>({leftPanelVisible:!t.leftPanelVisible})),toggleRightPanel:()=>e(t=>({rightPanelVisible:!t.rightPanelVisible})),toggleAllPanels:()=>e(t=>{const n=t.leftPanelVisible||t.rightPanelVisible;return{leftPanelVisible:!n,rightPanelVisible:!n}}),setShowOnlyGitChanged:t=>e({showOnlyGitChanged:t}),toggleGitFilter:()=>e(t=>({showOnlyGitChanged:!t.showOnlyGitChanged})),setDiffViewMode:t=>e({diffViewMode:t}),cycleDiffViewMode:()=>e(t=>{const n=["none","inline","side-by-side"],i=(n.indexOf(t.diffViewMode)+1)%n.length;return{diffViewMode:n[i]}})})),at={async getFiles(){const e=await fetch("/api/files");if(!e.ok)throw new Error("Failed to fetch files");return e.json()},async getFlatFiles(){const e=await fetch("/api/files/flat");if(!e.ok)throw new Error("Failed to fetch flat files");return e.json()},async getFile(e){const t=await fetch(`/api/file?path=${encodeURIComponent(e)}`);if(!t.ok)throw new Error("Failed to fetch file");return t.json()},async getGitStatus(){const e=await fetch("/api/git/status");if(!e.ok)throw new Error("Failed to fetch git status");return e.json()},async getFileDiff(e){const t=await fetch(`/api/git/diff?path=${encodeURIComponent(e)}`);if(!t.ok){if(t.status===404)return{hunks:[],status:"modified"};throw new Error("Failed to fetch diff")}return t.json()},async submit(e,t){if(!(await fetch("/api/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:e,items:t})})).ok)throw new Error("Failed to submit")},async cancel(){if(!(await fetch("/api/cancel",{method:"POST"})).ok)throw new Error("Failed to cancel")}};function qf(e,t){return e.map(n=>{if(n.type==="file")return t.has(n.path)?n:null;const r=n.children?qf(n.children,t):[];return r.length>0?{...n,children:r}:null}).filter(n=>n!==null)}function a_(){const{fileTree:e,expandedDirs:t,toggleDir:n,setCurrentFile:r,gitStatus:i}=No(),{showOnlyGitChanged:o,toggleGitFilter:l}=Oo(),s=M.useCallback(async p=>{try{const y=await at.getFile(p);r(y)}catch(y){console.error("Failed to load file:",y)}},[r]),a=M.useMemo(()=>i!=null&&i.isGitRepo?new Set(i.unstaged.map(p=>p.path)):new Set,[i]),u=a.size,c=M.useMemo(()=>!o||a.size===0?e:qf(e,a),[e,o,a]),d=p=>{var y;return i!=null&&i.isGitRepo?((y=i.unstaged.find(v=>v.path===p))==null?void 0:y.status)??null:null},f=(p,y=0)=>{const v=p.type==="directory",L=t.has(p.path),g=p.filtered===!0,m=d(p.path);return S.jsxs("div",{className:"tree-node",children:[S.jsxs("div",{className:`tree-item ${v?"tree-item-dir":"tree-item-file"} ${m?`git-${m}`:""} ${g?"tree-item-filtered":""}`,style:{paddingLeft:`${y*16+8}px`},title:g?"Not loaded for performance":void 0,onClick:()=>{g||(v?n(p.path):s(p.path))},children:[S.jsx("span",{className:"tree-icon",children:v?L?S.jsx(kg,{size:14}):S.jsx(Cg,{size:14}):S.jsx(Pg,{size:14})}),v&&S.jsx("span",{className:"tree-folder-icon",children:L?S.jsx(Ag,{size:14}):S.jsx(Rg,{size:14})}),S.jsx("span",{className:"tree-name",children:p.name}),m&&S.jsx("span",{className:`git-badge git-badge-${m}`,children:m==="modified"?"M":m==="untracked"?"U":m==="deleted"?"D":"A"})]}),v&&L&&p.children&&S.jsx("div",{className:"tree-children",children:p.children.map(_=>f(_,y+1))})]},p.path)};return S.jsxs("div",{className:"file-tree",children:[S.jsxs("div",{className:"file-tree-header",children:[S.jsx("span",{children:"Files"}),(i==null?void 0:i.isGitRepo)&&u>0&&S.jsx("div",{className:"file-tree-header-actions",children:S.jsxs("button",{className:`filter-btn ${o?"active":""}`,onClick:l,title:"Show only changed files (Cmd+G)",children:[S.jsx(xg,{size:12}),S.jsx("span",{className:"count",children:u})]})})]}),S.jsx("div",{className:"file-tree-content",children:c.length===0?S.jsx("div",{className:"staging-list-empty",children:S.jsx("p",{className:"staging-hint",children:"No files to display"})}):c.map(p=>f(p))})]})}const u_="modulepreload",c_=function(e){return"/"+e},ec={},h=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),s=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(a=>{if(a=c_(a),a in ec)return;ec[a]=!0;const u=a.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":u_,u||(d.as="script"),d.crossOrigin="",d.href=a,s&&d.setAttribute("nonce",s),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}function o(l){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l}return i.then(l=>{for(const s of l||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};let ne=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function d_(e){return Ta(e)}function Ta(e){return Array.isArray(e)?f_(e):e instanceof RegExp?e:typeof e=="object"?p_(e):e}function f_(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ta(e[n]);return t}function p_(e){let t={};for(let n in e)t[n]=Ta(e[n]);return t}function Yf(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Xf(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Xf(e.substring(0,e.length-1)):e.substr(~t+1)}var hl=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,hi=class{static hasCaptures(e){return e===null?!1:(hl.lastIndex=0,hl.test(e))}static replaceCaptures(e,t,n){return e.replace(hl,(r,i,o,l)=>{let s=n[parseInt(i||o,10)];if(s){let a=t.substring(s.start,s.end);for(;a[0]===".";)a=a.substring(1);switch(l){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function Jf(e,t){return e<t?-1:e>t?1:0}function Zf(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let o=Jf(e[i],t[i]);if(o!==0)return o}return 0}return n-r}function tc(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ep(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var tp=class{constructor(e){w(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},ro=class{constructor(e,t,n){w(this,"_cachedMatchRoot",new tp(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(g_(e),t)}static createFromParsedTheme(e,t){return y_(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>h_(e.parent,i.parentScopes));return r?new np(r.fontStyle,r.foreground,r.background):null}},ml=class Ii{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Ii(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Ii(n,t[r]);return n}push(t){return new Ii(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function h_(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!m_(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function m_(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var np=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function g_(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i<o;i++){let l=t[i];if(!l.settings)continue;let s;if(typeof l.scope=="string"){let d=l.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),s=d.split(",")}else Array.isArray(l.scope)?s=l.scope:s=[""];let a=-1;if(typeof l.settings.fontStyle=="string"){a=0;let d=l.settings.fontStyle.split(" ");for(let f=0,p=d.length;f<p;f++)switch(d[f]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let u=null;typeof l.settings.foreground=="string"&&tc(l.settings.foreground)&&(u=l.settings.foreground);let c=null;typeof l.settings.background=="string"&&tc(l.settings.background)&&(c=l.settings.background);for(let d=0,f=s.length;d<f;d++){let y=s[d].trim().split(" "),v=y[y.length-1],L=null;y.length>1&&(L=y.slice(0,y.length-1),L.reverse()),n[r++]=new __(v,L,i,a,u,c)}}return n}var __=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},Ee=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Ee||{});function y_(e,t){e.sort((a,u)=>{let c=Jf(a.scope,u.scope);return c!==0||(c=Zf(a.parentScopes,u.parentScopes),c!==0)?c:a.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let a=e.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(i=a.background)}let o=new v_(t),l=new np(n,o.getId(r),o.getId(i)),s=new S_(new _s(0,null,-1,0,0),[]);for(let a=0,u=e.length;a<u;a++){let c=e[a];s.insert(0,c.scope,c.parentScopes,c.fontStyle,o.getId(c.foreground),o.getId(c.background))}return new ro(o,l,s)}var v_=class{constructor(e){w(this,"_isFrozen");w(this,"_lastColorId");w(this,"_id2color");w(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},E_=Object.freeze([]),_s=class rp{constructor(t,n,r,i,o){w(this,"scopeDepth");w(this,"parentScopes");w(this,"fontStyle");w(this,"foreground");w(this,"background");this.scopeDepth=t,this.parentScopes=n||E_,this.fontStyle=r,this.foreground=i,this.background=o}clone(){return new rp(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},S_=class ys{constructor(t,n=[],r={}){w(this,"_rulesWithParentScopes");this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ys._cmpBySpecificity),n}insert(t,n,r,i,o,l){if(n===""){this._doInsertHere(t,r,i,o,l);return}let s=n.indexOf("."),a,u;s===-1?(a=n,u=""):(a=n.substring(0,s),u=n.substring(s+1));let c;this._children.hasOwnProperty(a)?c=this._children[a]:(c=new ys(this._mainRule.clone(),_s.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,u,r,i,o,l)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let l=0,s=this._rulesWithParentScopes.length;l<s;l++){let a=this._rulesWithParentScopes[l];if(Zf(a.parentScopes,n)===0){a.acceptOverwrite(t,r,i,o);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new _s(t,n,r,i,o))}},Gn=class $e{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=$e.getLanguageId(t),r=$e.getTokenType(t),i=$e.getFontStyle(t),o=$e.getForeground(t),l=$e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:o,background:l})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,l,s){let a=$e.getLanguageId(t),u=$e.getTokenType(t),c=$e.containsBalancedBrackets(t)?1:0,d=$e.getFontStyle(t),f=$e.getForeground(t),p=$e.getBackground(t);return n!==0&&(a=n),r!==8&&(u=r),i!==null&&(c=i?1:0),o!==-1&&(d=o),l!==0&&(f=l),s!==0&&(p=s),(a<<0|u<<8|c<<10|d<<11|f<<15|p<<24)>>>0}};function io(e,t){const n=[],r=w_(e);let i=r.next();for(;i!==null;){let a=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=l();if(n.push({matcher:u,priority:a}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const a=o();return u=>!!a&&!a(u)}if(i==="("){i=r.next();const a=s();return i===")"&&(i=r.next()),a}if(nc(i)){const a=[];do a.push(i),i=r.next();while(nc(i));return u=>t(a,u)}return null}function l(){const a=[];let u=o();for(;u;)a.push(u),u=o();return c=>a.every(d=>d(c))}function s(){const a=[];let u=l();for(;u&&(a.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=l()}return c=>a.some(d=>d(c))}}function nc(e){return!!e&&!!e.match(/[\w\.:]+/)}function w_(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function ip(e){typeof e.dispose=="function"&&e.dispose()}var Fr=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},k_=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},C_=class{constructor(){w(this,"_references",[]);w(this,"_seenReferenceKeys",new Set);w(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},L_=class{constructor(e,t){w(this,"seenFullScopeRequests",new Set);w(this,"seenPartialScopeRequests",new Set);w(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Fr(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new C_;for(const n of e)P_(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Fr){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function P_(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Fr?Di({baseGrammar:o,selfGrammar:i},r):vs(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const l=n.injections(e.scopeName);if(l)for(const s of l)r.add(new Fr(s))}function vs(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];oo([r],t,n)}}function Di(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&oo(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&oo(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function oo(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Yf({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&oo(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const l=op(o);switch(l.kind){case 0:Di({...t,selfGrammar:t.baseGrammar},n);break;case 1:Di(t,n);break;case 2:vs(l.ruleName,{...t,repository:i},n);break;case 3:case 4:const s=l.scopeName===t.selfGrammar.scopeName?t.selfGrammar:l.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(s){const a={baseGrammar:t.baseGrammar,selfGrammar:s,repository:i};l.kind===4?vs(l.ruleName,a,n):Di(a,n)}else l.kind===4?n.add(new k_(l.scopeName,l.ruleName)):n.add(new Fr(l.scopeName));break}}}var A_=class{constructor(){w(this,"kind",0)}},R_=class{constructor(){w(this,"kind",1)}},x_=class{constructor(e){w(this,"kind",2);this.ruleName=e}},T_=class{constructor(e){w(this,"kind",3);this.scopeName=e}},I_=class{constructor(e,t){w(this,"kind",4);this.scopeName=e,this.ruleName=t}};function op(e){if(e==="$base")return new A_;if(e==="$self")return new R_;const t=e.indexOf("#");if(t===-1)return new T_(e);if(t===0)return new x_(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new I_(n,r)}}var D_=/\\(\d+)/,rc=/\\(\d+)/g,N_=-1,lp=-2;var Kr=class{constructor(e,t,n,r){w(this,"$location");w(this,"id");w(this,"_nameIsCapturing");w(this,"_name");w(this,"_contentNameIsCapturing");w(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=hi.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=hi.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Xf(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:hi.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:hi.replaceCaptures(this._contentName,e,t)}},O_=class extends Kr{constructor(t,n,r,i,o){super(t,n,r,i);w(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(t,n){throw new Error("Not supported!")}compile(t,n){throw new Error("Not supported!")}compileAG(t,n,r,i){throw new Error("Not supported!")}},M_=class extends Kr{constructor(t,n,r,i,o){super(t,n,r,null);w(this,"_match");w(this,"captures");w(this,"_cachedCompiledPatterns");this._match=new zr(i,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,n){n.push(this._match)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Br,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ic=class extends Kr{constructor(t,n,r,i,o){super(t,n,r,i);w(this,"hasMissingPatterns");w(this,"patterns");w(this,"_cachedCompiledPatterns");this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,n){for(const r of this.patterns)t.getRule(r).collectPatterns(t,n)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Br,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Es=class extends Kr{constructor(t,n,r,i,o,l,s,a,u,c){super(t,n,r,i);w(this,"_begin");w(this,"beginCaptures");w(this,"_end");w(this,"endHasBackReferences");w(this,"endCaptures");w(this,"applyEndPatternLast");w(this,"hasMissingPatterns");w(this,"patterns");w(this,"_cachedCompiledPatterns");this._begin=new zr(o,this.id),this.beginCaptures=l,this._end=new zr(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=u||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,n){return this._end.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t,n).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t,n).compileAG(t,r,i)}_getCachedCompiledPatterns(t,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Br;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},lo=class extends Kr{constructor(t,n,r,i,o,l,s,a,u){super(t,n,r,i);w(this,"_begin");w(this,"beginCaptures");w(this,"whileCaptures");w(this,"_while");w(this,"whileHasBackReferences");w(this,"hasMissingPatterns");w(this,"patterns");w(this,"_cachedCompiledPatterns");w(this,"_cachedCompiledWhilePatterns");this._begin=new zr(o,this.id),this.beginCaptures=l,this.whileCaptures=a,this._while=new zr(s,lp),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,n){return this._while.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Br;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,n){return this._getCachedCompiledWhilePatterns(t,n).compile(t)}compileWhileAG(t,n,r,i){return this._getCachedCompiledWhilePatterns(t,n).compileAG(t,r,i)}_getCachedCompiledWhilePatterns(t,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Br,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}},sp=class ye{static createCaptureRule(t,n,r,i,o){return t.registerRule(l=>new O_(n,l,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new M_(t.$vscodeTextmateLocation,t.id,t.name,t.match,ye._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Yf({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new ic(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,ye._compilePatterns(o,n,r))}return t.while?new lo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ye._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,ye._compileCaptures(t.whileCaptures||t.captures,n,r),ye._compilePatterns(t.patterns,n,r)):new Es(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ye._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,ye._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,ye._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const s=parseInt(l,10);s>o&&(o=s)}for(let l=0;l<=o;l++)i[l]=null;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const s=parseInt(l,10);let a=0;t[l].patterns&&(a=ye.getCompiledRuleId(t[l],n,r)),i[s]=ye.createCaptureRule(n,t[l].$vscodeTextmateLocation,t[l].name,t[l].contentName,a)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,l=t.length;o<l;o++){const s=t[o];let a=-1;if(s.include){const u=op(s.include);switch(u.kind){case 0:case 1:a=ye.getCompiledRuleId(r[s.include],n,r);break;case 2:let c=r[u.ruleName];c&&(a=ye.getCompiledRuleId(c,n,r));break;case 3:case 4:const d=u.scopeName,f=u.kind===4?u.ruleName:null,p=n.getExternalGrammar(d,r);if(p)if(f){let y=p.repository[f];y&&(a=ye.getCompiledRuleId(y,n,p.repository))}else a=ye.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=ye.getCompiledRuleId(s,n,r);if(a!==-1){const u=n.getRule(a);let c=!1;if((u instanceof ic||u instanceof Es||u instanceof lo)&&u.hasMissingPatterns&&u.patterns.length===0&&(c=!0),c)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},zr=class ap{constructor(t,n){w(this,"source");w(this,"ruleId");w(this,"hasAnchor");w(this,"hasBackReferences");w(this,"_anchorCache");if(t&&typeof t=="string"){const r=t.length;let i=0,o=[],l=!1;for(let s=0;s<r;s++)if(t.charAt(s)==="\\"&&s+1<r){const u=t.charAt(s+1);u==="z"?(o.push(t.substring(i,s)),o.push("$(?!\\n)(?<!\\n)"),i=s+2):(u==="A"||u==="G")&&(l=!0),s++}this.hasAnchor=l,i===0?this.source=t:(o.push(t.substring(i,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=D_.test(this.source):this.hasBackReferences=!1}clone(){return new ap(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return rc.lastIndex=0,this.source.replace(rc,(i,o)=>ep(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,l,s,a;for(o=0,l=this.source.length;o<l;o++)s=this.source.charAt(o),t[o]=s,n[o]=s,r[o]=s,i[o]=s,s==="\\"&&o+1<l&&(a=this.source.charAt(o+1),a==="A"?(t[o+1]="￿",n[o+1]="￿",r[o+1]="A",i[o+1]="A"):a==="G"?(t[o+1]="￿",n[o+1]="G",r[o+1]="￿",i[o+1]="G"):(t[o+1]=a,n[o+1]=a,r[o+1]=a,i[o+1]=a),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Br=class{constructor(){w(this,"_items");w(this,"_hasAnchors");w(this,"_cached");w(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new oc(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new oc(e,r,this._items.map(i=>i.ruleId))}},oc=class{constructor(e,t,n){w(this,"scanner");this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
143
143
  `)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},gl=class{constructor(e,t){this.languageId=e,this.tokenType=t}},gt,V_=(gt=class{constructor(t,n){w(this,"_defaultAttributes");w(this,"_embeddedLanguagesMatcher");w(this,"_getBasicScopeAttributes",new tp(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new gl(n,r)}));this._defaultAttributes=new gl(t,8),this._embeddedLanguagesMatcher=new j_(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?gt._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(gt.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},w(gt,"_NULL_SCOPE_METADATA",new gl(0,0)),w(gt,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),gt),j_=class{constructor(e){w(this,"values");w(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>ep(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},lc=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function up(e,t,n,r,i,o,l,s){const a=t.content.length;let u=!1,c=-1;if(l){const p=F_(e,t,n,r,i,o);i=p.stack,r=p.linePos,n=p.isFirstLine,c=p.anchorPosition}const d=Date.now();for(;!u;){if(s!==0&&Date.now()-d>s)return new lc(i,!0);f()}return new lc(i,!1);function f(){const p=z_(e,t,n,r,i,c);if(!p){o.produce(i,a),u=!0;return}const y=p.captureIndices,v=p.matchedRuleId,L=y&&y.length>0?y[0].end>r:!1;if(v===N_){const g=i.getRule(e);o.produce(i,y[0].start),i=i.withContentNameScopesList(i.nameScopesList),cr(e,t,n,i,o,g.endCaptures,y),o.produce(i,y[0].end);const m=i;if(i=i.parent,c=m.getAnchorPos(),!L&&m.getEnterPos()===r){i=m,o.produce(i,a),u=!0;return}}else{const g=e.getRule(v);o.produce(i,y[0].start);const m=i,_=g.getName(t.content,y),E=i.contentNameScopesList.pushAttributed(_,e);if(i=i.push(v,r,c,y[0].end===a,null,E,E),g instanceof Es){const C=g;cr(e,t,n,i,o,C.beginCaptures,y),o.produce(i,y[0].end),c=y[0].end;const R=C.getContentName(t.content,y),k=E.pushAttributed(R,e);if(i=i.withContentNameScopesList(k),C.endHasBackReferences&&(i=i.withEndRule(C.getEndWithResolvedBackReferences(t.content,y))),!L&&m.hasSameRuleAs(i)){i=i.pop(),o.produce(i,a),u=!0;return}}else if(g instanceof lo){const C=g;cr(e,t,n,i,o,C.beginCaptures,y),o.produce(i,y[0].end),c=y[0].end;const R=C.getContentName(t.content,y),k=E.pushAttributed(R,e);if(i=i.withContentNameScopesList(k),C.whileHasBackReferences&&(i=i.withEndRule(C.getWhileWithResolvedBackReferences(t.content,y))),!L&&m.hasSameRuleAs(i)){i=i.pop(),o.produce(i,a),u=!0;return}}else if(cr(e,t,n,i,o,g.captures,y),o.produce(i,y[0].end),i=i.pop(),!L){i=i.safePop(),o.produce(i,a),u=!0;return}}y[0].end>r&&(r=y[0].end,n=!1)}}function F_(e,t,n,r,i,o){let l=i.beginRuleCapturedEOL?0:-1;const s=[];for(let a=i;a;a=a.pop()){const u=a.getRule(e);u instanceof lo&&s.push({rule:u,stack:a})}for(let a=s.pop();a;a=s.pop()){const{ruleScanner:u,findOptions:c}=$_(a.rule,e,a.stack.endRule,n,r===l),d=u.findNextMatchSync(t,r,c);if(d){if(d.ruleId!==lp){i=a.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(o.produce(a.stack,d.captureIndices[0].start),cr(e,t,n,a.stack,o,a.rule.whileCaptures,d.captureIndices),o.produce(a.stack,d.captureIndices[0].end),l=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{i=a.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:l,isFirstLine:n}}function z_(e,t,n,r,i,o){const l=B_(e,t,n,r,i,o),s=e.getInjections();if(s.length===0)return l;const a=b_(s,e,t,n,r,i,o);if(!a)return l;if(!l)return a;const u=l.captureIndices[0].start,c=a.captureIndices[0].start;return c<u||a.priorityMatch&&c===u?a:l}function B_(e,t,n,r,i,o){const l=i.getRule(e),{ruleScanner:s,findOptions:a}=cp(l,e,i.endRule,n,r===o),u=s.findNextMatchSync(t,r,a);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function b_(e,t,n,r,i,o,l){let s=Number.MAX_VALUE,a=null,u,c=0;const d=o.contentNameScopesList.getScopeNames();for(let f=0,p=e.length;f<p;f++){const y=e[f];if(!y.matcher(d))continue;const v=t.getRule(y.ruleId),{ruleScanner:L,findOptions:g}=cp(v,t,null,r,i===l),m=L.findNextMatchSync(n,i,g);if(!m)continue;const _=m.captureIndices[0].start;if(!(_>=s)&&(s=_,a=m.captureIndices,u=m.ruleId,c=y.priority,s===i))break}return a?{priorityMatch:c===-1,captureIndices:a,matchedRuleId:u}:null}function cp(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function $_(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function cr(e,t,n,r,i,o,l){if(o.length===0)return;const s=t.content,a=Math.min(o.length,l.length),u=[],c=l[0].end;for(let d=0;d<a;d++){const f=o[d];if(f===null)continue;const p=l[d];if(p.length===0)continue;if(p.start>c)break;for(;u.length>0&&u[u.length-1].endPos<=p.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,p.start):i.produce(r,p.start),f.retokenizeCapturedWithRuleId){const v=f.getName(s,l),L=r.contentNameScopesList.pushAttributed(v,e),g=f.getContentName(s,l),m=L.pushAttributed(g,e),_=r.push(f.retokenizeCapturedWithRuleId,p.start,-1,!1,null,L,m),E=e.createOnigString(s.substring(0,p.end));up(e,E,n&&p.start===0,p.start,_,i,!1,0),ip(E);continue}const y=f.getName(s,l);if(y!==null){const L=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(y,e);u.push(new U_(L,p.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var U_=class{constructor(e,t){w(this,"scopes");w(this,"endPos");this.scopes=e,this.endPos=t}};function G_(e,t,n,r,i,o,l,s){return new W_(e,t,n,r,i,o,l,s)}function sc(e,t,n,r,i){const o=io(t,so),l=sp.getCompiledRuleId(n,r,i.repository);for(const s of o)e.push({debugSelector:t,matcher:s.matcher,ruleId:l,grammar:i,priority:s.priority})}function so(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let i=n;i<t.length;i++)if(H_(t[i],r))return n=i+1,!0;return!1})}function H_(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var W_=class{constructor(e,t,n,r,i,o,l,s){w(this,"_rootId");w(this,"_lastRuleId");w(this,"_ruleId2desc");w(this,"_includedGrammars");w(this,"_grammarRepository");w(this,"_grammar");w(this,"_injections");w(this,"_basicScopeAttributesProvider");w(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=s,this._basicScopeAttributesProvider=new V_(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=ac(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const a of Object.keys(i)){const u=io(a,so);for(const c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:i[a]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let l in i)sc(t,l,i[l],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(l=>{const s=this.getExternalGrammar(l);if(s){const a=s.injectionSelector;a&&sc(t,a,s,this,s)}})}return t.sort((i,o)=>i.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ac(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=sp.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Ss.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),d=Gn.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),f=this.getRule(this._rootId).getName(null,null);let p;f?p=Er.createRootAndLookUpScopeName(f,d,this):p=Er.createRoot("unknown",d),t=new Ss(null,this._rootId,-1,-1,!1,null,p,p)}else i=!1,t.reset();e=e+`
144
144
  `;const o=this.createOnigString(e),l=o.content.length,s=new Q_(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=up(this,o,i,0,t,s,!0,r);return ip(o),{lineLength:l,lineTokens:s,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function ac(e,t){return e=d_(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Er=class ot{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=(t==null?void 0:t.scopePath)??null;for(const o of n)i=ml.push(i,o.scopeNames),r=new ot(r,i,o.encodedTokenAttributes);return r}static createRoot(t,n){return new ot(null,new ml(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),o=new ml(null,t),l=r.themeProvider.themeMatch(o),s=ot.mergeAttributes(n,i,l);return new ot(null,o,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return ot.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,o=0,l=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,l=r.backgroundId),Gn.set(t,n.languageId,n.tokenType,null,i,o,l)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return ot._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const o of r)i=ot._pushAttributed(i,o,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),o=t.scopePath.push(n),l=r.themeProvider.themeMatch(o),s=ot.mergeAttributes(t.tokenAttributes,i,l);return new ot(t,o,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var i;const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((i=r.parent)==null?void 0:i.scopePath)??null)}),r=r.parent;return r===t?n.reverse():void 0}},He,Ss=(He=class{constructor(t,n,r,i,o,l,s,a){w(this,"_stackElementBrand");w(this,"_enterPos");w(this,"_anchorPos");w(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=l,this.nameScopesList=s,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(t){return t===null?!1:He._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Er.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){He._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,o,l,s){return new He(this,t,n,r,i,o,l,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){var r,i;return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(i=this.contentNameScopesList)==null?void 0:i.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new He(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var t,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,n){const r=Er.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new He(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Er.fromExtension(r,n.contentNameScopesList))}},w(He,"NULL",new He(null,0,0,0,!1,null,null,null)),He),K_=class{constructor(e,t){w(this,"balancedBracketScopes");w(this,"unbalancedBracketScopes");w(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):io(n,so).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>io(n,so).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Q_=class{constructor(e,t,n,r){w(this,"_emitBinaryTokens");w(this,"_lineText");w(this,"_tokens");w(this,"_binaryTokens");w(this,"_lastTokenEndIndex");w(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var r;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=(e==null?void 0:e.tokenAttributes)??0,o=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const l=(e==null?void 0:e.getScopeNames())??[];for(const s of this._tokenTypeOverrides)s.matcher(l)&&(i=Gn.set(i,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(l))}if(o&&(i=Gn.set(i,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const n=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},q_=class{constructor(e,t){w(this,"_grammars",new Map);w(this,"_rawGrammars",new Map);w(this,"_injectionGrammars",new Map);w(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,G_(e,o,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Y_=class{constructor(t){w(this,"_options");w(this,"_syncRegistry");w(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new q_(ro.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(ro.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new K_(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,o){const l=new L_(this._syncRegistry,t);for(;l.Q.length>0;)l.Q.map(s=>this._loadSingleGrammar(s.scopeName)),l.processQueue();return this._grammarForScopeName(t,n,r,i,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,o)}},ws=Ss.NULL;const X_=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Qr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Qr.prototype.normal={};Qr.prototype.property={};Qr.prototype.space=void 0;function dp(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Qr(n,r,t)}function ks(e){return e.toLowerCase()}class Ie{constructor(t,n){this.attribute=n,this.property=t}}Ie.prototype.attribute="";Ie.prototype.booleanish=!1;Ie.prototype.boolean=!1;Ie.prototype.commaOrSpaceSeparated=!1;Ie.prototype.commaSeparated=!1;Ie.prototype.defined=!1;Ie.prototype.mustUseProperty=!1;Ie.prototype.number=!1;Ie.prototype.overloadedBoolean=!1;Ie.prototype.property="";Ie.prototype.spaceSeparated=!1;Ie.prototype.space=void 0;let J_=0;const j=pn(),te=pn(),Cs=pn(),A=pn(),$=pn(),On=pn(),Ne=pn();function pn(){return 2**++J_}const Ls=Object.freeze(Object.defineProperty({__proto__:null,boolean:j,booleanish:te,commaOrSpaceSeparated:Ne,commaSeparated:On,number:A,overloadedBoolean:Cs,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),_l=Object.keys(Ls);class Ia extends Ie{constructor(t,n,r,i){let o=-1;if(super(t,n),uc(this,"space",i),typeof r=="number")for(;++o<_l.length;){const l=_l[o];uc(this,_l[o],(r&Ls[l])===Ls[l])}}}Ia.prototype.defined=!0;function uc(e,t,n){n&&(e[t]=n)}function Qn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Ia(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[ks(r)]=r,n[ks(o.attribute)]=r}return new Qr(t,n,e.space)}const fp=Qn({properties:{ariaActiveDescendant:null,ariaAtomic:te,ariaAutoComplete:null,ariaBusy:te,ariaChecked:te,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:$,ariaCurrent:null,ariaDescribedBy:$,ariaDetails:null,ariaDisabled:te,ariaDropEffect:$,ariaErrorMessage:null,ariaExpanded:te,ariaFlowTo:$,ariaGrabbed:te,ariaHasPopup:null,ariaHidden:te,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$,ariaLevel:A,ariaLive:null,ariaModal:te,ariaMultiLine:te,ariaMultiSelectable:te,ariaOrientation:null,ariaOwns:$,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:te,ariaReadOnly:te,ariaRelevant:null,ariaRequired:te,ariaRoleDescription:$,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:te,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function pp(e,t){return t in e?e[t]:t}function hp(e,t){return pp(e,t.toLowerCase())}const Z_=Qn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:On,acceptCharset:$,accessKey:$,action:null,allow:null,allowFullScreen:j,allowPaymentRequest:j,allowUserMedia:j,alt:null,as:null,async:j,autoCapitalize:null,autoComplete:$,autoFocus:j,autoPlay:j,blocking:$,capture:null,charSet:null,checked:j,cite:null,className:$,cols:A,colSpan:null,content:null,contentEditable:te,controls:j,controlsList:$,coords:A|On,crossOrigin:null,data:null,dateTime:null,decoding:null,default:j,defer:j,dir:null,dirName:null,disabled:j,download:Cs,draggable:te,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:j,formTarget:null,headers:$,height:A,hidden:Cs,high:A,href:null,hrefLang:null,htmlFor:$,httpEquiv:$,id:null,imageSizes:null,imageSrcSet:null,inert:j,inputMode:null,integrity:null,is:null,isMap:j,itemId:null,itemProp:$,itemRef:$,itemScope:j,itemType:$,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:j,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:j,muted:j,name:null,nonce:null,noModule:j,noValidate:j,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:j,optimum:A,pattern:null,ping:$,placeholder:null,playsInline:j,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:j,referrerPolicy:null,rel:$,required:j,reversed:j,rows:A,rowSpan:A,sandbox:$,scope:null,scoped:j,seamless:j,selected:j,shadowRootClonable:j,shadowRootDelegatesFocus:j,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:te,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:j,useMap:null,value:te,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:j,declare:j,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:j,noHref:j,noShade:j,noWrap:j,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:te,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:j,disableRemotePlayback:j,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:hp}),ey=Qn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ne,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:$,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:j,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:On,g2:On,glyphName:On,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:Ne,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ne,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ne,rev:Ne,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ne,requiredFeatures:Ne,requiredFonts:Ne,requiredFormats:Ne,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:Ne,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ne,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ne,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pp}),mp=Qn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),gp=Qn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:hp}),_p=Qn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ty=/[A-Z]/g,cc=/-[a-z]/g,ny=/^data[-\w.:]+$/i;function ry(e,t){const n=ks(t);let r=t,i=Ie;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ny.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(cc,oy);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!cc.test(o)){let l=o.replace(ty,iy);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Ia}return new i(r,t)}function iy(e){return"-"+e.toLowerCase()}function oy(e){return e.charAt(1).toUpperCase()}const ly=dp([fp,Z_,mp,gp,_p],"html"),yp=dp([fp,ey,mp,gp,_p],"svg"),dc={}.hasOwnProperty;function sy(e,t){const n=t||{};function r(i,...o){let l=r.invalid;const s=r.handlers;if(i&&dc.call(i,e)){const a=String(i[e]);l=dc.call(s,a)?s[a]:r.unknown}if(l)return l.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const ay=/["&'<>`]/g,uy=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,cy=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,dy=/[|\\{}()[\]^$+*?.]/g,fc=new WeakMap;function fy(e,t){if(e=e.replace(t.subset?py(t.subset):ay,r),t.subset||t.escapeOnly)return e;return e.replace(uy,n).replace(cy,r);function n(i,o,l){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,l.charCodeAt(o+2),t)}function r(i,o,l){return t.format(i.charCodeAt(0),l.charCodeAt(o+1),t)}}function py(e){let t=fc.get(e);return t||(t=hy(e),fc.set(e,t)),t}function hy(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(dy,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const my=/[\dA-Fa-f]/;function gy(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!my.test(String.fromCharCode(t))?r:r+";"}const _y=/\d/;function yy(e,t,n){const r="&#"+String(e);return n&&t&&!_y.test(String.fromCharCode(t))?r:r+";"}const vy=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],yl={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Ey=["cent","copy","divide","gt","lt","not","para","times"],vp={}.hasOwnProperty,Ps={};let mi;for(mi in yl)vp.call(yl,mi)&&(Ps[yl[mi]]=mi);const Sy=/[^\dA-Za-z]/;function wy(e,t,n,r){const i=String.fromCharCode(e);if(vp.call(Ps,i)){const o=Ps[i],l="&"+o;return n&&vy.includes(o)&&!Ey.includes(o)&&(!r||t&&t!==61&&Sy.test(String.fromCharCode(t)))?l:l+";"}return""}function ky(e,t,n){let r=gy(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=wy(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=yy(e,t,n.omitOptionalSemicolons);o.length<r.length&&(r=o)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Mn(e,t){return fy(e,Object.assign({format:ky},t))}const Cy=/^>|^->|<!--|-->|--!>|<!-$/g,Ly=[">"],Py=["<",">"];function Ay(e,t,n,r){return r.settings.bogusComments?"<?"+Mn(e.value,Object.assign({},r.settings.characterReferences,{subset:Ly}))+">":"<!--"+e.value.replace(Cy,i)+"-->";function i(o){return Mn(o,Object.assign({},r.settings.characterReferences,{subset:Py}))}}function Ry(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function pc(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function xy(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Ty(e){return e.join(" ").trim()}const Iy=/[ \t\n\f\r]/g;function Da(e){return typeof e=="object"?e.type==="text"?hc(e.value):!1:hc(e)}function hc(e){return e.replace(Iy,"")===""}const ae=Sp(1),Ep=Sp(-1),Dy=[];function Sp(e){return t;function t(n,r,i){const o=n?n.children:Dy;let l=(r||0)+e,s=o[l];if(!i)for(;s&&Da(s);)l+=e,s=o[l];return s}}const Ny={}.hasOwnProperty;function wp(e){return t;function t(n,r,i){return Ny.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const Na=wp({body:My,caption:vl,colgroup:vl,dd:zy,dt:Fy,head:vl,html:Oy,li:jy,optgroup:By,option:by,p:Vy,rp:mc,rt:mc,tbody:Uy,td:gc,tfoot:Gy,th:gc,thead:$y,tr:Hy});function vl(e,t,n){const r=ae(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Da(r.value.charAt(0)))}function Oy(e,t,n){const r=ae(n,t);return!r||r.type!=="comment"}function My(e,t,n){const r=ae(n,t);return!r||r.type!=="comment"}function Vy(e,t,n){const r=ae(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function jy(e,t,n){const r=ae(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Fy(e,t,n){const r=ae(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function zy(e,t,n){const r=ae(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function mc(e,t,n){const r=ae(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function By(e,t,n){const r=ae(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function by(e,t,n){const r=ae(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function $y(e,t,n){const r=ae(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Uy(e,t,n){const r=ae(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Gy(e,t,n){return!ae(n,t)}function Hy(e,t,n){const r=ae(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function gc(e,t,n){const r=ae(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Wy=wp({body:qy,colgroup:Yy,head:Qy,html:Ky,tbody:Xy});function Ky(e){const t=ae(e,-1);return!t||t.type!=="comment"}function Qy(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function qy(e){const t=ae(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Da(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Yy(e,t,n){const r=Ep(n,t),i=ae(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Na(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Xy(e,t,n){const r=Ep(n,t),i=ae(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Na(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const gi={name:[[`
145
145
  \f\r &/=>`.split(""),`
@@ -151,4 +151,4 @@ Error generating stack: `+o.message+`
151
151
  \f\r "&'<=>\``.split(""),`\0
152
152
  \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Jy(e,t,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let l=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const s=[];let a;i.space==="html"&&e.tagName==="svg"&&(r.schema=yp);const u=Zy(r,e.properties),c=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,c&&(l=!1),(u||!o||!Wy(e,t,n))&&(s.push("<",e.tagName,u?" "+u:""),l&&(i.space==="svg"||r.settings.closeSelfClosing)&&(a=u.charAt(u.length-1),(!r.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(c),!l&&(!o||!Na(e,t,n))&&s.push("</"+e.tagName+">"),s.join("")}function Zy(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const o=e0(e,i,t[i]);o&&n.push(o)}}for(;++r<n.length;){const o=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&o!=='"'&&o!=="'"&&(n[r]+=" ")}return n.join("")}function e0(e,t,n){const r=ry(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,o=e.settings.allowDangerousCharacters?0:1;let l=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const a=Mn(r.attribute,Object.assign({},e.settings.characterReferences,{subset:gi.name[i][o]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?xy:Ty)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?a:(e.settings.preferUnquoted&&(s=Mn(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:gi.unquoted[i][o]}))),s!==n&&(e.settings.quoteSmart&&pc(n,l)>pc(n,e.alternative)&&(l=e.alternative),s=l+Mn(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?gi.single:gi.double)[i][o],attribute:!0}))+l),a+(s&&"="+s))}const t0=["<","&"];function kp(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Mn(e.value,Object.assign({},r.settings.characterReferences,{subset:t0}))}function n0(e,t,n,r){return r.settings.allowDangerousHtml?e.value:kp(e,t,n,r)}function r0(e,t,n,r){return r.all(e)}const i0=sy("type",{invalid:o0,unknown:l0,handlers:{comment:Ay,doctype:Ry,element:Jy,raw:n0,root:r0,text:kp}});function o0(e){throw new Error("Expected node, not `"+e+"`")}function l0(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const s0={},a0={},u0=[];function c0(e,t){const n=t||s0,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:d0,all:f0,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||X_,characterReferences:n.characterReferences||a0,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?yp:ly,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function d0(e,t,n){return i0(e,t,n,this)}function f0(e){const t=[],n=e&&e.children||u0;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function ao(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,o]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof o=="string"?n[i]=o:i===r&&Object.assign(n,o);return n}function bt(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function p0(e){return Array.isArray(e)?e:[e]}async function Cp(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Oa(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Lp(e){return e==="ansi"||Oa(e)}function Ma(e){return e==="none"}function Pp(e){return Ma(e)}function Ap(e,t){var r;if(!t)return e;e.properties||(e.properties={}),(r=e.properties).class||(r.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function Mo(e,t=!1){var o;if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let l=0;l<n.length;l+=2){const s=t?n[l]+(n[l+1]||""):n[l];i.push([s,r]),r+=n[l].length,r+=((o=n[l+1])==null?void 0:o.length)||0}return i}function h0(e){const t=Mo(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let o=i,l=0;for(const s of t){if(o<s.length)break;o-=s.length,l++}return{line:l,character:o}}function r(i,o){let l=0;for(let s=0;s<i;s++)l+=t[s].length;return l+=o,l}return{lines:t,indexToPos:n,posToIndex:r}}const Va="light-dark()",m0=["color","background-color"];function g0(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function _0(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const o=n.filter(l=>i.offset<l&&l<i.offset+i.content.length).map(l=>l-i.offset).sort((l,s)=>l-s);return o.length?g0(i,o):i})):e}function y0(e,t,n,r,i="css-vars"){const o={content:e.content,explanation:e.explanation,offset:e.offset},l=t.map(c=>uo(e.variants[c])),s=new Set(l.flatMap(c=>Object.keys(c))),a={},u=(c,d)=>{const f=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[c]+(d==="color"?"":f)};return l.forEach((c,d)=>{for(const f of s){const p=c[f]||"inherit";if(d===0&&r&&m0.includes(f))if(r===Va&&l.length>1){const y=t.findIndex(m=>m==="light"),v=t.findIndex(m=>m==="dark");if(y===-1||v===-1)throw new ne('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const L=l[y][f]||"inherit",g=l[v][f]||"inherit";a[f]=`light-dark(${L}, ${g})`,i==="css-vars"&&(a[u(d,f)]=p)}else a[f]=p;else i==="css-vars"&&(a[u(d,f)]=p)}}),o.htmlStyle=a,o}function uo(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Ee.Italic&&(t["font-style"]="italic"),e.fontStyle&Ee.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Ee.Underline&&n.push("underline"),e.fontStyle&Ee.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function As(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Rp=new WeakMap;function Vo(e,t){Rp.set(e,t)}function br(e){return Rp.get(e)}class qn{constructor(...t){w(this,"_stacks",{});w(this,"lang");if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new qn(Object.fromEntries(p0(n).map(r=>[r,ws])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return v0(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function v0(e){const t=[],n=new Set;function r(i){var l;if(n.has(i))return;n.add(i);const o=(l=i==null?void 0:i.nameScopesList)==null?void 0:l.scopeName;o&&t.push(o),i.parent&&r(i.parent)}return r(e),t}function E0(e,t){if(!(e instanceof qn))throw new ne("Invalid grammar state");return e.getInternalStack(t)}function S0(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new ne(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...i.indexToPos(l),offset:l}}else{const s=i.lines[l.line];if(s===void 0)throw new ne(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${i.lines.length}`);let a=l.character;if(a<0&&(a=s.length+a),a<0||a>s.length)throw new ne(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${s.length}`);return{...l,character:a,offset:i.posToIndex(l.line,a)}}};const i=h0(n.source),o=(n.options.decorations||[]).map(l=>({...l,start:r(l.start),end:r(l.end)}));w0(o),e.set(n.meta,{decorations:o,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var l;if(!((l=this.options.decorations)!=null&&l.length))return;const i=t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return _0(n,i)},code(n){var c;if(!((c=this.options.decorations)!=null&&c.length))return;const r=t(this),i=Array.from(n.children).filter(d=>d.type==="element"&&d.tagName==="span");if(i.length!==r.converter.lines.length)throw new ne(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(d,f,p,y){const v=i[d];let L="",g=-1,m=-1;if(f===0&&(g=0),p===0&&(m=0),p===Number.POSITIVE_INFINITY&&(m=v.children.length),g===-1||m===-1)for(let E=0;E<v.children.length;E++)L+=xp(v.children[E]),g===-1&&L.length===f&&(g=E+1),m===-1&&L.length===p&&(m=E+1);if(g===-1)throw new ne(`Failed to find start index for decoration ${JSON.stringify(y.start)}`);if(m===-1)throw new ne(`Failed to find end index for decoration ${JSON.stringify(y.end)}`);const _=v.children.slice(g,m);if(!y.alwaysWrap&&_.length===v.children.length)s(v,y,"line");else if(!y.alwaysWrap&&_.length===1&&_[0].type==="element")s(_[0],y,"token");else{const E={type:"element",tagName:"span",properties:{},children:_};s(E,y,"wrapper"),v.children.splice(g,_.length,E)}}function l(d,f){i[d]=s(i[d],f,"line")}function s(d,f,p){var L;const y=f.properties||{},v=f.transform||(g=>g);return d.tagName=f.tagName||"span",d.properties={...d.properties,...y,class:d.properties.class},(L=f.properties)!=null&&L.class&&Ap(d,f.properties.class),d=v(d,p)||d,d}const a=[],u=r.decorations.sort((d,f)=>f.start.offset-d.start.offset||d.end.offset-f.end.offset);for(const d of u){const{start:f,end:p}=d;if(f.line===p.line)o(f.line,f.character,p.character,d);else if(f.line<p.line){o(f.line,f.character,Number.POSITIVE_INFINITY,d);for(let y=f.line+1;y<p.line;y++)a.unshift(()=>l(y,d));o(p.line,0,p.character,d)}}a.forEach(d=>d())}}}function w0(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new ne(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],o=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,l=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,s=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,a=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(o||l||s||a){if(o&&l||s&&a||s&&n.start.offset===n.end.offset||l&&i.start.offset===i.end.offset)continue;throw new ne(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function xp(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(xp).join(""):""}const k0=[S0()];function co(e){const t=C0(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...k0]}function C0(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var nn=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],El={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function L0(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function _c(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function P0(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)El[r]&&t.push({type:"setDecoration",value:El[r]});else if(r<=29){const i=El[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:nn[r-30]}});else if(r===38){const i=_c(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:nn[r-40]}});else if(r===48){const i=_c(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:nn[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:nn[r-100+8]}})}return t}function A0(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let o=0;do{const l=L0(r,o),s=l.sequence?r.substring(o,l.startPosition):r.substring(o);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),l.sequence){const a=P0(l.sequence);for(const u of a)u.type==="resetAll"?(e=null,t=null,n.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of a)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&n.add(u.value)}o=l.position}while(o<r.length);return i}}}var R0={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function x0(e=R0){function t(s){return e[s]}function n(s){return`#${s.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let u=0;u<nn.length;u++)r.push(t(nn[u]));let s=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let c=0;c<6;c++)for(let d=0;d<6;d++)r.push(n([s[u],s[c],s[d]]));let a=8;for(let u=0;u<24;u++,a+=10)r.push(n([a,a,a]));return r}function o(s){return i()[s]}function l(s){switch(s.type){case"named":return t(s.name);case"rgb":return n(s.rgb);case"table":return o(s.index)}}return{value:l}}const T0={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function I0(e,t,n){const r=ao(e,n),i=Mo(t),o=Object.fromEntries(nn.map(a=>{var d;const u=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`,c=(d=e.colors)==null?void 0:d[u];return[a,c||T0[a]]})),l=x0(o),s=A0();return i.map(a=>s.parse(a[0]).map(u=>{let c,d;u.decorations.has("reverse")?(c=u.background?l.value(u.background):e.bg,d=u.foreground?l.value(u.foreground):e.fg):(c=u.foreground?l.value(u.foreground):e.fg,d=u.background?l.value(u.background):void 0),c=bt(c,r),d=bt(d,r),u.decorations.has("dim")&&(c=D0(c));let f=Ee.None;return u.decorations.has("bold")&&(f|=Ee.Bold),u.decorations.has("italic")&&(f|=Ee.Italic),u.decorations.has("underline")&&(f|=Ee.Underline),u.decorations.has("strikethrough")&&(f|=Ee.Strikethrough),{content:u.value,offset:a[1],color:c,bgColor:d,fontStyle:f}}))}function D0(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],o=r[1],l=r[2],s=r[3],a=Math.round(Number.parseInt(`${s}${s}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${o}${o}${l}${l}${a}`}else if(r.length===3){const i=r[0],o=r[1],l=r[2];return`#${i}${i}${o}${o}${l}${l}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function ja(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||"text");if(Oa(i)||Ma(r))return Mo(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:o,colorMap:l}=e.setTheme(r);if(i==="ansi")return I0(o,t,n);const s=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new ne(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(o.name))throw new ne(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return O0(t,s,o,l,n)}function N0(...e){if(e.length===2)return br(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:o=t.getLoadedThemes()[0]}=r;if(Oa(i)||Ma(o))throw new ne("Plain language does not have grammar state");if(i==="ansi")throw new ne("ANSI language does not have grammar state");const{theme:l,colorMap:s}=t.setTheme(o),a=t.getLanguage(i);return new qn(Fa(n,a,l,s,r).stateStack,a.name,l.name)}function O0(e,t,n,r,i){const o=Fa(e,t,n,r,i),l=new qn(o.stateStack,t.name,n.name);return Vo(o.tokens,l),o.tokens}function Fa(e,t,n,r,i){const o=ao(n,i),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:s=500}=i,a=Mo(e);let u=i.grammarState?E0(i.grammarState,n.name)??ws:i.grammarContextCode!=null?Fa(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:ws,c=[];const d=[];for(let f=0,p=a.length;f<p;f++){const[y,v]=a[f];if(y===""){c=[],d.push([]);continue}if(l>0&&y.length>=l){c=[],d.push([{content:y,offset:v,color:"",fontStyle:0}]);continue}let L,g,m;i.includeExplanation&&(L=t.tokenizeLine(y,u,s),g=L.tokens,m=0);const _=t.tokenizeLine2(y,u,s),E=_.tokens.length/2;for(let C=0;C<E;C++){const R=_.tokens[2*C],k=C+1<E?_.tokens[2*C+2]:y.length;if(R===k)continue;const x=_.tokens[2*C+1],O=bt(r[Gn.getForeground(x)],o),D=Gn.getFontStyle(x),X={content:y.substring(R,k),offset:v+R,color:O,fontStyle:D};if(i.includeExplanation){const ie=[];if(i.includeExplanation!=="scopeName")for(const W of n.settings){let De;switch(typeof W.scope){case"string":De=W.scope.split(/,/).map(rt=>rt.trim());break;case"object":De=W.scope;break;default:continue}ie.push({settings:W,selectors:De.map(rt=>rt.split(/ /))})}X.explanation=[];let pt=0;for(;R+pt<k;){const W=g[m],De=y.substring(W.startIndex,W.endIndex);pt+=De.length,X.explanation.push({content:De,scopes:i.includeExplanation==="scopeName"?M0(W.scopes):V0(ie,W.scopes)}),m+=1}}c.push(X)}d.push(c),c=[],u=_.ruleStack}return{tokens:d,stateStack:u}}function M0(e){return e.map(t=>({scopeName:t}))}function V0(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const o=t[r];n[r]={scopeName:o,themeMatches:F0(e,o,t.slice(0,r))}}return n}function yc(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function j0(e,t,n){if(!yc(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)yc(e[r],n[i])&&(r-=1),i-=1;return r===-1}function F0(e,t,n){const r=[];for(const{selectors:i,settings:o}of e)for(const l of i)if(j0(l,t,n)){r.push(o);break}return r}function Tp(e,t,n){const r=Object.entries(n.themes).filter(a=>a[1]).map(a=>({color:a[0],theme:a[1]})),i=r.map(a=>{const u=ja(e,t,{...n,theme:a.theme}),c=br(u),d=typeof a.theme=="string"?a.theme:a.theme.name;return{tokens:u,state:c,theme:d}}),o=z0(...i.map(a=>a.tokens)),l=o[0].map((a,u)=>a.map((c,d)=>{const f={content:c.content,variants:{},offset:c.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=c.explanation),o.forEach((p,y)=>{const{content:v,explanation:L,offset:g,...m}=p[u][d];f.variants[r[y].color]=m}),f})),s=i[0].state?new qn(Object.fromEntries(i.map(a=>{var u;return[a.theme,(u=a.state)==null?void 0:u.getInternalStack(a.theme)]})),i[0].state.lang):void 0;return s&&Vo(l,s),l}function z0(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(a=>a[r]),o=t.map(()=>[]);t.forEach((a,u)=>a.push(o[u]));const l=i.map(()=>0),s=i.map(a=>a[0]);for(;s.every(a=>a);){const a=Math.min(...s.map(u=>u.content.length));for(let u=0;u<n;u++){const c=s[u];c.content.length===a?(o[u].push(c),l[u]+=1,s[u]=i[u][l[u]]):(o[u].push({...c,content:c.content.slice(0,a)}),s[u]={...c,content:c.content.slice(a),offset:c.offset+a})}}}return t}function fo(e,t,n){let r,i,o,l,s,a;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:c="--shiki-",colorsRendering:d="css-vars"}=n,f=Object.entries(n.themes).filter(g=>g[1]).map(g=>({color:g[0],theme:g[1]})).sort((g,m)=>g.color===u?-1:m.color===u?1:0);if(f.length===0)throw new ne("`themes` option must not be empty");const p=Tp(e,t,n);if(a=br(p),u&&Va!==u&&!f.find(g=>g.color===u))throw new ne(`\`themes\` option must contain the defaultColor key \`${u}\``);const y=f.map(g=>e.getTheme(g.theme)),v=f.map(g=>g.color);o=p.map(g=>g.map(m=>y0(m,v,c,u,d))),a&&Vo(o,a);const L=f.map(g=>ao(g.theme,n));i=vc(f,y,L,c,u,"fg",d),r=vc(f,y,L,c,u,"bg",d),l=`shiki-themes ${y.map(g=>g.name).join(" ")}`,s=u?void 0:[i,r].join(";")}else if("theme"in n){const u=ao(n.theme,n);o=ja(e,t,n);const c=e.getTheme(n.theme);r=bt(c.bg,u),i=bt(c.fg,u),l=c.name,a=br(o)}else throw new ne("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:i,bg:r,themeName:l,rootStyle:s,grammarState:a}}function vc(e,t,n,r,i,o,l){return e.map((s,a)=>{const u=bt(t[a][o],n[a])||"inherit",c=`${r+s.color}${o==="bg"?"-bg":""}:${u}`;if(a===0&&i){if(i===Va&&e.length>1){const d=e.findIndex(v=>v.color==="light"),f=e.findIndex(v=>v.color==="dark");if(d===-1||f===-1)throw new ne('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const p=bt(t[d][o],n[d])||"inherit",y=bt(t[f][o],n[f])||"inherit";return`light-dark(${p}, ${y});${c}`}return u}return l==="css-vars"?c:null}).filter(s=>!!s).join(";")}function po(e,t,n,r={meta:{},options:n,codeToHast:(i,o)=>po(e,i,o),codeToTokens:(i,o)=>fo(e,i,o)}){var y,v;let i=t;for(const L of co(n))i=((y=L.preprocess)==null?void 0:y.call(r,i,n))||i;let{tokens:o,fg:l,bg:s,themeName:a,rootStyle:u,grammarState:c}=fo(e,i,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?o=b0(o):d==="never"&&(o=$0(o)),f&&(o=U0(o));const p={...r,get source(){return i}};for(const L of co(n))o=((v=L.tokens)==null?void 0:v.call(p,o))||o;return B0(o,{...n,fg:l,bg:s,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},p,c)}function B0(e,t,n,r=br(e)){var v,L,g,m;const i=co(t),o=[],l={type:"root",children:[]},{structure:s="classic",tabindex:a="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),a!==!1&&a!=null&&(u.tabindex=a.toString());for(const[_,E]of Object.entries(t.meta||{}))_.startsWith("_")||(u[_]=E);let c={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:o};const f=[],p={...n,structure:s,addClassToHast:Ap,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return l},get pre(){return c},get code(){return d},get lines(){return f}};if(e.forEach((_,E)=>{var k,x;E&&(s==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):s==="classic"&&o.push({type:"text",value:`
153
153
  `}));let C={type:"element",tagName:"span",properties:{class:"line"},children:[]},R=0;for(const O of _){let D={type:"element",tagName:"span",properties:{...O.htmlAttrs},children:[{type:"text",value:O.content}]};const X=As(O.htmlStyle||uo(O));X&&(D.properties.style=X);for(const ie of i)D=((k=ie==null?void 0:ie.span)==null?void 0:k.call(p,D,E+1,R,C,O))||D;s==="inline"?l.children.push(D):s==="classic"&&C.children.push(D),R+=O.content.length}if(s==="classic"){for(const O of i)C=((x=O==null?void 0:O.line)==null?void 0:x.call(p,C,E+1))||C;f.push(C),o.push(C)}else s==="inline"&&f.push(C)}),s==="classic"){for(const _ of i)d=((v=_==null?void 0:_.code)==null?void 0:v.call(p,d))||d;c.children.push(d);for(const _ of i)c=((L=_==null?void 0:_.pre)==null?void 0:L.call(p,c))||c;l.children.push(c)}else if(s==="inline"){const _=[];let E={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const k of l.children)k.type==="element"&&k.tagName==="br"?(_.push(E),E={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(k.type==="element"||k.type==="text")&&E.children.push(k);_.push(E);let R={type:"element",tagName:"code",properties:{},children:_};for(const k of i)R=((g=k==null?void 0:k.code)==null?void 0:g.call(p,R))||R;l.children=[];for(let k=0;k<R.children.length;k++){k>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const x=R.children[k];x.type==="element"&&l.children.push(...x.children)}}let y=l;for(const _ of i)y=((m=_==null?void 0:_.root)==null?void 0:m.call(p,y))||y;return r&&Vo(y,r),y}function b0(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((o,l)=>{const a=!(o.fontStyle&&(o.fontStyle&Ee.Underline||o.fontStyle&Ee.Strikethrough));a&&o.content.match(/^\s+$/)&&t[l+1]?(i===void 0&&(i=o.offset),r+=o.content):r?(a?n.push({...o,offset:i,content:r+o.content}):n.push({content:r,offset:i},o),i=void 0,r=""):n.push(o)}),n})}function $0(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,o,l]=r;if(!i&&!l)return n;const s=[{...n,offset:n.offset+i.length,content:o}];return i&&s.unshift({content:i,offset:n.offset}),l&&s.push({content:l,offset:n.offset+i.length+o.length}),s}))}function U0(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],o=As(i.htmlStyle||uo(i)),l=As(r.htmlStyle||uo(r)),s=i.fontStyle&&(i.fontStyle&Ee.Underline||i.fontStyle&Ee.Strikethrough),a=r.fontStyle&&(r.fontStyle&Ee.Underline||r.fontStyle&Ee.Strikethrough);!s&&!a&&o===l?i.content+=r.content:n.push({...r})}return n})}const G0=c0;function H0(e,t,n){var o;const r={meta:{},options:n,codeToHast:(l,s)=>po(e,l,s),codeToTokens:(l,s)=>fo(e,l,s)};let i=G0(po(e,t,n,r));for(const l of co(n))i=((o=l.postprocess)==null?void 0:o.call(r,i,n))||i;return i}const Ec={light:"#333333",dark:"#bbbbbb"},Sc={light:"#fffffe",dark:"#1e1e1e"},wc="__shiki_resolved";function za(e){var s,a,u,c,d;if(e!=null&&e[wc])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:n,fg:r}=t;if(!n||!r){const f=t.settings?t.settings.find(p=>!p.name&&!p.scope):void 0;(s=f==null?void 0:f.settings)!=null&&s.foreground&&(r=f.settings.foreground),(a=f==null?void 0:f.settings)!=null&&a.background&&(n=f.settings.background),!r&&((u=t==null?void 0:t.colors)!=null&&u["editor.foreground"])&&(r=t.colors["editor.foreground"]),!n&&((c=t==null?void 0:t.colors)!=null&&c["editor.background"])&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?Ec.light:Ec.dark),n||(n=t.type==="light"?Sc.light:Sc.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const o=new Map;function l(f){var y;if(o.has(f))return o.get(f);i+=1;const p=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return(y=t.colorReplacements)!=null&&y[`#${p}`]?l(f):(o.set(f,p),p)}t.settings=t.settings.map(f=>{var L,g;const p=((L=f.settings)==null?void 0:L.foreground)&&!f.settings.foreground.startsWith("#"),y=((g=f.settings)==null?void 0:g.background)&&!f.settings.background.startsWith("#");if(!p&&!y)return f;const v={...f,settings:{...f.settings}};if(p){const m=l(f.settings.foreground);t.colorReplacements[m]=f.settings.foreground,v.settings.foreground=m}if(y){const m=l(f.settings.background);t.colorReplacements[m]=f.settings.background,v.settings.background=m}return v});for(const f of Object.keys(t.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!((d=t.colors[f])!=null&&d.startsWith("#"))){const p=l(t.colors[f]);t.colorReplacements[p]=t.colors[f],t.colors[f]=p}return Object.defineProperty(t,wc,{enumerable:!1,writable:!1,value:!0}),t}async function Ip(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Lp(t)).map(async t=>await Cp(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Dp(e){return(await Promise.all(e.map(async n=>Pp(n)?null:za(await Cp(n))))).filter(n=>!!n)}let W0=3;function K0(e,t=3){t>W0||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let An=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Np(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new An(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class Q0 extends Y_{constructor(n,r,i,o={}){super(n);w(this,"_resolvedThemes",new Map);w(this,"_resolvedGrammars",new Map);w(this,"_langMap",new Map);w(this,"_langGraph",new Map);w(this,"_textmateThemeCache",new WeakMap);w(this,"_loadedThemesCache",null);w(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=r,this._langs=i,this._alias=o,this._themes.map(l=>this.loadTheme(l)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const r=za(n);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let r=this._textmateThemeCache.get(n);r||(r=ro.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){return n=Np(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var l,s,a,u;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(c=>{var d;return(d=c.embeddedLangsLazy)==null?void 0:d.includes(n.name)}));this._resolver.addLanguage(n);const i={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const o=this.loadGrammarWithConfiguration(n.scopeName,1,i);if(o.name=n.name,this._resolvedGrammars.set(n.name,o),n.aliases&&n.aliases.forEach(c=>{this._alias[c]=n.name}),this._loadedLanguagesCache=null,r.size)for(const c of r)this._resolvedGrammars.delete(c.name),this._loadedLanguagesCache=null,(s=(l=this._syncRegistry)==null?void 0:l._injectionGrammars)==null||s.delete(c.scopeName),(u=(a=this._syncRegistry)==null?void 0:a._grammars)==null||u.delete(c.scopeName),this.loadLanguage(this._langMap.get(c.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const o of n)this.resolveEmbeddedLanguages(o);const r=Array.from(this._langGraph.entries()),i=r.filter(([o,l])=>!l);if(i.length){const o=r.filter(([l,s])=>{if(!s)return!1;const a=s.embeddedLanguages||s.embeddedLangs;return a==null?void 0:a.some(u=>i.map(([c])=>c).includes(u))}).filter(l=>!i.includes(l));throw new An(`Missing languages ${i.map(([l])=>`\`${l}\``).join(", ")}, required by ${o.map(([l])=>`\`${l}\``).join(", ")}`)}for(const[o,l]of r)this._resolver.addLanguage(l);for(const[o,l]of r)this.loadLanguage(l)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){this._langMap.set(n.name,n),this._langGraph.set(n.name,n);const r=n.embeddedLanguages??n.embeddedLangs;if(r)for(const i of r)this._langGraph.set(i,this._langMap.get(i))}}class q0{constructor(t,n){w(this,"_langs",new Map);w(this,"_scopeToLang",new Map);w(this,"_injections",new Map);w(this,"_onigLib");this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let i=1;i<=n.length;i++){const o=n.slice(0,i).join(".");r=[...r,...this._injections.get(o)||[]]}return r}}let or=0;function Y0(e){or+=1,e.warnings!==!1&&or>=10&&or%10===0&&console.warn(`[Shiki] ${or} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new An("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(za),i=new q0(e.engine,n),o=new Q0(i,r,n,e.langAlias);let l;function s(_){return Np(_,e.langAlias)}function a(_){g();const E=o.getGrammar(typeof _=="string"?_:_.name);if(!E)throw new An(`Language \`${_}\` not found, you may need to load it first`);return E}function u(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};g();const E=o.getTheme(_);if(!E)throw new An(`Theme \`${_}\` not found, you may need to load it first`);return E}function c(_){g();const E=u(_);l!==_&&(o.setTheme(E),l=_);const C=o.getColorMap();return{theme:E,colorMap:C}}function d(){return g(),o.getLoadedThemes()}function f(){return g(),o.getLoadedLanguages()}function p(..._){g(),o.loadLanguages(_.flat(1))}async function y(..._){return p(await Ip(_))}function v(..._){g();for(const E of _.flat(1))o.loadTheme(E)}async function L(..._){return g(),v(await Dp(_))}function g(){if(t)throw new An("Shiki instance has been disposed")}function m(){t||(t=!0,o.dispose(),or-=1)}return{setTheme:c,getTheme:u,getLanguage:a,getLoadedThemes:d,getLoadedLanguages:f,resolveLangAlias:s,loadLanguage:y,loadLanguageSync:p,loadTheme:L,loadThemeSync:v,dispose:m,[Symbol.dispose]:m}}async function X0(e){e.engine||K0("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Dp(e.themes||[]),Ip(e.langs||[]),e.engine]);return Y0({...e,themes:t,langs:n,engine:r})}async function J0(e){const t=await X0(e);return{getLastGrammarState:(...n)=>N0(t,...n),codeToTokensBase:(n,r)=>ja(t,n,r),codeToTokensWithThemes:(n,r)=>Tp(t,n,r),codeToTokens:(n,r)=>fo(t,n,r),codeToHast:(n,r)=>po(t,n,r),codeToHtml:(n,r)=>H0(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Z0(e){const t=e.langs,n=e.themes,r=e.engine;async function i(o){function l(d){var f;if(typeof d=="string"){if(d=((f=o.langAlias)==null?void 0:f[d])||d,Lp(d))return[];const p=t[d];if(!p)throw new ne(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return p}return d}function s(d){if(Pp(d))return"none";if(typeof d=="string"){const f=n[d];if(!f)throw new ne(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}const a=(o.themes??[]).map(d=>s(d)),u=(o.langs??[]).map(d=>l(d)),c=await J0({engine:o.engine??r(),...o,themes:a,langs:u});return{...c,loadLanguage(...d){return c.loadLanguage(...d.map(l))},loadTheme(...d){return c.loadTheme(...d.map(s))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}const Op=[{id:"abap",name:"ABAP",import:()=>h(()=>import("./abap-BdImnpbu.js"),[])},{id:"actionscript-3",name:"ActionScript",import:()=>h(()=>import("./actionscript-3-CfeIJUat.js"),[])},{id:"ada",name:"Ada",import:()=>h(()=>import("./ada-bCR0ucgS.js"),[])},{id:"angular-html",name:"Angular HTML",import:()=>h(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]))},{id:"angular-ts",name:"Angular TypeScript",import:()=>h(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5]))},{id:"apache",name:"Apache Conf",import:()=>h(()=>import("./apache-Pmp26Uib.js"),[])},{id:"apex",name:"Apex",import:()=>h(()=>import("./apex-D8_7TLub.js"),[])},{id:"apl",name:"APL",import:()=>h(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9]))},{id:"applescript",name:"AppleScript",import:()=>h(()=>import("./applescript-Co6uUVPk.js"),[])},{id:"ara",name:"Ara",import:()=>h(()=>import("./ara-BRHolxvo.js"),[])},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>h(()=>import("./asciidoc-Dv7Oe6Be.js"),[])},{id:"asm",name:"Assembly",import:()=>h(()=>import("./asm-D_Q5rh1f.js"),[])},{id:"astro",name:"Astro",import:()=>h(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13]))},{id:"awk",name:"AWK",import:()=>h(()=>import("./awk-DMzUqQB5.js"),[])},{id:"ballerina",name:"Ballerina",import:()=>h(()=>import("./ballerina-BFfxhgS-.js"),[])},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>h(()=>import("./bat-BkioyH1T.js"),[])},{id:"beancount",name:"Beancount",import:()=>h(()=>import("./beancount-k_qm7-4y.js"),[])},{id:"berry",name:"Berry",aliases:["be"],import:()=>h(()=>import("./berry-uYugtg8r.js"),[])},{id:"bibtex",name:"BibTeX",import:()=>h(()=>import("./bibtex-CHM0blh-.js"),[])},{id:"bicep",name:"Bicep",import:()=>h(()=>import("./bicep-Bmn6On1c.js"),[])},{id:"blade",name:"Blade",import:()=>h(()=>import("./blade-D4QpJJKB.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>h(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18]))},{id:"c",name:"C",import:()=>h(()=>import("./c-BIGW1oBm.js"),[])},{id:"c3",name:"C3",import:()=>h(()=>import("./c3-VCDPK7BO.js"),[])},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>h(()=>import("./cadence-Bv_4Rxtq.js"),[])},{id:"cairo",name:"Cairo",import:()=>h(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20]))},{id:"clarity",name:"Clarity",import:()=>h(()=>import("./clarity-D53aC0YG.js"),[])},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>h(()=>import("./clojure-P80f7IUj.js"),[])},{id:"cmake",name:"CMake",import:()=>h(()=>import("./cmake-D1j8_8rp.js"),[])},{id:"cobol",name:"COBOL",import:()=>h(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8]))},{id:"codeowners",name:"CODEOWNERS",import:()=>h(()=>import("./codeowners-Bp6g37R7.js"),[])},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>h(()=>import("./codeql-DsOJ9woJ.js"),[])},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>h(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2]))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>h(()=>import("./common-lisp-Cg-RD9OK.js"),[])},{id:"coq",name:"Coq",import:()=>h(()=>import("./coq-DkFqJrB1.js"),[])},{id:"cpp",name:"C++",aliases:["c++"],import:()=>h(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16]))},{id:"crystal",name:"Crystal",import:()=>h(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28]))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>h(()=>import("./csharp-K5feNrxe.js"),[])},{id:"css",name:"CSS",import:()=>h(()=>import("./css-DPfMkruS.js"),[])},{id:"csv",name:"CSV",import:()=>h(()=>import("./csv-fuZLfV_i.js"),[])},{id:"cue",name:"CUE",import:()=>h(()=>import("./cue-D82EKSYY.js"),[])},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>h(()=>import("./cypher-COkxafJQ.js"),[])},{id:"d",name:"D",import:()=>h(()=>import("./d-85-TOEBH.js"),[])},{id:"dart",name:"Dart",import:()=>h(()=>import("./dart-CF10PKvl.js"),[])},{id:"dax",name:"DAX",import:()=>h(()=>import("./dax-CEL-wOlO.js"),[])},{id:"desktop",name:"Desktop",import:()=>h(()=>import("./desktop-BmXAJ9_W.js"),[])},{id:"diff",name:"Diff",import:()=>h(()=>import("./diff-D97Zzqfu.js"),[])},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>h(()=>import("./docker-BcOcwvcX.js"),[])},{id:"dotenv",name:"dotEnv",import:()=>h(()=>import("./dotenv-Da5cRb03.js"),[])},{id:"dream-maker",name:"Dream Maker",import:()=>h(()=>import("./dream-maker-BtqSS_iP.js"),[])},{id:"edge",name:"Edge",import:()=>h(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15]))},{id:"elixir",name:"Elixir",import:()=>h(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3]))},{id:"elm",name:"Elm",import:()=>h(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26]))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>h(()=>import("./emacs-lisp-C9XAeP06.js"),[])},{id:"erb",name:"ERB",import:()=>h(()=>import("./erb-BOJIQeun.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38]))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>h(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40]))},{id:"fennel",name:"Fennel",import:()=>h(()=>import("./fennel-BYunw83y.js"),[])},{id:"fish",name:"Fish",import:()=>h(()=>import("./fish-BvzEVeQv.js"),[])},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>h(()=>import("./fluent-C4IJs8-o.js"),[])},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>h(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42]))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>h(()=>import("./fortran-free-form-BxgE0vQu.js"),[])},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>h(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40]))},{id:"gdresource",name:"GDResource",import:()=>h(()=>import("./gdresource-B7Tvp0Sc.js"),__vite__mapDeps([44,45,46]))},{id:"gdscript",name:"GDScript",import:()=>h(()=>import("./gdscript-DTMYz4Jt.js"),[])},{id:"gdshader",name:"GDShader",import:()=>h(()=>import("./gdshader-DkwncUOv.js"),[])},{id:"genie",name:"Genie",import:()=>h(()=>import("./genie-D0YGMca9.js"),[])},{id:"gherkin",name:"Gherkin",import:()=>h(()=>import("./gherkin-DyxjwDmM.js"),[])},{id:"git-commit",name:"Git Commit Message",import:()=>h(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48]))},{id:"git-rebase",name:"Git Rebase Message",import:()=>h(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28]))},{id:"gleam",name:"Gleam",import:()=>h(()=>import("./gleam-BspZqrRM.js"),[])},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>h(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1]))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>h(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1]))},{id:"glsl",name:"GLSL",import:()=>h(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26]))},{id:"gn",name:"GN",import:()=>h(()=>import("./gn-n2N0HUVH.js"),[])},{id:"gnuplot",name:"Gnuplot",import:()=>h(()=>import("./gnuplot-DdkO51Og.js"),[])},{id:"go",name:"Go",import:()=>h(()=>import("./go-Dn2_MT6a.js"),[])},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>h(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13]))},{id:"groovy",name:"Groovy",import:()=>h(()=>import("./groovy-gcz8RCvz.js"),[])},{id:"hack",name:"Hack",import:()=>h(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16]))},{id:"haml",name:"Ruby Haml",import:()=>h(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3]))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>h(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38]))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>h(()=>import("./haskell-Df6bDoY_.js"),[])},{id:"haxe",name:"Haxe",import:()=>h(()=>import("./haxe-CzTSHFRz.js"),[])},{id:"hcl",name:"HashiCorp HCL",import:()=>h(()=>import("./hcl-BWvSN4gD.js"),[])},{id:"hjson",name:"Hjson",import:()=>h(()=>import("./hjson-D5-asLiD.js"),[])},{id:"hlsl",name:"HLSL",import:()=>h(()=>import("./hlsl-D3lLCCz7.js"),[])},{id:"html",name:"HTML",import:()=>h(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3]))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>h(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3]))},{id:"http",name:"HTTP",import:()=>h(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13]))},{id:"hurl",name:"Hurl",import:()=>h(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56]))},{id:"hxml",name:"HXML",import:()=>h(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58]))},{id:"hy",name:"Hy",import:()=>h(()=>import("./hy-DFXneXwc.js"),[])},{id:"imba",name:"Imba",import:()=>h(()=>import("./imba-DGztddWO.js"),[])},{id:"ini",name:"INI",aliases:["properties"],import:()=>h(()=>import("./ini-BEwlwnbL.js"),[])},{id:"java",name:"Java",import:()=>h(()=>import("./java-CylS5w8V.js"),[])},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>h(()=>import("./javascript-wDzz0qaB.js"),[])},{id:"jinja",name:"Jinja",import:()=>h(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3]))},{id:"jison",name:"Jison",import:()=>h(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2]))},{id:"json",name:"JSON",import:()=>h(()=>import("./json-Cp-IABpG.js"),[])},{id:"json5",name:"JSON5",import:()=>h(()=>import("./json5-C9tS-k6U.js"),[])},{id:"jsonc",name:"JSON with Comments",import:()=>h(()=>import("./jsonc-Des-eS-w.js"),[])},{id:"jsonl",name:"JSON Lines",import:()=>h(()=>import("./jsonl-DcaNXYhu.js"),[])},{id:"jsonnet",name:"Jsonnet",import:()=>h(()=>import("./jsonnet-DFQXde-d.js"),[])},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>h(()=>import("./jssm-C2t-YnRu.js"),[])},{id:"jsx",name:"JSX",import:()=>h(()=>import("./jsx-g9-lgVsj.js"),[])},{id:"julia",name:"Julia",aliases:["jl"],import:()=>h(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62]))},{id:"kdl",name:"KDL",import:()=>h(()=>import("./kdl-DV7GczEv.js"),[])},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>h(()=>import("./kotlin-BdnUsdx6.js"),[])},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>h(()=>import("./kusto-DZf3V79B.js"),[])},{id:"latex",name:"LaTeX",import:()=>h(()=>import("./latex-B4uzh10-.js"),__vite__mapDeps([63,64,62]))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>h(()=>import("./lean-BZvkOJ9d.js"),[])},{id:"less",name:"Less",import:()=>h(()=>import("./less-B1dDrJ26.js"),[])},{id:"liquid",name:"Liquid",import:()=>h(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9]))},{id:"llvm",name:"LLVM IR",import:()=>h(()=>import("./llvm-BtvRca6l.js"),[])},{id:"log",name:"Log file",import:()=>h(()=>import("./log-2UxHyX5q.js"),[])},{id:"logo",name:"Logo",import:()=>h(()=>import("./logo-BtOb2qkB.js"),[])},{id:"lua",name:"Lua",import:()=>h(()=>import("./lua-BbnMAYS6.js"),__vite__mapDeps([37,26]))},{id:"luau",name:"Luau",import:()=>h(()=>import("./luau-C-HG3fhB.js"),[])},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>h(()=>import("./make-CHLpvVh8.js"),[])},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>h(()=>import("./markdown-Cvjx9yec.js"),[])},{id:"marko",name:"Marko",import:()=>h(()=>import("./marko-DZsq8hO1.js"),__vite__mapDeps([66,3,67,5,11]))},{id:"matlab",name:"MATLAB",import:()=>h(()=>import("./matlab-D7o27uSR.js"),[])},{id:"mdc",name:"MDC",import:()=>h(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3]))},{id:"mdx",name:"MDX",import:()=>h(()=>import("./mdx-Cmh6b_Ma.js"),[])},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>h(()=>import("./mermaid-mWjccvbQ.js"),[])},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>h(()=>import("./mipsasm-CKIfxQSi.js"),[])},{id:"mojo",name:"Mojo",import:()=>h(()=>import("./mojo-B93PlW-d.js"),[])},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:()=>h(()=>import("./moonbit-Ba13S78F.js"),[])},{id:"move",name:"Move",import:()=>h(()=>import("./move-Bu9oaDYs.js"),[])},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>h(()=>import("./narrat-DRg8JJMk.js"),[])},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>h(()=>import("./nextflow-BrzmwbiE.js"),[])},{id:"nginx",name:"Nginx",import:()=>h(()=>import("./nginx-DknmC5AR.js"),__vite__mapDeps([69,37,26]))},{id:"nim",name:"Nim",import:()=>h(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40]))},{id:"nix",name:"Nix",import:()=>h(()=>import("./nix-CwoSXNpI.js"),[])},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>h(()=>import("./nushell-C-sUppwS.js"),[])},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>h(()=>import("./objective-c-DXmwc3jG.js"),[])},{id:"objective-cpp",name:"Objective-C++",import:()=>h(()=>import("./objective-cpp-CLxacb5B.js"),[])},{id:"ocaml",name:"OCaml",import:()=>h(()=>import("./ocaml-C0hk2d4L.js"),[])},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:()=>h(()=>import("./openscad-C4EeE6gA.js"),[])},{id:"pascal",name:"Pascal",import:()=>h(()=>import("./pascal-D93ZcfNL.js"),[])},{id:"perl",name:"Perl",import:()=>h(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16]))},{id:"php",name:"PHP",import:()=>h(()=>import("./php-CDn_0X-4.js"),__vite__mapDeps([72,1,2,3,7,8,16,9]))},{id:"pkl",name:"Pkl",import:()=>h(()=>import("./pkl-u5AG7uiY.js"),[])},{id:"plsql",name:"PL/SQL",import:()=>h(()=>import("./plsql-ChMvpjG-.js"),[])},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>h(()=>import("./po-BTJTHyun.js"),[])},{id:"polar",name:"Polar",import:()=>h(()=>import("./polar-C0HS_06l.js"),[])},{id:"postcss",name:"PostCSS",import:()=>h(()=>import("./postcss-CXtECtnM.js"),[])},{id:"powerquery",name:"PowerQuery",import:()=>h(()=>import("./powerquery-CEu0bR-o.js"),[])},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>h(()=>import("./powershell-Dpen1YoG.js"),[])},{id:"prisma",name:"Prisma",import:()=>h(()=>import("./prisma-Dd19v3D-.js"),[])},{id:"prolog",name:"Prolog",import:()=>h(()=>import("./prolog-CbFg5uaA.js"),[])},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>h(()=>import("./proto-C7zT0LnQ.js"),[])},{id:"pug",name:"Pug",aliases:["jade"],import:()=>h(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1]))},{id:"puppet",name:"Puppet",import:()=>h(()=>import("./puppet-BMWR74SV.js"),[])},{id:"purescript",name:"PureScript",import:()=>h(()=>import("./purescript-CklMAg4u.js"),[])},{id:"python",name:"Python",aliases:["py"],import:()=>h(()=>import("./python-B6aJPvgy.js"),[])},{id:"qml",name:"QML",import:()=>h(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2]))},{id:"qmldir",name:"QML Directory",import:()=>h(()=>import("./qmldir-C8lEn-DE.js"),[])},{id:"qss",name:"Qt Style Sheets",import:()=>h(()=>import("./qss-IeuSbFQv.js"),[])},{id:"r",name:"R",import:()=>h(()=>import("./r-Dspwwk_N.js"),[])},{id:"racket",name:"Racket",import:()=>h(()=>import("./racket-BqYA7rlc.js"),[])},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>h(()=>import("./raku-DXvB9xmW.js"),[])},{id:"razor",name:"ASP.NET Razor",import:()=>h(()=>import("./razor-C1TweQQi.js"),__vite__mapDeps([75,1,2,3,76]))},{id:"reg",name:"Windows Registry Script",import:()=>h(()=>import("./reg-C-SQnVFl.js"),[])},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>h(()=>import("./regexp-CDVJQ6XC.js"),[])},{id:"rel",name:"Rel",import:()=>h(()=>import("./rel-C3B-1QV4.js"),[])},{id:"riscv",name:"RISC-V",import:()=>h(()=>import("./riscv-BM1_JUlF.js"),[])},{id:"rosmsg",name:"ROS Interface",import:()=>h(()=>import("./rosmsg-BJDFO7_C.js"),[])},{id:"rst",name:"reStructuredText",import:()=>h(()=>import("./rst-B0xPkSld.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37]))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>h(()=>import("./ruby-BvKwtOVI.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38]))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>h(()=>import("./rust-B1yitclQ.js"),[])},{id:"sas",name:"SAS",import:()=>h(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16]))},{id:"sass",name:"Sass",import:()=>h(()=>import("./sass-Cj5Yp3dK.js"),[])},{id:"scala",name:"Scala",import:()=>h(()=>import("./scala-C151Ov-r.js"),[])},{id:"scheme",name:"Scheme",import:()=>h(()=>import("./scheme-C98Dy4si.js"),[])},{id:"scss",name:"SCSS",import:()=>h(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3]))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>h(()=>import("./sdbl-DVxCFoDh.js"),[])},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>h(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81]))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>h(()=>import("./shellscript-Yzrsuije.js"),[])},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>h(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28]))},{id:"smalltalk",name:"Smalltalk",import:()=>h(()=>import("./smalltalk-BERRCDM3.js"),[])},{id:"solidity",name:"Solidity",import:()=>h(()=>import("./solidity-rGO070M0.js"),[])},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>h(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3]))},{id:"sparql",name:"SPARQL",import:()=>h(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85]))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>h(()=>import("./splunk-BtCnVYZw.js"),[])},{id:"sql",name:"SQL",import:()=>h(()=>import("./sql-BLtJtn59.js"),[])},{id:"ssh-config",name:"SSH Config",import:()=>h(()=>import("./ssh-config-_ykCGR6B.js"),[])},{id:"stata",name:"Stata",import:()=>h(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>h(()=>import("./stylus-BEDo0Tqx.js"),[])},{id:"svelte",name:"Svelte",import:()=>h(()=>import("./svelte-zxCyuUbr.js"),__vite__mapDeps([87,2,11,3,12]))},{id:"swift",name:"Swift",import:()=>h(()=>import("./swift-Dg5xB15N.js"),[])},{id:"system-verilog",name:"SystemVerilog",import:()=>h(()=>import("./system-verilog-CnnmHF94.js"),[])},{id:"systemd",name:"Systemd Units",import:()=>h(()=>import("./systemd-4A_iFExJ.js"),[])},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>h(()=>import("./talonscript-CkByrt1z.js"),[])},{id:"tasl",name:"Tasl",import:()=>h(()=>import("./tasl-QIJgUcNo.js"),[])},{id:"tcl",name:"Tcl",import:()=>h(()=>import("./tcl-dwOrl1Do.js"),[])},{id:"templ",name:"Templ",import:()=>h(()=>import("./templ-W15q3VgB.js"),__vite__mapDeps([88,89,2,3]))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>h(()=>import("./terraform-BETggiCN.js"),[])},{id:"tex",name:"TeX",import:()=>h(()=>import("./tex-CvyZ59Mk.js"),__vite__mapDeps([64,62]))},{id:"toml",name:"TOML",import:()=>h(()=>import("./toml-vGWfd6FD.js"),[])},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>h(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8]))},{id:"tsv",name:"TSV",import:()=>h(()=>import("./tsv-B_m7g4N7.js"),[])},{id:"tsx",name:"TSX",import:()=>h(()=>import("./tsx-COt5Ahok.js"),[])},{id:"turtle",name:"Turtle",import:()=>h(()=>import("./turtle-BsS91CYL.js"),[])},{id:"twig",name:"Twig",import:()=>h(()=>import("./twig-CO9l9SDP.js"),__vite__mapDeps([91,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38]))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>h(()=>import("./typescript-BPQ3VLAy.js"),[])},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>h(()=>import("./typespec-BGHnOYBU.js"),[])},{id:"typst",name:"Typst",aliases:["typ"],import:()=>h(()=>import("./typst-DHCkPAjA.js"),[])},{id:"v",name:"V",import:()=>h(()=>import("./v-BcVCzyr7.js"),[])},{id:"vala",name:"Vala",import:()=>h(()=>import("./vala-CsfeWuGM.js"),[])},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>h(()=>import("./vb-D17OF-Vu.js"),[])},{id:"verilog",name:"Verilog",import:()=>h(()=>import("./verilog-BQ8w6xss.js"),[])},{id:"vhdl",name:"VHDL",import:()=>h(()=>import("./vhdl-CeAyd5Ju.js"),[])},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>h(()=>import("./viml-CJc9bBzg.js"),[])},{id:"vue",name:"Vue",import:()=>h(()=>import("./vue-DN_0RTcg.js"),__vite__mapDeps([92,3,2,11,9,1,15]))},{id:"vue-html",name:"Vue HTML",import:()=>h(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([93,2]))},{id:"vue-vine",name:"Vue Vine",import:()=>h(()=>import("./vue-vine-CQOfvN7w.js"),__vite__mapDeps([94,3,5,67,95,12,2]))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>h(()=>import("./vyper-CDx5xZoG.js"),[])},{id:"wasm",name:"WebAssembly",import:()=>h(()=>import("./wasm-MzD3tlZU.js"),[])},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>h(()=>import("./wenyan-BV7otONQ.js"),[])},{id:"wgsl",name:"WGSL",import:()=>h(()=>import("./wgsl-Dx-B1_4e.js"),[])},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>h(()=>import("./wikitext-BhOHFoWU.js"),[])},{id:"wit",name:"WebAssembly Interface Types",import:()=>h(()=>import("./wit-5i3qLPDT.js"),[])},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>h(()=>import("./wolfram-lXgVvXCa.js"),[])},{id:"xml",name:"XML",import:()=>h(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8]))},{id:"xsl",name:"XSL",import:()=>h(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([96,7,8]))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>h(()=>import("./yaml-Buea-lGh.js"),[])},{id:"zenscript",name:"ZenScript",import:()=>h(()=>import("./zenscript-DVFEvuxE.js"),[])},{id:"zig",name:"Zig",import:()=>h(()=>import("./zig-VOosw3JB.js"),[])}],ev=Object.fromEntries(Op.map(e=>[e.id,e.import])),tv=Object.fromEntries(Op.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.import]))||[]})),nv={...ev,...tv},rv=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>h(()=>import("./andromeeda-C-Jbm3Hp.js"),[])},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>h(()=>import("./aurora-x-D-2ljcwZ.js"),[])},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>h(()=>import("./ayu-dark-CmMr59Fi.js"),[])},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>h(()=>import("./catppuccin-frappe-DFWUc33u.js"),[])},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>h(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[])},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>h(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[])},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>h(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[])},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>h(()=>import("./dark-plus-C3mMm8J8.js"),[])},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>h(()=>import("./dracula-BzJJZx-M.js"),[])},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>h(()=>import("./dracula-soft-BXkSAIEj.js"),[])},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>h(()=>import("./everforest-dark-BgDCqdQA.js"),[])},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>h(()=>import("./everforest-light-C8M2exoo.js"),[])},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>h(()=>import("./github-dark-DHJKELXO.js"),[])},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>h(()=>import("./github-dark-default-Cuk6v7N8.js"),[])},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>h(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[])},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>h(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[])},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>h(()=>import("./github-light-DAi9KRSo.js"),[])},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>h(()=>import("./github-light-default-D7oLnXFd.js"),[])},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>h(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[])},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>h(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[])},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>h(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[])},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>h(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[])},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>h(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[])},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>h(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[])},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>h(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[])},{id:"houston",displayName:"Houston",type:"dark",import:()=>h(()=>import("./houston-DnULxvSX.js"),[])},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>h(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[])},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>h(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[])},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>h(()=>import("./kanagawa-wave-DWedfzmr.js"),[])},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>h(()=>import("./laserwave-DUszq2jm.js"),[])},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>h(()=>import("./light-plus-B7mTdjB0.js"),[])},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>h(()=>import("./material-theme-D5KoaKCx.js"),[])},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>h(()=>import("./material-theme-darker-BfHTSMKl.js"),[])},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>h(()=>import("./material-theme-lighter-B0m2ddpp.js"),[])},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>h(()=>import("./material-theme-ocean-CyktbL80.js"),[])},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>h(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[])},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>h(()=>import("./min-dark-CafNBF8u.js"),[])},{id:"min-light",displayName:"Min Light",type:"light",import:()=>h(()=>import("./min-light-CTRr51gU.js"),[])},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>h(()=>import("./monokai-D4h5O-jR.js"),[])},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>h(()=>import("./night-owl-C39BiMTA.js"),[])},{id:"nord",displayName:"Nord",type:"dark",import:()=>h(()=>import("./nord-Ddv68eIx.js"),[])},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>h(()=>import("./one-dark-pro-DVMEJ2y_.js"),[])},{id:"one-light",displayName:"One Light",type:"light",import:()=>h(()=>import("./one-light-PoHY5YXO.js"),[])},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>h(()=>import("./plastic-3e1v2bzS.js"),[])},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>h(()=>import("./poimandres-CS3Unz2-.js"),[])},{id:"red",displayName:"Red",type:"dark",import:()=>h(()=>import("./red-bN70gL4F.js"),[])},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>h(()=>import("./rose-pine-qdsjHGoJ.js"),[])},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>h(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[])},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>h(()=>import("./rose-pine-moon-D4_iv3hh.js"),[])},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>h(()=>import("./slack-dark-BthQWCQV.js"),[])},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>h(()=>import("./slack-ochin-DqwNpetd.js"),[])},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>h(()=>import("./snazzy-light-Bw305WKR.js"),[])},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>h(()=>import("./solarized-dark-DXbdFlpD.js"),[])},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>h(()=>import("./solarized-light-L9t79GZl.js"),[])},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>h(()=>import("./synthwave-84-CbfX1IO0.js"),[])},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>h(()=>import("./tokyo-night-hegEt444.js"),[])},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>h(()=>import("./vesper-DU1UobuO.js"),[])},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>h(()=>import("./vitesse-black-Bkuqu6BP.js"),[])},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>h(()=>import("./vitesse-dark-D0r3Knsf.js"),[])},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>h(()=>import("./vitesse-light-CVO1_9PV.js"),[])}],iv=Object.fromEntries(rv.map(e=>[e.id,e.import]));class Ba extends Error{constructor(t){super(t),this.name="ShikiError"}}function ov(){return 2147483648}function lv(){return typeof performance<"u"?performance.now():Date.now()}const sv=(e,t)=>e+(t-e%t)%t;async function av(e){let t,n;const r={};function i(p){n=p,r.HEAPU8=new Uint8Array(p),r.HEAPU32=new Uint32Array(p)}function o(p,y,v){r.HEAPU8.copyWithin(p,y,y+v)}function l(p){try{return t.grow(p-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(p){const y=r.HEAPU8.length;p=p>>>0;const v=ov();if(p>v)return!1;for(let L=1;L<=4;L*=2){let g=y*(1+.2/L);g=Math.min(g,p+100663296);const m=Math.min(v,sv(Math.max(p,g),65536));if(l(m))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(p,y,v=1024){const L=y+v;let g=y;for(;p[g]&&!(g>=L);)++g;if(g-y>16&&p.buffer&&a)return a.decode(p.subarray(y,g));let m="";for(;y<g;){let _=p[y++];if(!(_&128)){m+=String.fromCharCode(_);continue}const E=p[y++]&63;if((_&224)===192){m+=String.fromCharCode((_&31)<<6|E);continue}const C=p[y++]&63;if((_&240)===224?_=(_&15)<<12|E<<6|C:_=(_&7)<<18|E<<12|C<<6|p[y++]&63,_<65536)m+=String.fromCharCode(_);else{const R=_-65536;m+=String.fromCharCode(55296|R>>10,56320|R&1023)}}return m}function c(p,y){return p?u(r.HEAPU8,p,y):""}const d={emscripten_get_now:lv,emscripten_memcpy_big:o,emscripten_resize_heap:s,fd_write:()=>0};async function f(){const y=await e({env:d,wasi_snapshot_preview1:d});t=y.memory,i(t.buffer),Object.assign(r,y),r.UTF8ToString=c}return await f(),r}var uv=Object.defineProperty,cv=(e,t,n)=>t in e?uv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,le=(e,t,n)=>cv(e,typeof t!="symbol"?t+"":t,n);let ce=null;function dv(e){throw new Ba(e.UTF8ToString(e.getLastOnigError()))}class jo{constructor(t){le(this,"utf16Length"),le(this,"utf8Length"),le(this,"utf16Value"),le(this,"utf8Value"),le(this,"utf16OffsetToUtf8"),le(this,"utf8OffsetToUtf16");const n=t.length,r=jo._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const l=i?new Uint32Array(r+1):null;i&&(l[r]=n);const s=new Uint8Array(r);let a=0;for(let u=0;u<n;u++){const c=t.charCodeAt(u);let d=c,f=!1;if(c>=55296&&c<=56319&&u+1<n){const p=t.charCodeAt(u+1);p>=56320&&p<=57343&&(d=(c-55296<<10)+65536|p-56320,f=!0)}i&&(o[u]=a,f&&(o[u+1]=a),d<=127?l[a+0]=u:d<=2047?(l[a+0]=u,l[a+1]=u):d<=65535?(l[a+0]=u,l[a+1]=u,l[a+2]=u):(l[a+0]=u,l[a+1]=u,l[a+2]=u,l[a+3]=u)),d<=127?s[a++]=d:d<=2047?(s[a++]=192|(d&1984)>>>6,s[a++]=128|(d&63)>>>0):d<=65535?(s[a++]=224|(d&61440)>>>12,s[a++]=128|(d&4032)>>>6,s[a++]=128|(d&63)>>>0):(s[a++]=240|(d&1835008)>>>18,s[a++]=128|(d&258048)>>>12,s[a++]=128|(d&4032)>>>6,s[a++]=128|(d&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=l}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r<i;r++){const o=t.charCodeAt(r);let l=o,s=!1;if(o>=55296&&o<=56319&&r+1<i){const a=t.charCodeAt(r+1);a>=56320&&a<=57343&&(l=(o-55296<<10)+65536|a-56320,s=!0)}l<=127?n+=1:l<=2047?n+=2:l<=65535?n+=3:n+=4,s&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Fo=class lt{constructor(t){if(le(this,"id",++lt.LAST_ID),le(this,"_onigBinding"),le(this,"content"),le(this,"utf16Length"),le(this,"utf8Length"),le(this,"utf16OffsetToUtf8"),le(this,"utf8OffsetToUtf16"),le(this,"ptr"),!ce)throw new Ba("Must invoke loadWasm first.");this._onigBinding=ce,this.content=t;const n=new jo(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!lt._sharedPtrInUse?(lt._sharedPtr||(lt._sharedPtr=ce.omalloc(1e4)),lt._sharedPtrInUse=!0,ce.HEAPU8.set(n.utf8Value,lt._sharedPtr),this.ptr=lt._sharedPtr):this.ptr=n.createString(ce)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===lt._sharedPtr?lt._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};le(Fo,"LAST_ID",0);le(Fo,"_sharedPtr",0);le(Fo,"_sharedPtrInUse",!1);let Mp=Fo;class fv{constructor(t){if(le(this,"_onigBinding"),le(this,"_ptr"),!ce)throw new Ba("Must invoke loadWasm first.");const n=[],r=[];for(let s=0,a=t.length;s<a;s++){const u=new jo(t[s]);n[s]=u.createString(ce),r[s]=u.utf8Length}const i=ce.omalloc(4*t.length);ce.HEAPU32.set(n,i/4);const o=ce.omalloc(4*t.length);ce.HEAPU32.set(r,o/4);const l=ce.createOnigScanner(i,o,t.length);for(let s=0,a=t.length;s<a;s++)ce.ofree(n[s]);ce.ofree(o),ce.ofree(i),l===0&&dv(ce),this._onigBinding=ce,this._ptr=l}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof t=="string"){t=new Mp(t);const o=this._findNextMatchSync(t,n,!1,i);return t.dispose(),o}return this._findNextMatchSync(t,n,!1,i)}_findNextMatchSync(t,n,r,i){const o=this._onigBinding,l=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),i);if(l===0)return null;const s=o.HEAPU32;let a=l/4;const u=s[a++],c=s[a++],d=[];for(let f=0;f<c;f++){const p=t.convertUtf8OffsetToUtf16(s[a++]),y=t.convertUtf8OffsetToUtf16(s[a++]);d[f]={start:p,end:y,length:y-p}}return{index:u,captureIndices:d}}}function pv(e){return typeof e.instantiator=="function"}function hv(e){return typeof e.default=="function"}function mv(e){return typeof e.data<"u"}function gv(e){return typeof Response<"u"&&e instanceof Response}function _v(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let _i;function yv(e){if(_i)return _i;async function t(){ce=await av(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),pv(r)?r=await r.instantiator(n):hv(r)?r=await r.default(n):(mv(r)&&(r=r.data),gv(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await vv(r)(n):r=await Ev(r)(n):_v(r)?r=await Sl(r)(n):r instanceof WebAssembly.Module?r=await Sl(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Sl(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return _i=t(),_i}function Sl(e){return t=>WebAssembly.instantiate(e,t)}function vv(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Ev(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Sv(e){return e&&await yv(e),{createScanner(t){return new fv(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Mp(t)}}}const wv=Z0({langs:nv,themes:iv,engine:()=>Sv(h(()=>import("./wasm-CG6Dc4jp.js"),[]))});let wl=null;const kv={plaintext:"text",text:"text",javascript:"javascript",typescript:"typescript",jsx:"jsx",tsx:"tsx",rust:"rust",go:"go",c:"c",cpp:"cpp",java:"java",kotlin:"kotlin",scala:"scala",groovy:"groovy",python:"python",ruby:"ruby",php:"php",perl:"perl",lua:"lua",swift:"swift","objective-c":"objective-c","objective-cpp":"objective-cpp",dart:"dart",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",vue:"vue",svelte:"svelte",astro:"astro",json:"json",jsonc:"jsonc",yaml:"yaml",toml:"toml",xml:"xml",csv:"csv",markdown:"markdown",mdx:"mdx",rst:"rst",latex:"latex",bash:"bash",fish:"fish",powershell:"powershell",batch:"bat",sql:"sql",prisma:"prisma",graphql:"graphql",ini:"ini",dotenv:"dotenv",dockerfile:"dockerfile",makefile:"makefile",cmake:"cmake",gitignore:"gitignore",gitattributes:"gitattributes",diff:"diff",editorconfig:"editorconfig",csharp:"csharp"};async function Cv(){return wl||(wl=wv({themes:["github-dark"],langs:["typescript","javascript","tsx","jsx","python","rust","go","java","kotlin","swift","c","cpp","csharp","php","ruby","html","css","scss","less","json","yaml","markdown","sql","bash","dockerfile","makefile","xml","vue","svelte","graphql","toml","ini","diff","gitignore"]})),wl}function Lv(e){const t=e.toLowerCase();return kv[t]||t}function Pv(e){return e.map(t=>({content:t.content,color:t.color||"#e6edf3",fontStyle:t.fontStyle===1?"italic":t.fontStyle===2?"bold":void 0}))}function Av({code:e,language:t}){const[n,r]=M.useState([]),[i,o]=M.useState(!0),[l,s]=M.useState(null);return M.useEffect(()=>{let a=!1;async function u(){try{o(!0);const c=await Cv();if(a)return;const d=Lv(t),f=c.getLoadedLanguages(),p=f.includes(d)?d:"text";if(!f.includes(d)&&d!=="text")try{await c.loadLanguage(d)}catch{}const y=c.codeToTokens(e,{lang:p,theme:"github-dark"});if(a)return;const v=y.tokens.map((L,g)=>({lineNumber:g+1,tokens:Pv(L)}));r(v),s(null)}catch(c){if(!a){console.error("Shiki highlighting error:",c),s(c);const d=e.split(`
154
- `).map((f,p)=>({lineNumber:p+1,tokens:[{content:f||" ",color:"#e6edf3"}]}));r(d)}}finally{a||o(!1)}}return u(),()=>{a=!0}},[e,t]),{lines:n,loading:i,error:l}}function Rv({filePath:e,enabled:t}){const[n,r]=M.useState(null),[i,o]=M.useState(!1),[l,s]=M.useState(null);return M.useEffect(()=>{if(!t||!e){r(null);return}let a=!1;async function u(){try{o(!0),s(null);const c=await at.getFileDiff(e);a||r(c)}catch(c){a||(console.error("Failed to fetch diff:",c),s(c),r(null))}finally{a||o(!1)}}return u(),()=>{a=!0}},[e,t]),{diff:n,loading:i,error:l}}function xv(e){const[t,n]=M.useState(!1),[r,i]=M.useState(null),[o,l]=M.useState(null),s=M.useCallback(c=>{n(!0),i(c),l({startLine:c,endLine:c})},[]),a=M.useCallback(c=>{if(!t||r===null)return;const d=Math.min(r,c),f=Math.max(r,c);l({startLine:d,endLine:f})},[t,r]),u=M.useCallback(()=>{t&&o&&e&&e(o),n(!1)},[t,o,e]);return{selecting:t,selection:o,handlers:{onMouseDown:s,onMouseMove:a,onMouseUp:u}}}function Rs({lineNumber:e,tokens:t,selected:n,diffType:r,handlers:i}){const o=r==="add"?"code-line-added":r==="delete"?"code-line-deleted":"";return S.jsxs("div",{className:`code-line ${n?"code-line-selected":""} ${o}`,onMouseDown:()=>i.onMouseDown(e),onMouseMove:()=>i.onMouseMove(e),onMouseUp:i.onMouseUp,children:[S.jsx("span",{className:"line-number",children:e}),S.jsx("span",{className:"code-content",children:t.map((l,s)=>S.jsx("span",{style:{color:l.color,fontStyle:l.fontStyle==="italic"?"italic":void 0,fontWeight:l.fontStyle==="bold"?"bold":void 0},children:l.content},s))})]})}function Tv({lines:e,diffLines:t,selection:n,handlers:r}){const i=o=>n?o>=n.startLine&&o<=n.endLine:!1;return S.jsx(S.Fragment,{children:e.map(o=>S.jsx(Rs,{lineNumber:o.lineNumber,tokens:o.tokens,selected:i(o.lineNumber),diffType:t.get(o.lineNumber),handlers:r},o.lineNumber))})}function Iv({originalLines:e,modifiedLines:t,diffData:n}){const r=M.useMemo(()=>{const i=[],o=new Map(e.map(s=>[s.lineNumber,s.tokens])),l=new Map(t.map(s=>[s.lineNumber,s.tokens]));for(const s of n)s.type==="context"?i.push({left:{lineNumber:s.oldLineNumber,tokens:o.get(s.oldLineNumber)||[{content:s.content,color:"#e6edf3"}],type:"context"},right:{lineNumber:s.newLineNumber,tokens:l.get(s.newLineNumber)||[{content:s.content,color:"#e6edf3"}],type:"context"}}):s.type==="delete"?i.push({left:{lineNumber:s.oldLineNumber,tokens:o.get(s.oldLineNumber)||[{content:s.content,color:"#e6edf3"}],type:"delete"},right:null}):s.type==="add"&&i.push({left:null,right:{lineNumber:s.newLineNumber,tokens:l.get(s.newLineNumber)||[{content:s.content,color:"#e6edf3"}],type:"add"}});return i},[e,t,n]);return r.length===0?S.jsx("div",{className:"code-viewer-empty",children:S.jsx("p",{children:"No changes in this file"})}):S.jsxs("div",{className:"diff-side-by-side",children:[S.jsxs("div",{className:"diff-pane diff-pane-left",children:[S.jsx("div",{className:"diff-pane-header",children:"Original"}),S.jsx("div",{className:"code-viewer-content",children:r.map((i,o)=>{var l,s,a;return S.jsxs("div",{className:`code-line ${((l=i.left)==null?void 0:l.type)==="delete"?"code-line-deleted":""}`,children:[S.jsx("span",{className:"line-number",children:((s=i.left)==null?void 0:s.lineNumber)||""}),S.jsx("span",{className:"code-content",children:((a=i.left)==null?void 0:a.tokens.map((u,c)=>S.jsx("span",{style:{color:u.color},children:u.content},c)))||" "})]},o)})})]}),S.jsxs("div",{className:"diff-pane diff-pane-right",children:[S.jsx("div",{className:"diff-pane-header",children:"Modified"}),S.jsx("div",{className:"code-viewer-content",children:r.map((i,o)=>{var l,s,a;return S.jsxs("div",{className:`code-line ${((l=i.right)==null?void 0:l.type)==="add"?"code-line-added":""}`,children:[S.jsx("span",{className:"line-number",children:((s=i.right)==null?void 0:s.lineNumber)||""}),S.jsx("span",{className:"code-content",children:((a=i.right)==null?void 0:a.tokens.map((u,c)=>S.jsx("span",{style:{color:u.color},children:u.content},c)))||" "})]},o)})})]})]})}function Dv(){const{currentFile:e,selection:t,setSelection:n}=No(),{diffViewMode:r}=Oo(),{handlers:i}=xv(p=>{n(p)}),{lines:o,loading:l}=Av({code:(e==null?void 0:e.content)||"",language:(e==null?void 0:e.language)||"text"}),{diff:s,loading:a}=Rv({filePath:(e==null?void 0:e.path)||null,enabled:r!=="none"}),u=M.useMemo(()=>{const p=new Map;if(!s||s.hunks.length===0)return p;for(const y of s.hunks)for(const v of y.lines)v.type==="add"&&v.newLineNumber?p.set(v.newLineNumber,"add"):v.type==="delete"&&v.oldLineNumber;return p},[s]),c=M.useMemo(()=>!s||s.hunks.length===0?[]:s.hunks.flatMap(p=>p.lines),[s]);if(!e)return S.jsxs("div",{className:"code-viewer code-viewer-empty",children:[S.jsx(Lg,{size:48,className:"empty-state-icon"}),S.jsx("p",{children:"Select a file to view its contents"}),S.jsxs("p",{className:"hint",children:[S.jsx(Og,{size:12}),"Use Cmd+P or / to search for files"]})]});const d=l||a;if(r==="side-by-side")return S.jsxs("div",{className:"code-viewer",children:[S.jsxs("div",{className:"code-viewer-header",children:[S.jsx("span",{className:"file-path",children:e.path}),S.jsxs("span",{className:"file-language",children:["Side by Side - ",e.language]})]}),d?S.jsx("div",{className:"code-viewer-loading",children:"Loading..."}):c.length>0?S.jsx(Iv,{originalLines:o,modifiedLines:o,diffData:c}):S.jsx("div",{className:"code-viewer-content",children:o.map(p=>S.jsx(Rs,{lineNumber:p.lineNumber,tokens:p.tokens,selected:!1,handlers:i},p.lineNumber))})]});if(r==="inline")return S.jsxs("div",{className:"code-viewer",children:[S.jsxs("div",{className:"code-viewer-header",children:[S.jsx("span",{className:"file-path",children:e.path}),S.jsxs("span",{className:"file-language",children:["Inline Diff - ",e.language]})]}),S.jsx("div",{className:"code-viewer-content",children:d?S.jsx("div",{className:"code-viewer-loading",children:"Loading..."}):S.jsx(Tv,{lines:o,diffLines:u,selection:t,handlers:i})})]});const f=p=>t?p>=t.startLine&&p<=t.endLine:!1;return S.jsxs("div",{className:"code-viewer",children:[S.jsxs("div",{className:"code-viewer-header",children:[S.jsx("span",{className:"file-path",children:e.path}),S.jsx("span",{className:"file-language",children:e.language})]}),S.jsx("div",{className:"code-viewer-content",children:d?S.jsx("div",{className:"code-viewer-loading",children:"Loading..."}):o.map(p=>S.jsx(Rs,{lineNumber:p.lineNumber,tokens:p.tokens,selected:f(p.lineNumber),handlers:i},p.lineNumber))})]})}let Nv=1;const Vp=xa(e=>({items:[],addItem:t=>e(n=>({items:[...n.items,{...t,id:`staged-${Nv++}`}]})),removeItem:t=>e(n=>({items:n.items.filter(r=>r.id!==t)})),clear:()=>e({items:[]})}));function Ov(){const{items:e,removeItem:t,clear:n}=Vp(),r=(i,o,l)=>{const s=i.split("/").pop()||i;return o===l?`${s}:${o}`:`${s}:${o}-${l}`};return e.length===0?S.jsxs("div",{className:"staging-list staging-list-empty",children:[S.jsx("div",{className:"staging-header",children:"Staged Selections"}),S.jsxs("div",{className:"empty-state",children:[S.jsx(Ig,{size:32,className:"empty-state-icon"}),S.jsx("p",{className:"staging-hint",children:"Select lines in the code viewer and add a comment to stage them"})]})]}):S.jsxs("div",{className:"staging-list",children:[S.jsxs("div",{className:"staging-header",children:[S.jsxs("span",{children:["Staged Selections (",e.length,")"]}),S.jsx("button",{className:"btn-link",onClick:n,children:"Clear all"})]}),S.jsx("div",{className:"staging-items",children:e.map(i=>S.jsxs("div",{className:"staging-item",children:[S.jsxs("div",{className:"staging-item-header",children:[S.jsx("span",{className:"staging-location",children:r(i.filePath,i.startLine,i.endLine)}),S.jsx("button",{className:"btn-icon",onClick:()=>t(i.id),title:"Remove",children:S.jsx(Mg,{size:14})})]}),S.jsx("div",{className:"staging-comment",children:i.comment})]},i.id))})]})}function Mv({selection:e,currentFilePath:t,onSubmit:n,onCancel:r}){const[i,o]=M.useState(""),l=M.useRef(null);M.useEffect(()=>{var c;e&&((c=l.current)==null||c.focus())},[e]),M.useEffect(()=>{e||o("")},[e]);const s=c=>{c.preventDefault(),!(!e||!i.trim())&&(n(i.trim()),o(""))},a=c=>{c.key==="Escape"&&(c.preventDefault(),r())},u=()=>{if(!e||!t)return"";const c=t.split("/").pop()||t;return e.startLine===e.endLine?`${c}:${e.startLine}`:`${c}:${e.startLine}-${e.endLine}`};return S.jsx("form",{className:"comment-input",onSubmit:s,children:e?S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"comment-selection",children:u()}),S.jsx("input",{ref:l,type:"text",className:"comment-field",placeholder:"Add comment and press Enter...",value:i,onChange:c=>o(c.target.value),onKeyDown:a}),S.jsx("button",{type:"submit",className:"btn btn-small btn-primary",disabled:!i.trim(),children:"Add"})]}):S.jsx("span",{className:"comment-hint",children:"Select lines in the code viewer to add a comment"})})}function Ct(e){return Array.isArray?Array.isArray(e):zp(e)==="[object Array]"}function Vv(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function jv(e){return e==null?"":Vv(e)}function ct(e){return typeof e=="string"}function jp(e){return typeof e=="number"}function Fv(e){return e===!0||e===!1||zv(e)&&zp(e)=="[object Boolean]"}function Fp(e){return typeof e=="object"}function zv(e){return Fp(e)&&e!==null}function Me(e){return e!=null}function kl(e){return!e.trim().length}function zp(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Bv="Incorrect 'index' type",bv=e=>`Invalid value for key ${e}`,$v=e=>`Pattern length exceeds max of ${e}.`,Uv=e=>`Missing ${e} property in key`,Gv=e=>`Property 'weight' in key '${e}' must be a positive integer`,kc=Object.prototype.hasOwnProperty;class Hv{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let i=Bp(r);this._keys.push(i),this._keyMap[i.id]=i,n+=i.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Bp(e){let t=null,n=null,r=null,i=1,o=null;if(ct(e)||Ct(e))r=e,t=Cc(e),n=xs(e);else{if(!kc.call(e,"name"))throw new Error(Uv("name"));const l=e.name;if(r=l,kc.call(e,"weight")&&(i=e.weight,i<=0))throw new Error(Gv(l));t=Cc(l),n=xs(l),o=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:o}}function Cc(e){return Ct(e)?e:e.split(".")}function xs(e){return Ct(e)?e.join("."):e}function Wv(e,t){let n=[],r=!1;const i=(o,l,s)=>{if(Me(o))if(!l[s])n.push(o);else{let a=l[s];const u=o[a];if(!Me(u))return;if(s===l.length-1&&(ct(u)||jp(u)||Fv(u)))n.push(jv(u));else if(Ct(u)){r=!0;for(let c=0,d=u.length;c<d;c+=1)i(u[c],l,s+1)}else l.length&&i(u,l,s+1)}};return i(e,ct(t)?t.split("."):t,0),r?n:n[0]}const Kv={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Qv={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},qv={location:0,threshold:.6,distance:100},Yv={useExtendedSearch:!1,getFn:Wv,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var N={...Qv,...Kv,...qv,...Yv};const Xv=/[^ ]+/g;function Jv(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(i){const o=i.match(Xv).length;if(n.has(o))return n.get(o);const l=1/Math.pow(o,.5*e),s=parseFloat(Math.round(l*r)/r);return n.set(o,s),s},clear(){n.clear()}}}class ba{constructor({getFn:t=N.getFn,fieldNormWeight:n=N.fieldNormWeight}={}){this.norm=Jv(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ct(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();ct(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!Me(t)||kl(t))return;let r={v:t,i:n,n:this.norm.get(t)};this.records.push(r)}_addObject(t,n){let r={i:n,$:{}};this.keys.forEach((i,o)=>{let l=i.getFn?i.getFn(t):this.getFn(t,i.path);if(Me(l)){if(Ct(l)){let s=[];const a=[{nestedArrIndex:-1,value:l}];for(;a.length;){const{nestedArrIndex:u,value:c}=a.pop();if(Me(c))if(ct(c)&&!kl(c)){let d={v:c,i:u,n:this.norm.get(c)};s.push(d)}else Ct(c)&&c.forEach((d,f)=>{a.push({nestedArrIndex:f,value:d})})}r.$[o]=s}else if(ct(l)&&!kl(l)){let s={v:l,n:this.norm.get(l)};r.$[o]=s}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function bp(e,t,{getFn:n=N.getFn,fieldNormWeight:r=N.fieldNormWeight}={}){const i=new ba({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(Bp)),i.setSources(t),i.create(),i}function Zv(e,{getFn:t=N.getFn,fieldNormWeight:n=N.fieldNormWeight}={}){const{keys:r,records:i}=e,o=new ba({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(i),o}function yi(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=N.distance,ignoreLocation:o=N.ignoreLocation}={}){const l=t/e.length;if(o)return l;const s=Math.abs(r-n);return i?l+s/i:s?1:l}function e1(e=[],t=N.minMatchCharLength){let n=[],r=-1,i=-1,o=0;for(let l=e.length;o<l;o+=1){let s=e[o];s&&r===-1?r=o:!s&&r!==-1&&(i=o-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}const Jt=32;function t1(e,t,n,{location:r=N.location,distance:i=N.distance,threshold:o=N.threshold,findAllMatches:l=N.findAllMatches,minMatchCharLength:s=N.minMatchCharLength,includeMatches:a=N.includeMatches,ignoreLocation:u=N.ignoreLocation}={}){if(t.length>Jt)throw new Error($v(Jt));const c=t.length,d=e.length,f=Math.max(0,Math.min(r,d));let p=o,y=f;const v=s>1||a,L=v?Array(d):[];let g;for(;(g=e.indexOf(t,y))>-1;){let k=yi(t,{currentLocation:g,expectedLocation:f,distance:i,ignoreLocation:u});if(p=Math.min(k,p),y=g+c,v){let x=0;for(;x<c;)L[g+x]=1,x+=1}}y=-1;let m=[],_=1,E=c+d;const C=1<<c-1;for(let k=0;k<c;k+=1){let x=0,O=E;for(;x<O;)yi(t,{errors:k,currentLocation:f+O,expectedLocation:f,distance:i,ignoreLocation:u})<=p?x=O:E=O,O=Math.floor((E-x)/2+x);E=O;let D=Math.max(1,f-O+1),X=l?d:Math.min(f+O,d)+c,ie=Array(X+2);ie[X+1]=(1<<k)-1;for(let W=X;W>=D;W-=1){let De=W-1,rt=n[e.charAt(De)];if(v&&(L[De]=+!!rt),ie[W]=(ie[W+1]<<1|1)&rt,k&&(ie[W]|=(m[W+1]|m[W])<<1|1|m[W+1]),ie[W]&C&&(_=yi(t,{errors:k,currentLocation:De,expectedLocation:f,distance:i,ignoreLocation:u}),_<=p)){if(p=_,y=De,y<=f)break;D=Math.max(1,2*f-y)}}if(yi(t,{errors:k+1,currentLocation:f,expectedLocation:f,distance:i,ignoreLocation:u})>p)break;m=ie}const R={isMatch:y>=0,score:Math.max(.001,_)};if(v){const k=e1(L,s);k.length?a&&(R.indices=k):R.isMatch=!1}return R}function n1(e){let t={};for(let n=0,r=e.length;n<r;n+=1){const i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}const ho=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class $p{constructor(t,{location:n=N.location,threshold:r=N.threshold,distance:i=N.distance,includeMatches:o=N.includeMatches,findAllMatches:l=N.findAllMatches,minMatchCharLength:s=N.minMatchCharLength,isCaseSensitive:a=N.isCaseSensitive,ignoreDiacritics:u=N.ignoreDiacritics,ignoreLocation:c=N.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:i,includeMatches:o,findAllMatches:l,minMatchCharLength:s,isCaseSensitive:a,ignoreDiacritics:u,ignoreLocation:c},t=a?t:t.toLowerCase(),t=u?ho(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const d=(p,y)=>{this.chunks.push({pattern:p,alphabet:n1(p),startIndex:y})},f=this.pattern.length;if(f>Jt){let p=0;const y=f%Jt,v=f-y;for(;p<v;)d(this.pattern.substr(p,Jt),p),p+=Jt;if(y){const L=f-Jt;d(this.pattern.substr(L),L)}}else d(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:i}=this.options;if(t=n?t:t.toLowerCase(),t=r?ho(t):t,this.pattern===t){let v={isMatch:!0,score:0};return i&&(v.indices=[[0,t.length-1]]),v}const{location:o,distance:l,threshold:s,findAllMatches:a,minMatchCharLength:u,ignoreLocation:c}=this.options;let d=[],f=0,p=!1;this.chunks.forEach(({pattern:v,alphabet:L,startIndex:g})=>{const{isMatch:m,score:_,indices:E}=t1(t,v,L,{location:o+g,distance:l,threshold:s,findAllMatches:a,minMatchCharLength:u,includeMatches:i,ignoreLocation:c});m&&(p=!0),f+=_,m&&E&&(d=[...d,...E])});let y={isMatch:p,score:p?f/this.chunks.length:1};return p&&i&&(y.indices=d),y}}class Kt{constructor(t){this.pattern=t}static isMultiMatch(t){return Lc(t,this.multiRegex)}static isSingleMatch(t){return Lc(t,this.singleRegex)}search(){}}function Lc(e,t){const n=e.match(t);return n?n[1]:null}class r1 extends Kt{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class i1 extends Kt{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class o1 extends Kt{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class l1 extends Kt{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class s1 extends Kt{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class a1 extends Kt{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Up extends Kt{constructor(t,{location:n=N.location,threshold:r=N.threshold,distance:i=N.distance,includeMatches:o=N.includeMatches,findAllMatches:l=N.findAllMatches,minMatchCharLength:s=N.minMatchCharLength,isCaseSensitive:a=N.isCaseSensitive,ignoreDiacritics:u=N.ignoreDiacritics,ignoreLocation:c=N.ignoreLocation}={}){super(t),this._bitapSearch=new $p(t,{location:n,threshold:r,distance:i,includeMatches:o,findAllMatches:l,minMatchCharLength:s,isCaseSensitive:a,ignoreDiacritics:u,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Gp extends Kt{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const i=[],o=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+o,i.push([r,n-1]);const l=!!i.length;return{isMatch:l,score:l?0:1,indices:i}}}const Ts=[r1,Gp,o1,l1,a1,s1,i1,Up],Pc=Ts.length,u1=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,c1="|";function d1(e,t={}){return e.split(c1).map(n=>{let r=n.trim().split(u1).filter(o=>o&&!!o.trim()),i=[];for(let o=0,l=r.length;o<l;o+=1){const s=r[o];let a=!1,u=-1;for(;!a&&++u<Pc;){const c=Ts[u];let d=c.isMultiMatch(s);d&&(i.push(new c(d,t)),a=!0)}if(!a)for(u=-1;++u<Pc;){const c=Ts[u];let d=c.isSingleMatch(s);if(d){i.push(new c(d,t));break}}}return i})}const f1=new Set([Up.type,Gp.type]);class p1{constructor(t,{isCaseSensitive:n=N.isCaseSensitive,ignoreDiacritics:r=N.ignoreDiacritics,includeMatches:i=N.includeMatches,minMatchCharLength:o=N.minMatchCharLength,ignoreLocation:l=N.ignoreLocation,findAllMatches:s=N.findAllMatches,location:a=N.location,threshold:u=N.threshold,distance:c=N.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:i,minMatchCharLength:o,findAllMatches:s,ignoreLocation:l,location:a,threshold:u,distance:c},t=n?t:t.toLowerCase(),t=r?ho(t):t,this.pattern=t,this.query=d1(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:i,ignoreDiacritics:o}=this.options;t=i?t:t.toLowerCase(),t=o?ho(t):t;let l=0,s=[],a=0;for(let u=0,c=n.length;u<c;u+=1){const d=n[u];s.length=0,l=0;for(let f=0,p=d.length;f<p;f+=1){const y=d[f],{isMatch:v,indices:L,score:g}=y.search(t);if(v){if(l+=1,a+=g,r){const m=y.constructor.type;f1.has(m)?s=[...s,...L]:s.push(L)}}else{a=0,l=0,s.length=0;break}}if(l){let f={isMatch:!0,score:a/l};return r&&(f.indices=s),f}}return{isMatch:!1,score:1}}}const Is=[];function h1(...e){Is.push(...e)}function Ds(e,t){for(let n=0,r=Is.length;n<r;n+=1){let i=Is[n];if(i.condition(e,t))return new i(e,t)}return new $p(e,t)}const mo={AND:"$and",OR:"$or"},Ns={PATH:"$path",PATTERN:"$val"},Os=e=>!!(e[mo.AND]||e[mo.OR]),m1=e=>!!e[Ns.PATH],g1=e=>!Ct(e)&&Fp(e)&&!Os(e),Ac=e=>({[mo.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Hp(e,t,{auto:n=!0}={}){const r=i=>{let o=Object.keys(i);const l=m1(i);if(!l&&o.length>1&&!Os(i))return r(Ac(i));if(g1(i)){const a=l?i[Ns.PATH]:o[0],u=l?i[Ns.PATTERN]:i[a];if(!ct(u))throw new Error(bv(a));const c={keyId:xs(a),pattern:u};return n&&(c.searcher=Ds(u,t)),c}let s={children:[],operator:o[0]};return o.forEach(a=>{const u=i[a];Ct(u)&&u.forEach(c=>{s.children.push(r(c))})}),s};return Os(e)||(e=Ac(e)),r(e)}function _1(e,{ignoreFieldNorm:t=N.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:i,norm:o,score:l})=>{const s=i?i.weight:null;r*=Math.pow(l===0&&s?Number.EPSILON:l,(s||1)*(t?1:o))}),n.score=r})}function y1(e,t){const n=e.matches;t.matches=[],Me(n)&&n.forEach(r=>{if(!Me(r.indices)||!r.indices.length)return;const{indices:i,value:o}=r;let l={indices:i,value:o};r.key&&(l.key=r.key.src),r.idx>-1&&(l.refIndex=r.idx),t.matches.push(l)})}function v1(e,t){t.score=e.score}function E1(e,t,{includeMatches:n=N.includeMatches,includeScore:r=N.includeScore}={}){const i=[];return n&&i.push(y1),r&&i.push(v1),e.map(o=>{const{idx:l}=o,s={item:t[l],refIndex:l};return i.length&&i.forEach(a=>{a(o,s)}),s})}class Yn{constructor(t,n={},r){this.options={...N,...n},this.options.useExtendedSearch,this._keyStore=new Hv(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof ba))throw new Error(Bv);this._myIndex=n||bp(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){Me(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,i=this._docs.length;r<i;r+=1){const o=this._docs[r];t(o,r)&&(this.removeAt(r),r-=1,i-=1,n.push(o))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:r,includeScore:i,shouldSort:o,sortFn:l,ignoreFieldNorm:s}=this.options;let a=ct(t)?ct(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return _1(a,{ignoreFieldNorm:s}),o&&a.sort(l),jp(n)&&n>-1&&(a=a.slice(0,n)),E1(a,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(t){const n=Ds(t,this.options),{records:r}=this._myIndex,i=[];return r.forEach(({v:o,i:l,n:s})=>{if(!Me(o))return;const{isMatch:a,score:u,indices:c}=n.searchIn(o);a&&i.push({item:o,idx:l,matches:[{score:u,value:o,norm:s,indices:c}]})}),i}_searchLogical(t){const n=Hp(t,this.options),r=(s,a,u)=>{if(!s.children){const{keyId:d,searcher:f}=s,p=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(a,d),searcher:f});return p&&p.length?[{idx:u,item:a,matches:p}]:[]}const c=[];for(let d=0,f=s.children.length;d<f;d+=1){const p=s.children[d],y=r(p,a,u);if(y.length)c.push(...y);else if(s.operator===mo.AND)return[]}return c},i=this._myIndex.records,o={},l=[];return i.forEach(({$:s,i:a})=>{if(Me(s)){let u=r(n,s,a);u.length&&(o[a]||(o[a]={idx:a,item:s,matches:[]},l.push(o[a])),u.forEach(({matches:c})=>{o[a].matches.push(...c)}))}}),l}_searchObjectList(t){const n=Ds(t,this.options),{keys:r,records:i}=this._myIndex,o=[];return i.forEach(({$:l,i:s})=>{if(!Me(l))return;let a=[];r.forEach((u,c)=>{a.push(...this._findMatches({key:u,value:l[c],searcher:n}))}),a.length&&o.push({idx:s,item:l,matches:a})}),o}_findMatches({key:t,value:n,searcher:r}){if(!Me(n))return[];let i=[];if(Ct(n))n.forEach(({v:o,i:l,n:s})=>{if(!Me(o))return;const{isMatch:a,score:u,indices:c}=r.searchIn(o);a&&i.push({score:u,key:t,value:o,idx:l,norm:s,indices:c})});else{const{v:o,n:l}=n,{isMatch:s,score:a,indices:u}=r.searchIn(o);s&&i.push({score:a,key:t,value:o,norm:l,indices:u})}return i}}Yn.version="7.1.0";Yn.createIndex=bp;Yn.parseIndex=Zv;Yn.config=N;Yn.parseQuery=Hp;h1(p1);function S1(){const{flatFiles:e,setCurrentFile:t,setShowFuzzyFinder:n}=No(),[r,i]=M.useState(""),[o,l]=M.useState(0),s=M.useRef(null);M.useEffect(()=>{var f;(f=s.current)==null||f.focus()},[]);const a=M.useMemo(()=>new Yn(e,{threshold:.4,distance:100}),[e]),u=M.useMemo(()=>r.trim()?a.search(r).slice(0,20).map(f=>f.item):e.slice(0,20),[r,a,e]);M.useEffect(()=>{l(0)},[u]);const c=async f=>{try{const p=await at.getFile(f);t(p),n(!1)}catch(p){console.error("Failed to load file:",p)}},d=f=>{switch(f.key){case"ArrowDown":f.preventDefault(),l(p=>Math.min(p+1,u.length-1));break;case"ArrowUp":f.preventDefault(),l(p=>Math.max(p-1,0));break;case"Enter":f.preventDefault(),u[o]&&c(u[o]);break;case"Escape":f.preventDefault(),n(!1);break}};return S.jsx("div",{className:"fuzzy-finder-overlay",onClick:()=>n(!1),children:S.jsxs("div",{className:"fuzzy-finder",onClick:f=>f.stopPropagation(),children:[S.jsx("input",{ref:s,type:"text",className:"fuzzy-finder-input",placeholder:"Search files...",value:r,onChange:f=>i(f.target.value),onKeyDown:d}),S.jsxs("div",{className:"fuzzy-finder-results",children:[u.map((f,p)=>S.jsx("div",{className:`fuzzy-finder-item ${p===o?"fuzzy-finder-item-selected":""}`,onClick:()=>c(f),onMouseEnter:()=>l(p),children:f},f)),u.length===0&&S.jsx("div",{className:"fuzzy-finder-empty",children:"No files found"})]})]})})}const w1={none:"No Diff",inline:"Inline","side-by-side":"Side by Side"};function k1(){const{leftPanelVisible:e,rightPanelVisible:t,toggleLeftPanel:n,toggleRightPanel:r,diffViewMode:i,cycleDiffViewMode:o}=Oo();return S.jsxs("div",{className:"toolbar",children:[S.jsx("div",{className:"toolbar-left",children:S.jsx("button",{className:`toolbar-btn ${e?"active":""}`,onClick:n,title:"Toggle file tree (Cmd+B)",children:S.jsx(Dg,{size:16})})}),S.jsx("div",{className:"toolbar-center",children:S.jsxs("button",{className:"toolbar-btn diff-toggle",onClick:o,title:"Cycle diff mode (Cmd+D)",children:[S.jsx(Tg,{size:16}),S.jsx("span",{className:"diff-mode-label",children:w1[i]})]})}),S.jsx("div",{className:"toolbar-right",children:S.jsx("button",{className:`toolbar-btn ${t?"active":""}`,onClick:r,title:"Toggle staging panel (Cmd+Shift+B)",children:S.jsx(Ng,{size:16})})})]})}function C1({onFuzzyFinderToggle:e,onCancel:t,onSubmit:n,onToggleLeftPanel:r,onToggleRightPanel:i,onToggleAllPanels:o,onToggleGitFilter:l,onCycleDiffMode:s}){M.useEffect(()=>{const a=u=>{const c=u.target,d=c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable;if(u.metaKey&&u.key==="p"||!d&&u.key==="/"){u.preventDefault(),e();return}if(!d&&u.key==="q"){u.preventDefault(),t();return}if(u.metaKey&&u.key==="Enter"){u.preventDefault(),n();return}if(u.metaKey&&!u.shiftKey&&u.key==="b"){u.preventDefault(),r();return}if(u.metaKey&&u.shiftKey&&u.key==="B"){u.preventDefault(),i();return}if(u.metaKey&&u.key==="\\"){u.preventDefault(),o();return}if(u.metaKey&&u.key==="g"){u.preventDefault(),l();return}if(u.metaKey&&u.key==="d"){u.preventDefault(),s();return}u.key};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e,t,n,r,i,o,l,s])}function L1(){const{currentFile:e,selection:t,setFileTree:n,setFlatFiles:r,setGitStatus:i,showFuzzyFinder:o,setShowFuzzyFinder:l,clearSelection:s}=No(),{items:a,addItem:u}=Vp(),{leftPanelVisible:c,rightPanelVisible:d,toggleLeftPanel:f,toggleRightPanel:p,toggleAllPanels:y,toggleGitFilter:v,cycleDiffViewMode:L}=Oo(),[g,m]=M.useState(!1),_=new URLSearchParams(window.location.search).get("session")||"";M.useEffect(()=>{(async()=>{try{const[x,O,D]=await Promise.all([at.getFiles(),at.getFlatFiles(),at.getGitStatus()]);n(x.tree),r(O.files),i(D)}catch(x){console.error("Failed to load data:",x)}})()},[n,r,i]),C1({onFuzzyFinderToggle:()=>l(!o),onCancel:async()=>{try{await at.cancel(),window.close()}catch(k){console.error("Failed to cancel:",k)}},onSubmit:async()=>{if(a.length!==0){m(!0);try{await at.submit(_,a),window.close()}catch(k){console.error("Failed to submit:",k),m(!1)}}},onToggleLeftPanel:f,onToggleRightPanel:p,onToggleAllPanels:y,onToggleGitFilter:v,onCycleDiffMode:L});const E=k=>{!e||!t||(u({filePath:e.path,startLine:t.startLine,endLine:t.endLine,comment:k}),s())},C=async()=>{if(a.length!==0){m(!0);try{await at.submit(_,a),window.close()}catch(k){console.error("Failed to submit:",k),m(!1)}}},R=async()=>{try{await at.cancel(),window.close()}catch(k){console.error("Failed to cancel:",k)}};return S.jsxs("div",{className:"app",children:[S.jsx(k1,{}),S.jsxs("div",{className:"main-content",children:[S.jsx("aside",{className:`sidebar ${c?"":"collapsed"}`,children:S.jsx(a_,{})}),S.jsx("main",{className:"content",children:S.jsx(Dv,{})}),S.jsx("aside",{className:`staging-panel ${d?"":"collapsed"}`,children:S.jsx(Ov,{})})]}),S.jsxs("footer",{className:"footer",children:[S.jsx(Mv,{selection:t,currentFilePath:(e==null?void 0:e.path)??null,onSubmit:E,onCancel:s}),S.jsxs("div",{className:"footer-actions",children:[S.jsx("button",{className:"btn btn-secondary",onClick:R,children:"Cancel (q)"}),S.jsx("button",{className:"btn btn-primary",onClick:C,disabled:a.length===0||g,children:g?"Submitting...":`Submit (${a.length})`})]})]}),o&&S.jsx(S1,{})]})}Cl.createRoot(document.getElementById("root")).render(S.jsx(zc.StrictMode,{children:S.jsx(L1,{})}));
154
+ `).map((f,p)=>({lineNumber:p+1,tokens:[{content:f||" ",color:"#e6edf3"}]}));r(d)}}finally{a||o(!1)}}return u(),()=>{a=!0}},[e,t]),{lines:n,loading:i,error:l}}function Rv({filePath:e,enabled:t}){const[n,r]=M.useState(null),[i,o]=M.useState(!1),[l,s]=M.useState(null);return M.useEffect(()=>{if(!t||!e){r(null);return}let a=!1;async function u(){try{o(!0),s(null);const c=await at.getFileDiff(e);a||r(c)}catch(c){a||(console.error("Failed to fetch diff:",c),s(c),r(null))}finally{a||o(!1)}}return u(),()=>{a=!0}},[e,t]),{diff:n,loading:i,error:l}}function xv(e){const[t,n]=M.useState(!1),[r,i]=M.useState(null),[o,l]=M.useState(null),s=M.useCallback(c=>{n(!0),i(c),l({startLine:c,endLine:c})},[]),a=M.useCallback(c=>{if(!t||r===null)return;const d=Math.min(r,c),f=Math.max(r,c);l({startLine:d,endLine:f})},[t,r]),u=M.useCallback(()=>{t&&o&&e&&e(o),n(!1)},[t,o,e]);return{selecting:t,selection:o,handlers:{onMouseDown:s,onMouseMove:a,onMouseUp:u}}}function Rs({lineNumber:e,tokens:t,selected:n,diffType:r,handlers:i}){const o=r==="add"?"code-line-added":r==="delete"?"code-line-deleted":"";return S.jsxs("div",{className:`code-line ${n?"code-line-selected":""} ${o}`,onMouseDown:()=>i.onMouseDown(e),onMouseMove:()=>i.onMouseMove(e),onMouseUp:i.onMouseUp,children:[S.jsx("span",{className:"line-number",children:e}),S.jsx("span",{className:"code-content",children:t.map((l,s)=>S.jsx("span",{style:{color:l.color,fontStyle:l.fontStyle==="italic"?"italic":void 0,fontWeight:l.fontStyle==="bold"?"bold":void 0},children:l.content},s))})]})}function Tv({lines:e,diffLines:t,selection:n,handlers:r}){const i=o=>n?o>=n.startLine&&o<=n.endLine:!1;return S.jsx(S.Fragment,{children:e.map(o=>S.jsx(Rs,{lineNumber:o.lineNumber,tokens:o.tokens,selected:i(o.lineNumber),diffType:t.get(o.lineNumber),handlers:r},o.lineNumber))})}function Iv({originalLines:e,modifiedLines:t,diffData:n}){const r=M.useMemo(()=>{const i=[],o=new Map(e.map(s=>[s.lineNumber,s.tokens])),l=new Map(t.map(s=>[s.lineNumber,s.tokens]));for(const s of n)s.type==="context"?i.push({left:{lineNumber:s.oldLineNumber,tokens:o.get(s.oldLineNumber)||[{content:s.content,color:"#e6edf3"}],type:"context"},right:{lineNumber:s.newLineNumber,tokens:l.get(s.newLineNumber)||[{content:s.content,color:"#e6edf3"}],type:"context"}}):s.type==="delete"?i.push({left:{lineNumber:s.oldLineNumber,tokens:o.get(s.oldLineNumber)||[{content:s.content,color:"#e6edf3"}],type:"delete"},right:null}):s.type==="add"&&i.push({left:null,right:{lineNumber:s.newLineNumber,tokens:l.get(s.newLineNumber)||[{content:s.content,color:"#e6edf3"}],type:"add"}});return i},[e,t,n]);return r.length===0?S.jsx("div",{className:"code-viewer-empty",children:S.jsx("p",{children:"No changes in this file"})}):S.jsxs("div",{className:"diff-side-by-side",children:[S.jsxs("div",{className:"diff-pane diff-pane-left",children:[S.jsx("div",{className:"diff-pane-header",children:"Original"}),S.jsx("div",{className:"code-viewer-content",children:r.map((i,o)=>{var l,s,a;return S.jsxs("div",{className:`code-line ${((l=i.left)==null?void 0:l.type)==="delete"?"code-line-deleted":""}`,children:[S.jsx("span",{className:"line-number",children:((s=i.left)==null?void 0:s.lineNumber)||""}),S.jsx("span",{className:"code-content",children:((a=i.left)==null?void 0:a.tokens.map((u,c)=>S.jsx("span",{style:{color:u.color},children:u.content},c)))||" "})]},o)})})]}),S.jsxs("div",{className:"diff-pane diff-pane-right",children:[S.jsx("div",{className:"diff-pane-header",children:"Modified"}),S.jsx("div",{className:"code-viewer-content",children:r.map((i,o)=>{var l,s,a;return S.jsxs("div",{className:`code-line ${((l=i.right)==null?void 0:l.type)==="add"?"code-line-added":""}`,children:[S.jsx("span",{className:"line-number",children:((s=i.right)==null?void 0:s.lineNumber)||""}),S.jsx("span",{className:"code-content",children:((a=i.right)==null?void 0:a.tokens.map((u,c)=>S.jsx("span",{style:{color:u.color},children:u.content},c)))||" "})]},o)})})]})]})}function Dv(){const{currentFile:e,selection:t,setSelection:n}=No(),{diffViewMode:r}=Oo(),{handlers:i}=xv(p=>{n(p)}),{lines:o,loading:l}=Av({code:(e==null?void 0:e.content)||"",language:(e==null?void 0:e.language)||"text"}),{diff:s,loading:a}=Rv({filePath:(e==null?void 0:e.path)||null,enabled:r!=="none"}),u=M.useMemo(()=>{const p=new Map;if(!s||s.hunks.length===0)return p;for(const y of s.hunks)for(const v of y.lines)v.type==="add"&&v.newLineNumber?p.set(v.newLineNumber,"add"):v.type==="delete"&&v.oldLineNumber;return p},[s]),c=M.useMemo(()=>!s||s.hunks.length===0?[]:s.hunks.flatMap(p=>p.lines),[s]);if(!e)return S.jsxs("div",{className:"code-viewer code-viewer-empty",children:[S.jsx(Lg,{size:48,className:"empty-state-icon"}),S.jsx("p",{children:"Select a file to view its contents"}),S.jsxs("p",{className:"hint",children:[S.jsx(Og,{size:12}),"Use Cmd+P or / to search for files"]})]});const d=l||a;if(r==="side-by-side")return S.jsxs("div",{className:"code-viewer",children:[S.jsxs("div",{className:"code-viewer-header",children:[S.jsx("span",{className:"file-path",children:e.path}),S.jsxs("span",{className:"file-language",children:["Side by Side - ",e.language]})]}),d?S.jsx("div",{className:"code-viewer-loading",children:"Loading..."}):c.length>0?S.jsx(Iv,{originalLines:o,modifiedLines:o,diffData:c}):S.jsx("div",{className:"code-viewer-content",children:o.map(p=>S.jsx(Rs,{lineNumber:p.lineNumber,tokens:p.tokens,selected:!1,handlers:i},p.lineNumber))})]});if(r==="inline")return S.jsxs("div",{className:"code-viewer",children:[S.jsxs("div",{className:"code-viewer-header",children:[S.jsx("span",{className:"file-path",children:e.path}),S.jsxs("span",{className:"file-language",children:["Inline Diff - ",e.language]})]}),S.jsx("div",{className:"code-viewer-content",children:d?S.jsx("div",{className:"code-viewer-loading",children:"Loading..."}):S.jsx(Tv,{lines:o,diffLines:u,selection:t,handlers:i})})]});const f=p=>t?p>=t.startLine&&p<=t.endLine:!1;return S.jsxs("div",{className:"code-viewer",children:[S.jsxs("div",{className:"code-viewer-header",children:[S.jsx("span",{className:"file-path",children:e.path}),S.jsx("span",{className:"file-language",children:e.language})]}),S.jsx("div",{className:"code-viewer-content",children:d?S.jsx("div",{className:"code-viewer-loading",children:"Loading..."}):o.map(p=>S.jsx(Rs,{lineNumber:p.lineNumber,tokens:p.tokens,selected:f(p.lineNumber),handlers:i},p.lineNumber))})]})}let Nv=1;const Vp=xa(e=>({items:[],addItem:t=>e(n=>({items:[...n.items,{...t,id:`staged-${Nv++}`}]})),removeItem:t=>e(n=>({items:n.items.filter(r=>r.id!==t)})),clear:()=>e({items:[]})}));function Ov(){const{items:e,removeItem:t,clear:n}=Vp(),r=(i,o,l)=>{const s=i.split("/").pop()||i;return o===l?`${s}:${o}`:`${s}:${o}-${l}`};return e.length===0?S.jsxs("div",{className:"staging-list staging-list-empty",children:[S.jsx("div",{className:"staging-header",children:"Staged Selections"}),S.jsxs("div",{className:"empty-state",children:[S.jsx(Ig,{size:32,className:"empty-state-icon"}),S.jsx("p",{className:"staging-hint",children:"Select lines in the code viewer and add a comment to stage them"})]})]}):S.jsxs("div",{className:"staging-list",children:[S.jsxs("div",{className:"staging-header",children:[S.jsxs("span",{children:["Staged Selections (",e.length,")"]}),S.jsx("button",{className:"btn-link",onClick:n,children:"Clear all"})]}),S.jsx("div",{className:"staging-items",children:e.map(i=>S.jsxs("div",{className:"staging-item",children:[S.jsxs("div",{className:"staging-item-header",children:[S.jsx("span",{className:"staging-location",children:r(i.filePath,i.startLine,i.endLine)}),S.jsx("button",{className:"btn-icon",onClick:()=>t(i.id),title:"Remove",children:S.jsx(Mg,{size:14})})]}),S.jsx("div",{className:"staging-comment",children:i.comment})]},i.id))})]})}function Mv({selection:e,currentFilePath:t,onSubmit:n,onCancel:r}){const[i,o]=M.useState(""),l=M.useRef(null);M.useEffect(()=>{var c;e&&((c=l.current)==null||c.focus())},[e]),M.useEffect(()=>{e||o("")},[e]);const s=c=>{c.preventDefault(),!(!e||!i.trim())&&(n(i.trim()),o(""))},a=c=>{c.key==="Escape"&&(c.preventDefault(),r())},u=()=>{if(!e||!t)return"";const c=t.split("/").pop()||t;return e.startLine===e.endLine?`${c}:${e.startLine}`:`${c}:${e.startLine}-${e.endLine}`};return S.jsx("form",{className:"comment-input",onSubmit:s,children:e?S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"comment-selection",children:u()}),S.jsx("input",{ref:l,type:"text",className:"comment-field",placeholder:"Add comment and press Enter...",value:i,onChange:c=>o(c.target.value),onKeyDown:a}),S.jsx("button",{type:"submit",className:"btn btn-small btn-primary",disabled:!i.trim(),children:"Add"})]}):S.jsx("span",{className:"comment-hint",children:"Select lines in the code viewer to add a comment"})})}function Ct(e){return Array.isArray?Array.isArray(e):zp(e)==="[object Array]"}function Vv(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function jv(e){return e==null?"":Vv(e)}function ct(e){return typeof e=="string"}function jp(e){return typeof e=="number"}function Fv(e){return e===!0||e===!1||zv(e)&&zp(e)=="[object Boolean]"}function Fp(e){return typeof e=="object"}function zv(e){return Fp(e)&&e!==null}function Me(e){return e!=null}function kl(e){return!e.trim().length}function zp(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Bv="Incorrect 'index' type",bv=e=>`Invalid value for key ${e}`,$v=e=>`Pattern length exceeds max of ${e}.`,Uv=e=>`Missing ${e} property in key`,Gv=e=>`Property 'weight' in key '${e}' must be a positive integer`,kc=Object.prototype.hasOwnProperty;class Hv{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let i=Bp(r);this._keys.push(i),this._keyMap[i.id]=i,n+=i.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Bp(e){let t=null,n=null,r=null,i=1,o=null;if(ct(e)||Ct(e))r=e,t=Cc(e),n=xs(e);else{if(!kc.call(e,"name"))throw new Error(Uv("name"));const l=e.name;if(r=l,kc.call(e,"weight")&&(i=e.weight,i<=0))throw new Error(Gv(l));t=Cc(l),n=xs(l),o=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:o}}function Cc(e){return Ct(e)?e:e.split(".")}function xs(e){return Ct(e)?e.join("."):e}function Wv(e,t){let n=[],r=!1;const i=(o,l,s)=>{if(Me(o))if(!l[s])n.push(o);else{let a=l[s];const u=o[a];if(!Me(u))return;if(s===l.length-1&&(ct(u)||jp(u)||Fv(u)))n.push(jv(u));else if(Ct(u)){r=!0;for(let c=0,d=u.length;c<d;c+=1)i(u[c],l,s+1)}else l.length&&i(u,l,s+1)}};return i(e,ct(t)?t.split("."):t,0),r?n:n[0]}const Kv={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Qv={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},qv={location:0,threshold:.6,distance:100},Yv={useExtendedSearch:!1,getFn:Wv,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var N={...Qv,...Kv,...qv,...Yv};const Xv=/[^ ]+/g;function Jv(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(i){const o=i.match(Xv).length;if(n.has(o))return n.get(o);const l=1/Math.pow(o,.5*e),s=parseFloat(Math.round(l*r)/r);return n.set(o,s),s},clear(){n.clear()}}}class ba{constructor({getFn:t=N.getFn,fieldNormWeight:n=N.fieldNormWeight}={}){this.norm=Jv(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ct(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();ct(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!Me(t)||kl(t))return;let r={v:t,i:n,n:this.norm.get(t)};this.records.push(r)}_addObject(t,n){let r={i:n,$:{}};this.keys.forEach((i,o)=>{let l=i.getFn?i.getFn(t):this.getFn(t,i.path);if(Me(l)){if(Ct(l)){let s=[];const a=[{nestedArrIndex:-1,value:l}];for(;a.length;){const{nestedArrIndex:u,value:c}=a.pop();if(Me(c))if(ct(c)&&!kl(c)){let d={v:c,i:u,n:this.norm.get(c)};s.push(d)}else Ct(c)&&c.forEach((d,f)=>{a.push({nestedArrIndex:f,value:d})})}r.$[o]=s}else if(ct(l)&&!kl(l)){let s={v:l,n:this.norm.get(l)};r.$[o]=s}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function bp(e,t,{getFn:n=N.getFn,fieldNormWeight:r=N.fieldNormWeight}={}){const i=new ba({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(Bp)),i.setSources(t),i.create(),i}function Zv(e,{getFn:t=N.getFn,fieldNormWeight:n=N.fieldNormWeight}={}){const{keys:r,records:i}=e,o=new ba({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(i),o}function yi(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=N.distance,ignoreLocation:o=N.ignoreLocation}={}){const l=t/e.length;if(o)return l;const s=Math.abs(r-n);return i?l+s/i:s?1:l}function e1(e=[],t=N.minMatchCharLength){let n=[],r=-1,i=-1,o=0;for(let l=e.length;o<l;o+=1){let s=e[o];s&&r===-1?r=o:!s&&r!==-1&&(i=o-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}const Jt=32;function t1(e,t,n,{location:r=N.location,distance:i=N.distance,threshold:o=N.threshold,findAllMatches:l=N.findAllMatches,minMatchCharLength:s=N.minMatchCharLength,includeMatches:a=N.includeMatches,ignoreLocation:u=N.ignoreLocation}={}){if(t.length>Jt)throw new Error($v(Jt));const c=t.length,d=e.length,f=Math.max(0,Math.min(r,d));let p=o,y=f;const v=s>1||a,L=v?Array(d):[];let g;for(;(g=e.indexOf(t,y))>-1;){let k=yi(t,{currentLocation:g,expectedLocation:f,distance:i,ignoreLocation:u});if(p=Math.min(k,p),y=g+c,v){let x=0;for(;x<c;)L[g+x]=1,x+=1}}y=-1;let m=[],_=1,E=c+d;const C=1<<c-1;for(let k=0;k<c;k+=1){let x=0,O=E;for(;x<O;)yi(t,{errors:k,currentLocation:f+O,expectedLocation:f,distance:i,ignoreLocation:u})<=p?x=O:E=O,O=Math.floor((E-x)/2+x);E=O;let D=Math.max(1,f-O+1),X=l?d:Math.min(f+O,d)+c,ie=Array(X+2);ie[X+1]=(1<<k)-1;for(let W=X;W>=D;W-=1){let De=W-1,rt=n[e.charAt(De)];if(v&&(L[De]=+!!rt),ie[W]=(ie[W+1]<<1|1)&rt,k&&(ie[W]|=(m[W+1]|m[W])<<1|1|m[W+1]),ie[W]&C&&(_=yi(t,{errors:k,currentLocation:De,expectedLocation:f,distance:i,ignoreLocation:u}),_<=p)){if(p=_,y=De,y<=f)break;D=Math.max(1,2*f-y)}}if(yi(t,{errors:k+1,currentLocation:f,expectedLocation:f,distance:i,ignoreLocation:u})>p)break;m=ie}const R={isMatch:y>=0,score:Math.max(.001,_)};if(v){const k=e1(L,s);k.length?a&&(R.indices=k):R.isMatch=!1}return R}function n1(e){let t={};for(let n=0,r=e.length;n<r;n+=1){const i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}const ho=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class $p{constructor(t,{location:n=N.location,threshold:r=N.threshold,distance:i=N.distance,includeMatches:o=N.includeMatches,findAllMatches:l=N.findAllMatches,minMatchCharLength:s=N.minMatchCharLength,isCaseSensitive:a=N.isCaseSensitive,ignoreDiacritics:u=N.ignoreDiacritics,ignoreLocation:c=N.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:i,includeMatches:o,findAllMatches:l,minMatchCharLength:s,isCaseSensitive:a,ignoreDiacritics:u,ignoreLocation:c},t=a?t:t.toLowerCase(),t=u?ho(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const d=(p,y)=>{this.chunks.push({pattern:p,alphabet:n1(p),startIndex:y})},f=this.pattern.length;if(f>Jt){let p=0;const y=f%Jt,v=f-y;for(;p<v;)d(this.pattern.substr(p,Jt),p),p+=Jt;if(y){const L=f-Jt;d(this.pattern.substr(L),L)}}else d(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:i}=this.options;if(t=n?t:t.toLowerCase(),t=r?ho(t):t,this.pattern===t){let v={isMatch:!0,score:0};return i&&(v.indices=[[0,t.length-1]]),v}const{location:o,distance:l,threshold:s,findAllMatches:a,minMatchCharLength:u,ignoreLocation:c}=this.options;let d=[],f=0,p=!1;this.chunks.forEach(({pattern:v,alphabet:L,startIndex:g})=>{const{isMatch:m,score:_,indices:E}=t1(t,v,L,{location:o+g,distance:l,threshold:s,findAllMatches:a,minMatchCharLength:u,includeMatches:i,ignoreLocation:c});m&&(p=!0),f+=_,m&&E&&(d=[...d,...E])});let y={isMatch:p,score:p?f/this.chunks.length:1};return p&&i&&(y.indices=d),y}}class Kt{constructor(t){this.pattern=t}static isMultiMatch(t){return Lc(t,this.multiRegex)}static isSingleMatch(t){return Lc(t,this.singleRegex)}search(){}}function Lc(e,t){const n=e.match(t);return n?n[1]:null}class r1 extends Kt{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class i1 extends Kt{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class o1 extends Kt{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class l1 extends Kt{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class s1 extends Kt{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class a1 extends Kt{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Up extends Kt{constructor(t,{location:n=N.location,threshold:r=N.threshold,distance:i=N.distance,includeMatches:o=N.includeMatches,findAllMatches:l=N.findAllMatches,minMatchCharLength:s=N.minMatchCharLength,isCaseSensitive:a=N.isCaseSensitive,ignoreDiacritics:u=N.ignoreDiacritics,ignoreLocation:c=N.ignoreLocation}={}){super(t),this._bitapSearch=new $p(t,{location:n,threshold:r,distance:i,includeMatches:o,findAllMatches:l,minMatchCharLength:s,isCaseSensitive:a,ignoreDiacritics:u,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Gp extends Kt{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const i=[],o=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+o,i.push([r,n-1]);const l=!!i.length;return{isMatch:l,score:l?0:1,indices:i}}}const Ts=[r1,Gp,o1,l1,a1,s1,i1,Up],Pc=Ts.length,u1=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,c1="|";function d1(e,t={}){return e.split(c1).map(n=>{let r=n.trim().split(u1).filter(o=>o&&!!o.trim()),i=[];for(let o=0,l=r.length;o<l;o+=1){const s=r[o];let a=!1,u=-1;for(;!a&&++u<Pc;){const c=Ts[u];let d=c.isMultiMatch(s);d&&(i.push(new c(d,t)),a=!0)}if(!a)for(u=-1;++u<Pc;){const c=Ts[u];let d=c.isSingleMatch(s);if(d){i.push(new c(d,t));break}}}return i})}const f1=new Set([Up.type,Gp.type]);class p1{constructor(t,{isCaseSensitive:n=N.isCaseSensitive,ignoreDiacritics:r=N.ignoreDiacritics,includeMatches:i=N.includeMatches,minMatchCharLength:o=N.minMatchCharLength,ignoreLocation:l=N.ignoreLocation,findAllMatches:s=N.findAllMatches,location:a=N.location,threshold:u=N.threshold,distance:c=N.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:i,minMatchCharLength:o,findAllMatches:s,ignoreLocation:l,location:a,threshold:u,distance:c},t=n?t:t.toLowerCase(),t=r?ho(t):t,this.pattern=t,this.query=d1(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:i,ignoreDiacritics:o}=this.options;t=i?t:t.toLowerCase(),t=o?ho(t):t;let l=0,s=[],a=0;for(let u=0,c=n.length;u<c;u+=1){const d=n[u];s.length=0,l=0;for(let f=0,p=d.length;f<p;f+=1){const y=d[f],{isMatch:v,indices:L,score:g}=y.search(t);if(v){if(l+=1,a+=g,r){const m=y.constructor.type;f1.has(m)?s=[...s,...L]:s.push(L)}}else{a=0,l=0,s.length=0;break}}if(l){let f={isMatch:!0,score:a/l};return r&&(f.indices=s),f}}return{isMatch:!1,score:1}}}const Is=[];function h1(...e){Is.push(...e)}function Ds(e,t){for(let n=0,r=Is.length;n<r;n+=1){let i=Is[n];if(i.condition(e,t))return new i(e,t)}return new $p(e,t)}const mo={AND:"$and",OR:"$or"},Ns={PATH:"$path",PATTERN:"$val"},Os=e=>!!(e[mo.AND]||e[mo.OR]),m1=e=>!!e[Ns.PATH],g1=e=>!Ct(e)&&Fp(e)&&!Os(e),Ac=e=>({[mo.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Hp(e,t,{auto:n=!0}={}){const r=i=>{let o=Object.keys(i);const l=m1(i);if(!l&&o.length>1&&!Os(i))return r(Ac(i));if(g1(i)){const a=l?i[Ns.PATH]:o[0],u=l?i[Ns.PATTERN]:i[a];if(!ct(u))throw new Error(bv(a));const c={keyId:xs(a),pattern:u};return n&&(c.searcher=Ds(u,t)),c}let s={children:[],operator:o[0]};return o.forEach(a=>{const u=i[a];Ct(u)&&u.forEach(c=>{s.children.push(r(c))})}),s};return Os(e)||(e=Ac(e)),r(e)}function _1(e,{ignoreFieldNorm:t=N.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:i,norm:o,score:l})=>{const s=i?i.weight:null;r*=Math.pow(l===0&&s?Number.EPSILON:l,(s||1)*(t?1:o))}),n.score=r})}function y1(e,t){const n=e.matches;t.matches=[],Me(n)&&n.forEach(r=>{if(!Me(r.indices)||!r.indices.length)return;const{indices:i,value:o}=r;let l={indices:i,value:o};r.key&&(l.key=r.key.src),r.idx>-1&&(l.refIndex=r.idx),t.matches.push(l)})}function v1(e,t){t.score=e.score}function E1(e,t,{includeMatches:n=N.includeMatches,includeScore:r=N.includeScore}={}){const i=[];return n&&i.push(y1),r&&i.push(v1),e.map(o=>{const{idx:l}=o,s={item:t[l],refIndex:l};return i.length&&i.forEach(a=>{a(o,s)}),s})}class Yn{constructor(t,n={},r){this.options={...N,...n},this.options.useExtendedSearch,this._keyStore=new Hv(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof ba))throw new Error(Bv);this._myIndex=n||bp(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){Me(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,i=this._docs.length;r<i;r+=1){const o=this._docs[r];t(o,r)&&(this.removeAt(r),r-=1,i-=1,n.push(o))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:r,includeScore:i,shouldSort:o,sortFn:l,ignoreFieldNorm:s}=this.options;let a=ct(t)?ct(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return _1(a,{ignoreFieldNorm:s}),o&&a.sort(l),jp(n)&&n>-1&&(a=a.slice(0,n)),E1(a,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(t){const n=Ds(t,this.options),{records:r}=this._myIndex,i=[];return r.forEach(({v:o,i:l,n:s})=>{if(!Me(o))return;const{isMatch:a,score:u,indices:c}=n.searchIn(o);a&&i.push({item:o,idx:l,matches:[{score:u,value:o,norm:s,indices:c}]})}),i}_searchLogical(t){const n=Hp(t,this.options),r=(s,a,u)=>{if(!s.children){const{keyId:d,searcher:f}=s,p=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(a,d),searcher:f});return p&&p.length?[{idx:u,item:a,matches:p}]:[]}const c=[];for(let d=0,f=s.children.length;d<f;d+=1){const p=s.children[d],y=r(p,a,u);if(y.length)c.push(...y);else if(s.operator===mo.AND)return[]}return c},i=this._myIndex.records,o={},l=[];return i.forEach(({$:s,i:a})=>{if(Me(s)){let u=r(n,s,a);u.length&&(o[a]||(o[a]={idx:a,item:s,matches:[]},l.push(o[a])),u.forEach(({matches:c})=>{o[a].matches.push(...c)}))}}),l}_searchObjectList(t){const n=Ds(t,this.options),{keys:r,records:i}=this._myIndex,o=[];return i.forEach(({$:l,i:s})=>{if(!Me(l))return;let a=[];r.forEach((u,c)=>{a.push(...this._findMatches({key:u,value:l[c],searcher:n}))}),a.length&&o.push({idx:s,item:l,matches:a})}),o}_findMatches({key:t,value:n,searcher:r}){if(!Me(n))return[];let i=[];if(Ct(n))n.forEach(({v:o,i:l,n:s})=>{if(!Me(o))return;const{isMatch:a,score:u,indices:c}=r.searchIn(o);a&&i.push({score:u,key:t,value:o,idx:l,norm:s,indices:c})});else{const{v:o,n:l}=n,{isMatch:s,score:a,indices:u}=r.searchIn(o);s&&i.push({score:a,key:t,value:o,norm:l,indices:u})}return i}}Yn.version="7.1.0";Yn.createIndex=bp;Yn.parseIndex=Zv;Yn.config=N;Yn.parseQuery=Hp;h1(p1);function S1(){const{flatFiles:e,filteredDirs:t,setCurrentFile:n,setShowFuzzyFinder:r}=No(),[i,o]=M.useState(""),[l,s]=M.useState(0),a=M.useRef(null);M.useEffect(()=>{var p;(p=a.current)==null||p.focus()},[]);const u=M.useMemo(()=>new Yn(e,{threshold:.4,distance:100}),[e]),c=M.useMemo(()=>i.trim()?u.search(i).slice(0,20).map(p=>p.item):e.slice(0,20),[i,u,e]);M.useEffect(()=>{s(0)},[c]);const d=async p=>{try{const y=await at.getFile(p);n(y),r(!1)}catch(y){console.error("Failed to load file:",y)}},f=p=>{switch(p.key){case"ArrowDown":p.preventDefault(),s(y=>Math.min(y+1,c.length-1));break;case"ArrowUp":p.preventDefault(),s(y=>Math.max(y-1,0));break;case"Enter":p.preventDefault(),c[l]&&d(c[l]);break;case"Escape":p.preventDefault(),r(!1);break}};return S.jsx("div",{className:"fuzzy-finder-overlay",onClick:()=>r(!1),children:S.jsxs("div",{className:"fuzzy-finder",onClick:p=>p.stopPropagation(),children:[S.jsx("input",{ref:a,type:"text",className:"fuzzy-finder-input",placeholder:"Search files...",value:i,onChange:p=>o(p.target.value),onKeyDown:f}),S.jsxs("div",{className:"fuzzy-finder-results",children:[c.map((p,y)=>S.jsx("div",{className:`fuzzy-finder-item ${y===l?"fuzzy-finder-item-selected":""}`,onClick:()=>d(p),onMouseEnter:()=>s(y),children:p},p)),c.length===0&&S.jsx("div",{className:"fuzzy-finder-empty",children:"No files found"}),t.length>0&&S.jsxs("div",{className:"fuzzy-finder-hint",children:[t.length," folder",t.length>1?"s":""," excluded:"," ",t.slice(0,3).join(", "),t.length>3&&" ..."]})]})]})})}const w1={none:"No Diff",inline:"Inline","side-by-side":"Side by Side"};function k1(){const{leftPanelVisible:e,rightPanelVisible:t,toggleLeftPanel:n,toggleRightPanel:r,diffViewMode:i,cycleDiffViewMode:o}=Oo();return S.jsxs("div",{className:"toolbar",children:[S.jsx("div",{className:"toolbar-left",children:S.jsx("button",{className:`toolbar-btn ${e?"active":""}`,onClick:n,title:"Toggle file tree (Cmd+B)",children:S.jsx(Dg,{size:16})})}),S.jsx("div",{className:"toolbar-center",children:S.jsxs("button",{className:"toolbar-btn diff-toggle",onClick:o,title:"Cycle diff mode (Cmd+D)",children:[S.jsx(Tg,{size:16}),S.jsx("span",{className:"diff-mode-label",children:w1[i]})]})}),S.jsx("div",{className:"toolbar-right",children:S.jsx("button",{className:`toolbar-btn ${t?"active":""}`,onClick:r,title:"Toggle staging panel (Cmd+Shift+B)",children:S.jsx(Ng,{size:16})})})]})}function C1({onFuzzyFinderToggle:e,onCancel:t,onSubmit:n,onToggleLeftPanel:r,onToggleRightPanel:i,onToggleAllPanels:o,onToggleGitFilter:l,onCycleDiffMode:s}){M.useEffect(()=>{const a=u=>{const c=u.target,d=c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable;if(u.metaKey&&u.key==="p"||!d&&u.key==="/"){u.preventDefault(),e();return}if(!d&&u.key==="q"){u.preventDefault(),t();return}if(u.metaKey&&u.key==="Enter"){u.preventDefault(),n();return}if(u.metaKey&&!u.shiftKey&&u.key==="b"){u.preventDefault(),r();return}if(u.metaKey&&u.shiftKey&&u.key==="B"){u.preventDefault(),i();return}if(u.metaKey&&u.key==="\\"){u.preventDefault(),o();return}if(u.metaKey&&u.key==="g"){u.preventDefault(),l();return}if(u.metaKey&&u.key==="d"){u.preventDefault(),s();return}u.key};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e,t,n,r,i,o,l,s])}function L1(){const{currentFile:e,selection:t,setFileTree:n,setFlatFiles:r,setGitStatus:i,showFuzzyFinder:o,setShowFuzzyFinder:l,clearSelection:s}=No(),{items:a,addItem:u}=Vp(),{leftPanelVisible:c,rightPanelVisible:d,toggleLeftPanel:f,toggleRightPanel:p,toggleAllPanels:y,toggleGitFilter:v,cycleDiffViewMode:L}=Oo(),[g,m]=M.useState(!1),_=new URLSearchParams(window.location.search).get("session")||"";M.useEffect(()=>{(async()=>{try{const[x,O,D]=await Promise.all([at.getFiles(),at.getFlatFiles(),at.getGitStatus()]);n(x.tree),r(O.files,O.filteredDirs),i(D)}catch(x){console.error("Failed to load data:",x)}})()},[n,r,i]),C1({onFuzzyFinderToggle:()=>l(!o),onCancel:async()=>{try{await at.cancel(),window.close()}catch(k){console.error("Failed to cancel:",k)}},onSubmit:async()=>{if(a.length!==0){m(!0);try{await at.submit(_,a),window.close()}catch(k){console.error("Failed to submit:",k),m(!1)}}},onToggleLeftPanel:f,onToggleRightPanel:p,onToggleAllPanels:y,onToggleGitFilter:v,onCycleDiffMode:L});const E=k=>{!e||!t||(u({filePath:e.path,startLine:t.startLine,endLine:t.endLine,comment:k}),s())},C=async()=>{if(a.length!==0){m(!0);try{await at.submit(_,a),window.close()}catch(k){console.error("Failed to submit:",k),m(!1)}}},R=async()=>{try{await at.cancel(),window.close()}catch(k){console.error("Failed to cancel:",k)}};return S.jsxs("div",{className:"app",children:[S.jsx(k1,{}),S.jsxs("div",{className:"main-content",children:[S.jsx("aside",{className:`sidebar ${c?"":"collapsed"}`,children:S.jsx(a_,{})}),S.jsx("main",{className:"content",children:S.jsx(Dv,{})}),S.jsx("aside",{className:`staging-panel ${d?"":"collapsed"}`,children:S.jsx(Ov,{})})]}),S.jsxs("footer",{className:"footer",children:[S.jsx(Mv,{selection:t,currentFilePath:(e==null?void 0:e.path)??null,onSubmit:E,onCancel:s}),S.jsxs("div",{className:"footer-actions",children:[S.jsx("button",{className:"btn btn-secondary",onClick:R,children:"Cancel (q)"}),S.jsx("button",{className:"btn btn-primary",onClick:C,disabled:a.length===0||g,children:g?"Submitting...":`Submit (${a.length})`})]})]}),o&&S.jsx(S1,{})]})}Cl.createRoot(document.getElementById("root")).render(S.jsx(zc.StrictMode,{children:S.jsx(L1,{})}));
@@ -0,0 +1 @@
1
+ *{box-sizing:border-box;margin:0;padding:0}:root{--bg-primary: #0d1117;--bg-secondary: #161b22;--bg-tertiary: #21262d;--bg-hover: #30363d;--bg-selected: #1f6feb26;--text-primary: #e6edf3;--text-secondary: #8b949e;--text-muted: #6e7681;--border-color: #30363d;--border-subtle: #21262d;--accent-primary: #238636;--accent-primary-hover: #2ea043;--accent-secondary: #1f6feb;--git-modified: #d29922;--git-untracked: #3fb950;--git-deleted: #f85149;--git-added: #3fb950;--line-number-color: #6e7681;--selection-bg: #264f78;--diff-add-bg: rgba(46, 160, 67, .15);--diff-add-text: #7ee787;--diff-add-border: rgba(46, 160, 67, .4);--diff-delete-bg: rgba(248, 81, 73, .15);--diff-delete-text: #ffa198;--diff-delete-border: rgba(248, 81, 73, .4);--diff-hunk-bg: rgba(56, 139, 253, .1);--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;--font-mono: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 24px;--transition-fast: .15s ease;--transition-normal: .2s ease}body{font-family:var(--font-sans);font-size:14px;background-color:var(--bg-primary);color:var(--text-primary);height:100vh;overflow:hidden}#root{height:100%}.app{display:flex;flex-direction:column;height:100%}.main-content{display:flex;flex:1;overflow:hidden}.toolbar{display:flex;align-items:center;justify-content:space-between;height:40px;padding:0 var(--space-3);background-color:var(--bg-secondary);border-bottom:1px solid var(--border-subtle)}.toolbar-left,.toolbar-center,.toolbar-right{display:flex;align-items:center;gap:var(--space-2)}.toolbar-btn{display:flex;align-items:center;justify-content:center;gap:var(--space-1);height:28px;padding:0 var(--space-2);border:none;background:transparent;border-radius:6px;color:var(--text-secondary);cursor:pointer;transition:all var(--transition-fast)}.toolbar-btn:hover{background-color:var(--bg-hover);color:var(--text-primary)}.toolbar-btn.active{background-color:var(--bg-tertiary);color:var(--text-primary)}.toolbar-btn svg{flex-shrink:0}.diff-toggle{min-width:100px}.diff-mode-label{font-size:12px}.sidebar{width:280px;background-color:var(--bg-secondary);border-right:1px solid var(--border-subtle);overflow:hidden;display:flex;flex-direction:column;transition:width var(--transition-normal),opacity var(--transition-fast)}.sidebar.collapsed{width:0;opacity:0;border-right:none}.content{flex:1;overflow:hidden;display:flex;flex-direction:column;min-width:0}.staging-panel{width:320px;background-color:var(--bg-secondary);border-left:1px solid var(--border-subtle);overflow:hidden;display:flex;flex-direction:column;transition:width var(--transition-normal),opacity var(--transition-fast)}.staging-panel.collapsed{width:0;opacity:0;border-left:none}.footer{display:flex;align-items:center;justify-content:space-between;padding:var(--space-2) var(--space-4);background-color:var(--bg-secondary);border-top:1px solid var(--border-subtle);gap:var(--space-4)}.footer-actions{display:flex;gap:var(--space-2)}.file-tree{display:flex;flex-direction:column;height:100%}.file-tree-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-3) var(--space-4);font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--text-secondary);border-bottom:1px solid var(--border-subtle)}.file-tree-header-actions{display:flex;gap:var(--space-1)}.filter-btn{display:flex;align-items:center;gap:var(--space-1);padding:2px 8px;border:none;background:transparent;border-radius:4px;color:var(--text-muted);font-size:10px;font-weight:600;cursor:pointer;transition:all var(--transition-fast)}.filter-btn:hover{background-color:var(--bg-hover);color:var(--text-secondary)}.filter-btn.active{background-color:var(--accent-secondary);color:#fff}.filter-btn .count{background-color:var(--bg-hover);padding:0 4px;border-radius:3px;font-size:9px}.filter-btn.active .count{background-color:#fff3}.file-tree-content{flex:1;overflow-y:auto;padding:var(--space-1) 0}.tree-item{display:flex;align-items:center;padding:var(--space-1) var(--space-2);cursor:pointer;-webkit-user-select:none;user-select:none;gap:6px}.tree-item:hover{background-color:var(--bg-hover)}.tree-icon{display:flex;align-items:center;justify-content:center;width:14px;color:var(--text-secondary);flex-shrink:0}.tree-folder-icon{display:flex;align-items:center;justify-content:center;width:14px;color:var(--git-modified);flex-shrink:0}.tree-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.git-badge{font-size:10px;font-weight:600;padding:1px 4px;border-radius:3px}.git-badge-modified{color:var(--git-modified);background-color:#d2992226}.git-badge-untracked{color:var(--git-untracked);background-color:#3fb95026}.git-badge-deleted{color:var(--git-deleted);background-color:#f8514926}.git-badge-added{color:var(--git-added);background-color:#3fb95026}.tree-item-filtered{opacity:.5;cursor:default}.tree-item-filtered:hover{background-color:inherit}.code-viewer{display:flex;flex-direction:column;height:100%;overflow:hidden}.code-viewer-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--text-secondary);gap:var(--space-3)}.code-viewer-empty .hint{display:flex;align-items:center;gap:var(--space-1);font-size:12px;color:var(--text-muted)}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--space-5);gap:var(--space-3)}.empty-state-icon{color:var(--text-muted);opacity:.5}.code-viewer-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-2) var(--space-4);background-color:var(--bg-secondary);border-bottom:1px solid var(--border-subtle)}.file-path{font-size:13px;font-family:var(--font-mono)}.file-language{font-size:11px;color:var(--text-secondary);text-transform:uppercase}.code-viewer-content{flex:1;overflow:auto;font-family:var(--font-mono);font-size:13px;line-height:1.5}.code-line{display:flex;min-height:20px;cursor:pointer}.code-line:hover{background-color:var(--bg-hover)}.code-line-selected{background-color:var(--selection-bg)!important}.code-line-added{background-color:var(--diff-add-bg)!important}.code-line-added:hover{background-color:#2ea04340!important}.code-line-deleted{background-color:var(--diff-delete-bg)!important}.code-line-deleted:hover{background-color:#f8514940!important}.line-number{display:inline-block;min-width:50px;padding:0 var(--space-3);text-align:right;color:var(--line-number-color);-webkit-user-select:none;user-select:none;background-color:var(--bg-tertiary);border-right:1px solid var(--border-subtle)}.code-line code{flex:1;padding:0 var(--space-3);white-space:pre;background:transparent}.code-line code.hljs{background:transparent;padding:0 var(--space-3)}.code-content{flex:1;padding:0 var(--space-3);white-space:pre}.staging-list{display:flex;flex-direction:column;height:100%}.staging-list-empty{padding:var(--space-4)}.staging-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-3) var(--space-4);font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--text-secondary);border-bottom:1px solid var(--border-subtle)}.staging-hint{font-size:12px;color:var(--text-muted);line-height:1.5}.staging-items{flex:1;overflow-y:auto;padding:var(--space-2)}.staging-item{background-color:var(--bg-tertiary);border-radius:6px;padding:var(--space-2) var(--space-3);margin-bottom:var(--space-2)}.staging-item-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-1)}.staging-location{font-family:var(--font-mono);font-size:12px;color:var(--text-secondary)}.staging-comment{font-size:13px;line-height:1.4}.comment-input{display:flex;align-items:center;gap:var(--space-3);flex:1}.comment-selection{font-family:var(--font-mono);font-size:12px;color:var(--accent-secondary);white-space:nowrap}.comment-field{flex:1;padding:var(--space-2) var(--space-3);background-color:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:6px;color:var(--text-primary);font-size:14px;transition:border-color var(--transition-fast)}.comment-field:focus{outline:none;border-color:var(--accent-secondary)}.comment-hint{color:var(--text-muted);font-size:13px}.fuzzy-finder-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0009;display:flex;justify-content:center;padding-top:80px;z-index:100}.fuzzy-finder{background-color:var(--bg-secondary);border:1px solid var(--border-color);border-radius:12px;box-shadow:0 16px 48px #00000080;width:600px;max-height:400px;display:flex;flex-direction:column;overflow:hidden}.fuzzy-finder-input{padding:var(--space-4);background-color:var(--bg-tertiary);border:none;border-bottom:1px solid var(--border-subtle);color:var(--text-primary);font-size:16px}.fuzzy-finder-input:focus{outline:none}.fuzzy-finder-results{flex:1;overflow-y:auto}.fuzzy-finder-item{padding:var(--space-3) var(--space-4);cursor:pointer;font-family:var(--font-mono);font-size:13px}.fuzzy-finder-item:hover,.fuzzy-finder-item-selected{background-color:var(--bg-selected)}.fuzzy-finder-empty{padding:var(--space-4);color:var(--text-muted);text-align:center}.fuzzy-finder-hint{padding:var(--space-2) var(--space-4);font-size:11px;color:var(--text-muted);background-color:var(--bg-tertiary);border-top:1px solid var(--border-subtle)}.btn{padding:var(--space-2) var(--space-4);border:none;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:background-color var(--transition-fast)}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background-color:var(--accent-primary);color:#fff}.btn-primary:hover:not(:disabled){background-color:var(--accent-primary-hover)}.btn-secondary{background-color:var(--bg-tertiary);color:var(--text-primary)}.btn-secondary:hover:not(:disabled){background-color:var(--bg-hover)}.btn-small{padding:var(--space-1) var(--space-3)}.btn-link{background:none;border:none;color:var(--accent-secondary);cursor:pointer;font-size:11px}.btn-link:hover{text-decoration:underline}.btn-icon{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:14px;padding:2px 6px}.btn-icon:hover{color:var(--text-primary)}.diff-side-by-side{display:flex;height:100%;overflow:hidden}.diff-pane{flex:1;overflow:auto;font-family:var(--font-mono);font-size:13px;line-height:1.5}.diff-pane-left{border-right:1px solid var(--border-color)}.diff-pane-header{padding:var(--space-2) var(--space-3);background-color:var(--bg-tertiary);border-bottom:1px solid var(--border-subtle);font-size:11px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px}.code-viewer-loading{display:flex;align-items:center;justify-content:center;height:100%;color:var(--text-muted)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#484f58}::-webkit-scrollbar-corner{background:transparent}
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Flip</title>
7
- <script type="module" crossorigin src="/assets/index-DmJdj9bX.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-DTf1sRAX.css">
7
+ <script type="module" crossorigin src="/assets/index-BYcwO1DZ.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-iFjjtGMT.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
package/dist/index.js CHANGED
@@ -423,59 +423,35 @@ import net from "net";
423
423
  import { Router } from "express";
424
424
  import fs2 from "fs";
425
425
  import path2 from "path";
426
- var router = Router();
427
- var DEFAULT_IGNORES = [
426
+ var FILTERED_PATTERNS = /* @__PURE__ */ new Set([
427
+ // Package managers
428
428
  "node_modules",
429
+ "vendor",
430
+ ".pnpm-store",
431
+ // VCS internal
429
432
  ".git",
430
433
  ".svn",
431
434
  ".hg",
435
+ // OS metadata
436
+ ".DS_Store",
437
+ "Thumbs.db",
438
+ // Build output
432
439
  "dist",
433
440
  "build",
434
441
  "out",
442
+ // Cache directories
435
443
  ".cache",
436
444
  ".next",
437
445
  ".nuxt",
438
446
  "coverage",
439
447
  "__pycache__",
440
448
  ".pytest_cache",
441
- "target",
442
- "Cargo.lock",
443
- "package-lock.json",
444
- "pnpm-lock.yaml",
445
- "yarn.lock",
446
- ".DS_Store"
447
- ];
448
- var VISIBLE_DOTFILES = /* @__PURE__ */ new Set([
449
- ".gitignore",
450
- ".gitattributes",
451
- ".env.example",
452
- ".env.local.example",
453
- ".eslintrc",
454
- ".eslintrc.js",
455
- ".eslintrc.cjs",
456
- ".eslintrc.json",
457
- ".eslintrc.yml",
458
- ".prettierrc",
459
- ".prettierrc.js",
460
- ".prettierrc.cjs",
461
- ".prettierrc.json",
462
- ".prettierrc.yml",
463
- ".editorconfig",
464
- ".npmrc",
465
- ".nvmrc",
466
- ".node-version",
467
- ".dockerignore",
468
- ".browserslistrc",
469
- ".babelrc",
470
- ".babelrc.js",
471
- ".babelrc.json"
449
+ "target"
472
450
  ]);
473
- function shouldIgnore(name) {
474
- if (name.startsWith(".")) {
475
- return !VISIBLE_DOTFILES.has(name);
476
- }
477
- return DEFAULT_IGNORES.includes(name);
451
+ function isFiltered(name) {
452
+ return FILTERED_PATTERNS.has(name);
478
453
  }
454
+ var router = Router();
479
455
  function buildFileTree(rootPath, currentPath, maxDepth, depth = 0) {
480
456
  if (depth > maxDepth)
481
457
  return [];
@@ -489,39 +465,42 @@ function buildFileTree(rootPath, currentPath, maxDepth, depth = 0) {
489
465
  return a.name.localeCompare(b.name);
490
466
  });
491
467
  for (const entry of entries) {
492
- if (shouldIgnore(entry.name))
493
- continue;
494
468
  const fullPath = path2.join(currentPath, entry.name);
495
469
  const relativePath = path2.relative(rootPath, fullPath);
470
+ const filtered = isFiltered(entry.name);
496
471
  const node = {
497
472
  path: relativePath,
498
473
  name: entry.name,
499
- type: entry.isDirectory() ? "directory" : "file"
474
+ type: entry.isDirectory() ? "directory" : "file",
475
+ ...filtered && { filtered: true }
500
476
  };
501
- if (entry.isDirectory()) {
477
+ if (entry.isDirectory() && !filtered) {
502
478
  node.children = buildFileTree(rootPath, fullPath, maxDepth, depth + 1);
503
479
  }
504
480
  nodes.push(node);
505
481
  }
506
482
  return nodes;
507
483
  }
508
- function collectFlatFiles(rootPath, currentPath, maxDepth, depth = 0) {
484
+ function collectFlatFiles(rootPath, currentPath, maxDepth, depth = 0, result = { files: [], filteredDirs: [] }) {
509
485
  if (depth > maxDepth)
510
- return [];
486
+ return result;
511
487
  const entries = fs2.readdirSync(currentPath, { withFileTypes: true });
512
- const files = [];
513
488
  for (const entry of entries) {
514
- if (shouldIgnore(entry.name))
515
- continue;
516
489
  const fullPath = path2.join(currentPath, entry.name);
517
490
  const relativePath = path2.relative(rootPath, fullPath);
491
+ if (isFiltered(entry.name)) {
492
+ if (entry.isDirectory()) {
493
+ result.filteredDirs.push(relativePath);
494
+ }
495
+ continue;
496
+ }
518
497
  if (entry.isFile()) {
519
- files.push(relativePath);
498
+ result.files.push(relativePath);
520
499
  } else if (entry.isDirectory()) {
521
- files.push(...collectFlatFiles(rootPath, fullPath, maxDepth, depth + 1));
500
+ collectFlatFiles(rootPath, fullPath, maxDepth, depth + 1, result);
522
501
  }
523
502
  }
524
- return files;
503
+ return result;
525
504
  }
526
505
  router.get("/", (req, res) => {
527
506
  const state = req.app.locals.state;
@@ -534,10 +513,12 @@ router.get("/", (req, res) => {
534
513
  });
535
514
  router.get("/flat", (req, res) => {
536
515
  const state = req.app.locals.state;
537
- const files = collectFlatFiles(state.cwd, state.cwd, 10);
538
- files.sort();
516
+ const result = collectFlatFiles(state.cwd, state.cwd, 10);
517
+ result.files.sort();
518
+ result.filteredDirs.sort();
539
519
  const response = {
540
- files
520
+ files: result.files,
521
+ filteredDirs: result.filteredDirs
541
522
  };
542
523
  res.json(response);
543
524
  });
@@ -1593,6 +1574,8 @@ async function createWorktreeCommand(workspaceRoot, args) {
1593
1574
  await copyWorktreeFiles(workspaceRoot, worktreePath);
1594
1575
  if (split) {
1595
1576
  await openNewTerminal(worktreePath);
1577
+ } else if (process.platform === "darwin") {
1578
+ await cdInCurrentTerminal(worktreePath);
1596
1579
  } else {
1597
1580
  console.log(worktreePath);
1598
1581
  }
@@ -1627,7 +1610,11 @@ async function quitWorktreeCommand() {
1627
1610
  await gitAdapter.removeWorktree(context.currentPath, context.mainRoot, true);
1628
1611
  await gitAdapter.deleteBranch(context.branch, context.mainRoot, true);
1629
1612
  console.log(chalk2.green(`\u2713 Deleted worktree and branch: ${context.branch}`));
1630
- console.log(context.mainRoot);
1613
+ if (process.platform === "darwin") {
1614
+ await cdInCurrentTerminal(context.mainRoot);
1615
+ } else {
1616
+ console.log(context.mainRoot);
1617
+ }
1631
1618
  } catch (error) {
1632
1619
  console.error(chalk2.red(`Failed to quit: ${error.message}`));
1633
1620
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-squad-cli",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "csq": "./dist/index.js"
@@ -1 +0,0 @@
1
- *{box-sizing:border-box;margin:0;padding:0}:root{--bg-primary: #0d1117;--bg-secondary: #161b22;--bg-tertiary: #21262d;--bg-hover: #30363d;--bg-selected: #1f6feb26;--text-primary: #e6edf3;--text-secondary: #8b949e;--text-muted: #6e7681;--border-color: #30363d;--border-subtle: #21262d;--accent-primary: #238636;--accent-primary-hover: #2ea043;--accent-secondary: #1f6feb;--git-modified: #d29922;--git-untracked: #3fb950;--git-deleted: #f85149;--git-added: #3fb950;--line-number-color: #6e7681;--selection-bg: #264f78;--diff-add-bg: rgba(46, 160, 67, .15);--diff-add-text: #7ee787;--diff-add-border: rgba(46, 160, 67, .4);--diff-delete-bg: rgba(248, 81, 73, .15);--diff-delete-text: #ffa198;--diff-delete-border: rgba(248, 81, 73, .4);--diff-hunk-bg: rgba(56, 139, 253, .1);--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;--font-mono: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 24px;--transition-fast: .15s ease;--transition-normal: .2s ease}body{font-family:var(--font-sans);font-size:14px;background-color:var(--bg-primary);color:var(--text-primary);height:100vh;overflow:hidden}#root{height:100%}.app{display:flex;flex-direction:column;height:100%}.main-content{display:flex;flex:1;overflow:hidden}.toolbar{display:flex;align-items:center;justify-content:space-between;height:40px;padding:0 var(--space-3);background-color:var(--bg-secondary);border-bottom:1px solid var(--border-subtle)}.toolbar-left,.toolbar-center,.toolbar-right{display:flex;align-items:center;gap:var(--space-2)}.toolbar-btn{display:flex;align-items:center;justify-content:center;gap:var(--space-1);height:28px;padding:0 var(--space-2);border:none;background:transparent;border-radius:6px;color:var(--text-secondary);cursor:pointer;transition:all var(--transition-fast)}.toolbar-btn:hover{background-color:var(--bg-hover);color:var(--text-primary)}.toolbar-btn.active{background-color:var(--bg-tertiary);color:var(--text-primary)}.toolbar-btn svg{flex-shrink:0}.diff-toggle{min-width:100px}.diff-mode-label{font-size:12px}.sidebar{width:280px;background-color:var(--bg-secondary);border-right:1px solid var(--border-subtle);overflow:hidden;display:flex;flex-direction:column;transition:width var(--transition-normal),opacity var(--transition-fast)}.sidebar.collapsed{width:0;opacity:0;border-right:none}.content{flex:1;overflow:hidden;display:flex;flex-direction:column;min-width:0}.staging-panel{width:320px;background-color:var(--bg-secondary);border-left:1px solid var(--border-subtle);overflow:hidden;display:flex;flex-direction:column;transition:width var(--transition-normal),opacity var(--transition-fast)}.staging-panel.collapsed{width:0;opacity:0;border-left:none}.footer{display:flex;align-items:center;justify-content:space-between;padding:var(--space-2) var(--space-4);background-color:var(--bg-secondary);border-top:1px solid var(--border-subtle);gap:var(--space-4)}.footer-actions{display:flex;gap:var(--space-2)}.file-tree{display:flex;flex-direction:column;height:100%}.file-tree-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-3) var(--space-4);font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--text-secondary);border-bottom:1px solid var(--border-subtle)}.file-tree-header-actions{display:flex;gap:var(--space-1)}.filter-btn{display:flex;align-items:center;gap:var(--space-1);padding:2px 8px;border:none;background:transparent;border-radius:4px;color:var(--text-muted);font-size:10px;font-weight:600;cursor:pointer;transition:all var(--transition-fast)}.filter-btn:hover{background-color:var(--bg-hover);color:var(--text-secondary)}.filter-btn.active{background-color:var(--accent-secondary);color:#fff}.filter-btn .count{background-color:var(--bg-hover);padding:0 4px;border-radius:3px;font-size:9px}.filter-btn.active .count{background-color:#fff3}.file-tree-content{flex:1;overflow-y:auto;padding:var(--space-1) 0}.tree-item{display:flex;align-items:center;padding:var(--space-1) var(--space-2);cursor:pointer;-webkit-user-select:none;user-select:none;gap:6px}.tree-item:hover{background-color:var(--bg-hover)}.tree-icon{display:flex;align-items:center;justify-content:center;width:14px;color:var(--text-secondary);flex-shrink:0}.tree-folder-icon{display:flex;align-items:center;justify-content:center;width:14px;color:var(--git-modified);flex-shrink:0}.tree-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.git-badge{font-size:10px;font-weight:600;padding:1px 4px;border-radius:3px}.git-badge-modified{color:var(--git-modified);background-color:#d2992226}.git-badge-untracked{color:var(--git-untracked);background-color:#3fb95026}.git-badge-deleted{color:var(--git-deleted);background-color:#f8514926}.git-badge-added{color:var(--git-added);background-color:#3fb95026}.code-viewer{display:flex;flex-direction:column;height:100%;overflow:hidden}.code-viewer-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--text-secondary);gap:var(--space-3)}.code-viewer-empty .hint{display:flex;align-items:center;gap:var(--space-1);font-size:12px;color:var(--text-muted)}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--space-5);gap:var(--space-3)}.empty-state-icon{color:var(--text-muted);opacity:.5}.code-viewer-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-2) var(--space-4);background-color:var(--bg-secondary);border-bottom:1px solid var(--border-subtle)}.file-path{font-size:13px;font-family:var(--font-mono)}.file-language{font-size:11px;color:var(--text-secondary);text-transform:uppercase}.code-viewer-content{flex:1;overflow:auto;font-family:var(--font-mono);font-size:13px;line-height:1.5}.code-line{display:flex;min-height:20px;cursor:pointer}.code-line:hover{background-color:var(--bg-hover)}.code-line-selected{background-color:var(--selection-bg)!important}.code-line-added{background-color:var(--diff-add-bg)!important}.code-line-added:hover{background-color:#2ea04340!important}.code-line-deleted{background-color:var(--diff-delete-bg)!important}.code-line-deleted:hover{background-color:#f8514940!important}.line-number{display:inline-block;min-width:50px;padding:0 var(--space-3);text-align:right;color:var(--line-number-color);-webkit-user-select:none;user-select:none;background-color:var(--bg-tertiary);border-right:1px solid var(--border-subtle)}.code-line code{flex:1;padding:0 var(--space-3);white-space:pre;background:transparent}.code-line code.hljs{background:transparent;padding:0 var(--space-3)}.code-content{flex:1;padding:0 var(--space-3);white-space:pre}.staging-list{display:flex;flex-direction:column;height:100%}.staging-list-empty{padding:var(--space-4)}.staging-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-3) var(--space-4);font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--text-secondary);border-bottom:1px solid var(--border-subtle)}.staging-hint{font-size:12px;color:var(--text-muted);line-height:1.5}.staging-items{flex:1;overflow-y:auto;padding:var(--space-2)}.staging-item{background-color:var(--bg-tertiary);border-radius:6px;padding:var(--space-2) var(--space-3);margin-bottom:var(--space-2)}.staging-item-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-1)}.staging-location{font-family:var(--font-mono);font-size:12px;color:var(--text-secondary)}.staging-comment{font-size:13px;line-height:1.4}.comment-input{display:flex;align-items:center;gap:var(--space-3);flex:1}.comment-selection{font-family:var(--font-mono);font-size:12px;color:var(--accent-secondary);white-space:nowrap}.comment-field{flex:1;padding:var(--space-2) var(--space-3);background-color:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:6px;color:var(--text-primary);font-size:14px;transition:border-color var(--transition-fast)}.comment-field:focus{outline:none;border-color:var(--accent-secondary)}.comment-hint{color:var(--text-muted);font-size:13px}.fuzzy-finder-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0009;display:flex;justify-content:center;padding-top:80px;z-index:100}.fuzzy-finder{background-color:var(--bg-secondary);border:1px solid var(--border-color);border-radius:12px;box-shadow:0 16px 48px #00000080;width:600px;max-height:400px;display:flex;flex-direction:column;overflow:hidden}.fuzzy-finder-input{padding:var(--space-4);background-color:var(--bg-tertiary);border:none;border-bottom:1px solid var(--border-subtle);color:var(--text-primary);font-size:16px}.fuzzy-finder-input:focus{outline:none}.fuzzy-finder-results{flex:1;overflow-y:auto}.fuzzy-finder-item{padding:var(--space-3) var(--space-4);cursor:pointer;font-family:var(--font-mono);font-size:13px}.fuzzy-finder-item:hover,.fuzzy-finder-item-selected{background-color:var(--bg-selected)}.fuzzy-finder-empty{padding:var(--space-4);color:var(--text-muted);text-align:center}.btn{padding:var(--space-2) var(--space-4);border:none;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:background-color var(--transition-fast)}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background-color:var(--accent-primary);color:#fff}.btn-primary:hover:not(:disabled){background-color:var(--accent-primary-hover)}.btn-secondary{background-color:var(--bg-tertiary);color:var(--text-primary)}.btn-secondary:hover:not(:disabled){background-color:var(--bg-hover)}.btn-small{padding:var(--space-1) var(--space-3)}.btn-link{background:none;border:none;color:var(--accent-secondary);cursor:pointer;font-size:11px}.btn-link:hover{text-decoration:underline}.btn-icon{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:14px;padding:2px 6px}.btn-icon:hover{color:var(--text-primary)}.diff-side-by-side{display:flex;height:100%;overflow:hidden}.diff-pane{flex:1;overflow:auto;font-family:var(--font-mono);font-size:13px;line-height:1.5}.diff-pane-left{border-right:1px solid var(--border-color)}.diff-pane-header{padding:var(--space-2) var(--space-3);background-color:var(--bg-tertiary);border-bottom:1px solid var(--border-subtle);font-size:11px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px}.code-viewer-loading{display:flex;align-items:center;justify-content:center;height:100%;color:var(--text-muted)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#484f58}::-webkit-scrollbar-corner{background:transparent}