@hyperpuncher/pi-ui 0.47.0 → 0.47.1

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.
package/README.md CHANGED
@@ -153,7 +153,30 @@ all options with their defaults:
153
153
  "wrap": true
154
154
  },
155
155
  "keybindHints": true,
156
- "keybinds": {},
156
+ "keybinds": {
157
+ "new-chat": "ctrl o",
158
+ "new-temporary-chat": "ctrl alt o",
159
+ "resume-session": "ctrl r",
160
+ "previous-session": "ctrl ^",
161
+ "command-palette": "ctrl k",
162
+ "toggle-minimal-mode": "alt m",
163
+ "toggle-tool-output": "alt o",
164
+ "switch-model": "ctrl l",
165
+ "cycle-model": "ctrl p",
166
+ "cycle-thinking": "alt t",
167
+ "cycle-thinking-backward": "alt shift t",
168
+ "toggle-thinking": "ctrl alt t",
169
+ "toggle-review": "ctrl g",
170
+ "change-workspace": "ctrl /",
171
+ "cycle-model-backward": "ctrl shift p",
172
+ "toggle-sessions": "ctrl b",
173
+ "focus-prompt": "alt p",
174
+ "focus-conversation": "alt c",
175
+ "focus-sessions": "alt s",
176
+ "focus-workspace-files": "alt f",
177
+ "focus-workspace-changes": "alt g",
178
+ "focus-workspace-editor": "alt e"
179
+ },
157
180
  "minimalMode": false,
158
181
  "sessionSidebar": {
159
182
  "open": true,
@@ -199,22 +222,6 @@ all options with their defaults:
199
222
  | <kbd>alt</kbd> <kbd>enter</kbd> | queue follow-up |
200
223
  | <kbd>alt</kbd> <kbd>↑</kbd> | restore queued text |
201
224
 
202
- ### custom keybinds
203
-
204
- override any shortcut in `keybinds`, keyed by action id and written as modifiers followed by one key. `ctrl` is the primary modifier (`⌘` on macOS).
205
-
206
- ```json
207
- {
208
- "keybinds": {
209
- "new-chat": "ctrl n",
210
- "previous-session": "ctrl alt p",
211
- "focus-prompt": "alt q"
212
- }
213
- }
214
- ```
215
-
216
- modifiers are `ctrl` (or `control`), `alt`, and `shift`; keys are a letter, a digit, `/`, or `^`. overrides apply at startup, ignore unknown ids or malformed chords (keeping the default), and never bind a chord without `ctrl` or `alt` so typing is unaffected. contextual keys (`/`, `@`, <kbd>alt</kbd> <kbd>enter</kbd>, <kbd>alt</kbd> <kbd>↑</kbd>, and list navigation) are not configurable.
217
-
218
225
  ## license
219
226
 
220
227
  mit
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var ikr=Object.create;var{getPrototypeOf:okr,defineProperty:I7,getOwnPropertyNames:_gt,getOwnPropertyDescriptor:skr}=Object,xgt=Object.prototype.hasOwnProperty;function Cgt(e){return this[e]}var ckr,lkr,An=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var a=t?ckr??=new WeakMap:lkr??=new WeakMap,i=a.get(e);if(i)return i}n=e!=null?ikr(okr(e)):{};let o=t||!e||!e.__esModule?I7(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let s of _gt(e))if(!xgt.call(o,s))I7(o,s,{get:Cgt.bind(e,s),enumerable:!0})}if(r)a.set(e,o);return o},ukr=(e)=>{var t=(kgt??=new WeakMap).get(e),n;if(t)return t;if(t=I7({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var r of _gt(e))if(!xgt.call(t,r))I7(t,r,{get:Cgt.bind(e,r),enumerable:!(n=skr(e,r))||n.enumerable})}return kgt.set(e,t),t},kgt,Me=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var dkr=(e)=>e;function pkr(e,t){this[e]=dkr.bind(null,t)}var Fe=(e,t)=>{for(var n in t)I7(e,n,{get:t[n],enumerable:!0,configurable:!0,set:pkr.bind(t,n)})};var m=(e,t)=>()=>(e&&(t=e(e=0)),t);var an=import.meta.require;async function cv(e,t={}){let n=Bun.spawn([e,...t.args??[]],{env:{...process.env,...t.env},stdin:t.stdin??"ignore",stdout:"pipe",stderr:"pipe",windowsHide:!0,signal:t.signal}),[r,a,i]=await Promise.all([new Response(n.stdout).bytes(),new Response(n.stderr).bytes(),n.exited]);return{code:i,stdout:r,stderr:a,success:i===0}}function Zne(e,t){return e instanceof Error&&"code"in e&&e.code===t}function Jne(e){return Zne(e,"EEXIST")}function td(e){return Zne(e,"ENOENT")}function kSe(e){return Zne(e,"EACCES")||Zne(e,"EPERM")}var Xne,Gd;var lv=m(()=>{Xne=globalThis.navigator?.platform??globalThis.process?.platform,Gd=Xne==="win32"||Xne?.startsWith("Win")?"windows":Xne==="darwin"||Xne?.startsWith("Mac")?"darwin":"linux"});var $gt;var Qgt=m(()=>{$gt={name:"@hyperpuncher/pi-ui",version:"0.47.0",description:"keyboard-first minimal gui for pi",homepage:"https://pi-ui.app",bugs:"https://github.com/hyperpuncher/pi-ui/issues",license:"MIT",repository:{type:"git",url:"git+https://github.com/hyperpuncher/pi-ui.git"},bin:{"pi-ui":"dist/npm/server-main.js"},files:["dist/npm","static"],type:"module",imports:{"#testing/assertions":"./src/testing/assertions.ts","#testing/temp":"./src/testing/temp.ts"},publishConfig:{access:"public"},scripts:{dev:"bun run assets:build && bun src/server-main.ts","assets:build":"bun scripts/build-assets.ts",build:"bun run assets:build && bun scripts/build.ts","npm:build":"bun run assets:build && bun scripts/build-npm.ts",prepack:"bun run npm:build",run:"./dist/pi-ui",release:"bun scripts/release.ts","schema:build":"bun scripts/generate-config-schema.ts","schema:check":"bun scripts/generate-config-schema.ts --check",fmt:"bun run schema:build && ~/projects/dsfmt/target/release/dsfmt --write . && bunx oxfmt",lint:"bunx oxlint && bun run lint:css","lint:css":'bunx stylelint "src/**/*.css"',"lint:fix":"bunx oxlint --fix && bun run lint:css --fix",check:"bun run schema:check && bunx tsc --noEmit",test:"bun test",audit:"bunx fallow audit"},devDependencies:{"@earendil-works/pi-ai":"^0.85.1","@earendil-works/pi-coding-agent":"^0.85.1","@earendil-works/pi-tui":"^0.85.1","@iconify-json/lucide":"^1.2.131","@kitajs/html":"5.0.0-next.1","@oxlint/plugins":"1.82.0","@pierre/diffs":"^1.4.2","@pierre/trees":"^1.0.0-beta.6","@starfederation/datastar-sdk":"^1.0.0","@types/bun":"^1.4.2","open-props":"^1.7.23",oxfmt:"^0.67.0",oxlint:"1.82.0",stylelint:"^17.15.0","stylelint-config-standard":"^40.0.0",typebox:"^1.3.30",typescript:"^7.0.2"},engines:{bun:">=1.4.0"},packageManager:"bun@1.4.0",patchedDependencies:{"@shikijs/primitive@4.4.3":"patches/@shikijs%2Fprimitive@4.4.3.patch"}}});function jgt(e){return e.length===1&&e[0]==="--version"}var tre;var DSe=m(()=>{Qgt();tre=$gt.version});var Ugt=1000,Ggt=!1,qgt=!1,RSe="selector",nre="mode",MSe="elements",B7="namespace",Hgt="useViewTransition",PSe="signals",zgt="onlyIfMissing",NSe,FSe,Wgt="outer",Kgt="html";var LSe=m(()=>{NSe=["outer","inner","replace","prepend","append","before","after","remove"],FSe=["html","svg","mathml"]});var Vgt,OSe;var QSe=m(()=>{LSe();Vgt={"Cache-Control":"no-cache",Connection:"keep-alive","Content-Type":"text/event-stream"},OSe={[nre]:Wgt,[B7]:Kgt,[Hgt]:Ggt,[zgt]:qgt}});class $Se{constructor(){}validateElementPatchMode(e){if(!NSe.includes(e))throw Error(`Invalid ElementPatchMode: "${e}". Valid modes are: ${NSe.join(", ")}`)}validateNamespace(e){if(!FSe.includes(e))throw Error(`Invalid namespace: "${e}". Valid namespaces are: ${FSe.join(", ")}`)}validateRequired(e,t){if(!e||e.trim()==="")throw Error(`${t} is required and cannot be empty`)}send(e,t,n){let{eventId:r,retryDuration:a}=n||{},i=[`event: ${e}
3
+ var ikr=Object.create;var{getPrototypeOf:okr,defineProperty:I7,getOwnPropertyNames:_gt,getOwnPropertyDescriptor:skr}=Object,xgt=Object.prototype.hasOwnProperty;function Cgt(e){return this[e]}var ckr,lkr,An=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var a=t?ckr??=new WeakMap:lkr??=new WeakMap,i=a.get(e);if(i)return i}n=e!=null?ikr(okr(e)):{};let o=t||!e||!e.__esModule?I7(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let s of _gt(e))if(!xgt.call(o,s))I7(o,s,{get:Cgt.bind(e,s),enumerable:!0})}if(r)a.set(e,o);return o},ukr=(e)=>{var t=(kgt??=new WeakMap).get(e),n;if(t)return t;if(t=I7({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var r of _gt(e))if(!xgt.call(t,r))I7(t,r,{get:Cgt.bind(e,r),enumerable:!(n=skr(e,r))||n.enumerable})}return kgt.set(e,t),t},kgt,Me=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var dkr=(e)=>e;function pkr(e,t){this[e]=dkr.bind(null,t)}var Fe=(e,t)=>{for(var n in t)I7(e,n,{get:t[n],enumerable:!0,configurable:!0,set:pkr.bind(t,n)})};var m=(e,t)=>()=>(e&&(t=e(e=0)),t);var an=import.meta.require;async function cv(e,t={}){let n=Bun.spawn([e,...t.args??[]],{env:{...process.env,...t.env},stdin:t.stdin??"ignore",stdout:"pipe",stderr:"pipe",windowsHide:!0,signal:t.signal}),[r,a,i]=await Promise.all([new Response(n.stdout).bytes(),new Response(n.stderr).bytes(),n.exited]);return{code:i,stdout:r,stderr:a,success:i===0}}function Zne(e,t){return e instanceof Error&&"code"in e&&e.code===t}function Jne(e){return Zne(e,"EEXIST")}function td(e){return Zne(e,"ENOENT")}function kSe(e){return Zne(e,"EACCES")||Zne(e,"EPERM")}var Xne,Gd;var lv=m(()=>{Xne=globalThis.navigator?.platform??globalThis.process?.platform,Gd=Xne==="win32"||Xne?.startsWith("Win")?"windows":Xne==="darwin"||Xne?.startsWith("Mac")?"darwin":"linux"});var $gt;var Qgt=m(()=>{$gt={name:"@hyperpuncher/pi-ui",version:"0.47.1",description:"keyboard-first minimal gui for pi",homepage:"https://pi-ui.app",bugs:"https://github.com/hyperpuncher/pi-ui/issues",license:"MIT",repository:{type:"git",url:"git+https://github.com/hyperpuncher/pi-ui.git"},bin:{"pi-ui":"dist/npm/server-main.js"},files:["dist/npm","static"],type:"module",imports:{"#testing/assertions":"./src/testing/assertions.ts","#testing/temp":"./src/testing/temp.ts"},publishConfig:{access:"public"},scripts:{dev:"bun run assets:build && bun src/server-main.ts","assets:build":"bun scripts/build-assets.ts",build:"bun run assets:build && bun scripts/build.ts","npm:build":"bun run assets:build && bun scripts/build-npm.ts",prepack:"bun run npm:build",run:"./dist/pi-ui",release:"bun scripts/release.ts","schema:build":"bun scripts/generate-config-schema.ts","schema:check":"bun scripts/generate-config-schema.ts --check",fmt:"bun run schema:build && ~/projects/dsfmt/target/release/dsfmt --write . && bunx oxfmt",lint:"bunx oxlint && bun run lint:css","lint:css":'bunx stylelint "src/**/*.css"',"lint:fix":"bunx oxlint --fix && bun run lint:css --fix",check:"bun run schema:check && bunx tsc --noEmit",test:"bun test",audit:"bunx fallow audit"},devDependencies:{"@earendil-works/pi-ai":"^0.85.1","@earendil-works/pi-coding-agent":"^0.85.1","@earendil-works/pi-tui":"^0.85.1","@iconify-json/lucide":"^1.2.131","@kitajs/html":"5.0.0-next.1","@oxlint/plugins":"1.82.0","@pierre/diffs":"^1.4.2","@pierre/trees":"^1.0.0-beta.6","@starfederation/datastar-sdk":"^1.0.0","@types/bun":"^1.4.2","open-props":"^1.7.23",oxfmt:"^0.67.0",oxlint:"1.82.0",stylelint:"^17.15.0","stylelint-config-standard":"^40.0.0",typebox:"^1.3.30",typescript:"^7.0.2"},engines:{bun:">=1.4.0"},packageManager:"bun@1.4.0",patchedDependencies:{"@shikijs/primitive@4.4.3":"patches/@shikijs%2Fprimitive@4.4.3.patch"}}});function jgt(e){return e.length===1&&e[0]==="--version"}var tre;var DSe=m(()=>{Qgt();tre=$gt.version});var Ugt=1000,Ggt=!1,qgt=!1,RSe="selector",nre="mode",MSe="elements",B7="namespace",Hgt="useViewTransition",PSe="signals",zgt="onlyIfMissing",NSe,FSe,Wgt="outer",Kgt="html";var LSe=m(()=>{NSe=["outer","inner","replace","prepend","append","before","after","remove"],FSe=["html","svg","mathml"]});var Vgt,OSe;var QSe=m(()=>{LSe();Vgt={"Cache-Control":"no-cache",Connection:"keep-alive","Content-Type":"text/event-stream"},OSe={[nre]:Wgt,[B7]:Kgt,[Hgt]:Ggt,[zgt]:qgt}});class $Se{constructor(){}validateElementPatchMode(e){if(!NSe.includes(e))throw Error(`Invalid ElementPatchMode: "${e}". Valid modes are: ${NSe.join(", ")}`)}validateNamespace(e){if(!FSe.includes(e))throw Error(`Invalid namespace: "${e}". Valid namespaces are: ${FSe.join(", ")}`)}validateRequired(e,t){if(!e||e.trim()==="")throw Error(`${t} is required and cannot be empty`)}send(e,t,n){let{eventId:r,retryDuration:a}=n||{},i=[`event: ${e}
4
4
  `],o=r?[`id: ${r}
5
5
  `]:[],s=!a||a===1000?[]:[`retry: ${a??Ugt}
6
6
  `];return i.concat(o,s,t.map((c)=>`data: ${c}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperpuncher/pi-ui",
3
- "version": "0.47.0",
3
+ "version": "0.47.1",
4
4
  "description": "keyboard-first minimal gui for pi",
5
5
  "homepage": "https://pi-ui.app",
6
6
  "bugs": "https://github.com/hyperpuncher/pi-ui/issues",
@@ -1,2 +1,2 @@
1
- import{D as C,E as d,d as w,l as u,m as h}from"./main-hq8q8mc5.js";import"./main-f40c0hm2.js";import"./main-2yyq3124.js";import"./main-kt1z40p6.js";var p="// syntax preview\nconst greet = (name: string) => {\n return `hello, ${name}!`;\n};",O=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia","ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],D=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","kanagawa-wave","kanagawa-dragon","dark-plus","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","night-owl","one-dark-pro","rose-pine","rose-pine-moon","slack-dark","andromeeda","solarized-dark","vitesse-dark","vitesse-black","aurora-x","dracula","dracula-soft","houston","laserwave","monokai","nord","plastic","poimandres","red","synthwave-84","tokyo-night","vesper"],M=new Map(Object.entries({ayu:"Ayu",cvd:"CVD",github:"GitHub",min:"Min",pierre:"Pierre",vscode:"VS Code"}));function R(e){return e.split("-").map((t)=>M.get(t)??`${t[0]?.toUpperCase()??""}${t.slice(1)}`).join(" ")}function g(e,t){return{appearance:t,label:R(e),name:e}}var _=O.map((e)=>g(e,"light")).toSorted((e,t)=>e.label.localeCompare(t.label)),A=D.map((e)=>g(e,"dark")).toSorted((e,t)=>e.label.localeCompare(t.label)),f=[..._,...A];var F=f.map((e)=>e.name),b;window.piUi.codeTheme={loadFontPreviews(e,t){I(document.documentElement.classList.contains("dark")?t:e)},loadPreviews(){b??=V()}};var k=document.body.dataset.codeThemeLight,T=document.body.dataset.codeThemeDark;if(k&&T)setTimeout(()=>{P({dark:T,light:k})});window.addEventListener("pi-ui-code-theme-changed",(e)=>{if(e instanceof CustomEvent&&C(e.detail))P(e.detail)});window.addEventListener("pi-ui-theme-mode-changed",S);var y=0,v="",m,E=new Map;async function P(e){let t=`${e.light}:${e.dark}`;if(t===v)return;v=t;let o=++y,[r,n,a,i]=await Promise.all([l(e.light),l(e.dark),l(d.light),l(d.dark)]);if(o!==y)return;m={light:{error:r.error??a.error,warning:r.warning??a.warning,success:r.success??a.success},dark:{error:n.error??i.error,warning:n.warning??i.warning,success:n.success??i.success}},S()}function l(e){let t=E.get(e);if(t)return t;let o=w(e).then((r)=>({error:r.colors?.["gitDecoration.deletedResourceForeground"]??r.colors?.["terminal.ansiRed"],warning:r.colors?.["editorWarning.foreground"]??r.colors?.["terminal.ansiYellow"],success:r.colors?.["gitDecoration.addedResourceForeground"]??r.colors?.["terminal.ansiGreen"]})).catch(()=>({}));return E.set(e,o),o}function S(){if(!m)return;let e=document.documentElement.classList.contains("dark")?"dark":"light";for(let[t,o]of Object.entries(m[e])){let r=`--status-${t}`;if(o)document.documentElement.style.setProperty(r,o);else document.documentElement.style.removeProperty(r)}}async function I(e){let t=[...document.querySelectorAll("[data-font-code-preview]")],o=t[0]?.textContent;if(!o)return;try{await h({langs:["typescript"],themes:[e]});let r=u();if(!r)return;let n=r.codeToTokens(o,{lang:"typescript",theme:e});for(let a of t)x(a,n.tokens,n.fg??"inherit")}catch{}}async function V(){c("Loading theme previews…");try{await h({langs:["typescript"],themes:F});let e=u();if(!e)throw Error("Highlighter unavailable");let t=document.querySelectorAll("[data-theme-name]");for(let[o,r]of[...t].entries()){let n=r.dataset.themeName,a=r.querySelector(".code-theme-preview");if(!n||!a)continue;let i=e.codeToTokens(p,{lang:"typescript",theme:n});if(x(a,i.tokens,i.fg??"inherit"),o>0&&o%8===0)await z()}c("Theme previews ready.")}catch{b=void 0,c("Could not load theme previews.")}}function x(e,t,o){e.replaceChildren(),e.style.color=o,e.style.removeProperty("background-color");let r=document.createElement("code");for(let[n,a]of t.entries()){for(let i of a){let s=document.createElement("span");if(s.textContent=i.content,i.color)s.style.color=i.color;for(let[L,H]of Object.entries(i.htmlStyle??{}))s.style.setProperty(L,H);r.append(s)}if(n<t.length-1)r.append(`
1
+ import{D as C,E as d,d as w,l as u,m as h}from"./main-scnj6yst.js";import"./main-6b6epn84.js";import"./main-2yyq3124.js";import"./main-kt1z40p6.js";var p="// syntax preview\nconst greet = (name: string) => {\n return `hello, ${name}!`;\n};",O=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia","ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],D=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","kanagawa-wave","kanagawa-dragon","dark-plus","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","night-owl","one-dark-pro","rose-pine","rose-pine-moon","slack-dark","andromeeda","solarized-dark","vitesse-dark","vitesse-black","aurora-x","dracula","dracula-soft","houston","laserwave","monokai","nord","plastic","poimandres","red","synthwave-84","tokyo-night","vesper"],M=new Map(Object.entries({ayu:"Ayu",cvd:"CVD",github:"GitHub",min:"Min",pierre:"Pierre",vscode:"VS Code"}));function R(e){return e.split("-").map((t)=>M.get(t)??`${t[0]?.toUpperCase()??""}${t.slice(1)}`).join(" ")}function g(e,t){return{appearance:t,label:R(e),name:e}}var _=O.map((e)=>g(e,"light")).toSorted((e,t)=>e.label.localeCompare(t.label)),A=D.map((e)=>g(e,"dark")).toSorted((e,t)=>e.label.localeCompare(t.label)),f=[..._,...A];var F=f.map((e)=>e.name),b;window.piUi.codeTheme={loadFontPreviews(e,t){I(document.documentElement.classList.contains("dark")?t:e)},loadPreviews(){b??=V()}};var k=document.body.dataset.codeThemeLight,T=document.body.dataset.codeThemeDark;if(k&&T)setTimeout(()=>{P({dark:T,light:k})});window.addEventListener("pi-ui-code-theme-changed",(e)=>{if(e instanceof CustomEvent&&C(e.detail))P(e.detail)});window.addEventListener("pi-ui-theme-mode-changed",S);var y=0,v="",m,E=new Map;async function P(e){let t=`${e.light}:${e.dark}`;if(t===v)return;v=t;let o=++y,[r,n,a,i]=await Promise.all([l(e.light),l(e.dark),l(d.light),l(d.dark)]);if(o!==y)return;m={light:{error:r.error??a.error,warning:r.warning??a.warning,success:r.success??a.success},dark:{error:n.error??i.error,warning:n.warning??i.warning,success:n.success??i.success}},S()}function l(e){let t=E.get(e);if(t)return t;let o=w(e).then((r)=>({error:r.colors?.["gitDecoration.deletedResourceForeground"]??r.colors?.["terminal.ansiRed"],warning:r.colors?.["editorWarning.foreground"]??r.colors?.["terminal.ansiYellow"],success:r.colors?.["gitDecoration.addedResourceForeground"]??r.colors?.["terminal.ansiGreen"]})).catch(()=>({}));return E.set(e,o),o}function S(){if(!m)return;let e=document.documentElement.classList.contains("dark")?"dark":"light";for(let[t,o]of Object.entries(m[e])){let r=`--status-${t}`;if(o)document.documentElement.style.setProperty(r,o);else document.documentElement.style.removeProperty(r)}}async function I(e){let t=[...document.querySelectorAll("[data-font-code-preview]")],o=t[0]?.textContent;if(!o)return;try{await h({langs:["typescript"],themes:[e]});let r=u();if(!r)return;let n=r.codeToTokens(o,{lang:"typescript",theme:e});for(let a of t)x(a,n.tokens,n.fg??"inherit")}catch{}}async function V(){c("Loading theme previews…");try{await h({langs:["typescript"],themes:F});let e=u();if(!e)throw Error("Highlighter unavailable");let t=document.querySelectorAll("[data-theme-name]");for(let[o,r]of[...t].entries()){let n=r.dataset.themeName,a=r.querySelector(".code-theme-preview");if(!n||!a)continue;let i=e.codeToTokens(p,{lang:"typescript",theme:n});if(x(a,i.tokens,i.fg??"inherit"),o>0&&o%8===0)await z()}c("Theme previews ready.")}catch{b=void 0,c("Could not load theme previews.")}}function x(e,t,o){e.replaceChildren(),e.style.color=o,e.style.removeProperty("background-color");let r=document.createElement("code");for(let[n,a]of t.entries()){for(let i of a){let s=document.createElement("span");if(s.textContent=i.content,i.color)s.style.color=i.color;for(let[L,H]of Object.entries(i.htmlStyle??{}))s.style.setProperty(L,H);r.append(s)}if(n<t.length-1)r.append(`
2
2
  `)}e.append(r)}function c(e){let t=document.getElementById("code-theme-status");if(t)t.textContent=e}function z(){return new Promise((e)=>requestAnimationFrame(()=>e()))}
@@ -1,4 +1,4 @@
1
- import{H as Li}from"./main-e1326455.js";import{Aa as Ze,Ba as nt,Ca as yt,Da as Tn,K as de,M as Q,_ as he,na as Lt,oa as pe,pa as ge,qa as si,ta as qe,ua as ft,va as Ie,ya as Jn,za as je}from"./main-f40c0hm2.js";import{oc as Ci}from"./main-kt1z40p6.js";var xt=class t{#n=[];#s=[];#e;#t=!1;constructor(e){this.#e=Math.max(1,e?.maxEntries??100)}get canUndo(){return this.#n.length>0}get canRedo(){return this.#s.length>0}getState(){return{undoStack:this.#n.map(Ce),redoStack:this.#s.map(Ce),maxEntries:this.#e,canCoalesce:this.#t}}getLiveState(){return Object.defineProperties({},{undoStack:{enumerable:!0,get:()=>this.#n},redoStack:{enumerable:!0,get:()=>this.#s},maxEntries:{enumerable:!0,get:()=>this.#e},canCoalesce:{enumerable:!0,get:()=>this.#t}})}static fromState(e){let n=new t({maxEntries:e.maxEntries});return n.#n=e.undoStack,n.#s=e.redoStack,n.#t=e.canCoalesce,n}clear(){this.#n.length=0,this.#s.length=0,this.#t=!1}clearRedo(){this.#s.length=0}push(e){if(this.#n.push(e),this.clearRedo(),this.#t=!0,this.#n.length>this.#e)this.#n.shift()}setLastUndoSelectionsAfter(e){let n=this.#n[this.#n.length-1];if(n!==void 0)n.selectionsAfter=e.map((i)=>({...i}))}setLastUndoLineAnnotations(e,n){let i=this.#n[this.#n.length-1];if(i!==void 0)i.lineAnnotationsBefore=e.slice(),i.lineAnnotationsAfter=n.slice()}peekUndo(){return this.#n[this.#n.length-1]}peekUndoForCoalescing(){return this.#t?this.peekUndo():void 0}replaceLastUndo(e){if(this.#n.length===0){this.push(e);return}this.#n[this.#n.length-1]=e,this.clearRedo(),this.#t=!0}popUndoToRedo(){let e=this.#n.pop();if(e!==void 0)return this.#s.push(e),this.#t=!1,e}popRedoToUndo(){let e=this.#s.pop();if(e!==void 0)return this.#n.push(e),this.#t=!1,e}};function ai(t){return{...t,forwardEdits:t.forwardEdits.map((e)=>({...e})),inverseEdits:t.inverseEdits.map((e)=>({...e})),selectionsBefore:t.selectionsBefore?.map(Le),selectionsAfter:t.selectionsAfter?.map(Le),lineAnnotationsBefore:t.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:t.lineAnnotationsAfter?.slice()}}function Ce(t){return{...ai(t),lineAnnotationsBefore:t.lineAnnotationsBefore?.map((e)=>({...e})),lineAnnotationsAfter:t.lineAnnotationsAfter?.map((e)=>({...e}))}}function Le(t){return{...t,start:{...t.start},end:{...t.end}}}function xe(t,e,n,i,s,o,r,a){let c=[...e].sort((d,f)=>d.start-f.start),l=[],h;if(s?.length===c.length){let d=[];for(let f of s){if(f.start.line!==f.end.line||f.start.character!==f.end.character)break;d.push(t.offsetAt(f.start))}if(d.length===c.length){d.sort((p,m)=>p-m);let f=!0,u=!0;for(let p=0;p<c.length;p++){let m=c[p];if(m.text.length>0||m.start===m.end){f=!1,u=!1;break}f&&=d[p]===m.end,u&&=d[p]===m.start}h=f?"backspace":u?"delete":void 0}}for(let d=0,f=0;d<c.length;d++){let u=c[d],p=t.getTextSlice(u.start,u.end),m=u.start+f;l.push({start:m,end:m+u.text.length,text:p}),f+=u.text.length-(u.end-u.start)}return{forwardEdits:c.map((d)=>({...d})),inverseEdits:l,versionBefore:n,versionAfter:i,selectionsBefore:s?.map((d)=>({...d})),selectionsAfter:o?.map((d)=>({...d})),lineAnnotationsBefore:r?.slice(),lineAnnotationsAfter:a?.slice(),coalescingMode:h}}function Se(t,e){if(t===void 0||t.undoBoundary===!0||e.undoBoundary===!0||t.forwardEdits.length===0||t.forwardEdits.length!==t.inverseEdits.length||t.forwardEdits.length!==e.forwardEdits.length||e.forwardEdits.length!==e.inverseEdits.length)return!1;let n;for(let i=0;i<t.forwardEdits.length;i++){let s=t.forwardEdits[i],o=t.inverseEdits[i],r=e.forwardEdits[i],a=e.inverseEdits[i],c=be(r.start,t.forwardEdits),l=s.start<=s.end&&s.text.length>0&&!s.text.includes(`
1
+ import{H as Li}from"./main-e1326455.js";import{Aa as Ze,Ba as nt,Ca as yt,Da as Tn,K as de,M as Q,_ as he,na as Lt,oa as pe,pa as ge,qa as si,ta as qe,ua as ft,va as Ie,ya as Jn,za as je}from"./main-6b6epn84.js";import{oc as Ci}from"./main-kt1z40p6.js";var xt=class t{#n=[];#s=[];#e;#t=!1;constructor(e){this.#e=Math.max(1,e?.maxEntries??100)}get canUndo(){return this.#n.length>0}get canRedo(){return this.#s.length>0}getState(){return{undoStack:this.#n.map(Ce),redoStack:this.#s.map(Ce),maxEntries:this.#e,canCoalesce:this.#t}}getLiveState(){return Object.defineProperties({},{undoStack:{enumerable:!0,get:()=>this.#n},redoStack:{enumerable:!0,get:()=>this.#s},maxEntries:{enumerable:!0,get:()=>this.#e},canCoalesce:{enumerable:!0,get:()=>this.#t}})}static fromState(e){let n=new t({maxEntries:e.maxEntries});return n.#n=e.undoStack,n.#s=e.redoStack,n.#t=e.canCoalesce,n}clear(){this.#n.length=0,this.#s.length=0,this.#t=!1}clearRedo(){this.#s.length=0}push(e){if(this.#n.push(e),this.clearRedo(),this.#t=!0,this.#n.length>this.#e)this.#n.shift()}setLastUndoSelectionsAfter(e){let n=this.#n[this.#n.length-1];if(n!==void 0)n.selectionsAfter=e.map((i)=>({...i}))}setLastUndoLineAnnotations(e,n){let i=this.#n[this.#n.length-1];if(i!==void 0)i.lineAnnotationsBefore=e.slice(),i.lineAnnotationsAfter=n.slice()}peekUndo(){return this.#n[this.#n.length-1]}peekUndoForCoalescing(){return this.#t?this.peekUndo():void 0}replaceLastUndo(e){if(this.#n.length===0){this.push(e);return}this.#n[this.#n.length-1]=e,this.clearRedo(),this.#t=!0}popUndoToRedo(){let e=this.#n.pop();if(e!==void 0)return this.#s.push(e),this.#t=!1,e}popRedoToUndo(){let e=this.#s.pop();if(e!==void 0)return this.#n.push(e),this.#t=!1,e}};function ai(t){return{...t,forwardEdits:t.forwardEdits.map((e)=>({...e})),inverseEdits:t.inverseEdits.map((e)=>({...e})),selectionsBefore:t.selectionsBefore?.map(Le),selectionsAfter:t.selectionsAfter?.map(Le),lineAnnotationsBefore:t.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:t.lineAnnotationsAfter?.slice()}}function Ce(t){return{...ai(t),lineAnnotationsBefore:t.lineAnnotationsBefore?.map((e)=>({...e})),lineAnnotationsAfter:t.lineAnnotationsAfter?.map((e)=>({...e}))}}function Le(t){return{...t,start:{...t.start},end:{...t.end}}}function xe(t,e,n,i,s,o,r,a){let c=[...e].sort((d,f)=>d.start-f.start),l=[],h;if(s?.length===c.length){let d=[];for(let f of s){if(f.start.line!==f.end.line||f.start.character!==f.end.character)break;d.push(t.offsetAt(f.start))}if(d.length===c.length){d.sort((p,m)=>p-m);let f=!0,u=!0;for(let p=0;p<c.length;p++){let m=c[p];if(m.text.length>0||m.start===m.end){f=!1,u=!1;break}f&&=d[p]===m.end,u&&=d[p]===m.start}h=f?"backspace":u?"delete":void 0}}for(let d=0,f=0;d<c.length;d++){let u=c[d],p=t.getTextSlice(u.start,u.end),m=u.start+f;l.push({start:m,end:m+u.text.length,text:p}),f+=u.text.length-(u.end-u.start)}return{forwardEdits:c.map((d)=>({...d})),inverseEdits:l,versionBefore:n,versionAfter:i,selectionsBefore:s?.map((d)=>({...d})),selectionsAfter:o?.map((d)=>({...d})),lineAnnotationsBefore:r?.slice(),lineAnnotationsAfter:a?.slice(),coalescingMode:h}}function Se(t,e){if(t===void 0||t.undoBoundary===!0||e.undoBoundary===!0||t.forwardEdits.length===0||t.forwardEdits.length!==t.inverseEdits.length||t.forwardEdits.length!==e.forwardEdits.length||e.forwardEdits.length!==e.inverseEdits.length)return!1;let n;for(let i=0;i<t.forwardEdits.length;i++){let s=t.forwardEdits[i],o=t.inverseEdits[i],r=e.forwardEdits[i],a=e.inverseEdits[i],c=be(r.start,t.forwardEdits),l=s.start<=s.end&&s.text.length>0&&!s.text.includes(`
2
2
  `)&&!o.text.includes(`
3
3
  `),h=r.start===r.end&&r.text.length>0&&!r.text.includes(`
4
4
  `)&&a.text.length===0;if(l&&h){if(r.start!==o.end)return!1;if(n??="insert",n!=="insert"||t.coalescingMode!==void 0&&t.coalescingMode!=="insert"||e.coalescingMode!==void 0&&e.coalescingMode!=="insert")return!1;continue}let d=s.text.length===0&&s.end>s.start&&o.text.length>0,f=r.text.length===0&&r.end>r.start&&a.text.length>0;if(d&&f){let u;if(c===s.end)u="delete";else if(c+(r.end-r.start)!==s.start)return!1;else u="backspace";if(n??=u,n!==u||t.coalescingMode!==void 0&&t.coalescingMode!==u||e.coalescingMode!==void 0&&e.coalescingMode!==u)return!1;continue}return!1}return n!==void 0}function Ee(t,e){let n=[],i=[],s;for(let o=0;o<t.forwardEdits.length;o++){let r=t.forwardEdits[o],a=t.inverseEdits[o],c=e.forwardEdits[o],l=e.inverseEdits[o],h=be(c.start,t.forwardEdits);if(r.text.length>0){s??="insert",n.push({start:r.start,end:r.end,text:r.text+c.text}),i.push(a.text);continue}if(h===r.end){s??="delete",n.push({start:r.start,end:h+(c.end-c.start),text:""}),i.push(a.text+l.text);continue}s??="backspace",n.push({start:Math.min(r.start,h),end:r.end,text:""}),i.push(l.text+a.text)}return{forwardEdits:n,inverseEdits:ci(n,i),versionBefore:t.versionBefore,versionAfter:e.versionAfter,selectionsBefore:t.selectionsBefore?.slice(),selectionsAfter:e.selectionsAfter?.slice(),lineAnnotationsBefore:t.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:e.lineAnnotationsAfter?.slice(),coalescingMode:s}}function ci(t,e){let n=[];for(let i=0,s=0;i<t.length;i++){let o=t[i],r=o.start+s;n.push({start:r,end:r+o.text.length,text:e[i]}),s+=o.text.length-(o.end-o.start)}return n}function be(t,e){let n=t;for(let i of e){let s=i.end-i.start,o=i.text.length,r=o-s;if(n<i.start)continue;if(n>=i.start+o){n-=r;continue}n=i.start+Math.min(n-i.start,s)}return n}var li=1e5,Wt=10,Et=13,di="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",ht=class{source;offset;length;lineOffsetStart;lineOffsetEnd;hasVirtualTrailingCRBreak;firstCharCode;lastCharCode;static Original=0;static Added=1;constructor(t,e,n,i,s,o,r,a){this.source=t,this.offset=e,this.length=n,this.lineOffsetStart=i,this.lineOffsetEnd=s,this.hasVirtualTrailingCRBreak=o,this.firstCharCode=r,this.lastCharCode=a}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart+(this.hasVirtualTrailingCRBreak?1:0)}},we=class{text;lineOffsets;constructor(t){this.text=t,this.lineOffsets=ft(t)}append(t){let e=this.text.length;for(let n=0;n<t.length;n++){let i=t.charCodeAt(n);if(i!==Wt&&i!==Et)continue;if(i===Et&&t.charCodeAt(n+1)===Wt)n++;this.lineOffsets.push(e+n+1)}return this.text+=t,e}},St=class{piece;subtreeLength;subtreeLineBreakCount;subtreeFirstCharCode;subtreeLastCharCode;left=null;right=null;parent=null;priority=0;constructor(t,e=t.length,n=t.lineBreakCount,i=t.firstCharCode,s=t.lastCharCode){this.piece=t,this.subtreeLength=e,this.subtreeLineBreakCount=n,this.subtreeFirstCharCode=i,this.subtreeLastCharCode=s}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)-(X(this.left?.subtreeLastCharCode,this.piece.firstCharCode)?1:0)-(X(this.piece.lastCharCode,this.right?.subtreeFirstCharCode)?1:0),this.subtreeFirstCharCode=this.left?.subtreeFirstCharCode??this.piece.firstCharCode,this.subtreeLastCharCode=this.right?.subtreeLastCharCode??this.piece.lastCharCode}},ke=class{#n;#s=new we("");#e=null;#t=0;#o=0;#l=null;#c=null;#L=null;#w=2654435769;constructor(t){this.#n=new we(t);let e=this.#y(ht.Original,0,t.length);this.#e=e.length>0?this.#$(e):null,this.#t=this.#e?.subtreeLength??0,this.#o=(this.#e?.subtreeLineBreakCount??0)+1}get lineCount(){return this.#o}getText(t){if(t===void 0)return this.#R();let e=this.offsetAt(t.start),n=this.offsetAt(t.end);return this.getTextSlice(e,n)}getLineText(t,e=!1){if(this.#l!==null&&this.#l[0]===t&&this.#l[1]===e)return this.#l[2];let n=this.#p(t);if(n===void 0)throw Error(`Line index out of range: ${t}`);let i=this.getTextSlice(n[0],n[1],!e);return this.#l=[t,e,i],this.#c=[t,e,i.length],i}getLineLength(t,e=!1){let n=this.#c,i=this.#l;if(n!==null&&n[0]===t&&n[1]===e)return n[2];if(i!==null&&i[0]===t&&i[1]===e){let c=i[2].length;return this.#c=[t,e,c],c}let s=this.#p(t);if(s===void 0)throw Error(`Line index out of range: ${t}`);let[o,r]=s,a=r-o;if(!e)while(a>0&&Ft(this.charAt(o+a-1).charCodeAt(0)))a--;return this.#c=[t,e,a],a}getTextSlice(t,e,n=!1){if(t>=e)return"";let i=U(t,0,this.#t),s=U(e,i,this.#t);if(i>=s)return"";let o=this.#x(i);if(o===void 0)return"";let r=[],[a,c]=o,l=s-i;while(a!==null&&l>0){let h=Math.min(a.piece.length-c,l),d=this.#E(a.piece.source),f=a.piece.offset+c,u=f+h;if(n)while(u>f&&Ft(d.text.charCodeAt(u-1)))u--;r.push(d.text.slice(f,u)),l-=h,c=0,a=this.#m(a)}return r.join("")}charAt(t){let e=this.#x(t);if(e===void 0)return"";let[n,i]=e;return this.#E(n.piece.source).text.charAt(n.piece.offset+i)}includes(t){if(t.length===0)return!0;let e=ye(t),n=0,i=!1;return this.#h((s)=>{for(let o=s.start;o<s.end;o++){let r=s.text.charCodeAt(o);while(n>0&&r!==t.charCodeAt(n))n=e[n-1];if(r===t.charCodeAt(n))n++;if(n===t.length)return i=!0,!1}return!0}),i}findNextNonOverlappingSubstring(t,e){if(t.length===0||t.length>this.#t)return;let n=hi(e,this.#t),i=n.reduce((l,[,h])=>Math.max(l,h),0),s=ye(t),o=0,r=0,a,c;return this.#h((l)=>{for(let h=l.start;h<l.end;h++){let d=l.text.charCodeAt(h);while(o>0&&d!==t.charCodeAt(o))o=s[o-1];if(d===t.charCodeAt(o))o++;if(o===t.length){let f=r-t.length+1;if(!fi(n,f,f+t.length)){if(f>=i)return c=f,!1;a??=f}o=s[o-1]}r++}return!0}),c??a}search(t){if(t.text.length===0||this.#t===0)return[];if(t.text.includes(`
@@ -1,7 +1,7 @@
1
- var Ot="diffs-container",jt=(()=>{try{return!1}catch{return!1}})(),Ft=/(?=^From [a-f0-9]+ .+$)/m,Dt=/(?=^diff --git)/gm;var $t=/(?<=\n)/,Wt=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Ut=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,qt=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,zt=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i;var Ht="header-prefix",Kt="header-filename-suffix",Xt="header-metadata",Vt="header-custom",Qt={dark:"pierre-dark",light:"pierre-light"},Yt="data-theme-css",Zt="data-unsafe-css";var Jt="data-diffs-scrollbar-measure",es="data-diffs-code-view-header",ts="data-diffs-code-view-footer",ss="--diffs-scrollbar-gutter-measured";var ns=1e5,Oe={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},rs={...Oe,hunkLineCount:1},is={paddingTop:8,paddingBottom:8,gap:8},os={omega:0.015,positionEpsilon:0.5,velocityEpsilon:0.05},as=Object.freeze({fromStart:0,fromEnd:0}),cs={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},ls={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};var I=new Set,w=null;function hs(t){I.add(t),w??=requestAnimationFrame(re)}function ds(t){if(I.delete(t)&&I.size===0&&w!=null)cancelAnimationFrame(w),w=null}function re(t){let e=new Set(I);I.clear();for(let s of e)try{s(t)}catch(n){console.error(n)}if(I.size>0)w=requestAnimationFrame(re);else w=null}function fs(t){for(let e of t){if(!(e instanceof HTMLElement))continue;if(e.hasAttribute("data-utility-button")||e.hasAttribute("data-gutter-utility-slot")||e.getAttribute("slot")==="gutter-utility-slot"||e.getAttribute("name")==="gutter-utility-slot")return!0}return!1}var A=new Map,je=0,k={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","\uD83D\uDD25":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",mts:"typescript",cts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function gs(t){if(A.has(t))return A.get(t)??"text";if(k[t]!=null)return k[t];let e=t.match(/\.([^/\\]+\.[^/\\]+)$/);if(e!=null){if(A.has(e[1]))return A.get(e[1])??"text";if(k[e[1]]!=null)return k[e[1]]??"text"}let s=t.match(/\.([^.]+)$/)?.[1]??"";if(A.has(s))return A.get(s)??"text";return k[s]??"text"}function _s(){return je}function Rs(){return Object.fromEntries(A)}function Fe(t){let e=[0],s=t.indexOf("\r"),n=t.indexOf(`
1
+ var jt="diffs-container",Ft=(()=>{try{return!1}catch{return!1}})(),Dt=/(?=^From [a-f0-9]+ .+$)/m,$t=/(?=^diff --git)/gm;var Wt=/(?<=\n)/,Ut=/^(---|\+\+\+)\s+([^\t\r\n]+)/,qt=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,zt=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Ht=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i;var Kt="header-prefix",Xt="header-filename-suffix",Vt="header-metadata",Qt="header-custom",Yt={dark:"pierre-dark",light:"pierre-light"},Zt="data-theme-css",Jt="data-unsafe-css";var es="data-diffs-scrollbar-measure",ts="data-diffs-code-view-header",ss="data-diffs-code-view-footer",ns="--diffs-scrollbar-gutter-measured";var rs=1e5,Oe={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},is={...Oe,hunkLineCount:1},os={paddingTop:8,paddingBottom:8,gap:8},as={omega:0.015,positionEpsilon:0.5,velocityEpsilon:0.05},cs=Object.freeze({fromStart:0,fromEnd:0}),ls={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},us={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};var I=new Set,w=null;function ds(t){I.add(t),w??=requestAnimationFrame(re)}function ps(t){if(I.delete(t)&&I.size===0&&w!=null)cancelAnimationFrame(w),w=null}function re(t){let e=new Set(I);I.clear();for(let s of e)try{s(t)}catch(n){console.error(n)}if(I.size>0)w=requestAnimationFrame(re);else w=null}function ms(t){for(let e of t){if(!(e instanceof HTMLElement))continue;if(e.hasAttribute("data-utility-button")||e.hasAttribute("data-gutter-utility-slot")||e.getAttribute("slot")==="gutter-utility-slot"||e.getAttribute("name")==="gutter-utility-slot")return!0}return!1}var A=new Map,je=0,k={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","\uD83D\uDD25":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",mts:"typescript",cts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function _s(t){if(A.has(t))return A.get(t)??"text";if(k[t]!=null)return k[t];let e=t.match(/\.([^/\\]+\.[^/\\]+)$/);if(e!=null){if(A.has(e[1]))return A.get(e[1])??"text";if(k[e[1]]!=null)return k[e[1]]??"text"}let s=t.match(/\.([^.]+)$/)?.[1]??"";if(A.has(s))return A.get(s)??"text";return k[s]??"text"}function Rs(){return je}function Es(){return Object.fromEntries(A)}function Fe(t){let e=[0],s=t.indexOf("\r"),n=t.indexOf(`
2
2
  `),r=0,i=0;while(s!==-1||n!==-1){let o;if(s!==-1&&(n===-1||s<n))if(n===s+1)o=n+1,s=t.indexOf("\r",o),n=t.indexOf(`
3
3
  `,o);else o=s+1,s=t.indexOf("\r",o);else o=n+1,n=t.indexOf(`
4
- `,o);if(e.push(o),++i===4){if(o-r<=40){for(let c=o;c<t.length;c++){let a=t.charCodeAt(c);if(a===10||a===13){if(a===13&&c+1<t.length&&t.charCodeAt(c+1)===10)c++;e.push(c+1)}}return e}r=o,i=0}}return e}function bs(t){let e=0;for(let s=0;s<t.length;s++){let n=t.charCodeAt(s);if(n===10||n===13){if(n===13&&s+1<t.length&&t.charCodeAt(s+1)===10)s++;e++}}return e}function Ss(t){let e=Fe(t);return Array.from({length:e.length},(s,n)=>{let r=e[n],i=e[n+1]??t.length;return t.slice(r,i)})}var De=void 0;var $e=void 0;function As(){return De??=/macOS|MacIntel|iPhone|iPad|iPod/i.test(We())}function ys(){return $e??="safari"in window&&"pushNotification"in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function We(){let t=globalThis.navigator;return t?.platform??t?.userAgentData?.platform??"unknown"}function Ue(t){return se(t)}function se(t){if(Array.isArray(t))return qe(t);if(t instanceof RegExp)return t;if(typeof t==="object")return ze(t);return t}function qe(t){let e=[];for(let s=0,n=t.length;s<n;s++)e[s]=se(t[s]);return e}function ze(t){let e={};for(let s in t)e[s]=se(t[s]);return e}function pe(t,...e){return e.forEach((s)=>{for(let n in s)t[n]=s[n]}),t}function fe(t){let e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");if(e===0)return t;else if(~e===t.length-1)return fe(t.substring(0,t.length-1));else return t.substr(~e+1)}var X=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,B=class{static hasCaptures(t){if(t===null)return!1;return X.lastIndex=0,X.test(t)}static replaceCaptures(t,e,s){return t.replace(X,(n,r,i,o)=>{let c=s[parseInt(r||i,10)];if(c){let a=e.substring(c.start,c.end);while(a[0]===".")a=a.substring(1);switch(o){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return n})}};function me(t,e){if(t<e)return-1;if(t>e)return 1;return 0}function ge(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let s=t.length,n=e.length;if(s===n){for(let r=0;r<s;r++){let i=me(t[r],e[r]);if(i!==0)return i}return 0}return s-n}function ie(t){if(/^#[0-9a-f]{6}$/i.test(t))return!0;if(/^#[0-9a-f]{8}$/i.test(t))return!0;if(/^#[0-9a-f]{3}$/i.test(t))return!0;if(/^#[0-9a-f]{4}$/i.test(t))return!0;return!1}function _e(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Re=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);let e=this.fn(t);return this.cache.set(t,e),e}},Y=class{constructor(t,e,s){this._colorMap=t,this._defaults=e,this._root=s}static createFromRawTheme(t,e){return this.createFromParsedTheme(Xe(t),e)}static createFromParsedTheme(t,e){return Ye(t,e)}_cachedMatchRoot=new Re((t)=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;let e=t.scopeName,n=this._cachedMatchRoot.get(e).find((r)=>He(t.parent,r.parentScopes));if(!n)return null;return new Ee(n.fontStyle,n.foreground,n.background)}},V=class t{constructor(e,s){this.parent=e,this.scopeName=s}static push(e,s){for(let n of s)e=new t(e,n);return e}static from(...e){let s=null;for(let n=0;n<e.length;n++)s=new t(s,e[n]);return s}push(e){return new t(this,e)}getSegments(){let e=this,s=[];while(e)s.push(e.scopeName),e=e.parent;return s.reverse(),s}toString(){return this.getSegments().join(" ")}extends(e){if(this===e)return!0;if(this.parent===null)return!1;return this.parent.extends(e)}getExtensionIfDefined(e){let s=[],n=this;while(n&&n!==e)s.push(n.scopeName),n=n.parent;return n===e?s.reverse():void 0}};function He(t,e){if(e.length===0)return!0;for(let s=0;s<e.length;s++){let n=e[s],r=!1;if(n===">"){if(s===e.length-1)return!1;n=e[++s],r=!0}while(t){if(Ke(t.scopeName,n))break;if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Ke(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Ee=class{constructor(t,e,s){this.fontStyle=t,this.foregroundId=e,this.backgroundId=s}};function Xe(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,s=[],n=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let c;if(typeof o.scope==="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),c=h.split(",")}else if(Array.isArray(o.scope))c=o.scope;else c=[""];let a=-1;if(typeof o.settings.fontStyle==="string"){a=0;let h=o.settings.fontStyle.split(" ");for(let f=0,d=h.length;f<d;f++)switch(h[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 l=null;if(typeof o.settings.foreground==="string"&&ie(o.settings.foreground))l=o.settings.foreground;let u=null;if(typeof o.settings.background==="string"&&ie(o.settings.background))u=o.settings.background;for(let h=0,f=c.length;h<f;h++){let p=c[h].trim().split(" "),E=p[p.length-1],m=null;if(p.length>1)m=p.slice(0,p.length-1),m.reverse();s[n++]=new Ve(E,m,r,a,l,u)}}return s}var Ve=class{constructor(t,e,s,n,r,i){this.scope=t,this.parentScopes=e,this.index=s,this.fontStyle=n,this.foreground=r,this.background=i}},Qe=((t)=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(Qe||{});function Ye(t,e){t.sort((a,l)=>{let u=me(a.scope,l.scope);if(u!==0)return u;if(u=ge(a.parentScopes,l.parentScopes),u!==0)return u;return a.index-l.index});let s=0,n="#000000",r="#ffffff";while(t.length>=1&&t[0].scope===""){let a=t.shift();if(a.fontStyle!==-1)s=a.fontStyle;if(a.foreground!==null)n=a.foreground;if(a.background!==null)r=a.background}let i=new Ze(e),o=new Ee(s,i.getId(n),i.getId(r)),c=new et(new Z(0,null,-1,0,0),[]);for(let a=0,l=t.length;a<l;a++){let u=t[a];c.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new Y(i,o,c)}var Ze=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,s=t.length;e<s;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Je=Object.freeze([]),Z=class t{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,s,n,r,i){this.scopeDepth=e,this.parentScopes=s||Je,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new t(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let s=[];for(let n=0,r=e.length;n<r;n++)s[n]=e[n].clone();return s}acceptOverwrite(e,s,n,r){if(this.scopeDepth>e)console.log("how did this happen?");else this.scopeDepth=e;if(s!==-1)this.fontStyle=s;if(n!==0)this.foreground=n;if(r!==0)this.background=r}},et=class t{constructor(e,s=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=s}_rulesWithParentScopes;static _cmpBySpecificity(e,s){if(e.scopeDepth!==s.scopeDepth)return s.scopeDepth-e.scopeDepth;let n=0,r=0;while(!0){if(e.parentScopes[n]===">")n++;if(s.parentScopes[r]===">")r++;if(n>=e.parentScopes.length||r>=s.parentScopes.length)break;let i=s.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return s.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let n=e.indexOf("."),r,i;if(n===-1)r=e,i="";else r=e.substring(0,n),i=e.substring(n+1);if(this._children.hasOwnProperty(r))return this._children[r].match(i)}let s=this._rulesWithParentScopes.concat(this._mainRule);return s.sort(t._cmpBySpecificity),s}insert(e,s,n,r,i,o){if(s===""){this._doInsertHere(e,n,r,i,o);return}let c=s.indexOf("."),a,l;if(c===-1)a=s,l="";else a=s.substring(0,c),l=s.substring(c+1);let u;if(this._children.hasOwnProperty(a))u=this._children[a];else u=new t(this._mainRule.clone(),Z.cloneArr(this._rulesWithParentScopes)),this._children[a]=u;u.insert(e+1,l,n,r,i,o)}_doInsertHere(e,s,n,r,i){if(s===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let a=this._rulesWithParentScopes[o];if(ge(a.parentScopes,s)===0){a.acceptOverwrite(e,n,r,i);return}}if(n===-1)n=this._mainRule.fontStyle;if(r===0)r=this._mainRule.foreground;if(i===0)i=this._mainRule.background;this._rulesWithParentScopes.push(new Z(e,s,n,r,i))}},j=class t{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){let s=t.getLanguageId(e),n=t.getTokenType(e),r=t.getFontStyle(e),i=t.getForeground(e),o=t.getBackground(e);console.log({languageId:s,tokenType:n,fontStyle:r,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,s,n,r,i,o,c){let a=t.getLanguageId(e),l=t.getTokenType(e),u=t.containsBalancedBrackets(e)?1:0,h=t.getFontStyle(e),f=t.getForeground(e),d=t.getBackground(e);if(s!==0)a=s;if(n!==8)l=st(n);if(r!==null)u=r?1:0;if(i!==-1)h=i;if(o!==0)f=o;if(c!==0)d=c;return(a<<0|l<<8|u<<10|h<<11|f<<15|d<<24)>>>0}};function tt(t){return t}function st(t){return t}function F(t,e){let s=[],n=nt(t),r=n.next();while(r!==null){let a=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=n.next()}let l=o();if(s.push({matcher:l,priority:a}),r!==",")break;r=n.next()}return s;function i(){if(r==="-"){r=n.next();let a=i();return(l)=>!!a&&!a(l)}if(r==="("){r=n.next();let a=c();if(r===")")r=n.next();return a}if(oe(r)){let a=[];do a.push(r),r=n.next();while(oe(r));return(l)=>e(a,l)}return null}function o(){let a=[],l=i();while(l)a.push(l),l=i();return(u)=>a.every((h)=>h(u))}function c(){let a=[],l=o();while(l){if(a.push(l),r==="|"||r===",")do r=n.next();while(r==="|"||r===",");else break;l=o()}return(u)=>a.some((h)=>h(u))}}function oe(t){return!!t&&!!t.match(/[\w\.:]+/)}function nt(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,s=e.exec(t);return{next:()=>{if(!s)return null;let n=s[0];return s=e.exec(t),n}}}function be(t){if(typeof t.dispose==="function")t.dispose()}var T=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},rt=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},it=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){let e=t.toKey();if(this._seenReferenceKeys.has(e))return;this._seenReferenceKeys.add(e),this._references.push(t)}},ot=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new T(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let t=this.Q;this.Q=[];let e=new it;for(let s of t)at(s,this.initialScopeName,this.repo,e);for(let s of e.references)if(s instanceof T){if(this.seenFullScopeRequests.has(s.scopeName))continue;this.seenFullScopeRequests.add(s.scopeName),this.Q.push(s)}else{if(this.seenFullScopeRequests.has(s.scopeName))continue;if(this.seenPartialScopeRequests.has(s.toKey()))continue;this.seenPartialScopeRequests.add(s.toKey()),this.Q.push(s)}}};function at(t,e,s,n){let r=s.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw Error(`No grammar provided for <${e}>`);return}let i=s.lookup(e);if(t instanceof T)O({baseGrammar:i,selfGrammar:r},n);else J(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},n);let o=s.injections(t.scopeName);if(o)for(let c of o)n.add(new T(c))}function J(t,e,s){if(e.repository&&e.repository[t]){let n=e.repository[t];D([n],e,s)}}function O(t,e){if(t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns))D(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e);if(t.selfGrammar.injections)D(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function D(t,e,s){for(let n of t){if(s.visitedRule.has(n))continue;s.visitedRule.add(n);let r=n.repository?pe({},e.repository,n.repository):e.repository;if(Array.isArray(n.patterns))D(n.patterns,{...e,repository:r},s);let i=n.include;if(!i)continue;let o=Se(i);switch(o.kind){case 0:O({...e,selfGrammar:e.baseGrammar},s);break;case 1:O(e,s);break;case 2:J(o.ruleName,{...e,repository:r},s);break;case 3:case 4:let c=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){let a={baseGrammar:e.baseGrammar,selfGrammar:c,repository:r};if(o.kind===4)J(o.ruleName,a,s);else O(a,s)}else if(o.kind===4)s.add(new rt(o.scopeName,o.ruleName));else s.add(new T(o.scopeName));break}}}var ct=class{kind=0},lt=class{kind=1},ut=class{constructor(t){this.ruleName=t}kind=2},ht=class{constructor(t){this.scopeName=t}kind=3},dt=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Se(t){if(t==="$base")return new ct;else if(t==="$self")return new lt;let e=t.indexOf("#");if(e===-1)return new ht(t);else if(e===0)return new ut(t.substring(1));else{let s=t.substring(0,e),n=t.substring(e+1);return new dt(s,n)}}var pt=/\\(\d+)/,ae=/\\(\d+)/g,ws=Symbol("RuleId"),ft=-1,Ce=-2;function Ae(t){return t}function ye(t){return t}var x=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,s,n){this.$location=t,this.id=e,this._name=s||null,this._nameIsCapturing=B.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=B.hasCaptures(this._contentName)}get debugName(){let t=this.$location?`${fe(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){if(!this._nameIsCapturing||this._name===null||t===null||e===null)return this._name;return B.replaceCaptures(this._name,t,e)}getContentName(t,e){if(!this._contentNameIsCapturing||this._contentName===null)return this._contentName;return B.replaceCaptures(this._contentName,t,e)}},mt=class extends x{retokenizeCapturedWithRuleId;constructor(t,e,s,n,r){super(t,e,s,n);this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw Error("Not supported!")}compile(t,e){throw Error("Not supported!")}compileAG(t,e,s,n){throw Error("Not supported!")}},gt=class extends x{_match;captures;_cachedCompiledPatterns;constructor(t,e,s,n,r){super(t,e,s,null);this._match=new L(n,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,s,n){return this._getCachedCompiledPatterns(t).compileAG(t,s,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new P,this.collectPatterns(t,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},ce=class extends x{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,s,n,r){super(t,e,s,n);this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}collectPatterns(t,e){for(let s of this.patterns)t.getRule(s).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,s,n){return this._getCachedCompiledPatterns(t).compileAG(t,s,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new P,this.collectPatterns(t,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},ee=class extends x{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,s,n,r,i,o,c,a,l){super(t,e,s,n);this._begin=new L(r,this.id),this.beginCaptures=i,this._end=new L(o?o:"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=a||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,s,n){return this._getCachedCompiledPatterns(t,e).compileAG(t,s,n)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let s of this.patterns)t.getRule(s).collectPatterns(t,this._cachedCompiledPatterns);if(this.applyEndPatternLast)this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end);else this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}if(this._end.hasBackReferences)if(this.applyEndPatternLast)this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e);else this._cachedCompiledPatterns.setSource(0,e);return this._cachedCompiledPatterns}},W=class extends x{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,s,n,r,i,o,c,a){super(t,e,s,n);this._begin=new L(r,this.id),this.beginCaptures=i,this.whileCaptures=c,this._while=new L(o,Ce),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null;if(this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,s,n){return this._getCachedCompiledPatterns(t).compileAG(t,s,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,s,n){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,s,n)}_getCachedCompiledWhilePatterns(t,e){if(!this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns=new P,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while);if(this._while.hasBackReferences)this._cachedCompiledWhilePatterns.setSource(0,e?e:"￿");return this._cachedCompiledWhilePatterns}},Ie=class t{static createCaptureRule(e,s,n,r,i){return e.registerRule((o)=>new mt(s,o,n,r,i))}static getCompiledRuleId(e,s,n){if(!e.id)s.registerRule((r)=>{if(e.id=r,e.match)return new gt(e.$vscodeTextmateLocation,e.id,e.name,e.match,t._compileCaptures(e.captures,s,n));if(typeof e.begin>"u"){if(e.repository)n=pe({},n,e.repository);let i=e.patterns;if(typeof i>"u"&&e.include)i=[{include:e.include}];return new ce(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,t._compilePatterns(i,s,n))}if(e.while)return new W(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,t._compileCaptures(e.beginCaptures||e.captures,s,n),e.while,t._compileCaptures(e.whileCaptures||e.captures,s,n),t._compilePatterns(e.patterns,s,n));return new ee(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,t._compileCaptures(e.beginCaptures||e.captures,s,n),e.end,t._compileCaptures(e.endCaptures||e.captures,s,n),e.applyEndPatternLast,t._compilePatterns(e.patterns,s,n))});return e.id}static _compileCaptures(e,s,n){let r=[];if(e){let i=0;for(let o in e){if(o==="$vscodeTextmateLocation")continue;let c=parseInt(o,10);if(c>i)i=c}for(let o=0;o<=i;o++)r[o]=null;for(let o in e){if(o==="$vscodeTextmateLocation")continue;let c=parseInt(o,10),a=0;if(e[o].patterns)a=t.getCompiledRuleId(e[o],s,n);r[c]=t.createCaptureRule(s,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,a)}}return r}static _compilePatterns(e,s,n){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){let c=e[i],a=-1;if(c.include){let l=Se(c.include);switch(l.kind){case 0:case 1:a=t.getCompiledRuleId(n[c.include],s,n);break;case 2:let u=n[l.ruleName];if(u)a=t.getCompiledRuleId(u,s,n);break;case 3:case 4:let h=l.scopeName,f=l.kind===4?l.ruleName:null,d=s.getExternalGrammar(h,n);if(d)if(f){let p=d.repository[f];if(p)a=t.getCompiledRuleId(p,s,d.repository)}else a=t.getCompiledRuleId(d.repository.$self,s,d.repository);break}}else a=t.getCompiledRuleId(c,s,n);if(a!==-1){let l=s.getRule(a),u=!1;if(l instanceof ce||l instanceof ee||l instanceof W){if(l.hasMissingPatterns&&l.patterns.length===0)u=!0}if(u)continue;r.push(a)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},L=class t{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,s){if(e&&typeof e==="string"){let n=e.length,r=0,i=[],o=!1;for(let c=0;c<n;c++)if(e.charAt(c)==="\\"){if(c+1<n){let l=e.charAt(c+1);if(l==="z")i.push(e.substring(r,c)),i.push("$(?!\\n)(?<!\\n)"),r=c+2;else if(l==="A"||l==="G")o=!0;c++}}if(this.hasAnchor=o,r===0)this.source=e;else i.push(e.substring(r,n)),this.source=i.join("")}else this.hasAnchor=!1,this.source=e;if(this.hasAnchor)this._anchorCache=this._buildAnchorCache();else this._anchorCache=null;if(this.ruleId=s,typeof this.source==="string")this.hasBackReferences=pt.test(this.source);else this.hasBackReferences=!1}clone(){return new t(this.source,this.ruleId)}setSource(e){if(this.source===e)return;if(this.source=e,this.hasAnchor)this._anchorCache=this._buildAnchorCache()}resolveBackReferences(e,s){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let n=s.map((r)=>e.substring(r.start,r.end));return ae.lastIndex=0,this.source.replace(ae,(r,i)=>_e(n[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let e=[],s=[],n=[],r=[],i,o,c,a;for(i=0,o=this.source.length;i<o;i++)if(c=this.source.charAt(i),e[i]=c,s[i]=c,n[i]=c,r[i]=c,c==="\\"){if(i+1<o){if(a=this.source.charAt(i+1),a==="A")e[i+1]="￿",s[i+1]="￿",n[i+1]="A",r[i+1]="A";else if(a==="G")e[i+1]="￿",s[i+1]="G",n[i+1]="￿",r[i+1]="G";else e[i+1]=a,s[i+1]=a,n[i+1]=a,r[i+1]=a;i++}}return{A0_G0:e.join(""),A0_G1:s.join(""),A1_G0:n.join(""),A1_G1:r.join("")}}resolveAnchors(e,s){if(!this.hasAnchor||!this._anchorCache||typeof this.source!=="string")return this.source;if(e)if(s)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;else if(s)return this._anchorCache.A0_G1;else return this._anchorCache.A0_G0}},P=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){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(){if(this._cached)this._cached.dispose(),this._cached=null;if(this._anchorCache.A0_G0)this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null;if(this._anchorCache.A0_G1)this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null;if(this._anchorCache.A1_G0)this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null;if(this._anchorCache.A1_G1)this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){if(this._items[t].source!==e)this._disposeCaches(),this._items[t].setSource(e)}compile(t){if(!this._cached){let e=this._items.map((s)=>s.source);this._cached=new le(t,e,this._items.map((s)=>s.ruleId))}return this._cached}compileAG(t,e,s){if(!this._hasAnchors)return this.compile(t);else if(e)if(s){if(!this._anchorCache.A1_G1)this._anchorCache.A1_G1=this._resolveAnchors(t,e,s);return this._anchorCache.A1_G1}else{if(!this._anchorCache.A1_G0)this._anchorCache.A1_G0=this._resolveAnchors(t,e,s);return this._anchorCache.A1_G0}else if(s){if(!this._anchorCache.A0_G1)this._anchorCache.A0_G1=this._resolveAnchors(t,e,s);return this._anchorCache.A0_G1}else{if(!this._anchorCache.A0_G0)this._anchorCache.A0_G0=this._resolveAnchors(t,e,s);return this._anchorCache.A0_G0}}_resolveAnchors(t,e,s){let n=this._items.map((r)=>r.resolveAnchors(e,s));return new le(t,n,this._items.map((r)=>r.ruleId))}},le=class{constructor(t,e,s){this.regExps=e,this.rules=s,this.scanner=t.createOnigScanner(e)}scanner;dispose(){if(typeof this.scanner.dispose==="function")this.scanner.dispose()}toString(){let t=[];for(let e=0,s=this.rules.length;e<s;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
5
- `)}findNextMatchSync(t,e,s){let n=this.scanner.findNextMatchSync(t,e,s);if(!n)return null;return{ruleId:this.rules[n.index],captureIndices:n.captureIndices}}},Q=class{constructor(t,e){this.languageId=t,this.tokenType=e}},_t=class t{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,s){this._defaultAttributes=new Q(e,8),this._embeddedLanguagesMatcher=new Rt(Object.entries(s||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){if(e===null)return t._NULL_SCOPE_METADATA;return this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new Q(0,0);_getBasicScopeAttributes=new Re((e)=>{let s=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new Q(s,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){let s=e.match(t.STANDARD_TOKEN_TYPE_REGEXP);if(!s)return 8;switch(s[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Rt=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);let e=t.map(([s,n])=>_e(s));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;let e=t.match(this.scopesRegExp);if(!e)return;return this.values.get(e[1])}},ks={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},we=!1,ue=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function ke(t,e,s,n,r,i,o,c){let a=e.content.length,l=!1,u=-1;if(o){let d=Et(t,e,s,n,r,i);r=d.stack,n=d.linePos,s=d.isFirstLine,u=d.anchorPosition}let h=Date.now();while(!l){if(c!==0){if(Date.now()-h>c)return new ue(r,!0)}f()}return new ue(r,!1);function f(){let d=bt(t,e,s,n,r,u);if(!d){i.produce(r,a),l=!0;return}let{captureIndices:p,matchedRuleId:E}=d,m=p&&p.length>0?p[0].end>n:!1;if(E===ft){let R=r.getRule(t);i.produce(r,p[0].start),r=r.withContentNameScopesList(r.nameScopesList),v(t,e,s,r,i,R.endCaptures,p),i.produce(r,p[0].end);let g=r;if(r=r.parent,u=g.getAnchorPos(),!m&&g.getEnterPos()===n){r=g,i.produce(r,a),l=!0;return}}else{let R=t.getRule(E);i.produce(r,p[0].start);let g=r,y=R.getName(e.content,p),C=r.contentNameScopesList.pushAttributed(y,t);if(r=r.push(E,n,u,p[0].end===a,null,C,C),R instanceof ee){let b=R;v(t,e,s,r,i,b.beginCaptures,p),i.produce(r,p[0].end),u=p[0].end;let H=b.getContentName(e.content,p),K=C.pushAttributed(H,t);if(r=r.withContentNameScopesList(K),b.endHasBackReferences)r=r.withEndRule(b.getEndWithResolvedBackReferences(e.content,p));if(!m&&g.hasSameRuleAs(r)){r=r.pop(),i.produce(r,a),l=!0;return}}else if(R instanceof W){let b=R;v(t,e,s,r,i,b.beginCaptures,p),i.produce(r,p[0].end),u=p[0].end;let H=b.getContentName(e.content,p),K=C.pushAttributed(H,t);if(r=r.withContentNameScopesList(K),b.whileHasBackReferences)r=r.withEndRule(b.getWhileWithResolvedBackReferences(e.content,p));if(!m&&g.hasSameRuleAs(r)){r=r.pop(),i.produce(r,a),l=!0;return}}else if(v(t,e,s,r,i,R.captures,p),i.produce(r,p[0].end),r=r.pop(),!m){r=r.safePop(),i.produce(r,a),l=!0;return}}if(p[0].end>n)n=p[0].end,s=!1}}function Et(t,e,s,n,r,i){let o=r.beginRuleCapturedEOL?0:-1,c=[];for(let a=r;a;a=a.pop()){let l=a.getRule(t);if(l instanceof W)c.push({rule:l,stack:a})}for(let a=c.pop();a;a=c.pop()){let{ruleScanner:l,findOptions:u}=At(a.rule,t,a.stack.endRule,s,n===o),h=l.findNextMatchSync(e,n,u);if(h){if(h.ruleId!==Ce){r=a.stack.pop();break}if(h.captureIndices&&h.captureIndices.length){if(i.produce(a.stack,h.captureIndices[0].start),v(t,e,s,a.stack,i,a.rule.whileCaptures,h.captureIndices),i.produce(a.stack,h.captureIndices[0].end),o=h.captureIndices[0].end,h.captureIndices[0].end>n)n=h.captureIndices[0].end,s=!1}}else{r=a.stack.pop();break}}return{stack:r,linePos:n,anchorPosition:o,isFirstLine:s}}function bt(t,e,s,n,r,i){let o=St(t,e,s,n,r,i),c=t.getInjections();if(c.length===0)return o;let a=Ct(c,t,e,s,n,r,i);if(!a)return o;if(!o)return a;let l=o.captureIndices[0].start,u=a.captureIndices[0].start;if(u<l||a.priorityMatch&&u===l)return a;return o}function St(t,e,s,n,r,i){let o=r.getRule(t),{ruleScanner:c,findOptions:a}=ve(o,t,r.endRule,s,n===i),l=c.findNextMatchSync(e,n,a);if(l)return{captureIndices:l.captureIndices,matchedRuleId:l.ruleId};return null}function Ct(t,e,s,n,r,i,o){let c=Number.MAX_VALUE,a=null,l,u=0,h=i.contentNameScopesList.getScopeNames();for(let f=0,d=t.length;f<d;f++){let p=t[f];if(!p.matcher(h))continue;let E=e.getRule(p.ruleId),{ruleScanner:m,findOptions:R}=ve(E,e,null,n,r===o),g=m.findNextMatchSync(s,r,R);if(!g)continue;let y=g.captureIndices[0].start;if(y>=c)continue;if(c=y,a=g.captureIndices,l=g.ruleId,u=p.priority,c===r)break}if(a)return{priorityMatch:u===-1,captureIndices:a,matchedRuleId:l};return null}function ve(t,e,s,n,r){if(we){let o=t.compile(e,s),c=Ne(n,r);return{ruleScanner:o,findOptions:c}}return{ruleScanner:t.compileAG(e,s,n,r),findOptions:0}}function At(t,e,s,n,r){if(we){let o=t.compileWhile(e,s),c=Ne(n,r);return{ruleScanner:o,findOptions:c}}return{ruleScanner:t.compileWhileAG(e,s,n,r),findOptions:0}}function Ne(t,e){let s=0;if(!t)s|=1;if(!e)s|=4;return s}function v(t,e,s,n,r,i,o){if(i.length===0)return;let c=e.content,a=Math.min(i.length,o.length),l=[],u=o[0].end;for(let h=0;h<a;h++){let f=i[h];if(f===null)continue;let d=o[h];if(d.length===0)continue;if(d.start>u)break;while(l.length>0&&l[l.length-1].endPos<=d.start)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0)r.produceFromScopes(l[l.length-1].scopes,d.start);else r.produce(n,d.start);if(f.retokenizeCapturedWithRuleId){let E=f.getName(c,o),m=n.contentNameScopesList.pushAttributed(E,t),R=f.getContentName(c,o),g=m.pushAttributed(R,t),y=n.push(f.retokenizeCapturedWithRuleId,d.start,-1,!1,null,m,g),C=t.createOnigString(c.substring(0,d.end));ke(t,C,s&&d.start===0,d.start,y,r,!1,0),be(C);continue}let p=f.getName(c,o);if(p!==null){let m=(l.length>0?l[l.length-1].scopes:n.contentNameScopesList).pushAttributed(p,t);l.push(new yt(m,d.end))}}while(l.length>0)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var yt=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function It(t,e,s,n,r,i,o,c){return new kt(t,e,s,n,r,i,o,c)}function he(t,e,s,n,r){let i=F(e,U),o=Ie.getCompiledRuleId(s,n,r.repository);for(let c of i)t.push({debugSelector:e,matcher:c.matcher,ruleId:o,grammar:r,priority:c.priority})}function U(t,e){if(e.length<t.length)return!1;let s=0;return t.every((n)=>{for(let r=s;r<e.length;r++)if(wt(e[r],n))return s=r+1,!0;return!1})}function wt(t,e){if(!t)return!1;if(t===e)return!0;let s=e.length;return t.length>s&&t.substr(0,s)===e&&t[s]==="."}var kt=class{constructor(t,e,s,n,r,i,o,c){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=c,this._basicScopeAttributesProvider=new _t(s,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=de(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(let a of Object.keys(r)){let l=F(a,U);for(let u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[a]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let t of this._ruleId2desc)if(t)t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){let t={lookup:(r)=>{if(r===this._rootScopeName)return this._grammar;return this.getExternalGrammar(r)},injections:(r)=>this._grammarRepository.injections(r)},e=[],s=this._rootScopeName,n=t.lookup(s);if(n){let r=n.injections;if(r)for(let o in r)he(e,o,r[o],this,n);let i=this._grammarRepository.injections(s);if(i)i.forEach((o)=>{let c=this.getExternalGrammar(o);if(c){let a=c.injectionSelector;if(a)he(e,a,c,this,c)}})}return e.sort((r,i)=>r.priority-i.priority),e}getInjections(){if(this._injections===null)this._injections=this._collectInjections();return this._injections}registerRule(t){let e=++this._lastRuleId,s=t(Ae(e));return this._ruleId2desc[e]=s,s}getRule(t){return this._ruleId2desc[ye(t)]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];else if(this._grammarRepository){let s=this._grammarRepository.lookup(t);if(s)return this._includedGrammars[t]=de(s,e&&e.$base),this._includedGrammars[t]}return}tokenizeLine(t,e,s=0){let n=this._tokenize(t,e,!1,s);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(t,e,s=0){let n=this._tokenize(t,e,!0,s);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(t,e,s,n){if(this._rootId===-1)this._rootId=Ie.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections();let r;if(!e||e===te.NULL){r=!0;let l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=j.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null),d;if(f)d=N.createRootAndLookUpScopeName(f,h,this);else d=N.createRoot("unknown",h);e=new te(null,this._rootId,-1,-1,!1,null,d,d)}else r=!1,e.reset();t=t+`
6
- `;let i=this.createOnigString(t),o=i.content.length,c=new Nt(s,t,this._tokenTypeMatchers,this.balancedBracketSelectors),a=ke(this,i,r,0,e,c,!0,n);return be(i),{lineLength:o,lineTokens:c,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function de(t,e){return t=Ue(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var N=class t{constructor(e,s,n){this.parent=e,this.scopePath=s,this.tokenAttributes=n}static fromExtension(e,s){let n=e,r=e?.scopePath??null;for(let i of s)r=V.push(r,i.scopeNames),n=new t(n,r,i.encodedTokenAttributes);return n}static createRoot(e,s){return new t(null,new V(null,e),s)}static createRootAndLookUpScopeName(e,s,n){let r=n.getMetadataForScope(e),i=new V(null,e),o=n.themeProvider.themeMatch(i),c=t.mergeAttributes(s,r,o);return new t(null,i,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return t.equals(this,e)}static equals(e,s){do{if(e===s)return!0;if(!e&&!s)return!0;if(!e||!s)return!1;if(e.scopeName!==s.scopeName||e.tokenAttributes!==s.tokenAttributes)return!1;e=e.parent,s=s.parent}while(!0)}static mergeAttributes(e,s,n){let r=-1,i=0,o=0;if(n!==null)r=n.fontStyle,i=n.foregroundId,o=n.backgroundId;return j.set(e,s.languageId,s.tokenType,null,r,i,o)}pushAttributed(e,s){if(e===null)return this;if(e.indexOf(" ")===-1)return t._pushAttributed(this,e,s);let n=e.split(/ /g),r=this;for(let i of n)r=t._pushAttributed(r,i,s);return r}static _pushAttributed(e,s,n){let r=n.getMetadataForScope(s),i=e.scopePath.push(s),o=n.themeProvider.themeMatch(i),c=t.mergeAttributes(e.tokenAttributes,r,o);return new t(e,i,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let s=[],n=this;while(n&&n!==e)s.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?s.reverse():void 0}},te=class t{constructor(e,s,n,r,i,o,c,a){this.parent=e,this.ruleId=s,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new t(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){if(e===null)return!1;return t._equals(this,e)}static _equals(e,s){if(e===s)return!0;if(!this._structuralEquals(e,s))return!1;return N.equals(e.contentNameScopesList,s.contentNameScopesList)}static _structuralEquals(e,s){do{if(e===s)return!0;if(!e&&!s)return!0;if(!e||!s)return!1;if(e.depth!==s.depth||e.ruleId!==s.ruleId||e.endRule!==s.endRule)return!1;e=e.parent,s=s.parent}while(!0)}clone(){return this}static _reset(e){while(e)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){t._reset(this)}pop(){return this.parent}safePop(){if(this.parent)return this.parent;return this}push(e,s,n,r,i,o,c){return new t(this,e,s,n,r,i,o,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,s){if(this.parent)s=this.parent._writeString(e,s);return e[s++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,s}withContentNameScopesList(e){if(this.contentNameScopesList===e)return this;return this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){if(this.endRule===e)return this;return new t(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let s=this;while(s&&s._enterPos===e._enterPos){if(s.ruleId===e.ruleId)return!0;s=s.parent}return!1}toStateStackFrame(){return{ruleId:ye(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,s){let n=N.fromExtension(e?.nameScopesList??null,s.nameScopesList);return new t(e,Ae(s.ruleId),s.enterPos??-1,s.anchorPos??-1,s.beginRuleCapturedEOL,s.endRule,n,N.fromExtension(n,s.contentNameScopesList))}},vt=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap((s)=>{if(s==="*")return this.allowAny=!0,[];return F(s,U).map((n)=>n.matcher)}),this.unbalancedBracketScopes=e.flatMap((s)=>F(s,U).map((n)=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(let e of this.unbalancedBracketScopes)if(e(t))return!1;for(let e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Nt=class{constructor(t,e,s,n){this.balancedBracketSelectors=n,this._emitBinaryTokens=t,this._tokenTypeOverrides=s,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let n=t?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways)r=!0;if(this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let i=t?.getScopeNames()??[];for(let o of this._tokenTypeOverrides)if(o.matcher(i))n=j.set(n,0,tt(o.type),null,-1,0,0);if(this.balancedBracketSelectors)r=this.balancedBracketSelectors.match(i)}if(r)n=j.set(n,0,8,r,-1,0,0);if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=e;return}let s=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:s}),this._lastTokenEndIndex=e}getResult(t,e){if(this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1)this._tokens.pop();if(this._tokens.length===0)this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0;return this._tokens}getBinaryResult(t,e){if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1)this._binaryTokens.pop(),this._binaryTokens.pop();if(this._binaryTokens.length===0)this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0;let s=new Uint32Array(this._binaryTokens.length);for(let n=0,r=this._binaryTokens.length;n<r;n++)s[n]=this._binaryTokens[n];return s}},Tt=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){if(this._rawGrammars.set(t.scopeName,t),e)this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,s,n,r){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,It(t,i,e,s,n,r,this,this._onigLib))}return this._grammars.get(t)}},vs=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new Tt(Y.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,e){this._syncRegistry.setTheme(Y.createFromRawTheme(t,e))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,e,s){return this.loadGrammarWithConfiguration(t,e,{embeddedLanguages:s})}loadGrammarWithConfiguration(t,e,s){return this._loadGrammar(t,e,s.embeddedLanguages,s.tokenTypes,new vt(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,e,s,n,r){let i=new ot(this._syncRegistry,t);while(i.Q.length>0)i.Q.map((o)=>this._loadSingleGrammar(o.scopeName)),i.processQueue();return this._grammarForScopeName(t,e,s,n,r)}_loadSingleGrammar(t){if(!this._ensureGrammarCache.has(t))this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0)}_doLoadSingleGrammar(t){let e=this._options.loadGrammar(t);if(e){let s=typeof this._options.getInjections==="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(e,s)}}addGrammar(t,e=[],s=0,n=null){return this._syncRegistry.addGrammar(t,e),this._grammarForScopeName(t.scopeName,s,n)}_grammarForScopeName(t,e=0,s=null,n=null,r=null){return this._syncRegistry.grammarForScopeName(t,e,s,n,r)}},Ns=te.NULL;function un(t){return`annotation-${"side"in t?`${t.side}-`:""}${t.lineNumber}`}var Lt=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Pt=/^0(?:\.0+)?%?$/;function xt(t){let e=t.indexOf("(");if(e<=0||!t.endsWith(")"))return;let s=t.slice(0,e).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(s))return;let n=t.slice(e+1,-1).trim();if(n.length===0)return;let r=n.lastIndexOf("/");if(r!==-1)return n.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(s)){let i=n.split(",");if(i.length===4)return i[3]?.trim()}}function G(t){let e=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(t.trim());if(e==null)return null;let s=e[1],n,r=1;if(s.length===3)n=s.split("").map((i)=>i+i).join("");else if(s.length===6)n=s;else n=s.slice(0,6),r=parseInt(s.slice(6,8),16)/255;return[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16),r]}function _(t){if(t==null)return null;let e=G(t);if(e==null)return null;let s=e[0]/255,n=e[1]/255,r=e[2]/255,i=(o)=>o<=0.03928?o/12.92:((o+0.055)/1.055)**2.4;return 0.2126*i(s)+0.7152*i(n)+0.0722*i(r)}function q(t,e){let[s,n]=t>e?[t,e]:[e,t];return(s+0.05)/(n+0.05)}function Te(t,e){if(e==null)return;let s=G(t),n=G(e);if(s==null||n==null)return;let[r,i,o,c]=s,[a,l,u]=n;return"#"+[Math.round(r*c+a*(1-c)),Math.round(i*c+l*(1-c)),Math.round(o*c+u*(1-c))].map((h)=>h.toString(16).padStart(2,"0")).join("")}function M(t){if(t==null)return!1;let e=t.trim().toLowerCase();if(e==="transparent")return!0;if(Lt.test(e))return!0;let s=xt(e);return s!=null&&Pt.test(s)}function Le(t,e){let s=_(t);if(s!=null)return s<0.4;let n=_(e);return n!=null?n>0.6:!1}function Pe(t,e){if(t==null||e==null)return!1;if(t.trim().toLowerCase()===e.trim().toLowerCase())return!0;let s=_(t),n=_(e);if(s==null||n==null)return!1;return Math.abs(s-n)<0.06}function z(t,e,s){if(e==null||s==null)return!1;let n=_(t),r=_(e),i=_(s);if(n==null||r==null||i==null)return!1;return Math.abs(n-i)<Math.abs(n-r)}function xe(t,e){let s=_(t),n=e.find((o)=>o!=null&&o!=="");if(s==null)return n;let r,i=-1;for(let o of e){if(o==null||o==="")continue;let c=_(o);if(c==null)continue;let a=q(s,c);if(a>=3)return o;if(a>i)r=o,i=a}return r??n}function Ge(t,e){if(e==null)return t;let s=G(t),n=G(e),r=_(e);if(s==null||n==null||r==null)return`color-mix(in srgb, ${t} 70%, ${e})`;let[i,o,c]=s,[a,l,u]=n;for(let h of[0.6,0.7,0.8,0.9]){let f="#"+[Math.round(i*h+a*(1-h)),Math.round(o*h+l*(1-h)),Math.round(c*h+u*(1-h))].map((p)=>p.toString(16).padStart(2,"0")).join(""),d=_(f);if(d!=null&&q(r,d)>=4.5)return f}return t}var Me=new WeakMap;function Gt(t){let e=Me.get(t);if(e!=null)return e;let s=t.colors??{},n={...s},r=s["editor.background"]??t.bg,i=s["editor.foreground"]??t.fg,o=s["sideBar.background"]??r,c=s["sideBar.foreground"]??i;S(n,"editor.background",r),S(n,"editor.foreground",i),S(n,"sideBar.background",o),S(n,"sideBar.foreground",c),S(n,"input.background",s["input.background"]??o),S(n,"sideBarSectionHeader.foreground",s["sideBarSectionHeader.foreground"]??c),S(n,"list.activeSelectionForeground",s["list.activeSelectionForeground"]??c),S(n,"gitDecoration.addedResourceForeground",ne(s["gitDecoration.addedResourceForeground"],s["terminal.ansiGreen"],s["editorGutter.addedBackground"])),S(n,"gitDecoration.modifiedResourceForeground",ne(s["gitDecoration.modifiedResourceForeground"],s["terminal.ansiBlue"],s["editorGutter.modifiedBackground"])),S(n,"gitDecoration.deletedResourceForeground",ne(s["gitDecoration.deletedResourceForeground"],s["terminal.ansiRed"],s["editorGutter.deletedBackground"]));let a=(M(s["list.focusOutline"])?void 0:s["list.focusOutline"])??(M(s.focusBorder)?void 0:s.focusBorder);if(a!=null)n["list.focusOutline"]=a;else delete n["list.focusOutline"];let l=s["list.hoverBackground"];if(l!=null&&(Mt(l,o)||z(l,o,c)))delete n["list.hoverBackground"];let u=Object.freeze({...t,colors:Object.freeze(n)});return Me.set(t,u),u}function S(t,e,s){if(s!=null&&s!=="")t[e]=s}function ne(...t){for(let e of t)if(e!=null&&e!=="")return e}function Mt(t,e){return e!=null&&t.toLowerCase()===e.toLowerCase()}var _n={compositeOverBg:Te,contrastRatio:q,deriveMutedFg:Ge,hoverWouldEraseText:z,isDarkSurface:Le,isFullyTransparent:M,pickReadableForeground:xe,relativeLuminance:_,surfacesMatch:Pe};var Be=new WeakMap;function En(t){let e=Be.get(t);return e==null?t:e}function bn(t,e){Be.set(t,e)}function Bt(t){return t.map((e)=>({...e,hunkContent:e.hunkContent.map((s)=>({...s}))}))}function Cn(t){return{...t,hunks:Bt(t.hunks),deletionLines:[...t.deletionLines],additionLines:[...t.additionLines]}}
7
- export{Y as I,Qe as J,j as K,vs as L,Ns as M,Ot as N,jt as O,Ft as P,Dt as Q,$t as R,Wt as S,Ut as T,qt as U,zt as V,Ht as W,Kt as X,Xt as Y,Vt as Z,Qt as _,Yt as $,Zt as aa,Jt as ba,es as ca,ts as da,ss as ea,ns as fa,Oe as ga,rs as ha,is as ia,os as ja,as as ka,cs as la,ls as ma,hs as na,ds as oa,fs as pa,gs as qa,_s as ra,Rs as sa,un as ta,Fe as ua,bs as va,Ss as wa,Gt as xa,_n as ya,En as za,bn as Aa,As as Ba,ys as Ca,Bt as Da,Cn as Ea};
4
+ `,o);if(e.push(o),++i===4){if(o-r<=40){for(let c=o;c<t.length;c++){let a=t.charCodeAt(c);if(a===10||a===13){if(a===13&&c+1<t.length&&t.charCodeAt(c+1)===10)c++;e.push(c+1)}}return e}r=o,i=0}}return e}function Ss(t){let e=0;for(let s=0;s<t.length;s++){let n=t.charCodeAt(s);if(n===10||n===13){if(n===13&&s+1<t.length&&t.charCodeAt(s+1)===10)s++;e++}}return e}function Cs(t){let e=Fe(t);return Array.from({length:e.length},(s,n)=>{let r=e[n],i=e[n+1]??t.length;return t.slice(r,i)})}var De=void 0;var $e=void 0;function ys(){return De??=/macOS|MacIntel|iPhone|iPad|iPod/i.test(We())}function Is(){return $e??="safari"in window&&"pushNotification"in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function We(){let t=globalThis.navigator;return t?.platform??t?.userAgentData?.platform??"unknown"}function Ue(t){return se(t)}function se(t){if(Array.isArray(t))return qe(t);if(t instanceof RegExp)return t;if(typeof t==="object")return ze(t);return t}function qe(t){let e=[];for(let s=0,n=t.length;s<n;s++)e[s]=se(t[s]);return e}function ze(t){let e={};for(let s in t)e[s]=se(t[s]);return e}function pe(t,...e){return e.forEach((s)=>{for(let n in s)t[n]=s[n]}),t}function fe(t){let e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");if(e===0)return t;else if(~e===t.length-1)return fe(t.substring(0,t.length-1));else return t.substr(~e+1)}var X=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,B=class{static hasCaptures(t){if(t===null)return!1;return X.lastIndex=0,X.test(t)}static replaceCaptures(t,e,s){return t.replace(X,(n,r,i,o)=>{let c=s[parseInt(r||i,10)];if(c){let a=e.substring(c.start,c.end);while(a[0]===".")a=a.substring(1);switch(o){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return n})}};function me(t,e){if(t<e)return-1;if(t>e)return 1;return 0}function ge(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let s=t.length,n=e.length;if(s===n){for(let r=0;r<s;r++){let i=me(t[r],e[r]);if(i!==0)return i}return 0}return s-n}function ie(t){if(/^#[0-9a-f]{6}$/i.test(t))return!0;if(/^#[0-9a-f]{8}$/i.test(t))return!0;if(/^#[0-9a-f]{3}$/i.test(t))return!0;if(/^#[0-9a-f]{4}$/i.test(t))return!0;return!1}function _e(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Re=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);let e=this.fn(t);return this.cache.set(t,e),e}},Y=class{constructor(t,e,s){this._colorMap=t,this._defaults=e,this._root=s}static createFromRawTheme(t,e){return this.createFromParsedTheme(Xe(t),e)}static createFromParsedTheme(t,e){return Ye(t,e)}_cachedMatchRoot=new Re((t)=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;let e=t.scopeName,n=this._cachedMatchRoot.get(e).find((r)=>He(t.parent,r.parentScopes));if(!n)return null;return new Ee(n.fontStyle,n.foreground,n.background)}},V=class t{constructor(e,s){this.parent=e,this.scopeName=s}static push(e,s){for(let n of s)e=new t(e,n);return e}static from(...e){let s=null;for(let n=0;n<e.length;n++)s=new t(s,e[n]);return s}push(e){return new t(this,e)}getSegments(){let e=this,s=[];while(e)s.push(e.scopeName),e=e.parent;return s.reverse(),s}toString(){return this.getSegments().join(" ")}extends(e){if(this===e)return!0;if(this.parent===null)return!1;return this.parent.extends(e)}getExtensionIfDefined(e){let s=[],n=this;while(n&&n!==e)s.push(n.scopeName),n=n.parent;return n===e?s.reverse():void 0}};function He(t,e){if(e.length===0)return!0;for(let s=0;s<e.length;s++){let n=e[s],r=!1;if(n===">"){if(s===e.length-1)return!1;n=e[++s],r=!0}while(t){if(Ke(t.scopeName,n))break;if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Ke(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Ee=class{constructor(t,e,s){this.fontStyle=t,this.foregroundId=e,this.backgroundId=s}};function Xe(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,s=[],n=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let c;if(typeof o.scope==="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),c=h.split(",")}else if(Array.isArray(o.scope))c=o.scope;else c=[""];let a=-1;if(typeof o.settings.fontStyle==="string"){a=0;let h=o.settings.fontStyle.split(" ");for(let f=0,d=h.length;f<d;f++)switch(h[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 l=null;if(typeof o.settings.foreground==="string"&&ie(o.settings.foreground))l=o.settings.foreground;let u=null;if(typeof o.settings.background==="string"&&ie(o.settings.background))u=o.settings.background;for(let h=0,f=c.length;h<f;h++){let p=c[h].trim().split(" "),E=p[p.length-1],m=null;if(p.length>1)m=p.slice(0,p.length-1),m.reverse();s[n++]=new Ve(E,m,r,a,l,u)}}return s}var Ve=class{constructor(t,e,s,n,r,i){this.scope=t,this.parentScopes=e,this.index=s,this.fontStyle=n,this.foreground=r,this.background=i}},Qe=((t)=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(Qe||{});function Ye(t,e){t.sort((a,l)=>{let u=me(a.scope,l.scope);if(u!==0)return u;if(u=ge(a.parentScopes,l.parentScopes),u!==0)return u;return a.index-l.index});let s=0,n="#000000",r="#ffffff";while(t.length>=1&&t[0].scope===""){let a=t.shift();if(a.fontStyle!==-1)s=a.fontStyle;if(a.foreground!==null)n=a.foreground;if(a.background!==null)r=a.background}let i=new Ze(e),o=new Ee(s,i.getId(n),i.getId(r)),c=new et(new Z(0,null,-1,0,0),[]);for(let a=0,l=t.length;a<l;a++){let u=t[a];c.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new Y(i,o,c)}var Ze=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,s=t.length;e<s;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Je=Object.freeze([]),Z=class t{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,s,n,r,i){this.scopeDepth=e,this.parentScopes=s||Je,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new t(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let s=[];for(let n=0,r=e.length;n<r;n++)s[n]=e[n].clone();return s}acceptOverwrite(e,s,n,r){if(this.scopeDepth>e)console.log("how did this happen?");else this.scopeDepth=e;if(s!==-1)this.fontStyle=s;if(n!==0)this.foreground=n;if(r!==0)this.background=r}},et=class t{constructor(e,s=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=s}_rulesWithParentScopes;static _cmpBySpecificity(e,s){if(e.scopeDepth!==s.scopeDepth)return s.scopeDepth-e.scopeDepth;let n=0,r=0;while(!0){if(e.parentScopes[n]===">")n++;if(s.parentScopes[r]===">")r++;if(n>=e.parentScopes.length||r>=s.parentScopes.length)break;let i=s.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return s.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let n=e.indexOf("."),r,i;if(n===-1)r=e,i="";else r=e.substring(0,n),i=e.substring(n+1);if(this._children.hasOwnProperty(r))return this._children[r].match(i)}let s=this._rulesWithParentScopes.concat(this._mainRule);return s.sort(t._cmpBySpecificity),s}insert(e,s,n,r,i,o){if(s===""){this._doInsertHere(e,n,r,i,o);return}let c=s.indexOf("."),a,l;if(c===-1)a=s,l="";else a=s.substring(0,c),l=s.substring(c+1);let u;if(this._children.hasOwnProperty(a))u=this._children[a];else u=new t(this._mainRule.clone(),Z.cloneArr(this._rulesWithParentScopes)),this._children[a]=u;u.insert(e+1,l,n,r,i,o)}_doInsertHere(e,s,n,r,i){if(s===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let a=this._rulesWithParentScopes[o];if(ge(a.parentScopes,s)===0){a.acceptOverwrite(e,n,r,i);return}}if(n===-1)n=this._mainRule.fontStyle;if(r===0)r=this._mainRule.foreground;if(i===0)i=this._mainRule.background;this._rulesWithParentScopes.push(new Z(e,s,n,r,i))}},j=class t{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){let s=t.getLanguageId(e),n=t.getTokenType(e),r=t.getFontStyle(e),i=t.getForeground(e),o=t.getBackground(e);console.log({languageId:s,tokenType:n,fontStyle:r,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,s,n,r,i,o,c){let a=t.getLanguageId(e),l=t.getTokenType(e),u=t.containsBalancedBrackets(e)?1:0,h=t.getFontStyle(e),f=t.getForeground(e),d=t.getBackground(e);if(s!==0)a=s;if(n!==8)l=st(n);if(r!==null)u=r?1:0;if(i!==-1)h=i;if(o!==0)f=o;if(c!==0)d=c;return(a<<0|l<<8|u<<10|h<<11|f<<15|d<<24)>>>0}};function tt(t){return t}function st(t){return t}function F(t,e){let s=[],n=nt(t),r=n.next();while(r!==null){let a=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=n.next()}let l=o();if(s.push({matcher:l,priority:a}),r!==",")break;r=n.next()}return s;function i(){if(r==="-"){r=n.next();let a=i();return(l)=>!!a&&!a(l)}if(r==="("){r=n.next();let a=c();if(r===")")r=n.next();return a}if(oe(r)){let a=[];do a.push(r),r=n.next();while(oe(r));return(l)=>e(a,l)}return null}function o(){let a=[],l=i();while(l)a.push(l),l=i();return(u)=>a.every((h)=>h(u))}function c(){let a=[],l=o();while(l){if(a.push(l),r==="|"||r===",")do r=n.next();while(r==="|"||r===",");else break;l=o()}return(u)=>a.some((h)=>h(u))}}function oe(t){return!!t&&!!t.match(/[\w\.:]+/)}function nt(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,s=e.exec(t);return{next:()=>{if(!s)return null;let n=s[0];return s=e.exec(t),n}}}var rt=((t)=>(t[t.None=0]="None",t[t.NotBeginString=1]="NotBeginString",t[t.NotEndString=2]="NotEndString",t[t.NotBeginPosition=4]="NotBeginPosition",t[t.DebugCall=8]="DebugCall",t))(rt||{});function be(t){if(typeof t.dispose==="function")t.dispose()}var T=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},it=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},ot=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){let e=t.toKey();if(this._seenReferenceKeys.has(e))return;this._seenReferenceKeys.add(e),this._references.push(t)}},at=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new T(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let t=this.Q;this.Q=[];let e=new ot;for(let s of t)ct(s,this.initialScopeName,this.repo,e);for(let s of e.references)if(s instanceof T){if(this.seenFullScopeRequests.has(s.scopeName))continue;this.seenFullScopeRequests.add(s.scopeName),this.Q.push(s)}else{if(this.seenFullScopeRequests.has(s.scopeName))continue;if(this.seenPartialScopeRequests.has(s.toKey()))continue;this.seenPartialScopeRequests.add(s.toKey()),this.Q.push(s)}}};function ct(t,e,s,n){let r=s.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw Error(`No grammar provided for <${e}>`);return}let i=s.lookup(e);if(t instanceof T)O({baseGrammar:i,selfGrammar:r},n);else J(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},n);let o=s.injections(t.scopeName);if(o)for(let c of o)n.add(new T(c))}function J(t,e,s){if(e.repository&&e.repository[t]){let n=e.repository[t];D([n],e,s)}}function O(t,e){if(t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns))D(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e);if(t.selfGrammar.injections)D(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function D(t,e,s){for(let n of t){if(s.visitedRule.has(n))continue;s.visitedRule.add(n);let r=n.repository?pe({},e.repository,n.repository):e.repository;if(Array.isArray(n.patterns))D(n.patterns,{...e,repository:r},s);let i=n.include;if(!i)continue;let o=Se(i);switch(o.kind){case 0:O({...e,selfGrammar:e.baseGrammar},s);break;case 1:O(e,s);break;case 2:J(o.ruleName,{...e,repository:r},s);break;case 3:case 4:let c=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){let a={baseGrammar:e.baseGrammar,selfGrammar:c,repository:r};if(o.kind===4)J(o.ruleName,a,s);else O(a,s)}else if(o.kind===4)s.add(new it(o.scopeName,o.ruleName));else s.add(new T(o.scopeName));break}}}var lt=class{kind=0},ut=class{kind=1},ht=class{constructor(t){this.ruleName=t}kind=2},dt=class{constructor(t){this.scopeName=t}kind=3},pt=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Se(t){if(t==="$base")return new lt;else if(t==="$self")return new ut;let e=t.indexOf("#");if(e===-1)return new dt(t);else if(e===0)return new ht(t.substring(1));else{let s=t.substring(0,e),n=t.substring(e+1);return new pt(s,n)}}var ft=/\\(\d+)/,ae=/\\(\d+)/g,ks=Symbol("RuleId"),mt=-1,Ce=-2;function Ae(t){return t}function ye(t){return t}var x=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,s,n){this.$location=t,this.id=e,this._name=s||null,this._nameIsCapturing=B.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=B.hasCaptures(this._contentName)}get debugName(){let t=this.$location?`${fe(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){if(!this._nameIsCapturing||this._name===null||t===null||e===null)return this._name;return B.replaceCaptures(this._name,t,e)}getContentName(t,e){if(!this._contentNameIsCapturing||this._contentName===null)return this._contentName;return B.replaceCaptures(this._contentName,t,e)}},gt=class extends x{retokenizeCapturedWithRuleId;constructor(t,e,s,n,r){super(t,e,s,n);this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw Error("Not supported!")}compile(t,e){throw Error("Not supported!")}compileAG(t,e,s,n){throw Error("Not supported!")}},_t=class extends x{_match;captures;_cachedCompiledPatterns;constructor(t,e,s,n,r){super(t,e,s,null);this._match=new L(n,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,s,n){return this._getCachedCompiledPatterns(t).compileAG(t,s,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new P,this.collectPatterns(t,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},ce=class extends x{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,s,n,r){super(t,e,s,n);this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}collectPatterns(t,e){for(let s of this.patterns)t.getRule(s).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,s,n){return this._getCachedCompiledPatterns(t).compileAG(t,s,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new P,this.collectPatterns(t,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},ee=class extends x{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,s,n,r,i,o,c,a,l){super(t,e,s,n);this._begin=new L(r,this.id),this.beginCaptures=i,this._end=new L(o?o:"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=a||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,s,n){return this._getCachedCompiledPatterns(t,e).compileAG(t,s,n)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let s of this.patterns)t.getRule(s).collectPatterns(t,this._cachedCompiledPatterns);if(this.applyEndPatternLast)this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end);else this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}if(this._end.hasBackReferences)if(this.applyEndPatternLast)this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e);else this._cachedCompiledPatterns.setSource(0,e);return this._cachedCompiledPatterns}},W=class extends x{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,s,n,r,i,o,c,a){super(t,e,s,n);this._begin=new L(r,this.id),this.beginCaptures=i,this.whileCaptures=c,this._while=new L(o,Ce),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null;if(this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,s,n){return this._getCachedCompiledPatterns(t).compileAG(t,s,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,s,n){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,s,n)}_getCachedCompiledWhilePatterns(t,e){if(!this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns=new P,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while);if(this._while.hasBackReferences)this._cachedCompiledWhilePatterns.setSource(0,e?e:"￿");return this._cachedCompiledWhilePatterns}},Ie=class t{static createCaptureRule(e,s,n,r,i){return e.registerRule((o)=>new gt(s,o,n,r,i))}static getCompiledRuleId(e,s,n){if(!e.id)s.registerRule((r)=>{if(e.id=r,e.match)return new _t(e.$vscodeTextmateLocation,e.id,e.name,e.match,t._compileCaptures(e.captures,s,n));if(typeof e.begin>"u"){if(e.repository)n=pe({},n,e.repository);let i=e.patterns;if(typeof i>"u"&&e.include)i=[{include:e.include}];return new ce(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,t._compilePatterns(i,s,n))}if(e.while)return new W(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,t._compileCaptures(e.beginCaptures||e.captures,s,n),e.while,t._compileCaptures(e.whileCaptures||e.captures,s,n),t._compilePatterns(e.patterns,s,n));return new ee(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,t._compileCaptures(e.beginCaptures||e.captures,s,n),e.end,t._compileCaptures(e.endCaptures||e.captures,s,n),e.applyEndPatternLast,t._compilePatterns(e.patterns,s,n))});return e.id}static _compileCaptures(e,s,n){let r=[];if(e){let i=0;for(let o in e){if(o==="$vscodeTextmateLocation")continue;let c=parseInt(o,10);if(c>i)i=c}for(let o=0;o<=i;o++)r[o]=null;for(let o in e){if(o==="$vscodeTextmateLocation")continue;let c=parseInt(o,10),a=0;if(e[o].patterns)a=t.getCompiledRuleId(e[o],s,n);r[c]=t.createCaptureRule(s,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,a)}}return r}static _compilePatterns(e,s,n){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){let c=e[i],a=-1;if(c.include){let l=Se(c.include);switch(l.kind){case 0:case 1:a=t.getCompiledRuleId(n[c.include],s,n);break;case 2:let u=n[l.ruleName];if(u)a=t.getCompiledRuleId(u,s,n);break;case 3:case 4:let h=l.scopeName,f=l.kind===4?l.ruleName:null,d=s.getExternalGrammar(h,n);if(d)if(f){let p=d.repository[f];if(p)a=t.getCompiledRuleId(p,s,d.repository)}else a=t.getCompiledRuleId(d.repository.$self,s,d.repository);break}}else a=t.getCompiledRuleId(c,s,n);if(a!==-1){let l=s.getRule(a),u=!1;if(l instanceof ce||l instanceof ee||l instanceof W){if(l.hasMissingPatterns&&l.patterns.length===0)u=!0}if(u)continue;r.push(a)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},L=class t{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,s){if(e&&typeof e==="string"){let n=e.length,r=0,i=[],o=!1;for(let c=0;c<n;c++)if(e.charAt(c)==="\\"){if(c+1<n){let l=e.charAt(c+1);if(l==="z")i.push(e.substring(r,c)),i.push("$(?!\\n)(?<!\\n)"),r=c+2;else if(l==="A"||l==="G")o=!0;c++}}if(this.hasAnchor=o,r===0)this.source=e;else i.push(e.substring(r,n)),this.source=i.join("")}else this.hasAnchor=!1,this.source=e;if(this.hasAnchor)this._anchorCache=this._buildAnchorCache();else this._anchorCache=null;if(this.ruleId=s,typeof this.source==="string")this.hasBackReferences=ft.test(this.source);else this.hasBackReferences=!1}clone(){return new t(this.source,this.ruleId)}setSource(e){if(this.source===e)return;if(this.source=e,this.hasAnchor)this._anchorCache=this._buildAnchorCache()}resolveBackReferences(e,s){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let n=s.map((r)=>e.substring(r.start,r.end));return ae.lastIndex=0,this.source.replace(ae,(r,i)=>_e(n[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let e=[],s=[],n=[],r=[],i,o,c,a;for(i=0,o=this.source.length;i<o;i++)if(c=this.source.charAt(i),e[i]=c,s[i]=c,n[i]=c,r[i]=c,c==="\\"){if(i+1<o){if(a=this.source.charAt(i+1),a==="A")e[i+1]="￿",s[i+1]="￿",n[i+1]="A",r[i+1]="A";else if(a==="G")e[i+1]="￿",s[i+1]="G",n[i+1]="￿",r[i+1]="G";else e[i+1]=a,s[i+1]=a,n[i+1]=a,r[i+1]=a;i++}}return{A0_G0:e.join(""),A0_G1:s.join(""),A1_G0:n.join(""),A1_G1:r.join("")}}resolveAnchors(e,s){if(!this.hasAnchor||!this._anchorCache||typeof this.source!=="string")return this.source;if(e)if(s)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;else if(s)return this._anchorCache.A0_G1;else return this._anchorCache.A0_G0}},P=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){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(){if(this._cached)this._cached.dispose(),this._cached=null;if(this._anchorCache.A0_G0)this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null;if(this._anchorCache.A0_G1)this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null;if(this._anchorCache.A1_G0)this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null;if(this._anchorCache.A1_G1)this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){if(this._items[t].source!==e)this._disposeCaches(),this._items[t].setSource(e)}compile(t){if(!this._cached){let e=this._items.map((s)=>s.source);this._cached=new le(t,e,this._items.map((s)=>s.ruleId))}return this._cached}compileAG(t,e,s){if(!this._hasAnchors)return this.compile(t);else if(e)if(s){if(!this._anchorCache.A1_G1)this._anchorCache.A1_G1=this._resolveAnchors(t,e,s);return this._anchorCache.A1_G1}else{if(!this._anchorCache.A1_G0)this._anchorCache.A1_G0=this._resolveAnchors(t,e,s);return this._anchorCache.A1_G0}else if(s){if(!this._anchorCache.A0_G1)this._anchorCache.A0_G1=this._resolveAnchors(t,e,s);return this._anchorCache.A0_G1}else{if(!this._anchorCache.A0_G0)this._anchorCache.A0_G0=this._resolveAnchors(t,e,s);return this._anchorCache.A0_G0}}_resolveAnchors(t,e,s){let n=this._items.map((r)=>r.resolveAnchors(e,s));return new le(t,n,this._items.map((r)=>r.ruleId))}},le=class{constructor(t,e,s){this.regExps=e,this.rules=s,this.scanner=t.createOnigScanner(e)}scanner;dispose(){if(typeof this.scanner.dispose==="function")this.scanner.dispose()}toString(){let t=[];for(let e=0,s=this.rules.length;e<s;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
5
+ `)}findNextMatchSync(t,e,s){let n=this.scanner.findNextMatchSync(t,e,s);if(!n)return null;return{ruleId:this.rules[n.index],captureIndices:n.captureIndices}}},Q=class{constructor(t,e){this.languageId=t,this.tokenType=e}},Rt=class t{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,s){this._defaultAttributes=new Q(e,8),this._embeddedLanguagesMatcher=new Et(Object.entries(s||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){if(e===null)return t._NULL_SCOPE_METADATA;return this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new Q(0,0);_getBasicScopeAttributes=new Re((e)=>{let s=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new Q(s,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){let s=e.match(t.STANDARD_TOKEN_TYPE_REGEXP);if(!s)return 8;switch(s[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Et=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);let e=t.map(([s,n])=>_e(s));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;let e=t.match(this.scopesRegExp);if(!e)return;return this.values.get(e[1])}},vs={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},we=!1,ue=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function ke(t,e,s,n,r,i,o,c){let a=e.content.length,l=!1,u=-1;if(o){let d=bt(t,e,s,n,r,i);r=d.stack,n=d.linePos,s=d.isFirstLine,u=d.anchorPosition}let h=Date.now();while(!l){if(c!==0){if(Date.now()-h>c)return new ue(r,!0)}f()}return new ue(r,!1);function f(){let d=St(t,e,s,n,r,u);if(!d){i.produce(r,a),l=!0;return}let{captureIndices:p,matchedRuleId:E}=d,m=p&&p.length>0?p[0].end>n:!1;if(E===mt){let R=r.getRule(t);i.produce(r,p[0].start),r=r.withContentNameScopesList(r.nameScopesList),v(t,e,s,r,i,R.endCaptures,p),i.produce(r,p[0].end);let g=r;if(r=r.parent,u=g.getAnchorPos(),!m&&g.getEnterPos()===n){r=g,i.produce(r,a),l=!0;return}}else{let R=t.getRule(E);i.produce(r,p[0].start);let g=r,y=R.getName(e.content,p),C=r.contentNameScopesList.pushAttributed(y,t);if(r=r.push(E,n,u,p[0].end===a,null,C,C),R instanceof ee){let b=R;v(t,e,s,r,i,b.beginCaptures,p),i.produce(r,p[0].end),u=p[0].end;let H=b.getContentName(e.content,p),K=C.pushAttributed(H,t);if(r=r.withContentNameScopesList(K),b.endHasBackReferences)r=r.withEndRule(b.getEndWithResolvedBackReferences(e.content,p));if(!m&&g.hasSameRuleAs(r)){r=r.pop(),i.produce(r,a),l=!0;return}}else if(R instanceof W){let b=R;v(t,e,s,r,i,b.beginCaptures,p),i.produce(r,p[0].end),u=p[0].end;let H=b.getContentName(e.content,p),K=C.pushAttributed(H,t);if(r=r.withContentNameScopesList(K),b.whileHasBackReferences)r=r.withEndRule(b.getWhileWithResolvedBackReferences(e.content,p));if(!m&&g.hasSameRuleAs(r)){r=r.pop(),i.produce(r,a),l=!0;return}}else if(v(t,e,s,r,i,R.captures,p),i.produce(r,p[0].end),r=r.pop(),!m){r=r.safePop(),i.produce(r,a),l=!0;return}}if(p[0].end>n)n=p[0].end,s=!1}}function bt(t,e,s,n,r,i){let o=r.beginRuleCapturedEOL?0:-1,c=[];for(let a=r;a;a=a.pop()){let l=a.getRule(t);if(l instanceof W)c.push({rule:l,stack:a})}for(let a=c.pop();a;a=c.pop()){let{ruleScanner:l,findOptions:u}=yt(a.rule,t,a.stack.endRule,s,n===o),h=l.findNextMatchSync(e,n,u);if(h){if(h.ruleId!==Ce){r=a.stack.pop();break}if(h.captureIndices&&h.captureIndices.length){if(i.produce(a.stack,h.captureIndices[0].start),v(t,e,s,a.stack,i,a.rule.whileCaptures,h.captureIndices),i.produce(a.stack,h.captureIndices[0].end),o=h.captureIndices[0].end,h.captureIndices[0].end>n)n=h.captureIndices[0].end,s=!1}}else{r=a.stack.pop();break}}return{stack:r,linePos:n,anchorPosition:o,isFirstLine:s}}function St(t,e,s,n,r,i){let o=Ct(t,e,s,n,r,i),c=t.getInjections();if(c.length===0)return o;let a=At(c,t,e,s,n,r,i);if(!a)return o;if(!o)return a;let l=o.captureIndices[0].start,u=a.captureIndices[0].start;if(u<l||a.priorityMatch&&u===l)return a;return o}function Ct(t,e,s,n,r,i){let o=r.getRule(t),{ruleScanner:c,findOptions:a}=ve(o,t,r.endRule,s,n===i),l=c.findNextMatchSync(e,n,a);if(l)return{captureIndices:l.captureIndices,matchedRuleId:l.ruleId};return null}function At(t,e,s,n,r,i,o){let c=Number.MAX_VALUE,a=null,l,u=0,h=i.contentNameScopesList.getScopeNames();for(let f=0,d=t.length;f<d;f++){let p=t[f];if(!p.matcher(h))continue;let E=e.getRule(p.ruleId),{ruleScanner:m,findOptions:R}=ve(E,e,null,n,r===o),g=m.findNextMatchSync(s,r,R);if(!g)continue;let y=g.captureIndices[0].start;if(y>=c)continue;if(c=y,a=g.captureIndices,l=g.ruleId,u=p.priority,c===r)break}if(a)return{priorityMatch:u===-1,captureIndices:a,matchedRuleId:l};return null}function ve(t,e,s,n,r){if(we){let o=t.compile(e,s),c=Ne(n,r);return{ruleScanner:o,findOptions:c}}return{ruleScanner:t.compileAG(e,s,n,r),findOptions:0}}function yt(t,e,s,n,r){if(we){let o=t.compileWhile(e,s),c=Ne(n,r);return{ruleScanner:o,findOptions:c}}return{ruleScanner:t.compileWhileAG(e,s,n,r),findOptions:0}}function Ne(t,e){let s=0;if(!t)s|=1;if(!e)s|=4;return s}function v(t,e,s,n,r,i,o){if(i.length===0)return;let c=e.content,a=Math.min(i.length,o.length),l=[],u=o[0].end;for(let h=0;h<a;h++){let f=i[h];if(f===null)continue;let d=o[h];if(d.length===0)continue;if(d.start>u)break;while(l.length>0&&l[l.length-1].endPos<=d.start)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0)r.produceFromScopes(l[l.length-1].scopes,d.start);else r.produce(n,d.start);if(f.retokenizeCapturedWithRuleId){let E=f.getName(c,o),m=n.contentNameScopesList.pushAttributed(E,t),R=f.getContentName(c,o),g=m.pushAttributed(R,t),y=n.push(f.retokenizeCapturedWithRuleId,d.start,-1,!1,null,m,g),C=t.createOnigString(c.substring(0,d.end));ke(t,C,s&&d.start===0,d.start,y,r,!1,0),be(C);continue}let p=f.getName(c,o);if(p!==null){let m=(l.length>0?l[l.length-1].scopes:n.contentNameScopesList).pushAttributed(p,t);l.push(new It(m,d.end))}}while(l.length>0)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var It=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function wt(t,e,s,n,r,i,o,c){return new vt(t,e,s,n,r,i,o,c)}function he(t,e,s,n,r){let i=F(e,U),o=Ie.getCompiledRuleId(s,n,r.repository);for(let c of i)t.push({debugSelector:e,matcher:c.matcher,ruleId:o,grammar:r,priority:c.priority})}function U(t,e){if(e.length<t.length)return!1;let s=0;return t.every((n)=>{for(let r=s;r<e.length;r++)if(kt(e[r],n))return s=r+1,!0;return!1})}function kt(t,e){if(!t)return!1;if(t===e)return!0;let s=e.length;return t.length>s&&t.substr(0,s)===e&&t[s]==="."}var vt=class{constructor(t,e,s,n,r,i,o,c){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=c,this._basicScopeAttributesProvider=new Rt(s,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=de(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(let a of Object.keys(r)){let l=F(a,U);for(let u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[a]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let t of this._ruleId2desc)if(t)t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){let t={lookup:(r)=>{if(r===this._rootScopeName)return this._grammar;return this.getExternalGrammar(r)},injections:(r)=>this._grammarRepository.injections(r)},e=[],s=this._rootScopeName,n=t.lookup(s);if(n){let r=n.injections;if(r)for(let o in r)he(e,o,r[o],this,n);let i=this._grammarRepository.injections(s);if(i)i.forEach((o)=>{let c=this.getExternalGrammar(o);if(c){let a=c.injectionSelector;if(a)he(e,a,c,this,c)}})}return e.sort((r,i)=>r.priority-i.priority),e}getInjections(){if(this._injections===null)this._injections=this._collectInjections();return this._injections}registerRule(t){let e=++this._lastRuleId,s=t(Ae(e));return this._ruleId2desc[e]=s,s}getRule(t){return this._ruleId2desc[ye(t)]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];else if(this._grammarRepository){let s=this._grammarRepository.lookup(t);if(s)return this._includedGrammars[t]=de(s,e&&e.$base),this._includedGrammars[t]}return}tokenizeLine(t,e,s=0){let n=this._tokenize(t,e,!1,s);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(t,e,s=0){let n=this._tokenize(t,e,!0,s);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(t,e,s,n){if(this._rootId===-1)this._rootId=Ie.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections();let r;if(!e||e===te.NULL){r=!0;let l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=j.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null),d;if(f)d=N.createRootAndLookUpScopeName(f,h,this);else d=N.createRoot("unknown",h);e=new te(null,this._rootId,-1,-1,!1,null,d,d)}else r=!1,e.reset();t=t+`
6
+ `;let i=this.createOnigString(t),o=i.content.length,c=new Tt(s,t,this._tokenTypeMatchers,this.balancedBracketSelectors),a=ke(this,i,r,0,e,c,!0,n);return be(i),{lineLength:o,lineTokens:c,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function de(t,e){return t=Ue(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var N=class t{constructor(e,s,n){this.parent=e,this.scopePath=s,this.tokenAttributes=n}static fromExtension(e,s){let n=e,r=e?.scopePath??null;for(let i of s)r=V.push(r,i.scopeNames),n=new t(n,r,i.encodedTokenAttributes);return n}static createRoot(e,s){return new t(null,new V(null,e),s)}static createRootAndLookUpScopeName(e,s,n){let r=n.getMetadataForScope(e),i=new V(null,e),o=n.themeProvider.themeMatch(i),c=t.mergeAttributes(s,r,o);return new t(null,i,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return t.equals(this,e)}static equals(e,s){do{if(e===s)return!0;if(!e&&!s)return!0;if(!e||!s)return!1;if(e.scopeName!==s.scopeName||e.tokenAttributes!==s.tokenAttributes)return!1;e=e.parent,s=s.parent}while(!0)}static mergeAttributes(e,s,n){let r=-1,i=0,o=0;if(n!==null)r=n.fontStyle,i=n.foregroundId,o=n.backgroundId;return j.set(e,s.languageId,s.tokenType,null,r,i,o)}pushAttributed(e,s){if(e===null)return this;if(e.indexOf(" ")===-1)return t._pushAttributed(this,e,s);let n=e.split(/ /g),r=this;for(let i of n)r=t._pushAttributed(r,i,s);return r}static _pushAttributed(e,s,n){let r=n.getMetadataForScope(s),i=e.scopePath.push(s),o=n.themeProvider.themeMatch(i),c=t.mergeAttributes(e.tokenAttributes,r,o);return new t(e,i,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let s=[],n=this;while(n&&n!==e)s.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?s.reverse():void 0}},te=class t{constructor(e,s,n,r,i,o,c,a){this.parent=e,this.ruleId=s,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new t(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){if(e===null)return!1;return t._equals(this,e)}static _equals(e,s){if(e===s)return!0;if(!this._structuralEquals(e,s))return!1;return N.equals(e.contentNameScopesList,s.contentNameScopesList)}static _structuralEquals(e,s){do{if(e===s)return!0;if(!e&&!s)return!0;if(!e||!s)return!1;if(e.depth!==s.depth||e.ruleId!==s.ruleId||e.endRule!==s.endRule)return!1;e=e.parent,s=s.parent}while(!0)}clone(){return this}static _reset(e){while(e)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){t._reset(this)}pop(){return this.parent}safePop(){if(this.parent)return this.parent;return this}push(e,s,n,r,i,o,c){return new t(this,e,s,n,r,i,o,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,s){if(this.parent)s=this.parent._writeString(e,s);return e[s++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,s}withContentNameScopesList(e){if(this.contentNameScopesList===e)return this;return this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){if(this.endRule===e)return this;return new t(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let s=this;while(s&&s._enterPos===e._enterPos){if(s.ruleId===e.ruleId)return!0;s=s.parent}return!1}toStateStackFrame(){return{ruleId:ye(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,s){let n=N.fromExtension(e?.nameScopesList??null,s.nameScopesList);return new t(e,Ae(s.ruleId),s.enterPos??-1,s.anchorPos??-1,s.beginRuleCapturedEOL,s.endRule,n,N.fromExtension(n,s.contentNameScopesList))}},Nt=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap((s)=>{if(s==="*")return this.allowAny=!0,[];return F(s,U).map((n)=>n.matcher)}),this.unbalancedBracketScopes=e.flatMap((s)=>F(s,U).map((n)=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(let e of this.unbalancedBracketScopes)if(e(t))return!1;for(let e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Tt=class{constructor(t,e,s,n){this.balancedBracketSelectors=n,this._emitBinaryTokens=t,this._tokenTypeOverrides=s,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let n=t?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways)r=!0;if(this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let i=t?.getScopeNames()??[];for(let o of this._tokenTypeOverrides)if(o.matcher(i))n=j.set(n,0,tt(o.type),null,-1,0,0);if(this.balancedBracketSelectors)r=this.balancedBracketSelectors.match(i)}if(r)n=j.set(n,0,8,r,-1,0,0);if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=e;return}let s=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:s}),this._lastTokenEndIndex=e}getResult(t,e){if(this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1)this._tokens.pop();if(this._tokens.length===0)this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0;return this._tokens}getBinaryResult(t,e){if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1)this._binaryTokens.pop(),this._binaryTokens.pop();if(this._binaryTokens.length===0)this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0;let s=new Uint32Array(this._binaryTokens.length);for(let n=0,r=this._binaryTokens.length;n<r;n++)s[n]=this._binaryTokens[n];return s}},Lt=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){if(this._rawGrammars.set(t.scopeName,t),e)this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,s,n,r){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,wt(t,i,e,s,n,r,this,this._onigLib))}return this._grammars.get(t)}},Ns=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new Lt(Y.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,e){this._syncRegistry.setTheme(Y.createFromRawTheme(t,e))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,e,s){return this.loadGrammarWithConfiguration(t,e,{embeddedLanguages:s})}loadGrammarWithConfiguration(t,e,s){return this._loadGrammar(t,e,s.embeddedLanguages,s.tokenTypes,new Nt(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,e,s,n,r){let i=new at(this._syncRegistry,t);while(i.Q.length>0)i.Q.map((o)=>this._loadSingleGrammar(o.scopeName)),i.processQueue();return this._grammarForScopeName(t,e,s,n,r)}_loadSingleGrammar(t){if(!this._ensureGrammarCache.has(t))this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0)}_doLoadSingleGrammar(t){let e=this._options.loadGrammar(t);if(e){let s=typeof this._options.getInjections==="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(e,s)}}addGrammar(t,e=[],s=0,n=null){return this._syncRegistry.addGrammar(t,e),this._grammarForScopeName(t.scopeName,s,n)}_grammarForScopeName(t,e=0,s=null,n=null,r=null){return this._syncRegistry.grammarForScopeName(t,e,s,n,r)}},Ts=te.NULL;function hn(t){return`annotation-${"side"in t?`${t.side}-`:""}${t.lineNumber}`}var Pt=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,xt=/^0(?:\.0+)?%?$/;function Gt(t){let e=t.indexOf("(");if(e<=0||!t.endsWith(")"))return;let s=t.slice(0,e).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(s))return;let n=t.slice(e+1,-1).trim();if(n.length===0)return;let r=n.lastIndexOf("/");if(r!==-1)return n.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(s)){let i=n.split(",");if(i.length===4)return i[3]?.trim()}}function G(t){let e=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(t.trim());if(e==null)return null;let s=e[1],n,r=1;if(s.length===3)n=s.split("").map((i)=>i+i).join("");else if(s.length===6)n=s;else n=s.slice(0,6),r=parseInt(s.slice(6,8),16)/255;return[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16),r]}function _(t){if(t==null)return null;let e=G(t);if(e==null)return null;let s=e[0]/255,n=e[1]/255,r=e[2]/255,i=(o)=>o<=0.03928?o/12.92:((o+0.055)/1.055)**2.4;return 0.2126*i(s)+0.7152*i(n)+0.0722*i(r)}function q(t,e){let[s,n]=t>e?[t,e]:[e,t];return(s+0.05)/(n+0.05)}function Te(t,e){if(e==null)return;let s=G(t),n=G(e);if(s==null||n==null)return;let[r,i,o,c]=s,[a,l,u]=n;return"#"+[Math.round(r*c+a*(1-c)),Math.round(i*c+l*(1-c)),Math.round(o*c+u*(1-c))].map((h)=>h.toString(16).padStart(2,"0")).join("")}function M(t){if(t==null)return!1;let e=t.trim().toLowerCase();if(e==="transparent")return!0;if(Pt.test(e))return!0;let s=Gt(e);return s!=null&&xt.test(s)}function Le(t,e){let s=_(t);if(s!=null)return s<0.4;let n=_(e);return n!=null?n>0.6:!1}function Pe(t,e){if(t==null||e==null)return!1;if(t.trim().toLowerCase()===e.trim().toLowerCase())return!0;let s=_(t),n=_(e);if(s==null||n==null)return!1;return Math.abs(s-n)<0.06}function z(t,e,s){if(e==null||s==null)return!1;let n=_(t),r=_(e),i=_(s);if(n==null||r==null||i==null)return!1;return Math.abs(n-i)<Math.abs(n-r)}function xe(t,e){let s=_(t),n=e.find((o)=>o!=null&&o!=="");if(s==null)return n;let r,i=-1;for(let o of e){if(o==null||o==="")continue;let c=_(o);if(c==null)continue;let a=q(s,c);if(a>=3)return o;if(a>i)r=o,i=a}return r??n}function Ge(t,e){if(e==null)return t;let s=G(t),n=G(e),r=_(e);if(s==null||n==null||r==null)return`color-mix(in srgb, ${t} 70%, ${e})`;let[i,o,c]=s,[a,l,u]=n;for(let h of[0.6,0.7,0.8,0.9]){let f="#"+[Math.round(i*h+a*(1-h)),Math.round(o*h+l*(1-h)),Math.round(c*h+u*(1-h))].map((p)=>p.toString(16).padStart(2,"0")).join(""),d=_(f);if(d!=null&&q(r,d)>=4.5)return f}return t}var Me=new WeakMap;function Mt(t){let e=Me.get(t);if(e!=null)return e;let s=t.colors??{},n={...s},r=s["editor.background"]??t.bg,i=s["editor.foreground"]??t.fg,o=s["sideBar.background"]??r,c=s["sideBar.foreground"]??i;S(n,"editor.background",r),S(n,"editor.foreground",i),S(n,"sideBar.background",o),S(n,"sideBar.foreground",c),S(n,"input.background",s["input.background"]??o),S(n,"sideBarSectionHeader.foreground",s["sideBarSectionHeader.foreground"]??c),S(n,"list.activeSelectionForeground",s["list.activeSelectionForeground"]??c),S(n,"gitDecoration.addedResourceForeground",ne(s["gitDecoration.addedResourceForeground"],s["terminal.ansiGreen"],s["editorGutter.addedBackground"])),S(n,"gitDecoration.modifiedResourceForeground",ne(s["gitDecoration.modifiedResourceForeground"],s["terminal.ansiBlue"],s["editorGutter.modifiedBackground"])),S(n,"gitDecoration.deletedResourceForeground",ne(s["gitDecoration.deletedResourceForeground"],s["terminal.ansiRed"],s["editorGutter.deletedBackground"]));let a=(M(s["list.focusOutline"])?void 0:s["list.focusOutline"])??(M(s.focusBorder)?void 0:s.focusBorder);if(a!=null)n["list.focusOutline"]=a;else delete n["list.focusOutline"];let l=s["list.hoverBackground"];if(l!=null&&(Bt(l,o)||z(l,o,c)))delete n["list.hoverBackground"];let u=Object.freeze({...t,colors:Object.freeze(n)});return Me.set(t,u),u}function S(t,e,s){if(s!=null&&s!=="")t[e]=s}function ne(...t){for(let e of t)if(e!=null&&e!=="")return e}function Bt(t,e){return e!=null&&t.toLowerCase()===e.toLowerCase()}var Rn={compositeOverBg:Te,contrastRatio:q,deriveMutedFg:Ge,hoverWouldEraseText:z,isDarkSurface:Le,isFullyTransparent:M,pickReadableForeground:xe,relativeLuminance:_,surfacesMatch:Pe};var Be=new WeakMap;function bn(t){let e=Be.get(t);return e==null?t:e}function Sn(t,e){Be.set(t,e)}function Ot(t){return t.map((e)=>({...e,hunkContent:e.hunkContent.map((s)=>({...s}))}))}function An(t){return{...t,hunks:Ot(t.hunks),deletionLines:[...t.deletionLines],additionLines:[...t.additionLines]}}
7
+ export{Y as I,Qe as J,j as K,Ns as L,Ts as M,jt as N,Ft as O,Dt as P,$t as Q,Wt as R,Ut as S,qt as T,zt as U,Ht as V,Kt as W,Xt as X,Vt as Y,Qt as Z,Yt as _,Zt as $,Jt as aa,es as ba,ts as ca,ss as da,ns as ea,rs as fa,Oe as ga,is as ha,os as ia,as as ja,cs as ka,ls as la,us as ma,ds as na,ps as oa,ms as pa,_s as qa,Rs as ra,Es as sa,hn as ta,Fe as ua,Ss as va,Cs as wa,Mt as xa,Rn as ya,bn as za,Sn as Aa,ys as Ba,Is as Ca,Ot as Da,An as Ea};