@dimina-kit/devtools 0.4.0-dev.20260625063832 → 0.4.0-dev.20260629114208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/main/app/app.js +2 -0
  2. package/dist/main/index.bundle.js +230 -144
  3. package/dist/main/ipc/bridge-router.d.ts +21 -0
  4. package/dist/main/ipc/bridge-router.js +63 -3
  5. package/dist/main/services/automation/index.js +0 -1
  6. package/dist/main/services/elements-forward/index.js +81 -72
  7. package/dist/main/services/mcp/target-manager.d.ts +3 -3
  8. package/dist/main/services/views/miniapp-partition.d.ts +18 -8
  9. package/dist/main/services/views/miniapp-partition.js +34 -13
  10. package/dist/main/services/views/view-manager.js +59 -36
  11. package/dist/main/services/workbench-coi-server.d.ts +7 -0
  12. package/dist/main/services/workbench-coi-server.js +6 -0
  13. package/dist/main/services/workbench-context.d.ts +4 -2
  14. package/dist/main/services/workbench-context.js +1 -0
  15. package/dist/main/services/workspace/op-lock.d.ts +26 -0
  16. package/dist/main/services/workspace/op-lock.js +23 -0
  17. package/dist/main/services/workspace/workspace-service.d.ts +7 -0
  18. package/dist/main/services/workspace/workspace-service.js +197 -103
  19. package/dist/main/windows/service-host-window/create.d.ts +5 -1
  20. package/dist/main/windows/service-host-window/create.js +6 -3
  21. package/dist/native-host/render/render.js +485 -449
  22. package/dist/native-host/service/service.js +1 -1
  23. package/dist/renderer/assets/index-BMwmmaSp.js +46 -0
  24. package/dist/renderer/entries/main/index.html +1 -1
  25. package/dist/shared/types.d.ts +15 -0
  26. package/dist/vscode-workbench/assets/__vite-browser-external-B0DTNerG.js +1 -0
  27. package/dist/vscode-workbench/assets/__vite-browser-external-BuLjVMfN.js +1 -0
  28. package/dist/vscode-workbench/assets/__vite-browser-external-thkx7I19.js +1 -0
  29. package/dist/vscode-workbench/assets/{dist-SFZ2HNEz.js → dist-CS7SQP3K.js} +4 -4
  30. package/dist/vscode-workbench/assets/dist-VSgdjUlW.js +8 -0
  31. package/dist/vscode-workbench/assets/editor.worker-DmMg51ee.js +41 -0
  32. package/dist/vscode-workbench/assets/extensionHost.worker-BMpl1cpB.js +207 -0
  33. package/dist/vscode-workbench/assets/{iconv-lite-umd-izd5l6fa.js → iconv-lite-umd-D3q-1-o6.js} +1 -1
  34. package/dist/vscode-workbench/assets/{iconv-lite-umd-COfjYshr.js → iconv-lite-umd-Jn9RTrsv.js} +2 -2
  35. package/dist/vscode-workbench/assets/index-zjigpZ25.js +2842 -0
  36. package/dist/vscode-workbench/assets/{jschardet-Bf-VMK4F.js → jschardet-CjCVc2Gw.js} +1 -1
  37. package/dist/vscode-workbench/assets/{jschardet-Dh5TyKsQ.js → jschardet-Cu4ufeHq.js} +1 -1
  38. package/dist/vscode-workbench/assets/{layout.contribution.darwin-cz2ttHTW.js → layout.contribution.darwin-CoH1BZtz.js} +1 -1
  39. package/dist/vscode-workbench/assets/{layout.contribution.linux-fEtdzbcY.js → layout.contribution.linux-Di2FF-CG.js} +1 -1
  40. package/dist/vscode-workbench/assets/{layout.contribution.win-BFyOKI8c.js → layout.contribution.win-moiNStil.js} +1 -1
  41. package/dist/vscode-workbench/assets/{main-Bh8TI5LP.js → main-DzHL45xo.js} +4 -4
  42. package/dist/vscode-workbench/assets/{main2-Bds9Fhfn.js → main2-CWVd-Hyp.js} +1 -1
  43. package/dist/vscode-workbench/assets/{worker-D9ti6A0r.js → worker-CRTb-Arc.js} +7 -7
  44. package/dist/vscode-workbench/assets/{worker-DQtXDXIZ.js → worker-CVB8WPuM.js} +2 -2
  45. package/dist/vscode-workbench/index.html +1 -4
  46. package/package.json +7 -37
  47. package/dist/renderer/assets/index-6XUSo6Su.js +0 -46
  48. package/dist/vscode-workbench/assets/__vite-browser-external-BUwiolNy.js +0 -1
  49. package/dist/vscode-workbench/assets/__vite-browser-external-CmG9GjjO.js +0 -1
  50. package/dist/vscode-workbench/assets/__vite-browser-external-DGJPTKLg.js +0 -1
  51. package/dist/vscode-workbench/assets/_commonjsHelpers-qcUHfnrg.js +0 -1
  52. package/dist/vscode-workbench/assets/chunk-B3K2TuZy.js +0 -1
  53. package/dist/vscode-workbench/assets/chunk-DECur_0Z.js +0 -1
  54. package/dist/vscode-workbench/assets/dist-tesJ1Kd2.js +0 -8
  55. package/dist/vscode-workbench/assets/editor.worker-BC1qOyXG.js +0 -41
  56. package/dist/vscode-workbench/assets/extension.api-BWA2aPAU.js +0 -1
  57. package/dist/vscode-workbench/assets/extensionHost.worker-Dvu35anN.js +0 -207
  58. package/dist/vscode-workbench/assets/index-CQ5xP0pp.js +0 -1656
  59. package/dist/vscode-workbench/assets/localExtensionHost-Ccz7QUdA.js +0 -1188
  60. package/dist/vscode-workbench/assets/main-BDgdQmvs.js +0 -4
  61. package/dist/vscode-workbench/assets/main2-DwfDVleQ.js +0 -1
  62. package/dist/vscode-workbench/assets/preload-helper-xBbMyY7u.js +0 -1
  63. /package/dist/vscode-workbench/assets/{_.contribution-C9aS_G-o.js → _.contribution-B46wcGKQ.js} +0 -0
  64. /package/dist/vscode-workbench/assets/{_commonjsHelpers-BPKu-ps5.js → _commonjsHelpers-DMmVv2OA.js} +0 -0
@@ -1,207 +0,0 @@
1
- import{n as e}from"./chunk-B3K2TuZy.js";var t;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Running=1]=`Running`,e[e.Completed=2]=`Completed`})(t||={});var n=class{constructor(e){this.executor=e,this._state=t.Uninitialized}get hasValue(){return this._state===t.Completed}get value(){if(this._state===t.Uninitialized){this._state=t.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=t.Completed}}else if(this._state===t.Running)throw Error(`Cannot read the value of a lazy that is being initialized`);if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};const r=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ie.isErrorNoTelemetry(e)?new ie(e.message+`
2
-
3
- `+e.stack):Error(e.message+`
4
-
5
- `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function i(e){r.setUnexpectedErrorHandler(e)}function a(e){r.onUnexpectedError(e)}function o(e){d(e)||r.onUnexpectedError(e)}function s(e){d(e)||r.onUnexpectedExternalError(e)}function c(e){if(e instanceof Error){let{name:t,message:n,cause:r}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack,noTelemetry:ie.isErrorNoTelemetry(e),cause:r?c(r):void 0,code:e.code}}return e}function l(e){let t;return e.noTelemetry?t=new ie:(t=Error(),t.name=e.name),t.message=e.message,t.stack=e.stack,e.code&&(t.code=e.code),e.cause&&(t.cause=l(e.cause)),t}const u=`Canceled`;function d(e){return e instanceof f?!0:e instanceof Error&&e.name===`Canceled`&&e.message===`Canceled`}var f=class extends Error{constructor(){super(u),this.name=this.message}},p=class e extends Error{static{this._name=`PendingMigrationError`}static is(t){return t instanceof e||t instanceof Error&&t.name===e._name}constructor(t){super(t),this.name=e._name}};function m(){let e=Error(u);return e.name=e.message,e}function h(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}function ee(e){return Error(e?`Illegal state: ${e}`:`Illegal state`)}var te=class extends TypeError{constructor(e){super(e?`${e} is read-only and cannot be changed`:`Cannot change read-only property`)}};function g(e){return e?e.message?e.message:e.stack?e.stack.split(`
6
- `)[0]:String(e):`Error`}var ne=class extends Error{constructor(e){super(`NotImplemented`),e&&(this.message=e)}},re=class extends Error{constructor(e){super(`NotSupported`),e&&(this.message=e)}},ie=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},ae=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function oe(e,t,n=0,r=e.length){let i=n,a=r;for(;i<a;){let n=Math.floor((i+a)/2);t(e[n])?i=n+1:a=n}return i-1}(class e{static{this.assertInvariants=!1}constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(e.assertInvariants){if(this._prevFindLastPredicate){for(let e of this._array)if(this._prevFindLastPredicate(e)&&!t(e))throw Error(`MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.`)}this._prevFindLastPredicate=t}let n=oe(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}});function se(e,t,n=(e,t)=>e===t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!n(e[r],t[r]))return!1;return!0}function ce(e,t,n){return le(e.length,r=>n(e[r],t))}function le(e,t){let n=0,r=e-1;for(;n<=r;){let e=(n+r)/2|0,i=t(e);if(i<0)n=e+1;else if(i>0)r=e-1;else return e}return-(n+1)}function ue(e,t){let n=[],r;for(let i of e.slice(0).sort(t))!r||t(r[0],i)!==0?(r=[i],n.push(r)):r.push(i);return n}function de(e,t,n){let r=[];function i(e,t,n){if(t===0&&n.length===0)return;let i=r[r.length-1];i&&i.start+i.deleteCount===e?(i.deleteCount+=t,i.toInsert.push(...n)):r.push({start:e,deleteCount:t,toInsert:n})}let a=0,o=0;for(;;){if(a===e.length){i(a,0,t.slice(o));break}if(o===t.length){i(a,e.length-a,[]);break}let r=e[a],s=t[o],c=n(r,s);c===0?(a+=1,o+=1):c<0?(i(a,1,[]),a+=1):c>0&&(i(a,0,[s]),o+=1)}return r}function fe(e,t,n){let r=de(e,t,n),i=[],a=[];for(let t of r)i.push(...e.slice(t.start,t.start+t.deleteCount)),a.push(...t.toInsert);return{removed:i,added:a}}function pe(e){return e.filter(e=>!!e)}function me(e){let t=0;for(let n=0;n<e.length;n++)e[n]&&(e[t]=e[n],t+=1);e.length=t}function he(e){return!Array.isArray(e)||e.length===0}function ge(e){return Array.isArray(e)&&e.length>0}function _e(e,t=e=>e){let n=new Set;return e.filter(e=>{let r=t(e);return n.has(r)?!1:(n.add(r),!0)})}function ve(e,t){let n;if(typeof t==`number`){let e=t;n=()=>{let t=Math.sin(e++)*179426549;return t-Math.floor(t)}}else n=Math.random;for(let t=e.length-1;t>0;--t){let r=Math.floor(n()*(t+1)),i=e[t];e[t]=e[r],e[r]=i}}function ye(e,t){return Array.isArray(e)?e.map(t):t(e)}function be(e){return Array.isArray(e)?e:[e]}var xe;(function(e){function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(xe||={});function Se(e,t){return(n,r)=>t(e(n),e(r))}const Ce=(e,t)=>e-t;(class e{static{this.empty=new e(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>e(n)?(t=n,!1):!0),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||xe.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}});var we;function Te(e,t){let n=Object.create(null);for(let r of e){let e=t(r),i=n[e];i||=n[e]=[],i.push(r)}return n}function Ee(e,t){let n=[],r=[];for(let r of e)t.has(r)||n.push(r);for(let n of t)e.has(n)||r.push(n);return{removed:n,added:r}}(class{static{we=Symbol.toStringTag}constructor(e,t){this.toKey=t,this._map=new Map,this[we]=`SetWithKey`;for(let t of e)this.add(t)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(n=>e.call(t,n,n,this))}[Symbol.iterator](){return this.values()}});var De,Oe,ke;function Ae(e,t,n){let r=e.get(t);return r===void 0&&(r=n,e.set(t,r)),r}var je=class{constructor(e,t){this.uri=e,this.value=t}};function Me(e){return Array.isArray(e)}var Ne=class e{static{this.defaultToKey=e=>e.toString()}constructor(t,n){if(this[De]=`ResourceMap`,t instanceof e)this.map=new Map(t.map),this.toKey=n??e.defaultToKey;else if(Me(t)){this.map=new Map,this.toKey=n??e.defaultToKey;for(let[e,n]of t)this.set(e,n)}else this.map=new Map,this.toKey=t??e.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new je(e,t)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.map)e(n.value,n.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(De=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},Pe=class{constructor(e,t){this[Oe]=`ResourceSet`,!e||typeof e==`function`?this._map=new Ne(e):(this._map=new Ne(t),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,t){this._map.forEach((n,r)=>e.call(t,r,r,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(Oe=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},Fe;(function(e){e[e.None=0]=`None`,e[e.AsOld=1]=`AsOld`,e[e.AsNew=2]=`AsNew`})(Fe||={});var Ie=class{constructor(){this[ke]=`LinkedMap`,this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=Fe.None){let n=this._map.get(e);if(n)return t!==Fe.None&&this.touch(n,t),n.value}set(e,t,n=Fe.None){let r=this._map.get(e);if(r)r.value=t,n!==Fe.None&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case Fe.None:this.addItemLast(r);break;case Fe.AsOld:this.addItemFirst(r);break;case Fe.AsNew:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this,t=this._state,n=this._head,r={[Symbol.iterator](){return r},[Symbol.dispose](){},next(){if(e._state!==t)throw Error(`LinkedMap got modified during iteration.`);if(n){let e={value:n.key,done:!1};return n=n.next,e}else return{value:void 0,done:!0}}};return r}values(){let e=this,t=this._state,n=this._head,r={[Symbol.iterator](){return r},[Symbol.dispose](){},next(){if(e._state!==t)throw Error(`LinkedMap got modified during iteration.`);if(n){let e={value:n.value,done:!1};return n=n.next,e}else return{value:void 0,done:!0}}};return r}entries(){let e=this,t=this._state,n=this._head,r={[Symbol.iterator](){return r},[Symbol.dispose](){},next(){if(e._state!==t)throw Error(`LinkedMap got modified during iteration.`);if(n){let e={value:[n.key,n.value],done:!1};return n=n.next,e}else return{value:void 0,done:!0}}};return r}[(ke=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.previous,n--;this._tail=t,this._size=n,t&&(t.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw Error(`Invalid list`);this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error(`Invalid list`);this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error(`Invalid list`);if(!(t!==Fe.AsOld&&t!==Fe.AsNew)){if(t===Fe.AsOld){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===Fe.AsNew){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}},Le=class extends Ie{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=Fe.AsNew){return super.get(e,t)}peek(e){return super.get(e,Fe.None)}set(e,t){return super.set(e,t,Fe.AsNew),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},Re=class extends Le{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}},ze=class{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){let n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){let n=this.map.get(e);n&&n.forEach(t)}get(e){return this.map.get(e)||new Set}};function Be(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}function Ve(e,t){if(!e)throw Error(t?`Assertion failed (${t})`:`Assertion Failed`)}function He(e,t=`Unreachable`){throw Error(t)}function Ue(e,t=`unexpected state`){if(!e)throw typeof t==`string`?new ae(`Assertion Failed: ${t}`):t}function We(e){e()||(e(),o(new ae(`Assertion Failed`)))}function Ge(e){return typeof e==`string`}function Ke(e){return qe(e,Ge)}function qe(e,t){return Array.isArray(e)&&e.every(t)}function Je(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Ye(e){return typeof e==`object`&&e instanceof Object.getPrototypeOf(Uint8Array)}function Xe(e){return typeof e==`number`&&!isNaN(e)}function Ze(e){return!!e&&typeof e[Symbol.iterator]==`function`}function Qe(e){return e===void 0}function $e(e){return!et(e)}function et(e){return Qe(e)||e===null}function tt(e,t){if(!e)throw Error(t?`Unexpected type, expected '${t}'`:`Unexpected type`)}function nt(e){return Ue(e!=null,"Argument is `undefined` or `null`."),e}const rt=Object.prototype.hasOwnProperty;function it(e){if(!Je(e))return!1;for(let t in e)if(rt.call(e,t))return!1;return!0}function at(e){return typeof e==`function`}function ot(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)st(e[r],t[r])}function st(e,t){if(Ge(t)){if(typeof e!==t)throw Error(`argument does not match constraint: typeof ${t}`)}else if(at(t)){try{if(e instanceof t)return}catch{}if(!et(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`)}}function ct(e,t){for(let n in t)if(!(n in e))return!1;return!0}var lt;(function(e){function t(e){return!!e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e??n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){let n=0;for(let r of e)if(!t(r,n++))return!1;return!0}e.every=d;function f(e,t){for(let n of e)if(t(n))return n}e.find=f;function*p(e,t){for(let n of e)t(n)&&(yield n)}e.filter=p;function*m(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=m;function*h(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=h;function*ee(...e){for(let t of e)Ze(t)?yield*t:yield t}e.concat=ee;function te(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=te;function g(e){let t=0;for(let n of e)t++;return t}e.length=g;function*ne(e,t,n=e.length){for(t<-e.length&&(t=0),t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=ne;function re(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=re;async function ie(e){let t=[];for await(let n of e)t.push(n);return t}e.asyncToArray=ie;async function ae(e){let t=[];for await(let n of e)t=t.concat(n);return t}e.asyncToArrayFlat=ae})(lt||={}),class e{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(t){let n=this.livingDisposables.get(t);return n||(n={parent:null,source:null,isSingleton:!1,value:t,idx:e.idx++},this.livingDisposables.set(t,n)),n}trackDisposable(e){let t=this.getDisposableData(e);t.source||=Error().stack}setParent(e,t){let n=this.getDisposableData(e);n.parent=t}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,t){let n=t.get(e);if(n)return n;let r=e.parent?this.getRootParent(this.getDisposableData(e.parent),t):e;return t.set(e,r),r}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,t])=>t.source!==null&&!this.getRootParent(t,e).isSingleton).flatMap(([e])=>e)}computeLeakingDisposables(e=10,t){let n;if(t)n=t;else{let e=new Map,t=[...this.livingDisposables.values()].filter(t=>t.source!==null&&!this.getRootParent(t,e).isSingleton);if(t.length===0)return;let r=new Set(t.map(e=>e.value));if(n=t.filter(e=>!(e.parent&&r.has(e.parent))),n.length===0)throw Error(`There are cyclic diposable chains!`)}if(!n)return;function r(e){function t(e,t){for(;e.length>0&&t.some(t=>typeof t==`string`?t===e[0]:e[0].match(t));)e.shift()}let n=e.source.split(`
7
- `).map(e=>e.trim().replace(`at `,``)).filter(e=>e!==``);return t(n,[`Error`,/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),n.reverse()}let i=new ze;for(let e of n){let t=r(e);for(let n=0;n<=t.length;n++)i.add(t.slice(0,n).join(`
8
- `),e)}n.sort(Se(e=>e.idx,Ce));let a=``,o=0;for(let t of n.slice(0,e)){o++;let e=r(t),s=[];for(let t=0;t<e.length;t++){let a=e[t];a=`(shared with ${i.get(e.slice(0,t+1).join(`
9
- `)).size}/${n.length} leaks) at ${a}`;let o=Te([...i.get(e.slice(0,t).join(`
10
- `))].map(e=>r(e)[t]),e=>e);delete o[e[t]];for(let[e,t]of Object.entries(o))t&&s.unshift(` - stacktraces of ${t.length} other leaks continue with ${e}`);s.unshift(a)}a+=`\n\n\n==================== Leaking disposable ${o}/${n.length}: ${t.value.constructor.name} ====================\n${s.join(`
11
- `)}\n============================================================\n\n`}return n.length>e&&(a+=`\n\n\n... and ${n.length-e} more leaking disposables\n\n`),{leaks:n,details:a}}};function ut(e){return null?.trackDisposable(e),e}function dt(e){null?.markAsDisposed(e)}function ft(e,t){null?.setParent(e,t)}function pt(e){return null?.markAsSingleton(e),e}function mt(e){return typeof e==`object`&&!!e&&typeof e.dispose==`function`&&e.dispose.length===0}function ht(e){if(lt.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function gt(...e){return _(()=>ht(e))}var _t=class{constructor(e){this._isDisposed=!1,this._fn=e,ut(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw Error(`Unbound disposable context: Need to use an arrow function to preserve the value of this`);this._isDisposed=!0,dt(this),this._fn()}}};function _(e){return new _t(e)}var v=class e{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,ut(this)}dispose(){this._isDisposed||(dt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ht(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t||t===y.None)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return ft(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&ft(e,null)}assertNotDisposed(){this._isDisposed&&o(new ae(`Object disposed`))}},y=class{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new v,ut(this),ft(this._store,this)}dispose(){dt(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}},vt=class{constructor(){this._isDisposed=!1,ut(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&ft(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,dt(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&ft(e,null),e}},yt=class{constructor(e=new Map){this._isDisposed=!1,this._store=e,ut(this)}dispose(){dt(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ht(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,t,n=!1){this._isDisposed&&console.warn(Error(`Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!`).stack),n||this._store.get(e)?.dispose(),this._store.set(e,t),ft(t,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let t=this._store.get(e);return t&&ft(t,null),this._store.delete(e),t}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}},bt=class extends yt{constructor(){super(new Ne)}};function xt(e,t){return new St(e,t)}var St=class{constructor(e,t){this.reducer=e,this.options=t,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark==`number`&&this.buffer.data.length>this.options.highWaterMark)return new Promise(e=>this.pendingWritePromises.push(e))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(e!==void 0&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(t=>t(e))}emitError(e){this.listeners.error.length===0?o(e):this.listeners.error.slice(0).forEach(t=>t(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,t){if(!this.state.destroyed)switch(e){case`data`:this.listeners.data.push(t),this.resume();break;case`end`:this.listeners.end.push(t),this.state.flowing&&this.flowEnd()&&this.destroy();break;case`error`:this.listeners.error.push(t),this.state.flowing&&this.flowErrors();break}}removeListener(e,t){if(this.state.destroyed)return;let n;switch(e){case`data`:n=this.listeners.data;break;case`end`:n=this.listeners.end;break;case`error`:n=this.listeners.error;break}if(n){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer==`function`){let e=this.reducer(this.buffer.data);this.emitData(e)}else for(let e of this.buffer.data)this.emitData(e);this.buffer.data.length=0;let e=[...this.pendingWritePromises];this.pendingWritePromises.length=0,e.forEach(e=>e())}flowErrors(){if(this.listeners.error.length>0){for(let e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}};function Ct(e,t){let n=[],r;for(;(r=e.read())!==null;)n.push(r);return t(n)}function wt(e,t){return new Promise((n,r)=>{let i=[];Tt(e,{onData:e=>{t&&i.push(e)},onError:e=>{t?r(e):n(void 0)},onEnd:()=>{n(t?t(i):void 0)}})})}function Tt(e,t,n){e.on(`error`,e=>{n?.isCancellationRequested||t.onError(e)}),e.on(`end`,()=>{n?.isCancellationRequested||t.onEnd()}),e.on(`data`,e=>{n?.isCancellationRequested||t.onData(e)})}function Et(e,t){let n=xt(t);return n.end(e),n}const Dt=typeof Buffer<`u`,Ot=new n(()=>new Uint8Array(256));let kt,At;var b=class e{static alloc(t){return Dt?new e(Buffer.allocUnsafe(t)):new e(new Uint8Array(t))}static wrap(t){return Dt&&!Buffer.isBuffer(t)&&(t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)),new e(t)}static fromString(t,n){return!n?.dontUseNodeBuffer&&Dt?new e(Buffer.from(t)):(kt||=new TextEncoder,new e(kt.encode(t)))}static fromByteArray(t){let n=e.alloc(t.length);for(let e=0,r=t.length;e<r;e++)n.buffer[e]=t[e];return n}static concat(t,n){if(n===void 0){n=0;for(let e=0,r=t.length;e<r;e++)n+=t[e].byteLength}let r=e.alloc(n),i=0;for(let e=0,n=t.length;e<n;e++){let n=t[e];r.set(n,i),i+=n.byteLength}return r}static isNativeBuffer(e){return Dt&&Buffer.isBuffer(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}clone(){let t=e.alloc(this.byteLength);return t.set(this),t}toString(){return Dt?this.buffer.toString():(At||=new TextDecoder(void 0,{ignoreBOM:!0}),At.decode(this.buffer))}slice(t,n){return new e(this.buffer.subarray(t,n))}set(t,n){if(t instanceof e)this.buffer.set(t.buffer,n);else if(t instanceof Uint8Array)this.buffer.set(t,n);else if(t instanceof ArrayBuffer)this.buffer.set(new Uint8Array(t),n);else if(ArrayBuffer.isView(t))this.buffer.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n);else throw Error(`Unknown argument 'array'`)}readUInt32BE(e){return Pt(this.buffer,e)}writeUInt32BE(e,t){Ft(this.buffer,e,t)}readUInt32LE(e){return It(this.buffer,e)}writeUInt32LE(e,t){Lt(this.buffer,e,t)}readUInt8(e){return Rt(this.buffer,e)}writeUInt8(e,t){zt(this.buffer,e,t)}indexOf(t,n=0){return jt(this.buffer,t instanceof e?t.buffer:t,n)}equals(e){return this===e?!0:this.byteLength===e.byteLength?this.buffer.every((t,n)=>t===e.buffer[n]):!1}};function jt(e,t,n=0){let r=t.byteLength,i=e.byteLength;if(r===0)return 0;if(r===1)return e.indexOf(t[0],n);if(r>i-n)return-1;let a=Ot.value;a.fill(t.length);for(let e=0;e<t.length;e++)a[t[e]]=t.length-e-1;let o=n+t.length-1,s=o,c=-1;for(;o<i;)if(e[o]===t[s]){if(s===0){c=o;break}o--,s--}else o+=Math.max(t.length-s,a[e[o]]),s=t.length-1;return c}function Mt(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function Nt(e,t,n){e[n+0]=t&255,t>>>=8,e[n+1]=t&255}function Pt(e,t){return e[t]*2**24+e[t+1]*2**16+e[t+2]*2**8+e[t+3]}function Ft(e,t,n){e[n+3]=t,t>>>=8,e[n+2]=t,t>>>=8,e[n+1]=t,t>>>=8,e[n]=t}function It(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0|e[t+2]<<16>>>0|e[t+3]<<24>>>0}function Lt(e,t,n){e[n+0]=t&255,t>>>=8,e[n+1]=t&255,t>>>=8,e[n+2]=t&255,t>>>=8,e[n+3]=t&255}function Rt(e,t){return e[t]}function zt(e,t,n){e[n]=t}function Bt(e){return Ct(e,e=>b.concat(e))}function Vt(e){return wt(e,e=>b.concat(e))}function Ht(e){return Et(e,e=>b.concat(e))}function Ut(e){let t=0,n=0,r=0,i=new Uint8Array(Math.floor(e.length/4*3)),a=e=>{switch(n){case 3:i[r++]=t|e,n=0;break;case 2:i[r++]=t|e>>>2,t=e<<6,n=3;break;case 1:i[r++]=t|e>>>4,t=e<<4,n=2;break;default:t=e<<2,n=1}};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=65&&n<=90)a(n-65);else if(n>=97&&n<=122)a(n-97+26);else if(n>=48&&n<=57)a(n-48+52);else if(n===43||n===45)a(62);else if(n===47||n===95)a(63);else if(n===61)break;else throw SyntaxError(`Unexpected base64 character ${e[t]}`)}let o=r;for(;n>0;)a(0);return b.wrap(i).slice(0,o)}function Wt({buffer:e},t=!0,n=!1){let r=n?`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,i=``,a=e.byteLength%3,o=0;for(;o<e.byteLength-a;o+=3){let t=e[o+0],n=e[o+1],a=e[o+2];i+=r[t>>>2],i+=r[(t<<4|n>>>4)&63],i+=r[(n<<2|a>>>6)&63],i+=r[a&63]}if(a===1){let n=e[o+0];i+=r[n>>>2],i+=r[n<<4&63],t&&(i+=`==`)}else if(a===2){let n=e[o+0],a=e[o+1];i+=r[n>>>2],i+=r[(n<<4|a>>>4)&63],i+=r[a<<2&63],t&&(i+=`=`)}return i}const Gt=`0123456789abcdef`;function Kt({buffer:e}){let t=``;for(let n=0;n<e.length;n++){let r=e[n];t+=Gt[r>>>4],t+=Gt[r&15]}return t}function qt(e){if(e.length%2!=0)throw SyntaxError(`Hex string must have an even length`);let t=new Uint8Array(e.length>>1);for(let n=0;n<e.length;)t[n>>1]=Jt(e,n++)<<4|Jt(e,n++);return b.wrap(t)}function Jt(e,t){let n=e.charCodeAt(t);if(n>=48&&n<=57)return n-48;if(n>=97&&n<=102)return n-87;if(n>=65&&n<=70)return n-55;throw SyntaxError(`Invalid hex character at position ${t}`)}var Yt=class e{static{this.Undefined=new e(void 0)}constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}},Xt=class{constructor(){this._first=Yt.Undefined,this._last=Yt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Yt.Undefined}clear(){let e=this._first;for(;e!==Yt.Undefined;){let t=e.next;e.prev=Yt.Undefined,e.next=Yt.Undefined,e=t}this._first=Yt.Undefined,this._last=Yt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Yt(e);if(this._first===Yt.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==Yt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Yt.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==Yt.Undefined)return this._last.element}_remove(e){if(e.prev!==Yt.Undefined&&e.next!==Yt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Yt.Undefined&&e.next===Yt.Undefined?(this._first=Yt.Undefined,this._last=Yt.Undefined):e.next===Yt.Undefined?(this._last=this._last.prev,this._last.next=Yt.Undefined):e.prev===Yt.Undefined&&(this._first=this._first.next,this._first.prev=Yt.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==Yt.Undefined;)yield e.element,e=e.next}};function Zt(){return globalThis._VSCODE_NLS_MESSAGES}function Qt(){return globalThis._VSCODE_NLS_LANGUAGE}const $t=Qt()===`pseudo`||typeof document<`u`&&document.location&&typeof document.location.hash==`string`&&document.location.hash.indexOf(`pseudo=true`)>=0;function en(e,t){let n;return n=t.length===0?e:e.replace(/\{(\d+)\}/g,(e,n)=>{let r=t[n[0]],i=e;return typeof r==`string`?i=r:(typeof r==`number`||typeof r==`boolean`||r==null)&&(i=String(r)),i}),$t&&(n=`[`+n.replace(/[aouei]/g,`$&$&`)+`]`),n}function x(e,t,...n){return en(typeof e==`number`?tn(e,t):t,n)}function tn(e,t){let n=Zt()?.[e];if(typeof n!=`string`){if(typeof t==`string`)return t;throw Error(`!!! NLS MISSING: ${e} !!!`)}return n}function nn(e,t,...n){let r;r=typeof e==`number`?tn(e,t):t;let i=en(r,n);return{value:i,original:t===r?i:en(t,n)}}let rn=!1,an=!1,on=!1,sn=!1,cn=!1,ln=!1,un=!1,dn=!1,fn=`en`,pn;const mn=globalThis;let hn;mn.vscode!==void 0&&mn.vscode.process!==void 0?hn=mn.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(hn=process);const gn=typeof hn?.versions?.electron==`string`&&hn?.type===`renderer`;if(typeof hn==`object`){rn=hn.platform===`win32`,an=hn.platform===`darwin`,on=hn.platform===`linux`,on&&hn.env.SNAP&&hn.env.SNAP_REVISION,un=!!hn.env.CI||!!hn.env.BUILD_ARTIFACTSTAGINGDIRECTORY||!!hn.env.GITHUB_WORKSPACE,fn=`en`;let e=hn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,fn=t.resolvedLanguage||`en`,t.languagePack?.translationsConfigFile}catch{}sn=!0}else typeof navigator==`object`&&!gn?(pn=navigator.userAgent,rn=pn.indexOf(`Windows`)>=0,an=pn.indexOf(`Macintosh`)>=0,ln=(pn.indexOf(`Macintosh`)>=0||pn.indexOf(`iPad`)>=0||pn.indexOf(`iPhone`)>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,on=pn.indexOf(`Linux`)>=0,dn=pn?.indexOf(`Mobi`)>=0,cn=!0,fn=Qt()||`en`,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var _n;(function(e){e[e.Web=0]=`Web`,e[e.Mac=1]=`Mac`,e[e.Linux=2]=`Linux`,e[e.Windows=3]=`Windows`})(_n||={});function vn(e){switch(e){case _n.Web:return`Web`;case _n.Mac:return`Mac`;case _n.Linux:return`Linux`;case _n.Windows:return`Windows`}}_n.Web,an?_n.Mac:rn?_n.Windows:on&&_n.Linux;const yn=rn,bn=an,xn=on,Sn=sn,Cn=cn,wn=cn&&typeof mn.importScripts==`function`,Tn=wn?mn.origin:void 0,En=ln,Dn=dn,On=un,kn=pn,An=fn;var jn;(function(e){function t(){return An}e.value=t;function n(){return An.length===2?An===`en`:An.length>=3?An[0]===`e`&&An[1]===`n`&&An[2]===`-`:!1}e.isDefaultVariant=n;function r(){return An===`en`}e.isDefault=r})(jn||={});const Mn=typeof mn.postMessage==`function`&&!mn.importScripts,Nn=(()=>{if(Mn){let e=[];mn.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),mn.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var Pn;(function(e){e[e.Windows=1]=`Windows`,e[e.Macintosh=2]=`Macintosh`,e[e.Linux=3]=`Linux`})(Pn||={});const Fn=an||ln?Pn.Macintosh:rn?Pn.Windows:Pn.Linux;let In=!0,Ln=!1;function Rn(){if(!Ln){Ln=!0;let e=new Uint8Array(2);e[0]=1,e[1]=2,In=new Uint16Array(e.buffer)[0]===513}return In}const zn=!!(kn&&kn.indexOf(`Chrome`)>=0),Bn=!!(kn&&kn.indexOf(`Firefox`)>=0),Vn=!!(!zn&&kn&&kn.indexOf(`Safari`)>=0),Hn=!!(kn&&kn.indexOf(`Edg/`)>=0);kn&&kn.indexOf(`Android`);let Un;const Wn=globalThis.vscode;if(Wn!==void 0&&Wn.process!==void 0){let e=Wn.process;Un={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd(){return e.cwd()}}}else Un=typeof process<`u`&&typeof process?.versions?.node==`string`?{get platform(){return process.platform},get arch(){return process.arch},get env(){return{}},cwd(){return{}.VSCODE_CWD||process.cwd()}}:{get platform(){return yn?`win32`:bn?`darwin`:`linux`},get arch(){},get env(){return{}},cwd(){return`/`}};const Gn=Un.cwd,Kn=Un.env,qn=Un.platform;Un.arch;const Jn=globalThis.performance.now.bind(globalThis.performance);var Yn=class e{static create(t){return new e(t)}constructor(e){this._now=e===!1?Date.now:Jn,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}};const Xn=6e4;function Zn(){return!!Kn.VSCODE_DEV}var Qn;(function(e){e.None=()=>y.None;function t(e,t,n){return f(e,()=>void 0,0,void 0,t??!0,void 0,n)}e.defer=t;function n(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=n;function r(t,n){return e.once(e.filter(t,n))}e.onceIf=r;function i(e,t,n){return u((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=i;function a(e,t,n){return u((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=a;function o(e,t,n){return u((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=o;function s(e){return e}e.signal=s;function c(...e){return(t,n=null,r)=>d(gt(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=c;function l(e,t,n,r){let a=n;return i(e,e=>(a=t(a,e),a),r)}e.reduce=l;function u(e,t){let n,r=new S({onWillAddFirstListener(){n=e(r.fire,r)},onDidRemoveLastListener(){n?.dispose()}});return t?.add(r),r.event}function d(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function f(e,t,n=100,r=!1,i=!1,a,o){let s,c,l,u=0,d,f=new S({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),r&&!l&&(f.fire(c),c=void 0),d=()=>{let e=c;c=void 0,l=void 0,(!r||u>1)&&f.fire(e),u=0},typeof n==`number`?(l&&clearTimeout(l),l=setTimeout(d,n)):l===void 0&&(l=null,queueMicrotask(d))})},onWillRemoveListener(){i&&u>0&&d?.()},onDidRemoveLastListener(){d=void 0,s.dispose()}});return o?.add(f),f.event}e.debounce=f;function p(t,n=0,r,i){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,r??!0,void 0,i)}e.accumulate=p;function m(e,t,n=100,r=!0,i=!0,a,o){let s,c,l,u=0,d=new S({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),l===void 0&&(r&&(d.fire(c),c=void 0,u=0),typeof n==`number`?l=setTimeout(()=>{i&&u>0&&d.fire(c),c=void 0,l=void 0,u=0},n):(l=0,queueMicrotask(()=>{i&&u>0&&d.fire(c),c=void 0,l=void 0,u=0})))})},onDidRemoveLastListener(){s.dispose()}});return o?.add(d),d.event}e.throttle=m;function h(e,t=(e,t)=>e===t,n){let r=!0,i;return o(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=h;function ee(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=ee;function te(e,t,n=!1,r=[],i){let a=r.slice(),o;Zn()&&(o={stack:tr.create(),timerId:setTimeout(()=>{a&&a.length>0&&o&&!o.warned&&(o.warned=!0,console.warn(`[Event.buffer][${t}] potential LEAK detected: ${a.length} events buffered for ${Xn/1e3}s without being consumed. Buffered here:`),o.stack.print())},Xn),warned:!1},i&&i.add(_(()=>clearTimeout(o.timerId))));let s=()=>{o&&clearTimeout(o.timerId)},c=e(e=>{a?(a.push(e),Zn()&&o&&!o.warned&&a.length>=100&&(o.warned=!0,console.warn(`[Event.buffer][${t}] potential LEAK detected: ${a.length} events buffered without being consumed. Buffered here:`),o.stack.print())):u.fire(e)});i&&i.add(c);let l=()=>{a?.forEach(e=>u.fire(e)),a=null,s()},u=new S({onWillAddFirstListener(){c||(c=e(e=>u.fire(e)),i&&i.add(c))},onDidAddFirstListener(){a&&(n?setTimeout(l):l())},onDidRemoveLastListener(){c&&c.dispose(),c=null,s()}});return i&&i.add(u),u.event}e.buffer=te;function g(e,t){return(n,r,i)=>{let a=t(new re);return e(function(e){let t=a.evaluate(e);t!==ne&&n.call(r,t)},void 0,i)}}e.chain=g;let ne=Symbol(`HaltChainable`);class re{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:ne),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:ne}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===ne)break;return e}}function ie(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new S({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=ie;function ae(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new S({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=ae;function oe(e,t){let r,i,a=new Promise(a=>{i=n(e)(a),fr(i,t),r=()=>{pr(i,t)}});return a.cancel=r,t&&a.finally(()=>pr(i,t)),a}e.toPromise=oe;function se(e,t){return e(e=>t.fire(e))}e.forward=se;function ce(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=ce;class le{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1,this.emitter=new S({onWillAddFirstListener:()=>{e.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{e.removeObserver(this)}}),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ue(e,t){return new le(e,t).emitter.event}e.fromObservable=ue;function de(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return fr(s,r),s}}e.fromObservableLight=de})(Qn||={});var $n=class e{static{this.all=new Set}static{this._idPool=0}constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new Yn,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},er=class e{static{this._idPool=1}constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||=new Map;let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),--this._warnCountdown,this._warnCountdown<=0){this._warnCountdown=n*.5;let[e,r]=this.getMostFrequentStack(),i=/^[0-9a-f]+$/i.test(this.name)?void 0:this.name,a=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;console.warn(a),console.warn(e);let o=new nr(r/t>.3?`dominated`:`popular`,a,e,t,i);this._errorHandler(o)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t<r)&&(e=[n,r],t=r);return e}},tr=class e{static create(){return new e(Error().stack??``)}constructor(e){this.value=e}print(){console.warn(this.value.split(`
12
- `).slice(2).join(`
13
- `))}},nr=class e extends Error{constructor(e,t,n,r,i){super(i?`[${i}] potential listener LEAK detected, ${e}`:`potential listener LEAK detected, ${e}`),this.name=`ListenerLeakError`,this.kind=e,this.listenerCount=r,this.details=t,this.stack=n}static is(t){return t instanceof e||t instanceof Error&&typeof t.kind==`string`&&typeof t.listenerCount==`number`}},rr=class extends nr{constructor(e,t,n,r,i){super(e,t,n,r,i),this.name=`ListenerRefusalError`}};let ir=0;var ar=class{constructor(e){this.value=e,this.id=ir++}};const or=(e,t)=>{if(e instanceof ar)t(e);else for(let n=0;n<e.length;n++){let r=e[n];r&&t(r)}};var S=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new er(e?.onListenerError??o,this._options?.leakWarningThreshold??-1,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new $n(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new rr(t[1]/this._size>.3?`dominated`:`popular`,`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||o)(n),y.None}if(this._disposed)return y.None;t&&(e=e.bind(t));let r=new ar(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=tr.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof ar?(this._deliveryQueue??=new sr,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=_(()=>{i?.(),this._removeListener(r)});return fr(a,n),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*2<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&e<this._deliveryQueue.end&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||o;if(!n){e.value(t);return}try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof ar)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},sr=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},cr=class extends S{async fireAsync(e,t,n){if(this._listeners)for(this._asyncDeliveryQueue||=new Xt,or(this._listeners,t=>this._asyncDeliveryQueue.push([t.value,e]));this._asyncDeliveryQueue.size>0&&!t.isCancellationRequested;){let[e,r]=this._asyncDeliveryQueue.shift(),i=[],a={...r,token:t,waitUntil:t=>{if(Object.isFrozen(i))throw Error(`waitUntil can NOT be called asynchronous`);n&&(t=n(t,e)),i.push(t)}};try{e(a)}catch(e){o(e);continue}await Promise.allSettled(i).then(e=>{for(let t of e)t.status===`rejected`&&o(t.reason)})}}},lr=class extends S{get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new Xt,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused===0?super.fire(e):this._eventQueue.push(e))}},ur=class extends lr{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||=(this.pause(),setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}},dr=class extends S{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(e=>super.fire(e)),this._queuedEvents=[]}))}};function fr(e,t){t instanceof v?t.add(e):Array.isArray(t)&&t.push(e)}function pr(e,t){if(t instanceof v)t.delete(e);else if(Array.isArray(t)){let n=t.indexOf(e);n!==-1&&t.splice(n,1)}e.dispose()}var mr;(function(e){e[e.Desktop=1]=`Desktop`,e[e.Web=2]=`Web`})(mr||={});var hr;(function(e){e[e.VersionMismatch=55]=`VersionMismatch`,e[e.UnexpectedError=81]=`UnexpectedError`})(hr||={});var gr;(function(e){e[e.Initialized=0]=`Initialized`,e[e.Ready=1]=`Ready`,e[e.Terminate=2]=`Terminate`})(gr||={});function _r(e){let t=b.alloc(1);switch(e){case gr.Initialized:t.writeUInt8(1,0);break;case gr.Ready:t.writeUInt8(2,0);break;case gr.Terminate:t.writeUInt8(3,0);break}return t}function vr(e,t){if(e.byteLength!==1)return!1;switch(e.readUInt8(0)){case 1:return t===gr.Initialized;case 2:return t===gr.Ready;case 3:return t===gr.Terminate;default:return!1}}var yr;(function(e){e.Start=`START_NATIVE_LOG`,e.End=`END_NATIVE_LOG`})(yr||={});function br(e){let t=[];typeof e==`number`&&t.push(`code/timeOrigin`,e);function n(e,n){t.push(e,n?.startTime??Date.now())}function r(){let e=[];for(let n=0;n<t.length;n+=2)e.push({name:t[n],startTime:t[n+1]});return e}function i(e){if(e===void 0){let e=t.length>=2&&t[0]===`code/timeOrigin`,n=e?t[1]:void 0;t.length=0,e&&t.push(`code/timeOrigin`,n)}else for(let n=t.length-2;n>=0;n-=2)t[n]===e&&t.splice(n,2)}return{mark:n,getMarks:r,clearMarks:i}}function xr(){if(typeof performance==`object`&&typeof performance.mark==`function`&&!performance.nodeTiming)return typeof performance.timeOrigin!=`number`&&!performance.timing?br():{mark(e,t){performance.mark(e,t)},clearMarks(e){performance.clearMarks(e)},getMarks(){let e=performance.timeOrigin;typeof e!=`number`&&(e=(performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart)??0);let t=[{name:`code/timeOrigin`,startTime:Math.round(e)}];for(let n of performance.getEntriesByType(`mark`))t.push({name:n.name,startTime:Math.round(e+n.startTime)});return t}};if(typeof process==`object`){let e=performance?.timeOrigin;return br(e)}else return console.trace(`perf-util loaded in UNKNOWN environment`),br()}function Sr(e){return e.MonacoPerformanceMarks||=xr(),e.MonacoPerformanceMarks}const Cr=Sr(globalThis),wr=Cr.mark;Cr.clearMarks;const Tr=Cr.getMarks;var C;(function(e){e[e.Null=0]=`Null`,e[e.Backspace=8]=`Backspace`,e[e.Tab=9]=`Tab`,e[e.LineFeed=10]=`LineFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationMark=33]=`ExclamationMark`,e[e.DoubleQuote=34]=`DoubleQuote`,e[e.Hash=35]=`Hash`,e[e.DollarSign=36]=`DollarSign`,e[e.PercentSign=37]=`PercentSign`,e[e.Ampersand=38]=`Ampersand`,e[e.SingleQuote=39]=`SingleQuote`,e[e.OpenParen=40]=`OpenParen`,e[e.CloseParen=41]=`CloseParen`,e[e.Asterisk=42]=`Asterisk`,e[e.Plus=43]=`Plus`,e[e.Comma=44]=`Comma`,e[e.Dash=45]=`Dash`,e[e.Period=46]=`Period`,e[e.Slash=47]=`Slash`,e[e.Digit0=48]=`Digit0`,e[e.Digit1=49]=`Digit1`,e[e.Digit2=50]=`Digit2`,e[e.Digit3=51]=`Digit3`,e[e.Digit4=52]=`Digit4`,e[e.Digit5=53]=`Digit5`,e[e.Digit6=54]=`Digit6`,e[e.Digit7=55]=`Digit7`,e[e.Digit8=56]=`Digit8`,e[e.Digit9=57]=`Digit9`,e[e.Colon=58]=`Colon`,e[e.Semicolon=59]=`Semicolon`,e[e.LessThan=60]=`LessThan`,e[e.Equals=61]=`Equals`,e[e.GreaterThan=62]=`GreaterThan`,e[e.QuestionMark=63]=`QuestionMark`,e[e.AtSign=64]=`AtSign`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.OpenSquareBracket=91]=`OpenSquareBracket`,e[e.Backslash=92]=`Backslash`,e[e.CloseSquareBracket=93]=`CloseSquareBracket`,e[e.Caret=94]=`Caret`,e[e.Underline=95]=`Underline`,e[e.BackTick=96]=`BackTick`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.OpenCurlyBrace=123]=`OpenCurlyBrace`,e[e.Pipe=124]=`Pipe`,e[e.CloseCurlyBrace=125]=`CloseCurlyBrace`,e[e.Tilde=126]=`Tilde`,e[e.NoBreakSpace=160]=`NoBreakSpace`,e[e.U_Combining_Grave_Accent=768]=`U_Combining_Grave_Accent`,e[e.U_Combining_Acute_Accent=769]=`U_Combining_Acute_Accent`,e[e.U_Combining_Circumflex_Accent=770]=`U_Combining_Circumflex_Accent`,e[e.U_Combining_Tilde=771]=`U_Combining_Tilde`,e[e.U_Combining_Macron=772]=`U_Combining_Macron`,e[e.U_Combining_Overline=773]=`U_Combining_Overline`,e[e.U_Combining_Breve=774]=`U_Combining_Breve`,e[e.U_Combining_Dot_Above=775]=`U_Combining_Dot_Above`,e[e.U_Combining_Diaeresis=776]=`U_Combining_Diaeresis`,e[e.U_Combining_Hook_Above=777]=`U_Combining_Hook_Above`,e[e.U_Combining_Ring_Above=778]=`U_Combining_Ring_Above`,e[e.U_Combining_Double_Acute_Accent=779]=`U_Combining_Double_Acute_Accent`,e[e.U_Combining_Caron=780]=`U_Combining_Caron`,e[e.U_Combining_Vertical_Line_Above=781]=`U_Combining_Vertical_Line_Above`,e[e.U_Combining_Double_Vertical_Line_Above=782]=`U_Combining_Double_Vertical_Line_Above`,e[e.U_Combining_Double_Grave_Accent=783]=`U_Combining_Double_Grave_Accent`,e[e.U_Combining_Candrabindu=784]=`U_Combining_Candrabindu`,e[e.U_Combining_Inverted_Breve=785]=`U_Combining_Inverted_Breve`,e[e.U_Combining_Turned_Comma_Above=786]=`U_Combining_Turned_Comma_Above`,e[e.U_Combining_Comma_Above=787]=`U_Combining_Comma_Above`,e[e.U_Combining_Reversed_Comma_Above=788]=`U_Combining_Reversed_Comma_Above`,e[e.U_Combining_Comma_Above_Right=789]=`U_Combining_Comma_Above_Right`,e[e.U_Combining_Grave_Accent_Below=790]=`U_Combining_Grave_Accent_Below`,e[e.U_Combining_Acute_Accent_Below=791]=`U_Combining_Acute_Accent_Below`,e[e.U_Combining_Left_Tack_Below=792]=`U_Combining_Left_Tack_Below`,e[e.U_Combining_Right_Tack_Below=793]=`U_Combining_Right_Tack_Below`,e[e.U_Combining_Left_Angle_Above=794]=`U_Combining_Left_Angle_Above`,e[e.U_Combining_Horn=795]=`U_Combining_Horn`,e[e.U_Combining_Left_Half_Ring_Below=796]=`U_Combining_Left_Half_Ring_Below`,e[e.U_Combining_Up_Tack_Below=797]=`U_Combining_Up_Tack_Below`,e[e.U_Combining_Down_Tack_Below=798]=`U_Combining_Down_Tack_Below`,e[e.U_Combining_Plus_Sign_Below=799]=`U_Combining_Plus_Sign_Below`,e[e.U_Combining_Minus_Sign_Below=800]=`U_Combining_Minus_Sign_Below`,e[e.U_Combining_Palatalized_Hook_Below=801]=`U_Combining_Palatalized_Hook_Below`,e[e.U_Combining_Retroflex_Hook_Below=802]=`U_Combining_Retroflex_Hook_Below`,e[e.U_Combining_Dot_Below=803]=`U_Combining_Dot_Below`,e[e.U_Combining_Diaeresis_Below=804]=`U_Combining_Diaeresis_Below`,e[e.U_Combining_Ring_Below=805]=`U_Combining_Ring_Below`,e[e.U_Combining_Comma_Below=806]=`U_Combining_Comma_Below`,e[e.U_Combining_Cedilla=807]=`U_Combining_Cedilla`,e[e.U_Combining_Ogonek=808]=`U_Combining_Ogonek`,e[e.U_Combining_Vertical_Line_Below=809]=`U_Combining_Vertical_Line_Below`,e[e.U_Combining_Bridge_Below=810]=`U_Combining_Bridge_Below`,e[e.U_Combining_Inverted_Double_Arch_Below=811]=`U_Combining_Inverted_Double_Arch_Below`,e[e.U_Combining_Caron_Below=812]=`U_Combining_Caron_Below`,e[e.U_Combining_Circumflex_Accent_Below=813]=`U_Combining_Circumflex_Accent_Below`,e[e.U_Combining_Breve_Below=814]=`U_Combining_Breve_Below`,e[e.U_Combining_Inverted_Breve_Below=815]=`U_Combining_Inverted_Breve_Below`,e[e.U_Combining_Tilde_Below=816]=`U_Combining_Tilde_Below`,e[e.U_Combining_Macron_Below=817]=`U_Combining_Macron_Below`,e[e.U_Combining_Low_Line=818]=`U_Combining_Low_Line`,e[e.U_Combining_Double_Low_Line=819]=`U_Combining_Double_Low_Line`,e[e.U_Combining_Tilde_Overlay=820]=`U_Combining_Tilde_Overlay`,e[e.U_Combining_Short_Stroke_Overlay=821]=`U_Combining_Short_Stroke_Overlay`,e[e.U_Combining_Long_Stroke_Overlay=822]=`U_Combining_Long_Stroke_Overlay`,e[e.U_Combining_Short_Solidus_Overlay=823]=`U_Combining_Short_Solidus_Overlay`,e[e.U_Combining_Long_Solidus_Overlay=824]=`U_Combining_Long_Solidus_Overlay`,e[e.U_Combining_Right_Half_Ring_Below=825]=`U_Combining_Right_Half_Ring_Below`,e[e.U_Combining_Inverted_Bridge_Below=826]=`U_Combining_Inverted_Bridge_Below`,e[e.U_Combining_Square_Below=827]=`U_Combining_Square_Below`,e[e.U_Combining_Seagull_Below=828]=`U_Combining_Seagull_Below`,e[e.U_Combining_X_Above=829]=`U_Combining_X_Above`,e[e.U_Combining_Vertical_Tilde=830]=`U_Combining_Vertical_Tilde`,e[e.U_Combining_Double_Overline=831]=`U_Combining_Double_Overline`,e[e.U_Combining_Grave_Tone_Mark=832]=`U_Combining_Grave_Tone_Mark`,e[e.U_Combining_Acute_Tone_Mark=833]=`U_Combining_Acute_Tone_Mark`,e[e.U_Combining_Greek_Perispomeni=834]=`U_Combining_Greek_Perispomeni`,e[e.U_Combining_Greek_Koronis=835]=`U_Combining_Greek_Koronis`,e[e.U_Combining_Greek_Dialytika_Tonos=836]=`U_Combining_Greek_Dialytika_Tonos`,e[e.U_Combining_Greek_Ypogegrammeni=837]=`U_Combining_Greek_Ypogegrammeni`,e[e.U_Combining_Bridge_Above=838]=`U_Combining_Bridge_Above`,e[e.U_Combining_Equals_Sign_Below=839]=`U_Combining_Equals_Sign_Below`,e[e.U_Combining_Double_Vertical_Line_Below=840]=`U_Combining_Double_Vertical_Line_Below`,e[e.U_Combining_Left_Angle_Below=841]=`U_Combining_Left_Angle_Below`,e[e.U_Combining_Not_Tilde_Above=842]=`U_Combining_Not_Tilde_Above`,e[e.U_Combining_Homothetic_Above=843]=`U_Combining_Homothetic_Above`,e[e.U_Combining_Almost_Equal_To_Above=844]=`U_Combining_Almost_Equal_To_Above`,e[e.U_Combining_Left_Right_Arrow_Below=845]=`U_Combining_Left_Right_Arrow_Below`,e[e.U_Combining_Upwards_Arrow_Below=846]=`U_Combining_Upwards_Arrow_Below`,e[e.U_Combining_Grapheme_Joiner=847]=`U_Combining_Grapheme_Joiner`,e[e.U_Combining_Right_Arrowhead_Above=848]=`U_Combining_Right_Arrowhead_Above`,e[e.U_Combining_Left_Half_Ring_Above=849]=`U_Combining_Left_Half_Ring_Above`,e[e.U_Combining_Fermata=850]=`U_Combining_Fermata`,e[e.U_Combining_X_Below=851]=`U_Combining_X_Below`,e[e.U_Combining_Left_Arrowhead_Below=852]=`U_Combining_Left_Arrowhead_Below`,e[e.U_Combining_Right_Arrowhead_Below=853]=`U_Combining_Right_Arrowhead_Below`,e[e.U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below=854]=`U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below`,e[e.U_Combining_Right_Half_Ring_Above=855]=`U_Combining_Right_Half_Ring_Above`,e[e.U_Combining_Dot_Above_Right=856]=`U_Combining_Dot_Above_Right`,e[e.U_Combining_Asterisk_Below=857]=`U_Combining_Asterisk_Below`,e[e.U_Combining_Double_Ring_Below=858]=`U_Combining_Double_Ring_Below`,e[e.U_Combining_Zigzag_Above=859]=`U_Combining_Zigzag_Above`,e[e.U_Combining_Double_Breve_Below=860]=`U_Combining_Double_Breve_Below`,e[e.U_Combining_Double_Breve=861]=`U_Combining_Double_Breve`,e[e.U_Combining_Double_Macron=862]=`U_Combining_Double_Macron`,e[e.U_Combining_Double_Macron_Below=863]=`U_Combining_Double_Macron_Below`,e[e.U_Combining_Double_Tilde=864]=`U_Combining_Double_Tilde`,e[e.U_Combining_Double_Inverted_Breve=865]=`U_Combining_Double_Inverted_Breve`,e[e.U_Combining_Double_Rightwards_Arrow_Below=866]=`U_Combining_Double_Rightwards_Arrow_Below`,e[e.U_Combining_Latin_Small_Letter_A=867]=`U_Combining_Latin_Small_Letter_A`,e[e.U_Combining_Latin_Small_Letter_E=868]=`U_Combining_Latin_Small_Letter_E`,e[e.U_Combining_Latin_Small_Letter_I=869]=`U_Combining_Latin_Small_Letter_I`,e[e.U_Combining_Latin_Small_Letter_O=870]=`U_Combining_Latin_Small_Letter_O`,e[e.U_Combining_Latin_Small_Letter_U=871]=`U_Combining_Latin_Small_Letter_U`,e[e.U_Combining_Latin_Small_Letter_C=872]=`U_Combining_Latin_Small_Letter_C`,e[e.U_Combining_Latin_Small_Letter_D=873]=`U_Combining_Latin_Small_Letter_D`,e[e.U_Combining_Latin_Small_Letter_H=874]=`U_Combining_Latin_Small_Letter_H`,e[e.U_Combining_Latin_Small_Letter_M=875]=`U_Combining_Latin_Small_Letter_M`,e[e.U_Combining_Latin_Small_Letter_R=876]=`U_Combining_Latin_Small_Letter_R`,e[e.U_Combining_Latin_Small_Letter_T=877]=`U_Combining_Latin_Small_Letter_T`,e[e.U_Combining_Latin_Small_Letter_V=878]=`U_Combining_Latin_Small_Letter_V`,e[e.U_Combining_Latin_Small_Letter_X=879]=`U_Combining_Latin_Small_Letter_X`,e[e.LINE_SEPARATOR=8232]=`LINE_SEPARATOR`,e[e.PARAGRAPH_SEPARATOR=8233]=`PARAGRAPH_SEPARATOR`,e[e.NEXT_LINE=133]=`NEXT_LINE`,e[e.U_CIRCUMFLEX=94]=`U_CIRCUMFLEX`,e[e.U_GRAVE_ACCENT=96]=`U_GRAVE_ACCENT`,e[e.U_DIAERESIS=168]=`U_DIAERESIS`,e[e.U_MACRON=175]=`U_MACRON`,e[e.U_ACUTE_ACCENT=180]=`U_ACUTE_ACCENT`,e[e.U_CEDILLA=184]=`U_CEDILLA`,e[e.U_MODIFIER_LETTER_LEFT_ARROWHEAD=706]=`U_MODIFIER_LETTER_LEFT_ARROWHEAD`,e[e.U_MODIFIER_LETTER_RIGHT_ARROWHEAD=707]=`U_MODIFIER_LETTER_RIGHT_ARROWHEAD`,e[e.U_MODIFIER_LETTER_UP_ARROWHEAD=708]=`U_MODIFIER_LETTER_UP_ARROWHEAD`,e[e.U_MODIFIER_LETTER_DOWN_ARROWHEAD=709]=`U_MODIFIER_LETTER_DOWN_ARROWHEAD`,e[e.U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING=722]=`U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING`,e[e.U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING=723]=`U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING`,e[e.U_MODIFIER_LETTER_UP_TACK=724]=`U_MODIFIER_LETTER_UP_TACK`,e[e.U_MODIFIER_LETTER_DOWN_TACK=725]=`U_MODIFIER_LETTER_DOWN_TACK`,e[e.U_MODIFIER_LETTER_PLUS_SIGN=726]=`U_MODIFIER_LETTER_PLUS_SIGN`,e[e.U_MODIFIER_LETTER_MINUS_SIGN=727]=`U_MODIFIER_LETTER_MINUS_SIGN`,e[e.U_BREVE=728]=`U_BREVE`,e[e.U_DOT_ABOVE=729]=`U_DOT_ABOVE`,e[e.U_RING_ABOVE=730]=`U_RING_ABOVE`,e[e.U_OGONEK=731]=`U_OGONEK`,e[e.U_SMALL_TILDE=732]=`U_SMALL_TILDE`,e[e.U_DOUBLE_ACUTE_ACCENT=733]=`U_DOUBLE_ACUTE_ACCENT`,e[e.U_MODIFIER_LETTER_RHOTIC_HOOK=734]=`U_MODIFIER_LETTER_RHOTIC_HOOK`,e[e.U_MODIFIER_LETTER_CROSS_ACCENT=735]=`U_MODIFIER_LETTER_CROSS_ACCENT`,e[e.U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR=741]=`U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR`,e[e.U_MODIFIER_LETTER_HIGH_TONE_BAR=742]=`U_MODIFIER_LETTER_HIGH_TONE_BAR`,e[e.U_MODIFIER_LETTER_MID_TONE_BAR=743]=`U_MODIFIER_LETTER_MID_TONE_BAR`,e[e.U_MODIFIER_LETTER_LOW_TONE_BAR=744]=`U_MODIFIER_LETTER_LOW_TONE_BAR`,e[e.U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR=745]=`U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR`,e[e.U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK=746]=`U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK`,e[e.U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK=747]=`U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK`,e[e.U_MODIFIER_LETTER_UNASPIRATED=749]=`U_MODIFIER_LETTER_UNASPIRATED`,e[e.U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD=751]=`U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD`,e[e.U_MODIFIER_LETTER_LOW_UP_ARROWHEAD=752]=`U_MODIFIER_LETTER_LOW_UP_ARROWHEAD`,e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD=753]=`U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD`,e[e.U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD=754]=`U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD`,e[e.U_MODIFIER_LETTER_LOW_RING=755]=`U_MODIFIER_LETTER_LOW_RING`,e[e.U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT=756]=`U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT`,e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT=757]=`U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT`,e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT=758]=`U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT`,e[e.U_MODIFIER_LETTER_LOW_TILDE=759]=`U_MODIFIER_LETTER_LOW_TILDE`,e[e.U_MODIFIER_LETTER_RAISED_COLON=760]=`U_MODIFIER_LETTER_RAISED_COLON`,e[e.U_MODIFIER_LETTER_BEGIN_HIGH_TONE=761]=`U_MODIFIER_LETTER_BEGIN_HIGH_TONE`,e[e.U_MODIFIER_LETTER_END_HIGH_TONE=762]=`U_MODIFIER_LETTER_END_HIGH_TONE`,e[e.U_MODIFIER_LETTER_BEGIN_LOW_TONE=763]=`U_MODIFIER_LETTER_BEGIN_LOW_TONE`,e[e.U_MODIFIER_LETTER_END_LOW_TONE=764]=`U_MODIFIER_LETTER_END_LOW_TONE`,e[e.U_MODIFIER_LETTER_SHELF=765]=`U_MODIFIER_LETTER_SHELF`,e[e.U_MODIFIER_LETTER_OPEN_SHELF=766]=`U_MODIFIER_LETTER_OPEN_SHELF`,e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROW=767]=`U_MODIFIER_LETTER_LOW_LEFT_ARROW`,e[e.U_GREEK_LOWER_NUMERAL_SIGN=885]=`U_GREEK_LOWER_NUMERAL_SIGN`,e[e.U_GREEK_TONOS=900]=`U_GREEK_TONOS`,e[e.U_GREEK_DIALYTIKA_TONOS=901]=`U_GREEK_DIALYTIKA_TONOS`,e[e.U_GREEK_KORONIS=8125]=`U_GREEK_KORONIS`,e[e.U_GREEK_PSILI=8127]=`U_GREEK_PSILI`,e[e.U_GREEK_PERISPOMENI=8128]=`U_GREEK_PERISPOMENI`,e[e.U_GREEK_DIALYTIKA_AND_PERISPOMENI=8129]=`U_GREEK_DIALYTIKA_AND_PERISPOMENI`,e[e.U_GREEK_PSILI_AND_VARIA=8141]=`U_GREEK_PSILI_AND_VARIA`,e[e.U_GREEK_PSILI_AND_OXIA=8142]=`U_GREEK_PSILI_AND_OXIA`,e[e.U_GREEK_PSILI_AND_PERISPOMENI=8143]=`U_GREEK_PSILI_AND_PERISPOMENI`,e[e.U_GREEK_DASIA_AND_VARIA=8157]=`U_GREEK_DASIA_AND_VARIA`,e[e.U_GREEK_DASIA_AND_OXIA=8158]=`U_GREEK_DASIA_AND_OXIA`,e[e.U_GREEK_DASIA_AND_PERISPOMENI=8159]=`U_GREEK_DASIA_AND_PERISPOMENI`,e[e.U_GREEK_DIALYTIKA_AND_VARIA=8173]=`U_GREEK_DIALYTIKA_AND_VARIA`,e[e.U_GREEK_DIALYTIKA_AND_OXIA=8174]=`U_GREEK_DIALYTIKA_AND_OXIA`,e[e.U_GREEK_VARIA=8175]=`U_GREEK_VARIA`,e[e.U_GREEK_OXIA=8189]=`U_GREEK_OXIA`,e[e.U_GREEK_DASIA=8190]=`U_GREEK_DASIA`,e[e.U_IDEOGRAPHIC_FULL_STOP=12290]=`U_IDEOGRAPHIC_FULL_STOP`,e[e.U_LEFT_CORNER_BRACKET=12300]=`U_LEFT_CORNER_BRACKET`,e[e.U_RIGHT_CORNER_BRACKET=12301]=`U_RIGHT_CORNER_BRACKET`,e[e.U_LEFT_BLACK_LENTICULAR_BRACKET=12304]=`U_LEFT_BLACK_LENTICULAR_BRACKET`,e[e.U_RIGHT_BLACK_LENTICULAR_BRACKET=12305]=`U_RIGHT_BLACK_LENTICULAR_BRACKET`,e[e.U_OVERLINE=8254]=`U_OVERLINE`,e[e.UTF8_BOM=65279]=`UTF8_BOM`,e[e.U_FULLWIDTH_SEMICOLON=65307]=`U_FULLWIDTH_SEMICOLON`,e[e.U_FULLWIDTH_COMMA=65292]=`U_FULLWIDTH_COMMA`})(C||={});var Er;(function(e){e[e.Uri=1]=`Uri`,e[e.Regexp=2]=`Regexp`,e[e.ScmResource=3]=`ScmResource`,e[e.ScmResourceGroup=4]=`ScmResourceGroup`,e[e.ScmProvider=5]=`ScmProvider`,e[e.CommentController=6]=`CommentController`,e[e.CommentThread=7]=`CommentThread`,e[e.CommentThreadInstance=8]=`CommentThreadInstance`,e[e.CommentThreadReply=9]=`CommentThreadReply`,e[e.CommentNode=10]=`CommentNode`,e[e.CommentThreadNode=11]=`CommentThreadNode`,e[e.TimelineActionContext=12]=`TimelineActionContext`,e[e.NotebookCellActionContext=13]=`NotebookCellActionContext`,e[e.NotebookActionContext=14]=`NotebookActionContext`,e[e.TerminalContext=15]=`TerminalContext`,e[e.TestItemContext=16]=`TestItemContext`,e[e.Date=17]=`Date`,e[e.TestMessageMenuArgs=18]=`TestMessageMenuArgs`,e[e.ChatViewContext=19]=`ChatViewContext`,e[e.LanguageModelToolResult=20]=`LanguageModelToolResult`,e[e.LanguageModelTextPart=21]=`LanguageModelTextPart`,e[e.LanguageModelThinkingPart=22]=`LanguageModelThinkingPart`,e[e.LanguageModelPromptTsxPart=23]=`LanguageModelPromptTsxPart`,e[e.LanguageModelDataPart=24]=`LanguageModelDataPart`,e[e.AgentSessionContext=25]=`AgentSessionContext`,e[e.ChatResponsePullRequestPart=26]=`ChatResponsePullRequestPart`})(Er||={});var Dr=class extends Error{constructor(e,t,n){let r;typeof t==`string`&&t.indexOf(`not `)===0?(r=`must not be`,t=t.replace(/^not /,``)):r=`must be`;let i=`The "${e}" ${e.indexOf(`.`)===-1?`argument`:`property`} ${r} of type ${t}`;i+=`. Received type ${typeof n}`,super(i),this.code=`ERR_INVALID_ARG_TYPE`}};function Or(e,t){if(typeof e!=`object`||!e)throw new Dr(t,`Object`,e)}function kr(e,t){if(typeof e!=`string`)throw new Dr(t,`string`,e)}const Ar=qn===`win32`;function jr(e){return e===47||e===92}function Mr(e){return e===47}function Nr(e){return e>=65&&e<=90||e>=97&&e<=122}function Pr(e,t,n,r){let i=``,a=0,o=-1,s=0,c=0;for(let l=0;l<=e.length;++l){if(l<e.length)c=e.charCodeAt(l);else if(r(c))break;else c=47;if(r(c)){if(!(o===l-1||s===1))if(s===2){if(i.length<2||a!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){let e=i.lastIndexOf(n);e===-1?(i=``,a=0):(i=i.slice(0,e),a=i.length-1-i.lastIndexOf(n)),o=l,s=0;continue}else if(i.length!==0){i=``,a=0,o=l,s=0;continue}}t&&(i+=i.length>0?`${n}..`:`..`,a=2)}else i.length>0?i+=`${n}${e.slice(o+1,l)}`:i=e.slice(o+1,l),a=l-o-1;o=l,s=0}else c===46&&s!==-1?++s:s=-1}return i}function Fr(e){return e?`${e[0]===`.`?``:`.`}${e}`:``}function Ir(e,t){Or(t,`pathObject`);let n=t.dir||t.root,r=t.base||`${t.name||``}${Fr(t.ext)}`;return n?n===t.root?`${n}${r}`:`${n}${e}${r}`:r}const Lr={resolve(...e){let t=``,n=``,r=!1;for(let i=e.length-1;i>=-1;i--){let a;if(i>=0){if(a=e[i],kr(a,`paths[${i}]`),a.length===0)continue}else t.length===0?a=Gn():(a=Kn[`=${t}`]||Gn(),(a===void 0||a.slice(0,2).toLowerCase()!==t.toLowerCase()&&a.charCodeAt(2)===92)&&(a=`${t}\\`));let o=a.length,s=0,c=``,l=!1,u=a.charCodeAt(0);if(o===1)jr(u)&&(s=1,l=!0);else if(jr(u))if(l=!0,jr(a.charCodeAt(1))){let e=2,t=e;for(;e<o&&!jr(a.charCodeAt(e));)e++;if(e<o&&e!==t){let n=a.slice(t,e);for(t=e;e<o&&jr(a.charCodeAt(e));)e++;if(e<o&&e!==t){for(t=e;e<o&&!jr(a.charCodeAt(e));)e++;(e===o||e!==t)&&(c=`\\\\${n}\\${a.slice(t,e)}`,s=e)}}}else s=1;else Nr(u)&&a.charCodeAt(1)===58&&(c=a.slice(0,2),s=2,o>2&&jr(a.charCodeAt(2))&&(l=!0,s=3));if(c.length>0)if(t.length>0){if(c.toLowerCase()!==t.toLowerCase())continue}else t=c;if(r){if(t.length>0)break}else if(n=`${a.slice(s)}\\${n}`,r=l,l&&t.length>0)break}return n=Pr(n,!r,`\\`,jr),r?`${t}\\${n}`:`${t}${n}`||`.`},normalize(e){kr(e,`path`);let t=e.length;if(t===0)return`.`;let n=0,r,i=!1,a=e.charCodeAt(0);if(t===1)return Mr(a)?`\\`:e;if(jr(a))if(i=!0,jr(e.charCodeAt(1))){let i=2,a=i;for(;i<t&&!jr(e.charCodeAt(i));)i++;if(i<t&&i!==a){let o=e.slice(a,i);for(a=i;i<t&&jr(e.charCodeAt(i));)i++;if(i<t&&i!==a){for(a=i;i<t&&!jr(e.charCodeAt(i));)i++;if(i===t)return`\\\\${o}\\${e.slice(a)}\\`;i!==a&&(r=`\\\\${o}\\${e.slice(a,i)}`,n=i)}}}else n=1;else Nr(a)&&e.charCodeAt(1)===58&&(r=e.slice(0,2),n=2,t>2&&jr(e.charCodeAt(2))&&(i=!0,n=3));let o=n<t?Pr(e.slice(n),!i,`\\`,jr):``;if(o.length===0&&!i&&(o=`.`),o.length>0&&jr(e.charCodeAt(t-1))&&(o+=`\\`),!i&&r===void 0&&e.includes(`:`)){if(o.length>=2&&Nr(o.charCodeAt(0))&&o.charCodeAt(1)===58)return`.\\${o}`;let n=e.indexOf(`:`);do if(n===t-1||jr(e.charCodeAt(n+1)))return`.\\${o}`;while((n=e.indexOf(`:`,n+1))!==-1)}return r===void 0?i?`\\${o}`:o:i?`${r}\\${o}`:`${r}${o}`},isAbsolute(e){kr(e,`path`);let t=e.length;if(t===0)return!1;let n=e.charCodeAt(0);return jr(n)||t>2&&Nr(n)&&e.charCodeAt(1)===58&&jr(e.charCodeAt(2))},join(...e){if(e.length===0)return`.`;let t,n;for(let r=0;r<e.length;++r){let i=e[r];kr(i,`path`),i.length>0&&(t===void 0?t=n=i:t+=`\\${i}`)}if(t===void 0)return`.`;let r=!0,i=0;if(typeof n==`string`&&jr(n.charCodeAt(0))){++i;let e=n.length;e>1&&jr(n.charCodeAt(1))&&(++i,e>2&&(jr(n.charCodeAt(2))?++i:r=!1))}if(r){for(;i<t.length&&jr(t.charCodeAt(i));)i++;i>=2&&(t=`\\${t.slice(i)}`)}return Lr.normalize(t)},relative(e,t){if(kr(e,`from`),kr(t,`to`),e===t)return``;let n=Lr.resolve(e),r=Lr.resolve(t);if(n===r||(e=n.toLowerCase(),t=r.toLowerCase(),e===t))return``;if(n.length!==e.length||r.length!==t.length){let e=n.split(`\\`),t=r.split(`\\`);e[e.length-1]===``&&e.pop(),t[t.length-1]===``&&t.pop();let i=e.length,a=t.length,o=i<a?i:a,s;for(s=0;s<o&&e[s].toLowerCase()===t[s].toLowerCase();s++);return s===0?r:s===o?a>o?t.slice(s).join(`\\`):i>o?`..\\`.repeat(i-1-s)+`..`:``:`..\\`.repeat(i-s)+t.slice(s).join(`\\`)}let i=0;for(;i<e.length&&e.charCodeAt(i)===92;)i++;let a=e.length;for(;a-1>i&&e.charCodeAt(a-1)===92;)a--;let o=a-i,s=0;for(;s<t.length&&t.charCodeAt(s)===92;)s++;let c=t.length;for(;c-1>s&&t.charCodeAt(c-1)===92;)c--;let l=c-s,u=o<l?o:l,d=-1,f=0;for(;f<u;f++){let n=e.charCodeAt(i+f);if(n!==t.charCodeAt(s+f))break;n===92&&(d=f)}if(f!==u){if(d===-1)return r}else{if(l>u){if(t.charCodeAt(s+f)===92)return r.slice(s+f+1);if(f===2)return r.slice(s+f)}o>u&&(e.charCodeAt(i+f)===92?d=f:f===2&&(d=3)),d===-1&&(d=0)}let p=``;for(f=i+d+1;f<=a;++f)(f===a||e.charCodeAt(f)===92)&&(p+=p.length===0?`..`:`\\..`);return s+=d,p.length>0?`${p}${r.slice(s,c)}`:(r.charCodeAt(s)===92&&++s,r.slice(s,c))},toNamespacedPath(e){if(typeof e!=`string`||e.length===0)return e;let t=Lr.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===92){if(t.charCodeAt(1)===92){let e=t.charCodeAt(2);if(e!==63&&e!==46)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(Nr(t.charCodeAt(0))&&t.charCodeAt(1)===58&&t.charCodeAt(2)===92)return`\\\\?\\${t}`;return t},dirname(e){kr(e,`path`);let t=e.length;if(t===0)return`.`;let n=-1,r=0,i=e.charCodeAt(0);if(t===1)return jr(i)?e:`.`;if(jr(i)){if(n=r=1,jr(e.charCodeAt(1))){let i=2,a=i;for(;i<t&&!jr(e.charCodeAt(i));)i++;if(i<t&&i!==a){for(a=i;i<t&&jr(e.charCodeAt(i));)i++;if(i<t&&i!==a){for(a=i;i<t&&!jr(e.charCodeAt(i));)i++;if(i===t)return e;i!==a&&(n=r=i+1)}}}}else Nr(i)&&e.charCodeAt(1)===58&&(n=t>2&&jr(e.charCodeAt(2))?3:2,r=n);let a=-1,o=!0;for(let n=t-1;n>=r;--n)if(jr(e.charCodeAt(n))){if(!o){a=n;break}}else o=!1;if(a===-1){if(n===-1)return`.`;a=n}return e.slice(0,a)},basename(e,t){t!==void 0&&kr(t,`suffix`),kr(e,`path`);let n=0,r=-1,i=!0,a;if(e.length>=2&&Nr(e.charCodeAt(0))&&e.charCodeAt(1)===58&&(n=2),t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=n;--a){let c=e.charCodeAt(a);if(jr(c)){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=n;--a)if(jr(e.charCodeAt(a))){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){kr(e,`path`);let t=0,n=-1,r=0,i=-1,a=!0,o=0;e.length>=2&&e.charCodeAt(1)===58&&Nr(e.charCodeAt(0))&&(t=r=2);for(let s=e.length-1;s>=t;--s){let t=e.charCodeAt(s);if(jr(t)){if(!a){r=s+1;break}continue}i===-1&&(a=!1,i=s+1),t===46?n===-1?n=s:o!==1&&(o=1):n!==-1&&(o=-1)}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?``:e.slice(n,i)},format:Ir.bind(null,`\\`),parse(e){kr(e,`path`);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;let n=e.length,r=0,i=e.charCodeAt(0);if(n===1)return jr(i)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(jr(i)){if(r=1,jr(e.charCodeAt(1))){let t=2,i=t;for(;t<n&&!jr(e.charCodeAt(t));)t++;if(t<n&&t!==i){for(i=t;t<n&&jr(e.charCodeAt(t));)t++;if(t<n&&t!==i){for(i=t;t<n&&!jr(e.charCodeAt(t));)t++;t===n?r=t:t!==i&&(r=t+1)}}}}else if(Nr(i)&&e.charCodeAt(1)===58){if(n<=2)return t.root=t.dir=e,t;if(r=2,jr(e.charCodeAt(2))){if(n===3)return t.root=t.dir=e,t;r=3}}r>0&&(t.root=e.slice(0,r));let a=-1,o=r,s=-1,c=!0,l=e.length-1,u=0;for(;l>=r;--l){if(i=e.charCodeAt(l),jr(i)){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),i===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return s!==-1&&(a===-1||u===0||u===1&&a===s-1&&a===o+1?t.base=t.name=e.slice(o,s):(t.name=e.slice(o,a),t.base=e.slice(o,s),t.ext=e.slice(a,s))),o>0&&o!==r?t.dir=e.slice(0,o-1):t.dir=t.root,t},sep:`\\`,delimiter:`;`,win32:null,posix:null},Rr=(()=>{if(Ar){let e=/\\/g;return()=>{let t=Gn().replace(e,`/`);return t.slice(t.indexOf(`/`))}}return()=>Gn()})(),zr={resolve(...e){let t=``,n=!1;for(let r=e.length-1;r>=0&&!n;r--){let i=e[r];kr(i,`paths[${r}]`),i.length!==0&&(t=`${i}/${t}`,n=i.charCodeAt(0)===47)}if(!n){let e=Rr();t=`${e}/${t}`,n=e.charCodeAt(0)===47}return t=Pr(t,!n,`/`,Mr),n?`/${t}`:t.length>0?t:`.`},normalize(e){if(kr(e,`path`),e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=Pr(e,!t,`/`,Mr),e.length===0?t?`/`:n?`./`:`.`:(n&&(e+=`/`),t?`/${e}`:e)},isAbsolute(e){return kr(e,`path`),e.length>0&&e.charCodeAt(0)===47},join(...e){if(e.length===0)return`.`;let t=[];for(let n=0;n<e.length;++n){let r=e[n];kr(r,`path`),r.length>0&&t.push(r)}return t.length===0?`.`:zr.normalize(t.join(`/`))},relative(e,t){if(kr(e,`from`),kr(t,`to`),e===t||(e=zr.resolve(e),t=zr.resolve(t),e===t))return``;let n=e.length,r=n-1,i=t.length-1,a=r<i?r:i,o=-1,s=0;for(;s<a;s++){let n=e.charCodeAt(1+s);if(n!==t.charCodeAt(1+s))break;n===47&&(o=s)}if(s===a)if(i>a){if(t.charCodeAt(1+s)===47)return t.slice(1+s+1);if(s===0)return t.slice(1+s)}else r>a&&(e.charCodeAt(1+s)===47?o=s:s===0&&(o=0));let c=``;for(s=1+o+1;s<=n;++s)(s===n||e.charCodeAt(s)===47)&&(c+=c.length===0?`..`:`/..`);return`${c}${t.slice(1+o)}`},toNamespacedPath(e){return e},dirname(e){if(kr(e,`path`),e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=-1,r=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===47){if(!r){n=t;break}}else r=!1;return n===-1?t?`/`:`.`:t&&n===1?`//`:e.slice(0,n)},basename(e,t){t!==void 0&&kr(t,`suffix`),kr(e,`path`);let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){kr(e,`path`);let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e[o];if(s===`/`){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===`.`?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},format:Ir.bind(null,`/`),parse(e){kr(e,`path`);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;let n=e.charCodeAt(0)===47,r;n?(t.root=`/`,r=1):r=0;let i=-1,a=0,o=-1,s=!0,c=e.length-1,l=0;for(;c>=r;--c){let t=e.charCodeAt(c);if(t===47){if(!s){a=c+1;break}continue}o===-1&&(s=!1,o=c+1),t===46?i===-1?i=c:l!==1&&(l=1):i!==-1&&(l=-1)}if(o!==-1){let r=a===0&&n?1:a;i===-1||l===0||l===1&&i===o-1&&i===a+1?t.base=t.name=e.slice(r,o):(t.name=e.slice(r,i),t.base=e.slice(r,o),t.ext=e.slice(i,o))}return a>0?t.dir=e.slice(0,a-1):n&&(t.dir=`/`),t},sep:`/`,delimiter:`:`,win32:null,posix:null};zr.win32=Lr.win32=Lr,zr.posix=Lr.posix=zr;const Br=Ar?Lr.normalize:zr.normalize,Vr=Ar?Lr.isAbsolute:zr.isAbsolute,Hr=Ar?Lr.join:zr.join,Ur=Ar?Lr.resolve:zr.resolve,Wr=Ar?Lr.relative:zr.relative,Gr=Ar?Lr.dirname:zr.dirname,Kr=Ar?Lr.basename:zr.basename,qr=Ar?Lr.extname:zr.extname;Ar?Lr.parse:zr.parse;const Jr=Ar?Lr.sep:zr.sep,Yr=/^\w[\w\d+.-]*$/,Xr=/^\//,Zr=/^\/\//;function Qr(e,t){if(!e.scheme&&t)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!Yr.test(e.scheme)){let t=[...e.scheme.matchAll(/[^\w\d+.-]/gu)],n=t.length>0?` Found '${t[0][0]}' at index ${t[0].index} (${t.length} total)`:``;throw Error(`[UriError]: Scheme contains illegal characters.${n} (len:${e.scheme.length})`)}if(e.path){if(e.authority){if(!Xr.test(e.path))throw Error(`[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character`)}else if(Zr.test(e.path))throw Error(`[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")`)}}function $r(e,t){return!e&&!t?`file`:e}function ei(e,t){switch(e){case`https`:case`http`:case`file`:t?t[0]!==ti&&(t=ti+t):t=ti;break}return t}const ti=`/`,ni=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;var w=class e{static isUri(t){return t instanceof e?!0:!t||typeof t!=`object`?!1:typeof t.authority==`string`&&typeof t.fragment==`string`&&typeof t.path==`string`&&typeof t.query==`string`&&typeof t.scheme==`string`&&typeof t.fsPath==`string`&&typeof t.with==`function`&&typeof t.toString==`function`}constructor(e,t,n,r,i,a=!1){typeof e==`object`?(this.scheme=e.scheme||``,this.authority=e.authority||``,this.path=e.path||``,this.query=e.query||``,this.fragment=e.fragment||``):(this.scheme=$r(e,a),this.authority=t||``,this.path=ei(this.scheme,n||``),this.query=r||``,this.fragment=i||``,Qr(this,a))}get fsPath(){return li(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:a}=e;return t===void 0?t=this.scheme:t===null&&(t=``),n===void 0?n=this.authority:n===null&&(n=``),r===void 0?r=this.path:r===null&&(r=``),i===void 0?i=this.query:i===null&&(i=``),a===void 0?a=this.fragment:a===null&&(a=``),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new ai(t,n,r,i,a)}static parse(e,t=!1){let n=ni.exec(e);return n?new ai(n[2]||``,pi(n[4]||``),pi(n[5]||``),pi(n[7]||``),pi(n[9]||``),t):new ai(``,``,``,``,``)}static file(e){let t=``;if(yn&&(e=e.replace(/\\/g,`/`)),e[0]===`/`&&e[1]===`/`){let n=e.indexOf(`/`,2);n===-1?(t=e.substring(2),e=`/`):(t=e.substring(2,n),e=e.substring(n)||`/`)}return new ai(`file`,t,e,``,``)}static from(e,t){return new ai(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(t,...n){if(!t.path)throw Error(`[UriError]: cannot call joinPath on URI without path: ${t.toString()}`);let r;return r=yn&&t.scheme===`file`?e.file(Lr.join(li(t,!0),...n)).path:zr.join(t.path,...n),t.with({path:r})}toString(e=!1){return ui(this,e)}toJSON(){return this}static revive(t){if(!t||t instanceof e)return t;{let e=new ai(t);return e._formatted=t.external??null,e._fsPath=t._sep===ii?t.fsPath??null:null,e}}[Symbol.for(`debug.description`)](){return`URI(${this.toString()})`}};function ri(e){return!e||typeof e!=`object`?!1:typeof e.scheme==`string`&&(typeof e.authority==`string`||e.authority===void 0)&&(typeof e.path==`string`||e.path===void 0)&&(typeof e.query==`string`||e.query===void 0)&&(typeof e.fragment==`string`||e.fragment===void 0)}const ii=yn?1:void 0;var ai=class extends w{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||=li(this,!1),this._fsPath}toString(e=!1){return e?ui(this,!0):(this._formatted||=ui(this,!1),this._formatted)}toJSON(){let e={$mid:Er.Uri};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=ii),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const oi={[C.Colon]:`%3A`,[C.Slash]:`%2F`,[C.QuestionMark]:`%3F`,[C.Hash]:`%23`,[C.OpenSquareBracket]:`%5B`,[C.CloseSquareBracket]:`%5D`,[C.AtSign]:`%40`,[C.ExclamationMark]:`%21`,[C.DollarSign]:`%24`,[C.Ampersand]:`%26`,[C.SingleQuote]:`%27`,[C.OpenParen]:`%28`,[C.CloseParen]:`%29`,[C.Asterisk]:`%2A`,[C.Plus]:`%2B`,[C.Comma]:`%2C`,[C.Semicolon]:`%3B`,[C.Equals]:`%3D`,[C.Space]:`%20`};function si(e,t,n){let r,i=-1;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);if(o>=C.a&&o<=C.z||o>=C.A&&o<=C.Z||o>=C.Digit0&&o<=C.Digit9||o===C.Dash||o===C.Period||o===C.Underline||o===C.Tilde||t&&o===C.Slash||n&&o===C.OpenSquareBracket||n&&o===C.CloseSquareBracket||n&&o===C.Colon)i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r!==void 0&&(r+=e.charAt(a));else{r===void 0&&(r=e.substr(0,a));let t=oi[o];t===void 0?i===-1&&(i=a):(i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r+=t)}}return i!==-1&&(r+=encodeURIComponent(e.substring(i))),r===void 0?e:r}function ci(e){let t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r===C.Hash||r===C.QuestionMark?(t===void 0&&(t=e.substr(0,n)),t+=oi[r]):t!==void 0&&(t+=e[n])}return t===void 0?e:t}function li(e,t){let n;return n=e.authority&&e.path.length>1&&e.scheme===`file`?`//${e.authority}${e.path}`:e.path.charCodeAt(0)===C.Slash&&(e.path.charCodeAt(1)>=C.A&&e.path.charCodeAt(1)<=C.Z||e.path.charCodeAt(1)>=C.a&&e.path.charCodeAt(1)<=C.z)&&e.path.charCodeAt(2)===C.Colon?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,yn&&(n=n.replace(/\//g,`\\`)),n}function ui(e,t){let n=t?ci:si,r=``,{scheme:i,authority:a,path:o,query:s,fragment:c}=e;if(i&&(r+=i,r+=`:`),(a||i===`file`)&&(r+=`/`,r+=`/`),a){let e=a.indexOf(`@`);if(e!==-1){let t=a.substr(0,e);a=a.substr(e+1),e=t.lastIndexOf(`:`),e===-1?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=`:`,r+=n(t.substr(e+1),!1,!0)),r+=`@`}a=a.toLowerCase(),e=a.lastIndexOf(`:`),e===-1?r+=n(a,!1,!0):(r+=n(a.substr(0,e),!1,!0),r+=a.substr(e))}if(o){if(o.length>=3&&o.charCodeAt(0)===C.Slash&&o.charCodeAt(2)===C.Colon){let e=o.charCodeAt(1);e>=C.A&&e<=C.Z&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===C.Colon){let e=o.charCodeAt(0);e>=C.A&&e<=C.Z&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return s&&(r+=`?`,r+=n(s,!1,!1)),c&&(r+=`#`,r+=t?c:si(c,!1,!1)),r}function di(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+di(e.substr(3)):e}}const fi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function pi(e){return e.match(fi)?e.replace(fi,e=>di(e)):e}var mi=class e{static{this.count=0}constructor(t){this._proxyIdentifierBrand=void 0,this.sid=t,this.nid=++e.count}};const hi=[];function T(e){let t=new mi(e);return hi[t.nid]=t,t}function gi(e){return hi[e].sid}var _i=class{constructor(e){this.value=e}},vi;(function(e){e[e.Default=0]=`Default`,e[e.InCenter=1]=`InCenter`,e[e.InCenterIfOutsideViewport=2]=`InCenterIfOutsideViewport`,e[e.AtTop=3]=`AtTop`})(vi||={});var yi;(function(e){e[e.UnknownInput=0]=`UnknownInput`,e[e.TextInput=1]=`TextInput`,e[e.TextDiffInput=2]=`TextDiffInput`,e[e.TextMergeInput=3]=`TextMergeInput`,e[e.NotebookInput=4]=`NotebookInput`,e[e.NotebookDiffInput=5]=`NotebookDiffInput`,e[e.CustomEditorInput=6]=`CustomEditorInput`,e[e.WebviewEditorInput=7]=`WebviewEditorInput`,e[e.TerminalEditorInput=8]=`TerminalEditorInput`,e[e.InteractiveEditorInput=9]=`InteractiveEditorInput`,e[e.ChatEditorInput=10]=`ChatEditorInput`,e[e.MultiDiffEditorInput=11]=`MultiDiffEditorInput`})(yi||={});var bi;(function(e){e[e.TAB_OPEN=0]=`TAB_OPEN`,e[e.TAB_CLOSE=1]=`TAB_CLOSE`,e[e.TAB_UPDATE=2]=`TAB_UPDATE`,e[e.TAB_MOVE=3]=`TAB_MOVE`})(bi||={});var xi;(function(e){e[e.Editable=0]=`Editable`,e[e.SupportsHotExit=1]=`SupportsHotExit`})(xi||={});var Si;(function(e){e[e.Int8Array=1]=`Int8Array`,e[e.Uint8Array=2]=`Uint8Array`,e[e.Uint8ClampedArray=3]=`Uint8ClampedArray`,e[e.Int16Array=4]=`Int16Array`,e[e.Uint16Array=5]=`Uint16Array`,e[e.Int32Array=6]=`Int32Array`,e[e.Uint32Array=7]=`Uint32Array`,e[e.Float32Array=8]=`Float32Array`,e[e.Float64Array=9]=`Float64Array`,e[e.BigInt64Array=10]=`BigInt64Array`,e[e.BigUint64Array=11]=`BigUint64Array`})(Si||={});var Ci;(function(e){e[e.Text=1]=`Text`,e[e.Error=2]=`Error`,e[e.Rich=3]=`Rich`})(Ci||={});var wi;(function(e){e[e.Default=0]=`Default`,e[e.InCenter=1]=`InCenter`,e[e.InCenterIfOutsideViewport=2]=`InCenterIfOutsideViewport`,e[e.AtTop=3]=`AtTop`})(wi||={});var Ti;(function(e){e[e.None=0]=`None`,e[e.Process=1]=`Process`,e[e.Output=2]=`Output`,e[e.Hybrid=3]=`Hybrid`})(Ti||={});var Ei;(function(e){e.label=`a`,e.kind=`b`,e.detail=`c`,e.documentation=`d`,e.sortText=`e`,e.filterText=`f`,e.preselect=`g`,e.insertText=`h`,e.insertTextRules=`i`,e.range=`j`,e.commitCharacters=`k`,e.additionalTextEdits=`l`,e.kindModifier=`m`,e.commandIdent=`n`,e.commandId=`o`,e.commandArguments=`p`})(Ei||={});var Di;(function(e){e.defaultRanges=`a`,e.completions=`b`,e.isIncomplete=`c`,e.duration=`d`})(Di||={});var Oi;(function(e){e[e.Workspace=0]=`Workspace`,e[e.TextDocument=1]=`TextDocument`})(Oi||={});var ki;(function(e){e.Header=`header`,e.WellKnown=`wellKnown`,e.None=`none`})(ki||={});var Ai;(function(e){e.ResourceMetadata=`resourceMetadata`,e.WellKnown=`wellKnown`,e.Default=`default`})(Ai||={});var ji;(function(e){e[e.Info=0]=`Info`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(ji||={});var Mi;(function(e){e[e.Head=0]=`Head`,e[e.RemoteHead=1]=`RemoteHead`,e[e.Tag=2]=`Tag`})(Mi||={});const E={MainThreadAuthentication:T(`MainThreadAuthentication`),MainThreadBulkEdits:T(`MainThreadBulkEdits`),MainThreadLanguageModels:T(`MainThreadLanguageModels`),MainThreadEmbeddings:T(`MainThreadEmbeddings`),MainThreadChatAgents2:T(`MainThreadChatAgents2`),MainThreadCodeMapper:T(`MainThreadCodeMapper`),MainThreadLanguageModelTools:T(`MainThreadChatSkills`),MainThreadGitExtension:T(`MainThreadGitExtension`),MainThreadClipboard:T(`MainThreadClipboard`),MainThreadCommands:T(`MainThreadCommands`),MainThreadComments:T(`MainThreadComments`),MainThreadConfiguration:T(`MainThreadConfiguration`),MainThreadConsole:T(`MainThreadConsole`),MainThreadDebugService:T(`MainThreadDebugService`),MainThreadDecorations:T(`MainThreadDecorations`),MainThreadDiagnostics:T(`MainThreadDiagnostics`),MainThreadDialogs:T(`MainThreadDiaglogs`),MainThreadDocuments:T(`MainThreadDocuments`),MainThreadDocumentContentProviders:T(`MainThreadDocumentContentProviders`),MainThreadTextEditors:T(`MainThreadTextEditors`),MainThreadEditorInsets:T(`MainThreadEditorInsets`),MainThreadEditorTabs:T(`MainThreadEditorTabs`),MainThreadErrors:T(`MainThreadErrors`),MainThreadTreeViews:T(`MainThreadTreeViews`),MainThreadDownloadService:T(`MainThreadDownloadService`),MainThreadLanguageFeatures:T(`MainThreadLanguageFeatures`),MainThreadLanguages:T(`MainThreadLanguages`),MainThreadLogger:T(`MainThreadLogger`),MainThreadMessageService:T(`MainThreadMessageService`),MainThreadOutputService:T(`MainThreadOutputService`),MainThreadProgress:T(`MainThreadProgress`),MainThreadQuickDiff:T(`MainThreadQuickDiff`),MainThreadDocumentDiff:T(`MainThreadDocumentDiff`),MainThreadQuickOpen:T(`MainThreadQuickOpen`),MainThreadStatusBar:T(`MainThreadStatusBar`),MainThreadSecretState:T(`MainThreadSecretState`),MainThreadStorage:T(`MainThreadStorage`),MainThreadSpeech:T(`MainThreadSpeechProvider`),MainThreadTelemetry:T(`MainThreadTelemetry`),MainThreadMeteredConnection:T(`MainThreadMeteredConnection`),MainThreadTerminalService:T(`MainThreadTerminalService`),MainThreadTerminalShellIntegration:T(`MainThreadTerminalShellIntegration`),MainThreadWebviews:T(`MainThreadWebviews`),MainThreadWebviewPanels:T(`MainThreadWebviewPanels`),MainThreadWebviewViews:T(`MainThreadWebviewViews`),MainThreadCustomEditors:T(`MainThreadCustomEditors`),MainThreadUrls:T(`MainThreadUrls`),MainThreadUriOpeners:T(`MainThreadUriOpeners`),MainThreadProfileContentHandlers:T(`MainThreadProfileContentHandlers`),MainThreadWorkspace:T(`MainThreadWorkspace`),MainThreadFileSystem:T(`MainThreadFileSystem`),MainThreadFileSystemEventService:T(`MainThreadFileSystemEventService`),MainThreadExtensionService:T(`MainThreadExtensionService`),MainThreadSCM:T(`MainThreadSCM`),MainThreadSearch:T(`MainThreadSearch`),MainThreadShare:T(`MainThreadShare`),MainThreadTask:T(`MainThreadTask`),MainThreadWindow:T(`MainThreadWindow`),MainThreadPower:T(`MainThreadPower`),MainThreadLabelService:T(`MainThreadLabelService`),MainThreadNotebook:T(`MainThreadNotebook`),MainThreadNotebookDocuments:T(`MainThreadNotebookDocumentsShape`),MainThreadNotebookEditors:T(`MainThreadNotebookEditorsShape`),MainThreadNotebookKernels:T(`MainThreadNotebookKernels`),MainThreadNotebookRenderers:T(`MainThreadNotebookRenderers`),MainThreadInteractive:T(`MainThreadInteractive`),MainThreadTheming:T(`MainThreadTheming`),MainThreadTunnelService:T(`MainThreadTunnelService`),MainThreadManagedSockets:T(`MainThreadManagedSockets`),MainThreadTimeline:T(`MainThreadTimeline`),MainThreadTesting:T(`MainThreadTesting`),MainThreadLocalization:T(`MainThreadLocalizationShape`),MainThreadMcp:T(`MainThreadMcpShape`),MainThreadAiRelatedInformation:T(`MainThreadAiRelatedInformation`),MainThreadAiEmbeddingVector:T(`MainThreadAiEmbeddingVector`),MainThreadChatStatus:T(`MainThreadChatStatus`),MainThreadChatQuota:T(`MainThreadChatQuota`),MainThreadChatInputNotification:T(`MainThreadChatInputNotification`),MainThreadAiSettingsSearch:T(`MainThreadAiSettingsSearch`),MainThreadDataChannels:T(`MainThreadDataChannels`),MainThreadChatSessions:T(`MainThreadChatSessions`),MainThreadChatOutputRenderer:T(`MainThreadChatOutputRenderer`),MainThreadChatContext:T(`MainThreadChatContext`),MainThreadChatDebug:T(`MainThreadChatDebug`),MainThreadBrowsers:T(`MainThreadBrowsers`)},D={ExtHostCodeMapper:T(`ExtHostCodeMapper`),ExtHostCommands:T(`ExtHostCommands`),ExtHostConfiguration:T(`ExtHostConfiguration`),ExtHostDiagnostics:T(`ExtHostDiagnostics`),ExtHostDebugService:T(`ExtHostDebugService`),ExtHostDecorations:T(`ExtHostDecorations`),ExtHostDocumentsAndEditors:T(`ExtHostDocumentsAndEditors`),ExtHostDocuments:T(`ExtHostDocuments`),ExtHostDocumentContentProviders:T(`ExtHostDocumentContentProviders`),ExtHostDocumentSaveParticipant:T(`ExtHostDocumentSaveParticipant`),ExtHostEditors:T(`ExtHostEditors`),ExtHostTreeViews:T(`ExtHostTreeViews`),ExtHostFileSystem:T(`ExtHostFileSystem`),ExtHostFileSystemInfo:T(`ExtHostFileSystemInfo`),ExtHostFileSystemEventService:T(`ExtHostFileSystemEventService`),ExtHostLanguages:T(`ExtHostLanguages`),ExtHostLanguageFeatures:T(`ExtHostLanguageFeatures`),ExtHostQuickOpen:T(`ExtHostQuickOpen`),ExtHostQuickDiff:T(`ExtHostQuickDiff`),ExtHostStatusBar:T(`ExtHostStatusBar`),ExtHostShare:T(`ExtHostShare`),ExtHostExtensionService:T(`ExtHostExtensionService`),ExtHostLogLevelServiceShape:T(`ExtHostLogLevelServiceShape`),ExtHostTerminalService:T(`ExtHostTerminalService`),ExtHostTerminalShellIntegration:T(`ExtHostTerminalShellIntegration`),ExtHostSCM:T(`ExtHostSCM`),ExtHostSearch:T(`ExtHostSearch`),ExtHostTask:T(`ExtHostTask`),ExtHostWorkspace:T(`ExtHostWorkspace`),ExtHostWindow:T(`ExtHostWindow`),ExtHostPower:T(`ExtHostPower`),ExtHostWebviews:T(`ExtHostWebviews`),ExtHostWebviewPanels:T(`ExtHostWebviewPanels`),ExtHostCustomEditors:T(`ExtHostCustomEditors`),ExtHostWebviewViews:T(`ExtHostWebviewViews`),ExtHostEditorInsets:T(`ExtHostEditorInsets`),ExtHostEditorTabs:T(`ExtHostEditorTabs`),ExtHostProgress:T(`ExtHostProgress`),ExtHostComments:T(`ExtHostComments`),ExtHostSecretState:T(`ExtHostSecretState`),ExtHostStorage:T(`ExtHostStorage`),ExtHostUrls:T(`ExtHostUrls`),ExtHostUriOpeners:T(`ExtHostUriOpeners`),ExtHostChatOutputRenderer:T(`ExtHostChatOutputRenderer`),ExtHostProfileContentHandlers:T(`ExtHostProfileContentHandlers`),ExtHostOutputService:T(`ExtHostOutputService`),ExtHostLabelService:T(`ExtHostLabelService`),ExtHostNotebook:T(`ExtHostNotebook`),ExtHostNotebookDocuments:T(`ExtHostNotebookDocuments`),ExtHostNotebookEditors:T(`ExtHostNotebookEditors`),ExtHostNotebookKernels:T(`ExtHostNotebookKernels`),ExtHostNotebookRenderers:T(`ExtHostNotebookRenderers`),ExtHostNotebookDocumentSaveParticipant:T(`ExtHostNotebookDocumentSaveParticipant`),ExtHostInteractive:T(`ExtHostInteractive`),ExtHostChatAgents2:T(`ExtHostChatAgents`),ExtHostLanguageModelTools:T(`ExtHostChatSkills`),ExtHostChatProvider:T(`ExtHostChatProvider`),ExtHostChatContext:T(`ExtHostChatContext`),ExtHostChatDebug:T(`ExtHostChatDebug`),ExtHostSpeech:T(`ExtHostSpeech`),ExtHostEmbeddings:T(`ExtHostEmbeddings`),ExtHostAiRelatedInformation:T(`ExtHostAiRelatedInformation`),ExtHostAiEmbeddingVector:T(`ExtHostAiEmbeddingVector`),ExtHostAiSettingsSearch:T(`ExtHostAiSettingsSearch`),ExtHostTheming:T(`ExtHostTheming`),ExtHostTunnelService:T(`ExtHostTunnelService`),ExtHostManagedSockets:T(`ExtHostManagedSockets`),ExtHostAuthentication:T(`ExtHostAuthentication`),ExtHostTimeline:T(`ExtHostTimeline`),ExtHostTesting:T(`ExtHostTesting`),ExtHostTelemetry:T(`ExtHostTelemetry`),ExtHostMeteredConnection:T(`ExtHostMeteredConnection`),ExtHostLocalization:T(`ExtHostLocalization`),ExtHostMcp:T(`ExtHostMcp`),ExtHostDataChannels:T(`ExtHostDataChannels`),ExtHostChatSessions:T(`ExtHostChatSessions`),ExtHostChatQuota:T(`ExtHostChatQuota`),ExtHostGitExtension:T(`ExtHostGitExtension`),ExtHostBrowsers:T(`ExtHostBrowsers`)},Ni=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}});var Pi;(function(e){function t(t){return t===e.None||t===e.Cancelled||t instanceof Fi?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Qn.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ni})})(Pi||={});var Fi=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Ni:(this._emitter||=new S,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},Ii=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||=new Fi,this._token}cancel(){this._token?this._token instanceof Fi&&this._token.cancel():this._token=Pi.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Fi&&this._token.dispose():this._token=Pi.None}};function Li(e){return e}var Ri=class{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e==`function`?(this._fn=e,this._computeKey=Li):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){let t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}},zi;(function(e){e[e.MAX_SAFE_SMALL_INTEGER=1073741824]=`MAX_SAFE_SMALL_INTEGER`,e[e.MIN_SAFE_SMALL_INTEGER=-1073741824]=`MIN_SAFE_SMALL_INTEGER`,e[e.MAX_UINT_8=255]=`MAX_UINT_8`,e[e.MAX_UINT_16=65535]=`MAX_UINT_16`,e[e.MAX_UINT_32=4294967295]=`MAX_UINT_32`,e[e.UNICODE_SUPPLEMENTARY_PLANE_BEGIN=65536]=`UNICODE_SUPPLEMENTARY_PLANE_BEGIN`})(zi||={});function Bi(e){return e<0?0:e>zi.MAX_UINT_8?zi.MAX_UINT_8:e|0}function Vi(e){return e<0?0:e>zi.MAX_UINT_32?zi.MAX_UINT_32:e|0}function Hi(e){return!e||typeof e!=`string`?!0:e.trim().length===0}const Ui=/{(\d+)}/g;function Wi(e,...t){return t.length===0?e:e.replace(Ui,function(e,n){let r=parseInt(n,10);return isNaN(r)||r<0||r>=t.length?e:t[r]})}const Gi=/{([^}]+)}/g;function Ki(e,t){return Object.keys(t).length===0?e:e.replace(Gi,(e,n)=>t[n]??e)}function qi(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,`\\$&`)}function Ji(e,t){let n=0,r=e.indexOf(t);for(;r!==-1;)n++,r=e.indexOf(t,r+t.length);return n}function Yi(e,t){if(!e||!t)return e;let n=t.length,r=0;if(n===1){let n=t.charCodeAt(0);for(;r<e.length&&e.charCodeAt(r)===n;)r++}else for(;e.startsWith(t,r);)r+=n;return e.substring(r)}function Xi(e,t){if(!e||!t)return e;let n=t.length,r=e.length;if(n===1){let n=r,i=t.charCodeAt(0);for(;n>0&&e.charCodeAt(n-1)===i;)n--;return e.substring(0,n)}let i=r;for(;i>0&&e.endsWith(t,i);)i-=n;return e.substring(0,i)}function Zi(e,t,n={}){if(!e)throw Error(`Cannot create regex from empty string`);t||(e=qi(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e=`\\b`+e),/\B/.test(e.charAt(e.length-1))||(e+=`\\b`));let r=``;return n.global&&(r+=`g`),n.matchCase||(r+=`i`),n.multiline&&(r+=`m`),n.unicode&&(r+=`u`),new RegExp(e,r)}function Qi(e){return e.source===`^`||e.source===`^$`||e.source===`$`||e.source===`^\\s*$`?!1:!!(e.exec(``)&&e.lastIndex===0)}function $i(e){return e.split(/\r\n|\r|\n/)}function ea(e){for(let t=0,n=e.length;t<n;t++){let n=e.charCodeAt(t);if(n!==C.Space&&n!==C.Tab)return t}return-1}function ta(e,t=e.length-1){for(let n=t;n>=0;n--){let t=e.charCodeAt(n);if(t!==C.Space&&t!==C.Tab)return n}return-1}function na(e,t){return e<t?-1:+(e>t)}function ra(e,t,n=0,r=e.length,i=0,a=t.length){for(;n<r&&i<a;n++,i++){let r=e.charCodeAt(n),a=t.charCodeAt(i);if(r<a)return-1;if(r>a)return 1}let o=r-n,s=a-i;return o<s?-1:+(o>s)}function ia(e,t){return aa(e,t,0,e.length,0,t.length)}function aa(e,t,n=0,r=e.length,i=0,a=t.length){for(;n<r&&i<a;n++,i++){let o=e.charCodeAt(n),s=t.charCodeAt(i);if(o===s)continue;if(o>=128||s>=128)return ra(e.toLowerCase(),t.toLowerCase(),n,r,i,a);oa(o)&&(o-=32),oa(s)&&(s-=32);let c=o-s;if(c!==0)return c}let o=r-n,s=a-i;return o<s?-1:+(o>s)}function oa(e){return e>=C.a&&e<=C.z}function sa(e,t){return e.length===t.length&&aa(e,t)===0}function ca(e,t,n){return e===t||!!n&&e!==void 0&&t!==void 0&&sa(e,t)}function la(e,t){let n=t.length;return n<=e.length&&aa(e,t,0,n)===0}function ua(e,t){let n=e.length,r=n-t.length;return r>=0&&aa(e,t,r,n)===0}function da(e,t){let n=Math.min(e.length,t.length),r;for(r=0;r<n;r++)if(e.charCodeAt(r)!==t.charCodeAt(r))return r;return n}function fa(e){return 55296<=e&&e<=56319}function pa(e){return 56320<=e&&e<=57343}function ma(e,t){return(e-55296<<10)+(t-56320)+65536}function ha(e,t,n){let r=e.charCodeAt(n);if(fa(r)&&n+1<t){let t=e.charCodeAt(n+1);if(pa(t))return ma(r,t)}return r}function ga(e,t){let n=e.charCodeAt(t-1);if(pa(n)&&t>1){let r=e.charCodeAt(t-2);if(fa(r))return ma(r,n)}return n}var _a=class{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){let e=ga(this._str,this._offset);return this._offset-=e>=zi.UNICODE_SUPPLEMENTARY_PLANE_BEGIN?2:1,e}nextCodePoint(){let e=ha(this._str,this._len,this._offset);return this._offset+=e>=zi.UNICODE_SUPPLEMENTARY_PLANE_BEGIN?2:1,e}eol(){return this._offset>=this._len}},va=class{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new _a(e,t)}nextGraphemeLength(){let e=Na.getInstance(),t=this._iterator,n=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){let n=t.offset,i=e.getGraphemeBreakType(t.nextCodePoint());if(ja(r,i)){t.setOffset(n);break}r=i}return t.offset-n}prevGraphemeLength(){let e=Na.getInstance(),t=this._iterator,n=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){let n=t.offset,i=e.getGraphemeBreakType(t.prevCodePoint());if(ja(i,r)){t.setOffset(n);break}r=i}return n-t.offset}eol(){return this._iterator.eol()}};function ya(e,t){return new va(e,t).nextGraphemeLength()}let ba;function xa(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function Sa(e){return ba||=xa(),ba.test(e)}const Ca=/^[\t\n\r\x20-\x7E]*$/;function wa(e){return Ca.test(e)}const Ta=/[\u2028\u2029]/;function Ea(e){return Ta.test(e)}RegExp(`(?:`+[`(?:\\x1b\\[|\\x9b)[=?>!]?[\\d;:]*["$#'* ]?[a-zA-Z@^\`{}|~]`,`(?:\\x1b\\]|\\x9d).*?(?:\\x1b\\\\|\\x07|\\x9c)`,`\\x1b(?:[ #%\\(\\)\\*\\+\\-\\.\\/]?[a-zA-Z0-9\\|}~@])`].join(`|`)+`)`,`g`);const Da=String.fromCharCode(C.UTF8_BOM);function Oa(e){return!!(e&&e.length>0&&e.charCodeAt(0)===C.UTF8_BOM)}function ka(e,t=!1){return e?(t&&(e=e.replace(/\\./g,``)),e.toLowerCase()!==e):!1}function Aa(e,t=1){if(t===0)return``;let n=-1;do n=e.indexOf(`
14
- `,n+1),t--;while(t>0&&n>=0);return n===-1?e:(e[n-1]===`\r`&&n--,e.substr(0,n))}function ja(e,t){return e===Ma.Other?t!==Ma.Extend&&t!==Ma.SpacingMark:e===Ma.CR&&t===Ma.LF?!1:e===Ma.Control||e===Ma.CR||e===Ma.LF||t===Ma.Control||t===Ma.CR||t===Ma.LF?!0:!(e===Ma.L&&(t===Ma.L||t===Ma.V||t===Ma.LV||t===Ma.LVT)||(e===Ma.LV||e===Ma.V)&&(t===Ma.V||t===Ma.T)||(e===Ma.LVT||e===Ma.T)&&t===Ma.T||t===Ma.Extend||t===Ma.ZWJ||t===Ma.SpacingMark||e===Ma.Prepend||e===Ma.ZWJ&&t===Ma.Extended_Pictographic||e===Ma.Regional_Indicator&&t===Ma.Regional_Indicator)}var Ma;(function(e){e[e.Other=0]=`Other`,e[e.Prepend=1]=`Prepend`,e[e.CR=2]=`CR`,e[e.LF=3]=`LF`,e[e.Control=4]=`Control`,e[e.Extend=5]=`Extend`,e[e.Regional_Indicator=6]=`Regional_Indicator`,e[e.SpacingMark=7]=`SpacingMark`,e[e.L=8]=`L`,e[e.V=9]=`V`,e[e.T=10]=`T`,e[e.LV=11]=`LV`,e[e.LVT=12]=`LVT`,e[e.ZWJ=13]=`ZWJ`,e[e.Extended_Pictographic=14]=`Extended_Pictographic`})(Ma||={});var Na=class e{static{this._INSTANCE=null}static getInstance(){return e._INSTANCE||=new e,e._INSTANCE}constructor(){this._data=Pa()}getGraphemeBreakType(e){if(e<32)return e===C.LineFeed?Ma.LF:e===C.CarriageReturn?Ma.CR:Ma.Control;if(e<127)return Ma.Other;let t=this._data,n=t.length/3,r=1;for(;r<=n;)if(e<t[3*r])r=2*r;else if(e>t[3*r+1])r=2*r+1;else return t[3*r+2];return Ma.Other}};function Pa(){return JSON.parse(`[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]`)}var Fa;(function(e){e[e.zwj=8205]=`zwj`,e[e.emojiVariantSelector=65039]=`emojiVariantSelector`,e[e.enclosingKeyCap=8419]=`enclosingKeyCap`,e[e.space=32]=`space`})(Fa||={}),class e{static{this.ambiguousCharacterData=new n(()=>JSON.parse(`{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}`))}static{this.cache=new Ri(t=>{let n=t.split(`,`);function r(e){let t=new Map;for(let n=0;n<e.length;n+=2)t.set(e[n],e[n+1]);return t}function i(e,t){let n=new Map(e);for(let[e,r]of t)n.set(e,r);return n}function a(e,t){if(!e)return t;let n=new Map;for(let[r,i]of e)t.has(r)&&n.set(r,i);return n}let o=this.ambiguousCharacterData.value,s=n.filter(e=>!e.startsWith(`_`)&&Object.hasOwn(o,e));s.length===0&&(s=[`_default`]);let c;for(let e of s){let t=r(o[e]);c=a(c,t)}return new e(i(r(o._common),c))})}static getInstance(t){return e.cache.get(Array.from(t).join(`,`))}static{this._locales=new n(()=>Object.keys(e.ambiguousCharacterData.value).filter(e=>!e.startsWith(`_`)))}static getLocales(){return e._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(typeof n==`number`&&this.isAmbiguous(n))return!0}return!1}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}},class e{static getRawData(){return JSON.parse(`{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}`)}static{this._data=void 0}static getData(){return this._data||=new Set([...Object.values(e.getRawData())].flat()),this._data}static isInvisibleCharacter(t){return e.getData().has(t)}static containsInvisibleCharacter(t){for(let n=0;n<t.length;n++){let r=t.codePointAt(n);if(typeof r==`number`&&(e.isInvisibleCharacter(r)||r===Fa.space))return!0}return!1}static get codePoints(){return e.getData()}};function Ia(e){return e===C.Slash||e===C.Backslash}function La(e){return e.replace(/[\\/]/g,zr.sep)}function Ra(e){return e.indexOf(`/`)===-1&&(e=La(e)),/^[a-zA-Z]:(\/|$)/.test(e)&&(e=`/`+e),e}function za(e,t=zr.sep){if(!e)return``;let n=e.length,r=e.charCodeAt(0);if(Ia(r)){if(Ia(e.charCodeAt(1))&&!Ia(e.charCodeAt(2))){let r=3,i=r;for(;r<n&&!Ia(e.charCodeAt(r));r++);if(i!==r&&!Ia(e.charCodeAt(r+1))){for(r+=1;r<n;r++)if(Ia(e.charCodeAt(r)))return e.slice(0,r+1).replace(/[\\/]/g,t)}}return t}else if(Va(r)&&e.charCodeAt(1)===C.Colon)return Ia(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);let i=e.indexOf(`://`);if(i!==-1){for(i+=3;i<n;i++)if(Ia(e.charCodeAt(i)))return e.slice(0,i+1)}return``}function Ba(e,t,n,r=!1){let i=r?zr.sep:Jr;if(e===t)return!0;if(!e||!t||((e.indexOf(`..`)>=0||t.indexOf(`..`)>=0)&&(e=r?zr.normalize(e):Br(e),t=r?zr.normalize(t):Br(t)),t.length>e.length))return!1;if(n){if(!la(e,t))return!1;if(t.length===e.length)return!0;let n=t.length;return t.charAt(t.length-1)===i&&n--,e.charAt(n)===i}return t.charAt(t.length-1)!==i&&(t+=i),e.indexOf(t)===0}function Va(e){return e>=C.A&&e<=C.Z||e>=C.a&&e<=C.z}function Ha(e,t=yn){return t?Va(e.charCodeAt(0))&&e.charCodeAt(1)===C.Colon:!1}var O;(function(e){e.inMemory=`inmemory`,e.vscode=`vscode`,e.internal=`private`,e.walkThrough=`walkThrough`,e.walkThroughSnippet=`walkThroughSnippet`,e.http=`http`,e.https=`https`,e.file=`file`,e.mailto=`mailto`,e.untitled=`untitled`,e.data=`data`,e.command=`command`,e.vscodeRemote=`vscode-remote`,e.vscodeRemoteResource=`vscode-remote-resource`,e.vscodeManagedRemoteResource=`vscode-managed-remote-resource`,e.vscodeUserData=`vscode-userdata`,e.vscodeCustomEditor=`vscode-custom-editor`,e.vscodeNotebookCell=`vscode-notebook-cell`,e.vscodeNotebookCellMetadata=`vscode-notebook-cell-metadata`,e.vscodeNotebookCellMetadataDiff=`vscode-notebook-cell-metadata-diff`,e.vscodeNotebookCellOutput=`vscode-notebook-cell-output`,e.vscodeNotebookCellOutputDiff=`vscode-notebook-cell-output-diff`,e.vscodeNotebookMetadata=`vscode-notebook-metadata`,e.vscodeInteractiveInput=`vscode-interactive-input`,e.vscodeSettings=`vscode-settings`,e.vscodeWorkspaceTrust=`vscode-workspace-trust`,e.vscodeTerminal=`vscode-terminal`,e.vscodeImageCarousel=`vscode-image-carousel`,e.vscodeChatCodeBlock=`vscode-chat-code-block`,e.vscodeChatCodeCompareBlock=`vscode-chat-code-compare-block`,e.vscodeChatEditor=`vscode-chat-editor`,e.vscodeChatInput=`chatSessionInput`,e.vscodeLocalChatSession=`vscode-chat-session`,e.webviewPanel=`webview-panel`,e.vscodeWebview=`vscode-webview`,e.vscodeBrowser=`vscode-browser`,e.extension=`extension`,e.vscodeFileResource=`vscode-file`,e.tmp=`tmp`,e.vsls=`vsls`,e.vscodeSourceControl=`vscode-scm`,e.commentsInput=`comment`,e.codeSetting=`code-setting`,e.outputChannel=`output`,e.accessibleView=`accessible-view`,e.chatEditingSnapshotScheme=`chat-editing-snapshot-text-model`,e.chatEditingModel=`chat-editing-text-model`,e.copilotPr=`copilot-pr`})(O||={});function Ua(e,t){return w.isUri(e)?sa(e.scheme,t):la(e,t+`:`)}function Wa(e,...t){return t.some(t=>Ua(e,t))}const Ga=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema=`http`,this._delegate=null,this._serverRootPath=`/`}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,t){this._serverRootPath=zr.join(t??`/`,Ka(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return zr.join(this._serverRootPath,O.vscodeRemoteResource)}set(e,t,n){this._hosts[e]=t,this._ports[e]=n}setConnectionToken(e,t){this._connectionTokens[e]=t}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(t){return s(t),e}let t=e.authority,n=this._hosts[t];n&&n.indexOf(`:`)!==-1&&n.indexOf(`[`)===-1&&(n=`[${n}]`);let r=this._ports[t],i=this._connectionTokens[t],a=`path=${encodeURIComponent(e.path)}`;return typeof i==`string`&&(a+=`&tkn=${encodeURIComponent(i)}`),w.from({scheme:Cn?this._preferredWebSchema:O.vscodeRemoteResource,authority:`${n}:${r}`,path:this._remoteResourcesPath,query:a})}};function Ka(e){return`${e.quality??`oss`}-${e.commit??`dev`}`}new class e{constructor(){this.staticBrowserUris=new Ne,this.appResourcePathUrls=new Map,this.appResourceUrlMapper=[]}static{this.FALLBACK_AUTHORITY=`vscode-app`}registerAppResourcePathUrl(e,t){this.appResourcePathUrls.set(e,t)}registerAppResourceLoader(e){this.appResourceUrlMapper.push(e)}toUrl(e){let t=this.appResourcePathUrls.get(e);typeof t==`function`&&(t=t());for(let t of this.appResourceUrlMapper){let n=t(e);if(n)return n}return new URL(t??e,globalThis.location?.href??import.meta.url).toString()}asBrowserUri(e){let t=this.toUri(e);return this.uriToBrowserUri(t)}uriToBrowserUri(t){return t.scheme===O.vscodeRemote?Ga.rewrite(t):t.scheme===O.file&&(Sn||Tn===`${O.vscodeFileResource}://${e.FALLBACK_AUTHORITY}`)?t.with({scheme:O.vscodeFileResource,authority:t.authority||e.FALLBACK_AUTHORITY,query:null,fragment:null}):this.staticBrowserUris.get(t)??t}asFileUri(e){let t=this.toUri(e);return this.uriToFileUri(t)}uriToFileUri(t){return t.scheme===O.vscodeFileResource?t.with({scheme:O.file,authority:t.authority===e.FALLBACK_AUTHORITY?null:t.authority,query:null,fragment:null}):t}toUri(e){if(w.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let t=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(t))return w.joinPath(w.parse(t,!0),e);let n=Hr(t,e);return w.file(n)}return w.parse(this.toUrl(e))}registerStaticBrowserUri(e,t){return this.staticBrowserUris.set(e,t),_(()=>{this.staticBrowserUris.get(e)===t&&this.staticBrowserUris.delete(e)})}getRegisteredBrowserUris(){return this.staticBrowserUris.keys()}};var qa;(function(e){let t=new Map([[`1`,{"Cross-Origin-Opener-Policy":`same-origin`}],[`2`,{"Cross-Origin-Embedder-Policy":`require-corp`}],[`3`,{"Cross-Origin-Opener-Policy":`same-origin`,"Cross-Origin-Embedder-Policy":`require-corp`}]]);e.CoopAndCoep=Object.freeze(t.get(`3`));let n=`vscode-coi`;function r(e){let r;typeof e==`string`?r=new URL(e).searchParams:e instanceof URL?r=e.searchParams:w.isUri(e)&&(r=new URL(e.toString(!0)).searchParams);let i=r?.get(n);if(i)return t.get(i)}e.getHeadersFromQuery=r;function i(e,t,r){if(!globalThis.crossOriginIsolated)return;let i=t&&r?`3`:r?`2`:`1`;e instanceof URLSearchParams?e.set(n,i):e[n]=i}e.addSearchParam=i})(qa||={});function Ja(e){return li(e,!0)}var Ya=class{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:na(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}ignorePathCasing(e){return this._ignorePathCasing(e)}isEqualOrParent(e,t,n=!1){if(e.scheme===t.scheme){if(e.scheme===O.file)return Ba(Ja(e),Ja(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(so(e.authority,t.authority))return Ba(e.path,t.path,this._ignorePathCasing(e),!0)&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return w.joinPath(e,...t)}basenameOrAuthority(e){return to(e)||e.authority}basename(e,t){return zr.basename(e.path,t)}extname(e){return zr.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===O.file?t=w.file(Gr(Ja(e))).path:(t=zr.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==C.Slash&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t=`/`)),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===O.file?w.file(Br(Ja(e))).path:zr.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!so(e.authority,t.authority))return;if(e.scheme===O.file){let n=Wr(Ja(e),Ja(t));return yn?La(n):n}let n=e.path||`/`,r=t.path||`/`;if(this._ignorePathCasing(e)){let e=0;for(let t=Math.min(n.length,r.length);e<t&&!(n.charCodeAt(e)!==r.charCodeAt(e)&&n.charAt(e).toLowerCase()!==r.charAt(e).toLowerCase());e++);n=r.substr(0,e)+n.substr(e)}return zr.relative(n,r)}resolvePath(e,t){if(e.scheme===O.file){let n=w.file(Ur(Ja(e),t));return e.with({authority:n.authority,path:n.path})}return t=Ra(t),e.with({path:zr.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&e.path[0]===`/`}isEqualAuthority(e,t){return e===t||e!==void 0&&t!==void 0&&sa(e,t)}hasTrailingPathSeparator(e,t=Jr){if(e.scheme===O.file){let n=Ja(e);return n.length>za(n).length&&n[n.length-1]===t}else{let t=e.path;return t.length>1&&t.charCodeAt(t.length-1)===C.Slash&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Jr){return co(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Jr){let n=!1;if(e.scheme===O.file){let r=Ja(e);n=r!==void 0&&r.length===za(r).length&&r[r.length-1]===t}else{t=`/`;let r=e.path;n=r.length===1&&r.charCodeAt(r.length-1)===C.Slash}return!n&&!co(e,t)?e.with({path:e.path+`/`}):e}};const Xa=new Ya(()=>!1),Za=new Ya(e=>e.scheme===O.file?!xn:!0),Qa=new Ya(e=>!0),$a=Xa.isEqual.bind(Xa);Xa.isEqualOrParent.bind(Xa),Xa.getComparisonKey.bind(Xa);const eo=Xa.basenameOrAuthority.bind(Xa),to=Xa.basename.bind(Xa),no=Xa.extname.bind(Xa),ro=Xa.dirname.bind(Xa),io=Xa.joinPath.bind(Xa);Xa.normalizePath.bind(Xa);const ao=Xa.relativePath.bind(Xa);Xa.resolvePath.bind(Xa);const oo=Xa.isAbsolutePath.bind(Xa),so=Xa.isEqualAuthority.bind(Xa),co=Xa.hasTrailingPathSeparator.bind(Xa);Xa.removeTrailingPathSeparator.bind(Xa),Xa.addTrailingPathSeparator.bind(Xa);var lo;(function(e){e.META_DATA_LABEL=`label`,e.META_DATA_DESCRIPTION=`description`,e.META_DATA_SIZE=`size`,e.META_DATA_MIME=`mime`;function t(t){let n=new Map;t.path.substring(t.path.indexOf(`;`)+1,t.path.lastIndexOf(`;`)).split(`;`).forEach(e=>{let[t,r]=e.split(`:`);t&&r&&n.set(t,r)});let r=t.path.substring(0,t.path.indexOf(`;`));return r&&n.set(e.META_DATA_MIME,r),n}e.parseMetaData=t})(lo||={});const uo=Symbol(`MicrotaskDelay`);function fo(e){return!!e&&typeof e.then==`function`}function po(e){let t=new Ii,n=e(t.token),r=!1,i=new Promise((e,i)=>{let a=t.token.onCancellationRequested(()=>{r=!0,a.dispose(),i(new f)});Promise.resolve(n).then(n=>{a.dispose(),t.dispose(),r?mt(n)&&n.dispose():e(n)},e=>{a.dispose(),t.dispose(),i(e)})});return new class{cancel(){t.cancel(),t.dispose()}then(e,t){return i.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return i.finally(e)}}}function mo(e,t,n){return new Promise((r,i)=>{let a=t.onCancellationRequested(()=>{a.dispose(),r(n)});e.then(r,i).finally(()=>a.dispose())})}function ho(e,t){return new Promise((n,r)=>{let i=t.onCancellationRequested(()=>{i.dispose(),r(new f)});e.then(n,r).finally(()=>i.dispose())})}function go(e){return new Promise((t,n)=>{let r=e();fo(r)?r.then(t,n):t(r)})}function _o(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var vo=class{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new Ii}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(Error(`Throttler is disposed`));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let e=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise(t=>{this.activePromise.then(e,e).then(t)})}return new Promise((e,t)=>{this.queuedPromise.then(e,t)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((e,t)=>{this.activePromise.then(t=>{this.activePromise=null,e(t)},e=>{this.activePromise=null,t(e)})})}dispose(){this.cancellationTokenSource.cancel()}},yo=class{constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}},bo=class{constructor(){this.promiseMap=new Map}queue(e,t){let n=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(t).finally(()=>{this.promiseMap.get(e)===n&&this.promiseMap.delete(e)});return this.promiseMap.set(e,n),n}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};const xo=(e,t)=>{let n=!0,r=setTimeout(()=>{n=!1,t()},e);return{isTriggered:()=>n,dispose:()=>{clearTimeout(r),n=!1}}},So=e=>{let t=!0;return queueMicrotask(()=>{t&&(t=!1,e())}),{isTriggered:()=>t,dispose:()=>{t=!1}}};var Co=class{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||=new Promise((e,t)=>{this.doResolve=e,this.doReject=t}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let e=this.task;return this.task=null,e()}});let n=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===uo?So(n):xo(t,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&=(this.doReject?.(new f),null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}},wo=class{constructor(e){this.delayer=new Co(e),this.throttler=new vo}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}},To=class{constructor(){this._isOpen=!1,this._promise=new Promise((e,t)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};function Eo(e,t){return t?new Promise((n,r)=>{let i=setTimeout(()=>{a.dispose(),n()},e),a=t.onCancellationRequested(()=>{clearTimeout(i),a.dispose(),r(new f)})}):po(t=>Eo(e,t))}function Do(e,t=0,n){let r=setTimeout(()=>{e(),n&&i.dispose()},t),i=_(()=>{clearTimeout(r),n?.delete(i)});return n?.add(i),i}var Oo=class{constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new S}whenIdle(){return this.size>0?Qn.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw Error(`Object has been disposed`);return this._size++,new Promise((t,n)=>{this.outstandingPromises.push({factory:e,c:t,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){let e=this.outstandingPromises.shift();this.runningPromises++;let t=e.factory();t.then(e.c,e.e),t.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw Error(`Object has been disposed`);this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}},ko=class extends Oo{constructor(){super(1)}},Ao=class{constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new Ro;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,t=Xa){let n=t.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,t,n=Xa){let r=n.getComparisonKey(e),i=this.queues.get(r);if(!i){i=new ko;let e=this.drainListenerCount++,t=Qn.once(i.onDrained)(()=>{i?.dispose(),this.queues.delete(r),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(e),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||=new yt,this.drainListeners.set(e,t),this.queues.set(r,i)}return i.queue(t)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}},jo=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new ae(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=_(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Mo=class{constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};let No,Po;(function(){let e=globalThis;Po=typeof e.requestIdleCallback!=`function`||typeof e.cancelIdleCallback!=`function`?(e,t,n)=>{Nn(()=>{if(r)return;let e=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,e-Date.now())}}))});let r=!1;return{dispose(){r||=!0}}}:(e,t,n)=>{let r=e.requestIdleCallback(t,typeof n==`number`?{timeout:n}:void 0),i=!1;return{dispose(){i||(i=!0,e.cancelIdleCallback(r))}}},No=(e,t)=>Po(globalThis,e,t)})();var Fo=class{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=Po(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}},Io=class extends Fo{constructor(e){super(globalThis,e)}},Lo;(function(e){e[e.Resolved=0]=`Resolved`,e[e.Rejected=1]=`Rejected`})(Lo||={});var Ro=class e{static fromPromise(t){let n=new e;return n.settleWith(t),n}get isRejected(){return this.outcome?.outcome===Lo.Rejected}get isResolved(){return this.outcome?.outcome===Lo.Resolved}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===Lo.Resolved?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.completeCallback(e),this.outcome={outcome:Lo.Resolved,value:e},t()})}error(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.errorCallback(e),this.outcome={outcome:Lo.Rejected,value:e},t()})}settleWith(e){return e.then(e=>this.complete(e),e=>this.error(e))}cancel(){return this.error(new f)}},zo;(function(e){async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(t!==void 0)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(zo||={});var Bo;(function(e){e[e.Initial=0]=`Initial`,e[e.DoneOK=1]=`DoneOK`,e[e.DoneError=2]=`DoneError`})(Bo||={});var Vo=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromisesResolveOrder(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}static{this.EMPTY=e.fromArray([])}constructor(e,t){this._state=Bo.Initial,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new S,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===Bo.DoneError)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===Bo.DoneOK)return{done:!0,value:void 0};await Qn.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===Bo.Initial&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===Bo.Initial&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===Bo.Initial&&(this._state=Bo.DoneOK,this._onStateChanged.fire())}reject(e){this._state===Bo.Initial&&(this._state=Bo.DoneError,this._error=e,this._onStateChanged.fire())}},Ho=class{constructor(e){this._deferred=new Ro,this._asyncIterable=new Vo(e=>{if(t){e.reject(t);return}return n&&e.emitMany(n),this._errorFn=t=>e.reject(t),this._emitOneFn=t=>e.emitOne(t),this._emitManyFn=t=>e.emitMany(t),this._deferred.p},e);let t,n;this._errorFn=e=>{t||=e},this._emitOneFn=e=>{n||=[],n.push(e)},this._emitManyFn=e=>{n?e.forEach(e=>n.push(e)):n=e.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}},Uo=class{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let t of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new ae(`ProducerConsumer: cannot produce after final value has been set`)}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new Ro;return this._unsatisfiedConsumers.push(e),e.p}}},Wo=class e{constructor(e,t){this._onReturn=t,this._producerConsumer=new Uo,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async e=>(this._finishError(e),{done:!0,value:void 0})},queueMicrotask(async()=>{let t=e({emitOne:e=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:e}}),emitMany:e=>{for(let t of e)this._producerConsumer.produce({ok:!0,value:{done:!1,value:t}})},reject:e=>this._finishError(e)});if(!this._producerConsumer.hasFinalValue)try{await t,this._finishOk()}catch(e){this._finishError(e)}})}static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromisesResolveOrder(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}static{this.EMPTY=e.fromArray([])}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}static tee(t){let n,r,i=new Ro,a=async()=>{if(!(!n||!r))try{for await(let e of t)n.emitOne(e),r.emitOne(e)}catch(e){n.reject(e),r.reject(e)}finally{i.complete()}};return[new e(async e=>(n=e,a(),i.p)),new e(async e=>(r=e,a(),i.p))]}map(t){return e.map(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};new class{transformIncoming(e){return e}transformOutgoing(e){return e}transformOutgoingURI(e){return e}transformOutgoingScheme(e){return e}};function Go(e,t,n,r){if(!e||r>200)return null;if(typeof e==`object`){if(e.$mid===Er.Uri)return n?w.revive(t.transformIncoming(e)):t.transformIncoming(e);if(e instanceof b)return null;for(let i in e)if(Object.hasOwnProperty.call(e,i)){let a=Go(e[i],t,n,r+1);a!==null&&(e[i]=a)}}return null}function Ko(e,t){let n=Go(e,t,!1,0);return n===null?e:n}var qo=class{constructor(){this._actual=null,this._actualOk=null,this._actualErr=null,this._hasValue=!1,this._value=null,this._hasErr=!1,this._err=null}get[Symbol.toStringTag](){return this.toString()}_ensureActual(){return this._actual||=new Promise((e,t)=>{this._actualOk=e,this._actualErr=t,this._hasValue&&this._actualOk(this._value),this._hasErr&&this._actualErr(this._err)}),this._actual}resolveOk(e){this._hasValue||this._hasErr||(this._hasValue=!0,this._value=e,this._actual&&this._actualOk(e))}resolveErr(e){this._hasValue||this._hasErr||(this._hasErr=!0,this._err=e,this._actual?this._actualErr(e):o(e))}then(e,t){return this._ensureActual().then(e,t)}catch(e){return this._ensureActual().then(void 0,e)}finally(e){return this._ensureActual().finally(e)}},Jo=class extends qo{constructor(){super(),this._hasErr=!0,this._err=new f}},Yo;function Xo(e,t){try{return JSON.stringify(e,t)}catch{return`null`}}const Zo=`$$ref$$`,Qo={[Zo]:-1};function $o(e,t=null,n=!1){let r=[];return{jsonString:(n?Xo:JSON.stringify)(e,(e,n)=>{if(n===void 0)return Qo;if(typeof n==`object`){if(n instanceof b){let e=r.push(n)-1;return{[Zo]:e}}if(t)return t(e,n)}return n}),referencedBuffers:r}}function es(e,t,n){return JSON.parse(e,(e,r)=>{if(r){let e=r[Zo];if(typeof e==`number`)return t[e];if(n&&r.$mid===Er.Uri)return n.transformIncoming(r)}return r})}function ts(e,t){return JSON.stringify(e,t)}function ns(e){return e?(t,n)=>n&&n.$mid===Er.Uri?e.transformOutgoing(n):n:null}var rs;(function(e){e[e.LocalSide=0]=`LocalSide`,e[e.OtherSide=1]=`OtherSide`})(rs||={});var is;(function(e){e[e.Responsive=0]=`Responsive`,e[e.Unresponsive=1]=`Unresponsive`})(is||={});const as=()=>{},os=Symbol.for(`rpcProtocol`),ss=Symbol.for(`rpcProxy`);var cs=class e extends y{static{Yo=os}static{this.UNRESPONSIVE_TIME=3*1e3}constructor(e,t=null,n=null){super(),this[Yo]=!0,this._onDidChangeResponsiveState=this._register(new S),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._protocol=e,this._logger=t,this._uriTransformer=n,this._uriReplacer=ns(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let e=0,t=mi.count;e<t;e++)this._locals[e]=null,this._proxies[e]=null;this._lastMessageId=0,this._cancelInvokedHandlers=Object.create(null),this._pendingRPCReplies={},this._responsiveState=is.Responsive,this._unacknowledgedCount=0,this._unresponsiveTime=0,this._asyncCheckUresponsive=this._register(new Mo(()=>this._checkUnresponsive(),1e3)),this._register(this._protocol.onMessage(e=>this._receiveOneMessage(e)))}dispose(){this._isDisposed=!0,Object.keys(this._pendingRPCReplies).forEach(e=>{let t=this._pendingRPCReplies[e];delete this._pendingRPCReplies[e],t.resolveErr(m())}),super.dispose()}drain(){return typeof this._protocol.drain==`function`?this._protocol.drain():Promise.resolve()}_onWillSendRequest(t){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+e.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(t){this._unresponsiveTime=Date.now()+e.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(is.Responsive)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(is.Unresponsive):this._asyncCheckUresponsive.schedule())}_setResponsiveState(e){this._responsiveState!==e&&(this._responsiveState=e,this._onDidChangeResponsiveState.fire(this._responsiveState))}get responsiveState(){return this._responsiveState}transformIncomingURIs(e){return this._uriTransformer?Ko(e,this._uriTransformer):e}getProxy(e){let{nid:t,sid:n}=e;return this._proxies[t]||(this._proxies[t]=this._createProxy(t,n)),this._proxies[t]}_createProxy(e,t){return new Proxy(Object.create(null),{get:(n,r)=>(typeof r==`string`&&!n[r]&&r.charCodeAt(0)===C.DollarSign&&(n[r]=(...t)=>this._remoteCall(e,r,t)),r===ss?t:n[r])})}set(e,t){return this._locals[e.nid]=t,t}assertRegistered(e){for(let t=0,n=e.length;t<n;t++){let n=e[t];if(!this._locals[n.nid])throw Error(`Missing proxy instance ${n.sid}`)}}_receiveOneMessage(e){if(this._isDisposed)return;let t=e.byteLength,n=us.read(e,0),r=n.readUInt8(),i=n.readUInt32();switch(r){case ps.RequestJSONArgs:case ps.RequestJSONArgsWithCancellation:{let{rpcId:e,method:a,args:o}=fs.deserializeRequestJSONArgs(n);this._uriTransformer&&(o=Ko(o,this._uriTransformer)),this._receiveRequest(t,i,e,a,o,r===ps.RequestJSONArgsWithCancellation);break}case ps.RequestMixedArgs:case ps.RequestMixedArgsWithCancellation:{let{rpcId:e,method:a,args:o}=fs.deserializeRequestMixedArgs(n);this._uriTransformer&&(o=Ko(o,this._uriTransformer)),this._receiveRequest(t,i,e,a,o,r===ps.RequestMixedArgsWithCancellation);break}case ps.Acknowledged:this._logger?.logIncoming(t,i,rs.LocalSide,`ack`),this._onDidReceiveAcknowledge(i);break;case ps.Cancel:this._receiveCancel(t,i);break;case ps.ReplyOKEmpty:this._receiveReply(t,i,void 0);break;case ps.ReplyOKJSON:{let e=fs.deserializeReplyOKJSON(n);this._uriTransformer&&(e=Ko(e,this._uriTransformer)),this._receiveReply(t,i,e);break}case ps.ReplyOKJSONWithBuffers:{let e=fs.deserializeReplyOKJSONWithBuffers(n,this._uriTransformer);this._receiveReply(t,i,e);break}case ps.ReplyOKVSBuffer:{let e=fs.deserializeReplyOKVSBuffer(n);this._receiveReply(t,i,e);break}case ps.ReplyErrError:{let e=fs.deserializeReplyErrError(n);this._uriTransformer&&(e=Ko(e,this._uriTransformer)),this._receiveReplyErr(t,i,e);break}case ps.ReplyErrEmpty:this._receiveReplyErr(t,i,void 0);break;default:console.error(`received unexpected message`),console.error(e)}}_receiveRequest(e,t,n,r,i,a){this._logger?.logIncoming(e,t,rs.OtherSide,`receiveRequest ${gi(n)}.${r}(`,i);let o=String(t),s,c;if(a){let e=new Ii;i.push(e.token),s=this._invokeHandler(n,r,i),c=()=>e.cancel()}else s=this._invokeHandler(n,r,i),c=as;this._cancelInvokedHandlers[o]=c;let l=fs.serializeAcknowledged(t);this._logger?.logOutgoing(l.byteLength,t,rs.OtherSide,`ack`),this._protocol.send(l),s.then(e=>{delete this._cancelInvokedHandlers[o];let n=fs.serializeReplyOK(t,e,this._uriReplacer);this._logger?.logOutgoing(n.byteLength,t,rs.OtherSide,`reply:`,e),this._protocol.send(n)},e=>{delete this._cancelInvokedHandlers[o];let n=fs.serializeReplyErr(t,e);this._logger?.logOutgoing(n.byteLength,t,rs.OtherSide,`replyErr:`,e),this._protocol.send(n)})}_receiveCancel(e,t){this._logger?.logIncoming(e,t,rs.OtherSide,`receiveCancel`);let n=String(t);this._cancelInvokedHandlers[n]?.()}_receiveReply(e,t,n){this._logger?.logIncoming(e,t,rs.LocalSide,`receiveReply:`,n);let r=String(t);if(!this._pendingRPCReplies.hasOwnProperty(r))return;let i=this._pendingRPCReplies[r];delete this._pendingRPCReplies[r],i.resolveOk(n)}_receiveReplyErr(e,t,n){this._logger?.logIncoming(e,t,rs.LocalSide,`receiveReplyErr:`,n);let r=String(t);if(!this._pendingRPCReplies.hasOwnProperty(r))return;let i=this._pendingRPCReplies[r];delete this._pendingRPCReplies[r];let a;n&&(n.$isError?(a=Error(),a.name=n.name,a.message=n.message,a.stack=n.stack):a=n),i.resolveErr(a)}_invokeHandler(e,t,n){try{return Promise.resolve(this._doInvokeHandler(e,t,n))}catch(e){return Promise.reject(e)}}_doInvokeHandler(e,t,n){let r=this._locals[e];if(!r)throw Error(`Unknown actor `+gi(e));let i=r[t];if(typeof i!=`function`)throw Error(`Unknown method `+t+` on actor `+gi(e));return i.apply(r,n)}_remoteCall(e,t,n){if(this._isDisposed)return new Jo;let r=null;if(n.length>0&&Pi.isCancellationToken(n[n.length-1])&&(r=n.pop()),r&&r.isCancellationRequested)return Promise.reject(m());let i=fs.serializeRequestArguments(n,this._uriReplacer),a=++this._lastMessageId,o=String(a),s=new qo,c=new v;r&&c.add(r.onCancellationRequested(()=>{let e=fs.serializeCancel(a);this._logger?.logOutgoing(e.byteLength,a,rs.LocalSide,`cancel`),this._protocol.send(e)})),this._pendingRPCReplies[o]=new ls(s,c),this._onWillSendRequest(a);let l=fs.serializeRequest(a,e,t,i,!!r);return this._logger?.logOutgoing(l.byteLength,a,rs.LocalSide,`request: ${gi(e)}.${t}(`,n),this._protocol.send(l),s}},ls=class{constructor(e,t){this._promise=e,this._disposable=t}resolveOk(e){this._promise.resolveOk(e),this._disposable.dispose()}resolveErr(e){this._promise.resolveErr(e),this._disposable.dispose()}},us=class e{static alloc(t,n,r){let i=new e(b.alloc(r+1+4),0);return i.writeUInt8(t),i.writeUInt32(n),i}static read(t,n){return new e(t,n)}get buffer(){return this._buff}constructor(e,t){this._buff=e,this._offset=t}static sizeUInt8(){return 1}static{this.sizeUInt32=4}writeUInt8(e){this._buff.writeUInt8(e,this._offset),this._offset+=1}readUInt8(){let e=this._buff.readUInt8(this._offset);return this._offset+=1,e}writeUInt32(e){this._buff.writeUInt32BE(e,this._offset),this._offset+=4}readUInt32(){let e=this._buff.readUInt32BE(this._offset);return this._offset+=4,e}static sizeShortString(e){return 1+e.byteLength}writeShortString(e){this._buff.writeUInt8(e.byteLength,this._offset),this._offset+=1,this._buff.set(e,this._offset),this._offset+=e.byteLength}readShortString(){let e=this._buff.readUInt8(this._offset);this._offset+=1;let t=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,t}static sizeLongString(e){return 4+e.byteLength}writeLongString(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readLongString(){let e=this._buff.readUInt32BE(this._offset);this._offset+=4;let t=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,t}writeBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}static sizeVSBuffer(e){return 4+e.byteLength}writeVSBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readVSBuffer(){let e=this._buff.readUInt32BE(this._offset);this._offset+=4;let t=this._buff.slice(this._offset,this._offset+e);return this._offset+=e,t}static sizeMixedArray(e){let t=0;t+=1;for(let n=0,r=e.length;n<r;n++){let r=e[n];switch(t+=1,r.type){case ms.String:t+=this.sizeLongString(r.value);break;case ms.VSBuffer:t+=this.sizeVSBuffer(r.value);break;case ms.SerializedObjectWithBuffers:t+=this.sizeUInt32,t+=this.sizeLongString(r.value);for(let e=0;e<r.buffers.length;++e)t+=this.sizeVSBuffer(r.buffers[e]);break}}return t}writeMixedArray(e){this._buff.writeUInt8(e.length,this._offset),this._offset+=1;for(let t=0,n=e.length;t<n;t++){let n=e[t];switch(n.type){case ms.String:this.writeUInt8(ms.String),this.writeLongString(n.value);break;case ms.VSBuffer:this.writeUInt8(ms.VSBuffer),this.writeVSBuffer(n.value);break;case ms.SerializedObjectWithBuffers:this.writeUInt8(ms.SerializedObjectWithBuffers),this.writeUInt32(n.buffers.length),this.writeLongString(n.value);for(let e=0;e<n.buffers.length;++e)this.writeBuffer(n.buffers[e]);break;case ms.Undefined:this.writeUInt8(ms.Undefined);break}}}readMixedArray(){let e=this._buff.readUInt8(this._offset);this._offset+=1;let t=Array(e);for(let n=0;n<e;n++)switch(this.readUInt8()){case ms.String:t[n]=this.readLongString();break;case ms.VSBuffer:t[n]=this.readVSBuffer();break;case ms.SerializedObjectWithBuffers:{let e=this.readUInt32(),r=this.readLongString(),i=[];for(let t=0;t<e;++t)i.push(this.readVSBuffer());t[n]=new _i(es(r,i,null));break}case ms.Undefined:t[n]=void 0;break}return t}},ds;(function(e){e[e.Simple=0]=`Simple`,e[e.Mixed=1]=`Mixed`})(ds||={});var fs=class{static _useMixedArgSerialization(e){for(let t=0,n=e.length;t<n;t++)if(e[t]instanceof b||e[t]instanceof _i||e[t]===void 0)return!0;return!1}static serializeRequestArguments(e,t){if(this._useMixedArgSerialization(e)){let n=[];for(let r=0,i=e.length;r<i;r++){let i=e[r];if(i instanceof b)n[r]={type:ms.VSBuffer,value:i};else if(i===void 0)n[r]={type:ms.Undefined};else if(i instanceof _i){let{jsonString:e,referencedBuffers:a}=$o(i.value,t);n[r]={type:ms.SerializedObjectWithBuffers,value:b.fromString(e),buffers:a}}else n[r]={type:ms.String,value:b.fromString(ts(i,t))}}return{type:ds.Mixed,args:n}}return{type:ds.Simple,args:ts(e,t)}}static serializeRequest(e,t,n,r,i){switch(r.type){case ds.Simple:return this._requestJSONArgs(e,t,n,r.args,i);case ds.Mixed:return this._requestMixedArgs(e,t,n,r.args,i)}}static _requestJSONArgs(e,t,n,r,i){let a=b.fromString(n),o=b.fromString(r),s=0;s+=us.sizeUInt8(),s+=us.sizeShortString(a),s+=us.sizeLongString(o);let c=us.alloc(i?ps.RequestJSONArgsWithCancellation:ps.RequestJSONArgs,e,s);return c.writeUInt8(t),c.writeShortString(a),c.writeLongString(o),c.buffer}static deserializeRequestJSONArgs(e){let t=e.readUInt8(),n=e.readShortString(),r=e.readLongString();return{rpcId:t,method:n,args:JSON.parse(r)}}static _requestMixedArgs(e,t,n,r,i){let a=b.fromString(n),o=0;o+=us.sizeUInt8(),o+=us.sizeShortString(a),o+=us.sizeMixedArray(r);let s=us.alloc(i?ps.RequestMixedArgsWithCancellation:ps.RequestMixedArgs,e,o);return s.writeUInt8(t),s.writeShortString(a),s.writeMixedArray(r),s.buffer}static deserializeRequestMixedArgs(e){let t=e.readUInt8(),n=e.readShortString(),r=e.readMixedArray(),i=Array(r.length);for(let e=0,t=r.length;e<t;e++){let t=r[e];typeof t==`string`?i[e]=JSON.parse(t):i[e]=t}return{rpcId:t,method:n,args:i}}static serializeAcknowledged(e){return us.alloc(ps.Acknowledged,e,0).buffer}static serializeCancel(e){return us.alloc(ps.Cancel,e,0).buffer}static serializeReplyOK(e,t,n){if(t===void 0)return this._serializeReplyOKEmpty(e);if(t instanceof b)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof _i){let{jsonString:r,referencedBuffers:i}=$o(t.value,n,!0);return this._serializeReplyOKJSONWithBuffers(e,r,i)}else return this._serializeReplyOKJSON(e,Xo(t,n))}static _serializeReplyOKEmpty(e){return us.alloc(ps.ReplyOKEmpty,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let n=0;n+=us.sizeVSBuffer(t);let r=us.alloc(ps.ReplyOKVSBuffer,e,n);return r.writeVSBuffer(t),r.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){let n=b.fromString(t),r=0;r+=us.sizeLongString(n);let i=us.alloc(ps.ReplyOKJSON,e,r);return i.writeLongString(n),i.buffer}static _serializeReplyOKJSONWithBuffers(e,t,n){let r=b.fromString(t),i=0;i+=us.sizeUInt32,i+=us.sizeLongString(r);for(let e of n)i+=us.sizeVSBuffer(e);let a=us.alloc(ps.ReplyOKJSONWithBuffers,e,i);a.writeUInt32(n.length),a.writeLongString(r);for(let e of n)a.writeBuffer(e);return a.buffer}static deserializeReplyOKJSON(e){let t=e.readLongString();return JSON.parse(t)}static deserializeReplyOKJSONWithBuffers(e,t){let n=e.readUInt32(),r=e.readLongString(),i=[];for(let t=0;t<n;++t)i.push(e.readVSBuffer());return new _i(es(r,i,t))}static serializeReplyErr(e,t){let n=t?Xo(c(t),null):void 0;if(typeof n!=`string`)return this._serializeReplyErrEmpty(e);let r=b.fromString(n),i=0;i+=us.sizeLongString(r);let a=us.alloc(ps.ReplyErrError,e,i);return a.writeLongString(r),a.buffer}static deserializeReplyErrError(e){let t=e.readLongString();return JSON.parse(t)}static _serializeReplyErrEmpty(e){return us.alloc(ps.ReplyErrEmpty,e,0).buffer}},ps;(function(e){e[e.RequestJSONArgs=1]=`RequestJSONArgs`,e[e.RequestJSONArgsWithCancellation=2]=`RequestJSONArgsWithCancellation`,e[e.RequestMixedArgs=3]=`RequestMixedArgs`,e[e.RequestMixedArgsWithCancellation=4]=`RequestMixedArgsWithCancellation`,e[e.Acknowledged=5]=`Acknowledged`,e[e.Cancel=6]=`Cancel`,e[e.ReplyOKEmpty=7]=`ReplyOKEmpty`,e[e.ReplyOKVSBuffer=8]=`ReplyOKVSBuffer`,e[e.ReplyOKJSON=9]=`ReplyOKJSON`,e[e.ReplyOKJSONWithBuffers=10]=`ReplyOKJSONWithBuffers`,e[e.ReplyErrError=11]=`ReplyErrError`,e[e.ReplyErrEmpty=12]=`ReplyErrEmpty`})(ps||={});var ms;(function(e){e[e.String=1]=`String`,e[e.VSBuffer=2]=`VSBuffer`,e[e.SerializedObjectWithBuffers=3]=`SerializedObjectWithBuffers`,e[e.Undefined=4]=`Undefined`})(ms||={});function hs(e){if(!e)return;let t=e.indexOf(`+`);return t<0?e:e.substr(0,t)}const gs=[`AI`,`Azure`,`Chat`,`Data Science`,`Debuggers`,`Extension Packs`,`Education`,`Formatters`,`Keymaps`,`Language Packs`,`Linters`,`Machine Learning`,`Notebooks`,`Programming Languages`,`SCM Providers`,`Snippets`,`Testing`,`Themes`,`Visualization`,`Other`];var _s;(function(e){e[e.System=0]=`System`,e[e.User=1]=`User`})(_s||={});var vs;(function(e){e.WIN32_X64=`win32-x64`,e.WIN32_ARM64=`win32-arm64`,e.LINUX_X64=`linux-x64`,e.LINUX_ARM64=`linux-arm64`,e.LINUX_ARMHF=`linux-armhf`,e.ALPINE_X64=`alpine-x64`,e.ALPINE_ARM64=`alpine-arm64`,e.DARWIN_X64=`darwin-x64`,e.DARWIN_ARM64=`darwin-arm64`,e.WEB=`web`,e.UNIVERSAL=`universal`,e.UNKNOWN=`unknown`,e.UNDEFINED=`undefined`})(vs||={});var ys=class{constructor(e){this.value=e,this._lower=e.toLowerCase()}static equals(e,t){return e==null?t==null:t==null?!1:typeof e==`string`||typeof t==`string`?sa(typeof e==`string`?e:e.value,typeof t==`string`?t:t.value):e._lower===t._lower}static toKey(e){return typeof e==`string`?e.toLowerCase():e._lower}},bs=class{get size(){return this._set.size}constructor(e){if(this._set=new Set,e)for(let t of e)this.add(t)}add(e){this._set.add(ys.toKey(e))}delete(e){return this._set.delete(ys.toKey(e))}has(e){return this._set.has(ys.toKey(e))}},xs=class{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(ys.toKey(e))}get(e){return this._map.get(ys.toKey(e))}has(e){return this._map.has(ys.toKey(e))}set(e,t){this._map.set(ys.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}},Ss=class extends Error{constructor(e,t,n){super(`Error in extension ${ys.toKey(e)}: ${n??t.message}`,{cause:t}),this.name=`ExtensionError`,this.extension=e}},Cs;(function(e){e.serviceIds=new Map,e.DI_TARGET=`$di$target`,e.DI_DEPENDENCIES=`$di$dependencies`;function t(t){return t[e.DI_DEPENDENCIES]||[]}e.getServiceDependencies=t})(Cs||={});const ws=k(`instantiationService`);function Ts(e,t,n){t[Cs.DI_TARGET]===t?t[Cs.DI_DEPENDENCIES].push({id:e,index:n}):(t[Cs.DI_DEPENDENCIES]=[{id:e,index:n}],t[Cs.DI_TARGET]=t)}function k(e){if(Cs.serviceIds.has(e))return Cs.serviceIds.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Ts(t,e,r)};return t.toString=()=>e,Cs.serviceIds.set(e,t),t}function Es(e){return e}const Ds=k(`logService`),Os=k(`loggerService`);var ks=class{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}};const As=[];var js;(function(e){e[e.Eager=0]=`Eager`,e[e.Delayed=1]=`Delayed`})(js||={});function Ms(e,t,n){t instanceof ks||(t=new ks(t,[],!!n)),As.push([e,t])}function Ns(){return As}var Ps=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}};const Fs=k(`IExtHostInitDataService`);var Is=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}},Ls=class{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){let n=this.lookupOrInsertNode(e),r=this.lookupOrInsertNode(t);n.outgoing.set(r.key,r),r.incoming.set(n.key,n)}removeNode(e){let t=this._hashFn(e);this._nodes.delete(t);for(let e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){let t=this._hashFn(e),n=this._nodes.get(t);return n||(n=new Is(t,e),this._nodes.set(t,n)),n}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[t,n]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...n.incoming.keys()].join(`, `)}]\n\t(outgoing ->)[${[...n.outgoing.keys()].join(`,`)}]\n`);return e.join(`
15
- `)}findCycleSlow(){for(let[e,t]of this._nodes){let n=new Set([e]),r=this._findCycle(t,n);if(r)return r}}_findCycle(e,t){for(let[n,r]of e.outgoing){if(t.has(n))return[...t,n].join(` -> `);t.add(n);let e=this._findCycle(r,t);if(e)return e;t.delete(n)}}},Rs=class extends Error{constructor(e){super(`cyclic dependency between services`),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}},zs=class e{constructor(e=new Ps,t=!1,n,r=!1){this._services=e,this._strict=t,this._parent=n,this._enableTracing=r,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(ws,this),this._globalGraph=r?n?._globalGraph??new Ls(e=>e):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,ht(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)mt(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw Error(`InstantiationService has been disposed`)}createChild(t,n){this._throwIfDisposed();let r=this,i=new class extends e{dispose(){r._children.delete(i),super.dispose()}}(t,this._strict,this,this._enableTracing);return this._children.add(i),n?.add(i),i}invokeFunction(e,...t){this._throwIfDisposed();let n=Vs.traceInvocation(this._enableTracing,e),r=!1;try{return e({get:e=>{if(r)throw ee(`service accessor is only valid during the invocation of its target method`);let t=this._getOrCreateServiceInstance(e,n);return t||this._throwIfStrict(`[invokeFunction] unknown service '${e}'`,!1),t}},...t)}finally{r=!0,n.stop()}}createInstance(e,...t){this._throwIfDisposed();let n,r;return e instanceof ks?(n=Vs.traceCreation(this._enableTracing,e.ctor),r=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=Vs.traceCreation(this._enableTracing,e),r=this._createInstance(e,t,n)),n.stop(),r}_createInstance(e,t=[],n){let r=Cs.getServiceDependencies(e).sort((e,t)=>e.index-t.index),i=[];for(let t of r){let r=this._getOrCreateServiceInstance(t.id,n);r||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`,!1),i.push(r)}let a=r.length>0?r[0].index:t.length;if(t.length!==a){console.trace(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);let n=a-t.length;t=n>0?t.concat(Array(n)):t.slice(0,a)}return Reflect.construct(e,t.concat(i))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof ks)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw Error(`illegalState - setting UNKNOWN service instance`)}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let n=this._getServiceInstanceOrDescriptor(e);return n instanceof ks?this._safeCreateAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,t,n){if(this._activeInstantiations.has(e))throw Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,n){let r=new Ls(e=>e.id.toString()),i=0,a=[{id:e,desc:t,_trace:n}],o=new Set;for(;a.length;){let t=a.pop();if(!o.has(String(t.id))){if(o.add(String(t.id)),r.lookupOrInsertNode(t),i++>1e3)throw new Rs(r);for(let n of Cs.getServiceDependencies(t.desc.ctor)){let i=this._getServiceInstanceOrDescriptor(n.id);if(i||this._throwIfStrict(`[createInstance] ${e} depends on ${n.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(t.id),String(n.id)),i instanceof ks){let e={id:n.id,desc:i,_trace:t._trace.branch(n.id,!0)};r.lookup(e)||a.push(e),r.insertEdge(t,e)}}}}for(;;){let e=r.roots();if(e.length===0){if(!r.isEmpty())throw new Rs(r);break}for(let{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof ks){let e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setCreatedServiceInstance(t.id,e)}r.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],r,i){if(this._services.get(e)instanceof ks)return this._createServiceInstance(e,t,n,r,i,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,r,i);throw Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(t,n,r=[],i,a,o){if(i){let i=new e(void 0,this._strict,this,this._enableTracing);i._globalGraphImplicitDependency=String(t);let s=new Map,c=new Io(()=>{let e=i._createInstance(n,r,a);for(let[t,n]of s){let r=e[t];if(typeof r==`function`)for(let t of n)t.disposable=r.apply(e,t.listener)}return s.clear(),o.add(e),e});return new Proxy(Object.create(null),{get(e,t){if(!c.isInitialized&&typeof t==`string`&&(t.startsWith(`onDid`)||t.startsWith(`onWill`))){let e=s.get(t);return e||(e=new Xt,s.set(t,e)),(n,r,i)=>{if(c.isInitialized)return c.value[t](n,r,i);{let t={listener:[n,r,i],disposable:void 0},a=e.push(t);return _(()=>{a(),t.disposable?.dispose()})}}}if(t in e)return e[t];let n=c.value,r=n[t];return typeof r==`function`?(r=r.bind(n),e[t]=r,r):r},set(e,t,n){return c.value[t]=n,!0},getPrototypeOf(e){return n.prototype}})}else{let e=this._createInstance(n,r,a);return o.add(e),e}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw Error(e)}},Bs;(function(e){e[e.None=0]=`None`,e[e.Creation=1]=`Creation`,e[e.Invocation=2]=`Invocation`,e[e.Branch=3]=`Branch`})(Bs||={});var Vs=class e{static{this.all=new Set}static{this._None=new class extends e{constructor(){super(Bs.None,null)}stop(){}branch(){return this}}}static traceInvocation(t,n){return t?new e(Bs.Invocation,n.name||Error().stack.split(`
16
- `).slice(3,4).join(`
17
- `)):e._None}static traceCreation(t,n){return t?new e(Bs.Creation,n.name):e._None}static{this._totals=0}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(t,n){let r=new e(Bs.Branch,t.toString());return this._dep.push([t,n,r]),r}stop(){let t=Date.now()-this._start;e._totals+=t;let n=!1;function r(e,t){let i=[],a=Array(e+1).join(` `);for(let[o,s,c]of t._dep)if(s&&c){n=!0,i.push(`${a}CREATES -> ${o}`);let t=r(e+1,c);t&&i.push(t)}else i.push(`${a}uses -> ${o}`);return i.join(`
18
- `)}let i=[`${this.type===Bs.Creation?`CREATE`:`CALL`} ${this.name}`,`${r(1,this)}`,`DONE, took ${t.toFixed(2)}ms (grand total ${e._totals.toFixed(2)}ms)`];(t>2||n)&&e.all.add(i.join(`
19
- `))}};const Hs=k(`IExtHostRpcService`);var Us=class{constructor(e){this.getProxy=e.getProxy.bind(e),this.set=e.set.bind(e),this.dispose=e.dispose.bind(e),this.assertRegistered=e.assertRegistered.bind(e),this.drain=e.drain.bind(e)}};const Ws=k(`IURITransformerService`);var Gs=class{constructor(e){e?(this.transformIncoming=e.transformIncoming.bind(e),this.transformOutgoing=e.transformOutgoing.bind(e),this.transformOutgoingURI=e.transformOutgoingURI.bind(e),this.transformOutgoingScheme=e.transformOutgoingScheme.bind(e)):(this.transformIncoming=e=>e,this.transformOutgoing=e=>e,this.transformOutgoingURI=e=>e,this.transformOutgoingScheme=e=>e)}};function A(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function j(e,t){return function(n,r){t(n,r,e)}}var Ks=class{constructor(){this._value=``,this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){return e.charCodeAt(0)-this._value.charCodeAt(this._pos)}value(){return this._value[this._pos]}},qs=class{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===C.Period)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?ra(e,this._value,0,e.length,this._from,this._to):aa(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},Js=class{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){let e=this._value.charCodeAt(t);if(!(e===C.Slash||this._splitOnBackslash&&e===C.Backslash))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){let t=this._value.charCodeAt(this._to);if(t===C.Slash||this._splitOnBackslash&&t===C.Backslash)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?ra(e,this._value,0,e.length,this._from,this._to):aa(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},Ys;(function(e){e[e.Scheme=1]=`Scheme`,e[e.Authority=2]=`Authority`,e[e.Path=3]=`Path`,e[e.Query=4]=`Query`,e[e.Fragment=5]=`Fragment`})(Ys||={});var Xs=class{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(Ys.Scheme),this._value.authority&&this._states.push(Ys.Authority),this._value.path&&(this._pathIterator=new Js(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(Ys.Path)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(Ys.Query),this._value.fragment&&this._states.push(Ys.Fragment)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===Ys.Path&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===Ys.Path&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===Ys.Scheme)return ia(e,this._value.scheme);if(this._states[this._stateIdx]===Ys.Authority)return ia(e,this._value.authority);if(this._states[this._stateIdx]===Ys.Path)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===Ys.Query)return na(e,this._value.query);if(this._states[this._stateIdx]===Ys.Fragment)return na(e,this._value.fragment);throw Error()}value(){if(this._states[this._stateIdx]===Ys.Scheme)return this._value.scheme;if(this._states[this._stateIdx]===Ys.Authority)return this._value.authority;if(this._states[this._stateIdx]===Ys.Path)return this._pathIterator.value();if(this._states[this._stateIdx]===Ys.Query)return this._value.query;if(this._states[this._stateIdx]===Ys.Fragment)return this._value.fragment;throw Error()}},Zs=class e{static{this.Val=Symbol(`undefined_placeholder`)}static wrap(t){return t===void 0?e.Val:t}static unwrap(t){return t===e.Val?void 0:t}},Qs=class{constructor(){this.height=1,this.value=void 0,this.key=void 0,this.left=void 0,this.mid=void 0,this.right=void 0}isEmpty(){return!this.left&&!this.mid&&!this.right&&this.value===void 0}rotateLeft(){let e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}},$s;(function(e){e[e.Left=-1]=`Left`,e[e.Mid=0]=`Mid`,e[e.Right=1]=`Right`})($s||={});var ec=class e{static forUris(t=()=>!1,n=()=>!1){return new e(new Xs(t,n))}static forPaths(t=!1){return new e(new Js(void 0,!t))}static forStrings(){return new e(new Ks)}static forConfigKeys(){return new e(new qs)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){let n=t.slice(0);ve(n);for(let t of n)this.set(t,e)}else{let t=e.slice(0);ve(t);for(let e of t)this.set(e[0],e[1])}}set(e,t){let n=this._iter.reset(e),r;this._root||(this._root=new Qs,this._root.segment=n.value());let i=[];for(r=this._root;;){let e=n.cmp(r.segment);if(e>0)r.left||(r.left=new Qs,r.left.segment=n.value()),i.push([$s.Left,r]),r=r.left;else if(e<0)r.right||(r.right=new Qs,r.right.segment=n.value()),i.push([$s.Right,r]),r=r.right;else if(n.hasNext())n.next(),r.mid||(r.mid=new Qs,r.mid.segment=n.value()),i.push([$s.Mid,r]),r=r.mid;else break}let a=Zs.unwrap(r.value);r.value=Zs.wrap(t),r.key=e;for(let e=i.length-1;e>=0;e--){let t=i[e][1];t.updateHeight();let n=t.balanceFactor();if(n<-1||n>1){let n=i[e][0],r=i[e+1][0];if(n===$s.Right&&r===$s.Right)i[e][1]=t.rotateLeft();else if(n===$s.Left&&r===$s.Left)i[e][1]=t.rotateRight();else if(n===$s.Right&&r===$s.Left)t.right=i[e+1][1]=i[e+1][1].rotateRight(),i[e][1]=t.rotateLeft();else if(n===$s.Left&&r===$s.Right)t.left=i[e+1][1]=i[e+1][1].rotateLeft(),i[e][1]=t.rotateRight();else throw Error();if(e>0)switch(i[e-1][0]){case $s.Left:i[e-1][1].left=i[e][1];break;case $s.Right:i[e-1][1].right=i[e][1];break;case $s.Mid:i[e-1][1].mid=i[e][1];break}else this._root=i[0][1]}}return a}get(e){return Zs.unwrap(this._getNode(e)?.value)}_getNode(e){let t=this._iter.reset(e),n=this._root;for(;n;){let e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){let t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){let n=this._iter.reset(e),r=[],i=this._root;for(;i;){let e=n.cmp(i.segment);if(e>0)r.push([$s.Left,i]),i=i.left;else if(e<0)r.push([$s.Right,i]),i=i.right;else if(n.hasNext())n.next(),r.push([$s.Mid,i]),i=i.mid;else break}if(i){if(t?(i.left=void 0,i.mid=void 0,i.right=void 0,i.height=1):(i.key=void 0,i.value=void 0),!i.mid&&!i.value)if(i.left&&i.right){let e=[[$s.Right,i]],t=this._min(i.right,e);if(t.key){i.key=t.key,i.value=t.value,i.segment=t.segment;let n=t.right;if(e.length>1){let[t,r]=e[e.length-1];switch(t){case $s.Left:r.left=n;break;case $s.Mid:Ue(!1);case $s.Right:Ue(!1)}}else i.right=n;let a=this._balanceByStack(e);if(r.length>0){let[e,t]=r[r.length-1];switch(e){case $s.Left:t.left=a;break;case $s.Mid:t.mid=a;break;case $s.Right:t.right=a;break}}else this._root=a}}else{let e=i.left??i.right;if(r.length>0){let[t,n]=r[r.length-1];switch(t){case $s.Left:n.left=e;break;case $s.Mid:n.mid=e;break;case $s.Right:n.right=e;break}}else this._root=e}this._root=this._balanceByStack(r)??this._root}}_min(e,t){for(;e.left;)t.push([$s.Left,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){let n=e[t][1];n.updateHeight();let r=n.balanceFactor();if(r>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[t][1]=n.rotateLeft()):r<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[t][1]=n.rotateRight()),t>0)switch(e[t-1][0]){case $s.Left:e[t-1][1].left=e[t][1];break;case $s.Right:e[t-1][1].right=e[t][1];break;case $s.Mid:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){let t=this._iter.reset(e),n=this._root,r;for(;n;){let e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else if(t.hasNext())t.next(),r=Zs.unwrap(n.value)||r,n=n.mid;else break}return n&&Zs.unwrap(n.value)||r}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){let n=this._iter.reset(e),r=this._root;for(;r;){let e=n.cmp(r.segment);if(e>0)r=r.left;else if(e<0)r=r.right;else if(n.hasNext())n.next(),r=r.mid;else if(r.mid)return this._entries(r.mid);else return t?Zs.unwrap(r.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(let[t,n]of this)e(n,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value!==void 0&&t.push([e.key,Zs.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}_isBalanced(){let e=t=>{if(!t)return!0;let n=t.balanceFactor();return n<-1||n>1?!1:e(t.left)&&e(t.right)};return e(this._root)}};function tc(e){if(!e||typeof e!=`object`||e instanceof RegExp)return e;let t=Array.isArray(e)?[]:{};return Object.entries(e).forEach(([e,n])=>{t[e]=n&&typeof n==`object`?tc(n):n}),t}function nc(e){if(!e||typeof e!=`object`)return e;let t=[e];for(;t.length>0;){let e=t.shift();for(let n in e)if(rc.call(e,n)){let r=e[n];typeof r==`object`&&!Object.isFrozen(r)&&!Ye(r)&&t.push(r)}}return e}const rc=Object.prototype.hasOwnProperty;function ic(e,t){return ac(e,t,new Set)}function ac(e,t,n){if(et(e))return e;let r=t(e);if(r!==void 0)return r;if(Array.isArray(e)){let r=[];for(let i of e)r.push(ac(i,t,n));return r}if(Je(e)){if(n.has(e))throw Error(`Cannot clone recursive data-structure`);n.add(e);let r={};for(let i in e)rc.call(e,i)&&(r[i]=ac(e[i],t,n));return n.delete(e),r}return e}function oc(e,t,n=!0){return Je(e)?(Je(t)&&Object.keys(t).forEach(r=>{r in e?n&&(Je(e[r])&&Je(t[r])?oc(e[r],t[r],n):e[r]=t[r]):e[r]=t[r]}),e):t}function sc(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`||Array.isArray(e)!==Array.isArray(t))return!1;let n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!sc(e[n],t[n]))return!1}else{let i=[];for(r in e)i.push(r);i.sort();let a=[];for(r in t)a.push(r);if(a.sort(),!sc(i,a))return!1;for(n=0;n<i.length;n++)if(!sc(e[i[n]],t[i[n]]))return!1}return!0}function cc(e){let t=new Set;return JSON.stringify(e,(e,n)=>{if(Je(n)||Array.isArray(n)){if(t.has(n))return`[Circular]`;t.add(n)}return typeof n==`bigint`?`[BigInt ${n.toString()}]`:n})}function lc(e,t){let n=Object.create(null);for(let[r,i]of Object.entries(e))t(r,i)&&(n[r]=i);return n}var uc=class{constructor(){this._next=0}getNext(){return this._next++}},dc;(function(e){e[e.Unknown=0]=`Unknown`,e[e.File=1]=`File`,e[e.Directory=2]=`Directory`,e[e.SymbolicLink=64]=`SymbolicLink`})(dc||={});var fc;(function(e){e[e.Readonly=1]=`Readonly`,e[e.Locked=2]=`Locked`,e[e.Executable=4]=`Executable`})(fc||={});var pc;(function(e){e[e.UPDATED=2]=`UPDATED`,e[e.ADDED=4]=`ADDED`,e[e.DELETED=8]=`DELETED`})(pc||={});var mc;(function(e){e[e.None=0]=`None`,e[e.FileReadWrite=2]=`FileReadWrite`,e[e.FileOpenReadWriteClose=4]=`FileOpenReadWriteClose`,e[e.FileReadStream=16]=`FileReadStream`,e[e.FileFolderCopy=8]=`FileFolderCopy`,e[e.PathCaseSensitive=1024]=`PathCaseSensitive`,e[e.Readonly=2048]=`Readonly`,e[e.Trash=4096]=`Trash`,e[e.FileWriteUnlock=8192]=`FileWriteUnlock`,e[e.FileAtomicRead=16384]=`FileAtomicRead`,e[e.FileAtomicWrite=32768]=`FileAtomicWrite`,e[e.FileAtomicDelete=65536]=`FileAtomicDelete`,e[e.FileClone=131072]=`FileClone`,e[e.FileRealpath=262144]=`FileRealpath`,e[e.FileAppend=524288]=`FileAppend`})(mc||={});var hc;(function(e){e.FileExists=`EntryExists`,e.FileNotFound=`EntryNotFound`,e.FileNotADirectory=`EntryNotADirectory`,e.FileIsADirectory=`EntryIsADirectory`,e.FileExceedsStorageQuota=`EntryExceedsStorageQuota`,e.FileTooLarge=`EntryTooLarge`,e.FileWriteLocked=`EntryWriteLocked`,e.NoPermissions=`NoPermissions`,e.Unavailable=`Unavailable`,e.Unknown=`Unknown`})(hc||={});var gc=class e extends Error{static create(t,n){let r=new e(t.toString(),n);return _c(r,n),r}constructor(e,t){super(e),this.code=t}};function _c(e,t){return e.name=t?`${t} (FileSystemError)`:`FileSystemError`,e}function vc(e){if(!e)return hc.Unknown;if(e instanceof gc)return e.code;let t=/^(.+) \(FileSystemError\)$/.exec(e.name);if(!t)return hc.Unknown;switch(t[1]){case hc.FileExists:return hc.FileExists;case hc.FileIsADirectory:return hc.FileIsADirectory;case hc.FileNotADirectory:return hc.FileNotADirectory;case hc.FileNotFound:return hc.FileNotFound;case hc.FileTooLarge:return hc.FileTooLarge;case hc.FileWriteLocked:return hc.FileWriteLocked;case hc.NoPermissions:return hc.NoPermissions;case hc.Unavailable:return hc.Unavailable}return hc.Unknown}function yc(e){if(e instanceof Sc)return e.fileOperationResult;switch(vc(e)){case hc.FileNotFound:return Cc.FILE_NOT_FOUND;case hc.FileIsADirectory:return Cc.FILE_IS_DIRECTORY;case hc.FileNotADirectory:return Cc.FILE_NOT_DIRECTORY;case hc.FileWriteLocked:return Cc.FILE_WRITE_LOCKED;case hc.NoPermissions:return Cc.FILE_PERMISSION_DENIED;case hc.FileExists:return Cc.FILE_MOVE_CONFLICT;case hc.FileTooLarge:return Cc.FILE_TOO_LARGE;default:return Cc.FILE_OTHER_ERROR}}var bc;(function(e){e[e.CREATE=0]=`CREATE`,e[e.DELETE=1]=`DELETE`,e[e.MOVE=2]=`MOVE`,e[e.COPY=3]=`COPY`,e[e.WRITE=4]=`WRITE`})(bc||={});var xc;(function(e){e[e.UPDATED=0]=`UPDATED`,e[e.ADDED=1]=`ADDED`,e[e.DELETED=2]=`DELETED`})(xc||={}),class e{static{this.MIXED_CORRELATION=null}constructor(t,r){this.ignorePathCasing=r,this.correlationId=void 0,this.added=new n(()=>{let e=ec.forUris(()=>this.ignorePathCasing);return e.fill(this.rawAdded.map(e=>[e,!0])),e}),this.updated=new n(()=>{let e=ec.forUris(()=>this.ignorePathCasing);return e.fill(this.rawUpdated.map(e=>[e,!0])),e}),this.deleted=new n(()=>{let e=ec.forUris(()=>this.ignorePathCasing);return e.fill(this.rawDeleted.map(e=>[e,!0])),e}),this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];for(let n of t){switch(n.type){case xc.ADDED:this.rawAdded.push(n.resource);break;case xc.UPDATED:this.rawUpdated.push(n.resource);break;case xc.DELETED:this.rawDeleted.push(n.resource);break}this.correlationId!==e.MIXED_CORRELATION&&(typeof n.cId==`number`?this.correlationId===void 0?this.correlationId=n.cId:this.correlationId!==n.cId&&(this.correlationId=e.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=e.MIXED_CORRELATION))}}contains(e,...t){return this.doContains(e,{includeChildren:!1},...t)}affects(e,...t){return this.doContains(e,{includeChildren:!0},...t)}doContains(e,t,...n){if(!e)return!1;let r=n.length>0;return!!((!r||n.includes(xc.ADDED))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!r||n.includes(xc.UPDATED))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!r||n.includes(xc.DELETED))&&(this.deleted.value.findSubstr(e)||t.includeChildren&&this.deleted.value.findSuperstr(e)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(e){return this.correlationId===e}hasCorrelation(){return typeof this.correlationId==`number`}};var Sc=class extends Error{constructor(e,t,n){super(e),this.fileOperationResult=t,this.options=n}},Cc;(function(e){e[e.FILE_IS_DIRECTORY=0]=`FILE_IS_DIRECTORY`,e[e.FILE_NOT_FOUND=1]=`FILE_NOT_FOUND`,e[e.FILE_NOT_MODIFIED_SINCE=2]=`FILE_NOT_MODIFIED_SINCE`,e[e.FILE_MODIFIED_SINCE=3]=`FILE_MODIFIED_SINCE`,e[e.FILE_MOVE_CONFLICT=4]=`FILE_MOVE_CONFLICT`,e[e.FILE_WRITE_LOCKED=5]=`FILE_WRITE_LOCKED`,e[e.FILE_PERMISSION_DENIED=6]=`FILE_PERMISSION_DENIED`,e[e.FILE_TOO_LARGE=7]=`FILE_TOO_LARGE`,e[e.FILE_INVALID_PATH=8]=`FILE_INVALID_PATH`,e[e.FILE_NOT_DIRECTORY=9]=`FILE_NOT_DIRECTORY`,e[e.FILE_OTHER_ERROR=10]=`FILE_OTHER_ERROR`})(Cc||={});var wc;(function(e){e[e.FILE=0]=`FILE`,e[e.FOLDER=1]=`FOLDER`,e[e.ROOT_FOLDER=2]=`ROOT_FOLDER`})(wc||={});function Tc(e){if(!(typeof e.size!=`number`||typeof e.mtime!=`number`))return e.mtime.toString(29)+e.size.toString(31)}(class e{static{this.KB=1024}static{this.MB=e.KB*e.KB}static{this.GB=e.MB*e.KB}static{this.TB=e.GB*e.KB}static formatSize(t){return Xe(t)||(t=0),t<e.KB?x(2045,`{0}B`,t.toFixed(0)):t<e.MB?x(2046,`{0}KB`,(t/e.KB).toFixed(2)):t<e.GB?x(2047,`{0}MB`,(t/e.MB).toFixed(2)):t<e.TB?x(2048,`{0}GB`,(t/e.GB).toFixed(2)):x(2049,`{0}TB`,(t/e.TB).toFixed(2))}});var Ec;(function(e){e[e.Ignore=0]=`Ignore`,e[e.Info=1]=`Info`,e[e.Warning=2]=`Warning`,e[e.Error=3]=`Error`})(Ec||={}),(function(e){let t=`error`,n=`warning`,r=`info`;function i(i){return i?sa(t,i)?e.Error:sa(n,i)||sa(`warn`,i)?e.Warning:sa(r,i)?e.Info:e.Ignore:e.Ignore}e.fromValue=i;function a(i){switch(i){case e.Error:return t;case e.Warning:return n;case e.Info:return r;default:return`ignore`}}e.toString=a})(Ec||={});var Dc=Ec,Oc;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.OPTIONAL=1]=`OPTIONAL`,e[e.SILENT=2]=`SILENT`,e[e.URGENT=3]=`URGENT`})(Oc||={});var kc;(function(e){e[e.WORKSPACE=0]=`WORKSPACE`,e[e.PROFILE=1]=`PROFILE`,e[e.APPLICATION=2]=`APPLICATION`})(kc||={});var Ac;(function(e){e[e.OFF=0]=`OFF`,e[e.ERROR=1]=`ERROR`})(Ac||={});function jc(e){let t=e;return typeof t?.id==`string`&&w.isUri(t.uri)}function Mc(e){let t=e;return typeof t?.id==`string`&&w.isUri(t.configPath)}var Nc;(function(e){e[e.EMPTY=1]=`EMPTY`,e[e.FOLDER=2]=`FOLDER`,e[e.WORKSPACE=3]=`WORKSPACE`})(Nc||={});let Pc=class{get folders(){return this._folders}set folders(e){this._folders=e,this.updateFoldersMap()}constructor(e,t,n,r,i,a){this._id=e,this._transient=n,this._configuration=r,this.ignorePathCasing=i,this._workspaceName=a,this.foldersMap=ec.forUris(this.ignorePathCasing,()=>!0),this.folders=t}update(e){this._id=e.id,this._configuration=e.configuration,this._transient=e.transient,this._workspaceName=e.name,this.ignorePathCasing=e.ignorePathCasing,this.folders=e.folders}get id(){return this._id}get transient(){return this._transient}get configuration(){return this._configuration}set configuration(e){this._configuration=e}get name(){return this._workspaceName}getFolder(e){return e&&this.foldersMap.findSubstr(e)||null}updateFoldersMap(){this.foldersMap=ec.forUris(this.ignorePathCasing,()=>!0);for(let e of this.folders)this.foldersMap.set(e.uri,e)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration,name:this.name}}};var Fc=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return io(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function Ic(e){return new Fc({uri:e,index:0,name:eo(e)},{uri:e.toString()})}x(2607,`Code Workspace`);var Lc=class{constructor(){this._systemSchemes=new Set(Object.keys(O)),this._providerInfo=new Map,this.extUri=new Ya(e=>{let t=this._providerInfo.get(e.scheme);return!(t===void 0||t&mc.PathCaseSensitive)})}$acceptProviderInfos(e,t){t===null?this._providerInfo.delete(e.scheme):this._providerInfo.set(e.scheme,t)}isFreeScheme(e){return!this._providerInfo.has(e)&&!this._systemSchemes.has(e)}getCapabilities(e){return this._providerInfo.get(e)}};const Rc=k(`IExtHostFileSystemInfo`),zc=(function(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID.bind(crypto);let e=new Uint8Array(16),t=[];for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,`0`));return function(){crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,r=``;return r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r}})(),Bc=Object.freeze({create:e=>_e(e.map(e=>e.toString())).join(`\r
20
- `),split:e=>e.split(`\r
21
- `),parse:e=>Bc.split(e).filter(e=>!e.startsWith(`#`))});var Vc;(function(e){e[e.InitialConsonant=4352]=`InitialConsonant`,e[e.Vowel=4449]=`Vowel`,e[e.FinalConsonant=4520]=`FinalConsonant`,e[e.CompatibilityJamo=12593]=`CompatibilityJamo`})(Vc||={});var M;(function(e){e[e.NUL=0]=`NUL`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`})(M||={});var Hc;(function(e){e[e.fa=24934]=`fa`,e[e.fg=26470]=`fg`,e[e.fq=29030]=`fq`,e[e.fr=29286]=`fr`,e[e.ft=29798]=`ft`,e[e.fv=30310]=`fv`,e[e.fx=30822]=`fx`,e[e.hk=27496]=`hk`,e[e.hl=27752]=`hl`,e[e.ho=28520]=`ho`,e[e.ml=27757]=`ml`,e[e.nj=27246]=`nj`,e[e.nl=27758]=`nl`,e[e.np=28782]=`np`,e[e.qt=29809]=`qt`,e[e.rt=29810]=`rt`,e[e.sg=26483]=`sg`,e[e.sw=30579]=`sw`})(Hc||={}),new Uint8Array([M.r,M.R,M.s,M.e,M.E,M.f,M.a,M.q,M.Q,M.t,M.T,M.d,M.w,M.W,M.c,M.z,M.x,M.v,M.g]),new Uint16Array([M.k,M.o,M.i,M.O,M.j,M.p,M.u,M.P,M.h,Hc.hk,Hc.ho,Hc.hl,M.y,M.n,Hc.nj,Hc.np,Hc.nl,M.b,M.m,Hc.ml,M.l]),new Uint16Array([M.r,M.R,Hc.rt,M.s,Hc.sw,Hc.sg,M.e,M.f,Hc.fr,Hc.fa,Hc.fq,Hc.ft,Hc.fx,Hc.fv,Hc.fg,M.a,M.q,Hc.qt,M.t,M.T,M.d,M.w,M.c,M.z,M.x,M.v,M.g]),new Uint16Array([M.r,M.R,Hc.rt,M.s,Hc.sw,Hc.sg,M.e,M.E,M.f,Hc.fr,Hc.fa,Hc.fq,Hc.ft,Hc.fx,Hc.fv,Hc.fg,M.a,M.q,M.Q,Hc.qt,M.t,M.T,M.d,M.w,M.W,M.c,M.z,M.x,M.v,M.g,M.k,M.o,M.i,M.O,M.j,M.p,M.u,M.P,M.h,Hc.hk,Hc.ho,Hc.hl,M.y,M.n,Hc.nj,Hc.np,Hc.nl,M.b,M.m,Hc.ml,M.l]);const Uc=new Re(1e4);function Wc(e){return Kc(e,`NFD`,Uc)}const Gc=/[^\u0000-\u0080]/;function Kc(e,t,n){if(!e)return e;let r=n.get(e);if(r)return r;let i;return i=Gc.test(e)?e.normalize(t):e,n.set(e,i),i}(function(){let e=new Re(1e4),t=/[\u0300-\u036f]/g;return function(n){let r=e.get(n);if(r)return r;let i=Wc(n).replace(t,``),a=(i.length===n.length?i:n).toLowerCase();return e.set(n,a),a}})(),qc.bind(void 0,!1),qc.bind(void 0,!0);function qc(e,t,n){if(!n||n.length<t.length)return null;let r;return r=e?la(n,t):n.indexOf(t)===0,r?t.length>0?[{start:0,end:t.length}]:[]:null}function Jc(e,t,n,r){if(n===e.length)return[];if(r===t.length)return null;if(e[n]===t[r]){let i=null;return(i=Jc(e,t,n+1,r+1))?el({start:r,end:r+1},i):null}return Jc(e,t,n,r+1)}function Yc(e){return C.a<=e&&e<=C.z}function Xc(e){return C.A<=e&&e<=C.Z}function Zc(e){return C.Digit0<=e&&e<=C.Digit9}const Qc=new Set;`()[]{}<>\`'"-/;:,.?!`.split(``).forEach(e=>Qc.add(e.charCodeAt(0)));function $c(e){return Yc(e)||Xc(e)||Zc(e)}function el(e,t){return t.length===0?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function tl(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(Xc(t)||Zc(t)||n>0&&!$c(e.charCodeAt(n-1)))return n}return e.length}function nl(e,t,n,r){if(n===e.length)return[];if(r===t.length||e[n]!==t[r].toLowerCase())return null;{let i=null,a=r+1;for(i=nl(e,t,n+1,r+1);!i&&(a=tl(t,a))<t.length;)i=nl(e,t,n+1,a),a++;return i===null?null:el({start:r,end:r+1},i)}}new Re(1e4);function rl(){let e=[],t=[];for(let e=0;e<=128;e++)t[e]=0;for(let n=0;n<=128;n++)e.push(t.slice(0));return e}function il(e){let t=[];for(let n=0;n<=e;n++)t[n]=0;return t}il(256),il(256),rl(),rl(),rl();var al;(function(e){e[e.Diag=1]=`Diag`,e[e.Left=2]=`Left`,e[e.LeftLeft=3]=`LeftLeft`})(al||={});var ol;(function(e){e.Default=[-100,0];function t(e){return!e||e.length===2&&e[0]===-100&&e[1]===0}e.isDefault=t})(ol||={}),class{static{this.default={boostFullMatch:!0,firstMatchCanBeWeak:!1}}constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}};const sl=Object.create(null);function N(e,t){if(Ge(t)){let n=sl[t];if(n===void 0)throw Error(`${e} references an unknown codicon: ${t}`);t=n}return sl[e]=t,{id:e}}function cl(){return sl}const ll={add:N(`add`,6e4),plus:N(`plus`,6e4),gistNew:N(`gist-new`,6e4),repoCreate:N(`repo-create`,6e4),lightbulb:N(`lightbulb`,60001),lightBulb:N(`light-bulb`,60001),repo:N(`repo`,60002),repoDelete:N(`repo-delete`,60002),gistFork:N(`gist-fork`,60003),repoForked:N(`repo-forked`,60003),gitPullRequest:N(`git-pull-request`,60004),gitPullRequestAbandoned:N(`git-pull-request-abandoned`,60004),recordKeys:N(`record-keys`,60005),keyboard:N(`keyboard`,60005),tag:N(`tag`,60006),gitPullRequestLabel:N(`git-pull-request-label`,60006),tagAdd:N(`tag-add`,60006),tagRemove:N(`tag-remove`,60006),person:N(`person`,60007),personFollow:N(`person-follow`,60007),personOutline:N(`person-outline`,60007),personFilled:N(`person-filled`,60007),sourceControl:N(`source-control`,60008),mirror:N(`mirror`,60009),mirrorPublic:N(`mirror-public`,60009),star:N(`star`,60010),starAdd:N(`star-add`,60010),starDelete:N(`star-delete`,60010),starEmpty:N(`star-empty`,60010),comment:N(`comment`,60011),commentAdd:N(`comment-add`,60011),alert:N(`alert`,60012),warning:N(`warning`,60012),search:N(`search`,60013),searchSave:N(`search-save`,60013),logOut:N(`log-out`,60014),signOut:N(`sign-out`,60014),logIn:N(`log-in`,60015),signIn:N(`sign-in`,60015),eye:N(`eye`,60016),eyeUnwatch:N(`eye-unwatch`,60016),eyeWatch:N(`eye-watch`,60016),circleFilled:N(`circle-filled`,60017),primitiveDot:N(`primitive-dot`,60017),closeDirty:N(`close-dirty`,60017),debugBreakpoint:N(`debug-breakpoint`,60017),debugBreakpointDisabled:N(`debug-breakpoint-disabled`,60017),debugHint:N(`debug-hint`,60017),terminalDecorationSuccess:N(`terminal-decoration-success`,60017),primitiveSquare:N(`primitive-square`,60018),edit:N(`edit`,60019),pencil:N(`pencil`,60019),info:N(`info`,60020),issueOpened:N(`issue-opened`,60020),gistPrivate:N(`gist-private`,60021),gitForkPrivate:N(`git-fork-private`,60021),lock:N(`lock`,60021),mirrorPrivate:N(`mirror-private`,60021),close:N(`close`,60022),removeClose:N(`remove-close`,60022),x:N(`x`,60022),repoSync:N(`repo-sync`,60023),sync:N(`sync`,60023),clone:N(`clone`,60024),desktopDownload:N(`desktop-download`,60024),beaker:N(`beaker`,60025),microscope:N(`microscope`,60025),vm:N(`vm`,60026),deviceDesktop:N(`device-desktop`,60026),file:N(`file`,60027),more:N(`more`,60028),ellipsis:N(`ellipsis`,60028),kebabHorizontal:N(`kebab-horizontal`,60028),mailReply:N(`mail-reply`,60029),reply:N(`reply`,60029),organization:N(`organization`,60030),organizationFilled:N(`organization-filled`,60030),organizationOutline:N(`organization-outline`,60030),newFile:N(`new-file`,60031),fileAdd:N(`file-add`,60031),newFolder:N(`new-folder`,60032),fileDirectoryCreate:N(`file-directory-create`,60032),trash:N(`trash`,60033),trashcan:N(`trashcan`,60033),history:N(`history`,60034),clock:N(`clock`,60034),folder:N(`folder`,60035),fileDirectory:N(`file-directory`,60035),symbolFolder:N(`symbol-folder`,60035),logoGithub:N(`logo-github`,60036),markGithub:N(`mark-github`,60036),github:N(`github`,60036),terminal:N(`terminal`,60037),console:N(`console`,60037),repl:N(`repl`,60037),zap:N(`zap`,60038),symbolEvent:N(`symbol-event`,60038),error:N(`error`,60039),stop:N(`stop`,60039),variable:N(`variable`,60040),symbolVariable:N(`symbol-variable`,60040),array:N(`array`,60042),symbolArray:N(`symbol-array`,60042),symbolModule:N(`symbol-module`,60043),symbolPackage:N(`symbol-package`,60043),symbolNamespace:N(`symbol-namespace`,60043),symbolObject:N(`symbol-object`,60043),symbolMethod:N(`symbol-method`,60044),symbolFunction:N(`symbol-function`,60044),symbolConstructor:N(`symbol-constructor`,60044),symbolBoolean:N(`symbol-boolean`,60047),symbolNull:N(`symbol-null`,60047),symbolNumeric:N(`symbol-numeric`,60048),symbolNumber:N(`symbol-number`,60048),symbolStructure:N(`symbol-structure`,60049),symbolStruct:N(`symbol-struct`,60049),symbolParameter:N(`symbol-parameter`,60050),symbolTypeParameter:N(`symbol-type-parameter`,60050),symbolKey:N(`symbol-key`,60051),symbolText:N(`symbol-text`,60051),symbolReference:N(`symbol-reference`,60052),goToFile:N(`go-to-file`,60052),symbolEnum:N(`symbol-enum`,60053),symbolValue:N(`symbol-value`,60053),symbolRuler:N(`symbol-ruler`,60054),symbolUnit:N(`symbol-unit`,60054),activateBreakpoints:N(`activate-breakpoints`,60055),archive:N(`archive`,60056),arrowBoth:N(`arrow-both`,60057),arrowDown:N(`arrow-down`,60058),arrowLeft:N(`arrow-left`,60059),arrowRight:N(`arrow-right`,60060),arrowSmallDown:N(`arrow-small-down`,60061),arrowSmallLeft:N(`arrow-small-left`,60062),arrowSmallRight:N(`arrow-small-right`,60063),arrowSmallUp:N(`arrow-small-up`,60064),arrowUp:N(`arrow-up`,60065),bell:N(`bell`,60066),bold:N(`bold`,60067),book:N(`book`,60068),bookmark:N(`bookmark`,60069),debugBreakpointConditionalUnverified:N(`debug-breakpoint-conditional-unverified`,60070),debugBreakpointConditional:N(`debug-breakpoint-conditional`,60071),debugBreakpointConditionalDisabled:N(`debug-breakpoint-conditional-disabled`,60071),debugBreakpointDataUnverified:N(`debug-breakpoint-data-unverified`,60072),debugBreakpointData:N(`debug-breakpoint-data`,60073),debugBreakpointDataDisabled:N(`debug-breakpoint-data-disabled`,60073),debugBreakpointLogUnverified:N(`debug-breakpoint-log-unverified`,60074),debugBreakpointLog:N(`debug-breakpoint-log`,60075),debugBreakpointLogDisabled:N(`debug-breakpoint-log-disabled`,60075),briefcase:N(`briefcase`,60076),broadcast:N(`broadcast`,60077),browser:N(`browser`,60078),bug:N(`bug`,60079),calendar:N(`calendar`,60080),caseSensitive:N(`case-sensitive`,60081),check:N(`check`,60082),checklist:N(`checklist`,60083),chevronDown:N(`chevron-down`,60084),chevronLeft:N(`chevron-left`,60085),chevronRight:N(`chevron-right`,60086),chevronUp:N(`chevron-up`,60087),chromeClose:N(`chrome-close`,60088),chromeMaximize:N(`chrome-maximize`,60089),chromeMinimize:N(`chrome-minimize`,60090),chromeRestore:N(`chrome-restore`,60091),circleOutline:N(`circle-outline`,60092),circle:N(`circle`,60092),debugBreakpointUnverified:N(`debug-breakpoint-unverified`,60092),terminalDecorationIncomplete:N(`terminal-decoration-incomplete`,60092),circleSlash:N(`circle-slash`,60093),circuitBoard:N(`circuit-board`,60094),clearAll:N(`clear-all`,60095),clippy:N(`clippy`,60096),closeAll:N(`close-all`,60097),cloudDownload:N(`cloud-download`,60098),cloudUpload:N(`cloud-upload`,60099),code:N(`code`,60100),collapseAll:N(`collapse-all`,60101),colorMode:N(`color-mode`,60102),commentDiscussion:N(`comment-discussion`,60103),creditCard:N(`credit-card`,60105),dash:N(`dash`,60108),dashboard:N(`dashboard`,60109),database:N(`database`,60110),debugContinue:N(`debug-continue`,60111),debugDisconnect:N(`debug-disconnect`,60112),debugPause:N(`debug-pause`,60113),debugRestart:N(`debug-restart`,60114),debugStart:N(`debug-start`,60115),debugStepInto:N(`debug-step-into`,60116),debugStepOut:N(`debug-step-out`,60117),debugStepOver:N(`debug-step-over`,60118),debugStop:N(`debug-stop`,60119),debug:N(`debug`,60120),deviceCameraVideo:N(`device-camera-video`,60121),deviceCamera:N(`device-camera`,60122),deviceMobile:N(`device-mobile`,60123),diffAdded:N(`diff-added`,60124),diffIgnored:N(`diff-ignored`,60125),diffModified:N(`diff-modified`,60126),diffRemoved:N(`diff-removed`,60127),diffRenamed:N(`diff-renamed`,60128),diff:N(`diff`,60129),diffSidebyside:N(`diff-sidebyside`,60129),discard:N(`discard`,60130),editorLayout:N(`editor-layout`,60131),emptyWindow:N(`empty-window`,60132),exclude:N(`exclude`,60133),extensions:N(`extensions`,60134),eyeClosed:N(`eye-closed`,60135),fileBinary:N(`file-binary`,60136),fileCode:N(`file-code`,60137),fileMedia:N(`file-media`,60138),filePdf:N(`file-pdf`,60139),fileSubmodule:N(`file-submodule`,60140),fileSymlinkDirectory:N(`file-symlink-directory`,60141),fileSymlinkFile:N(`file-symlink-file`,60142),fileZip:N(`file-zip`,60143),files:N(`files`,60144),filter:N(`filter`,60145),flame:N(`flame`,60146),foldDown:N(`fold-down`,60147),foldUp:N(`fold-up`,60148),fold:N(`fold`,60149),folderActive:N(`folder-active`,60150),folderOpened:N(`folder-opened`,60151),gear:N(`gear`,60152),gift:N(`gift`,60153),gistSecret:N(`gist-secret`,60154),gist:N(`gist`,60155),gitCommit:N(`git-commit`,60156),gitCompare:N(`git-compare`,60157),compareChanges:N(`compare-changes`,60157),gitMerge:N(`git-merge`,60158),githubAction:N(`github-action`,60159),githubAlt:N(`github-alt`,60160),globe:N(`globe`,60161),grabber:N(`grabber`,60162),graph:N(`graph`,60163),gripper:N(`gripper`,60164),heart:N(`heart`,60165),home:N(`home`,60166),horizontalRule:N(`horizontal-rule`,60167),hubot:N(`hubot`,60168),inbox:N(`inbox`,60169),issueReopened:N(`issue-reopened`,60171),issues:N(`issues`,60172),italic:N(`italic`,60173),jersey:N(`jersey`,60174),json:N(`json`,60175),bracket:N(`bracket`,60175),kebabVertical:N(`kebab-vertical`,60176),key:N(`key`,60177),law:N(`law`,60178),lightbulbAutofix:N(`lightbulb-autofix`,60179),linkExternal:N(`link-external`,60180),link:N(`link`,60181),listOrdered:N(`list-ordered`,60182),listUnordered:N(`list-unordered`,60183),liveShare:N(`live-share`,60184),loading:N(`loading`,60185),location:N(`location`,60186),mailRead:N(`mail-read`,60187),mail:N(`mail`,60188),markdown:N(`markdown`,60189),megaphone:N(`megaphone`,60190),mention:N(`mention`,60191),milestone:N(`milestone`,60192),gitPullRequestMilestone:N(`git-pull-request-milestone`,60192),mortarBoard:N(`mortar-board`,60193),move:N(`move`,60194),multipleWindows:N(`multiple-windows`,60195),mute:N(`mute`,60196),noNewline:N(`no-newline`,60197),note:N(`note`,60198),octoface:N(`octoface`,60199),openPreview:N(`open-preview`,60200),package:N(`package`,60201),paintcan:N(`paintcan`,60202),pin:N(`pin`,60203),play:N(`play`,60204),run:N(`run`,60204),plug:N(`plug`,60205),preserveCase:N(`preserve-case`,60206),preview:N(`preview`,60207),project:N(`project`,60208),pulse:N(`pulse`,60209),question:N(`question`,60210),quote:N(`quote`,60211),radioTower:N(`radio-tower`,60212),reactions:N(`reactions`,60213),references:N(`references`,60214),refresh:N(`refresh`,60215),regex:N(`regex`,60216),remoteExplorer:N(`remote-explorer`,60217),remote:N(`remote`,60218),remove:N(`remove`,60219),replaceAll:N(`replace-all`,60220),replace:N(`replace`,60221),repoClone:N(`repo-clone`,60222),repoForcePush:N(`repo-force-push`,60223),repoPull:N(`repo-pull`,60224),repoPush:N(`repo-push`,60225),report:N(`report`,60226),requestChanges:N(`request-changes`,60227),rocket:N(`rocket`,60228),rootFolderOpened:N(`root-folder-opened`,60229),rootFolder:N(`root-folder`,60230),rss:N(`rss`,60231),ruby:N(`ruby`,60232),saveAll:N(`save-all`,60233),saveAs:N(`save-as`,60234),save:N(`save`,60235),screenFull:N(`screen-full`,60236),screenNormal:N(`screen-normal`,60237),searchStop:N(`search-stop`,60238),server:N(`server`,60240),settingsGear:N(`settings-gear`,60241),settings:N(`settings`,60242),shield:N(`shield`,60243),smiley:N(`smiley`,60244),sortPrecedence:N(`sort-precedence`,60245),splitHorizontal:N(`split-horizontal`,60246),splitVertical:N(`split-vertical`,60247),squirrel:N(`squirrel`,60248),starFull:N(`star-full`,60249),starHalf:N(`star-half`,60250),symbolClass:N(`symbol-class`,60251),symbolColor:N(`symbol-color`,60252),symbolConstant:N(`symbol-constant`,60253),symbolEnumMember:N(`symbol-enum-member`,60254),symbolField:N(`symbol-field`,60255),symbolFile:N(`symbol-file`,60256),symbolInterface:N(`symbol-interface`,60257),symbolKeyword:N(`symbol-keyword`,60258),symbolMisc:N(`symbol-misc`,60259),symbolOperator:N(`symbol-operator`,60260),symbolProperty:N(`symbol-property`,60261),wrench:N(`wrench`,60261),wrenchSubaction:N(`wrench-subaction`,60261),symbolSnippet:N(`symbol-snippet`,60262),tasklist:N(`tasklist`,60263),telescope:N(`telescope`,60264),textSize:N(`text-size`,60265),threeBars:N(`three-bars`,60266),thumbsdown:N(`thumbsdown`,60267),thumbsup:N(`thumbsup`,60268),tools:N(`tools`,60269),triangleDown:N(`triangle-down`,60270),triangleLeft:N(`triangle-left`,60271),triangleRight:N(`triangle-right`,60272),triangleUp:N(`triangle-up`,60273),twitter:N(`twitter`,60274),unfold:N(`unfold`,60275),unlock:N(`unlock`,60276),unmute:N(`unmute`,60277),unverified:N(`unverified`,60278),verified:N(`verified`,60279),versions:N(`versions`,60280),vmActive:N(`vm-active`,60281),vmOutline:N(`vm-outline`,60282),vmRunning:N(`vm-running`,60283),watch:N(`watch`,60284),whitespace:N(`whitespace`,60285),wholeWord:N(`whole-word`,60286),window:N(`window`,60287),wordWrap:N(`word-wrap`,60288),zoomIn:N(`zoom-in`,60289),zoomOut:N(`zoom-out`,60290),listFilter:N(`list-filter`,60291),listFlat:N(`list-flat`,60292),listSelection:N(`list-selection`,60293),selection:N(`selection`,60293),listTree:N(`list-tree`,60294),debugBreakpointFunctionUnverified:N(`debug-breakpoint-function-unverified`,60295),debugBreakpointFunction:N(`debug-breakpoint-function`,60296),debugBreakpointFunctionDisabled:N(`debug-breakpoint-function-disabled`,60296),debugStackframeActive:N(`debug-stackframe-active`,60297),circleSmallFilled:N(`circle-small-filled`,60298),debugStackframeDot:N(`debug-stackframe-dot`,60298),terminalDecorationMark:N(`terminal-decoration-mark`,60298),debugStackframe:N(`debug-stackframe`,60299),debugStackframeFocused:N(`debug-stackframe-focused`,60299),debugBreakpointUnsupported:N(`debug-breakpoint-unsupported`,60300),symbolString:N(`symbol-string`,60301),debugReverseContinue:N(`debug-reverse-continue`,60302),debugStepBack:N(`debug-step-back`,60303),debugRestartFrame:N(`debug-restart-frame`,60304),debugAlt:N(`debug-alt`,60305),callIncoming:N(`call-incoming`,60306),callOutgoing:N(`call-outgoing`,60307),menu:N(`menu`,60308),expandAll:N(`expand-all`,60309),feedback:N(`feedback`,60310),gitPullRequestReviewer:N(`git-pull-request-reviewer`,60310),groupByRefType:N(`group-by-ref-type`,60311),ungroupByRefType:N(`ungroup-by-ref-type`,60312),account:N(`account`,60313),gitPullRequestAssignee:N(`git-pull-request-assignee`,60313),bellDot:N(`bell-dot`,60314),debugConsole:N(`debug-console`,60315),library:N(`library`,60316),output:N(`output`,60317),runAll:N(`run-all`,60318),syncIgnored:N(`sync-ignored`,60319),pinned:N(`pinned`,60320),githubInverted:N(`github-inverted`,60321),serverProcess:N(`server-process`,60322),serverEnvironment:N(`server-environment`,60323),pass:N(`pass`,60324),issueClosed:N(`issue-closed`,60324),stopCircle:N(`stop-circle`,60325),playCircle:N(`play-circle`,60326),record:N(`record`,60327),debugAltSmall:N(`debug-alt-small`,60328),vmConnect:N(`vm-connect`,60329),cloud:N(`cloud`,60330),merge:N(`merge`,60331),export:N(`export`,60332),graphLeft:N(`graph-left`,60333),magnet:N(`magnet`,60334),notebook:N(`notebook`,60335),redo:N(`redo`,60336),checkAll:N(`check-all`,60337),pinnedDirty:N(`pinned-dirty`,60338),passFilled:N(`pass-filled`,60339),circleLargeFilled:N(`circle-large-filled`,60340),circleLarge:N(`circle-large`,60341),circleLargeOutline:N(`circle-large-outline`,60341),combine:N(`combine`,60342),gather:N(`gather`,60342),table:N(`table`,60343),variableGroup:N(`variable-group`,60344),typeHierarchy:N(`type-hierarchy`,60345),typeHierarchySub:N(`type-hierarchy-sub`,60346),typeHierarchySuper:N(`type-hierarchy-super`,60347),gitPullRequestCreate:N(`git-pull-request-create`,60348),runAbove:N(`run-above`,60349),runBelow:N(`run-below`,60350),notebookTemplate:N(`notebook-template`,60351),debugRerun:N(`debug-rerun`,60352),workspaceTrusted:N(`workspace-trusted`,60353),workspaceUntrusted:N(`workspace-untrusted`,60354),workspaceUnknown:N(`workspace-unknown`,60355),terminalCmd:N(`terminal-cmd`,60356),terminalDebian:N(`terminal-debian`,60357),terminalLinux:N(`terminal-linux`,60358),terminalPowershell:N(`terminal-powershell`,60359),terminalTmux:N(`terminal-tmux`,60360),terminalUbuntu:N(`terminal-ubuntu`,60361),terminalBash:N(`terminal-bash`,60362),arrowSwap:N(`arrow-swap`,60363),copy:N(`copy`,60364),personAdd:N(`person-add`,60365),filterFilled:N(`filter-filled`,60366),wand:N(`wand`,60367),debugLineByLine:N(`debug-line-by-line`,60368),inspect:N(`inspect`,60369),layers:N(`layers`,60370),layersDot:N(`layers-dot`,60371),layersActive:N(`layers-active`,60372),compass:N(`compass`,60373),compassDot:N(`compass-dot`,60374),compassActive:N(`compass-active`,60375),azure:N(`azure`,60376),issueDraft:N(`issue-draft`,60377),gitPullRequestClosed:N(`git-pull-request-closed`,60378),gitPullRequestDraft:N(`git-pull-request-draft`,60379),debugAll:N(`debug-all`,60380),debugCoverage:N(`debug-coverage`,60381),runErrors:N(`run-errors`,60382),folderLibrary:N(`folder-library`,60383),debugContinueSmall:N(`debug-continue-small`,60384),beakerStop:N(`beaker-stop`,60385),graphLine:N(`graph-line`,60386),graphScatter:N(`graph-scatter`,60387),pieChart:N(`pie-chart`,60388),bracketDot:N(`bracket-dot`,60389),bracketError:N(`bracket-error`,60390),lockSmall:N(`lock-small`,60391),azureDevops:N(`azure-devops`,60392),verifiedFilled:N(`verified-filled`,60393),newline:N(`newline`,60394),layout:N(`layout`,60395),layoutActivitybarLeft:N(`layout-activitybar-left`,60396),layoutActivitybarRight:N(`layout-activitybar-right`,60397),layoutPanelLeft:N(`layout-panel-left`,60398),layoutPanelCenter:N(`layout-panel-center`,60399),layoutPanelJustify:N(`layout-panel-justify`,60400),layoutPanelRight:N(`layout-panel-right`,60401),layoutPanel:N(`layout-panel`,60402),layoutSidebarLeft:N(`layout-sidebar-left`,60403),layoutSidebarRight:N(`layout-sidebar-right`,60404),layoutStatusbar:N(`layout-statusbar`,60405),layoutMenubar:N(`layout-menubar`,60406),layoutCentered:N(`layout-centered`,60407),target:N(`target`,60408),indent:N(`indent`,60409),recordSmall:N(`record-small`,60410),errorSmall:N(`error-small`,60411),terminalDecorationError:N(`terminal-decoration-error`,60411),arrowCircleDown:N(`arrow-circle-down`,60412),arrowCircleLeft:N(`arrow-circle-left`,60413),arrowCircleRight:N(`arrow-circle-right`,60414),arrowCircleUp:N(`arrow-circle-up`,60415),layoutSidebarRightOff:N(`layout-sidebar-right-off`,60416),layoutPanelOff:N(`layout-panel-off`,60417),layoutSidebarLeftOff:N(`layout-sidebar-left-off`,60418),blank:N(`blank`,60419),heartFilled:N(`heart-filled`,60420),map:N(`map`,60421),mapHorizontal:N(`map-horizontal`,60421),foldHorizontal:N(`fold-horizontal`,60421),mapFilled:N(`map-filled`,60422),mapHorizontalFilled:N(`map-horizontal-filled`,60422),foldHorizontalFilled:N(`fold-horizontal-filled`,60422),circleSmall:N(`circle-small`,60423),bellSlash:N(`bell-slash`,60424),bellSlashDot:N(`bell-slash-dot`,60425),commentUnresolved:N(`comment-unresolved`,60426),gitPullRequestGoToChanges:N(`git-pull-request-go-to-changes`,60427),gitPullRequestNewChanges:N(`git-pull-request-new-changes`,60428),searchFuzzy:N(`search-fuzzy`,60429),commentDraft:N(`comment-draft`,60430),send:N(`send`,60431),sparkle:N(`sparkle`,60432),insert:N(`insert`,60433),mic:N(`mic`,60434),thumbsdownFilled:N(`thumbsdown-filled`,60435),thumbsupFilled:N(`thumbsup-filled`,60436),coffee:N(`coffee`,60437),snake:N(`snake`,60438),game:N(`game`,60439),vr:N(`vr`,60440),chip:N(`chip`,60441),piano:N(`piano`,60442),music:N(`music`,60443),micFilled:N(`mic-filled`,60444),repoFetch:N(`repo-fetch`,60445),copilot:N(`copilot`,60446),lightbulbSparkle:N(`lightbulb-sparkle`,60447),robot:N(`robot`,60448),sparkleFilled:N(`sparkle-filled`,60449),diffSingle:N(`diff-single`,60450),diffMultiple:N(`diff-multiple`,60451),surroundWith:N(`surround-with`,60452),share:N(`share`,60453),gitStash:N(`git-stash`,60454),gitStashApply:N(`git-stash-apply`,60455),gitStashPop:N(`git-stash-pop`,60456),vscode:N(`vscode`,60457),vscodeInsiders:N(`vscode-insiders`,60458),codeOss:N(`code-oss`,60459),runCoverage:N(`run-coverage`,60460),runAllCoverage:N(`run-all-coverage`,60461),coverage:N(`coverage`,60462),githubProject:N(`github-project`,60463),mapVertical:N(`map-vertical`,60464),foldVertical:N(`fold-vertical`,60464),mapVerticalFilled:N(`map-vertical-filled`,60465),foldVerticalFilled:N(`fold-vertical-filled`,60465),goToSearch:N(`go-to-search`,60466),percentage:N(`percentage`,60467),sortPercentage:N(`sort-percentage`,60467),attach:N(`attach`,60468),goToEditingSession:N(`go-to-editing-session`,60469),editSession:N(`edit-session`,60470),codeReview:N(`code-review`,60471),copilotWarning:N(`copilot-warning`,60472),python:N(`python`,60473),copilotLarge:N(`copilot-large`,60474),copilotWarningLarge:N(`copilot-warning-large`,60475),keyboardTab:N(`keyboard-tab`,60476),copilotBlocked:N(`copilot-blocked`,60477),copilotNotConnected:N(`copilot-not-connected`,60478),flag:N(`flag`,60479),lightbulbEmpty:N(`lightbulb-empty`,60480),symbolMethodArrow:N(`symbol-method-arrow`,60481),copilotUnavailable:N(`copilot-unavailable`,60482),repoPinned:N(`repo-pinned`,60483),keyboardTabAbove:N(`keyboard-tab-above`,60484),keyboardTabBelow:N(`keyboard-tab-below`,60485),gitPullRequestDone:N(`git-pull-request-done`,60486),mcp:N(`mcp`,60487),extensionsLarge:N(`extensions-large`,60488),layoutPanelDock:N(`layout-panel-dock`,60489),layoutSidebarLeftDock:N(`layout-sidebar-left-dock`,60490),layoutSidebarRightDock:N(`layout-sidebar-right-dock`,60491),copilotInProgress:N(`copilot-in-progress`,60492),copilotError:N(`copilot-error`,60493),copilotSuccess:N(`copilot-success`,60494),chatSparkle:N(`chat-sparkle`,60495),searchSparkle:N(`search-sparkle`,60496),editSparkle:N(`edit-sparkle`,60497),copilotSnooze:N(`copilot-snooze`,60498),sendToRemoteAgent:N(`send-to-remote-agent`,60499),commentDiscussionSparkle:N(`comment-discussion-sparkle`,60500),chatSparkleWarning:N(`chat-sparkle-warning`,60501),chatSparkleError:N(`chat-sparkle-error`,60502),collection:N(`collection`,60503),newCollection:N(`new-collection`,60504),thinking:N(`thinking`,60505),build:N(`build`,60506),commentDiscussionQuote:N(`comment-discussion-quote`,60507),cursor:N(`cursor`,60508),eraser:N(`eraser`,60509),fileText:N(`file-text`,60510),quotes:N(`quotes`,60512),rename:N(`rename`,60513),runWithDeps:N(`run-with-deps`,60514),debugConnected:N(`debug-connected`,60515),strikethrough:N(`strikethrough`,60516),openInProduct:N(`open-in-product`,60517),indexZero:N(`index-zero`,60518),agent:N(`agent`,60519),editCode:N(`edit-code`,60520),repoSelected:N(`repo-selected`,60521),skip:N(`skip`,60522),mergeInto:N(`merge-into`,60523),gitBranchChanges:N(`git-branch-changes`,60524),gitBranchStagedChanges:N(`git-branch-staged-changes`,60525),gitBranchConflicts:N(`git-branch-conflicts`,60526),gitBranch:N(`git-branch`,60527),gitBranchCreate:N(`git-branch-create`,60527),gitBranchDelete:N(`git-branch-delete`,60527),searchLarge:N(`search-large`,60528),terminalGitBash:N(`terminal-git-bash`,60529),windowActive:N(`window-active`,60530),forward:N(`forward`,60531),download:N(`download`,60532),clockface:N(`clockface`,60533),unarchive:N(`unarchive`,60534),sessionInProgress:N(`session-in-progress`,60535),collectionSmall:N(`collection-small`,60536),vmSmall:N(`vm-small`,60537),cloudSmall:N(`cloud-small`,60538),addSmall:N(`add-small`,60539),removeSmall:N(`remove-small`,60540),worktreeSmall:N(`worktree-small`,60541),worktree:N(`worktree`,60542),screenCut:N(`screen-cut`,60543),ask:N(`ask`,60544),openai:N(`openai`,60545),claude:N(`claude`,60546),openInWindow:N(`open-in-window`,60547),newSession:N(`new-session`,60548),terminalSecure:N(`terminal-secure`,60549),chatImport:N(`chat-import`,60550),chatExport:N(`chat-export`,60551),shareWindow:N(`share-window`,60552),circleSlashCompact:N(`circle-slash-compact`,60553),copilotCompact:N(`copilot-compact`,60554),folderOpenedCompact:N(`folder-opened-compact`,60555),folderCompact:N(`folder-compact`,60556),gearCompact:N(`gear-compact`,60557),gitBranchCompact:N(`git-branch-compact`,60558),libraryCompact:N(`library-compact`,60559),recordKeysCompact:N(`record-keys-compact`,60560),remoteCompact:N(`remote-compact`,60561),repoForkedCompact:N(`repo-forked-compact`,60562),repoCompact:N(`repo-compact`,60563),shieldCompact:N(`shield-compact`,60564),sparkleCompact:N(`sparkle-compact`,60565),symbolColorCompact:N(`symbol-color-compact`,60566),windowCompact:N(`window-compact`,60567),errorCompact:N(`error-compact`,60568),warningCompact:N(`warning-compact`,60569),passCompact:N(`pass-compact`,60570),important:N(`important`,60571),importantCompact:N(`important-compact`,60572),rocketCompact:N(`rocket-compact`,60573),unpin:N(`unpin`,60574),addCompact:N(`add-compact`,60575),attachCompact:N(`attach-compact`,60576),beakerCompact:N(`beaker-compact`,60577),checkCompact:N(`check-compact`,60578),checklistCompact:N(`checklist-compact`,60579),chevronDownCompact:N(`chevron-down-compact`,60580),chevronLeftCompact:N(`chevron-left-compact`,60581),chevronRightCompact:N(`chevron-right-compact`,60582),chevronUpCompact:N(`chevron-up-compact`,60583),circleFilledCompact:N(`circle-filled-compact`,60584),circleSmallFilledCompact:N(`circle-small-filled-compact`,60585),closeCompact:N(`close-compact`,60586),collapseAllCompact:N(`collapse-all-compact`,60587),commentCompact:N(`comment-compact`,60588),commentUnresolvedCompact:N(`comment-unresolved-compact`,60589),debugConnectedCompact:N(`debug-connected-compact`,60590),debugDisconnectCompact:N(`debug-disconnect-compact`,60591),editCompact:N(`edit-compact`,60592),fileMediaCompact:N(`file-media-compact`,60593),gitFetch:N(`git-fetch`,60594),lightbulbCompact:N(`lightbulb-compact`,60595),loadingCompact:N(`loading-compact`,60596),passFilledCompact:N(`pass-filled-compact`,60597),projectCompact:N(`project-compact`,60598),refreshCompact:N(`refresh-compact`,60599),searchCompact:N(`search-compact`,60600),sessionInProgressCompact:N(`session-in-progress-compact`,60601),syncCompact:N(`sync-compact`,60602),terminalCompact:N(`terminal-compact`,60603),vmPending:N(`vm-pending`,60604),worktreeCompact:N(`worktree-compact`,60605),developerTools:N(`developer-tools`,60606),cloudCompact:N(`cloud-compact`,60607),agentCompact:N(`agent-compact`,60608),askCompact:N(`ask-compact`,60609),settingsCompact:N(`settings-compact`,60610),vmCompact:N(`vm-compact`,60611)},ul={dialogError:N(`dialog-error`,`error`),dialogWarning:N(`dialog-warning`,`warning`),dialogInfo:N(`dialog-info`,`info`),dialogClose:N(`dialog-close`,`close`),treeItemExpanded:N(`tree-item-expanded`,`chevron-down`),treeFilterOnTypeOn:N(`tree-filter-on-type-on`,`list-filter`),treeFilterOnTypeOff:N(`tree-filter-on-type-off`,`list-selection`),treeFilterClear:N(`tree-filter-clear`,`close`),treeItemLoading:N(`tree-item-loading`,`loading`),menuSelection:N(`menu-selection`,`check`),menuSubmenu:N(`menu-submenu`,`chevron-right`),menuBarMore:N(`menubar-more`,`more`),scrollbarButtonLeft:N(`scrollbar-button-left`,`triangle-left`),scrollbarButtonRight:N(`scrollbar-button-right`,`triangle-right`),scrollbarButtonUp:N(`scrollbar-button-up`,`triangle-up`),scrollbarButtonDown:N(`scrollbar-button-down`,`triangle-down`),toolBarMore:N(`toolbar-more`,`more`),quickInputBack:N(`quick-input-back`,`arrow-left`),dropDownButton:N(`drop-down-button`,60084),symbolCustomColor:N(`symbol-customcolor`,60252),exportIcon:N(`export`,60332),workspaceUnspecified:N(`workspace-unspecified`,60355),newLine:N(`newline`,60394),thumbsDownFilled:N(`thumbsdown-filled`,60435),thumbsUpFilled:N(`thumbsup-filled`,60436),gitFetch:N(`git-fetch`,60445),lightbulbSparkleAutofix:N(`lightbulb-sparkle-autofix`,60447),debugBreakpointPending:N(`debug-breakpoint-pending`,60377),chatImport:N(`chat-import`,60550),chatExport:N(`chat-export`,60551)},P={...ll,...ul};var dl;(function(e){function t(e){return!!e&&typeof e==`object`&&typeof e.id==`string`}e.isThemeColor=t})(dl||={});var fl;(function(e){e.iconNameSegment=`[A-Za-z0-9]+`,e.iconNameExpression=`[A-Za-z0-9-]+`,e.iconModifierExpression=`~[A-Za-z]+`,e.iconNameCharacter=`[A-Za-z0-9~-]`;let t=RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function n(e){let r=t.exec(e.id);if(!r)return n(P.error);let[,i,a]=r,o=[`codicon`,`codicon-`+i];return a&&o.push(`codicon-modifier-`+a.substring(1)),o}e.asClassNameArray=n;function r(e){return n(e).join(` `)}e.asClassName=r;function i(e){return`.`+n(e).join(`.`)}e.asCSSSelector=i;function a(e){return!!e&&typeof e==`object`&&typeof e.id==`string`&&(e.color===void 0||dl.isThemeColor(e.color))}e.isThemeIcon=a;let o=RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);function s(e){let t=o.exec(e);if(!t)return;let[,n]=t;return{id:n}}e.fromString=s;function c(e){return{id:e}}e.fromId=c;function l(e,t){let n=e.id,r=n.lastIndexOf(`~`);return r!==-1&&(n=n.substring(0,r)),t&&(n=`${n}~${t}`),{id:n}}e.modify=l;function u(e){let t=e.id.lastIndexOf(`~`);if(t!==-1)return e.id.substring(t+1)}e.getModifier=u;function d(e,t){return e.id===t.id&&e.color?.id===t.color?.id}e.isEqual=d;function f(e){return e?.id===P.file.id}e.isFile=f;function p(e){return e?.id===P.folder.id}e.isFolder=p})(fl||={});const pl=RegExp(`\\$\\(${fl.iconNameExpression}(?:${fl.iconModifierExpression})?\\)`,`g`),ml=RegExp(`(\\\\)?${pl.source}`,`g`);function hl(e){return e.replace(ml,(e,t)=>t?e:`\\${e}`)}RegExp(`\\\\${pl.source}`,`g`),RegExp(`(\\s)?(\\\\)?${pl.source}(\\s)?`,`g`),RegExp(`\\$\\(${fl.iconNameCharacter}+\\)`,`g`);var gl;(function(e){e[e.Paragraph=0]=`Paragraph`,e[e.Break=1]=`Break`})(gl||={});var _l=class e{static lift(t){let n=new e(t.value,t);return n.uris=t.uris,n.baseUri=t.baseUri?w.revive(t.baseUri):void 0,n}constructor(e=``,t=!1){if(this.value=e,typeof this.value!=`string`)throw h(`value`);typeof t==`boolean`?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1,this.supportAlertSyntax=t.supportAlertSyntax??!1)}appendText(e,t=gl.Paragraph){return this.value+=yl(this.supportThemeIcons?hl(e):e).replace(/([ \t]+)/g,(e,t)=>`&nbsp;`.repeat(t.length)).replace(/\>/gm,`\\>`).replace(/\n/g,t===gl.Break?`\\
22
- `:`
23
-
24
- `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`\n${bl(t,e)}\n`,this}appendLink(e,t,n){return this.value+=`[`,this.value+=this._escape(t,`]`),this.value+=`](`,this.value+=this._escape(String(e),`)`),n&&(this.value+=` "${this._escape(this._escape(n,`"`),`)`)}"`),this.value+=`)`,this}_escape(e,t){let n=new RegExp(qi(t),`g`);return e.replace(n,(t,n)=>e.charAt(n-1)===`\\`?t:`\\${t}`)}};function vl(e){return e instanceof _l?!0:e&&typeof e==`object`?typeof e.value==`string`&&(typeof e.isTrusted==`boolean`||typeof e.isTrusted==`object`||e.isTrusted===void 0)&&(typeof e.supportThemeIcons==`boolean`||e.supportThemeIcons===void 0)&&(typeof e.supportAlertSyntax==`boolean`||e.supportAlertSyntax===void 0):!1}function yl(e){return e.replace(/[\\`*_{}[\]()#+!~]/g,`\\$&`).replace(/^([ \t]*)-/gm,`$1\\-`)}function bl(e,t){let n=e.match(/^`+/gm)?.reduce((e,t)=>e.length>t.length?e:t).length??0,r=n>=3?n+1:3;return[`${"`".repeat(r)}${t}`,e,`${"`".repeat(r)}`].join(`
25
- `)}function xl(e){let t=[],n=e.split(`|`).map(e=>e.trim());e=n[0];let r=n[1];if(r){let e=/height=(\d+)/.exec(r),n=/width=(\d+)/.exec(r),i=e?e[1]:``,a=n?n[1]:``,o=isFinite(parseInt(a)),s=isFinite(parseInt(i));o&&t.push(`width="${a}"`),s&&t.push(`height="${i}"`)}return{href:e,dimensions:t}}function Sl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Cl=Sl();function wl(e){Cl=e}const Tl=/[&<>"']/,El=new RegExp(Tl.source,`g`),Dl=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ol=new RegExp(Dl.source,`g`),kl={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Al=e=>kl[e];function jl(e,t){if(t){if(Tl.test(e))return e.replace(El,Al)}else if(Dl.test(e))return e.replace(Ol,Al);return e}const Ml=/(^|[^\[])\^/g;function Nl(e,t){let n=typeof e==`string`?e:e.source;t||=``;let r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Ml,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function Pl(e){try{e=encodeURI(e).replace(/%25/g,`%`)}catch{return null}return e}const Fl={exec:()=>null};function Il(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,`|`);return n}function Ll(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Rl(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function zl(e,t,n,r){let i=t.href,a=t.title?jl(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;let e={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:`image`,raw:n,href:i,title:a,text:jl(o)}}function Bl(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(`
26
- `).map(e=>{let t=e.match(/^\s+/);if(t===null)return e;let[n]=t;return n.length>=r.length?e.slice(r.length):e}).join(`
27
- `)}var Vl=class{options;rules;lexer;constructor(e){this.options=e||Cl}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:Ll(e,`
28
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Bl(e,t[3]||``);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=Ll(e,`#`);(this.options.pedantic||!t||/ $/.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Ll(t[0],`
29
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Ll(t[0],`
30
- `).split(`
31
- `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(/^ {0,3}>/.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
32
- `),c=s.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
33
- $1`).replace(/^ {0,3}>[ \t]?/gm,``);n=n?`${n}\n${s}`:s,r=r?`${r}\n${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i[i.length-1];if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
34
- `+e.join(`
35
- `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
36
- `+e.join(`
37
- `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i[i.length-1].raw.length).split(`
38
- `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
39
- `,1)[0].replace(/^\t+/,e=>` `.repeat(3*e.length)),l=e.split(`
40
- `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(/[^ ]/),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&/^ *$/.test(l)&&(r+=l+`
41
- `,e=e.substring(l.length+1),n=!0),!n){let t=RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),a=RegExp(`^ {0,${Math.min(3,d-1)}}#`);for(;e;){let o=e.split(`
42
- `,1)[0];if(l=o,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g,` `)),i.test(l)||a.test(l)||t.test(l)||n.test(e))break;if(l.search(/[^ ]/)>=d||!l.trim())s+=`
43
- `+l.slice(d);else{if(u||c.search(/[^ ]/)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
44
- `+l}!u&&!l.trim()&&(u=!0),r+=o+`
45
- `,e=e.substring(o.length+1),c=l.slice(d)}}i.loose||(o?i.loose=!0:/\n *\n *$/.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=/^\[[ xX]\] /.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(/^\[[ xX]\] +/,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(/\s+/g,` `),n=t[2]?t[2].replace(/^<(.*)>$/,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let n=Il(t[1]),r=t[2].replace(/^\||\| *$/g,``).split(`|`),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,``).split(`
46
- `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)/^ *-+: *$/.test(e)?a.align.push(`right`):/^ *:-+: *$/.test(e)?a.align.push(`center`):/^ *:-+ *$/.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Il(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
47
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:jl(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let t=Ll(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Rl(t[2],`()`);if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),zl(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(/\s+/g,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return zl(n,e,n[0],this.lexer)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(/[\p{L}\p{N}]/u))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g,` `),n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=jl(e,!0),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=jl(t[1]),n=`mailto:`+e):(e=jl(t[1]),n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=jl(t[0]),n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=jl(t[0]),n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:jl(t[0]),{type:`text`,raw:t[0],text:e}}}};const Hl=/^(?: *(?:\n|$))+/,Ul=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Wl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Gl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Kl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ql=/(?:[*+-]|\d{1,9}[.)])/,Jl=Nl(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ql).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Yl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xl=/^[^\n]+/,Zl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ql=Nl(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace(`label`,Zl).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$l=Nl(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ql).getRegex(),eu=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,tu=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,nu=Nl(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))`,`i`).replace(`comment`,tu).replace(`tag`,eu).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ru=Nl(Yl).replace(`hr`,Gl).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,eu).getRegex(),iu={blockquote:Nl(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ru).getRegex(),code:Ul,def:Ql,fences:Wl,heading:Kl,hr:Gl,html:nu,lheading:Jl,list:$l,newline:Hl,paragraph:ru,table:Fl,text:Xl},au=Nl(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Gl).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,` {4}[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,eu).getRegex(),ou={...iu,table:au,paragraph:Nl(Yl).replace(`hr`,Gl).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,au).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,eu).getRegex()},su={...iu,html:Nl(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,tu).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Fl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Nl(Yl).replace(`hr`,Gl).replace(`heading`,` *#{1,6} *[^
48
- ]`).replace(`lheading`,Jl).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},cu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,uu=/^( {2,}|\\)\n(?!\s*$)/,du=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fu=`\\p{P}\\p{S}`,pu=Nl(/^((?![*_])[\spunctuation])/,`u`).replace(/punctuation/g,fu).getRegex(),mu=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,hu=Nl(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,`u`).replace(/punct/g,fu).getRegex(),gu=Nl(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])`,`gu`).replace(/punct/g,fu).getRegex(),_u=Nl(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])`,`gu`).replace(/punct/g,fu).getRegex(),vu=Nl(/\\([punct])/,`gu`).replace(/punct/g,fu).getRegex(),yu=Nl(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bu=Nl(tu).replace(`(?:-->|$)`,`-->`).getRegex(),xu=Nl(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,bu).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Su=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Cu=Nl(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace(`label`,Su).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wu=Nl(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Su).replace(`ref`,Zl).getRegex(),Tu=Nl(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Zl).getRegex(),Eu={_backpedal:Fl,anyPunctuation:vu,autolink:yu,blockSkip:mu,br:uu,code:lu,del:Fl,emStrongLDelim:hu,emStrongRDelimAst:gu,emStrongRDelimUnd:_u,escape:cu,link:Cu,nolink:Tu,punctuation:pu,reflink:wu,reflinkSearch:Nl(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,wu).replace(`nolink`,Tu).getRegex(),tag:xu,text:du,url:Fl},Du={...Eu,link:Nl(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Su).getRegex(),reflink:Nl(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Su).getRegex()},Ou={...Eu,escape:Nl(cu).replace(`])`,`~|])`).getRegex(),url:Nl(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ku={...Ou,br:Nl(uu).replace(`{2,}`,`*`).getRegex(),text:Nl(Ou.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Au={normal:iu,gfm:ou,pedantic:su},ju={normal:Eu,gfm:Ou,breaks:ku,pedantic:Du};var Mu=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Cl,this.options.tokenizer=this.options.tokenizer||new Vl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:Au.normal,inline:ju.normal};this.options.pedantic?(t.block=Au.pedantic,t.inline=ju.pedantic):this.options.gfm&&(t.block=Au.gfm,this.options.breaks?t.inline=ju.breaks:t.inline=ju.gfm),this.tokenizer.rules=t}static get rules(){return{block:Au,inline:ju}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(/\r\n|\r/g,`
49
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){e=this.options.pedantic?e.replace(/\t/g,` `).replace(/^ +$/gm,``):e.replace(/^( *)(\t+)/gm,(e,t,n)=>t+` `.repeat(n.length));let r,i,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&t.length>0?t[t.length-1].raw+=`
50
- `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
51
- `+r.raw,i.text+=`
52
- `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
53
- `+r.raw,i.text+=`
54
- `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(a=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){i=t[t.length-1],n&&i?.type===`paragraph`?(i.raw+=`
55
- `+r.raw,i.text+=`
56
- `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r),n=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&i.type===`text`?(i.raw+=`
57
- `+r.raw,i.text+=`
58
- `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,a=e,o,s,c;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)e.includes(o[0].slice(o[0].lastIndexOf(`[`)+1,-1))&&(a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+`++`+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(c=``),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,a,c)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),n.raw.slice(-1)!==`_`&&(c=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},Nu=class{options;parser;constructor(e){this.options=e||Cl}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(/^\S*/)?.[0],i=e.replace(/\n$/,``)+`
59
- `;return r?`<pre><code class="language-`+jl(r)+`">`+(n?i:jl(i,!0))+`</code></pre>
60
- `:`<pre><code>`+(n?i:jl(i,!0))+`</code></pre>
61
- `}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>
62
- `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
63
- `+r+`</`+i+`>
64
- `}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
65
- <thead>
66
- `+t+`</thead>
67
- `+r+`</table>
68
- `}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Pl(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+t+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n}){let r=Pl(e);if(r===null)return n;e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=`>`,i}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}},Pu=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},Fu=class e{options;renderer;textRenderer;constructor(e){this.options=e||Cl,this.options.renderer=this.options.renderer||new Nu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Pu}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
69
- `+this.renderer.text(i);t?n+=this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o}]}):n+=o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t){t||=this.renderer;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Iu=class{options;constructor(e){this.options=e||Cl}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}};const Lu=new class{defaults=Sl();options=this.setOptions;parse=this.parseMarkdown(Mu.lex,Fu.parse);parseInline=this.parseMarkdown(Mu.lexInline,Fu.parseInline);Parser=Fu;Renderer=Nu;TextRenderer=Pu;Lexer=Mu;Tokenizer=Vl;Hooks=Iu;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Nu(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Vl(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Iu;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if(n===`options`)continue;let r=n,i=e.hooks[r],a=t[r];Iu.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Mu.lex(e,t??this.defaults)}parser(e,t){return Fu.parse(e,t??this.defaults)}parseMarkdown(e,t){return(n,r)=>{let i={...r},a={...this.defaults,...i},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return o(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(n==null)return o(Error(`marked(): input parameter is undefined or null`));if(typeof n!=`string`)return o(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(n)+`, string expected`));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(t=>e(t,a)).then(e=>a.hooks?a.hooks.processAllTokens(e):e).then(e=>a.walkTokens?Promise.all(this.walkTokens(e,a.walkTokens)).then(()=>e):e).then(e=>t(e,a)).then(e=>a.hooks?a.hooks.postprocess(e):e).catch(o);try{a.hooks&&(n=a.hooks.preprocess(n));let r=e(n,a);a.hooks&&(r=a.hooks.processAllTokens(r)),a.walkTokens&&this.walkTokens(r,a.walkTokens);let i=t(r,a);return a.hooks&&(i=a.hooks.postprocess(i)),i}catch(e){return o(e)}}}onError(e,t){return n=>{if(n.message+=`
70
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+jl(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Ru(e,t){return Lu.parse(e,t)}Ru.options=Ru.setOptions=function(e){return Lu.setOptions(e),Ru.defaults=Lu.defaults,wl(Ru.defaults),Ru},Ru.getDefaults=Sl,Ru.defaults=Cl,Ru.use=function(...e){return Lu.use(...e),Ru.defaults=Lu.defaults,wl(Ru.defaults),Ru},Ru.walkTokens=function(e,t){return Lu.walkTokens(e,t)},Ru.parseInline=Lu.parseInline,Ru.Parser=Fu,Ru.parser=Fu.parse,Ru.Renderer=Nu,Ru.TextRenderer=Pu,Ru.Lexer=Mu,Ru.lexer=Mu.lex,Ru.Tokenizer=Vl,Ru.Hooks=Iu,Ru.parse=Ru,Ru.options,Ru.setOptions,Ru.use,Ru.walkTokens,Ru.parseInline,Fu.parse,Mu.lex;function zu(e){return JSON.stringify(e,Vu)}function Bu(e){let t=JSON.parse(e);return t=Hu(t),t}function Vu(e,t){return t instanceof RegExp?{$mid:Er.Regexp,source:t.source,flags:t.flags}:t}function Hu(e,t=0){if(!e||t>200)return e;if(typeof e==`object`){switch(e.$mid){case Er.Uri:return w.revive(e);case Er.Regexp:return new RegExp(e.source,e.flags);case Er.Date:return new Date(e.source)}if(e instanceof b||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let n=0;n<e.length;++n)e[n]=Hu(e[n],t+1);else for(let n in e)Object.hasOwnProperty.call(e,n)&&(e[n]=Hu(e[n],t+1))}return e}const Uu=Object.freeze({text:`text/plain`,binary:`application/octet-stream`,unknown:`application/unknown`,markdown:`text/markdown`,latex:`text/latex`,uriList:`text/uri-list`,html:`text/html`}),Wu=/^(.+)\/(.+?)(;.+)?$/;function Gu(e,t){let n=Wu.exec(e);return n?`${n[1].toLowerCase()}/${n[2].toLowerCase()}${n[3]??``}`:t?void 0:e}function Ku(e){return[`application/vnd.code.notebook.stdout`,`application/vnd.code.notebook.stderr`].includes(e)}const qu=Symbol(`unset`);var Ju=class{constructor(){this.root=new Xu,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||lt.empty()}get entries(){return this.root.children?.entries()||lt.empty()}insert(e,t,n){this.opNode(e,e=>e._value=t,n)}mutate(e,t){this.opNode(e,e=>e._value=t(e._value===qu?void 0:e._value))}mutatePath(e,t){this.opNode(e,()=>{},e=>t(e))}delete(e){let t=this.getPathToKey(e);if(!t)return;let n=t.length-1,r=t[n].node._value;if(r!==qu){for(this._size--,t[n].node._value=qu;n>0;n--){let{node:e,part:r}=t[n];if(e.children?.size||e._value!==qu)break;t[n-1].node.children.delete(r)}return r}}*deleteRecursive(e){let t=this.getPathToKey(e);if(!t)return;let n=t[t.length-1].node;for(let e=t.length-1;e>0;e--){let n=t[e-1];if(n.node.children.delete(t[e].part),n.node.children.size>0||n.node._value!==qu)break}for(let e of Yu(n))e._value!==qu&&(this._size--,yield e._value);n===this.root&&(this.root._value=qu,this.root.children=void 0)}find(e){let t=this.root;for(let n of e){let e=t.children?.get(n);if(!e)return;t=e}return t._value===qu?void 0:t._value}hasKeyOrParent(e){let t=this.root;for(let n of e){let e=t.children?.get(n);if(!e)return!1;if(e._value!==qu)return!0;t=e}return!1}hasKeyOrChildren(e){let t=this.root;for(let n of e){let e=t.children?.get(n);if(!e)return!1;t=e}return!0}hasKey(e){let t=this.root;for(let n of e){let e=t.children?.get(n);if(!e)return!1;t=e}return t._value!==qu}getPathToKey(e){let t=[{part:``,node:this.root}],n=0;for(let r of e){let e=t[n].node.children?.get(r);if(!e)return;t.push({part:r,node:e}),n++}return t}opNode(e,t,n){let r=this.root;for(let t of e){if(!r.children){let e=new Xu;r.children=new Map([[t,e]]),r=e}else if(r.children.has(t))r=r.children.get(t);else{let e=new Xu;r.children.set(t,e),r=e}n?.(r)}let i=r._value===qu?0:1;t(r);let a=r._value===qu?0:1;this._size+=a-i}*values(){for(let{_value:e}of Yu(this.root))e!==qu&&(yield e)}};function*Yu(e){let t=[e];for(;t.length>0;){let e=t.pop();if(yield e,e.children)for(let n of e.children.values())t.push(n)}}var Xu=class{constructor(){this._value=qu}get value(){return this._value===qu?void 0:this._value}set value(e){this._value=e===void 0?qu:e}},Zu;(function(e){e[e.Auto=1]=`Auto`,e[e.Hidden=2]=`Hidden`,e[e.Visible=3]=`Visible`})(Zu||={});const Qu=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new S,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},$u=bn?1.5:1.35;var ed=class e{static _create(t,n,r,i,a,o,s,c,l){o===0?o=$u*r:o<8&&(o*=r),o=Math.round(o),o<8&&(o=8);let u=1+(l?0:Qu.getZoomLevel()*.1);return r*=u,o*=u,a===`translate`&&(n===`normal`||n===`bold`?a=nd:(a=`'wght' ${parseInt(n,10)}`,n=`normal`)),new e({pixelRatio:c,fontFamily:t,fontWeight:n,fontSize:r,fontFeatureSettings:i,fontVariationSettings:a,lineHeight:o,letterSpacing:s})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){let t=rd.fontFamily,n=e._wrapInQuotes(this.fontFamily);return this.fontFamily===t?n:`${n}, ${t}`}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}},td=class extends ed{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=2,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}};const nd=`normal`,rd={fontFamily:bn?`Menlo, Monaco, 'Courier New', monospace`:yn?`Consolas, 'Courier New', monospace`:`'Droid Sans Mono', monospace`,fontWeight:`normal`,fontSize:bn?12:14,lineHeight:0,letterSpacing:0},id={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},ad=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`;function od(e=``){let t=`(-?\\d*\\.\\d\\w*)|([^`;for(let n of ad)e.indexOf(n)>=0||(t+=`\\`+n);return t+=`\\s]+)`,new RegExp(t,`g`)}const sd=od();function cd(e){let t=sd;if(e&&e instanceof RegExp)if(e.global)t=e;else{let n=`g`;e.ignoreCase&&(n+=`i`),e.multiline&&(n+=`m`),e.unicode&&(n+=`u`),t=new RegExp(e.source,n)}return t.lastIndex=0,t}const ld=new Xt;ld.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function ud(e,t,n,r,i){if(t=cd(t),i||=lt.first(ld),n.length>i.maxLen){let a=e-i.maxLen/2;return a<0?a=0:r+=a,n=n.substring(a,e+i.maxLen/2),ud(e,t,n,r,i)}let a=Date.now(),o=e-1-r,s=-1,c=null;for(let e=1;!(Date.now()-a>=i.timeBudget);e++){let r=o-i.windowSize*e;t.lastIndex=Math.max(0,r);let a=dd(t,n,o,s);if(!a&&c||(c=a,r<=0))break;s=r}if(c){let e={word:c[0],startColumn:r+1+c.index,endColumn:r+1+c.index+c[0].length};return t.lastIndex=0,e}return null}function dd(e,t,n,r){let i;for(;i=e.exec(t);){let t=i.index||0;if(t<=n&&e.lastIndex>=n)return i;if(r>0&&t>r)return null}return null}var F;(function(e){e[e.LParen=0]=`LParen`,e[e.RParen=1]=`RParen`,e[e.Neg=2]=`Neg`,e[e.Eq=3]=`Eq`,e[e.NotEq=4]=`NotEq`,e[e.Lt=5]=`Lt`,e[e.LtEq=6]=`LtEq`,e[e.Gt=7]=`Gt`,e[e.GtEq=8]=`GtEq`,e[e.RegexOp=9]=`RegexOp`,e[e.RegexStr=10]=`RegexStr`,e[e.True=11]=`True`,e[e.False=12]=`False`,e[e.In=13]=`In`,e[e.Not=14]=`Not`,e[e.And=15]=`And`,e[e.Or=16]=`Or`,e[e.Str=17]=`Str`,e[e.QuotedStr=18]=`QuotedStr`,e[e.Error=19]=`Error`,e[e.EOF=20]=`EOF`})(F||={});function fd(...e){switch(e.length){case 1:return x(1900,`Did you mean {0}?`,e[0]);case 2:return x(1901,`Did you mean {0} or {1}?`,e[0],e[1]);case 3:return x(1902,`Did you mean {0}, {1} or {2}?`,e[0],e[1],e[2]);default:return}}const pd=x(1903,`Did you forget to open or close the quote?`),md=x(1904,`Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.`);var hd=class e{constructor(){this._input=``,this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case F.LParen:return`(`;case F.RParen:return`)`;case F.Neg:return`!`;case F.Eq:return e.isTripleEq?`===`:`==`;case F.NotEq:return e.isTripleEq?`!==`:`!=`;case F.Lt:return`<`;case F.LtEq:return`<=`;case F.Gt:return`>`;case F.GtEq:return`>=`;case F.RegexOp:return`=~`;case F.RegexStr:return e.lexeme;case F.True:return`true`;case F.False:return`false`;case F.In:return`in`;case F.Not:return`not`;case F.And:return`&&`;case F.Or:return`||`;case F.Str:return e.lexeme;case F.QuotedStr:return e.lexeme;case F.Error:return e.lexeme;case F.EOF:return`EOF`;default:throw ee(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set([`i`,`g`,`s`,`m`,`y`,`u`].map(e=>e.charCodeAt(0)))}static{this._keywords=new Map([[`not`,F.Not],[`in`,F.In],[`false`,F.False],[`true`,F.True]])}get errors(){return this._errors}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case C.OpenParen:this._addToken(F.LParen);break;case C.CloseParen:this._addToken(F.RParen);break;case C.ExclamationMark:if(this._match(C.Equals)){let e=this._match(C.Equals);this._tokens.push({type:F.NotEq,offset:this._start,isTripleEq:e})}else this._addToken(F.Neg);break;case C.SingleQuote:this._quotedString();break;case C.Slash:this._regex();break;case C.Equals:if(this._match(C.Equals)){let e=this._match(C.Equals);this._tokens.push({type:F.Eq,offset:this._start,isTripleEq:e})}else this._match(C.Tilde)?this._addToken(F.RegexOp):this._error(fd(`==`,`=~`));break;case C.LessThan:this._addToken(this._match(C.Equals)?F.LtEq:F.Lt);break;case C.GreaterThan:this._addToken(this._match(C.Equals)?F.GtEq:F.Gt);break;case C.Ampersand:this._match(C.Ampersand)?this._addToken(F.And):this._error(fd(`&&`));break;case C.Pipe:this._match(C.Pipe)?this._addToken(F.Or):this._error(fd(`||`));break;case C.Space:case C.CarriageReturn:case C.Tab:case C.LineFeed:case C.NoBreakSpace:break;default:this._string()}return this._start=this._current,this._addToken(F.EOF),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?C.Null:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){let t=this._start,n=this._input.substring(this._start,this._current),r={type:F.Error,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(r)}_string(){this.stringRe.lastIndex=this._start;let t=this.stringRe.exec(this._input);if(t){this._current=this._start+t[0].length;let n=this._input.substring(this._start,this._current),r=e._keywords.get(n);r?this._addToken(r):this._tokens.push({type:F.Str,lexeme:n,offset:this._start})}}_quotedString(){for(;this._peek()!==C.SingleQuote&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(pd);return}this._advance(),this._tokens.push({type:F.QuotedStr,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let t=this._current,n=!1,r=!1;for(;;){if(t>=this._input.length){this._current=t,this._error(md);return}let e=this._input.charCodeAt(t);if(n)n=!1;else if(e===C.Slash&&!r){t++;break}else e===C.OpenSquareBracket?r=!0:e===C.Backslash?n=!0:e===C.CloseSquareBracket&&(r=!1);t++}for(;t<this._input.length&&e._regexFlags.has(this._input.charCodeAt(t));)t++;this._current=t;let i=this._input.substring(this._start,this._current);this._tokens.push({type:F.RegexStr,lexeme:i,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}};const gd=new Map;gd.set(`false`,!1),gd.set(`true`,!0),gd.set(`isMac`,bn),gd.set(`isLinux`,xn),gd.set(`isWindows`,yn),gd.set(`isWeb`,Cn),gd.set(`isMacNative`,bn&&!Cn),gd.set(`isEdge`,Hn),gd.set(`isFirefox`,Bn),gd.set(`isChrome`,zn),gd.set(`isSafari`,Vn);const _d=Object.prototype.hasOwnProperty;var vd;(function(e){e[e.False=0]=`False`,e[e.True=1]=`True`,e[e.Defined=2]=`Defined`,e[e.Not=3]=`Not`,e[e.Equals=4]=`Equals`,e[e.NotEquals=5]=`NotEquals`,e[e.And=6]=`And`,e[e.Regex=7]=`Regex`,e[e.NotRegex=8]=`NotRegex`,e[e.Or=9]=`Or`,e[e.In=10]=`In`,e[e.NotIn=11]=`NotIn`,e[e.Greater=12]=`Greater`,e[e.GreaterEquals=13]=`GreaterEquals`,e[e.Smaller=14]=`Smaller`,e[e.SmallerEquals=15]=`SmallerEquals`})(vd||={});const yd={regexParsingWithErrorRecovery:!0},bd=x(1880,`Empty context key expression`),xd=x(1881,`Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively.`),Sd=x(1882,`'in' after 'not'.`),Cd=x(1883,`closing parenthesis ')'`),wd=x(1884,`Unexpected token`),Td=x(1885,`Did you forget to put && or || before the token?`),Ed=x(1886,`Unexpected end of expression`),Dd=x(1887,`Did you forget to put a context key?`);var Od=class e{static{this._parseError=Error()}get lexingErrors(){return this._scanner.errors}get parsingErrors(){return this._parsingErrors}constructor(e=yd){this._config=e,this._scanner=new hd,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(t){if(t===``){this._parsingErrors.push({message:bd,offset:0,lexeme:``,additionalInfo:xd});return}this._tokens=this._scanner.reset(t).scan(),this._current=0,this._parsingErrors=[];try{let t=this._expr();if(!this._isAtEnd()){let t=this._peek(),n=t.type===F.Str?Td:void 0;throw this._parsingErrors.push({message:wd,offset:t.offset,lexeme:hd.getLexeme(t),additionalInfo:n}),e._parseError}return t}catch(t){if(t!==e._parseError)throw t;return}}_expr(){return this._or()}_or(){let e=[this._and()];for(;this._matchOne(F.Or);){let t=this._and();e.push(t)}return e.length===1?e[0]:kd.or(...e)}_and(){let e=[this._term()];for(;this._matchOne(F.And);){let t=this._term();e.push(t)}return e.length===1?e[0]:kd.and(...e)}_term(){if(this._matchOne(F.Neg)){let e=this._peek();switch(e.type){case F.True:return this._advance(),Md.INSTANCE;case F.False:return this._advance(),Nd.INSTANCE;case F.LParen:{this._advance();let e=this._expr();return this._consume(F.RParen,Cd),e?.negate()}case F.Str:return this._advance(),zd.create(e.lexeme);default:throw this._errExpectedButGot(`KEY | true | false | '(' expression ')'`,e)}}return this._primary()}_primary(){let t=this._peek();switch(t.type){case F.True:return this._advance(),kd.true();case F.False:return this._advance(),kd.false();case F.LParen:{this._advance();let e=this._expr();return this._consume(F.RParen,Cd),e}case F.Str:{let e=t.lexeme;if(this._advance(),this._matchOne(F.RegexOp)){let t=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),t.type!==F.RegexStr)throw this._errExpectedButGot(`REGEX`,t);let n=t.lexeme,r=n.lastIndexOf(`/`),i=r===n.length-1?void 0:this._removeFlagsGY(n.substring(r+1)),a;try{a=new RegExp(n.substring(1,r),i)}catch{throw this._errExpectedButGot(`REGEX`,t)}return Gd.create(e,a)}switch(t.type){case F.RegexStr:case F.Error:{let n=[t.lexeme];this._advance();let r=this._peek(),i=0;for(let e=0;e<t.lexeme.length;e++)t.lexeme.charCodeAt(e)===C.OpenParen?i++:t.lexeme.charCodeAt(e)===C.CloseParen&&i--;for(;!this._isAtEnd()&&r.type!==F.And&&r.type!==F.Or;){switch(r.type){case F.LParen:i++;break;case F.RParen:i--;break;case F.RegexStr:case F.QuotedStr:for(let e=0;e<r.lexeme.length;e++)r.lexeme.charCodeAt(e)===C.OpenParen?i++:t.lexeme.charCodeAt(e)===C.CloseParen&&i--}if(i<0)break;n.push(hd.getLexeme(r)),this._advance(),r=this._peek()}let a=n.join(``),o=a.lastIndexOf(`/`),s=o===a.length-1?void 0:this._removeFlagsGY(a.substring(o+1)),c;try{c=new RegExp(a.substring(1,o),s)}catch{throw this._errExpectedButGot(`REGEX`,t)}return kd.regex(e,c)}case F.QuotedStr:{let n=t.lexeme;this._advance();let r=null;if(!Hi(n)){let e=n.indexOf(`/`),i=n.lastIndexOf(`/`);if(e!==i&&e>=0){let a=n.slice(e+1,i),o=n[i+1]===`i`?`i`:``;try{r=new RegExp(a,o)}catch{throw this._errExpectedButGot(`REGEX`,t)}}}if(r===null)throw this._errExpectedButGot(`REGEX`,t);return Gd.create(e,r)}default:throw this._errExpectedButGot(`REGEX`,this._peek())}}if(this._matchOne(F.Not)){this._consume(F.In,Sd);let t=this._value();return kd.notIn(e,t)}switch(this._peek().type){case F.Eq:{this._advance();let t=this._value();if(this._previous().type===F.QuotedStr)return kd.equals(e,t);switch(t){case`true`:return kd.has(e);case`false`:return kd.not(e);default:return kd.equals(e,t)}}case F.NotEq:{this._advance();let t=this._value();if(this._previous().type===F.QuotedStr)return kd.notEquals(e,t);switch(t){case`true`:return kd.not(e);case`false`:return kd.has(e);default:return kd.notEquals(e,t)}}case F.Lt:return this._advance(),Ud.create(e,this._value());case F.LtEq:return this._advance(),Wd.create(e,this._value());case F.Gt:return this._advance(),Vd.create(e,this._value());case F.GtEq:return this._advance(),Hd.create(e,this._value());case F.In:return this._advance(),kd.in(e,this._value());default:return kd.has(e)}}case F.EOF:throw this._parsingErrors.push({message:Ed,offset:t.offset,lexeme:``,additionalInfo:Dd}),e._parseError;default:throw this._errExpectedButGot(`true | false | KEY
71
- | KEY '=~' REGEX
72
- | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){let e=this._peek();switch(e.type){case F.Str:case F.QuotedStr:return this._advance(),e.lexeme;case F.True:return this._advance(),`true`;case F.False:return this._advance(),`false`;case F.In:return this._advance(),`in`;default:return``}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,``)}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(t,n,r){let i=x(1888,`Expected: {0}
73
- Received: '{1}'.`,t,hd.getLexeme(n)),a=n.offset,o=hd.getLexeme(n);return this._parsingErrors.push({message:i,offset:a,lexeme:o,additionalInfo:r}),e._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===F.EOF}},kd=class{static false(){return Md.INSTANCE}static true(){return Nd.INSTANCE}static has(e){return Pd.create(e)}static equals(e,t){return Fd.create(e,t)}static notEquals(e,t){return Rd.create(e,t)}static regex(e,t){return Gd.create(e,t)}static in(e,t){return Id.create(e,t)}static notIn(e,t){return Ld.create(e,t)}static not(e){return zd.create(e)}static and(...e){return Jd.create(e,null,!0)}static or(...e){return Yd.create(e,null,!0)}static greater(e,t){return Vd.create(e,t)}static greaterEquals(e,t){return Hd.create(e,t)}static smaller(e,t){return Ud.create(e,t)}static smallerEquals(e,t){return Wd.create(e,t)}static{this._parser=new Od({regexParsingWithErrorRecovery:!1})}static deserialize(e){if(e!=null)return this._parser.parse(e)}};function Ad(e){let t=new Od({regexParsingWithErrorRecovery:!1});return e.map(e=>(t.parse(e),t.lexingErrors.length>0?t.lexingErrors.map(e=>({errorMessage:e.additionalInfo?x(1889,`Unexpected token. Hint: {0}`,e.additionalInfo):x(1890,`Unexpected token.`),offset:e.offset,length:e.lexeme.length})):t.parsingErrors.length>0?t.parsingErrors.map(e=>({errorMessage:e.additionalInfo?`${e.message}. ${e.additionalInfo}`:e.message,offset:e.offset,length:e.lexeme.length})):[]))}function jd(e,t){return e.cmp(t)}var Md=class e{static{this.INSTANCE=new e}constructor(){this.type=vd.False}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return`false`}keys(){return[]}map(e){return this}negate(){return Nd.INSTANCE}},Nd=class e{static{this.INSTANCE=new e}constructor(){this.type=vd.True}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return`true`}keys(){return[]}map(e){return this}negate(){return Md.INSTANCE}},Pd=class e{static create(t,n=null){let r=gd.get(t);return typeof r==`boolean`?r?Nd.INSTANCE:Md.INSTANCE:new e(t,n)}constructor(e,t){this.key=e,this.negated=t,this.type=vd.Defined}cmp(e){return e.type===this.type?Xd(this.key,e.key):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){let e=gd.get(this.key);return typeof e==`boolean`?e?Nd.INSTANCE:Md.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(e){return e.mapDefined(this.key)}negate(){return this.negated||=zd.create(this.key,this),this.negated}},Fd=class e{static create(t,n,r=null){if(typeof n==`boolean`)return n?Pd.create(t,r):zd.create(t,r);let i=gd.get(t);return typeof i==`boolean`?n===(i?`true`:`false`)?Nd.INSTANCE:Md.INSTANCE:new e(t,n,r)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=vd.Equals}cmp(e){return e.type===this.type?Zd(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){let e=gd.get(this.key);if(typeof e==`boolean`){let t=e?`true`:`false`;return this.value===t?Nd.INSTANCE:Md.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}map(e){return e.mapEquals(this.key,this.value)}negate(){return this.negated||=Rd.create(this.key,this.value,this),this.negated}},Id=class e{static create(t,n){return new e(t,n)}constructor(e,t){this.key=e,this.valueKey=t,this.type=vd.In,this.negated=null}cmp(e){return e.type===this.type?Zd(this.key,this.valueKey,e.key,e.valueKey):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.valueKey),n=e.getValue(this.key);if(Array.isArray(t)){if(t.includes(n))return!0;if(yn&&typeof n==`string`&&n.startsWith(`file:///`)){let e=n.toLowerCase();return t.some(t=>typeof t==`string`&&t.toLowerCase()===e)}return!1}if(typeof n==`string`&&typeof t==`object`&&t){if(_d.call(t,n))return!0;if(yn&&n.startsWith(`file:///`)){let e=n.toLowerCase();return Object.keys(t).some(t=>t.toLowerCase()===e)}return!1}return!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}map(e){return e.mapIn(this.key,this.valueKey)}negate(){return this.negated||=Ld.create(this.key,this.valueKey),this.negated}},Ld=class e{static create(t,n){return new e(t,n)}constructor(e,t){this.key=e,this.valueKey=t,this.type=vd.NotIn,this._negated=Id.create(e,t)}cmp(e){return e.type===this.type?this._negated.cmp(e._negated):this.type-e.type}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}map(e){return e.mapNotIn(this.key,this.valueKey)}negate(){return this._negated}},Rd=class e{static create(t,n,r=null){if(typeof n==`boolean`)return n?zd.create(t,r):Pd.create(t,r);let i=gd.get(t);return typeof i==`boolean`?n===(i?`true`:`false`)?Md.INSTANCE:Nd.INSTANCE:new e(t,n,r)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=vd.NotEquals}cmp(e){return e.type===this.type?Zd(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){let e=gd.get(this.key);if(typeof e==`boolean`){let t=e?`true`:`false`;return this.value===t?Md.INSTANCE:Nd.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}map(e){return e.mapNotEquals(this.key,this.value)}negate(){return this.negated||=Fd.create(this.key,this.value,this),this.negated}},zd=class e{static create(t,n=null){let r=gd.get(t);return typeof r==`boolean`?r?Md.INSTANCE:Nd.INSTANCE:new e(t,n)}constructor(e,t){this.key=e,this.negated=t,this.type=vd.Not}cmp(e){return e.type===this.type?Xd(this.key,e.key):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){let e=gd.get(this.key);return typeof e==`boolean`?e?Md.INSTANCE:Nd.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}map(e){return e.mapNot(this.key)}negate(){return this.negated||=Pd.create(this.key,this),this.negated}};function Bd(e,t){if(typeof e==`string`){let t=parseFloat(e);isNaN(t)||(e=t)}return typeof e==`string`||typeof e==`number`?t(e):Md.INSTANCE}var Vd=class e{static create(t,n,r=null){return Bd(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=vd.Greater}cmp(e){return e.type===this.type?Zd(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}map(e){return e.mapGreater(this.key,this.value)}negate(){return this.negated||=Wd.create(this.key,this.value,this),this.negated}},Hd=class e{static create(t,n,r=null){return Bd(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=vd.GreaterEquals}cmp(e){return e.type===this.type?Zd(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}map(e){return e.mapGreaterEquals(this.key,this.value)}negate(){return this.negated||=Ud.create(this.key,this.value,this),this.negated}},Ud=class e{static create(t,n,r=null){return Bd(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=vd.Smaller}cmp(e){return e.type===this.type?Zd(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}map(e){return e.mapSmaller(this.key,this.value)}negate(){return this.negated||=Hd.create(this.key,this.value,this),this.negated}},Wd=class e{static create(t,n,r=null){return Bd(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=vd.SmallerEquals}cmp(e){return e.type===this.type?Zd(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}map(e){return e.mapSmallerEquals(this.key,this.value)}negate(){return this.negated||=Vd.create(this.key,this.value,this),this.negated}},Gd=class e{static create(t,n){return new e(t,n)}constructor(e,t){this.key=e,this.regexp=t,this.type=vd.Regex,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;let t=this.regexp?this.regexp.source:``,n=e.regexp?e.regexp.source:``;return t<n?-1:+(t>n)}equals(e){if(e.type===this.type){let t=this.regexp?this.regexp.source:``,n=e.regexp?e.regexp.source:``;return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){let e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:`/invalid/`;return`${this.key} =~ ${e}`}keys(){return[this.key]}map(e){return e.mapRegex(this.key,this.regexp)}negate(){return this.negated||=Kd.create(this),this.negated}},Kd=class e{static create(t){return new e(t)}constructor(e){this._actual=e,this.type=vd.NotRegex}cmp(e){return e.type===this.type?this._actual.cmp(e._actual):this.type-e.type}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}map(t){return new e(this._actual.map(t))}negate(){return this._actual}};function qd(e){let t=null;for(let n=0,r=e.length;n<r;n++){let r=e[n].substituteConstants();if(e[n]!==r&&t===null){t=[];for(let r=0;r<n;r++)t[r]=e[r]}t!==null&&(t[n]=r)}return t===null?e:t}var Jd=class e{static create(t,n,r){return e._normalizeArr(t,n,r)}constructor(e,t){this.expr=e,this.negated=t,this.type=vd.And}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){let n=jd(this.expr[t],e.expr[t]);if(n!==0)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){let t=qd(this.expr);return t===this.expr?this:e.create(t,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(t,n,r){let i=[],a=!1;for(let e of t)if(e){if(e.type===vd.True){a=!0;continue}if(e.type===vd.False)return Md.INSTANCE;if(e.type===vd.And){i.push(...e.expr);continue}i.push(e)}if(i.length===0&&a)return Nd.INSTANCE;if(i.length!==0){if(i.length===1)return i[0];i.sort(jd);for(let e=1;e<i.length;e++)i[e-1].equals(i[e])&&(i.splice(e,1),e--);if(i.length===1)return i[0];for(;i.length>1;){let t=i[i.length-1];if(t.type!==vd.Or)break;i.pop();let n=i.pop(),a=i.length===0,o=Yd.create(t.expr.map(t=>e.create([t,n],null,r)),null,a);o&&(i.push(o),i.sort(jd))}if(i.length===1)return i[0];if(r){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if(i[e].negate().equals(i[t]))return Md.INSTANCE;if(i.length===1)return i[0]}return new e(i,n)}}serialize(){return this.expr.map(e=>e.serialize()).join(` && `)}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}map(t){return new e(this.expr.map(e=>e.map(t)),null)}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());this.negated=Yd.create(e,this,!0)}return this.negated}},Yd=class e{static create(t,n,r){return e._normalizeArr(t,n,r)}constructor(e,t){this.expr=e,this.negated=t,this.type=vd.Or}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){let n=jd(this.expr[t],e.expr[t]);if(n!==0)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){let t=qd(this.expr);return t===this.expr?this:e.create(t,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(t,n,r){let i=[],a=!1;if(t){for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n){if(n.type===vd.False){a=!0;continue}if(n.type===vd.True)return Nd.INSTANCE;if(n.type===vd.Or){i=i.concat(n.expr);continue}i.push(n)}}if(i.length===0&&a)return Md.INSTANCE;i.sort(jd)}if(i.length!==0){if(i.length===1)return i[0];for(let e=1;e<i.length;e++)i[e-1].equals(i[e])&&(i.splice(e,1),e--);if(i.length===1)return i[0];if(r){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if(i[e].negate().equals(i[t]))return Nd.INSTANCE;if(i.length===1)return i[0]}return new e(i,n)}}serialize(){return this.expr.map(e=>e.serialize()).join(` || `)}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}map(t){return new e(this.expr.map(e=>e.map(t)),null)}negate(){if(!this.negated){let t=[];for(let e of this.expr)t.push(e.negate());for(;t.length>1;){let n=t.shift(),r=t.shift(),i=[];for(let e of Qd(n))for(let t of Qd(r))i.push(Jd.create([e,t],null,!1));t.unshift(e.create(i,null,!1))}this.negated=e.create(t,this,!0)}return this.negated}},I=class e extends Pd{static{this._info=[]}static all(){return e._info.values()}constructor(t,n,r){super(t,null),this._defaultValue=n,typeof r==`object`?e._info.push({...r,key:t}):r!==!0&&e._info.push({key:t,description:r,type:n==null?void 0:typeof n})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return Fd.create(this.key,e)}notEqualsTo(e){return Rd.create(this.key,e)}greater(e){return Vd.create(this.key,e)}};function Xd(e,t){return e<t?-1:+(e>t)}function Zd(e,t,n,r){return e<n?-1:e>n?1:t<r?-1:+(t>r)}function Qd(e){return e.type===vd.Or?e.expr:[e]}var $d;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Disabled=1]=`Disabled`,e[e.Enabled=2]=`Enabled`})($d||={}),new I(`accessibilityModeEnabled`,!1);var ef;(function(e){e[e.None=0]=`None`,e[e.Keep=1]=`Keep`,e[e.Brackets=2]=`Brackets`,e[e.Advanced=3]=`Advanced`,e[e.Full=4]=`Full`})(ef||={});var tf=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},nf=class{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return af(e,t)}compute(e,t,n){return n}},rf=class{constructor(e,t){this.newValue=e,this.didChange=t}};function af(e,t){if(typeof e!=`object`||typeof t!=`object`||!e||!t)return new rf(t,e!==t);if(Array.isArray(e)||Array.isArray(t))return new rf(t,!(Array.isArray(e)&&Array.isArray(t)&&se(e,t)));let n=!1;for(let r in t)if(t.hasOwnProperty(r)){let i=af(e[r],t[r]);i.didChange&&(e[r]=i.newValue,n=!0)}return new rf(e,n)}var of=class{constructor(e,t){this.schema=void 0,this.id=e,this.name=`_never_`,this.defaultValue=t}applyUpdate(e,t){return af(e,t)}validate(e){return this.defaultValue}},sf=class{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return af(e,t)}compute(e,t,n){return n}};function L(e,t){return e===void 0?t:e===`false`?!1:!!e}var R=class extends sf{constructor(e,t,n,r=void 0){r!==void 0&&(r.type=`boolean`,r.default=n),super(e,t,n,r)}validate(e){return L(e,this.defaultValue)}};function cf(e,t,n,r){if(typeof e==`string`&&(e=parseInt(e,10)),typeof e!=`number`||isNaN(e))return t;let i=e;return i=Math.max(n,i),i=Math.min(r,i),i|0}var lf=class e extends sf{static clampedInt(e,t,n,r){return cf(e,t,n,r)}constructor(e,t,n,r,i,a=void 0){a!==void 0&&(a.type=`integer`,a.default=n,a.minimum=r,a.maximum=i),super(e,t,n,a),this.minimum=r,this.maximum=i}validate(t){return e.clampedInt(t,this.defaultValue,this.minimum,this.maximum)}},uf=class e extends sf{static clamp(e,t,n){return e<t?t:e>n?n:e}static float(e,t){return typeof e==`string`&&(e=parseFloat(e)),typeof e!=`number`||isNaN(e)?t:e}constructor(e,t,n,r,i,a,o){i!==void 0&&(i.type=`number`,i.default=n,i.minimum=a,i.maximum=o),super(e,t,n,i),this.validationFn=r,this.minimum=a,this.maximum=o}validate(t){return this.validationFn(e.float(t,this.defaultValue))}},df=class e extends sf{static string(e,t){return typeof e==`string`?e:t}constructor(e,t,n,r=void 0){r!==void 0&&(r.type=`string`,r.default=n),super(e,t,n,r)}validate(t){return e.string(t,this.defaultValue)}};function ff(e,t,n,r){return typeof e==`string`?r&&e in r?r[e]:n.indexOf(e)===-1?t:e:t}var pf=class extends sf{constructor(e,t,n,r,i=void 0){i!==void 0&&(i.type=`string`,i.enum=r.slice(0),i.default=n),super(e,t,n,i),this._allowedValues=r}validate(e){return ff(e,this.defaultValue,this._allowedValues)}},mf=class extends nf{constructor(e,t,n,r,i,a,o=void 0){o!==void 0&&(o.type=`string`,o.enum=i,o.default=r),super(e,t,n,o),this._allowedValues=i,this._convert=a}validate(e){return typeof e!=`string`||this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}};function hf(e){switch(e){case`none`:return ef.None;case`keep`:return ef.Keep;case`brackets`:return ef.Brackets;case`advanced`:return ef.Advanced;case`full`:return ef.Full}}var gf=class extends nf{constructor(){super(B.accessibilitySupport,`accessibilitySupport`,$d.Unknown,{type:`string`,enum:[`auto`,`on`,`off`],enumDescriptions:[x(295,`Use platform APIs to detect when a Screen Reader is attached.`),x(296,`Optimize for usage with a Screen Reader.`),x(297,`Assume a screen reader is not attached.`)],default:`auto`,tags:[`accessibility`],description:x(298,`Controls if the UI should run in a mode where it is optimized for screen readers.`)})}validate(e){switch(e){case`auto`:return $d.Unknown;case`off`:return $d.Disabled;case`on`:return $d.Enabled}return this.defaultValue}compute(e,t,n){return n===$d.Unknown?e.accessibilitySupport:n}},_f=class extends nf{constructor(){let e={insertSpace:!0,ignoreEmptyLines:!0};super(B.comments,`comments`,e,{"editor.comments.insertSpace":{type:`boolean`,default:e.insertSpace,description:x(299,`Controls whether a space character is inserted when commenting.`)},"editor.comments.ignoreEmptyLines":{type:`boolean`,default:e.ignoreEmptyLines,description:x(300,`Controls if empty lines should be ignored with toggle, add or remove actions for line comments.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{insertSpace:L(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:L(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}},vf;(function(e){e[e.Hidden=0]=`Hidden`,e[e.Blink=1]=`Blink`,e[e.Smooth=2]=`Smooth`,e[e.Phase=3]=`Phase`,e[e.Expand=4]=`Expand`,e[e.Solid=5]=`Solid`})(vf||={});function yf(e){switch(e){case`blink`:return vf.Blink;case`smooth`:return vf.Smooth;case`phase`:return vf.Phase;case`expand`:return vf.Expand;case`solid`:return vf.Solid}}var bf;(function(e){e[e.Line=1]=`Line`,e[e.Block=2]=`Block`,e[e.Underline=3]=`Underline`,e[e.LineThin=4]=`LineThin`,e[e.BlockOutline=5]=`BlockOutline`,e[e.UnderlineThin=6]=`UnderlineThin`})(bf||={});function xf(e){switch(e){case`line`:return bf.Line;case`block`:return bf.Block;case`underline`:return bf.Underline;case`line-thin`:return bf.LineThin;case`block-outline`:return bf.BlockOutline;case`underline-thin`:return bf.UnderlineThin}}var Sf=class extends of{constructor(){super(B.editorClassName,``)}compute(e,t,n){let r=[`monaco-editor`];return t.get(B.extraEditorClassName)&&r.push(t.get(B.extraEditorClassName)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(B.mouseStyle)===`default`?r.push(`mouse-default`):t.get(B.mouseStyle)===`copy`&&r.push(`mouse-copy`),t.get(B.showUnused)&&r.push(`showUnused`),t.get(B.showDeprecated)&&r.push(`showDeprecated`),r.join(` `)}},Cf=class extends R{constructor(){super(B.emptySelectionClipboard,`emptySelectionClipboard`,!0,{description:x(301,`Controls whether copying without a selection copies the current line.`)})}compute(e,t,n){return n&&e.emptySelectionClipboard}},wf=class extends nf{constructor(){let e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:`always`,autoFindInSelection:`never`,globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,closeOnResult:!1,history:`workspace`,replaceHistory:`workspace`};super(B.find,`find`,e,{"editor.find.cursorMoveOnType":{type:`boolean`,default:e.cursorMoveOnType,description:x(302,`Controls whether the cursor should jump to find matches while typing.`)},"editor.find.seedSearchStringFromSelection":{type:`string`,enum:[`never`,`always`,`selection`],default:e.seedSearchStringFromSelection,enumDescriptions:[x(303,`Never seed search string from the editor selection.`),x(304,`Always seed search string from the editor selection, including word at cursor position.`),x(305,`Only seed search string from the editor selection.`)],description:x(306,`Controls whether the search string in the Find Widget is seeded from the editor selection.`)},"editor.find.autoFindInSelection":{type:`string`,enum:[`never`,`always`,`multiline`],default:e.autoFindInSelection,enumDescriptions:[x(307,`Never turn on Find in Selection automatically (default).`),x(308,`Always turn on Find in Selection automatically.`),x(309,`Turn on Find in Selection automatically when multiple lines of content are selected.`)],description:x(310,`Controls the condition for turning on Find in Selection automatically.`)},"editor.find.globalFindClipboard":{type:`boolean`,default:e.globalFindClipboard,description:x(311,`Controls whether the Find Widget should read or modify the shared find clipboard on macOS.`),included:bn},"editor.find.addExtraSpaceOnTop":{type:`boolean`,default:e.addExtraSpaceOnTop,description:x(312,`Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.`)},"editor.find.loop":{type:`boolean`,default:e.loop,description:x(313,`Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.`)},"editor.find.closeOnResult":{type:`boolean`,default:e.closeOnResult,description:x(314,`Controls whether the Find Widget closes after an explicit find navigation command lands on a result.`)},"editor.find.history":{type:`string`,enum:[`never`,`workspace`],default:`workspace`,enumDescriptions:[x(315,`Do not store search history from the find widget.`),x(316,`Store search history across the active workspace`)],description:x(317,`Controls how the find widget history should be stored`)},"editor.find.replaceHistory":{type:`string`,enum:[`never`,`workspace`],default:`workspace`,enumDescriptions:[x(318,`Do not store history from the replace widget.`),x(319,`Store replace history across the active workspace`)],description:x(320,`Controls how the replace widget history should be stored`)},"editor.find.findOnType":{type:`boolean`,default:e.findOnType,description:x(321,`Controls whether the Find Widget should search as you type.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{cursorMoveOnType:L(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:L(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection==`boolean`?t.seedSearchStringFromSelection?`always`:`never`:ff(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,[`never`,`always`,`selection`]),autoFindInSelection:typeof t.autoFindInSelection==`boolean`?t.autoFindInSelection?`always`:`never`:ff(t.autoFindInSelection,this.defaultValue.autoFindInSelection,[`never`,`always`,`multiline`]),globalFindClipboard:L(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:L(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:L(t.loop,this.defaultValue.loop),closeOnResult:L(t.closeOnResult,this.defaultValue.closeOnResult),history:ff(t.history,this.defaultValue.history,[`never`,`workspace`]),replaceHistory:ff(t.replaceHistory,this.defaultValue.replaceHistory,[`never`,`workspace`])}}},Tf=class e extends nf{static{this.OFF=`"liga" off, "calt" off`}static{this.ON=`"liga" on, "calt" on`}constructor(){super(B.fontLigatures,`fontLigatures`,e.OFF,{anyOf:[{type:`boolean`,description:x(322,`Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.`)},{type:`string`,description:x(323,`Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.`)}],description:x(324,`Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property.`),default:!1})}validate(t){return t===void 0?this.defaultValue:typeof t==`string`?t===`false`||t.length===0?e.OFF:t===`true`?e.ON:t:t?e.ON:e.OFF}},Ef=class e extends nf{static{this.OFF=nd}static{this.TRANSLATE=`translate`}constructor(){super(B.fontVariations,`fontVariations`,e.OFF,{anyOf:[{type:`boolean`,description:x(325,`Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.`)},{type:`string`,description:x(326,`Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.`)}],description:x(327,`Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property.`),default:!1})}validate(t){return t===void 0?this.defaultValue:typeof t==`string`?t===`false`?e.OFF:t===`true`?e.TRANSLATE:t:t?e.TRANSLATE:e.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}},Df=class extends of{constructor(){super(B.fontInfo,new td({pixelRatio:0,fontFamily:``,fontWeight:``,fontSize:0,fontFeatureSettings:``,fontVariationSettings:``,lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,n){return e.fontInfo}},Of=class extends of{constructor(){super(B.effectiveCursorStyle,bf.Line)}compute(e,t,n){return e.inputMode===`overtype`?t.get(B.overtypeCursorStyle):t.get(B.cursorStyle)}},kf=class extends of{constructor(){super(B.effectiveEditContext,!1)}compute(e,t){return e.editContextSupported&&t.get(B.editContext)}},Af=class extends of{constructor(){super(B.effectiveAllowVariableFonts,!1)}compute(e,t){return e.accessibilitySupport===$d.Enabled?t.get(B.allowVariableFontsInAccessibilityMode):t.get(B.allowVariableFonts)}},jf=class extends sf{constructor(){super(B.fontSize,`fontSize`,rd.fontSize,{type:`number`,minimum:6,maximum:100,default:rd.fontSize,description:x(328,`Controls the font size in pixels.`)})}validate(e){let t=uf.float(e,this.defaultValue);return t===0?rd.fontSize:uf.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}},Mf=class e extends nf{static{this.SUGGESTION_VALUES=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`]}static{this.MINIMUM_VALUE=1}static{this.MAXIMUM_VALUE=1e3}constructor(){super(B.fontWeight,`fontWeight`,rd.fontWeight,{anyOf:[{type:`number`,minimum:e.MINIMUM_VALUE,maximum:e.MAXIMUM_VALUE,errorMessage:x(329,`Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.`)},{type:`string`,pattern:`^(normal|bold|1000|[1-9][0-9]{0,2})$`},{enum:e.SUGGESTION_VALUES}],default:rd.fontWeight,description:x(330,`Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.`)})}validate(t){return t===`normal`||t===`bold`?t:String(lf.clampedInt(t,rd.fontWeight,e.MINIMUM_VALUE,e.MAXIMUM_VALUE))}},Nf=class extends nf{constructor(){let e={multiple:`peek`,multipleDefinitions:`peek`,multipleTypeDefinitions:`peek`,multipleDeclarations:`peek`,multipleImplementations:`peek`,multipleReferences:`peek`,multipleTests:`peek`,alternativeDefinitionCommand:`editor.action.goToReferences`,alternativeTypeDefinitionCommand:`editor.action.goToReferences`,alternativeDeclarationCommand:`editor.action.goToReferences`,alternativeImplementationCommand:``,alternativeReferenceCommand:``,alternativeTestsCommand:``},t={type:`string`,enum:[`peek`,`gotoAndPeek`,`goto`],default:e.multiple,enumDescriptions:[x(331,`Show Peek view of the results (default)`),x(332,`Go to the primary result and show a Peek view`),x(333,`Go to the primary result and enable Peek-less navigation to others`)]},n=[``,`editor.action.referenceSearch.trigger`,`editor.action.goToReferences`,`editor.action.peekImplementation`,`editor.action.goToImplementation`,`editor.action.peekTypeDefinition`,`editor.action.goToTypeDefinition`,`editor.action.peekDeclaration`,`editor.action.revealDeclaration`,`editor.action.peekDefinition`,`editor.action.revealDefinitionAside`,`editor.action.revealDefinition`];super(B.gotoLocation,`gotoLocation`,e,{"editor.gotoLocation.multiple":{deprecationMessage:x(334,`This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.`)},"editor.gotoLocation.multipleDefinitions":{description:x(335,`Controls the behavior the 'Go to Definition'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:x(336,`Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleDeclarations":{description:x(337,`Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleImplementations":{description:x(338,`Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleReferences":{description:x(339,`Controls the behavior the 'Go to References'-command when multiple target locations exist.`),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:`string`,default:e.alternativeDefinitionCommand,enum:n,description:x(340,`Alternative command id that is being executed when the result of 'Go to Definition' is the current location.`)},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:`string`,default:e.alternativeTypeDefinitionCommand,enum:n,description:x(341,`Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.`)},"editor.gotoLocation.alternativeDeclarationCommand":{type:`string`,default:e.alternativeDeclarationCommand,enum:n,description:x(342,`Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.`)},"editor.gotoLocation.alternativeImplementationCommand":{type:`string`,default:e.alternativeImplementationCommand,enum:n,description:x(343,`Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.`)},"editor.gotoLocation.alternativeReferenceCommand":{type:`string`,default:e.alternativeReferenceCommand,enum:n,description:x(344,`Alternative command id that is being executed when the result of 'Go to Reference' is the current location.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{multiple:ff(t.multiple,this.defaultValue.multiple,[`peek`,`gotoAndPeek`,`goto`]),multipleDefinitions:ff(t.multipleDefinitions,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleTypeDefinitions:ff(t.multipleTypeDefinitions,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleDeclarations:ff(t.multipleDeclarations,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleImplementations:ff(t.multipleImplementations,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleReferences:ff(t.multipleReferences,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleTests:ff(t.multipleTests,`peek`,[`peek`,`gotoAndPeek`,`goto`]),alternativeDefinitionCommand:df.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:df.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:df.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:df.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:df.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:df.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}},Pf=class extends nf{constructor(){let e={enabled:`on`,delay:300,hidingDelay:300,sticky:!0,above:!0,showLongLineWarning:!0};super(B.hover,`hover`,e,{"editor.hover.enabled":{type:`string`,enum:[`on`,`off`,`onKeyboardModifier`],default:e.enabled,markdownEnumDescriptions:[x(345,`Hover is enabled.`),x(346,`Hover is disabled.`),x(347,"Hover is shown when holding `{0}` or `Alt` (the opposite modifier of `#editor.multiCursorModifier#`)",bn?`Command`:`Control`)],description:x(348,`Controls whether the hover is shown.`),keywords:[`hint`,`info`,`tooltip`]},"editor.hover.delay":{type:`number`,default:e.delay,minimum:0,maximum:1e4,description:x(349,`Controls the delay in milliseconds after which the hover is shown.`)},"editor.hover.sticky":{type:`boolean`,default:e.sticky,description:x(350,`Controls whether the hover should remain visible when mouse is moved over it.`)},"editor.hover.hidingDelay":{type:`integer`,minimum:0,default:e.hidingDelay,markdownDescription:x(351,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:`boolean`,default:e.above,description:x(352,`Prefer showing hovers above the line, if there's space.`)},"editor.hover.showLongLineWarning":{type:`boolean`,default:e.showLongLineWarning,description:x(353,`Controls whether long line warning hovers are shown, such as when tokenization is skipped or rendering is paused.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:ff(t.enabled,this.defaultValue.enabled,[`on`,`off`,`onKeyboardModifier`]),delay:lf.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:L(t.sticky,this.defaultValue.sticky),hidingDelay:lf.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:L(t.above,this.defaultValue.above),showLongLineWarning:L(t.showLongLineWarning,this.defaultValue.showLongLineWarning)}}},Ff;(function(e){e[e.None=0]=`None`,e[e.Text=1]=`Text`,e[e.Blocks=2]=`Blocks`})(Ff||={});var If=class e extends of{constructor(){super(B.layoutInfo,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:Ff.None,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(t,n,r){return e.computeLayout(n,{memory:t.memory,outerWidth:t.outerWidth,outerHeight:t.outerHeight,isDominatedByLongLines:t.isDominatedByLongLines,lineHeight:t.fontInfo.lineHeight,viewLineCount:t.viewLineCount,lineNumbersDigitCount:t.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:t.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:t.fontInfo.maxDigitWidth,pixelRatio:t.pixelRatio,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){let t=e.height/e.lineHeight,n=Math.floor(e.paddingTop/e.lineHeight),r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));let i=(n+e.viewLineCount+r)/(e.pixelRatio*e.height),a=Math.floor(e.viewLineCount/i);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:r,desiredRatio:i,minimapLineCount:a}}static _computeMinimapLayout(t,n){let r=t.outerWidth,i=t.outerHeight,a=t.pixelRatio;if(!t.minimap.enabled)return{renderMinimap:Ff.None,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(a*i),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:i};let o=n.stableMinimapLayoutInput,s=o&&t.outerHeight===o.outerHeight&&t.lineHeight===o.lineHeight&&t.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&t.pixelRatio===o.pixelRatio&&t.scrollBeyondLastLine===o.scrollBeyondLastLine&&t.paddingTop===o.paddingTop&&t.paddingBottom===o.paddingBottom&&t.minimap.enabled===o.minimap.enabled&&t.minimap.side===o.minimap.side&&t.minimap.size===o.minimap.size&&t.minimap.showSlider===o.minimap.showSlider&&t.minimap.renderCharacters===o.minimap.renderCharacters&&t.minimap.maxColumn===o.minimap.maxColumn&&t.minimap.scale===o.minimap.scale&&t.verticalScrollbarWidth===o.verticalScrollbarWidth&&t.isViewportWrapping===o.isViewportWrapping,c=t.lineHeight,l=t.typicalHalfwidthCharacterWidth,u=t.scrollBeyondLastLine,d=t.minimap.renderCharacters,f=a>=2?Math.round(t.minimap.scale*2):t.minimap.scale,p=t.minimap.maxColumn,m=t.minimap.size,h=t.minimap.side,ee=t.verticalScrollbarWidth,te=t.viewLineCount,g=t.remainingWidth,ne=t.isViewportWrapping,re=d?2:3,ie=Math.floor(a*i),ae=ie/a,oe=!1,se=!1,ce=re*f,le=f/a,ue=1;if(m===`fill`||m===`fit`){let{typicalViewportLineCount:r,extraLinesBeforeFirstLine:o,extraLinesBeyondLastLine:l,desiredRatio:d,minimapLineCount:p}=e.computeContainedMinimapLineCount({viewLineCount:te,scrollBeyondLastLine:u,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:i,lineHeight:c,pixelRatio:a});if(te/p>1)oe=!0,se=!0,f=1,ce=1,le=f/a;else{let e=!1,i=f+1;if(m===`fit`){let t=Math.ceil((o+te+l)*ce);ne&&s&&g<=n.stableFitRemainingWidth?(e=!0,i=n.stableFitMaxMinimapScale):e=t>ie}if(m===`fill`||e){oe=!0;let e=f;ce=Math.min(c*a,Math.max(1,Math.floor(1/d))),ne&&s&&g<=n.stableFitRemainingWidth&&(i=n.stableFitMaxMinimapScale),f=Math.min(i,Math.max(1,Math.floor(ce/re))),f>e&&(ue=Math.min(2,f/e)),le=f/a/ue,ie=Math.ceil(Math.max(r,o+te+l)*ce),ne?(n.stableMinimapLayoutInput=t,n.stableFitRemainingWidth=g,n.stableFitMaxMinimapScale=f):(n.stableMinimapLayoutInput=null,n.stableFitRemainingWidth=0)}}}let de=Math.floor(p*le),fe=Math.min(de,Math.max(0,Math.floor((g-ee-2)*le/(l+le)))+8),pe=Math.floor(a*fe),me=pe/a;return pe=Math.floor(pe*ue),{renderMinimap:d?Ff.Text:Ff.Blocks,minimapLeft:h===`left`?0:r-fe-ee,minimapWidth:fe,minimapHeightIsEditorHeight:oe,minimapIsSampling:se,minimapScale:f,minimapLineHeight:ce,minimapCanvasInnerWidth:pe,minimapCanvasInnerHeight:ie,minimapCanvasOuterWidth:me,minimapCanvasOuterHeight:ae}}static computeLayout(t,n){let r=n.outerWidth|0,i=n.outerHeight|0,a=n.lineHeight|0,o=n.lineNumbersDigitCount|0,s=n.typicalHalfwidthCharacterWidth,c=n.maxDigitWidth,l=n.pixelRatio,u=n.viewLineCount,d=t.get(B.wordWrapOverride2),f=d===`inherit`?t.get(B.wordWrapOverride1):d,p=f===`inherit`?t.get(B.wordWrap):f,m=t.get(B.wordWrapColumn),h=n.isDominatedByLongLines,ee=t.get(B.glyphMargin),te=t.get(B.lineNumbers).renderType!==Zf.Off,g=t.get(B.lineNumbersMinChars),ne=t.get(B.scrollBeyondLastLine),re=t.get(B.padding),ie=t.get(B.minimap),ae=t.get(B.scrollbar),oe=ae.verticalScrollbarSize,se=ae.verticalHasArrows,ce=ae.arrowSize,le=ae.horizontalScrollbarSize,ue=t.get(B.folding),de=t.get(B.showFoldingControls)!==`never`,fe=t.get(B.lineDecorationsWidth);ue&&de&&(fe+=16);let pe=0;te&&(pe=Math.round(Math.max(o,g)*c));let me=0;ee&&(me=a*n.glyphMarginDecorationLaneCount);let he=0,ge=he+me,_e=ge+pe,ve=_e+fe,ye=r-me-pe-fe,be=!1,xe=!1,Se=-1;t.get(B.accessibilitySupport)===$d.Enabled&&f===`inherit`&&h?(be=!0,xe=!0):p===`on`||p===`bounded`?xe=!0:p===`wordWrapColumn`&&(Se=m);let Ce=e._computeMinimapLayout({outerWidth:r,outerHeight:i,lineHeight:a,typicalHalfwidthCharacterWidth:s,pixelRatio:l,scrollBeyondLastLine:ne,paddingTop:re.top,paddingBottom:re.bottom,minimap:ie,verticalScrollbarWidth:oe,viewLineCount:u,remainingWidth:ye,isViewportWrapping:xe},n.memory||new tf);Ce.renderMinimap!==Ff.None&&Ce.minimapLeft===0&&(he+=Ce.minimapWidth,ge+=Ce.minimapWidth,_e+=Ce.minimapWidth,ve+=Ce.minimapWidth);let we=ye-Ce.minimapWidth,Te=Math.max(1,Math.floor((we-oe-2)/s)),Ee=se?ce:0;return xe&&(Se=Math.max(1,Te),p===`bounded`&&(Se=Math.min(Se,m))),{width:r,height:i,glyphMarginLeft:he,glyphMarginWidth:me,glyphMarginDecorationLaneCount:n.glyphMarginDecorationLaneCount,lineNumbersLeft:ge,lineNumbersWidth:pe,decorationsLeft:_e,decorationsWidth:fe,contentLeft:ve,contentWidth:we,minimap:Ce,viewportColumn:Te,isWordWrapMinified:be,isViewportWrapping:xe,wrappingColumn:Se,verticalScrollbarWidth:oe,horizontalScrollbarHeight:le,overviewRuler:{top:Ee,width:oe,height:i-2*Ee,right:0}}}},Lf=class extends nf{constructor(){super(B.wrappingStrategy,`wrappingStrategy`,`simple`,{"editor.wrappingStrategy":{enumDescriptions:[x(354,`Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.`),x(355,`Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.`)],type:`string`,enum:[`simple`,`advanced`],default:`simple`,description:x(356,`Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.`)}})}validate(e){return ff(e,`simple`,[`simple`,`advanced`])}compute(e,t,n){return t.get(B.accessibilitySupport)===$d.Enabled?`advanced`:n}},Rf;(function(e){e.Off=`off`,e.OnCode=`onCode`,e.On=`on`})(Rf||={});var zf=class extends nf{constructor(){let e={enabled:Rf.OnCode};super(B.lightbulb,`lightbulb`,e,{"editor.lightbulb.enabled":{type:`string`,enum:[Rf.Off,Rf.OnCode,Rf.On],default:e.enabled,enumDescriptions:[x(357,`Disable the code action menu.`),x(358,`Show the code action menu when the cursor is on lines with code.`),x(359,`Show the code action menu when the cursor is on lines with code or on empty lines.`)],description:x(360,`Enables the Code Action lightbulb in the editor.`)}})}validate(e){return!e||typeof e!=`object`?this.defaultValue:{enabled:ff(e.enabled,this.defaultValue.enabled,[Rf.Off,Rf.OnCode,Rf.On])}}},Bf=class extends nf{constructor(){let e={enabled:!0,maxLineCount:5,defaultModel:`outlineModel`,scrollWithEditor:!0};super(B.stickyScroll,`stickyScroll`,e,{"editor.stickyScroll.enabled":{type:`boolean`,default:e.enabled,description:x(361,`Shows the nested current scopes during the scroll at the top of the editor.`)},"editor.stickyScroll.maxLineCount":{type:`number`,default:e.maxLineCount,minimum:1,maximum:20,description:x(362,`Defines the maximum number of sticky lines to show.`)},"editor.stickyScroll.defaultModel":{type:`string`,enum:[`outlineModel`,`foldingProviderModel`,`indentationModel`],default:e.defaultModel,description:x(363,`Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.`)},"editor.stickyScroll.scrollWithEditor":{type:`boolean`,default:e.scrollWithEditor,description:x(364,`Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:L(t.enabled,this.defaultValue.enabled),maxLineCount:lf.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:ff(t.defaultModel,this.defaultValue.defaultModel,[`outlineModel`,`foldingProviderModel`,`indentationModel`]),scrollWithEditor:L(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},Vf=class extends nf{constructor(){let e={enabled:`on`,fontSize:0,fontFamily:``,padding:!1,maximumLength:43};super(B.inlayHints,`inlayHints`,e,{"editor.inlayHints.enabled":{type:`string`,default:e.enabled,description:x(365,`Enables the inlay hints in the editor.`),enum:[`on`,`onUnlessPressed`,`offUnlessPressed`,`off`],markdownEnumDescriptions:[x(366,`Inlay hints are enabled`),x(367,`Inlay hints are showing by default and hide when holding {0}`,bn?`Ctrl+Option`:`Ctrl+Alt`),x(368,`Inlay hints are hidden by default and show when holding {0}`,bn?`Ctrl+Option`:`Ctrl+Alt`),x(369,`Inlay hints are disabled`)]},"editor.inlayHints.fontSize":{type:`number`,default:e.fontSize,markdownDescription:x(370,`Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.`,"`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:`string`,default:e.fontFamily,markdownDescription:x(371,`Controls font family of inlay hints in the editor. When set to empty, the {0} is used.`,"`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:`boolean`,default:e.padding,description:x(372,`Enables the padding around the inlay hints in the editor.`)},"editor.inlayHints.maximumLength":{type:`number`,default:e.maximumLength,markdownDescription:x(373,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return typeof t.enabled==`boolean`&&(t.enabled=t.enabled?`on`:`off`),{enabled:ff(t.enabled,this.defaultValue.enabled,[`on`,`off`,`offUnlessPressed`,`onUnlessPressed`]),fontSize:lf.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:df.string(t.fontFamily,this.defaultValue.fontFamily),padding:L(t.padding,this.defaultValue.padding),maximumLength:lf.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,2**53-1)}}},Hf=class extends nf{constructor(){super(B.lineDecorationsWidth,`lineDecorationsWidth`,10)}validate(e){return typeof e==`string`&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):lf.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?lf.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}},Uf=class extends uf{constructor(){super(B.lineHeight,`lineHeight`,rd.lineHeight,e=>uf.clamp(e,0,150),{markdownDescription:x(374,`Controls the line height.
74
- - Use 0 to automatically compute the line height from the font size.
75
- - Values between 0 and 8 will be used as a multiplier with the font size.
76
- - Values greater than or equal to 8 will be used as effective values.`)},0,150)}compute(e,t,n){return e.fontInfo.lineHeight}},Wf=class extends nf{constructor(){let e={enabled:!0,size:`proportional`,side:`right`,showSlider:`mouseover`,autohide:`none`,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:`\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$`,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(B.minimap,`minimap`,e,{"editor.minimap.enabled":{type:`boolean`,default:e.enabled,description:x(375,`Controls whether the minimap is shown.`)},"editor.minimap.autohide":{type:`string`,enum:[`none`,`mouseover`,`scroll`],enumDescriptions:[x(376,`The minimap is always shown.`),x(377,`The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap.`),x(378,`The minimap is only shown when the editor is scrolled`)],default:e.autohide,description:x(379,`Controls whether the minimap is hidden automatically.`)},"editor.minimap.size":{type:`string`,enum:[`proportional`,`fill`,`fit`],enumDescriptions:[x(380,`The minimap has the same size as the editor contents (and might scroll).`),x(381,`The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling).`),x(382,`The minimap will shrink as necessary to never be larger than the editor (no scrolling).`)],default:e.size,description:x(383,`Controls the size of the minimap.`)},"editor.minimap.side":{type:`string`,enum:[`left`,`right`],default:e.side,description:x(384,`Controls the side where to render the minimap.`)},"editor.minimap.showSlider":{type:`string`,enum:[`always`,`mouseover`],default:e.showSlider,description:x(385,`Controls when the minimap slider is shown.`)},"editor.minimap.scale":{type:`number`,default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:x(386,`Scale of content drawn in the minimap: 1, 2 or 3.`)},"editor.minimap.renderCharacters":{type:`boolean`,default:e.renderCharacters,description:x(387,`Render the actual characters on a line as opposed to color blocks.`)},"editor.minimap.maxColumn":{type:`number`,default:e.maxColumn,description:x(388,`Limit the width of the minimap to render at most a certain number of columns.`)},"editor.minimap.showRegionSectionHeaders":{type:`boolean`,default:e.showRegionSectionHeaders,description:x(389,`Controls whether named regions are shown as section headers in the minimap.`)},"editor.minimap.showMarkSectionHeaders":{type:`boolean`,default:e.showMarkSectionHeaders,description:x(390,`Controls whether MARK: comments are shown as section headers in the minimap.`)},"editor.minimap.markSectionHeaderRegex":{type:`string`,default:e.markSectionHeaderRegex,description:x(391,"Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.")},"editor.minimap.sectionHeaderFontSize":{type:`number`,default:e.sectionHeaderFontSize,description:x(392,`Controls the font size of section headers in the minimap.`)},"editor.minimap.sectionHeaderLetterSpacing":{type:`number`,default:e.sectionHeaderLetterSpacing,description:x(393,`Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e,n=this.defaultValue.markSectionHeaderRegex,r=t.markSectionHeaderRegex;if(typeof r==`string`)try{new RegExp(r,`d`),n=r}catch{}return{enabled:L(t.enabled,this.defaultValue.enabled),autohide:ff(t.autohide,this.defaultValue.autohide,[`none`,`mouseover`,`scroll`]),size:ff(t.size,this.defaultValue.size,[`proportional`,`fill`,`fit`]),side:ff(t.side,this.defaultValue.side,[`right`,`left`]),showSlider:ff(t.showSlider,this.defaultValue.showSlider,[`always`,`mouseover`]),renderCharacters:L(t.renderCharacters,this.defaultValue.renderCharacters),scale:lf.clampedInt(t.scale,1,1,3),maxColumn:lf.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:L(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:L(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:n,sectionHeaderFontSize:uf.clamp(uf.float(t.sectionHeaderFontSize,this.defaultValue.sectionHeaderFontSize),4,32),sectionHeaderLetterSpacing:uf.clamp(uf.float(t.sectionHeaderLetterSpacing,this.defaultValue.sectionHeaderLetterSpacing),0,5)}}};function Gf(e){return e===`ctrlCmd`?bn?`metaKey`:`ctrlKey`:`altKey`}var Kf=class extends nf{constructor(){super(B.padding,`padding`,{top:0,bottom:0},{"editor.padding.top":{type:`number`,default:0,minimum:0,maximum:1e3,description:x(394,`Controls the amount of space between the top edge of the editor and the first line.`)},"editor.padding.bottom":{type:`number`,default:0,minimum:0,maximum:1e3,description:x(395,`Controls the amount of space between the bottom edge of the editor and the last line.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{top:lf.clampedInt(t.top,0,0,1e3),bottom:lf.clampedInt(t.bottom,0,0,1e3)}}},qf=class extends nf{constructor(){let e={enabled:!0,cycle:!0};super(B.parameterHints,`parameterHints`,e,{"editor.parameterHints.enabled":{type:`boolean`,default:e.enabled,description:x(396,`Enables a pop-up that shows parameter documentation and type information as you type.`)},"editor.parameterHints.cycle":{type:`boolean`,default:e.cycle,description:x(397,`Controls whether the parameter hints menu cycles or closes when reaching the end of the list.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:L(t.enabled,this.defaultValue.enabled),cycle:L(t.cycle,this.defaultValue.cycle)}}},Jf=class extends of{constructor(){super(B.pixelRatio,1)}compute(e,t,n){return e.pixelRatio}},Yf=class extends nf{constructor(){super(B.placeholder,`placeholder`,void 0)}validate(e){return e===void 0?this.defaultValue:typeof e==`string`?e:this.defaultValue}},Xf=class extends nf{constructor(){let e={other:`offWhenInlineCompletions`,comments:`off`,strings:`off`},t=[{type:`boolean`},{type:`string`,enum:[`on`,`inline`,`off`,`offWhenInlineCompletions`],enumDescriptions:[x(398,`Quick suggestions show inside the suggest widget`),x(399,`Quick suggestions show as ghost text`),x(400,`Quick suggestions are disabled`),x(401,`Quick suggestions are disabled when inline completions are showing`)]}];super(B.quickSuggestions,`quickSuggestions`,e,{anyOf:[{type:`boolean`},{type:`string`,enum:[`on`,`inline`,`off`,`offWhenInlineCompletions`],enumDescriptions:[x(402,`Quick suggestions are enabled for all token types`),x(403,`Quick suggestions show as ghost text for all token types`),x(404,`Quick suggestions are disabled for all token types`),x(405,`Quick suggestions are disabled for all token types when inline completions are showing`)]},{type:`object`,additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:x(406,`Enable quick suggestions inside strings.`)},comments:{anyOf:t,default:e.comments,description:x(407,`Enable quick suggestions inside comments.`)},other:{anyOf:t,default:e.other,description:x(408,`Enable quick suggestions outside of strings and comments.`)}}}],default:e,markdownDescription:x(409,`Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.`,"`#editor.suggestOnTriggerCharacters#`"),experiment:{mode:`auto`}}),this.defaultValue=e}validate(e){if(typeof e==`boolean`){let t=e?`on`:`off`;return{comments:t,strings:t,other:t}}if(typeof e==`string`){let t=ff(e,this.defaultValue.other,[`on`,`inline`,`off`,`offWhenInlineCompletions`]);return{comments:t,strings:t,other:t}}if(!e||typeof e!=`object`)return this.defaultValue;let{other:t,comments:n,strings:r}=e,i=[`on`,`inline`,`off`,`offWhenInlineCompletions`],a,o,s;return a=typeof t==`boolean`?t?`on`:`off`:ff(t,this.defaultValue.other,i),o=typeof n==`boolean`?n?`on`:`off`:ff(n,this.defaultValue.comments,i),s=typeof r==`boolean`?r?`on`:`off`:ff(r,this.defaultValue.strings,i),{other:a,comments:o,strings:s}}},Zf;(function(e){e[e.Off=0]=`Off`,e[e.On=1]=`On`,e[e.Relative=2]=`Relative`,e[e.Interval=3]=`Interval`,e[e.Custom=4]=`Custom`})(Zf||={});var Qf=class extends nf{constructor(){super(B.lineNumbers,`lineNumbers`,{renderType:Zf.On,renderFn:null},{type:`string`,enum:[`off`,`on`,`relative`,`interval`],enumDescriptions:[x(410,`Line numbers are not rendered.`),x(411,`Line numbers are rendered as absolute number.`),x(412,`Line numbers are rendered as distance in lines to cursor position.`),x(413,`Line numbers are rendered every 10 lines.`)],default:`on`,description:x(414,`Controls the display of line numbers.`)})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return e!==void 0&&(typeof e==`function`?(t=Zf.Custom,n=e):t=e===`interval`?Zf.Interval:e===`relative`?Zf.Relative:e===`on`?Zf.On:Zf.Off),{renderType:t,renderFn:n}}},$f=class extends nf{constructor(){let e=[],t={type:`number`,description:x(415,`Number of monospace characters at which this editor ruler will render.`)};super(B.rulers,`rulers`,e,{type:`array`,items:{anyOf:[t,{type:[`object`],properties:{column:t,color:{type:`string`,description:x(416,`Color of this editor ruler.`),format:`color-hex`}}}]},default:e,description:x(417,`Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.`)})}validate(e){if(Array.isArray(e)){let t=[];for(let n of e)if(typeof n==`number`)t.push({column:lf.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n==`object`){let e=n;t.push({column:lf.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}},ep=class extends nf{constructor(){super(B.readOnlyMessage,`readOnlyMessage`,void 0)}validate(e){return!e||typeof e!=`object`?this.defaultValue:e}};function tp(e,t){if(typeof e!=`string`)return t;switch(e){case`hidden`:return Zu.Hidden;case`visible`:return Zu.Visible;default:return Zu.Auto}}var np=class extends nf{constructor(){let e={vertical:Zu.Auto,horizontal:Zu.Auto,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(B.scrollbar,`scrollbar`,e,{"editor.scrollbar.vertical":{type:`string`,enum:[`auto`,`visible`,`hidden`],enumDescriptions:[x(418,`The vertical scrollbar will be visible only when necessary.`),x(419,`The vertical scrollbar will always be visible.`),x(420,`The vertical scrollbar will always be hidden.`)],default:`auto`,description:x(421,`Controls the visibility of the vertical scrollbar.`)},"editor.scrollbar.horizontal":{type:`string`,enum:[`auto`,`visible`,`hidden`],enumDescriptions:[x(422,`The horizontal scrollbar will be visible only when necessary.`),x(423,`The horizontal scrollbar will always be visible.`),x(424,`The horizontal scrollbar will always be hidden.`)],default:`auto`,description:x(425,`Controls the visibility of the horizontal scrollbar.`)},"editor.scrollbar.verticalScrollbarSize":{type:`number`,default:e.verticalScrollbarSize,description:x(426,`The width of the vertical scrollbar.`)},"editor.scrollbar.horizontalScrollbarSize":{type:`number`,default:e.horizontalScrollbarSize,description:x(427,`The height of the horizontal scrollbar.`)},"editor.scrollbar.scrollByPage":{type:`boolean`,default:e.scrollByPage,description:x(428,`Controls whether clicks scroll by page or jump to click position.`)},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:`boolean`,default:e.ignoreHorizontalScrollbarInContentHeight,description:x(429,`When set, the horizontal scrollbar will not increase the size of the editor's content.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e,n=lf.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=lf.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:lf.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:tp(t.vertical,this.defaultValue.vertical),horizontal:tp(t.horizontal,this.defaultValue.horizontal),useShadows:L(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:L(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:L(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:L(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:L(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:lf.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:r,verticalSliderSize:lf.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:L(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:L(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const rp=`inUntrustedWorkspace`,ip={allowedCharacters:`editor.unicodeHighlight.allowedCharacters`,invisibleCharacters:`editor.unicodeHighlight.invisibleCharacters`,nonBasicASCII:`editor.unicodeHighlight.nonBasicASCII`,ambiguousCharacters:`editor.unicodeHighlight.ambiguousCharacters`,includeComments:`editor.unicodeHighlight.includeComments`,includeStrings:`editor.unicodeHighlight.includeStrings`,allowedLocales:`editor.unicodeHighlight.allowedLocales`};var ap=class extends nf{constructor(){let e={nonBasicASCII:rp,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:rp,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(B.unicodeHighlighting,`unicodeHighlight`,e,{[ip.nonBasicASCII]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,rp],default:e.nonBasicASCII,description:x(430,`Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.`)},[ip.invisibleCharacters]:{restricted:!0,type:`boolean`,default:e.invisibleCharacters,description:x(431,`Controls whether characters that just reserve space or have no width at all are highlighted.`)},[ip.ambiguousCharacters]:{restricted:!0,type:`boolean`,default:e.ambiguousCharacters,description:x(432,`Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.`)},[ip.includeComments]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,rp],default:e.includeComments,description:x(433,`Controls whether characters in comments should also be subject to Unicode highlighting.`)},[ip.includeStrings]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,rp],default:e.includeStrings,description:x(434,`Controls whether characters in strings should also be subject to Unicode highlighting.`)},[ip.allowedCharacters]:{restricted:!0,type:`object`,default:e.allowedCharacters,description:x(435,`Defines allowed characters that are not being highlighted.`),additionalProperties:{type:`boolean`}},[ip.allowedLocales]:{restricted:!0,type:`object`,additionalProperties:{type:`boolean`},default:e.allowedLocales,description:x(436,`Unicode characters that are common in allowed locales are not being highlighted.`)}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(sc(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},n=!0)),t.allowedLocales&&e&&(sc(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},n=!0));let r=super.applyUpdate(e,t);return n?new rf(r.newValue,!0):r}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{nonBasicASCII:lp(t.nonBasicASCII,rp,[!0,!1,rp]),invisibleCharacters:L(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:L(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:lp(t.includeComments,rp,[!0,!1,rp]),includeStrings:lp(t.includeStrings,rp,[!0,!1,rp]),allowedCharacters:this.validateBooleanMap(t.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(t.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!=`object`||!e)return t;let n={};for(let[t,r]of Object.entries(e))r===!0&&(n[t]=!0);return n}},op=class extends nf{constructor(){let e={enabled:!0,mode:`subwordSmart`,showToolbar:`onHover`,suppressSuggestions:!1,keepOnBlur:!1,fontFamily:`default`,syntaxHighlightingEnabled:!0,minShowDelay:0,suppressInSnippetMode:!0,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:`auto`,allowCodeShifting:`always`,showLongDistanceHint:!0},triggerCommandOnProviderChange:!1,experimental:{suppressInlineSuggestions:``,showOnSuggestConflict:`never`,emptyResponseInformation:!0}};super(B.inlineSuggest,`inlineSuggest`,e,{"editor.inlineSuggest.enabled":{type:`boolean`,default:e.enabled,description:x(437,`Controls whether to automatically show inline suggestions in the editor.`)},"editor.inlineSuggest.showToolbar":{type:`string`,default:e.showToolbar,enum:[`always`,`onHover`,`never`],enumDescriptions:[x(438,`Show the inline suggestion toolbar whenever an inline suggestion is shown.`),x(439,`Show the inline suggestion toolbar when hovering over an inline suggestion.`),x(440,`Never show the inline suggestion toolbar.`)],description:x(441,`Controls when to show the inline suggestion toolbar.`)},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:`boolean`,default:e.syntaxHighlightingEnabled,description:x(442,`Controls whether to show syntax highlighting for inline suggestions in the editor.`)},"editor.inlineSuggest.suppressSuggestions":{type:`boolean`,default:e.suppressSuggestions,description:x(443,`Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.`)},"editor.inlineSuggest.suppressInSnippetMode":{type:`boolean`,default:e.suppressInSnippetMode,description:x(444,`Controls whether inline suggestions are suppressed when in snippet mode.`)},"editor.inlineSuggest.minShowDelay":{type:`number`,default:0,minimum:0,maximum:1e4,description:x(445,`Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.`)},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:`string`,default:e.experimental.suppressInlineSuggestions,tags:[`experimental`],description:x(446,`Suppresses inline completions for specified extension IDs -- comma separated.`),experiment:{mode:`auto`}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:`boolean`,default:e.experimental.emptyResponseInformation,tags:[`experimental`],description:x(447,`Controls whether to send request information from the inline suggestion provider.`),experiment:{mode:`auto`}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:`boolean`,default:e.triggerCommandOnProviderChange,tags:[`experimental`],description:x(448,`Controls whether to trigger a command when the inline suggestion provider changes.`),experiment:{mode:`auto`}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:`string`,default:e.experimental.showOnSuggestConflict,tags:[`experimental`],enum:[`always`,`never`,`whenSuggestListIsIncomplete`],description:x(449,`Controls whether to show inline suggestions when there is a suggest conflict.`),experiment:{mode:`auto`}},"editor.inlineSuggest.fontFamily":{type:`string`,default:e.fontFamily,description:x(450,`Controls the font family of the inline suggestions.`)},"editor.inlineSuggest.edits.allowCodeShifting":{type:`string`,default:e.edits.allowCodeShifting,description:x(451,`Controls whether showing a suggestion will shift the code to make space for the suggestion inline.`),enum:[`always`,`horizontal`,`never`],tags:[`nextEditSuggestions`]},"editor.inlineSuggest.edits.showLongDistanceHint":{type:`boolean`,default:e.edits.showLongDistanceHint,description:x(452,`Controls whether long distance inline suggestions are shown.`),tags:[`nextEditSuggestions`,`experimental`]},"editor.inlineSuggest.edits.renderSideBySide":{type:`string`,default:e.edits.renderSideBySide,description:x(453,`Controls whether larger suggestions can be shown side by side.`),enum:[`auto`,`never`],enumDescriptions:[x(454,`Larger suggestions will show side by side if there is enough space, otherwise they will be shown below.`),x(455,`Larger suggestions are never shown side by side and will always be shown below.`)],tags:[`nextEditSuggestions`]},"editor.inlineSuggest.edits.showCollapsed":{type:`boolean`,default:e.edits.showCollapsed,description:x(456,`Controls whether the suggestion will show as collapsed until jumping to it.`),tags:[`nextEditSuggestions`]}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:L(t.enabled,this.defaultValue.enabled),mode:ff(t.mode,this.defaultValue.mode,[`prefix`,`subword`,`subwordSmart`]),showToolbar:ff(t.showToolbar,this.defaultValue.showToolbar,[`always`,`onHover`,`never`]),suppressSuggestions:L(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:L(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:df.string(t.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:L(t.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:lf.clampedInt(t.minShowDelay,0,0,1e4),suppressInSnippetMode:L(t.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:this._validateEdits(t.edits),triggerCommandOnProviderChange:L(t.triggerCommandOnProviderChange,this.defaultValue.triggerCommandOnProviderChange),experimental:this._validateExperimental(t.experimental)}}_validateEdits(e){if(!e||typeof e!=`object`)return this.defaultValue.edits;let t=e;return{enabled:L(t.enabled,this.defaultValue.edits.enabled),showCollapsed:L(t.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:ff(t.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,[`always`,`horizontal`,`never`]),showLongDistanceHint:L(t.showLongDistanceHint,this.defaultValue.edits.showLongDistanceHint),renderSideBySide:ff(t.renderSideBySide,this.defaultValue.edits.renderSideBySide,[`never`,`auto`])}}_validateExperimental(e){if(!e||typeof e!=`object`)return this.defaultValue.experimental;let t=e;return{suppressInlineSuggestions:df.string(t.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:ff(t.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,[`always`,`never`,`whenSuggestListIsIncomplete`]),emptyResponseInformation:L(t.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}},sp=class extends nf{constructor(){let e={enabled:id.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:id.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(B.bracketPairColorization,`bracketPairColorization`,e,{"editor.bracketPairColorization.enabled":{type:`boolean`,default:e.enabled,markdownDescription:x(457,`Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.`,"`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:`boolean`,default:e.independentColorPoolPerBracketType,description:x(458,`Controls whether each bracket type has its own independent color pool.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:L(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:L(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}},cp=class extends nf{constructor(){let e={bracketPairs:!1,bracketPairsHorizontal:`active`,highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(B.guides,`guides`,e,{"editor.guides.bracketPairs":{type:[`boolean`,`string`],enum:[!0,`active`,!1],enumDescriptions:[x(459,`Enables bracket pair guides.`),x(460,`Enables bracket pair guides only for the active bracket pair.`),x(461,`Disables bracket pair guides.`)],default:e.bracketPairs,description:x(462,`Controls whether bracket pair guides are enabled or not.`)},"editor.guides.bracketPairsHorizontal":{type:[`boolean`,`string`],enum:[!0,`active`,!1],enumDescriptions:[x(463,`Enables horizontal guides as addition to vertical bracket pair guides.`),x(464,`Enables horizontal guides only for the active bracket pair.`),x(465,`Disables horizontal bracket pair guides.`)],default:e.bracketPairsHorizontal,description:x(466,`Controls whether horizontal bracket pair guides are enabled or not.`)},"editor.guides.highlightActiveBracketPair":{type:`boolean`,default:e.highlightActiveBracketPair,description:x(467,`Controls whether the editor should highlight the active bracket pair.`)},"editor.guides.indentation":{type:`boolean`,default:e.indentation,description:x(468,`Controls whether the editor should render indent guides.`)},"editor.guides.highlightActiveIndentation":{type:[`boolean`,`string`],enum:[!0,`always`,!1],enumDescriptions:[x(469,`Highlights the active indent guide.`),x(470,`Highlights the active indent guide even if bracket guides are highlighted.`),x(471,`Do not highlight the active indent guide.`)],default:e.highlightActiveIndentation,description:x(472,`Controls whether the editor should highlight the active indent guide.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{bracketPairs:lp(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,`active`]),bracketPairsHorizontal:lp(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,`active`]),highlightActiveBracketPair:L(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:L(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:lp(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,`always`])}}};function lp(e,t,n){let r=n.indexOf(e);return r===-1?t:n[r]}var up=class extends nf{constructor(){let e={insertMode:`insert`,filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:`always`,showIcons:!0,showStatusBar:!1,preview:!1,previewMode:`subwordSmart`,showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(B.suggest,`suggest`,e,{"editor.suggest.insertMode":{type:`string`,enum:[`insert`,`replace`],enumDescriptions:[x(473,`Insert suggestion without overwriting text right of the cursor.`),x(474,`Insert suggestion and overwrite text right of the cursor.`)],default:e.insertMode,description:x(475,`Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.`)},"editor.suggest.filterGraceful":{type:`boolean`,default:e.filterGraceful,description:x(476,`Controls whether filtering and sorting suggestions accounts for small typos.`)},"editor.suggest.localityBonus":{type:`boolean`,default:e.localityBonus,description:x(477,`Controls whether sorting favors words that appear close to the cursor.`)},"editor.suggest.shareSuggestSelections":{type:`boolean`,default:e.shareSuggestSelections,markdownDescription:x(478,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:`string`,enum:[`always`,`never`,`whenTriggerCharacter`,`whenQuickSuggestion`],enumDescriptions:[x(479,`Always select a suggestion when automatically triggering IntelliSense.`),x(480,`Never select a suggestion when automatically triggering IntelliSense.`),x(481,`Select a suggestion only when triggering IntelliSense from a trigger character.`),x(482,`Select a suggestion only when triggering IntelliSense as you type.`)],default:e.selectionMode,markdownDescription:x(483,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:`boolean`,default:e.snippetsPreventQuickSuggestions,description:x(484,`Controls whether an active snippet prevents quick suggestions.`)},"editor.suggest.showIcons":{type:`boolean`,default:e.showIcons,description:x(485,`Controls whether to show or hide icons in suggestions.`)},"editor.suggest.showStatusBar":{type:`boolean`,default:e.showStatusBar,description:x(486,`Controls the visibility of the status bar at the bottom of the suggest widget.`)},"editor.suggest.preview":{type:`boolean`,default:e.preview,description:x(487,`Controls whether to preview the suggestion outcome in the editor.`)},"editor.suggest.showInlineDetails":{type:`boolean`,default:e.showInlineDetails,description:x(488,`Controls whether suggest details show inline with the label or only in the details widget.`)},"editor.suggest.maxVisibleSuggestions":{type:`number`,deprecationMessage:x(489,`This setting is deprecated. The suggest widget can now be resized.`)},"editor.suggest.filteredTypes":{type:`object`,deprecationMessage:x(490,`This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.`)},"editor.suggest.showMethods":{type:`boolean`,default:!0,markdownDescription:x(491,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:`boolean`,default:!0,markdownDescription:x(492,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:`boolean`,default:!0,markdownDescription:x(493,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:`boolean`,default:!0,markdownDescription:x(494,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:`boolean`,default:!0,markdownDescription:x(495,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:`boolean`,default:!0,markdownDescription:x(496,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:`boolean`,default:!0,markdownDescription:x(497,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:`boolean`,default:!0,markdownDescription:x(498,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:`boolean`,default:!0,markdownDescription:x(499,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:`boolean`,default:!0,markdownDescription:x(500,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:`boolean`,default:!0,markdownDescription:x(501,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:`boolean`,default:!0,markdownDescription:x(502,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:`boolean`,default:!0,markdownDescription:x(503,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:`boolean`,default:!0,markdownDescription:x(504,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:`boolean`,default:!0,markdownDescription:x(505,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:`boolean`,default:!0,markdownDescription:x(506,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:`boolean`,default:!0,markdownDescription:x(507,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:`boolean`,default:!0,markdownDescription:x(508,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:`boolean`,default:!0,markdownDescription:x(509,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:`boolean`,default:!0,markdownDescription:x(510,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:`boolean`,default:!0,markdownDescription:x(511,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:`boolean`,default:!0,markdownDescription:x(512,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:`boolean`,default:!0,markdownDescription:x(513,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:`boolean`,default:!0,markdownDescription:x(514,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:`boolean`,default:!0,markdownDescription:x(515,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:`boolean`,default:!0,markdownDescription:x(516,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:`boolean`,default:!0,markdownDescription:x(517,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:`boolean`,default:!0,markdownDescription:x(518,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:`boolean`,default:!0,markdownDescription:x(519,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:`boolean`,default:!0,markdownDescription:x(520,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{insertMode:ff(t.insertMode,this.defaultValue.insertMode,[`insert`,`replace`]),filterGraceful:L(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:L(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:L(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:L(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:ff(t.selectionMode,this.defaultValue.selectionMode,[`always`,`never`,`whenQuickSuggestion`,`whenTriggerCharacter`]),showIcons:L(t.showIcons,this.defaultValue.showIcons),showStatusBar:L(t.showStatusBar,this.defaultValue.showStatusBar),preview:L(t.preview,this.defaultValue.preview),previewMode:ff(t.previewMode,this.defaultValue.previewMode,[`prefix`,`subword`,`subwordSmart`]),showInlineDetails:L(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:L(t.showMethods,this.defaultValue.showMethods),showFunctions:L(t.showFunctions,this.defaultValue.showFunctions),showConstructors:L(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:L(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:L(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:L(t.showFields,this.defaultValue.showFields),showVariables:L(t.showVariables,this.defaultValue.showVariables),showClasses:L(t.showClasses,this.defaultValue.showClasses),showStructs:L(t.showStructs,this.defaultValue.showStructs),showInterfaces:L(t.showInterfaces,this.defaultValue.showInterfaces),showModules:L(t.showModules,this.defaultValue.showModules),showProperties:L(t.showProperties,this.defaultValue.showProperties),showEvents:L(t.showEvents,this.defaultValue.showEvents),showOperators:L(t.showOperators,this.defaultValue.showOperators),showUnits:L(t.showUnits,this.defaultValue.showUnits),showValues:L(t.showValues,this.defaultValue.showValues),showConstants:L(t.showConstants,this.defaultValue.showConstants),showEnums:L(t.showEnums,this.defaultValue.showEnums),showEnumMembers:L(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:L(t.showKeywords,this.defaultValue.showKeywords),showWords:L(t.showWords,this.defaultValue.showWords),showColors:L(t.showColors,this.defaultValue.showColors),showFiles:L(t.showFiles,this.defaultValue.showFiles),showReferences:L(t.showReferences,this.defaultValue.showReferences),showFolders:L(t.showFolders,this.defaultValue.showFolders),showTypeParameters:L(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:L(t.showSnippets,this.defaultValue.showSnippets),showUsers:L(t.showUsers,this.defaultValue.showUsers),showIssues:L(t.showIssues,this.defaultValue.showIssues)}}},dp=class extends nf{constructor(){super(B.smartSelect,`smartSelect`,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:x(521,`Whether leading and trailing whitespace should always be selected.`),default:!0,type:`boolean`},"editor.smartSelect.selectSubwords":{description:x(522,`Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected.`),default:!0,type:`boolean`}})}validate(e){return!e||typeof e!=`object`?this.defaultValue:{selectLeadingAndTrailingWhitespace:L(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:L(e.selectSubwords,this.defaultValue.selectSubwords)}}},fp=class extends nf{constructor(){let e=[];super(B.wordSegmenterLocales,`wordSegmenterLocales`,e,{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}],description:x(523,`Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.).`),type:`array`,items:{type:`string`},default:e})}validate(e){if(typeof e==`string`&&(e=[e]),Array.isArray(e)){let t=[];for(let n of e)if(typeof n==`string`)try{Intl.Segmenter.supportedLocalesOf(n).length>0&&t.push(n)}catch{}return t}return this.defaultValue}},pp;(function(e){e[e.None=0]=`None`,e[e.Same=1]=`Same`,e[e.Indent=2]=`Indent`,e[e.DeepIndent=3]=`DeepIndent`})(pp||={});var mp=class extends nf{constructor(){super(B.wrappingIndent,`wrappingIndent`,pp.Same,{"editor.wrappingIndent":{type:`string`,enum:[`none`,`same`,`indent`,`deepIndent`],enumDescriptions:[x(524,`No indentation. Wrapped lines begin at column 1.`),x(525,`Wrapped lines get the same indentation as the parent.`),x(526,`Wrapped lines get +1 indentation toward the parent.`),x(527,`Wrapped lines get +2 indentation toward the parent.`)],description:x(528,`Controls the indentation of wrapped lines.`),default:`same`}})}validate(e){switch(e){case`none`:return pp.None;case`same`:return pp.Same;case`indent`:return pp.Indent;case`deepIndent`:return pp.DeepIndent}return pp.Same}compute(e,t,n){return t.get(B.accessibilitySupport)===$d.Enabled?pp.None:n}},hp=class extends of{constructor(){super(B.wrappingInfo,{isDominatedByLongLines:!1,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1})}compute(e,t,n){let r=t.get(B.layoutInfo);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}},gp=class extends nf{constructor(){let e={enabled:!0,showDropSelector:`afterDrop`};super(B.dropIntoEditor,`dropIntoEditor`,e,{"editor.dropIntoEditor.enabled":{type:`boolean`,default:e.enabled,markdownDescription:x(529,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:`string`,markdownDescription:x(530,`Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped.`),enum:[`afterDrop`,`never`],enumDescriptions:[x(531,`Show the drop selector widget after a file is dropped into the editor.`),x(532,`Never show the drop selector widget. Instead the default drop provider is always used.`)],default:`afterDrop`}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:L(t.enabled,this.defaultValue.enabled),showDropSelector:ff(t.showDropSelector,this.defaultValue.showDropSelector,[`afterDrop`,`never`])}}},_p=class extends nf{constructor(){let e={enabled:!0,showPasteSelector:`afterPaste`};super(B.pasteAs,`pasteAs`,e,{"editor.pasteAs.enabled":{type:`boolean`,default:e.enabled,markdownDescription:x(533,`Controls whether you can paste content in different ways.`)},"editor.pasteAs.showPasteSelector":{type:`string`,markdownDescription:x(534,`Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted.`),enum:[`afterPaste`,`never`],enumDescriptions:[x(535,`Show the paste selector widget after content is pasted into the editor.`),x(536,`Never show the paste selector widget. Instead the default pasting behavior is always used.`)],default:`afterPaste`}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:L(t.enabled,this.defaultValue.enabled),showPasteSelector:ff(t.showPasteSelector,this.defaultValue.showPasteSelector,[`afterPaste`,`never`])}}};const vp=[];function z(e){return vp[e.id]=e,e}var B;(function(e){e[e.acceptSuggestionOnCommitCharacter=0]=`acceptSuggestionOnCommitCharacter`,e[e.acceptSuggestionOnEnter=1]=`acceptSuggestionOnEnter`,e[e.accessibilitySupport=2]=`accessibilitySupport`,e[e.accessibilityPageSize=3]=`accessibilityPageSize`,e[e.allowOverflow=4]=`allowOverflow`,e[e.allowVariableLineHeights=5]=`allowVariableLineHeights`,e[e.allowVariableFonts=6]=`allowVariableFonts`,e[e.allowVariableFontsInAccessibilityMode=7]=`allowVariableFontsInAccessibilityMode`,e[e.ariaLabel=8]=`ariaLabel`,e[e.ariaRequired=9]=`ariaRequired`,e[e.autoClosingBrackets=10]=`autoClosingBrackets`,e[e.autoClosingComments=11]=`autoClosingComments`,e[e.screenReaderAnnounceInlineSuggestion=12]=`screenReaderAnnounceInlineSuggestion`,e[e.autoClosingDelete=13]=`autoClosingDelete`,e[e.autoClosingOvertype=14]=`autoClosingOvertype`,e[e.autoClosingQuotes=15]=`autoClosingQuotes`,e[e.autoIndent=16]=`autoIndent`,e[e.autoIndentOnPaste=17]=`autoIndentOnPaste`,e[e.autoIndentOnPasteWithinString=18]=`autoIndentOnPasteWithinString`,e[e.automaticLayout=19]=`automaticLayout`,e[e.autoSurround=20]=`autoSurround`,e[e.bracketPairColorization=21]=`bracketPairColorization`,e[e.guides=22]=`guides`,e[e.codeLens=23]=`codeLens`,e[e.codeLensFontFamily=24]=`codeLensFontFamily`,e[e.codeLensFontSize=25]=`codeLensFontSize`,e[e.colorDecorators=26]=`colorDecorators`,e[e.colorDecoratorsLimit=27]=`colorDecoratorsLimit`,e[e.columnSelection=28]=`columnSelection`,e[e.comments=29]=`comments`,e[e.contextmenu=30]=`contextmenu`,e[e.copyWithSyntaxHighlighting=31]=`copyWithSyntaxHighlighting`,e[e.cursorBlinking=32]=`cursorBlinking`,e[e.cursorSmoothCaretAnimation=33]=`cursorSmoothCaretAnimation`,e[e.cursorStyle=34]=`cursorStyle`,e[e.cursorSurroundingLines=35]=`cursorSurroundingLines`,e[e.cursorSurroundingLinesStyle=36]=`cursorSurroundingLinesStyle`,e[e.cursorWidth=37]=`cursorWidth`,e[e.cursorHeight=38]=`cursorHeight`,e[e.disableLayerHinting=39]=`disableLayerHinting`,e[e.disableMonospaceOptimizations=40]=`disableMonospaceOptimizations`,e[e.domReadOnly=41]=`domReadOnly`,e[e.dragAndDrop=42]=`dragAndDrop`,e[e.dropIntoEditor=43]=`dropIntoEditor`,e[e.editContext=44]=`editContext`,e[e.emptySelectionClipboard=45]=`emptySelectionClipboard`,e[e.experimentalGpuAcceleration=46]=`experimentalGpuAcceleration`,e[e.experimentalWhitespaceRendering=47]=`experimentalWhitespaceRendering`,e[e.extraEditorClassName=48]=`extraEditorClassName`,e[e.fastScrollSensitivity=49]=`fastScrollSensitivity`,e[e.find=50]=`find`,e[e.fixedOverflowWidgets=51]=`fixedOverflowWidgets`,e[e.folding=52]=`folding`,e[e.foldingStrategy=53]=`foldingStrategy`,e[e.foldingHighlight=54]=`foldingHighlight`,e[e.foldingImportsByDefault=55]=`foldingImportsByDefault`,e[e.foldingMaximumRegions=56]=`foldingMaximumRegions`,e[e.unfoldOnClickAfterEndOfLine=57]=`unfoldOnClickAfterEndOfLine`,e[e.fontFamily=58]=`fontFamily`,e[e.fontInfo=59]=`fontInfo`,e[e.fontLigatures=60]=`fontLigatures`,e[e.fontSize=61]=`fontSize`,e[e.fontWeight=62]=`fontWeight`,e[e.fontVariations=63]=`fontVariations`,e[e.formatOnPaste=64]=`formatOnPaste`,e[e.formatOnType=65]=`formatOnType`,e[e.glyphMargin=66]=`glyphMargin`,e[e.gotoLocation=67]=`gotoLocation`,e[e.hideCursorInOverviewRuler=68]=`hideCursorInOverviewRuler`,e[e.hover=69]=`hover`,e[e.inDiffEditor=70]=`inDiffEditor`,e[e.inlineSuggest=71]=`inlineSuggest`,e[e.letterSpacing=72]=`letterSpacing`,e[e.lightbulb=73]=`lightbulb`,e[e.lineDecorationsWidth=74]=`lineDecorationsWidth`,e[e.lineHeight=75]=`lineHeight`,e[e.lineNumbers=76]=`lineNumbers`,e[e.lineNumbersMinChars=77]=`lineNumbersMinChars`,e[e.linkedEditing=78]=`linkedEditing`,e[e.links=79]=`links`,e[e.matchBrackets=80]=`matchBrackets`,e[e.minimap=81]=`minimap`,e[e.mouseStyle=82]=`mouseStyle`,e[e.mouseWheelScrollSensitivity=83]=`mouseWheelScrollSensitivity`,e[e.mouseWheelZoom=84]=`mouseWheelZoom`,e[e.multiCursorMergeOverlapping=85]=`multiCursorMergeOverlapping`,e[e.multiCursorModifier=86]=`multiCursorModifier`,e[e.mouseMiddleClickAction=87]=`mouseMiddleClickAction`,e[e.multiCursorPaste=88]=`multiCursorPaste`,e[e.multiCursorLimit=89]=`multiCursorLimit`,e[e.occurrencesHighlight=90]=`occurrencesHighlight`,e[e.occurrencesHighlightDelay=91]=`occurrencesHighlightDelay`,e[e.overtypeCursorStyle=92]=`overtypeCursorStyle`,e[e.overtypeOnPaste=93]=`overtypeOnPaste`,e[e.overviewRulerBorder=94]=`overviewRulerBorder`,e[e.overviewRulerLanes=95]=`overviewRulerLanes`,e[e.padding=96]=`padding`,e[e.pasteAs=97]=`pasteAs`,e[e.parameterHints=98]=`parameterHints`,e[e.peekWidgetDefaultFocus=99]=`peekWidgetDefaultFocus`,e[e.placeholder=100]=`placeholder`,e[e.definitionLinkOpensInPeek=101]=`definitionLinkOpensInPeek`,e[e.quickSuggestions=102]=`quickSuggestions`,e[e.quickSuggestionsDelay=103]=`quickSuggestionsDelay`,e[e.readOnly=104]=`readOnly`,e[e.readOnlyMessage=105]=`readOnlyMessage`,e[e.renameOnType=106]=`renameOnType`,e[e.renderRichScreenReaderContent=107]=`renderRichScreenReaderContent`,e[e.renderControlCharacters=108]=`renderControlCharacters`,e[e.renderFinalNewline=109]=`renderFinalNewline`,e[e.renderLineHighlight=110]=`renderLineHighlight`,e[e.renderLineHighlightOnlyWhenFocus=111]=`renderLineHighlightOnlyWhenFocus`,e[e.renderValidationDecorations=112]=`renderValidationDecorations`,e[e.renderWhitespace=113]=`renderWhitespace`,e[e.revealHorizontalRightPadding=114]=`revealHorizontalRightPadding`,e[e.roundedSelection=115]=`roundedSelection`,e[e.rulers=116]=`rulers`,e[e.scrollbar=117]=`scrollbar`,e[e.scrollBeyondLastColumn=118]=`scrollBeyondLastColumn`,e[e.scrollBeyondLastLine=119]=`scrollBeyondLastLine`,e[e.scrollPredominantAxis=120]=`scrollPredominantAxis`,e[e.selectionClipboard=121]=`selectionClipboard`,e[e.selectionHighlight=122]=`selectionHighlight`,e[e.selectionHighlightMaxLength=123]=`selectionHighlightMaxLength`,e[e.selectionHighlightMultiline=124]=`selectionHighlightMultiline`,e[e.selectOnLineNumbers=125]=`selectOnLineNumbers`,e[e.showFoldingControls=126]=`showFoldingControls`,e[e.showUnused=127]=`showUnused`,e[e.snippetSuggestions=128]=`snippetSuggestions`,e[e.smartSelect=129]=`smartSelect`,e[e.smoothScrolling=130]=`smoothScrolling`,e[e.stickyScroll=131]=`stickyScroll`,e[e.stickyTabStops=132]=`stickyTabStops`,e[e.stopRenderingLineAfter=133]=`stopRenderingLineAfter`,e[e.suggest=134]=`suggest`,e[e.suggestFontSize=135]=`suggestFontSize`,e[e.suggestLineHeight=136]=`suggestLineHeight`,e[e.suggestOnTriggerCharacters=137]=`suggestOnTriggerCharacters`,e[e.suggestSelection=138]=`suggestSelection`,e[e.tabCompletion=139]=`tabCompletion`,e[e.tabIndex=140]=`tabIndex`,e[e.trimWhitespaceOnDelete=141]=`trimWhitespaceOnDelete`,e[e.unicodeHighlighting=142]=`unicodeHighlighting`,e[e.unusualLineTerminators=143]=`unusualLineTerminators`,e[e.useShadowDOM=144]=`useShadowDOM`,e[e.useTabStops=145]=`useTabStops`,e[e.wordBreak=146]=`wordBreak`,e[e.wordSegmenterLocales=147]=`wordSegmenterLocales`,e[e.wordSeparators=148]=`wordSeparators`,e[e.wordWrap=149]=`wordWrap`,e[e.wordWrapBreakAfterCharacters=150]=`wordWrapBreakAfterCharacters`,e[e.wordWrapBreakBeforeCharacters=151]=`wordWrapBreakBeforeCharacters`,e[e.wordWrapColumn=152]=`wordWrapColumn`,e[e.wordWrapOverride1=153]=`wordWrapOverride1`,e[e.wordWrapOverride2=154]=`wordWrapOverride2`,e[e.wrappingIndent=155]=`wrappingIndent`,e[e.wrappingStrategy=156]=`wrappingStrategy`,e[e.showDeprecated=157]=`showDeprecated`,e[e.inertialScroll=158]=`inertialScroll`,e[e.inlayHints=159]=`inlayHints`,e[e.wrapOnEscapedLineFeeds=160]=`wrapOnEscapedLineFeeds`,e[e.effectiveCursorStyle=161]=`effectiveCursorStyle`,e[e.editorClassName=162]=`editorClassName`,e[e.pixelRatio=163]=`pixelRatio`,e[e.tabFocusMode=164]=`tabFocusMode`,e[e.layoutInfo=165]=`layoutInfo`,e[e.wrappingInfo=166]=`wrappingInfo`,e[e.defaultColorDecorators=167]=`defaultColorDecorators`,e[e.colorDecoratorsActivatedOn=168]=`colorDecoratorsActivatedOn`,e[e.inlineCompletionsAccessibilityVerbose=169]=`inlineCompletionsAccessibilityVerbose`,e[e.effectiveEditContext=170]=`effectiveEditContext`,e[e.scrollOnMiddleClick=171]=`scrollOnMiddleClick`,e[e.effectiveAllowVariableFonts=172]=`effectiveAllowVariableFonts`,e[e.doubleClickSelectsBlock=173]=`doubleClickSelectsBlock`})(B||={}),z(new R(B.acceptSuggestionOnCommitCharacter,`acceptSuggestionOnCommitCharacter`,!0,{markdownDescription:x(537,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),z(new pf(B.acceptSuggestionOnEnter,`acceptSuggestionOnEnter`,`on`,[`on`,`smart`,`off`],{markdownEnumDescriptions:[``,x(538,"Only accept a suggestion with `Enter` when it makes a textual change."),``],markdownDescription:x(539,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),z(new gf),z(new lf(B.accessibilityPageSize,`accessibilityPageSize`,500,1,zi.MAX_SAFE_SMALL_INTEGER,{description:x(540,`Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.`),tags:[`accessibility`]})),z(new R(B.allowOverflow,`allowOverflow`,!0)),z(new R(B.allowVariableLineHeights,`allowVariableLineHeights`,!0,{description:x(541,`Controls whether to allow using variable line heights in the editor.`)})),z(new R(B.allowVariableFonts,`allowVariableFonts`,!0,{description:x(542,`Controls whether to allow using variable fonts in the editor.`)})),z(new R(B.allowVariableFontsInAccessibilityMode,`allowVariableFontsInAccessibilityMode`,!1,{description:x(543,`Controls whether to allow using variable fonts in the editor in the accessibility mode.`),tags:[`accessibility`]})),z(new df(B.ariaLabel,`ariaLabel`,x(544,`Editor content`))),z(new R(B.ariaRequired,`ariaRequired`,!1,void 0)),z(new R(B.screenReaderAnnounceInlineSuggestion,`screenReaderAnnounceInlineSuggestion`,!0,{description:x(545,`Control whether inline suggestions are announced by a screen reader.`),tags:[`accessibility`]})),z(new pf(B.autoClosingBrackets,`autoClosingBrackets`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,x(546,`Use language configurations to determine when to autoclose brackets.`),x(547,`Autoclose brackets only when the cursor is to the left of whitespace.`),``],description:x(548,`Controls whether the editor should automatically close brackets after the user adds an opening bracket.`)})),z(new pf(B.autoClosingComments,`autoClosingComments`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,x(549,`Use language configurations to determine when to autoclose comments.`),x(550,`Autoclose comments only when the cursor is to the left of whitespace.`),``],description:x(551,`Controls whether the editor should automatically close comments after the user adds an opening comment.`)})),z(new pf(B.autoClosingDelete,`autoClosingDelete`,`auto`,[`always`,`auto`,`never`],{enumDescriptions:[``,x(552,`Remove adjacent closing quotes or brackets only if they were automatically inserted.`),``],description:x(553,`Controls whether the editor should remove adjacent closing quotes or brackets when deleting.`)})),z(new pf(B.autoClosingOvertype,`autoClosingOvertype`,`auto`,[`always`,`auto`,`never`],{enumDescriptions:[``,x(554,`Type over closing quotes or brackets only if they were automatically inserted.`),``],description:x(555,`Controls whether the editor should type over closing quotes or brackets.`)})),z(new pf(B.autoClosingQuotes,`autoClosingQuotes`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,x(556,`Use language configurations to determine when to autoclose quotes.`),x(557,`Autoclose quotes only when the cursor is to the left of whitespace.`),``],description:x(558,`Controls whether the editor should automatically close quotes after the user adds an opening quote.`)})),z(new mf(B.autoIndent,`autoIndent`,ef.Full,`full`,[`none`,`keep`,`brackets`,`advanced`,`full`],hf,{enumDescriptions:[x(559,`The editor will not insert indentation automatically.`),x(560,`The editor will keep the current line's indentation.`),x(561,`The editor will keep the current line's indentation and honor language defined brackets.`),x(562,`The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages.`),x(563,`The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.`)],description:x(564,`Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.`)})),z(new R(B.autoIndentOnPaste,`autoIndentOnPaste`,!1,{description:x(565,`Controls whether the editor should automatically auto-indent the pasted content.`)})),z(new R(B.autoIndentOnPasteWithinString,`autoIndentOnPasteWithinString`,!0,{description:x(566,`Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.`)})),z(new R(B.automaticLayout,`automaticLayout`,!1)),z(new pf(B.autoSurround,`autoSurround`,`languageDefined`,[`languageDefined`,`quotes`,`brackets`,`never`],{enumDescriptions:[x(567,`Use language configurations to determine when to automatically surround selections.`),x(568,`Surround with quotes but not brackets.`),x(569,`Surround with brackets but not quotes.`),``],description:x(570,`Controls whether the editor should automatically surround selections when typing quotes or brackets.`)})),z(new sp),z(new cp),z(new R(B.stickyTabStops,`stickyTabStops`,!1,{description:x(571,`Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.`)})),z(new R(B.codeLens,`codeLens`,!0,{description:x(572,`Controls whether the editor shows CodeLens.`)})),z(new df(B.codeLensFontFamily,`codeLensFontFamily`,``,{description:x(573,`Controls the font family for CodeLens.`)})),z(new lf(B.codeLensFontSize,`codeLensFontSize`,0,0,100,{type:`number`,default:0,minimum:0,maximum:100,markdownDescription:x(574,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),z(new R(B.colorDecorators,`colorDecorators`,!0,{description:x(575,`Controls whether the editor should render the inline color decorators and color picker.`)})),z(new pf(B.colorDecoratorsActivatedOn,`colorDecoratorsActivatedOn`,`clickAndHover`,[`clickAndHover`,`hover`,`click`],{enumDescriptions:[x(576,`Make the color picker appear both on click and hover of the color decorator`),x(577,`Make the color picker appear on hover of the color decorator`),x(578,`Make the color picker appear on click of the color decorator`)],description:x(579,`Controls the condition to make a color picker appear from a color decorator.`)})),z(new lf(B.colorDecoratorsLimit,`colorDecoratorsLimit`,500,1,1e6,{markdownDescription:x(580,`Controls the max number of color decorators that can be rendered in an editor at once.`)})),z(new R(B.columnSelection,`columnSelection`,!1,{description:x(581,`Enable that the selection with the mouse and keys is doing column selection.`)})),z(new _f),z(new R(B.contextmenu,`contextmenu`,!0)),z(new R(B.copyWithSyntaxHighlighting,`copyWithSyntaxHighlighting`,!0,{description:x(582,`Controls whether syntax highlighting should be copied into the clipboard.`)})),z(new mf(B.cursorBlinking,`cursorBlinking`,vf.Blink,`blink`,[`blink`,`smooth`,`phase`,`expand`,`solid`],yf,{description:x(583,`Control the cursor animation style.`)})),z(new pf(B.cursorSmoothCaretAnimation,`cursorSmoothCaretAnimation`,`off`,[`off`,`explicit`,`on`],{enumDescriptions:[x(584,`Smooth caret animation is disabled.`),x(585,`Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture.`),x(586,`Smooth caret animation is always enabled.`)],description:x(587,`Controls whether the smooth caret animation should be enabled.`)})),z(new mf(B.cursorStyle,`cursorStyle`,bf.Line,`line`,[`line`,`block`,`underline`,`line-thin`,`block-outline`,`underline-thin`],xf,{description:x(588,`Controls the cursor style in insert input mode.`)})),z(new mf(B.overtypeCursorStyle,`overtypeCursorStyle`,bf.Block,`block`,[`line`,`block`,`underline`,`line-thin`,`block-outline`,`underline-thin`],xf,{description:x(589,`Controls the cursor style in overtype input mode.`)})),z(new lf(B.cursorSurroundingLines,`cursorSurroundingLines`,0,0,zi.MAX_SAFE_SMALL_INTEGER,{description:x(590,`Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.`)})),z(new pf(B.cursorSurroundingLinesStyle,`cursorSurroundingLinesStyle`,`default`,[`default`,`all`],{enumDescriptions:[x(591,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),x(592,"`cursorSurroundingLines` is enforced always.")],markdownDescription:x(593,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),z(new lf(B.cursorWidth,`cursorWidth`,0,0,zi.MAX_SAFE_SMALL_INTEGER,{markdownDescription:x(594,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),z(new lf(B.cursorHeight,`cursorHeight`,0,0,zi.MAX_SAFE_SMALL_INTEGER,{markdownDescription:x(595,"Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.")})),z(new R(B.disableLayerHinting,`disableLayerHinting`,!1)),z(new R(B.disableMonospaceOptimizations,`disableMonospaceOptimizations`,!1)),z(new R(B.domReadOnly,`domReadOnly`,!1)),z(new R(B.doubleClickSelectsBlock,`doubleClickSelectsBlock`,!0,{description:x(596,`Controls whether double-clicking next to a bracket or quote selects the content inside.`)})),z(new R(B.dragAndDrop,`dragAndDrop`,!0,{description:x(597,`Controls whether the editor should allow moving selections via drag and drop.`)})),z(new Cf),z(new gp),z(new R(B.editContext,`editContext`,!0,{description:x(598,`Sets whether the EditContext API should be used instead of the text area to power input in the editor.`),included:zn||Hn||Sn})),z(new R(B.renderRichScreenReaderContent,`renderRichScreenReaderContent`,!1,{markdownDescription:x(599,"Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.")})),z(new Bf),z(new pf(B.experimentalGpuAcceleration,`experimentalGpuAcceleration`,`off`,[`off`,`on`],{tags:[`experimental`],enumDescriptions:[x(600,`Use regular DOM-based rendering.`),x(601,`Use GPU acceleration.`)],description:x(602,`Controls whether to use the experimental GPU acceleration to render the editor.`)})),z(new pf(B.experimentalWhitespaceRendering,`experimentalWhitespaceRendering`,`svg`,[`svg`,`font`,`off`],{enumDescriptions:[x(603,`Use a new rendering method with svgs.`),x(604,`Use a new rendering method with font characters.`),x(605,`Use the stable rendering method.`)],description:x(606,`Controls whether whitespace is rendered with a new, experimental method.`)})),z(new df(B.extraEditorClassName,`extraEditorClassName`,``)),z(new uf(B.fastScrollSensitivity,`fastScrollSensitivity`,5,e=>e<=0?5:e,{markdownDescription:x(607,"Scrolling speed multiplier when pressing `Alt`.")})),z(new wf),z(new R(B.fixedOverflowWidgets,`fixedOverflowWidgets`,!1)),z(new R(B.folding,`folding`,!0,{description:x(608,`Controls whether the editor has code folding enabled.`)})),z(new pf(B.foldingStrategy,`foldingStrategy`,`auto`,[`auto`,`indentation`],{enumDescriptions:[x(609,`Use a language-specific folding strategy if available, else the indentation-based one.`),x(610,`Use the indentation-based folding strategy.`)],description:x(611,`Controls the strategy for computing folding ranges.`)})),z(new R(B.foldingHighlight,`foldingHighlight`,!0,{description:x(612,`Controls whether the editor should highlight folded ranges.`)})),z(new R(B.foldingImportsByDefault,`foldingImportsByDefault`,!1,{description:x(613,`Controls whether the editor automatically collapses import ranges.`)})),z(new lf(B.foldingMaximumRegions,`foldingMaximumRegions`,5e3,10,65e3,{description:x(614,`The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.`)})),z(new R(B.unfoldOnClickAfterEndOfLine,`unfoldOnClickAfterEndOfLine`,!1,{description:x(615,`Controls whether clicking on the empty content after a folded line will unfold the line.`)})),z(new df(B.fontFamily,`fontFamily`,rd.fontFamily,{description:x(616,`Controls the font family.`)})),z(new Df),z(new Tf),z(new jf),z(new Mf),z(new Ef),z(new R(B.formatOnPaste,`formatOnPaste`,!1,{description:x(617,`Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.`)})),z(new R(B.formatOnType,`formatOnType`,!1,{description:x(618,`Controls whether the editor should automatically format the line after typing.`)})),z(new R(B.glyphMargin,`glyphMargin`,!0,{description:x(619,`Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.`)})),z(new Nf),z(new R(B.hideCursorInOverviewRuler,`hideCursorInOverviewRuler`,!1,{description:x(620,`Controls whether the cursor should be hidden in the overview ruler.`)})),z(new Pf),z(new R(B.inDiffEditor,`inDiffEditor`,!1)),z(new R(B.inertialScroll,`inertialScroll`,!1,{description:x(621,`Make scrolling inertial - mostly useful with touchpad on linux.`)})),z(new uf(B.letterSpacing,`letterSpacing`,rd.letterSpacing,e=>uf.clamp(e,-5,20),{description:x(622,`Controls the letter spacing in pixels.`)})),z(new zf),z(new Hf),z(new Uf),z(new Qf),z(new lf(B.lineNumbersMinChars,`lineNumbersMinChars`,5,1,300)),z(new R(B.linkedEditing,`linkedEditing`,!1,{description:x(623,`Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.`)})),z(new R(B.links,`links`,!0,{description:x(624,`Controls whether the editor should detect links and make them clickable.`)})),z(new pf(B.matchBrackets,`matchBrackets`,`always`,[`always`,`near`,`never`],{description:x(625,`Highlight matching brackets.`)})),z(new Wf),z(new pf(B.mouseStyle,`mouseStyle`,`text`,[`text`,`default`,`copy`])),z(new uf(B.mouseWheelScrollSensitivity,`mouseWheelScrollSensitivity`,1,e=>e===0?1:e,{markdownDescription:x(626,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),z(new R(B.mouseWheelZoom,`mouseWheelZoom`,!1,{markdownDescription:bn?x(627,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):x(628,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),z(new R(B.multiCursorMergeOverlapping,`multiCursorMergeOverlapping`,!0,{description:x(629,`Merge multiple cursors when they are overlapping.`)})),z(new mf(B.multiCursorModifier,`multiCursorModifier`,`altKey`,`alt`,[`ctrlCmd`,`alt`],Gf,{markdownEnumDescriptions:[x(630,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),x(631,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:x(632,`The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).`)})),z(new pf(B.mouseMiddleClickAction,`mouseMiddleClickAction`,`default`,[`default`,`openLink`,`ctrlLeftClick`],{description:x(633,`Controls what happens when middle mouse button is clicked in the editor.`)})),z(new pf(B.multiCursorPaste,`multiCursorPaste`,`spread`,[`spread`,`full`],{markdownEnumDescriptions:[x(634,`Each cursor pastes a single line of the text.`),x(635,`Each cursor pastes the full text.`)],markdownDescription:x(636,`Controls pasting when the line count of the pasted text matches the cursor count.`)})),z(new lf(B.multiCursorLimit,`multiCursorLimit`,1e4,1,1e5,{markdownDescription:x(637,`Controls the max number of cursors that can be in an active editor at once.`)})),z(new pf(B.occurrencesHighlight,`occurrencesHighlight`,`singleFile`,[`off`,`singleFile`,`multiFile`],{markdownEnumDescriptions:[x(638,`Does not highlight occurrences.`),x(639,`Highlights occurrences only in the current file.`),x(640,`Experimental: Highlights occurrences across all valid open files.`)],markdownDescription:x(641,`Controls whether occurrences should be highlighted across open files.`)})),z(new lf(B.occurrencesHighlightDelay,`occurrencesHighlightDelay`,0,0,2e3,{description:x(642,`Controls the delay in milliseconds after which occurrences are highlighted.`),tags:[`preview`]})),z(new R(B.overtypeOnPaste,`overtypeOnPaste`,!0,{description:x(643,`Controls whether pasting should overtype.`)})),z(new R(B.overviewRulerBorder,`overviewRulerBorder`,!0,{description:x(644,`Controls whether a border should be drawn around the overview ruler.`)})),z(new lf(B.overviewRulerLanes,`overviewRulerLanes`,3,0,3)),z(new Kf),z(new _p),z(new qf),z(new pf(B.peekWidgetDefaultFocus,`peekWidgetDefaultFocus`,`tree`,[`tree`,`editor`],{enumDescriptions:[x(645,`Focus the tree when opening peek`),x(646,`Focus the editor when opening peek`)],description:x(647,`Controls whether to focus the inline editor or the tree in the peek widget.`)})),z(new Yf),z(new R(B.definitionLinkOpensInPeek,`definitionLinkOpensInPeek`,!1,{description:x(648,`Controls whether the Go to Definition mouse gesture always opens the peek widget.`)})),z(new Xf),z(new lf(B.quickSuggestionsDelay,`quickSuggestionsDelay`,10,0,zi.MAX_SAFE_SMALL_INTEGER,{description:x(649,`Controls the delay in milliseconds after which quick suggestions will show up.`),experiment:{mode:`auto`}})),z(new R(B.readOnly,`readOnly`,!1)),z(new ep),z(new R(B.renameOnType,`renameOnType`,!1,{description:x(650,`Controls whether the editor auto renames on type.`),markdownDeprecationMessage:x(651,"Deprecated, use `#editor.linkedEditing#` instead.")})),z(new R(B.renderControlCharacters,`renderControlCharacters`,!0,{description:x(652,`Controls whether the editor should render control characters.`),restricted:!0})),z(new pf(B.renderFinalNewline,`renderFinalNewline`,xn?`dimmed`:`on`,[`off`,`on`,`dimmed`],{description:x(653,`Render last line number when the file ends with a newline.`)})),z(new pf(B.renderLineHighlight,`renderLineHighlight`,`line`,[`none`,`gutter`,`line`,`all`],{enumDescriptions:[``,``,``,x(654,`Highlights both the gutter and the current line.`)],description:x(655,`Controls how the editor should render the current line highlight.`)})),z(new R(B.renderLineHighlightOnlyWhenFocus,`renderLineHighlightOnlyWhenFocus`,!1,{description:x(656,`Controls if the editor should render the current line highlight only when the editor is focused.`)})),z(new pf(B.renderValidationDecorations,`renderValidationDecorations`,`editable`,[`editable`,`on`,`off`])),z(new pf(B.renderWhitespace,`renderWhitespace`,`selection`,[`none`,`boundary`,`selection`,`trailing`,`all`],{enumDescriptions:[``,x(657,`Render whitespace characters except for single spaces between words.`),x(658,`Render whitespace characters only on selected text.`),x(659,`Render only trailing whitespace characters.`),``],description:x(660,`Controls how the editor should render whitespace characters.`)})),z(new lf(B.revealHorizontalRightPadding,`revealHorizontalRightPadding`,15,0,1e3)),z(new R(B.roundedSelection,`roundedSelection`,!0,{description:x(661,`Controls whether selections should have rounded corners.`)})),z(new $f),z(new np),z(new lf(B.scrollBeyondLastColumn,`scrollBeyondLastColumn`,4,0,zi.MAX_SAFE_SMALL_INTEGER,{description:x(662,`Controls the number of extra characters beyond which the editor will scroll horizontally.`)})),z(new R(B.scrollBeyondLastLine,`scrollBeyondLastLine`,!0,{description:x(663,`Controls whether the editor will scroll beyond the last line.`)})),z(new R(B.scrollOnMiddleClick,`scrollOnMiddleClick`,!1,{description:x(664,`Controls whether the editor will scroll when the middle button is pressed.`)})),z(new R(B.scrollPredominantAxis,`scrollPredominantAxis`,!0,{description:x(665,`Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.`)})),z(new R(B.selectionClipboard,`selectionClipboard`,!0,{description:x(666,`Controls whether the Linux primary clipboard should be supported.`),included:xn})),z(new R(B.selectionHighlight,`selectionHighlight`,!0,{description:x(667,`Controls whether the editor should highlight matches similar to the selection.`)})),z(new lf(B.selectionHighlightMaxLength,`selectionHighlightMaxLength`,200,0,zi.MAX_SAFE_SMALL_INTEGER,{description:x(668,`Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.`)})),z(new R(B.selectionHighlightMultiline,`selectionHighlightMultiline`,!1,{description:x(669,`Controls whether the editor should highlight selection matches that span multiple lines.`)})),z(new R(B.selectOnLineNumbers,`selectOnLineNumbers`,!0)),z(new pf(B.showFoldingControls,`showFoldingControls`,`mouseover`,[`always`,`never`,`mouseover`],{enumDescriptions:[x(670,`Always show the folding controls.`),x(671,`Never show the folding controls and reduce the gutter size.`),x(672,`Only show the folding controls when the mouse is over the gutter.`)],description:x(673,`Controls when the folding controls on the gutter are shown.`)})),z(new R(B.showUnused,`showUnused`,!0,{description:x(674,`Controls fading out of unused code.`)})),z(new R(B.showDeprecated,`showDeprecated`,!0,{description:x(675,`Controls strikethrough deprecated variables.`)})),z(new Vf),z(new pf(B.snippetSuggestions,`snippetSuggestions`,`inline`,[`top`,`bottom`,`inline`,`none`],{enumDescriptions:[x(676,`Show snippet suggestions on top of other suggestions.`),x(677,`Show snippet suggestions below other suggestions.`),x(678,`Show snippets suggestions with other suggestions.`),x(679,`Do not show snippet suggestions.`)],description:x(680,`Controls whether snippets are shown with other suggestions and how they are sorted.`)})),z(new dp),z(new R(B.smoothScrolling,`smoothScrolling`,!1,{description:x(681,`Controls whether the editor will scroll using an animation.`)})),z(new lf(B.stopRenderingLineAfter,`stopRenderingLineAfter`,1e4,-1,zi.MAX_SAFE_SMALL_INTEGER)),z(new up),z(new op),z(new R(B.inlineCompletionsAccessibilityVerbose,`inlineCompletionsAccessibilityVerbose`,!1,{description:x(682,`Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.`)})),z(new lf(B.suggestFontSize,`suggestFontSize`,0,0,1e3,{markdownDescription:x(683,`Font size for the suggest widget. When set to {0}, the value of {1} is used.`,"`0`","`#editor.fontSize#`")})),z(new lf(B.suggestLineHeight,`suggestLineHeight`,0,0,1e3,{markdownDescription:x(684,`Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.`,"`0`","`#editor.lineHeight#`")})),z(new R(B.suggestOnTriggerCharacters,`suggestOnTriggerCharacters`,!0,{description:x(685,`Controls whether suggestions should automatically show up when typing trigger characters.`)})),z(new pf(B.suggestSelection,`suggestSelection`,`first`,[`first`,`recentlyUsed`,`recentlyUsedByPrefix`],{markdownEnumDescriptions:[x(686,`Always select the first suggestion.`),x(687,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),x(688,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:x(689,`Controls how suggestions are pre-selected when showing the suggest list.`)})),z(new pf(B.tabCompletion,`tabCompletion`,`off`,[`on`,`off`,`onlySnippets`],{enumDescriptions:[x(690,`Tab complete will insert the best matching suggestion when pressing tab.`),x(691,`Disable tab completions.`),x(692,`Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.`)],description:x(693,`Enables tab completions.`)})),z(new lf(B.tabIndex,`tabIndex`,0,-1,zi.MAX_SAFE_SMALL_INTEGER)),z(new R(B.trimWhitespaceOnDelete,`trimWhitespaceOnDelete`,!1,{description:x(694,`Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.`)})),z(new ap),z(new pf(B.unusualLineTerminators,`unusualLineTerminators`,`prompt`,[`auto`,`off`,`prompt`],{enumDescriptions:[x(695,`Unusual line terminators are automatically removed.`),x(696,`Unusual line terminators are ignored.`),x(697,`Unusual line terminators prompt to be removed.`)],description:x(698,`Remove unusual line terminators that might cause problems.`)})),z(new R(B.useShadowDOM,`useShadowDOM`,!0)),z(new R(B.useTabStops,`useTabStops`,!0,{description:x(699,`Spaces and tabs are inserted and deleted in alignment with tab stops.`)})),z(new pf(B.wordBreak,`wordBreak`,`normal`,[`normal`,`keepAll`],{markdownEnumDescriptions:[x(700,`Use the default line break rule.`),x(701,`Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.`)],description:x(702,`Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.`)})),z(new fp),z(new df(B.wordSeparators,`wordSeparators`,ad,{description:x(703,`Characters that will be used as word separators when doing word related navigations or operations.`)})),z(new pf(B.wordWrap,`wordWrap`,`off`,[`off`,`on`,`wordWrapColumn`,`bounded`],{markdownEnumDescriptions:[x(704,`Lines will never wrap.`),x(705,`Lines will wrap at the viewport width.`),x(706,"Lines will wrap at `#editor.wordWrapColumn#`."),x(707,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:x(708,`Controls how lines should wrap.`)})),z(new df(B.wordWrapBreakAfterCharacters,`wordWrapBreakAfterCharacters`,` })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」`)),z(new df(B.wordWrapBreakBeforeCharacters,`wordWrapBreakBeforeCharacters`,`([{‘“〈《「『【〔([{「£¥$£¥++`)),z(new lf(B.wordWrapColumn,`wordWrapColumn`,80,1,zi.MAX_SAFE_SMALL_INTEGER,{markdownDescription:x(709,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),z(new pf(B.wordWrapOverride1,`wordWrapOverride1`,`inherit`,[`off`,`on`,`inherit`])),z(new pf(B.wordWrapOverride2,`wordWrapOverride2`,`inherit`,[`off`,`on`,`inherit`])),z(new R(B.wrapOnEscapedLineFeeds,`wrapOnEscapedLineFeeds`,!1,{markdownDescription:x(710,'Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str="hello\\nworld"\n```\nwill be displayed as\n```c\nchar* str="hello\\n\n world"\n```')})),z(new Of),z(new Sf),z(new pf(B.defaultColorDecorators,`defaultColorDecorators`,`auto`,[`auto`,`always`,`never`],{enumDescriptions:[x(711,`Show default color decorators only when no extension provides colors decorators.`),x(712,`Always show default color decorators.`),x(713,`Never show default color decorators.`)],description:x(714,`Controls whether inline color decorations should be shown using the default document color provider.`)})),z(new Jf),z(new R(B.tabFocusMode,`tabFocusMode`,!1,{markdownDescription:x(715,`Controls whether the editor receives tabs or defers them to the workbench for navigation.`)})),z(new If),z(new hp),z(new mp),z(new Lf),z(new kf),z(new Af);var yp=class e{constructor(e,t){this.lineNumber=e,this.column=t}with(t=this.lineNumber,n=this.column){return t===this.lineNumber&&n===this.column?this:new e(t,n)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(t){return e.equals(this,t)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(t){return e.isBefore(this,t)}static isBefore(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column}isBeforeOrEqual(t){return e.isBeforeOrEqual(this,t)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column}static compare(e,t){let n=e.lineNumber|0,r=t.lineNumber|0;return n===r?(e.column|0)-(t.column|0):n-r}clone(){return new e(this.lineNumber,this.column)}toString(){return`(`+this.lineNumber+`,`+this.column+`)`}static lift(t){return new e(t.lineNumber,t.column)}static isIPosition(e){return!!e&&typeof e.lineNumber==`number`&&typeof e.column==`number`}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}},bp=class e{constructor(e,t,n,r){e>n||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}isEmpty(){return e.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(t){return e.containsPosition(this,t)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(t){return e.containsRange(this,t)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(t){return e.strictContainsRange(this,t)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(t){return e.plusRange(this,t)}static plusRange(t,n){let r,i,a,o;return n.startLineNumber<t.startLineNumber?(r=n.startLineNumber,i=n.startColumn):n.startLineNumber===t.startLineNumber?(r=n.startLineNumber,i=Math.min(n.startColumn,t.startColumn)):(r=t.startLineNumber,i=t.startColumn),n.endLineNumber>t.endLineNumber?(a=n.endLineNumber,o=n.endColumn):n.endLineNumber===t.endLineNumber?(a=n.endLineNumber,o=Math.max(n.endColumn,t.endColumn)):(a=t.endLineNumber,o=t.endColumn),new e(r,i,a,o)}intersectRanges(t){return e.intersectRanges(this,t)}static intersectRanges(t,n){let r=t.startLineNumber,i=t.startColumn,a=t.endLineNumber,o=t.endColumn,s=n.startLineNumber,c=n.startColumn,l=n.endLineNumber,u=n.endColumn;return r<s?(r=s,i=c):r===s&&(i=Math.max(i,c)),a>l?(a=l,o=u):a===l&&(o=Math.min(o,u)),r>a||r===a&&i>o?null:new e(r,i,a,o)}equalsRange(t){return e.equalsRange(this,t)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return e.getEndPosition(this)}static getEndPosition(e){return new yp(e.endLineNumber,e.endColumn)}getStartPosition(){return e.getStartPosition(this)}static getStartPosition(e){return new yp(e.startLineNumber,e.startColumn)}toString(){return`[`+this.startLineNumber+`,`+this.startColumn+` -> `+this.endLineNumber+`,`+this.endColumn+`]`}setEndPosition(t,n){return new e(this.startLineNumber,this.startColumn,t,n)}setStartPosition(t,n){return new e(t,n,this.endLineNumber,this.endColumn)}collapseToStart(){return e.collapseToStart(this)}static collapseToStart(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)}collapseToEnd(){return e.collapseToEnd(this)}static collapseToEnd(t){return new e(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)}delta(t){return new e(this.startLineNumber+t,this.startColumn,this.endLineNumber+t,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(t,n=t){return new e(t.lineNumber,t.column,n.lineNumber,n.column)}static lift(t){return t?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber==`number`&&typeof e.startColumn==`number`&&typeof e.endLineNumber==`number`&&typeof e.endColumn==`number`}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static areOnlyIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber-1||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn-1||t.endLineNumber<e.startLineNumber-1||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn-1)}static compareRangesUsingStarts(e,t){if(e&&t){let n=e.startLineNumber|0,r=t.startLineNumber|0;if(n===r){let n=e.startColumn|0,r=t.startColumn|0;if(n===r){let n=e.endLineNumber|0,r=t.endLineNumber|0;return n===r?(e.endColumn|0)-(t.endColumn|0):n-r}return n-r}return n-r}return!!e-+!!t}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}},xp;(function(e){e[e.Null=0]=`Null`,e[e.PlainText=1]=`PlainText`})(xp||={});var Sp;(function(e){e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`})(Sp||={});var Cp;(function(e){e[e.None=0]=`None`,e[e.DefaultForeground=1]=`DefaultForeground`,e[e.DefaultBackground=2]=`DefaultBackground`})(Cp||={});var wp;(function(e){e[e.Other=0]=`Other`,e[e.Comment=1]=`Comment`,e[e.String=2]=`String`,e[e.RegEx=3]=`RegEx`})(wp||={});var Tp;(function(e){e[e.LANGUAGEID_MASK=255]=`LANGUAGEID_MASK`,e[e.TOKEN_TYPE_MASK=768]=`TOKEN_TYPE_MASK`,e[e.BALANCED_BRACKETS_MASK=1024]=`BALANCED_BRACKETS_MASK`,e[e.FONT_STYLE_MASK=30720]=`FONT_STYLE_MASK`,e[e.FOREGROUND_MASK=16744448]=`FOREGROUND_MASK`,e[e.BACKGROUND_MASK=4278190080]=`BACKGROUND_MASK`,e[e.ITALIC_MASK=2048]=`ITALIC_MASK`,e[e.BOLD_MASK=4096]=`BOLD_MASK`,e[e.UNDERLINE_MASK=8192]=`UNDERLINE_MASK`,e[e.STRIKETHROUGH_MASK=16384]=`STRIKETHROUGH_MASK`,e[e.SEMANTIC_USE_ITALIC=1]=`SEMANTIC_USE_ITALIC`,e[e.SEMANTIC_USE_BOLD=2]=`SEMANTIC_USE_BOLD`,e[e.SEMANTIC_USE_UNDERLINE=4]=`SEMANTIC_USE_UNDERLINE`,e[e.SEMANTIC_USE_STRIKETHROUGH=8]=`SEMANTIC_USE_STRIKETHROUGH`,e[e.SEMANTIC_USE_FOREGROUND=16]=`SEMANTIC_USE_FOREGROUND`,e[e.SEMANTIC_USE_BACKGROUND=32]=`SEMANTIC_USE_BACKGROUND`,e[e.LANGUAGEID_OFFSET=0]=`LANGUAGEID_OFFSET`,e[e.TOKEN_TYPE_OFFSET=8]=`TOKEN_TYPE_OFFSET`,e[e.BALANCED_BRACKETS_OFFSET=10]=`BALANCED_BRACKETS_OFFSET`,e[e.FONT_STYLE_OFFSET=11]=`FONT_STYLE_OFFSET`,e[e.FOREGROUND_OFFSET=15]=`FOREGROUND_OFFSET`,e[e.BACKGROUND_OFFSET=24]=`BACKGROUND_OFFSET`})(Tp||={});var Ep=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new S,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),_(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();let n=new Dp(this,e,t);return this._factories.set(e,n),_(()=>{let t=this._factories.get(e);!t||t!==n||(this._factories.delete(e),t.dispose())})}async getOrCreate(e){let t=this.get(e);if(t)return t;let n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;let t=this._factories.get(e);return!!(!t||t.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>Cp.DefaultBackground?this._colorMap[Cp.DefaultBackground]:null}},Dp=class extends y{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||=this._create(),this._resolvePromise}async _create(){let e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}},Op;(function(e){e[e.Increase=0]=`Increase`,e[e.Decrease=1]=`Decrease`})(Op||={});var V;(function(e){e[e.Method=0]=`Method`,e[e.Function=1]=`Function`,e[e.Constructor=2]=`Constructor`,e[e.Field=3]=`Field`,e[e.Variable=4]=`Variable`,e[e.Class=5]=`Class`,e[e.Struct=6]=`Struct`,e[e.Interface=7]=`Interface`,e[e.Module=8]=`Module`,e[e.Property=9]=`Property`,e[e.Event=10]=`Event`,e[e.Operator=11]=`Operator`,e[e.Unit=12]=`Unit`,e[e.Value=13]=`Value`,e[e.Constant=14]=`Constant`,e[e.Enum=15]=`Enum`,e[e.EnumMember=16]=`EnumMember`,e[e.Keyword=17]=`Keyword`,e[e.Text=18]=`Text`,e[e.Color=19]=`Color`,e[e.File=20]=`File`,e[e.Reference=21]=`Reference`,e[e.Customcolor=22]=`Customcolor`,e[e.Folder=23]=`Folder`,e[e.TypeParameter=24]=`TypeParameter`,e[e.User=25]=`User`,e[e.Issue=26]=`Issue`,e[e.Tool=27]=`Tool`,e[e.Snippet=28]=`Snippet`})(V||={});var kp;(function(e){let t=new Map;t.set(V.Method,P.symbolMethod),t.set(V.Function,P.symbolFunction),t.set(V.Constructor,P.symbolConstructor),t.set(V.Field,P.symbolField),t.set(V.Variable,P.symbolVariable),t.set(V.Class,P.symbolClass),t.set(V.Struct,P.symbolStruct),t.set(V.Interface,P.symbolInterface),t.set(V.Module,P.symbolModule),t.set(V.Property,P.symbolProperty),t.set(V.Event,P.symbolEvent),t.set(V.Operator,P.symbolOperator),t.set(V.Unit,P.symbolUnit),t.set(V.Value,P.symbolValue),t.set(V.Enum,P.symbolEnum),t.set(V.Constant,P.symbolConstant),t.set(V.Enum,P.symbolEnum),t.set(V.EnumMember,P.symbolEnumMember),t.set(V.Keyword,P.symbolKeyword),t.set(V.Snippet,P.symbolSnippet),t.set(V.Text,P.symbolText),t.set(V.Color,P.symbolColor),t.set(V.File,P.symbolFile),t.set(V.Reference,P.symbolReference),t.set(V.Customcolor,P.symbolCustomColor),t.set(V.Folder,P.symbolFolder),t.set(V.TypeParameter,P.symbolTypeParameter),t.set(V.User,P.account),t.set(V.Issue,P.issues),t.set(V.Tool,P.tools);function n(e){let n=t.get(e);return n||=(console.info(`No codicon found for CompletionItemKind `+e),P.symbolProperty),n}e.toIcon=n;function r(e){switch(e){case V.Method:return x(837,`Method`);case V.Function:return x(838,`Function`);case V.Constructor:return x(839,`Constructor`);case V.Field:return x(840,`Field`);case V.Variable:return x(841,`Variable`);case V.Class:return x(842,`Class`);case V.Struct:return x(843,`Struct`);case V.Interface:return x(844,`Interface`);case V.Module:return x(845,`Module`);case V.Property:return x(846,`Property`);case V.Event:return x(847,`Event`);case V.Operator:return x(848,`Operator`);case V.Unit:return x(849,`Unit`);case V.Value:return x(850,`Value`);case V.Constant:return x(851,`Constant`);case V.Enum:return x(852,`Enum`);case V.EnumMember:return x(853,`Enum Member`);case V.Keyword:return x(854,`Keyword`);case V.Text:return x(855,`Text`);case V.Color:return x(856,`Color`);case V.File:return x(857,`File`);case V.Reference:return x(858,`Reference`);case V.Customcolor:return x(859,`Custom Color`);case V.Folder:return x(860,`Folder`);case V.TypeParameter:return x(861,`Type Parameter`);case V.User:return x(862,`User`);case V.Issue:return x(863,`Issue`);case V.Tool:return x(864,`Tool`);case V.Snippet:return x(865,`Snippet`);default:return``}}e.toLabel=r;let i=new Map;i.set(`method`,V.Method),i.set(`function`,V.Function),i.set(`constructor`,V.Constructor),i.set(`field`,V.Field),i.set(`variable`,V.Variable),i.set(`class`,V.Class),i.set(`struct`,V.Struct),i.set(`interface`,V.Interface),i.set(`module`,V.Module),i.set(`property`,V.Property),i.set(`event`,V.Event),i.set(`operator`,V.Operator),i.set(`unit`,V.Unit),i.set(`value`,V.Value),i.set(`constant`,V.Constant),i.set(`enum`,V.Enum),i.set(`enum-member`,V.EnumMember),i.set(`enumMember`,V.EnumMember),i.set(`keyword`,V.Keyword),i.set(`snippet`,V.Snippet),i.set(`text`,V.Text),i.set(`color`,V.Color),i.set(`file`,V.File),i.set(`reference`,V.Reference),i.set(`customcolor`,V.Customcolor),i.set(`folder`,V.Folder),i.set(`type-parameter`,V.TypeParameter),i.set(`typeParameter`,V.TypeParameter),i.set(`account`,V.User),i.set(`issue`,V.Issue),i.set(`tool`,V.Tool);function a(e,t){let n=i.get(e);return n===void 0&&!t&&(n=V.Property),n}e.fromString=a})(kp||={});var Ap;(function(e){e[e.Deprecated=1]=`Deprecated`})(Ap||={});var jp;(function(e){e[e.None=0]=`None`,e[e.KeepWhitespace=1]=`KeepWhitespace`,e[e.InsertAsSnippet=4]=`InsertAsSnippet`})(jp||={});var Mp;(function(e){e[e.Word=0]=`Word`,e[e.Line=1]=`Line`,e[e.Suggest=2]=`Suggest`})(Mp||={});var Np;(function(e){e[e.Invoke=0]=`Invoke`,e[e.TriggerCharacter=1]=`TriggerCharacter`,e[e.TriggerForIncompleteCompletions=2]=`TriggerForIncompleteCompletions`})(Np||={});var Pp;(function(e){e[e.Automatic=0]=`Automatic`,e[e.Explicit=1]=`Explicit`})(Pp||={});var Fp;(function(e){e[e.Code=1]=`Code`,e[e.Label=2]=`Label`})(Fp||={});var Ip;(function(e){e[e.Accepted=0]=`Accepted`,e[e.Rejected=1]=`Rejected`,e[e.Ignored=2]=`Ignored`})(Ip||={});var Lp;(function(e){e[e.Invoke=1]=`Invoke`,e[e.Auto=2]=`Auto`})(Lp||={});var Rp;(function(e){e[e.Automatic=0]=`Automatic`,e[e.PasteAs=1]=`PasteAs`})(Rp||={});var zp;(function(e){e[e.Invoke=1]=`Invoke`,e[e.TriggerCharacter=2]=`TriggerCharacter`,e[e.ContentChange=3]=`ContentChange`})(zp||={});var Bp;(function(e){e[e.Text=0]=`Text`,e[e.Read=1]=`Read`,e[e.Write=2]=`Write`})(Bp||={});function Vp(e){return!!e&&w.isUri(e.uri)&&bp.isIRange(e.range)&&(bp.isIRange(e.originSelectionRange)||bp.isIRange(e.targetSelectionRange))}function Hp(e){return!!e&&w.isUri(e.uri)&&bp.isIRange(e.range)}var H;(function(e){e[e.File=0]=`File`,e[e.Module=1]=`Module`,e[e.Namespace=2]=`Namespace`,e[e.Package=3]=`Package`,e[e.Class=4]=`Class`,e[e.Method=5]=`Method`,e[e.Property=6]=`Property`,e[e.Field=7]=`Field`,e[e.Constructor=8]=`Constructor`,e[e.Enum=9]=`Enum`,e[e.Interface=10]=`Interface`,e[e.Function=11]=`Function`,e[e.Variable=12]=`Variable`,e[e.Constant=13]=`Constant`,e[e.String=14]=`String`,e[e.Number=15]=`Number`,e[e.Boolean=16]=`Boolean`,e[e.Array=17]=`Array`,e[e.Object=18]=`Object`,e[e.Key=19]=`Key`,e[e.Null=20]=`Null`,e[e.EnumMember=21]=`EnumMember`,e[e.Struct=22]=`Struct`,e[e.Event=23]=`Event`,e[e.Operator=24]=`Operator`,e[e.TypeParameter=25]=`TypeParameter`})(H||={}),H.Array,x(866,`array`),H.Boolean,x(867,`boolean`),H.Class,x(868,`class`),H.Constant,x(869,`constant`),H.Constructor,x(870,`constructor`),H.Enum,x(871,`enumeration`),H.EnumMember,x(872,`enumeration member`),H.Event,x(873,`event`),H.Field,x(874,`field`),H.File,x(875,`file`),H.Function,x(876,`function`),H.Interface,x(877,`interface`),H.Key,x(878,`key`),H.Method,x(879,`method`),H.Module,x(880,`module`),H.Namespace,x(881,`namespace`),H.Null,x(882,`null`),H.Number,x(883,`number`),H.Object,x(884,`object`),H.Operator,x(885,`operator`),H.Package,x(886,`package`),H.Property,x(887,`property`),H.String,x(888,`string`),H.Struct,x(889,`struct`),H.TypeParameter,x(890,`type parameter`),H.Variable,x(891,`variable`);var Up;(function(e){e[e.Deprecated=1]=`Deprecated`})(Up||={});var Wp;(function(e){let t=new Map;t.set(H.File,P.symbolFile),t.set(H.Module,P.symbolModule),t.set(H.Namespace,P.symbolNamespace),t.set(H.Package,P.symbolPackage),t.set(H.Class,P.symbolClass),t.set(H.Method,P.symbolMethod),t.set(H.Property,P.symbolProperty),t.set(H.Field,P.symbolField),t.set(H.Constructor,P.symbolConstructor),t.set(H.Enum,P.symbolEnum),t.set(H.Interface,P.symbolInterface),t.set(H.Function,P.symbolFunction),t.set(H.Variable,P.symbolVariable),t.set(H.Constant,P.symbolConstant),t.set(H.String,P.symbolString),t.set(H.Number,P.symbolNumber),t.set(H.Boolean,P.symbolBoolean),t.set(H.Array,P.symbolArray),t.set(H.Object,P.symbolObject),t.set(H.Key,P.symbolKey),t.set(H.Null,P.symbolNull),t.set(H.EnumMember,P.symbolEnumMember),t.set(H.Struct,P.symbolStruct),t.set(H.Event,P.symbolEvent),t.set(H.Operator,P.symbolOperator),t.set(H.TypeParameter,P.symbolTypeParameter);function n(e){let n=t.get(e);return n||=(console.info(`No codicon found for SymbolKind `+e),P.symbolProperty),n}e.toIcon=n;let r=new Map;r.set(H.File,V.File),r.set(H.Module,V.Module),r.set(H.Namespace,V.Module),r.set(H.Package,V.Module),r.set(H.Class,V.Class),r.set(H.Method,V.Method),r.set(H.Property,V.Property),r.set(H.Field,V.Field),r.set(H.Constructor,V.Constructor),r.set(H.Enum,V.Enum),r.set(H.Interface,V.Interface),r.set(H.Function,V.Function),r.set(H.Variable,V.Variable),r.set(H.Constant,V.Constant),r.set(H.String,V.Text),r.set(H.Number,V.Value),r.set(H.Boolean,V.Value),r.set(H.Array,V.Value),r.set(H.Object,V.Value),r.set(H.Key,V.Keyword),r.set(H.Null,V.Value),r.set(H.EnumMember,V.EnumMember),r.set(H.Struct,V.Struct),r.set(H.Event,V.Event),r.set(H.Operator,V.Operator),r.set(H.TypeParameter,V.TypeParameter);function i(e){let t=r.get(e);return t===void 0&&(console.info(`No completion kind found for SymbolKind `+e),t=V.File),t}e.toCompletionKind=i})(Wp||={});var Gp=class e{static{this.Comment=new e(`comment`)}static{this.Imports=new e(`imports`)}static{this.Region=new e(`region`)}static fromValue(t){switch(t){case`comment`:return e.Comment;case`imports`:return e.Imports;case`region`:return e.Region}return new e(t)}constructor(e){this.value=e}},Kp;(function(e){e[e.AIGenerated=1]=`AIGenerated`})(Kp||={});var qp;(function(e){e[e.Invoke=0]=`Invoke`,e[e.Automatic=1]=`Automatic`})(qp||={});var Jp;(function(e){function t(e){return!e||typeof e!=`object`?!1:typeof e.id==`string`&&typeof e.title==`string`}e.is=t})(Jp||={});var Yp;(function(e){e[e.Collapsed=0]=`Collapsed`,e[e.Expanded=1]=`Expanded`})(Yp||={});var Xp;(function(e){e[e.Unresolved=0]=`Unresolved`,e[e.Resolved=1]=`Resolved`})(Xp||={});var Zp;(function(e){e[e.Current=0]=`Current`,e[e.Outdated=1]=`Outdated`})(Zp||={});var Qp;(function(e){e[e.Editing=0]=`Editing`,e[e.Preview=1]=`Preview`})(Qp||={});var $p;(function(e){e[e.Published=0]=`Published`,e[e.Draft=1]=`Draft`})($p||={});var em;(function(e){e[e.Type=1]=`Type`,e[e.Parameter=2]=`Parameter`})(em||={}),new Ep;var tm;(function(e){e[e.None=0]=`None`,e[e.Option=1]=`Option`,e[e.Default=2]=`Default`,e[e.Preferred=3]=`Preferred`})(tm||={});var nm;(function(e){e[e.Left=1]=`Left`,e[e.Center=2]=`Center`,e[e.Right=4]=`Right`,e[e.Full=7]=`Full`})(nm||={});var rm;(function(e){e[e.Left=1]=`Left`,e[e.Center=2]=`Center`,e[e.Right=3]=`Right`})(rm||={});var im;(function(e){e[e.Inline=1]=`Inline`,e[e.Gutter=2]=`Gutter`})(im||={});var am;(function(e){e[e.Normal=1]=`Normal`,e[e.Underlined=2]=`Underlined`})(am||={});var om;(function(e){e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`})(om||={});var sm;(function(e){e[e.Both=0]=`Both`,e[e.Right=1]=`Right`,e[e.Left=2]=`Left`,e[e.None=3]=`None`})(sm||={});var cm;(function(e){e[e.TextDefined=0]=`TextDefined`,e[e.LF=1]=`LF`,e[e.CRLF=2]=`CRLF`})(cm||={});var lm;(function(e){e[e.LF=1]=`LF`,e[e.CRLF=2]=`CRLF`})(lm||={});var um;(function(e){e[e.LF=0]=`LF`,e[e.CRLF=1]=`CRLF`})(um||={});var dm=class{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}},fm;(function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]=`AlwaysGrowsWhenTypingAtEdges`,e[e.NeverGrowsWhenTypingAtEdges=1]=`NeverGrowsWhenTypingAtEdges`,e[e.GrowsOnlyWhenTypingBefore=2]=`GrowsOnlyWhenTypingBefore`,e[e.GrowsOnlyWhenTypingAfter=3]=`GrowsOnlyWhenTypingAfter`})(fm||={});var pm;(function(e){e[e.Left=0]=`Left`,e[e.Right=1]=`Right`,e[e.None=2]=`None`,e[e.LeftOfInjectedText=3]=`LeftOfInjectedText`,e[e.RightOfInjectedText=4]=`RightOfInjectedText`})(pm||={});var mm;(function(e){e[e.FIRST_LINE_DETECTION_LENGTH_LIMIT=1e3]=`FIRST_LINE_DETECTION_LENGTH_LIMIT`})(mm||={});var hm=class{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}},gm=class{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}},_m;(function(e){e[e.Unnecessary=1]=`Unnecessary`,e[e.Deprecated=2]=`Deprecated`})(_m||={});var vm;(function(e){e[e.Hint=1]=`Hint`,e[e.Info=2]=`Info`,e[e.Warning=4]=`Warning`,e[e.Error=8]=`Error`})(vm||={}),(function(e){function t(e,t){return t-e}e.compare=t;let n=Object.create(null);n[e.Error]=x(2100,`Error`),n[e.Warning]=x(2101,`Warning`),n[e.Info]=x(2102,`Info`);function r(e){return n[e]||``}e.toString=r;let i=Object.create(null);i[e.Error]=x(2103,`Errors`),i[e.Warning]=x(2104,`Warnings`),i[e.Info]=x(2105,`Infos`);function a(e){return i[e]||``}e.toStringPlural=a;function o(t){switch(t){case Dc.Error:return e.Error;case Dc.Warning:return e.Warning;case Dc.Info:return e.Info;case Dc.Ignore:return e.Hint}}e.fromSeverity=o;function s(t){switch(t){case e.Error:return Dc.Error;case e.Warning:return Dc.Warning;case e.Info:return Dc.Info;case e.Hint:return Dc.Ignore}}e.toSeverity=s})(vm||={});var ym;(function(e){function t(e){return n(e,!0)}e.makeKey=t;function n(e,t){let n=[``];return e.source?n.push(e.source.replace(`¦`,`\\¦`)):n.push(``),e.code?typeof e.code==`string`?n.push(e.code.replace(`¦`,`\\¦`)):n.push(e.code.value.replace(`¦`,`\\¦`)):n.push(``),e.severity!==void 0&&e.severity!==null?n.push(vm.toString(e.severity)):n.push(``),e.message&&t?n.push(e.message.replace(`¦`,`\\¦`)):n.push(``),e.startLineNumber!==void 0&&e.startLineNumber!==null?n.push(e.startLineNumber.toString()):n.push(``),e.startColumn!==void 0&&e.startColumn!==null?n.push(e.startColumn.toString()):n.push(``),e.endLineNumber!==void 0&&e.endLineNumber!==null?n.push(e.endLineNumber.toString()):n.push(``),e.endColumn!==void 0&&e.endColumn!==null?n.push(e.endColumn.toString()):n.push(``),n.push(``),n.join(`¦`)}e.makeKeyOptionalMessage=n})(ym||={});const bm=k(`progressService`);k(`editorProgressService`);var xm;(function(e){e[e.Explorer=1]=`Explorer`,e[e.Scm=3]=`Scm`,e[e.Extensions=5]=`Extensions`,e[e.Window=10]=`Window`,e[e.Notification=15]=`Notification`,e[e.Dialog=20]=`Dialog`})(xm||={}),Object.freeze({total(){},worked(){},done(){}});var Sm=class{static{this.None=Object.freeze({report(){}})}get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};let Cm=class extends y{constructor(e,t){super(),this.deferred=new Ro,t.withProgress(e,e=>(this.reporter=e,this.lastStep&&e.report(this.lastStep),this.deferred.p)),this._register(_(()=>this.deferred.complete()))}report(e){this.reporter?this.reporter.report(e):this.lastStep=e}};Cm=A([j(1,bm)],Cm);const wm=new class{constructor(){this.data=new Map}add(e,t){Ve(Ge(e)),Ve(Je(t)),Ve(!this.data.has(e),`There is already an extension with this id`),this.data.set(e,t)}knows(e){return this.data.has(e)}as(e){return this.data.get(e)||null}dispose(){this.data.forEach(e=>{at(e.dispose)&&e.dispose()}),this.data.clear()}};function Tm(e,t){return t&&(e.stack||e.stacktrace)?x(112,`{0}: {1}`,Dm(e),Em(e.stack)||Em(e.stacktrace)):Dm(e)}function Em(e){return Array.isArray(e)?e.join(`
77
- `):e}function Dm(e){return e.code===`ERR_UNC_HOST_NOT_ALLOWED`?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof e.code==`string`&&typeof e.errno==`number`&&typeof e.syscall==`string`?x(113,`A system error occurred ({0})`,e.message):e.message||x(114,`An unknown error occurred. Please consult the log for more details.`)}function Om(e=null,t=!1){if(!e)return x(114,`An unknown error occurred. Please consult the log for more details.`);if(Array.isArray(e)){let n=pe(e),r=Om(n[0],t);return n.length>1?x(115,`{0} ({1} errors in total)`,r,n.length):r}if(Ge(e))return e;if(e.detail){let n=e.detail;if(n.error)return Tm(n.error,t);if(n.exception)return Tm(n.exception,t)}return e.stack?Tm(e,t):e.message?e.message:x(114,`An unknown error occurred. Please consult the log for more details.`)}var km=class extends y{get onDidChange(){return this._onDidChange.event}constructor(e,t=``,n=``,r=!0,i){super(),this._onDidChange=this._register(new S),this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=r,this._actionCallback=i}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||``}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}};(class e{constructor(){this.id=e.ID,this.label=``,this.tooltip=``,this.class=`separator`,this.enabled=!1,this.checked=void 0}static join(...t){let n=[];for(let r of t)r.length&&(n=n.length?[...n,new e,...r]:r);return n}static clean(t){for(;t.length>0&&t[0].id===e.ID;)t.shift();for(;t.length>0&&t[t.length-1].id===e.ID;)t.pop();for(let n=t.length-2;n>=0;n--)t[n].id===e.ID&&t[n+1].id===e.ID&&t.splice(n+1,1);return t}static{this.ID=`vs.actions.separator`}async run(){}});var Am=class{get actions(){return this._actions}constructor(e,t,n,r){this.tooltip=``,this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=r,this._actions=n}async run(){}};(class e extends km{static{this.ID=`vs.actions.empty`}constructor(){super(e.ID,x(47,`(empty)`),void 0,!1)}});const jm={EditorPane:`workbench.contributions.editors`,EditorFactory:`workbench.contributions.editor.inputFactories`},Mm={id:`default`,displayName:x(4290,`Text Editor`),providerDisplayName:x(4291,`Built-in`)};var Nm;(function(e){e[e.PROGRAMMATIC=1]=`PROGRAMMATIC`,e[e.USER=2]=`USER`,e[e.EDIT=3]=`EDIT`,e[e.NAVIGATION=4]=`NAVIGATION`,e[e.JUMP=5]=`JUMP`})(Nm||={});var Pm;(function(e){e[e.IDENTICAL=1]=`IDENTICAL`,e[e.SIMILAR=2]=`SIMILAR`,e[e.DIFFERENT=3]=`DIFFERENT`})(Pm||={});function Fm(e){if(Um(e))return!1;let t=e;return t?.original!==void 0&&t.modified!==void 0}function Im(e){if(Um(e))return!1;let t=e;return!t||t.resources&&!Array.isArray(t.resources)?!1:!!t.resources||!!t.multiDiffSource}function Lm(e){if(Um(e)||Fm(e))return!1;let t=e;return t?.primary!==void 0&&t.secondary!==void 0}function Rm(e){if(Um(e))return!1;let t=e;return w.isUri(t?.base?.resource)&&w.isUri(t?.input1?.resource)&&w.isUri(t?.input2?.resource)&&w.isUri(t?.result?.resource)}var zm;(function(e){e[e.SHORT=0]=`SHORT`,e[e.MEDIUM=1]=`MEDIUM`,e[e.LONG=2]=`LONG`})(zm||={});var Bm;(function(e){e[e.EXPLICIT=1]=`EXPLICIT`,e[e.AUTO=2]=`AUTO`,e[e.FOCUS_CHANGE=3]=`FOCUS_CHANGE`,e[e.WINDOW_CHANGE=4]=`WINDOW_CHANGE`})(Bm||={}),new class{constructor(){this.mapIdToSaveSource=new Map}registerSource(e,t){let n=this.mapIdToSaveSource.get(e);return n||(n={source:e,label:t},this.mapIdToSaveSource.set(e,n)),n.source}getSourceLabel(e){return this.mapIdToSaveSource.get(e)?.label??e}};var Vm;(function(e){e[e.None=0]=`None`,e[e.Readonly=2]=`Readonly`,e[e.Untitled=4]=`Untitled`,e[e.Singleton=8]=`Singleton`,e[e.RequiresTrust=16]=`RequiresTrust`,e[e.CanSplitInGroup=32]=`CanSplitInGroup`,e[e.ForceDescription=64]=`ForceDescription`,e[e.CanDropIntoEditor=128]=`CanDropIntoEditor`,e[e.MultipleEditors=256]=`MultipleEditors`,e[e.Scratchpad=512]=`Scratchpad`,e[e.ForceReveal=1024]=`ForceReveal`,e[e.RequiresModal=2048]=`RequiresModal`})(Vm||={});var Hm=class extends y{};function Um(e){return e instanceof Hm}function Wm(e){let t=e;return w.isUri(t?.preferredResource)}function Gm(e){let t=e;return Um(t?.primary)&&Um(t?.secondary)}function Km(e){let t=e;return Um(t?.modified)&&Um(t?.original)}var qm;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.REPLACE=1]=`REPLACE`,e[e.MOVE=2]=`MOVE`,e[e.UNPIN=3]=`UNPIN`})(qm||={});var Jm;(function(e){e[e.GROUP_ACTIVE=0]=`GROUP_ACTIVE`,e[e.GROUP_INDEX=1]=`GROUP_INDEX`,e[e.GROUP_LABEL=2]=`GROUP_LABEL`,e[e.GROUP_LOCKED=3]=`GROUP_LOCKED`,e[e.EDITORS_SELECTION=4]=`EDITORS_SELECTION`,e[e.EDITOR_OPEN=5]=`EDITOR_OPEN`,e[e.EDITOR_CLOSE=6]=`EDITOR_CLOSE`,e[e.EDITOR_MOVE=7]=`EDITOR_MOVE`,e[e.EDITOR_ACTIVE=8]=`EDITOR_ACTIVE`,e[e.EDITOR_LABEL=9]=`EDITOR_LABEL`,e[e.EDITOR_CAPABILITIES=10]=`EDITOR_CAPABILITIES`,e[e.EDITOR_PIN=11]=`EDITOR_PIN`,e[e.EDITOR_TRANSIENT=12]=`EDITOR_TRANSIENT`,e[e.EDITOR_STICKY=13]=`EDITOR_STICKY`,e[e.EDITOR_DIRTY=14]=`EDITOR_DIRTY`,e[e.EDITOR_WILL_DISPOSE=15]=`EDITOR_WILL_DISPOSE`})(Jm||={});var Ym;(function(e){e[e.PRIMARY=1]=`PRIMARY`,e[e.SECONDARY=2]=`SECONDARY`,e[e.BOTH=3]=`BOTH`,e[e.ANY=4]=`ANY`})(Ym||={});var Xm=class{getOriginalUri(e,t){if(!e)return;if(Rm(e))return Qm.getOriginalUri(e.result,t);if(t?.supportSideBySide){let{primary:n,secondary:r}=this.getSideEditors(e);if(n&&r){if(t?.supportSideBySide===Ym.BOTH)return{primary:this.getOriginalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(r,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Ym.ANY)return this.getOriginalUri(n,{filterByScheme:t.filterByScheme})??this.getOriginalUri(r,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Ym.PRIMARY?n:r}}if(Fm(e)||Im(e)||Lm(e)||Rm(e))return;let n=Wm(e)?e.preferredResource:e.resource;return!n||!t?.filterByScheme?n:this.filterUri(n,t.filterByScheme)}getSideEditors(e){return Gm(e)||Lm(e)?{primary:e.primary,secondary:e.secondary}:Km(e)||Fm(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(Rm(e))return Qm.getCanonicalUri(e.result,t);if(t?.supportSideBySide){let{primary:n,secondary:r}=this.getSideEditors(e);if(n&&r){if(t?.supportSideBySide===Ym.BOTH)return{primary:this.getCanonicalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(r,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Ym.ANY)return this.getCanonicalUri(n,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(r,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Ym.PRIMARY?n:r}}if(Fm(e)||Im(e)||Lm(e)||Rm(e))return;let n=e.resource;return!n||!t?.filterByScheme?n:this.filterUri(n,t.filterByScheme)}filterUri(e,t){if(Array.isArray(t)){if(t.some(t=>e.scheme===t))return e}else if(t===e.scheme)return e}},Zm;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.KEYBOARD=1]=`KEYBOARD`,e[e.MOUSE=2]=`MOUSE`})(Zm||={});const Qm=new Xm;var $m;(function(e){e[e.LEFT=0]=`LEFT`,e[e.RIGHT=1]=`RIGHT`})($m||={});var eh=class{constructor(){this.editorSerializerConstructors=new Map,this.editorSerializerInstances=new Map}start(e){let t=this.instantiationService=e.get(ws);for(let[e,n]of this.editorSerializerConstructors)this.createEditorSerializer(e,n,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,n){let r=n.createInstance(t);this.editorSerializerInstances.set(e,r)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw Error(`Can only register one file editor factory.`);this.fileEditorFactory=e}getFileEditorFactory(){return nt(this.fileEditorFactory)}registerEditorSerializer(e,t){if(this.editorSerializerConstructors.has(e)||this.editorSerializerInstances.has(e))throw Error(`A editor serializer with type ID '${e}' was already registered.`);return this.instantiationService?this.createEditorSerializer(e,t,this.instantiationService):this.editorSerializerConstructors.set(e,t),_(()=>{this.editorSerializerConstructors.delete(e),this.editorSerializerInstances.delete(e)})}getEditorSerializer(e){return this.editorSerializerInstances.get(typeof e==`string`?e:e.typeId)}};wm.add(jm.EditorFactory,new eh);var th;(function(e){e[e.MOST_RECENTLY_ACTIVE=0]=`MOST_RECENTLY_ACTIVE`,e[e.SEQUENTIAL=1]=`SEQUENTIAL`})(th||={});var nh;(function(e){e[e.Failed=0]=`Failed`,e[e.Completed=1]=`Completed`,e[e.InProgress=2]=`InProgress`,e[e.NeedsInput=3]=`NeedsInput`})(nh||={});var rh;(function(e){e.CopilotCLI=`copilotcli`,e.CopilotCloud=`copilot-cloud-agent`,e.Local=`local`,e.ClaudeCode=`claude-code`,e.Codex=`openai-codex`,e.Growth=`copilot-growth`,e.AgentHostCopilot=`agent-host-copilotcli`})(rh||={});const ih=rh.Local;var ah;(function(e){function t(e){return new Map(Object.entries(e))}e.fromRecord=t;function n(e){let t=Object.create(null),n=i(e);for(let[e,r]of n)t[e]=r;return t}e.toRecord=n;function r(e){if(!e)return;let t=i(e);return Array.from(t,([e,t])=>({optionId:e,value:typeof t==`string`?t:t.id}))}e.toStrValueArray=r;function i(e){return e instanceof Map?e:Object.entries(e)}})(ah||={});var oh;(function(e){e.scheme=O.vscodeLocalChatSession;function t(t){let n=Wt(b.wrap(new TextEncoder().encode(t)),!1,!0);return w.from({scheme:e.scheme,authority:ih,path:`/`+n})}e.forSession=t;function n(){return t(`chat-${Math.floor(Math.random()*1e9)}`)}e.getNewSessionUri=n;function r(e){let t=a(e);return t?.chatSessionType===ih?t.sessionId:void 0}e.parseLocalSessionId=r;function i(e){return!!r(e)}e.isLocalSession=i;function a(t){if(t.scheme!==e.scheme||!t.authority)return;let n=t.path.split(`/`);if(n.length!==2)return;let r=t.authority,i=Ut(n[1]);return{chatSessionType:r,sessionId:new TextDecoder().decode(i.buffer)}}})(oh||={});function sh(e){return e.scheme===O.vscodeChatEditor?ih:e.scheme===oh.scheme?e.authority||ih:e.scheme}function ch(e){return e.path.startsWith(`/untitled-`)}var lh;(function(e){e[e.NotOmitted=0]=`NotOmitted`,e[e.Partial=1]=`Partial`,e[e.Full=2]=`Full`,e[e.ImageLimitExceeded=3]=`ImageLimitExceeded`})(lh||={});var uh;(function(e){e.icon=P.error;function t(e){return{filterUri:e.resource,owner:e.owner,problemMessage:e.message,filterRange:{startLineNumber:e.startLineNumber,endLineNumber:e.endLineNumber,startColumn:e.startColumn,endColumn:e.endColumn}}}e.fromMarker=t;function n(t){return{id:r(t),name:i(t),icon:e.icon,value:t,kind:`diagnostic`,...t}}e.toEntry=n;function r(e){return[e.filterUri,e.owner,e.filterSeverity,e.filterRange?.startLineNumber,e.filterRange?.startColumn].join(`:`)}e.id=r;function i(e){let t;if((function(e){e[e.MaxChars=30]=`MaxChars`,e[e.MaxSpaceLookback=10]=`MaxSpaceLookback`})(t||={}),e.problemMessage){if(e.problemMessage.length<30)return e.problemMessage;let t=e.problemMessage.lastIndexOf(` `,30);return t===-1||t+10<30?e.problemMessage.substring(0,30)+`…`:e.problemMessage.substring(0,t)+`…`}let n=x(7916,`All Problems`);return e.filterUri&&(n=x(7917,`Problems in {0}`,to(e.filterUri))),n}e.label=i})(uh||={});var dh;(function(e){function t(e){return w.isUri(e.value)?e.value:Hp(e.value)?e.value.uri:void 0}e.toUri=t;function n(e){if(e.value instanceof Uint8Array){let t={...e};return t.value={$base64:Wt(b.wrap(e.value))},t}return e}e.toExport=n;function r(e){if(e&&`values`in e&&Array.isArray(e.values))return{kind:`generic`,id:e.id??``,name:e.name,value:e.values[0]?.value,range:e.range,modelDescription:e.modelDescription,references:e.references};if(e.value&&typeof e.value==`object`&&`$base64`in e.value&&typeof e.value.$base64==`string`){let t={...e};return t.value=Ut(e.value.$base64).buffer,t}return e}e.fromExport=r})(dh||={});function fh(e){return e.kind===`image`}function ph(e){return e.kind===`promptFile`}function mh(e){return e.kind===`promptText`}var hh;(function(e){e.Instruction=`vscode.instructions.file.root`,e.InstructionReference=`vscode.instructions.file.reference`,e.PromptFile=`vscode.prompt.file`})(hh||={});function gh(e,t,n,r=!1,i){return{id:`${t}__${e.toString()}`,name:`prompt:${to(e)}`,value:e,kind:`promptFile`,modelDescription:`Prompt instructions file`,isRoot:t!==hh.InstructionReference,originLabel:n,toolReferences:i,automaticallyAdded:r}}var _h;(function(e){e.CustomizationsIndex=`vscode.customizations.index`})(_h||={});function vh(e,t=!1,n){return{id:_h.CustomizationsIndex,name:`prompt:customizationsIndex`,value:e,kind:`promptText`,modelDescription:`Chat customizations index`,automaticallyAdded:t,toolReferences:n}}function yh(e,t){return{kind:`tool`,id:e.id,icon:fl.isThemeIcon(e.icon)?e.icon:void 0,name:e.displayName,value:void 0,range:t}}var bh=class{constructor(e){this._ids=new Set,this._entries=[],e&&this.add(...e)}add(...e){for(let t of e)this._ids.has(t.id)||(this._ids.add(t.id),this._entries.push(t))}insertFirst(e){this._ids.has(e.id)||(this._ids.add(e.id),this._entries.unshift(e))}remove(e){this._ids.delete(e.id),this._entries=this._entries.filter(t=>t.id!==e.id)}has(e){return this._ids.has(e.id)}asArray(){return this._entries.slice(0)}get length(){return this._entries.length}};k(`chatSessionsService`);var xh={nameShort:`Code - OSS`,nameLong:`Code - OSS`,applicationName:`code-oss`,dataFolderName:`.vscode-oss`,sharedDataFolderName:`.vscode-oss-shared`,win32MutexName:`vscodeoss`,licenseName:`MIT`,licenseUrl:`https://github.com/microsoft/vscode/blob/main/LICENSE.txt`,serverLicenseUrl:`https://github.com/microsoft/vscode/blob/main/LICENSE.txt`,serverGreeting:[],serverLicense:[],serverLicensePrompt:``,serverApplicationName:`code-server-oss`,serverDataFolderName:`.vscode-server-oss`,tunnelApplicationName:`code-tunnel-oss`,win32DirName:`Microsoft Code OSS`,win32NameVersion:`Microsoft Code OSS`,win32RegValueName:`CodeOSS`,win32x64AppId:`{{D77B7E06-80BA-4137-BCF4-654B95CCEBC5}`,win32arm64AppId:`{{D1ACE434-89C5-48D1-88D3-E2991DF85475}`,win32x64UserAppId:`{{CC6B787D-37A0-49E8-AE24-8559A032BE0C}`,win32arm64UserAppId:`{{3AEBF0C8-F733-4AD4-BADE-FDB816D53D7B}`,win32AppUserModelId:`Microsoft.CodeOSS`,win32ShellNameShort:`C&ode - OSS`,win32TunnelServiceMutex:`vscodeoss-tunnelservice`,win32TunnelMutex:`vscodeoss-tunnel`,darwinBundleIdentifier:`com.visualstudio.code.oss`,darwinProfileUUID:`47827DD9-4734-49A0-AF80-7E19B11495CC`,darwinProfilePayloadUUID:`CF808BE7-53F3-46C6-A7E2-7EDB98A5E959`,linuxIconName:`code-oss`,licenseFileName:`LICENSE.txt`,reportIssueUrl:`https://github.com/microsoft/vscode/issues/new`,nodejsRepository:`https://nodejs.org`,urlProtocol:`code-oss`,agentsTelemetryAppName:`agents`,webviewContentExternalBaseUrlTemplate:`https://{{uuid}}.vscode-cdn.net/insider/ef65ac1ba57f57f2a3961bfe94aa20481caca4c6/out/vs/workbench/contrib/webview/browser/pre/`,builtInExtensions:[{name:`ms-vscode.js-debug-companion`,version:`1.1.3`,sha256:`7380a890787452f14b2db7835dfa94de538caf358ebc263f9d46dd68ac52de93`,repo:`https://github.com/microsoft/vscode-js-debug-companion`,metadata:{id:`99cb0b7f-7354-4278-b8da-6cc79972169d`,publisherId:{publisherId:`5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee`,publisherName:`ms-vscode`,displayName:`Microsoft`,flags:`verified`},publisherDisplayName:`Microsoft`}},{name:`ms-vscode.js-debug`,version:`1.117.0`,sha256:`854eeb8a785b1f41ba2bd02d7ccd4fdbe10021b61473293973c7e96d036c7fb8`,repo:`https://github.com/microsoft/vscode-js-debug`,metadata:{id:`25629058-ddac-4e17-abba-74678e126c5d`,publisherId:{publisherId:`5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee`,publisherName:`ms-vscode`,displayName:`Microsoft`,flags:`verified`},publisherDisplayName:`Microsoft`}},{name:`ms-vscode.vscode-js-profile-table`,version:`1.0.10`,sha256:`7361748ddf9fd09d8a2ed1f2a2d7376a2cf9aae708692820b799708385c38e08`,repo:`https://github.com/microsoft/vscode-js-profile-visualizer`,metadata:{id:`7e52b41b-71ad-457b-ab7e-0620f1fc4feb`,publisherId:{publisherId:`5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee`,publisherName:`ms-vscode`,displayName:`Microsoft`,flags:`verified`},publisherDisplayName:`Microsoft`}}],defaultChatAgent:{extensionId:`GitHub.copilot`,chatExtensionId:`GitHub.copilot-chat`,chatExtensionOutputId:`GitHub.copilot-chat.GitHub Copilot Chat.log`,chatExtensionOutputExtensionStateCommand:`github.copilot.debug.extensionState`,documentationUrl:`https://aka.ms/github-copilot-overview`,termsStatementUrl:`https://aka.ms/github-copilot-terms-statement`,privacyStatementUrl:`https://aka.ms/github-copilot-privacy-statement`,skusDocumentationUrl:`https://aka.ms/github-copilot-plans`,publicCodeMatchesUrl:`https://aka.ms/github-copilot-match-public-code`,managePlanUrl:`https://aka.ms/github-copilot-manage-plan`,upgradePlanUrl:`https://aka.ms/github-copilot-upgrade-plan`,signUpUrl:`https://aka.ms/github-sign-up`,provider:{default:{id:`github`,name:`GitHub`},enterprise:{id:`github-enterprise`,name:`GHE`},google:{id:`google`,name:`Google`},apple:{id:`apple`,name:`Apple`}},providerExtensionId:`vscode.github-authentication`,providerUriSetting:`github-enterprise.uri`,providerScopes:[[`read:user`,`user:email`,`repo`,`workflow`],[`user:email`],[`read:user`]],entitlementUrl:`https://api.github.com/copilot_internal/user`,entitlementSignupLimitedUrl:`https://api.github.com/copilot_internal/subscribe_limited_user`,chatQuotaExceededContext:`github.copilot.chat.quotaExceeded`,completionsQuotaExceededContext:`github.copilot.completions.quotaExceeded`,walkthroughCommand:`github.copilot.open.walkthrough`,completionsMenuCommand:`github.copilot.toggleStatusMenu`,chatRefreshTokenCommand:`github.copilot.refreshToken`,generateCommitMessageCommand:`github.copilot.git.generateCommitMessage`,resolveMergeConflictsCommand:`github.copilot.git.resolveMergeConflicts`,completionsAdvancedSetting:`github.copilot.advanced`,completionsEnablementSetting:`github.copilot.enable`,nextEditSuggestionsSetting:`github.copilot.nextEditSuggestions.enabled`,tokenEntitlementUrl:`https://api.github.com/copilot_internal/v2/token`,mcpRegistryDataUrl:`https://api.github.com/copilot/mcp_registry`,managedSettingsUrl:`https://api.github.com/copilot_internal/managed_settings`},trustedExtensionAuthAccess:{github:[`GitHub.copilot-chat`],"github-enterprise":[`GitHub.copilot-chat`]},onboardingKeymaps:[{id:`vscode`,label:`VS Code`,description:`Default keyboard mapping`},{id:`sublime`,label:`Sublime Text`,extensionId:`ms-vscode.sublime-keybindings`,description:`Keyboard mapping from Sublime Text`},{id:`intellij`,label:`IntelliJ / JetBrains`,extensionId:`k--kato.intellij-idea-keybindings`,description:`Keyboard mapping from IntelliJ IDEA`},{id:`vim`,label:`Vim`,extensionId:`vscodevim.vim`,description:`Vim modal editing`},{id:`eclipse`,label:`Eclipse`,extensionId:`alphabotsec.vscode-eclipse-keybindings`,description:`Keyboard mapping from Eclipse`},{id:`notepadpp`,label:`Notepad++`,extensionId:`ms-vscode.notepadplusplus-keybindings`,description:`Keyboard mapping from Notepad++`}],onboardingThemes:[{id:`dark-2026`,label:`Dark 2026`,themeId:`Dark 2026`,type:`dark`},{id:`hc-dark`,label:`Dark High Contrast`,themeId:`Default High Contrast`,type:`hcDark`},{id:`solarized-dark`,label:`Solarized Dark`,themeId:`Solarized Dark`,type:`dark`},{id:`light-2026`,label:`Light 2026`,themeId:`Light 2026`,type:`light`},{id:`hc-light`,label:`Light High Contrast`,themeId:`Default High Contrast Light`,type:`hcLight`},{id:`solarized-light`,label:`Solarized Light`,themeId:`Solarized Light`,type:`light`}],builtInExtensionsEnabledWithAutoUpdates:[`GitHub.copilot-chat`],sessionsWindowAllowedExtensions:[],quality:`stable`,version:`1.124.2`,commit:`6928394f91b684055b873eecb8bc281365131f1c`,date:`2026-06-18T13:34:00.227Z`,...globalThis._VSCODE_PRODUCT_JSON??{}};const Sh=k(`configurationService`),Ch=k(`contextKeyService`),wh=k(`dialogService`);k(`fileDialogService`);function Th(e){return Eh(e,0)}function Eh(e,t){switch(typeof e){case`object`:return e===null?Dh(349,t):Array.isArray(e)?Ah(e,t):jh(e,t);case`string`:return kh(e,t);case`boolean`:return Oh(e,t);case`number`:return Dh(e,t);case`undefined`:return Dh(937,t);default:return Dh(617,t)}}function Dh(e,t){return(t<<5)-t+e|0}function Oh(e,t){return Dh(e?433:863,t)}function kh(e,t){t=Dh(149417,t);for(let n=0,r=e.length;n<r;n++)t=Dh(e.charCodeAt(n),t);return t}function Ah(e,t){return t=Dh(104579,t),e.reduce((e,t)=>Eh(t,e),t)}function jh(e,t){return t=Dh(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=kh(n,t),Eh(e[n],t)),t)}var Mh;(function(e){e[e.BLOCK_SIZE=64]=`BLOCK_SIZE`,e[e.UNICODE_REPLACEMENT=65533]=`UNICODE_REPLACEMENT`})(Mh||={});function Nh(e,t,n=32){let r=n-t,i=~((1<<r)-1);return(e<<t|(i&e)>>>r)>>>0}function Ph(e,t=32){return e instanceof ArrayBuffer?Kt(b.wrap(new Uint8Array(e))):(e>>>0).toString(16).padStart(t/4,`0`)}(class e{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(Mh.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let t=e.length;if(t===0)return;let n=this._buff,r=this._buffLen,i=this._leftoverHighSurrogate,a,o;for(i===0?(a=e.charCodeAt(0),o=0):(a=i,o=-1,i=0);;){let s=a;if(fa(a))if(o+1<t){let t=e.charCodeAt(o+1);pa(t)?(o++,s=ma(a,t)):s=Mh.UNICODE_REPLACEMENT}else{i=a;break}else pa(a)&&(s=Mh.UNICODE_REPLACEMENT);if(r=this._push(n,r,s),o++,o<t)a=e.charCodeAt(o);else break}this._buffLen=r,this._leftoverHighSurrogate=i}_push(e,t,n){return n<128?e[t++]=n:n<2048?(e[t++]=192|(n&1984)>>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=Mh.BLOCK_SIZE&&(this._step(),t-=Mh.BLOCK_SIZE,this._totalLen+=Mh.BLOCK_SIZE,e[0]=e[Mh.BLOCK_SIZE+0],e[1]=e[Mh.BLOCK_SIZE+1],e[2]=e[Mh.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,Mh.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),Ph(this._h0)+Ph(this._h1)+Ph(this._h2)+Ph(this._h3)+Ph(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let t=e._bigBlock32,n=this._buffDV;for(let e=0;e<64;e+=4)t.setUint32(e,n.getUint32(e,!1),!1);for(let e=64;e<320;e+=4)t.setUint32(e,Nh(t.getUint32(e-12,!1)^t.getUint32(e-32,!1)^t.getUint32(e-56,!1)^t.getUint32(e-64,!1),1),!1);let r=this._h0,i=this._h1,a=this._h2,o=this._h3,s=this._h4,c,l,u;for(let e=0;e<80;e++)e<20?(c=i&a|~i&o,l=1518500249):e<40?(c=i^a^o,l=1859775393):e<60?(c=i&a|i&o|a&o,l=2400959708):(c=i^a^o,l=3395469782),u=Nh(r,5)+c+s+l+t.getUint32(e*4,!1)&4294967295,s=o,o=a,a=Nh(i,30),i=r,r=u;this._h0=this._h0+r&4294967295,this._h1=this._h1+i&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+s&4294967295}});var U;(function(e){e[e.Off=0]=`Off`,e[e.Trace=1]=`Trace`,e[e.Debug=2]=`Debug`,e[e.Info=3]=`Info`,e[e.Warning=4]=`Warning`,e[e.Error=5]=`Error`})(U||={});const Fh=U.Info;function Ih(e,t){return e!==U.Off&&e<=t}function Lh(e,t,n){switch(t){case U.Trace:e.trace(n);break;case U.Debug:e.debug(n);break;case U.Info:e.info(n);break;case U.Warning:e.warn(n);break;case U.Error:e.error(n);break;case U.Off:break;default:throw Error(`Invalid log level ${t}`)}}function Rh(e,t=!1){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i instanceof Error&&(i=Om(i,t)),typeof i==`object`)try{i=JSON.stringify(i)}catch{}n+=(r>0?` `:``)+i}return n}var zh=class extends y{constructor(){super(...arguments),this.level=Fh,this._onDidChangeLogLevel=this._register(new S)}get onDidChangeLogLevel(){return this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return Ih(this.level,e)}canLog(e){return this._store.isDisposed?!1:this.checkLogLevel(e)}},Bh=class extends zh{constructor(e){super(),this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...t){this.canLog(U.Trace)&&this.log(U.Trace,Rh([e,...t],!0))}debug(e,...t){this.canLog(U.Debug)&&this.log(U.Debug,Rh([e,...t]))}info(e,...t){this.canLog(U.Info)&&this.log(U.Info,Rh([e,...t]))}warn(e,...t){this.canLog(U.Warning)&&this.log(U.Warning,Rh([e,...t]))}error(e,...t){if(this.canLog(U.Error))if(e instanceof Error){let t=Array.prototype.slice.call(arguments);t[0]=e.stack,this.log(U.Error,Rh(t))}else this.log(U.Error,Rh([e,...t]))}flush(){}},Vh=class extends zh{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(let t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(let n of this.loggers)n.trace(e,...t)}debug(e,...t){for(let n of this.loggers)n.debug(e,...t)}info(e,...t){for(let n of this.loggers)n.info(e,...t)}warn(e,...t){for(let n of this.loggers)n.warn(e,...t)}error(e,...t){for(let n of this.loggers)n.error(e,...t)}flush(){for(let e of this.loggers)e.flush()}dispose(){for(let e of this.loggers)e.dispose();super.dispose()}},Hh=class extends y{constructor(e,t,n){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new Ne,this._onDidChangeLoggers=this._register(new S),this.onDidChangeLoggers=this._onDidChangeLoggers.event,this._onDidChangeLogLevel=this._register(new S),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event,this._onDidChangeVisibility=this._register(new S),this.onDidChangeVisibility=this._onDidChangeVisibility.event,n)for(let e of n)this._loggers.set(e.resource,{logger:void 0,info:e})}getLoggerEntry(e){return Ge(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}getLogger(e){return this.getLoggerEntry(e)?.logger}createLogger(e,t){let n=this.toResource(e),r=Ge(e)?e:t?.id??Th(n.toString()).toString(16),i=this._loggers.get(n)?.logger,a=t?.logLevel===`always`?U.Trace:t?.logLevel;i||=this.doCreateLogger(n,a??this.getLogLevel(n)??this.logLevel,{...t,id:r});let o={logger:i,info:{resource:n,id:r,logLevel:a,name:t?.name,hidden:t?.hidden,group:t?.group,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(o.info),this._loggers.set(n,o),i}toResource(e){return Ge(e)?io(this.logsHome,`${e.replace(/[\\/:\*\?"<>\|]/g,``)}.log`):e}setLogLevel(e,t){if(w.isUri(e)){let n=e,r=t,i=this._loggers.get(n);i&&r!==i.info.logLevel&&(i.info.logLevel=r===this.logLevel?void 0:r,i.logger?.setLevel(r),this._loggers.set(i.info.resource,i),this._onDidChangeLogLevel.fire([n,r]))}else{this.logLevel=e;for(let[e,t]of this._loggers.entries())this._loggers.get(e)?.info.logLevel===void 0&&t.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(e,t){let n=this.getLoggerEntry(e);n&&t!==!n.info.hidden&&(n.info.hidden=!t,this._loggers.set(n.info.resource,n),this._onDidChangeVisibility.fire([n.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){let t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}deregisterLogger(e){let t=this.toResource(e),n=this._loggers.get(t);n&&(n.logger&&n.logger.dispose(),this._loggers.delete(t),this._onDidChangeLoggers.fire({added:[],removed:[n.info]}))}*getRegisteredLoggers(){for(let e of this._loggers.values())yield e.info}getRegisteredLogger(e){return this._loggers.get(e)?.info}dispose(){this._loggers.forEach(e=>e.logger?.dispose()),this._loggers.clear(),super.dispose()}};function Uh(e){switch(e){case U.Trace:return`trace`;case U.Debug:return`debug`;case U.Info:return`info`;case U.Warning:return`warn`;case U.Error:return`error`;case U.Off:return`off`}}new I(`logLevel`,Uh(U.Info));const Wh=k(`productService`);var Gh;(function(e){e[e.APPLICATION=1]=`APPLICATION`,e[e.USER=2]=`USER`,e[e.USER_LOCAL=3]=`USER_LOCAL`,e[e.USER_REMOTE=4]=`USER_REMOTE`,e[e.WORKSPACE=5]=`WORKSPACE`,e[e.WORKSPACE_FOLDER=6]=`WORKSPACE_FOLDER`,e[e.DEFAULT=7]=`DEFAULT`,e[e.MEMORY=8]=`MEMORY`})(Gh||={});function Kh(e,t){let n=Object.create(null);for(let r in e)qh(n,r,e[r],t);return n}function qh(e,t,n,r){let i=t.split(`.`),a=i.pop(),o=e;for(let e=0;e<i.length;e++){let n=i[e],a=o[n];switch(typeof a){case`undefined`:a=o[n]=Object.create(null);break;case`object`:if(a===null){r(`Ignoring ${t} as ${i.slice(0,e+1).join(`.`)} is null`);return}break;default:r(`Ignoring ${t} as ${i.slice(0,e+1).join(`.`)} is ${JSON.stringify(a)}`);return}o=a}if(typeof o==`object`&&o)try{o[a]=n}catch{r(`Ignoring ${t} as ${i.join(`.`)} is ${JSON.stringify(o)}`)}else r(`Ignoring ${t} as ${i.join(`.`)} is ${JSON.stringify(o)}`)}function Jh(e,t){Yh(e,t.split(`.`))}function Yh(e,t){if(!e)return;let n=e,r=t.shift();if(t.length===0){delete n[r];return}if(Object.keys(n).indexOf(r)!==-1){let e=n[r];typeof e==`object`&&e&&!Array.isArray(e)&&(Yh(e,t),Object.keys(e).length===0&&delete n[r])}}function Xh(e,t,n){function r(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}let i=r(e,t.split(`.`));return i===void 0?n:i}function Zh(e){return e.replace(/^\[/,``).replace(/]$/g,``).replace(/\]\[/g,`, `)}function Qh(e){let t=!1,n=new Map,r=new Map;if(eg(e,i=>{if(e===i)return!0;let a=JSON.stringify(i);if(a.length<30)return!0;let o=n.get(a);if(!o){let e={schemas:[i]};return n.set(a,e),r.set(i,e),!0}return o.schemas.push(i),r.set(i,o),t=!0,!1}),n.clear(),!t)return JSON.stringify(e);let i=`$defs`;for(;e.hasOwnProperty(i);)i+=`_`;let a=[];function o(e){return JSON.stringify(e,(t,n)=>{if(n!==e){let e=r.get(n);if(e&&e.schemas.length>1)return e.id||(e.id=`_${a.length}`,a.push(e.schemas[0])),{$ref:`#/${i}/${e.id}`}}return n})}let s=o(e),c=[];for(let e=0;e<a.length;e++)c.push(`"_${e}":${o(a[e])}`);return c.length?`${s.substring(0,s.length-1)},"${i}":{${c.join(`,`)}}}`:s}function $h(e){return typeof e==`object`&&!!e}function eg(e,t){if(!e||typeof e!=`object`)return;let n=(...e)=>{for(let t of e)$h(t)&&o.push(t)},r=(...e)=>{for(let t of e)if($h(t))for(let e in t){let n=t[e];$h(n)&&o.push(n)}},i=(...e)=>{for(let t of e)if(Array.isArray(t))for(let e of t)$h(e)&&o.push(e)},a=e=>{if(Array.isArray(e))for(let t of e)$h(t)&&o.push(t);else $h(e)&&o.push(e)},o=[e],s=o.pop();for(;s;)t(s)&&(n(s.additionalItems,s.additionalProperties,s.not,s.contains,s.propertyNames,s.if,s.then,s.else,s.unevaluatedItems,s.unevaluatedProperties),r(s.definitions,s.$defs,s.properties,s.patternProperties,s.dependencies,s.dependentSchemas),i(s.anyOf,s.allOf,s.oneOf,s.prefixItems),a(s.items)),s=o.pop()}const tg={JSONContribution:`base.contributions.json`};function ng(e){return e.length>0&&e.charAt(e.length-1)===`#`?e.substring(0,e.length-1):e}const rg=new class extends y{constructor(){super(...arguments),this.schemasById={},this.schemaAssociations={},this._onDidChangeSchema=this._register(new S),this.onDidChangeSchema=this._onDidChangeSchema.event,this._onDidChangeSchemaAssociations=this._register(new S),this.onDidChangeSchemaAssociations=this._onDidChangeSchemaAssociations.event}registerSchema(e,t,n){let r=ng(e);this.schemasById[r]=t,this._onDidChangeSchema.fire(e),n&&n.add(_(()=>{delete this.schemasById[r],this._onDidChangeSchema.fire(e)}))}registerSchemaAssociation(e,t){let n=ng(e);return this.schemaAssociations[n]||(this.schemaAssociations[n]=[]),this.schemaAssociations[n].includes(t)||(this.schemaAssociations[n].push(t),this._onDidChangeSchemaAssociations.fire()),_(()=>{let e=this.schemaAssociations[n];if(e){let r=e.indexOf(t);r!==-1&&(e.splice(r,1),e.length===0&&delete this.schemaAssociations[n],this._onDidChangeSchemaAssociations.fire())}})}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(e){let t=this.schemasById[e];return t?Qh(t):void 0}hasSchemaContent(e){return!!this.schemasById[e]}getSchemaAssociations(){return this.schemaAssociations}};wm.add(tg.JSONContribution,rg);var ig;(function(e){e.Multiline=`multilineText`,e.Singleline=`singlelineText`})(ig||={});const ag={Configuration:`base.contributions.configuration`};var og;(function(e){e[e.APPLICATION=1]=`APPLICATION`,e[e.MACHINE=2]=`MACHINE`,e[e.APPLICATION_MACHINE=3]=`APPLICATION_MACHINE`,e[e.WINDOW=4]=`WINDOW`,e[e.RESOURCE=5]=`RESOURCE`,e[e.LANGUAGE_OVERRIDABLE=6]=`LANGUAGE_OVERRIDABLE`,e[e.MACHINE_OVERRIDABLE=7]=`MACHINE_OVERRIDABLE`})(og||={});function sg(e,t){return e===t?!0:!e||!t?!1:typeof e==`string`||typeof t==`string`?e===t:e.id===t.id}const cg={properties:{},patternProperties:{}},lg={properties:{},patternProperties:{}},ug={properties:{},patternProperties:{}},dg={properties:{},patternProperties:{}},fg={properties:{},patternProperties:{}},pg={properties:{},patternProperties:{}},mg={properties:{},patternProperties:{}},hg=`vscode://schemas/settings/resourceLanguage`,gg=wm.as(tg.JSONContribution);var _g=class extends y{constructor(){super(),this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=this._register(new S),this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=this._register(new S),this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:`defaultOverrides`,title:x(1871,`Default Language Configuration Overrides`),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},gg.registerSchema(hg,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){return this.registerConfigurations([e],t),e}registerConfigurations(e,t=!0){let n=new Set;this.doRegisterConfigurations(e,t,n),gg.registerSchema(hg,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}deregisterConfigurations(e){let t=new Set;this.doDeregisterConfigurations(e,t),gg.registerSchema(hg,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t})}updateConfigurations({add:e,remove:t}){let n=new Set;this.doDeregisterConfigurations(t,n),this.doRegisterConfigurations(e,!1,n),gg.registerSchema(hg,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){let t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);let n=[];for(let{overrides:r,source:i}of e)for(let e in r){t.add(e);let a=this.configurationDefaultsOverrides.get(e)??this.configurationDefaultsOverrides.set(e,{configurationDefaultOverrides:[]}).get(e),o=r[e];if(a.configurationDefaultOverrides.push({value:o,source:i}),xg.test(e)){let t=this.mergeDefaultConfigurationsForOverrideIdentifier(e,o,i,a.configurationDefaultOverrideValue);if(!t)continue;a.configurationDefaultOverrideValue=t,this.updateDefaultOverrideProperty(e,t,i),n.push(...Sg(e))}else{let t=this.mergeDefaultConfigurationsForConfigurationProperty(e,o,i,a.configurationDefaultOverrideValue);if(!t)continue;a.configurationDefaultOverrideValue=t;let n=this.configurationProperties[e];n&&(this.updatePropertyDefaultValue(e,n),this.updateSchema(e,n))}}this.doRegisterOverrideIdentifiers(n)}deregisterDefaultConfigurations(e){let t=new Set;this.doDeregisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(e,t){for(let t of e){let e=this.registeredConfigurationDefaults.indexOf(t);e!==-1&&this.registeredConfigurationDefaults.splice(e,1)}for(let{overrides:n,source:r}of e)for(let e in n){let i=this.configurationDefaultsOverrides.get(e);if(!i)continue;let a=i.configurationDefaultOverrides.findIndex(t=>r?sg(t.source,r):t.value===n[e]);if(a!==-1){if(i.configurationDefaultOverrides.splice(a,1),i.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(e),xg.test(e)){let t;for(let n of i.configurationDefaultOverrides)t=this.mergeDefaultConfigurationsForOverrideIdentifier(e,n.value,n.source,t);t&&!it(t.value)?(i.configurationDefaultOverrideValue=t,this.updateDefaultOverrideProperty(e,t,r)):(this.configurationDefaultsOverrides.delete(e),delete this.configurationProperties[e],delete this.defaultLanguageConfigurationOverridesNode.properties[e])}else{let t;for(let n of i.configurationDefaultOverrides)t=this.mergeDefaultConfigurationsForConfigurationProperty(e,n.value,n.source,t);i.configurationDefaultOverrideValue=t;let n=this.configurationProperties[e];n&&(this.updatePropertyDefaultValue(e,n),this.updateSchema(e,n))}t.add(e)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(e,t,n){let r={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:`object`,default:t.value,description:x(1872,`Configure settings to be overridden for {0}.`,Zh(e)),$ref:hg,defaultDefaultValue:t.value,source:n,defaultValueSource:n};this.configurationProperties[e]=r,this.defaultLanguageConfigurationOverridesNode.properties[e]=r}mergeDefaultConfigurationsForOverrideIdentifier(e,t,n,r){let i=r?.value||{},a=r?.source??new Map;if(!(a instanceof Map)){console.error(`objectConfigurationSources is not a Map`);return}for(let e of Object.keys(t)){let r=t[e];if(Je(r)&&(Qe(i[e])||Je(i[e]))){if(i[e]={...i[e]??{},...r},n)for(let t in r)a.set(`${e}.${t}`,n)}else i[e]=r,n?a.set(e,n):a.delete(e)}return{value:i,source:a}}mergeDefaultConfigurationsForConfigurationProperty(e,t,n,r){let i=this.configurationProperties[e],a=r?.value??i?.defaultDefaultValue,o=n;if(Je(t)&&(i!==void 0&&i.type===`object`||i===void 0&&(Qe(a)||Je(a)))){if(o=r?.source??new Map,!(o instanceof Map)){console.error(`defaultValueSource is not a Map`);return}for(let r in t)n&&o.set(`${e}.${r}`,n);t={...Je(a)?a:{},...t}}return{value:t,source:o}}deltaConfiguration(e){let t=!1,n=new Set;e.removedDefaults&&(this.doDeregisterDefaultConfigurations(e.removedDefaults,n),t=!0),e.addedDefaults&&(this.doRegisterDefaultConfigurations(e.addedDefaults,n),t=!0),e.removedConfigurations&&this.doDeregisterConfigurations(e.removedConfigurations,n),e.addedConfigurations&&this.doRegisterConfigurations(e.addedConfigurations,!1,n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:t})}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(let t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,n),this.configurationContributors.push(e),this.registerJSONConfiguration(e)})}doDeregisterConfigurations(e,t){let n=e=>{if(e.properties)for(let n in e.properties){t.add(n);let r=this.configurationProperties[n];r?.policy?.name&&this.policyConfigurations.delete(r.policy.name),delete this.configurationProperties[n],this.removeFromSchema(n,e.properties[n])}e.allOf?.forEach(e=>n(e))};for(let t of e){n(t);let e=this.configurationContributors.indexOf(t);e!==-1&&this.configurationContributors.splice(e,1)}}validateAndRegisterProperties(e,t=!0,n,r,i=og.WINDOW,a){i=et(e.scope)?i:e.scope;let o=e.properties;if(o)for(let s in o){let c=o[s];if(c.section={id:e.id,title:e.title,order:e.order,extensionInfo:e.extensionInfo},t&&Tg(s,c,n?.id)){delete o[s];continue}c.source=n,c.defaultDefaultValue=o[s].default,this.updatePropertyDefaultValue(s,c),xg.test(s)?c.scope=void 0:(c.scope=et(c.scope)?i:c.scope,c.restricted=et(c.restricted)?!!r?.includes(s):c.restricted),c.experiment?c.tags?.some(e=>e.toLowerCase()===`onexp`)||(c.tags=c.tags??[],c.tags.push(`onExP`)):c.tags?.some(e=>e.toLowerCase()===`onexp`)&&(console.error(`Invalid tag 'onExP' found for property '${s}'. Please use 'experiment' property instead.`),c.experiment={mode:`startup`});let l=o[s].hasOwnProperty(`included`)&&!o[s].included,u=o[s].policy?.name;l?(this.excludedConfigurationProperties[s]=o[s],u&&(this.policyConfigurations.set(u,s),a.add(s)),delete o[s]):(a.add(s),u&&this.policyConfigurations.set(u,s),this.configurationProperties[s]=o[s],!o[s].deprecationMessage&&o[s].markdownDeprecationMessage&&(o[s].deprecationMessage=o[s].markdownDeprecationMessage))}let s=e.allOf;if(s)for(let e of s)this.validateAndRegisterProperties(e,t,n,r,i,a)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getRegisteredDefaultConfigurations(){return[...this.registeredConfigurationDefaults]}getConfigurationDefaultsOverrides(){let e=new Map;for(let[t,n]of this.configurationDefaultsOverrides)n.configurationDefaultOverrideValue&&e.set(t,n.configurationDefaultOverrideValue);return e}registerJSONConfiguration(e){let t=e=>{let n=e.properties;if(n)for(let e in n)this.updateSchema(e,n[e]);e.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(cg.properties[e]=t,t.scope){case og.APPLICATION:lg.properties[e]=t;break;case og.MACHINE:dg.properties[e]=t;break;case og.APPLICATION_MACHINE:ug.properties[e]=t;break;case og.MACHINE_OVERRIDABLE:fg.properties[e]=t;break;case og.WINDOW:pg.properties[e]=t;break;case og.RESOURCE:mg.properties[e]=t;break;case og.LANGUAGE_OVERRIDABLE:mg.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete cg.properties[e],t.scope){case og.APPLICATION:delete lg.properties[e];break;case og.MACHINE:delete dg.properties[e];break;case og.APPLICATION_MACHINE:delete ug.properties[e];break;case og.MACHINE_OVERRIDABLE:delete fg.properties[e];break;case og.WINDOW:delete pg.properties[e];break;case og.RESOURCE:case og.LANGUAGE_OVERRIDABLE:delete mg.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(let e of this.overrideIdentifiers.values()){let t=`[${e}]`,n={type:`object`,description:x(1873,`Configure editor settings to be overridden for a language.`),errorMessage:x(1874,`This setting does not support per-language configuration.`),$ref:hg};this.updatePropertyDefaultValue(t,n),cg.properties[t]=n,lg.properties[t]=n,ug.properties[t]=n,dg.properties[t]=n,fg.properties[t]=n,pg.properties[t]=n,mg.properties[t]=n}}registerOverridePropertyPatternKey(){let e={type:`object`,description:x(1873,`Configure editor settings to be overridden for a language.`),errorMessage:x(1874,`This setting does not support per-language configuration.`),$ref:hg};cg.patternProperties[bg]=e,lg.patternProperties[bg]=e,ug.patternProperties[bg]=e,dg.patternProperties[bg]=e,fg.patternProperties[bg]=e,pg.patternProperties[bg]=e,mg.patternProperties[bg]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let n=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue,r,i;n&&(!t.disallowConfigurationDefault||!n.source)&&(r=n.value,i=n.source),Qe(r)&&(r=t.defaultDefaultValue,i=void 0),Qe(r)&&(r=Cg(t.type)),t.default=r,t.defaultValueSource=i}};const vg=`\\[([^\\]]+)\\]`,yg=new RegExp(vg,`g`),bg=`^(${vg})+$`,xg=new RegExp(bg);function Sg(e){let t=[];if(xg.test(e)){let n=yg.exec(e);for(;n?.length;){let r=n[1].trim();r&&t.push(r),n=yg.exec(e)}}return _e(t)}function Cg(e){switch(Array.isArray(e)?e[0]:e){case`boolean`:return!1;case`integer`:case`number`:return 0;case`string`:return``;case`array`:return[];case`object`:return{};default:return null}}const wg=new _g;wm.add(ag.Configuration,wg);function Tg(e,t,n){return e.trim()?xg.test(e)?x(1876,`Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.`,e):wg.getConfigurationProperties()[e]!==void 0&&(!n||!Eg.has(n.toLowerCase()))?x(1877,`Cannot register '{0}'. This property is already registered.`,e):t.policy?.name&&wg.getPolicyConfigurations().get(t.policy?.name)!==void 0?x(1878,`Cannot register '{0}'. The associated policy {1} is already registered with {2}.`,e,t.policy?.name,wg.getPolicyConfigurations().get(t.policy?.name)):null:x(1875,`Cannot register an empty property`)}const Eg=new Set(xh.defaultChatAgent?[xh.defaultChatAgent.extensionId,xh.defaultChatAgent.chatExtensionId].map(e=>e.toLowerCase()):[]);function Dg(e){return e.res.statusCode&&e.res.statusCode>=200&&e.res.statusCode<300||e.res.statusCode===1223}function Og(e){return e.res.statusCode===204}async function kg(e){return Og(e)?null:(await Vt(e.stream)).toString()}async function Ag(e){if(!Dg(e))throw Error(`Server returned `+e.res.statusCode);if(Og(e))return null;let t=(await Vt(e.stream)).toString();try{return JSON.parse(t)}catch(e){throw e.message+=`:
78
- `+t,e}}let jg=[],Mg,Ng;function Pg(e=!0,t=!0){if(Mg===e&&Ng===t)return;Mg=e,Ng=t;let n=wm.as(ag.Configuration),r=jg;jg=[{id:`http`,order:15,title:x(2156,`HTTP`),type:`object`,scope:og.MACHINE,properties:{"http.useLocalProxyConfiguration":{type:`boolean`,default:t,markdownDescription:x(2157,`Controls whether in the remote extension host the local proxy configuration should be used. This setting only applies as a remote setting during [remote development](https://aka.ms/vscode-remote).`),restricted:!0}}},{id:`http`,order:15,title:x(2156,`HTTP`),type:`object`,scope:og.APPLICATION,properties:{"http.electronFetch":{type:`boolean`,default:!1,description:x(2158,`Controls whether use of Electron's fetch implementation instead of Node.js' should be enabled. All local extensions will get Electron's fetch implementation for the global fetch API.`),restricted:!0}}},{id:`http`,order:15,title:x(2156,`HTTP`),type:`object`,scope:e?og.APPLICATION:og.MACHINE,properties:{"http.proxy":{type:`string`,pattern:`^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$`,markdownDescription:x(2159,"The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyStrictSSL":{type:`boolean`,default:!0,markdownDescription:x(2160,`Controls whether the proxy server certificate should be verified against the list of supplied CAs. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.`,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyKerberosServicePrincipal":{type:`string`,markdownDescription:x(2161,`Overrides the principal service name for Kerberos authentication with the HTTP proxy. A default based on the proxy hostname is used when this is not set. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.`,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.noProxy":{type:`array`,items:{type:`string`},markdownDescription:x(2162,`Specifies domain names for which proxy settings should be ignored for HTTP/HTTPS requests. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.`,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyAuthorization":{type:[`null`,`string`],default:null,markdownDescription:x(2163,"The value to send as the `Proxy-Authorization` header for every network request. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxySupport":{type:`string`,enum:[`off`,`on`,`fallback`,`override`],enumDescriptions:[x(2164,`Disable proxy support for extensions.`),x(2165,`Enable proxy support for extensions.`),x(2166,`Enable proxy support for extensions, fall back to request options, when no proxy found.`),x(2167,`Enable proxy support for extensions, override request options.`)],default:`override`,markdownDescription:x(2168,`Use the proxy support for extensions. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.`,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificates":{type:`boolean`,default:!0,markdownDescription:x(2169,`Controls whether CA certificates should be loaded from the OS. On Windows and macOS, a reload of the window is required after turning this off. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.`,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificatesNode":{type:`boolean`,tags:[`experimental`],default:!1,markdownDescription:x(2170,`Controls whether system certificates should be loaded using Node.js built-in support. Reload the window after changing this setting. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.`,"`#http.useLocalProxyConfiguration#`"),restricted:!0,experiment:{mode:`auto`}},"http.experimental.systemCertificatesV2":{type:`boolean`,tags:[`experimental`],default:!1,markdownDescription:x(2171,`Controls whether experimental loading of CA certificates from the OS should be enabled. This uses a more general approach than the default implementation. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.`,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.fetchAdditionalSupport":{type:`boolean`,default:!0,markdownDescription:x(2172,`Controls whether Node.js' fetch implementation should be extended with additional support. Currently proxy support ({1}) and system certificates ({2}) are added when the corresponding settings are enabled. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.`,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0},"http.webSocketAdditionalSupport":{type:`boolean`,default:!0,markdownDescription:x(2173,`Controls whether the built-in WebSocket implementation should be extended with additional support. Currently proxy support ({1}) and system certificates ({2}) are added when the corresponding settings are enabled. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.`,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0},"http.experimental.networkInterfaceCheckInterval":{type:`number`,default:300,minimum:-1,tags:[`experimental`],markdownDescription:x(2174,`Controls the interval in seconds for checking network interface changes to invalidate the proxy cache. Set to -1 to disable. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.`,"`#http.useLocalProxyConfiguration#`"),restricted:!0,experiment:{mode:`auto`}}}}],n.updateConfigurations({add:jg,remove:r})}Pg();const Fg=k(`requestService`);var Ig;(function(e){e[e.STORAGE_DOES_NOT_EXIST=0]=`STORAGE_DOES_NOT_EXIST`,e[e.STORAGE_IN_MEMORY=1]=`STORAGE_IN_MEMORY`})(Ig||={});var Lg;(function(e){e[e.None=0]=`None`,e[e.Initialized=1]=`Initialized`,e[e.Closed=2]=`Closed`})(Lg||={});var Rg=class e extends y{static{this.DEFAULT_FLUSH_DELAY=100}constructor(t,n=Object.create(null)){super(),this.database=t,this.options=n,this._onDidChangeStorage=this._register(new lr),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Lg.None,this.cache=new Map,this.flushDelayer=this._register(new wo(e.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((e,t)=>this.acceptExternal(t,e)),e.deleted?.forEach(e=>this.acceptExternal(e,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Lg.Closed)return;let n=!1;et(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===Lg.None&&(this.state=Lg.Initialized,this.options.hint!==Ig.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){let n=this.cache.get(e);return et(n)?t:n}getBoolean(e,t){let n=this.get(e);return et(n)?t:n===`true`}getNumber(e,t){let n=this.get(e);return et(n)?t:parseInt(n,10)}getObject(e,t){let n=this.get(e);return et(n)?t:Bu(n)}async set(e,t,n=!1){if(this.state===Lg.Closed)return;if(et(t))return this.delete(e,n);let r=Je(t)||Array.isArray(t)?zu(t):String(t);if(this.cache.get(e)!==r)return this.cache.set(e,r),this.pendingInserts.set(e,r),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()}async delete(e,t=!1){if(this.state!==Lg.Closed&&this.cache.delete(e))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}async optimize(){if(this.state!==Lg.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||=this.doClose(),this.pendingClose}async doClose(){this.state=Lg.Closed;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;let e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===Lg.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===Ig.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}isInMemory(){return this.options.hint===Ig.STORAGE_IN_MEMORY}};const zg=`__$__migratedStorageMarker`;(class e extends Rg{constructor(){super(...arguments),this.migratedKeys=new Set,this.fallbackStorage=void 0,this.isFallbackStorageReadonly=!1}async init(){await super.init(),this.migratedKeys=this.loadMigratedKeys()}setFallbackStorage(e,t){this.fallbackStorage=e,this.isFallbackStorageReadonly=t}static{this.INTERNAL_KEY_PREFIX=`__$__`}get(t,n){if(!t.startsWith(e.INTERNAL_KEY_PREFIX)&&!this.migratedKeys.has(t)&&Qe(super.get(t))){this.migratedKeys.add(t);let e=this.fallbackStorage?.items.get(t);Qe(e)||(this.set(t,e),this.isFallbackStorageReadonly||this.fallbackStorage?.delete(t),this.persistMigratedKeys())}return super.get(t,n)}loadMigratedKeys(){let e=super.get(zg);if(e)try{return new Set(JSON.parse(e))}catch{}return new Set}persistMigratedKeys(){this.set(zg,JSON.stringify([...this.migratedKeys]))}});const Bg=k(`environmentService`),Vg=k(`fileService`),Hg=k(`IUriIdentityService`),Ug={settings:!0,keybindings:!0,prompts:!0,mcp:!0,languageModels:!0,snippets:!0,tasks:!0,extensions:!0};var Wg;(function(e){e.Settings=`settings`,e.Keybindings=`keybindings`,e.Snippets=`snippets`,e.Prompts=`prompts`,e.Tasks=`tasks`,e.Extensions=`extensions`,e.GlobalState=`globalState`,e.Mcp=`mcp`,e.LanguageModels=`languageModels`})(Wg||={});function Gg(e){let t=e;return!!(t&&typeof t==`object`&&typeof t.id==`string`&&typeof t.isDefault==`boolean`&&typeof t.name==`string`&&w.isUri(t.location)&&w.isUri(t.globalStorageHome)&&w.isUri(t.settingsResource)&&w.isUri(t.keybindingsResource)&&w.isUri(t.tasksResource)&&w.isUri(t.snippetsHome)&&w.isUri(t.promptsHome)&&w.isUri(t.extensionsResource)&&w.isUri(t.mcpResource)&&w.isUri(t.languageModelsResource)&&w.isUri(t.agentPluginsHome))}function Kg(e,t,n,r,i,a){let o=e===`agents`;return{id:e,name:t,location:n,isDefault:!1,icon:i?.icon,globalStorageHome:a&&i?.useDefaultFlags?.globalState?a.globalStorageHome:io(n,`globalStorage`),settingsResource:a&&i?.useDefaultFlags?.settings?a.settingsResource:io(n,`settings.json`),keybindingsResource:a&&i?.useDefaultFlags?.keybindings?a.keybindingsResource:io(n,`keybindings.json`),tasksResource:a&&i?.useDefaultFlags?.tasks?a.tasksResource:io(n,`tasks.json`),snippetsHome:a&&i?.useDefaultFlags?.snippets?a.snippetsHome:io(n,`snippets`),promptsHome:a&&i?.useDefaultFlags?.prompts?a.promptsHome:io(n,`prompts`),extensionsResource:a&&i?.useDefaultFlags?.extensions?a.extensionsResource:io(n,`extensions.json`),mcpResource:a&&i?.useDefaultFlags?.mcp?a.mcpResource:io(n,`mcp.json`),languageModelsResource:a&&i?.useDefaultFlags?.languageModels?a.languageModelsResource:io(n,`chatLanguageModels.json`),agentPluginsHome:a?a.agentPluginsHome:io(n,`agent-plugins`),cacheHome:io(r,e),useDefaultFlags:i?.useDefaultFlags,isTransient:i?.transient,isInternal:o||i?.transient,isAgentsWindowProfile:o,workspaces:i?.workspaces}}const qg=`builtin`;let Jg=class extends y{static{this.PROFILES_KEY=`userDataProfiles`}static{this.PROFILE_ASSOCIATIONS_KEY=`profileAssociations`}get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.profilesObject.profiles,...this.transientProfilesObject.profiles]}constructor(e,t,n,r){super(),this.environmentService=e,this.fileService=t,this.uriIdentityService=n,this.logService=r,this._onDidChangeProfiles=this._register(new S),this.onDidChangeProfiles=this._onDidChangeProfiles.event,this._onWillCreateProfile=this._register(new S),this.onWillCreateProfile=this._onWillCreateProfile.event,this._onWillRemoveProfile=this._register(new S),this.onWillRemoveProfile=this._onWillRemoveProfile.event,this._onDidResetWorkspaces=this._register(new S),this.onDidResetWorkspaces=this._onDidResetWorkspaces.event,this.profileCreationPromises=new Map,this.transientProfilesObject={profiles:[],emptyWindows:new Map},this.profilesHome=io(this.environmentService.userRoamingDataHome,`profiles`),this.profilesCacheHome=io(this.environmentService.cacheHome,`CachedProfilesData`)}init(){this._profilesObject=void 0}get profilesObject(){if(!this._profilesObject){let e=this.createDefaultProfile(),t=[e];try{for(let n of this.getStoredProfiles()){if(this.isInvalidProfile(n)){this.logService.warn(`Skipping the invalid stored profile`,n.location||n.name);continue}let r=to(n.location);t.push(Kg(r,n.name,n.location,this.profilesCacheHome,{icon:n.icon,useDefaultFlags:r===`agents`?Ug:n.useDefaultFlags},e))}}catch(e){this.logService.error(e)}let n=new Map;if(t.length)try{let e=this.getStoredProfileAssociations();if(e.workspaces)for(let[n,r]of Object.entries(e.workspaces)){let e=w.parse(n),i=t.find(e=>e.id===r);if(i){let t=i.workspaces?i.workspaces.slice(0):[];t.push(e),i.workspaces=t}}if(e.emptyWindows)for(let[r,i]of Object.entries(e.emptyWindows)){let e=t.find(e=>e.id===i);e&&n.set(r,e)}}catch(e){this.logService.error(e)}this._profilesObject={profiles:t,emptyWindows:n}}return this._profilesObject}isInvalidProfile(e){return!e.name||!Ge(e.name)||!e.location}createDefaultProfile(){let e=Kg(`__default__profile__`,x(2589,`Default`),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){let t=`Temp`,n=RegExp(`${qi(t)}\\s(\\d+)`),r=0;for(let e of this.profiles){let t=n.exec(e.name),i=t?parseInt(t[1]):0;r=i>r?i:r}let i=`${t} ${r+1}`;return this.createProfile(Th(zc()).toString(16),i,{transient:!0},e)}async createNamedProfile(e,t,n){return this.createProfile(Th(zc()).toString(16),e,t,n)}async createProfile(e,t,n,r){return await this.doCreateProfile(e,t,n,r)}async doCreateProfile(e,t,n,r){if(!Ge(t)||!t)throw Error("Name of the profile is mandatory and must be of type `string`");let i=this.profileCreationPromises.get(t);return i||(i=(async()=>{try{if(this.profiles.find(r=>r.id===e||e!==`agents`&&!r.isTransient&&!n?.transient&&r.name===t))throw Error(`Profile with ${t} name already exists`);let i=r?this.getWorkspace(r):void 0;w.isUri(i)&&(n={...n,workspaces:[i]});let a=Kg(e,t,this.uriIdentityService.extUri.joinPath(this.profilesHome,...e===`agents`?[qg,e]:[e]),this.profilesCacheHome,e===`agents`?{}:n,this.defaultProfile);await this.fileService.createFolder(a.location);let o=[];return this._onWillCreateProfile.fire({profile:a,join(e){o.push(e)}}),await zo.settled(o),i&&!w.isUri(i)&&this.updateEmptyWindowAssociation(i,a,!!a.isTransient),this.updateProfiles([a],[],[]),this.profiles.find(e=>e.id===a.id)??a}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,i)),i}async updateProfile(e,t){if(e.isAgentsWindowProfile)throw Error(`Cannot update agents window profile`);let n=[];for(let r of this.profiles){let i;if(e.id===r.id)r.isDefault?t.workspaces&&(i=r,i.workspaces=t.workspaces):i=Kg(r.id,t.name??r.name,r.location,this.profilesCacheHome,{icon:t.icon===null?void 0:t.icon??r.icon,transient:t.transient??r.isTransient,useDefaultFlags:t.useDefaultFlags??r.useDefaultFlags,workspaces:t.workspaces??r.workspaces},this.defaultProfile);else if(t.workspaces){let e=r.workspaces?.filter(e=>!t.workspaces?.some(t=>this.uriIdentityService.extUri.isEqual(e,t)));r.workspaces?.length!==e?.length&&(i=r,i.workspaces=e)}i&&n.push(i)}if(!n.length)throw e.isDefault?Error(`Cannot update default profile`):Error(`Profile '${e.name}' does not exist`);this.updateProfiles([],[],n);let r=this.profiles.find(t=>t.id===e.id);if(!r)throw Error(`Profile '${e.name}' was not updated`);return r}async removeProfile(e){if(e.isDefault)throw Error(`Cannot remove default profile`);let t=this.profiles.find(t=>t.id===e.id);if(!t)throw Error(`Profile '${e.name}' does not exist`);let n=[];this._onWillRemoveProfile.fire({profile:t,join(e){n.push(e)}});try{await Promise.allSettled(n)}catch(e){this.logService.error(e)}this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(e){yc(e)!==Cc.FILE_NOT_FOUND&&this.logService.error(e)}}async setProfileForWorkspace(e,t){let n=this.profiles.find(e=>e.id===t.id);if(!n)throw Error(`Profile '${t.name}' does not exist`);let r=this.getWorkspace(e);if(w.isUri(r)){let e=n.workspaces?[...n.workspaces]:[];e.some(e=>this.uriIdentityService.extUri.isEqual(e,r))||(e.push(r),await this.updateProfile(n,{workspaces:e}))}else this.updateEmptyWindowAssociation(r,n,!1),this.updateStoredProfiles(this.profiles)}unsetWorkspace(e,t=!1){let n=this.getWorkspace(e);if(w.isUri(n)){let t=this.getProfileForWorkspace(e);t&&this.updateProfile(t,{workspaces:t.workspaces?.filter(e=>!this.uriIdentityService.extUri.isEqual(e,n))})}else this.updateEmptyWindowAssociation(n,void 0,t),this.updateStoredProfiles(this.profiles)}async resetWorkspaces(){this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.emptyWindows.clear();for(let e of this.profiles)e.workspaces=void 0;this.updateProfiles([],[],this.profiles),this._onDidResetWorkspaces.fire()}async cleanUp(){try{if(await this.fileService.exists(this.profilesHome)){let e=await this.fileService.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(e=>e.isDirectory&&e.name!==qg&&this.profiles.every(t=>!this.uriIdentityService.extUri.isEqual(t.location,e.resource))).map(e=>this.fileService.del(e.resource,{recursive:!0})))}}catch(e){this.logService.error(`Error deleting redundant profile folders`,e)}try{let e=this.getStoredProfiles(),t=[];for(let e of this.getStoredProfiles())this.isInvalidProfile(e)?this.logService.warn(`Invalid user data profile found: ${e.name}`):t.push(e);e.length!==t.length&&this.saveStoredProfiles(t)}catch(e){this.logService.error(`Error removing invalid stored profiles`,e)}}async cleanUpTransientProfiles(){let e=this.transientProfilesObject.profiles.filter(e=>!this.isProfileAssociatedToWorkspace(e));await Promise.allSettled(e.map(e=>this.removeProfile(e)))}getProfileForWorkspace(e){let t=this.getWorkspace(e);return w.isUri(t)&&this.uriIdentityService.extUri.isEqual(t,this.environmentService.agentSessionsWorkspace)?this.profiles.find(e=>e.isAgentsWindowProfile):w.isUri(t)?this.profiles.find(e=>e.workspaces?.some(e=>this.uriIdentityService.extUri.isEqual(e,t))):this.profilesObject.emptyWindows.get(t)??this.transientProfilesObject.emptyWindows.get(t)}getWorkspace(e){return jc(e)?e.uri:Mc(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!(e.workspaces?.length||[...this.profilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.transientProfilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location)))}updateProfiles(e,t,n,r=!1){let i=[...this.profiles,...e],a=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];let o=[];for(let e of i){if(t.some(t=>e.id===t.id)){for(let t of[...this.profilesObject.emptyWindows.keys()])e.id===this.profilesObject.emptyWindows.get(t)?.id&&this.profilesObject.emptyWindows.delete(t);continue}if(!e.isDefault){e=n.find(t=>e.id===t.id)??e;let t=a.find(t=>e.id===t.id);if(e.isTransient)this.transientProfilesObject.profiles.push(e);else if(t){for(let[t,n]of this.transientProfilesObject.emptyWindows.entries())if(e.id===n.id){this.transientProfilesObject.emptyWindows.delete(t),this.profilesObject.emptyWindows.set(t,e);break}}}e.workspaces?.length===0&&(e.workspaces=void 0),o.push(e)}this.updateStoredProfiles(o),r||this.triggerProfilesChanges(e,t,n)}triggerProfilesChanges(e,t,n){this._onDidChangeProfiles.fire({added:e,removed:t,updated:n,all:this.profiles})}updateEmptyWindowAssociation(e,t,n){n=t?.isTransient?!0:n,n?t?this.transientProfilesObject.emptyWindows.set(e,t):this.transientProfilesObject.emptyWindows.delete(e):(this.transientProfilesObject.emptyWindows.delete(e),t?this.profilesObject.emptyWindows.set(e,t):this.profilesObject.emptyWindows.delete(e))}updateStoredProfiles(e){let t=[],n={},r={};for(let r of e)if(!r.isTransient&&(r.isDefault||t.push({location:r.location,name:r.name,icon:r.icon,useDefaultFlags:r.useDefaultFlags}),r.workspaces))for(let e of r.workspaces)n[e.toString()]=r.id;for(let[e,t]of this.profilesObject.emptyWindows.entries())r[e.toString()]=t.id;this.saveStoredProfileAssociations({workspaces:n,emptyWindows:r}),this.saveStoredProfiles(t),this._profilesObject=void 0}getStoredProfiles(){return[]}saveStoredProfiles(e){throw Error(`not implemented`)}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw Error(`not implemented`)}getDefaultProfileExtensionsLocation(){}};Jg=A([j(0,Bg),j(1,Vg),j(2,Hg),j(3,Ds)],Jg);const Yg=`__$__targetStorageMarker`;var Xg;(function(e){e[e.NONE=0]=`NONE`,e[e.SHUTDOWN=1]=`SHUTDOWN`})(Xg||={});var Zg;(function(e){e[e.APPLICATION_SHARED=-2]=`APPLICATION_SHARED`,e[e.APPLICATION=-1]=`APPLICATION`,e[e.PROFILE=0]=`PROFILE`,e[e.WORKSPACE=1]=`WORKSPACE`})(Zg||={});var Qg;(function(e){e[e.USER=0]=`USER`,e[e.MACHINE=1]=`MACHINE`})(Qg||={});function $g(e){let t=e.get(Yg);if(t)try{return JSON.parse(t)}catch{}return Object.create(null)}(class e extends y{static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}constructor(t={flushInterval:e.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new lr),this._onDidChangeTarget=this._register(new lr),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new S),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new vt),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this._applicationSharedKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new Mo(()=>this.doFlushWhenIdle(),t.flushInterval))}onDidChangeValue(e,t,n){return Qn.filter(this._onDidChangeValue.event,n=>n.scope===e&&(t===void 0||n.key===t),n)}doFlushWhenIdle(){this.runFlushWhenIdle.value=No(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){ht([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||=(async()=>{wr(`code/willInitStorage`);try{await this.doInitialize()}finally{wr(`code/didInitStorage`)}this.flushWhenIdleScheduler.schedule()})(),this.initializationPromise}emitDidChangeValue(e,t){let{key:n,external:r}=t;if(n===`__$__targetStorageMarker`){switch(e){case Zg.APPLICATION_SHARED:this._applicationSharedKeyTargets=void 0;break;case Zg.APPLICATION:this._applicationKeyTargets=void 0;break;case Zg.PROFILE:this._profileKeyTargets=void 0;break;case Zg.WORKSPACE:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:n,target:this.getKeyTargets(e)[n],external:r})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,t,n){return this.getStorage(t)?.get(e,n)}getBoolean(e,t,n){return this.getStorage(t)?.getBoolean(e,n)}getNumber(e,t,n){return this.getStorage(t)?.getNumber(e,n)}getObject(e,t,n){return this.getStorage(t)?.getObject(e,n)}storeAll(e,t){this.withPausedEmitters(()=>{for(let n of e)this.store(n.key,n.value,n.scope,n.target,t)})}store(e,t,n,r,i=!1){if(et(t)){this.remove(e,n,i);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,n,r),this.getStorage(n)?.set(e,t,i)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,t){let n=[],r=this.getKeyTargets(e);for(let e of Object.keys(r))r[e]===t&&n.push(e);return n}updateKeyTarget(e,t,n,r=!1){let i=this.getKeyTargets(t);typeof n==`number`?i[e]!==n&&(i[e]=n,this.getStorage(t)?.set(Yg,JSON.stringify(i),r)):typeof i[e]==`number`&&(delete i[e],this.getStorage(t)?.set(Yg,JSON.stringify(i),r))}get workspaceKeyTargets(){return this._workspaceKeyTargets||=this.loadKeyTargets(Zg.WORKSPACE),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||=this.loadKeyTargets(Zg.PROFILE),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||=this.loadKeyTargets(Zg.APPLICATION),this._applicationKeyTargets}get applicationSharedKeyTargets(){return this._applicationSharedKeyTargets||=this.loadKeyTargets(Zg.APPLICATION_SHARED),this._applicationSharedKeyTargets}getKeyTargets(e){switch(e){case Zg.APPLICATION_SHARED:return this.applicationSharedKeyTargets;case Zg.APPLICATION:return this.applicationKeyTargets;case Zg.PROFILE:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){let t=this.getStorage(e);return t?$g(t):Object.create(null)}isNew(e){return this.getBoolean(`__$__isNewStorageMarker`,e)===!0}async flush(e=Xg.NONE){this._onWillSaveState.fire({reason:e});let t=this.getStorage(Zg.APPLICATION),n=this.getStorage(Zg.APPLICATION_SHARED),r=this.getStorage(Zg.PROFILE),i=this.getStorage(Zg.WORKSPACE);switch(e){case Xg.NONE:await zo.settled([t?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve(),r?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve()]);break;case Xg.SHUTDOWN:await zo.settled([t?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve(),r?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve()]);break}}async log(){return t_(this.getStorage(Zg.APPLICATION)?.items??new Map,this.getStorage(Zg.APPLICATION_SHARED)?.items??new Map,this.getStorage(Zg.PROFILE)?.items??new Map,this.getStorage(Zg.WORKSPACE)?.items??new Map,this.getLogDetails(Zg.APPLICATION)??``,this.getLogDetails(Zg.APPLICATION_SHARED)??``,this.getLogDetails(Zg.PROFILE)??``,this.getLogDetails(Zg.WORKSPACE)??``)}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,t){return this.emitWillSaveState(Xg.NONE),Gg(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||e_(t)&&e_(e))}switchData(e,t,n){this.withPausedEmitters(()=>{let r=new Set;for(let[i,a]of e)r.add(i),t.get(i)!==a&&this.emitDidChangeValue(n,{key:i,external:!0});for(let[e]of t.items)r.has(e)||this.emitDidChangeValue(n,{key:e,external:!0})})}});function e_(e){return e.isDefault||!!e.useDefaultFlags?.globalState}async function t_(e,t,n,r,i,a,o,s){let c=e=>{try{return JSON.parse(e)}catch{return e}},l=new Map,u=new Map;e.forEach((e,t)=>{l.set(t,e),u.set(t,c(e))});let d=new Map,f=new Map;t.forEach((e,t)=>{d.set(t,e),f.set(t,c(e))});let p=new Map,m=new Map;n.forEach((e,t)=>{p.set(t,e),m.set(t,c(e))});let h=new Map,ee=new Map;r.forEach((e,t)=>{h.set(t,e),ee.set(t,c(e))}),console.group(i===o?`Storage: Application & Profile (path: ${i}, default profile)`:`Storage: Application (path: ${i})`);let te=[];l.forEach((e,t)=>{te.push({key:t,value:e})}),console.table(te),console.groupEnd(),console.log(u),console.group(`Storage: Application Shared (path: ${a})`);let g=[];if(d.forEach((e,t)=>{g.push({key:t,value:e})}),console.table(g),console.groupEnd(),console.log(f),i!==o){console.group(`Storage: Profile (path: ${o}, profile specific)`);let e=[];p.forEach((t,n)=>{e.push({key:n,value:t})}),console.table(e),console.groupEnd(),console.log(m)}console.group(`Storage: Workspace (path: ${s})`);let ne=[];h.forEach((e,t)=>{ne.push({key:t,value:e})}),console.table(ne),console.groupEnd(),console.log(ee)}const n_=k(`storageService`);var r_;(function(e){e[e.NONE=0]=`NONE`,e[e.CRASH=1]=`CRASH`,e[e.ERROR=2]=`ERROR`,e[e.USAGE=3]=`USAGE`})(r_||={});var i_;(function(e){e.OFF=`off`,e.CRASH=`crash`,e.ERROR=`error`,e.ON=`all`})(i_||={});const a_=k(`telemetryService`);k(`customEndpointTelemetryService`);const o_=k(`IAuthenticationService`);k(`IAuthenticationExtensionsService`);const s_=k(`openerService`),c_=Es(Bg),l_=k(`lifecycleService`);function u_(e,t){return e===t}function d_(){return(e,t)=>e===t}function f_(e,t,n){return se(e,t,n??u_)}function p_(e){return(t,n)=>se(t,n,e??u_)}function m_(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!m_(e[n],t[n]))return!1;return!0}if(e&&typeof e==`object`&&t&&typeof t==`object`&&Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){let n=e,r=t,i=Object.keys(n),a=Object.keys(r),o=new Set(a);if(i.length!==a.length)return!1;for(let e of i)if(!o.has(e)||!m_(n[e],r[e]))return!1;return!0}return!1}function h_(){return(e,t)=>m_(e,t)}function g_(e,t){return JSON.stringify(e)===JSON.stringify(t)}function __(){return(e,t)=>JSON.stringify(e)===JSON.stringify(t)}function v_(){return(e,t)=>e.equals(t)}function y_(e,t,n){return e==null||t==null?t===e:n(e,t)}function b_(e){return(t,n)=>t==null||n==null?n===t:e(t,n)}var x_;(function(e){e.strict=u_,e.strictC=d_,e.array=f_,e.arrayC=p_,e.structural=m_,e.structuralC=h_,e.jsonStringify=g_,e.jsonStringifyC=__,e.thisC=v_,e.ifDefined=y_,e.ifDefinedC=b_})(x_||={});let S_;function C_(e){S_?S_ instanceof O_?S_.loggers.push(e):S_=new O_([S_,e]):S_=e}function w_(){return S_}let T_;function E_(e){T_=e}function D_(e){T_&&T_(e)}var O_=class{constructor(e){this.loggers=e}handleObservableCreated(e,t){for(let n of this.loggers)n.handleObservableCreated(e,t)}handleOnListenerCountChanged(e,t){for(let n of this.loggers)n.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(let n of this.loggers)n.handleObservableUpdated(e,t)}handleAutorunCreated(e,t){for(let n of this.loggers)n.handleAutorunCreated(e,t)}handleAutorunDisposed(e){for(let t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,n){for(let r of this.loggers)r.handleAutorunDependencyChanged(e,t,n)}handleAutorunStarted(e){for(let t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(let t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,n){for(let r of this.loggers)r.handleDerivedDependencyChanged(e,t,n)}handleDerivedCleared(e){for(let t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(let t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(let t of this.loggers)t.handleEndTransaction(e)}},k_;(function(e){let t=!1;function n(){t=!0}e.enable=n;function r(){if(!t)return;let e=Error,n=e.stackTraceLimit;e.stackTraceLimit=3;let r=Error().stack;return e.stackTraceLimit=n,A_.fromStack(r,2)}e.ofCaller=r})(k_||={});var A_=class e{static fromStack(t,n){let r=j_(t.split(`
79
- `)[n+1]);if(r)return new e(r.fileName,r.line,r.column,r.id)}constructor(e,t,n,r){this.fileName=e,this.line=t,this.column=n,this.id=r}};function j_(e){let t=e.match(/\((.*):(\d+):(\d+)\)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:e};let n=e.match(/at ([^\(\)]*):(\d+):(\d+)/);if(n)return{fileName:n[1],line:parseInt(n[2]),column:parseInt(n[3]),id:e}}var M_=class{constructor(e,t,n){this.owner=e,this.debugNameSource=t,this.referenceFn=n}getDebugName(e){return F_(e,this)}};const N_=new Map,P_=new WeakMap;function F_(e,t){let n=P_.get(e);if(n)return n;let r=I_(e,t);if(r){let t=N_.get(r)??0;t++,N_.set(r,t);let n=t===1?r:`${r}#${t}`;return P_.set(e,n),n}}function I_(e,t){let n=P_.get(e);if(n)return n;let r=t.owner?B_(t.owner)+`.`:``,i,a=t.debugNameSource;if(a!==void 0)if(typeof a==`function`){if(i=a(),i!==void 0)return r+i}else return r+a;let o=t.referenceFn;if(o!==void 0&&(i=H_(o),i!==void 0))return r+i;if(t.owner!==void 0){let n=L_(t.owner,e);if(n!==void 0)return r+n}}function L_(e,t){for(let n in e)if(e[n]===t)return n}const R_=new Map,z_=new WeakMap;function B_(e){let t=z_.get(e);if(t)return t;let n=V_(e)??`Object`,r=R_.get(n)??0;r++,R_.set(n,r);let i=r===1?n:`${n}#${r}`;return z_.set(e,i),i}function V_(e){let t=e.constructor;if(t)return t.name===`Object`?void 0:t.name}function H_(e){let t=e.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t);return(n?n[1]:void 0)?.trim()}let U_;function W_(e){U_=e}let G_;function K_(e){G_=e}let q_;function J_(e){q_=e}let Y_;function X_(e){Y_=e}var Z_=class{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t,n=k_.ofCaller()){let r=t===void 0?void 0:e,i=t===void 0?e:t;return U_({owner:r,debugName:()=>{let e=H_(i);if(e!==void 0)return e;let t=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(i.toString());if(t)return`${this.debugName}.${t[2]}`;if(!r)return`${this.debugName} (mapped)`},debugReferenceFn:i},e=>i(this.read(e),e),n)}flatten(){return U_({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(G_(this,t)),this}keepObserved(e){return e.add(q_(this)),this}get debugValue(){return this.get()}get debug(){return new Q_(this)}},Q_=class{constructor(e){this.observable=e}getDependencyGraph(){return Y_(this.observable,{type:`dependencies`})}getObserverGraph(){return Y_(this.observable,{type:`observers`})}},$_=class extends Z_{constructor(e){super(),this._observers=new Set,w_()?.handleObservableCreated(this,e)}addObserver(e){let t=this._observers.size;this._observers.add(e),t===0&&this.onFirstObserverAdded(),t!==this._observers.size&&w_()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let t=this._observers.delete(e);t&&this._observers.size===0&&this.onLastObserverRemoved(),t&&w_()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!w_();return D_(this),e||w_()?.handleObservableCreated(this,k_.ofCaller()),this}debugGetObservers(){return this._observers}},ev;(function(e){e[e.dependenciesMightHaveChanged=1]=`dependenciesMightHaveChanged`,e[e.stale=2]=`stale`,e[e.upToDate=3]=`upToDate`})(ev||={});function tv(e){switch(e){case ev.dependenciesMightHaveChanged:return`dependenciesMightHaveChanged`;case ev.stale:return`stale`;case ev.upToDate:return`upToDate`;default:return`<unknown>`}}var nv=class{get debugName(){return this._debugNameData.getDebugName(this)??`(anonymous)`}constructor(e,t,n,r){this._debugNameData=e,this._runFn=t,this._changeTracker=n,this._state=ev.stale,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._iteration=0,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),w_()?.handleAutorunCreated(this,r),this._run(),ut(this)}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),w_()?.handleAutorunDisposed(this),dt(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=ev.upToDate;try{if(!this._disposed){w_()?.handleAutorunStarted(this);let e=this._changeSummary,t=this._delayedStore;t!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,e),this._changeSummary=this._changeTracker.createChangeSummary(e)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,e)}catch(e){a(e)}finally{this._isRunning=!1,t!==void 0&&t.dispose()}}}finally{this._disposed||w_()?.handleAutorunFinished(this);for(let e of this._dependenciesToBeRemoved)e.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===ev.upToDate&&(this._checkIterations(),this._state=ev.dependenciesMightHaveChanged),this._updateCount++}endUpdate(e){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===ev.dependenciesMightHaveChanged){this._state=ev.upToDate;for(let e of this._dependencies)if(e.reportChanges(),this._state===ev.stale)break}this._iteration++,this._state!==ev.upToDate&&this._run()}while(this._state!==ev.upToDate)}}finally{this._updateCount--}We(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===ev.upToDate&&this._isDependency(e)&&(this._checkIterations(),this._state=ev.dependenciesMightHaveChanged)}handleChange(e,t){if(this._isDependency(e)){w_()?.handleAutorunDependencyChanged(this,e,t);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:t,didChange:t=>t===e},this._changeSummary))&&(this._checkIterations(),this._state=ev.stale)}catch(e){a(e)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new ae(`The reader object cannot be used outside its compute function!`)}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new ae(`Cannot access store after dispose`);return this._store===void 0&&(this._store=new v),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new ae(`Cannot access store after dispose`);return this._delayedStore===void 0&&(this._delayedStore=new v),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:tv(this._state)}}debugRerun(){this._isRunning?this._state=ev.stale:this._run()}_checkIterations(){return this._iteration>100?(a(new ae(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}},rv;(function(e){e[e.initial=0]=`initial`,e[e.dependenciesMightHaveChanged=1]=`dependenciesMightHaveChanged`,e[e.stale=2]=`stale`,e[e.upToDate=3]=`upToDate`})(rv||={});function iv(e){switch(e){case rv.initial:return`initial`;case rv.dependenciesMightHaveChanged:return`dependenciesMightHaveChanged`;case rv.stale:return`stale`;case rv.upToDate:return`upToDate`;default:return`<unknown>`}}var av=class extends $_{get debugName(){return this._debugNameData.getDebugName(this)??`(anonymous)`}constructor(e,t,n,r=void 0,i,a){super(a),this._debugNameData=e,this._computeFn=t,this._changeTracker=n,this._handleLastObserverRemoved=r,this._equalityComparator=i,this._state=rv.initial,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=rv.initial,this._value=void 0,w_()?.handleDerivedCleared(this);for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._observers.size===0){let e;try{this._isReaderValid=!0;let t;this._changeTracker&&(t=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,t)),e=this._computeFn(this,t)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),e}else{do{if(this._state===rv.dependenciesMightHaveChanged){for(let e of this._dependencies)if(e.reportChanges(),this._state===rv.stale)break}this._state===rv.dependenciesMightHaveChanged&&(this._state=rv.upToDate),this._state!==rv.upToDate&&this._recompute()}while(this._state!==rv.upToDate);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{let t=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,t),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(t));let n=this._state!==rv.initial,r=this._value;this._state=rv.upToDate;let i=this._delayedStore;i!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,t)}finally{this._isReaderValid=!1;for(let e of this._dependenciesToBeRemoved)e.removeObserver(this);this._dependenciesToBeRemoved.clear(),i!==void 0&&i.dispose()}e=this._didReportChange||n&&!this._equalityComparator(r,this._value),w_()?.handleObservableUpdated(this,{oldValue:r,newValue:this._value,change:void 0,didChange:e,hadValue:n})}catch(e){a(e)}if(this._isComputing=!1,!this._didReportChange&&e)for(let e of this._observers)e.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new ae(`Cyclic deriveds are not supported yet!`);this._updateCount++,this._isUpdating=!0;try{let e=this._updateCount===1;if(this._state===rv.upToDate&&(this._state=rv.dependenciesMightHaveChanged,!e))for(let e of this._observers)e.handlePossibleChange(this);if(e)for(let e of this._observers)e.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let e=[...this._observers];for(let t of e)t.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let e=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let t of e)t.endUpdate(this)}}We(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===rv.upToDate&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=rv.dependenciesMightHaveChanged;for(let e of this._observers)e.handlePossibleChange(this)}}handleChange(e,t){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){w_()?.handleDerivedDependencyChanged(this,e,t);let n=!1;try{n=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:t=>t===e},this._changeSummary):!0}catch(e){a(e)}let r=this._state===rv.upToDate;if(n&&(this._state===rv.dependenciesMightHaveChanged||r)&&(this._state=rv.stale,r))for(let e of this._observers)e.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new ae(`The reader object cannot be used outside its compute function!`)}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let t of this._observers)t.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new v),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new v),this._delayedStore}addObserver(e){let t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn?.delete(e)||e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||=new Set,this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:iv(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=rv.stale:this._recompute()}finally{this.endUpdate(this)}}setValue(e,t,n){this._value=e;let r=this._observers;t.updateObserver(this,this);for(let e of r)e.handleChange(this,n)}};function ov(e,t,n=k_.ofCaller()){return new av(new M_(e.owner,e.debugName,e.debugReferenceFn),t,void 0,e.onLastObserverRemoved,e.equalsFn??u_,n)}W_(ov);function sv(e,t=k_.ofCaller()){return new nv(new M_(void 0,void 0,e),e,void 0,t)}function cv(e){let t=Error(`BugIndicatingErrorRecovery: `+e);o(t),console.error(`recovered from an error that indicates a bug`,t)}function lv(e,t){let n=new dv(e,t);try{e(n)}finally{n.finish()}}function uv(e,t,n){e?t(e):lv(t,n)}var dv=class{constructor(e,t){this._fn=e,this._getDebugName=t,this._updatingObservers=[],w_()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():H_(this._fn)}updateObserver(e,t){if(!this._updatingObservers){cv(`Transaction already finished!`),lv(n=>{n.updateObserver(e,t)});return}this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){let e=this._updatingObservers;if(!e){cv(`transaction.finish() has already been called!`);return}for(let t=0;t<e.length;t++){let{observer:n,observable:r}=e[t];n.endUpdate(r)}this._updatingObservers=null,w_()?.handleEndTransaction(this)}debugGetUpdatingObservers(){return this._updatingObservers}};function fv(e,t,n=k_.ofCaller()){let r;return r=typeof e==`string`?new M_(void 0,e,void 0):new M_(e,void 0,void 0),new pv(r,t,u_,n)}var pv=class extends $_{get debugName(){return this._debugNameData.getDebugName(this)??`ObservableValue`}constructor(e,t,n,r){super(r),this._debugNameData=e,this._equalityComparator=n,this._value=t,w_()?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let r;t||=r=new dv(()=>{},()=>`Setting ${this.debugName}`);try{let r=this._value;this._setValue(e),w_()?.handleObservableUpdated(this,{oldValue:r,newValue:e,change:n,didChange:!0,hadValue:!0});for(let e of this._observers)t.updateObserver(e,this),e.handleChange(this,n)}finally{r&&r.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}};function mv(...e){let t,n,r,i;return e.length===2?[n,r]=e:[t,n,r,i]=e,new hv(new M_(t,void 0,r),n,r,()=>hv.globalTransaction,u_,i??k_.ofCaller())}var hv=class extends $_{constructor(e,t,n,r,i,a){super(a),this._debugNameData=e,this.event=t,this._getValue=n,this._getTransaction=r,this._equalityComparator=i,this._hasValue=!1,this.handleEvent=e=>{let t=this._getValue(e),n=this._value,r=!this._hasValue||!this._equalityComparator(n,t),i=!1;r&&(this._value=t,this._hasValue&&(i=!0,uv(this._getTransaction(),e=>{w_()?.handleObservableUpdated(this,{oldValue:n,newValue:t,change:void 0,didChange:r,hadValue:this._hasValue});for(let t of this._observers)e.updateObserver(t,this),t.handleChange(this,void 0)},()=>{let e=this.getDebugName();return`Event fired`+(e?`: ${e}`:``)})),this._hasValue=!0),i||w_()?.handleObservableUpdated(this,{oldValue:n,newValue:t,change:void 0,didChange:r,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return`From Event`+(e?`: ${e}`:``)}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};(function(e){e.Observer=hv;function t(e,t){let n=!1;hv.globalTransaction===void 0&&(hv.globalTransaction=e,n=!0);try{t()}finally{n&&(hv.globalTransaction=void 0)}}e.batchEventsGlobally=t})(mv||={});function gv(e){let t=new vv(!1,void 0);return e.addObserver(t),_(()=>{e.removeObserver(t)})}J_(gv);function _v(e,t){let n=new vv(!0,t);e.addObserver(n);try{n.beginUpdate(e)}finally{n.endUpdate(e)}return _(()=>{e.removeObserver(n)})}K_(_v);var vv=class{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}};let yv;function bv(e){yv||(yv=new xv,C_(yv)),yv.addFilteredObj(e)}var xv=class{constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||=new Set,this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return Sv([Cv(kv(`| `,this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[Cv(` `),Tv(Ev(e.oldValue,70),{color:`red`,strikeThrough:!0}),Cv(` `),Tv(Ev(e.newValue,60),{color:`green`})]:[Cv(` (unchanged)`)]:[Cv(` `),Tv(Ev(e.newValue,60),{color:`green`}),Cv(` (initial)`)]}handleObservableCreated(e){if(e instanceof av){let t=e;this.changedObservablesSets.set(t,new Set)}}handleOnListenerCountChanged(e,t){}handleObservableUpdated(e,t){if(this._isIncluded(e)){if(e instanceof av){this._handleDerivedRecomputed(e,t);return}console.log(...this.textToConsoleArgs([wv(`observable value changed`),Tv(e.debugName,{color:`BlueViolet`}),...this.formatInfo(t)]))}}formatChanges(e){if(e.size!==0)return Tv(` (changed deps: `+[...e].map(e=>e.debugName).join(`, `)+`)`,{color:`gray`})}handleDerivedDependencyChanged(e,t,n){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(t)}_handleDerivedRecomputed(e,t){if(!this._isIncluded(e))return;let n=this.changedObservablesSets.get(e);n&&(console.log(...this.textToConsoleArgs([wv(`derived recomputed`),Tv(e.debugName,{color:`BlueViolet`}),...this.formatInfo(t),this.formatChanges(n),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),n.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wv(`derived cleared`),Tv(e.debugName,{color:`BlueViolet`})]))}handleFromEventObservableTriggered(e,t){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wv(`observable from event triggered`),Tv(e.debugName,{color:`BlueViolet`}),...this.formatInfo(t),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,t,n){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(t)}handleAutorunStarted(e){let t=this.changedObservablesSets.get(e);t&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wv(`autorun`),Tv(e.debugName,{color:`BlueViolet`}),this.formatChanges(t),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),t.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let t=e.getDebugName();t===void 0&&(t=``),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wv(`transaction`),Tv(t,{color:`BlueViolet`}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};function Sv(e){let t=[],n=[],r=``;function i(e){if(`length`in e)for(let t of e)t&&i(t);else `text`in e?(r+=`%c${e.text}`,t.push(e.style),e.data&&n.push(...e.data)):`data`in e&&n.push(...e.data)}i(e);let a=[r,...t];return a.push(...n),a}function Cv(e){return Tv(e,{color:`black`})}function wv(e){return Tv(Av(`${e}: `,10),{color:`black`,bold:!0})}function Tv(e,t={color:`black`}){function n(e){return Object.entries(e).reduce((e,[t,n])=>`${e}${t}:${n};`,``)}let r={color:t.color};return t.strikeThrough&&(r[`text-decoration`]=`line-through`),t.bold&&(r[`font-weight`]=`bold`),{text:e,style:n(r)}}function Ev(e,t){switch(typeof e){case`number`:return``+e;case`string`:return e.length+2<=t?`"${e}"`:`"${e.substr(0,t-7)}"+...`;case`boolean`:return e?`true`:`false`;case`undefined`:return`undefined`;case`object`:return e===null?`null`:Array.isArray(e)?Dv(e,t):Ov(e,t);case`symbol`:return e.toString();case`function`:return`[[Function${e.name?` `+e.name:``}]]`;default:return``+e}}function Dv(e,t){let n=`[ `,r=!0;for(let i of e){if(r||(n+=`, `),n.length-5>t){n+=`...`;break}r=!1,n+=`${Ev(i,t-n.length)}`}return n+=` ]`,n}function Ov(e,t){if(typeof e.toString==`function`&&e.toString!==Object.prototype.toString){let n=e.toString();return n.length<=t?n:n.substring(0,t-3)+`...`}let n=V_(e),r=n?n+`(`:`{ `,i=!0;for(let[n,a]of Object.entries(e)){if(i||(r+=`, `),r.length-5>t){r+=`...`;break}i=!1,r+=`${n}: ${Ev(a,t-r.length)}`}return r+=n?`)`:` }`,r}function kv(e,t){let n=``;for(let r=1;r<=t;r++)n+=e;return n}function Av(e,t){for(;e.length<t;)e+=` `;return e}var jv=class e{static createHost(t,n){return new e(t,n)}static createClient(t,n){return new e(t,n)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:e=>{let t=e,n=this._getHandler().notifications[t[0]];if(!n)throw Error(`Unknown notification "${t[0]}"!`);n(...t[1])},handleRequest:e=>{let t=e;try{return{type:`result`,value:this._getHandler().requests[t[0]](...t[1])}}catch(e){return{type:`error`,value:e}}}});let n=new Proxy({},{get:(e,t)=>async(...e)=>{let n=await this._channel.sendRequest([t,e]);if(n.type===`error`)throw n.value;return n.value}});this.api={notifications:new Proxy({},{get:(e,t)=>(...e)=>{this._channel.sendNotification([t,e])}}),requests:n}}};function Mv(e,t){let n=globalThis,r=[],i,{channel:a,handler:o}=Nv({sendNotification:e=>{i?i.sendNotification(e):r.push(e)}}),s;return(n.$$debugValueEditor_debugChannels??={})[e]=e=>{s=t(),i=e;for(let t of r)e.sendNotification(t);return r=[],o},jv.createClient(a,()=>{if(!s)throw Error(`Not supported`);return s})}function Nv(e){let t;return{channel:n=>(t=n,{sendNotification:t=>{e.sendNotification(t)},sendRequest:e=>{throw Error(`not supported`)}}),handler:{handleRequest:e=>e.type===`notification`?t?.handleNotification(e.data):t?.handleRequest(e.data)}}}var Pv=class{constructor(){this._timeout=void 0}throttle(e,t){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},t))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};function Fv(e,t){for(let n in t)e[n]&&typeof e[n]==`object`&&t[n]&&typeof t[n]==`object`?Fv(e[n],t[n]):e[n]=t[n]}function Iv(e,t){for(let n in t)t[n]===null?delete e[n]:e[n]&&typeof e[n]==`object`&&t[n]&&typeof t[n]==`object`?Iv(e[n],t[n]):e[n]=t[n]}var Lv=class e{static{this._instance=void 0}static getInstance(){return e._instance===void 0&&(e._instance=new e),e._instance}getTransactionState(){let e=[],t=[...this._activeTransactions];if(t.length===0)return;let n=t.flatMap(e=>e.debugGetUpdatingObservers()??[]).map(e=>e.observer),r=new Set;for(;n.length>0;){let t=n.shift();if(r.has(t))continue;r.add(t);let i=this._getInfo(t,e=>{r.has(e)||n.push(e)});i&&e.push(i)}return{names:t.map(e=>e.getDebugName()??`tx`),affected:e}}_getObservableInfo(e){let t=this._instanceInfos.get(e);if(!t){o(new ae(`No info found`));return}return t}_getAutorunInfo(e){let t=this._instanceInfos.get(e);if(!t){o(new ae(`No info found`));return}return t}_getInfo(e,t){if(e instanceof av){let n=[...e.debugGetObservers()];for(let e of n)t(e);let r=this._getObservableInfo(e);if(!r)return;let i=e.debugGetState(),a={name:e.debugName,instanceId:r.instanceId,updateCount:i.updateCount},o=[...r.changedObservables].map(e=>this._instanceInfos.get(e)?.instanceId).filter($e);if(i.isComputing)return{...a,type:`observable/derived`,state:`updating`,changedDependencies:o,initialComputation:!1};switch(i.state){case rv.initial:return{...a,type:`observable/derived`,state:`noValue`};case rv.upToDate:return{...a,type:`observable/derived`,state:`upToDate`};case rv.stale:return{...a,type:`observable/derived`,state:`stale`,changedDependencies:o};case rv.dependenciesMightHaveChanged:return{...a,type:`observable/derived`,state:`possiblyStale`}}}else if(e instanceof nv){let t=this._getAutorunInfo(e);if(!t)return;let n={name:e.debugName,instanceId:t.instanceId,updateCount:t.updateCount},r=[...t.changedObservables].map(e=>this._instanceInfos.get(e).instanceId);if(e.debugGetState().isRunning)return{...n,type:`autorun`,state:`updating`,changedDependencies:r};switch(e.debugGetState().state){case ev.upToDate:return{...n,type:`autorun`,state:`upToDate`};case ev.stale:return{...n,type:`autorun`,state:`stale`,changedDependencies:r};case ev.dependenciesMightHaveChanged:return{...n,type:`autorun`,state:`possiblyStale`}}}}_formatObservable(e){let t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){if(e instanceof av)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};let t=this._getAutorunInfo(e);if(t)return{name:e.toString(),instanceId:t.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=Mv(`observableDevTools`,()=>({notifications:{setDeclarationIdFilter:e=>{},logObservableValue:e=>{console.log(`logObservableValue`,e)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{let e={};for(let t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(e=>this._formatObserver(e)).filter($e)}),getDerivedInfo:e=>{let t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map(e=>this._formatObservable(e)).filter($e),observers:[...t.debugGetObservers()].map(e=>this._formatObserver(e)).filter($e)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(e=>this._formatObservable(e)).filter($e)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{let n=this._aliveInstances.get(e);if(n instanceof av)n.debugSetValue(t);else if(n instanceof pv)n.debugSetValue(t);else if(n instanceof hv)n.debugSetValue(t);else throw new ae(`Observable is not supported`);let r=[...n.debugGetObservers()];for(let e of r)e.beginUpdate(n);for(let e of r)e.handleChange(n,void 0);for(let e of r)e.endUpdate(n)},getValue:e=>{let t=this._aliveInstances.get(e);if(t instanceof av||t instanceof pv)return Ev(t.debugGetState().value,200)},logValue:e=>{let t=this._aliveInstances.get(e);if(t&&`get`in t)console.log(`Logged Value:`,t.get());else throw new ae(`Observable is not supported`)},rerun:e=>{let t=this._aliveInstances.get(e);if(t instanceof av)t.debugRecompute();else if(t instanceof nv)t.debugRerun();else throw new ae(`Observable is not supported`)}}})),this._pendingChanges=null,this._changeThrottler=new Pv,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},k_.enable()}_handleChange(e){Iv(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:Fv(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,t){if(!t)return-1;let n=this._declarations.get(t.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:t.fileName,line:t.line,column:t.column},this._declarations.set(t.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,t){let n={declarationId:this._getDeclarationId(`observable/value`,t),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,n)}handleOnListenerCountChanged(e,t){let n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&t>0){let t=e instanceof av?`observable/derived`:`observable/value`;this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:t,name:e.debugName}}})}else n.listenerCount>0&&t===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=t}}handleObservableUpdated(e,t){if(e instanceof av){this._handleDerivedRecomputed(e,t);return}let n=this._getObservableInfo(e);n&&t.didChange&&(n.lastValue=Ev(t.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,t){let n={declarationId:this._getDeclarationId(`autorun`,t),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,n),this._aliveInstances.set(n.instanceId,e),n&&this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,runCount:0,type:`autorun`,name:e.debugName}}})}handleAutorunDisposed(e){let t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,n){let r=this._getAutorunInfo(e);r&&r.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){let t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,n){let r=this._getObservableInfo(e);r&&r.changedObservables.add(t)}_handleDerivedRecomputed(e,t){let n=this._getObservableInfo(e);if(!n)return;let r=Ev(t.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=r,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:r,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){let t=this._getObservableInfo(e);t&&(t.lastValue=void 0,t.changedObservables.clear(),t.listenerCount>0&&this._handleChange({instances:{[t.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};function Rv(e,t){let n=t?.debugNamePostProcessor??(e=>e),r=Vv.from(e,n);if(!r)return``;let i=new Set;return t.type===`observers`?Bv(r,0,i,t).trim():zv(r,0,i,t).trim()}function zv(e,t,n,r){let i=` `.repeat(t),a=[];if(n.has(e.sourceObj))return a.push(`${i}* ${e.type} ${e.name} (already listed)`),a.join(`
80
- `);if(n.add(e.sourceObj),a.push(`${i}* ${e.type} ${e.name}:`),a.push(`${i} value: ${Ev(e.value,50)}`),a.push(`${i} state: ${e.state}`),e.dependencies.length>0){a.push(`${i} dependencies:`);for(let i of e.dependencies){let e=Vv.from(i,r.debugNamePostProcessor??(e=>e))??Vv.unknown(i);a.push(zv(e,t+1,n,r))}}return a.join(`
81
- `)}function Bv(e,t,n,r){let i=` `.repeat(t),a=[];if(n.has(e.sourceObj))return a.push(`${i}* ${e.type} ${e.name} (already listed)`),a.join(`
82
- `);if(n.add(e.sourceObj),a.push(`${i}* ${e.type} ${e.name}:`),a.push(`${i} value: ${Ev(e.value,50)}`),a.push(`${i} state: ${e.state}`),e.observers.length>0){a.push(`${i} observers:`);for(let i of e.observers){let e=Vv.from(i,r.debugNamePostProcessor??(e=>e))??Vv.unknown(i);a.push(Bv(e,t+1,n,r))}}return a.join(`
83
- `)}var Vv=class e{static from(t,n){if(t instanceof nv){let r=t.debugGetState();return new e(t,n(t.debugName),`autorun`,void 0,r.stateStr,Array.from(r.dependencies),[])}else if(t instanceof av){let r=t.debugGetState();return new e(t,n(t.debugName),`derived`,r.value,r.stateStr,Array.from(r.dependencies),Array.from(t.debugGetObservers()))}else if(t instanceof pv){let r=t.debugGetState();return new e(t,n(t.debugName),`observableValue`,r.value,`upToDate`,[],Array.from(t.debugGetObservers()))}else if(t instanceof hv){let r=t.debugGetState();return new e(t,n(t.debugName),`fromEvent`,r.value,r.hasValue?`upToDate`:`initial`,[],Array.from(t.debugGetObservers()))}}static unknown(t){return new e(t,`(unknown)`,`unknown`,void 0,`unknown`,[],[])}constructor(e,t,n,r,i,a,o){this.sourceObj=e,this.name=t,this.type=n,this.value=r,this.state=i,this.dependencies=a,this.observers=o}};X_(Rv),E_(bv),Kn&&Kn.VSCODE_DEV_DEBUG_OBSERVABLES&&C_(Lv.getInstance());const Hv=k(`defaultAccountService`);var Uv,Wv,W;(function(e){e.Setup={hidden:new I(`chatSetupHidden`,!1,!0),installed:new I(`chatSetupInstalled`,!1,!0),disabled:new I(`chatSetupDisabled`,!1,!0),disabledInWorkspace:new I(`chatSetupDisabledInWorkspace`,!1,!0),untrusted:new I(`chatSetupUntrusted`,!1,!0),later:new I(`chatSetupLater`,!1,!0),registered:new I(`chatSetupRegistered`,!1,!0),completed:new I(`chatSetupCompleted`,!1,!0)},e.Entitlement={signedOut:new I(`chatEntitlementSignedOut`,!1,!0),canSignUp:new I(`chatPlanCanSignUp`,!1,!0),planFree:new I(`chatPlanFree`,!1,!0),planPro:new I(`chatPlanPro`,!1,!0),planEdu:new I(`chatPlanEdu`,!1,!0),planProPlus:new I(`chatPlanProPlus`,!1,!0),planMax:new I(`chatPlanMax`,!1,!0),planBusiness:new I(`chatPlanBusiness`,!1,!0),planEnterprise:new I(`chatPlanEnterprise`,!1,!0),organisations:new I(`chatEntitlementOrganisations`,void 0,!0),internal:new I(`chatEntitlementInternal`,!1,!0),sku:new I(`chatEntitlementSku`,void 0,!0)},e.chatQuotaExceeded=new I(`chatQuotaExceeded`,!1,!0),e.completionsQuotaExceeded=new I(`completionsQuotaExceeded`,!1,!0),e.chatAnonymous=new I(`chatAnonymous`,!1,!0),e.clientByokEnabled=new I(`github.copilot.clientByokEnabled`,!0,!0),e.hasByokModels=new I(`github.copilot.hasByokModels`,!1,!0)})(W||={});var Gv;(function(e){e[e.Unknown=1]=`Unknown`,e[e.Unresolved=2]=`Unresolved`,e[e.Available=3]=`Available`,e[e.Unavailable=4]=`Unavailable`,e[e.Free=5]=`Free`,e[e.EDU=10]=`EDU`,e[e.Pro=6]=`Pro`,e[e.ProPlus=7]=`ProPlus`,e[e.Business=8]=`Business`,e[e.Enterprise=9]=`Enterprise`,e[e.Max=11]=`Max`})(Gv||={});function Kv(e){return e===Gv.EDU||e===Gv.Pro||e===Gv.ProPlus||e===Gv.Max||e===Gv.Business||e===Gv.Enterprise}const qv={upgradePlanUrl:xh.defaultChatAgent?.upgradePlanUrl??``,entitlementSignupLimitedUrl:xh.defaultChatAgent?.entitlementSignupLimitedUrl??``,chatQuotaExceededContext:xh.defaultChatAgent?.chatQuotaExceededContext??``,completionsQuotaExceededContext:xh.defaultChatAgent?.completionsQuotaExceededContext??``},Jv=`chat.allowAnonymousAccess`;function Yv(e,t,n){return!(e.getValue(Jv)!==!0||t!==Gv.Unknown||n.hidden||n.disabledInWorkspace)}function Xv(e,t,n){n.publicLog2(`chatEntitlements`,{chatHidden:!!e.hidden,chatDisabled:!!e.disabled,chatEntitlement:e.entitlement,chatRegistered:!!e.registered,chatAnonymous:Yv(t,e.entitlement,e)})}let Zv=class extends y{static{Uv=this}static{this.CACHED_UBB_STORAGE_KEY=`chat.usageBasedBilling`}constructor(e,t,r,i,a,o,s,c){super(),this.contextKeyService=i,this.configurationService=a,this.telemetryService=o,this.logService=s,this.storageService=c,this._onDidChangeQuotaExceeded=this._register(new S),this.onDidChangeQuotaExceeded=this._onDidChangeQuotaExceeded.event,this._onDidChangeQuotaRemaining=this._register(new S),this.onDidChangeQuotaRemaining=this._onDidChangeQuotaRemaining.event,this._onDidChangeUsageBasedBilling=this._register(new S),this.onDidChangeUsageBasedBilling=this._onDidChangeUsageBasedBilling.event,this.ExtensionQuotaContextKeys={chatQuotaExceeded:qv.chatQuotaExceededContext,completionsQuotaExceeded:qv.completionsQuotaExceededContext},this._onDidChangeAnonymous=this._register(new S),this.onDidChangeAnonymous=this._onDidChangeAnonymous.event,this.anonymousObs=mv(this.onDidChangeAnonymous,()=>this.anonymous);let l=this.storageService.getBoolean(Uv.CACHED_UBB_STORAGE_KEY,Zg.PROFILE);if(this._quotas=l===void 0?{}:{usageBasedBilling:l},this.chatQuotaExceededContextKey=W.chatQuotaExceeded.bindTo(this.contextKeyService),this.completionsQuotaExceededContextKey=W.completionsQuotaExceeded.bindTo(this.contextKeyService),this.anonymousContextKey=W.chatAnonymous.bindTo(this.contextKeyService),this.anonymousContextKey.set(this.anonymous),this.contextKeyService.getContextKeyValue(W.clientByokEnabled.key)===void 0&&W.clientByokEnabled.bindTo(this.contextKeyService),this.onDidChangeEntitlement=Qn.map(Qn.filter(this.contextKeyService.onDidChangeContext,e=>e.affectsSome(new Set([W.Entitlement.planEdu.key,W.Entitlement.planPro.key,W.Entitlement.planBusiness.key,W.Entitlement.planEnterprise.key,W.Entitlement.planProPlus.key,W.Entitlement.planMax.key,W.Entitlement.planFree.key,W.Entitlement.canSignUp.key,W.Entitlement.signedOut.key,W.Entitlement.organisations.key,W.Entitlement.internal.key,W.Entitlement.sku.key])),this._store),()=>{},this._store),this.entitlementObs=mv(this.onDidChangeEntitlement,()=>this.entitlement),this.onDidChangeSentiment=Qn.map(Qn.filter(this.contextKeyService.onDidChangeContext,e=>e.affectsSome(new Set([W.Setup.completed.key,W.Setup.hidden.key,W.Setup.disabled.key,W.Setup.untrusted.key,W.Setup.installed.key,W.Setup.later.key,W.Setup.registered.key])),this._store),()=>{},this._store),this.sentimentObs=mv(this.onDidChangeSentiment,()=>this.sentiment),!t.defaultChatAgent)return;let u=this.context=new n(()=>this._register(e.createInstance(ey)));this.requests=new n(()=>this._register(e.createInstance($v,u.value,{clearQuotas:()=>this.clearQuotas(),acceptQuotas:e=>this.acceptQuotas(e)}))),this.registerListeners()}get entitlement(){return this.contextKeyService.getContextKeyValue(W.Entitlement.planEdu.key)===!0?Gv.EDU:this.contextKeyService.getContextKeyValue(W.Entitlement.planPro.key)===!0?Gv.Pro:this.contextKeyService.getContextKeyValue(W.Entitlement.planBusiness.key)===!0?Gv.Business:this.contextKeyService.getContextKeyValue(W.Entitlement.planEnterprise.key)===!0?Gv.Enterprise:this.contextKeyService.getContextKeyValue(W.Entitlement.planProPlus.key)===!0?Gv.ProPlus:this.contextKeyService.getContextKeyValue(W.Entitlement.planMax.key)===!0?Gv.Max:this.contextKeyService.getContextKeyValue(W.Entitlement.planFree.key)===!0?Gv.Free:this.contextKeyService.getContextKeyValue(W.Entitlement.canSignUp.key)===!0?Gv.Available:this.contextKeyService.getContextKeyValue(W.Entitlement.signedOut.key)===!0?Gv.Unknown:Gv.Unresolved}get isInternal(){return this.contextKeyService.getContextKeyValue(W.Entitlement.internal.key)===!0}get organisations(){return this.contextKeyService.getContextKeyValue(W.Entitlement.organisations.key)}get sku(){return this.contextKeyService.getContextKeyValue(W.Entitlement.sku.key)}get copilotTrackingId(){return this.context?.value.state.copilotTrackingId}get previewFeaturesDisabled(){return this.contextKeyService.getContextKeyValue(`github.copilot.previewFeaturesDisabled`)===!0}get clientByokEnabled(){return this.contextKeyService.getContextKeyValue(`github.copilot.clientByokEnabled`)===!0}get hasByokModels(){return this.contextKeyService.getContextKeyValue(`github.copilot.hasByokModels`)===!0}get quotas(){return this._quotas}registerListeners(){let e=new Set([this.ExtensionQuotaContextKeys.chatQuotaExceeded,this.ExtensionQuotaContextKeys.completionsQuotaExceeded]),t=this._register(new vt);this._register(this.contextKeyService.onDidChangeContext(n=>{n.affectsSome(e)&&(t.value&&t.value.cancel(),t.value=new Ii,this.update(t.value.token))}));let n=this.anonymous,r=()=>{let e=this.anonymous;e!==n&&(n=e,this.anonymousContextKey.set(e),this.context?.hasValue&&Xv(this.context.value.state,this.configurationService,this.telemetryService),this._onDidChangeAnonymous.fire())};this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Jv)&&r()})),this._register(this.onDidChangeEntitlement(()=>r())),this._register(this.onDidChangeSentiment(()=>r()))}acceptQuotas(e){let t=this._quotas;this._quotas=e,this.updateContextKeys(),t.usageBasedBilling!==e.usageBasedBilling&&(e.usageBasedBilling===void 0?this.storageService.remove(Uv.CACHED_UBB_STORAGE_KEY,Zg.PROFILE):this.storageService.store(Uv.CACHED_UBB_STORAGE_KEY,e.usageBasedBilling,Zg.PROFILE,Qg.MACHINE)),this.logService.getLevel()===U.Trace&&this.logService.trace(`[chat entitlement]: acceptQuotas: ${JSON.stringify(e)}`);let{changed:n}=this.compareQuotas(t.chat,e.chat),{changed:r}=this.compareQuotas(t.completions,e.completions),{changed:i}=this.compareQuotas(t.premiumChat,e.premiumChat);(n.exceeded||r.exceeded||i.exceeded)&&this._onDidChangeQuotaExceeded.fire();let a=t.sessionRateLimit?.percentRemaining!==e.sessionRateLimit?.percentRemaining,o=t.weeklyRateLimit?.percentRemaining!==e.weeklyRateLimit?.percentRemaining;(n.remaining||r.remaining||i.remaining||a||o||t.usageBasedBilling!==e.usageBasedBilling)&&this._onDidChangeQuotaRemaining.fire(),t.usageBasedBilling!==e.usageBasedBilling&&this._onDidChangeUsageBasedBilling.fire(),t.additionalUsageEnabled!==void 0&&e.additionalUsageEnabled!==void 0&&t.additionalUsageEnabled!==e.additionalUsageEnabled&&this.telemetryService.publicLog2(`chatAdditionalSpendConfiguration`,{enabled:e.additionalUsageEnabled??!1,entitlement:this.entitlement}),e.additionalUsageEnabled&&e.premiumChat?.percentRemaining===0&&t.premiumChat?.percentRemaining!==void 0&&t.premiumChat.percentRemaining>0&&this.telemetryService.publicLog2(`chatAdditionalSpendActive`,{entitlement:this.entitlement,additionalUsageCount:e.additionalUsageCount??0})}compareQuotas(e,t){return{changed:{exceeded:e?.percentRemaining===0!=(t?.percentRemaining===0),remaining:e?.percentRemaining!==t?.percentRemaining||e?.usageBasedBilling!==t?.usageBasedBilling}}}clearQuotas(){this.acceptQuotas({})}updateContextKeys(){let e=this._quotas.chat?.percentRemaining===0,t=this._quotas.premiumChat?.unlimited?this._quotas.premiumChat.hasQuota===!1:this._quotas.premiumChat?.percentRemaining===0,n=this._quotas.additionalUsageEnabled??!1,r=this.entitlement===Gv.Business||this.entitlement===Gv.Enterprise;this.chatQuotaExceededContextKey.set(e||t&&(r||!n)),this.completionsQuotaExceededContextKey.set(this._quotas.completions?.percentRemaining===0)}get sentiment(){return{completed:this.contextKeyService.getContextKeyValue(W.Setup.completed.key)===!0,installed:this.contextKeyService.getContextKeyValue(W.Setup.installed.key)===!0,hidden:this.contextKeyService.getContextKeyValue(W.Setup.hidden.key)===!0,disabledInWorkspace:this.contextKeyService.getContextKeyValue(W.Setup.disabledInWorkspace.key)===!0,disabled:this.contextKeyService.getContextKeyValue(W.Setup.disabled.key)===!0,untrusted:this.contextKeyService.getContextKeyValue(W.Setup.untrusted.key)===!0,later:this.contextKeyService.getContextKeyValue(W.Setup.later.key)===!0,registered:this.contextKeyService.getContextKeyValue(W.Setup.registered.key)===!0}}get anonymous(){return Yv(this.configurationService,this.entitlement,this.sentiment)}markAnonymousRateLimited(){this.anonymous&&(this.chatQuotaExceededContextKey.set(!0),this._onDidChangeQuotaExceeded.fire())}markSetupCompleted(){this.context?.value.update({completed:!0})}setForceHidden(e){this.context?this.context.value.setForceHidden(e):W.Setup.hidden.bindTo(this.contextKeyService).set(e)}async update(e){await this.requests?.value.forceResolveEntitlement(e)}};Zv=Uv=A([j(0,ws),j(1,Wh),j(2,c_),j(3,Ch),j(4,Sh),j(5,a_),j(6,Ds),j(7,n_)],Zv);function Qv(e){let t={resetDate:e.quota_reset_date_utc??e.quota_reset_date??e.limited_user_reset_date,resetDateHasTime:typeof e.quota_reset_date_utc==`string`,usageBasedBilling:e.token_based_billing,canUpgradePlan:e.can_upgrade_plan};if(e.monthly_quotas?.chat&&typeof e.limited_user_quotas?.chat==`number`&&(t.chat={percentRemaining:Math.min(100,Math.max(0,e.limited_user_quotas.chat/e.monthly_quotas.chat*100)),unlimited:!1}),e.monthly_quotas?.completions&&typeof e.limited_user_quotas?.completions==`number`&&(t.completions={percentRemaining:Math.min(100,Math.max(0,e.limited_user_quotas.completions/e.monthly_quotas.completions*100)),unlimited:!1}),e.quota_snapshots){for(let n of[`chat`,`completions`,`premium_interactions`]){let r=e.quota_snapshots[n];if(!r)continue;let i=r.entitlement===void 0?void 0:Number(r.entitlement);if(!r.unlimited&&i===0)continue;let a=r.quota_remaining===void 0?void 0:Number(r.quota_remaining),o={percentRemaining:Math.min(100,Math.max(0,r.percent_remaining)),unlimited:r.unlimited,hasQuota:r.has_quota,usageBasedBilling:e.token_based_billing,resetAt:r.quota_reset_at||void 0,entitlement:i!==void 0&&Number.isFinite(i)&&i>=0?i:void 0,quotaRemaining:a!==void 0&&Number.isFinite(a)&&a>=0?a:void 0};switch(n){case`chat`:t.chat=o;break;case`completions`:t.completions=o;break;case`premium_interactions`:t.premiumChat=o;break}}let n=e.quota_snapshots.premium_interactions;t.additionalUsageEnabled=n?.overage_permitted??!1,t.additionalUsageCount=n?.overage_count??0}return t}let $v=class extends y{constructor(e,t,n,r,i,a,o,s,c,l){super(),this.context=e,this.chatQuotasAccessor=t,this.telemetryService=n,this.logService=r,this.requestService=i,this.dialogService=a,this.openerService=o,this.lifecycleService=s,this.defaultAccountService=c,this.authenticationService=l,this.pendingResolveCts=new Ii,this.state={entitlement:this.context.state.entitlement},this.registerListeners(),this.resolve()}registerListeners(){this._register(this.defaultAccountService.onDidChangeDefaultAccount(()=>this.resolve())),this._register(this.context.onDidChange(()=>{(this.context.state.disabled||this.context.state.entitlement===Gv.Unknown)&&(this.state={entitlement:this.state.entitlement,quotas:void 0},this.chatQuotasAccessor.clearQuotas())}))}async resolve(){this.pendingResolveCts.dispose(!0);let e=this.pendingResolveCts=new Ii,t=await this.defaultAccountService.getDefaultAccount();if(e.token.isCancellationRequested)return;let n;t?this.state.entitlement===Gv.Unknown&&(n={entitlement:Gv.Unresolved}):n={entitlement:Gv.Unknown},n&&this.update(n),t&&await this.resolveEntitlement(t,e.token)}async resolveEntitlement(e,t){let n=await this.doResolveEntitlement(e,t);return typeof n?.entitlement==`number`&&!t.isCancellationRequested&&this.update(n),n}async doResolveEntitlement(e,t){if(t.isCancellationRequested)return;let n=e.entitlementsData;if(!n)return this.logService.trace(`[chat entitlement]: no entitlements data available on default account`),{entitlement:n===null?Gv.Unknown:Gv.Unresolved};let r;r=n.access_type_sku===`free_limited_copilot`?Gv.Free:n.access_type_sku===`free_educational_quota`?Gv.EDU:n.can_signup_for_limited?Gv.Available:n.copilot_plan===`individual_edu`?Gv.EDU:n.copilot_plan===`individual`?Gv.Pro:n.copilot_plan===`individual_pro`?Gv.ProPlus:n.copilot_plan===`individual_max`?Gv.Max:n.copilot_plan===`business`?Gv.Business:n.copilot_plan===`enterprise`?Gv.Enterprise:Gv.Unavailable;let i={entitlement:r,organisations:n.organization_login_list,quotas:this.toQuotas(n),sku:n.access_type_sku,copilotTrackingId:n.analytics_tracking_id};return this.logService.trace(`[chat entitlement]: resolved to ${i.entitlement}, quotas: ${JSON.stringify(i.quotas)}`),this.telemetryService.publicLog2(`chatInstallEntitlement`,{entitlement:i.entitlement,tid:n.analytics_tracking_id,sku:i.sku,quotaChatUnlimited:i.quotas?.chat?.unlimited,quotaChatHasQuota:i.quotas?.chat?.hasQuota,quotaChatEntitlement:i.quotas?.chat?.entitlement,quotaPremiumChat:i.quotas?.premiumChat?.percentRemaining,quotaPremiumChatUnlimited:i.quotas?.premiumChat?.unlimited,quotaPremiumChatHasQuota:i.quotas?.premiumChat?.hasQuota,quotaPremiumChatEntitlement:i.quotas?.premiumChat?.entitlement,quotaCompletions:i.quotas?.completions?.percentRemaining,quotaCompletionsUnlimited:i.quotas?.completions?.unlimited,quotaCompletionsHasQuota:i.quotas?.completions?.hasQuota,quotaCompletionsEntitlement:i.quotas?.completions?.entitlement,quotaResetDate:i.quotas?.resetDate,usageBasedBilling:i.quotas?.usageBasedBilling,additionalUsageEnabled:i.quotas?.additionalUsageEnabled,additionalUsageCount:i.quotas?.additionalUsageCount,canUpgradePlan:i.quotas?.canUpgradePlan}),i}toQuotas(e){return Qv(e)}async request(e,t,n,r,i,a){let o;for(let s of r){if(i.isCancellationRequested)return o;try{let r=await this.requestService.request({type:t,url:e,data:t===`POST`?JSON.stringify(n):void 0,disableCache:!0,headers:{Authorization:`Bearer ${s.accessToken}`},callSite:a},i),c=r.res.statusCode;if(c&&c!==200){o=r;continue}return r}catch(e){i.isCancellationRequested||this.logService.error(`[chat entitlement] request: error ${e}`)}}return o}update(e){this.state=e,this.context.update({entitlement:this.state.entitlement,organisations:this.state.organisations,sku:this.state.sku,copilotTrackingId:this.state.copilotTrackingId}),e.quotas&&this.chatQuotasAccessor.acceptQuotas(e.quotas)}async forceResolveEntitlement(e=Pi.None){let t=await this.defaultAccountService.refresh({forceRefresh:!0});if(t)return this.resolveEntitlement(t,e)}async signUpFree(){let e=await this.getSessions();if(e.length!==0)return this.doSignUpFree(e)}async doSignUpFree(e){let t={restricted_telemetry:this.telemetryService.telemetryLevel===r_.NONE?`disabled`:`enabled`,public_code_suggestions:`enabled`},n=await this.request(qv.entitlementSignupLimitedUrl,`POST`,t,e,Pi.None,`chatEntitlementService.signUpFree`);if(!n)return await this.onUnknownSignUpError(x(16727,`No response received.`),`[chat entitlement] sign-up: no response`)?this.doSignUpFree(e):{errorCode:1};if(n.res.statusCode&&n.res.statusCode!==200){if(n.res.statusCode===422)try{let e=await kg(n);if(e){let t=JSON.parse(e);if(typeof t.message==`string`&&t.message)return this.onUnprocessableSignUpError(`[chat entitlement] sign-up: unprocessable entity (${t.message})`,t.message),{errorCode:n.res.statusCode}}}catch{}return await this.onUnknownSignUpError(x(16728,`Unexpected status code {0}.`,n.res.statusCode),`[chat entitlement] sign-up: unexpected status code ${n.res.statusCode}`)?this.doSignUpFree(e):{errorCode:n.res.statusCode}}let r=null;try{r=await kg(n)}catch{}if(!r)return await this.onUnknownSignUpError(x(16729,`Response has no contents.`),`[chat entitlement] sign-up: response has no content`)?this.doSignUpFree(e):{errorCode:2};let i;try{i=JSON.parse(r),this.logService.trace(`[chat entitlement] sign-up: response is ${r}`)}catch(t){return await this.onUnknownSignUpError(x(16730,`Invalid response contents.`),`[chat entitlement] sign-up: error parsing response (${t})`)?this.doSignUpFree(e):{errorCode:3}}return this.update({entitlement:Gv.Free}),!!i?.subscribed}async getSessions(){let e=await this.defaultAccountService.getDefaultAccount();if(e){let t=(await this.authenticationService.getSessions(e.authenticationProvider.id)).filter(t=>t.id===e.sessionId);if(t.length)return t}return[...await this.authenticationService.getSessions(this.defaultAccountService.getDefaultAccountAuthenticationProvider().id)]}async onUnknownSignUpError(e,t){if(this.logService.error(t),!this.lifecycleService.willShutdown){let{confirmed:t}=await this.dialogService.confirm({type:Dc.Error,message:x(16731,`An error occurred while signing up for the GitHub Copilot Free plan. Would you like to try again?`),detail:e,primaryButton:x(16732,`Retry`)});return t}return!1}onUnprocessableSignUpError(e,t){this.logService.error(e),this.lifecycleService.willShutdown||this.dialogService.prompt({type:Dc.Error,message:x(16733,`An error occurred while signing up for the GitHub Copilot Free plan.`),detail:t,buttons:[{label:x(16734,`OK`),run:()=>{}},{label:x(16735,`Learn More`),run:()=>this.openerService.open(w.parse(qv.upgradePlanUrl))}]})}async signIn(e){let t=await this.defaultAccountService.signIn({additionalScopes:e?.additionalScopes,extraAuthorizeParameters:{get_started_with:`copilot-vscode`},provider:e?.useSocialProvider});return t?{defaultAccount:t,entitlements:await this.doResolveEntitlement(t,Pi.None)}:{}}dispose(){this.pendingResolveCts.dispose(!0),super.dispose()}};$v=A([j(2,a_),j(3,Ds),j(4,Fg),j(5,wh),j(6,s_),j(7,l_),j(8,Hv),j(9,o_)],$v);let ey=class extends y{static{Wv=this}static{this.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY=`chat.setupContext`}static{this.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY=`chat.setupContext.migrated.v1`}static{this.CHAT_DISABLED_CONFIGURATION_KEY=`chat.disableAIFeatures`}get state(){return this.withConfiguration(this.suspendedState??this._state)}constructor(e,t,n,r,i){super(),this.storageService=t,this.logService=n,this.configurationService=r,this.telemetryService=i,this.suspendedState=void 0,this._onDidChange=this._register(new S),this.onDidChange=this._onDidChange.event,this.updateBarrier=void 0,this._forceHidden=!1,this.canSignUpContextKey=W.Entitlement.canSignUp.bindTo(e),this.signedOutContextKey=W.Entitlement.signedOut.bindTo(e),this.freeContextKey=W.Entitlement.planFree.bindTo(e),this.eduContextKey=W.Entitlement.planEdu.bindTo(e),this.proContextKey=W.Entitlement.planPro.bindTo(e),this.proPlusContextKey=W.Entitlement.planProPlus.bindTo(e),this.maxContextKey=W.Entitlement.planMax.bindTo(e),this.businessContextKey=W.Entitlement.planBusiness.bindTo(e),this.enterpriseContextKey=W.Entitlement.planEnterprise.bindTo(e),this.organisationsContextKey=W.Entitlement.organisations.bindTo(e),this.isInternalContextKey=W.Entitlement.internal.bindTo(e),this.skuContextKey=W.Entitlement.sku.bindTo(e),this.completedContext=W.Setup.completed.bindTo(e),this.hiddenContext=W.Setup.hidden.bindTo(e),this.disabledInWorkspaceContext=W.Setup.disabledInWorkspace.bindTo(e),this.laterContext=W.Setup.later.bindTo(e),this.installedContext=W.Setup.installed.bindTo(e),this.disabledContext=W.Setup.disabled.bindTo(e),this.untrustedContext=W.Setup.untrusted.bindTo(e),this.registeredContext=W.Setup.registered.bindTo(e),this._state=this.storageService.getObject(Wv.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,Zg.PROFILE)??{entitlement:Gv.Unknown,organisations:void 0,sku:void 0,copilotTrackingId:void 0},this.storageService.getBoolean(Wv.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY,Zg.PROFILE)!==!0&&(this.storageService.store(Wv.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY,!0,Zg.PROFILE,Qg.MACHINE),this._state.installed&&!this._state.completed&&(this._state.completed=!0,this.storageService.store(Wv.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,this._state,Zg.PROFILE,Qg.MACHINE))),this.updateContextSync(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Wv.CHAT_DISABLED_CONFIGURATION_KEY)&&this.updateContext()}))}withConfiguration(e){return this._forceHidden||this.configurationService.getValue(Wv.CHAT_DISABLED_CONFIGURATION_KEY)===!0?{...e,hidden:!0}:e}setForceHidden(e){this._forceHidden!==e&&(this._forceHidden=e,this.updateContext())}async update(e){this.logService.trace(`[chat entitlement context] update(): ${JSON.stringify(e)}`);let t=JSON.stringify(this._state);if(typeof e.installed==`boolean`&&typeof e.disabled==`boolean`&&typeof e.untrusted==`boolean`&&(this._state.installed=e.installed,this._state.disabled=e.disabled,this._state.untrusted=e.untrusted,this._state.disabledInWorkspace=e.disabledInWorkspace,e.installed&&!e.disabled&&(e.hidden=!1)),typeof e.hidden==`boolean`&&(this._state.hidden=e.hidden),typeof e.later==`boolean`&&(this._state.later=e.later),typeof e.completed==`boolean`&&(this._state.completed=e.completed),typeof e.entitlement==`number`&&(this._state.entitlement=e.entitlement,this._state.organisations=e.organisations,this._state.sku=e.sku,this._state.copilotTrackingId=e.copilotTrackingId,this._state.entitlement===Gv.Free||Kv(this._state.entitlement)?this._state.registered=!0:this._state.entitlement===Gv.Available&&(this._state.registered=!1)),Yv(this.configurationService,this._state.entitlement,this._state)&&(this._state.sku=`no_auth_limited_copilot`),t!==JSON.stringify(this._state))return this.storageService.store(Wv.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,{...this._state,later:void 0},Zg.PROFILE,Qg.MACHINE),this.updateContext()}async updateContext(){await this.updateBarrier?.wait(),this.updateContextSync()}updateContextSync(){let e=this.withConfiguration(this._state);this.signedOutContextKey.set(e.entitlement===Gv.Unknown),this.canSignUpContextKey.set(e.entitlement===Gv.Available),this.freeContextKey.set(e.entitlement===Gv.Free),this.eduContextKey.set(e.entitlement===Gv.EDU),this.proContextKey.set(e.entitlement===Gv.Pro),this.proPlusContextKey.set(e.entitlement===Gv.ProPlus),this.maxContextKey.set(e.entitlement===Gv.Max),this.businessContextKey.set(e.entitlement===Gv.Business),this.enterpriseContextKey.set(e.entitlement===Gv.Enterprise),this.organisationsContextKey.set(e.organisations),this.isInternalContextKey.set(!!e.organisations?.some(e=>e===`github`||e===`microsoft`||e===`ms-copilot`||e===`MicrosoftCopilot`)),this.skuContextKey.set(e.sku),this.completedContext.set(!!e.completed),this.hiddenContext.set(!!e.hidden),this.disabledInWorkspaceContext.set(!!e.disabledInWorkspace),this.laterContext.set(!!e.later),this.installedContext.set(!!e.installed),this.disabledContext.set(!!e.disabled),this.untrustedContext.set(!!e.untrusted),this.registeredContext.set(!!e.registered),this.logService.trace(`[chat entitlement context] updateContext(): ${JSON.stringify(e)}`),Xv(e,this.configurationService,this.telemetryService),this._onDidChange.fire()}suspend(){this.suspendedState={...this._state},this.updateBarrier=new To}resume(){this.suspendedState=void 0,this.updateBarrier?.open(),this.updateBarrier=void 0}};ey=Wv=A([j(0,Ch),j(1,n_),j(2,Ds),j(3,Sh),j(4,a_)],ey);const ty=k(`languageService`),ny=k(`modelService`);var ry;new I(`workbenchState`,void 0,{type:`string`,description:x(4207,`The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)`)}),new I(`workspaceFolderCount`,0,x(4208,`The number of root folders in the workspace`)),new I(`openFolderWorkspaceSupport`,!0,!0),new I(`enterMultiRootWorkspaceSupport`,!0,!0),new I(`emptyWorkspaceSupport`,!0,!0),new I(`dirtyWorkingCopies`,!1,x(4209,`Whether there are any working copies with unsaved changes`));const iy=new I(`remoteName`,``,x(4210,`The name of the remote the window is connected to or an empty string if not connected to any remote`));new I(`virtualWorkspace`,``,x(4211,`The scheme of the current workspace is from a virtual file system or an empty string.`)),new I(`temporaryWorkspace`,!1,x(4212,`The scheme of the current workspace is from a temporary file system.`));const ay=new I(`isSessionsWindow`,!1,x(4213,`Whether the current window is a agent sessions window.`));new I(`hasWebFileSystemAccess`,!1,!0),new I(`embedderIdentifier`,void 0,x(4214,`The identifier of the embedder according to the product service, if one is defined`)),new I(`inAutomation`,!1,x(4215,`Whether VS Code is running under automation/smoke test`)),new I(`isSandboxWorkspace`,!1,!0),new I(`isFullscreen`,!1,x(4216,`Whether the main window is in fullscreen mode`)),new I(`isAuxiliaryWindowFocusedContext`,!1,x(4217,`Whether an auxiliary window is focused`));const oy=new I(`isAuxiliaryWindow`,!1,x(4218,`Window is an auxiliary window`));new I(`activeEditorIsDirty`,!1,x(4219,`Whether the active editor has unsaved changes`)),new I(`activeEditorIsNotPreview`,!1,x(4220,`Whether the active editor is not in preview mode`)),new I(`activeEditorIsFirstInGroup`,!1,x(4221,`Whether the active editor is the first one in its group`)),new I(`activeEditorIsLastInGroup`,!1,x(4222,`Whether the active editor is the last one in its group`)),new I(`activeEditorIsPinned`,!1,x(4223,`Whether the active editor is pinned`)),new I(`activeEditorIsReadonly`,!1,x(4224,`Whether the active editor is read-only`)),new I(`activeCompareEditorCanSwap`,!1,x(4225,`Whether the active compare editor can swap sides`)),new I(`activeEditorCanToggleReadonly`,!0,x(4226,`Whether the active editor can toggle between being read-only or writeable`)),new I(`activeEditorCanRevert`,!1,x(4227,`Whether the active editor can revert`)),new I(`activeEditorCanSplitInGroup`,!0),new I(`activeEditor`,null,{type:`string`,description:x(4228,`The identifier of the active editor`)}),new I(`activeEditorAvailableEditorIds`,``,x(4229,`The available editor identifiers that are usable for the active editor`)),new I(`textCompareEditorVisible`,!1,x(4230,`Whether a text compare editor is visible`)),new I(`textCompareEditorActive`,!1,x(4231,`Whether a text compare editor is active`)),new I(`sideBySideEditorActive`,!1,x(4232,`Whether a side by side editor is active`)),new I(`activeCustomEditorDiffCanToggleLayout`,!1,x(4233,`Whether the active custom editor diff can toggle between inline and side by side layout`)),new I(`activeCustomEditorTextDiff`,!1,x(4234,`Whether the active custom editor diff is backed by text documents`)),new I(`groupEditorsCount`,0,x(4235,`The number of opened editor groups`)),new I(`isTopRightEditorGroup`,!1,x(4236,`Whether the editor group is the top right editor group in the editor part`)),new I(`activeEditorGroupEmpty`,!1,x(4237,`Whether the active editor group is empty`)),new I(`activeEditorGroupIndex`,0,x(4238,`The index of the active editor group`)),new I(`activeEditorGroupLast`,!1,x(4239,`Whether the active editor group is the last group`)),new I(`activeEditorGroupLocked`,!1,x(4240,`Whether the active editor group is locked`)),new I(`multipleEditorGroups`,!1,x(4241,`Whether there are multiple editor groups opened`)),new I(`multipleEditorsSelectedInGroup`,!1,x(4242,`Whether multiple editors have been selected in an editor group`)),new I(`twoEditorsSelectedInGroup`,!1,x(4243,`Whether exactly two editors have been selected in an editor group`)),new I(`SelectedEditorsInGroupFileOrUntitledResourceContextKey`,!0,x(4244,`Whether all selected editors in a group have a file or untitled resource associated`)),new I(`editorPartMultipleEditorGroups`,!1,x(4245,`Whether there are multiple editor groups opened in an editor part`)),new I(`editorPartMaximizedEditorGroup`,!1,x(4246,`Editor Part has a maximized group`)),new I(`editorPartModal`,!1,x(4247,`Whether focus is in a modal editor part`)),new I(`editorPartModalMaximized`,!1,x(4248,`Whether the modal editor part is maximized`)),new I(`editorPartModalNavigation`,!1,x(4249,`Whether the modal editor part has navigation context`)),new I(`editorPartModalSidebar`,!1,x(4250,`Whether the modal editor part has a sidebar`)),new I(`editorPartModalSidebarVisible`,!1,x(4251,`Whether the modal editor part sidebar is visible`)),new I(`editorIsOpen`,!1,x(4252,`Whether an editor is open`)),new I(`editorAreaFocus`,!1,x(4253,`Whether the editor area (any editor part) has keyboard focus`)),new I(`inZenMode`,!1,x(4254,`Whether Zen mode is enabled`)),new I(`isCenteredLayout`,!1,x(4255,`Whether centered layout is enabled for the main editor`)),new I(`splitEditorsVertically`,!1,x(4256,`Whether editors split vertically`)),new I(`mainEditorAreaVisible`,!0,x(4257,`Whether the editor area in the main window is visible`)),new I(`editorTabsVisible`,!0,x(4258,`Whether editor tabs are visible`)),new I(`sideBarVisible`,!1,x(4259,`Whether the sidebar is visible`)),new I(`sideBarFocus`,!1,x(4260,`Whether the sidebar has keyboard focus`)),new I(`activeViewlet`,``,x(4261,`The identifier of the active viewlet`)),new I(`statusBarFocused`,!1,x(4262,`Whether the status bar has keyboard focus`)),new I(`titleBarStyle`,`custom`,x(4263,`Style of the window title bar`)),new I(`titleBarVisible`,!1,x(4264,`Whether the title bar is visible`)),new I(`isCompactTitleBar`,!1,x(4265,`Title bar is in compact mode`)),new I(`bannerFocused`,!1,x(4266,`Whether the banner has keyboard focus`)),new I(`notificationFocus`,!0,x(4267,`Whether a notification has keyboard focus`)),new I(`notificationCenterVisible`,!1,x(4268,`Whether the notifications center is visible`)),new I(`notificationToastsVisible`,!1,x(4269,`Whether a notification toast is visible`)),new I(`activeAuxiliary`,``,x(4270,`The identifier of the active auxiliary panel`)),new I(`auxiliaryBarFocus`,!1,x(4271,`Whether the auxiliary bar has keyboard focus`)),new I(`auxiliaryBarVisible`,!1,x(4272,`Whether the auxiliary bar is visible`)),new I(`auxiliaryBarMaximized`,!1,x(4273,`Whether the auxiliary bar is maximized`)),new I(`activePanel`,``,x(4274,`The identifier of the active panel`)),new I(`panelFocus`,!1,x(4275,`Whether the panel has keyboard focus`)),new I(`panelPosition`,`bottom`,x(4276,`The position of the panel, always 'bottom'`)),new I(`panelAlignment`,`center`,x(4277,`The alignment of the panel, either 'center', 'left', 'right' or 'justify'`)),new I(`panelVisible`,!1,x(4278,`Whether the panel is visible`)),new I(`panelMaximized`,!1,x(4279,`Whether the panel is maximized`)),new I(`focusedView`,``,x(4280,`The identifier of the view that has keyboard focus`));let sy=class{static{ry=this}static{this.Scheme=new I(`resourceScheme`,void 0,{type:`string`,description:x(4281,`The scheme of the resource`)})}static{this.Filename=new I(`resourceFilename`,void 0,{type:`string`,description:x(4282,`The file name of the resource`)})}static{this.Dirname=new I(`resourceDirname`,void 0,{type:`string`,description:x(4283,`The folder name the resource is contained in`)})}static{this.Path=new I(`resourcePath`,void 0,{type:`string`,description:x(4284,`The full path of the resource`)})}static{this.LangId=new I(`resourceLangId`,void 0,{type:`string`,description:x(4285,`The language identifier of the resource`)})}static{this.Resource=new I(`resource`,void 0,{type:`URI`,description:x(4286,`The full value of the resource including scheme and path`)})}static{this.Extension=new I(`resourceExtname`,void 0,{type:`string`,description:x(4287,`The extension name of the resource`)})}static{this.HasResource=new I(`resourceSet`,void 0,{type:`boolean`,description:x(4288,`Whether a resource is present or not`)})}static{this.IsFileSystemResource=new I(`isFileSystemResource`,void 0,{type:`boolean`,description:x(4289,`Whether the resource is backed by a file system provider`)})}constructor(e,t,n,r){this._contextKeyService=e,this._fileService=t,this._languageService=n,this._modelService=r,this._schemeKey=ry.Scheme.bindTo(this._contextKeyService),this._filenameKey=ry.Filename.bindTo(this._contextKeyService),this._dirnameKey=ry.Dirname.bindTo(this._contextKeyService),this._pathKey=ry.Path.bindTo(this._contextKeyService),this._langIdKey=ry.LangId.bindTo(this._contextKeyService),this._resourceKey=ry.Resource.bindTo(this._contextKeyService),this._extensionKey=ry.Extension.bindTo(this._contextKeyService),this._hasResource=ry.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=ry.IsFileSystemResource.bindTo(this._contextKeyService)}_setLangId(){let e=this.get();if(!e){this._langIdKey.set(null);return}let t=this._modelService.getModel(e)?.getLanguageId()??this._languageService.guessLanguageIdByFilepathOrFirstLine(e);this._langIdKey.set(t)}set(e){e??=void 0,!$a(this._value,e)&&(this._value=e,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.set(e?e.toString():null),this._schemeKey.set(e?e.scheme:null),this._filenameKey.set(e?to(e):null),this._dirnameKey.set(e?this.uriToPath(ro(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?no(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===O.file?e.fsPath:e.path}reset(){this._value=void 0,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.reset(),this._schemeKey.reset(),this._filenameKey.reset(),this._dirnameKey.reset(),this._pathKey.reset(),this._langIdKey.reset(),this._extensionKey.reset(),this._hasResource.reset(),this._isFileSystemResource.reset()})}get(){return this._value}};sy=ry=A([j(0,Ch),j(1,Vg),j(2,ty),j(3,ny)],sy);let cy=class extends sy{constructor(e,t,n,r){super(e,t,n,r),this._disposables=new v,this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{let e=this.get();this._isFileSystemResource.set(!!(e&&t.hasProvider(e)))})),this._disposables.add(r.onModelAdded(e=>{$a(e.uri,this.get())&&this._setLangId()})),this._disposables.add(r.onModelLanguageChanged(e=>{$a(e.model.uri,this.get())&&this._setLangId()}))}dispose(){this._disposables.dispose()}};cy=A([j(0,Ch),j(1,Vg),j(2,ty),j(3,ny)],cy);var ly;(function(e){e.AIDisabled=`chat.disableAIFeatures`,e.PluginsEnabled=`chat.plugins.enabled`,e.PluginLocations=`chat.pluginLocations`,e.PluginMarketplaces=`chat.plugins.marketplaces`,e.ExtraMarketplaces=`chat.plugins.extraMarketplaces`,e.StrictMarketplaces=`chat.plugins.strictMarketplaces`,e.EnabledPlugins=`chat.plugins.enabledPlugins`,e.AgentEnabled=`chat.agent.enabled`,e.PlanAgentDefaultModel=`chat.planAgent.defaultModel`,e.ExploreAgentDefaultModel=`chat.exploreAgent.defaultModel`,e.UtilityModel=`chat.utilityModel`,e.UtilitySmallModel=`chat.utilitySmallModel`,e.RequestQueueingDefaultAction=`chat.requestQueuing.defaultAction`,e.AgentStatusEnabled=`chat.agentsControl.enabled`,e.EditorAssociations=`chat.editorAssociations`,e.UnifiedAgentsBar=`chat.unifiedAgentsBar.enabled`,e.AgentSessionProjectionEnabled=`chat.agentSessionProjection.enabled`,e.EditModeHidden=`chat.editMode.hidden`,e.ExtensionToolsEnabled=`chat.extensionTools.enabled`,e.RepoInfoEnabled=`chat.repoInfo.enabled`,e.EditRequests=`chat.editRequests`,e.InlineReferencesStyle=`chat.inlineReferences.style`,e.AutoReply=`chat.autoReply`,e.GlobalAutoApprove=`chat.tools.global.autoApprove`,e.AutoApproveEdits=`chat.tools.edits.autoApprove`,e.AutoApprovedUrls=`chat.tools.urls.autoApprove`,e.EligibleForAutoApproval=`chat.tools.eligibleForAutoApproval`,e.EnableMath=`chat.math.enabled`,e.CheckpointsEnabled=`chat.checkpoints.enabled`,e.ThinkingStyle=`chat.agent.thinkingStyle`,e.ThinkingGenerateTitles=`chat.agent.thinking.generateTitles`,e.TerminalToolsInThinking=`chat.agent.thinking.terminalTools`,e.SimpleTerminalCollapsible=`chat.tools.terminal.simpleCollapsible`,e.CompressOutputEnabled=`chat.tools.compressOutput.enabled`,e.ThinkingPhrases=`chat.agent.thinking.phrases`,e.AutoExpandToolFailures=`chat.tools.autoExpandFailures`,e.TodosShowWidget=`chat.tools.todos.showWidget`,e.NotifyWindowOnConfirmation=`chat.notifyWindowOnConfirmation`,e.NotifyWindowOnResponseReceived=`chat.notifyWindowOnResponseReceived`,e.ChatViewSessionsEnabled=`chat.viewSessions.enabled`,e.SessionSyncEnabled=`chat.sessionSync.enabled`,e.SessionSyncExcludeRepositories=`chat.sessionSync.excludeRepositories`,e.ChatViewSessionsGrouping=`chat.viewSessions.grouping`,e.ChatViewSessionsOrientation=`chat.viewSessions.orientation`,e.ChatViewProgressBadgeEnabled=`chat.viewProgressBadge.enabled`,e.ChatContextUsageEnabled=`chat.contextUsage.enabled`,e.ChatPersistentProgressEnabled=`chat.persistentProgress.enabled`,e.ProgressBorder=`chat.progressBorder.enabled`,e.SubagentToolCustomAgents=`chat.customAgentInSubagent.enabled`,e.GeneralPurposeAgentEnabled=`chat.generalPurposeAgent.enabled`,e.SubagentsAllowInvocationsFromSubagents=`chat.subagents.allowInvocationsFromSubagents`,e.ShowCodeBlockProgressAnimation=`chat.agent.codeBlockProgress`,e.RestoreLastPanelSession=`chat.restoreLastPanelSession`,e.ExitAfterDelegation=`chat.exitAfterDelegation`,e.ExplainChangesEnabled=`chat.editing.explainChanges.enabled`,e.RevealNextChangeOnResolve=`chat.editing.revealNextChangeOnResolve`,e.GrowthNotificationEnabled=`chat.growthNotification.enabled`,e.TitleBarSignInEnabled=`chat.titleBar.signIn.enabled`,e.TitleBarOpenInAgentsWindowEnabled=`chat.titleBar.openInAgentsWindow.enabled`,e.ChatCustomizationHarnessSelectorEnabled=`chat.customizations.harnessSelector.enabled`,e.ChatCustomizationsStructuredPreviewEnabled=`chat.customizations.structuredPreview.enabled`,e.AutopilotAdvancedEnabled=`chat.autopilot.advanced.enabled`,e.PlanReviewInlineEditorEnabled=`chat.planReview.inlineEditor.enabled`,e.DefaultPermissionLevel=`chat.permissions.default`,e.ImageCarouselEnabled=`imageCarousel.chat.enabled`,e.ArtifactsEnabled=`chat.artifacts.enabled`,e.ArtifactsRulesByMimeType=`chat.artifacts.rules.byMimeType`,e.ArtifactsRulesByFilePath=`chat.artifacts.rules.byFilePath`,e.ArtifactsRulesByMemoryFilePath=`chat.artifacts.rules.byMemoryFilePath`,e.ToolConfirmationCarousel=`chat.tools.confirmationCarousel.enabled`,e.ToolRiskAssessmentEnabled=`chat.tools.riskAssessment.enabled`,e.ToolRiskAssessmentModel=`chat.tools.riskAssessment.model`,e.DefaultNewSessionMode=`chat.newSession.defaultMode`,e.AgentHostClientTools=`chat.agentHost.clientTools`,e.AgentHostDefaultChatProvider=`chat.agentHost.defaultChatProvider`,e.AgentsHandoffTipMode=`chat.agentsHandoffTip.mode`,e.IncrementalRendering=`chat.experimental.incrementalRendering.enabled`,e.IncrementalRenderingStyle=`chat.experimental.incrementalRendering.animationStyle`,e.IncrementalRenderingBuffering=`chat.experimental.incrementalRendering.buffering`})(ly||={});var uy;(function(e){e.Ask=`ask`,e.Edit=`edit`,e.Agent=`agent`})(uy||={});var dy;(function(e){e.Default=`default`,e.AutoApprove=`autoApprove`,e.Autopilot=`autopilot`})(dy||={}),new Set(Object.values(dy));var fy;(function(e){e.Collapsed=`collapsed`,e.CollapsedPreview=`collapsedPreview`,e.FixedScrolling=`fixedScrolling`})(fy||={});var py;(function(e){e.Off=`off`,e.WithThinking=`withThinking`,e.Always=`always`})(py||={});var my;(function(e){e.Off=`off`,e.WindowNotFocused=`windowNotFocused`,e.Always=`always`})(my||={});var hy;(function(e){e.Chat=`panel`,e.Terminal=`terminal`,e.Notebook=`notebook`,e.EditorInline=`editor`})(hy||={}),(function(e){function t(t){switch(t){case`panel`:return e.Chat;case`terminal`:return e.Terminal;case`notebook`:return e.Notebook;case`editor`:return e.EditorInline}return e.Chat}e.fromRaw=t})(hy||={}),new Set([O.vscodeChatEditor,O.walkThrough,O.vscodeLocalChatSession,O.vscodeSettings,O.webviewPanel,O.vscodeUserData,O.extension,`ccreq`,`openai-codex`]),kd.and(W.Setup.hidden.negate(),W.Setup.disabledInWorkspace.negate(),ay.negate(),kd.has(`config.${ly.AgentEnabled}`),oy.negate()),new I(`inModelsEditor`,!1),new I(`inModelsSearch`,!1);const gy=`General Purpose`;function _y(e,t=yn){return Ha(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}function vy(e,t){return e.replace(/^~($|\/|\\)/,`${t}$1`)}var yy;(function(e){e[e.TEXT=0]=`TEXT`,e[e.VARIABLE=1]=`VARIABLE`,e[e.SEPARATOR=2]=`SEPARATOR`})(yy||={});var by;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(by||={});var xy;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(xy||={});var Sy;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(Sy||={});var Cy;(function(e){e.DEFAULT={allowTrailingComma:!0}})(Cy||={});function wy(e,t=!1){let n=0,r=e.length,i=``,a=0,o=xy.Unknown,s=by.None;function c(t){let r=0,i=0;for(;r<t;){let t=e.charCodeAt(n);if(t>=G._0&&t<=G._9)i=i*16+t-G._0;else if(t>=G.A&&t<=G.F)i=i*16+t-G.A+10;else if(t>=G.a&&t<=G.f)i=i*16+t-G.a+10;else break;n++,r++}return r<t&&(i=-1),i}function l(e){n=e,i=``,a=0,o=xy.Unknown,s=by.None}function u(){let t=n;if(e.charCodeAt(n)===G._0)n++;else for(n++;n<e.length&&Dy(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===G.dot)if(n++,n<e.length&&Dy(e.charCodeAt(n)))for(n++;n<e.length&&Dy(e.charCodeAt(n));)n++;else return s=by.UnexpectedEndOfNumber,e.substring(t,n);let r=n;if(n<e.length&&(e.charCodeAt(n)===G.E||e.charCodeAt(n)===G.e))if(n++,(n<e.length&&e.charCodeAt(n)===G.plus||e.charCodeAt(n)===G.minus)&&n++,n<e.length&&Dy(e.charCodeAt(n))){for(n++;n<e.length&&Dy(e.charCodeAt(n));)n++;r=n}else s=by.UnexpectedEndOfNumber;return e.substring(t,r)}function d(){let t=``,i=n;for(;;){if(n>=r){t+=e.substring(i,n),s=by.UnexpectedEndOfString;break}let a=e.charCodeAt(n);if(a===G.doubleQuote){t+=e.substring(i,n),n++;break}if(a===G.backslash){if(t+=e.substring(i,n),n++,n>=r){s=by.UnexpectedEndOfString;break}switch(e.charCodeAt(n++)){case G.doubleQuote:t+=`"`;break;case G.backslash:t+=`\\`;break;case G.slash:t+=`/`;break;case G.b:t+=`\b`;break;case G.f:t+=`\f`;break;case G.n:t+=`
84
- `;break;case G.r:t+=`\r`;break;case G.t:t+=` `;break;case G.u:{let e=c(4);e>=0?t+=String.fromCharCode(e):s=by.InvalidUnicode;break}default:s=by.InvalidEscapeCharacter}i=n;continue}if(a>=0&&a<=31)if(Ey(a)){t+=e.substring(i,n),s=by.UnexpectedEndOfString;break}else s=by.InvalidCharacter;n++}return t}function f(){if(i=``,s=by.None,a=n,n>=r)return a=r,o=xy.EOF;let t=e.charCodeAt(n);if(Ty(t)){do n++,i+=String.fromCharCode(t),t=e.charCodeAt(n);while(Ty(t));return o=xy.Trivia}if(Ey(t))return n++,i+=String.fromCharCode(t),t===G.carriageReturn&&e.charCodeAt(n)===G.lineFeed&&(n++,i+=`
85
- `),o=xy.LineBreakTrivia;switch(t){case G.openBrace:return n++,o=xy.OpenBraceToken;case G.closeBrace:return n++,o=xy.CloseBraceToken;case G.openBracket:return n++,o=xy.OpenBracketToken;case G.closeBracket:return n++,o=xy.CloseBracketToken;case G.colon:return n++,o=xy.ColonToken;case G.comma:return n++,o=xy.CommaToken;case G.doubleQuote:return n++,i=d(),o=xy.StringLiteral;case G.slash:{let a=n-1;if(e.charCodeAt(n+1)===G.slash){for(n+=2;n<r&&!Ey(e.charCodeAt(n));)n++;return i=e.substring(a,n),o=xy.LineCommentTrivia}if(e.charCodeAt(n+1)===G.asterisk){n+=2;let t=r-1,c=!1;for(;n<t;){if(e.charCodeAt(n)===G.asterisk&&e.charCodeAt(n+1)===G.slash){n+=2,c=!0;break}n++}return c||(n++,s=by.UnexpectedEndOfComment),i=e.substring(a,n),o=xy.BlockCommentTrivia}return i+=String.fromCharCode(t),n++,o=xy.Unknown}case G.minus:if(i+=String.fromCharCode(t),n++,n===r||!Dy(e.charCodeAt(n)))return o=xy.Unknown;case G._0:case G._1:case G._2:case G._3:case G._4:case G._5:case G._6:case G._7:case G._8:case G._9:return i+=u(),o=xy.NumericLiteral;default:for(;n<r&&p(t);)n++,t=e.charCodeAt(n);if(a!==n){switch(i=e.substring(a,n),i){case`true`:return o=xy.TrueKeyword;case`false`:return o=xy.FalseKeyword;case`null`:return o=xy.NullKeyword}return o=xy.Unknown}return i+=String.fromCharCode(t),n++,o=xy.Unknown}}function p(e){if(Ty(e)||Ey(e))return!1;switch(e){case G.closeBrace:case G.closeBracket:case G.openBrace:case G.openBracket:case G.doubleQuote:case G.colon:case G.comma:case G.slash:return!1}return!0}function m(){let e;do e=f();while(e>=xy.LineCommentTrivia&&e<=xy.Trivia);return e}return{setPosition:l,getPosition:()=>n,scan:t?m:f,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>n-a,getTokenError:()=>s}}function Ty(e){return e===G.space||e===G.tab||e===G.verticalTab||e===G.formFeed||e===G.nonBreakingSpace||e===G.ogham||e>=G.enQuad&&e<=G.zeroWidthSpace||e===G.narrowNoBreakSpace||e===G.mathematicalSpace||e===G.ideographicSpace||e===G.byteOrderMark}function Ey(e){return e===G.lineFeed||e===G.carriageReturn||e===G.lineSeparator||e===G.paragraphSeparator}function Dy(e){return e>=G._0&&e<=G._9}var G;(function(e){e[e.nullCharacter=0]=`nullCharacter`,e[e.maxAsciiCharacter=127]=`maxAsciiCharacter`,e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.lineSeparator=8232]=`lineSeparator`,e[e.paragraphSeparator=8233]=`paragraphSeparator`,e[e.nextLine=133]=`nextLine`,e[e.space=32]=`space`,e[e.nonBreakingSpace=160]=`nonBreakingSpace`,e[e.enQuad=8192]=`enQuad`,e[e.emQuad=8193]=`emQuad`,e[e.enSpace=8194]=`enSpace`,e[e.emSpace=8195]=`emSpace`,e[e.threePerEmSpace=8196]=`threePerEmSpace`,e[e.fourPerEmSpace=8197]=`fourPerEmSpace`,e[e.sixPerEmSpace=8198]=`sixPerEmSpace`,e[e.figureSpace=8199]=`figureSpace`,e[e.punctuationSpace=8200]=`punctuationSpace`,e[e.thinSpace=8201]=`thinSpace`,e[e.hairSpace=8202]=`hairSpace`,e[e.zeroWidthSpace=8203]=`zeroWidthSpace`,e[e.narrowNoBreakSpace=8239]=`narrowNoBreakSpace`,e[e.ideographicSpace=12288]=`ideographicSpace`,e[e.mathematicalSpace=8287]=`mathematicalSpace`,e[e.ogham=5760]=`ogham`,e[e._=95]=`_`,e[e.$=36]=`$`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.ampersand=38]=`ampersand`,e[e.asterisk=42]=`asterisk`,e[e.at=64]=`at`,e[e.backslash=92]=`backslash`,e[e.bar=124]=`bar`,e[e.caret=94]=`caret`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.closeParen=41]=`closeParen`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.equals=61]=`equals`,e[e.exclamation=33]=`exclamation`,e[e.greaterThan=62]=`greaterThan`,e[e.lessThan=60]=`lessThan`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.openParen=40]=`openParen`,e[e.percent=37]=`percent`,e[e.plus=43]=`plus`,e[e.question=63]=`question`,e[e.semicolon=59]=`semicolon`,e[e.singleQuote=39]=`singleQuote`,e[e.slash=47]=`slash`,e[e.tilde=126]=`tilde`,e[e.backspace=8]=`backspace`,e[e.formFeed=12]=`formFeed`,e[e.byteOrderMark=65279]=`byteOrderMark`,e[e.tab=9]=`tab`,e[e.verticalTab=11]=`verticalTab`})(G||={});function Oy(e,t,n=Cy.DEFAULT){let r=wy(e,!1);function i(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength()):()=>!0}function a(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength()):()=>!0}let o=i(t.onObjectBegin),s=a(t.onObjectProperty),c=i(t.onObjectEnd),l=i(t.onArrayBegin),u=i(t.onArrayEnd),d=a(t.onLiteralValue),f=a(t.onSeparator),p=i(t.onComment),m=a(t.onError),h=n&&n.disallowComments,ee=n&&n.allowTrailingComma;function te(){for(;;){let e=r.scan();switch(r.getTokenError()){case by.InvalidUnicode:g(Sy.InvalidUnicode);break;case by.InvalidEscapeCharacter:g(Sy.InvalidEscapeCharacter);break;case by.UnexpectedEndOfNumber:g(Sy.UnexpectedEndOfNumber);break;case by.UnexpectedEndOfComment:h||g(Sy.UnexpectedEndOfComment);break;case by.UnexpectedEndOfString:g(Sy.UnexpectedEndOfString);break;case by.InvalidCharacter:g(Sy.InvalidCharacter);break}switch(e){case xy.LineCommentTrivia:case xy.BlockCommentTrivia:h?g(Sy.InvalidCommentToken):p();break;case xy.Unknown:g(Sy.InvalidSymbol);break;case xy.Trivia:case xy.LineBreakTrivia:break;default:return e}}}function g(e,t=[],n=[]){if(m(e),t.length+n.length>0){let e=r.getToken();for(;e!==xy.EOF;){if(t.indexOf(e)!==-1){te();break}else if(n.indexOf(e)!==-1)break;e=te()}}}function ne(e){let t=r.getTokenValue();return e?d(t):s(t),te(),!0}function re(){switch(r.getToken()){case xy.NumericLiteral:{let e=0;try{e=JSON.parse(r.getTokenValue()),typeof e!=`number`&&(g(Sy.InvalidNumberFormat),e=0)}catch{g(Sy.InvalidNumberFormat)}d(e);break}case xy.NullKeyword:d(null);break;case xy.TrueKeyword:d(!0);break;case xy.FalseKeyword:d(!1);break;default:return!1}return te(),!0}function ie(){return r.getToken()===xy.StringLiteral?(ne(!1),r.getToken()===xy.ColonToken?(f(`:`),te(),se()||g(Sy.ValueExpected,[],[xy.CloseBraceToken,xy.CommaToken])):g(Sy.ColonExpected,[],[xy.CloseBraceToken,xy.CommaToken]),!0):(g(Sy.PropertyNameExpected,[],[xy.CloseBraceToken,xy.CommaToken]),!1)}function ae(){o(),te();let e=!1;for(;r.getToken()!==xy.CloseBraceToken&&r.getToken()!==xy.EOF;){if(r.getToken()===xy.CommaToken){if(e||g(Sy.ValueExpected,[],[]),f(`,`),te(),r.getToken()===xy.CloseBraceToken&&ee)break}else e&&g(Sy.CommaExpected,[],[]);ie()||g(Sy.ValueExpected,[],[xy.CloseBraceToken,xy.CommaToken]),e=!0}return c(),r.getToken()===xy.CloseBraceToken?te():g(Sy.CloseBraceExpected,[xy.CloseBraceToken],[]),!0}function oe(){l(),te();let e=!1;for(;r.getToken()!==xy.CloseBracketToken&&r.getToken()!==xy.EOF;){if(r.getToken()===xy.CommaToken){if(e||g(Sy.ValueExpected,[],[]),f(`,`),te(),r.getToken()===xy.CloseBracketToken&&ee)break}else e&&g(Sy.CommaExpected,[],[]);se()||g(Sy.ValueExpected,[],[xy.CloseBracketToken,xy.CommaToken]),e=!0}return u(),r.getToken()===xy.CloseBracketToken?te():g(Sy.CloseBracketExpected,[xy.CloseBracketToken],[]),!0}function se(){switch(r.getToken()){case xy.OpenBracketToken:return oe();case xy.OpenBraceToken:return ae();case xy.StringLiteral:return ne(!0);default:return re()}}return te(),r.getToken()===xy.EOF?n.allowEmptyContent?!0:(g(Sy.ValueExpected,[],[]),!1):se()?(r.getToken()!==xy.EOF&&g(Sy.EndOfFileExpected,[],[]),!0):(g(Sy.ValueExpected,[],[]),!1)}var ky;(function(e){e[e.Scalar=0]=`Scalar`,e[e.Colon=1]=`Colon`,e[e.Dash=2]=`Dash`,e[e.Comma=3]=`Comma`,e[e.FlowMapStart=4]=`FlowMapStart`,e[e.FlowMapEnd=5]=`FlowMapEnd`,e[e.FlowSeqStart=6]=`FlowSeqStart`,e[e.FlowSeqEnd=7]=`FlowSeqEnd`,e[e.Newline=8]=`Newline`,e[e.Indent=9]=`Indent`,e[e.Comment=10]=`Comment`,e[e.DocumentStart=11]=`DocumentStart`,e[e.DocumentEnd=12]=`DocumentEnd`,e[e.EOF=13]=`EOF`})(ky||={});var Ay;(function(e){e.PROMPT=`promptString`,e.PICK=`pickString`})(Ay||={});var jy;(function(e){e.LOCAL=`stdio`,e.REMOTE=`http`})(jy||={});var My;(function(e){e.Enabled=`enabled`,e.Disabled=`disabled`,e.Unconfigured=`unconfigured`})(My||={});var Ny;(function(e){e.Steering=`steering`,e.Queued=`queued`})(Ny||={});var Py;(function(e){e.Creating=`creating`,e.Ready=`ready`,e.CreationFailed=`creationFailed`})(Py||={});var Fy;(function(e){e[e.Idle=1]=`Idle`,e[e.Error=2]=`Error`,e[e.InProgress=8]=`InProgress`,e[e.InputNeeded=24]=`InputNeeded`,e[e.IsRead=32]=`IsRead`,e[e.IsArchived=64]=`IsArchived`})(Fy||={});var Iy;(function(e){e.Accept=`accept`,e.Decline=`decline`,e.Cancel=`cancel`})(Iy||={});var Ly;(function(e){e.Text=`text`,e.Number=`number`,e.Integer=`integer`,e.Boolean=`boolean`,e.SingleSelect=`single-select`,e.MultiSelect=`multi-select`})(Ly||={});var Ry;(function(e){e.Text=`text`,e.Number=`number`,e.Boolean=`boolean`,e.Selected=`selected`,e.SelectedMany=`selected-many`})(Ry||={});var zy;(function(e){e.Draft=`draft`,e.Submitted=`submitted`,e.Skipped=`skipped`})(zy||={});var By;(function(e){e.Complete=`complete`,e.Cancelled=`cancelled`,e.Error=`error`})(By||={});var Vy;(function(e){e.Simple=`simple`,e.EmbeddedResource=`embeddedResource`,e.Resource=`resource`})(Vy||={});var Hy;(function(e){e.User=`user`,e.SystemNotification=`systemNotification`})(Hy||={});var Uy;(function(e){e.Markdown=`markdown`,e.ContentRef=`contentRef`,e.ToolCall=`toolCall`,e.Reasoning=`reasoning`,e.SystemNotification=`systemNotification`})(Uy||={});var Wy;(function(e){e.Streaming=`streaming`,e.PendingConfirmation=`pending-confirmation`,e.Running=`running`,e.PendingResultConfirmation=`pending-result-confirmation`,e.Completed=`completed`,e.Cancelled=`cancelled`})(Wy||={});var Gy;(function(e){e.NotNeeded=`not-needed`,e.UserAction=`user-action`,e.Setting=`setting`})(Gy||={});var Ky;(function(e){e.Denied=`denied`,e.Skipped=`skipped`,e.ResultDenied=`result-denied`})(Ky||={});var qy;(function(e){e.Approve=`approve`,e.Deny=`deny`})(qy||={});var Jy;(function(e){e.Client=`client`,e.MCP=`mcp`})(Jy||={});var Yy;(function(e){e.Text=`text`,e.EmbeddedResource=`embeddedResource`,e.Resource=`resource`,e.FileEdit=`fileEdit`,e.Terminal=`terminal`,e.Subagent=`subagent`})(Yy||={});var Xy;(function(e){e.Plugin=`plugin`,e.Directory=`directory`,e.Agent=`agent`,e.Skill=`skill`,e.Prompt=`prompt`,e.Rule=`rule`,e.Hook=`hook`,e.McpServer=`mcpServer`})(Xy||={});var Zy;(function(e){e.Loading=`loading`,e.Loaded=`loaded`,e.Degraded=`degraded`,e.Error=`error`})(Zy||={});var Qy;(function(e){e.Starting=`starting`,e.Ready=`ready`,e.AuthRequired=`authRequired`,e.Error=`error`,e.Stopped=`stopped`})(Qy||={});var $y;(function(e){e.Required=`required`,e.Expired=`expired`,e.InsufficientScope=`insufficientScope`})($y||={});var eb;(function(e){e.Client=`client`,e.Session=`session`})(eb||={});var tb;(function(e){e.Computing=`computing`,e.Ready=`ready`,e.Error=`error`})(tb||={});var nb;(function(e){e.Idle=`idle`,e.Running=`running`,e.Error=`error`})(nb||={});var rb;(function(e){e.Changeset=`changeset`,e.Resource=`resource`,e.Range=`range`})(rb||={});var ib;(function(e){e.Added=`added`,e.Updated=`updated`,e.Deleted=`deleted`})(ib||={});var ab;(function(e){e.Replay=`replay`,e.Snapshot=`snapshot`})(ab||={});var ob;(function(e){e.Base64=`base64`,e.Utf8=`utf-8`})(ob||={});var sb;(function(e){e.Truncate=`truncate`,e.Append=`append`,e.Insert=`insert`})(sb||={});var cb;(function(e){e.File=`file`,e.Directory=`directory`,e.Symlink=`symlink`})(cb||={});var lb;(function(e){e.UserMessage=`userMessage`})(lb||={});var ub;(function(e){e.Resource=`resource`,e.Range=`range`})(ub||={});var db;(function(e){e.Edit=`edit`,e.Create=`create`,e.Delete=`delete`,e.Rename=`rename`})(db||={});var fb;(function(e){e[e.Root=0]=`Root`,e[e.Session=1]=`Session`,e[e.Terminal=2]=`Terminal`,e[e.Changeset=3]=`Changeset`})(fb||={});var pb;(function(e){function t(e,t){return e===t?!0:!e||!t?!1:e.command===t.command&&e.windows===t.windows&&e.linux===t.linux&&e.osx===t.osx&&$a(e.cwd,t.cwd)&&sc(e.env,t.env)&&e.timeout===t.timeout&&$a(e.sourceUri,t.sourceUri)}e.isEquals=t})(pb||={});var mb;(function(e){e[e.Copilot=0]=`Copilot`,e[e.Claude=1]=`Claude`,e[e.OpenPlugin=2]=`OpenPlugin`})(mb||={}),mb.Copilot,mb.Claude,mb.OpenPlugin;var hb;(function(e){e.instructions=`instructions`,e.prompt=`prompt`,e.agent=`agent`,e.skill=`skill`,e.hook=`hook`})(hb||={});var gb;(function(e){e.VSCode=`vscode`,e.GitHubCopilot=`github-copilot`,e.Claude=`claude`,e.Undefined=`undefined`})(gb||={});var _b;(function(e){e.GitHubWorkspace=`github-workspace`,e.CopilotPersonal=`copilot-personal`,e.ClaudePersonal=`claude-personal`,e.ClaudeWorkspace=`claude-workspace`,e.ClaudeWorkspaceLocal=`claude-workspace-local`,e.AgentsWorkspace=`agents-workspace`,e.AgentsPersonal=`agents-personal`,e.ConfigWorkspace=`config-workspace`,e.ConfigPersonal=`config-personal`,e.UserData=`user-data`,e.ExtensionContribution=`extension-contribution`,e.ExtensionAPI=`extension-api`,e.Plugin=`plugin`})(_b||={});var vb;(function(e){e.SessionStart=`SessionStart`,e.SessionEnd=`SessionEnd`,e.UserPromptSubmit=`UserPromptSubmit`,e.PreToolUse=`PreToolUse`,e.PostToolUse=`PostToolUse`,e.PreCompact=`PreCompact`,e.SubagentStart=`SubagentStart`,e.SubagentStop=`SubagentStop`,e.Stop=`Stop`,e.ErrorOccurred=`ErrorOccurred`})(vb||={});const yb={[gb.VSCode]:{SessionStart:vb.SessionStart,UserPromptSubmit:vb.UserPromptSubmit,PreToolUse:vb.PreToolUse,PostToolUse:vb.PostToolUse,PreCompact:vb.PreCompact,SubagentStart:vb.SubagentStart,SubagentStop:vb.SubagentStop,Stop:vb.Stop},[gb.GitHubCopilot]:{sessionStart:vb.SessionStart,sessionEnd:vb.SessionEnd,userPromptSubmitted:vb.UserPromptSubmit,preToolUse:vb.PreToolUse,postToolUse:vb.PostToolUse,agentStop:vb.Stop,subagentStop:vb.SubagentStop,errorOccurred:vb.ErrorOccurred},[gb.Claude]:{SessionStart:vb.SessionStart,UserPromptSubmit:vb.UserPromptSubmit,PreToolUse:vb.PreToolUse,PostToolUse:vb.PostToolUse,PreCompact:vb.PreCompact,SubagentStart:vb.SubagentStart,SubagentStop:vb.SubagentStop,Stop:vb.Stop},[gb.Undefined]:Object.fromEntries(Object.values(vb).map(e=>[e,e]))},bb={[vb.SessionStart]:{label:x(8046,`Session Start`),description:x(8047,`Executed when a new agent session begins.`)},[vb.UserPromptSubmit]:{label:x(8048,`User Prompt Submit`),description:x(8049,`Executed when the user submits a prompt to the agent.`)},[vb.PreToolUse]:{label:x(8050,`Pre-Tool Use`),description:x(8051,`Executed before the agent uses any tool.`)},[vb.PostToolUse]:{label:x(8052,`Post-Tool Use`),description:x(8053,`Executed after a tool completes execution successfully.`)},[vb.PreCompact]:{label:x(8054,`Pre-Compact`),description:x(8055,`Executed before the agent compacts the conversation context.`)},[vb.SubagentStart]:{label:x(8056,`Subagent Start`),description:x(8057,`Executed when a subagent is started.`)},[vb.SubagentStop]:{label:x(8058,`Subagent Stop`),description:x(8059,`Executed when a subagent stops.`)},[vb.Stop]:{label:x(8060,`Stop`),description:x(8061,`Executed when the agent stops.`)},[vb.SessionEnd]:{label:x(8062,`Session End`),description:x(8063,`Executed when an agent session ends.`)},[vb.ErrorOccurred]:{label:x(8064,`Error Occurred`),description:x(8065,`Executed when an error occurs during the agent session.`)}};var xb;(function(e){function t(e,t){if(e===t)return!0;if(!e||!t)return!1;for(let n of Object.values(vb)){let r=e[n],i=t[n];if(r?.length!==i?.length)return!1;if(r&&i){for(let e=0;e<r.length;e++)if(!pb.isEquals(r[e],i[e]))return!1}}return!0}e.isEquals=t})(xb||={});function Sb(e,t){if(!e)return t;let n={...e};for(let r of Object.values(vb)){let i=e[r],a=t[r];a&&a.length>0&&(n[r]=i?[...i,...a]:a)}return n}const Cb={type:x(8028,`Must be "command".`),command:x(8029,`The command to execute. This is the default cross-platform command.`),windows:x(8030,`Windows-specific command. If specified and running on Windows, this overrides the "command" field.`),linux:x(8031,`Linux-specific command. If specified and running on Linux, this overrides the "command" field.`),osx:x(8032,`macOS-specific command. If specified and running on macOS, this overrides the "command" field.`),bash:x(8033,`Bash command for Linux and macOS.`),powershell:x(8034,`PowerShell command for Windows.`),cwd:x(8035,`Working directory for the script (relative to repository root).`),env:x(8036,`Additional environment variables that are merged with the existing environment.`),timeout:x(8037,`Maximum execution time in seconds (default: 30).`),timeoutSec:x(8038,`Maximum execution time in seconds (default: 10).`)},wb={type:`array`,items:{type:`object`,additionalProperties:!0,required:[`type`],anyOf:[{required:[`command`]},{required:[`windows`]},{required:[`linux`]},{required:[`osx`]},{required:[`bash`]},{required:[`powershell`]}],errorMessage:x(8039,`At least one of "command", "windows", "linux", or "osx" must be specified.`),properties:{type:{type:`string`,enum:[`command`],description:Cb.type},command:{type:`string`,description:Cb.command},windows:{type:`string`,description:Cb.windows},linux:{type:`string`,description:Cb.linux},osx:{type:`string`,description:Cb.osx},cwd:{type:`string`,description:Cb.cwd},env:{type:`object`,additionalProperties:{type:`string`},description:Cb.env},timeout:{type:`number`,default:30,description:Cb.timeout}}}};function Tb(e,t){return Object.fromEntries(Object.entries(yb[e]).map(([e,n])=>[e,{...t,description:bb[n]?.description}]))}Tb(gb.VSCode,wb);const Eb={type:`array`,items:{type:`object`,additionalProperties:!0,required:[`type`],anyOf:[{required:[`bash`]},{required:[`powershell`]}],errorMessage:x(8040,`At least one of "bash" or "powershell" must be specified.`),properties:{type:{type:`string`,enum:[`command`],description:Cb.type},bash:{type:`string`,description:Cb.bash},powershell:{type:`string`,description:Cb.powershell},cwd:{type:`string`,description:Cb.cwd},env:{type:`object`,additionalProperties:{type:`string`},description:Cb.env},timeoutSec:{type:`number`,default:10,description:Cb.timeoutSec}}}};Tb(gb.GitHubCopilot,Eb),x(8041,`GitHub Copilot hook configuration file. Hooks enable executing custom shell commands at strategic points in an agent's workflow.`),x(8042,`Hook definitions organized by type.`),x(8043,`Hook configuration format version.`),x(8044,`Basic hook configuration`),x(8045,`A basic hook configuration with common hooks`);function Db(e,t){return t===Pn.Windows&&e.windows?e.windows:t===Pn.Macintosh&&e.osx?e.osx:t===Pn.Linux&&e.linux?e.linux:e.command}var Ob;(function(e){e[e.Piece=1]=`Piece`,e[e.Text=2]=`Text`})(Ob||={});var kb;(function(e){e[e.BaseChatMessage=1]=`BaseChatMessage`,e[e.Other=2]=`Other`,e[e.ImageChatMessage=3]=`ImageChatMessage`})(kb||={});var Ab;(function(e){e.Internal={type:`internal`,label:`Built-In`},e.External={type:`external`,label:`External`};function t(e){switch(e.type){case`extension`:return`extension:${e.extensionId.value}`;case`mcp`:return`mcp:${e.collectionId}:${e.definitionId}`;case`user`:return`user:${e.file.toString()}`;case`internal`:return`internal`;case`external`:return`external`}}e.toKey=t;function n(e,n){return t(e)===t(n)}e.equals=n;function r(e){return e.type===`internal`?{ordinal:1,label:x(8390,`Built-In`)}:e.type===`mcp`?{ordinal:2,label:e.serverLabel||e.label}:e.type===`user`?{ordinal:0,label:x(8391,`User Defined`)}:{ordinal:3,label:e.label}}e.classify=r})(Ab||={});function jb(e){return typeof e==`object`&&!!e&&w.isUri(e.sessionResource)}var Mb;(function(e){e.Hidden=`hidden`,e.HiddenAfterComplete=`hiddenAfterComplete`})(Mb||={});function Nb(e){return!!e&&e.getTools!==void 0}var Pb;(function(e){e.execute=`execute`,e.edit=`edit`,e.search=`search`,e.agent=`agent`,e.read=`read`,e.web=`web`,e.todo=`todo`})(Pb||={});var Fb;(function(e){e.runSubagent=`runSubagent`,e.vscode=`vscode`})(Fb||={});var Ib;(function(e){e[e.Blur=1]=`Blur`,e[e.Gesture=2]=`Gesture`,e[e.Other=3]=`Other`})(Ib||={});var Lb;(function(e){e.QuickPick=`quickPick`,e.InputBox=`inputBox`,e.QuickWidget=`quickWidget`,e.QuickTree=`quickTree`})(Lb||={});var Rb;(function(e){e[e.NONE=0]=`NONE`,e[e.FIRST=1]=`FIRST`,e[e.SECOND=2]=`SECOND`,e[e.LAST=3]=`LAST`})(Rb||={});var zb;(function(e){e[e.First=1]=`First`,e[e.Second=2]=`Second`,e[e.Last=3]=`Last`,e[e.Next=4]=`Next`,e[e.Previous=5]=`Previous`,e[e.NextPage=6]=`NextPage`,e[e.PreviousPage=7]=`PreviousPage`,e[e.NextSeparator=8]=`NextSeparator`,e[e.PreviousSeparator=9]=`PreviousSeparator`})(zb||={});var Bb;(function(e){e[e.Title=1]=`Title`,e[e.Inline=2]=`Inline`,e[e.Input=3]=`Input`})(Bb||={}),new class{constructor(e){this.options=e}getItemLabel(e){return e.label}getItemDescription(e){if(!this.options?.skipDescription)return e.description}getItemPath(e){if(!this.options?.skipPath)return e.resource?.scheme===O.file?e.resource.fsPath:e.resource?.path}};const Vb=k(`quickInputService`),Hb=k(`secretStorageService`),Ub=k(`extensionService`);var Wb;(function(e){e.Extensions=`Extensions`,e.IntegratedTerminal=`IntegratedTerminal`,e.InteractiveSession=`InteractiveSession`,e.Telemetry=`Telemetry`,e.Update=`Update`})(Wb||={});const Gb=`^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$`;new RegExp(Gb);var Kb;(function(e){e.COMMAND=`command`,e.SETTINGS_SYNC=`settingsSync`})(Kb||={});var qb;(function(e){e.NoneOrRelevance=`NoneOrRelevance`,e.LastUpdatedDate=`LastUpdatedDate`,e.Title=`Title`,e.PublisherName=`PublisherName`,e.InstallCount=`InstallCount`,e.PublishedDate=`PublishedDate`,e.AverageRating=`AverageRating`,e.WeightedRating=`WeightedRating`})(qb||={});var Jb;(function(e){e[e.Default=0]=`Default`,e[e.Ascending=1]=`Ascending`,e[e.Descending=2]=`Descending`})(Jb||={});var Yb;(function(e){e.Category=`Category`,e.ExtensionId=`ExtensionId`,e.ExtensionName=`ExtensionName`,e.ExcludeWithFlags=`ExcludeWithFlags`,e.Featured=`Featured`,e.SearchText=`SearchText`,e.Tag=`Tag`,e.Target=`Target`})(Yb||={});var Xb;(function(e){e.Install=`install`,e.Uninstall=`uninstall`})(Xb||={});var Zb;(function(e){e[e.None=1]=`None`,e[e.Install=2]=`Install`,e[e.Update=3]=`Update`,e[e.Migrate=4]=`Migrate`})(Zb||={});var Qb;(function(e){e.Timeout=`Timeout`,e.Cancelled=`Cancelled`,e.ClientError=`ClientError`,e.ServerError=`ServerError`,e.Failed=`Failed`,e.DownloadFailedWriting=`DownloadFailedWriting`,e.Offline=`Offline`})(Qb||={});var $b;(function(e){e.NotFound=`NotFound`,e.Unsupported=`Unsupported`,e.Deprecated=`Deprecated`,e.Malicious=`Malicious`,e.Incompatible=`Incompatible`,e.IncompatibleApi=`IncompatibleApi`,e.IncompatibleTargetPlatform=`IncompatibleTargetPlatform`,e.ReleaseVersionNotFound=`ReleaseVersionNotFound`,e.Invalid=`Invalid`,e.Download=`Download`,e.DownloadSignature=`DownloadSignature`,e.DownloadFailedWriting=`DownloadFailedWriting`,e.UpdateMetadata=`UpdateMetadata`,e.Extract=`Extract`,e.Scanning=`Scanning`,e.ScanningExtension=`ScanningExtension`,e.ReadRemoved=`ReadRemoved`,e.UnsetRemoved=`UnsetRemoved`,e.Delete=`Delete`,e.Rename=`Rename`,e.IntializeDefaultProfile=`IntializeDefaultProfile`,e.AddToProfile=`AddToProfile`,e.InstalledExtensionNotFound=`InstalledExtensionNotFound`,e.PostInstall=`PostInstall`,e.CorruptZip=`CorruptZip`,e.IncompleteZip=`IncompleteZip`,e.PackageNotSigned=`PackageNotSigned`,e.SignatureVerificationInternal=`SignatureVerificationInternal`,e.SignatureVerificationFailed=`SignatureVerificationFailed`,e.NotAllowed=`NotAllowed`,e.Gallery=`Gallery`,e.Cancelled=`Cancelled`,e.Unknown=`Unknown`,e.Internal=`Internal`})($b||={});var ex;(function(e){e.NotSigned=`NotSigned`,e.Success=`Success`,e.RequiredArgumentMissing=`RequiredArgumentMissing`,e.InvalidArgument=`InvalidArgument`,e.PackageIsUnreadable=`PackageIsUnreadable`,e.UnhandledException=`UnhandledException`,e.SignatureManifestIsMissing=`SignatureManifestIsMissing`,e.SignatureManifestIsUnreadable=`SignatureManifestIsUnreadable`,e.SignatureIsMissing=`SignatureIsMissing`,e.SignatureIsUnreadable=`SignatureIsUnreadable`,e.CertificateIsUnreadable=`CertificateIsUnreadable`,e.SignatureArchiveIsUnreadable=`SignatureArchiveIsUnreadable`,e.FileAlreadyExists=`FileAlreadyExists`,e.SignatureArchiveIsInvalidZip=`SignatureArchiveIsInvalidZip`,e.SignatureArchiveHasSameSignatureFile=`SignatureArchiveHasSameSignatureFile`,e.PackageIntegrityCheckFailed=`PackageIntegrityCheckFailed`,e.SignatureIsInvalid=`SignatureIsInvalid`,e.SignatureManifestIsInvalid=`SignatureManifestIsInvalid`,e.SignatureIntegrityCheckFailed=`SignatureIntegrityCheckFailed`,e.EntryIsMissing=`EntryIsMissing`,e.EntryIsTampered=`EntryIsTampered`,e.Untrusted=`Untrusted`,e.CertificateRevoked=`CertificateRevoked`,e.SignatureIsNotValid=`SignatureIsNotValid`,e.UnknownError=`UnknownError`,e.PackageIsInvalidZip=`PackageIsInvalidZip`,e.SignatureArchiveHasTooManyEntries=`SignatureArchiveHasTooManyEntries`})(ex||={}),nn(1931,`Extensions`),nn(1932,`Preferences`),wm.as(ag.Configuration).registerConfiguration({id:`extensions`,order:30,title:x(1933,`Extensions`),type:`object`,properties:{"extensions.allowed":{type:`object`,markdownDescription:x(1934,`Specify a list of extensions that are allowed to use. This helps maintain a secure and consistent development environment by restricting the use of unauthorized extensions. For more information on how to configure this setting, please visit the [Configure Allowed Extensions](https://aka.ms/vscode/enterprise/extensions/allowed) section.`),default:`*`,defaultSnippets:[{body:{},description:x(1935,`No extensions are allowed.`)},{body:{"*":!0},description:x(1936,`All extensions are allowed.`)}],scope:og.APPLICATION,policy:{name:`AllowedExtensions`,category:Wb.Extensions,minimumVersion:`1.96`,localization:{description:{key:`extensions.allowed.policy`,value:x(1937,`Specify a list of extensions that are allowed to use. This helps maintain a secure and consistent development environment by restricting the use of unauthorized extensions. More information: https://aka.ms/vscode/enterprise/extensions/allowed`)}}},additionalProperties:!1,patternProperties:{"([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$":{anyOf:[{type:[`boolean`,`string`],enum:[!0,!1,`stable`],description:x(1938,`Allow or disallow the extension.`),enumDescriptions:[x(1939,`Extension is allowed.`),x(1940,`Extension is not allowed.`),x(1941,`Allow only stable versions of the extension.`)]},{type:`array`,items:{type:`string`},description:x(1942,"Allow or disallow specific versions of the extension. To specifcy a platform specific version, use the format `platform@1.2.3`, e.g. `win32-x64@1.2.3`. Supported platforms are `win32-x64`, `win32-arm64`, `linux-x64`, `linux-arm64`, `linux-armhf`, `alpine-x64`, `alpine-arm64`, `darwin-x64`, `darwin-arm64`")}]},"([a-z0-9A-Z][a-z0-9-A-Z]*)$":{type:[`boolean`,`string`],enum:[!0,!1,`stable`],description:x(1943,`Allow or disallow all extensions from the publisher.`),enumDescriptions:[x(1944,`All extensions from the publisher are allowed.`),x(1945,`All extensions from the publisher are not allowed.`),x(1946,`Allow only stable versions of the extensions from the publisher.`)]},"\\*":{type:`boolean`,enum:[!0,!1],description:x(1947,`Allow or disallow all extensions.`),enumDescriptions:[x(1948,`Allow all extensions.`),x(1949,`Disallow all extensions.`)]}}}}});const tx=new class{constructor(){this._generators=new Map,this._cache=new WeakMap}register(e,t){this._generators.set(e,t)}readActivationEvents(e){return this._cache.has(e)||this._cache.set(e,this._readActivationEvents(e)),this._cache.get(e)}createActivationEventsMap(e){let t=Object.create(null);for(let n of e){let e=this.readActivationEvents(n);e.length>0&&(t[ys.toKey(n.identifier)]=e)}return t}_readActivationEvents(e){if(e.main===void 0&&e.browser===void 0)return[];let t=Array.isArray(e.activationEvents)?e.activationEvents.slice(0):[];for(let n=0;n<t.length;n++)t[n]===`onUri`&&(t[n]=`onUri:${ys.toKey(e.identifier)}`);if(!e.contributes)return t;for(let n in e.contributes){let r=this._generators.get(n);if(!r)continue;let i=e.contributes[n],a=Array.isArray(i)?i:[i];try{t.push(...r(a))}catch(e){o(e)}}return t}},nx=Object.freeze({activeComment:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts`},agentSessionsWorkspace:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.agentSessionsWorkspace.d.ts`},agentsWindowConfiguration:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.agentsWindowConfiguration.d.ts`},aiRelatedInformation:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts`},aiSettingsSearch:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiSettingsSearch.d.ts`},aiTextSearchProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts`,version:2},authIssuers:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authIssuers.d.ts`},authLearnMore:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts`},authProviderSpecific:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authProviderSpecific.d.ts`},authSession:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts`},authSessionAudience:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSessionAudience.d.ts`},authenticationChallenges:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authenticationChallenges.d.ts`},browser:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.browser.d.ts`},canonicalUriProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts`},chatContextProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatContextProvider.d.ts`},chatDebug:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatDebug.d.ts`,version:4},chatHooks:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatHooks.d.ts`,version:6},chatInputNotification:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatInputNotification.d.ts`},chatOutputRenderer:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatOutputRenderer.d.ts`},chatParticipantAdditions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts`,version:3},chatParticipantPrivate:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts`,version:15},chatPromptFiles:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatPromptFiles.d.ts`,version:2},chatProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts`,version:5},chatReferenceBinaryData:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceBinaryData.d.ts`},chatReferenceDiagnostic:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceDiagnostic.d.ts`},chatSessionCustomizationProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatSessionCustomizationProvider.d.ts`},chatSessionsProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatSessionsProvider.d.ts`,version:3},chatStatusItem:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatStatusItem.d.ts`},chatTab:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts`},codeActionAI:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts`},codeActionRanges:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts`},codiconDecoration:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts`},commentReactor:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts`},commentReveal:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReveal.d.ts`},commentThreadApplicability:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts`},commentingRangeHint:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts`},commentsDraftState:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts`},contribAccessibilityHelpContent:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts`},contribChatEditorInlineGutterMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribChatEditorInlineGutterMenu.d.ts`},contribCommentEditorActionsMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts`},contribCommentPeekContext:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts`},contribCommentThreadAdditionalMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts`},contribCommentsViewThreadMenus:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts`},contribDebugCreateConfiguration:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDebugCreateConfiguration.d.ts`},contribDiffEditorGutterToolBarMenus:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts`},contribEditSessions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts`},contribEditorContentMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts`},contribLabelFormatterWorkspaceTooltip:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts`},contribLanguageModelToolSets:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLanguageModelToolSets.d.ts`},contribMenuBarHome:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts`},contribMergeEditorMenus:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts`},contribMultiDiffEditorMenus:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts`},contribNotebookStaticPreloads:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts`},contribRemoteHelp:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts`},contribShareMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts`},contribSourceControlArtifactGroupMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlArtifactGroupMenu.d.ts`},contribSourceControlArtifactMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlArtifactMenu.d.ts`},contribSourceControlHistoryItemMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts`},contribSourceControlHistoryTitleMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryTitleMenu.d.ts`},contribSourceControlInputBoxMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts`},contribSourceControlTitleMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts`},contribStatusBarItems:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts`},contribViewContainerTitle:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewContainerTitle.d.ts`},contribViewsRemote:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts`},contribViewsWelcome:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts`},css:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.css.d.ts`},customEditorDiffs:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorDiffs.d.ts`},customEditorMove:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts`},customEditorPriority:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorPriority.d.ts`},dataChannels:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.dataChannels.d.ts`},debugVisualization:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts`},defaultChatParticipant:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts`,version:4},devDeviceId:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.devDeviceId.d.ts`},diffCommand:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts`},diffContentOptions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts`},documentDiff:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentDiff.d.ts`},documentFiltersExclusive:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts`},editSessionIdentityProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts`},editorHoverVerbosityLevel:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts`},editorInsets:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts`},embeddings:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts`},envIsConnectionMetered:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envIsConnectionMetered.d.ts`},environmentPower:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.environmentPower.d.ts`},extensionAffinity:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionAffinity.d.ts`},extensionRuntime:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts`},extensionsAny:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts`},externalUriOpener:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts`},fileSearchProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts`},fileSearchProvider2:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider2.d.ts`},findFiles2:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts`,version:2},findTextInFiles:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts`},findTextInFiles2:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles2.d.ts`},fsChunks:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts`},inlineCompletionsAdditions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts`},interactive:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts`},interactiveWindow:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts`},ipc:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts`},languageModelCapabilities:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelCapabilities.d.ts`},languageModelPricing:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelPricing.d.ts`},languageModelProxy:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelProxy.d.ts`},languageModelSystem:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts`},languageModelThinkingPart:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelThinkingPart.d.ts`,version:1},languageModelToolResultAudience:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolResultAudience.d.ts`},languageModelToolSupportsModel:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolSupportsModel.d.ts`,version:1},languageStatusText:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts`},mappedEditsProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts`},markdownAlertSyntax:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.markdownAlertSyntax.d.ts`},mcpServerDefinitions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mcpServerDefinitions.d.ts`,version:1},mcpToolDefinitions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mcpToolDefinitions.d.ts`},multiDocumentHighlightProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts`},nativeWindowHandle:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.nativeWindowHandle.d.ts`},newSymbolNamesProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts`},notebookCellExecution:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts`},notebookControllerAffinityHidden:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts`},notebookDeprecated:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts`},notebookExecution:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts`},notebookKernelSource:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts`},notebookLiveShare:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts`},notebookMessaging:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts`},notebookMime:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts`},notebookReplDocument:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts`},notebookVariableProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts`},portsAttributes:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts`},profileContentHandlers:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts`},quickDiffProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts`},quickPickItemTooltip:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts`},quickPickSortByLabel:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts`},remoteCodingAgents:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.remoteCodingAgents.d.ts`},resolvers:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts`},scmActionButton:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts`},scmArtifactProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmArtifactProvider.d.ts`},scmHistoryProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts`},scmMultiDiffEditor:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts`},scmProviderOptions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmProviderOptions.d.ts`},scmSelectedProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts`},scmTextDocument:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts`},scmValidation:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts`},shareProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts`},speech:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts`},statusBarItemTooltip:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.statusBarItemTooltip.d.ts`},tabInputMultiDiff:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts`},tabInputTextMerge:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts`},taskExecutionTerminal:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskExecutionTerminal.d.ts`},taskPresentationGroup:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts`},taskProblemMatcherStatus:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskProblemMatcherStatus.d.ts`},taskRunOptions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskRunOptions.d.ts`},telemetry:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts`},terminalCompletionProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts`},terminalDataWriteEvent:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts`},terminalDimensions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts`},terminalExecuteCommandEvent:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts`},terminalQuickFixProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts`},terminalSelection:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts`},terminalShellEnv:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellEnv.d.ts`},terminalTitle:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalTitle.d.ts`},testObserver:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts`},testRelatedCode:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testRelatedCode.d.ts`},textDocumentChangeReason:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textDocumentChangeReason.d.ts`},textEditorDiffInformation:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textEditorDiffInformation.d.ts`},textSearchComplete2:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchComplete2.d.ts`},textSearchProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts`},textSearchProvider2:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider2.d.ts`},timeline:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts`},tokenInformation:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts`},toolInvocationApproveCombination:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.toolInvocationApproveCombination.d.ts`},toolProgress:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.toolProgress.d.ts`},treeItemMarkdownLabel:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeItemMarkdownLabel.d.ts`},treeViewActiveItem:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts`},treeViewMarkdownMessage:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts`},treeViewReveal:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts`},tunnelFactory:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts`},tunnels:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts`},valueSelectionInQuickPick:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.valueSelectionInQuickPick.d.ts`},workspaceTrust:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts`}}),rx=wm.as(tg.JSONContribution);var ix=class e{static _toSet(e){let t=new bs;for(let n=0,r=e.length;n<r;n++)t.add(e[n].description.identifier);return t}static compute(t,n){if(!t||!t.length)return new e(n,[]);if(!n||!n.length)return new e([],t);let r=this._toSet(t),i=this._toSet(n);return new e(n.filter(e=>!r.has(e.description.identifier)),t.filter(e=>!i.has(e.description.identifier)))}constructor(e,t){this.added=e,this.removed=t}},ax=class{constructor(e,t,n){this.name=e,this.defaultExtensionKind=t,this.canHandleResolver=n,this._handler=null,this._users=null,this._delta=null}setHandler(e){if(this._handler!==null)throw Error(`Handler already set!`);return this._handler=e,this._handle(),{dispose:()=>{this._handler=null}}}acceptUsers(e){this._delta=ix.compute(this._users,e),this._users=e,this._handle()}_handle(){if(!(this._handler===null||this._users===null||this._delta===null))try{this._handler(this._users,this._delta)}catch(e){o(e)}}};const ox={type:`string`,enum:[`ui`,`workspace`],enumDescriptions:[x(16992,`UI extension kind. In a remote window, such extensions are enabled only when available on the local machine.`),x(16993,`Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote.`)]},sx=`vscode://schemas/vscode-extensions`,cx={properties:{engines:{type:`object`,description:x(16994,`Engine compatibility.`),properties:{vscode:{type:`string`,description:x(16995,`For VS Code extensions, specifies the VS Code version that the extension is compatible with. Cannot be *. For example: ^1.105.0 indicates compatibility with a minimum VS Code version of 1.105.0.`),default:`^1.105.0`}}},publisher:{description:x(16996,`The publisher of the VS Code extension.`),type:`string`},displayName:{description:x(16997,`The display name for the extension used in the VS Code gallery.`),type:`string`},categories:{description:x(16998,`The categories used by the VS Code gallery to categorize the extension.`),type:`array`,uniqueItems:!0,items:{oneOf:[{type:`string`,enum:gs},{type:`string`,const:`Languages`,deprecationMessage:x(16999,`Use 'Programming Languages' instead`)}]}},galleryBanner:{type:`object`,description:x(17e3,`Banner used in the VS Code marketplace.`),properties:{color:{description:x(17001,`The banner color on the VS Code marketplace page header.`),type:`string`},theme:{description:x(17002,`The color theme for the font used in the banner.`),type:`string`,enum:[`dark`,`light`]}}},contributes:{description:x(17003,`All contributions of the VS Code extension represented by this package.`),type:`object`,properties:{},default:{}},preview:{type:`boolean`,description:x(17004,`Sets the extension to be flagged as a Preview in the Marketplace.`)},enableProposedApi:{type:`boolean`,deprecationMessage:x(17005,"Use `enabledApiProposals` instead.")},enabledApiProposals:{markdownDescription:x(17006,`Enable API proposals to try them out. Only valid **during development**. Extensions **cannot be published** with this property. For more details visit: https://code.visualstudio.com/api/advanced-topics/using-proposed-api`),type:`array`,uniqueItems:!0,items:{type:`string`,enum:Object.keys(nx).map(e=>e),markdownEnumDescriptions:Object.values(nx).map(e=>e.proposal)}},api:{markdownDescription:x(17007,`Describe the API provided by this extension. For more details visit: https://code.visualstudio.com/api/advanced-topics/remote-extensions#handling-dependencies-with-remote-extensions`),type:`string`,enum:[`none`],enumDescriptions:[x(17008,`Give up entirely the ability to export any APIs. This allows other extensions that depend on this extension to run in a separate extension host process or in a remote machine.`)]},activationEvents:{description:x(17009,`Activation events for the VS Code extension.`),type:`array`,items:{type:`string`,defaultSnippets:[{label:`onWebviewPanel`,description:x(17010,`An activation event emitted when a webview is loaded of a certain viewType`),body:`onWebviewPanel:viewType`},{label:`onLanguage`,description:x(17011,`An activation event emitted whenever a file that resolves to the specified language gets opened.`),body:"onLanguage:${1:languageId}"},{label:`onCommand`,description:x(17012,`An activation event emitted whenever the specified command gets invoked.`),body:"onCommand:${2:commandId}"},{label:`onDebug`,description:x(17013,`An activation event emitted whenever a user is about to start debugging or about to setup debug configurations.`),body:`onDebug`},{label:`onDebugInitialConfigurations`,description:x(17014,`An activation event emitted whenever a "launch.json" needs to be created (and all provideDebugConfigurations methods need to be called).`),body:`onDebugInitialConfigurations`},{label:`onDebugDynamicConfigurations`,description:x(17015,`An activation event emitted whenever a list of all debug configurations needs to be created (and all provideDebugConfigurations methods for the "dynamic" scope need to be called).`),body:`onDebugDynamicConfigurations`},{label:`onDebugResolve`,description:x(17016,`An activation event emitted whenever a debug session with the specific type is about to be launched (and a corresponding resolveDebugConfiguration method needs to be called).`),body:"onDebugResolve:${6:type}"},{label:`onDebugAdapterProtocolTracker`,description:x(17017,`An activation event emitted whenever a debug session with the specific type is about to be launched and a debug protocol tracker might be needed.`),body:"onDebugAdapterProtocolTracker:${6:type}"},{label:`workspaceContains`,description:x(17018,`An activation event emitted whenever a folder is opened that contains at least a file matching the specified glob pattern.`),body:"workspaceContains:${4:filePattern}"},{label:`onStartupFinished`,description:x(17019,"An activation event emitted after the start-up finished (after all `*` activated extensions have finished activating)."),body:`onStartupFinished`},{label:`onTaskType`,description:x(17020,`An activation event emitted whenever tasks of a certain type need to be listed or resolved.`),body:"onTaskType:${1:taskType}"},{label:`onFileSystem`,description:x(17021,`An activation event emitted whenever a file or folder is accessed with the given scheme.`),body:"onFileSystem:${1:scheme}"},{label:`onEditSession`,description:x(17022,`An activation event emitted whenever an edit session is accessed with the given scheme.`),body:"onEditSession:${1:scheme}"},{label:`onSearch`,description:x(17023,`An activation event emitted whenever a search is started in the folder with the given scheme.`),body:"onSearch:${7:scheme}"},{label:`onView`,body:"onView:${5:viewId}",description:x(17024,`An activation event emitted whenever the specified view is expanded.`)},{label:`onUri`,body:`onUri`,description:x(17025,`An activation event emitted whenever a system-wide Uri directed towards this extension is open.`)},{label:`onOpenExternalUri`,body:`onOpenExternalUri`,description:x(17026,`An activation event emitted whenever a external uri (such as an http or https link) is being opened.`)},{label:`onCustomEditor`,body:"onCustomEditor:${9:viewType}",description:x(17027,`An activation event emitted whenever the specified custom editor becomes visible.`)},{label:`onNotebook`,body:"onNotebook:${1:type}",description:x(17028,`An activation event emitted whenever the specified notebook document is opened.`)},{label:`onAuthenticationRequest`,body:"onAuthenticationRequest:${11:authenticationProviderId}",description:x(17029,`An activation event emitted whenever sessions are requested from the specified authentication provider.`)},{label:`onRenderer`,description:x(17030,`An activation event emitted whenever a notebook output renderer is used.`),body:"onRenderer:${11:rendererId}"},{label:`onTerminalProfile`,body:"onTerminalProfile:${1:terminalId}",description:x(17031,`An activation event emitted when a specific terminal profile is launched.`)},{label:`onTerminalQuickFixRequest`,body:"onTerminalQuickFixRequest:${1:quickFixId}",description:x(17032,`An activation event emitted when a command matches the selector associated with this ID`)},{label:`onWalkthrough`,body:"onWalkthrough:${1:walkthroughID}",description:x(17033,`An activation event emitted when a specified walkthrough is opened.`)},{label:`onIssueReporterOpened`,body:`onIssueReporterOpened`,description:x(17034,`An activation event emitted when the issue reporter is opened.`)},{label:`onChatParticipant`,body:"onChatParticipant:${1:participantId}",description:x(17035,`An activation event emitted when the specified chat participant is invoked.`)},{label:`onChatContextProvider`,body:"onChatContextProvider:${1:contextProviderId}",description:x(17036,`An activation event emitted when the specified chat context provider is invoked.`)},{label:`onLanguageModelChatProvider`,body:"onLanguageModelChatProvider:${1:vendor}",description:x(17037,`An activation event emitted when a chat model provider for the given vendor is requested.`)},{label:`onLanguageModelTool`,body:"onLanguageModelTool:${1:toolId}",description:x(17038,`An activation event emitted when the specified language model tool is invoked.`)},{label:`onTerminal`,body:`onTerminal:{1:shellType}`,description:x(17039,`An activation event emitted when a terminal of the given shell type is opened.`)},{label:`onTerminalShellIntegration`,body:"onTerminalShellIntegration:${1:shellType}",description:x(17040,`An activation event emitted when terminal shell integration is activated for the given shell type.`)},{label:`onMcpCollection`,description:x(17041,`An activation event emitted whenever a tool from the MCP server is requested.`),body:"onMcpCollection:${2:collectionId}"},{label:`*`,description:x(17042,`An activation event emitted on VS Code startup. To ensure a great end user experience, please use this activation event in your extension only when no other activation events combination works in your use-case.`),body:`*`}]}},badges:{type:`array`,description:x(17043,`Array of badges to display in the sidebar of the Marketplace's extension page.`),items:{type:`object`,required:[`url`,`href`,`description`],properties:{url:{type:`string`,description:x(17044,`Badge image URL.`)},href:{type:`string`,description:x(17045,`Badge link.`)},description:{type:`string`,description:x(17046,`Badge description.`)}}}},markdown:{type:`string`,description:x(17047,`Controls the Markdown rendering engine used in the Marketplace. Either github (default) or standard.`),enum:[`github`,`standard`],default:`github`},qna:{default:`marketplace`,description:x(17048,`Controls the Q&A link in the Marketplace. Set to marketplace to enable the default Marketplace Q & A site. Set to a string to provide the URL of a custom Q & A site. Set to false to disable Q & A altogether.`),anyOf:[{type:[`string`,`boolean`],enum:[`marketplace`,!1]},{type:`string`}]},extensionDependencies:{description:x(17049,"Dependencies to other extensions. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:`array`,uniqueItems:!0,items:{type:`string`,pattern:Gb}},extensionAffinity:{description:x(17050,"Extensions that this extension should be colocated with in the same extension host process if possible. The identifier of an extension is always ${publisher}.${name}. For example: vscode.git."),type:`array`,uniqueItems:!0,items:{type:`string`,pattern:Gb}},extensionPack:{description:x(17051,"A set of extensions that can be installed together. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:`array`,uniqueItems:!0,items:{type:`string`,pattern:Gb}},extensionKind:{description:x(17052,"Define the kind of an extension. `ui` extensions are installed and run on the local machine while `workspace` extensions run on the remote."),type:`array`,items:ox,default:[`workspace`],defaultSnippets:[{body:[`ui`],description:x(17053,`Define an extension which can run only on the local machine when connected to remote window.`)},{body:[`workspace`],description:x(17054,`Define an extension which can run only on the remote machine when connected remote window.`)},{body:[`ui`,`workspace`],description:x(17055,`Define an extension which can run on either side, with a preference towards running on the local machine.`)},{body:[`workspace`,`ui`],description:x(17056,`Define an extension which can run on either side, with a preference towards running on the remote machine.`)},{body:[],description:x(17057,`Define an extension which cannot run in a remote context, neither on the local, nor on the remote machine.`)}]},capabilities:{description:x(17058,`Declare the set of supported capabilities by the extension.`),type:`object`,properties:{virtualWorkspaces:{description:x(17059,`Declares whether the extension should be enabled in virtual workspaces. A virtual workspace is a workspace which is not backed by any on-disk resources. When false, this extension will be automatically disabled in virtual workspaces. Default is true.`),type:[`boolean`,`object`],defaultSnippets:[{label:`limited`,body:{supported:"${1:limited}",description:"${2}"}},{label:`false`,body:{supported:!1,description:"${2}"}}],default:(!0).valueOf,properties:{supported:{markdownDescription:x(17060,`Declares the level of support for virtual workspaces by the extension.`),type:[`string`,`boolean`],enum:[`limited`,!0,!1],enumDescriptions:[x(17061,`The extension will be enabled in virtual workspaces with some functionality disabled.`),x(17062,`The extension will be enabled in virtual workspaces with all functionality enabled.`),x(17063,`The extension will not be enabled in virtual workspaces.`)]},description:{type:`string`,markdownDescription:x(17064,"A description of how virtual workspaces affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}},untrustedWorkspaces:{description:x(17065,`Declares how the extension should be handled in untrusted workspaces.`),type:`object`,required:[`supported`],defaultSnippets:[{body:{supported:"${1:limited}",description:"${2}"}}],properties:{supported:{markdownDescription:x(17066,`Declares the level of support for untrusted workspaces by the extension.`),type:[`string`,`boolean`],enum:[`limited`,!0,!1],enumDescriptions:[x(17067,`The extension will be enabled in untrusted workspaces with some functionality disabled.`),x(17068,`The extension will be enabled in untrusted workspaces with all functionality enabled.`),x(17069,`The extension will not be enabled in untrusted workspaces.`)]},restrictedConfigurations:{description:x(17070,`A list of configuration keys contributed by the extension that should not use workspace values in untrusted workspaces.`),type:`array`,items:{type:`string`}},description:{type:`string`,markdownDescription:x(17071,"A description of how workspace trust affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}}}},sponsor:{description:x(17072,`Specify the location from where users can sponsor your extension.`),type:`object`,defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:x(17073,`URL from where users can sponsor your extension. It must be a valid URL with a HTTP or HTTPS protocol. Example value: https://github.com/sponsors/nvaccess`),type:`string`}}},scripts:{type:`object`,properties:{"vscode:prepublish":{description:x(17074,`Script executed before the package is published as a VS Code extension.`),type:`string`},"vscode:uninstall":{description:x(17075,`Uninstall hook for VS Code extension. Script that gets executed when the extension is completely uninstalled from VS Code which is when VS Code is restarted (shutdown and start) after the extension is uninstalled. Only Node scripts are supported.`),type:`string`}}},icon:{type:`string`,description:x(17076,`The path to a 128x128 pixel icon.`)},l10n:{type:`string`,description:x(17077,`The relative path to a folder containing localization (bundle.l10n.*.json) files. Must be specified if you are using the vscode.l10n API.`)},pricing:{type:`string`,markdownDescription:x(17078,`The pricing information for the extension. Can be Free (default) or Trial. For more details visit: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#extension-pricing-label`),enum:[`Free`,`Trial`],default:`Free`}}};var lx=class{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw Error(`Duplicate extension point: `+e.extensionPoint);let t=new ax(e.extensionPoint,e.defaultExtensionKind,e.canHandleResolver);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&tx.register(e.extensionPoint,e.activationEventsGenerator),cx.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,rx.registerSchema(sx,cx),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}};const ux={ExtensionsRegistry:`ExtensionsRegistry`};wm.add(ux.ExtensionsRegistry,new lx);const dx=wm.as(ux.ExtensionsRegistry);rx.registerSchema(sx,cx),rx.registerSchema(`vscode://schemas/vscode-product`,{properties:{extensionEnabledApiProposals:{description:x(17079,`API proposals that the respective extensions can freely use.`),type:`object`,properties:{},additionalProperties:{anyOf:[{type:`array`,uniqueItems:!0,items:{type:`string`,enum:Object.keys(nx),markdownEnumDescriptions:Object.values(nx).map(e=>e.proposal)}}]}}}}),new I(`isMac`,bn,x(1891,`Whether the operating system is macOS`)),new I(`isLinux`,xn,x(1892,`Whether the operating system is Linux`)),new I(`isWindows`,yn,x(1893,`Whether the operating system is Windows`));const fx=new I(`isWeb`,Cn,x(1894,`Whether the platform is a web browser`));new I(`isMacNative`,bn&&!Cn,x(1895,`Whether the operating system is macOS on a non-browser platform`)),new I(`isIOS`,En,x(1896,`Whether the operating system is iOS`)),new I(`isMobile`,Dn,x(1897,`Whether the platform is a mobile web browser`)),new I(`isDevelopment`,!1,!0),new I(`productQualityType`,``,x(1898,`Quality type of VS Code`)),new I(`inputFocus`,!1,x(1899,`Whether keyboard focus is inside an input box`));var px;(function(e){e.Inactive=`inactive`,e.Satisfied=`satisfied`,e.Restricted=`restricted`})(px||={});var mx;(function(e){e.NoAccount=`noAccount`,e.WrongProvider=`wrongProvider`,e.OrgNotApproved=`orgNotApproved`,e.PolicyNotResolved=`policyNotResolved`})(mx||={});const hx=new I(`chatAccountPolicyGateActive`,!1,{type:`boolean`,description:x(17176,`True when the 'Require Approved Account' policy is in effect and the user is not yet signed into an approved GitHub organization, so all AI features are disabled until they sign in.`)});var gx;(function(e){e.responseVote=new I(`chatSessionResponseVote`,``,{type:`string`,description:x(7828,`When the response has been voted up, is set to 'up'. When voted down, is set to 'down'. Otherwise an empty string.`)}),e.responseDetectedAgentCommand=new I(`chatSessionResponseDetectedAgentOrCommand`,!1,{type:`boolean`,description:x(7829,`When the agent or command was automatically detected`)}),e.responseSupportsIssueReporting=new I(`chatResponseSupportsIssueReporting`,!1,{type:`boolean`,description:x(7830,`True when the current chat response supports issue reporting.`)}),e.responseIsFiltered=new I(`chatSessionResponseFiltered`,!1,{type:`boolean`,description:x(7831,`True when the chat response was filtered out by the server.`)}),e.responseHasError=new I(`chatSessionResponseError`,!1,{type:`boolean`,description:x(7832,`True when the chat response resulted in an error.`)}),e.requestInProgress=new I(`chatSessionRequestInProgress`,!1,{type:`boolean`,description:x(7833,`True when the current request is still in progress.`)}),e.hasActiveRequest=new I(`chatSessionHasActiveRequest`,!1,{type:`boolean`,description:x(7834,`True when the current chat response has not completed, regardless of intermediate states like tool calls or elicitations.`)}),e.currentlyEditing=new I(`chatSessionCurrentlyEditing`,!1,{type:`boolean`,description:x(7835,`True when the current request is being edited.`)}),e.currentlyEditingInput=new I(`chatSessionCurrentlyEditingInput`,!1,{type:`boolean`,description:x(7836,`True when the current request input at the bottom is being edited.`)}),(function(e){e.Sent=`s`,e.Queue=`q`,e.Steer=`st`})(e.EditingRequestType||={}),e.editingRequestType=new I(`chatEditingSentRequest`,void 0,{type:`string`,description:x(7837,`The type of the current editing request.`)}),e.isResponse=new I(`chatResponse`,!1,{type:`boolean`,description:x(7838,`The chat item is a response.`)}),e.isRequest=new I(`chatRequest`,!1,{type:`boolean`,description:x(7839,`The chat item is a request`)}),e.isFirstRequest=new I(`chatFirstRequest`,!1,{type:`boolean`,description:x(7840,`The chat item is the first request in the session.`)}),e.isPendingRequest=new I(`chatRequestIsPending`,!1,{type:`boolean`,description:x(7841,`True when the chat request item is pending in the queue.`)}),e.itemId=new I(`chatItemId`,``,{type:`string`,description:x(7842,`The id of the chat item.`)}),e.lastItemId=new I(`chatLastItemId`,[],{type:`string`,description:x(7843,`The id of the last chat item.`)}),e.editApplied=new I(`chatEditApplied`,!1,{type:`boolean`,description:x(7844,`True when the chat text edits have been applied.`)}),e.inputHasText=new I(`chatInputHasText`,!1,{type:`boolean`,description:x(7845,`True when the chat input has text.`)}),e.inputHasSendableContent=new I(`chatInputHasSendableContent`,!1,{type:`boolean`,description:x(7846,`True when the chat input has text or file attachments that can be sent.`)}),e.inputHasFocus=new I(`chatInputHasFocus`,!1,{type:`boolean`,description:x(7847,`True when the chat input has focus.`)}),e.inChatInput=new I(`inChatInput`,!1,{type:`boolean`,description:x(7848,`True when focus is in the chat input, false otherwise.`)}),e.inChatSession=new I(`inChat`,!1,{type:`boolean`,description:x(7849,`True when focus is in the chat widget, false otherwise.`)}),e.inChatQuestionCarousel=new I(`inChatQuestionCarousel`,!1,{type:`boolean`,description:x(7850,`True when focus is in the chat question carousel.`)}),e.chatQuestionCarouselHasTerminal=new I(`chatQuestionCarouselHasTerminal`,!1,{type:`boolean`,description:x(7851,`True when the chat question carousel was triggered by a terminal and has a terminal to focus.`)}),e.inChatEditor=new I(`inChatEditor`,!1,{type:`boolean`,description:x(7852,`Whether focus is in a chat editor.`)}),e.inChatTodoList=new I(`inChatTodoList`,!1,{type:`boolean`,description:x(7853,`True when focus is in the chat todo list.`)}),e.inChatTip=new I(`inChatTip`,!1,{type:`boolean`,description:x(7854,`True when focus is in a chat tip.`)}),e.multipleChatTips=new I(`multipleChatTips`,!1,{type:`boolean`,description:x(7855,`True when there are multiple chat tips available.`)}),e.inChatTerminalToolOutput=new I(`inChatTerminalToolOutput`,!1,{type:`boolean`,description:x(7856,`True when focus is in the chat terminal output region.`)}),e.chatModeKind=new I(`chatAgentKind`,uy.Ask,{type:`string`,description:x(7857,`The 'kind' of the current agent.`)}),e.chatPermissionLevel=new I(`chatPermissionLevel`,dy.Default,{type:`string`,description:x(7858,`The current permission level for tool auto-approval.`)}),e.chatModeName=new I(`chatModeName`,``,{type:`string`,description:x(7859,`The name of the current chat mode (e.g. 'Plan' for custom modes).`)}),e.chatModelId=new I(`chatModelId`,``,{type:`string`,description:x(7860,`The short id of the currently selected chat model (for example 'gpt-4.1').`)}),e.supported=kd.or(fx.negate(),iy.notEqualsTo(``),kd.has(`config.chat.experimental.serverlessWebEnabled`)),e.enabled=new I(`chatIsEnabled`,!1,{type:`boolean`,description:x(7861,`True when chat is enabled because a default chat participant is activated with an implementation.`)}),e.accountPolicyGateActive=hx,e.lockedToCodingAgent=new I(`lockedToCodingAgent`,!1,{type:`boolean`,description:x(7862,`True when the chat widget is locked to the coding agent session.`)}),e.lockedCodingAgentId=new I(`lockedCodingAgentId`,``,{type:`string`,description:x(7863,`The agent ID when the chat widget is locked to a coding agent session.`)}),e.chatSessionHasCustomAgentTarget=new I(`chatSessionHasCustomAgentTarget`,!1,{type:`boolean`,description:x(7864,`True when the chat session has a customAgentTarget defined to filter modes.`)}),e.chatSessionHasTargetedModels=new I(`chatSessionHasTargetedModels`,!1,{type:`boolean`,description:x(7865,`True when the chat session has language models that target it via targetChatSessionType.`)}),e.agentSupportsAttachments=new I(`agentSupportsAttachments`,!1,{type:`boolean`,description:x(7866,`True when the chat agent supports attachments.`)}),e.withinEditSessionDiff=new I(`withinEditSessionDiff`,!1,{type:`boolean`,description:x(7867,`True when the chat widget dispatches to the edit session chat.`)}),e.filePartOfEditSession=new I(`filePartOfEditSession`,!1,{type:`boolean`,description:x(7868,`True when the chat widget is within a file with an edit session.`)}),e.extensionParticipantRegistered=new I(`chatPanelExtensionParticipantRegistered`,!1,{type:`boolean`,description:x(7869,`True when a default chat participant is registered for the panel from an extension.`)}),e.panelParticipantRegistered=new I(`chatPanelParticipantRegistered`,!1,{type:`boolean`,description:x(7870,`True when a default chat participant is registered for the panel.`)}),e.chatEditingCanUndo=new I(`chatEditingCanUndo`,!1,{type:`boolean`,description:x(7871,`True when it is possible to undo an interaction in the editing panel.`)}),e.chatEditingCanRedo=new I(`chatEditingCanRedo`,!1,{type:`boolean`,description:x(7872,`True when it is possible to redo an interaction in the editing panel.`)}),e.languageModelsAreUserSelectable=new I(`chatModelsAreUserSelectable`,!1,{type:`boolean`,description:x(7873,`True when the chat model can be selected manually by the user.`)}),e.nonCopilotLanguageModelsAreUserSelectable=new I(`chatNonCopilotModelsAreUserSelectable`,!1,{type:`boolean`,description:x(7874,`True when a user-selectable chat model from a non-Copilot vendor is available.`)}),e.chatSessionHasModels=new I(`chatSessionHasModels`,!1,{type:`boolean`,description:x(7875,`True when the chat is in a contributed chat session that has available 'models' to display.`)}),e.chatSessionOptionsValid=new I(`chatSessionOptionsValid`,!0,{type:`boolean`,description:x(7876,`True when all selected session options exist in their respective option group items.`)}),e.extensionInvalid=new I(`chatExtensionInvalid`,!1,{type:`boolean`,description:x(7877,`True when the installed chat extension is invalid and needs to be updated.`)}),e.inputCursorAtTop=new I(`chatCursorAtTop`,!1),e.inputHasAgent=new I(`chatInputHasAgent`,!1),e.location=new I(`chatLocation`,void 0),e.inQuickChat=new I(`quickChatHasFocus`,!1,{type:`boolean`,description:x(7878,`True when the quick chat UI has focus, false otherwise.`)}),e.inAgentSessionsWelcome=new I(`inAgentSessionsWelcome`,!1,{type:`boolean`,description:x(7879,`True when the chat input is within the agent sessions welcome page.`)}),e.chatSessionType=new I(`chatSessionType`,``,{type:`string`,description:x(7880,`The type of the current chat session.`)}),e.hasFileAttachments=new I(`chatHasFileAttachments`,!1,{type:`boolean`,description:x(7881,`True when the chat has file attachments.`)}),e.chatSessionIsEmpty=new I(`chatSessionIsEmpty`,!0,{type:`boolean`,description:x(7882,`True when the current chat session has no requests.`)}),e.hasPendingRequests=new I(`chatHasPendingRequests`,!1,{type:`boolean`,description:x(7883,`True when there are pending requests in the queue.`)}),e.chatSessionHasDebugData=new I(`chatSessionHasDebugData`,!1,{type:`boolean`,description:x(7884,`True when the current chat session has debug log data.`)}),e.chatSessionHasDebugTools=new I(`chatSessionHasDebugTools`,!1,{type:`boolean`,description:x(7885,`True when debug tools are enabled in the current chat session.`)}),e.remoteJobCreating=new I(`chatRemoteJobCreating`,!1,{type:`boolean`,description:x(7886,`True when a remote coding agent job is being created.`)}),e.hasRemoteCodingAgent=new I(`hasRemoteCodingAgent`,!1,x(7887,`Whether any remote coding agent is available`)),e.hasCanDelegateProviders=new I(`chatHasCanDelegateProviders`,!1,{type:`boolean`,description:x(7888,`True when there are chat session providers with delegation support available.`)}),e.enableRemoteCodingAgentPromptFileOverlay=new I(`enableRemoteCodingAgentPromptFileOverlay`,!1,x(7889,`Whether the remote coding agent prompt file overlay feature is enabled`)),e.skipChatRequestInProgressMessage=new I(`chatSkipRequestInProgressMessage`,!1,{type:`boolean`,description:x(7890,`True when the chat request in progress message should be skipped.`)}),e.Setup=W.Setup,e.Entitlement=W.Entitlement,e.chatQuotaExceeded=W.chatQuotaExceeded,e.completionsQuotaExceeded=W.completionsQuotaExceeded,e.Editing={hasToolConfirmation:new I(`chatHasToolConfirmation`,!1,{type:`boolean`,description:x(7891,`True when a tool confirmation is present.`)}),hasElicitationRequest:new I(`chatHasElicitationRequest`,!1,{type:`boolean`,description:x(7892,`True when a chat elicitation request is pending.`)}),hasQuestionCarousel:new I(`chatHasQuestionCarousel`,!1,{type:`boolean`,description:x(7893,`True when a question carousel is rendered in the chat input.`)})},e.Tools={toolsCount:new I(`toolsCount`,0,{type:`number`,description:x(7894,`The count of tools available in the chat.`)})},e.foregroundSessionCount=new I(`chatForegroundSessionCount`,0,{type:`number`,description:x(7895,`The number of foreground chat sessions visible across chat surfaces.`)}),e.Modes={hasCustomChatModes:new I(`chatHasCustomAgents`,!1,{type:`boolean`,description:x(7896,`True when the chat has custom agents available.`)}),agentModeDisabledByPolicy:new I(`chatAgentModeDisabledByPolicy`,!1,{type:`boolean`,description:x(7897,`True when agent mode is disabled by organization policy.`)})},e.panelLocation=new I(`chatPanelLocation`,void 0,{type:`number`,description:x(7898,`The location of the chat panel.`)}),e.agentSessionsViewerFocused=new I(`agentSessionsViewerFocused`,!0,{type:`boolean`,description:x(7899,`If the agent sessions view in the chat view is focused.`)}),e.agentSessionsViewerOrientation=new I(`agentSessionsViewerOrientation`,void 0,{type:`number`,description:x(7900,`Orientation of the agent sessions view in the chat view.`)}),e.agentSessionsViewerPosition=new I(`agentSessionsViewerPosition`,void 0,{type:`number`,description:x(7901,`Position of the agent sessions view in the chat view.`)}),e.agentSessionsViewerVisible=new I(`agentSessionsViewerVisible`,void 0,{type:`boolean`,description:x(7902,`Visibility of the agent sessions view in the chat view.`)}),e.agentSessionType=new I(`chatSessionType`,``,{type:`string`,description:x(7903,`The type of the current agent session item.`)}),e.chatSessionSupportsDelegation=new I(`chatSessionSupportsDelegation`,!0,{type:`boolean`,description:x(7904,`True when the current session type supports delegation.`)}),e.chatSessionSupportsFork=new I(`chatSessionSupportsFork`,!1,{type:`boolean`,description:x(7905,`True when the current chat session provider supports forking conversations.`)}),e.agentSessionSection=new I(`agentSessionSection`,``,{type:`string`,description:x(7906,`The section of the current agent session section item.`)}),e.isArchivedAgentSession=new I(`agentSessionIsArchived`,!1,{type:`boolean`,description:x(7907,`True when the agent session item is archived.`)}),e.isPinnedAgentSession=new I(`agentSessionIsPinned`,!1,{type:`boolean`,description:x(7908,`True when the agent session item is pinned.`)}),e.isReadAgentSession=new I(`agentSessionIsRead`,!1,{type:`boolean`,description:x(7909,`True when the agent session item is read.`)}),e.hasMultipleAgentSessionsSelected=new I(`agentSessionHasMultipleSelected`,!1,{type:`boolean`,description:x(7910,`True when multiple agent sessions are selected.`)}),e.hasAgentSessionChanges=new I(`agentSessionHasChanges`,!1,{type:`boolean`,description:x(7911,`True when the current agent session item has changes.`)}),e.isKatexMathElement=new I(`chatIsKatexMathElement`,!1,{type:`boolean`,description:x(7912,`True when focusing a KaTeX math element.`)}),e.hasUsedCreateSlashCommands=new I(`chatHasUsedCreateSlashCommands`,!1,{type:`boolean`,description:x(7913,`True when the user has used any of the /create-* slash commands.`)}),e.contextUsageHasBeenOpened=new I(`chatContextUsageHasBeenOpened`,!1,{type:`boolean`,description:x(7914,`True when the user has opened the context window usage details.`)}),e.newChatButtonExperimentIcon=new I(`chatNewChatButtonExperimentIcon`,``,{type:`string`,description:x(7915,`The icon variant for the new chat button, controlled by experiment. Values: 'copilot', 'new-session', 'comment', or empty for default.`)})})(gx||={});var _x;(function(e){e.inEditingMode=kd.or(gx.chatModeKind.isEqualTo(uy.Edit),gx.chatModeKind.isEqualTo(uy.Agent)),e.isAgentHostSession=kd.or(kd.regex(gx.lockedCodingAgentId.key,/^agent-host-/),kd.regex(gx.lockedCodingAgentId.key,/^remote-/)),e.isAgentHostSessionItem=kd.or(kd.regex(gx.agentSessionType.key,/^agent-host-/),kd.regex(gx.agentSessionType.key,/^remote-/))})(_x||={});const vx=k(`ILanguageModelsConfigurationService`);var yx,bx;(function(e){e[e.System=0]=`System`,e[e.User=1]=`User`,e[e.Assistant=2]=`Assistant`})(bx||={});var xx;(function(e){e[e.Assistant=0]=`Assistant`,e[e.User=1]=`User`,e[e.Extension=2]=`Extension`})(xx||={});var Sx;(function(e){e.PNG=`image/png`,e.JPEG=`image/jpeg`,e.GIF=`image/gif`,e.WEBP=`image/webp`,e.BMP=`image/bmp`})(Sx||={});var Cx;(function(e){e.Low=`low`,e.High=`high`})(Cx||={});var wx;(function(e){function t(e){return(e.capabilities?.agentMode===void 0||e.capabilities.agentMode)&&!!e.capabilities?.toolCalling}e.suitableForAgentMode=t;function n(e){return`${e.name} (${e.vendor})`}e.asQualifiedName=n;function r(e,t){return t.vendor===`copilot`&&e===t.name?!0:e===n(t)}e.matchesQualifiedName=r})(wx||={});const Tx={type:`object`,required:[`vendor`,`displayName`],properties:{vendor:{type:`string`,description:x(7948,`A globally unique vendor of language model chat provider.`)},displayName:{type:`string`,description:x(7949,`The display name of the language model chat provider.`)},configuration:{type:`object`,description:x(7950,`Configuration options for the language model chat provider.`),anyOf:[{$ref:`http://json-schema.org/draft-07/schema#`},{properties:{properties:{type:`object`,additionalProperties:{$ref:`http://json-schema.org/draft-07/schema#`,properties:{secret:{type:`boolean`,description:x(7951,`Whether the property is a secret.`)}}}},additionalProperties:{$ref:`http://json-schema.org/draft-07/schema#`,properties:{secret:{type:`boolean`,description:x(7951,`Whether the property is a secret.`)}}}}}]},managementCommand:{type:`string`,description:x(7952,`A command to manage the language model chat provider, e.g. 'Manage Copilot models'. This is used in the chat model picker. If not provided, a gear icon is not rendered during vendor selection.`),deprecated:!0,deprecationMessage:x(7953,`The managementCommand property is deprecated and will be removed in a future release. Use the new configuration property instead.`)},when:{type:`string`,description:x(7954,`Condition which must be true to show this language model chat provider in the Manage Models list.`)}}},Ex=dx.registerExtensionPoint({extensionPoint:`languageModelChatProviders`,jsonSchema:{description:x(7955,`Contribute language model chat providers of a specific vendor.`),oneOf:[Tx,{type:`array`,items:Tx}]},activationEventsGenerator:function*(e){for(let t of e)yield`onLanguageModelChatProvider:${t.vendor}`}}),Dx=`chatModelRecentlyUsed`,Ox=`chatModelPinned`,kx=`chatModelVisibility`,Ax=`copilot/auto`,jx=`chat.participantNameRegistry`,Mx=`chat.modelsControl`;let Nx=class{static{yx=this}static{this.SECRET_KEY_PREFIX=`chat.lm.secret.`}static{this.SECRET_INPUT="${input:{0}}"}constructor(e,t,n,r,i,a,o,s,c){this._extensionService=e,this._logService=t,this._storageService=n,this._contextKeyService=r,this._languageModelsConfigurationService=i,this._quickInputService=a,this._secretStorageService=o,this._productService=s,this._requestService=c,this._store=new v,this._providers=new Map,this._vendors=new Map,this._onDidChangeLanguageModelVendors=this._store.add(new S),this.onDidChangeLanguageModelVendors=this._onDidChangeLanguageModelVendors.event,this._modelsGroups=new Map,this._modelCache=new Map,this._resolveLMSequencer=new bo,this._modelConfigurations=new Map,this._onLanguageModelChange=this._store.add(new S),this.onDidChangeLanguageModels=this._onLanguageModelChange.event,this._recentlyUsedModelIds=[],this._pinnedModelIds=[],this._hiddenModelIds=new Set,this._onDidChangeModelsControlManifest=this._store.add(new S),this.onDidChangeModelsControlManifest=this._onDidChangeModelsControlManifest.event,this._onDidChangePinnedModels=this._store.add(new S),this.onDidChangePinnedModels=this._onDidChangePinnedModels.event,this._onDidChangeModelVisibility=this._store.add(new S),this.onDidChangeModelVisibility=this._onDidChangeModelVisibility.event,this._modelsControlManifest={free:{},paid:{}},this._chatControlDisposed=!1,this._restrictedChatParticipants=fv(this,Object.create(null)),this.restrictedChatParticipants=this._restrictedChatParticipants,this._hasUserSelectableModels=gx.languageModelsAreUserSelectable.bindTo(r),this._hasNonCopilotUserSelectableModels=gx.nonCopilotLanguageModelsAreUserSelectable.bindTo(r),this._recentlyUsedModelIds=this._readRecentlyUsedModels(),this._pinnedModelIds=this._readPinnedModels(),this._readVisibility(),this._initChatControlData(),this._store.add(this.onDidChangeLanguageModels(()=>{let e=!1,t=!1;for(let n of this._modelCache.values())if(n.isUserSelectable!==!1&&(e=!0,n.vendor!==`copilot`)){t=!0;break}this._hasUserSelectableModels.set(e),this._hasNonCopilotUserSelectableModels.set(t),this._refreshModelsControlManifest()})),this._store.add(this._languageModelsConfigurationService.onDidChangeLanguageModelGroups(e=>this._onDidChangeLanguageModelGroups(e))),this._store.add(Ex.setHandler((e,{added:t,removed:n})=>{let r=[],i=[];for(let e of t)for(let t of lt.wrap(e.value)){if(this._vendors.has(t.vendor)){e.collector.error(x(7956,`The vendor '{0}' is already registered and cannot be registered twice`,t.vendor));continue}if(Hi(t.vendor)){e.collector.error(x(7957,`The vendor field cannot be empty.`));continue}if(t.vendor.trim()!==t.vendor){e.collector.error(x(7958,`The vendor field cannot start or end with whitespace.`));continue}r.push(t)}for(let e of n)for(let t of lt.wrap(e.value))i.push(t);this.deltaLanguageModelChatProviderDescriptors(r,i)}))}deltaLanguageModelChatProviderDescriptors(e,t){let n=[],r=[];for(let t of e){if(this._vendors.has(t.vendor)){this._logService.error(`The vendor '${t.vendor}' is already registered and cannot be registered twice`);continue}if(Hi(t.vendor)){this._logService.error(`The vendor field cannot be empty.`);continue}if(t.vendor.trim()!==t.vendor){this._logService.error(`The vendor field cannot start or end with whitespace.`);continue}let e={vendor:t.vendor,displayName:t.displayName,configuration:t.configuration,managementCommand:t.managementCommand,when:t.when,isDefault:t.vendor===`copilot`};this._vendors.set(t.vendor,e),n.push(t.vendor)}for(let e of t)this._vendors.delete(e.vendor),this._providers.delete(e.vendor),this._clearModelCache(e.vendor),this._modelsGroups.delete(e.vendor),r.push(e.vendor);for(let[e,t]of this._providers)this._vendors.has(e)||this._providers.delete(e);if((n.length>0||r.length>0)&&(this._onDidChangeLanguageModelVendors.fire([...n,...r]),r.length>0))for(let e of r)this._onLanguageModelChange.fire(e)}async _onDidChangeLanguageModelGroups(e){let t=new Set(e.map(e=>e.vendor));await Promise.all(Array.from(t).map(e=>this._resolveAllLanguageModels(e,!0)))}getVendors(){return Array.from(this._vendors.values()).filter(e=>{if(!e.when)return!0;let t=kd.deserialize(e.when);return t?this._contextKeyService.contextMatchesRules(t):!1})}getLanguageModelIds(){return Array.from(this._modelCache.keys())}lookupLanguageModel(e){return this._modelCache.get(e)}lookupLanguageModelByQualifiedName(e){for(let[t,n]of this._modelCache.entries())if(wx.matchesQualifiedName(e,n))return{metadata:n,identifier:t}}async _resolveAllLanguageModels(e,t){let n=this._vendors.get(e);if(!n)return;let r=this._providers.get(e);if(r||=(await this._extensionService.activateByEvent(`onLanguageModelChatProvider:${e}`),this._providers.get(e)),!r){this._logService.warn(`[LM] No provider registered for vendor ${e}`);return}return this._resolveLMSequencer.queue(e,async()=>{let i=[],a=[];try{let e=await r.provideLanguageModelChatInfo({silent:t},Pi.None);if(e.length){i.push(...e);let t=[];for(let r of e)n.isDefault&&r.metadata.isUserSelectable===!1?this._logService.trace(`[LM] Skipping model ${r.identifier} from model picker as it is not user selectable.`):t.push(r.identifier);a.push({modelIdentifiers:t})}}catch(e){a.push({modelIdentifiers:[],status:{message:g(e),severity:Dc.Error}})}let o=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),s=new Map;for(let c of o){if(c.vendor!==e)continue;if(!n.configuration&&i.length>0){if(c.settings)for(let e of i){let t=c.settings[e.metadata.id];t&&s.set(e.identifier,{...t})}a.push({group:c,modelIdentifiers:[]});continue}let o=await this._resolveConfiguration(c,n.configuration);try{let e=await r.provideLanguageModelChatInfo({group:c.name,silent:t,configuration:o},Pi.None);if(e.length){for(let t=0;t<e.length;t++)e[t].metadata.detail||(e[t]={...e[t],metadata:{...e[t].metadata,detail:c.name}});i.push(...e),a.push({group:c,modelIdentifiers:e.map(e=>e.identifier)})}if(c.settings)for(let t of e){let e=c.settings[t.metadata.id];e&&s.set(t.identifier,{...e})}}catch(e){a.push({group:c,modelIdentifiers:[],status:{message:g(e),severity:Dc.Error}})}}let c=this._modelsGroups.get(e)??[];this._modelsGroups.set(e,a);let l=this._clearModelCache(e),u=!1;for(let e of i){if(this._modelCache.has(e.identifier)){this._logService.warn(`[LM] Model ${e.identifier} is already registered. Skipping.`);continue}this._modelCache.set(e.identifier,e.metadata),u||=!sc(l.get(e.identifier),e.metadata),l.delete(e.identifier)}this._logService.trace(`[LM] Resolved language models for vendor ${e}`,i),u||=l.size>0,u||=this._hasGroupStructureChanged(c,a),this._clearModelConfigurations(e);for(let[e,t]of s)this._modelCache.has(e)&&this._modelConfigurations.set(e,t);u?this._onLanguageModelChange.fire(e):this._logService.trace(`[LM] No changes in language models for vendor ${e}`)})}_hasGroupStructureChanged(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.group?.name!==i.group?.name||r.group?.vendor!==i.group?.vendor||r.status?.message!==i.status?.message||r.status?.severity!==i.status?.severity||r.modelIdentifiers.length!==i.modelIdentifiers.length)return!0}return!1}getLanguageModelGroups(e){return this._modelsGroups.get(e)??[]}hasResolvedVendor(e){return this._modelsGroups.has(e)}async selectLanguageModels(e){if(e.vendor)await this._resolveAllLanguageModels(e.vendor,!0);else{let e=Array.from(this._vendors.keys());await Promise.all(e.map(e=>this._resolveAllLanguageModels(e,!0)))}let t=[];for(let[n,r]of this._modelCache)(e.vendor===void 0||r.vendor===e.vendor)&&(e.family===void 0||r.family===e.family)&&(e.version===void 0||r.version===e.version)&&(e.id===void 0||r.id===e.id)&&t.push(n);return this._logService.trace(`[LM] selected language models`,e,t),t}registerLanguageModelProvider(e,t){if(this._logService.trace(`[LM] registering language model provider`,e,t),!this._vendors.has(e))throw Error(`Chat model provider uses UNKNOWN vendor ${e}.`);if(this._providers.has(e))throw Error(`Chat model provider for vendor ${e} is already registered.`);this._providers.set(e,t);let n=t.onDidChange(()=>{this._resolveAllLanguageModels(e,!0)});return _(()=>{this._logService.trace(`[LM] UNregistered language model provider`,e),this._clearModelCache(e),this._modelsGroups.delete(e),this._providers.delete(e),n.dispose()})}async sendChatRequest(e,t,n,r,i){let a=this._modelCache.get(e),o=this._providers.get(a?.vendor||``);if(!o)throw Error(`Chat provider for model ${e} is not registered.`);let s=this.getModelConfiguration(e),c=s?{...r,configuration:{...s,...r.configuration}}:r;return o.sendChatRequest(e,n,t,c,i)}_resolveModelConfigurationWithDefaults(e,t){let n=this._modelConfigurations.get(e),r=t?.configurationSchema;if(!r?.properties&&!n)return;let i={};if(r?.properties)for(let[e,t]of Object.entries(r.properties))t.default!==void 0&&(i[e]=t.default);if(!(!n&&Object.keys(i).length===0))return{...i,...n}}computeTokenLength(e,t,n){let r=this._modelCache.get(e);if(!r)throw Error(`Chat model ${e} could not be found.`);let i=this._providers.get(r.vendor);if(!i)throw Error(`Chat provider for model ${e} is not registered.`);return i.provideTokenCount(e,t,n)}getModelConfiguration(e){let t=this._modelCache.get(e);return this._resolveModelConfigurationWithDefaults(e,t)}async setModelConfiguration(e,t){let n=this._modelCache.get(e);if(!n)return;let r=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i;i=r.find(e=>e.vendor===n.vendor&&e.settings?.[n.id]!==void 0),i||=r.find(e=>e.vendor===n.vendor);let a={...this._modelConfigurations.get(e)??{},...t},o=n.configurationSchema;if(o?.properties)for(let[e,t]of Object.entries(a)){let n=o.properties[e];n?.default!==void 0&&n.default===t&&delete a[e]}if(i){let e=i.settings??{},t;Object.keys(a).length===0?(t={...e},delete t[n.id]):t={...e,[n.id]:a};let r={...i,settings:Object.keys(t).length>0?t:void 0};!r.settings&&Object.keys(r).filter(e=>e!==`name`&&e!==`vendor`&&e!==`range`&&e!==`modelsRange`&&e!==`settings`).length===0?await this._languageModelsConfigurationService.removeLanguageModelsProviderGroup(i):await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,r)}else if(Object.keys(a).length>0){let e=this._vendors.get(n.vendor);if(!e)return;let t={name:e.displayName,vendor:n.vendor,settings:{[n.id]:a}};await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(t)}Object.keys(a).length>0?this._modelConfigurations.set(e,a):this._modelConfigurations.delete(e),this._onLanguageModelChange.fire(n.vendor)}getModelConfigurationActions(e){let t=this._modelCache.get(e)?.configurationSchema;if(!t?.properties)return[];let n=[],r=this._modelConfigurations.get(e)??{};for(let[i,a]of Object.entries(t.properties)){if(!a.enum||!Array.isArray(a.enum)||a.enum.length<2)continue;let t=r[i]??a.default,o=(typeof a.title==`string`?a.title:void 0)??i.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase()),s=a.default,c=a.enumItemLabels,l=a.enumDescriptions,u=a.enum.map((n,r)=>{let a=c?.[r]??String(n),o=n===s?x(7959,`{0} (default)`,a):a,u=l?.[r]??``;return{id:`configureModel.${i}.${n}`,label:o,class:void 0,enabled:!0,tooltip:u,checked:t===n,run:()=>this.setModelConfiguration(e,{[i]:n})}});n.push(new Am(`configureModel.${i}`,o,u))}return n}async configureLanguageModelsProviderGroup(e,t){let n=this.getVendors().find(({vendor:t})=>t===e);if(!n)throw Error(`Vendor ${e} not found.`);if(n.managementCommand){await this._resolveAllLanguageModels(n.vendor,!1);return}let r=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i=r.find(n=>n.vendor===e&&n.name===t),a=await this.promptForName(r,n,i);if(!a)return;let o=i?await this._resolveConfiguration(i,n.configuration):void 0;try{let t=n.configuration?await this.promptForConfiguration(a,n.configuration,o):void 0;if(n.configuration&&!t)return;let r=await this._resolveLanguageModelProviderGroup(a,e,t,n.configuration),s=i?await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,r):await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(r);if(n.configuration&&this.requireConfiguring(n.configuration)){let e=this.getSnippetForFirstUnconfiguredProperty(t??{},n.configuration);await this._languageModelsConfigurationService.configureLanguageModels({group:s,snippet:e})}}catch(e){if(d(e))return;throw e}}async renameLanguageModelsProviderGroup(e,t){let n=this.getVendors().find(({vendor:t})=>t===e);if(!n)throw Error(`Vendor ${e} not found.`);let r=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i=r.find(n=>n.vendor===e&&n.name===t);if(!i)throw Error(`Language model provider group ${t} for vendor ${e} not found.`);let a=await this.promptForName(r,n,i);!a||a===i.name||await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,{...i,name:a})}async updateLanguageModelsProviderGroupApiKey(e,t){let n=this.getVendors().find(({vendor:t})=>t===e),r=n?.configuration,i=r?.properties?.apiKey;if(!n||!r||!i)return;let a=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(n=>n.vendor===e&&n.name===t);if(!a)throw Error(`Language model provider group ${t} for vendor ${e} not found.`);try{let t=await this._resolveConfiguration(a,r),n=await this.promptForValue(a.name,`apiKey`,i,!!r.required?.includes(`apiKey`),t);if(n===void 0||n===t.apiKey)return;let o={...t,apiKey:n},s={...await this._resolveLanguageModelProviderGroup(a.name,e,o,r),settings:a.settings};await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(a,s),await this._deleteSecretsInConfiguration(a,r)}catch(e){if(d(e))return;throw e}}async addLanguageModelsProviderGroupModel(e,t){let n=this.getVendors().find(({vendor:t})=>t===e),r=(n?.configuration)?.properties?.models;if(!n||!r)return;let i=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(n=>n.vendor===e&&n.name===t);if(!i)throw Error(`Language model provider group ${t} for vendor ${e} not found.`);let a=Array.isArray(i.models),o=a?this.getSnippetForArrayItem(r):this.getSnippetForProperty(`models`,r);o&&await this._languageModelsConfigurationService.configureLanguageModels({group:i,snippet:o,snippetTarget:a?`models`:`group`})}async openLanguageModelsProviderGroupSettings(e,t){let n=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(n=>n.vendor===e&&n.name===t);if(!n)throw Error(`Language model provider group ${t} for vendor ${e} not found.`);await this._languageModelsConfigurationService.configureLanguageModels({group:n})}async configureModel(e){let t=this._modelCache.get(e);if(!t||!t.configurationSchema)return;let n=this._modelsGroups.get(t.vendor),r;if(n){for(let t of n)if(t.modelIdentifiers.includes(e)&&t.group){r=t.group;break}}if(!r){let e=this.getVendors().find(e=>e.vendor===t.vendor);if(!e)return;let n={name:e.displayName,vendor:t.vendor,settings:{[t.id]:{}}};r=await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(n),await this._resolveAllLanguageModels(t.vendor,!0)}let i=this._getModelConfigurationSnippet(t.id,t.configurationSchema);await this._languageModelsConfigurationService.configureLanguageModels({group:r,snippet:i})}_getModelConfigurationSnippet(e,t){let n=[];if(t.properties)for(let[e,r]of Object.entries(t.properties))if(r.defaultSnippets?.[0]){let t=r.defaultSnippets[0],i=t.bodyText??JSON.stringify(t.body,null,` `);i=i.replace(/"(\^[^"]*)"/g,(e,t)=>t.substring(1)),n.push(`\t\t\t"${e}": ${i}`)}else r.default===void 0?n.push(`\t\t\t"${e}": $\{${e}\}`):n.push(`\t\t\t"${e}": ${JSON.stringify(r.default)}`);return`"settings": {\n\t\t"${e}": ${n.length>0?`{\n${n.join(`,
86
- `)}\n\t\t}`:`{
87
- $0
88
- }`}\n\t}`}async addLanguageModelsProviderGroup(e,t,n){let r=this.getVendors().find(({vendor:e})=>e===t);if(!r)throw Error(`Vendor ${t} not found.`);let i=await this._resolveLanguageModelProviderGroup(e,t,n,r.configuration);await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(i)}async removeLanguageModelsProviderGroup(e,t){let n=this.getVendors().find(({vendor:t})=>t===e);if(!n)throw Error(`Vendor ${e} not found.`);let r=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(n=>n.vendor===e&&n.name===t);if(!r)throw Error(`Language model provider group ${t} for vendor ${e} not found.`);await this._deleteSecretsInConfiguration(r,n.configuration),await this._languageModelsConfigurationService.removeLanguageModelsProviderGroup(r)}requireConfiguring(e){if(e.additionalProperties)return!0;if(!e.properties)return!1;for(let t of Object.keys(e.properties))if(!this.canPromptForProperty(e.properties[t]))return!0;return!1}getSnippetForFirstUnconfiguredProperty(e,t){if(t.properties){for(let n of Object.keys(t.properties))if(e[n]===void 0){let e=t.properties[n],r=this.getSnippetForProperty(n,e);if(r)return r}}}getSnippetForProperty(e,t){let n=this.getDefaultSnippetBodyText(t);return n?`"${e}": ${n}`:void 0}getSnippetForArrayItem(e){return this.getDefaultSnippetBodyText(e,!0)}getDefaultSnippetBodyText(e,t=!1){let n=e.defaultSnippets?.[0];if(!n)return;let r=t?Array.isArray(n.body)&&n.body.length>0?JSON.stringify(n.body[0],null,` `):void 0:n.bodyText??JSON.stringify(n.body,null,` `);if(r)return r.replace(/"(\^[^"]*)"/g,(e,t)=>t.substring(1))}async promptForName(e,t,n){let r=n?.name;if(!r){r=t.displayName;let n=1;for(;e.some(e=>e.vendor===t.vendor&&e.name===r);)n++,r=`${t.displayName} ${n}`}let i,a=new v;try{await new Promise(o=>{let s=a.add(this._quickInputService.createInputBox());s.title=x(7960,`Group Name`),s.placeholder=x(7961,`Enter a name for the group`),s.value=r,s.ignoreFocusOut=!0,a.add(s.onDidChangeValue(r=>{if(!r){s.validationMessage=x(7962,`Please enter a name`),s.severity=Dc.Error;return}if(e.some(e=>e!==n&&e.vendor===t.vendor&&e.name===r)){s.validationMessage=x(7963,`A language models group with this name already exists`),s.severity=Dc.Error;return}s.validationMessage=void 0,s.severity=Dc.Ignore})),a.add(s.onDidAccept(async()=>{i=s.value,s.hide()})),a.add(s.onDidHide(()=>o())),s.show()})}finally{a.dispose()}return i}async promptForConfiguration(e,t,n){if(!t.properties)return;let r=n?{...n}:{};for(let i of Object.keys(t.properties)){let a=t.properties[i],o=!!t.required?.includes(i),s=await this.promptForValue(e,i,a,o,n);s!==void 0&&(r[i]=s)}return r}async promptForValue(e,t,n,r,i){if(!n||!this.canPromptForProperty(n))return;if(n.type===`array`&&n.items&&!Array.isArray(n.items)&&n.items.enum){let r=await this.promptForArray(e,t,n);return r===void 0?void 0:r}if(n.type===`string`&&Array.isArray(n.enum)&&n.enum.length>0)return this.promptForEnum(e,t,n,i);let a=await this.promptForInput(e,t,n,r,i);if(a!==void 0)return a}canPromptForProperty(e){return!e||typeof e==`boolean`?!1:!!(e.type===`array`&&e.items&&!Array.isArray(e.items)&&e.items.enum||e.type===`string`||e.type===`number`||e.type===`integer`||e.type===`boolean`)}getDescriptionPlaintext(e){if(e.description)return e.description;let t=e.markdownDescription;if(t)return t.replace(/`([^`]+)`/g,`$1`).replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/\*([^*]+)\*/g,`$1`).replace(/\[([^\]]+)\]\([^)]+\)/g,`$1`)}async promptForArray(e,t,n){if(!n.items||Array.isArray(n.items)||!n.items.enum)return;let r=n.items.enum,i=new v;try{return await new Promise(a=>{let o=i.add(this._quickInputService.createQuickPick());o.title=`${e}: ${n.title??t}`,o.items=r.map(e=>({label:e})),o.placeholder=this.getDescriptionPlaintext(n)??x(7964,`Select value for {0}`,t),o.canSelectMany=!0,o.ignoreFocusOut=!0,i.add(o.onDidAccept(()=>{a(o.selectedItems.map(e=>e.label)),o.hide()})),i.add(o.onDidHide(()=>{a(void 0)})),o.show()})}finally{i.dispose()}}async promptForEnum(e,t,n,r){let i=n.enum;if(!Array.isArray(i)||i.length===0)return;let a=n.enumDescriptions,o=Array.isArray(n.enumItemLabels)?n.enumItemLabels:void 0,s=r?.[t]===void 0?n.default===void 0?void 0:String(n.default):String(r[t]),c=i.map((e,t)=>({label:o?.[t]??String(e),description:a?.[t],id:String(e)})),l=new v;try{return await new Promise(r=>{let i=l.add(this._quickInputService.createQuickPick());if(i.title=`${e}: ${n.title??t}`,i.items=c,i.placeholder=this.getDescriptionPlaintext(n)??x(7964,`Select value for {0}`,t),i.ignoreFocusOut=!0,s!==void 0){let e=c.find(e=>e.id===s);e&&(i.activeItems=[e])}l.add(i.onDidAccept(()=>{let e=i.selectedItems[0];r(e?.id),i.hide()})),l.add(i.onDidHide(()=>{r(void 0)})),i.show()})}finally{l.dispose()}}async promptForInput(e,t,n,r,i){let a=new v;try{let o=e=>{if(!e&&r)return x(7965,`Value is required`)},s=await new Promise((r,s)=>{let c=a.add(this._quickInputService.createInputBox());c.title=`${e}: ${n.title??t}`,c.placeholder=x(7966,`Enter value for {0}`,t),c.password=!!n.secret,c.ignoreFocusOut=!0,i?.[t]?c.value=String(i?.[t]):n.default&&(c.value=String(n.default));let l=this.getDescriptionPlaintext(n);l&&(c.prompt=l),a.add(c.onDidChangeValue(e=>{let t=o(e);t?(c.validationMessage=t,c.severity=Dc.Error):(c.validationMessage=void 0,c.severity=Dc.Ignore)})),a.add(c.onDidAccept(()=>{let e=o(c.value);if(e){c.validationMessage=e,c.severity=Dc.Error;return}r(c.value),c.hide()})),a.add(c.onDidHide(e=>{e.reason===Ib.Gesture?s(new f):r(void 0)})),c.show()});return s?n.type===`number`||n.type===`integer`?Number(s):n.type===`boolean`?s===`true`:s:void 0}finally{a.dispose()}}encodeSecretKey(e){return Wi(yx.SECRET_INPUT,e)}decodeSecretKey(e){if(Ge(e))return e.substring(e.indexOf(`:`)+1,e.length-1)}_clearModelCache(e){let t=new Map;for(let[n,r]of this._modelCache.entries())r.vendor===e&&(t.set(n,r),this._modelCache.delete(n));return t}_clearModelConfigurations(e){for(let[t]of this._modelConfigurations)(this._modelCache.get(t)?.vendor===e||t.startsWith(`${e}/`))&&this._modelConfigurations.delete(t)}async _resolveConfiguration(e,t){if(!t)return{};let n={};for(let r in e){if(r===`vendor`||r===`name`||r===`range`||r===`modelsRange`||r===`settings`)continue;let i=e[r];if(t.properties?.[r]?.secret){let e=this.decodeSecretKey(i);i=e?await this._secretStorageService.get(e):void 0}n[r]=i}return n}async _resolveLanguageModelProviderGroup(e,t,n,r){if(!r)return{name:e,vendor:t};let i={};for(let e in n){let t=n[e];if(r.properties?.[e]?.secret&&Ge(t)){let e=`${yx.SECRET_KEY_PREFIX}${Th(zc()).toString(16)}`;await this._secretStorageService.set(e,t),t=this.encodeSecretKey(e)}i[e]=t}return{name:e,vendor:t,...i}}async _deleteSecretsInConfiguration(e,t){if(!t)return;let{vendor:n,name:r,range:i,modelsRange:a,...o}=e;for(let n in o){let r=e[n];if(t.properties?.[n]?.secret){let e=this.decodeSecretKey(r);e&&await this._secretStorageService.delete(e)}}}async migrateLanguageModelsProviderGroup(e){let{vendor:t,name:n,...r}=e;if(!this._vendors.get(t))throw Error(`Vendor ${t} not found.`);await this._extensionService.activateByEvent(`onLanguageModelChatProvider:${t}`);let i=this._providers.get(t);if(!i)throw Error(`Chat model provider for vendor ${t} is not registered.`);await i.provideLanguageModelChatInfo({group:n,silent:!1,configuration:r},Pi.None),await this.addLanguageModelsProviderGroup(n,t,r)}_readRecentlyUsedModels(){return this._storageService.getObject(Dx,Zg.PROFILE,[])}_saveRecentlyUsedModels(){this._storageService.store(Dx,this._recentlyUsedModelIds,Zg.PROFILE,Qg.USER)}getRecentlyUsedModelIds(){return this._recentlyUsedModelIds.filter(e=>this._modelCache.has(e)&&e!==Ax).slice(0,4)}addToRecentlyUsedList(e){if(e===Ax)return;let t=this._recentlyUsedModelIds.indexOf(e);t!==-1&&this._recentlyUsedModelIds.splice(t,1),this._recentlyUsedModelIds.unshift(e),this._recentlyUsedModelIds.length>20&&(this._recentlyUsedModelIds.length=20),this._saveRecentlyUsedModels()}clearRecentlyUsedList(){this._recentlyUsedModelIds=[],this._saveRecentlyUsedModels()}_readPinnedModels(){return this._storageService.getObject(Ox,Zg.PROFILE,[])}_savePinnedModels(){this._storageService.store(Ox,this._pinnedModelIds,Zg.PROFILE,Qg.USER)}getPinnedModelIds(){return this._pinnedModelIds.filter(e=>e!==Ax&&this._modelCache.has(e))}pinModel(e){e===Ax||this._pinnedModelIds.includes(e)||(this._pinnedModelIds.push(e),this._savePinnedModels(),this._onDidChangePinnedModels.fire())}unpinModel(e){let t=this._pinnedModelIds.indexOf(e);t!==-1&&(this._pinnedModelIds.splice(t,1),this._savePinnedModels(),this._onDidChangePinnedModels.fire())}isModelPinned(e){return e!==Ax&&this._pinnedModelIds.includes(e)}_getGroupNameForVendor(e){return this._vendors.get(e)?.displayName??e}_getModelIdsInGroup(e,t){let n=this._modelsGroups.get(e);if(!n)return[];let r=[],i=this._getGroupNameForVendor(e);for(let e of n)(e.group?.name??i)===t&&r.push(...e.modelIdentifiers);return r}_readVisibility(){let e=this._storageService.getObject(kx,Zg.PROFILE,{});this._hiddenModelIds=new Set(Array.isArray(e?.hiddenModels)?e.hiddenModels:[])}_saveVisibility(){this._storageService.store(kx,{hiddenModels:Array.from(this._hiddenModelIds)},Zg.PROFILE,Qg.USER)}isGroupHidden(e,t){let n=this._getModelIdsInGroup(e,t);return n.length>0&&n.every(e=>this._hiddenModelIds.has(e))}isModelHidden(e){return this._hiddenModelIds.has(e)}setGroupHidden(e,t,n){let r=!1,i=this._getModelIdsInGroup(e,t);for(let e of i)n?this._hiddenModelIds.has(e)||(this._hiddenModelIds.add(e),r=!0):this._hiddenModelIds.delete(e)&&(r=!0);r&&(this._saveVisibility(),this._onDidChangeModelVisibility.fire())}setModelHidden(e,t){let n=!1;t?this._hiddenModelIds.has(e)||(this._hiddenModelIds.add(e),n=!0):this._hiddenModelIds.delete(e)&&(n=!0),n&&(this._saveVisibility(),this._onDidChangeModelVisibility.fire())}getHiddenModelIds(){return Array.from(this._hiddenModelIds)}getModelsControlManifest(){return this._modelsControlManifest}_setModelsControlManifest(e){this._modelsControlRawResponse=e,this._refreshModelsControlManifest()}_refreshModelsControlManifest(){let e=this._modelsControlRawResponse,t={},n={};if(e?.free){let n=Array.isArray(e.free)?e.free:Object.values(e.free);for(let e of n)!e||!Je(e)||(t[e.id]={label:e.label,featured:e.featured,exists:this._modelCache.has(`copilot/${e.id}`)})}if(e?.paid){let t=Array.isArray(e.paid)?e.paid:Object.values(e.paid);for(let e of t)!e||!Je(e)||(n[e.id]={label:e.label,featured:e.featured,minVSCodeVersion:e.minVSCodeVersion,exists:this._modelCache.has(`copilot/${e.id}`)})}this._modelsControlManifest={free:t,paid:n},this._onDidChangeModelsControlManifest.fire(this._modelsControlManifest)}_initChatControlData(){if(this._chatControlUrl=this._productService.chatParticipantRegistry,!this._chatControlUrl)return;let e=this._storageService.get(jx,Zg.APPLICATION);try{this._restrictedChatParticipants.set(JSON.parse(e??`{}`),void 0)}catch{this._storageService.remove(jx,Zg.APPLICATION)}let t=this._storageService.get(Mx,Zg.APPLICATION);try{let e=JSON.parse(t??`{}`);Je(e)&&this._setModelsControlManifest(e)}catch{this._storageService.remove(Mx,Zg.APPLICATION)}this._refreshChatControlData()}_refreshChatControlData(){this._chatControlDisposed||this._fetchChatControlData().catch(e=>this._logService.warn(`Failed to fetch chat control data`,e)).then(()=>Eo(300*1e3)).then(()=>this._refreshChatControlData())}async _fetchChatControlData(){this._logService.trace(`[LM] Fetching chat control data from`,this._chatControlUrl);let e;try{e=await this._requestService.request({type:`GET`,url:this._chatControlUrl,callSite:`languageModels.fetchChatControlData`},Pi.None)}catch(e){this._logService.warn(`[LM] Failed to request chat control data`,g(e));return}if(e.res.statusCode!==200){this._logService.warn(`[LM] Chat control data request failed with status ${e.res.statusCode}`);return}let t;try{t=await Ag(e)}catch(e){this._logService.warn(`[LM] Failed to parse chat control response`,g(e));return}if(this._logService.trace(`[LM] Received chat control response`,t?Object.keys(t):`null`),!t||t.version!==1){this._logService.warn(`[LM] Unexpected chat control response version`,t?.version);return}let n=t.restrictedChatParticipants;this._restrictedChatParticipants.set(n,void 0),this._storageService.store(jx,JSON.stringify(n),Zg.APPLICATION,Qg.MACHINE),t.models&&(this._logService.trace(`[LM] Updating models control manifest`,{freeCount:Object.keys(t.models.free??{}).length,paidCount:Object.keys(t.models.paid??{}).length}),this._setModelsControlManifest(t.models),this._storageService.store(Mx,JSON.stringify(t.models),Zg.APPLICATION,Qg.MACHINE))}dispose(){this._chatControlDisposed=!0,this._store.dispose(),this._providers.clear()}};Nx=yx=A([j(0,Ub),j(1,Ds),j(2,n_),j(3,Ch),j(4,vx),j(5,Vb),j(6,Hb),j(7,Wh),j(8,Fg)],Nx),new I(`debugType`,void 0,{type:`string`,description:x(9374,`Debug type of the active debug session. For example 'python'.`)}),new I(`debugConfigurationType`,void 0,{type:`string`,description:x(9375,`Debug type of the selected launch configuration. For example 'python'.`)}),new I(`debugState`,`inactive`,{type:`string`,description:x(9376,`State that the focused debug session is in. One of the following: 'inactive', 'initializing', 'stopped' or 'running'.`)}),new I(`debugUx`,`default`,{type:`string`,description:x(9377,`Debug UX state. When there are no debug configurations it is 'simple', otherwise 'default'. Used to decide when to show welcome views in the debug viewlet.`)}),new I(`hasDebugged`,!1,{type:`boolean`,description:x(9378,`True when a debug session has been started at least once, false otherwise.`)}),new I(`inDebugMode`,!1,{type:`boolean`,description:x(9379,`True when debugging, false otherwise.`)}),new I(`inDebugRepl`,!1,{type:`boolean`,description:x(9380,`True when focus is in the debug console, false otherwise.`)}),new I(`breakpointWidgetVisible`,!1,{type:`boolean`,description:x(9381,`True when breakpoint editor zone widget is visible, false otherwise.`)}),new I(`inBreakpointWidget`,!1,{type:`boolean`,description:x(9382,`True when focus is in the breakpoint editor zone widget, false otherwise.`)}),new I(`breakpointsFocused`,!0,{type:`boolean`,description:x(9383,`True when the BREAKPOINTS view is focused, false otherwise.`)}),new I(`watchExpressionsFocused`,!0,{type:`boolean`,description:x(9384,`True when the WATCH view is focused, false otherwise.`)}),new I(`watchExpressionsExist`,!1,{type:`boolean`,description:x(9385,`True when at least one watch expression exists, false otherwise.`)}),new I(`variablesFocused`,!0,{type:`boolean`,description:x(9386,`True when the VARIABLES views is focused, false otherwise`)}),new I(`expressionSelected`,!1,{type:`boolean`,description:x(9387,`True when an expression input box is open in either the WATCH or the VARIABLES view, false otherwise.`)}),new I(`breakpointInputFocused`,!1,{type:`boolean`,description:x(9388,`True when the input box has focus in the BREAKPOINTS view.`)}),new I(`callStackItemType`,void 0,{type:`string`,description:x(9389,`Represents the item type of the focused element in the CALL STACK view. For example: 'session', 'thread', 'stackFrame'`)}),new I(`callStackSessionIsAttach`,!1,{type:`boolean`,description:x(9390,`True when the session in the CALL STACK view is attach, false otherwise. Used internally for inline menus in the CALL STACK view.`)}),new I(`callStackItemStopped`,!1,{type:`boolean`,description:x(9391,`True when the focused item in the CALL STACK is stopped. Used internally for inline menus in the CALL STACK view.`)}),new I(`callStackSessionHasOneThread`,!1,{type:`boolean`,description:x(9392,`True when the focused session in the CALL STACK view has exactly one thread. Used internally for inline menus in the CALL STACK view.`)}),new I(`callStackFocused`,!0,{type:`boolean`,description:x(9393,`True when the CALLSTACK view is focused, false otherwise.`)}),new I(`watchItemType`,void 0,{type:`string`,description:x(9394,`Represents the item type of the focused element in the WATCH view. For example: 'expression', 'variable'`)}),new I(`canViewMemory`,void 0,{type:`boolean`,description:x(9395,`Indicates whether the item in the view has an associated memory reference.`)}),new I(`breakpointItemType`,void 0,{type:`string`,description:x(9396,`Represents the item type of the focused element in the BREAKPOINTS view. For example: 'breakpoint', 'exceptionBreakpoint', 'functionBreakpoint', 'dataBreakpoint'`)}),new I(`breakpointItemBytes`,void 0,{type:`boolean`,description:x(9397,`Whether the breakpoint item is a data breakpoint on a byte range.`)}),new I(`breakpointHasModes`,!1,{type:`boolean`,description:x(9398,`Whether the breakpoint has multiple modes it can switch to.`)}),new I(`breakpointSupportsCondition`,!1,{type:`boolean`,description:x(9399,`True when the focused breakpoint supports conditions.`)}),new I(`loadedScriptsSupported`,!1,{type:`boolean`,description:x(9400,`True when the focused sessions supports the LOADED SCRIPTS view`)}),new I(`loadedScriptsItemType`,void 0,{type:`string`,description:x(9401,`Represents the item type of the focused element in the LOADED SCRIPTS view.`)}),new I(`focusedSessionIsAttach`,!1,{type:`boolean`,description:x(9402,`True when the focused session is 'attach'.`)}),new I(`focusedSessionIsNoDebug`,!1,{type:`boolean`,description:x(9403,`True when the focused session is run without debugging.`)}),new I(`stepBackSupported`,!1,{type:`boolean`,description:x(9404,`True when the focused session supports 'stepBack' requests.`)}),new I(`restartFrameSupported`,!1,{type:`boolean`,description:x(9405,`True when the focused session supports 'restartFrame' requests.`)}),new I(`stackFrameSupportsRestart`,!1,{type:`boolean`,description:x(9406,`True when the focused stack frame supports 'restartFrame'.`)}),new I(`jumpToCursorSupported`,!1,{type:`boolean`,description:x(9407,`True when the focused session supports 'jumpToCursor' request.`)}),new I(`stepIntoTargetsSupported`,!1,{type:`boolean`,description:x(9408,`True when the focused session supports 'stepIntoTargets' request.`)}),new I(`breakpointsExist`,!1,{type:`boolean`,description:x(9409,`True when at least one breakpoint exists.`)}),new I(`debuggersAvailable`,!1,{type:`boolean`,description:x(9410,`True when there is at least one debug extensions active.`)}),new I(`debugExtensionAvailable`,!0,{type:`boolean`,description:x(9411,`True when there is at least one debug extension installed and enabled.`)}),new I(`debugProtocolVariableMenuContext`,void 0,{type:`string`,description:x(9412,`Represents the context the debug adapter sets on the focused variable in the VARIABLES view.`)}),new I(`debugSetVariableSupported`,!1,{type:`boolean`,description:x(9413,`True when the focused session supports 'setVariable' request.`)}),new I(`debugSetDataBreakpointAddressSupported`,!1,{type:`boolean`,description:x(9414,`True when the focused session supports 'getBreakpointInfo' request on an address.`)}),new I(`debugSetExpressionSupported`,!1,{type:`boolean`,description:x(9415,`True when the focused session supports 'setExpression' request.`)}),new I(`breakWhenValueChangesSupported`,!1,{type:`boolean`,description:x(9416,`True when the focused session supports to break when value changes.`)}),new I(`breakWhenValueIsAccessedSupported`,!1,{type:`boolean`,description:x(9417,`True when the focused breakpoint supports to break when value is accessed.`)}),new I(`breakWhenValueIsReadSupported`,!1,{type:`boolean`,description:x(9418,`True when the focused breakpoint supports to break when value is read.`)}),new I(`terminateDebuggeeSupported`,!1,{type:`boolean`,description:x(9419,`True when the focused session supports the terminate debuggee capability.`)}),new I(`suspendDebuggeeSupported`,!1,{type:`boolean`,description:x(9420,`True when the focused session supports the suspend debuggee capability.`)}),new I(`terminateThreadsSupported`,!1,{type:`boolean`,description:x(9421,`True when the focused session supports the terminate threads capability.`)}),new I(`variableEvaluateNamePresent`,!1,{type:`boolean`,description:x(9422,`True when the focused variable has an 'evaluateName' field set.`)}),new I(`variableIsReadonly`,!1,{type:`boolean`,description:x(9423,`True when the focused variable is read-only.`)}),new I(`variableValue`,!1,{type:`string`,description:x(9424,`Value of the variable, present for debug visualization clauses.`)}),new I(`variableType`,!1,{type:`string`,description:x(9425,`Type of the variable, present for debug visualization clauses.`)}),new I(`variableInterfaces`,!1,{type:`array`,description:x(9426,`Any interfaces or contracts that the variable satisfies, present for debug visualization clauses.`)}),new I(`variableName`,!1,{type:`string`,description:x(9427,`Name of the variable, present for debug visualization clauses.`)}),new I(`variableLanguage`,!1,{type:`string`,description:x(9428,`Language of the variable source, present for debug visualization clauses.`)}),new I(`variableExtensionId`,!1,{type:`string`,description:x(9429,`Extension ID of the variable source, present for debug visualization clauses.`)}),new I(`exceptionWidgetVisible`,!1,{type:`boolean`,description:x(9430,`True when the exception widget is visible.`)}),new I(`multiSessionRepl`,!1,{type:`boolean`,description:x(9431,`True when there is more than 1 debug console.`)}),new I(`multiSessionDebug`,!1,{type:`boolean`,description:x(9432,`True when there is more than 1 active debug session.`)}),new I(`disassembleRequestSupported`,!1,{type:`boolean`,description:x(9433,`True when the focused sessions supports disassemble request.`)}),new I(`disassemblyViewFocus`,!1,{type:`boolean`,description:x(9434,`True when the Disassembly View is focused.`)}),new I(`languageSupportsDisassembleRequest`,!1,{type:`boolean`,description:x(9435,`True when the language in the current editor supports disassemble request.`)}),new I(`focusedStackFrameHasInstructionReference`,!1,{type:`boolean`,description:x(9436,`True when the focused stack frame has instruction pointer reference.`)}),x(9438,`Controls when the internal Debug Console should open.`);var Px;(function(e){e[e.Inactive=0]=`Inactive`,e[e.Initializing=1]=`Initializing`,e[e.Stopped=2]=`Stopped`,e[e.Running=3]=`Running`})(Px||={});var Fx;(function(e){e[e.Valid=0]=`Valid`,e[e.Unreadable=1]=`Unreadable`,e[e.Error=2]=`Error`})(Fx||={});var Ix;(function(e){e[e.Variable=0]=`Variable`,e[e.Address=1]=`Address`})(Ix||={});var Lx;(function(e){e[e.Initial=1]=`Initial`,e[e.Dynamic=2]=`Dynamic`})(Lx||={});var Rx;(function(e){e.UnverifiedBreakpoints=`unverifiedBreakpoints`})(Rx||={});var zx;(function(e){e[e.CONDITION=0]=`CONDITION`,e[e.HIT_COUNT=1]=`HIT_COUNT`,e[e.LOG_MESSAGE=2]=`LOG_MESSAGE`,e[e.TRIGGER_POINT=3]=`TRIGGER_POINT`})(zx||={});var Bx;(function(e){e[e.Command=0]=`Command`,e[e.Tree=1]=`Tree`})(Bx||={});var Vx;(function(e){e[e.None=0]=`None`,e[e.Collapsed=1]=`Collapsed`,e[e.Expanded=2]=`Expanded`})(Vx||={});var Hx;(function(e){e.deserialize=e=>e,e.serialize=e=>e})(Hx||={});var Ux;(function(e){e.deserialize=e=>({id:e.id,name:e.name,iconPath:e.iconPath&&{light:w.revive(e.iconPath.light),dark:w.revive(e.iconPath.dark)},iconClass:e.iconClass,visualization:e.visualization}),e.serialize=e=>e})(Ux||={});var Wx;(function(e){e.McpServersQueryService=`McpServersQueryService`,e.McpServerWebUri=`McpServerWebUriTemplate`,e.McpServerVersionUri=`McpServerVersionUriTemplate`,e.McpServerIdUri=`McpServerIdUriTemplate`,e.McpServerLatestVersionUri=`McpServerLatestVersionUriTemplate`,e.McpServerNamedResourceUri=`McpServerNamedResourceUriTemplate`,e.PublisherUriTemplate=`PublisherUriTemplate`,e.ContactSupportUri=`ContactSupportUri`,e.PrivacyPolicyUri=`PrivacyPolicyUri`,e.TermsOfServiceUri=`TermsOfServiceUri`,e.ReportUri=`ReportUri`})(Wx||={});var Gx;(function(e){e.Available=`available`,e.Unavailable=`unavailable`})(Gx||={});var Kx;(function(e){e.LATEST_PROTOCOL_VERSION=`2025-11-25`,e.JSONRPC_VERSION=`2.0`,e.PARSE_ERROR=-32700,e.INVALID_REQUEST=-32600,e.METHOD_NOT_FOUND=-32601,e.INVALID_PARAMS=-32602,e.INTERNAL_ERROR=-32603,e.URL_ELICITATION_REQUIRED=-32042})(Kx||={}),k(`IMcpService`);const qx=k(`IMcpWorkbenchService`);k(`IMcpServerSampling`),k(`IMcpElicitationService`);function Jx(e,t){return ys.toKey(e)+`/`+t}var Yx;(function(e){e[e.WorkspaceFolder=0]=`WorkspaceFolder`,e[e.Workspace=100]=`Workspace`,e[e.User=200]=`User`,e[e.Extension=300]=`Extension`,e[e.Plugin=350]=`Plugin`,e[e.Filesystem=400]=`Filesystem`,e[e.RemoteBoost=-50]=`RemoteBoost`})(Yx||={});var Xx;(function(e){function t(e,t){return e.id===t.id&&e.remoteAuthority===t.remoteAuthority&&e.label===t.label&&e.trustBehavior===t.trustBehavior&&sc(e.sandbox,t.sandbox)}e.equals=t})(Xx||={});var Zx;(function(e){e[e.Initial=0]=`Initial`,e[e.Dynamic=1]=`Dynamic`})(Zx||={});var Qx;(function(e){function t(e){return e}e.toSerialized=t;function n(e){return{id:e.id,label:e.label,cacheNonce:e.cacheNonce,staticMetadata:e.staticMetadata,launch:oS.fromSerialized(e.launch),sandboxEnabled:e.sandboxEnabled,variableReplacement:e.variableReplacement?$x.fromSerialized(e.variableReplacement):void 0}}e.fromSerialized=n;function r(e,t){return e.id===t.id&&e.label===t.label&&e.cacheNonce===t.cacheNonce&&se(e.roots,t.roots,(e,t)=>e.toString()===t.toString())&&sc(e.launch,t.launch)&&sc(e.presentation,t.presentation)&&sc(e.variableReplacement,t.variableReplacement)&&sc(e.devMode,t.devMode)&&e.sandboxEnabled===t.sandboxEnabled}e.equals=r})(Qx||={});var $x;(function(e){function t(e){return e}e.toSerialized=t;function n(e){return{section:e.section,folder:e.folder?{...e.folder,uri:w.revive(e.folder.uri)}:void 0,target:e.target}}e.fromSerialized=n})($x||={});var eS;(function(e){e.Empty={working:!1,starting:[],serversRequiringInteraction:[]}})(eS||={});var tS;(function(e){e[e.HasUnknown=0]=`HasUnknown`,e[e.LoadingUnknown=1]=`LoadingUnknown`,e[e.AllKnown=2]=`AllKnown`})(tS||={});var nS;(function(e){(function(e){e[e.Trusted=0]=`Trusted`,e[e.TrustedOnNonce=1]=`TrustedOnNonce`,e[e.Untrusted=2]=`Untrusted`,e[e.Unknown=3]=`Unknown`})(e.Kind||={})})(nS||={});var rS;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Cached=1]=`Cached`,e[e.Outdated=2]=`Outdated`,e[e.RefreshingFromUnknown=3]=`RefreshingFromUnknown`,e[e.RefreshingFromCached=4]=`RefreshingFromCached`,e[e.Live=5]=`Live`})(rS||={});var iS;(function(e){e[e.Model=1]=`Model`,e[e.App=2]=`App`})(iS||={});var aS;(function(e){e[e.Stdio=1]=`Stdio`,e[e.HTTP=2]=`HTTP`})(aS||={});var oS;(function(e){function t(e){return e}e.toSerialized=t;function n(e){switch(e.type){case aS.HTTP:return{type:e.type,uri:w.revive(e.uri),headers:e.headers,oauth:e.oauth,authentication:e.authentication};case aS.Stdio:return{type:e.type,cwd:e.cwd,command:e.command,args:e.args,env:e.env,envFile:e.envFile,sandbox:e.sandbox}}}e.fromSerialized=n;async function r(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(JSON.stringify(e)));return Kt(b.wrap(new Uint8Array(t)))}e.hash=r})(oS||={});var sS;(function(e){let t;(function(e){e[e.Stopped=0]=`Stopped`,e[e.Starting=1]=`Starting`,e[e.Running=2]=`Running`,e[e.Error=3]=`Error`})(t=e.Kind||={}),e.toString=e=>{switch(e.state){case t.Stopped:return x(11555,`Stopped`);case t.Starting:return x(11556,`Starting`);case t.Running:return x(11557,`Running`);case t.Error:return x(11558,`Error {0}`,e.message);default:He()}},e.toKindString=e=>{switch(e){case t.Stopped:return`stopped`;case t.Starting:return`starting`;case t.Running:return`running`;case t.Error:return`error`;default:He()}},e.canBeStarted=e=>e===t.Error||e===t.Stopped,e.isRunning=t=>!e.canBeStarted(t.state)})(sS||={});var cS=class e extends Error{static{this.prefix=`User interaction required: `}static is(e){return e.message.startsWith(this.prefix)}constructor(t){super(`${e.prefix}${t}`),this.reason=t}},lS;(function(e){e[e.Disabled=0]=`Disabled`,e[e.DisabledByAccess=1]=`DisabledByAccess`,e[e.DisabledProfile=2]=`DisabledProfile`,e[e.DisabledWorkspace=3]=`DisabledWorkspace`,e[e.Enabled=4]=`Enabled`})(lS||={});var uS;(function(e){e[e.Installing=0]=`Installing`,e[e.Installed=1]=`Installed`,e[e.Uninstalling=2]=`Uninstalling`,e[e.Uninstalled=3]=`Uninstalled`})(uS||={});var dS;(function(e){e.Readme=`readme`,e.Manifest=`manifest`,e.Configuration=`configuration`})(dS||={});let fS=class extends y{constructor(e,t){super(),this.containers=e,this._register(t.onChange(this.update,this))}set mcpServer(e){this.containers.forEach(t=>t.mcpServer=e)}update(e){for(let t of this.containers)e&&t.mcpServer?e.id===t.mcpServer.id&&(t.mcpServer=e):t.update()}};fS=A([j(1,qx)],fS),new I(`mcpServersGalleryStatus`,Gx.Unavailable),new I(`hasInstalledMcpServers`,!0);var pS;(function(e){e.scheme=`mcp-resource`;let t=`dylo78gyp`;function n(n,r){return typeof r==`string`&&(r=w.parse(r)),r.with({scheme:e.scheme,authority:Kt(b.fromString(n.id)),path:[``,r.scheme,r.authority||t].join(`/`)+r.path})}e.fromServer=n;function r(n){if(typeof n==`string`&&(n=w.parse(n)),n.scheme!==e.scheme)throw Error(`Invalid MCP resource URI: ${n.toString()}`);let r=n.path.split(`/`);if(r.length<3)throw Error(`Invalid MCP resource URI: ${n.toString()}`);let[,i,a,...o]=r,s=new URL(`${i}://${a.toLowerCase()===t?``:a}`);return s.pathname=o.length?`/`+o.join(`/`):``,s.search=n.query,s.hash=n.fragment,{definitionId:qt(n.authority).toString(),resourceURL:s}}e.toServer=r})(pS||={});var mS;(function(e){e[e.Logging=1]=`Logging`,e[e.Completions=2]=`Completions`,e[e.Prompts=4]=`Prompts`,e[e.PromptsListChanged=8]=`PromptsListChanged`,e[e.Resources=16]=`Resources`,e[e.ResourcesSubscribe=32]=`ResourcesSubscribe`,e[e.ResourcesListChanged=64]=`ResourcesListChanged`,e[e.Tools=128]=`Tools`,e[e.ToolsListChanged=256]=`ToolsListChanged`})(mS||={});var hS;(function(e){e.Prefix=`mcp_`,e[e.MaxPrefixLen=18]=`MaxPrefixLen`,e[e.MaxLength=64]=`MaxLength`})(hS||={});var gS;(function(e){e[e.Form=0]=`Form`,e[e.URL=1]=`URL`})(gS||={});const _S=`[/\\\\]`,vS=`[^/\\\\]`,yS=/\//g;function bS(e,t){switch(e){case 0:return``;case 1:return`${vS}*?`;default:return`(?:${_S}|${vS}+${_S}${t?`|${_S}${vS}+`:``})*?`}}function xS(e,t){if(!e)return[];let n=[],r=!1,i=!1,a=``;for(let o of e){switch(o){case t:if(!r&&!i){n.push(a),a=``;continue}break;case`{`:r=!0;break;case`}`:r=!1;break;case`[`:i=!0;break;case`]`:i=!1;break}a+=o}return a&&n.push(a),n}function SS(e){if(!e)return``;let t=``,n=xS(e,`/`);if(n.every(e=>e===`**`))t=`.*`;else{let e=!1;n.forEach((r,i)=>{if(r===`**`){if(e)return;t+=bS(2,i===n.length-1)}else{let e=!1,a=``,o=!1,s=``;for(let n of r){if(n!==`}`&&e){a+=n;continue}if(o&&(n!==`]`||!s)){let e;e=n===`-`?n:(n===`^`||n===`!`)&&!s?`^`:n===`/`?``:qi(n),s+=e;continue}switch(n){case`{`:e=!0;continue;case`[`:o=!0;continue;case`}`:{let n=`(?:${xS(a,`,`).map(e=>SS(e)).join(`|`)})`;t+=n,e=!1,a=``;break}case`]`:t+=`[`+s+`]`,o=!1,s=``;break;case`?`:t+=vS;continue;case`*`:t+=bS(1);continue;default:t+=qi(n)}}i<n.length-1&&(n[i+1]!==`**`||i+2<n.length)&&(t+=_S)}e=r===`**`})}return t}const CS=/^\*\*\/\*\.[\w\.-]+$/,wS=/^\*\*\/([\w\.-]+)\/?$/,TS=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,ES=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,DS=/^\*\*((\/[\w\.-]+)+)\/?$/,OS=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,kS=new Re(1e4),AS=function(){return!1},jS=function(){return null};function MS(e,t){if(!e)return jS;let n;n=typeof e==`string`?e:e.pattern,n=n.trim();let r=t.ignoreCase??!1,i={...t,equals:r?sa:(e,t)=>e===t,endsWith:r?ua:(e,t)=>e.endsWith(t),isEqualOrParent:(e,n)=>Ba(e,n,t.ignoreCase??!xn)},a=`${r?n.toLowerCase():n}_${!!t.trimForExclusions}_${r}`,o=kS.get(a);if(o)return NS(o,e,i);let s;return o=CS.test(n)?FS(n.substring(4),n,i):(s=wS.exec(PS(n,i)))?IS(s[1],n,i):(t.trimForExclusions?ES:TS).test(n)?LS(n,i):(s=DS.exec(PS(n,i)))?RS(s[1].substring(1),n,!0,i):(s=OS.exec(PS(n,i)))?RS(s[1],n,!1,i):zS(n,i),kS.set(a,o),NS(o,e,i)}function NS(e,t,n){if(typeof t==`string`)return e;let r=function(r,i){return n.isEqualOrParent(r,t.base)?e(Yi(r.substring(t.base.length),Jr),i):null};return r.allBasenames=e.allBasenames,r.allPaths=e.allPaths,r.basenames=e.basenames,r.patterns=e.patterns,r}function PS(e,t){return t.trimForExclusions&&e.endsWith(`/**`)?e.substring(0,e.length-2):e}function FS(e,t,n){return function(r,i){return typeof r==`string`&&n.endsWith(r,e)?t:null}}function IS(e,t,n){let r=`/${e}`,i=`\\${e}`,a=function(a,o){return typeof a==`string`?o?n.equals(o,e)?t:null:n.equals(a,e)||n.endsWith(a,r)||n.endsWith(a,i)?t:null:null},o=[e];return a.basenames=o,a.patterns=[t],a.allBasenames=o,a}function LS(e,t){let n=GS(e.slice(1,-1).split(`,`).map(e=>MS(e,t)).filter(e=>e!==jS),e),r=n.length;if(!r)return jS;if(r===1)return n[0];let i=function(t,r){for(let i=0,a=n.length;i<a;i++)if(n[i](t,r))return e;return null},a=n.find(e=>!!e.allBasenames);a&&(i.allBasenames=a.allBasenames);let o=n.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return o.length&&(i.allPaths=o),i}function RS(e,t,n,r){let i=Jr===zr.sep,a=i?e:e.replace(yS,Jr),o=Jr+a,s=zr.sep+e,c;return c=n?function(n,c){return typeof n==`string`&&(r.equals(n,a)||r.endsWith(n,o)||!i&&(r.equals(n,e)||r.endsWith(n,s)))?t:null}:function(n,o){return typeof n==`string`&&(r.equals(n,a)||!i&&r.equals(n,e))?t:null},c.allPaths=[(n?`*/`:`./`)+e],c}function zS(e,t){try{let n=RegExp(`^${SS(e)}$`,t.ignoreCase?`i`:void 0);return function(t){return n.lastIndex=0,typeof t==`string`&&n.test(t)?e:null}}catch{return jS}}function BS(e,t,n){return!e||typeof t!=`string`?!1:VS(e,n)(t)}function VS(e,t={}){if(!e)return AS;if(typeof e==`string`||HS(e)){let n=MS(e,t);if(n===jS)return AS;let r=function(e,t){return!!n(e,t)};return n.allBasenames&&(r.allBasenames=n.allBasenames),n.allPaths&&(r.allPaths=n.allPaths),r}return US(e,t)}function HS(e){let t=e;return t?typeof t.base==`string`&&typeof t.pattern==`string`:!1}function US(e,t){let n=GS(Object.getOwnPropertyNames(e).map(n=>WS(n,e[n],t)).filter(e=>e!==jS)),r=n.length;if(!r)return jS;if(!n.some(e=>!!e.requiresSiblings)){if(r===1)return n[0];let e=function(e,t){let r;for(let i=0,a=n.length;i<a;i++){let a=n[i](e,t);if(typeof a==`string`)return a;fo(a)&&(r||=[],r.push(a))}return r?(async()=>{for(let e of r){let t=await e;if(typeof t==`string`)return t}return null})():null},t=n.find(e=>!!e.allBasenames);t&&(e.allBasenames=t.allBasenames);let i=n.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return i.length&&(e.allPaths=i),e}let i=function(e,t,r){let i,a;for(let o=0,s=n.length;o<s;o++){let s=n[o];s.requiresSiblings&&r&&(t||=Kr(e),i||=t.substring(0,t.length-qr(e).length));let c=s(e,t,i,r);if(typeof c==`string`)return c;fo(c)&&(a||=[],a.push(c))}return a?(async()=>{for(let e of a){let t=await e;if(typeof t==`string`)return t}return null})():null},a=n.find(e=>!!e.allBasenames);a&&(i.allBasenames=a.allBasenames);let o=n.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return o.length&&(i.allPaths=o),i}function WS(e,t,n){if(t===!1)return jS;let r=MS(e,n);if(r===jS)return jS;if(typeof t==`boolean`)return r;if(t){let n=t.when;if(typeof n==`string`){let t=(t,i,a,o)=>{if(!o||!r(t,i))return null;let s=o(n.replace(`$(basename)`,()=>a));return fo(s)?s.then(t=>t?e:null):s?e:null};return t.requiresSiblings=!0,t}}return r}function GS(e,t){let n=e.filter(e=>!!e.basenames);if(n.length<2)return e;let r=n.reduce((e,t)=>{let n=t.basenames;return n?e.concat(n):e},[]),i;if(t){i=[];for(let e=0,n=r.length;e<n;e++)i.push(t)}else i=n.reduce((e,t)=>{let n=t.patterns;return n?e.concat(n):e},[]);let a=function(e,t){if(typeof e!=`string`)return null;if(!t){let n;for(n=e.length;n>0;n--){let t=e.charCodeAt(n-1);if(t===C.Slash||t===C.Backslash)break}t=e.substring(n)}let n=r.indexOf(t);return n===-1?null:i[n]};a.basenames=r,a.patterns=i,a.allBasenames=r;let o=e.filter(e=>!e.basenames);return o.push(a),o}const KS=[`W`,`X`,`Y`,`Z`,`a`,`b`,`c`,`d`,`e`,`f`],qS=RegExp(`^[${KS.join(``)}]+`);function JS(e){if(e.scheme!==O.vscodeNotebookCell)return;let t=e.fragment.indexOf(`s`);if(t<0)return;let n=parseInt(e.fragment.substring(0,t).replace(qS,``),7),r=Ut(e.fragment.substring(t+1)).toString();if(!isNaN(n))return{handle:n,notebook:e.with({scheme:r,fragment:null})}}function YS(e,t){let n=t.toString(7),r=`${n.length<KS.length?KS[n.length-1]:`z`}${n}s${Wt(b.fromString(e.scheme),!0,!0)}`;return e.with({scheme:O.vscodeNotebookCell,fragment:r})}function XS(e){if(e.scheme!==O.vscodeNotebookMetadata)return;let t=Ut(e.fragment).toString();return e.with({scheme:t,fragment:null})}function ZS(e){let t=`${Wt(b.fromString(e.scheme),!0,!0)}`;return e.with({scheme:O.vscodeNotebookMetadata,fragment:t})}function QS(e){if(e.scheme!==O.vscodeNotebookCellOutput)return;let t=new URLSearchParams(e.query),n=t.get(`openIn`);if(!n)return;let r=t.get(`outputId`)??void 0,i=JS(e.with({scheme:O.vscodeNotebookCell,query:null})),a=t.get(`outputIndex`)?parseInt(t.get(`outputIndex`)||``,10):void 0,o=i?i.notebook:e.with({scheme:t.get(`notebookScheme`)||O.file,fragment:null,query:null}),s=t.get(`cellIndex`)?parseInt(t.get(`cellIndex`)||``,10):void 0;return{notebook:o,openIn:n,outputId:r,outputIndex:a,cellHandle:i?.handle,cellFragment:e.fragment,cellIndex:s}}var $S;(function(e){e[e.Markup=1]=`Markup`,e[e.Code=2]=`Code`})($S||={}),Uu.latex,Uu.markdown,Uu.text,Uu.latex,Uu.markdown,Uu.text;var eC;(function(e){e[e.Running=1]=`Running`,e[e.Idle=2]=`Idle`})(eC||={});var tC;(function(e){e[e.Unconfirmed=1]=`Unconfirmed`,e[e.Pending=2]=`Pending`,e[e.Executing=3]=`Executing`})(tC||={});var nC;(function(e){e[e.Unconfirmed=1]=`Unconfirmed`,e[e.Pending=2]=`Pending`,e[e.Executing=3]=`Executing`})(nC||={});var rC;(function(e){e[e.WithHardKernelDependency=0]=`WithHardKernelDependency`,e[e.WithOptionalKernelDependency=1]=`WithOptionalKernelDependency`,e[e.Pure=2]=`Pure`,e[e.Never=3]=`Never`})(rC||={});var iC;(function(e){e.Always=`always`,e.Never=`never`,e.Optional=`optional`})(iC||={});var aC;(function(e){e[e.ModelChange=1]=`ModelChange`,e[e.Move=2]=`Move`,e[e.ChangeCellLanguage=5]=`ChangeCellLanguage`,e[e.Initialize=6]=`Initialize`,e[e.ChangeCellMetadata=7]=`ChangeCellMetadata`,e[e.Output=8]=`Output`,e[e.OutputItem=9]=`OutputItem`,e[e.ChangeCellContent=10]=`ChangeCellContent`,e[e.ChangeDocumentMetadata=11]=`ChangeDocumentMetadata`,e[e.ChangeCellInternalMetadata=12]=`ChangeCellInternalMetadata`,e[e.ChangeCellMime=13]=`ChangeCellMime`,e[e.Unknown=100]=`Unknown`})(aC||={});var oC;(function(e){e[e.Handle=0]=`Handle`,e[e.Index=1]=`Index`})(oC||={});var sC;(function(e){e[e.Replace=1]=`Replace`,e[e.Output=2]=`Output`,e[e.Metadata=3]=`Metadata`,e[e.CellLanguage=4]=`CellLanguage`,e[e.DocumentMetadata=5]=`DocumentMetadata`,e[e.Move=6]=`Move`,e[e.OutputItems=7]=`OutputItems`,e[e.PartialMetadata=8]=`PartialMetadata`,e[e.PartialInternalMetadata=9]=`PartialInternalMetadata`})(sC||={});var cC;(function(e){e.scheme=O.vscodeNotebookMetadata;function t(e){return ZS(e)}e.generate=t;function n(e){return XS(e)}e.parse=n})(cC||={});var lC;(function(e){e.scheme=O.vscodeNotebookCell;function t(e,t){return YS(e,t)}e.generate=t;function n(e){return JS(e)}e.parse=n;function r(e,t){return e.with({scheme:O.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:`editor`,outputId:t??``,notebookScheme:e.scheme===O.file?``:e.scheme}).toString()})}e.generateCellOutputUriWithId=r;function i(e,t,n){return e.with({scheme:O.vscodeNotebookCellOutput,fragment:t.fragment,query:new URLSearchParams({openIn:`notebook`,outputIndex:String(n)}).toString()})}e.generateCellOutputUriWithIndex=i;function a(e,t,n,r,i){return e.with({scheme:O.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:`notebookOutputEditor`,notebook:e.toString(),cellIndex:String(n),outputId:r,outputIndex:String(i)}).toString()})}e.generateOutputEditorUri=a;function o(e){return QS(e)}e.parseCellOutputUri=o;function s(t,n,r){return e.generate(t,n).with({scheme:r})}e.generateCellPropertyUri=s;function c(t,n){if(t.scheme===n)return e.parse(t.with({scheme:e.scheme}))}e.parseCellPropertyUri=c})(lC||={}),new I(`notebookEditorCursorAtBoundary`,`none`),new I(`notebookEditorCursorAtLineBoundary`,`none`);var uC;(function(e){e.default=`default`,e.option=`option`})(uC||={});var dC;(function(e){e.Cells=`cells`,e.Text=`text`,e.None=`none`})(dC||={});var fC;(function(e){e[e.Left=1]=`Left`,e[e.Right=2]=`Right`})(fC||={}),class e{static{this._prefix=`notebook/`}static create(t,n){return`${e._prefix}${t}/${n??t}`}static parse(t){if(t.startsWith(e._prefix)){let n=t.substring(e._prefix.length).split(`/`);if(n.length===2)return{notebookType:n[0],viewType:n[1]}}}};const pC=new TextDecoder;function mC(e){let t=[],n=!1;for(let r of e)(t.length===0||n)&&(t.push(r),n=!0);let r=gC(t),i=b.concat(t.map(e=>b.wrap(e))),a=yC(i);return r||=a.byteLength!==i.byteLength,{data:a,didCompression:r}}const hC=`\x1B[A`.split(``).map(e=>e.charCodeAt(0));function gC(e){let t=!1;return e.forEach((n,r)=>{if(r===0||n.length<3)return;let i=e[r-1],a=n.subarray(0,3);if(a[0]===hC[0]&&a[1]===hC[1]&&a[2]===hC[2]){let a=i.lastIndexOf(10);if(a===-1)return;t=!0,e[r-1]=i.subarray(0,a),e[r]=n.subarray(3)}}),t}function _C(e){let t=e;do e=t,t=e.replace(/[^\n]\x08/gm,``);while(t.length<e.length);return e}function vC(e){for(e=e.replace(/\r+\n/gm,`
89
- `);e.search(/\r[^$]/g)>-1;){let t=e.match(/^(.*)\r+/m)[1],n=e.match(/\r+(.*)$/m)[1];n+=t.slice(n.length,t.length),e=e.replace(/\r+.*$/m,`\r`).replace(/^.*\r/m,n)}return e}function yC(e){return!e.buffer.includes(8)&&!e.buffer.includes(13)?e:b.fromString(vC(_C(pC.decode(e.buffer))))}var bC;(function(e){e.List=`list`,e.Tree=`tree`})(bC||={});var xC;(function(e){e[e.Error=0]=`Error`,e[e.Warning=1]=`Warning`,e[e.Information=2]=`Information`})(xC||={});var SC;(function(e){e[e.HistoryPrevious=0]=`HistoryPrevious`,e[e.HistoryNext=1]=`HistoryNext`})(SC||={});var CC;(function(e){e.DiscoveryTime=`discoveryTime`,e.Name=`name`,e.Path=`path`})(CC||={});var wC;(function(e){e.Single=`single`,e.Multiple=`multiple`})(wC||={});var TC;(function(e){e.Delimiter=`\0`})(TC||={});var EC;(function(e){e[e.IsSame=0]=`IsSame`,e[e.Disconnected=1]=`Disconnected`,e[e.IsChild=2]=`IsChild`,e[e.IsParent=3]=`IsParent`})(EC||={});var DC=class e{static fromExtHostTestItem(t,n,r=t.parent){if(t._isRoot)return new e([n]);let i=[t.id];for(let e=r;e&&e.id!==n;e=e.parent)i.push(e.id);return i.push(n),new e(i.reverse())}static isRoot(e){return!e.includes(TC.Delimiter)}static root(e){let t=e.indexOf(TC.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(t){return new e(t.split(TC.Delimiter))}static join(t,n){return new e([...t.path,n])}static split(e){return e.split(TC.Delimiter)}static joinToString(e,t){return e.toString()+TC.Delimiter+t}static parentId(e){let t=e.lastIndexOf(TC.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){let t=e.lastIndexOf(TC.Delimiter);return t===-1?e:e.slice(t+TC.Delimiter.length)}static isChild(e,t){return t[e.length]===TC.Delimiter&&t.startsWith(e)}static compare(t,n){return t===n?EC.IsSame:e.isChild(t,n)?EC.IsChild:e.isChild(n,t)?EC.IsParent:EC.Disconnected}static getLengthOfCommonPrefix(e,t){if(e===0)return 0;let n=0;for(;n<e-1;){for(let r=1;r<e;r++){let e=t(r-1),i=t(r);if(e.path[n]!==i.path[n])return n}n++}return n}constructor(e,t=e.length){if(this.path=e,this.viewEnd=t,e.length===0||t<1)throw Error(`cannot create test with empty path`)}get rootId(){return new e(this.path,1)}get parentId(){return this.viewEnd>1?new e(this.path,this.viewEnd-1):void 0}get localId(){return this.path[this.viewEnd-1]}get controllerId(){return this.path[0]}get isRoot(){return this.viewEnd===1}*idsFromRoot(){for(let t=1;t<=this.viewEnd;t++)yield new e(this.path,t)}*idsToRoot(){for(let t=this.viewEnd;t>0;t--)yield new e(this.path,t)}compare(t){if(typeof t==`string`)return e.compare(this.toString(),t);for(let e=0;e<t.viewEnd&&e<this.viewEnd;e++)if(t.path[e]!==this.path[e])return EC.Disconnected;return t.viewEnd>this.viewEnd?EC.IsChild:t.viewEnd<this.viewEnd?EC.IsParent:EC.IsSame}toJSON(){return this.toString()}toString(){if(!this.stringifed){this.stringifed=this.path[0];for(let e=1;e<this.viewEnd;e++)this.stringifed+=TC.Delimiter,this.stringifed+=this.path[e]}return this.stringifed}},OC;(function(e){e[e.Unset=0]=`Unset`,e[e.Queued=1]=`Queued`,e[e.Running=2]=`Running`,e[e.Passed=3]=`Passed`,e[e.Failed=4]=`Failed`,e[e.Skipped=5]=`Skipped`,e[e.Errored=6]=`Errored`})(OC||={}),OC.Unset,OC.Queued,OC.Running,OC.Passed,OC.Failed,OC.Skipped,OC.Errored;var kC;(function(e){e[e.Run=1]=`Run`,e[e.Debug=2]=`Debug`,e[e.Coverage=3]=`Coverage`})(kC||={});var AC;(function(e){e[e.Refresh=2]=`Refresh`,e[e.CodeRelatedToTest=4]=`CodeRelatedToTest`,e[e.TestRelatedToCode=8]=`TestRelatedToCode`})(AC||={});var jC;(function(e){e[e.Run=2]=`Run`,e[e.Debug=4]=`Debug`,e[e.Coverage=8]=`Coverage`,e[e.HasNonDefaultProfile=16]=`HasNonDefaultProfile`,e[e.HasConfigurable=32]=`HasConfigurable`,e[e.SupportsContinuousRun=64]=`SupportsContinuousRun`})(jC||={}),jC.Run,x(15487,`Run`),jC.Debug,x(15488,`Debug`),jC.Coverage,x(15489,`Coverage`),jC.Run,jC.Debug,jC.Coverage,jC.HasNonDefaultProfile,jC.HasConfigurable,jC.SupportsContinuousRun;const MC=e=>`runId`in e;var NC;(function(e){e.serialize=e=>({range:e.range.toJSON(),uri:e.uri.toJSON()}),e.deserialize=(e,t)=>({range:bp.lift(t.range),uri:e.asCanonicalUri(w.revive(t.uri))})})(NC||={});var PC;(function(e){e[e.Error=0]=`Error`,e[e.Output=1]=`Output`})(PC||={});var FC;(function(e){e.serialize=e=>({label:e.label,uri:e.uri?.toJSON(),position:e.position?.toJSON()}),e.deserialize=(e,t)=>({label:t.label,uri:t.uri?e.asCanonicalUri(w.revive(t.uri)):void 0,position:t.position?yp.lift(t.position):void 0})})(FC||={});var IC;(function(e){e.serialize=e=>({message:e.message,type:PC.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&NC.serialize(e.location),stackTrace:e.stackTrace?.map(FC.serialize)}),e.deserialize=(e,t)=>({message:t.message,type:PC.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&NC.deserialize(e,t.location),stackTrace:t.stackTrace&&t.stackTrace.map(t=>FC.deserialize(e,t))})})(IC||={});var LC;(function(e){e.serialize=e=>({message:e.message,type:PC.Output,offset:e.offset,length:e.length,location:e.location&&NC.serialize(e.location)}),e.deserialize=(e,t)=>({message:t.message,type:PC.Output,offset:t.offset,length:t.length,location:t.location&&NC.deserialize(e,t.location)})})(LC||={});var RC;(function(e){e.serialize=e=>e.type===PC.Error?IC.serialize(e):LC.serialize(e),e.deserialize=(e,t)=>t.type===PC.Error?IC.deserialize(e,t):LC.deserialize(e,t),e.isDiffable=e=>e.type===PC.Error&&e.actual!==void 0&&e.expected!==void 0})(RC||={});var zC;(function(e){e.serializeWithoutMessages=e=>({state:e.state,duration:e.duration,messages:[]}),e.serialize=e=>({state:e.state,duration:e.duration,messages:e.messages.map(RC.serialize)}),e.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(t=>RC.deserialize(e,t))})})(zC||={});const BC=(e,t)=>e+`\0`+t,VC=e=>{let t=e.indexOf(`\0`);return{ctrlId:e.slice(0,t),tagId:e.slice(t+1)}};var HC;(function(e){e.serialize=e=>({extId:e.extId,label:e.label,tags:e.tags,busy:e.busy,children:void 0,uri:e.uri?.toJSON(),range:e.range?.toJSON()||null,description:e.description,error:e.error,sortText:e.sortText}),e.deserialize=(e,t)=>({extId:t.extId,label:t.label,tags:t.tags,busy:t.busy,children:void 0,uri:t.uri?e.asCanonicalUri(w.revive(t.uri)):void 0,range:t.range?bp.lift(t.range):null,description:t.description,error:t.error,sortText:t.sortText})})(HC||={});var UC;(function(e){e[e.NotExpandable=0]=`NotExpandable`,e[e.Expandable=1]=`Expandable`,e[e.BusyExpanding=2]=`BusyExpanding`,e[e.Expanded=3]=`Expanded`})(UC||={});var WC;(function(e){e.serialize=e=>({expand:e.expand,item:HC.serialize(e.item)}),e.deserialize=(e,t)=>({controllerId:DC.root(t.item.extId),expand:t.expand,item:HC.deserialize(e,t.item)})})(WC||={});var GC;(function(e){e.serialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.uri!==void 0&&(t.uri=e.item.uri?.toJSON()),e.item.range!==void 0&&(t.range=e.item.range?.toJSON()),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}},e.deserialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.range!==void 0&&(t.range=e.item.range?bp.lift(e.item.range):null),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}}})(GC||={});const KC=(e,t)=>{t.expand!==void 0&&(e.expand=t.expand),t.item!==void 0&&(e.item=e.item?Object.assign(e.item,t.item):t.item)};var qC;(function(e){e.serializeWithoutMessages=e=>({...WC.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(zC.serializeWithoutMessages)}),e.serialize=e=>({...WC.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(zC.serialize)}),e.deserialize=(e,t)=>({...WC.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(t=>zC.deserialize(e,t)),retired:!0})})(qC||={});var JC;(function(e){e.empty=()=>({covered:0,total:0}),e.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(JC||={});var YC;(function(e){e.serialize=e=>({id:e.id,statement:e.statement,branch:e.branch,declaration:e.declaration,testIds:e.testIds,uri:e.uri.toJSON()}),e.deserialize=(e,t)=>({id:t.id,statement:t.statement,branch:t.branch,declaration:t.declaration,testIds:t.testIds,uri:e.asCanonicalUri(w.revive(t.uri))}),e.empty=(e,t)=>({id:e,uri:t,statement:JC.empty()})})(YC||={});function XC(e){return{...e,location:e.location?.toJSON()}}function ZC(e){return e.location=e.location?yp.isIPosition(e.location)?yp.lift(e.location):bp.lift(e.location):void 0,e}var QC;(function(e){e[e.Declaration=0]=`Declaration`,e[e.Statement=1]=`Statement`,e[e.Branch=2]=`Branch`})(QC||={});var $C;(function(e){e.serialize=e=>e.type===QC.Declaration?tw.serialize(e):nw.serialize(e),e.deserialize=e=>e.type===QC.Declaration?tw.deserialize(e):nw.deserialize(e)})($C||={});var ew;(function(e){e.serialize=XC,e.deserialize=ZC})(ew||={});var tw;(function(e){e.serialize=XC,e.deserialize=ZC})(tw||={});var nw;(function(e){e.serialize=e=>({...XC(e),branches:e.branches?.map(ew.serialize)}),e.deserialize=e=>({...ZC(e),branches:e.branches?.map(ew.deserialize)})})(nw||={});var rw;(function(e){e[e.Add=0]=`Add`,e[e.Update=1]=`Update`,e[e.DocumentSynced=2]=`DocumentSynced`,e[e.Remove=3]=`Remove`,e[e.IncrementPendingExtHosts=4]=`IncrementPendingExtHosts`,e[e.Retire=5]=`Retire`,e[e.AddTag=6]=`AddTag`,e[e.RemoveTag=7]=`RemoveTag`})(rw||={});var iw;(function(e){e.deserialize=(e,t)=>t.op===rw.Add?{op:t.op,item:WC.deserialize(e,t.item)}:t.op===rw.Update?{op:t.op,item:GC.deserialize(t.item)}:t.op===rw.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(w.revive(t.uri)),docv:t.docv}:t,e.serialize=e=>e.op===rw.Add?{op:e.op,item:WC.serialize(e.item)}:e.op===rw.Update?{op:e.op,item:GC.serialize(e.item)}:e})(iw||={});var aw=class{constructor(e){this.uriIdentity=e,this._tags=new Map,this.items=new Map,this.roots=new Set,this.busyControllerCount=0,this.pendingRootCount=0,this.tags=this._tags}apply(e){let t=this.createChangeCollector();for(let n of e)switch(n.op){case rw.Add:this.add(WC.deserialize(this.uriIdentity,n.item),t);break;case rw.Update:this.update(GC.deserialize(n.item),t);break;case rw.Remove:this.remove(n.itemId,t);break;case rw.Retire:this.retireTest(n.itemId);break;case rw.IncrementPendingExtHosts:this.updatePendingRoots(n.amount);break;case rw.AddTag:this._tags.set(n.tag.id,n.tag);break;case rw.RemoveTag:this._tags.delete(n.id);break}t.complete?.()}add(e,t){let n=DC.parentId(e.item.extId)?.toString(),r;if(!n)r=this.createItem(e),this.roots.add(r),this.items.set(e.item.extId,r);else if(this.items.has(n)){let t=this.items.get(n);t.children.add(e.item.extId),r=this.createItem(e,t),this.items.set(e.item.extId,r)}else{console.error(`Test with unknown parent ID: ${JSON.stringify(e)}`);return}return t.add?.(r),e.expand===UC.BusyExpanding&&this.busyControllerCount++,r}update(e,t){let n=this.items.get(e.extId);if(n)return e.expand!==void 0&&(n.expand===UC.BusyExpanding&&this.busyControllerCount--,e.expand===UC.BusyExpanding&&this.busyControllerCount++),KC(n,e),t.update?.(n),n}remove(e,t){let n=this.items.get(e);if(!n)return;let r=DC.parentId(n.item.extId)?.toString();r?this.items.get(r).children.delete(n.item.extId):this.roots.delete(n);let i=[[e]];for(;i.length;)for(let e of i.pop()){let r=this.items.get(e);r&&(i.push(r.children),this.items.delete(e),t.remove?.(r,r!==n),r.expand===UC.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}},ow;(function(e){e[e.EMBEDDED=1]=`EMBEDDED`,e[e.LLM_RANKED=2]=`LLM_RANKED`,e[e.CANCELED=3]=`CANCELED`})(ow||={});var sw;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.PART_CLOSE=1]=`PART_CLOSE`})(sw||={});var cw;(function(e){e[e.UP=0]=`UP`,e[e.DOWN=1]=`DOWN`,e[e.LEFT=2]=`LEFT`,e[e.RIGHT=3]=`RIGHT`})(cw||={});var lw;(function(e){e[e.HORIZONTAL=0]=`HORIZONTAL`,e[e.VERTICAL=1]=`VERTICAL`})(lw||={});var uw;(function(e){e[e.FIRST=0]=`FIRST`,e[e.LAST=1]=`LAST`,e[e.NEXT=2]=`NEXT`,e[e.PREVIOUS=3]=`PREVIOUS`})(uw||={});var dw;(function(e){e[e.MAXIMIZE=0]=`MAXIMIZE`,e[e.EXPAND=1]=`EXPAND`,e[e.EVEN=2]=`EVEN`})(dw||={});var fw;(function(e){e[e.COPY_EDITORS=0]=`COPY_EDITORS`,e[e.MOVE_EDITORS=1]=`MOVE_EDITORS`})(fw||={});var pw;(function(e){e[e.CREATION_TIME=0]=`CREATION_TIME`,e[e.MOST_RECENTLY_ACTIVE=1]=`MOST_RECENTLY_ACTIVE`,e[e.GRID_APPEARANCE=2]=`GRID_APPEARANCE`})(pw||={});var mw;(function(e){e[e.NEW_EDITOR=1]=`NEW_EDITOR`,e[e.MOVE_EDITOR=2]=`MOVE_EDITOR`,e[e.COPY_EDITOR=3]=`COPY_EDITOR`})(mw||={});var hw=class{constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};new class{constructor(){this.telemetryLevel=r_.NONE,this.sessionId=`someValue.sessionId`,this.machineId=`someValue.machineId`,this.sqmId=`someValue.sqmId`,this.devDeviceId=`someValue.devDeviceId`,this.firstSessionDate=`someValue.firstSessionDate`,this.sendErrorTelemetry=!1}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}setExperimentProperty(){}setCommonProperty(){}};const gw={id:`telemetry`,name:x(2195,`Telemetry`)};function _w(e,t){if(!e)return`none`;let n=hs(e),r=t?.remoteExtensionTips;if(r&&Object.prototype.hasOwnProperty.call(r,n))return n;let i=t?.virtualWorkspaceExtensionTips;return i&&Object.prototype.hasOwnProperty.call(i,n)?n:`other`}function vw(e,t){if(!e||!e.includes(`/`)&&!e.includes(`\\`))return e;let n=e,r=[];for(let n of t)for(;;){let t=n.exec(e);if(!t)break;r.push([t.index,n.lastIndex])}let i=/(?:^|[\\\/])((node_modules|node_modules\.asar)[\\\/].*)$/,a=/^(.*?)((?:\.vscode(?:-[a-z]+)*|resources[\\\/]app)[\\\/]extensions[\\\/].*)$/i,o=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w\-\._@]+(\\\\|\\|\/))+[\w\-\._@]*/g,s=0;for(n=``;;){let t=o.exec(e);if(!t)break;if(!r.some(([e,n])=>t.index<n&&e<o.lastIndex)){let r=a.exec(t[0]);if(r)n+=e.substring(s,t.index)+`<REDACTED: user-file-path>/`+r[2];else{let r=i.exec(t[0]);r?n+=e.substring(s,t.index)+`<REDACTED: user-file-path>/`+r[1]:n+=e.substring(s,t.index)+`<REDACTED: user-file-path>`}s=o.lastIndex}}return s<e.length&&(n+=e.substr(s)),n}const yw=[{label:`URL`,regex:/[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s]*/},{label:`Google API Key`,regex:/AIza[A-Za-z0-9_\\\-]{35}/},{label:`JWT`,regex:/eyJ[0eXAiOiJKV1Qi|hbGci|a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+/},{label:`Slack Token`,regex:/xox[pbar]\-[A-Za-z0-9]/},{label:`GitHub Token`,regex:/(gh[psuro]_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})/},{label:`Generic Secret`,regex:/(key|token|sig|secret|signature|password|passwd|pwd|android:value)[^a-zA-Z0-9]/i},{label:`CLI Credentials`,regex:/((login|psexec|(certutil|psexec)\.exe).{1,50}(\s-u(ser(name)?)?\s+.{3,100})?\s-(admin|user|vm|root)?p(ass(word)?)?\s+["']?[^$\-\/\s]|(^|[\s\r\n\\])net(\.exe)?.{1,5}(user\s+|share\s+\/user:| user -? secrets ? set) \s + [^ $\s \/])/},{label:`Microsoft Entra ID`,regex:/eyJ(?:0eXAiOiJKV1Qi|hbGci|[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.)/},{label:`Email`,regex:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/}];function bw(e,t=e){for(let e of yw)if(e.regex.test(t))return`<REDACTED: ${e.label}>`;return e}function xw(e){if(!e)return e;let t=!1;for(let n of yw)if(n.regex.test(e)){t=!0;break}if(!t)return e;if(!e.includes(`
90
- `))return bw(e);let n=e.split(`
91
- `);for(let e=0;e<n.length;e++){let t=e<n.length-1?n[e]+`
92
- `:n[e];n[e]=bw(n[e],t)}return n.join(`
93
- `)}function Sw(e,t){return e?ic(e,e=>{if(e instanceof hw||Object.hasOwnProperty.call(e,`isTrustedTelemetryValue`))return e.value;if(typeof e==`string`){let n=e.replaceAll(`%20`,` `);n=vw(n,t);for(let e of t)n=n.replace(e,``);return n=xw(n),n}}):{}}function Cw(e,t){return e.uuid&&t.uuid?e.uuid===t.uuid:e.id===t.id?!0:ia(e.id,t.id)===0}new ys(`pprice.better-merge`);const ww=Object.freeze({identifier:new ys(`nullExtensionDescription`),name:`Null Extension Description`,version:`0.0.0`,publisher:`vscode`,engines:{vscode:``},extensionLocation:w.parse(`void:location`),isBuiltin:!1,targetPlatform:vs.UNDEFINED,isUserBuiltin:!1,isUnderDevelopment:!1,preRelease:!1});var Tw=class{constructor(e){this.dependency=e}},Ew;(function(e){e[e.EagerAutoStart=1]=`EagerAutoStart`,e[e.EagerManualStart=2]=`EagerManualStart`,e[e.LazyAutoStart=3]=`LazyAutoStart`})(Ew||={});function Dw(e,t){return!!e.enabledApiProposals}function K(e,t){if(!Dw(e))throw Error(`Extension '${e.identifier.value}' CANNOT use API proposal: ${t}.\nIts package.json#enabledApiProposals-property declares: ${e.enabledApiProposals?.join(`, `)??`[]`} but NOT ${t}.\n The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ${e.identifier.value}`)}var Ow;(function(e){e[e.Normal=0]=`Normal`,e[e.Immediate=1]=`Immediate`})(Ow||={});var kw;(function(e){e[e.Upsert=0]=`Upsert`,e[e.SetTags=1]=`SetTags`,e[e.UpdateCanResolveChildren=2]=`UpdateCanResolveChildren`,e[e.RemoveChild=3]=`RemoveChild`,e[e.SetProp=4]=`SetProp`,e[e.Bulk=5]=`Bulk`,e[e.DocumentSynced=6]=`DocumentSynced`})(kw||={});const Aw=(e,t)=>e===t,jw=Object.entries({range:(e,t)=>e===t?!0:!e||!t?!1:e.equalsRange(t),busy:Aw,label:Aw,description:Aw,error:Aw,sortText:Aw,tags:(e,t)=>!(e.length!==t.length||e.some(e=>!t.includes(e)))}),Mw=(e,t)=>{let n;for(let[r,i]of jw)i(e[r],t[r])||(n?n[r]=t[r]:n={[r]:t[r]});return n};var Nw=class extends y{get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new Mo(()=>this.flushDiff(),200)),this.diffOpEmitter=this._register(new S),this.tree=new Map,this.tags=new Map,this.diff=[],this.onDidGenerateDiff=this.diffOpEmitter.event,this.root.canResolveChildren=!0,this.upsertItem(this.root,void 0)}set resolveHandler(e){this._resolveHandler=e;for(let e of this.tree.values())this.updateExpandability(e)}get resolveHandler(){return this._resolveHandler}collectDiff(){let e=this.diff;return this.diff=[],e}pushDiff(e){switch(e.op){case rw.DocumentSynced:for(let t of this.diff)if(t.op===rw.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break;case rw.Update:{let t=this.diff[this.diff.length-1];if(t){if(t.op===rw.Update&&t.item.extId===e.item.extId){KC(t.item,e.item);return}if(t.op===rw.Add&&t.item.item.extId===e.item.extId){KC(t.item,e.item);return}}break}}this.diff.push(e),this.debounceSendDiff.isScheduled()||this.debounceSendDiff.schedule()}expand(e,t){let n=this.tree.get(e);if(n){if((n.expandLevels===void 0||t>n.expandLevels)&&(n.expandLevels=t),n.expand===UC.Expandable){let e=this.resolveChildren(n);return e.isOpen()?this.expandChildren(n,t-1):e.wait().then(()=>this.expandChildren(n,t-1))}else if(n.expand===UC.Expanded)return n.resolveBarrier?.isOpen()===!1?n.resolveBarrier.wait().then(()=>this.expandChildren(n,t-1)):this.expandChildren(n,t-1)}}dispose(){for(let e of this.tree.values())this.options.getApiFor(e.actual).listener=void 0;this.tree.clear(),this.diff=[],super.dispose()}onTestItemEvent(e,t){switch(t.op){case kw.RemoveChild:this.removeItem(DC.joinToString(e.fullId,t.id));break;case kw.Upsert:this.upsertItem(t.item,e);break;case kw.Bulk:for(let n of t.ops)this.onTestItemEvent(e,n);break;case kw.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case kw.UpdateCanResolveChildren:this.updateExpandability(e);break;case kw.SetProp:this.pushDiff({op:rw.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case kw.DocumentSynced:this.documentSynced(e.actual.uri);break;default:He()}}documentSynced(e){e&&this.pushDiff({op:rw.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){let n=DC.fromExtHostTestItem(e,this.root.id,t?.actual),r=this.options.getApiFor(e);r.parent&&r.parent!==t?.actual&&this.options.getChildren(r.parent).delete(e.id);let i=this.tree.get(n.toString());if(!i){i={fullId:n,actual:e,expandLevels:t?.expandLevels?t.expandLevels-1:void 0,expand:UC.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(i.fullId.toString(),i),this.setItemParent(e,t),this.pushDiff({op:rw.Add,item:{controllerId:this.options.controllerId,expand:i.expand,item:this.options.toITestItem(e)}}),this.connectItemAndChildren(e,i,t);return}if(i.actual===e){this.connectItem(e,i,t);return}if(i.actual.uri?.toString()!==e.uri?.toString())return this.removeItem(n.toString()),this.upsertItem(e,t);let a=this.options.getChildren(i.actual),o=i.actual,s=Mw(this.options.toITestItem(o),this.options.toITestItem(e));this.options.getApiFor(o).listener=void 0,i.actual=e,i.resolveBarrier=void 0,i.expand=UC.NotExpandable,s&&(s.hasOwnProperty(`tags`)&&(this.diffTagRefs(e.tags,o.tags,n.toString()),delete s.tags),this.onTestItemEvent(i,{op:kw.SetProp,update:s})),this.connectItemAndChildren(e,i,t);for(let[t,r]of a)this.options.getChildren(e).get(r.id)||this.removeItem(DC.joinToString(n,r.id));let c=i.expandLevels;c!==void 0&&queueMicrotask(()=>{i.expand===UC.Expandable&&(i.expandLevels=void 0,this.expand(n.toString(),c))}),this.documentSynced(i.actual.uri)}diffTagRefs(e,t,n){let r=new Set(t.map(e=>e.id));for(let t of e)r.delete(t.id)||this.incrementTagRefs(t);this.pushDiff({op:rw.Update,item:{extId:n,item:{tags:e.map(e=>BC(this.options.controllerId,e.id))}}}),r.forEach(this.decrementTagRefs,this)}incrementTagRefs(e){let t=this.tags.get(e.id);t?t.refCount++:(this.tags.set(e.id,{refCount:1}),this.pushDiff({op:rw.AddTag,tag:{id:BC(this.options.controllerId,e.id)}}))}decrementTagRefs(e){let t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:rw.RemoveTag,id:BC(this.options.controllerId,e)}))}setItemParent(e,t){this.options.getApiFor(e).parent=t&&t.actual!==this.root?t.actual:void 0}connectItem(e,t,n){this.setItemParent(e,n);let r=this.options.getApiFor(e);r.parent=n?.actual,r.listener=e=>this.onTestItemEvent(t,e),this.updateExpandability(t)}connectItemAndChildren(e,t,n){this.connectItem(e,t,n);for(let[n,r]of this.options.getChildren(e))this.upsertItem(r,t)}updateExpandability(e){let t;t=this._resolveHandler?e.resolveBarrier?e.resolveBarrier.isOpen()?UC.Expanded:UC.BusyExpanding:e.actual.canResolveChildren?UC.Expandable:UC.NotExpandable:UC.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:rw.Update,item:{extId:e.fullId.toString(),expand:t}}),t===UC.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;let n=[];for(let[r,i]of this.options.getChildren(e.actual)){let r=this.expand(DC.joinToString(e.fullId,i.id),t);fo(r)&&n.push(r)}if(n.length)return Promise.all(n).then(()=>{})}resolveChildren(e){if(e.resolveBarrier)return e.resolveBarrier;if(!this._resolveHandler){let e=new To;return e.open(),e}e.expand=UC.BusyExpanding,this.pushExpandStateUpdate(e);let t=e.resolveBarrier=new To,n=e=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,e)},r;try{r=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(e){n(e)}return fo(r)?r.catch(n).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:rw.Update,item:{extId:e.fullId.toString(),expand:e.expand}})}removeItem(e){let t=this.tree.get(e);if(!t)throw Error(`attempting to remove non-existent child`);this.pushDiff({op:rw.Remove,itemId:e});let n=[t];for(;n.length;){let e=n.pop();if(e){this.options.getApiFor(e.actual).listener=void 0;for(let t of e.actual.tags)this.decrementTagRefs(t.id);this.tree.delete(e.fullId.toString());for(let[t,r]of this.options.getChildren(e.actual))n.push(this.tree.get(DC.joinToString(e.fullId,r.id)))}}}flushDiff(){let e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}},Pw=class extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}},Fw=class extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}},Iw=class extends Error{constructor(e,t,n){super(`TestItem with ID "${e}" is from controller "${t}" and cannot be added as a child of an item from controller "${n}".`)}};const Lw=(e,t,n)=>{let r=new Map;return{get size(){return r.size},forEach(e,t){for(let n of r.values())e.call(t,n,this)},[Symbol.iterator](){return r.entries()},replace(i){let a=new Map,o=new Set(r.keys()),s={op:kw.Bulk,ops:[]};for(let r of i){if(!(r instanceof n))throw new Fw(r.id);let i=t(r).controllerId;if(i!==e.controllerId)throw new Iw(r.id,i,e.controllerId);if(a.has(r.id))throw new Pw(r.id);a.set(r.id,r),o.delete(r.id),s.ops.push({op:kw.Upsert,item:r})}for(let e of o.keys())s.ops.push({op:kw.RemoveChild,id:e});e.listener?.(s),r=a},add(t){if(!(t instanceof n))throw new Fw(t.id);r.set(t.id,t),e.listener?.({op:kw.Upsert,item:t})},delete(t){r.delete(t)&&e.listener?.({op:kw.RemoveChild,id:t})},get(e){return r.get(e)},toJSON(){return Array.from(r.values())}}},Rw=new WeakMap,zw=(e,t)=>{let n={controllerId:t};return Rw.set(e,n),n},Bw=e=>{let t=Rw.get(e);if(!t)throw new Fw(e?.id||`<unknown>`);return t};var Vw;(function(e){e[e.ACTIVATE=1]=`ACTIVATE`,e[e.RESTORE=2]=`RESTORE`,e[e.PRESERVE=3]=`PRESERVE`})(Vw||={});var Hw;(function(e){e[e.PICK=0]=`PICK`,e[e.EXCLUSIVE_ONLY=1]=`EXCLUSIVE_ONLY`})(Hw||={});var Uw;(function(e){e[e.API=0]=`API`,e[e.USER=1]=`USER`})(Uw||={});var Ww;(function(e){e[e.Center=0]=`Center`,e[e.CenterIfOutsideViewport=1]=`CenterIfOutsideViewport`,e[e.NearTop=2]=`NearTop`,e[e.NearTopIfOutsideViewport=3]=`NearTopIfOutsideViewport`})(Ww||={});var Gw;(function(e){e.PROGRAMMATIC=`api`,e.NAVIGATION=`code.navigation`,e.JUMP=`code.jump`})(Gw||={});var Kw;(function(e){e[e.WebSocket=0]=`WebSocket`,e[e.Managed=1]=`Managed`})(Kw||={});var qw=class{constructor(e){this.id=e,this.type=Kw.Managed}toString(){return`Managed(${this.id})`}},Jw=class{constructor(e,t){this.host=e,this.port=t,this.type=Kw.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}},Yw;(function(e){e.Unknown=`Unknown`,e.NotAvailable=`NotAvailable`,e.TemporarilyNotAvailable=`TemporarilyNotAvailable`,e.NoResolverFound=`NoResolverFound`,e.InvalidAuthority=`InvalidAuthority`})(Yw||={});function Xw(e){let t=e.indexOf(`+`);return t===-1?e:e.substring(0,t)}function q(e){return Object.assign(e,{apply:function(...t){if(t.length===0)return Reflect.construct(e,[]);{let n=t.length===1?[]:t[1];return Reflect.construct(e,n,t[0].constructor)}},call:function(...t){if(t.length===0)return Reflect.construct(e,[]);{let[n,...r]=t;return Reflect.construct(e,r,n.constructor)}}})}var Zw;let Qw=Zw=class{#e;static isMarkdownString(e){return e instanceof Zw?!0:!e||typeof e!=`object`?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,t=!1){this.#e=new _l(e,{supportThemeIcons:t})}get value(){return this.#e.value}set value(e){this.#e.value=e}get isTrusted(){return this.#e.isTrusted}set isTrusted(e){this.#e.isTrusted=e}get supportThemeIcons(){return this.#e.supportThemeIcons}set supportThemeIcons(e){this.#e.supportThemeIcons=e}get supportHtml(){return this.#e.supportHtml}set supportHtml(e){this.#e.supportHtml=e}get supportAlertSyntax(){return this.#e.supportAlertSyntax}set supportAlertSyntax(e){this.#e.supportAlertSyntax=e}get baseUri(){return this.#e.baseUri}set baseUri(e){this.#e.baseUri=e}appendText(e){return this.#e.appendText(e),this}appendMarkdown(e){return this.#e.appendMarkdown(e),this}appendCodeblock(e,t){return this.#e.appendCodeblock(t??``,e),this}};Qw=Zw=A([q],Qw);var $w;let eT=$w=class{static Min(...e){if(e.length===0)throw TypeError();let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];r.isBefore(t)&&(t=r)}return t}static Max(...e){if(e.length===0)throw TypeError();let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];r.isAfter(t)&&(t=r)}return t}static isPosition(e){if(!e)return!1;if(e instanceof $w)return!0;let{line:t,character:n}=e;return typeof t==`number`&&typeof n==`number`}static of(e){if(e instanceof $w)return e;if(this.isPosition(e))return new $w(e.line,e.character);throw Error(`Invalid argument, is NOT a position-like object`)}get line(){return this._line}get character(){return this._character}constructor(e,t){if(e<0)throw h(`line must be non-negative`);if(t<0)throw h(`character must be non-negative`);this._line=e,this._character=t}isBefore(e){return this._line<e._line?!0:e._line<this._line?!1:this._character<e._character}isBeforeOrEqual(e){return this._line<e._line?!0:e._line<this._line?!1:this._character<=e._character}isAfter(e){return!this.isBeforeOrEqual(e)}isAfterOrEqual(e){return!this.isBefore(e)}isEqual(e){return this._line===e._line&&this._character===e._character}compareTo(e){return this._line<e._line?-1:this._line>e.line?1:this._character<e._character?-1:+(this._character>e._character)}translate(e,t=0){if(e===null||t===null)throw h();let n;return e===void 0?n=0:typeof e==`number`?n=e:(n=typeof e.lineDelta==`number`?e.lineDelta:0,t=typeof e.characterDelta==`number`?e.characterDelta:0),n===0&&t===0?this:new $w(this.line+n,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw h();let n;return e===void 0?n=this.line:typeof e==`number`?n=e:(n=typeof e.line==`number`?e.line:this.line,t=typeof e.character==`number`?e.character:this.character),n===this.line&&t===this.character?this:new $w(n,t)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for(`debug.description`)](){return`(${this.line}:${this.character})`}};eT=$w=A([q],eT);var tT;let nT=tT=class{static isRange(e){return e instanceof tT?!0:!e||typeof e!=`object`?!1:eT.isPosition(e.start)&&eT.isPosition(e.end)}static of(e){if(e instanceof tT)return e;if(this.isRange(e))return new tT(e.start,e.end);throw Error(`Invalid argument, is NOT a range-like object`)}get start(){return this._start}get end(){return this._end}constructor(e,t,n,r){let i,a;if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`&&typeof r==`number`?(i=new eT(e,t),a=new eT(n,r)):eT.isPosition(e)&&eT.isPosition(t)&&(i=eT.of(e),a=eT.of(t)),!i||!a)throw Error(`Invalid arguments`);i.isBefore(a)?(this._start=i,this._end=a):(this._start=a,this._end=i)}contains(e){return tT.isRange(e)?this.contains(e.start)&&this.contains(e.end):eT.isPosition(e)?!(eT.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){let t=eT.Max(e.start,this._start),n=eT.Min(e.end,this._end);if(!t.isAfter(n))return new tT(t,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let t=eT.Min(e.start,this._start),n=eT.Max(e.end,this.end);return new tT(t,n)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,t=this.end){if(e===null||t===null)throw h();let n;return e?eT.isPosition(e)?n=e:(n=e.start||this.start,t=e.end||this.end):n=this.start,n.isEqual(this._start)&&t.isEqual(this.end)?this:new tT(n,t)}toJSON(){return[this.start,this.end]}[Symbol.for(`debug.description`)](){return rT(this)}};nT=tT=A([q],nT);function rT(e){return e.isEmpty?`[${e.start.line}:${e.start.character})`:`[${e.start.line}:${e.start.character} -> ${e.end.line}:${e.end.character})`}var iT;let aT=class{static{iT=this}static{this.sep=`.`}constructor(e){this.value=e}append(e){return new iT(this.value?this.value+iT.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+iT.sep)}};aT=iT=A([q],aT),aT.Empty=new aT(``),aT.QuickFix=aT.Empty.append(`quickfix`),aT.Refactor=aT.Empty.append(`refactor`),aT.RefactorExtract=aT.Refactor.append(`extract`),aT.RefactorInline=aT.Refactor.append(`inline`),aT.RefactorMove=aT.Refactor.append(`move`),aT.RefactorRewrite=aT.Refactor.append(`rewrite`),aT.Source=aT.Empty.append(`source`),aT.SourceOrganizeImports=aT.Source.append(`organizeImports`),aT.SourceFixAll=aT.Source.append(`fixAll`),aT.Notebook=aT.Empty.append(`notebook`);var oT;(function(e){e[e.Unnecessary=1]=`Unnecessary`,e[e.Deprecated=2]=`Deprecated`})(oT||={});var sT;(function(e){e[e.Hint=3]=`Hint`,e[e.Information=2]=`Information`,e[e.Warning=1]=`Warning`,e[e.Error=0]=`Error`})(sT||={});let cT=class{static is(e){return e?typeof e.message==`string`&&e.location&&nT.isRange(e.location.range)&&w.isUri(e.location.uri):!1}constructor(e,t){this.location=e,this.message=t}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.location.range.isEqual(t.location.range)&&e.location.uri.toString()===t.location.uri.toString()}};cT=A([q],cT);let lT=class{constructor(e,t,n=sT.Error){if(!nT.isRange(e))throw TypeError(`range must be set`);if(!t)throw TypeError(`message must be set`);this.range=e,this.message=t,this.severity=n}toJSON(){return{severity:sT[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.severity===t.severity&&e.code===t.code&&e.severity===t.severity&&e.source===t.source&&e.range.isEqual(t.range)&&se(e.tags,t.tags)&&se(e.relatedInformation,t.relatedInformation,cT.isEqual)}};lT=A([q],lT);var uT;let dT=uT=class{static isLocation(e){return e instanceof uT?!0:e?nT.isRange(e.range)&&w.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(nT.isRange(t))this.range=nT.of(t);else if(eT.isPosition(t))this.range=new nT(t,t);else throw Error(`Illegal argument`)}toJSON(){return{uri:this.uri,range:this.range}}};dT=uT=A([q],dT);var fT,pT;(function(e){e[e.Markup=1]=`Markup`,e[e.Code=2]=`Code`})(pT||={});var mT=class e{static isNotebookRange(t){return t instanceof e?!0:t?typeof t.start==`number`&&typeof t.end==`number`:!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,t){if(e<0)throw h(`start must be positive`);if(t<0)throw h(`end must be positive`);e<=t?(this._start=e,this._end=t):(this._start=t,this._end=e)}with(t){let n=this._start,r=this._end;return t.start!==void 0&&(n=t.start),t.end!==void 0&&(r=t.end),n===this._start&&r===this._end?this:new e(n,r)}},hT=class e{static validate(e){if(typeof e.kind!=`number`)throw Error(`NotebookCellData MUST have 'kind' property`);if(typeof e.value!=`string`)throw Error(`NotebookCellData MUST have 'value' property`);if(typeof e.languageId!=`string`)throw Error(`NotebookCellData MUST have 'languageId' property`)}static isNotebookCellDataArray(t){return Array.isArray(t)&&t.every(t=>e.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(t,n,r,i,a,o,s){this.kind=t,this.value=n,this.languageId=r,this.mime=i,this.outputs=a??[],this.metadata=o,this.executionSummary=s,e.validate(this)}},gT=class{constructor(e){this.cells=e}};let _T=fT=class{static isNotebookCellEdit(e){return e instanceof fT?!0:e?mT.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new fT(e,t)}static insertCells(e,t){return new fT(new mT(e,e),t)}static deleteCells(e){return new fT(e,[])}static updateCellMetadata(e,t){let n=new fT(new mT(e,e),[]);return n.newCellMetadata=t,n}static updateNotebookMetadata(e){let t=new fT(new mT(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};_T=fT=A([q],_T);var vT=class e{static isNotebookCellOutputItem(t){return t instanceof e?!0:t?typeof t.mime==`string`&&t.data instanceof Uint8Array:!1}static error(t){let n={name:t.name,message:t.message,stack:t.stack};return e.json(n,`application/vnd.code.notebook.error`)}static stdout(t){return e.text(t,`application/vnd.code.notebook.stdout`)}static stderr(t){return e.text(t,`application/vnd.code.notebook.stderr`)}static bytes(t,n=`application/octet-stream`){return new e(t,n)}static#e=new TextEncoder;static text(t,n=Uu.text){return new e(e.#e.encode(String(t)),n)}static json(t,n=`text/x-json`){let r=JSON.stringify(t,void 0,` `);return e.text(r,n)}constructor(e,t){this.data=e,this.mime=t;let n=Gu(t,!0);if(!n)throw Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}},yT=class e{static isNotebookCellOutput(t){return t instanceof e?!0:!t||typeof t!=`object`?!1:typeof t.id==`string`&&Array.isArray(t.items)}static ensureUniqueMimeTypes(e,t=!1){let n=new Set,r=new Set;for(let i=0;i<e.length;i++){let a=e[i],o=Gu(a.mime);if(!n.has(o)||Ku(o)){n.add(o);continue}r.add(i),t&&console.warn(`DUPLICATED mime type '${a.mime}' will be dropped`)}return r.size===0?e:e.filter((e,t)=>!r.has(t))}constructor(t,n,r){this.items=e.ensureUniqueMimeTypes(t,!0),typeof n==`string`?(this.id=n,this.metadata=r):(this.id=zc(),this.metadata=n??r)}},bT;let xT=bT=class extends nT{static isSelection(e){return e instanceof bT?!0:!e||typeof e!=`object`?!1:nT.isRange(e)&&eT.isPosition(e.anchor)&&eT.isPosition(e.active)&&typeof e.isReversed==`boolean`}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,n,r){let i,a;if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`&&typeof r==`number`?(i=new eT(e,t),a=new eT(n,r)):eT.isPosition(e)&&eT.isPosition(t)&&(i=eT.of(e),a=eT.of(t)),!i||!a)throw Error(`Invalid arguments`);super(i,a),this._anchor=i,this._active=a}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for(`debug.description`)](){return ST(this)}};xT=bT=A([q],xT);function ST(e){let t=rT(e);return e.isEmpty||(t=e.active.isEqual(e.start)?`|${t}`:`${t}|`),t}var CT;let wT=CT=class{static isSnippetString(e){return e instanceof CT?!0:!e||typeof e!=`object`?!1:typeof e.value==`string`}static _escape(e){return e.replace(/\$|}|\\/g,`\\$&`)}constructor(e){this._tabstop=1,this.value=e||``}appendText(e){return this.value+=CT._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+=`$`,this.value+=e,this}appendPlaceholder(e,t=this._tabstop++){if(typeof e==`function`){let t=new CT;t._tabstop=this._tabstop,e(t),this._tabstop=t._tabstop,e=t.value}else e=CT._escape(e);return this.value+="${",this.value+=t,this.value+=`:`,this.value+=e,this.value+=`}`,this}appendChoice(e,t=this._tabstop++){let n=e.map(e=>e.replaceAll(/[|\\,]/g,`\\$&`)).join(`,`);return this.value+="${",this.value+=t,this.value+=`|`,this.value+=n,this.value+=`|}`,this}appendVariable(e,t){if(typeof t==`function`){let e=new CT;e._tabstop=this._tabstop,t(e),this._tabstop=e._tabstop,t=e.value}else typeof t==`string`&&(t=t.replace(/\$|}/g,`\\$&`));return this.value+="${",this.value+=e,t&&(this.value+=`:`,this.value+=t),this.value+=`}`,this}};wT=CT=A([q],wT);var TT,ET;(function(e){e[e.File=0]=`File`,e[e.Module=1]=`Module`,e[e.Namespace=2]=`Namespace`,e[e.Package=3]=`Package`,e[e.Class=4]=`Class`,e[e.Method=5]=`Method`,e[e.Property=6]=`Property`,e[e.Field=7]=`Field`,e[e.Constructor=8]=`Constructor`,e[e.Enum=9]=`Enum`,e[e.Interface=10]=`Interface`,e[e.Function=11]=`Function`,e[e.Variable=12]=`Variable`,e[e.Constant=13]=`Constant`,e[e.String=14]=`String`,e[e.Number=15]=`Number`,e[e.Boolean=16]=`Boolean`,e[e.Array=17]=`Array`,e[e.Object=18]=`Object`,e[e.Key=19]=`Key`,e[e.Null=20]=`Null`,e[e.EnumMember=21]=`EnumMember`,e[e.Struct=22]=`Struct`,e[e.Event=23]=`Event`,e[e.Operator=24]=`Operator`,e[e.TypeParameter=25]=`TypeParameter`})(ET||={});var DT;(function(e){e[e.Deprecated=1]=`Deprecated`})(DT||={});let OT=TT=class{static validate(e){if(!e.name)throw Error(`name must not be falsy`)}constructor(e,t,n,r,i){this.name=e,this.kind=t,this.containerName=i,typeof n==`string`&&(this.containerName=n),r instanceof dT?this.location=r:n instanceof nT&&(this.location=new dT(r,n)),TT.validate(this)}toJSON(){return{name:this.name,kind:ET[this.kind],location:this.location,containerName:this.containerName}}};OT=TT=A([q],OT);var kT,AT;(function(e){e[e.LF=1]=`LF`,e[e.CRLF=2]=`CRLF`})(AT||={});let jT=kT=class{static isTextEdit(e){return e instanceof kT?!0:!e||typeof e!=`object`?!1:nT.isRange(e)&&typeof e.newText==`string`}static replace(e,t){return new kT(e,t)}static insert(e,t){return kT.replace(new nT(e,e),t)}static delete(e){return kT.replace(e,``)}static setEndOfLine(e){let t=new kT(new nT(new eT(0,0),new eT(0,0)),``);return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!nT.isRange(e))throw h(`range`);this._range=e}get newText(){return this._newText||``}set newText(e){if(e&&typeof e!=`string`)throw h(`newText`);this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!=`number`)throw h(`newEol`);this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};jT=kT=A([q],jT);var MT=class e{static isSnippetTextEdit(t){return t instanceof e?!0:t?nT.isRange(t.range)&&wT.isSnippetString(t.snippet):!1}static replace(t,n){return new e(t,n)}static insert(t,n){return e.replace(new nT(t,t),n)}constructor(e,t){this.range=e,this.snippet=t}},NT;(function(e){e[e.File=1]=`File`,e[e.Text=2]=`Text`,e[e.Cell=3]=`Cell`,e[e.CellReplace=5]=`CellReplace`,e[e.Snippet=6]=`Snippet`})(NT||={});let PT=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,n,r){this._edits.push({_type:NT.File,from:e,to:t,options:n,metadata:r})}createFile(e,t,n){this._edits.push({_type:NT.File,from:void 0,to:e,options:t,metadata:n})}deleteFile(e,t,n){this._edits.push({_type:NT.File,from:e,to:void 0,options:t,metadata:n})}replaceNotebookMetadata(e,t,n){this._edits.push({_type:NT.Cell,metadata:n,uri:e,edit:{editType:sC.DocumentMetadata,metadata:t}})}replaceNotebookCells(e,t,n,r){let i=t.start,a=t.end;(i!==a||n.length>0)&&this._edits.push({_type:NT.CellReplace,uri:e,index:i,count:a-i,cells:n,metadata:r})}replaceNotebookCellMetadata(e,t,n,r){this._edits.push({_type:NT.Cell,metadata:r,uri:e,edit:{editType:sC.Metadata,index:t,metadata:n}})}replace(e,t,n,r){this._edits.push({_type:NT.Text,uri:e,edit:new jT(t,n),metadata:r})}insert(e,t,n,r){this.replace(e,new nT(t,t),n,r)}delete(e,t,n){this.replace(e,t,``,n)}has(e){return this._edits.some(t=>t._type===NT.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(let n of t){if(!n)continue;let t,r;Array.isArray(n)?(t=n[0],r=n[1]):t=n,_T.isNotebookCellEdit(t)?t.newCellMetadata?this.replaceNotebookCellMetadata(e,t.range.start,t.newCellMetadata,r):t.newNotebookMetadata?this.replaceNotebookMetadata(e,t.newNotebookMetadata,r):this.replaceNotebookCells(e,t.range,t.newCells,r):MT.isSnippetTextEdit(t)?this._edits.push({_type:NT.Snippet,uri:e,range:t.range,edit:t.snippet,metadata:r,keepWhitespace:t.keepWhitespace}):this._edits.push({_type:NT.Text,uri:e,edit:t,metadata:r})}else{for(let t=0;t<this._edits.length;t++){let n=this._edits[t];switch(n._type){case NT.Text:case NT.Snippet:case NT.Cell:case NT.CellReplace:n.uri.toString()===e.toString()&&(this._edits[t]=void 0);break}}me(this._edits)}}get(e){let t=[];for(let n of this._edits)n._type===NT.Text&&n.uri.toString()===e.toString()&&t.push(n.edit);return t}entries(){let e=new Ne;for(let t of this._edits)if(t._type===NT.Text){let n=e.get(t.uri);n||(n=[t.uri,[]],e.set(t.uri,n)),n[1].push(t.edit)}return[...e.values()]}get size(){return this.entries().length}toJSON(){return this.entries()}};PT=A([q],PT);var FT,IT,LT,RT,zT,BT,VT,HT;(function(e){e[e.Top=0]=`Top`,e[e.Bottom=1]=`Bottom`})(HT||={});var UT;(function(e){e[e.TerminalCommand=0]=`TerminalCommand`,e[e.Opener=1]=`Opener`,e[e.Command=3]=`Command`})(UT||={});let WT=FT=class{static from(...e){let t=e;return new FT(function(){if(t){for(let e of t)e&&typeof e.dispose==`function`&&e.dispose();t=void 0}})}#e;constructor(e){this.#e=e}dispose(){typeof this.#e==`function`&&(this.#e(),this.#e=void 0)}};WT=FT=A([q],WT);const GT=e=>{if(typeof e!=`string`||e.length===0||!/^[0-9A-Za-z_\-]+$/.test(e))throw h(`connectionToken`)};var KT=class{static isResolvedAuthority(e){return e&&typeof e==`object`&&typeof e.host==`string`&&typeof e.port==`number`&&(e.connectionToken===void 0||typeof e.connectionToken==`string`)}constructor(e,t,n){if(typeof e!=`string`||e.length===0)throw h(`host`);if(typeof t!=`number`||t===0||Math.round(t)!==t)throw h(`port`);n!==void 0&&GT(n),this.host=e,this.port=Math.round(t),this.connectionToken=n}},qT=class{static isManagedResolvedAuthority(e){return e&&typeof e==`object`&&typeof e.makeConnection==`function`&&(e.connectionToken===void 0||typeof e.connectionToken==`string`)}constructor(e,t){this.makeConnection=e,this.connectionToken=t,t!==void 0&&GT(t)}},JT=class e extends Error{static NotAvailable(t,n){return new e(t,Yw.NotAvailable,n)}static TemporarilyNotAvailable(t){return new e(t,Yw.TemporarilyNotAvailable)}constructor(t,n=Yw.Unknown,r){super(t),this._message=t,this._code=n,this._detail=r,Object.setPrototypeOf(this,e.prototype)}},YT;(function(e){e[e.Replace=1]=`Replace`,e[e.Append=2]=`Append`,e[e.Prepend=3]=`Prepend`})(YT||={});let XT=class{constructor(e,t){if(!e)throw Error(`Illegal argument, contents must be defined`);Array.isArray(e)?this.contents=e:this.contents=[e],this.range=t}};XT=A([q],XT);let ZT=class extends XT{constructor(e,t,n,r){super(e,t),this.canIncreaseVerbosity=n,this.canDecreaseVerbosity=r}};ZT=A([q],ZT);var QT;(function(e){e[e.Increase=0]=`Increase`,e[e.Decrease=1]=`Decrease`})(QT||={});var $T;(function(e){e[e.Text=0]=`Text`,e[e.Read=1]=`Read`,e[e.Write=2]=`Write`})($T||={});let eE=class{constructor(e,t=$T.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:$T[this.kind]}}};eE=A([q],eE);let tE=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};tE=A([q],tE);let nE=IT=class{static validate(e){if(!e.name)throw Error(`name must not be falsy`);if(!e.range.contains(e.selectionRange))throw Error(`selectionRange must be contained in fullRange`);e.children?.forEach(IT.validate)}constructor(e,t,n,r,i){this.name=e,this.detail=t,this.kind=n,this.range=r,this.selectionRange=i,this.children=[],IT.validate(this)}};nE=IT=A([q],nE);var rE;(function(e){e[e.Invoke=1]=`Invoke`,e[e.Automatic=2]=`Automatic`})(rE||={});let iE=class{constructor(e,t){this.title=e,this.kind=t}};iE=A([q],iE);let aE=class{constructor(e,t){if(this.range=e,this.parent=t,t&&!t.range.contains(this.range))throw Error(`Invalid argument: parent must contain this range`)}};aE=A([q],aE);var oE=class{constructor(e,t,n,r,i,a){this.kind=e,this.name=t,this.detail=n,this.uri=r,this.range=i,this.selectionRange=a}},sE=class{constructor(e,t){this.fromRanges=t,this.from=e}},cE=class{constructor(e,t){this.fromRanges=t,this.to=e}},lE;(function(e){e[e.Information=0]=`Information`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(lE||={});let uE=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};uE=A([q],uE);let dE=class{constructor(e,t){this.label=e,this.documentation=t}};dE=A([q],dE);let fE=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};fE=A([q],fE);let pE=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};pE=A([q],pE);var mE;(function(e){e[e.Invoke=1]=`Invoke`,e[e.TriggerCharacter=2]=`TriggerCharacter`,e[e.ContentChange=3]=`ContentChange`})(mE||={});var hE;(function(e){e[e.Type=1]=`Type`,e[e.Parameter=2]=`Parameter`})(hE||={});let gE=class{constructor(e){this.value=e}};gE=A([q],gE);let _E=class{constructor(e,t,n){this.position=e,this.label=t,this.kind=n}};_E=A([q],_E);var vE;(function(e){e[e.Invoke=0]=`Invoke`,e[e.TriggerCharacter=1]=`TriggerCharacter`,e[e.TriggerForIncompleteCompletions=2]=`TriggerForIncompleteCompletions`})(vE||={});var yE;(function(e){e[e.Text=0]=`Text`,e[e.Method=1]=`Method`,e[e.Function=2]=`Function`,e[e.Constructor=3]=`Constructor`,e[e.Field=4]=`Field`,e[e.Variable=5]=`Variable`,e[e.Class=6]=`Class`,e[e.Interface=7]=`Interface`,e[e.Module=8]=`Module`,e[e.Property=9]=`Property`,e[e.Unit=10]=`Unit`,e[e.Value=11]=`Value`,e[e.Enum=12]=`Enum`,e[e.Keyword=13]=`Keyword`,e[e.Snippet=14]=`Snippet`,e[e.Color=15]=`Color`,e[e.File=16]=`File`,e[e.Reference=17]=`Reference`,e[e.Folder=18]=`Folder`,e[e.EnumMember=19]=`EnumMember`,e[e.Constant=20]=`Constant`,e[e.Struct=21]=`Struct`,e[e.Event=22]=`Event`,e[e.Operator=23]=`Operator`,e[e.TypeParameter=24]=`TypeParameter`,e[e.User=25]=`User`,e[e.Issue=26]=`Issue`})(yE||={});var bE;(function(e){e[e.Deprecated=1]=`Deprecated`})(bE||={});let xE=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&yE[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};xE=A([q],xE);let SE=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};SE=A([q],SE);let CE=class{constructor(e,t,n){this.insertText=e,this.range=t,this.command=n}};CE=A([q],CE);let wE=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};wE=A([q],wE);var TE;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Word=1]=`Word`,e[e.Line=2]=`Line`,e[e.Suggest=3]=`Suggest`})(TE||={});var EE;(function(e){e[e.Accepted=0]=`Accepted`,e[e.Rejected=1]=`Rejected`,e[e.Ignored=2]=`Ignored`})(EE||={});var DE;(function(e){e[e.Code=1]=`Code`,e[e.Label=2]=`Label`})(DE||={});var OE;(function(e){e[e.Active=-1]=`Active`,e[e.Beside=-2]=`Beside`,e[e.One=1]=`One`,e[e.Two=2]=`Two`,e[e.Three=3]=`Three`,e[e.Four=4]=`Four`,e[e.Five=5]=`Five`,e[e.Six=6]=`Six`,e[e.Seven=7]=`Seven`,e[e.Eight=8]=`Eight`,e[e.Nine=9]=`Nine`})(OE||={});var kE;(function(e){e[e.Left=1]=`Left`,e[e.Right=2]=`Right`})(kE||={});function AE(e,t){return`${ys.toKey(e)}.${t}`}var jE;(function(e){e[e.Off=0]=`Off`,e[e.On=1]=`On`,e[e.Relative=2]=`Relative`,e[e.Interval=3]=`Interval`})(jE||={});var ME;(function(e){e[e.Manual=1]=`Manual`,e[e.AfterDelay=2]=`AfterDelay`,e[e.FocusOut=3]=`FocusOut`})(ME||={});var NE;(function(e){e[e.Default=0]=`Default`,e[e.InCenter=1]=`InCenter`,e[e.InCenterIfOutsideViewport=2]=`InCenterIfOutsideViewport`,e[e.AtTop=3]=`AtTop`})(NE||={});var PE;(function(e){e[e.Keyboard=1]=`Keyboard`,e[e.Mouse=2]=`Mouse`,e[e.Command=3]=`Command`})(PE||={});var FE;(function(e){e[e.Addition=1]=`Addition`,e[e.Deletion=2]=`Deletion`,e[e.Modification=3]=`Modification`})(FE||={});var IE;(function(e){e[e.Undo=1]=`Undo`,e[e.Redo=2]=`Redo`})(IE||={});var LE;(function(e){e[e.OpenOpen=0]=`OpenOpen`,e[e.ClosedClosed=1]=`ClosedClosed`,e[e.OpenClosed=2]=`OpenClosed`,e[e.ClosedOpen=3]=`ClosedOpen`})(LE||={}),(function(e){function t(t){switch(t){case`keyboard`:return e.Keyboard;case`mouse`:return e.Mouse;case Gw.PROGRAMMATIC:case Gw.JUMP:case Gw.NAVIGATION:return e.Command}}e.fromValue=t})(PE||={});var RE;(function(e){e[e.Other=0]=`Other`,e[e.Comment=1]=`Comment`,e[e.String=2]=`String`,e[e.RegEx=3]=`RegEx`})(RE||={}),(function(e){function t(t){switch(t){case e.Other:return`other`;case e.Comment:return`comment`;case e.String:return`string`;case e.RegEx:return`regex`}return`other`}e.toString=t})(RE||={});let zE=class{constructor(e,t){if(t&&!w.isUri(t))throw h(`target`);if(!nT.isRange(e)||e.isEmpty)throw h(`range`);this.range=e,this.target=t}};zE=A([q],zE);let BE=class{constructor(e,t,n,r){this.red=e,this.green=t,this.blue=n,this.alpha=r}};BE=A([q],BE);let VE=class{constructor(e,t){if(t&&!(t instanceof BE))throw h(`color`);if(!nT.isRange(e)||e.isEmpty)throw h(`range`);this.range=e,this.color=t}};VE=A([q],VE);let HE=class{constructor(e){if(!e||typeof e!=`string`)throw h(`label`);this.label=e}};HE=A([q],HE);var UE;(function(e){e[e.RGB=0]=`RGB`,e[e.HEX=1]=`HEX`,e[e.HSL=2]=`HSL`})(UE||={});var WE;(function(e){e[e.Error=0]=`Error`,e[e.Warning=1]=`Warning`,e[e.Information=2]=`Information`})(WE||={});var GE;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Shutdown=1]=`Shutdown`,e[e.Process=2]=`Process`,e[e.User=3]=`User`,e[e.Extension=4]=`Extension`})(GE||={});var KE;(function(e){e[e.Low=0]=`Low`,e[e.Medium=1]=`Medium`,e[e.High=2]=`High`})(KE||={});var qE;(function(e){e[e.Sh=1]=`Sh`,e[e.Bash=2]=`Bash`,e[e.Fish=3]=`Fish`,e[e.Csh=4]=`Csh`,e[e.Ksh=5]=`Ksh`,e[e.Zsh=6]=`Zsh`,e[e.CommandPrompt=7]=`CommandPrompt`,e[e.GitBash=8]=`GitBash`,e[e.PowerShell=9]=`PowerShell`,e[e.Python=10]=`Python`,e[e.Julia=11]=`Julia`,e[e.NuShell=12]=`NuShell`,e[e.Node=13]=`Node`,e[e.Xonsh=14]=`Xonsh`})(qE||={});var JE=class{constructor(e,t,n){if(this.startIndex=e,this.length=t,this.tooltip=n,typeof e!=`number`||e<0)throw h(`startIndex`);if(typeof t!=`number`||t<1)throw h(`length`);if(n!==void 0&&typeof n!=`string`)throw h(`tooltip`)}},YE=class{constructor(e){this.uri=e}},XE=class{constructor(e){this.terminalCommand=e}},ZE;(function(e){e[e.Panel=1]=`Panel`,e[e.Editor=2]=`Editor`})(ZE||={});var QE=class{constructor(e){if(this.options=e,typeof e!=`object`)throw h(`options`)}},$E;(function(e){e[e.File=0]=`File`,e[e.Folder=1]=`Folder`,e[e.Method=2]=`Method`,e[e.Alias=3]=`Alias`,e[e.Argument=4]=`Argument`,e[e.Option=5]=`Option`,e[e.OptionValue=6]=`OptionValue`,e[e.Flag=7]=`Flag`,e[e.SymbolicLinkFile=8]=`SymbolicLinkFile`,e[e.SymbolicLinkFolder=9]=`SymbolicLinkFolder`,e[e.ScmCommit=10]=`ScmCommit`,e[e.ScmBranch=11]=`ScmBranch`,e[e.ScmTag=12]=`ScmTag`,e[e.ScmStash=13]=`ScmStash`,e[e.ScmRemote=14]=`ScmRemote`,e[e.PullRequest=15]=`PullRequest`,e[e.PullRequestDone=16]=`PullRequestDone`})($E||={});var eD=class{constructor(e,t,n,r,i,a,o,s){this.label=e,this.replacementRange=t,this.kind=n,this.detail=r,this.documentation=i,this.isFile=a,this.isDirectory=o,this.isKeyword=s}},tD=class{constructor(e,t){this.items=e??[],this.resourceOptions=t}},nD;(function(e){e[e.Always=1]=`Always`,e[e.Silent=2]=`Silent`,e[e.Never=3]=`Never`})(nD||={});var rD;(function(e){e.Changed=`changed`,e.ProcessStarted=`processStarted`,e.ProcessEnded=`processEnded`,e.Terminated=`terminated`,e.Start=`start`,e.AcquiredInput=`acquiredInput`,e.DependsOnStarted=`dependsOnStarted`,e.Active=`active`,e.Inactive=`inactive`,e.End=`end`,e.ProblemMatcherStarted=`problemMatcherStarted`,e.ProblemMatcherEnded=`problemMatcherEnded`,e.ProblemMatcherFoundErrors=`problemMatcherFoundErrors`})(rD||={});var iD;(function(e){e[e.Shared=1]=`Shared`,e[e.Dedicated=2]=`Dedicated`,e[e.New=3]=`New`})(iD||={});let aD=class{static{LT=this}static{this.Clean=new LT(`clean`,`Clean`)}static{this.Build=new LT(`build`,`Build`)}static{this.Rebuild=new LT(`rebuild`,`Rebuild`)}static{this.Test=new LT(`test`,`Test`)}static from(e){switch(e){case`clean`:return LT.Clean;case`build`:return LT.Build;case`rebuild`:return LT.Rebuild;case`test`:return LT.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!=`string`||typeof t!=`string`)throw h(`name`);this._id=e}get id(){return this._id}};aD=LT=A([q],aD);function oD(e){let t=``;for(let n=0;n<e.length;n++)t+=e[n].replace(/,/g,`,,`)+`,`;return t}let sD=class{constructor(e,t,n){if(typeof e!=`string`)throw h(`process`);this._args=[],this._process=e,t!==void 0&&(Array.isArray(t)?(this._args=t,this._options=n):this._options=t)}get process(){return this._process}set process(e){if(typeof e!=`string`)throw h(`process`);this._process=e}get args(){return this._args}set args(e){Array.isArray(e)||(e=[]),this._args=e}get options(){return this._options}set options(e){this._options=e}computeId(){let e=[];if(e.push(`process`),this._process!==void 0&&e.push(this._process),this._args&&this._args.length>0)for(let t of this._args)e.push(t);return oD(e)}};sD=A([q],sD);let cD=class{constructor(e,t,n){if(this._args=[],Array.isArray(t)){if(!e)throw h(`command can't be undefined or null`);if(typeof e!=`string`&&typeof e.value!=`string`)throw h(`command`);this._command=e,t&&(this._args=t),this._options=n}else{if(typeof e!=`string`)throw h(`commandLine`);this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!=`string`)throw h(`commandLine`);this._commandLine=e}get command(){return this._command?this._command:``}set command(e){if(typeof e!=`string`&&typeof e.value!=`string`)throw h(`command`);this._command=e}get args(){return this._args}set args(e){this._args=e||[]}get options(){return this._options}set options(e){this._options=e}computeId(){let e=[];if(e.push(`shell`),this._commandLine!==void 0&&e.push(this._commandLine),this._command!==void 0&&e.push(typeof this._command==`string`?this._command:this._command.value),this._args&&this._args.length>0)for(let t of this._args)e.push(typeof t==`string`?t:t.value);return oD(e)}};cD=A([q],cD);var lD;(function(e){e[e.Escape=1]=`Escape`,e[e.Strong=2]=`Strong`,e[e.Weak=3]=`Weak`})(lD||={});var uD;(function(e){e[e.Global=1]=`Global`,e[e.Workspace=2]=`Workspace`})(uD||={});var dD;(function(e){e[e.Default=1]=`Default`,e[e.FolderOpen=2]=`FolderOpen`,e[e.WorktreeCreated=3]=`WorktreeCreated`})(dD||={});var fD=class{constructor(e){this._callback=e}computeId(){return`customExecution`+zc()}set callback(e){this._callback=e}get callback(){return this._callback}};let pD=class{static{RT=this}static{this.ExtensionCallbackType=`customExecution`}static{this.ProcessType=`process`}static{this.ShellType=`shell`}static{this.EmptyType=`$empty`}constructor(e,t,n,r,i,a){this.__deprecated=!1,this._definition=this.definition=e;let o;typeof t==`string`?(this._name=this.name=t,this._source=this.source=n,this.execution=r,o=i,this.__deprecated=!0):(t===uD.Global||uD.Workspace,this.target=t,this._name=this.name=n,this._source=this.source=r,this.execution=i,o=a),typeof o==`string`?(this._problemMatchers=[o],this._hasDefinedMatchers=!0):Array.isArray(o)?(this._problemMatchers=o,this._hasDefinedMatchers=!0):(this._problemMatchers=[],this._hasDefinedMatchers=!1),this._isBackground=!1,this._presentationOptions=Object.create(null),this._runOptions=Object.create(null)}get _id(){return this.__id}set _id(e){this.__id=e}get _deprecated(){return this.__deprecated}clear(){this.__id!==void 0&&(this.__id=void 0,this._scope=void 0,this.computeDefinitionBasedOnExecution())}computeDefinitionBasedOnExecution(){this._execution instanceof sD?this._definition={type:RT.ProcessType,id:this._execution.computeId()}:this._execution instanceof cD?this._definition={type:RT.ShellType,id:this._execution.computeId()}:this._execution instanceof fD?this._definition={type:RT.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:RT.EmptyType,id:zc()}}get definition(){return this._definition}set definition(e){if(e==null)throw h(`Kind can't be undefined or null`);this.clear(),this._definition=e}get scope(){return this._scope}set target(e){this.clear(),this._scope=e}get name(){return this._name}set name(e){if(typeof e!=`string`)throw h(`name`);this.clear(),this._name=e}get execution(){return this._execution}set execution(e){e===null&&(e=void 0),this.clear(),this._execution=e;let t=this._definition.type;(RT.EmptyType===t||RT.ProcessType===t||RT.ShellType===t||RT.ExtensionCallbackType===t)&&this.computeDefinitionBasedOnExecution()}get problemMatchers(){return this._problemMatchers}set problemMatchers(e){if(Array.isArray(e))this.clear(),this._problemMatchers=e,this._hasDefinedMatchers=!0;else{this.clear(),this._problemMatchers=[],this._hasDefinedMatchers=!1;return}}get hasDefinedMatchers(){return this._hasDefinedMatchers}get isBackground(){return this._isBackground}set isBackground(e){e!==!0&&e!==!1&&(e=!1),this.clear(),this._isBackground=e}get source(){return this._source}set source(e){if(typeof e!=`string`||e.length===0)throw h(`source must be a string of length > 0`);this.clear(),this._source=e}get group(){return this._group}set group(e){e===null&&(e=void 0),this.clear(),this._group=e}get detail(){return this._detail}set detail(e){e===null&&(e=void 0),this._detail=e}get presentationOptions(){return this._presentationOptions}set presentationOptions(e){e??=Object.create(null),this.clear(),this._presentationOptions=e}get runOptions(){return this._runOptions}set runOptions(e){e??=Object.create(null),this.clear(),this._runOptions=e}};pD=RT=A([q],pD);var mD;(function(e){e[e.SourceControl=1]=`SourceControl`,e[e.Window=10]=`Window`,e[e.Notification=15]=`Notification`})(mD||={});var hD;(function(e){function t(e){let t=e;return Xe(t.value)?t.tooltip&&!Ge(t.tooltip)?(console.log(`INVALID view badge, invalid tooltip`,t.tooltip),!1):!0:(console.log(`INVALID view badge, invalid value`,t.value),!1)}e.isViewBadge=t})(hD||={});let gD=zT=class{static isTreeItem(e,t){let n=e;if(n.checkboxState!==void 0){let e=Xe(n.checkboxState)?n.checkboxState:Je(n.checkboxState)&&Xe(n.checkboxState.state)?n.checkboxState.state:void 0,t=!Xe(n.checkboxState)&&Je(n.checkboxState)?n.checkboxState.tooltip:void 0;if(e===void 0||e!==vD.Checked&&e!==vD.Unchecked||t!==void 0&&!Ge(t))return console.log(`INVALID tree item, invalid checkboxState`,n.checkboxState),!1}if(e instanceof zT)return!0;if(n.label!==void 0&&!Ge(n.label)&&!n.label?.label)return console.log(`INVALID tree item, invalid label`,n.label),!1;if(n.id!==void 0&&!Ge(n.id))return console.log(`INVALID tree item, invalid id`,n.id),!1;if(n.iconPath!==void 0&&!Ge(n.iconPath)&&!w.isUri(n.iconPath)&&(!n.iconPath||!Ge(n.iconPath.id))){let e=n.iconPath;if(!e||!Ge(e.light)&&!w.isUri(e.light)&&!Ge(e.dark)&&!w.isUri(e.dark))return console.log(`INVALID tree item, invalid iconPath`,n.iconPath),!1}return n.description!==void 0&&!Ge(n.description)&&typeof n.description!=`boolean`?(console.log(`INVALID tree item, invalid description`,n.description),!1):n.resourceUri!==void 0&&!w.isUri(n.resourceUri)?(console.log(`INVALID tree item, invalid resourceUri`,n.resourceUri),!1):n.tooltip!==void 0&&!Ge(n.tooltip)&&!(n.tooltip instanceof Qw)?(console.log(`INVALID tree item, invalid tooltip`,n.tooltip),!1):n.command!==void 0&&!n.command.command?(console.log(`INVALID tree item, invalid command`,n.command),!1):n.collapsibleState!==void 0&&n.collapsibleState<_D.None&&n.collapsibleState>_D.Expanded?(console.log(`INVALID tree item, invalid collapsibleState`,n.collapsibleState),!1):n.contextValue!==void 0&&!Ge(n.contextValue)?(console.log(`INVALID tree item, invalid contextValue`,n.contextValue),!1):n.accessibilityInformation!==void 0&&!n.accessibilityInformation?.label?(console.log(`INVALID tree item, invalid accessibilityInformation`,n.accessibilityInformation),!1):!0}constructor(e,t=_D.None){this.collapsibleState=t,w.isUri(e)?this.resourceUri=e:this.label=e}};gD=zT=A([q],gD);var _D;(function(e){e[e.None=0]=`None`,e[e.Collapsed=1]=`Collapsed`,e[e.Expanded=2]=`Expanded`})(_D||={});var vD;(function(e){e[e.Unchecked=0]=`Unchecked`,e[e.Checked=1]=`Checked`})(vD||={});let yD=class{async asString(){return typeof this.value==`string`?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};yD=A([q],yD);var bD=class extends yD{},xD=class extends bD{#e;constructor(e){super(``),this.#e=e}asFile(){return this.#e}},SD=class{constructor(e,t,n,r){this.name=e,this.uri=t,this._itemId=n,this._getData=r}data(){return this._getData()}};let CD=class{#e=new Map;constructor(e){for(let[t,n]of e??[]){let e=this.#e.get(this.#t(t));e?e.push(n):this.#e.set(this.#t(t),[n])}}get(e){return this.#e.get(this.#t(e))?.[0]}set(e,t){this.#e.set(this.#t(e),[t])}forEach(e,t){for(let[n,r]of this.#e)for(let i of r)e.call(t,i,n,this)}*[Symbol.iterator](){for(let[e,t]of this.#e)for(let n of t)yield[e,n]}#t(e){return e.toLowerCase()}};CD=A([q],CD);let wD=class{constructor(e,t,n){this.insertText=e,this.title=t,this.kind=n}};wD=A([q],wD);var TD;(function(e){e[e.Automatic=0]=`Automatic`,e[e.PasteAs=1]=`PasteAs`})(TD||={});var ED=class e{static{this.sep=`.`}constructor(e){this.value=e}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(t){return this.value===t.value||t.value.startsWith(this.value+e.sep)}};ED.Empty=new ED(``),ED.Text=new ED(`text`),ED.TextUpdateImports=ED.Text.append(`updateImports`);var DD=class{constructor(e,t,n){this.title=t,this.insertText=e,this.kind=n}};let OD=class{constructor(e,t){this.id=e,this.color=t}static isThemeIcon(e){return typeof e.id==`string`?!0:(console.log(`INVALID ThemeIcon, invalid id`,e.id),!1)}};OD=A([q],OD),OD.File=new OD(`file`),OD.Folder=new OD(`folder`);let kD=class{constructor(e){this.id=e}};kD=A([q],kD);var AD;(function(e){e[e.Global=1]=`Global`,e[e.Workspace=2]=`Workspace`,e[e.WorkspaceFolder=3]=`WorkspaceFolder`})(AD||={});let jD=class{get base(){return this._base}set base(e){this._base=e,this._baseUri=w.file(e)}get baseUri(){return this._baseUri}set baseUri(e){this._baseUri=e,this._base=e.fsPath}constructor(e,t){if(typeof e!=`string`&&(!e||!w.isUri(e)&&!w.isUri(e.uri)))throw h(`base`);if(typeof t!=`string`)throw h(`pattern`);typeof e==`string`?this.baseUri=w.file(e):w.isUri(e)?this.baseUri=e:this.baseUri=e.uri,this.pattern=t}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};jD=A([q],jD);const MD=new WeakMap;function ND(e,t){MD.set(e,t)}let PD=class{constructor(e,t,n,r,i){this.enabled=typeof e==`boolean`?e:!0,typeof t==`string`&&(this.condition=t),typeof n==`string`&&(this.hitCondition=n),typeof r==`string`&&(this.logMessage=r),typeof i==`string`&&(this.mode=i)}get id(){return this._id||=MD.get(this)??zc(),this._id}};PD=A([q],PD);let FD=class extends PD{constructor(e,t,n,r,i,a){if(super(t,n,r,i,a),e===null)throw h(`location`);this.location=e}};FD=A([q],FD);let ID=class extends PD{constructor(e,t,n,r,i,a){super(t,n,r,i,a),this.functionName=e}};ID=A([q],ID);let LD=class extends PD{constructor(e,t,n,r,i,a,o,s){if(super(r,i,a,o,s),!t)throw h(`dataId`);this.label=e,this.dataId=t,this.canPersist=n}};LD=A([q],LD);let RD=class{constructor(e,t,n){this.command=e,this.args=t||[],this.options=n}};RD=A([q],RD);let zD=class{constructor(e,t){this.port=e,this.host=t}};zD=A([q],zD);let BD=class{constructor(e){this.path=e}};BD=A([q],BD);let VD=class{constructor(e){this.implementation=e}};VD=A([q],VD);var HD=class{constructor(e,t,n){this.session=e,this.threadId=t,this.frameId=n}},UD=class{constructor(e,t){this.session=e,this.threadId=t}};let WD=class{constructor(e,t){this.range=e,this.expression=t}};WD=A([q],WD);var GD;(function(e){e[e.Invoke=0]=`Invoke`,e[e.Automatic=1]=`Automatic`})(GD||={});var KD;(function(e){e[e.Other=0]=`Other`,e[e.Empty=1]=`Empty`,e[e.TokenCancellation=2]=`TokenCancellation`,e[e.LostRace=3]=`LostRace`,e[e.NotTaken=4]=`NotTaken`})(KD||={});let qD=class{constructor(e,t){this.range=e,this.text=t}};qD=A([q],qD);let JD=class{constructor(e,t,n=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=n}};JD=A([q],JD);let YD=class{constructor(e,t){this.range=e,this.expression=t}};YD=A([q],YD);let XD=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};XD=A([q],XD);var ZD;(function(e){e[e.AIGenerated=1]=`AIGenerated`})(ZD||={});var QD;(function(e){e[e.Invoke=0]=`Invoke`,e[e.Automatic=1]=`Automatic`})(QD||={});var $D=class{constructor(e,t){this.newSymbolName=e,this.tags=t}},eO;(function(e){e[e.Changed=1]=`Changed`,e[e.Created=2]=`Created`,e[e.Deleted=3]=`Deleted`})(eO||={});let tO=BT=class extends Error{static FileExists(e){return new BT(e,hc.FileExists,BT.FileExists)}static FileNotFound(e){return new BT(e,hc.FileNotFound,BT.FileNotFound)}static FileNotADirectory(e){return new BT(e,hc.FileNotADirectory,BT.FileNotADirectory)}static FileIsADirectory(e){return new BT(e,hc.FileIsADirectory,BT.FileIsADirectory)}static NoPermissions(e){return new BT(e,hc.NoPermissions,BT.NoPermissions)}static Unavailable(e){return new BT(e,hc.Unavailable,BT.Unavailable)}constructor(e,t=hc.Unknown,n){super(w.isUri(e)?e.toString(!0):e),this.code=n?.name??`Unknown`,_c(this,t),Object.setPrototypeOf(this,BT.prototype),typeof Error.captureStackTrace==`function`&&typeof n==`function`&&Error.captureStackTrace(this,n)}};tO=BT=A([q],tO);let nO=class{constructor(e,t,n){this.start=e,this.end=t,this.kind=n}};nO=A([q],nO);var rO;(function(e){e[e.Comment=1]=`Comment`,e[e.Imports=2]=`Imports`,e[e.Region=3]=`Region`})(rO||={});var iO;(function(e){e[e.Collapsed=0]=`Collapsed`,e[e.Expanded=1]=`Expanded`})(iO||={});var aO;(function(e){e[e.Editing=0]=`Editing`,e[e.Preview=1]=`Preview`})(aO||={});var oO;(function(e){e[e.Published=0]=`Published`,e[e.Draft=1]=`Draft`})(oO||={});var sO;(function(e){e[e.Unresolved=0]=`Unresolved`,e[e.Resolved=1]=`Resolved`})(sO||={});var cO;(function(e){e[e.Current=0]=`Current`,e[e.Outdated=1]=`Outdated`})(cO||={});var lO;(function(e){e[e.Reply=1]=`Reply`,e[e.Comment=2]=`Comment`})(lO||={});var uO=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function dO(e){return e===void 0||Ke(e)}var fO=class e{constructor(e){if(this._prevLine=0,this._prevChar=0,this._dataIsSortedAndDeltaEncoded=!0,this._data=[],this._dataLen=0,this._tokenTypeStrToInt=new Map,this._tokenModifierStrToInt=new Map,this._hasLegend=!1,e){this._hasLegend=!0;for(let t=0,n=e.tokenTypes.length;t<n;t++)this._tokenTypeStrToInt.set(e.tokenTypes[t],t);for(let t=0,n=e.tokenModifiers.length;t<n;t++)this._tokenModifierStrToInt.set(e.tokenModifiers[t],t)}}push(e,t,n,r,i){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`&&typeof r==`number`&&(typeof i==`number`||i===void 0))return i===void 0&&(i=0),this._pushEncoded(e,t,n,r,i);if(nT.isRange(e)&&typeof t==`string`&&dO(n))return this._push(e,t,n);throw h()}_push(e,t,n){if(!this._hasLegend)throw Error(`Legend must be provided in constructor`);if(e.start.line!==e.end.line)throw Error("`range` cannot span multiple lines");if(!this._tokenTypeStrToInt.has(t))throw Error("`tokenType` is not in the provided legend");let r=e.start.line,i=e.start.character,a=e.end.character-e.start.character,o=this._tokenTypeStrToInt.get(t),s=0;if(n)for(let e of n){if(!this._tokenModifierStrToInt.has(e))throw Error("`tokenModifier` is not in the provided legend");let t=this._tokenModifierStrToInt.get(e);s|=1<<t>>>0}this._pushEncoded(r,i,a,o,s)}_pushEncoded(e,t,n,r,i){if(this._dataIsSortedAndDeltaEncoded&&(e<this._prevLine||e===this._prevLine&&t<this._prevChar)){this._dataIsSortedAndDeltaEncoded=!1;let e=this._data.length/5|0,t=0,n=0;for(let r=0;r<e;r++){let e=this._data[5*r],i=this._data[5*r+1];e===0?(e=t,i+=n):e+=t,this._data[5*r]=e,this._data[5*r+1]=i,t=e,n=i}}let a=e,o=t;this._dataIsSortedAndDeltaEncoded&&this._dataLen>0&&(a-=this._prevLine,a===0&&(o-=this._prevChar)),this._data[this._dataLen++]=a,this._data[this._dataLen++]=o,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}static _sortAndDeltaEncode(e){let t=[],n=e.length/5|0;for(let e=0;e<n;e++)t[e]=e;t.sort((t,n)=>{let r=e[5*t],i=e[5*n];return r===i?e[5*t+1]-e[5*n+1]:r-i});let r=new Uint32Array(e.length),i=0,a=0;for(let o=0;o<n;o++){let n=5*t[o],s=e[n+0],c=e[n+1],l=e[n+2],u=e[n+3],d=e[n+4],f=s-i,p=f===0?c-a:c,m=5*o;r[m+0]=f,r[m+1]=p,r[m+2]=l,r[m+3]=u,r[m+4]=d,i=s,a=c}return r}build(t){return this._dataIsSortedAndDeltaEncoded?new pO(new Uint32Array(this._data),t):new pO(e._sortAndDeltaEncode(this._data),t)}},pO=class{constructor(e,t){this.resultId=t,this.data=e}},mO=class{constructor(e,t,n){this.start=e,this.deleteCount=t,this.data=n}},hO=class{constructor(e,t){this.resultId=t,this.edits=e}},gO;(function(e){e[e.Separate=0]=`Separate`,e[e.MergeWithParent=1]=`MergeWithParent`})(gO||={});var _O=class{constructor(e){this.name=e}},vO;(function(e){e[e.Title=1]=`Title`,e[e.Inline=2]=`Inline`,e[e.Input=3]=`Input`})(vO||={});let yO=class{static{this.Back={iconPath:new OD(`arrow-left`)}}constructor(){}};yO=A([q],yO);var bO;(function(e){e[e.Separator=-1]=`Separator`,e[e.Default=0]=`Default`})(bO||={});var xO;(function(e){e[e.Info=1]=`Info`,e[e.Warning=2]=`Warning`,e[e.Error=3]=`Error`})(xO||={});var SO;(function(e){e[e.UI=1]=`UI`,e[e.Workspace=2]=`Workspace`})(SO||={});var CO=class{static validate(e){if(typeof e.badge==`string`){let t=ya(e.badge,0);if(t<e.badge.length&&(t+=ya(e.badge,t)),e.badge.length>t)throw Error(`The 'badge'-property must be undefined or a short character`)}else if(e.badge&&!OD.isThemeIcon(e.badge))throw Error(`The 'badge'-property is not a valid ThemeIcon`);if(!e.color&&!e.badge&&!e.tooltip)throw Error(`The decoration is empty`);return!0}constructor(e,t,n){this.badge=e,this.tooltip=t,this.color=n}};let wO=class{constructor(e){this.kind=e}};wO=A([q],wO);var TO;(function(e){e[e.Light=1]=`Light`,e[e.Dark=2]=`Dark`,e[e.HighContrast=3]=`HighContrast`,e[e.HighContrastLight=4]=`HighContrastLight`})(TO||={});var EO=class{constructor(e,t,n){this.label=e,this.uri=t,this.position=n}},DO;(function(e){e[e.Idle=1]=`Idle`,e[e.Pending=2]=`Pending`,e[e.Executing=3]=`Executing`})(DO||={});var OO;(function(e){e[e.Left=1]=`Left`,e[e.Right=2]=`Right`})(OO||={});var kO;(function(e){e[e.Default=0]=`Default`,e[e.InCenter=1]=`InCenter`,e[e.InCenterIfOutsideViewport=2]=`InCenterIfOutsideViewport`,e[e.AtTop=3]=`AtTop`})(kO||={});var AO=class{constructor(e,t){this.text=e,this.alignment=t}},jO;(function(e){e[e.Default=1]=`Default`,e[e.Preferred=2]=`Preferred`})(jO||={});var MO;(function(e){e[e.Default=1]=`Default`,e[e.Preferred=2]=`Preferred`,e[e.Hidden=-1]=`Hidden`})(MO||={});var NO=class{constructor(e,t=[]){this.uri=e,this.provides=be(t)}},PO=class{constructor(e){this.label=e}},FO;(function(e){e[e.Named=1]=`Named`,e[e.Indexed=2]=`Indexed`})(FO||={});let IO=class{constructor(e,t){this.label=e,this.timestamp=t}};IO=A([q],IO);var LO;(function(e){e[e.Production=1]=`Production`,e[e.Development=2]=`Development`,e[e.Test=3]=`Test`})(LO||={});var RO;(function(e){e[e.Node=1]=`Node`,e[e.Webworker=2]=`Webworker`})(RO||={});var zO;(function(e){e[e.Other=0]=`Other`,e[e.Comment=1]=`Comment`,e[e.String=2]=`String`,e[e.RegEx=3]=`RegEx`})(zO||={});var BO=class{constructor(e,t){this.ranges=e,this.wordPattern=t}},VO=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}},HO;(function(e){e[e.Queued=1]=`Queued`,e[e.Running=2]=`Running`,e[e.Passed=3]=`Passed`,e[e.Failed=4]=`Failed`,e[e.Skipped=5]=`Skipped`,e[e.Errored=6]=`Errored`})(HO||={});var UO;(function(e){e[e.Run=1]=`Run`,e[e.Debug=2]=`Debug`,e[e.Coverage=3]=`Coverage`})(UO||={});var WO=class{constructor(e,t,n){this.controllerId=e,this.profileId=t,this.kind=n}};let GO=class{constructor(e=void 0,t=void 0,n=void 0,r=!1,i=!0){this.include=e,this.exclude=t,this.profile=n,this.continuous=r,this.preserveFocus=i}};GO=A([q],GO);let KO=VT=class{static diff(e,t,n){let r=new VT(e);return r.expectedOutput=t,r.actualOutput=n,r}constructor(e){this.message=e}};KO=VT=A([q],KO);let qO=class{constructor(e){this.id=e}};qO=A([q],qO);var JO=class{constructor(e,t,n){this.label=e,this.uri=t,this.position=n}},YO=class{constructor(e,t){this.covered=e,this.total=t,XO(this)}};function XO(e){if(e){if(e.covered>e.total)throw Error(`The total number of covered items (${e.covered}) cannot be greater than the total (${e.total})`);if(e.total<0)throw Error(`The number of covered items (${e.total}) cannot be negative`)}}var ZO=class e{static fromDetails(t,n){let r=new YO(0,0),i=new YO(0,0),a=new YO(0,0);for(let e of n)if(`branches`in e){r.total+=1,r.covered+=+!!e.executed;for(let t of e.branches)i.total+=1,i.covered+=+!!t.executed}else a.total+=1,a.covered+=+!!e.executed;let o=new e(t,r,i.total>0?i:void 0,a.total>0?a:void 0);return o.detailedCoverage=n,o}constructor(e,t,n,r,i=[]){this.uri=e,this.statementCoverage=t,this.branchCoverage=n,this.declarationCoverage=r,this.includesTests=i}},QO=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,n=[]){this.executed=e,this.location=t,this.branches=n}},$O=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,n){this.executed=e,this.location=t,this.label=n}},ek=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,n){this.name=e,this.executed=t,this.location=n}},tk;(function(e){e[e.None=0]=`None`,e[e.Option=1]=`Option`,e[e.Default=2]=`Default`,e[e.Preferred=3]=`Preferred`})(tk||={});var nk;(function(e){e[e.Untrusted=0]=`Untrusted`,e[e.Trusted=1]=`Trusted`,e[e.Unspecified=2]=`Unspecified`})(nk||={});var rk;(function(e){e[e.Notify=1]=`Notify`,e[e.OpenBrowser=2]=`OpenBrowser`,e[e.OpenPreview=3]=`OpenPreview`,e[e.Silent=4]=`Silent`,e[e.Ignore=5]=`Ignore`,e[e.OpenBrowserOnce=6]=`OpenBrowserOnce`})(rk||={});var ik=class{constructor(e,t,n,r,i,a){this.kind=e,this.name=t,this.detail=n,this.uri=r,this.range=i,this.selectionRange=a}},ak=class{constructor(e){this.uri=e}},ok=class{constructor(e,t){this.original=e,this.modified=t}},sk=class{constructor(e,t,n,r){this.base=e,this.input1=t,this.input2=n,this.result=r}},ck=class{constructor(e,t){this.uri=e,this.viewType=t}},lk=class{constructor(e){this.viewType=e}},uk=class{constructor(e,t){this.uri=e,this.notebookType=t}},dk=class{constructor(e,t,n){this.original=e,this.modified=t,this.notebookType=n}},fk=class{constructor(){}},pk=class{constructor(e,t){this.uri=e,this.inputBoxUri=t}},mk=class{constructor(){}},hk=class{constructor(e){this.textDiffs=e}},gk;(function(e){e[e.Down=0]=`Down`,e[e.Up=1]=`Up`})(gk||={});var _k;(function(e){e[e.Action=1]=`Action`,e[e.Toolbar=2]=`Toolbar`})(_k||={});var vk;(function(e){e[e.Short=1]=`Short`,e[e.Medium=2]=`Medium`,e[e.Full=3]=`Full`})(vk||={});var yk=class{constructor(e,t,n){this.id=e,this.label=t,this.values=n}},bk;(function(e){e[e.Accepted=1]=`Accepted`,e[e.Rejected=2]=`Rejected`,e[e.Saved=3]=`Saved`})(bk||={});var xk;(function(e){e[e.Keep=1]=`Keep`,e[e.Undo=2]=`Undo`,e[e.UserModification=3]=`UserModification`})(xk||={});var Sk;(function(e){e[e.Unhelpful=0]=`Unhelpful`,e[e.Helpful=1]=`Helpful`,e[e.Undone=2]=`Undone`,e[e.Accepted=3]=`Accepted`,e[e.Bug=4]=`Bug`})(Sk||={});var Ck;(function(e){e[e.Unhelpful=0]=`Unhelpful`,e[e.Helpful=1]=`Helpful`})(Ck||={});var wk=class{constructor(e){if(typeof e!=`string`&&e.isTrusted===!0)throw Error(`The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.`);this.value=typeof e==`string`?new Qw(e):e}},Tk=class{constructor(e,t){if(typeof e!=`string`&&e.isTrusted===!0)throw Error(`The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.`);this.value=typeof e==`string`?new Qw(e):e,this.vulnerabilities=t}},Ek=class{constructor(e,t,n,r){this.title=e,this.message=t,this.data=n,this.buttons=r}},Dk=class{constructor(e,t){this.value=e,this.baseUri=t}},Ok=class{constructor(e,t,n){this.value=e,this.title=t,this.readOnly=n}},kk=class{constructor(e,t){this.data=e,this.mimeType=t}},Ak=class{constructor(e,t,n,r){this.description=e,this.agentName=t,this.prompt=n,this.result=r}},jk=class{constructor(e,t){this.uris=e,this.callback=t,this.applied=new Promise(e=>{this.didGetApplied=e})}},Mk=class{constructor(e,t){this.value=e,this.value2=e,this.title=t}},Nk=class{constructor(e){this.value=e}},Pk=class{constructor(e,t){this.value=e,this.task=t}},Fk=class{constructor(e,t,n){this.value=e,this.id=t,this.metadata=n}},Ik=class{constructor(e,t,n,r){this.hookType=e,this.stopReason=t,this.systemMessage=n,this.metadata=r}},Lk=class{constructor(e){if(typeof e!=`string`&&e.isTrusted===!0)throw Error(`The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.`);this.value=typeof e==`string`?new Qw(e):e}},Rk=class{constructor(e){if(typeof e!=`string`&&e.isTrusted===!0)throw Error(`The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.`);this.value=typeof e==`string`?new Qw(e):e}},zk=class{constructor(e){this.value=e}},Bk=class{constructor(e,t,n){this.value=e,this.iconPath=t,this.options=n}},Vk=class{constructor(e,t,n){this.value=e,this.isEdit=t,this.undoStopId=n}},Hk=class{constructor(e,t,n){this.value=e,this.license=t,this.snippet=n}},Uk=class{constructor(e,t){this.uri=e,this.range=t}},Wk=class{constructor(e){this.extensions=e}},Gk=class{constructor(e,t,n,r,i){this.title=t,this.description=n,this.author=r,this.linkTag=i,ri(e)?(this.uri=e,this.command={title:`Open Pull Request`,command:`vscode.open`,arguments:[e]}):this.command=e}toJSON(){return{$mid:Er.ChatResponsePullRequestPart,uri:this.uri,title:this.title,description:this.description,author:this.author}}},Kk;(function(e){e[e.Text=1]=`Text`,e[e.SingleSelect=2]=`SingleSelect`,e[e.MultiSelect=3]=`MultiSelect`})(Kk||={});var qk=class{constructor(e,t,n,r){this.id=e,this.type=t,this.title=n,this.message=r?.message,this.options=r?.options,this.defaultValue=r?.defaultValue,this.allowFreeformInput=r?.allowFreeformInput}},Jk=class{constructor(e,t=!0){this.questions=e,this.allowSkip=t}},Yk=class{constructor(e,t){this.uri=e,t===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(t)?t:[t]}},Xk=class{constructor(e,t){this.uri=e,t===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(t)?t:[t]}},Zk=class{constructor(e){this.edits=e}},Qk;(function(e){e[e.NotStarted=1]=`NotStarted`,e[e.InProgress=2]=`InProgress`,e[e.Completed=3]=`Completed`})(Qk||={});var $k;(function(e){e[e.Running=0]=`Running`,e[e.Completed=1]=`Completed`,e[e.Failed=2]=`Failed`})($k||={});var eA=class{constructor(e,t,n){this.toolName=e,this.toolCallId=t,this.errorMessage=n}},tA=class{constructor(e,t,n,r,i,a,o,s,c){this.prompt=e,this.command=t,this.references=n,this.participant=r,this.toolReferences=i,this.editedFileEvents=a,this.id=o,this.modelId=s,this.modeInstructions2=c}},nA=class{constructor(e,t,n,r){this.response=e,this.result=t,this.participant=n,this.command=r}},rA=class{constructor(e,t,n,r){this.response=e,this.result=t,this.participant=n,this.command=r}},iA;(function(e){e[e.Panel=1]=`Panel`,e[e.Terminal=2]=`Terminal`,e[e.Notebook=3]=`Notebook`,e[e.Editor=4]=`Editor`})(iA||={});var aA;(function(e){e[e.Failed=0]=`Failed`,e[e.Completed=1]=`Completed`,e[e.InProgress=2]=`InProgress`,e[e.NeedsInput=3]=`NeedsInput`})(aA||={});var oA=class e{static{this.Agent=new e(`agent`)}static{this.Skill=new e(`skill`)}static{this.Instructions=new e(`instructions`)}static{this.Prompt=new e(`prompt`)}static{this.Hook=new e(`hook`)}static{this.Plugins=new e(`plugins`)}constructor(e){this.id=e}},sA;(function(e){e[e.Trace=0]=`Trace`,e[e.Info=1]=`Info`,e[e.Warning=2]=`Warning`,e[e.Error=3]=`Error`})(sA||={});var cA;(function(e){e[e.Success=0]=`Success`,e[e.Error=1]=`Error`})(cA||={});var lA;(function(e){e[e.Success=0]=`Success`,e[e.Error=1]=`Error`,e[e.NonBlockingError=2]=`NonBlockingError`})(lA||={});var uA=class{constructor(e,t){this._kind=`toolCall`,this.toolName=e,this.created=t}},dA=class{constructor(e){this._kind=`modelTurn`,this.created=e}},fA=class{constructor(e,t,n){this._kind=`generic`,this.name=e,this.level=t,this.created=n}},pA=class{constructor(e,t){this._kind=`subagentInvocation`,this.agentName=e,this.created=t}},mA=class{constructor(e,t){this.name=e,this.content=t}},hA=class{constructor(e,t){this._kind=`userMessage`,this.message=e,this.created=t,this.sections=[]}},gA=class{constructor(e,t){this._kind=`agentResponse`,this.message=e,this.created=t,this.sections=[]}},_A=class{constructor(e){this._kind=`text`,this.value=e}},vA;(function(e){e[e.User=0]=`User`,e[e.Agent=1]=`Agent`})(vA||={});var yA=class{constructor(e,t,n){this._kind=`messageContent`,this.type=e,this.message=t,this.sections=n}},bA=class{constructor(e){this._kind=`toolCallContent`,this.toolName=e}},xA=class{constructor(e){this._kind=`modelTurnContent`,this.requestName=e}},SA=class{constructor(e){this._kind=`hookContent`,this.hookType=e}},CA=class{constructor(e,t,n,r,i){this.uri=e,this.originalUri=t,this.modifiedUri=n,this.insertions=r,this.deletions=i}},wA;(function(e){e[e.Complete=1]=`Complete`,e[e.Partial=2]=`Partial`,e[e.Omitted=3]=`Omitted`})(wA||={});var TA;(function(e){e[e.NoReason=0]=`NoReason`,e[e.FilteredContentRetry=1]=`FilteredContentRetry`,e[e.CopyrightContentRetry=2]=`CopyrightContentRetry`})(TA||={});var EA=class{constructor(e,t,n,r){this.editor=e,this.document=t,this.selection=n,this.wholeRange=r}},DA=class{constructor(e){this.cell=e}},OA=class{constructor(e,t,n){this.mimeType=e,this.data=t,this.reference=n}},kA=class{constructor(e){this.diagnostics=e}},AA;(function(e){e[e.User=1]=`User`,e[e.Assistant=2]=`Assistant`,e[e.System=3]=`System`})(AA||={});var jA=class{constructor(e,t,n){this.callId=e,this.content=t,this.isError=n??!1}},MA;(function(e){e[e.Info=0]=`Info`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(MA||={});var NA;(function(e){e[e.Info=0]=`Info`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(NA||={});var PA=class e{static User(t,n){return new e(AA.User,t,n)}static Assistant(t,n){return new e(AA.Assistant,t,n)}set content(e){typeof e==`string`?this._content=[new RA(e)]:this._content=e}get content(){return this._content}constructor(e,t,n){this._content=[],this.role=e,this.content=t,this.name=n}},FA=class e{static User(t,n){return new e(AA.User,t,n)}static Assistant(t,n){return new e(AA.Assistant,t,n)}set content(e){typeof e==`string`?this._content=[new RA(e)]:this._content=e}get content(){return this._content}set content2(e){e&&(this.content=e.map(e=>typeof e==`string`?new RA(e):e))}get content2(){return this.content.map(e=>e instanceof RA?e.value:e)}constructor(e,t,n){this._content=[],this.role=e,this.content=t,this.name=n}},IA=class{constructor(e,t,n){this.callId=e,this.name=t,this.input=n}},LA;(function(e){e[e.Assistant=0]=`Assistant`,e[e.User=1]=`User`,e[e.Extension=2]=`Extension`})(LA||={});var RA=class{constructor(e,t){this.value=e}toJSON(){return{$mid:Er.LanguageModelTextPart,value:this.value,audience:this.audience}}},zA=class e{constructor(e,t,n){this.mimeType=t,this.data=e,this.audience=n}static image(t,n){return new e(t,n)}static json(t,n=`text/x-json`){let r=JSON.stringify(t,void 0,` `);return new e(b.fromString(r).buffer,n)}static text(t,n=Uu.text){return new e(b.fromString(t).buffer,n)}toJSON(){return{$mid:Er.LanguageModelDataPart,mimeType:this.mimeType,data:Wt(b.wrap(this.data)),audience:this.audience}}},BA;(function(e){e.PNG=`image/png`,e.JPEG=`image/jpeg`,e.GIF=`image/gif`,e.WEBP=`image/webp`,e.BMP=`image/bmp`})(BA||={});var VA=class{constructor(e,t,n){this.value=e,this.id=t,this.metadata=n}toJSON(){return{$mid:Er.LanguageModelThinkingPart,value:this.value,id:this.id,metadata:this.metadata}}},HA=class{constructor(e){this.value=e}toJSON(){return{$mid:Er.LanguageModelPromptTsxPart,value:this.value}}},UA=class e extends Error{static#e=`LanguageModelError`;static NotFound(t){return new e(t,e.NotFound.name)}static NoPermissions(t){return new e(t,e.NoPermissions.name)}static Blocked(t){return new e(t,e.Blocked.name)}static tryDeserialize(t){if(t.name===e.#e)return new e(t.message,t.code,t.cause)}constructor(t,n,r){super(t,{cause:r}),this.name=e.#e,this.code=n??``}},WA=class{constructor(e){this.content=e}toJSON(){return{$mid:Er.LanguageModelToolResult,content:this.content}}},GA=class{constructor(e){this.content=e}toJSON(){return{$mid:Er.LanguageModelToolResult,content:this.content}}},KA=class extends WA{},qA;(function(e){e[e.Auto=1]=`Auto`,e[e.Required=2]=`Required`})(qA||={});var JA=class{constructor(e,t){this.id=e,this.label=t}},YA=class{constructor(e,t,n){this.label=e,this.name=t,this.instructions=n}},XA;(function(e){e[e.SymbolInformation=1]=`SymbolInformation`,e[e.CommandInformation=2]=`CommandInformation`,e[e.SearchInformation=3]=`SearchInformation`,e[e.SettingInformation=4]=`SettingInformation`})(XA||={});var ZA;(function(e){e[e.EMBEDDED=1]=`EMBEDDED`,e[e.LLM_RANKED=2]=`LLM_RANKED`,e[e.CANCELED=3]=`CANCELED`})(ZA||={});var QA;(function(e){e[e.Started=1]=`Started`,e[e.Recognizing=2]=`Recognizing`,e[e.Recognized=3]=`Recognized`,e[e.Stopped=4]=`Stopped`,e[e.Error=5]=`Error`})(QA||={});var $A;(function(e){e[e.Started=1]=`Started`,e[e.Stopped=2]=`Stopped`,e[e.Error=3]=`Error`})($A||={});var ej;(function(e){e[e.Recognized=1]=`Recognized`,e[e.Stopped=2]=`Stopped`})(ej||={});var tj;(function(e){e[e.Initial=0]=`Initial`,e[e.Dynamic=1]=`Dynamic`})(tj||={});var nj=class{constructor(e,t,n,r={},i,a){this.label=e,this.command=t,this.args=n,this.env=r,this.version=i,this.metadata=a}},rj=class{constructor(e,t,n={},r,i,a){this.label=e,this.uri=t,this.headers=n,this.version=r,this.metadata=i,this.authentication=a}},ij;(function(e){function t(e){let{selectionStartLineNumber:t,selectionStartColumn:n,positionLineNumber:r,positionColumn:i}=e;return new xT(new eT(t-1,n-1),new eT(r-1,i-1))}e.to=t;function n(e){let{anchor:t,active:n}=e;return{selectionStartLineNumber:t.line+1,selectionStartColumn:t.character+1,positionLineNumber:n.line+1,positionColumn:n.character+1}}e.from=n})(ij||={});var J;(function(e){function t(e){if(!e)return;let{start:t,end:n}=e;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:n.line+1,endColumn:n.character+1}}e.from=t;function n(e){if(!e)return;let{startLineNumber:t,startColumn:n,endLineNumber:r,endColumn:i}=e;return new nT(t-1,n-1,r-1,i-1)}e.to=n})(J||={});var aj;(function(e){function t(e){return{uri:e.uri,range:J.from(e.range)}}e.from=t;function n(e){return new dT(w.revive(e.uri),J.to(e.range))}e.to=n})(aj||={});var oj;(function(e){function t(e){switch(e){case wp.Comment:return zO.Comment;case wp.Other:return zO.Other;case wp.RegEx:return zO.RegEx;case wp.String:return zO.String}}e.to=t})(oj||={});var sj;(function(e){function t(e){return new eT(e.lineNumber-1,e.column-1)}e.to=t;function n(e){return{lineNumber:e.line+1,column:e.character+1}}e.from=n})(sj||={});var cj;(function(e){function t(e,t,r){return pe(be(e).map(e=>n(e,t,r)))}e.from=t;function n(e,t,n){if(typeof e==`string`)return{$serialized:!0,language:e,isBuiltin:n?.isBuiltin};if(e)return{$serialized:!0,language:e.language,scheme:r(e.scheme,t),pattern:cM.from(e.pattern)??void 0,exclusive:e.exclusive,notebookType:e.notebookType,isBuiltin:n?.isBuiltin}}function r(e,t){return t&&typeof e==`string`?t.transformOutgoingScheme(e):e}})(cj||={});var lj;(function(e){function t(e){switch(e){case oT.Unnecessary:return _m.Unnecessary;case oT.Deprecated:return _m.Deprecated}}e.from=t;function n(e){switch(e){case _m.Unnecessary:return oT.Unnecessary;case _m.Deprecated:return oT.Deprecated;default:return}}e.to=n})(lj||={});var uj;(function(e){function t(e){let t;return e.code&&(t=Ge(e.code)||Xe(e.code)?String(e.code):{value:String(e.code.value),target:e.code.target}),{...J.from(e.range),message:e.message,source:e.source,code:t,severity:fj.from(e.severity),relatedInformation:e.relatedInformation&&e.relatedInformation.map(dj.from),tags:Array.isArray(e.tags)?pe(e.tags.map(lj.from)):void 0}}e.from=t;function n(e){let t=new lT(J.to(e),e.message,fj.to(e.severity));return t.source=e.source,t.code=Ge(e.code)?e.code:e.code?.value,t.relatedInformation=e.relatedInformation&&e.relatedInformation.map(dj.to),t.tags=e.tags&&pe(e.tags.map(lj.to)),t}e.to=n})(uj||={});var dj;(function(e){function t(e){return{...J.from(e.location.range),message:e.message,resource:e.location.uri}}e.from=t;function n(e){return new cT(new dT(e.resource,J.to(e)),e.message)}e.to=n})(dj||={});var fj;(function(e){function t(e){switch(e){case sT.Error:return vm.Error;case sT.Warning:return vm.Warning;case sT.Information:return vm.Info;case sT.Hint:return vm.Hint}return vm.Error}e.from=t;function n(e){switch(e){case vm.Info:return sT.Information;case vm.Warning:return sT.Warning;case vm.Error:return sT.Error;case vm.Hint:return sT.Hint;default:return sT.Error}}e.to=n})(fj||={});var pj;(function(e){function t(e){return typeof e==`number`&&e>=OE.One?e-1:e===OE.Beside?-2:-1}e.from=t;function n(e){if(typeof e==`number`&&e>=0)return e+1;throw Error(`invalid 'EditorGroupColumn'`)}e.to=n})(pj||={});function mj(e){return e.range!==void 0}function hj(e){return e.length===0?!0:!!mj(e[0])}var Y;(function(e){function t(t){return t.map(e.from)}e.fromMany=t;function n(e){return e&&typeof e==`object`&&typeof e.language==`string`&&typeof e.value==`string`}function r(e){let t;if(n(e)){let{language:n,value:r}=e;t={value:"```"+n+`
94
- `+r+"\n```\n"}}else t=Qw.isMarkdownString(e)?{value:e.value,isTrusted:e.isTrusted,supportThemeIcons:e.supportThemeIcons,supportHtml:e.supportHtml,supportAlertSyntax:e.supportAlertSyntax,baseUri:e.baseUri}:typeof e==`string`?{value:e}:{value:``};let r=Object.create(null);t.uris=r;let a=({href:e})=>{try{let t=w.parse(e,!0);t=t.with({query:i(t.query,r)}),r[e]=t}catch{}return``};return Ru.walkTokens(Ru.lexer(t.value),e=>{e.type===`link`?a({href:e.href}):e.type===`image`&&typeof e.href==`string`&&a(xl(e.href))}),t}e.from=r;function i(e,t){if(!e)return e;let n;try{n=Bu(e)}catch{}if(!n)return e;let r=!1;return n=ic(n,e=>{if(w.isUri(e)){let n=`__uri_${Math.random().toString(16).slice(2,8)}`;return t[n]=e,r=!0,n}else return}),r?JSON.stringify(n):e}function a(e){let t=new Qw(e.value,e.supportThemeIcons);return t.isTrusted=e.isTrusted,t.supportHtml=e.supportHtml,t.supportAlertSyntax=e.supportAlertSyntax,t.baseUri=e.baseUri?w.from(e.baseUri):void 0,t}e.to=a;function o(t){if(t)return typeof t==`string`?t:e.from(t)}e.fromStrict=o})(Y||={});function gj(e){return hj(e)?e.map(e=>({range:J.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Y.fromMany(e.hoverMessage):e.hoverMessage?Y.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):e.map(e=>({range:J.from(e)}))}function _j(e){return e===void 0?e:typeof e==`string`?w.file(e):e}var vj;(function(e){function t(e){return e===void 0?e:{contentText:e.contentText,contentIconPath:e.contentIconPath?_j(e.contentIconPath):void 0,border:e.border,borderColor:e.borderColor,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,color:e.color,backgroundColor:e.backgroundColor,margin:e.margin,width:e.width,height:e.height}}e.from=t})(vj||={});var yj;(function(e){function t(e){return e===void 0?e:{backgroundColor:e.backgroundColor,outline:e.outline,outlineColor:e.outlineColor,outlineStyle:e.outlineStyle,outlineWidth:e.outlineWidth,border:e.border,borderColor:e.borderColor,borderRadius:e.borderRadius,borderSpacing:e.borderSpacing,borderStyle:e.borderStyle,borderWidth:e.borderWidth,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,cursor:e.cursor,color:e.color,opacity:e.opacity,letterSpacing:e.letterSpacing,gutterIconPath:e.gutterIconPath?_j(e.gutterIconPath):void 0,gutterIconSize:e.gutterIconSize,overviewRulerColor:e.overviewRulerColor,before:e.before?vj.from(e.before):void 0,after:e.after?vj.from(e.after):void 0}}e.from=t})(yj||={});var bj;(function(e){function t(e){if(e===void 0)return e;switch(e){case LE.OpenOpen:return fm.AlwaysGrowsWhenTypingAtEdges;case LE.ClosedClosed:return fm.NeverGrowsWhenTypingAtEdges;case LE.OpenClosed:return fm.GrowsOnlyWhenTypingBefore;case LE.ClosedOpen:return fm.GrowsOnlyWhenTypingAfter}}e.from=t})(bj||={});var xj;(function(e){function t(e){return{isWholeLine:e.isWholeLine,rangeBehavior:e.rangeBehavior?bj.from(e.rangeBehavior):void 0,overviewRulerLane:e.overviewRulerLane,light:e.light?yj.from(e.light):void 0,dark:e.dark?yj.from(e.dark):void 0,backgroundColor:e.backgroundColor,outline:e.outline,outlineColor:e.outlineColor,outlineStyle:e.outlineStyle,outlineWidth:e.outlineWidth,border:e.border,borderColor:e.borderColor,borderRadius:e.borderRadius,borderSpacing:e.borderSpacing,borderStyle:e.borderStyle,borderWidth:e.borderWidth,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,cursor:e.cursor,color:e.color,opacity:e.opacity,letterSpacing:e.letterSpacing,gutterIconPath:e.gutterIconPath?_j(e.gutterIconPath):void 0,gutterIconSize:e.gutterIconSize,overviewRulerColor:e.overviewRulerColor,before:e.before?vj.from(e.before):void 0,after:e.after?vj.from(e.after):void 0}}e.from=t})(xj||={});var Sj;(function(e){function t(e){return{text:e.newText,eol:e.newEol&&rM.from(e.newEol),range:J.from(e.range)}}e.from=t;function n(e){let t=new jT(J.to(e.range),e.text);return t.newEol=e.eol===void 0?void 0:rM.to(e.eol),t}e.to=n})(Sj||={});var Cj;(function(e){function t(e,t){let n={edits:[]};if(e instanceof PT){let r=new Pe;for(let t of e._allEntries())t._type===NT.File&&w.isUri(t.to)&&t.from===void 0&&r.add(t.to);for(let i of e._allEntries())if(i._type===NT.File){let e;i.options?.contents&&(e=ArrayBuffer.isView(i.options.contents)?{type:`base64`,value:Wt(b.wrap(i.options.contents))}:{type:`dataTransferItem`,id:i.options.contents._itemId}),n.edits.push({oldResource:i.from,newResource:i.to,options:{...i.options,contents:e},metadata:i.metadata})}else i._type===NT.Text?n.edits.push({resource:i.uri,textEdit:Sj.from(i.edit),versionId:r.has(i.uri)?void 0:t?.getTextDocumentVersion(i.uri),metadata:i.metadata}):i._type===NT.Snippet?n.edits.push({resource:i.uri,textEdit:{range:J.from(i.range),text:i.edit.value,insertAsSnippet:!0,keepWhitespace:i.keepWhitespace},versionId:r.has(i.uri)?void 0:t?.getTextDocumentVersion(i.uri),metadata:i.metadata}):i._type===NT.Cell?n.edits.push({metadata:i.metadata,resource:i.uri,cellEdit:i.edit,notebookVersionId:t?.getNotebookDocumentVersion(i.uri)}):i._type===NT.CellReplace&&n.edits.push({metadata:i.metadata,resource:i.uri,notebookVersionId:t?.getNotebookDocumentVersion(i.uri),cellEdit:{editType:sC.Replace,index:i.index,count:i.count,cells:i.cells.map(mM.from)}})}return n}e.from=t;function n(e){let t=new PT,n=new Ne;for(let r of e.edits)if(r.textEdit){let e=r,t=w.revive(e.resource),i=J.to(e.textEdit.range),a=e.textEdit.text,o=e.textEdit.insertAsSnippet,s;s=o?MT.replace(i,new wT(a)):jT.replace(i,a);let c=n.get(t);c?c.push(s):n.set(t,[s])}else t.renameFile(w.revive(r.oldResource),w.revive(r.newResource),r.options);for(let[e,r]of n)t.set(e,r);return t}e.to=n})(Cj||={});var wj;(function(e){let t=Object.create(null);t[ET.File]=H.File,t[ET.Module]=H.Module,t[ET.Namespace]=H.Namespace,t[ET.Package]=H.Package,t[ET.Class]=H.Class,t[ET.Method]=H.Method,t[ET.Property]=H.Property,t[ET.Field]=H.Field,t[ET.Constructor]=H.Constructor,t[ET.Enum]=H.Enum,t[ET.Interface]=H.Interface,t[ET.Function]=H.Function,t[ET.Variable]=H.Variable,t[ET.Constant]=H.Constant,t[ET.String]=H.String,t[ET.Number]=H.Number,t[ET.Boolean]=H.Boolean,t[ET.Array]=H.Array,t[ET.Object]=H.Object,t[ET.Key]=H.Key,t[ET.Null]=H.Null,t[ET.EnumMember]=H.EnumMember,t[ET.Struct]=H.Struct,t[ET.Event]=H.Event,t[ET.Operator]=H.Operator,t[ET.TypeParameter]=H.TypeParameter;function n(e){return typeof t[e]==`number`?t[e]:H.Property}e.from=n;function r(e){for(let n in t)if(t[n]===e)return Number(n);return ET.Property}e.to=r})(wj||={});var Tj;(function(e){function t(e){switch(e){case DT.Deprecated:return Up.Deprecated}}e.from=t;function n(e){switch(e){case Up.Deprecated:return DT.Deprecated}}e.to=n})(Tj||={});var Ej;(function(e){function t(e){return{name:e.name,kind:wj.from(e.kind),tags:e.tags&&e.tags.map(Tj.from),containerName:e.containerName,location:jj.from(e.location)}}e.from=t;function n(e){let t=new OT(e.name,wj.to(e.kind),e.containerName,jj.to(e.location));return t.tags=e.tags&&e.tags.map(Tj.to),t}e.to=n})(Ej||={});var Dj;(function(e){function t(e){let n={name:e.name||`!!MISSING: name!!`,detail:e.detail,range:J.from(e.range),selectionRange:J.from(e.selectionRange),kind:wj.from(e.kind),tags:e.tags?.map(Tj.from)??[]};return e.children&&(n.children=e.children.map(t)),n}e.from=t;function n(e){let t=new nE(e.name,e.detail,wj.to(e.kind),J.to(e.range),J.to(e.selectionRange));return ge(e.tags)&&(t.tags=e.tags.map(Tj.to)),e.children&&(t.children=e.children.map(n)),t}e.to=n})(Dj||={});var Oj;(function(e){function t(e){let t=new oE(wj.to(e.kind),e.name,e.detail||``,w.revive(e.uri),J.to(e.range),J.to(e.selectionRange));return t._sessionId=e._sessionId,t._itemId=e._itemId,t}e.to=t;function n(e,t,n){if(t??=e._sessionId,n??=e._itemId,t===void 0||n===void 0)throw Error(`invalid item`);return{_sessionId:t,_itemId:n,name:e.name,detail:e.detail,kind:wj.from(e.kind),uri:e.uri,range:J.from(e.range),selectionRange:J.from(e.selectionRange),tags:e.tags?.map(Tj.from)}}e.from=n})(Oj||={});var kj;(function(e){function t(e){return new sE(Oj.to(e.from),e.fromRanges.map(e=>J.to(e)))}e.to=t})(kj||={});var Aj;(function(e){function t(e){return new cE(Oj.to(e.to),e.fromRanges.map(e=>J.to(e)))}e.to=t})(Aj||={});var jj;(function(e){function t(e){return{range:e.range&&J.from(e.range),uri:e.uri}}e.from=t;function n(e){return new dT(w.revive(e.uri),J.to(e.range))}e.to=n})(jj||={});var Mj;(function(e){function t(e){let t=e,n=e;return{originSelectionRange:t.originSelectionRange?J.from(t.originSelectionRange):void 0,uri:t.targetUri?t.targetUri:n.uri,range:J.from(t.targetRange?t.targetRange:n.range),targetSelectionRange:t.targetSelectionRange?J.from(t.targetSelectionRange):void 0}}e.from=t;function n(e){return{targetUri:w.revive(e.uri),targetRange:J.to(e.range),targetSelectionRange:e.targetSelectionRange?J.to(e.targetSelectionRange):void 0,originSelectionRange:e.originSelectionRange?J.to(e.originSelectionRange):void 0}}e.to=n})(Mj||={});var Nj;(function(e){function t(e){return{range:J.from(e.range),contents:Y.fromMany(e.contents),canIncreaseVerbosity:e.canIncreaseVerbosity,canDecreaseVerbosity:e.canDecreaseVerbosity}}e.from=t;function n(e){let t=e.contents.map(Y.to),n=J.to(e.range),r=e.canIncreaseVerbosity,i=e.canDecreaseVerbosity;return new ZT(t,n,r,i)}e.to=n})(Nj||={});var Pj;(function(e){function t(e){return{range:J.from(e.range),expression:e.expression}}e.from=t;function n(e){return new WD(J.to(e.range),e.expression)}e.to=n})(Pj||={});var Fj;(function(e){function t(e){if(e instanceof qD)return{type:`text`,range:J.from(e.range),text:e.text};if(e instanceof JD)return{type:`variable`,range:J.from(e.range),variableName:e.variableName,caseSensitiveLookup:e.caseSensitiveLookup};if(e instanceof YD)return{type:`expression`,range:J.from(e.range),expression:e.expression};throw Error(`Unknown 'InlineValue' type`)}e.from=t;function n(e){switch(e.type){case`text`:return{range:J.to(e.range),text:e.text};case`variable`:return{range:J.to(e.range),variableName:e.variableName,caseSensitiveLookup:e.caseSensitiveLookup};case`expression`:return{range:J.to(e.range),expression:e.expression}}}e.to=n})(Fj||={});var Ij;(function(e){function t(e){return{frameId:e.frameId,stoppedLocation:J.from(e.stoppedLocation)}}e.from=t;function n(e){return new XD(e.frameId,J.to(e.stoppedLocation))}e.to=n})(Ij||={});var Lj;(function(e){function t(e){return{range:J.from(e.range),kind:e.kind}}e.from=t;function n(e){return new eE(J.to(e.range),e.kind)}e.to=n})(Lj||={});var Rj;(function(e){function t(e){return{uri:e.uri,highlights:e.highlights.map(Lj.from)}}e.from=t;function n(e){return new tE(w.revive(e.uri),e.highlights.map(Lj.to))}e.to=n})(Rj||={});var zj;(function(e){function t(e){switch(e){case Np.TriggerCharacter:return vE.TriggerCharacter;case Np.TriggerForIncompleteCompletions:return vE.TriggerForIncompleteCompletions;case Np.Invoke:default:return vE.Invoke}}e.to=t})(zj||={});var Bj;(function(e){function t(e){return{triggerKind:zj.to(e.triggerKind),triggerCharacter:e.triggerCharacter}}e.to=t})(Bj||={});var Vj;(function(e){function t(e){switch(e){case bE.Deprecated:return Ap.Deprecated}}e.from=t;function n(e){switch(e){case Ap.Deprecated:return bE.Deprecated}}e.to=n})(Vj||={});var Hj;(function(e){function t(e,t,n){return`icon`in e&&`command`in e?{command:t.toInternal(e.command,n),icon:NN.fromThemeIcon(e.icon)}:{command:t.toInternal(e,n)}}e.from=t})(Hj||={});var Uj;(function(e){let t=new Map([[yE.Method,V.Method],[yE.Function,V.Function],[yE.Constructor,V.Constructor],[yE.Field,V.Field],[yE.Variable,V.Variable],[yE.Class,V.Class],[yE.Interface,V.Interface],[yE.Struct,V.Struct],[yE.Module,V.Module],[yE.Property,V.Property],[yE.Unit,V.Unit],[yE.Value,V.Value],[yE.Constant,V.Constant],[yE.Enum,V.Enum],[yE.EnumMember,V.EnumMember],[yE.Keyword,V.Keyword],[yE.Snippet,V.Snippet],[yE.Text,V.Text],[yE.Color,V.Color],[yE.File,V.File],[yE.Reference,V.Reference],[yE.Folder,V.Folder],[yE.Event,V.Event],[yE.Operator,V.Operator],[yE.TypeParameter,V.TypeParameter],[yE.Issue,V.Issue],[yE.User,V.User]]);function n(e){return t.get(e)??V.Property}e.from=n;let r=new Map([[V.Method,yE.Method],[V.Function,yE.Function],[V.Constructor,yE.Constructor],[V.Field,yE.Field],[V.Variable,yE.Variable],[V.Class,yE.Class],[V.Interface,yE.Interface],[V.Struct,yE.Struct],[V.Module,yE.Module],[V.Property,yE.Property],[V.Unit,yE.Unit],[V.Value,yE.Value],[V.Constant,yE.Constant],[V.Enum,yE.Enum],[V.EnumMember,yE.EnumMember],[V.Keyword,yE.Keyword],[V.Snippet,yE.Snippet],[V.Text,yE.Text],[V.Color,yE.Color],[V.File,yE.File],[V.Reference,yE.Reference],[V.Folder,yE.Folder],[V.Event,yE.Event],[V.Operator,yE.Operator],[V.TypeParameter,yE.TypeParameter],[V.User,yE.User],[V.Issue,yE.Issue]]);function i(e){return r.get(e)??yE.Property}e.to=i})(Uj||={});var Wj;(function(e){function t(e,t){let n=new xE(e.label);return n.insertText=e.insertText,n.kind=Uj.to(e.kind),n.tags=e.tags?.map(Vj.to),n.detail=e.detail,n.documentation=vl(e.documentation)?Y.to(e.documentation):e.documentation,n.sortText=e.sortText,n.filterText=e.filterText,n.preselect=e.preselect,n.commitCharacters=e.commitCharacters,bp.isIRange(e.range)?n.range=J.to(e.range):typeof e.range==`object`&&(n.range={inserting:J.to(e.range.insert),replacing:J.to(e.range.replace)}),n.keepWhitespace=e.insertTextRules===void 0?!1:!!(e.insertTextRules&jp.KeepWhitespace),e.insertTextRules!==void 0&&e.insertTextRules&jp.InsertAsSnippet?n.insertText=new wT(e.insertText):(n.insertText=e.insertText,n.textEdit=n.range instanceof nT?new jT(n.range,n.insertText):void 0),e.additionalTextEdits&&e.additionalTextEdits.length>0&&(n.additionalTextEdits=e.additionalTextEdits.map(e=>Sj.to(e))),n.command=t&&e.command?t.fromInternal(e.command):void 0,n}e.to=t})(Wj||={});var Gj;(function(e){function t(e){if(typeof e.label!=`string`&&!Array.isArray(e.label))throw TypeError(`Invalid label`);return{label:e.label,documentation:Y.fromStrict(e.documentation)}}e.from=t;function n(e){return{label:e.label,documentation:vl(e.documentation)?Y.to(e.documentation):e.documentation}}e.to=n})(Gj||={});var Kj;(function(e){function t(e){return{label:e.label,documentation:Y.fromStrict(e.documentation),parameters:Array.isArray(e.parameters)?e.parameters.map(Gj.from):[],activeParameter:e.activeParameter}}e.from=t;function n(e){return{label:e.label,documentation:vl(e.documentation)?Y.to(e.documentation):e.documentation,parameters:Array.isArray(e.parameters)?e.parameters.map(Gj.to):[],activeParameter:e.activeParameter}}e.to=n})(Kj||={});var qj;(function(e){function t(e){return{activeSignature:e.activeSignature,activeParameter:e.activeParameter,signatures:Array.isArray(e.signatures)?e.signatures.map(Kj.from):[]}}e.from=t;function n(e){return{activeSignature:e.activeSignature,activeParameter:e.activeParameter,signatures:Array.isArray(e.signatures)?e.signatures.map(Kj.to):[]}}e.to=n})(qj||={});var Jj;(function(e){function t(e,t){let n=new _E(sj.to(t.position),typeof t.label==`string`?t.label:t.label.map(Yj.to.bind(void 0,e)),t.kind&&Xj.to(t.kind));return n.textEdits=t.textEdits&&t.textEdits.map(Sj.to),n.tooltip=vl(t.tooltip)?Y.to(t.tooltip):t.tooltip,n.paddingLeft=t.paddingLeft,n.paddingRight=t.paddingRight,n}e.to=t})(Jj||={});var Yj;(function(e){function t(e,t){let n=new gE(t.label);return n.tooltip=vl(t.tooltip)?Y.to(t.tooltip):t.tooltip,Jp.is(t.command)&&(n.command=e.fromInternal(t.command)),t.location&&(n.location=jj.to(t.location)),n}e.to=t})(Yj||={});var Xj;(function(e){function t(e){return e}e.from=t;function n(e){return e}e.to=n})(Xj||={});var Zj;(function(e){function t(e){return{range:J.from(e.range),url:e.target,tooltip:e.tooltip}}e.from=t;function n(e){let t;if(e.url)try{t=typeof e.url==`string`?w.parse(e.url,!0):w.revive(e.url)}catch{}let n=new zE(J.to(e.range),t);return n.tooltip=e.tooltip,n}e.to=n})(Zj||={});var Qj;(function(e){function t(e){let t=new HE(e.label);return e.textEdit&&(t.textEdit=Sj.to(e.textEdit)),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(e=>Sj.to(e))),t}e.to=t;function n(e){return{label:e.label,textEdit:e.textEdit?Sj.from(e.textEdit):void 0,additionalTextEdits:e.additionalTextEdits?e.additionalTextEdits.map(e=>Sj.from(e)):void 0}}e.from=n})(Qj||={});var $j;(function(e){function t(e){return new BE(e[0],e[1],e[2],e[3])}e.to=t;function n(e){return[e.red,e.green,e.blue,e.alpha]}e.from=n})($j||={});var eM;(function(e){function t(e){return{range:J.from(e.range)}}e.from=t;function n(e){return new aE(J.to(e.range))}e.to=n})(eM||={});var tM;(function(e){function t(e){switch(e){case Bm.AUTO:return ME.AfterDelay;case Bm.EXPLICIT:return ME.Manual;case Bm.FOCUS_CHANGE:case Bm.WINDOW_CHANGE:return ME.FocusOut}}e.to=t})(tM||={});var nM;(function(e){function t(e){switch(e){case jE.Off:return Zf.Off;case jE.Relative:return Zf.Relative;case jE.Interval:return Zf.Interval;case jE.On:default:return Zf.On}}e.from=t;function n(e){switch(e){case Zf.Off:return jE.Off;case Zf.Relative:return jE.Relative;case Zf.Interval:return jE.Interval;case Zf.On:default:return jE.On}}e.to=n})(nM||={});var rM;(function(e){function t(e){if(e===AT.CRLF)return um.CRLF;if(e===AT.LF)return um.LF}e.from=t;function n(e){if(e===um.CRLF)return AT.CRLF;if(e===um.LF)return AT.LF}e.to=n})(rM||={});var iM;(function(e){function t(e){if(typeof e==`object`)return e.viewId;switch(e){case mD.SourceControl:return xm.Scm;case mD.Window:return xm.Window;case mD.Notification:return xm.Notification}throw Error(`Unknown 'ProgressLocation'`)}e.from=t})(iM||={});var aM;(function(e){function t(e){let t={start:e.start+1,end:e.end+1};return e.kind&&(t.kind=oM.from(e.kind)),t}e.from=t;function n(e){let t={start:e.start-1,end:e.end-1};return e.kind&&(t.kind=oM.to(e.kind)),t}e.to=n})(aM||={});var oM;(function(e){function t(e){if(e)switch(e){case rO.Comment:return Gp.Comment;case rO.Imports:return Gp.Imports;case rO.Region:return Gp.Region}}e.from=t;function n(e){if(e)switch(e.value){case Gp.Comment.value:return rO.Comment;case Gp.Imports.value:return rO.Imports;case Gp.Region.value:return rO.Region}}e.to=n})(oM||={});var sM;(function(e){function t(e){if(e)return{pinned:typeof e.preview==`boolean`?!e.preview:void 0,inactive:e.background,preserveFocus:e.preserveFocus,selection:typeof e.selection==`object`?J.from(e.selection):void 0,override:typeof e.override==`boolean`?Mm.id:void 0}}e.from=t})(sM||={});var cM;(function(e){function t(e){return e instanceof jD?e.toJSON():typeof e==`string`?e:n(e)||r(e)?new jD(e.baseUri??e.base,e.pattern).toJSON():e}e.from=t;function n(e){let t=e;return t?w.isUri(t.baseUri)&&typeof t.pattern==`string`:!1}function r(e){let t=e;return t?typeof t.base==`string`&&typeof t.pattern==`string`:!1}function i(e){return typeof e==`string`?e:new jD(w.revive(e.baseUri),e.pattern)}e.to=i})(cM||={});var lM;(function(e){function t(e){if(e){if(Array.isArray(e))return e.map(t);if(typeof e==`string`)return e;{let t=e;return{language:t.language,scheme:t.scheme,pattern:cM.from(t.pattern)??void 0,exclusive:t.exclusive,notebookType:t.notebookType}}}}e.from=t})(lM||={});var uM;(function(e){function t(e){return{start:e.start,end:e.end}}e.from=t;function n(e){return new mT(e.start,e.end)}e.to=n})(uM||={});var dM;(function(e){function t(e){return{timing:typeof e.runStartTime==`number`&&typeof e.runEndTime==`number`?{startTime:e.runStartTime,endTime:e.runEndTime}:void 0,executionOrder:e.executionOrder,success:e.lastRunSuccess}}e.to=t;function n(e){return{lastRunSuccess:e.success,runStartTime:e.timing?.startTime,runEndTime:e.timing?.endTime,executionOrder:e.executionOrder}}e.from=n})(dM||={});var fM;(function(e){function t(e){switch(e){case pT.Markup:return $S.Markup;case pT.Code:default:return $S.Code}}e.from=t;function n(e){switch(e){case $S.Markup:return pT.Markup;case $S.Code:default:return pT.Code}}e.to=n})(fM||={});var pM;(function(e){function t(e){let t={metadata:e.metadata??Object.create(null),cells:[]};for(let n of e.cells)hT.validate(n),t.cells.push(mM.from(n));return t}e.from=t;function n(e){let t=new gT(e.cells.map(mM.to));return it(e.metadata)||(t.metadata=e.metadata),t}e.to=n})(pM||={});var mM;(function(e){function t(e){return{cellKind:fM.from(e.kind),language:e.languageId,mime:e.mime,source:e.value,metadata:e.metadata,internalMetadata:dM.from(e.executionSummary??{}),outputs:e.outputs?e.outputs.map(gM.from):[]}}e.from=t;function n(e){return new hT(fM.to(e.cellKind),e.source,e.language,e.mime,e.outputs?e.outputs.map(gM.to):void 0,e.metadata,e.internalMetadata?dM.to(e.internalMetadata):void 0)}e.to=n})(mM||={});var hM;(function(e){function t(e){return{mime:e.mime,valueBytes:b.wrap(e.data)}}e.from=t;function n(e){return new vT(e.valueBytes.buffer,e.mime)}e.to=n})(hM||={});var gM;(function(e){function t(e){return{outputId:e.id,items:e.items.map(hM.from),metadata:e.metadata}}e.from=t;function n(e){return new yT(e.items.map(hM.to),e.outputId,e.metadata)}e.to=n})(gM||={});var _M;(function(e){function t(e){return r(e)?{include:cM.from(e.include)??void 0,exclude:cM.from(e.exclude)??void 0}:cM.from(e)??void 0}e.from=t;function n(e){return r(e)?{include:cM.to(e.include),exclude:cM.to(e.exclude)}:cM.to(e)}e.to=n;function r(e){let t=e;return t?!et(t.include)&&!et(t.exclude):!1}})(_M||={});var vM;(function(e){function t(e,t,n){let r=typeof e.command==`string`?{title:``,command:e.command}:e.command;return{alignment:e.alignment===OO.Left?fC.Left:fC.Right,command:t.toInternal(r,n),text:e.text,tooltip:e.tooltip,accessibilityInformation:e.accessibilityInformation,priority:e.priority}}e.from=t})(vM||={});var yM;(function(e){function t(e,t,n){let r=typeof e.command==`string`?{title:``,command:e.command}:e.command;return{command:t.toInternal(r,n),label:e.label,description:e.description,detail:e.detail,documentation:e.documentation}}e.from=t})(yM||={});var bM;(function(e){function t(e){return{transientOutputs:e?.transientOutputs??!1,transientCellMetadata:e?.transientCellMetadata??{},transientDocumentMetadata:e?.transientDocumentMetadata??{},cellContentMetadata:e?.cellContentMetadata??{}}}e.from=t})(bM||={});var xM;(function(e){function t(e){return{uri:e.uri,provides:e.provides}}e.from=t;function n(e){return new NO(w.revive(e.uri),e.provides)}e.to=n})(xM||={});var SM;(function(e){function t(e){return{message:Y.fromStrict(e.message)||``,type:PC.Error,expected:e.expectedOutput,actual:e.actualOutput,contextValue:e.contextValue,location:e.location&&{range:J.from(e.location.range),uri:e.location.uri},stackTrace:e.stackTrace?.map(e=>({label:e.label,position:e.position&&sj.from(e.position),uri:e.uri&&w.revive(e.uri).toJSON()}))}}e.from=t;function n(e){let t=new KO(typeof e.message==`string`?e.message:Y.to(e.message));return t.actualOutput=e.actual,t.expectedOutput=e.expected,t.contextValue=e.contextValue,t.location=e.location?jj.to(e.location):void 0,t}e.to=n})(SM||={});var CM;(function(e){e.namespace=BC,e.denamespace=VC})(CM||={});var wM;(function(e){function t(e){return{controllerId:e.controllerId,profileId:e.profileId,group:TM.from(e.kind)}}e.from=t})(wM||={});var TM;(function(e){let t={[UO.Coverage]:jC.Coverage,[UO.Debug]:jC.Debug,[UO.Run]:jC.Run};function n(e){return t.hasOwnProperty(e)?t[e]:jC.Run}e.from=n})(TM||={});var EM;(function(e){function t(e){let t=Bw(e).controllerId;return{extId:DC.fromExtHostTestItem(e,t).toString(),label:e.label,uri:w.revive(e.uri),busy:e.busy,tags:e.tags.map(e=>CM.namespace(t,e.id)),range:bp.lift(J.from(e.range)),description:e.description||null,sortText:e.sortText||null,error:e.error&&Y.fromStrict(e.error)||null}}e.from=t;function n(e){return{parent:void 0,error:void 0,id:DC.fromString(e.extId).localId,label:e.label,uri:w.revive(e.uri),tags:(e.tags||[]).map(e=>{let{tagId:t}=CM.denamespace(e);return new qO(t)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>void 0,replace:()=>{},size:0},range:J.to(e.range||void 0),canResolveChildren:!1,busy:e.busy,description:e.description||void 0,sortText:e.sortText||void 0}}e.toPlain=n})(EM||={}),(function(e){function t(e){return{id:e.id}}e.from=t;function n(e){return new qO(e.id)}e.to=n})(CM||={});var DM;(function(e){let t=(e,n)=>{let r=e.value;if(!r)return;let i={...EM.toPlain(r.item),parent:n,taskStates:r.tasks.map(e=>({state:e.state,duration:e.duration,messages:e.messages.filter(e=>e.type===PC.Error).map(SM.to)})),children:[]};if(e.children)for(let n of e.children.values()){let e=t(n,i);e&&i.children.push(e)}return i};function n(e){let n=new Ju;for(let t of e.items)n.insert(DC.fromString(t.item.extId).path,t);let r=[n.nodes],i=[];for(;r.length;)for(let e of r.pop())e.value?i.push(e):e.children&&r.push(e.children.values());return{completedAt:e.completedAt,results:i.map(e=>t(e)).filter($e)}}e.to=n})(DM||={});var OM;(function(e){function t(e){return{covered:e.covered,total:e.total}}function n(e){return`line`in e?sj.from(e):J.from(e)}function r(e){if(e)return`endLineNumber`in e?J.to(e):sj.to(e)}function i(e){if(e.type===QC.Statement){let t=[];if(e.branches)for(let n of e.branches)t.push({executed:n.count,location:r(n.location),label:n.label});return new QO(e.count,r(e.location),e.branches?.map(e=>new $O(e.count,r(e.location),e.label)))}else return new ek(e.name,e.count,r(e.location))}e.to=i;function a(e){if(typeof e.executed==`number`&&e.executed<0)throw Error(`Invalid coverage count ${e.executed}`);return`branches`in e?{count:e.executed,location:n(e.location),type:QC.Statement,branches:e.branches.length?e.branches.map(e=>({count:e.executed,location:e.location&&n(e.location),label:e.label})):void 0}:{type:QC.Declaration,name:e.name,count:e.executed,location:n(e.location)}}e.fromDetails=a;function o(e,n,r){return XO(r.statementCoverage),XO(r.branchCoverage),XO(r.declarationCoverage),{id:n,uri:r.uri,statement:t(r.statementCoverage),branch:r.branchCoverage&&t(r.branchCoverage),declaration:r.declarationCoverage&&t(r.declarationCoverage),testIds:r instanceof ZO&&r.includesTests.length?r.includesTests.map(t=>DC.fromExtHostTestItem(t,e).toString()):void 0}}e.fromFile=o})(OM||={});var kM;(function(e){function t(e){switch(e){case Lp.Invoke:return rE.Invoke;case Lp.Auto:return rE.Automatic}}e.to=t})(kM||={});var AM;(function(e){function t(e){let t=new ik(wj.to(e.kind),e.name,e.detail||``,w.revive(e.uri),J.to(e.range),J.to(e.selectionRange));return t._sessionId=e._sessionId,t._itemId=e._itemId,t}e.to=t;function n(e,t,n){if(t??=e._sessionId,n??=e._itemId,t===void 0||n===void 0)throw Error(`invalid item`);return{_sessionId:t,_itemId:n,kind:wj.from(e.kind),name:e.name,detail:e.detail??``,uri:e.uri,range:J.from(e.range),selectionRange:J.from(e.selectionRange),tags:e.tags?.map(Tj.from)}}e.from=n})(AM||={});var jM;(function(e){function t(e){if(e)return{value:e.value,tooltip:e.tooltip}}e.from=t})(jM||={});var MM;(function(e){function t(e,t,n){let r=t.fileData;return r?new xD(new SD(r.name,w.revive(r.uri),r.id,Be(()=>n(r.id)))):e===Uu.uriList&&t.uriListData?new bD(i(t.uriListData)):new bD(t.asString)}e.to=t;async function n(e,t,n=zc()){let i=await t.asString();if(e===Uu.uriList)return{id:n,asString:i,fileData:void 0,uriListData:r(i)};let a=t.asFile();return{id:n,asString:i,fileData:a?{name:a.name,uri:a.uri,id:a._itemId??a.id}:void 0}}e.from=n;function r(e){return Bc.split(e).map(e=>{if(e.startsWith(`#`))return e;try{return w.parse(e)}catch{}return e})}function i(e){return Bc.create(e.map(e=>typeof e==`string`?e:w.revive(e)))}})(MM||={});var NM;(function(e){function t(e,t){return new CD(e.items.map(([e,n])=>[e,MM.to(e,n,t)]))}e.toDataTransfer=t;async function n(e){return{items:await Promise.all(Array.from(e,async([e,t])=>[e,await MM.from(e,t)]))}}e.from=n;async function r(e){return{items:await Promise.all(Array.from(e,async([e,t])=>[e,await MM.from(e,t,t.id)]))}}e.fromList=r})(NM||={});var PM;(function(e){function t(e,t){return{kind:`reply`,agentId:e.participant??t?.agentId??``,subCommand:e.command??t?.command,message:e.prompt,title:e.label}}e.from=t;function n(e){return{prompt:e.message,label:e.title,participant:e.agentId,command:e.subCommand}}e.to=n})(PM||={});var FM;(function(e){function t(e){switch(e){case bx.System:return AA.System;case bx.User:return AA.User;case bx.Assistant:return AA.Assistant}}e.to=t;function n(e){switch(e){case AA.System:return bx.System;case AA.User:return bx.User;case AA.Assistant:return bx.Assistant}return bx.User}e.from=n})(FM||={});var IM;(function(e){function t(e){let t=e.content.map(e=>{if(e.type===`text`)return new RA(e.value,e.audience);if(e.type===`tool_result`){let t=pe(e.value.map(e=>{if(e.type===`text`)return new RA(e.value,e.audience);if(e.type===`data`)return new zA(e.data.buffer,e.mimeType);if(e.type===`prompt_tsx`)return new HA(e.value)}));return new jA(e.toolCallId,t,e.isError)}else if(e.type===`image_url`)return new zA(e.value.data.buffer,e.value.mimeType);else if(e.type===`data`)return new zA(e.data.buffer,e.mimeType);else if(e.type===`tool_use`)return new IA(e.toolCallId,e.name,e.parameters)}).filter(e=>e!==void 0);return new PA(FM.to(e.role),t,e.name)}e.to=t;function n(e){let t=FM.from(e.role),n=e.name,r=e.content;return typeof r==`string`&&(r=[new RA(r)]),{role:t,name:n,content:r.map(e=>{if(e instanceof jA)return{type:`tool_result`,toolCallId:e.callId,value:pe(e.content.map(e=>{if(e instanceof RA)return{type:`text`,value:e.value,audience:e.audience};if(e instanceof HA)return{type:`prompt_tsx`,value:e.value};if(e instanceof zA)return{type:`data`,mimeType:e.mimeType,data:b.wrap(e.data),audience:e.audience}})),isError:e.isError};if(e instanceof zA)return RM(e)?{type:`image_url`,value:{mimeType:e.mimeType,data:b.wrap(e.data)}}:{type:`data`,mimeType:e.mimeType,data:b.wrap(e.data),audience:e.audience};if(e instanceof IA)return{type:`tool_use`,toolCallId:e.callId,name:e.name,parameters:e.input};if(e instanceof RA)return{type:`text`,value:e.value};if(typeof e!=`string`)throw Error(`Unexpected chat message content type`);return{type:`text`,value:e}})}}e.from=n})(IM||={});var LM;(function(e){function t(e){let t=e.content.map(e=>{if(e.type===`text`)return new RA(e.value,e.audience);if(e.type===`tool_result`){let t=e.value.map(e=>e.type===`text`?new RA(e.value,e.audience):e.type===`data`?new zA(e.data.buffer,e.mimeType):new HA(e.value));return new jA(e.toolCallId,t,e.isError)}else if(e.type===`image_url`)return new zA(e.value.data.buffer,e.value.mimeType);else if(e.type===`data`)return new zA(e.data.buffer,e.mimeType);else if(e.type===`thinking`)return new VA(e.value,e.id,e.metadata);else return new IA(e.toolCallId,e.name,e.parameters)});return new FA(FM.to(e.role),t,e.name)}e.to=t;function n(e){let t=FM.from(e.role),n=e.name,r=e.content;return typeof r==`string`&&(r=[new RA(r)]),{role:t,name:n,content:r.map(e=>{if(e instanceof jA)return{type:`tool_result`,toolCallId:e.callId,value:pe(e.content.map(e=>{if(e instanceof RA)return{type:`text`,value:e.value,audience:e.audience};if(e instanceof HA)return{type:`prompt_tsx`,value:e.value};if(e instanceof zA)return{type:`data`,mimeType:e.mimeType,data:b.wrap(e.data),audience:e.audience}})),isError:e.isError};if(e instanceof zA)return RM(e)?{type:`image_url`,value:{mimeType:e.mimeType,data:b.wrap(e.data)}}:{type:`data`,mimeType:e.mimeType,data:b.wrap(e.data),audience:e.audience};if(e instanceof IA)return{type:`tool_use`,toolCallId:e.callId,name:e.name,parameters:e.input};if(e instanceof RA)return{type:`text`,value:e.value};if(e instanceof VA)return{type:`thinking`,value:e.value,id:e.id,metadata:e.metadata};if(typeof e!=`string`)throw Error(`Unexpected chat message content type llm 2`);return{type:`text`,value:e}})}}e.from=n})(LM||={});function RM(e){switch(typeof e.mimeType==`string`?e.mimeType.toLowerCase():``){case`image/png`:case`image/jpeg`:case`image/jpg`:case`image/gif`:case`image/webp`:case`image/bmp`:return!0;default:return!1}}var zM;(function(e){function t(e){return{kind:`markdownContent`,content:Y.from(e.value)}}e.from=t;function n(e){return new wk(Y.to(e.content))}e.to=n})(zM||={});var BM;(function(e){function t(e){return{kind:`codeblockUri`,uri:e.value,isEdit:e.isEdit,undoStopId:e.undoStopId}}e.from=t;function n(e){return new Vk(w.revive(e.uri),e.isEdit,e.undoStopId)}e.to=n})(BM||={});var VM;(function(e){function t(e){return{kind:`markdownVuln`,content:Y.from(e.value),vulnerabilities:e.vulnerabilities}}e.from=t;function n(e){return new Tk(Y.to(e.content),e.vulnerabilities)}e.to=n})(VM||={});var HM;(function(e){function t(e){return{kind:`confirmation`,title:e.title,message:Y.from(e.message),data:e.data,buttons:e.buttons}}e.from=t})(HM||={});var UM;(function(e){function t(e){switch(e){case Kk.Text:return`text`;case Kk.SingleSelect:return`singleSelect`;case Kk.MultiSelect:return`multiSelect`;default:return`text`}}function n(e){switch(e){case`text`:return Kk.Text;case`singleSelect`:return Kk.SingleSelect;case`multiSelect`:return Kk.MultiSelect;default:return Kk.Text}}function r(e){return{kind:`questionCarousel`,questions:e.questions.map(e=>({id:e.id,type:t(e.type),title:e.title,message:e.message?Y.from(e.message):void 0,options:e.options?.map(e=>({id:e.id,label:e.label,value:String(e.value)})),defaultValue:e.defaultValue,allowFreeformInput:e.allowFreeformInput})),allowSkip:e.allowSkip}}e.from=r;function i(e){return new Jk(e.questions.map(e=>new qk(e.id,n(e.type),e.title,{message:e.message?typeof e.message==`string`?new Qw(e.message):Y.to(e.message):void 0,options:e.options?.map(e=>({id:e.id,label:e.label,value:e.value})),defaultValue:e.defaultValue,allowFreeformInput:e.allowFreeformInput})),e.allowSkip)}e.to=i})(UM||={});var WM;(function(e){function t(e){let{value:t,baseUri:n}=e;function r(e,t){return e.map(e=>{let n=w.joinPath(t,e.name);return{label:e.name,uri:n,children:e.children&&r(e.children,n)}})}return{kind:`treeData`,treeData:{label:to(n),uri:n,children:r(t,n)}}}e.from=t;function n(e){let t=Hu(e.treeData);function n(e){return e.map(e=>({name:e.label,children:e.children&&n(e.children)}))}let r=t.uri;return new Dk(t.children?n(t.children):[],r)}e.to=n})(WM||={});var GM;(function(e){function t(e){return{kind:`multiDiffData`,multiDiffData:{title:e.title,resources:e.value.map(e=>({originalUri:e.originalUri,modifiedUri:e.modifiedUri,goToFileUri:e.goToFileUri,added:e.added,removed:e.removed}))},readOnly:e.readOnly}}e.from=t;function n(e){return new Ok(e.multiDiffData.resources.map(e=>({originalUri:e.originalUri?w.revive(e.originalUri):void 0,modifiedUri:e.modifiedUri?w.revive(e.modifiedUri):void 0,goToFileUri:e.goToFileUri?w.revive(e.goToFileUri):void 0,added:e.added,removed:e.removed})),e.multiDiffData.title,e.readOnly)}e.to=n})(GM||={});var KM;(function(e){function t(e){return{kind:`inlineReference`,name:e.title,inlineReference:(e=>w.isUri(e))(e.value)?e.value:(e=>`name`in e)(e.value)?Ej.from(e.value):aj.from(e.value)}}e.from=t;function n(e){let t=Hu(e);return new Mk(w.isUri(t.inlineReference)?t.inlineReference:`location`in t.inlineReference?Ej.to(t.inlineReference):aj.to(t.inlineReference),e.name)}e.to=n})(KM||={});var qM;(function(e){function t(e){return{kind:`progressMessage`,content:Y.from(e.value)}}e.from=t;function n(e){return new Nk(e.content.value)}e.to=n})(qM||={});var JM;(function(e){function t(e){return{kind:`thinking`,value:e.value,id:e.id,metadata:e.metadata}}e.from=t;function n(e){return new Fk(e.value??``,e.id,e.metadata)}e.to=n})(JM||={});var YM;(function(e){function t(e){return{kind:`hook`,hookType:e.hookType,stopReason:e.stopReason,systemMessage:e.systemMessage,metadata:e.metadata}}e.from=t;function n(e){return new Ik(e.hookType,e.stopReason,e.systemMessage,e.metadata)}e.to=n})(YM||={});var XM;(function(e){function t(e){return{kind:`warning`,content:Y.from(e.value)}}e.from=t;function n(e){return new Lk(e.content.value)}e.to=n})(XM||={});var ZM;(function(e){function t(e){return{kind:`info`,content:Y.from(e.value)}}e.from=t;function n(e){return new Rk(e.content.value)}e.to=n})(ZM||={});var QM;(function(e){function t(e){return{kind:`extensions`,extensions:e.extensions}}e.from=t})(QM||={});var $M;(function(e){function t(e,t,n){let r;if(e.command)r=t.toInternal(e.command,n);else{if(!e.uri)throw Error(`Pull request part must have a command if URI is provided`);r={title:`Open Pull Request`,id:`vscode.open`,arguments:[e.uri]}}return{kind:`pullRequest`,author:e.author,title:e.title,description:e.description,uri:e.uri,linkTag:e.linkTag,command:r}}e.from=t})($M||={});var eN;(function(e){function t(e){return{kind:`move`,uri:e.uri,range:J.from(e.range)}}e.from=t;function n(e){return new Uk(w.revive(e.uri),J.to(e.range))}e.to=n})(eN||={});var tN;(function(e){function t(e){let t,a;e.toolSpecificData&&n(e.toolSpecificData)?(t=r(e.toolSpecificData,e.isError),a=void 0):a=e.toolSpecificData?i(e.toolSpecificData):void 0;let o=e.presentation===`hidden`?Mb.Hidden:e.presentation===`hiddenAfterComplete`?Mb.HiddenAfterComplete:void 0;return e.enablePartialUpdate?{kind:`externalToolInvocationUpdate`,toolCallId:e.toolCallId,toolName:e.toolName,isComplete:!!e.isComplete,invocationMessage:e.invocationMessage?Y.from(e.invocationMessage):void 0,pastTenseMessage:e.pastTenseMessage?Y.from(e.pastTenseMessage):void 0,toolSpecificData:a,subagentInvocationId:e.subAgentInvocationId,resultDetails:t}:{kind:`toolInvocationSerialized`,toolCallId:e.toolCallId,toolId:e.toolName,invocationMessage:e.invocationMessage?Y.from(e.invocationMessage):e.toolName,originMessage:e.originMessage?Y.from(e.originMessage):void 0,pastTenseMessage:e.pastTenseMessage?Y.from(e.pastTenseMessage):void 0,isConfirmed:e.isConfirmed,isComplete:!0,source:Ab.External,toolSpecificData:a,resultDetails:t,presentation:o,subAgentInvocationId:e.subAgentInvocationId}}e.from=t;function n(e){return typeof e==`object`&&!!e&&`input`in e&&typeof e.input==`string`&&`output`in e&&Array.isArray(e.output)}function r(e,t){return{input:e.input,output:e.output.map(e=>{let t=e.mimeType.startsWith(`text/`);return{type:`embed`,mimeType:e.mimeType,value:t?b.wrap(e.data).toString():Wt(b.wrap(e.data)),isText:t}}),isError:t??!1}}function i(e){return`command`in e&&`language`in e?{kind:`terminal`,command:e.command,language:e.language}:`commandLine`in e&&`language`in e?{kind:`terminal`,presentationOverrides:e.presentationOverrides&&typeof e.presentationOverrides.commandLine==`string`?{commandLine:e.presentationOverrides.commandLine,language:e.presentationOverrides.language}:void 0,commandLine:e.commandLine,language:e.language,terminalCommandOutput:typeof e.output?.text==`string`?{text:e.output.text}:void 0,terminalCommandState:e.state?{exitCode:e.state.exitCode,duration:e.state.duration}:void 0}:`todoList`in e&&Array.isArray(e.todoList)?{kind:`todoList`,todoList:e.todoList.map(e=>({id:String(e.id),title:e.title,status:a(e.status)}))}:`input`in e&&`output`in e&&!Array.isArray(e.output)?{kind:`simpleToolInvocation`,input:typeof e.input==`string`?e.input:``,output:typeof e.output==`string`?e.output:``}:e&&`values`in e&&Array.isArray(e.values)?{kind:`resources`,values:e.values.map(e=>e instanceof dT?aj.from(e):w.revive(e))}:e instanceof Ak?{kind:`subagent`,description:e.description,agentName:e.agentName,prompt:e.prompt,result:e.result}:e}function a(e){switch(e){case Qk.NotStarted:return`not-started`;case Qk.InProgress:return`in-progress`;case Qk.Completed:return`completed`;default:return`not-started`}}function o(e){switch(e){case`not-started`:return Qk.NotStarted;case`in-progress`:return Qk.InProgress;case`completed`:return Qk.Completed;default:return Qk.NotStarted}}function s(e){let t=new eA(e.toolId||e.toolName,e.toolCallId,e.errorMessage);return e.invocationMessage&&(t.invocationMessage=e.invocationMessage),e.originMessage&&(t.originMessage=e.originMessage),e.pastTenseMessage&&(t.pastTenseMessage=e.pastTenseMessage),e.isConfirmed!==void 0&&(t.isConfirmed=e.isConfirmed),e.isComplete!==void 0&&(t.isComplete=e.isComplete),e.toolSpecificData&&(t.toolSpecificData=c(e.toolSpecificData)),t.subAgentInvocationId=e.subAgentInvocationId,t.subAgentName=e.subAgentName,t}e.to=s;function c(e){if(e.kind===`terminal`)if(e.commandLine){let t={commandLine:e.commandLine,language:e.language};return e.terminalCommandOutput&&(t.output={text:e.terminalCommandOutput.text,truncated:e.terminalCommandOutput.truncated,lineCount:e.terminalCommandOutput.lineCount}),e.terminalCommandState&&(t.state={exitCode:e.terminalCommandState.exitCode,duration:e.terminalCommandState.duration}),t}else return{command:e.command,language:e.language};else if(e.kind===`terminal2`)return{commandLine:e.commandLine,language:e.language};else if(e.kind===`todoList`)return{todoList:e.todoList.map((e,t)=>{let n=Number(e.id);return{id:Number.isFinite(n)?n:t,title:e.title,status:o(e.status)}})};return e}})(tN||={});var nN;(function(e){function t(e){return{kind:`progressTask`,content:Y.from(e.value)}}e.from=t})(nN||={});var rN;(function(e){function t(e){return{kind:`progressTaskResult`,content:typeof e==`string`?Y.from(e):void 0}}e.from=t})(rN||={});var iN;(function(e){function t(e,t,n){return{kind:`command`,command:t.toInternal(e.value,n)??{command:e.value.command,title:e.value.title}}}e.from=t;function n(e,t){return new zk(t.fromInternal(e.command)??{command:e.command.id,title:e.command.title})}e.to=n})(iN||={});var aN;(function(e){function t(e){return{kind:`textEdit`,uri:e.uri,edits:e.edits.map(e=>Sj.from(e)),done:e.isDone}}e.from=t;function n(e){let t=new Yk(w.revive(e.uri),e.edits.map(e=>Sj.to(e)));return t.isDone=e.done,t}e.to=n})(aN||={});var oN;(function(e){function t(e){return e.newCellMetadata?{editType:sC.Metadata,index:e.range.start,metadata:e.newCellMetadata}:e.newNotebookMetadata?{editType:sC.DocumentMetadata,metadata:e.newNotebookMetadata}:{editType:sC.Replace,index:e.range.start,count:e.range.end-e.range.start,cells:e.newCells.map(mM.from)}}e.from=t})(oN||={});var sN;(function(e){function t(e){return{kind:`notebookEdit`,uri:e.uri,edits:e.edits.map(oN.from),done:e.isDone}}e.from=t})(sN||={});var cN;(function(e){function t(e){return{kind:`workspaceEdit`,edits:e.edits.map(e=>({oldResource:e.oldResource,newResource:e.newResource}))}}e.from=t})(cN||={});var lN;(function(e){function t(e){let t=fl.isThemeIcon(e.iconPath)?e.iconPath:w.isUri(e.iconPath)?{light:w.revive(e.iconPath)}:e.iconPath&&`light`in e.iconPath&&`dark`in e.iconPath&&w.isUri(e.iconPath.light)&&w.isUri(e.iconPath.dark)?{light:w.revive(e.iconPath.light),dark:w.revive(e.iconPath.dark)}:void 0;return typeof e.value==`object`&&`variableName`in e.value?{kind:`reference`,reference:{variableName:e.value.variableName,value:w.isUri(e.value.value)||!e.value.value?e.value.value:aj.from(e.value.value)},iconPath:t,options:e.options}:{kind:`reference`,reference:w.isUri(e.value)||typeof e.value==`string`?e.value:aj.from(e.value),iconPath:t,options:e.options}}e.from=t;function n(e){let t=Hu(e),n=e=>w.isUri(e)?e:aj.to(e);return new Bk(typeof t.reference==`string`?t.reference:`variableName`in t.reference?{variableName:t.reference.variableName,value:t.reference.value&&n(t.reference.value)}:n(t.reference))}e.to=n})(lN||={});var uN;(function(e){function t(e){return{kind:`codeCitation`,value:e.value,license:e.license,snippet:e.snippet}}e.from=t})(uN||={});var dN;(function(e){function t(e,t,n){return e instanceof wk?zM.from(e):e instanceof Mk?KM.from(e):e instanceof Bk?lN.from(e):e instanceof Nk?qM.from(e):e instanceof Fk?JM.from(e):e instanceof Ik?YM.from(e):e instanceof Dk?WM.from(e):e instanceof Ok?GM.from(e):e instanceof zk?iN.from(e,t,n):e instanceof Yk?aN.from(e):e instanceof Xk?sN.from(e):e instanceof Tk?VM.from(e):e instanceof Vk?BM.from(e):e instanceof Lk?XM.from(e):e instanceof Rk?ZM.from(e):e instanceof Ek?HM.from(e):e instanceof Jk?UM.from(e):e instanceof Hk?uN.from(e):e instanceof Uk?eN.from(e):e instanceof Wk?QM.from(e):e instanceof Gk?$M.from(e,t,n):e instanceof eA?tN.from(e):e instanceof Zk?cN.from(e):{kind:`markdownContent`,content:Y.from(``)}}e.from=t;function n(e,t){switch(e.kind){case`reference`:return lN.to(e);case`markdownContent`:case`inlineReference`:case`progressMessage`:case`treeData`:case`command`:return r(e,t)}}e.to=n;function r(e,t){switch(e.kind){case`markdownContent`:return zM.to(e);case`inlineReference`:return KM.to(e);case`progressMessage`:return;case`treeData`:return WM.to(e);case`command`:return iN.to(e,t)}}e.toContent=r})(dN||={});var fN;(function(e){function t(e,t,n,r,i,a,o,s){let c=[],l=[];for(let t of e.variables.variables)t.kind===`tool`?c.push(t):t.kind===`toolset`?c.push(...t.value):l.push(t);let u=oh.parseLocalSessionId(e.sessionResource)??e.sessionResource.toString(),d={id:e.requestId,prompt:e.message,command:e.command,attempt:e.attempt??0,enableCommandDetection:e.enableCommandDetection??!0,isParticipantDetected:e.isParticipantDetected??!1,sessionId:u,sessionResource:e.sessionResource,references:l.map(e=>hN.to(e,i,s)).filter($e),toolReferences:c.map(gN.to),location:pN.to(e.location),acceptedConfirmationData:e.acceptedConfirmationData,rejectedConfirmationData:e.rejectedConfirmationData,location2:t,toolInvocationToken:Object.freeze({sessionResource:e.sessionResource,workingDirectory:w.revive(e.workingDirectory)}),tools:a,model:n,modelConfiguration:r,editedFileEvents:e.editedFileEvents,modeInstructions:e.modeInstructions?.content,modeInstructions2:vN.to(e.modeInstructions),permissionLevel:e.permissionLevel,subAgentInvocationId:e.subAgentInvocationId,subAgentName:e.subAgentName,parentRequestId:e.parentRequestId,hasHooksEnabled:e.hasHooksEnabled??!1,hooks:e.hooks?LN.to(e.hooks):void 0,isSystemInitiated:e.isSystemInitiated};return Dw(o)||(delete d.id,delete d.attempt,delete d.enableCommandDetection,delete d.isParticipantDetected,delete d.location,delete d.location2,delete d.editedFileEvents,delete d.sessionId,delete d.subAgentInvocationId,delete d.subAgentName,delete d.parentRequestId,delete d.hasHooksEnabled,delete d.hooks),Dw(o)||(delete d.acceptedConfirmationData,delete d.rejectedConfirmationData,delete d.tools),d}e.to=t})(fN||={});var pN;(function(e){function t(e){switch(e){case hy.Notebook:return iA.Notebook;case hy.Terminal:return iA.Terminal;case hy.Chat:return iA.Panel;case hy.EditorInline:return iA.Editor}}e.to=t;function n(e){switch(e){case iA.Notebook:return hy.Notebook;case iA.Terminal:return hy.Terminal;case iA.Panel:return hy.Chat;case iA.Editor:return hy.EditorInline}}e.from=n})(pN||={});var mN;(function(e){function t(e){return e.id}e.from=t})(mN||={});var hN;(function(e){function t(e,t,n){let r=e.value;if(!r){let t;try{t=JSON.stringify(e)}catch{t=`kind=${e.kind}, id=${e.id}, name=${e.name}`}n.error(`[ChatPromptReference] Ignoring invalid reference in variable: ${t}`);return}if(ri(r))r=w.revive(r);else if(r&&typeof r==`object`&&`uri`in r&&`range`in r&&ri(r.uri))r=aj.to(Hu(r));else if(fh(e)){let t=e.references?.[0]?.reference;r=new OA(e.mimeType??`image/png`,()=>Promise.resolve(new Uint8Array(Object.values(e.value))),t&&w.isUri(t)?t:void 0)}else if(e.kind===`diagnostic`){let n=e.filterSeverity&&fj.to(e.filterSeverity),i=e.filterUri&&w.revive(e.filterUri).toString();r=new kA(t.map(([t,r])=>e.filterUri&&t.toString()!==i?[t,[]]:[t,r.filter(t=>!(n&&t.severity>n||e.filterRange&&!bp.areIntersectingOrTouching(e.filterRange,J.from(t.range))))]).filter(([,e])=>e.length>0))}let i;return(ph(e)||mh(e))&&e.toolReferences&&(i=_N.to(e.toolReferences)),{id:e.id,name:e.name,range:e.range&&[e.range.start,e.range.endExclusive],toolReferences:i,value:r,modelDescription:e.modelDescription}}e.to=t})(hN||={});var gN;(function(e){function t(e){if(e.value)throw Error(`Invalid tool reference`);return{name:e.id,range:e.range&&[e.range.start,e.range.endExclusive]}}e.to=t})(gN||={});var _N;(function(e){function t(e){let t=[];for(let n of e)if(n.kind===`tool`)t.push(gN.to(n));else if(n.kind===`toolset`)t.push(...n.value.map(gN.to));else throw Error(`Invalid tool reference in prompt variables`);return t}e.to=t})(_N||={});var vN;(function(e){function t(e){if(e)return{uri:w.revive(e.uri),name:e.name,content:e.content,toolReferences:_N.to(Hu(e.toolReferences)),metadata:e.metadata,isBuiltin:e.isBuiltin}}e.to=t;function n(e){if(e)return{uri:e.uri,name:e.name,content:e.content,toolReferences:e.toolReferences?.map(e=>({kind:`tool`,id:e.name,name:e.name,value:void 0,range:e.range?{start:e.range[0],endExclusive:e.range[1]}:void 0}))??[],metadata:e.metadata,isBuiltin:e.isBuiltin}}e.from=n})(vN||={});var yN;(function(e){function t(e,t,n){return{id:e.id,label:e.label,fullName:e.fullName,icon:e.icon?.id,value:e.values[0].value,insertText:e.insertText,detail:e.detail,documentation:e.documentation,command:t.toInternal(e.command,n)}}e.from=t})(yN||={});var bN;(function(e){function t(e){return{errorDetails:e.errorDetails,metadata:r(e.metadata),nextQuestion:e.nextQuestion,details:e.details}}e.to=t;function n(e){return{errorDetails:e.errorDetails,metadata:e.metadata,nextQuestion:e.nextQuestion,details:e.details}}e.from=n;function r(e){return ic(e,e=>{if(e.$mid===Er.LanguageModelToolResult)return new WA(ic(e.content,r));if(e.$mid===Er.LanguageModelTextPart)return new RA(e.value);if(e.$mid===Er.LanguageModelThinkingPart)return new VA(e.value,e.id,e.metadata);if(e.$mid===Er.LanguageModelPromptTsxPart)return new HA(e.value);if(e.$mid===Er.LanguageModelDataPart){let t;if(e.data&&typeof e.data==`object`&&e.data.type===`Buffer`&&Array.isArray(e.data.data))t=new Uint8Array(e.data.data);else if(typeof e.data==`string`)try{t=Ut(e.data).buffer}catch{t=new Uint8Array}else t=new Uint8Array;return new zA(t,e.mimeType,e.audience)}})}})(bN||={});var xN;(function(e){function t(e,t,n){if(t.action.kind===`vote`)return;let r=bN.to(e);if(t.action.kind===`command`){let e=t.action.commandButton.command;return{action:{kind:`command`,commandButton:{command:n.fromInternal(e)??{command:e.id,title:e.title}}},result:r}}else if(t.action.kind===`followUp`)return{action:{kind:`followUp`,followup:PM.to(t.action.followup)},result:r};else if(t.action.kind===`inlineChat`)return{action:{kind:`editor`,accepted:t.action.action===`accepted`},result:r};else if(t.action.kind===`chatEditingSessionAction`)return{action:{kind:`chatEditingSessionAction`,outcome:new Map([[`accepted`,bk.Accepted],[`rejected`,bk.Rejected],[`saved`,bk.Saved]]).get(t.action.outcome)??bk.Rejected,uri:w.revive(t.action.uri),hasRemainingEdits:t.action.hasRemainingEdits},result:r};else if(t.action.kind===`chatEditingHunkAction`)return{action:{kind:`chatEditingHunkAction`,outcome:new Map([[`accepted`,bk.Accepted],[`rejected`,bk.Rejected]]).get(t.action.outcome)??bk.Rejected,uri:w.revive(t.action.uri),hasRemainingEdits:t.action.hasRemainingEdits,lineCount:t.action.lineCount,linesAdded:t.action.linesAdded,linesRemoved:t.action.linesRemoved},result:r};else return{action:t.action,result:r}}e.to=t})(xN||={});var SN;(function(e){function t(e,t,n){return`terminalCommand`in e?{terminalCommand:e.terminalCommand,shouldExecute:e.shouldExecute}:`uri`in e?{uri:e.uri}:t.toInternal(e,n)}e.from=t})(SN||={});var CN;(function(e){function t(e){return{...e,documentation:Y.fromStrict(e.documentation)}}e.from=t})(CN||={});var wN;(function(e){function t(e,t){return Array.isArray(e)?{items:e.map(e=>CN.from(e))}:{items:e.items.map(e=>CN.from(e)),resourceOptions:e.resourceOptions?TN.from(e.resourceOptions,t):void 0}}e.from=t})(wN||={});var TN;(function(e){function t(e,t){return{...e,pathSeparator:t,cwd:e.cwd,globPattern:cM.from(e.globPattern)??void 0}}e.from=t})(TN||={});var EN;(function(e){function t(e){return{kind:DN.to(e.kind),acceptedLength:e.acceptedLength}}e.to=t})(EN||={});var DN;(function(e){function t(e){switch(e){case Mp.Word:return TE.Word;case Mp.Line:return TE.Line;case Mp.Suggest:return TE.Suggest;default:return TE.Unknown}}e.to=t})(DN||={});var ON;(function(e){function t(e,t){if(e.kind===Ip.Ignored){let n=e.supersededBy?t(e.supersededBy):void 0;return{kind:EE.Ignored,supersededBy:n,userTypingDisagreed:e.userTypingDisagreed}}else if(e.kind===Ip.Accepted)return{kind:EE.Accepted};return{kind:EE.Rejected}}e.to=t})(ON||={});var kN;(function(e){function t(e){return e===DE.Label?Fp.Label:Fp.Code}e.from=t;function n(e){switch(e){case Fp.Label:return DE.Label;default:return DE.Code}}e.to=n})(kN||={});var AN;(function(e){function t(e,t){return{id:t,label:e.label,description:e.description,canEdit:e.canEdit,collapsibleState:e.collapsibleState||Vx.None,contextValue:e.contextValue}}e.from=t})(AN||={});var jN;(function(e){function t(e){if(e.type===`mcp`)return new YA(e.label,e.serverLabel||e.label,e.instructions);if(e.type===`extension`)return new JA(e.extensionId.value,e.label)}e.to=t})(jN||={});var MN;(function(e){function t(e){let t=new WA(e.content.map(e=>e.kind===`text`?new RA(e.value,e.audience):e.kind===`data`?new zA(e.value.data.buffer,e.value.mimeType,e.audience):new HA(e.value)));return e.toolMetadata!==void 0&&(t.toolMetadata=e.toolMetadata),e.toolResultError&&(t.hasError=!!e.toolResultError),t}e.to=t;function n(e,t){e.toolResultMessage&&K(t,`chatParticipantPrivate`);let n=e=>{e.audience&&K(t,`languageModelToolResultAudience`)},r=!1,i;Array.isArray(e.toolResultDetails)?i=e.toolResultDetails?.map(e=>w.isUri(e)?e:aj.from(e)):e.toolResultDetails2&&(i={output:{type:`data`,mimeType:e.toolResultDetails2.mime,value:b.wrap(e.toolResultDetails2.value)}},r=!0);let a={content:e.content.map(e=>{if(e instanceof RA)return n(e),{kind:`text`,value:e.value,audience:e.audience};if(e instanceof HA)return{kind:`promptTsx`,value:e.value};if(e instanceof zA)return n(e),r=!0,{kind:`data`,value:{mimeType:e.mimeType,data:b.wrap(e.data)},audience:e.audience};throw Error(`Unknown LanguageModelToolResult part type`)}),toolResultMessage:Y.fromStrict(e.toolResultMessage),toolResultDetails:i,toolMetadata:e.toolMetadata,toolResultError:e.hasError};return r?new _i(a):a}e.from=n})(MN||={});var NN;(function(e){function t(e){return e}e.fromThemeIcon=t;function n(e){if(e){if(fl.isThemeIcon(e)||w.isUri(e))return e;if(typeof e==`string`)return w.file(e);if(typeof e==`object`&&e&&`dark`in e){let t=typeof e.dark==`string`?w.file(e.dark):e.dark,n=typeof e.light==`string`?w.file(e.light):e.light;return t?{dark:t,light:n??t}:void 0}else return}}e.from=n;function r(e){if(e){if(fl.isThemeIcon(e))return e;if(ri(e))return w.revive(e);{let t=e;return{light:w.revive(t.light),dark:w.revive(t.dark)}}}}e.to=r})(NN||={});var PN;(function(e){function t(e){return{query:e.query,kind:n(e.kind),settings:e.settings}}e.fromSettingsSearchResult=t;function n(e){switch(e){case ow.EMBEDDED:return ow.EMBEDDED;case ow.LLM_RANKED:return ow.LLM_RANKED;case ow.CANCELED:return ow.CANCELED;default:throw Error(`Unknown AiSettingsSearchResultKind`)}}})(PN||={});var FN;(function(e){function t(e){return!!e.uri}function n(e){return oS.toSerialized(t(e)?{type:aS.HTTP,uri:e.uri,headers:Object.entries(e.headers),authentication:e.authentication?{providerId:e.authentication.providerId,scopes:e.authentication.scopes}:void 0}:{type:aS.Stdio,cwd:e.cwd?.fsPath,args:e.args,command:e.command,env:e.env,envFile:void 0,sandbox:void 0})}e.from=n;function r(e){let t=oS.fromSerialized(e.launch);if(t.type===aS.HTTP)return new rj(e.label,t.uri,Object.fromEntries(t.headers),e.cacheNonce===`$$NONE`?void 0:e.cacheNonce);{let n=new nj(e.label,t.command,[...t.args],Object.fromEntries(Object.entries(t.env).map(([e,t])=>[e,t===null?null:String(t)])),e.cacheNonce===`$$NONE`?void 0:e.cacheNonce);return t.cwd&&(n.cwd=w.file(t.cwd)),n}}e.to=r})(FN||={});var IN;(function(e){function t(e){switch(e){case WE.Error:return xC.Error;case WE.Warning:return xC.Warning;case WE.Information:return xC.Information;default:throw Error(`Unknown SourceControlInputBoxValidationType`)}}e.from=t})(IN||={});var LN;(function(e){function t(e){let t={};for(let[n,r]of Object.entries(e)){if(!r||r.length===0)continue;let e=[];for(let t of r){let n=RN.to(t);n&&e.push(n)}e.length>0&&(t[n]=e)}return t}e.to=t})(LN||={});var RN;(function(e){function t(e){let t=Db(e,Fn);if(t)return{command:t,cwd:e.cwd,env:e.env,timeout:e.timeout}}e.to=t})(RN||={});var zN;(function(e){function t(e){if(e!==void 0)switch(e){case 0:return nh.Failed;case 1:return nh.Completed;case 2:return nh.InProgress;case 3:return nh.NeedsInput;default:return}}function n(e){let n=e.timing,r=n?.created??n?.startTime??0,i=n?.lastRequestStarted??n?.startTime,a=n?.lastRequestEnded??n?.endTime;return{resource:e.resource,label:e.label,description:e.description?Y.from(e.description):void 0,badge:e.badge?Y.from(e.badge):void 0,status:t(e.status),archived:e.archived,tooltip:Y.fromStrict(e.tooltip),timing:{created:r,lastRequestStarted:i,lastRequestEnded:a},changes:e.changes instanceof Array?e.changes:void 0,metadata:e.metadata,legacyResource:e.legacyResource}}e.from=n})(zN||={});var BN=class{constructor(e,t,n){this.uri=e,this.ranges=t,this.previewText=n}},VN=class{constructor(e,t,n){this.uri=e,this.text=t,this.lineNumber=n}},HN=class{constructor(e){this.keyword=e}},UN;(function(e){e[e.None=1]=`None`,e[e.FilesExclude=2]=`FilesExclude`,e[e.SearchAndFilesExclude=3]=`SearchAndFilesExclude`})(UN||={});var WN;(function(e){e[e.Information=1]=`Information`,e[e.Warning=2]=`Warning`})(WN||={});var GN;(function(e){e[e.file=0]=`file`,e[e.text=1]=`text`,e[e.aiText=2]=`aiText`})(GN||={});var KN;(function(e){e[e.File=1]=`File`,e[e.Text=2]=`Text`,e[e.aiText=3]=`aiText`})(KN||={});function qN(e){return!!e.rangeLocations&&!!e.previewText}var JN;(function(e){e[e.Normal=0]=`Normal`,e[e.NewSearchStarted=1]=`NewSearchStarted`})(JN||={});var YN=class{constructor(e,t,n,r){this.rangeLocations=[],this.webviewIndex=r;let i=Array.isArray(t)?t:[t];if(n&&n.matchLines===1&&XN(i)){e=Aa(e,n.matchLines);let t=``,r=0,a=0,o=Math.floor(n.charsPerLine/5);for(let s of i){let i=Math.max(s.startColumn-o,0),c=s.startColumn+n.charsPerLine;if(i>a+o+56){let n=`⟪ `+(i-a)+` characters skipped ⟫`;t+=n+e.slice(i,c),r+=i-(a+n.length)}else t+=e.slice(a,c);a=c,this.rangeLocations.push({source:s,preview:new QN(0,s.startColumn-r,s.endColumn-r)})}this.previewText=t}else{let n=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber,r=ye(t,e=>({preview:new ZN(e.startLineNumber-n,e.startColumn,e.endLineNumber-n,e.endColumn),source:e}));this.rangeLocations=Array.isArray(r)?r:[r],this.previewText=e}}};function XN(e){let t=e[0].startLineNumber;for(let n of e)if(n.startLineNumber!==t||n.endLineNumber!==t)return!1;return!0}var ZN=class{constructor(e,t,n,r){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r}},QN=class extends ZN{constructor(e,t,n){super(e,t,e,n)}},$N;(function(e){e.List=`list`,e.Tree=`tree`})($N||={});var eP;(function(e){e.Default=`default`,e.FileNames=`fileNames`,e.Type=`type`,e.Modified=`modified`,e.CountDescending=`countDescending`,e.CountAscending=`countAscending`})(eP||={});var tP;(function(e){e.Auto=`auto`,e.Manual=`manual`,e.RunOnEmpty=`runOnEmpty`})(tP||={});function nP(e,t=!0){let n=e&&e.files&&e.files.exclude,r=t&&e&&e.search&&e.search.exclude;if(!n&&!r)return;if(!n||!r)return n||r||void 0;let i=Object.create(null);return i=oc(i,tc(n)),i=oc(i,tc(r),!0),i}function rP(e,t){let n=e.ignoreGlobCase?{ignoreCase:!0}:void 0;return e.excludePattern&&BS(e.excludePattern,t,n)?!1:e.includePattern||e.usingSearchPaths?e.includePattern&&BS(e.includePattern,t,n)?!0:e.usingSearchPaths?!!e.folderQueries&&e.folderQueries.some(r=>{let i=r.folder.fsPath;if(Ba(t,i,e.ignoreGlobCase)){let e=Wr(i,t);return!r.includePattern||!!BS(r.includePattern,e,n)}else return!1}):!1:!0}var iP;(function(e){e[e.unknownEncoding=1]=`unknownEncoding`,e[e.regexParseError=2]=`regexParseError`,e[e.globParseError=3]=`globParseError`,e[e.invalidLiteral=4]=`invalidLiteral`,e[e.rgProcessError=5]=`rgProcessError`,e[e.other=6]=`other`,e[e.canceled=7]=`canceled`})(iP||={});function aP(e,t){let n={...e||{},...t||{}};return Object.keys(n).filter(e=>{let t=n[e];return typeof t==`boolean`&&t})}var oP=class{constructor(e,t){this._parsedIncludeExpression=null;let n=e.ignoreGlobCase||t.ignoreGlobCase?{ignoreCase:!0}:void 0;this._excludeExpression=t.excludePattern?.map(t=>({...e.excludePattern||{},...t.pattern||{}}))??[],this._excludeExpression.length===0&&(this._excludeExpression=[e.excludePattern||{}]),this._parsedExcludeExpression=this._excludeExpression.map(e=>VS(e,n));let r=e.includePattern;t.includePattern&&(r=r?{...r,...t.includePattern}:t.includePattern),r&&(this._parsedIncludeExpression=VS(r,n))}_evalParsedExcludeExpression(e,t,n){let r=null;for(let i of this._parsedExcludeExpression){let a=i(e,t,n);if(typeof a==`string`){r=a;break}}return r}matchesExcludesSync(e,t,n){return!!(this._parsedExcludeExpression&&this._evalParsedExcludeExpression(e,t,n))}includedInQuerySync(e,t,n){return!(this._parsedExcludeExpression&&this._evalParsedExcludeExpression(e,t,n)||this._parsedIncludeExpression&&!this._parsedIncludeExpression(e,t,n))}includedInQuery(e,t,n){let r=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,n):!0;return Promise.all(this._parsedExcludeExpression.map(i=>{let a=i(e,t,n);return fo(a)?a.then(e=>e?!1:r()):r()})).then(e=>e.some(e=>!!e))}hasSiblingExcludeClauses(){return this._excludeExpression.reduce((e,t)=>sP(t)||e,!1)}};function sP(e){for(let t in e)if(typeof e[t]!=`boolean`)return!0;return!1}function cP(e){if(!e)return;let t;return n=>(t||=(e()||Promise.resolve([])).then(e=>e?uP(e):{}),t.then(e=>!!e[n]))}function lP(e){if(!e)return;let t;return n=>{if(!t){let n=e();t=n?uP(n):{}}return!!t[n]}}function uP(e){let t={};for(let n of e)t[n]=!0;return t}function dP(e){return e.flatMap(e=>e.patterns.map(t=>e.baseUri?{baseUri:e.baseUri,pattern:t}:t))}const fP={matchLines:100,charsPerLine:1e4},pP=`utf8`,mP=`utf8bom`,hP=`utf16be`,gP=`utf16le`,_P=[254,255],vP=[255,254],yP=[239,187,191];var bP;(function(e){e[e.STREAM_IS_BINARY=1]=`STREAM_IS_BINARY`})(bP||={});var xP=class extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}},SP=class t{static async create(n){let r;if(n!==`utf8`)r=(await import(`./iconv-lite-umd-COfjYshr.js`).then(t=>e(t.default,1))).getDecoder(TP(n));else{let e=new TextDecoder;r={write(t){return e.decode(t,{stream:!0})},end(){return e.decode()}}}return new t(r)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}};function CP(e,t){let n=t.minBytesRequiredForDetection??(t.guessEncoding?4096:512);return new Promise((r,i)=>{let a=xt(e=>e.join(``)),o=[],s=0,c,l=new Ii,u=async()=>{try{let e=await PP({buffer:b.concat(o),bytesRead:s},t.guessEncoding,t.candidateGuessEncodings);if(e.seemsBinary&&t.acceptTextOnly)throw new xP(`Stream is binary but only text is accepted for decoding`,bP.STREAM_IS_BINARY);e.encoding=await t.overwriteEncoding(e.encoding),c=await SP.create(e.encoding);let n=c.write(b.concat(o).buffer);a.write(n),o.length=0,s=0,r({stream:a,detected:e})}catch(e){l.cancel(),a.destroy(),i(e)}};Tt(e,{onData:async t=>{c?a.write(c.write(t.buffer)):(o.push(t),s+=t.byteLength,s>=n&&(e.pause(),await u(),setTimeout(()=>e.resume())))},onError:e=>a.error(e),onEnd:async()=>{c||await u(),a.end(c?.end())}},l.token)})}async function wP(t,n,r){let i=(await import(`./iconv-lite-umd-COfjYshr.js`).then(t=>e(t.default,1))).getEncoder(TP(n),r),a=!1,o=!1;return{read(){if(o)return null;let e=t.read();if(typeof e!=`string`){if(o=!0,!a&&r?.addBOM)switch(n){case pP:case mP:return b.wrap(Uint8Array.from(yP));case hP:return b.wrap(Uint8Array.from(_P));case gP:return b.wrap(Uint8Array.from(vP))}let e=i.end();return e&&e.length>0?(a=!0,b.wrap(e)):null}return a=!0,b.wrap(i.write(e))}}}function TP(e){return e===`utf8bom`||e===null?pP:e}function EP(e,t){if(!e||t<_P.length)return null;let n=e.readUInt8(0),r=e.readUInt8(1);if(n===_P[0]&&r===_P[1])return hP;if(n===vP[0]&&r===vP[1])return gP;if(t<yP.length)return null;let i=e.readUInt8(2);return n===yP[0]&&r===yP[1]&&i===yP[2]?mP:null}const DP=[`ascii`,`utf-16`,`utf-32`];async function OP(t,n){let r=await import(`./jschardet-Bf-VMK4F.js`).then(t=>e(t.default,1)),i=NP(t.slice(0,65536).buffer);n&&(n=pe(n.map(e=>MP(e))),n.length===0&&(n=void 0));let a;try{a=r.detect(i,n?{detectEncodings:n}:void 0)}catch{return null}if(!a?.encoding)return null;let o=a.encoding.toLowerCase();return 0<=DP.indexOf(o)?null:jP(a.encoding)}const kP={ibm866:`cp866`,big5:`cp950`};function AP(e){return e.replace(/[^a-zA-Z0-9]/g,``).toLowerCase()}function jP(e){let t=AP(e);return kP[t]||t}function MP(e){let t=IP[AP(e)];return t?t.guessableName:void 0}function NP(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function PP({buffer:e,bytesRead:t},n,r){let i=EP(e,t),a=!1;if(i!==`utf16be`&&i!==`utf16le`&&e){let n=!0,r=!0,o=!1;for(let i=0;i<t&&i<512;i++){let t=i%2==1,a=e.readUInt8(i)===0;if(a&&(o=!0),n&&(t&&!a||!t&&a)&&(n=!1),r&&(t&&a||!t&&!a)&&(r=!1),a&&!n&&!r)break}o&&(n?i=gP:r?i=hP:a=!0)}return n&&!a&&!i&&e?OP(e.slice(0,t),r).then(e=>({seemsBinary:!1,encoding:e})):{seemsBinary:a,encoding:i}}const FP={utf8:{labelLong:`UTF-8`,labelShort:`UTF-8`,order:1,alias:`utf8bom`,guessableName:`UTF-8`},utf8bom:{labelLong:`UTF-8 with BOM`,labelShort:`UTF-8 with BOM`,encodeOnly:!0,order:2,alias:`utf8`},utf16le:{labelLong:`UTF-16 LE`,labelShort:`UTF-16 LE`,order:3,guessableName:`UTF-16LE`},utf16be:{labelLong:`UTF-16 BE`,labelShort:`UTF-16 BE`,order:4,guessableName:`UTF-16BE`},windows1252:{labelLong:`Western (Windows 1252)`,labelShort:`Windows 1252`,order:5,guessableName:`windows-1252`},iso88591:{labelLong:`Western (ISO 8859-1)`,labelShort:`ISO 8859-1`,order:6},iso88593:{labelLong:`Western (ISO 8859-3)`,labelShort:`ISO 8859-3`,order:7},iso885915:{labelLong:`Western (ISO 8859-15)`,labelShort:`ISO 8859-15`,order:8},macroman:{labelLong:`Western (Mac Roman)`,labelShort:`Mac Roman`,order:9},cp437:{labelLong:`DOS (CP 437)`,labelShort:`CP437`,order:10},windows1256:{labelLong:`Arabic (Windows 1256)`,labelShort:`Windows 1256`,order:11},iso88596:{labelLong:`Arabic (ISO 8859-6)`,labelShort:`ISO 8859-6`,order:12},windows1257:{labelLong:`Baltic (Windows 1257)`,labelShort:`Windows 1257`,order:13},iso88594:{labelLong:`Baltic (ISO 8859-4)`,labelShort:`ISO 8859-4`,order:14},iso885914:{labelLong:`Celtic (ISO 8859-14)`,labelShort:`ISO 8859-14`,order:15},windows1250:{labelLong:`Central European (Windows 1250)`,labelShort:`Windows 1250`,order:16,guessableName:`windows-1250`},iso88592:{labelLong:`Central European (ISO 8859-2)`,labelShort:`ISO 8859-2`,order:17,guessableName:`ISO-8859-2`},cp852:{labelLong:`Central European (CP 852)`,labelShort:`CP 852`,order:18},windows1251:{labelLong:`Cyrillic (Windows 1251)`,labelShort:`Windows 1251`,order:19,guessableName:`windows-1251`},cp866:{labelLong:`Cyrillic (CP 866)`,labelShort:`CP 866`,order:20,guessableName:`IBM866`},cp1125:{labelLong:`Cyrillic (CP 1125)`,labelShort:`CP 1125`,order:21,guessableName:`IBM1125`},iso88595:{labelLong:`Cyrillic (ISO 8859-5)`,labelShort:`ISO 8859-5`,order:22,guessableName:`ISO-8859-5`},koi8r:{labelLong:`Cyrillic (KOI8-R)`,labelShort:`KOI8-R`,order:23,guessableName:`KOI8-R`},koi8u:{labelLong:`Cyrillic (KOI8-U)`,labelShort:`KOI8-U`,order:24},iso885913:{labelLong:`Estonian (ISO 8859-13)`,labelShort:`ISO 8859-13`,order:25},windows1253:{labelLong:`Greek (Windows 1253)`,labelShort:`Windows 1253`,order:26,guessableName:`windows-1253`},iso88597:{labelLong:`Greek (ISO 8859-7)`,labelShort:`ISO 8859-7`,order:27,guessableName:`ISO-8859-7`},windows1255:{labelLong:`Hebrew (Windows 1255)`,labelShort:`Windows 1255`,order:28,guessableName:`windows-1255`},iso88598:{labelLong:`Hebrew (ISO 8859-8)`,labelShort:`ISO 8859-8`,order:29,guessableName:`ISO-8859-8`},iso885910:{labelLong:`Nordic (ISO 8859-10)`,labelShort:`ISO 8859-10`,order:30},iso885916:{labelLong:`Romanian (ISO 8859-16)`,labelShort:`ISO 8859-16`,order:31},windows1254:{labelLong:`Turkish (Windows 1254)`,labelShort:`Windows 1254`,order:32},iso88599:{labelLong:`Turkish (ISO 8859-9)`,labelShort:`ISO 8859-9`,order:33},cp857:{labelLong:`Turkish (CP 857)`,labelShort:`CP 857`,order:34},windows1258:{labelLong:`Vietnamese (Windows 1258)`,labelShort:`Windows 1258`,order:35},gbk:{labelLong:`Simplified Chinese (GBK)`,labelShort:`GBK`,order:36},gb18030:{labelLong:`Simplified Chinese (GB18030)`,labelShort:`GB18030`,order:37},cp950:{labelLong:`Traditional Chinese (Big5)`,labelShort:`Big5`,order:38,guessableName:`Big5`},big5hkscs:{labelLong:`Traditional Chinese (Big5-HKSCS)`,labelShort:`Big5-HKSCS`,order:39},shiftjis:{labelLong:`Japanese (Shift JIS)`,labelShort:`Shift JIS`,order:40,guessableName:`SHIFT_JIS`},eucjp:{labelLong:`Japanese (EUC-JP)`,labelShort:`EUC-JP`,order:41,guessableName:`EUC-JP`},euckr:{labelLong:`Korean (EUC-KR)`,labelShort:`EUC-KR`,order:42,guessableName:`EUC-KR`},windows874:{labelLong:`Thai (Windows 874)`,labelShort:`Windows 874`,order:43},iso885911:{labelLong:`Latin/Thai (ISO 8859-11)`,labelShort:`ISO 8859-11`,order:44},koi8ru:{labelLong:`Cyrillic (KOI8-RU)`,labelShort:`KOI8-RU`,order:45},koi8t:{labelLong:`Tajik (KOI8-T)`,labelShort:`KOI8-T`,order:46},gb2312:{labelLong:`Simplified Chinese (GB 2312)`,labelShort:`GB 2312`,order:47,guessableName:`GB2312`},cp865:{labelLong:`Nordic DOS (CP 865)`,labelShort:`CP 865`,order:48},cp850:{labelLong:`Western European DOS (CP 850)`,labelShort:`CP 850`,order:49}},IP=(()=>{let e={};for(let t in FP)FP[t].guessableName&&(e[t]=FP[t]);return e})();var LP;(function(e){e[e.FILE_IS_BINARY=0]=`FILE_IS_BINARY`})(LP||={});var RP;(function(e){e[e.SAVED=0]=`SAVED`,e[e.DIRTY=1]=`DIRTY`,e[e.PENDING_SAVE=2]=`PENDING_SAVE`,e[e.CONFLICT=3]=`CONFLICT`,e[e.ORPHAN=4]=`ORPHAN`,e[e.ERROR=5]=`ERROR`})(RP||={});var zP;(function(e){e[e.EDITOR=1]=`EDITOR`,e[e.REFERENCE=2]=`REFERENCE`,e[e.OTHER=3]=`OTHER`})(zP||={});var BP;(function(e){e[e.Encode=0]=`Encode`,e[e.Decode=1]=`Decode`})(BP||={});function VP(e){let t=!1;return{read(){return t?null:(t=!0,e)}}}function HP(e,t,n){return new Ya(e=>KP(e,n)).isEqual(e,t)}function UP(e,t,n){return HP(e.uri,t.uri,n)?0:na(e.uri.toString(),t.uri.toString())}function WP(e,t,n){return e.index===t.index?HP(e.uri,t.uri,n)?na(e.name,t.name):na(e.uri.toString(),t.uri.toString()):e.index<t.index?-1:1}function GP(e,t,n,r){return fe(e.slice(0).sort((e,t)=>n(e,t,r)),t.slice(0).sort((e,t)=>n(e,t,r)),(e,t)=>n(e,t,r))}function KP(e,t){let n=t.getCapabilities(e.scheme);return!(n&&n&mc.PathCaseSensitive)}var qP=class e extends Pc{static toExtHostWorkspace(t,n,r,i){if(!t)return{workspace:null,added:[],removed:[]};let{id:a,name:o,folders:s,configuration:c,transient:l,isUntitled:u}=t,d=[],f=n;n?s.forEach((t,a)=>{let o=w.revive(t.uri),s=e._findFolder(r||n,o,i);s?(s.name=t.name,s.index=t.index,d.push(s)):d.push({uri:o,name:t.name,index:a})}):d.push(...s.map(({uri:e,name:t,index:n})=>({uri:w.revive(e),name:t,index:n}))),d.sort((e,t)=>e.index<t.index?-1:1);let p=new e(a,o,d,!!l,c?w.revive(c):null,!!u,e=>KP(e,i)),{added:m,removed:h}=GP(f?f.workspaceFolders:[],p.workspaceFolders,UP,i);return{workspace:p,added:m,removed:h}}static _findFolder(e,t,n){for(let r=0;r<e.folders.length;r++){let i=e.workspaceFolders[r];if(HP(i.uri,t,n))return i}}constructor(e,t,n,r,i,a,o){super(e,n.map(e=>new Fc(e)),r,i,o),this._name=t,this._isUntitled=a,this._workspaceFolders=[],this._structure=ec.forUris(o,()=>!0),n.forEach(e=>{this._workspaceFolders.push(e),this._structure.set(e.uri,e)})}get name(){return this._name}get isUntitled(){return this._isUntitled}get workspaceFolders(){return this._workspaceFolders.slice(0)}getWorkspaceFolder(e,t){return t&&this._structure.get(e)&&(e=ro(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}};let JP=class{constructor(e,t,n,r,i){this._onDidChangeWorkspace=new S,this.onDidChangeWorkspace=this._onDidChangeWorkspace.event,this._onDidGrantWorkspaceTrust=new S,this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event,this._onDidChangeWorkspaceTrustedFolders=new S,this.onDidChangeWorkspaceTrustedFolders=this._onDidChangeWorkspaceTrustedFolders.event,this._activeSearchCallbacks=[],this._trusted=!1,this._editSessionIdentityProviders=new Map,this._providerHandlePool=0,this._onWillCreateEditSessionIdentityEvent=new cr,this._canonicalUriProviders=new Map,this._logService=r,this._extHostFileSystemInfo=n,this._uriTransformerService=i,this._requestIdProvider=new uc,this._barrier=new To,this._proxy=e.getProxy(E.MainThreadWorkspace),this._messageService=e.getProxy(E.MainThreadMessageService),this._telemetryProxy=e.getProxy(E.MainThreadTelemetry);let a=t.workspace;this._confirmedWorkspace=a?new qP(a.id,a.name,[],!!a.transient,a.configuration?w.revive(a.configuration):null,!!a.isUntitled,e=>KP(e,n)):void 0}$setConfigProvider(e){this._configProvider=e}_useIgnoreFilesInFindFiles(){return this._configProvider?.getConfiguration(`search`).get(`experimental.useIgnoreFilesInFindFiles`)??!1}_userIgnoreFilesSetting(){return this._configProvider?.getConfiguration(`search`).get(`useIgnoreFiles`)??!0}$initializeWorkspace(e,t){this._trusted=t,this.$acceptWorkspaceData(e),this._barrier.open()}waitForInitializeCall(){return this._barrier.wait()}get workspace(){return this._actualWorkspace}get name(){return this._actualWorkspace?this._actualWorkspace.name:void 0}get workspaceFile(){if(this._actualWorkspace&&this._actualWorkspace.configuration)return this._actualWorkspace.isUntitled?w.from({scheme:O.untitled,path:to(ro(this._actualWorkspace.configuration))}):this._actualWorkspace.configuration}get _actualWorkspace(){return this._unconfirmedWorkspace||this._confirmedWorkspace}getWorkspaceFolders(){if(this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}async getWorkspaceFolders2(){if(await this._barrier.wait(),this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}updateWorkspaceFolders(e,t,n,...r){let i=[];if(Array.isArray(r)&&r.forEach(e=>{w.isUri(e.uri)&&!i.some(t=>HP(t.uri,e.uri,this._extHostFileSystemInfo))&&i.push({uri:e.uri,name:e.name||eo(e.uri)})}),this._unconfirmedWorkspace||[t,n].some(e=>typeof e!=`number`||e<0)||n===0&&i.length===0)return!1;let a=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+n>a.length)return!1;let o=a.slice(0);o.splice(t,n,...i.map(e=>({uri:e.uri,name:e.name||eo(e.uri),index:void 0})));for(let e=0;e<o.length;e++){let t=o[e];if(o.some((n,r)=>r!==e&&HP(t.uri,n.uri,this._extHostFileSystemInfo)))return!1}o.forEach((e,t)=>e.index=t);let{added:s,removed:c}=GP(a,o,WP,this._extHostFileSystemInfo);if(s.length===0&&c.length===0)return!1;if(this._proxy){let r=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(r,t,n,i).then(void 0,t=>{this._unconfirmedWorkspace=void 0;let n={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(Dc.Error,x(2881,`Extension '{0}' failed to update workspace folders: {1}`,r,t.toString()),n,[])})}return this.trySetWorkspaceFolders(o),!0}getWorkspaceFolder(e,t){if(this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async getWorkspaceFolder2(e,t){if(await this._barrier.wait(),this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async resolveWorkspaceFolder(e){if(await this._barrier.wait(),this._actualWorkspace)return this._actualWorkspace.resolveWorkspaceFolder(e)}getPath(){if(!this._actualWorkspace)return;let{folders:e}=this._actualWorkspace;if(e.length!==0)return e[0].uri.fsPath}getRelativePath(e,t){let n,r=``;if(typeof e==`string`?(n=w.file(e),r=e):e!==void 0&&(n=e,r=e.fsPath),!n)return r;let i=this.getWorkspaceFolder(n,!0);if(!i)return r;t===void 0&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let a=ao(i.uri,n);return t&&i.name&&(a=`${i.name}/${a}`),a}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=qP.toExtHostWorkspace({id:this._actualWorkspace.id,name:this._actualWorkspace.name,configuration:this._actualWorkspace.configuration,folders:e,isUntitled:this._actualWorkspace.isUntitled},this._actualWorkspace,void 0,this._extHostFileSystemInfo).workspace||void 0)}$acceptWorkspaceData(e){let{workspace:t,added:n,removed:r}=qP.toExtHostWorkspace(e,this._confirmedWorkspace,this._unconfirmedWorkspace,this._extHostFileSystemInfo);this._confirmedWorkspace=t||void 0,this._unconfirmedWorkspace=void 0,this._onDidChangeWorkspace.fire(Object.freeze({added:n,removed:r}))}findFiles(e,t,n,r,i=Pi.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${r.value}, entryPoint: findFiles`);let a=``,o=!0;t===null?o=!1:t!==void 0&&(a=typeof t==`string`?t:t.pattern);let s=this._useIgnoreFilesInFindFiles()&&t!==null?void 0:!1;return this._findFilesImpl({type:`include`,value:e},{exclude:[a],maxResults:n,useExcludeSettings:o?UN.FilesExclude:UN.None,useIgnoreFiles:{local:s}},r,`findFiles`,{useIgnoreFilesLocal:void 0,excludeWasNull:t===null},i)}findFiles2(e,t={},n,r=Pi.None){return this._logService.trace(`extHostWorkspace#findFiles2New: fileSearch, extension: ${n.value}, entryPoint: findFiles2New`),this._findFilesImpl({type:`filePatterns`,value:e},t,n,`findFiles2`,{useIgnoreFilesLocal:t.useIgnoreFiles?.local,excludeWasNull:!1},r)}async _findFilesImpl(e,t,n,r,i,a){let o=i.useIgnoreFilesLocal===!0?`true`:i.useIgnoreFilesLocal===!1?`false`:`unspecified`,s=new Yn(!0),c=0,l=this._userIgnoreFilesSetting(),u=0,d=!1,f=!1;try{if(a.isCancellationRequested)return d=!0,[];let n=e.type===`include`?[e.value]:e.value??[];if(!Array.isArray(n))throw console.error(`Invalid file pattern provided`,n),Error(`Invalid file pattern provided ${JSON.stringify(n)}`);let r=n.map(n=>{let r=ZP(t.exclude),i={ignoreSymlinks:typeof t.followSymlinks==`boolean`?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles?.local==`boolean`?!t.useIgnoreFiles.local:void 0,disregardGlobalIgnoreFiles:typeof t.useIgnoreFiles?.global==`boolean`?!t.useIgnoreFiles.global:void 0,disregardParentIgnoreFiles:typeof t.useIgnoreFiles?.parent==`boolean`?!t.useIgnoreFiles.parent:void 0,disregardExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings===UN.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==UN.SearchAndFilesExclude,maxResults:t.maxResults,excludePattern:r.length>0?r:void 0,ignoreGlobCase:t.caseInsensitive,_reason:`startFileSearch`,shouldGlobSearch:e.type===`include`?void 0:!0},a=XP(cM.from(n)),o=a?.folder;return e.type===`include`?i.includePattern=a?.pattern:i.filePattern=a?.pattern,{folder:o,options:i}});c=r.length;let i=this._userIgnoreFilesSetting();l=r.every(e=>e.options.disregardIgnoreFiles===!0?!1:e.options.disregardIgnoreFiles===!1?!0:i);let o=await this._findFilesBase(r,a);return u=o.length,d=a.isCancellationRequested,o}catch(e){throw f=!0,d=a.isCancellationRequested,e}finally{this._reportFindFilesTelemetry({extensionId:n.value,apiKind:r,respectedIgnoreFiles:l,useIgnoreFilesLocalRequested:o,excludeWasNull:i.excludeWasNull,resultCount:u,durationMs:s.elapsed(),queryCount:c,cancelled:d,errored:f})}}async _findFilesBase(e,t){let n=t,r;if(!Pi.isCancellationToken(t)){r=new Ii;let e=t;typeof e.onCancellationRequested==`function`&&e.onCancellationRequested(()=>r.cancel()),n=r.token}let i=(await Promise.all(e?.map(e=>this._proxy.$startFileSearch(e.folder??null,e.options,n).then(e=>Array.isArray(e)?e.map(e=>w.revive(e)):[]))??[])).flat();r?.dispose();let a=new Ya(e=>KP(e,this._extHostFileSystemInfo)),o=new Map;for(let e of i){let t=a.getComparisonKey(e);o.has(t)||o.set(t,e)}return Array.from(o.values())}_reportFindFilesTelemetry(e){this._telemetryProxy.$publicLog2(`extHostFindFiles`,e)}findTextInFiles2(e,t,n,r=Pi.None){this._logService.trace(`extHostWorkspace#findTextInFiles2: textSearch, extension: ${n.value}, entryPoint: findTextInFiles2`);let i=e=>{if(!t)return{folder:void 0,options:{}};let n=e?XP(cM.from(e)):void 0,r=t.exclude?ZP(t.exclude):void 0;return{options:{ignoreSymlinks:typeof t.followSymlinks==`boolean`?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles?.local==`boolean`?!t.useIgnoreFiles?.local:void 0,disregardGlobalIgnoreFiles:typeof t.useIgnoreFiles?.global==`boolean`?!t.useIgnoreFiles?.global:void 0,disregardParentIgnoreFiles:typeof t.useIgnoreFiles?.parent==`boolean`?!t.useIgnoreFiles?.parent:void 0,disregardExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings===UN.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==UN.SearchAndFilesExclude,fileEncoding:t.encoding,maxResults:t.maxResults,ignoreGlobCase:t.caseInsensitive,previewOptions:t.previewOptions?{matchLines:t.previewOptions?.numMatchLines??100,charsPerLine:t.previewOptions?.charsPerLine??1e4}:void 0,surroundingContext:t.surroundingContext,includePattern:n?.pattern,excludePattern:r},folder:n?.folder}},a=(t?.include?.map(e=>i(e))??[i(void 0)]).filter(e=>!!e),o=new v,s=o.add(new S),c=this.findTextInFilesBase(e,a,(e,t)=>s.fire({result:e,uri:t}),r);return{results:new Wo(async e=>{o.add(s.event(t=>{let n=t.result,r=t.uri;qN(n)?e.emitOne(new BN(r,n.rangeLocations.map(e=>({previewRange:new nT(e.preview.startLineNumber,e.preview.startColumn,e.preview.endLineNumber,e.preview.endColumn),sourceRange:new nT(e.source.startLineNumber,e.source.startColumn,e.source.endLineNumber,e.source.endColumn)})),n.previewText)):e.emitOne(new VN(r,n.text,n.lineNumber))})),await c}),complete:c.then(e=>(o.dispose(),{limitHit:e?.limitHit??!1}))}}async findTextInFilesBase(e,t,n,r=Pi.None){let i=this._requestIdProvider.getNext(),a=!1;if(r.onCancellationRequested(e=>{a=!0}),this._activeSearchCallbacks[i]=e=>{if(a)return;let t=w.revive(e.resource);e.results.forEach(e=>{n(Hu(e),t)})},r.isCancellationRequested)return{};try{let n=await Promise.all(t?.map(t=>this._proxy.$startTextSearch(e,t.folder??null,t.options,i,r)||{})??[]);return delete this._activeSearchCallbacks[i],n.reduce((e,t)=>({limitHit:e?.limitHit||(t?.limitHit??!1),message:[e?.message??[],t?.message??[]].flat()}),{})??{limitHit:!1}}catch(e){throw delete this._activeSearchCallbacks[i],e}}async findTextInFiles(e,t,n,r,i=Pi.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${r.value}, entryPoint: findTextInFiles`);let a=t.previewOptions===void 0?{matchLines:100,charsPerLine:1e4}:t.previewOptions,o=XP(cM.from(t.include)),s=typeof t.exclude==`string`?t.exclude:t.exclude?t.exclude.pattern:void 0,c={ignoreSymlinks:typeof t.followSymlinks==`boolean`?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles==`boolean`?!t.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof t.useGlobalIgnoreFiles==`boolean`?!t.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof t.useParentIgnoreFiles==`boolean`?!t.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof t.useDefaultExcludes==`boolean`?!t.useDefaultExcludes:!0,disregardSearchExcludeSettings:typeof t.useSearchExclude==`boolean`?!t.useSearchExclude:!0,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:a,surroundingContext:t.afterContext,includePattern:o?.pattern,excludePattern:s?[{pattern:s}]:void 0};return this.findTextInFilesBase(e,[{options:c,folder:o?.folder}],(e,t)=>{qN(e)?n({uri:t,preview:{text:e.previewText,matches:ye(e.rangeLocations,e=>new nT(e.preview.startLineNumber,e.preview.startColumn,e.preview.endLineNumber,e.preview.endColumn))},ranges:ye(e.rangeLocations,e=>new nT(e.source.startLineNumber,e.source.startColumn,e.source.endLineNumber,e.source.endColumn))}):n({uri:t,text:e.text,lineNumber:e.lineNumber})},i)}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){let t=await this._proxy.$save(e,{saveAs:!1});return w.revive(t)}async saveAs(e){let t=await this._proxy.$save(e,{saveAs:!0});return w.revive(t)}saveAll(e){return this._proxy.$saveAll(e)}resolveProxy(e){return this._proxy.$resolveProxy(e)}lookupAuthorization(e){return this._proxy.$lookupAuthorization(e)}lookupKerberosAuthorization(e){return this._proxy.$lookupKerberosAuthorization(e)}loadCertificates(){return this._proxy.$loadCertificates()}get trusted(){return this._trusted}requestResourceTrust(e){return this._proxy.$requestResourceTrust(e)}requestWorkspaceTrust(e){return this._proxy.$requestWorkspaceTrust(e)}$onDidGrantWorkspaceTrust(){this._trusted||(this._trusted=!0,this._onDidGrantWorkspaceTrust.fire())}$onDidChangeWorkspaceTrustedFolders(){this._onDidChangeWorkspaceTrustedFolders.fire()}isResourceTrusted(e){return this._proxy.$isResourceTrusted(e)}registerEditSessionIdentityProvider(e,t){if(this._editSessionIdentityProviders.has(e))throw Error(`A provider has already been registered for scheme ${e}`);this._editSessionIdentityProviders.set(e,t);let n=this._uriTransformerService.transformOutgoingScheme(e),r=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(r,n),_(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(r)})}async $getEditSessionIdentifier(e,t){this._logService.info(`Getting edit session identifier for workspaceFolder`,e);let n=await this.resolveWorkspaceFolder(w.revive(e));if(!n){this._logService.warn(`Unable to resolve workspace folder`);return}this._logService.info(`Invoking #provideEditSessionIdentity for workspaceFolder`,n);let r=this._editSessionIdentityProviders.get(n.uri.scheme);if(this._logService.info(`Provider for scheme ${n.uri.scheme} is defined: `,!!r),!r)return;let i=await r.provideEditSessionIdentity(n,t);if(this._logService.info(`Provider returned edit session identifier: `,i),i)return i}async $provideEditSessionIdentityMatch(e,t,n,r){this._logService.info(`Getting edit session identifier for workspaceFolder`,e);let i=await this.resolveWorkspaceFolder(w.revive(e));if(!i){this._logService.warn(`Unable to resolve workspace folder`);return}this._logService.info(`Invoking #provideEditSessionIdentity for workspaceFolder`,i);let a=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!a),!a)return;let o=await a.provideEditSessionIdentityMatch?.(t,n,r);if(this._logService.info(`Provider returned edit session identifier match result: `,o),o)return o}getOnWillCreateEditSessionIdentityEvent(e){return(t,n,r)=>{let i=function(e){t.call(n,e)};return i.extension=e,this._onWillCreateEditSessionIdentityEvent.event(i,void 0,r)}}async $onWillCreateEditSessionIdentity(e,t,n){let r=await this.resolveWorkspaceFolder(w.revive(e));if(r===void 0)throw Error(`Unable to resolve workspace folder`);await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:r},t,async(e,t)=>{let r=Date.now();await Promise.resolve(e),Date.now()-r>n&&this._logService.warn(`SLOW edit session create-participant`,t.extension.identifier)}),t.isCancellationRequested}registerCanonicalUriProvider(e,t){if(this._canonicalUriProviders.has(e))throw Error(`A provider has already been registered for scheme ${e}`);this._canonicalUriProviders.set(e,t);let n=this._uriTransformerService.transformOutgoingScheme(e),r=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(r,n),_(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(r)})}async provideCanonicalUri(e,t,n){let r=this._canonicalUriProviders.get(e.scheme);if(!r)return;let i=await r.provideCanonicalUri?.(w.revive(e),t,n);if(i)return i}async $provideCanonicalUri(e,t,n){return this.provideCanonicalUri(w.revive(e),{targetScheme:t},n)}async decode(e,t){let[n,r]=this.toEncodeDecodeParameters(t),i=await this._proxy.$resolveDecoding(n,r),a=(await CP(Ht(b.wrap(e)),{...i,acceptTextOnly:!0,overwriteEncoding:e=>e===null||e===i.preferredEncoding?Promise.resolve(i.preferredEncoding):this._proxy.$validateDetectedEncoding(n,e,r)})).stream;return wt(a,e=>e.join(``))}async encode(e,t){let[n,r]=this.toEncodeDecodeParameters(t),{encoding:i,addBOM:a}=await this._proxy.$resolveEncoding(n,r);return i===`utf8`&&!a?b.fromString(e).buffer:Bt(await wP(VP(e),i,{addBOM:a})).buffer}toEncodeDecodeParameters(e){let t=ri(e?.uri)?e.uri:void 0,n=typeof e?.encoding==`string`?e.encoding:void 0;return[t,n?{encoding:n}:void 0]}};JP=A([j(0,Hs),j(1,Fs),j(2,Rc),j(3,Ds),j(4,Ws)],JP);const YP=k(`IExtHostWorkspace`);function XP(e){let t,n;if(e)return typeof e==`string`?t=e:(t=e.pattern,n=w.revive(e.baseUri)),{pattern:t,folder:n}}function ZP(e){return(e?.map(e=>{if(typeof e==`string`)return e===``?void 0:{pattern:e,uri:void 0};{let t=XP(e);return t?{pattern:t.pattern,uri:t.folder}:void 0}})??[]).filter(e=>!!e)}function QP(e){return Object.isFrozen(e)?e:nc(e)}var $P=class e{static createEmptyModel(t){return new e({},[],[],void 0,t)}constructor(e,t,n,r,i){this._contents=e,this._keys=t,this._overrides=n,this._raw=r,this.logService=i,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this._raw){let t=(Array.isArray(this._raw)?this._raw:[this._raw]).map(t=>{if(t instanceof e)return t;let n=new eF(``,this.logService);return n.parseRaw(t),n.configurationModel});this._rawConfiguration=t.reduce((e,t)=>t===e?t:e.merge(t),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}get raw(){if(this._raw&&!(Array.isArray(this._raw)&&this._raw.every(t=>t instanceof e)))return this._raw}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?Xh(this.contents,e):this.contents}inspect(t,n){let r=this;return{get value(){return QP(r.rawConfiguration.getValue(t))},get override(){return n?QP(r.rawConfiguration.getOverrideValue(t,n)):void 0},get merged(){return QP(n?r.rawConfiguration.override(n).getValue(t):r.rawConfiguration.getValue(t))},get overrides(){let n=[];for(let{contents:i,identifiers:a,keys:o}of r.rawConfiguration.overrides){let s=new e(i,o,[],void 0,r.logService).getValue(t);s!==void 0&&n.push({identifiers:a,value:s})}return n.length?QP(n):void 0}}}getOverrideValue(e,t){let n=this.getContentsForOverrideIdentifer(t);return n?e?Xh(n,e):n:void 0}getKeysForOverrideIdentifier(e){let t=[];for(let n of this.overrides)n.identifiers.includes(e)&&t.push(...n.keys);return _e(t)}getAllOverrideIdentifiers(){let e=[];for(let t of this.overrides)e.push(...t.identifiers);return _e(e)}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...t){let n=tc(this.contents),r=tc(this.overrides),i=[...this.keys],a=this._raw?Array.isArray(this._raw)?[...this._raw]:[this._raw]:[this];for(let e of t)if(a.push(...e._raw?Array.isArray(e._raw)?e._raw:[e._raw]:[e]),!e.isEmpty()){this.mergeContents(n,e.contents);for(let t of e.overrides){let[e]=r.filter(e=>se(e.identifiers,t.identifiers));e?(this.mergeContents(e.contents,t.contents),e.keys.push(...t.keys),e.keys=_e(e.keys)):r.push(tc(t))}for(let t of e.keys)i.indexOf(t)===-1&&i.push(t)}return new e(n,i,r,!a.length||a.every(t=>t instanceof e)?void 0:a,this.logService)}createOverrideConfigurationModel(t){let n=this.getContentsForOverrideIdentifer(t);if(!n||typeof n!=`object`||!Object.keys(n).length)return this;let r={};for(let e of _e([...Object.keys(this.contents),...Object.keys(n)])){let t=this.contents[e],i=n[e];i&&(typeof t==`object`&&typeof i==`object`?(t=tc(t),this.mergeContents(t,i)):t=i),r[e]=t}return new e(r,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(let n of Object.keys(t)){if(n in e&&Je(e[n])&&Je(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=tc(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null,r=e=>{e&&(n?this.mergeContents(n,e):n=tc(e))};for(let n of this.overrides)n.identifiers.length===1&&n.identifiers[0]===e?t=n.contents:n.identifiers.includes(e)&&r(n.contents);return r(t),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){let t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Jh(this.contents,e),xg.test(e)&&this.overrides.splice(this.overrides.findIndex(t=>se(t.identifiers,Sg(e))),1))}updateValue(e,t,n){if(qh(this.contents,e,t,e=>this.logService.error(e)),n||=this.keys.indexOf(e)===-1,n&&this.keys.push(e),xg.test(e)){let t=this.contents[e],n=Sg(e),r={identifiers:n,keys:Object.keys(t),contents:Kh(t,e=>this.logService.error(e))},i=this.overrides.findIndex(e=>se(e.identifiers,n));i===-1?this.overrides.push(r):this.overrides[i]=r}}},eF=class{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||$P.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!et(e)){let n=this.doParseContent(e);this.parseRaw(n,t)}}reparse(e){this._raw&&this.parseRaw(this._raw,e)}parseRaw(e,t){this._raw=e;let{contents:n,keys:r,overrides:i,restricted:a,hasExcludedProperties:o}=this.doParseRaw(e,t);this._configurationModel=new $P(n,r,i,o?[e]:void 0,this.logService),this._restrictedConfigurations=a||[]}doParseContent(e){let t={},n=null,r=[],i=[];function a(e){Array.isArray(r)?r.push(e):n!==null&&(r[n]=e)}let o={onObjectBegin:()=>{let e={};a(e),i.push(r),r=e,n=null},onObjectProperty:e=>{n=e},onObjectEnd:()=>{r=i.pop()},onArrayBegin:()=>{let e=[];a(e),i.push(r),r=e,n=null},onArrayEnd:()=>{r=i.pop()},onLiteralValue:a,onError:(e,t,n)=>{}};if(e)try{Oy(e,o),t=r[0]||{}}catch(e){this.logService.error(`Error while parsing settings file ${this._name}: ${e}`),this._parseErrors=[e]}return t}doParseRaw(e,t){let n=wm.as(ag.Configuration),r=n.getConfigurationProperties(),i=n.getExcludedConfigurationProperties(),a=this.filter(e,r,i,!0,t);return e=a.raw,{contents:Kh(e,e=>this.logService.error(`Conflict in settings file ${this._name}: ${e}`)),keys:Object.keys(e),overrides:this.toOverrides(e,e=>this.logService.error(`Conflict in settings file ${this._name}: ${e}`)),restricted:a.restricted,hasExcludedProperties:a.hasExcludedProperties}}filter(e,t,n,r,i){let a=!1;if(!i?.scopes&&!i?.skipRestricted&&!i?.skipUnregistered&&!i?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:a};let o={},s=[];for(let c in e)if(xg.test(c)&&r){let r=this.filter(e[c],t,n,!1,i);o[c]=r.raw,a||=r.hasExcludedProperties,s.push(...r.restricted)}else{let r=t[c];r?.restricted&&s.push(c),this.shouldInclude(c,r,n,i)?o[c]=e[c]:a=!0}return{raw:o,restricted:s,hasExcludedProperties:a}}shouldInclude(e,t,n,r){if(r.exclude?.includes(e))return!1;if(r.include?.includes(e))return!0;if(r.skipRestricted&&t?.restricted||r.skipUnregistered&&!t)return!1;let i=t??n[e],a=i?i.scope===void 0?og.WINDOW:i.scope:void 0;return a===void 0||r.scopes===void 0?!0:r.scopes.includes(a)}toOverrides(e,t){let n=[];for(let r of Object.keys(e))if(xg.test(r)){let i={},a=e[r];for(let e in a)i[e]=a[e];n.push({identifiers:Sg(r),keys:Object.keys(i),contents:Kh(i,t)})}return n}},tF=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=r,this.defaultConfiguration=i,this.policyConfiguration=a,this.applicationConfiguration=o,this.userConfiguration=s,this.localUserConfiguration=c,this.remoteUserConfiguration=l,this.workspaceConfiguration=u,this.folderConfigurationModel=d,this.memoryConfigurationModel=f}get value(){return QP(this._value)}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e:void 0}get defaultInspectValue(){return this._defaultInspectValue||=this.defaultConfiguration.inspect(this.key,this.overrides.overrideIdentifier),this._defaultInspectValue}get defaultValue(){return this.defaultInspectValue.merged}get default(){return this.toInspectValue(this.defaultInspectValue)}get policyInspectValue(){return this._policyInspectValue===void 0&&(this._policyInspectValue=this.policyConfiguration?this.policyConfiguration.inspect(this.key):null),this._policyInspectValue}get policyValue(){return this.policyInspectValue?.merged}get policy(){return this.policyInspectValue?.value===void 0?void 0:{value:this.policyInspectValue.value}}get applicationInspectValue(){return this._applicationInspectValue===void 0&&(this._applicationInspectValue=this.applicationConfiguration?this.applicationConfiguration.inspect(this.key):null),this._applicationInspectValue}get applicationValue(){return this.applicationInspectValue?.merged}get application(){return this.toInspectValue(this.applicationInspectValue)}get userInspectValue(){return this._userInspectValue||=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier),this._userInspectValue}get userValue(){return this.userInspectValue.merged}get user(){return this.toInspectValue(this.userInspectValue)}get userLocalInspectValue(){return this._userLocalInspectValue||=this.localUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier),this._userLocalInspectValue}get userLocalValue(){return this.userLocalInspectValue.merged}get userLocal(){return this.toInspectValue(this.userLocalInspectValue)}get userRemoteInspectValue(){return this._userRemoteInspectValue||=this.remoteUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier),this._userRemoteInspectValue}get userRemoteValue(){return this.userRemoteInspectValue.merged}get userRemote(){return this.toInspectValue(this.userRemoteInspectValue)}get workspaceInspectValue(){return this._workspaceInspectValue===void 0&&(this._workspaceInspectValue=this.workspaceConfiguration?this.workspaceConfiguration.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceInspectValue}get workspaceValue(){return this.workspaceInspectValue?.merged}get workspace(){return this.toInspectValue(this.workspaceInspectValue)}get workspaceFolderInspectValue(){return this._workspaceFolderInspectValue===void 0&&(this._workspaceFolderInspectValue=this.folderConfigurationModel?this.folderConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceFolderInspectValue}get workspaceFolderValue(){return this.workspaceFolderInspectValue?.merged}get workspaceFolder(){return this.toInspectValue(this.workspaceFolderInspectValue)}get memoryInspectValue(){return this._memoryInspectValue===void 0&&(this._memoryInspectValue=this.memoryConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier)),this._memoryInspectValue}get memoryValue(){return this.memoryInspectValue.merged}get memory(){return this.toInspectValue(this.memoryInspectValue)}};let nF=class e{constructor(e,t,n,r,i,a,o,s,c,l){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=r,this._remoteUserConfiguration=i,this._workspaceConfiguration=a,this._folderConfigurations=o,this._memoryConfiguration=s,this._memoryConfigurationByResource=c,this.logService=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Ne,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let r;n.resource?(r=this._memoryConfigurationByResource.get(n.resource),r||(r=$P.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(n.resource,r))):r=this._memoryConfiguration,t===void 0?r.removeValue(e):r.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){let r=this.getConsolidatedConfigurationModel(e,t,n),i=this.getFolderConfigurationModelForResource(t.resource,n),a=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,o=new Set;for(let t of r.overrides)for(let n of t.identifiers)r.getOverrideValue(e,n)!==void 0&&o.add(n);return new tF(e,t,r.getValue(e),o.size?[...o]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,n?this._workspaceConfiguration:void 0,i||void 0,a)}keys(e){let t=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.keys.slice(0),policy:this._policyConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:t?t.keys.slice(0):[]}}updateDefaultConfiguration(e){this._defaultConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(e){this._policyConfiguration=e}updateApplicationConfiguration(e){this._applicationConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(e){this._localUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(e){this._remoteUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(e){this._workspaceConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(e,t){this._folderConfigurations.set(e,t),this._foldersConsolidatedConfigurations.delete(e)}deleteFolderConfiguration(e){this.folderConfigurations.delete(e),this._foldersConsolidatedConfigurations.delete(e)}compareAndUpdateDefaultConfiguration(e,t){let n=[];if(!t){let{added:n,updated:r,removed:i}=iF(this._defaultConfiguration,e);t=[...n,...r,...i]}for(let r of t)for(let t of Sg(r)){let r=this._defaultConfiguration.getKeysForOverrideIdentifier(t),i=e.getKeysForOverrideIdentifier(t),a=[...i.filter(e=>r.indexOf(e)===-1),...r.filter(e=>i.indexOf(e)===-1),...r.filter(n=>!sc(this._defaultConfiguration.override(t).getValue(n),e.override(t).getValue(n)))];n.push([t,a])}return this.updateDefaultConfiguration(e),{keys:t,overrides:n}}compareAndUpdatePolicyConfiguration(e){let{added:t,updated:n,removed:r}=iF(this._policyConfiguration,e),i=[...t,...n,...r];return i.length&&this.updatePolicyConfiguration(e),{keys:i,overrides:[]}}compareAndUpdateApplicationConfiguration(e){let{added:t,updated:n,removed:r,overrides:i}=iF(this.applicationConfiguration,e),a=[...t,...n,...r];return a.length&&this.updateApplicationConfiguration(e),{keys:a,overrides:i}}compareAndUpdateLocalUserConfiguration(e){let{added:t,updated:n,removed:r,overrides:i}=iF(this.localUserConfiguration,e),a=[...t,...n,...r];return a.length&&this.updateLocalUserConfiguration(e),{keys:a,overrides:i}}compareAndUpdateRemoteUserConfiguration(e){let{added:t,updated:n,removed:r,overrides:i}=iF(this.remoteUserConfiguration,e),a=[...t,...n,...r];return a.length&&this.updateRemoteUserConfiguration(e),{keys:a,overrides:i}}compareAndUpdateWorkspaceConfiguration(e){let{added:t,updated:n,removed:r,overrides:i}=iF(this.workspaceConfiguration,e),a=[...t,...n,...r];return a.length&&this.updateWorkspaceConfiguration(e),{keys:a,overrides:i}}compareAndUpdateFolderConfiguration(e,t){let n=this.folderConfigurations.get(e),{added:r,updated:i,removed:a,overrides:o}=iF(n,t),s=[...r,...i,...a];return(s.length||!n)&&this.updateFolderConfiguration(e,t),{keys:s,overrides:o}}compareAndDeleteFolderConfiguration(e){let t=this.folderConfigurations.get(e);if(!t)throw Error(`Unknown folder`);this.deleteFolderConfiguration(e);let{added:n,updated:r,removed:i,overrides:a}=iF(t,void 0);return{keys:[...n,...r,...i],overrides:a}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{let e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new $P(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(e,t,n){let r=this.getConsolidatedConfigurationModelForResource(t,n);if(t.overrideIdentifier&&(r=r.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0){r=r.merge();for(let e of this._policyConfiguration.keys)r.setValue(e,this._policyConfiguration.getValue(e))}return r}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){let r=t.getFolder(e);r&&(n=this.getFolderConsolidatedConfiguration(r.uri)||n);let i=this._memoryConfigurationByResource.get(e);i&&(n=n.merge(i))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){let n=this.getWorkspaceConsolidatedConfiguration(),r=this._folderConfigurations.get(e);r?(t=n.merge(r),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){let n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{let{contents:n,overrides:r,keys:i}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:r,keys:i}]),e},[])}}allKeys(){let e=new Set;return this._defaultConfiguration.keys.forEach(t=>e.add(t)),this.userConfiguration.keys.forEach(t=>e.add(t)),this._workspaceConfiguration.keys.forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.keys.forEach(t=>e.add(t))),[...e.values()]}allOverrideIdentifiers(){let e=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this.userConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.getAllOverrideIdentifiers().forEach(t=>e.add(t))),[...e.values()]}getAllKeysForOverrideIdentifier(e){let t=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(e).forEach(e=>t.add(e)),this.userConfiguration.getKeysForOverrideIdentifier(e).forEach(e=>t.add(e)),this._workspaceConfiguration.getKeysForOverrideIdentifier(e).forEach(e=>t.add(e)),this._folderConfigurations.forEach(n=>n.getKeysForOverrideIdentifier(e).forEach(e=>t.add(e))),[...t.values()]}static parse(t,n){return new e(this.parseConfigurationModel(t.defaults,n),this.parseConfigurationModel(t.policy,n),this.parseConfigurationModel(t.application,n),this.parseConfigurationModel(t.userLocal,n),this.parseConfigurationModel(t.userRemote,n),this.parseConfigurationModel(t.workspace,n),t.folders.reduce((e,t)=>(e.set(w.revive(t[0]),this.parseConfigurationModel(t[1],n)),e),new Ne),$P.createEmptyModel(n),new Ne,n)}static parseConfigurationModel(e,t){return new $P(e.contents,e.keys,e.overrides,e.raw,t)}};var rF=class{constructor(e,t,n,r,i){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=r,this.logService=i,this._marker=`
95
- `,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(let t of e.keys)this.affectedKeys.add(t);for(let[,t]of e.overrides)for(let e of t)this.affectedKeys.add(e);this._affectsConfigStr=this._marker;for(let e of this.affectedKeys)this._affectsConfigStr+=e+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=nF.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){let n=this._marker+e,r=this._affectsConfigStr.indexOf(n);if(r<0)return!1;let i=r+n.length;if(i>=this._affectsConfigStr.length)return!1;let a=this._affectsConfigStr.charCodeAt(i);return a!==this._markerCode1&&a!==this._markerCode2?!1:t?!sc(this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace)):!0}};function iF(e,t){let{added:n,removed:r,updated:i}=aF(t?.rawConfiguration,e?.rawConfiguration),a=[],o=e?.getAllOverrideIdentifiers()||[],s=t?.getAllOverrideIdentifiers()||[];if(t){let e=s.filter(e=>!o.includes(e));for(let n of e)a.push([n,t.getKeysForOverrideIdentifier(n)])}if(e){let t=o.filter(e=>!s.includes(e));for(let n of t)a.push([n,e.getKeysForOverrideIdentifier(n)])}if(t&&e){for(let n of o)if(s.includes(n)){let r=aF({contents:e.getOverrideValue(void 0,n)||{},keys:e.getKeysForOverrideIdentifier(n)},{contents:t.getOverrideValue(void 0,n)||{},keys:t.getKeysForOverrideIdentifier(n)});a.push([n,[...r.added,...r.removed,...r.updated]])}}return{added:n,removed:r,updated:i,overrides:a}}function aF(e,t){let n=e?t?e.keys.filter(e=>t.keys.indexOf(e)===-1):[...e.keys]:[],r=t?e?t.keys.filter(t=>e.keys.indexOf(t)===-1):[...t.keys]:[],i=[];if(e&&t)for(let n of t.keys)e.keys.indexOf(n)!==-1&&(sc(Xh(t.contents,n),Xh(e.contents,n))||i.push(n));return{added:n,removed:r,updated:i}}function oF(e,t){if(t){let n=t.split(`.`),r=e;for(let e=0;r&&e<n.length;e++)r=r[n[e]];return r}}function sF(e){return e instanceof w}function cF(e){return Je(e)&&e.uri instanceof w&&!!e.languageId&&typeof e.languageId==`string`}function lF(e){return Je(e)&&!e.uri&&!!e.languageId&&typeof e.languageId==`string`}function uF(e){return Je(e)&&e.uri instanceof w&&(!e.name||typeof e.name==`string`)&&(!e.index||typeof e.index==`number`)}function dF(e){if(sF(e))return{resource:e};if(cF(e))return{resource:e.uri,overrideIdentifier:e.languageId};if(lF(e))return{overrideIdentifier:e.languageId};if(uF(e))return{resource:e.uri};if(e===null)return{resource:null}}let fF=class{constructor(e,t,n){this._proxy=e.getProxy(E.MainThreadConfiguration),this._extHostWorkspace=t,this._logService=n,this._barrier=new To,this._actual=null}getConfigProvider(){return this._barrier.wait().then(e=>this._actual)}$initializeConfiguration(e){this._actual=new pF(this._proxy,this._extHostWorkspace,e,this._logService),this._extHostWorkspace.$setConfigProvider(this._actual),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(n=>n.$acceptConfigurationChanged(e,t))}};fF=A([j(0,Hs),j(1,YP),j(2,Ds)],fF);var pF=class{constructor(e,t,n,r){this._onDidChangeConfiguration=new S,this._proxy=e,this._logService=r,this._extHostWorkspace=t,this._configuration=nF.parse(n,r),this._configurationScopes=this._toMap(n.configurationScopes)}get onDidChangeConfiguration(){return this._onDidChangeConfiguration&&this._onDidChangeConfiguration.event}$acceptConfigurationChanged(e,t){let n={data:this._configuration.toData(),workspace:this._extHostWorkspace.workspace};this._configuration=nF.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,n))}getConfiguration(e,t,n){let r=dF(t)||{},i=this._toReadonlyValue(this._configuration.getValue(e,r,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,r,n?.identifier);function a(e){if(e==null)return null;if(typeof e==`boolean`)return e?Gh.USER:Gh.WORKSPACE;switch(e){case AD.Global:return Gh.USER;case AD.Workspace:return Gh.WORKSPACE;case AD.WorkspaceFolder:return Gh.WORKSPACE_FOLDER}}let o={has(e){return oF(i,e)!==void 0},get:(t,a)=>{this._validateConfigurationAccess(e?`${e}.${t}`:t,r,n?.identifier);let o=oF(i,t);if(o===void 0)o=a;else{let e,n=(t,r)=>{if(Je(t)){let a,o=()=>{e||=tc(i),a||=oF(e,r)};return new Proxy(t,{get:(t,i)=>{if(typeof i==`string`&&i.toLowerCase()===`tojson`)return o(),()=>a;if(e)return a||=oF(e,r),a[i];let s=t[i];return typeof i==`string`?n(s,`${r}.${i}`):s},set:(e,t,n)=>(o(),a&&(a[t]=n),!0),deleteProperty:(e,t)=>(o(),a&&delete a[t],!0),defineProperty:(e,t,n)=>(o(),a&&Object.defineProperty(a,t,n),!0)})}return Array.isArray(t)?tc(t):t};o=n(o,t)}return o},update:(t,n,i,o)=>{t=e?`${e}.${t}`:t;let s=a(i);return n===void 0?this._proxy.$removeConfigurationOption(s,t,r,o):this._proxy.$updateConfigurationOption(s,t,n,r,o)},inspect:t=>{t=e?`${e}.${t}`:t;let n=this._configuration.inspect(t,r,this._extHostWorkspace.workspace);if(n)return{key:t,defaultValue:tc(n.policy?.value??n.default?.value),globalLocalValue:tc(n.userLocal?.value),globalRemoteValue:tc(n.userRemote?.value),globalValue:tc(n.user?.value??n.application?.value),workspaceValue:tc(n.workspace?.value),workspaceFolderValue:tc(n.workspaceFolder?.value),defaultLanguageValue:tc(n.default?.override),globalLocalLanguageValue:tc(n.userLocal?.override),globalRemoteLanguageValue:tc(n.userRemote?.override),globalLanguageValue:tc(n.user?.override??n.application?.override),workspaceLanguageValue:tc(n.workspace?.override),workspaceFolderLanguageValue:tc(n.workspaceFolder?.override),languageIds:tc(n.overrideIdentifiers)}}};return typeof i==`object`&&oc(o,i,!1),Object.freeze(o)}_toReadonlyValue(e){let t=e=>Je(e)?new Proxy(e,{get:(e,n)=>t(e[n]),set:(e,t,n)=>{throw Error(`TypeError: Cannot assign to read only property '${String(t)}' of object`)},deleteProperty:(e,t)=>{throw Error(`TypeError: Cannot delete read only property '${String(t)}' of object`)},defineProperty:(e,t)=>{throw Error(`TypeError: Cannot define property '${String(t)}' for a readonly object`)},setPrototypeOf:e=>{throw Error(`TypeError: Cannot set prototype for a readonly object`)},isExtensible:()=>!1,preventExtensions:()=>!0}):e;return t(e)}_validateConfigurationAccess(e,t,n){let r=xg.test(e)?og.RESOURCE:this._configurationScopes.get(e),i=n?`[${n.value}] `:``;if(og.RESOURCE===r){t?.resource===void 0&&this._logService.warn(`${i}Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '${e}', provide the URI of a resource or 'null' for any resource.`);return}if(og.WINDOW===r){t?.resource&&this._logService.warn(`${i}Accessing a window scoped configuration for a resource is not expected. To associate '${e}' to a resource, define its scope to 'resource' in configuration contributions in 'package.json'.`);return}}_toConfigurationChangeEvent(e,t){let n=new rF(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(e,t)=>n.affectsConfiguration(e,dF(t))})}_toMap(e){return e.reduce((e,t)=>(e.set(t[0],t[1]),e),new Map)}};const mF=k(`IExtHostConfiguration`);var hF=class{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}},gF=class e extends y{static isHostExtension(e,t,n){if(t.getExtensionDescription(e))return!1;let r=n.getExtensionDescription(e);return r?!!((r.main||r.browser)&&r.api===`none`):!1}constructor(e,t){super(),this._activationEventsReader=e,this._onDidChange=this._register(new S),this.onDidChange=this._onDidChange.event,this._versionId=0,this._extensionDescriptions=t,this._initialize()}_initialize(){this._extensionDescriptions.sort(yF),this._extensionsMap=new xs,this._extensionsArr=[],this._activationMap=new Map;for(let e of this._extensionDescriptions){if(this._extensionsMap.has(e.identifier)){console.error("Extension `"+e.identifier.value+"` is already registered");continue}this._extensionsMap.set(e.identifier,e),this._extensionsArr.push(e);let t=this._activationEventsReader.readActivationEvents(e);for(let n of t)this._activationMap.has(n)||this._activationMap.set(n,[]),this._activationMap.get(n).push(e)}}set(e){return this._extensionDescriptions=e,this._initialize(),this._versionId++,this._onDidChange.fire(void 0),{versionId:this._versionId}}deltaExtensions(t,n){this._extensionDescriptions=bF(this._extensionDescriptions,n),this._extensionDescriptions=this._extensionDescriptions.concat(t);let r=e._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=bF(this._extensionDescriptions,r.map(e=>e.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new hF(this._versionId,r)}static _findLoopingExtensions(e){let t=new class{constructor(){this._arcs=new Map,this._nodesSet=new Set,this._nodesArr=[]}addNode(e){this._nodesSet.has(e)||(this._nodesSet.add(e),this._nodesArr.push(e))}addArc(e,t){this.addNode(e),this.addNode(t),this._arcs.has(e)?this._arcs.get(e).push(t):this._arcs.set(e,[t])}getArcs(e){return this._arcs.has(e)?this._arcs.get(e):[]}hasOnlyGoodArcs(e,n){let r=t.getArcs(e);for(let e=0;e<r.length;e++)if(!n.has(r[e]))return!1;return!0}getNodes(){return this._nodesArr}},n=new xs;for(let r of e)if(n.set(r.identifier,r),r.extensionDependencies)for(let e of r.extensionDependencies)t.addArc(ys.toKey(r.identifier),ys.toKey(e));let r=new Set;t.getNodes().filter(e=>t.getArcs(e).length===0).forEach(e=>r.add(e));let i=t.getNodes().filter(e=>!r.has(e)),a;do{a=!1;for(let e=0;e<i.length;e++){let n=i[e];t.hasOnlyGoodArcs(n,r)&&(i.splice(e,1),e--,r.add(n),a=!0)}}while(a);return i.map(e=>n.get(e))}containsActivationEvent(e){return this._activationMap.has(e)}containsExtension(e){return this._extensionsMap.has(e)}getExtensionDescriptionsForActivationEvent(e){let t=this._activationMap.get(e);return t?t.slice(0):[]}getAllExtensionDescriptions(){return this._extensionsArr.slice(0)}getSnapshot(){return new _F(this._versionId,this.getAllExtensionDescriptions())}getExtensionDescription(e){return this._extensionsMap.get(e)||void 0}getExtensionDescriptionByUUID(e){for(let t of this._extensionsArr)if(t.uuid===e)return t}getExtensionDescriptionByIdOrUUID(e,t){return this.getExtensionDescription(e)??(t?this.getExtensionDescriptionByUUID(t):void 0)}},_F=class{constructor(e,t){this.versionId=e,this.extensions=t}},vF;(function(e){e[e.Builtin=0]=`Builtin`,e[e.User=1]=`User`,e[e.Dev=2]=`Dev`})(vF||={});function yF(e,t){let n=e.isBuiltin?vF.Builtin:e.isUnderDevelopment?vF.Dev:vF.User,r=t.isBuiltin?vF.Builtin:t.isUnderDevelopment?vF.Dev:vF.User;if(n!==r)return n-r;let i=zr.basename(e.extensionLocation.path),a=zr.basename(t.extensionLocation.path);return i<a?-1:+(i>a)}function bF(e,t){let n=new bs(t);return e.filter(e=>!n.has(e.identifier))}var xF=class e{static{this.NONE=new e(!1,-1,-1,-1)}constructor(e,t,n,r){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=n,this.activateResolvedTime=r}},SF=class{constructor(e){this._startup=e,this._codeLoadingStart=-1,this._codeLoadingStop=-1,this._activateCallStart=-1,this._activateCallStop=-1,this._activateResolveStart=-1,this._activateResolveStop=-1}_delta(e,t){return e===-1||t===-1?-1:t-e}build(){return new xF(this._startup,this._delta(this._codeLoadingStart,this._codeLoadingStop),this._delta(this._activateCallStart,this._activateCallStop),this._delta(this._activateResolveStart,this._activateResolveStop))}codeLoadingStart(){this._codeLoadingStart=Date.now()}codeLoadingStop(){this._codeLoadingStop=Date.now()}activateCallStart(){this._activateCallStart=Date.now()}activateCallStop(){this._activateCallStop=Date.now()}activateResolveStart(){this._activateResolveStart=Date.now()}activateResolveStop(){this._activateResolveStop=Date.now()}},CF=class{constructor(e,t,n,r,i,a){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=n,this.module=r,this.exports=i,this.disposable=a}},wF=class extends CF{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,y.None)}},TF=class extends CF{constructor(){super(!1,null,xF.NONE,{activate:void 0,deactivate:void 0},void 0,y.None)}},EF=class extends CF{constructor(e){super(!0,e,xF.NONE,{activate:void 0,deactivate:void 0},void 0,y.None)}};let DF=class{constructor(e,t,n,r){this._logService=r,this._registry=e,this._globalRegistry=t,this._host=n,this._operations=new xs,this._alreadyActivatedEvents=Object.create(null)}dispose(){for(let[e,t]of this._operations)t.dispose()}async waitForActivatingExtensions(){let e=[];for(let[t,n]of this._operations)e.push(n.wait());await Promise.all(e)}isActivated(e){let t=this._operations.get(e);return!!(t&&t.value)}getActivatedExtension(e){let t=this._operations.get(e);if(!t||!t.value)throw Error(`Extension '${e.value}' is not known or not activated`);return t.value}async activateByEvent(e,t){if(this._alreadyActivatedEvents[e])return;let n=this._registry.getExtensionDescriptionsForActivationEvent(e);await this._activateExtensions(n.map(n=>({id:n.identifier,reason:{startup:t,extensionId:n.identifier,activationEvent:e}}))),this._alreadyActivatedEvents[e]=!0}activateById(e,t){let n=this._registry.getExtensionDescription(e);if(!n)throw Error(`Extension '${e.value}' is not known`);return this._activateExtensions([{id:n.identifier,reason:t}])}async _activateExtensions(e){let t=e.filter(e=>!this.isActivated(e.id)).map(e=>this._handleActivationRequest(e));await Promise.all(t.map(e=>e.wait()))}_handleActivationRequest(e){if(this._operations.has(e.id))return this._operations.get(e.id);if(this._isHostExtension(e.id))return this._createAndSaveOperation(e,null,[],null);let t=this._registry.getExtensionDescription(e.id);if(!t){let t=Error(`Cannot activate unknown extension '${e.id.value}'`),n=this._createAndSaveOperation(e,null,[],new EF(t));return this._host.onExtensionActivationError(e.id,t,new Tw(e.id.value)),n}let n=[],r=t.extensionDependencies===void 0?[]:t.extensionDependencies;for(let i of r){if(this._isResolvedExtension(i))continue;let r=this._operations.get(i);if(r){n.push(r);continue}if(this._isHostExtension(i)){n.push(this._handleActivationRequest({id:this._globalRegistry.getExtensionDescription(i).identifier,reason:e.reason}));continue}let a=this._registry.getExtensionDescription(i);if(a){if(!a.main&&!a.browser)continue;n.push(this._handleActivationRequest({id:a.identifier,reason:e.reason}));continue}let o=t.displayName||t.identifier.value,s=Error(`Cannot activate the '${o}' extension because it depends on unknown extension '${i}'`),c=this._createAndSaveOperation(e,t.displayName,[],new EF(s));return this._host.onExtensionActivationError(t.identifier,s,new Tw(i)),c}return this._createAndSaveOperation(e,t.displayName,n,null)}_createAndSaveOperation(e,t,n,r){let i=new OF(e.id,t,e.reason,n,r,this._host,this._logService);return this._operations.set(e.id,i),i}_isHostExtension(e){return gF.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){let t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};DF=A([j(3,Ds)],DF);let OF=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,n,r,i,a,o){this._id=e,this._displayName=t,this._reason=n,this._deps=r,this._value=i,this._host=a,this._logService=o,this._barrier=new To,this._isDisposed=!1,this._initialize()}dispose(){this._isDisposed=!0}wait(){return this._barrier.wait()}async _initialize(){await this._waitForDepsThenActivate(),this._barrier.open()}async _waitForDepsThenActivate(){if(!this._value){for(;this._deps.length>0;){for(let e=0;e<this._deps.length;e++){let t=this._deps[e];if(t.value&&!t.value.activationFailed){this._deps.splice(e,1),e--;continue}if(t.value&&t.value.activationFailed){let e=Error(`Cannot activate the '${this.friendlyName}' extension because its dependency '${t.friendlyName}' failed to activate`);e.detail=t.value.activationFailedError,this._value=new EF(e),this._host.onExtensionActivationError(this._id,e,null);return}}this._deps.length>0&&await Promise.race(this._deps.map(e=>e.wait()))}await this._activate()}}async _activate(){try{this._value=await this._host.actualActivateExtension(this._id,this._reason)}catch(e){let t=Error();if(e&&e.name&&(t.name=e.name),e&&e.message?t.message=`Activating extension '${this._id.value}' failed: ${e.message}.`:t.message=`Activating extension '${this._id.value}' failed: ${e}.`,e&&e.stack&&(t.stack=e.stack),this._value=new EF(t),this._isDisposed&&d(e))return;this._host.onExtensionActivationError(this._id,t,null),this._logService.error(`Activating extension ${this._id.value} failed due to an error:`),this._logService.error(e)}}};OF=A([j(6,Ds)],OF);var kF=class{constructor(e,t){this._logService=t,this._onDidChangeStorage=new S,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(E.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,n){let r=await this._proxy.$initializeExtensionStorage(e,t),i;return r&&(i=this.safeParseValue(e,t,r)),i||n}setValue(e,t,n){return this._proxy.$setValue(e,t,n)}$acceptValue(e,t,n){let r=this.safeParseValue(e,t,n);r&&this._onDidChangeStorage.fire({shared:e,key:t,value:r})}safeParseValue(e,t,n){try{return JSON.parse(n)}catch(n){this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${t}, global: ${e}): ${n}`)}}};const AF=k(`IExtHostStorage`);var jF=class{constructor(e,t,n){this._deferredPromises=new Map,this._id=e,this._shared=t,this._storage=n,this._init=this._storage.initializeExtensionStorage(this._shared,this._id,Object.create(null)).then(e=>(this._value=e,this)),this._storageListener=this._storage.onDidChangeStorage(e=>{e.shared===this._shared&&e.key===this._id&&(this._value=e.value)}),this._scheduler=new Mo(()=>{let e=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(let t of e.values())t.complete()}catch(t){for(let n of e.values())n.error(t)}})()},0)}keys(){return Object.entries(this._value??{}).filter(([,e])=>e!==void 0).map(([e])=>e)}get whenReady(){return this._init}get(e,t){let n=this._value[e];return n===void 0&&(n=t),n}update(e,t){typeof t==`object`&&t?this._value[e]=JSON.parse(JSON.stringify(t)):this._value[e]=t;let n=this._deferredPromises.get(e);if(n!==void 0)return n.p;let r=new Ro;return this._deferredPromises.set(e,r),this._scheduler.isScheduled()||this._scheduler.schedule(),r.p}dispose(){this._storageListener.dispose()}},MF=class extends jF{setKeysForSync(e){this._storage.registerExtensionStorageKeysToSync({id:this._id,version:this._extension.version},e)}constructor(e,t){super(e.identifier.value,!0,t),this._extension=e}},NF;let PF=NF=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new Ao,this._proxy=e.getProxy(E.MainThreadFileSystem);let n=this;this.value=Object.freeze({async stat(e){try{let t,r=n._fileSystemProvider.get(e.scheme);return r?(await n._proxy.$ensureActivation(e.scheme),t=await r.impl.stat(e)):t=await n._proxy.$stat(e),{type:t.type,ctime:t.ctime,mtime:t.mtime,size:t.size,permissions:t.permissions===fc.Readonly?1:void 0}}catch(e){NF._handleError(e)}},async readDirectory(e){try{let t=n._fileSystemProvider.get(e.scheme);return t?(await n._proxy.$ensureActivation(e.scheme),(await t.impl.readDirectory(e)).slice()):await n._proxy.$readdir(e)}catch(e){return NF._handleError(e)}},async createDirectory(e){try{let t=n._fileSystemProvider.get(e.scheme);return t&&!t.isReadonly?(await n._proxy.$ensureActivation(e.scheme),await n.mkdirp(t.impl,t.extUri,e)):await n._proxy.$mkdir(e)}catch(e){return NF._handleError(e)}},async readFile(e){try{let t=n._fileSystemProvider.get(e.scheme);return t?(await n._proxy.$ensureActivation(e.scheme),(await t.impl.readFile(e)).slice()):(await n._proxy.$readFile(e)).buffer}catch(e){return NF._handleError(e)}},async writeFile(e,t){try{let r=n._fileSystemProvider.get(e.scheme);return r&&!r.isReadonly?(await n._proxy.$ensureActivation(e.scheme),await n.mkdirp(r.impl,r.extUri,r.extUri.dirname(e)),await n._writeQueue.queueFor(e,()=>Promise.resolve(r.impl.writeFile(e,t,{create:!0,overwrite:!0})))):await n._proxy.$writeFile(e,b.wrap(t))}catch(e){return NF._handleError(e)}},async delete(e,t){try{let r=n._fileSystemProvider.get(e.scheme);return r&&!r.isReadonly&&!t?.useTrash?(await n._proxy.$ensureActivation(e.scheme),await r.impl.delete(e,{recursive:!1,...t})):await n._proxy.$delete(e,{recursive:!1,useTrash:!1,atomic:!1,...t})}catch(e){return NF._handleError(e)}},async rename(e,t,r){try{return await n._proxy.$rename(e,t,{overwrite:!1,...r})}catch(e){return NF._handleError(e)}},async copy(e,t,r){try{return await n._proxy.$copy(e,t,{overwrite:!1,...r})}catch(e){return NF._handleError(e)}},isWritableFileSystem(e){let n=t.getCapabilities(e);if(typeof n==`number`)return!(n&mc.Readonly)}})}async mkdirp(e,t,n){let r=[];for(;!t.isEqual(n,t.dirname(n));)try{if(((await e.stat(n)).type&dc.Directory)===0)throw tO.FileExists(`Unable to create folder '${n.scheme===O.file?n.fsPath:n.toString(!0)}' that already exists but is not a directory`);break}catch(e){if(vc(e)!==hc.FileNotFound)throw e;r.push(t.basename(n)),n=t.dirname(n)}for(let i=r.length-1;i>=0;i--){n=t.joinPath(n,r[i]);try{await e.createDirectory(n)}catch(e){if(vc(e)!==hc.FileExists)throw e}}}static _handleError(e){if(e instanceof tO)throw e;if(e instanceof gc)switch(e.code){case hc.FileExists:throw tO.FileExists(e.message);case hc.FileNotFound:throw tO.FileNotFound(e.message);case hc.FileNotADirectory:throw tO.FileNotADirectory(e.message);case hc.FileIsADirectory:throw tO.FileIsADirectory(e.message);case hc.NoPermissions:throw tO.NoPermissions(e.message);case hc.Unavailable:throw tO.Unavailable(e.message);default:throw new tO(e.message,e.name)}if(!(e instanceof Error))throw new tO(String(e));if(e.name===`ENOPRO`||e.message.includes(`ENOPRO`))throw tO.Unavailable(e.message);switch(e.name){case hc.FileExists:throw tO.FileExists(e.message);case hc.FileNotFound:throw tO.FileNotFound(e.message);case hc.FileNotADirectory:throw tO.FileNotADirectory(e.message);case hc.FileIsADirectory:throw tO.FileIsADirectory(e.message);case hc.NoPermissions:throw tO.NoPermissions(e.message);case hc.Unavailable:throw tO.Unavailable(e.message);default:throw new tO(e.message,e.name)}}addFileSystemProvider(e,t,n){return this._fileSystemProvider.set(e,{impl:t,extUri:n?.isCaseSensitive?Xa:Qa,isReadonly:!!n?.isReadonly}),_(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??Xa}};PF=NF=A([j(0,Hs),j(1,Rc)],PF);const FF=k(`IExtHostConsumerFileSystem`),IF=k(`IExtensionStoragePaths`);let LF=class{constructor(e,t,n){this._logService=t,this._extHostFileSystem=n,this._workspace=e.workspace??void 0,this._environment=e.environment,this.whenReady=this._getOrCreateWorkspaceStoragePath().then(e=>this._value=e)}async _getWorkspaceStorageURI(e){return w.joinPath(this._environment.workspaceStorageHome,e)}async _getOrCreateWorkspaceStoragePath(){if(!this._workspace)return Promise.resolve(void 0);let e=this._workspace.id,t=await this._getWorkspaceStorageURI(e);try{return await this._extHostFileSystem.value.stat(t),this._logService.trace(`[ExtHostStorage] storage dir already exists`,t),t}catch{}try{return this._logService.trace(`[ExtHostStorage] creating dir and metadata-file`,t),await this._extHostFileSystem.value.createDirectory(t),await this._extHostFileSystem.value.writeFile(w.joinPath(t,`meta.json`),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:w.revive(this._workspace.configuration)?.toString(),name:this._workspace.name},void 0,2))),t}catch(e){this._logService.error(`[ExtHostStorage]`,e);return}}workspaceValue(e){if(this._value)return w.joinPath(this._value,e.identifier.value)}globalValue(e){return w.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};LF=A([j(0,Fs),j(1,Ds),j(2,FF)],LF);var RF;(function(e){e.Http=`http`,e.Https=`https`})(RF||={});var zF;(function(e){e.ConstantPrivate=`constantPrivate`,e.Private=`private`,e.Public=`public`})(zF||={});var BF;(function(e){e[e.Notify=1]=`Notify`,e[e.OpenBrowser=2]=`OpenBrowser`,e[e.OpenPreview=3]=`OpenPreview`,e[e.Silent=4]=`Silent`,e[e.Ignore=5]=`Ignore`,e[e.OpenBrowserOnce=6]=`OpenBrowserOnce`})(BF||={});function VF(e){if(e.scheme!==`http`&&e.scheme!==`https`)return;let t=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(e.authority);if(t)return{address:t[1],port:+t[2]}}const HF=[`localhost`,`127.0.0.1`,`0:0:0:0:0:0:0:1`,`::1`];function UF(e){return HF.indexOf(e)>=0}const WF=[`0.0.0.0`,`0:0:0:0:0:0:0:0`,`::`];function GF(e){return WF.indexOf(e)>=0}var KF=class{constructor(e,t,n){this.remoteAddress=e,this.localAddress=t,this._dispose=n,this._onDispose=new S,this.onDidDispose=this._onDispose.event}dispose(){return this._onDispose.fire(),this._onDispose.dispose(),this._dispose()}};let qF=class extends y{constructor(e,t){super(),this.logService=e,this.configurationService=t,this._onTunnelOpened=this._register(new S),this.onTunnelOpened=this._onTunnelOpened.event,this._onTunnelClosed=this._register(new S),this.onTunnelClosed=this._onTunnelClosed.event,this._onAddedTunnelProvider=this._register(new S),this.onAddedTunnelProvider=this._onAddedTunnelProvider.event,this._tunnels=new Map,this._canElevate=!1,this._canChangeProtocol=!0,this._privacyOptions=[],this._factoryInProgress=new Set}get hasTunnelProvider(){return!!this._tunnelProvider}get defaultTunnelHost(){let e=this.configurationService.getValue(`remote.localPortHost`);return!e||e===`localhost`?`127.0.0.1`:`0.0.0.0`}setTunnelProvider(e){return this._tunnelProvider=e,e?(this._onAddedTunnelProvider.fire(),{dispose:()=>{this._tunnelProvider=void 0,this._canElevate=!1,this._privacyOptions=[]}}):(this._canElevate=!1,this._privacyOptions=[],this._onAddedTunnelProvider.fire(),{dispose:()=>{}})}setTunnelFeatures(e){this._canElevate=e.elevation,this._privacyOptions=e.privacyOptions,this._canChangeProtocol=e.protocol}get canChangeProtocol(){return this._canChangeProtocol}get canElevate(){return this._canElevate}get canChangePrivacy(){return this._privacyOptions.length>0}get privacyOptions(){return this._privacyOptions}get tunnels(){return this.getTunnels()}async getTunnels(){let e=[],t=Array.from(this._tunnels.values());for(let n of t){let t=Array.from(n.values());for(let n of t){let t=await n.value;t&&typeof t!=`string`&&e.push(t)}}return e}async dispose(){super.dispose();for(let e of this._tunnels.values()){for(let{value:t}of e.values())await t.then(e=>typeof e==`string`?void 0:e?.dispose());e.clear()}this._tunnels.clear()}setEnvironmentTunnel(e,t,n,r,i){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:n,privacy:r,protocol:i,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(GF(e)||UF(e))&&(e=HF[0]);let n=this.getTunnelFromMap(e,t);if(n)return++n.refcount,n.value}openTunnel(e,t,n,r,i,a=!1,o,s){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${t}:${n} on local port ${i}.`);let c=this._tunnelProvider??e;if(!c)return;if(t||=`localhost`,r||=this.defaultTunnelHost,this._tunnelProvider&&this._factoryInProgress.has(n)){this.logService.debug(`ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.`);return}let l=this.retainOrCreateTunnel(c,t,n,r,i,a,o,s);return l?l.then(e=>{if(!e){this.logService.trace(`ForwardedPorts: (TunnelService) New tunnel is undefined.`),this.removeEmptyOrErrorTunnelFromMap(t,n);return}else if(typeof e==`string`)return this.logService.trace(`ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel.`),this.removeEmptyOrErrorTunnelFromMap(t,n),e;this.logService.trace(`ForwardedPorts: (TunnelService) New tunnel established.`);let r=this.makeTunnel(e);return(e.tunnelRemoteHost!==t||e.tunnelRemotePort!==n)&&this.logService.warn(`ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch.`),o&&e.privacy!==o&&this.logService.warn(`ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch.`),this._onTunnelOpened.fire(r),r}):(this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel was not created.`),l)}makeTunnel(e){return{tunnelRemotePort:e.tunnelRemotePort,tunnelRemoteHost:e.tunnelRemoteHost,tunnelLocalPort:e.tunnelLocalPort,localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol,dispose:async()=>{this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${e.tunnelRemoteHost}:${e.tunnelRemotePort} `);let t=this._tunnels.get(e.tunnelRemoteHost);if(t){let n=t.get(e.tunnelRemotePort);n&&(n.refcount--,await this.tryDisposeTunnel(e.tunnelRemoteHost,e.tunnelRemotePort,n))}}}}async tryDisposeTunnel(e,t,n){if(n.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${e}:${t}.`);let r=n.value.then(async e=>{e&&typeof e!=`string`&&(await e.dispose(!0),this._onTunnelClosed.fire({host:e.tunnelRemoteHost,port:e.tunnelRemotePort}))});return this._tunnels.has(e)&&this._tunnels.get(e).delete(t),r}}async closeTunnel(e,t){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${e}:${t} `);let n=this._tunnels.get(e);if(n&&n.has(t)){let r=n.get(t);r.refcount=0,await this.tryDisposeTunnel(e,t,r)}}addTunnelToMap(e,t,n){this._tunnels.has(e)||this._tunnels.set(e,new Map),this._tunnels.get(e).set(t,{refcount:1,value:n})}async removeEmptyOrErrorTunnelFromMap(e,t){let n=this._tunnels.get(e);if(n){let r=n.get(t),i=r?await r.value:void 0;(!i||typeof i==`string`)&&n.delete(t),n.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){let n=[e];UF(e)?(n.push(...HF),n.push(...WF)):GF(e)&&n.push(...WF);let r=n.map(e=>this._tunnels.get(e));for(let e of r){let n=e?.get(t);if(n)return n}}canTunnel(e){return!!VF(e)}createWithProvider(e,t,n,r,i,a,o){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${t}:${n} on local port ${r}.`);let s=n;this._factoryInProgress.add(s);let c=r===void 0?n:r,l={elevationRequired:i?this.isPortPrivileged(c):!1},u={remoteAddress:{host:t,port:n},localAddressPort:r,privacy:a,public:a?a!==zF.Private:void 0,protocol:o},d=e.forwardPort(u,l);return d?(this.addTunnelToMap(t,n,d),d.finally(()=>{this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel created by provider.`),this._factoryInProgress.delete(s)})):this._factoryInProgress.delete(s),d}};qF=A([j(0,Ds),j(1,Sh)],qF);var JF=class extends KF{},YF;(function(e){function t(e){return{remoteAddress:e.remoteAddress,localAddress:e.localAddress,public:!!e.public,privacy:e.privacy??(e.public?zF.Public:zF.Private),protocol:e.protocol}}e.fromApiTunnel=t;function n(e){return{remoteAddress:{host:e.tunnelRemoteHost,port:e.tunnelRemotePort},localAddress:e.localAddress,public:e.privacy!==zF.ConstantPrivate&&e.privacy!==zF.ConstantPrivate,privacy:e.privacy,protocol:e.protocol}}e.fromServiceTunnel=n})(YF||={});const XF=k(`IExtHostTunnelService`);let ZF=class extends y{constructor(e,t,n){super(),this.logService=n,this._showCandidatePort=()=>Promise.resolve(!0),this._extensionTunnels=new Map,this._onDidChangeTunnels=this._register(new S),this.onDidChangeTunnels=this._onDidChangeTunnels.event,this._providerHandleCounter=0,this._portAttributesProviders=new Map,this._proxy=e.getProxy(E.MainThreadTunnelService)}async openTunnel(e,t){this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) ${e.identifier.value} called openTunnel API for ${t.remoteAddress.host}:${t.remoteAddress.port}.`);let n=await this._proxy.$openTunnel(t,e.displayName);if(n){let e=new JF(n.remoteAddress,n.localAddress,()=>this._proxy.$closeTunnel(n.remoteAddress));return this._register(e),e}}async getTunnels(){return this._proxy.$getTunnels()}nextPortAttributesProviderHandle(){return this._providerHandleCounter++}registerPortsAttributesProvider(e,t){e.portRange===void 0&&e.commandPattern===void 0&&this.logService.error(`PortAttributesProvider must specify either a portRange or a commandPattern`);let n=this.nextPortAttributesProviderHandle();return this._portAttributesProviders.set(n,{selector:e,provider:t}),this._proxy.$registerPortsAttributesProvider(e,n),new WT(()=>{this._portAttributesProviders.delete(n),this._proxy.$unregisterPortsAttributesProvider(n)})}async $providePortAttributes(e,t,n,r,i){let a=[];for(let o of e){let e=this._portAttributesProviders.get(o);if(!e)return[];a.push(...await Promise.all(t.map(async t=>{let a;try{a=await e.provider.providePortAttributes({port:t,pid:n,commandLine:r},i)}catch{a=await e.provider.providePortAttributes(t,n,r,i)}return{providedAttributes:a,port:t}})))}let o=a.filter(e=>!!e.providedAttributes);return o.length>0?o.map(e=>({autoForwardAction:e.providedAttributes.autoForwardAction,port:e.port})):[]}async $registerCandidateFinder(e){}registerTunnelProvider(e,t){if(this._forwardPortProvider)throw Error(`A tunnel provider has already been registered. Only the first tunnel provider to be registered will be used.`);this._forwardPortProvider=async(t,n)=>await e.provideTunnel(t,n,Pi.None)??void 0;let n=t.tunnelFeatures?{elevation:!!t.tunnelFeatures?.elevation,privacyOptions:t.tunnelFeatures?.privacyOptions,protocol:t.tunnelFeatures.protocol===void 0?!0:t.tunnelFeatures.protocol}:void 0;return this._proxy.$setTunnelProvider(n,!0),Promise.resolve(_(()=>{this._forwardPortProvider=void 0,this._proxy.$setTunnelProvider(void 0,!1)}))}hasTunnelProvider(){return this._proxy.$hasTunnelProvider()}async setTunnelFactory(e,t){if(e){e.candidatePortSource!==void 0&&this._proxy.$setCandidatePortSource(e.candidatePortSource),e.showCandidatePort&&(this._showCandidatePort=e.showCandidatePort,this._proxy.$setCandidateFilter());let n=e.tunnelFactory??(t?this.makeManagedTunnelFactory(t):void 0);if(n){this._forwardPortProvider=n;let t=e.tunnelFeatures?.privacyOptions??[];e.tunnelFeatures?.public&&t.length===0&&(t=[{id:`private`,label:x(2879,`Private`),themeIcon:`lock`},{id:`public`,label:x(2880,`Public`),themeIcon:`eye`}]);let r=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:t,protocol:!0}:void 0;this._proxy.$setTunnelProvider(r,!!e.tunnelFactory)}}else this._forwardPortProvider=void 0;return _(()=>{this._forwardPortProvider=void 0})}makeManagedTunnelFactory(e){}async $closeTunnel(e,t){if(this._extensionTunnels.has(e.host)){let n=this._extensionTunnels.get(e.host);n.has(e.port)&&(t&&n.get(e.port).disposeListener.dispose(),await n.get(e.port).tunnel.dispose(),n.delete(e.port))}}async $onDidTunnelsChange(){this._onDidChangeTunnels.fire()}async $forwardPort(e,t){if(this._forwardPortProvider)try{this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) Getting tunnel from provider.`);let n=this._forwardPortProvider(e,t);if(this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) Got tunnel promise from provider.`),n!==void 0){let t=await n;if(this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) Successfully awaited tunnel from provider.`),t===void 0){this.logService.error(`ForwardedPorts: (ExtHostTunnelService) Resolved tunnel is undefined`);return}this._extensionTunnels.has(e.remoteAddress.host)||this._extensionTunnels.set(e.remoteAddress.host,new Map);let r=this._register(t.onDidDispose(()=>(this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) Extension fired tunnel's onDidDispose.`),this._proxy.$closeTunnel(t.remoteAddress))));return this._extensionTunnels.get(e.remoteAddress.host).set(e.remoteAddress.port,{tunnel:t,disposeListener:r}),YF.fromApiTunnel(t)}else this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) Tunnel is undefined`)}catch(e){if(this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) tunnel provider error`),e instanceof Error)return e.message}}async $applyCandidateFilter(e){let t=await Promise.all(e.map(e=>this._showCandidatePort(e.host,e.port,e.detail??``))),n=e.filter((e,n)=>t[n]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(e=>e.port).join(`, `)} to ${n.map(e=>e.port).join(`, `)}`),n}};ZF=A([j(0,Hs),j(1,Fs),j(2,Ds)],ZF);function QF(e){return[...e.entries()]}function $F(e){return e?[...e.entries()]:[]}var eI;(function(e){e.AutomationProfile=`terminal.integrated.automationProfile.`,e.DefaultProfile=`terminal.integrated.defaultProfile.`,e.Profiles=`terminal.integrated.profiles.`})(eI||={});var tI;(function(e){e.SendKeybindingsToShell=`terminal.integrated.sendKeybindingsToShell`,e.AutomationProfileLinux=`terminal.integrated.automationProfile.linux`,e.AutomationProfileMacOs=`terminal.integrated.automationProfile.osx`,e.AutomationProfileWindows=`terminal.integrated.automationProfile.windows`,e.AgentHostProfileLinux=`terminal.integrated.agentHostProfile.linux`,e.AgentHostProfileMacOs=`terminal.integrated.agentHostProfile.osx`,e.AgentHostProfileWindows=`terminal.integrated.agentHostProfile.windows`,e.ProfilesWindows=`terminal.integrated.profiles.windows`,e.ProfilesMacOs=`terminal.integrated.profiles.osx`,e.ProfilesLinux=`terminal.integrated.profiles.linux`,e.DefaultProfileLinux=`terminal.integrated.defaultProfile.linux`,e.DefaultProfileMacOs=`terminal.integrated.defaultProfile.osx`,e.DefaultProfileWindows=`terminal.integrated.defaultProfile.windows`,e.UseWslProfiles=`terminal.integrated.useWslProfiles`,e.TabsDefaultColor=`terminal.integrated.tabs.defaultColor`,e.TabsDefaultIcon=`terminal.integrated.tabs.defaultIcon`,e.TabsEnabled=`terminal.integrated.tabs.enabled`,e.TabsEnableAnimation=`terminal.integrated.tabs.enableAnimation`,e.TabsHideCondition=`terminal.integrated.tabs.hideCondition`,e.TabsShowActiveTerminal=`terminal.integrated.tabs.showActiveTerminal`,e.TabsShowActions=`terminal.integrated.tabs.showActions`,e.TabsLocation=`terminal.integrated.tabs.location`,e.TabsFocusMode=`terminal.integrated.tabs.focusMode`,e.TabsAllowAgentCliTitle=`terminal.integrated.tabs.allowAgentCliTitle`,e.MacOptionIsMeta=`terminal.integrated.macOptionIsMeta`,e.MacOptionClickForcesSelection=`terminal.integrated.macOptionClickForcesSelection`,e.AltClickMovesCursor=`terminal.integrated.altClickMovesCursor`,e.CopyOnSelection=`terminal.integrated.copyOnSelection`,e.EnableMultiLinePasteWarning=`terminal.integrated.enableMultiLinePasteWarning`,e.DrawBoldTextInBrightColors=`terminal.integrated.drawBoldTextInBrightColors`,e.FontFamily=`terminal.integrated.fontFamily`,e.FontSize=`terminal.integrated.fontSize`,e.LetterSpacing=`terminal.integrated.letterSpacing`,e.LineHeight=`terminal.integrated.lineHeight`,e.MinimumContrastRatio=`terminal.integrated.minimumContrastRatio`,e.TabStopWidth=`terminal.integrated.tabStopWidth`,e.FastScrollSensitivity=`terminal.integrated.fastScrollSensitivity`,e.MouseWheelScrollSensitivity=`terminal.integrated.mouseWheelScrollSensitivity`,e.BellDuration=`terminal.integrated.bellDuration`,e.FontWeight=`terminal.integrated.fontWeight`,e.FontWeightBold=`terminal.integrated.fontWeightBold`,e.CursorBlinking=`terminal.integrated.cursorBlinking`,e.TextBlinking=`terminal.integrated.textBlinking`,e.CursorStyle=`terminal.integrated.cursorStyle`,e.CursorStyleInactive=`terminal.integrated.cursorStyleInactive`,e.CursorWidth=`terminal.integrated.cursorWidth`,e.Scrollback=`terminal.integrated.scrollback`,e.DetectLocale=`terminal.integrated.detectLocale`,e.DefaultLocation=`terminal.integrated.defaultLocation`,e.GpuAcceleration=`terminal.integrated.gpuAcceleration`,e.TerminalTitleSeparator=`terminal.integrated.tabs.separator`,e.TerminalTitle=`terminal.integrated.tabs.title`,e.TerminalDescription=`terminal.integrated.tabs.description`,e.RightClickBehavior=`terminal.integrated.rightClickBehavior`,e.MiddleClickBehavior=`terminal.integrated.middleClickBehavior`,e.Cwd=`terminal.integrated.cwd`,e.ConfirmOnExit=`terminal.integrated.confirmOnExit`,e.ConfirmOnKill=`terminal.integrated.confirmOnKill`,e.EnableBell=`terminal.integrated.enableBell`,e.EnableVisualBell=`terminal.integrated.enableVisualBell`,e.CommandsToSkipShell=`terminal.integrated.commandsToSkipShell`,e.AllowChords=`terminal.integrated.allowChords`,e.AllowMnemonics=`terminal.integrated.allowMnemonics`,e.TabFocusMode=`terminal.integrated.tabFocusMode`,e.EnvMacOs=`terminal.integrated.env.osx`,e.EnvLinux=`terminal.integrated.env.linux`,e.EnvWindows=`terminal.integrated.env.windows`,e.EnvironmentChangesRelaunch=`terminal.integrated.environmentChangesRelaunch`,e.ShowExitAlert=`terminal.integrated.showExitAlert`,e.SplitCwd=`terminal.integrated.splitCwd`,e.WindowsUseConptyDll=`terminal.integrated.windowsUseConptyDll`,e.WordSeparators=`terminal.integrated.wordSeparators`,e.EnableFileLinks=`terminal.integrated.enableFileLinks`,e.AllowedLinkSchemes=`terminal.integrated.allowedLinkSchemes`,e.UnicodeVersion=`terminal.integrated.unicodeVersion`,e.EnablePersistentSessions=`terminal.integrated.enablePersistentSessions`,e.PersistentSessionReviveProcess=`terminal.integrated.persistentSessionReviveProcess`,e.HideOnStartup=`terminal.integrated.hideOnStartup`,e.HideOnLastClosed=`terminal.integrated.hideOnLastClosed`,e.PreserveDrawingBuffer=`terminal.integrated.preserveDrawingBuffer`,e.CustomGlyphs=`terminal.integrated.customGlyphs`,e.RescaleOverlappingGlyphs=`terminal.integrated.rescaleOverlappingGlyphs`,e.PersistentSessionScrollback=`terminal.integrated.persistentSessionScrollback`,e.InheritEnv=`terminal.integrated.inheritEnv`,e.ShowLinkHover=`terminal.integrated.showLinkHover`,e.IgnoreProcessNames=`terminal.integrated.ignoreProcessNames`,e.ShellIntegrationEnabled=`terminal.integrated.shellIntegration.enabled`,e.ShellIntegrationShowWelcome=`terminal.integrated.shellIntegration.showWelcome`,e.ShellIntegrationDecorationsEnabled=`terminal.integrated.shellIntegration.decorationsEnabled`,e.ShellIntegrationTimeout=`terminal.integrated.shellIntegration.timeout`,e.ShellIntegrationQuickFixEnabled=`terminal.integrated.shellIntegration.quickFixEnabled`,e.ShellIntegrationEnvironmentReporting=`terminal.integrated.shellIntegration.environmentReporting`,e.EnableImages=`terminal.integrated.enableImages`,e.SmoothScrolling=`terminal.integrated.smoothScrolling`,e.IgnoreBracketedPasteMode=`terminal.integrated.ignoreBracketedPasteMode`,e.FocusAfterRun=`terminal.integrated.focusAfterRun`,e.FontLigaturesEnabled=`terminal.integrated.fontLigatures.enabled`,e.FontLigaturesFeatureSettings=`terminal.integrated.fontLigatures.featureSettings`,e.FontLigaturesFallbackLigatures=`terminal.integrated.fontLigatures.fallbackLigatures`,e.EnableKittyKeyboardProtocol=`terminal.integrated.enableKittyKeyboardProtocol`,e.EnableWin32InputMode=`terminal.integrated.enableWin32InputMode`,e.AllowInUntrustedWorkspace=`terminal.integrated.allowInUntrustedWorkspace`,e.DeveloperPtyHostLatency=`terminal.integrated.developer.ptyHost.latency`,e.DeveloperPtyHostStartupDelay=`terminal.integrated.developer.ptyHost.startupDelay`,e.DevMode=`terminal.integrated.developer.devMode`})(tI||={});var nI;(function(e){e.Bash=`bash`,e.Fish=`fish`,e.Sh=`sh`,e.Csh=`csh`,e.Ksh=`ksh`,e.Zsh=`zsh`})(nI||={});var rI;(function(e){e.CommandPrompt=`cmd`,e.Wsl=`wsl`,e.GitBash=`gitbash`})(rI||={});var iI;(function(e){e.Claude=`claude`,e.Codex=`codex`,e.Copilot=`copilot`,e.Gemini=`gemini`,e.PowerShell=`pwsh`,e.Python=`python`,e.Julia=`julia`,e.NuShell=`nu`,e.Node=`node`,e.Xonsh=`xonsh`})(iI||={});var aI;(function(e){e[e.Api=0]=`Api`,e[e.Process=1]=`Process`,e[e.Sequence=2]=`Sequence`,e[e.Config=3]=`Config`})(aI||={});var oI;(function(e){e.LocalPty=`localPty`,e.PtyHost=`ptyHost`,e.PtyHostWindow=`ptyHostWindow`,e.Logger=`logger`,e.Heartbeat=`heartbeat`})(oI||={});var sI;(function(e){e.Cwd=`cwd`,e.InitialCwd=`initialCwd`,e.FixedDimensions=`fixedDimensions`,e.Title=`title`,e.ShellType=`shellType`,e.HasChildProcesses=`hasChildProcesses`,e.ResolvedShellLaunchConfig=`resolvedShellLaunchConfig`,e.OverrideDimensions=`overrideDimensions`,e.FailedShellIntegrationActivation=`failedShellIntegrationActivation`,e.UsedShellIntegrationInjection=`usedShellIntegrationInjection`,e.ShellIntegrationInjectionFailureReason=`shellIntegrationInjectionFailureReason`})(sI||={});var cI;(function(e){e[e.BeatInterval=5e3]=`BeatInterval`,e[e.ConnectingBeatInterval=2e4]=`ConnectingBeatInterval`,e[e.FirstWaitMultiplier=1.2]=`FirstWaitMultiplier`,e[e.SecondWaitMultiplier=1]=`SecondWaitMultiplier`,e[e.CreateProcessTimeout=5e3]=`CreateProcessTimeout`})(cI||={});var lI;(function(e){e[e.Panel=1]=`Panel`,e[e.Editor=2]=`Editor`})(lI||={});var uI;(function(e){e.TerminalView=`view`,e.Editor=`editor`})(uI||={});var dI;(function(e){e[e.GraceTime=6e4]=`GraceTime`,e[e.ShortGraceTime=6e3]=`ShortGraceTime`})(dI||={});var fI;(function(e){e[e.HighWatermarkChars=1e5]=`HighWatermarkChars`,e[e.LowWatermarkChars=5e3]=`LowWatermarkChars`,e[e.CharCountAckSize=5e3]=`CharCountAckSize`})(fI||={});var pI;(function(e){e.GitBash=`Git Bash`,e.Pwsh=`PowerShell`})(pI||={});var mI;(function(e){e[e.Off=0]=`Off`,e[e.FinalTerm=1]=`FinalTerm`,e[e.VSCode=2]=`VSCode`})(mI||={});var hI;(function(e){e.InjectionSettingDisabled=`injectionSettingDisabled`,e.NoExecutable=`noExecutable`,e.FeatureTerminal=`featureTerminal`,e.IgnoreShellIntegrationFlag=`ignoreShellIntegrationFlag`,e.UnsupportedWindowsBuild=`unsupportedWindowsBuild`,e.UnsupportedArgs=`unsupportedArgs`,e.UnsupportedShell=`unsupportedShell`,e.FailedToSetStickyBit=`failedToSetStickyBit`,e.FailedToCreateTmpDir=`failedToCreateTmpDir`})(hI||={});var gI;(function(e){e[e.DisableForTests=-2]=`DisableForTests`})(gI||={});var _I;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Shutdown=1]=`Shutdown`,e[e.Process=2]=`Process`,e[e.User=3]=`User`,e[e.Extension=4]=`Extension`})(_I||={});const vI={Backend:`workbench.contributions.terminal.processBackend`};function yI(e){return e?.toLowerCase()??``}var bI=class{constructor(e){this.remoteAuthority=e}affects(e){return yI(e)===this.remoteAuthority}},xI=class{constructor(){this._backends=new Map,this._onDidChangeBackends=new S,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){let t=yI(e.remoteAuthority);if(this._backends.has(t))throw Error(`A terminal backend with remote authority '${t}' was already registered.`);this._backends.set(t,e),this._onDidChangeBackends.fire(new bI(t))}getTerminalBackend(e){return this._backends.get(yI(e))}};wm.add(vI.Backend,new xI);var SI=class{constructor(e){this._callback=e,this._terminalBufferMap=new Map}dispose(){for(let e of this._terminalBufferMap.values())e.dispose()}startBuffering(e,t,n=5){let r=t(t=>{let i=Ge(t)?t:t.data,a=this._terminalBufferMap.get(e);if(a){a.data.push(i);return}let o=setTimeout(()=>this.flushBuffer(e),n);a={data:[i],timeoutId:o,dispose:()=>{clearTimeout(o),this.flushBuffer(e),r.dispose()}},this._terminalBufferMap.set(e,a)});return r}stopBuffering(e){this._terminalBufferMap.get(e)?.dispose()}flushBuffer(e){let t=this._terminalBufferMap.get(e);t&&(this._terminalBufferMap.delete(e),this._callback(e,t.data.join(``)))}};const CI=(e,t,n,r)=>{let i=t;return{enumerable:!0,configurable:!1,get(){return i},set(t){if(!n(i,t)){let n=i;i=t,e.listener?.(r(t,n))}}}},wI=(e,t)=>e===t,TI={range:(e,t)=>e===t?!0:!e||!t?!1:e.isEqual(t),label:wI,description:wI,sortText:wI,busy:wI,error:wI,canResolveChildren:wI,tags:(e,t)=>!(e.length!==t.length||e.some(e=>!t.find(t=>e.id===t.id)))},EI=e=>t=>({op:kw.SetProp,update:e(t)}),DI=(e,t)=>({range:(()=>{let t,n=EI(e=>({range:bp.lift(J.from(e))}));return{enumerable:!0,configurable:!1,get(){return t},set(r){e.listener?.({op:kw.DocumentSynced}),TI.range(t,r)||(t=r,e.listener?.(n(r)))}}})(),label:CI(e,t,TI.label,EI(e=>({label:e}))),description:CI(e,void 0,TI.description,EI(e=>({description:e}))),sortText:CI(e,void 0,TI.sortText,EI(e=>({sortText:e}))),canResolveChildren:CI(e,!1,TI.canResolveChildren,e=>({op:kw.UpdateCanResolveChildren,state:e})),busy:CI(e,!1,TI.busy,EI(e=>({busy:e}))),error:CI(e,void 0,TI.error,EI(e=>({error:Y.fromStrict(e)||null}))),tags:CI(e,[],TI.tags,(e,t)=>({op:kw.SetTags,new:e.map(CM.from),old:t.map(CM.from)}))}),OI=e=>{let t=DC.fromString(e.extId),n=new AI(t.controllerId,t.localId,e.label,w.revive(e.uri)||void 0);return n.range=J.to(e.range||void 0),n.description=e.description||void 0,n.sortText=e.sortText||void 0,n.tags=e.tags.map(e=>CM.to({id:VC(e).tagId})),n},kI=e=>{let t;for(let n of e.tests){let e=OI(n.item);Bw(e).parent=t,t=e}return t};var AI=class e{constructor(t,n,r,i){if(n.includes(TC.Delimiter))throw Error(`Test IDs may not include the ${JSON.stringify(n)} symbol`);let a=zw(this,t);Object.defineProperties(this,{id:{value:n,enumerable:!0,writable:!1},uri:{value:i,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return a.parent instanceof jI?void 0:a.parent}},children:{value:Lw(a,Bw,e),enumerable:!0,writable:!1},...DI(a,r)})}},jI=class extends AI{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}},MI=class extends Nw{constructor(e,t,n){super({controllerId:e,getDocumentVersion:e=>e&&n.getDocument(e)?.version,getApiFor:Bw,getChildren:e=>e.children,root:new jI(e,t),toITestItem:EM.from})}};let NI=class extends y{constructor(e,t,n){super(),this.initData=t,this._onDidChangeTelemetryEnabled=this._register(new S),this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event,this._onDidChangeTelemetryConfiguration=this._register(new S),this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event,this._productConfig={usage:!0,error:!0},this._level=r_.NONE,this._inLoggingOnlyMode=!1,this._telemetryLoggers=new Map,this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly;let r=t.remote.isRemote?`remoteExtHostTelemetry`:e?`workerExtHostTelemetry`:`extHostTelemetry`;this._outputLogger=this._register(n.createLogger(r,{name:x(2877,`Extension Telemetry{0}`,this._inLoggingOnlyMode?` (Not Sent)`:``),hidden:!0,group:gw}))}getTelemetryConfiguration(){return this._level===r_.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=r_.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=r_.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=r_.USAGE:!1}}instantiateLogger(e,t,n){let r=this.getTelemetryDetails(),i=new PI(t,n,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:r.isUsageEnabled,isErrorsEnabled:r.isErrorsEnabled}),a=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...a,i]),i.apiTelemetryLogger}$initializeTelemetryLevel(e,t,n){this._level=e,this._productConfig=n??{usage:!0,error:!0}}getBuiltInCommonProperties(e){let t=Object.create(null);switch(t[`common.extname`]=`${e.publisher}.${e.name}`,t[`common.extversion`]=e.version,t[`common.vscodemachineid`]=this.initData.telemetryInfo.machineId,t[`common.vscodesessionid`]=this.initData.telemetryInfo.sessionId,t[`common.vscodecommithash`]=this.initData.commit,t[`common.sqmid`]=this.initData.telemetryInfo.sqmId,t[`common.devDeviceId`]=this.initData.telemetryInfo.devDeviceId??this.initData.telemetryInfo.machineId,t[`common.vscodeversion`]=this.initData.version,t[`common.vscodereleasedate`]=this.initData.date,t[`common.isnewappinstall`]=FI(this.initData.telemetryInfo.firstSessionDate),t[`common.product`]=this.initData.environment.appHost,this.initData.uiKind){case mr.Web:t[`common.uikind`]=`web`;break;case mr.Desktop:t[`common.uikind`]=`desktop`;break;default:t[`common.uikind`]=`unknown`}return t[`common.remotename`]=_w(this.initData.remote.authority,this.initData),this.initData.environment.isSessionsWindow&&(t[`common.isAgentsWindow`]=!0),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;let t=this.getTelemetryDetails();this._telemetryLoggers.forEach((e,t)=>{let n=e.filter(e=>!e.isDisposed);n.length===0?this._telemetryLoggers.delete(t):this._telemetryLoggers.set(t,n)}),this._telemetryLoggers.forEach(e=>{for(let n of e)n.updateTelemetryEnablements(t.isUsageEnabled,t.isErrorsEnabled)}),this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails())}onExtensionError(e,t){let n=this._telemetryLoggers.get(e.value)?.filter(e=>!e.isDisposed);if(!n)return this._telemetryLoggers.delete(e.value),!1;let r=!1;for(let e of n)e.ignoreUnhandledExtHostErrors||(e.logError(t),r=!0);return r}};NI=A([j(1,Fs),j(2,Os)],NI);var PI=class{static validateSender(e){if(typeof e!=`object`)throw TypeError(`TelemetrySender argument is invalid`);if(typeof e.sendEventData!=`function`)throw TypeError(`TelemetrySender.sendEventData must be a function`);if(typeof e.sendErrorData!=`function`)throw TypeError(`TelemetrySender.sendErrorData must be a function`);if(e.flush!==void 0&&typeof e.flush!=`function`)throw TypeError(`TelemetrySender.flush must be a function or undefined`)}constructor(e,t,n,r,i,a,o){this._extension=n,this._logger=r,this._inLoggingOnlyMode=i,this._commonProperties=a,this._onDidChangeEnableStates=new S,this.ignoreUnhandledExtHostErrors=t?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=t?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=t?.additionalCommonProperties,this._sender=e,this._telemetryEnablements={isUsageEnabled:o.isUsageEnabled,isErrorsEnabled:o.isErrorsEnabled}}updateTelemetryEnablements(e,t){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:e,isErrorsEnabled:t},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(e){let t=e.properties?e.properties??{}:e;return t=Sw(t,[]),this._additionalCommonProperties&&(t=oc(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=oc(t,this._commonProperties)),e.properties?e.properties=t:e=t,e}logEvent(e,t){this._sender&&(e=this._extension.publisher===`vscode`?this._extension.name+`/`+e:this._extension.identifier.value+`/`+e,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender?.sendEventData(e,t),this._logger.trace(e,t))}logUsage(e,t){this._telemetryEnablements.isUsageEnabled&&this.logEvent(e,t)}logError(e,t){if(!(!this._telemetryEnablements.isErrorsEnabled||!this._sender))if(typeof e==`string`)this.logEvent(e,t);else{let n=Sw({name:e.name,message:e.message,stack:e.stack,cause:e.cause},[]),r=Error(typeof n.message==`string`?n.message:void 0,{cause:n.cause});r.stack=typeof n.stack==`string`?n.stack:void 0,r.name=typeof n.name==`string`?n.name:`unknown`,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(r,t),this._logger.trace(`exception`,t)}}get apiTelemetryLogger(){if(!this._apiObject){let e=this,t={logUsage:e.logUsage.bind(e),get isUsageEnabled(){return e._telemetryEnablements.isUsageEnabled},get isErrorsEnabled(){return e._telemetryEnablements.isErrorsEnabled},logError:e.logError.bind(e),dispose:e.dispose.bind(e),onDidChangeEnableStates:e._onDidChangeEnableStates.event.bind(e)};this._apiObject=Object.freeze(t)}return this._apiObject}get isDisposed(){return!this._sender}dispose(){if(this._sender?.flush){let e=this._sender;this._sender=void 0,Promise.resolve(e.flush()).then(e=void 0),this._apiObject=void 0}else this._sender=void 0;this._onDidChangeEnableStates.dispose()}};function FI(e){let t=Date.now()-new Date(e).getTime();return isNaN(t)?!1:t<1e3*60*60*24}const II=k(`IExtHostTelemetry`);let LI=class{#e;#t;#n;constructor(e,t,n){this._commands=new Map,this._apiCommands=new Map,this.#e=e.getProxy(E.MainThreadCommands),this._logService=t,this.#n=n,this.#t=e.getProxy(E.MainThreadTelemetry),this.converter=new zI(this,e=>{let t=this._apiCommands.get(e);return t?.result===BI.Void?t:void 0},t),this._argumentProcessors=[{processArgument(e){return Hu(e)}},{processArgument(e){return ic(e,function(e){if(bp.isIRange(e))return J.to(e);if(yp.isIPosition(e))return sj.to(e);if(bp.isIRange(e.range)&&w.isUri(e.uri))return jj.to(e);if(e instanceof b)return e.buffer.buffer;if(!Array.isArray(e))return e})}}]}registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){let t=this.registerCommand(!1,e.id,async(...t)=>{let n=e.args.map((n,r)=>{if(!n.validate(t[r]))throw Error(`Invalid argument '${n.name}' when running '${e.id}', received: ${typeof t[r]==`object`?JSON.stringify(t[r],null,` `):t[r]} `);return n.convert(t[r])}),r=await this.executeCommand(e.internalId,...n);return e.result.convert(r,t,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new WT(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,n,r,i,a){if(this._logService.trace(`ExtHostCommands#registerCommand`,t),!t.trim().length)throw Error(`invalid id`);if(this._commands.has(t))throw Error(`command '${t}' already exists`);return this._commands.set(t,{callback:n,thisArg:r,metadata:i,extension:a}),e&&this.#e.$registerCommand(t),new WT(()=>{this._commands.delete(t)&&e&&this.#e.$unregisterCommand(t)})}executeCommand(e,...t){return this._logService.trace(`ExtHostCommands#executeCommand`,e),this._doExecuteCommand(e,t,!0)}async _doExecuteCommand(e,t,n){if(this._commands.has(e))return this.#e.$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let r=!1,i=ic(t,function(e){if(e instanceof eT)return sj.from(e);if(e instanceof nT)return J.from(e);if(e instanceof dT)return jj.from(e);if(mT.isNotebookRange(e))return uM.from(e);if(e instanceof ArrayBuffer)return r=!0,b.wrap(new Uint8Array(e));if(e instanceof Uint8Array)return r=!0,b.wrap(e);if(e instanceof b)return r=!0,e;if(!Array.isArray(e))return e});try{return Hu(await this.#e.$executeCommand(e,r?new _i(i):i,n))}catch(n){if(n instanceof Error&&n.message===`$executeCommand:retry`)return this._doExecuteCommand(e,t,!1);throw n}}}async _executeContributedCommand(e,t,n){let r=this._commands.get(e);if(!r)throw Error(`Unknown command`);let{callback:i,thisArg:a,metadata:o}=r;if(o?.args)for(let n=0;n<o.args.length;n++)try{st(t[n],o.args[n].constraint)}catch{throw Error(`Running the contributed command: '${e}' failed. Illegal argument '${o.args[n].name}' - ${o.args[n].description}`)}let s=Yn.create();try{return await i.apply(a,t)}catch(i){if(e===this.converter.delegatingCommandId){let n=this.converter.getActualCommand(...t);n&&(e=n.command)}if(d(i)||this._logService.error(i,e,r.extension?.identifier),!n)throw i;if(r.extension?.identifier){let e=this.#n.onExtensionError(r.extension.identifier,i);this._logService.trace(`forwarded error to extension?`,e,r.extension?.identifier)}throw new class extends Error{constructor(){super(Om(i)),this.id=e,this.source=r.extension?.displayName??r.extension?.name}}}finally{this._reportTelemetry(r,e,s.elapsed())}}_reportTelemetry(e,t,n){e.extension&&(t.startsWith(`code.copilot.logStructured`)||this.#t.$publicLog2(`Extension:ActionExecuted`,{extensionId:e.extension.identifier.value,id:new hw(t),duration:n}))}$executeContributedCommand(e,...t){this._logService.trace(`ExtHostCommands#$executeContributedCommand`,e);let n=this._commands.get(e);return n?(t=t.map(e=>this._argumentProcessors.reduce((e,t)=>t.processArgument(e,n.extension),e)),this._executeContributedCommand(e,t,!0)):Promise.reject(Error(`Contributed command '${e}' does not exist.`))}getCommands(e=!1){return this._logService.trace(`ExtHostCommands#getCommands`,e),this.#e.$getCommands().then(t=>(e&&(t=t.filter(e=>e[0]!==`_`)),t))}$getContributedCommandMetadata(){let e=Object.create(null);for(let[t,n]of this._commands){let{metadata:r}=n;r&&(e[t]=r)}return Promise.resolve(e)}};LI=A([j(0,Hs),j(1,Ds),j(2,II)],LI);const RI=k(`IExtHostCommands`);var zI=class{constructor(e,t,n){this._commands=e,this._lookupApiCommand=t,this._logService=n,this.delegatingCommandId=`__vsc${zc()}`,this._cache=new Map,this._cachIdPool=0,this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(e,t){if(!e)return;let n={$ident:void 0,id:e.command,title:e.title,tooltip:e.tooltip};if(!e.command)return n;let r=this._lookupApiCommand(e.command);if(r)n.id=r.internalId,n.arguments=r.args.map((t,n)=>t.convert(e.arguments&&e.arguments[n]));else if(ge(e.arguments)){let r=`${e.command} /${++this._cachIdPool}`;this._cache.set(r,e),t.add(_(()=>{this._cache.delete(r),this._logService.trace(`CommandsConverter#DISPOSE`,r)})),n.$ident=r,n.id=this.delegatingCommandId,n.arguments=[r],this._logService.trace(`CommandsConverter#CREATE`,e.command,r)}return n}fromInternal(e){return typeof e.$ident==`string`?this._cache.get(e.$ident):{command:e.id,title:e.title,arguments:e.arguments}}getActualCommand(...e){return this._cache.get(e[0])}_executeConvertedCommand(...e){let t=this.getActualCommand(...e);return this._logService.trace(`CommandsConverter#EXECUTE`,e[0],t?t.command:`MISSING`),t?this._commands.executeCommand(t.command,...t.arguments||[]):Promise.reject(`Actual command not found, wanted to execute ${e[0]}`)}},X=class e{static{this.Uri=new e(`uri`,`Uri of a text document`,e=>w.isUri(e),e=>e)}static{this.Position=new e(`position`,`A position in a text document`,e=>eT.isPosition(e),sj.from)}static{this.Range=new e(`range`,`A range in a text document`,e=>nT.isRange(e),J.from)}static{this.Selection=new e(`selection`,`A selection in a text document`,e=>xT.isSelection(e),ij.from)}static{this.Number=new e(`number`,``,e=>typeof e==`number`,e=>e)}static{this.String=new e(`string`,``,e=>typeof e==`string`,e=>e)}static Arr(t){return new e(`${t.name}_array`,`Array of ${t.name}, ${t.description}`,e=>Array.isArray(e)&&e.every(e=>t.validate(e)),e=>e.map(e=>t.convert(e)))}static{this.CallHierarchyItem=new e(`item`,`A call hierarchy item`,e=>e instanceof oE,Oj.from)}static{this.TypeHierarchyItem=new e(`item`,`A type hierarchy item`,e=>e instanceof ik,AM.from)}static{this.TestItem=new e(`testItem`,`A VS Code TestItem`,e=>e instanceof AI,EM.from)}static{this.TestProfile=new e(`testProfile`,`A VS Code test profile`,e=>e instanceof WO,wM.from)}constructor(e,t,n,r){this.name=e,this.description=t,this.validate=n,this.convert=r}optional(){return new e(this.name,`(optional) ${this.description}`,e=>e==null||this.validate(e),e=>e===void 0?void 0:e===null?null:this.convert(e))}with(t,n){return new e(t??this.name,n??this.description,this.validate,this.convert)}},BI=class e{static{this.Void=new e(`no result`,e=>e)}constructor(e,t){this.description=e,this.convert=t}},VI=class{constructor(e,t,n,r,i){this.id=e,this.internalId=t,this.description=n,this.args=r,this.result=i}};const HI=k(`IExtHostTerminalService`);var UI=class extends y{constructor(e,t,n,r){super(),this._proxy=e,this._id=t,this._creationOptions=n,this._name=r,this._disposed=!1,this._state={isInteractedWith:!1,shell:void 0},this.isOpen=!1,this._onWillDispose=this._register(new S),this.onWillDispose=this._onWillDispose.event,this._creationOptions=Object.freeze(this._creationOptions),this._pidPromise=new Promise(e=>this._pidPromiseComplete=e);let i=this;this.value={get name(){return i._name||``},get processId(){return i._pidPromise},get creationOptions(){return i._creationOptions},get exitStatus(){return i._exitStatus},get state(){return i._state},get selection(){return i._selection},get shellIntegration(){return i.shellIntegration},sendText(e,t=!0){i._checkDisposed(),i._proxy.$sendText(i._id,e,t)},show(e){i._checkDisposed(),i._proxy.$show(i._id,e)},hide(){i._checkDisposed(),i._proxy.$hide(i._id)},dispose(){i._disposed||(i._disposed=!0,i._proxy.$dispose(i._id))},get dimensions(){if(!(i._cols===void 0||i._rows===void 0))return{columns:i._cols,rows:i._rows}}}}dispose(){this._onWillDispose.fire(),super.dispose()}async create(e,t){if(typeof this._id!=`string`)throw Error(`Terminal has already been created`);await this._proxy.$createTerminal(this._id,{name:e.name,shellPath:e.shellPath??void 0,shellArgs:e.shellArgs??void 0,cwd:e.cwd??t?.cwd??void 0,env:e.env??void 0,icon:XI(e.iconPath)??void 0,color:dl.isThemeColor(e.color)?e.color.id:void 0,initialText:e.message??void 0,strictEnv:e.strictEnv??void 0,hideFromUser:e.hideFromUser??void 0,forceShellIntegration:t?.forceShellIntegration??void 0,isFeatureTerminal:t?.isFeatureTerminal??void 0,isExtensionOwnedTerminal:!0,useShellEnvironment:t?.useShellEnvironment??void 0,location:t?.location||this._serializeParentTerminal(e.location,t?.resolvedExtHostIdentifier),isTransient:e.isTransient??void 0,shellIntegrationNonce:e.shellIntegrationNonce??void 0,titleTemplate:e.titleTemplate??void 0})}async createExtensionTerminal(e,t,n,r,i,a,o){if(typeof this._id!=`string`)throw Error(`Terminal has already been created`);if(await this._proxy.$createTerminal(this._id,{name:this._name,isExtensionCustomPtyTerminal:!0,icon:r,color:dl.isThemeColor(i)?i.id:void 0,location:t?.location||this._serializeParentTerminal(e,n),isTransient:!0,shellIntegrationNonce:a??void 0,titleTemplate:o??void 0}),typeof this._id==`string`)throw Error(`Terminal creation failed`);return this._id}_serializeParentTerminal(e,t){return typeof e==`object`?ct(e,{parentTerminal:!0})&&e.parentTerminal&&t?{parentTerminal:t}:ct(e,{viewColumn:!0})?{viewColumn:pj.from(e.viewColumn),preserveFocus:e.preserveFocus}:void 0:e}_checkDisposed(){if(this._disposed)throw Error(`Terminal has already been disposed`)}set name(e){this._name=e}setExitStatus(e,t){this._exitStatus=Object.freeze({code:e,reason:t})}setDimensions(e,t){return e===this._cols&&t===this._rows||e===0||t===0?!1:(this._cols=e,this._rows=t,!0)}setInteractedWith(){return this._state.isInteractedWith?!1:(this._state={...this._state,isInteractedWith:!0},!0)}setShellType(e){return this._state.shell===e?!1:(this._state={...this._state,shell:e},!0)}setSelection(e){this._selection=e}_setProcessId(e){this._pidPromiseComplete?(this._pidPromiseComplete(e),this._pidPromiseComplete=void 0):this._pidPromise.then(t=>{t!==e&&(this._pidPromise=Promise.resolve(e))})}},WI=class{get onProcessReady(){return this._onProcessReady.event}constructor(e){this._pty=e,this.id=0,this.shouldPersist=!1,this._onProcessData=new S,this.onProcessData=this._onProcessData.event,this._onProcessReady=new S,this._onDidChangeProperty=new S,this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=new S,this.onProcessExit=this._onProcessExit.event}refreshProperty(e){throw Error(`refreshProperty is not suppported in extension owned terminals. property: ${e}`)}updateProperty(e,t){throw Error(`updateProperty is not suppported in extension owned terminals. property: ${e}, value: ${t}`)}async start(){}shutdown(){this._pty.close()}input(e){this._pty.handleInput?.(e)}sendSignal(e){}resize(e,t){this._pty.setDimensions?.({columns:e,rows:t})}clearBuffer(){}async processBinary(e){}acknowledgeDataEvent(e){}async setUnicodeVersion(e){}getInitialCwd(){return Promise.resolve(``)}getCwd(){return Promise.resolve(``)}startSendingEvents(e){this._pty.onDidWrite(e=>this._onProcessData.fire(e)),this._pty.onDidClose?.((e=void 0)=>{this._onProcessExit.fire(e===void 0?void 0:e)}),this._pty.onDidOverrideDimensions?.(e=>{e&&this._onDidChangeProperty.fire({type:sI.OverrideDimensions,value:{cols:e.columns,rows:e.rows}})}),this._pty.onDidChangeName?.(e=>{this._onDidChangeProperty.fire({type:sI.Title,value:e})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:``,windowsPty:void 0})}};let GI=1,KI=class extends y{get activeTerminal(){return this._activeTerminal?.value}get terminals(){return this._terminals.map(e=>e.value)}constructor(e,t,n){super(),this._extHostCommands=t,this._terminals=[],this._terminalProcesses=new Map,this._terminalProcessDisposables={},this._extensionTerminalAwaitingStart={},this._getTerminalPromises={},this._environmentVariableCollections=new Map,this._lastQuickFixCommands=this._register(new vt),this._linkProviders=new Set,this._completionProviders=new Map,this._profileProviders=new Map,this._quickFixProviders=new Map,this._terminalLinkCache=new Map,this._terminalLinkCancellationSource=new Map,this._onDidCloseTerminal=new S,this.onDidCloseTerminal=this._onDidCloseTerminal.event,this._onDidOpenTerminal=new S,this.onDidOpenTerminal=this._onDidOpenTerminal.event,this._onDidChangeActiveTerminal=new S,this.onDidChangeActiveTerminal=this._onDidChangeActiveTerminal.event,this._onDidChangeTerminalDimensions=new S,this.onDidChangeTerminalDimensions=this._onDidChangeTerminalDimensions.event,this._onDidChangeTerminalState=new S,this.onDidChangeTerminalState=this._onDidChangeTerminalState.event,this._onDidChangeShell=new S,this.onDidChangeShell=this._onDidChangeShell.event,this._onDidWriteTerminalData=new S({onWillAddFirstListener:()=>this._proxy.$startSendingDataEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingDataEvents()}),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidExecuteCommand=new S({onWillAddFirstListener:()=>this._proxy.$startSendingCommandEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingCommandEvents()}),this.onDidExecuteTerminalCommand=this._onDidExecuteCommand.event,this._proxy=n.getProxy(E.MainThreadTerminalService),this._bufferer=new SI(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(e),this._extHostCommands.registerArgumentProcessor({processArgument:e=>{let t=e=>this.getTerminalById(e.instanceId)?.value;switch(e?.$mid){case Er.TerminalContext:return t(e);default:if(Array.isArray(e))for(let n=0;n<e.length&&e[n].$mid===Er.TerminalContext;n++)e[n]=t(e[n]);return e}}}),this._register({dispose:()=>{for(let[e,t]of this._terminalProcesses)t.shutdown(!0)}})}getDefaultShell(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.path||``}getDefaultShellArgs(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.args||[]}createExtensionTerminal(e,t){let n=new UI(this._proxy,zc(),e,e.name),r=new WI(e.pty);return n.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,XI(e.iconPath),ZI(e.color),e.shellIntegrationNonce,e.titleTemplate).then(e=>{let t=this._setupExtHostProcessListeners(e,r);this._terminalProcessDisposables[e]=t}),this._terminals.push(n),n.value}_serializeParentTerminal(e,t){if(t||={},e.location&&typeof e.location==`object`&&ct(e.location,{parentTerminal:!0})){let n=e.location.parentTerminal;if(n){let e=this._terminals.find(e=>e.value===n);e&&(t.resolvedExtHostIdentifier=e._id)}}else e.location&&typeof e.location!=`object`?t.location=e.location:t.location&&typeof t.location==`object`&&ct(t.location,{splitActiveTerminal:!0})&&(t.location={splitActiveTerminal:!0});return t}attachPtyToTerminal(e,t){if(!this.getTerminalById(e))throw Error(`Cannot resolve terminal with id ${e} for virtual process`);let n=new WI(t),r=this._setupExtHostProcessListeners(e,n);this._terminalProcessDisposables[e]=r}async $acceptActiveTerminalChanged(e){let t=this._activeTerminal;if(e===null){this._activeTerminal=void 0,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal);return}let n=this.getTerminalById(e);n&&(this._activeTerminal=n,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal.value))}async $acceptTerminalProcessData(e,t){let n=this.getTerminalById(e);n&&this._onDidWriteTerminalData.fire({terminal:n.value,data:t})}async $acceptTerminalDimensions(e,t,n){let r=this.getTerminalById(e);r&&r.setDimensions(t,n)&&this._onDidChangeTerminalDimensions.fire({terminal:r.value,dimensions:r.value.dimensions})}async $acceptDidExecuteCommand(e,t){let n=this.getTerminalById(e);n&&this._onDidExecuteCommand.fire({terminal:n.value,...t})}async $acceptTerminalMaximumDimensions(e,t,n){this._terminalProcesses.get(e)?.resize(t,n)}async $acceptTerminalTitleChange(e,t){let n=this.getTerminalById(e);n&&(n.name=t)}async $acceptTerminalClosed(e,t,n){this._terminalLinkCache.delete(e);let r=this._terminalLinkCancellationSource.get(e);r&&(this._terminalLinkCancellationSource.delete(e),r.dispose(!0));let i=this._getTerminalObjectIndexById(this._terminals,e);if(i!==null){let e=this._terminals.splice(i,1)[0];e.setExitStatus(t,n),this._onDidCloseTerminal.fire(e.value)}}$acceptTerminalOpened(e,t,n,r){if(t){let n=this._getTerminalObjectIndexById(this._terminals,t);if(n!==null){this._terminals[n]._id=e,this._onDidOpenTerminal.fire(this.terminals[n]),this._terminals[n].isOpen=!0;return}}let i={name:r.name,shellPath:r.executable,shellArgs:r.args,cwd:typeof r.cwd==`string`?r.cwd:w.revive(r.cwd),env:r.env,hideFromUser:r.hideFromUser,titleTemplate:r.titleTemplate},a=new UI(this._proxy,e,i,n);this._terminals.push(a),this._onDidOpenTerminal.fire(a.value),a.isOpen=!0}async $acceptTerminalProcessId(e,t){this.getTerminalById(e)?._setProcessId(t)}async $startExtensionTerminal(e,t){let n=this.getTerminalById(e);if(!n)return{message:x(2878,`Could not find the terminal with id {0} on the extension host`,e)};n.isOpen||await new Promise(e=>{let t=this.onDidOpenTerminal(async r=>{r===n.value&&(t.dispose(),e())})});let r=this._terminalProcesses.get(e);r?r.startSendingEvents(t):this._extensionTerminalAwaitingStart[e]={initialDimensions:t}}_setupExtHostProcessListeners(e,t){let n=new v;n.add(t.onProcessReady(t=>this._proxy.$sendProcessReady(e,t.pid,t.cwd,t.windowsPty))),n.add(t.onDidChangeProperty(t=>this._proxy.$sendProcessProperty(e,t))),this._bufferer.startBuffering(e,t.onProcessData),n.add(t.onProcessExit(t=>this._onProcessExit(e,t))),this._terminalProcesses.set(e,t);let r=this._extensionTerminalAwaitingStart[e];return r&&t instanceof WI&&(t.startSendingEvents(r.initialDimensions),delete this._extensionTerminalAwaitingStart[e]),n}$acceptProcessAckDataEvent(e,t){this._terminalProcesses.get(e)?.acknowledgeDataEvent(t)}$acceptProcessInput(e,t){this._terminalProcesses.get(e)?.input(t)}$acceptTerminalInteraction(e){let t=this.getTerminalById(e);t?.setInteractedWith()&&this._onDidChangeTerminalState.fire(t.value)}$acceptTerminalSelection(e,t){this.getTerminalById(e)?.setSelection(t)}$acceptProcessResize(e,t,n){try{this._terminalProcesses.get(e)?.resize(t,n)}catch(e){if(e.code!==`EPIPE`&&e.code!==`ERR_IPC_CHANNEL_CLOSED`)throw e}}$acceptProcessShutdown(e,t){this._terminalProcesses.get(e)?.shutdown(t)}$acceptProcessRequestInitialCwd(e){this._terminalProcesses.get(e)?.getInitialCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:sI.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:sI.Cwd,value:t}))}$acceptProcessRequestLatency(e){return Promise.resolve(e)}registerProfileProvider(e,t,n){if(this._profileProviders.has(t))throw Error(`Terminal profile provider "${t}" already registered`);return this._profileProviders.set(t,{provider:n,extension:e}),this._proxy.$registerProfileProvider(t,e.identifier.value),new WT(()=>{this._profileProviders.delete(t),this._proxy.$unregisterProfileProvider(t)})}registerTerminalCompletionProvider(e,t,...n){if(this._completionProviders.has(e.identifier.value))throw Error(`Terminal completion provider "${e.identifier.value}" already registered`);return this._completionProviders.set(e.identifier.value,t),this._proxy.$registerCompletionProvider(e.identifier.value,e.identifier.value,...n),new WT(()=>{this._completionProviders.delete(e.identifier.value),this._proxy.$unregisterCompletionProvider(e.identifier.value)})}async $provideTerminalCompletions(e,t){let n=new Ii().token;if(n.isCancellationRequested||!this.activeTerminal)return;let r=this._completionProviders.get(e);if(!r)return;let i=await r.provideTerminalCompletions(this.activeTerminal,t,n);if(i==null)return;let a=!yn||this.activeTerminal.state?.shell===rI.GitBash?`/`:`\\`;return wN.from(i,a)}$acceptTerminalShellType(e,t){let n=this.getTerminalById(e);n?.setShellType(t)&&this._onDidChangeTerminalState.fire(n.value)}registerTerminalQuickFixProvider(e,t,n){if(this._quickFixProviders.has(e))throw Error(`Terminal quick fix provider "${e}" is already registered`);return this._quickFixProviders.set(e,n),this._proxy.$registerQuickFixProvider(e,t),new WT(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){let n=new Ii().token;if(n.isCancellationRequested)return;let r=this._quickFixProviders.get(e);if(!r)return;let i=await r.provideTerminalQuickFixes(t,n);if(i===null||Array.isArray(i)&&i.length===0)return;let a=new v;if(this._lastQuickFixCommands.value=a,!Array.isArray(i))return i?SN.from(i,this._extHostCommands.converter,a):void 0;let o=[];for(let e of i){let t=SN.from(e,this._extHostCommands.converter,a);t&&o.push(t)}return o}async $createContributedProfileTerminal(e,t){let n=new Ii().token,r=this._profileProviders.get(e);if(!r)throw Error(`No terminal profile provider registered for id "${e}"`);let i=await r.provider.provideTerminalProfile(n);if(n.isCancellationRequested)return;if(i&&!ct(i,{options:!0})&&(i={options:i}),!i||!ct(i,{options:!0}))throw Error(`No terminal profile options provided for id "${e}"`);let a=Dw(r.extension);!a&&i.options.titleTemplate!==void 0&&(console.error(`[${r.extension.identifier.value}] \`titleTemplate\` returned from TerminalProfileProvider is ignored because the \`terminalTitle\` proposed API is not enabled.`),i={options:{...i.options,titleTemplate:void 0}}),!a&&t.titleTemplate!==void 0&&console.error(`[${r.extension.identifier.value}] \`titleTemplate\` passed to createContributedTerminalProfile is ignored because the \`terminalTitle\` proposed API is not enabled.`);let o=a&&t.titleTemplate&&!i.options.titleTemplate?{...i.options,titleTemplate:t.titleTemplate}:i.options;if(ct(o,{pty:!0})){this.createExtensionTerminal(o,t);return}this.createTerminalFromOptions(o,t)}registerLinkProvider(e){return this._linkProviders.add(e),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new WT(()=>{this._linkProviders.delete(e),this._linkProviders.size===0&&this._proxy.$stopLinkProvider()})}async $provideLinks(e,t){let n=this.getTerminalById(e);if(!n)return[];this._terminalLinkCache.delete(e),this._terminalLinkCancellationSource.get(e)?.dispose(!0);let r=new Ii;this._terminalLinkCancellationSource.set(e,r);let i=[],a={terminal:n.value,line:t},o=[];for(let e of this._linkProviders)o.push(zo.withAsyncBody(async t=>{let n=r.token.onCancellationRequested(()=>t({provider:e,links:[]}));try{let n=await e.provideTerminalLinks(a,r.token)||[];r.token.isCancellationRequested||t({provider:e,links:n})}finally{n.dispose()}}));let s=await Promise.all(o);if(r.token.isCancellationRequested)return[];let c=new Map;for(let e of s)e&&e.links.length>0&&i.push(...e.links.map(t=>{let n={id:GI++,startIndex:t.startIndex,length:t.length,label:t.tooltip};return c.set(n.id,{provider:e.provider,link:t}),n}));return this._terminalLinkCache.set(e,c),i}$activateLink(e,t){let n=this._terminalLinkCache.get(e)?.get(t);n&&n.provider.handleTerminalLink(n.link)}_onProcessExit(e,t){this._bufferer.stopBuffering(e),this._terminalProcesses.delete(e),delete this._extensionTerminalAwaitingStart[e];let n=this._terminalProcessDisposables[e];n&&(n.dispose(),delete this._terminalProcessDisposables[e]),this._proxy.$sendProcessExit(e,t)}getTerminalById(e){return this._getTerminalObjectById(this._terminals,e)}getTerminalIdByApiObject(e){let t=this._terminals.findIndex(t=>t.value===e);return t>=0?t:null}_getTerminalObjectById(e,t){let n=this._getTerminalObjectIndexById(e,t);return n===null?null:e[n]}_getTerminalObjectIndexById(e,t){let n=e.findIndex(e=>e._id===t);return n>=0?n:null}getEnvironmentVariableCollection(e){let t=this._environmentVariableCollections.get(e.identifier.value);return t||(t=this._register(new qI),this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){let n=QF(t.map),r=$F(t.descriptionMap);this._proxy.$setEnvironmentVariableCollection(e,t.persistent,n.length===0?void 0:n,r)}$initEnvironmentVariableCollections(e){e.forEach(e=>{let t=e[0],n=this._register(new qI(e[1]));this._setEnvironmentVariableCollection(t,n)})}$acceptDefaultProfile(e,t){let n=this._defaultProfile;this._defaultProfile=e,this._defaultAutomationProfile=t,n?.path!==e.path&&this._onDidChangeShell.fire(e.path)}_setEnvironmentVariableCollection(e,t){this._environmentVariableCollections.set(e,t),this._register(t.onDidChangeCollection(()=>{this._syncEnvironmentVariableCollection(e,t)}))}};KI=A([j(1,RI),j(2,Hs)],KI);var qI=class extends y{get persistent(){return this._persistent}set persistent(e){this._persistent=e,this._onDidChangeCollection.fire()}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e){super(),this.map=new Map,this.scopedCollections=new Map,this.descriptionMap=new Map,this._persistent=!0,this._onDidChangeCollection=this._register(new S),this.map=new Map(e)}getScopedEnvironmentVariableCollection(e){let t=this.getScopeKey(e),n=this.scopedCollections.get(t);return n||(n=new JI(this,e),this.scopedCollections.set(t,n),this._register(n.onDidChangeCollection(()=>this._onDidChangeCollection.fire()))),n}replace(e,t,n,r){this._setIfDiffers(e,{value:t,type:YT.Replace,options:n??{applyAtProcessCreation:!0},scope:r})}append(e,t,n,r){this._setIfDiffers(e,{value:t,type:YT.Append,options:n??{applyAtProcessCreation:!0},scope:r})}prepend(e,t,n,r){this._setIfDiffers(e,{value:t,type:YT.Prepend,options:n??{applyAtProcessCreation:!0},scope:r})}_setIfDiffers(e,t){if(t.options&&t.options.applyAtProcessCreation===!1&&!t.options.applyAtShellIntegration)throw Error(`EnvironmentVariableMutatorOptions must apply at either process creation or shell integration`);let n=this.getKey(e,t.scope),r=this.map.get(n),i=t.options?{applyAtProcessCreation:t.options.applyAtProcessCreation??!1,applyAtShellIntegration:t.options.applyAtShellIntegration??!1}:{applyAtProcessCreation:!0};if(!r||r.value!==t.value||r.type!==t.type||r.options?.applyAtProcessCreation!==i.applyAtProcessCreation||r.options?.applyAtShellIntegration!==i.applyAtShellIntegration||r.scope?.workspaceFolder?.index!==t.scope?.workspaceFolder?.index){let n=this.getKey(e,t.scope),r={variable:e,...t,options:i};this.map.set(n,r),this._onDidChangeCollection.fire()}}get(e,t){let n=this.getKey(e,t),r=this.map.get(n);return r?QI(r):void 0}getKey(e,t){let n=this.getScopeKey(t);return n.length?`${e}:::${n}`:e}getScopeKey(e){return this.getWorkspaceKey(e?.workspaceFolder)??``}getWorkspaceKey(e){return e?e.uri.toString():void 0}getVariableMap(e){let t=new Map;for(let[n,r]of this.map)this.getScopeKey(r.scope)===this.getScopeKey(e)&&t.set(r.variable,QI(r));return t}delete(e,t){let n=this.getKey(e,t);this.map.delete(n),this._onDidChangeCollection.fire()}clear(e){if(e?.workspaceFolder){for(let[t,n]of this.map)n.scope?.workspaceFolder?.index===e.workspaceFolder.index&&this.map.delete(t);this.clearDescription(e)}else this.map.clear(),this.descriptionMap.clear();this._onDidChangeCollection.fire()}setDescription(e,t){let n=this.getScopeKey(t),r=this.descriptionMap.get(n);if(!r||r.description!==e){let r;r=typeof e==`string`?e:e?.value.split(`
96
-
97
- `)[0];let i={description:r,scope:t};this.descriptionMap.set(n,i),this._onDidChangeCollection.fire()}}getDescription(e){let t=this.getScopeKey(e);return this.descriptionMap.get(t)?.description}clearDescription(e){let t=this.getScopeKey(e);this.descriptionMap.delete(t)}},JI=class{get persistent(){return this.collection.persistent}set persistent(e){this.collection.persistent=e}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e,t){this.collection=e,this.scope=t,this._onDidChangeCollection=new S}getScoped(e){return this.collection.getScopedEnvironmentVariableCollection(e)}replace(e,t,n){this.collection.replace(e,t,n,this.scope)}append(e,t,n){this.collection.append(e,t,n,this.scope)}prepend(e,t,n){this.collection.prepend(e,t,n,this.scope)}get(e){return this.collection.get(e,this.scope)}forEach(e,t){this.collection.getVariableMap(this.scope).forEach((n,r)=>e.call(t,r,n,this),this.scope)}[Symbol.iterator](){return this.collection.getVariableMap(this.scope).entries()}delete(e){this.collection.delete(e,this.scope),this._onDidChangeCollection.fire(void 0)}clear(){this.collection.clear(this.scope)}set description(e){this.collection.setDescription(e,this.scope)}get description(){return this.collection.getDescription(this.scope)}};let YI=class extends KI{constructor(e,t,n){super(!1,e,t),this._hasRemoteAuthority=!!n.remote.authority}createTerminal(e,t,n){if(!this._hasRemoteAuthority)throw new re;return this.createTerminalFromOptions({name:e,shellPath:t,shellArgs:n})}createTerminalFromOptions(e,t){if(!this._hasRemoteAuthority)throw new re;let n=new UI(this._proxy,zc(),e,e.name);return this._terminals.push(n),n.create(e,this._serializeParentTerminal(e,t)),n.value}};YI=A([j(0,RI),j(1,Hs),j(2,Fs)],YI);function XI(e){if(!(!e||typeof e==`string`))return ct(e,{id:!0})?{id:e.id,color:e.color}:e}function ZI(e){return dl.isThemeColor(e)?e:void 0}function QI(e){let t={...e};return delete t.scope,t.options=t.options??void 0,t}function $I(e){return typeof e==`object`&&!!e&&`wwwAuthenticate`in e&&typeof e.wwwAuthenticate==`string`}const eL=`/.well-known`,tL=`${eL}/oauth-protected-resource`,nL=`${eL}/oauth-authorization-server`,rL=`${eL}/openid-configuration`;function iL(e,t,n,r,i,a){let o=new URLSearchParams;return o.append(`client_id`,e),t&&o.append(`client_secret`,t),o.append(`grant_type`,`urn:ietf:params:oauth:grant-type:token-exchange`),o.append(`subject_token`,n),o.append(`subject_token_type`,`urn:ietf:params:oauth:token-type:id_token`),o.append(`requested_token_type`,`urn:ietf:params:oauth:token-type:id-jag`),o.append(`audience`,r),i&&o.append(`resource`,i),a.length&&o.append(`scope`,a.join(` `)),o}function aL(e,t,n,r,i){let a=new URLSearchParams;return a.append(`client_id`,e),t&&a.append(`client_secret`,t),a.append(`grant_type`,`urn:ietf:params:oauth:grant-type:jwt-bearer`),a.append(`assertion`,n),r&&a.append(`resource`,r),i.length&&a.append(`scope`,i.join(` `)),a}var oL;(function(e){e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`})(oL||={});var sL;(function(e){e.AuthorizationPending=`authorization_pending`,e.SlowDown=`slow_down`,e.AccessDenied=`access_denied`,e.ExpiredToken=`expired_token`})(sL||={});var cL;(function(e){e.InvalidRedirectUri=`invalid_redirect_uri`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidSoftwareStatement=`invalid_software_statement`,e.UnapprovedSoftwareStatement=`unapproved_software_statement`})(cL||={});function lL(e){if(typeof e!=`object`||!e)return!1;let t=e;return!(!t.resource||t.scopes_supported!==void 0&&!Array.isArray(t.scopes_supported))}const uL=[`issuer`,`authorization_endpoint`,`token_endpoint`,`registration_endpoint`,`jwks_uri`];function dL(e){if(typeof e!=`object`||!e)return!1;let t=e;if(!t.issuer)throw Error(`Authorization server metadata must have an issuer`);for(let e of uL)if(t[e]){if(typeof t[e]!=`string`)throw Error(`Authorization server metadata '${e}' must be a string`);if(!t[e].startsWith(`https://`)&&!t[e].startsWith(`http://`))throw Error(`Authorization server metadata '${e}' must start with http:// or https://`)}return!0}function fL(e){return typeof e!=`object`||!e?!1:e.client_id!==void 0}function pL(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.access_token!==void 0&&t.token_type!==void 0}function mL(e){return typeof e!=`object`||!e?!1:e.error!==void 0}function hL(e){return typeof e!=`object`||!e?!1:e.error!==void 0}function gL(e){return{issuer:e.toString(),authorization_endpoint:new URL(`/authorize`,e).toString(),token_endpoint:new URL(`/token`,e).toString(),registration_endpoint:new URL(`/register`,e).toString(),response_types_supported:[`code`,`id_token`,`id_token token`]}}const _L=[`authorization_code`,`refresh_token`,`urn:ietf:params:oauth:grant-type:device_code`];async function vL(e,t,n){if(!e.registration_endpoint)throw Error(`Server does not support dynamic registration`);let r={client_name:t,client_uri:`https://code.visualstudio.com`,grant_types:e.grant_types_supported?e.grant_types_supported.filter(e=>_L.includes(e)):_L,response_types:[`code`],redirect_uris:[`https://insiders.vscode.dev/redirect`,`https://vscode.dev/redirect`,`http://127.0.0.1/`,`http://127.0.0.1:33418/`],scope:n?.join(` `),token_endpoint_auth_method:`none`,application_type:`native`},i=await fetch(e.registration_endpoint,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});if(!i.ok){let t=await i.text(),n=t;try{let e=JSON.parse(t);hL(e)&&(n=`${e.error}${e.error_description?`: ${e.error_description}`:``}`)}catch{}throw Error(`Registration to ${e.registration_endpoint} failed: ${n}`)}let a=await i.json();if(fL(a))return a;throw Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(a)}`)}function yL(e){let t=[],n=[],r=``,i=!1;for(let t=0;t<e.length;t++){let a=e[t];a===`"`?(i=!i,r+=a):a===`,`&&!i?(r.trim()&&n.push(r.trim()),r=``):r+=a}r.trim()&&n.push(r.trim());let a;for(let e of n)if(!e.includes(`=`))a&&t.push(a),a={scheme:e.trim(),params:{}};else{let n=e.indexOf(` `);if(n>0){let r=e.substring(0,n),i=e.substring(n+1);if(!r.includes(`=`)&&i.includes(`=`)){a&&t.push(a),a={scheme:r.trim(),params:{}};let e=i.indexOf(`=`);if(e>0){let t=i.substring(0,e).trim(),n=i.substring(e+1).trim().replace(/^"|"$/g,``);t&&n!==void 0&&(a.params[t]=n)}continue}}if(a){let t=e.indexOf(`=`);if(t>0){let n=e.substring(0,t).trim(),r=e.substring(t+1).trim().replace(/^"|"$/g,``);n&&r!==void 0&&(a.params[n]=r)}}}return a&&t.push(a),t}function bL(e){let t=e.split(`.`);if(t.length!==3)throw Error(`Invalid JWT token format: token must have three parts separated by dots`);let[n,r]=t;try{if(typeof JSON.parse(Ut(n).toString())!=`object`)throw Error(`Invalid JWT token format: header is not a JSON object`);let e=JSON.parse(Ut(r).toString());if(typeof e!=`object`)throw Error(`Invalid JWT token format: payload is not a JSON object`);return e}catch(e){throw e instanceof Error?Error(`Failed to parse JWT token: ${e.message}`):Error(`Failed to parse JWT token`)}}function xL(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((e,t)=>e===r[t])}async function SL(e,t,n={}){let{sameOriginHeaders:r={},fetch:i=fetch}=n,a=new URL(e),o=async(e,t)=>{let n={Accept:`application/json`};new URL(e).origin===a.origin&&(n={...n,...r});let o=await i(e,{method:`GET`,headers:n});if(o.status!==200){let t;try{t=await o.text()}catch{t=o.statusText}throw Error(`Failed to fetch resource metadata from ${e}: ${o.status} ${t}`)}let s=await o.json();if(lL(s)){let n=new URL(s.resource).toString(),r=new URL(t).toString();if(n!==r)throw Error(`Protected Resource Metadata 'resource' property value "${n}" does not match expected value "${r}" for URL ${e}. Per RFC 9728, these MUST match. See https://datatracker.ietf.org/doc/html/rfc9728#PRConfigurationValidation`);return s}else throw Error(`Invalid resource metadata from ${e}. Expected to follow shape of https://datatracker.ietf.org/doc/html/rfc9728#name-protected-resource-metadata (Hints: is scopes_supported an array? Is resource a string?). Current payload: ${JSON.stringify(s)}`)},s=[];if(t)try{return{metadata:await o(t,e),discoveryUrl:t,errors:s}}catch(e){s.push(e instanceof Error?e:Error(String(e)))}let c=a.pathname!==`/`,l=`${a.origin}${tL}`;if(c){let t=`${l}${a.pathname}`;try{return{metadata:await o(t,e),discoveryUrl:t,errors:s}}catch(e){s.push(e instanceof Error?e:Error(String(e)))}}try{return{metadata:await o(l,a.origin),discoveryUrl:l,errors:s}}catch(e){s.push(e instanceof Error?e:Error(String(e)))}throw s.length===1?s[0]:AggregateError(s,`Failed to fetch resource metadata from all attempted URLs`)}async function CL(e){if(e.status===200)try{let t=await e.json();if(dL(t))return t}catch{}}async function wL(e){try{return await e.text()}catch{return e.statusText}}async function TL(e,t={}){let{additionalHeaders:n={},fetch:r=fetch}=t,i=new URL(e),a=i.pathname===`/`?``:i.pathname,o=[],s=async e=>{try{let t=await r(e,{method:`GET`,headers:{...n,Accept:`application/json`}}),i=await CL(t);if(i)return i;o.push(Error(`Failed to fetch authorization server metadata from ${e}: ${t.status} ${await wL(t)}`));return}catch(e){o.push(e instanceof Error?e:Error(String(e)));return}},c=new URL(nL,e).toString()+a,l=await s(c);if(l)return{metadata:l,discoveryUrl:c,errors:o};let u=new URL(rL,e).toString()+a;if(l=await s(u),l)return{metadata:l,discoveryUrl:u,errors:o};let d=e.endsWith(`/`)?e+rL.substring(1):e+rL;if(l=await s(d),l)return{metadata:l,discoveryUrl:d,errors:o};throw o.length===1?o[0]:AggregateError(o,`Failed to fetch authorization server metadata from all attempted URLs`)}var EL;let DL=class{static{EL=this}static{this.InitialState={focused:!0,active:!0}}getState(){let e=this._state;return{get focused(){return e.focused},get active(){return e.active}}}constructor(e,t){this._onDidChangeWindowState=new S,this.onDidChangeWindowState=this._onDidChangeWindowState.event,this._state=EL.InitialState,e.handle&&(this._nativeHandle=Ut(e.handle).buffer),this._proxy=t.getProxy(E.MainThreadWindow),this._proxy.$getInitialState().then(({isFocused:e,isActive:t})=>{this.onDidChangeWindowProperty(`focused`,e),this.onDidChangeWindowProperty(`active`,t)})}get nativeHandle(){return this._nativeHandle}$onDidChangeActiveNativeWindowHandle(e){this._nativeHandle=e?Ut(e).buffer:void 0}$onDidChangeWindowFocus(e){this.onDidChangeWindowProperty(`focused`,e)}$onDidChangeWindowActive(e){this.onDidChangeWindowProperty(`active`,e)}onDidChangeWindowProperty(e,t){t!==this._state[e]&&(this._state={...this._state,[e]:t},this._onDidChangeWindowState.fire(this._state))}openUri(e,t){let n;if(typeof e==`string`){n=e;try{e=w.parse(e)}catch{return Promise.reject(`Invalid uri - '${e}'`)}}return Hi(e.scheme)?Promise.reject(`Invalid scheme - cannot be empty`):e.scheme===O.command?Promise.reject(`Invalid scheme '${e.scheme}'`):this._proxy.$openUri(e,n,t)}async asExternalUri(e,t){if(Hi(e.scheme))return Promise.reject(`Invalid scheme - cannot be empty`);let n=await this._proxy.$asExternalUri(e,t);return w.from(n)}};DL=EL=A([j(0,Fs),j(1,Hs)],DL);const OL=k(`IExtHostWindow`);var kL;let AL=class{static{kL=this}static{this.HandlePool=0}constructor(e){this.handles=new bs,this.handlers=new Map,this._proxy=e.getProxy(E.MainThreadUrls)}registerUriHandler(e,t){let n=e.identifier;if(this.handles.has(n))throw Error(`Protocol handler already registered for extension ${n}`);let r=kL.HandlePool++;return this.handles.add(n),this.handlers.set(r,t),this._proxy.$registerUriHandler(r,n,e.displayName||e.name),_(()=>{this.handles.delete(n),this.handlers.delete(r),this._proxy.$unregisterUriHandler(r)})}$handleExternalUri(e,t){let n=this.handlers.get(e);if(!n)return Promise.resolve(void 0);try{n.handleUri(w.revive(t))}catch(e){o(e)}return Promise.resolve(void 0)}async createAppUri(e){return w.revive(await this._proxy.$createAppUri(e))}};AL=kL=A([j(0,Hs)],AL);const jL=k(`IExtHostUrlsService`);function ML(e){return(t,n,r)=>{let i=null,a=null;if(typeof r.value==`function`?(i=`value`,a=r.value):typeof r.get==`function`&&(i=`get`,a=r.get),!a||typeof n==`symbol`)throw Error(`not supported`);r[i]=e(a,n)}}function NL(e,t,n){return ML((t,n)=>{let r=`$debounce$${n}`,i=`$debounce$result$${n}`;return function(...n){this[i]||(this[i]=void 0),clearTimeout(this[r]),this[r]=setTimeout(()=>{t.apply(this,n),this[i]=void 0},e)}})}function PL(e,t,n){return ML((r,i)=>{let a=`$throttle$timer$${i}`,o=`$throttle$result$${i}`,s=`$throttle$lastRun$${i}`,c=`$throttle$pending$${i}`;return function(...i){if(this[o]||(this[o]=n?n():void 0),(this[s]===null||this[s]===void 0)&&(this[s]=-Number.MAX_VALUE),t&&(this[o]=t(this[o],...i)),this[c])return;let l=this[s]+e;l<=Date.now()?(this[s]=Date.now(),r.apply(this,[this[o]]),this[o]=n?n():void 0):(this[c]=!0,this[a]=setTimeout(()=>{this[c]=!1,this[s]=Date.now(),r.apply(this,[this[o]]),this[o]=n?n():void 0},l-Date.now()))}})}const FL=k(`IExtHostProgress`);let IL=class{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e.getProxy(E.MainThreadProgress)}async withProgress(e,t,n){let r=this._handles++,{title:i,location:a,cancellable:o}=t,c={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(r,{location:iM.from(a),title:i,source:c,cancellable:o},e.isUnderDevelopment?void 0:e.identifier.value).catch(s),this._withProgress(r,n,!!o)}async withProgressFromSource(e,t,n){let r=this._handles++,{title:i,location:a,cancellable:o}=t;return this._proxy.$startProgress(r,{location:iM.from(a),title:i,source:e,cancellable:o},void 0).catch(s),this._withProgress(r,n,!!o)}_withProgress(e,t,n){let r;n&&(r=new Ii,this._mapHandleToCancellationSource.set(e,r));let i=e=>{this._proxy.$progressEnd(e),this._mapHandleToCancellationSource.delete(e),r?.dispose()},a;try{a=t(new RL(this._proxy,e),n&&r?r.token:Pi.None)}catch(t){throw i(e),t}return a.then(t=>i(e),t=>i(e)),a}$acceptProgressCanceled(e){let t=this._mapHandleToCancellationSource.get(e);t&&(t.cancel(),this._mapHandleToCancellationSource.delete(e))}};IL=A([j(0,Hs)],IL);function LL(e,t){return e.message=t.message,typeof t.increment==`number`&&(typeof e.increment==`number`?e.increment+=t.increment:e.increment=t.increment),e}var RL=class extends Sm{constructor(e,t){super(e=>this.throttledReport(e)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}};RL.__decorator=A([PL(100,(e,t)=>LL(e,t),()=>Object.create(null))],RL.prototype,`throttledReport`,null);const zL=[`openid`,`offline_access`];function BL(e,t){return e+`|`+[...t].sort().join(` `)}function VL(e,t=Date.now()){return e.token.expires_in===void 0?!1:t>e.created_at+e.token.expires_in*1e3-6e4}function HL(e){return class extends e{_resourceClientSecretKey(e,t){return`${e}|${t}`}constructor(...e){super(...e),this._resourceTokens=new Map,this._resourceClientSecrets=new Map;let t=this.authorizationServer;this.id=`xaa:${t.toString(!0)}`,this._logger.trace(`[XAA] Provider constructed for issuer ${t.toString(!0)}. authorization_endpoint=${this._serverMetadata.authorization_endpoint}, token_endpoint=${this._serverMetadata.token_endpoint}`)}async getSessions(e,t){let n=t.resource,r=t.audience;if(!n||!e||!r)return[];let i=BL(n,e),a=this._resourceTokens.get(i);if(a&&!VL(a))return[UL(a.token,a.scopes)];a&&this._resourceTokens.delete(i);let o=await this._tryGetSilentIdpSession();if(!o?.idToken)return[];try{let i=await this._mintResourceToken(o,[...e],r,n,t,!0);return i?[UL(i.token,i.scopes)]:[]}catch(e){return this._logger.warn(`[XAA] Silent token mint failed for resource=${n}; falling back to interactive. Error: ${e.message}`),[]}}async createSession(e,t){let n=t.audience,r=t.resource;if(this._logger.trace(`[XAA] createSession scopes=[${e.join(` `)}] audience=${n} resource=${r}`),!n)throw Error("Enterprise-managed authentication requires `options.audience` (the resource's authorization server URL) but none was provided.");if(!r)throw Error("Enterprise-managed authentication requires `options.resource` (the resource indicator / MCP server URL) but none was provided.");let i=await this._ensureIdpSession();if(!i.idToken)throw Error("IdP session is missing an id_token; the issuer must support OpenID Connect and the `openid` scope.");let a=await this._mintResourceToken(i,e,n,r,t,!1);if(!a)throw Error(`Failed to mint a resource access token for the enterprise-managed MCP server.`);return UL(a.token,a.scopes)}async _mintResourceToken(e,t,n,r,i,a){let o=await this._exchangeForIdJag(e.idToken,n,r,t),s=await this._discoverResourceTokenEndpoint(n),c=this._clientId,l=!1,u=typeof i.clientId==`string`&&i.clientId.length>0?i.clientId:void 0;if(u)c=u,l=c!==this._clientId;else try{let e=bL(o);typeof e.client_id==`string`&&e.client_id.length>0&&(c=e.client_id,l=c!==this._clientId)}catch(e){this._logger.warn(`[XAA] Could not decode ID-JAG to read resource client_id; falling back to IdP client_id. Error: ${e.message}`)}let d=this._clientSecret,f=typeof i.clientSecret==`string`&&i.clientSecret.length>0?i.clientSecret:void 0,p=this._resourceClientSecretKey(r,c);if(f)d=f,this._resourceClientSecrets.set(p,f);else if(l)if(this._resourceClientSecrets.has(p))d=this._resourceClientSecrets.get(p);else if(a){this._logger.info(`[XAA] Silent mint requires resource client_secret for '${c}' but none is cached or configured; deferring to interactive flow.`);return}else{this._logger.info(`[XAA] Resource AS requires a distinct client_id '${c}' — prompting for matching client_secret.`);let e=await this._proxy.$promptForResourceClientSecret(c,r);if(e===void 0)return;this._resourceClientSecrets.set(p,e),d=e.length>0?e:void 0}let m={resource:r,scopes:t,token:await this._redeemAtResource(s,o,r,t,c,d),created_at:Date.now()};return this._resourceTokens.set(BL(r,t),m),m}async _tryGetSilentIdpSession(){let e=await super.getSessions(zL,{});return e.length?e[0]:void 0}async _ensureIdpSession(){this._logger.trace(`[XAA] _ensureIdpSession: scopes=[${zL.join(` `)}] authorization_endpoint=${this._serverMetadata.authorization_endpoint}`);let e=await this._tryGetSilentIdpSession();return e?.idToken?(this._logger.trace(`[XAA] _ensureIdpSession: reusing existing IdP session`),e):(this._logger.trace(`[XAA] _ensureIdpSession: creating new IdP session via super.createSession`),super.createSession([...zL],{}))}async _exchangeForIdJag(e,t,n,r){let i=this._serverMetadata.token_endpoint;if(!i)throw Error(`Issuer metadata is missing token_endpoint; cannot perform XAA token exchange.`);let a=iL(this._clientId,this._clientSecret,e,t,n,r);this._logger.trace(`[XAA] POST ${i} (ID-JAG exchange) audience=${t} resource=${n} scope=${r.join(` `)}`);let o=await fetch(i,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`},body:a.toString()});if(!o.ok)throw Error(`XAA token exchange (IdP) failed: ${o.status} ${await WL(o)}`);let s=await o.json(),c=s&&typeof s==`object`&&typeof s.access_token==`string`?s.access_token:void 0;if(!c)throw Error(`XAA token exchange (IdP) returned no access_token. Response: ${JSON.stringify(s)}`);return c}async _discoverResourceTokenEndpoint(e){let{metadata:t,errors:n}=await TL(e);if(!t?.token_endpoint)throw Error(`Failed to discover resource authorization server metadata for '${e}': ${n.map(e=>e.message).join(`; `)||`no token_endpoint in metadata`}`);return t.token_endpoint}async _redeemAtResource(e,t,n,r,i,a){let o=aL(i,a,t,n,r);this._logger.trace(`[XAA] POST ${e} (ID-JAG redemption) client_id=${i} resource=${n} scope=${r.join(` `)}`);let s=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`},body:o.toString()});if(!s.ok)throw Error(`XAA token exchange (resource) failed: ${s.status} ${await WL(s)}`);let c=await s.json();if(!pL(c))throw Error(`XAA token exchange (resource) returned an invalid token response: ${JSON.stringify(c)}`);return c}}}function UL(e,t){let n;if(e.id_token)try{n=bL(e.id_token)}catch{}if(!n)try{n=bL(e.access_token)}catch{}return{id:kh(e.access_token,0).toString(),accessToken:e.access_token,account:{id:n?.sub||`unknown`,label:n?.preferred_username||n?.name||n?.email||`XAA`},scopes:[...t],idToken:e.id_token}}async function WL(e){try{return await e.text()}catch{return e.statusText}}const GL=k(`IExtHostAuthentication`);let KL=class{constructor(e,t,n,r,i,a,o){this._initData=t,this._extHostWindow=n,this._extHostUrls=r,this._extHostProgress=i,this._extHostLoggerService=a,this._logService=o,this._dynamicAuthProviderCtor=JL,this._xaaAuthProviderCtor=HL(JL),this._authenticationProviders=new Map,this._providerOperations=new bo,this._onDidChangeSessions=new S,this._getSessionTaskSingler=new qL,this._onDidDynamicAuthProviderTokensChange=new S,this._proxy=e.getProxy(E.MainThreadAuthentication)}getExtensionScopedSessionsEvent(e){let t=e.toLowerCase();return Qn.chain(this._onDidChangeSessions.event,e=>e.filter(e=>!e.extensionIdFilter||e.extensionIdFilter.includes(t)).map(e=>({provider:e.provider})))}async getSession(e,t,n,r={}){let i=ys.toKey(e.identifier),a=Object.keys(r).map(e=>{switch(e){case`account`:return`${e}:${r.account?.id}`;case`createIfNone`:case`forceNewSession`:return`${e}:${typeof r[e]==`boolean`?`${r[e]}`:`'${r[e]?.detail}/${r[e]?.learnMore?.toString()}'`}`;case`authorizationServer`:return`${e}:${r.authorizationServer?.toString(!0)}`;default:return`${e}:${!!r[e]}`}}).sort().join(`, `),o;if($I(n)){let e=n;o=`${i} ${t} challenge:${e.wwwAuthenticate} ${e.fallbackScopes?[...e.fallbackScopes].sort().join(` `):``} ${a}`}else o=`${i} ${t} ${[...n].sort().join(` `)} ${a}`;return await this._getSessionTaskSingler.getOrCreate(o,async()=>{await this._proxy.$ensureProvider(t);let a=e.displayName||e.name;return this._proxy.$getSession(t,n,i,a,r)})}async getAccounts(e){return await this._proxy.$ensureProvider(e),await this._proxy.$getAccounts(e)}registerAuthenticationProvider(e,t,n,r){return this._providerOperations.queue(e,async()=>{if(this._authenticationProviders.get(e)){this._logService.error(`An authentication provider with id '${e}' is already registered. The existing provider will not be replaced.`);return}let i=n.onDidChangeSessions(t=>this._proxy.$sendDidChangeSessions(e,t));this._authenticationProviders.set(e,{label:t,provider:n,disposable:i,options:r??{supportsMultipleAccounts:!1}}),await this._proxy.$registerAuthenticationProvider({id:e,label:t,supportsMultipleAccounts:r?.supportsMultipleAccounts??!1,supportedAuthorizationServers:r?.supportedAuthorizationServers,supportsChallenges:r?.supportsChallenges})}),new WT(()=>{this._providerOperations.queue(e,async()=>{let t=this._authenticationProviders.get(e);t&&(t.disposable?.dispose(),this._authenticationProviders.delete(e),await this._proxy.$unregisterAuthenticationProvider(e))})})}$createSession(e,t,n){return this._providerOperations.queue(e,async()=>{let r=this._authenticationProviders.get(e);if(r)return n.authorizationServer=w.revive(n.authorizationServer),await r.provider.createSession(t,n);throw Error(`Unable to find authentication provider with handle: ${e}`)})}$removeSession(e,t){return this._providerOperations.queue(e,async()=>{let n=this._authenticationProviders.get(e);if(n)return await n.provider.removeSession(t);throw Error(`Unable to find authentication provider with handle: ${e}`)})}$getSessions(e,t,n){return this._providerOperations.queue(e,async()=>{let r=this._authenticationProviders.get(e);if(r)return n.authorizationServer=w.revive(n.authorizationServer),await r.provider.getSessions(t,n);throw Error(`Unable to find authentication provider with handle: ${e}`)})}$getSessionsFromChallenges(e,t,n){return this._providerOperations.queue(e,async()=>{let r=this._authenticationProviders.get(e);if(r){let i=r.provider;if(typeof i.getSessionsFromChallenges==`function`)return n.authorizationServer=w.revive(n.authorizationServer),await i.getSessionsFromChallenges(t,n);throw Error(`Authentication provider with handle: ${e} does not support getSessionsFromChallenges`)}throw Error(`Unable to find authentication provider with handle: ${e}`)})}$createSessionFromChallenges(e,t,n){return this._providerOperations.queue(e,async()=>{let r=this._authenticationProviders.get(e);if(r){let i=r.provider;if(typeof i.createSessionFromChallenges==`function`)return n.authorizationServer=w.revive(n.authorizationServer),await i.createSessionFromChallenges(t,n);throw Error(`Authentication provider with handle: ${e} does not support createSessionFromChallenges`)}throw Error(`Unable to find authentication provider with handle: ${e}`)})}$onDidChangeAuthenticationSessions(e,t,n){return e.startsWith(`__`)||this._onDidChangeSessions.fire({provider:{id:e,label:t},extensionIdFilter:n}),Promise.resolve()}$onDidUnregisterAuthenticationProvider(e){return this._providerOperations.queue(e,async()=>{let t=this._authenticationProviders.get(e);t&&(t.disposable?.dispose(),this._authenticationProviders.delete(e))})}async $registerDynamicAuthProvider(e,t,n,r,i,a){if(!r){let a=w.revive(e);if(t.registration_endpoint)try{let e=await vL(t,this._initData.environment.appName,n?.scopes_supported);r=e.client_id,i=e.client_secret}catch(e){this._logService.warn(`Dynamic registration failed for ${a.toString()}: ${e.message}. Prompting user for client ID and client secret...`)}if(!r){this._logService.info(`Prompting user for client registration details for ${a.toString()}`);let e=await this._proxy.$promptForClientRegistration(a.toString());if(!e)throw Error(`User did not provide client details`);r=e.clientId,i=e.clientSecret,this._logService.info(`User provided client registration for ${a.toString()}`),i?this._logService.trace(`User provided client secret for ${a.toString()}`):this._logService.trace(`User did not provide client secret for ${a.toString()}`)}}let o=new this._dynamicAuthProviderCtor(this._extHostWindow,this._extHostUrls,this._initData,this._extHostProgress,this._extHostLoggerService,this._proxy,w.revive(e),t,n,r,i,this._onDidDynamicAuthProviderTokensChange,a||[]);return await this._providerOperations.queue(o.id,async()=>{this._authenticationProviders.set(o.id,{label:o.label,provider:o,disposable:WT.from(o,o.onDidChangeSessions(e=>this._proxy.$sendDidChangeSessions(o.id,e)),o.onDidChangeClientId(()=>this._proxy.$sendDidChangeDynamicProviderInfo({providerId:o.id,clientId:o.clientId,clientSecret:o.clientSecret}))),options:{supportsMultipleAccounts:!0}}),await this._proxy.$registerDynamicAuthenticationProvider({id:o.id,label:o.label,supportsMultipleAccounts:!0,authorizationServer:e,resourceServer:n?w.parse(n.resource):void 0,clientId:o.clientId,clientSecret:o.clientSecret})}),o.id}async $registerXaaAuthProvider(e,t,n,r,i){let a=w.revive(e);if(!n){this._logService.info(`Prompting user for client registration details for XAA issuer ${a.toString()}`);let e=await this._proxy.$promptForClientRegistration(a.toString());if(!e)throw Error(`User did not provide client details`);n=e.clientId,r=e.clientSecret}let o=new this._xaaAuthProviderCtor(this._extHostWindow,this._extHostUrls,this._initData,this._extHostProgress,this._extHostLoggerService,this._proxy,a,t,void 0,n,r,this._onDidDynamicAuthProviderTokensChange,i||[]);return await this._providerOperations.queue(o.id,async()=>{this._authenticationProviders.set(o.id,{label:o.label,provider:o,disposable:WT.from(o,o.onDidChangeSessions(e=>this._proxy.$sendDidChangeSessions(o.id,e)),o.onDidChangeClientId(()=>this._proxy.$sendDidChangeDynamicProviderInfo({providerId:o.id,clientId:o.clientId,clientSecret:o.clientSecret}))),options:{supportsMultipleAccounts:!0}}),await this._proxy.$registerDynamicAuthenticationProvider({id:o.id,label:o.label,supportsMultipleAccounts:!0,authorizationServer:e,resourceServer:void 0,clientId:o.clientId,clientSecret:o.clientSecret})}),o.id}async $onDidChangeDynamicAuthProviderTokens(e,t,n){this._onDidDynamicAuthProviderTokensChange.fire({authProviderId:e,clientId:t,tokens:n})}};KL=A([j(0,Hs),j(1,Fs),j(2,OL),j(3,jL),j(4,FL),j(5,Os),j(6,Ds)],KL);var qL=class{constructor(){this._inFlightPromises=new Map}getOrCreate(e,t){let n=this._inFlightPromises.get(e);if(n)return n;let r=t().finally(()=>this._inFlightPromises.delete(e));return this._inFlightPromises.set(e,r),r}};let JL=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){this._extHostWindow=e,this._extHostUrls=t,this._initData=n,this._extHostProgress=r,this._proxy=a,this.authorizationServer=o,this._serverMetadata=s,this._resourceMetadata=c,this._clientId=l,this._clientSecret=u,this._onDidChangeSessions=new S,this.onDidChangeSessions=this._onDidChangeSessions.event,this._onDidChangeClientId=new S,this.onDidChangeClientId=this._onDidChangeClientId.event;let p=o.toString(!0);this.id=c?.resource?p+` `+c?.resource:p,this.label=c?.resource_name??this.authorizationServer.authority,this._logger=i.createLogger(this.id,{name:`Auth: ${this.label}`}),this._disposable=new v,this._disposable.add(this._onDidChangeSessions),this._disposable.add(this._onDidChangeClientId);let m=Qn.chain(d.event,e=>e.filter(e=>e.authProviderId===this.id&&e.clientId===l).map(e=>e.tokens));this._tokenStore=this._disposable.add(new YL({onDidChange:m,set:e=>a.$setSessionsForDynamicAuthProvider(this.id,this.clientId,e)},f,this._logger)),this._disposable.add(this._tokenStore.onDidChangeSessions(e=>this._onDidChangeSessions.fire(e))),this._createFlows=[],s.authorization_endpoint&&this._createFlows.push({label:x(2859,`URL Handler`),handler:(e,t,n)=>this._createWithUrlHandler(e,t,n)})}get clientId(){return this._clientId}get clientSecret(){return this._clientSecret}async getSessions(e,t){if(this._logger.info(`Getting sessions for scopes: ${e?.join(` `)??`all`}`),!e)return this._tokenStore.sessions;let n=[...e].sort(),r=e.join(` `),i=this._tokenStore.sessions.filter(e=>se([...e.scopes].sort(),n));if(this._logger.info(`Found ${i.length} sessions for scopes: ${r}`),i.length){let e=[],t=[],a=new Map(this._tokenStore.tokens.map(e=>[e.access_token,e]));for(let n of i){let i=a.get(n.accessToken);if(i&&i.expires_in){let a=Date.now(),o=i.expires_in*1e3;if(a>i.created_at+o-300*1e3){if(this._logger.info(`Token for session ${n.id} is about to expire, refreshing...`),t.push(i),!i.refresh_token){this._logger.warn(`No refresh token available for scopes ${n.scopes.join(` `)}. Throwing away token.`);continue}try{let t=await this.exchangeRefreshTokenForToken(i.refresh_token);t.scope!==r&&(this._logger.warn(`Token scopes '${t.scope}' do not match requested scopes '${r}'. Overwriting token with what was requested...`),t.scope=r),this._logger.info(`Successfully created a new token for scopes ${n.scopes.join(` `)}.`),e.push(t)}catch(e){this._logger.error(`Failed to refresh token: ${e}`)}}}}return(e.length||t.length)&&(this._tokenStore.update({added:e,removed:t}),i=this._tokenStore.sessions.filter(e=>se([...e.scopes].sort(),n))),this._logger.info(`Found ${i.length} sessions for scopes: ${r}`),i}return[]}async createSession(e,t){this._logger.info(`Creating session for scopes: ${e.join(` `)}`);let n;for(let t=0;t<this._createFlows.length;t++){let{handler:r}=this._createFlows[t];try{if(n=await this._extHostProgress.withProgressFromSource({label:this.label,id:this.id},{location:mD.Notification,title:x(2860,`Authenticating to '{0}'`,this.label),cancellable:!0},(t,n)=>r(e,t,n)),n)break}catch(e){let n=this._createFlows[t+1]?.label;if(!n)break;let r=d(e)?x(2861,`Having trouble authenticating to '{0}'? Would you like to try a different way? ({1})`,this.label,n):x(2862,`You have not yet finished authenticating to '{0}'. Would you like to try a different way? ({1})`,this.label,n);if(!await this._proxy.$showContinueNotification(r))throw new f;this._logger.error(`Failed to create token via flow '${n}': ${e}`)}}if(!n)throw Error(`Failed to create authentication token`);n.scope!==e.join(` `)&&(this._logger.warn(`Token scopes '${n.scope}' do not match requested scopes '${e.join(` `)}'. Overwriting token with what was requested...`),n.scope=e.join(` `)),this._tokenStore.update({added:[{...n,created_at:Date.now()}],removed:[]});let r=this._tokenStore.sessions.find(e=>e.accessToken===n.access_token);return this._logger.info(`Created ${n.refresh_token?`refreshable`:`non-refreshable`} session for scopes: ${n.scope}${n.expires_in?` that expires in ${n.expires_in} seconds`:``}`),r}async removeSession(e){this._logger.info(`Removing session with id: ${e}`);let t=this._tokenStore.sessions.find(t=>t.id===e);if(!t){this._logger.error(`Session with id ${e} not found`);return}let n=this._tokenStore.tokens.find(e=>e.access_token===t.accessToken);if(!n){this._logger.error(`Failed to retrieve token for removed session: ${t.id}`);return}this._tokenStore.update({added:[],removed:[n]}),this._logger.info(`Removed token for session: ${t.id} with scopes: ${t.scopes.join(` `)}`)}dispose(){this._disposable.dispose()}async _createWithUrlHandler(e,t,n){if(!this._serverMetadata.authorization_endpoint)throw Error(`Authorization Endpoint required`);if(!this._serverMetadata.token_endpoint)throw Error(`Token endpoint not available in server metadata`);let r=this.generateRandomString(64),i=await this.generateCodeChallenge(r),a=this.generateRandomString(32),o=w.parse(`${this._initData.environment.appUriScheme}://dynamicauthprovider/${this.authorizationServer.authority}/authorize?nonce=${a}`),s;try{s=await this._extHostUrls.createAppUri(o)}catch(e){throw Error(`Failed to create external URI: ${e}`)}let c=new URL(this._serverMetadata.authorization_endpoint);c.searchParams.append(`client_id`,this._clientId),c.searchParams.append(`response_type`,`code`),c.searchParams.append(`state`,s.toString()),c.searchParams.append(`code_challenge`,i),c.searchParams.append(`code_challenge_method`,`S256`);let l=e.join(` `);l&&c.searchParams.append(`scope`,l),this._resourceMetadata?.resource&&c.searchParams.append(`resource`,this._resourceMetadata.resource);let u=`https://vscode.dev/redirect`;c.searchParams.append(`redirect_uri`,u);let p=this.waitForAuthorizationCode(o);if(this._logger.info(`Opening authorization URL for scopes: ${l}`),this._logger.trace(`Authorization URL: ${c.toString()}`),!await this._extHostWindow.openUri(c.toString(),{}))throw new f;t.report({message:x(2863,`Complete the authentication in the browser window that has opened.`)});let m;try{m=(await ho(p,n)).code}catch(e){throw d(e)?(this._logger.info(`Authorization code request was cancelled by the user.`),e):(this._logger.error(`Failed to receive authorization code: ${e}`),Error(`Failed to receive authorization code: ${e}`))}return this._logger.info(`Authorization code received for scopes: ${l}`),await this.exchangeCodeForToken(m,r,u)}generateRandomString(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t).map(e=>e.toString(16).padStart(2,`0`)).join(``).substring(0,e)}async generateCodeChallenge(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Wt(b.wrap(new Uint8Array(n)),!1,!1).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async waitForAuthorizationCode(e){let t=await this._proxy.$waitForUriHandler(e),n=/[?&]code=([^&]+)/.exec(t.query||``);if(!n||n.length<2)throw Error(`Authentication failed: No authorization code received`);return{code:n[1]}}async exchangeCodeForToken(e,t,n){if(!this._serverMetadata.token_endpoint)throw Error(`Token endpoint not available in server metadata`);let r=new URLSearchParams;r.append(`client_id`,this._clientId),r.append(`grant_type`,`authorization_code`),r.append(`code`,e),r.append(`redirect_uri`,n),r.append(`code_verifier`,t),this._resourceMetadata?.resource&&r.append(`resource`,this._resourceMetadata.resource),this._clientSecret&&r.append(`client_secret`,this._clientSecret),this._logger.info(`Exchanging authorization code for token...`),this._logger.trace(`Url: ${this._serverMetadata.token_endpoint}`),this._logger.trace(`Token request body: ${r.toString()}`);let i;try{i=await fetch(this._serverMetadata.token_endpoint,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`},body:r.toString()})}catch(e){throw this._logger.error(`Failed to exchange authorization code for token: ${e}`),Error(`Failed to exchange authorization code for token: ${e}`)}if(!i.ok){let e=await i.text();throw Error(`Token exchange failed: ${i.status} ${i.statusText} - ${e}`)}let a=await i.json();if(pL(a))return this._logger.info(`Successfully exchanged authorization code for token.`),a;throw mL(a)&&a.error===oL.InvalidClient?(this._logger.warn(`Client ID (${this._clientId}) was invalid, generated a new one.`),await this._generateNewClientId(),Error(`Client ID was invalid, generated a new one. Please try again.`)):Error(`Invalid authorization token response: ${JSON.stringify(a)}`)}async exchangeRefreshTokenForToken(e){if(!this._serverMetadata.token_endpoint)throw Error(`Token endpoint not available in server metadata`);let t=new URLSearchParams;t.append(`client_id`,this._clientId),t.append(`grant_type`,`refresh_token`),t.append(`refresh_token`,e),this._resourceMetadata?.resource&&t.append(`resource`,this._resourceMetadata.resource),this._clientSecret&&t.append(`client_secret`,this._clientSecret);let n=await(await fetch(this._serverMetadata.token_endpoint,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`},body:t.toString()})).json();if(pL(n))return{...n,created_at:Date.now()};throw mL(n)&&n.error===oL.InvalidClient?(this._logger.warn(`Client ID (${this._clientId}) was invalid, generated a new one.`),await this._generateNewClientId(),Error(`Client ID was invalid, generated a new one. Please try again.`)):Error(`Invalid authorization token response: ${JSON.stringify(n)}`)}async _generateNewClientId(){try{let e=await vL(this._serverMetadata,this._initData.environment.appName,this._resourceMetadata?.scopes_supported);this._clientId=e.client_id,this._clientSecret=e.client_secret,this._onDidChangeClientId.fire()}catch(e){this._logger.info(`Dynamic registration failed for ${this.authorizationServer.toString()}: ${e}. Prompting user for client ID and client secret.`);try{let e=await this._proxy.$promptForClientRegistration(this.authorizationServer.toString());if(!e)throw Error(`User did not provide client details`);this._clientId=e.clientId,this._clientSecret=e.clientSecret,this._logger.info(`User provided client ID for ${this.authorizationServer.toString()}`),e.clientSecret?this._logger.info(`User provided client secret for ${this.authorizationServer.toString()}`):this._logger.info(`User did not provide client secret for ${this.authorizationServer.toString()} (optional)`),this._onDidChangeClientId.fire()}catch{throw this._logger.error(`Failed to fetch new client ID and user did not provide one: ${e}`),Error(`Failed to fetch new client ID and user did not provide one: ${e}`)}}}};JL=A([j(0,OL),j(1,jL),j(2,Fs),j(3,FL),j(4,Os)],JL);var YL=class{constructor(e,t,n){this._persistence=e,this._logger=n,this._onDidChangeSessions=new S,this.onDidChangeSessions=this._onDidChangeSessions.event,this._disposable=new v,this._tokensObservable=fv(`tokens`,t),this._sessionsObservable=ov({equalsFn:(e,t)=>se(e,t,(e,t)=>e.accessToken===t.accessToken)},e=>this._tokensObservable.read(e).map(e=>this._getSessionFromToken(e))),this._disposable.add(this._registerChangeEventAutorun()),this._disposable.add(this._persistence.onDidChange(e=>this._tokensObservable.set(e,void 0)))}get tokens(){return this._tokensObservable.get()}get sessions(){return this._sessionsObservable.get()}dispose(){this._disposable.dispose()}update({added:e,removed:t}){this._logger.trace(`Updating tokens: added ${e.length}, removed ${t.length}`);let n=[...this._tokensObservable.get()];for(let e of t){let t=n.findIndex(t=>t.access_token===e.access_token);t!==-1&&n.splice(t,1)}for(let t of e){let e=n.findIndex(e=>e.access_token===t.access_token);e===-1?n.push(t):n[e]=t}(e.length||t.length)&&(this._tokensObservable.set(n,void 0),this._persistence.set(n)),this._logger.trace(`Tokens updated: ${n.length} tokens stored.`)}_registerChangeEventAutorun(){let e=[];return sv(t=>{this._logger.trace(`Checking for session changes...`);let n=this._sessionsObservable.read(t);if(e===n){this._logger.trace(`No session changes detected.`);return}if(!n||n.length===0){this._logger.trace(`All sessions removed.`),e.length>0&&(this._onDidChangeSessions.fire({added:[],removed:e,changed:[]}),e=[]);return}let r=[],i=[];for(let t of n)e.some(e=>e.accessToken===t.accessToken)||r.push(t);for(let t of e)n.some(e=>e.accessToken===t.accessToken)||i.push(t);(r.length>0||i.length>0)&&(this._logger.trace(`Sessions changed: added ${r.length}, removed ${i.length}`),this._onDidChangeSessions.fire({added:r,removed:i,changed:[]})),e=n})}_getSessionFromToken(e){let t;if(e.id_token)try{t=bL(e.id_token)}catch{}if(!t)try{t=bL(e.access_token)}catch{}let n=e.scope?e.scope.split(` `):t?.scope?t.scope.split(` `):[];return{id:kh(e.access_token,0).toString(),accessToken:e.access_token,account:{id:t?.sub||`unknown`,label:t?.preferred_username||t?.name||t?.email||`MCP`},scopes:n,idToken:e.id_token}}},XL;const ZL=k(`IExtHostLanguageModels`);var QL=class{constructor(){this._defaultStream=new Ho,this._isDone=!1;let e=this,[t,n]=Wo.tee(e._defaultStream.asyncIterable);this.apiObject={get stream(){return t},get text(){return n.map(e=>{if(e instanceof RA)return e.value}).coalesce()}}}handleResponsePart(e){if(this._isDone)return;let t=[];for(let n of lt.wrap(e)){let e;e=n.type===`text`?new RA(n.value,n.audience):n.type===`thinking`?new VA(n.value,n.id,n.metadata):n.type===`data`?new zA(n.data.buffer,n.mimeType,n.audience):new IA(n.toolCallId,n.name,n.parameters),t.push(e)}this._defaultStream.emitMany(t)}reject(e){this._isDone=!0,this._defaultStream.reject(e)}resolve(){this._isDone=!0,this._defaultStream.resolve()}};let $L=class{static{XL=this}static{this._idPool=1}constructor(e,t,n){this._logService=t,this._extHostAuthentication=n,this._onDidChangeModelAccess=new S,this._onDidChangeProviders=new S,this.onDidChangeProviders=this._onDidChangeProviders.event,this._onDidChangeModelProxyAvailability=new S,this.onDidChangeModelProxyAvailability=this._onDidChangeModelProxyAvailability.event,this._languageModelProviders=new Map,this._localModels=new Map,this._modelAccessList=new xs,this._pendingRequest=new Map,this._ignoredFileProviders=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(E.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose(),this._onDidChangeModelProxyAvailability.dispose()}registerLanguageModelChatProvider(e,t,n){this._languageModelProviders.set(t,{extension:e,provider:n}),this._proxy.$registerLanguageModelProvider(t);let r;return n.onDidChangeLanguageModelChatInformation&&(r=n.onDidChangeLanguageModelChatInformation(()=>{this._proxy.$onLMProviderChange(t)})),_(()=>{this._languageModelProviders.delete(t),this._localModels.forEach((e,n)=>{e.metadata.vendor===t&&this._localModels.delete(n)}),r?.dispose(),this._proxy.$unregisterProvider(t)})}toModelIdentifier(e,t,n){return t?`${e}/${t}/${n}`:`${e}/${n}`}getVendorFromModelIdentifier(e){let t=e.indexOf(`/`);return t===-1?void 0:e.substring(0,t)}async $provideLanguageModelChatInfo(e,t,n){let r=this._languageModelProviders.get(e);if(!r)return[];let i=await r.provider.provideLanguageModelChatInformation({silent:t.silent,configuration:t.configuration},n)??[],a=i.map(n=>{let i;n.requiresAuthorization&&Dw(r.extension)&&(i={providerLabel:r.extension.displayName||r.extension.name,accountLabel:typeof n.requiresAuthorization==`object`?n.requiresAuthorization.label:void 0}),n.capabilities.editTools&&K(r.extension,`chatProvider`);let a={};if(Dw(r.extension)){if(n.isDefault===!0)for(let e of Object.values(hy))typeof e==`string`&&(a[e]=!0);else if(typeof n.isDefault==`object`)for(let e of Object.keys(n.isDefault)){let t=parseInt(e);a[pN.from(t)]=n.isDefault[t]}}return{metadata:{extension:r.extension.identifier,id:n.id,vendor:e,name:n.name??``,family:n.family??``,detail:n.detail,tooltip:n.tooltip,version:n.version,multiplierNumeric:n.multiplierNumeric,pricing:n.pricing,inputCost:n.inputCost,outputCost:n.outputCost,cacheCost:n.cacheCost,longContextInputCost:n.longContextInputCost,longContextOutputCost:n.longContextOutputCost,longContextCacheCost:n.longContextCacheCost,priceCategory:n.priceCategory,maxInputTokens:n.maxInputTokens,maxOutputTokens:n.maxOutputTokens,auth:i,isDefaultForLocation:a,isUserSelectable:n.isUserSelectable,statusIcon:n.statusIcon,targetChatSessionType:n.targetChatSessionType,configurationSchema:n.configurationSchema,capabilities:n.capabilities?{vision:n.capabilities.imageInput,editTools:n.capabilities.editTools,toolCalling:!!n.capabilities.toolCalling,agentMode:!!n.capabilities.toolCalling}:void 0},identifier:this.toModelIdentifier(e,t.group,n.id)}});this._localModels.forEach((n,r)=>{n.metadata.vendor===e&&n.group===t.group&&this._localModels.delete(r)});for(let e=0;e<a.length;e++)this._localModels.set(a[e].identifier,{group:t.group,metadata:a[e].metadata,info:i[e]});return a}async $startChatRequest(e,t,n,r,i,a){let o=this._localModels.get(e);if(!o)throw Error(`Model not found`);let s=this._languageModelProviders.get(o.metadata.vendor);if(!s)throw Error(`Language model provider for '${o.metadata.id}' not found.`);let l=[],u=()=>{l.length>0&&(this._proxy.$reportResponsePart(t,new _i(l)),l.length=0)},d=new Mo(u,30),f=e=>{l.push(e)>30?(u(),d.cancel()):d.schedule()},p=new Sm(async e=>{if(a.isCancellationRequested){this._logService.warn(`[CHAT](${s.extension.identifier.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}let t;if(e instanceof IA?t={type:`tool_use`,name:e.name,parameters:e.input,toolCallId:e.callId}:e instanceof RA?t={type:`text`,value:e.value,audience:e.audience}:e instanceof zA?t={type:`data`,mimeType:e.mimeType,data:b.wrap(e.data),audience:e.audience}:e instanceof VA&&(t={type:`thinking`,value:e.value,id:e.id,metadata:e.metadata}),!t){this._logService.warn(`[CHAT](${s.extension.identifier.value}) UNKNOWN part ${JSON.stringify(e)}`);return}f(t)}),m;try{m=s.provider.provideLanguageModelChatResponse(o.info,r.value.map(LM.to),{...i,modelOptions:i.modelOptions??{},modelConfiguration:i.configuration,requestInitiator:n?ys.toKey(n):`core`,toolMode:i.toolMode??qA.Auto},p,a)}catch(e){throw e}Promise.resolve(m).then(()=>{u(),this._proxy.$reportResponseDone(t,void 0)},e=>{u(),this._proxy.$reportResponseDone(t,c(e))})}$provideTokenLength(e,t,n){let r=this._localModels.get(e);if(!r)return Promise.resolve(0);let i=this._languageModelProviders.get(r.metadata.vendor);return i?Promise.resolve(i.provider.provideTokenCount(r.info,t,n)):Promise.resolve(0)}async getDefaultLanguageModel(e,t){let n;t&&await this.selectLanguageModels(e,{});for(let[e,t]of this._localModels)if(t.metadata.isDefaultForLocation[hy.Chat]&&t.metadata.vendor===`copilot`){n=e;break}return!n&&!t?this.getDefaultLanguageModel(e,!0):this.getLanguageModelByIdentifier(e,n)}async getLanguageModelByIdentifier(e,t){if(t){if(!this._localModels.has(t)){let n=this.getVendorFromModelIdentifier(t);if(!n){this._logService.warn(`[LanguageModelProxy](${e.identifier.value}) Could not extract vendor from model identifier '${t}'.`);return}if(this._logService.trace(`[LanguageModelProxy](${e.identifier.value}) Could not find model '${t}' in local cache. Trying to resolve model again.`),await this._proxy.$selectChatModels({vendor:n,extension:e.identifier}),!this._localModels.has(t)){this._logService.warn(`[LanguageModelProxy](${e.identifier.value}) Could not find model '${t}' in local cache after re-resolving models.`);return}}return this._createLanguageModelChatApi(e,t)}}async _createLanguageModelChatApi(e,t){let n=this._localModels.get(t);if(!n)return;this._isUsingAuth(e.identifier,n.metadata)&&await this._fakeAuthPopulate(n.metadata);let r=this;return{id:n.info.id,vendor:n.metadata.vendor,family:n.info.family,version:n.info.version,name:n.info.name,pricing:n.metadata.pricing,inputCost:n.metadata.inputCost,outputCost:n.metadata.outputCost,cacheCost:n.metadata.cacheCost,longContextInputCost:n.metadata.longContextInputCost,longContextOutputCost:n.metadata.longContextOutputCost,longContextCacheCost:n.metadata.longContextCacheCost,priceCategory:n.metadata.priceCategory,capabilities:{supportsImageToText:n.metadata.capabilities?.vision??!1,supportsToolCalling:!!n.metadata.capabilities?.toolCalling,editToolsHint:n.metadata.capabilities?.editTools},maxInputTokens:n.metadata.maxInputTokens,countTokens(e,n){if(!r._localModels.has(t))throw UA.NotFound(t);return r._computeTokenLength(t,e,n??Pi.None)},sendRequest(n,i,a){if(!r._localModels.has(t))throw UA.NotFound(t);return r._sendChatRequest(e,t,n,i??{},a??Pi.None)}}}async selectLanguageModels(e,t){let n=await this._proxy.$selectChatModels({...t,extension:e.identifier});return(await Promise.all(n.map(t=>this._createLanguageModelChatApi(e,t)))).filter(e=>!!e)}async _sendChatRequest(e,t,n,r,i){let a=this._convertMessages(e,n),o=e.identifier,s=this._localModels.get(t)?.metadata;if(!s||!this._localModels.has(t))throw UA.NotFound(`Language model '${t}' is unknown.`);if(this._isUsingAuth(o,s)&&(!await this._getAuthAccess(e,{identifier:s.extension,displayName:s.auth.providerLabel},r.justification,!1)||!this._modelAccessList.get(o)?.has(s.extension)))throw UA.NoPermissions(`Language model '${t}' cannot be used by '${o.value}'.`);let c=Math.random()*1e6|0,l=new QL;this._pendingRequest.set(c,{languageModelId:t,res:l});try{await this._proxy.$tryStartChatRequest(o,t,c,new _i(a),r,i)}catch(e){throw this._pendingRequest.delete(c),UA.tryDeserialize(e)??e}return l.apiObject}_convertMessages(e,t){let n=[];for(let r of t)r.role===AA.System&&K(e,`languageModelSystem`),n.push(LM.from(r));return n}async $acceptResponsePart(e,t){let n=this._pendingRequest.get(e);n&&n.res.handleResponsePart(t.value)}$onChatModelsChange(){this._onDidChangeProviders.fire()}async $acceptResponseDone(e,t){let n=this._pendingRequest.get(e);n&&(this._pendingRequest.delete(e),t?n.res.reject(UA.tryDeserialize(t)??l(t)):n.res.resolve())}async _getAuthAccess(e,t,n,r){let i=`__`+t.identifier.value;if(await this._extHostAuthentication.getSession(e,i,[],{silent:!0}))return this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0;if(r)return!1;try{let r=n?x(2869,`Justification: {1}`,t.displayName,n):void 0;return await this._extHostAuthentication.getSession(e,i,[],{forceNewSession:{detail:r}}),this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0}catch{return!1}}_isUsingAuth(e,t){return!!t.auth&&!ys.equals(t.extension,e)}async _fakeAuthPopulate(e){if(e.auth)for(let t of this._languageAccessInformationExtensions)try{await this._getAuthAccess(t,{identifier:e.extension,displayName:``},void 0,!0)}catch(e){this._logService.error(`Fake Auth request failed`),this._logService.error(e)}}async _computeTokenLength(e,t,n){let r=this._localModels.get(e);if(!r)throw UA.NotFound(`Language model '${e}' is unknown.`);return this._languageModelProviders.get(r.metadata.vendor)?.provider.provideTokenCount(r.info,t,n)??0}$updateModelAccesslist(e){let t=[];for(let{from:n,to:r,enabled:i}of e){let e=this._modelAccessList.get(n)??new bs;if(e.has(r)!==i){i?e.add(r):e.delete(r),this._modelAccessList.set(n,e);let a={from:n,to:r};t.push(a),this._onDidChangeModelAccess.fire(a)}}}createLanguageModelAccessInformation(e){this._languageAccessInformationExtensions.add(e);let t=Qn.signal(Qn.filter(this._onDidChangeModelAccess.event,t=>ys.equals(t.from,e.identifier))),n=Qn.signal(this._onDidChangeProviders.event);return{get onDidChange(){return Qn.any(t,n)},canSendRequest(e){return!0}}}fileIsIgnored(e,t,n=Pi.None){return K(e,`chatParticipantAdditions`),this._proxy.$fileIsIgnored(t,n)}get isModelProxyAvailable(){return!!this._languageModelProxyProvider}async getModelProxy(e){if(K(e,`languageModelProxy`),!this._languageModelProxyProvider)throw this._logService.trace(`[LanguageModelProxy] No LanguageModelProxyProvider registered`),Error(`No language model proxy provider is registered.`);let t=ys.toKey(e.identifier);try{let e=await Promise.resolve(this._languageModelProxyProvider.provideModelProxy(t,Pi.None));if(!e)throw this._logService.warn(`[LanguageModelProxy] Provider returned no proxy for ${t}`),Error(`Language model proxy is not available.`);return e}catch(e){throw this._logService.error(`[LanguageModelProxy] Provider failed to return proxy for ${t}`,e),e}}async $isFileIgnored(e,t,n){let r=this._ignoredFileProviders.get(e);if(!r)throw Error(`Unknown LanguageModelIgnoredFileProvider`);return await r.provideFileIgnored(w.revive(t),n)??!1}registerIgnoredFileProvider(e,t){K(e,`chatParticipantPrivate`);let n=XL._idPool++;return this._proxy.$registerFileIgnoreProvider(n),this._ignoredFileProviders.set(n,t),_(()=>{this._proxy.$unregisterFileIgnoreProvider(n),this._ignoredFileProviders.delete(n)})}registerLanguageModelProxyProvider(e,t){return K(e,`chatParticipantPrivate`),this._languageModelProxyProvider=t,this._onDidChangeModelProxyAvailability.fire(),_(()=>{this._languageModelProxyProvider===t&&(this._languageModelProxyProvider=void 0,this._onDidChangeModelProxyAvailability.fire())})}};$L=XL=A([j(0,Hs),j(1,Ds),j(2,GL)],$L);const eR=3600*24;eR*7,eR*30,eR*365;function tR(e){return e.getFullYear()+`-`+String(e.getMonth()+1).padStart(2,`0`)+`-`+String(e.getDate()).padStart(2,`0`)+`T`+String(e.getHours()).padStart(2,`0`)+`:`+String(e.getMinutes()).padStart(2,`0`)+`:`+String(e.getSeconds()).padStart(2,`0`)+`.`+(e.getMilliseconds()/1e3).toFixed(3).slice(2,5)+`Z`}const nR={DateTimeFormat(e,t){return new n(()=>{try{return new Intl.DateTimeFormat(e,t)}catch{return new Intl.DateTimeFormat(void 0,t)}})},Collator(e,t){return new n(()=>{try{return new Intl.Collator(e,t)}catch{return new Intl.Collator(void 0,t)}})},Segmenter(e,t){return new n(()=>{try{return new Intl.Segmenter(e,t)}catch{return new Intl.Segmenter(void 0,t)}})},Locale(e,t){return new n(()=>{try{return new Intl.Locale(e,t)}catch{return new Intl.Locale(`en`,t)}})},NumberFormat(e,t){return new n(()=>{try{return new Intl.NumberFormat(e,t)}catch{return new Intl.NumberFormat(void 0,t)}})}};var rR=class e{constructor(t){let n=Bi(t);this._defaultValue=n,this._asciiMap=e._createAsciiMap(n),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);return t.fill(e),t}set(e,t){let n=Bi(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}},iR;(function(e){e[e.False=0]=`False`,e[e.True=1]=`True`})(iR||={});var aR;(function(e){e[e.Regular=0]=`Regular`,e[e.Whitespace=1]=`Whitespace`,e[e.WordSeparator=2]=`WordSeparator`})(aR||={});var oR=class extends rR{constructor(e,t){super(aR.Regular),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=nR.Segmenter(this.intlSegmenterLocales,{granularity:`word`}):this._segmenter=null;for(let t=0,n=e.length;t<n;t++)this.set(e.charCodeAt(t),aR.WordSeparator);this.set(C.Space,aR.Whitespace),this.set(C.Tab,aR.Whitespace)}findPrevIntlWordBeforeOrAtOffset(e,t){let n=null;for(let r of this._getIntlSegmenterWordsOnLine(e)){if(r.index>t)break;n=r}return n}findNextIntlWordAtOrAfterOffset(e,t){for(let n of this._getIntlSegmenterWordsOnLine(e))if(!(n.index<t))return n;return null}_getIntlSegmenterWordsOnLine(e){return this._segmenter?this._cachedLine===e?this._cachedSegments:(this._cachedLine=e,this._cachedSegments=this._filterWordSegments(this._segmenter.value.segment(e)),this._cachedSegments):[]}_filterWordSegments(e){let t=[];for(let n of e)this._isWordLike(n)&&t.push(n);return t}_isWordLike(e){return!!e.isWordLike}};const sR=new Re(10);function cR(e,t){let n=`${e}/${t.join(`,`)}`,r=sR.get(n);return r||(r=new oR(e,t),sR.set(n,r)),r}var lR=class{constructor(e,t,n,r){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=r}parseSearchRequest(){if(this.searchString===``)return null;let e;e=this.isRegex?uR(this.searchString):this.searchString.indexOf(`
98
- `)>=0;let t=null;try{t=Zi(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new hm(t,this.wordSeparators?cR(this.wordSeparators,[]):null,n?this.searchString:null)}};function uR(e){if(!e||e.length===0)return!1;for(let t=0,n=e.length;t<n;t++){let r=e.charCodeAt(t);if(r===C.LineFeed)return!0;if(r===C.Backslash){if(t++,t>=n)break;let r=e.charCodeAt(t);if(r===C.n||r===C.r||r===C.W)return!0}}return!1}function dR(e,t,n){if(!n)return new dm(e,null);let r=[];for(let e=0,n=t.length;e<n;e++)r[e]=t[e];return new dm(e,r)}function fR(e,t,n,r,i){if(r===0)return!0;let a=t.charCodeAt(r-1);if(e.get(a)!==aR.Regular||a===C.CarriageReturn||a===C.LineFeed)return!0;if(i>0){let n=t.charCodeAt(r);if(e.get(n)!==aR.Regular)return!0}return!1}function pR(e,t,n,r,i){if(r+i===n)return!0;let a=t.charCodeAt(r+i);if(e.get(a)!==aR.Regular||a===C.CarriageReturn||a===C.LineFeed)return!0;if(i>0){let n=t.charCodeAt(r+i-1);if(e.get(n)!==aR.Regular)return!0}return!1}function mR(e,t,n,r,i){return fR(e,t,n,r,i)&&pR(e,t,n,r,i)}var hR=class{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){let t=e.length,n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;let r=n.index,i=n[0].length;if(r===this._prevMatchStartIndex&&i===this._prevMatchLength){if(i===0){ha(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=i,!this._wordSeparators||mR(this._wordSeparators,e,t,r,i))return n}while(n);return null}};const gR=k(`contextService`),_R=k(`editorGroupsService`),vR=k(`pathService`);function yR(e){return typeof e==`object`&&`uri`in e&&`pattern`in e}let bR=class{constructor(e,t,n,r,i,a){this.configurationService=e,this.workspaceContextService=t,this.editorGroupsService=n,this.logService=r,this.pathService=i,this.uriIdentityService=a}aiText(e,t,n={}){return{...this.commonQuery(t?.map(Ic),n),type:KN.aiText,contentPattern:e}}text(e,t,n={}){e=this.getContentPattern(e,n);let r=this.configurationService.getValue(),i=t&&t.some(e=>!this.configurationService.getValue({resource:e}).search?.useRipgrep);return{...this.commonQuery(t?.map(Ic),n),type:KN.Text,contentPattern:e,previewOptions:n.previewOptions,maxFileSize:n.maxFileSize,usePCRE2:r.search?.usePCRE2||i||!1,surroundingContext:n.surroundingContext,userDisabledExcludesAndIgnoreFiles:n.disregardExcludeSettings&&n.disregardIgnoreFiles}}getContentPattern(e,t){let n=this.configurationService.getValue();e.isRegExp&&(e.pattern=e.pattern.replace(/\r?\n/g,`\\n`));let r={...e,wordSeparators:n.editor.wordSeparators};return this.isCaseSensitive(e,t)&&(r.isCaseSensitive=!0),this.isMultiline(e)&&(r.isMultiline=!0),t.notebookSearchConfig?.includeMarkupInput&&(r.notebookInfo||={},r.notebookInfo.isInNotebookMarkdownInput=t.notebookSearchConfig.includeMarkupInput),t.notebookSearchConfig?.includeMarkupPreview&&(r.notebookInfo||={},r.notebookInfo.isInNotebookMarkdownPreview=t.notebookSearchConfig.includeMarkupPreview),t.notebookSearchConfig?.includeCodeInput&&(r.notebookInfo||={},r.notebookInfo.isInNotebookCellInput=t.notebookSearchConfig.includeCodeInput),t.notebookSearchConfig?.includeOutput&&(r.notebookInfo||={},r.notebookInfo.isInNotebookCellOutput=t.notebookSearchConfig.includeOutput),r}file(e,t={}){return{...this.commonQuery(e,t),type:KN.File,filePattern:t.filePattern?t.filePattern.trim():t.filePattern,exists:t.exists,sortByScore:t.sortByScore,cacheKey:t.cacheKey,shouldGlobMatchFilePattern:t.shouldGlobSearch}}handleIncludeExclude(e,t){if(!e)return{};if(Array.isArray(e)){if(e=e.filter(e=>e.length>0).map(TR),!e.length)return{}}else e=TR(e);return t?this.parseSearchPaths(e):{pattern:SR(...Array.isArray(e)?e:[e])}}commonQuery(e=[],t={}){let n=Array.isArray(t.excludePattern)?t.excludePattern.map(e=>e.pattern).flat():t.excludePattern;n=n?.length===1?n[0]:n;let r=this.handleIncludeExclude(t.includePattern,t.expandPatterns),i=this.handleIncludeExclude(n,t.expandPatterns),a=e.length>1,o=(r.searchPaths&&r.searchPaths.length?r.searchPaths.map(e=>this.getFolderQueryForSearchPath(e,t,i)):e.map(e=>this.getFolderQueryForRoot(e,t,i,a))).filter(e=>!!e),s={_reason:t._reason,folderQueries:o,usingSearchPaths:!!(r.searchPaths&&r.searchPaths.length),extraFileResources:t.extraFileResources,excludePattern:i.pattern,includePattern:r.pattern,ignoreGlobCase:t.ignoreGlobCase,onlyOpenEditors:t.onlyOpenEditors,maxResults:t.maxResults,onlyFileScheme:t.onlyFileScheme};if(t.onlyOpenEditors){let e=pe(this.editorGroupsService.groups.flatMap(e=>e.editors.map(e=>e.resource)));this.logService.trace(`QueryBuilder#commonQuery - openEditor URIs`,JSON.stringify(e));let t=e.filter(e=>rP(s,e.fsPath)),n=this.commonQueryFromFileList(t);return this.logService.trace(`QueryBuilder#commonQuery - openEditor Query`,JSON.stringify(n)),{...s,...n}}if(t.changedFileUris!==void 0){let e=t.changedFileUris.filter(e=>rP(s,e.fsPath)),n=this.commonQueryFromFileList(e);return this.logService.trace(`QueryBuilder#commonQuery - changedFile Query`,JSON.stringify(n)),{...s,...n}}let c=t.extraFileResources&&t.extraFileResources.filter(e=>rP(s,e.fsPath));return s.extraFileResources=c&&c.length?c:void 0,s}commonQueryFromFileList(e){let t=[],n=new Ne,r={},i=!1;return e.forEach(e=>{if(e.scheme!==O.walkThrough)if(oo(e)){let r=this.workspaceContextService.getWorkspaceFolder(e)?.uri??this.uriIdentityService.extUri.dirname(e),a=n.get(r);a||(i=!0,a={folder:r,includePattern:{}},t.push(a),n.set(r,a));let o=Wr(r.fsPath,e.fsPath);nt(a.includePattern)[DR(o.replace(/\\/g,`/`))]=!0}else e.fsPath&&(i=!0,r[DR(e.fsPath)]=!0)}),{folderQueries:t,includePattern:r,usingSearchPaths:!0,excludePattern:i?void 0:{"**/*":!0}}}isCaseSensitive(e,t){if(t.isSmartCase){if(e.isRegExp){if(ka(e.pattern,!0))return!0}else if(ka(e.pattern))return!0}return!!e.isCaseSensitive}isMultiline(e){return e.isMultiline||e.isRegExp&&uR(e.pattern)||e.pattern.indexOf(`
99
- `)>=0?!0:!!e.isMultiline}parseSearchPaths(e){let t=e=>Vr(e)||/^\.\.?([\/\\]|$)/.test(e),n=Te((Array.isArray(e)?e:CR(e)).map(e=>{let t=this.pathService.resolvedUserHome;return t?vy(e,t.scheme===O.file?t.fsPath:t.path):e}),e=>t(e)?`searchPaths`:`exprSegments`),r=(n.exprSegments||[]).map(e=>Xi(e,`/`)).map(e=>Xi(e,`\\`)).map(e=>(e[0]===`.`&&(e=`*`+e),wR(e))),i={},a=this.expandSearchPathPatterns(n.searchPaths||[]);a&&a.length&&(i.searchPaths=a);let o=SR(...r.flat());return o&&(i.pattern=o),i}getExcludesForFolder(e,t){return t.disregardExcludeSettings?void 0:nP(e,!t.disregardSearchExcludeSettings)}expandSearchPathPatterns(e){if(!e||!e.length)return[];let t=e.flatMap(e=>{let{pathPortion:t,globPortion:n}=xR(e);return n&&=ER(n),this.expandOneSearchPath(t).flatMap(e=>this.resolveOneSearchPathPattern(e,n))}),n=new Map;return t.forEach(e=>{let t=e.searchPath.toString(),r=n.get(t);r?e.pattern&&(r.pattern=r.pattern||{},r.pattern[e.pattern]=!0):n.set(t,{searchPath:e.searchPath,pattern:e.pattern?SR(e.pattern):void 0})}),Array.from(n.values())}expandOneSearchPath(e){if(Vr(e)){let t=this.workspaceContextService.getWorkspace().folders;return t[0]&&t[0].uri.scheme!==O.file?[{searchPath:t[0].uri.with({path:e})}]:[{searchPath:w.file(Br(e))}]}if(this.workspaceContextService.getWorkbenchState()===Nc.FOLDER){let t=this.workspaceContextService.getWorkspace().folders[0].uri;if(e=TR(e),e.startsWith(`../`)||e===`..`){let n=zr.resolve(t.path,e);return[{searchPath:t.with({path:n})}]}return[{searchPath:t,pattern:ER(e)}]}else if(e===`./`||e===`.\\`)return[];else{let t=e.replace(/^\.[\/\\]/,``),n=this.workspaceContextService.getWorkspace().folders.map(e=>{let n=t.match(RegExp(`^${qi(e.name)}(?:/(.*)|$)`));return n?{match:n,folder:e}:null}).filter($e);if(n.length)return n.map(e=>{let t=e.match[1];return{searchPath:e.folder.uri,pattern:t&&ER(t)}});{let t=e.match(/\.[\/\\](.+)[\/\\]?/),n=x(17250,`Workspace folder does not exist: {0}`,t?t[1]:e);throw Error(n)}}}resolveOneSearchPathPattern(e,t){let n=e.pattern&&t?`${e.pattern}/${t}`:e.pattern||t,r=[{searchPath:e.searchPath,pattern:n}];return n&&!n.endsWith(`**`)&&r.push({searchPath:e.searchPath,pattern:n+`/**`}),r}getFolderQueryForSearchPath(e,t,n){let r=this.getFolderQueryForRoot(Ic(e.searchPath),t,n,!1);return r?{...r,includePattern:e.pattern}:null}getFolderQueryForRoot(e,t,n,r){let i,a=w.isUri(e)?e:e.uri,o=t.excludePattern?.map(n=>{let r=t.excludePattern&&yR(n)?n.uri:void 0;return!r||!(w.isUri(e)&&this.uriIdentityService.extUri.isEqual(e,r))?r:void 0});if(o?.length||(o=[void 0]),n.searchPaths){let e=n.searchPaths.filter(e=>$a(e.searchPath,a))[0];if(e&&!e.pattern)return null;e&&(i=e.pattern)}let s=this.configurationService.getValue({resource:a}),c={...this.getExcludesForFolder(s,t)||{},...i||{}},l=w.isUri(e)?to(e):e.name,u=o.map(e=>Object.keys(c).length>0?{folder:e,pattern:c}:void 0).filter(e=>e);return{folder:a,folderName:r?l:void 0,excludePattern:u,fileEncoding:s.files&&s.files.encoding,disregardIgnoreFiles:typeof t.disregardIgnoreFiles==`boolean`?t.disregardIgnoreFiles:!s.search?.useIgnoreFiles,disregardGlobalIgnoreFiles:typeof t.disregardGlobalIgnoreFiles==`boolean`?t.disregardGlobalIgnoreFiles:!s.search?.useGlobalIgnoreFiles,disregardParentIgnoreFiles:typeof t.disregardParentIgnoreFiles==`boolean`?t.disregardParentIgnoreFiles:!s.search?.useParentIgnoreFiles,ignoreSymlinks:typeof t.ignoreSymlinks==`boolean`?t.ignoreSymlinks:!s.search?.followSymlinks,ignoreGlobCase:t.ignoreGlobCase}}};bR=A([j(0,Sh),j(1,gR),j(2,_R),j(3,Ds),j(4,vR),j(5,Hg)],bR);function xR(e){let t=e.match(/[\*\{\}\(\)\[\]\?]/);if(t){let n=t.index,r=e.substr(0,n).match(/[/|\\][^/\\]*$/);if(r){let t=e.substr(0,r.index);return t.match(/[/\\]/)||(t+=`/`),{pathPortion:t,globPortion:e.substr((r.index||0)+1)}}}return{pathPortion:e}}function SR(...e){return e.length?e.reduce((e,t)=>(e[t]=!0,e),Object.create(null)):void 0}function CR(e){return xS(e,`,`).map(e=>e.trim()).filter(e=>!!e.length)}function wR(e){return[`**/${e}/**`,`**/${e}`].map(e=>e.replace(/\*\*\/\*\*/g,`**`))}function TR(e){return e.replace(/\\/g,`/`)}function ER(e){return TR(e).replace(/^\.\//,``).replace(/\/+$/g,``)}function DR(e){return e.replace(/([?*[\]])/g,`[$1]`)}k(`searchService`);function OR(e,t){let n=t.activationEvents;if(!n)return Promise.resolve(void 0);let r=[],i=[];for(let t of n)if(/^workspaceContains:/.test(t)){let n=t.substr(18);n.indexOf(`*`)>=0||n.indexOf(`?`)>=0||e.forceUsingSearch?i.push(n):r.push(n)}if(r.length===0&&i.length===0)return Promise.resolve(void 0);let{promise:a,resolve:o}=_o(),s=e=>o({activationEvent:e}),c=Promise.all(r.map(t=>kR(e,t,s))).then(()=>{}),l=AR(e,t.identifier,i,s);return Promise.all([c,l]).then(()=>{o(void 0)}),a}async function kR(e,t,n){for(let r of e.folders)if(await e.exists(io(w.revive(r),t))){n(`workspaceContains:${t}`);return}}async function AR(e,t,n,r){if(n.length===0)return Promise.resolve(void 0);let i=new Ii,a=e.checkExists(e.folders,n,i.token),s=setTimeout(async()=>{i.cancel(),e.logService.info(`Not activating extension '${t.value}': Timed out while searching for 'workspaceContains' pattern ${n.join(`,`)}`)},7e3),c=!1;try{c=await a}catch(e){d(e)||o(e)}i.dispose(),clearTimeout(s),c&&r(`workspaceContains:${n.join(`,`)}`)}var jR=class{constructor(e){this._onDidChangePassword=new S,this.onDidChangePassword=this._onDidChangePassword.event,this._proxy=e.getProxy(E.MainThreadSecretState)}async $onDidChangePassword(e){this._onDidChangePassword.fire(e)}get(e,t){return this._proxy.$getPassword(e,t)}store(e,t,n){return this._proxy.$setPassword(e,t,n)}delete(e,t){return this._proxy.$deletePassword(e,t)}keys(e){return this._proxy.$getKeys(e)}};const MR=k(`IExtHostSecretState`);var NR=class{#e;constructor(e,t){this.disposables=new v,this._id=ys.toKey(e.identifier),this.#e=t,this.onDidChange=Qn.map(Qn.filter(this.#e.onDidChangePassword,e=>e.extensionId===this._id),e=>({key:e.key}),this.disposables)}dispose(){this.disposables.dispose()}get(e){return this.#e.get(this._id,e)}store(e,t){return this.#e.store(this._id,e,t)}delete(e){return this.#e.delete(this._id,e)}keys(){return this.#e.keys(this._id)||[]}};let PR=class{constructor(e,t,n){this.logService=n,this.bundleCache=new Map,this._proxy=t.getProxy(E.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===`en`}getMessage(e,t){let{message:n,args:r,comment:i}=t;if(this.isDefaultLanguage)return Ki(n,r??{});let a=n;i&&i.length>0&&(a+=`/${Array.isArray(i)?i.join(``):i}`);let o=this.bundleCache.get(e)?.contents[a];return o||this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${a}`),Ki(o??n,r??{})}getBundle(e){return this.bundleCache.get(e)?.contents}getBundleUri(e){return this.bundleCache.get(e)?.uri}async initializeLocalizedMessages(e){if(this.isDefaultLanguage||!e.l10n&&!e.isBuiltin||this.bundleCache.has(e.identifier.value))return;let t,n=await this.getBundleLocation(e);if(!n){this.logService.error(`No bundle location found for extension ${e.identifier.value}`);return}try{let r=await this._proxy.$fetchBundleContents(n),i=JSON.parse(r);t=e.isBuiltin?i.contents?.bundle:i}catch(t){this.logService.error(`Failed to load translations for ${e.identifier.value} from ${n}: ${t.message}`);return}t&&this.bundleCache.set(e.identifier.value,{contents:t,uri:n})}async getBundleLocation(e){if(e.isBuiltin){let t=await this._proxy.$fetchBuiltInBundleUri(e.identifier.value,this.currentLanguage);return w.revive(t)}return e.l10n?w.joinPath(e.extensionLocation,e.l10n,`bundle.l10n.${this.currentLanguage}.json`):void 0}};PR=A([j(0,Fs),j(1,Hs),j(2,Ds)],PR);const FR=k(`IExtHostLocalizationService`),IR=k(`IExtHostManagedSockets`);let LR=class{constructor(e){this._remoteSocketIdCounter=0,this._factory=null,this._managedRemoteSockets=new Map,this._proxy=e.getProxy(E.MainThreadManagedSockets)}setFactory(e,t){for(let e of this._managedRemoteSockets.values())e.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new RR(e,t),this._proxy.$registerSocketFactory(this._factory.socketFactoryId)}async $openRemoteSocket(e){if(!this._factory||this._factory.socketFactoryId!==e)throw Error(`No socket factory with id ${e}`);let t=++this._remoteSocketIdCounter,n=await this._factory.makeConnection(),r=new v;return this._managedRemoteSockets.set(t,new zR(t,n,r)),r.add(_(()=>this._managedRemoteSockets.delete(t))),r.add(n.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),r.dispose()})),r.add(n.onDidClose(e=>{this._proxy.$onDidManagedSocketClose(t,e?.stack??e?.message),r.dispose()})),r.add(n.onDidReceiveMessage(e=>this._proxy.$onDidManagedSocketHaveData(t,b.wrap(e)))),t}$remoteSocketWrite(e,t){this._managedRemoteSockets.get(e)?.actual.send(t.buffer)}$remoteSocketEnd(e){let t=this._managedRemoteSockets.get(e);t&&(t.actual.end(),t.dispose())}async $remoteSocketDrain(e){await this._managedRemoteSockets.get(e)?.actual.drain?.()}};LR=A([j(0,Hs)],LR);var RR=class{constructor(e,t){this.socketFactoryId=e,this.makeConnection=t}},zR=class extends y{constructor(e,t,n){super(),this.socketId=e,this.actual=t,this._register(n)}},BR;const VR=k(`IHostUtils`);let HR=BR=class extends y{constructor(e,t,n,r,i,a,o,s,l,u,d,f,p){super(),this._extHostManagedSockets=f,this._extHostLanguageModels=p,this._onDidChangeRemoteConnectionData=this._register(new S),this.onDidChangeRemoteConnectionData=this._onDidChangeRemoteConnectionData.event,this._realPathCache=new Map,this._isTerminating=!1,this._hostUtils=t,this._extHostContext=n,this._initData=o,this._extHostWorkspace=r,this._extHostConfiguration=i,this._logService=a,this._extHostTunnelService=l,this._extHostTerminalService=u,this._extHostLocalizationService=d,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(E.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(E.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(E.MainThreadExtensionService),this._almostReadyToRunExtensions=new To,this._readyToStartExtensionHost=new To,this._readyToRunExtensions=new To,this._eagerExtensionsActivated=new To,this._activationEventsReader=new XR(this._initData.extensions.activationEvents),this._globalRegistry=new gF(this._activationEventsReader,this._initData.extensions.allExtensions);let m=new bs(this._initData.extensions.myExtensions);this._myRegistry=new gF(this._activationEventsReader,JR(this._globalRegistry,m)),On&&(this._logService.info(`Creating extension host with the following global extensions: ${GR(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${GR(this._myRegistry)}`)),this._storage=new kF(this._extHostContext,this._logService),this._secretState=new jR(this._extHostContext),this._storagePath=s,this._instaService=this._store.add(e.createChild(new Ps([AF,this._storage],[MR,this._secretState]))),this._activator=this._register(new DF(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(e,t,n)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(e,c(t),n)},actualActivateExtension:async(e,t)=>{if(gF.isHostExtension(e,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(e,t),new TF;let n=this._myRegistry.getExtensionDescription(e);return this._activateExtension(n,t)}},this._logService)),this._extensionPathIndex=null,this._resolvers=Object.create(null),this._started=!1,this._remoteConnectionData=this._initData.remote.connectionData}getRemoteConnectionData(){return this._remoteConnectionData}async initialize(){try{await this._beforeAlmostReadyToRunExtensions(),this._almostReadyToRunExtensions.open(),await this._extHostWorkspace.waitForInitializeCall(),wr(`code/extHost/ready`),this._readyToStartExtensionHost.open(),this._initData.autoStart&&this._startExtensionHost()}catch(e){o(e)}}async _deactivateAll(){this._storagePath.onWillDeactivateAll();let e=[];try{e=this._myRegistry.getAllExtensionDescriptions().map(e=>e.identifier).filter(e=>this.isActivated(e)).map(e=>this._deactivate(e))}catch{}await Promise.all(e)}terminate(e,t=0){if(this._isTerminating)return;this._isTerminating=!0,this._logService.info(`Extension host terminating: ${e}`),this._logService.flush(),this._extHostTerminalService.dispose(),this._activator.dispose(),wn&&i(e=>{this._logService.error(e)}),this._extHostContext.dispose();let n=this._deactivateAll();Promise.race([Eo(5e3),n]).finally(()=>{this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} exiting with code ${t}`):this._logService.info(`Extension host exiting with code ${t}`),this._logService.flush(),this._logService.dispose(),this._hostUtils.exit(t)})}isActivated(e){return this._readyToRunExtensions.isOpen()?this._activator.isActivated(e):!1}async getExtension(e){let t=await this._mainThreadExtensionsProxy.$getExtension(e);return t&&{...t,identifier:new ys(t.identifier.value),extensionLocation:w.revive(t.extensionLocation)}}_activateByEvent(e,t){return this._activator.activateByEvent(e,t)}_activateById(e,t){return this._activator.activateById(e,t)}activateByIdWithErrors(e,t){return this._activateById(e,t).then(()=>{let t=this._activator.getActivatedExtension(e);if(t.activationFailed)return Promise.reject(t.activationFailedError)})}getExtensionRegistry(){return this._readyToRunExtensions.wait().then(e=>this._myRegistry)}getExtensionExports(e){if(this._readyToRunExtensions.isOpen())return this._activator.getActivatedExtension(e).exports;try{return this._activator.getActivatedExtension(e).exports}catch{return null}}async _realPathExtensionUri(e){if(e.scheme===O.file&&this._hostUtils.fsRealpath){let t=e.fsPath;this._realPathCache.has(t)||this._realPathCache.set(t,this._hostUtils.fsRealpath(t));let n=await this._realPathCache.get(t);return w.file(n)}return e}async getExtensionPathIndex(){return this._extensionPathIndex||=this._createExtensionPathIndex(this._myRegistry.getAllExtensionDescriptions()).then(e=>new YR(e)),this._extensionPathIndex}async _createExtensionPathIndex(e){let t=ec.forUris(e=>Za.ignorePathCasing(e));return await Promise.all(e.map(async e=>{if(this._getEntryPoint(e)){let n=await this._realPathExtensionUri(e.extensionLocation);t.set(n,e)}})),t}_deactivate(e){let t=Promise.resolve(void 0);if(!this._readyToRunExtensions.isOpen()||!this._activator.isActivated(e))return t;let n=this._activator.getActivatedExtension(e);if(!n)return t;try{typeof n.module.deactivate==`function`&&(t=Promise.resolve(n.module.deactivate()).then(void 0,e=>(this._logService.error(e),Promise.resolve(void 0))))}catch(t){this._logService.error(`An error occurred when deactivating the extension '${e.value}':`),this._logService.error(t)}try{n.disposable.dispose()}catch(t){this._logService.error(`An error occurred when disposing the subscriptions for extension '${e.value}':`),this._logService.error(t)}return t}async _activateExtension(e,t){return this._initData.remote.isRemote?this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier):await this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier),this._doActivateExtension(e,t).then(n=>{let r=n.activationTimes;return this._mainThreadExtensionsProxy.$onDidActivateExtension(e.identifier,r.codeLoadingTime,r.activateCallTime,r.activateResolvedTime,t),this._logExtensionActivationTimes(e,t,`success`,r),n},n=>{throw this._logExtensionActivationTimes(e,t,`failure`),n})}_logExtensionActivationTimes(e,t,n,r){let i=WR(e,t);this._mainThreadTelemetryProxy.$publicLog2(`extensionActivationTimes`,{...i,...r||{},outcome:n})}_doActivateExtension(e,t){let n=WR(e,t);this._mainThreadTelemetryProxy.$publicLog2(`activatePlugin`,n);let r=this._getEntryPoint(e);if(!r)return Promise.resolve(new wF(xF.NONE));this._logService.info(`ExtensionService#_doActivateExtension ${e.identifier.value}, startup: ${t.startup}, activationEvent: '${t.activationEvent}'${e.identifier.value===t.extensionId.value?``:`, root cause: ${t.extensionId.value}`}`),this._logService.flush();let i=this._isESM(e),a=new v,o=new SF(t.startup);return Promise.all([i?this._loadESMModule(e,io(e.extensionLocation,r),o):this._loadCommonJSModule(e,io(e.extensionLocation,r),o),this._loadExtensionContext(e,a)]).then(t=>(wr(`code/extHost/willActivateExtension/${e.identifier.value}`),BR._callActivate(this._logService,e.identifier,t[0],t[1],a,o))).then(t=>(wr(`code/extHost/didActivateExtension/${e.identifier.value}`),t))}_loadExtensionContext(e,t){let n=this._extHostLanguageModels.createLanguageModelAccessInformation(e),r=t.add(new MF(e,this._storage)),i=t.add(new jF(e.identifier.value,!1,this._storage)),a=t.add(new NR(e,this._secretState)),o=e.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?LO.Test:LO.Development:LO.Production,s=this._initData.remote.isRemote?SO.Workspace:SO.UI;return this._logService.trace(`ExtensionService#loadExtensionContext ${e.identifier.value}`),Promise.all([r.whenReady,i.whenReady,this._storagePath.whenReady]).then(()=>{let t=this,c,l,u=Dw(e)?this._initData.messagePorts?.get(ys.toKey(e.identifier)):void 0;return Object.freeze({globalState:r,workspaceState:i,secrets:a,subscriptions:[],get languageModelAccessInformation(){return n},get extensionUri(){return e.extensionLocation},get extensionPath(){return e.extensionLocation.fsPath},asAbsolutePath(t){return Hr(e.extensionLocation.fsPath,t)},get storagePath(){return t._storagePath.workspaceValue(e)?.fsPath},get globalStoragePath(){return t._storagePath.globalValue(e).fsPath},get logPath(){return Hr(t._initData.logsLocation.fsPath,e.identifier.value)},get logUri(){return w.joinPath(t._initData.logsLocation,e.identifier.value)},get storageUri(){return t._storagePath.workspaceValue(e)},get globalStorageUri(){return t._storagePath.globalValue(e)},get extensionMode(){return o},get extension(){return c===void 0&&(c=new qR(t,e.identifier,e,s,!1)),c},get extensionRuntime(){return K(e,`extensionRuntime`),t.extensionRuntime},get environmentVariableCollection(){return t._extHostTerminalService.getEnvironmentVariableCollection(e)},get messagePassingProtocol(){if(!l){if(!u)return;let e=Qn.buffer(Qn.fromDOMEventEmitter(u,`message`,e=>e.data),`onDidReceiveMessage`);u.start(),l={onDidReceiveMessage:e,postMessage:u.postMessage.bind(u)}}return l}})})}static _callActivate(e,t,n,r,i,a){return n||={activate:void 0,deactivate:void 0},this._callActivateOptional(e,t,n,r,a).then(e=>new CF(!1,null,a.build(),n,e,_(()=>{i.dispose(),ht(r.subscriptions)})))}static _callActivateOptional(e,t,n,r,i){if(typeof n.activate==`function`)try{i.activateCallStart(),e.trace(`ExtensionService#_callActivateOptional ${t.value}`);let a=n.activate.apply(globalThis,[r]);return i.activateCallStop(),i.activateResolveStart(),Promise.resolve(a).then(e=>(i.activateResolveStop(),e))}catch(e){return Promise.reject(e)}else return Promise.resolve(n)}_activateOneStartupFinished(e,t){this._activateById(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:t}).then(void 0,e=>{this._logService.error(e)})}_activateAllStartupFinishedDeferred(e,t=0){let n=Date.now();Nn(()=>{for(let r=t;r<e.length;r+=1){let t=e[r];for(let i of t.activationEvents??[])if(i===`onStartupFinished`)if(Date.now()-n>50){this._activateAllStartupFinishedDeferred(e,r);break}else this._activateOneStartupFinished(t,i)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(Tr()),this._extHostConfiguration.getConfigProvider().then(e=>{let t=e.getConfiguration(`extensions.experimental`).get(`deferredStartupFinishedActivation`),n=this._myRegistry.getAllExtensionDescriptions();if(t)this._activateAllStartupFinishedDeferred(n);else for(let e of n)if(e.activationEvents)for(let t of e.activationEvents)t===`onStartupFinished`&&this._activateOneStartupFinished(e,t)})}_handleEagerExtensions(){let e=this._activateByEvent(`*`,!0).then(void 0,e=>{this._logService.error(e)});this._register(this._extHostWorkspace.onDidChangeWorkspace(e=>this._handleWorkspaceContainsEagerExtensions(e.added)));let t=this._extHostWorkspace.workspace?this._extHostWorkspace.workspace.folders:[],n=this._handleWorkspaceContainsEagerExtensions(t),r=this._handleRemoteResolverEagerExtensions(),i=Promise.all([r,e,n]).then(()=>{});return Promise.race([i,Eo(1e4)]).then(()=>{this._activateAllStartupFinished()}),i}_handleWorkspaceContainsEagerExtensions(e){return e.length===0?Promise.resolve(void 0):Promise.all(this._myRegistry.getAllExtensionDescriptions().map(t=>this._handleWorkspaceContainsEagerExtension(e,t))).then(()=>{})}async _handleWorkspaceContainsEagerExtension(e,t){if(this.isActivated(t.identifier))return;let n=!this._initData.remote.isRemote&&!!this._initData.remote.authority,r=await OR({logService:this._logService,folders:e.map(e=>e.uri),forceUsingSearch:n||!this._hostUtils.fsExists,exists:e=>this._hostUtils.fsExists(e.fsPath),checkExists:(e,t,n)=>this._mainThreadWorkspaceProxy.$checkExists(e,t,n)},t);if(r)return this._activateById(t.identifier,{startup:!0,extensionId:t.identifier,activationEvent:r.activationEvent}).then(void 0,e=>this._logService.error(e))}async _handleRemoteResolverEagerExtensions(){if(this._initData.remote.authority)return this._activateByEvent(`onResolveRemoteAuthority:${this._initData.remote.authority}`,!1)}async $extensionTestsExecute(){await this._eagerExtensionsActivated.wait();try{return await this._doHandleExtensionTests()}catch(e){throw console.error(e),e}}async _doHandleExtensionTests(){let{extensionDevelopmentLocationURI:e,extensionTestsLocationURI:t}=this._initData.environment;if(!e||!t)throw Error(x(2865,`Cannot load test runner.`));let n=(await this.getExtensionPathIndex()).findSubstr(t),r=await(this._isESM(n,t.path)?this._loadESMModule(null,t,new SF(!1)):this._loadCommonJSModule(null,t,new SF(!1)));if(!r||typeof r.run!=`function`)throw Error(x(2866,`Path {0} does not point to a valid extension test runner.`,t.toString()));return new Promise((e,n)=>{let i=(t,r)=>{t?(On&&this._logService.error(`Test runner called back with error`,t),n(t)):(On&&(r?this._logService.info(`Test runner called back with ${r} failures.`):this._logService.info(`Test runner called back with successful outcome.`)),e(+(typeof r==`number`&&r>0)))},a=Ja(t),o=r.run(a,i);o&&o.then&&o.then(()=>{On&&this._logService.info(`Test runner finished successfully.`),e(0)}).catch(e=>{On&&this._logService.error(`Test runner finished with error`,e),n(e instanceof Error&&e.stack?e.stack:String(e))})})}_startExtensionHost(){if(this._started)throw Error(`Extension host is already started!`);return this._started=!0,this._readyToStartExtensionHost.wait().then(()=>this._readyToRunExtensions.open()).then(()=>Promise.race([this._activator.waitForActivatingExtensions(),Eo(1e3)])).then(()=>this._handleEagerExtensions()).then(()=>{this._eagerExtensionsActivated.open(),this._logService.info(`Eager extensions activated`)})}registerRemoteAuthorityResolver(e,t){return this._resolvers[e]=t,_(()=>{delete this._resolvers[e]})}async getRemoteExecServer(e){let{resolver:t}=await this._activateAndGetResolver(e);return t?.resolveExecServer?.(e,{resolveAttempt:0})}async _activateAndGetResolver(e){let t=e.indexOf(`+`);if(t===-1)throw new JT(`Not an authority that can be resolved!`,Yw.InvalidAuthority);let n=e.substr(0,t);return await this._almostReadyToRunExtensions.wait(),await this._activateByEvent(`onResolveRemoteAuthority:${n}`,!1),{authorityPrefix:n,resolver:this._resolvers[n]}}async $resolveAuthority(e,t){let n=Yn.create(!1),r=()=>`[resolveAuthority(${Xw(e)},${t})][${n.elapsed()}ms] `,i=e=>this._logService.info(`${r()}${e}`),a=e=>this._logService.warn(`${r()}${e}`),o=(e,t=void 0)=>this._logService.error(`${r()}${e}`,t),s=e=>{if(e instanceof JT)return{type:`error`,error:{code:e._code,message:e._message,detail:e._detail}};throw e},c=async e=>{i(`activating resolver for ${e}...`);let{resolver:t,authorityPrefix:n}=await this._activateAndGetResolver(e);if(!t)throw o(`no resolver for ${n}`),new JT(`No remote extension installed to resolve ${n}.`,Yw.NoResolverFound);return{resolver:t,authorityPrefix:n,remoteAuthority:e}},l=e.split(/@|%40/g).reverse();i(`activating remote resolvers ${l.join(` -> `)}`);let u;try{u=await Promise.all(l.map(c)).catch(async t=>{if(!(t instanceof JT)||t._code!==Yw.InvalidAuthority)throw t;return a(`resolving nested authorities failed: ${t.message}`),[await c(e)]})}catch(e){return s(e)}let d=new jo;d.cancelAndSet(()=>i(`waiting...`),1e3);let f,p;for(let[e,{authorityPrefix:n,resolver:r,remoteAuthority:a}]of u.entries())try{if(e===u.length-1)i(`invoking final resolve()...`),wr(`code/extHost/willResolveAuthority/${n}`),f=await r.resolve(a,{resolveAttempt:t,execServer:p}),wr(`code/extHost/didResolveAuthorityOK/${n}`),i(`setting tunnel factory...`),this._register(await this._extHostTunnelService.setTunnelFactory(r,qT.isManagedResolvedAuthority(f)?f:void 0));else{if(i(`invoking resolveExecServer() for ${a}`),wr(`code/extHost/willResolveExecServer/${n}`),p=await r.resolveExecServer?.(a,{resolveAttempt:t,execServer:p}),!p)throw new JT(`Exec server was not available for ${a}`,Yw.NoResolverFound);wr(`code/extHost/didResolveExecServerOK/${n}`)}}catch(e){return wr(`code/extHost/didResolveAuthorityError/${n}`),o(`returned an error`,e),d.dispose(),s(e)}d.dispose();let m={environmentTunnels:f.environmentTunnels,features:f.tunnelFeatures?{elevation:f.tunnelFeatures.elevation,privacyOptions:f.tunnelFeatures.privacyOptions,protocol:f.tunnelFeatures.protocol===void 0?!0:f.tunnelFeatures.protocol}:void 0},h={extensionHostEnv:f.extensionHostEnv,isTrusted:f.isTrusted,authenticationSession:f.authenticationSessionForInitializingExtensions?{id:f.authenticationSessionForInitializingExtensions.id,providerId:f.authenticationSessionForInitializingExtensions.providerId}:void 0};i(`returned ${qT.isManagedResolvedAuthority(f)?`managed authority`:`${f.host}:${f.port}`}`);let ee;if(qT.isManagedResolvedAuthority(f)){let n=t;this._extHostManagedSockets.setFactory(n,f.makeConnection),ee={authority:e,connectTo:new qw(n),connectionToken:f.connectionToken}}else ee={authority:e,connectTo:new Jw(f.host,f.port),connectionToken:f.connectionToken};return{type:`ok`,value:{authority:ee,options:h,tunnelInformation:m}}}async $getCanonicalURI(e,t){this._logService.info(`$getCanonicalURI invoked for authority (${Xw(e)})`);let{resolver:n}=await this._activateAndGetResolver(e);if(!n)return null;let r=w.revive(t);return n.getCanonicalURI===void 0?r:await go(()=>n.getCanonicalURI(r))||r}async $startExtensionHost(e){e.toAdd.forEach(e=>e.extensionLocation=w.revive(e.extensionLocation));let{globalRegistry:t,myExtensions:n}=UR(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),r=await this._createExtensionPathIndex(n);return(await this.getExtensionPathIndex()).setSearchTree(r),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(n),On&&(this._logService.info(`$startExtensionHost: global extensions: ${GR(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${GR(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(e,t){return t===Ow.Immediate?this._almostReadyToRunExtensions.wait().then(t=>this._activateByEvent(e,!1)):this._readyToRunExtensions.wait().then(t=>this._activateByEvent(e,!1))}async $activate(e,t){return await this._readyToRunExtensions.wait(),this._myRegistry.getExtensionDescription(e)?(await this._activateById(e,t),!0):!1}async $deltaExtensions(e){e.toAdd.forEach(e=>e.extensionLocation=w.revive(e.extensionLocation));let{globalRegistry:t,myExtensions:n}=UR(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),r=await this._createExtensionPathIndex(n);return(await this.getExtensionPathIndex()).setSearchTree(r),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(n),On&&(this._logService.info(`$deltaExtensions: global extensions: ${GR(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${GR(this._myRegistry)}`)),Promise.resolve(void 0)}async $test_latency(e){return e}async $test_up(e){return e.byteLength}async $test_down(e){let t=b.alloc(e),n=Math.random()%256;for(let r=0;r<e;r++)t.writeUInt8(n,r);return t}async $updateRemoteConnectionData(e){this._remoteConnectionData=e,this._onDidChangeRemoteConnectionData.fire()}_isESM(e,t){return t??=e?this._getEntryPoint(e):t,t?.endsWith(`.mjs`)||e?.type===`module`&&!t?.endsWith(`.cjs`)}};HR=BR=A([j(0,ws),j(1,VR),j(2,Hs),j(3,YP),j(4,mF),j(5,Ds),j(6,Fs),j(7,IF),j(8,XF),j(9,HI),j(10,FR),j(11,IR),j(12,ZL)],HR);function UR(e,t,n,r){e.addActivationEvents(r.addActivationEvents);let i=new gF(e,t.getAllExtensionDescriptions());i.deltaExtensions(r.toAdd,r.toRemove);let a=new bs(n.getAllExtensionDescriptions().map(e=>e.identifier));for(let e of r.myToRemove)a.delete(e);for(let e of r.myToAdd)a.add(e);return{globalRegistry:i,myExtensions:JR(i,a)}}function WR(e,t){return{id:e.identifier.value,name:e.name,extensionVersion:e.version,publisherDisplayName:e.publisher,activationEvents:e.activationEvents?e.activationEvents.join(`,`):null,isBuiltin:e.isBuiltin,reason:t.activationEvent,reasonId:t.extensionId.value}}function GR(e){return e.getAllExtensionDescriptions().map(e=>e.identifier.value).join(`,`)}const KR=k(`IExtHostExtensionService`);var qR=class{#e;#t;#n;constructor(e,t,n,r,i){this.#e=e,this.#t=t,this.#n=n.identifier,this.id=n.identifier.value,this.isBuiltin=n.isBuiltin||n.isUserBuiltin,this.extensionUri=n.extensionLocation,this.extensionPath=Br(Ja(n.extensionLocation)),this.packageJSON=n,this.extensionKind=r,this.isFromDifferentExtensionHost=i}get isActive(){return this.#e.isActivated(this.#n)}get exports(){if(!(this.packageJSON.api===`none`||this.isFromDifferentExtensionHost))return this.#e.getExtensionExports(this.#n)}async activate(){if(this.isFromDifferentExtensionHost)throw Error(`Cannot activate foreign extension`);return await this.#e.activateByIdWithErrors(this.#n,{startup:!1,extensionId:this.#t,activationEvent:`api`}),this.exports}};function JR(e,t){return e.getAllExtensionDescriptions().filter(e=>t.has(e.identifier))}var YR=class{constructor(e){this._searchTree=e}setSearchTree(e){this._searchTree=e}findSubstr(e){return this._searchTree.findSubstr(e)}forEach(e){return this._searchTree.forEach(e)}},XR=class{constructor(e){this._map=new xs,this.addActivationEvents(e)}readActivationEvents(e){return this._map.get(e.identifier)??[]}addActivationEvents(e){for(let t of Object.keys(e))this._map.set(t,e[t])}};const ZR=k(`IExtHostApiDeprecationService`);let QR=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(E.MainThreadTelemetry)}report(e,t,n,r){let i=this.getUsageKey(e,t,r?.usageId);this._reportedUsages.has(i)||(this._reportedUsages.add(i),t.isUnderDevelopment&&this._extHostLogService.warn(`[Deprecation Warning] '${e}' is deprecated. ${n}`),this._telemetryShape.$publicLog2(`extHostDeprecatedApiUsage`,{extensionId:t.identifier.value,apiId:e,usageId:r?.usageId??``}))}getUsageKey(e,t,n){let r=`${e}-${t.identifier.value}`;return n?`${r}-${n}`:r}};QR=A([j(0,Hs),j(1,Ds)],QR);let $R=class extends Hh{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(e=>Hu(e))),this._proxy=e.getProxy(E.MainThreadLogger)}$setLogLevel(e,t){t?this.setLogLevel(w.revive(t),e):this.setLogLevel(e)}setVisibility(e,t){super.setVisibility(e,t),this._proxy.$setVisibility(e,t)}doCreateLogger(e,t,n){return new ez(this._proxy,e,t,n)}};$R=A([j(0,Hs),j(1,Fs)],$R);var ez=class extends Bh{constructor(e,t,n,r){super(r?.logLevel===`always`),this.proxy=e,this.file=t,this.isLoggerCreated=!1,this.buffer=[],this.setLevel(n),this.proxy.$createLogger(t,r).then(()=>{this.doLog(this.buffer),this.isLoggerCreated=!0})}log(e,t){let n=[[e,t]];this.isLoggerCreated?this.doLog(n):this.buffer.push(...n)}doLog(e){this.proxy.$log(this.file,e)}flush(){this.proxy.$flush(this.file)}},tz=class extends y{constructor(e,t=[]){super(),this.logger=new Vh([e,...t]),this._register(e.onDidChangeLogLevel(e=>this.setLevel(e)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}flush(){this.logger.flush()}};let nz=class extends tz{constructor(e,t,n){let r=n.remote.isRemote?`remoteexthost`:e?`workerexthost`:`exthost`,i=n.remote.isRemote?x(2870,`Extension Host (Remote)`):e?x(2871,`Extension Host (Worker)`):x(2872,`Extension Host`);super(t.createLogger(r,{name:i}))}};nz=A([j(1,Os),j(2,Fs)],nz);var rz=class{static async installEarlyHandler(e){Error.stackTraceLimit=100;let t=e.get(Ds),n=e.get(Hs).getProxy(E.MainThreadErrors);i(e=>{t.error(e);let r=c(e);n.$onUnexpectedError(r)})}static async installFullHandler(e){let t=e.get(Ds),n=e.get(Hs),a=e.get(KR),o=e.get(II),s=e.get(ZR),l=n.getProxy(E.MainThreadExtensionService),u=n.getProxy(E.MainThreadErrors),d=await a.getExtensionRegistry(),f=await a.getExtensionPathIndex(),m=new WeakMap;function h(e,t){if(m.has(e))return m.get(e).stack;let n=``,r,i;for(let e of t)n+=`\n\tat ${e.toString()}`,i=e.getFileName(),!r&&i&&(r=f.findSubstr(w.file(i)));let a=`${e.name||`Error`}: ${e.message||``}${n}`;return m.set(e,{extensionIdentifier:r?.identifier,stack:a}),a}let ee=Symbol(`prepareStackTrace wrapped`),te=h;Object.defineProperty(Error,`prepareStackTrace`,{configurable:!1,get(){return te},set(e){if(e===h||!e||e[ee]){te=e||h;return}te=function(t,n){return h(t,n),e.call(Error,t,n)},Object.assign(te,{[ee]:!0})}}),i(e=>{p.is(e)||t.error(e);let n=c(e),r;if(r=e instanceof Ss?e.extension:m.get(e)?.extensionIdentifier,r)if(p.is(e)){let t=d.getExtensionDescription(r);t&&s.report(e.name,t,`${e.message}\n FROM: ${e.stack}`)}else{l.$onExtensionRuntimeError(r,n);let i=o.onExtensionError(r,e);t.trace(`forwarded error to extension?`,i,r)}}),r.addListener(e=>{u.$onUnexpectedError(e)})}},iz=class e{constructor(t,n,r,i,a){this._hostUtils=r,this._rpcProtocol=new cs(t,null,i),n=e._transform(n,this._rpcProtocol);let o=new Ps(...Ns());o.set(Fs,{_serviceBrand:void 0,...n,messagePorts:a}),o.set(Hs,new Us(this._rpcProtocol)),o.set(Ws,new Gs(i)),o.set(VR,r),o.set(Ds,new ks(nz,[!0],!0)),o.set(Os,new ks($R,[],!0));let s=new zs(o,!0);wn&&s.invokeFunction(rz.installEarlyHandler),this._logService=s.invokeFunction(e=>e.get(Ds)),wr(`code/extHost/didCreateServices`),this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} started`):this._logService.info(`Extension host started`),this._logService.trace(`initData`,n),this._extensionService=s.invokeFunction(e=>e.get(KR)),this._extensionService.initialize(),wn&&s.invokeFunction(rz.installFullHandler)}async asBrowserUri(e){let t=this._rpcProtocol.getProxy(E.MainThreadExtensionService);return w.revive(await t.$asBrowserUri(e))}async getAllStaticBrowserUris(){return(await this._rpcProtocol.getProxy(E.MainThreadExtensionService).$getAllStaticBrowserUris()).map(([e,t])=>[w.revive(e),w.revive(t)])}terminate(e){this._extensionService.terminate(e)}getExtHostExtensionService(){return this._extensionService}static _transform(e,t){e.extensions.allExtensions.forEach(e=>{e.extensionLocation=w.revive(t.transformIncomingURIs(e.extensionLocation))}),e.environment.appRoot=w.revive(t.transformIncomingURIs(e.environment.appRoot));let n=e.environment.extensionDevelopmentLocationURI;return n&&(e.environment.extensionDevelopmentLocationURI=n.map(e=>w.revive(t.transformIncomingURIs(e)))),e.environment.extensionTestsLocationURI=w.revive(t.transformIncomingURIs(e.environment.extensionTestsLocationURI)),e.environment.globalStorageHome=w.revive(t.transformIncomingURIs(e.environment.globalStorageHome)),e.environment.workspaceStorageHome=w.revive(t.transformIncomingURIs(e.environment.workspaceStorageHome)),e.nlsBaseUrl=w.revive(t.transformIncomingURIs(e.nlsBaseUrl)),e.logsLocation=w.revive(t.transformIncomingURIs(e.logsLocation)),e.workspace=t.transformIncomingURIs(e.workspace),e}};const az=(function(e){let t=n=>{globalThis.removeEventListener(`message`,t);let r=n.data;Object.defineProperties(globalThis,{postMessage:{value(e,t){r.postMessage(e,t)}},onmessage:{get(){return r.onmessage},set(e){r.onmessage=e}}}),r.addEventListener(`message`,e=>{globalThis.dispatchEvent(new MessageEvent(`message`,{data:e.data,ports:e.ports?[...e.ports]:void 0}))}),r.start(),globalThis.Worker=class{constructor(){throw TypeError(`Nested workers from within nested worker are NOT supported.`)}},importScripts(e)};globalThis.addEventListener(`message`,t)}).toString();var oz=class extends EventTarget{constructor(e,t,n){super(),this.onmessage=null,this.onmessageerror=null,this.onerror=null;let r=`((${az})('${t}'))`,i=new Blob([r],{type:`application/javascript`}),a=URL.createObjectURL(i),o=new MessageChannel,s=a;e({type:`_newWorker`,id:s,port:o.port2,url:a,options:n},[o.port2]),this.postMessage=o.port1.postMessage.bind(o.port1),this.terminate=()=>{e({type:`_terminateWorker`,id:s}),URL.revokeObjectURL(a),o.port1.close(),o.port2.close()},Object.defineProperties(this,{onmessage:{get(){return o.port1.onmessage},set(e){o.port1.onmessage=e}},onmessageerror:{get(){return o.port1.onmessageerror},set(e){o.port1.onmessageerror=e}}}),o.port1.addEventListener(`messageerror`,e=>{let t=new MessageEvent(`messageerror`,{data:e.data});this.dispatchEvent(t)}),o.port1.addEventListener(`message`,e=>{let t=new MessageEvent(`message`,{data:e.data});this.dispatchEvent(t)}),o.port1.start()}};new I(`inOutput`,!1),new I(`activeLogOutput`,!1),new I(`activeLogOutput.isLog`,!1),new I(`activeLogOutput.levelSettable`,!1),new I(`activeLogOutput.level`,``),new I(`activeLogOutput.levelIsDefault`,!1),new I(`outputView.scrollLock`,!1),new I(`activeOutputChannel`,``),new I(`output.filter.trace`,!0),new I(`output.filter.debug`,!0),new I(`output.filter.info`,!0),new I(`output.filter.warning`,!0),new I(`output.filter.error`,!0),new I(`outputFilterFocus`,!1),new I(`output.filter.categories`,``);var sz;(function(e){e[e.Append=1]=`Append`,e[e.Replace=2]=`Replace`,e[e.Clear=3]=`Clear`})(sz||={});const cz={OutputChannels:`workbench.contributions.outputChannels`};function lz(e){return Array.isArray(e.source)}var uz=class extends y{constructor(){super(...arguments),this.channels=new Map,this._onDidRegisterChannel=this._register(new S),this.onDidRegisterChannel=this._onDidRegisterChannel.event,this._onDidRemoveChannel=this._register(new S),this.onDidRemoveChannel=this._onDidRemoveChannel.event,this._onDidUpdateChannelFiles=this._register(new S),this.onDidUpdateChannelSources=this._onDidUpdateChannelFiles.event}registerChannel(e){this.channels.has(e.id)||(this.channels.set(e.id,e),this._onDidRegisterChannel.fire(e.id))}getChannels(){let e=[];return this.channels.forEach(t=>e.push(t)),e}getChannel(e){return this.channels.get(e)}updateChannelSources(e,t){let n=this.channels.get(e);n&&lz(n)&&(n.source=t,this._onDidUpdateChannelFiles.fire(n))}removeChannel(e){let t=this.channels.get(e);t&&(this.channels.delete(e),this._onDidRemoveChannel.fire(t))}};wm.add(cz.OutputChannels,new uz);var dz=class extends Bh{constructor(e,t,n,r,i){super(),this.id=e,this.name=t,this.logger=n,this.proxy=r,this.extension=i,this.offset=0,this.visible=!1,this.setLevel(n.getLevel()),this._register(n.onDidChangeLogLevel(e=>this.setLevel(e))),this._register(_(()=>this.proxy.$dispose(this.id)))}get logLevel(){return this.getLevel()}appendLine(e){this.append(e+`
100
- `)}append(e){this.info(e)}clear(){let e=this.offset;this.logger.flush(),this.proxy.$update(this.id,sz.Clear,e)}replace(e){let t=this.offset;this.info(e),this.proxy.$update(this.id,sz.Replace,t),this.visible&&this.logger.flush()}show(e,t){this.logger.flush(),this.proxy.$reveal(this.id,!!(typeof e==`boolean`?e:t))}hide(){this.proxy.$close(this.id)}log(e,t){this.offset+=b.fromString(t).byteLength,Lh(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,sz.Append))}},fz=class extends dz{appendLine(e){this.append(e)}};let pz=class{constructor(e,t,n,r,i,a){this.initData=t,this.extHostFileSystem=n,this.extHostFileSystemInfo=r,this.loggerService=i,this.logService=a,this.extensionLogDirectoryCreationPromise=new Ne,this.logOutputChannels=new Ne,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(E.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${tR(new Date).replace(/-|:|\.\d+Z$/g,``)}`)}$setVisibleChannel(e){this.visibleChannelId=e;for(let[e,t]of this.channels)t.visible=e===this.visibleChannelId}createOutputChannel(e,t,n){if(e=e.trim(),!e)throw Error("illegal argument `name`. must not be falsy");let r=typeof t==`object`&&t.log,i=Ge(t)?t:void 0;if(Ge(i)&&!i.trim())throw Error("illegal argument `languageId`. must not be empty");let a=new v,o,s=this.initData.environment.extensionLogLevel?.find(([e])=>ys.equals(n.identifier,e))?.[1],c;if(r){let t=this.extHostFileSystemInfo.extUri.joinPath(this.initData.logsLocation,n.identifier.value);c=this.extHostFileSystemInfo.extUri.joinPath(t,`${e.replace(/[\\/:\*\?"<>\|]/g,``)}.log`);let r=this.logOutputChannels.get(c);if(r)return r;let i=this.loggerService.getRegisteredLogger(c);i?.logLevel!==void 0&&(s=i.logLevel),o=this.doCreateLogOutputChannel(e,c,s,n,a)}else o=this.doCreateOutputChannel(e,i,n,a);if(o.then(e=>{this.channels.set(e.id,e),e.visible=e.id===this.visibleChannelId,a.add(_(()=>{this.channels.delete(e.id),c&&this.logOutputChannels.delete(c)}))}),c){let t=this.createExtHostLogOutputChannel(e,s??this.logService.getLevel(),o,a);return this.logOutputChannels.set(c,t),t}return this.createExtHostOutputChannel(e,o,a)}async doCreateOutputChannel(e,t,n,r){this.outputDirectoryPromise||=this.extHostFileSystem.value.createDirectory(this.outputsLocation).then(()=>this.outputsLocation);let i=await this.outputDirectoryPromise,a=this.extHostFileSystemInfo.extUri.joinPath(i,`${this.namePool++}-${e.replace(/[\\/:\*\?"<>\|]/g,``)}.log`),o=r.add(this.loggerService.createLogger(a,{logLevel:`always`,donotRotate:!0,donotUseFormatters:!0,hidden:!0})),s=await this.proxy.$register(e,a,t,n.identifier.value);return r.add(_(()=>this.loggerService.deregisterLogger(a))),new dz(s,e,o,this.proxy,n)}async doCreateLogOutputChannel(e,t,n,r,i){await this.createExtensionLogDirectory(t);let a=`${r.identifier.value}.${this.extHostFileSystemInfo.extUri.basename(t)}`,o=i.add(this.loggerService.createLogger(t,{id:a,name:e,logLevel:n,extensionId:r.identifier.value}));return i.add(_(()=>this.loggerService.deregisterLogger(t))),new fz(a,e,o,this.proxy,r)}createExtensionLogDirectory(e){let t=this.extHostFileSystemInfo.extUri.dirname(e),n=this.extensionLogDirectoryCreationPromise.get(t);return n||this.extensionLogDirectoryCreationPromise.set(t,n=(async()=>{try{await this.extHostFileSystem.value.createDirectory(t)}catch(e){if(vc(e)!==hc.FileExists)throw e}})()),n}createExtHostOutputChannel(e,t,n){let r=()=>{if(n.isDisposed)throw Error(`Channel has been closed`)};return t.then(e=>n.add(e)),{get name(){return e},append(e){r(),t.then(t=>t.append(e))},appendLine(e){r(),t.then(t=>t.appendLine(e))},clear(){r(),t.then(e=>e.clear())},replace(e){r(),t.then(t=>t.replace(e))},show(e,n){r(),t.then(t=>t.show(e,n))},hide(){r(),t.then(e=>e.hide())},dispose(){n.dispose()}}}createExtHostLogOutputChannel(e,t,n,r){let i=()=>{if(r.isDisposed)throw Error(`Channel has been closed`)},a=r.add(new S);function o(e){t=e,a.fire(e)}return n.then(e=>{e.logLevel!==t&&o(e.logLevel),r.add(e.onDidChangeLogLevel(e=>o(e)))}),{...this.createExtHostOutputChannel(e,n,r),get logLevel(){return t},onDidChangeLogLevel:a.event,trace(e,...t){i(),n.then(n=>n.trace(e,...t))},debug(e,...t){i(),n.then(n=>n.debug(e,...t))},info(e,...t){i(),n.then(n=>n.info(e,...t))},warn(e,...t){i(),n.then(n=>n.warn(e,...t))},error(e,...t){i(),n.then(n=>n.error(e,...t))}}}};pz=A([j(0,Hs),j(1,Fs),j(2,FF),j(3,Rc),j(4,Os),j(5,Ds)],pz);const mz=k(`IExtHostOutputService`);var hz;let gz=class{static{hz=this}static{this._handlePool=0}static{this._maxEventSize=250}constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(E.MainThreadDecorations)}registerFileDecorationProvider(e,t){let n=hz._handlePool++;this._provider.set(n,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(n,t.identifier.value);let r=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(e=>{if(!e){this._proxy.$onDidChange(n,null);return}let r=be(e);if(r.length<=hz._maxEventSize){this._proxy.$onDidChange(n,r);return}this._logService.warn(`[Decorations] CAPPING events from decorations provider`,t.identifier.value,r.length);let i=ue(r.map(e=>({uri:e,rank:Ji(e.path,`/`)})),(e,t)=>e.rank-t.rank||na(e.uri.path,t.uri.path)),a=[];outer:for(let e of i){let t;for(let n of e){let e=Gr(n.uri.path);if(t!==e&&(t=e,a.push(n.uri)>=hz._maxEventSize))break outer}}this._proxy.$onDidChange(n,a)});return new WT(()=>{r?.dispose(),this._proxy.$unregisterDecorationProvider(n),this._provider.delete(n)})}async $provideDecorations(e,t,n){if(!this._provider.has(e))return Object.create(null);let r=Object.create(null),{provider:i,extensionDescription:a}=this._provider.get(e);return await Promise.all(t.map(async e=>{try{let{uri:t,id:o}=e,s=await Promise.resolve(i.provideFileDecoration(w.revive(t),n));if(!s)return;try{CO.validate(s),s.badge&&typeof s.badge!=`string`&&K(a,`codiconDecoration`),r[o]=[s.propagate,s.tooltip,s.badge,s.color]}catch(e){this._logService.warn(`INVALID decoration from extension '${a.identifier.value}': ${e}`)}}catch(e){this._logService.error(e)}})),r}};gz=hz=A([j(0,Hs),j(1,Ds)],gz);const _z=k(`IExtHostDecorations`);var vz=class{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(e,t){e=Vi(e);let n=this.values,r=this.prefixSum,i=t.length;return i===0?!1:(this.values=new Uint32Array(n.length+i),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+i),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=Vi(e),t=Vi(t),this.values[e]===t?!1:(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=Vi(e),t=Vi(t);let n=this.values,r=this.prefixSum;if(e>=n.length)return!1;let i=n.length-e;return t>=i&&(t=i),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Vi(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,r=0,i=0,a=0;for(;t<=n;)if(r=t+(n-t)/2|0,i=this.prefixSum[r],a=i-this.values[r],e<a)n=r-1;else if(e>=i)t=r+1;else break;return new yz(r,e-a)}},yz=class{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}},bz=class{constructor(e,t,n,r){this._uri=e,this._lines=t,this._eol=n,this._versionId=r,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return this._cachedTextValue===null&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);let t=e.changes;for(let e of t)this._acceptDeleteRange(e.range),this._acceptInsertText(new yp(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){let e=this._eol.length,t=this._lines.length,n=new Uint32Array(t);for(let r=0;r<t;r++)n[r]=this._lines[r].length+e;this._lineStarts=new vz(n)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1));return}this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){if(t.length===0)return;let n=$i(t);if(n.length===1){this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+n[0]+this._lines[e.lineNumber-1].substring(e.column-1));return}n[n.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+n[0]);let r=new Uint32Array(n.length-1);for(let t=1;t<n.length;t++)this._lines.splice(e.lineNumber+t-1,0,n[t]),r[t-1]=n[t].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,r)}};const xz=new Map;function Sz(e,t){t?xz.set(e,t):xz.delete(e)}function Cz(e){return xz.get(e)}var wz=class extends bz{constructor(e,t,n,r,i,a,o,s,c=!0){super(t,n,r,i),this._proxy=e,this._languageId=a,this._isDirty=o,this._encoding=s,this._strictInstanceofChecks=c,this._isDisposed=!1}dispose(){Ve(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return se(this._lines,e)}get document(){if(!this._document){let e=this;this._document={get uri(){return e._uri},get fileName(){return e._uri.fsPath},get isUntitled(){return e._uri.scheme===O.untitled},get languageId(){return e._languageId},get version(){return e._versionId},get isClosed(){return e._isDisposed},get isDirty(){return e._isDirty},get encoding(){return e._encoding},save(){return e._save()},getText(t){return t?e._getTextInRange(t):e.getText()},get eol(){return e._eol===`
101
- `?AT.LF:AT.CRLF},get lineCount(){return e._lines.length},lineAt(t){return e._lineAt(t)},offsetAt(t){return e._offsetAt(t)},positionAt(t){return e._positionAt(t)},validateRange(t){return e._validateRange(t)},validatePosition(t){return e._validatePosition(t)},getWordRangeAtPosition(t,n){return e._getWordRangeAtPosition(t,n)},[Symbol.for(`debug.description`)](){return`TextDocument(${e._uri.toString()})`}}}return Object.freeze(this._document)}_acceptLanguageId(e){Ve(!this._isDisposed),this._languageId=e}_acceptIsDirty(e){Ve(!this._isDisposed),this._isDirty=e}_acceptEncoding(e){Ve(!this._isDisposed),this._encoding=e}_save(){return this._isDisposed?Promise.reject(Error(`Document has been closed`)):this._proxy.$trySaveDocument(this._uri)}_getTextInRange(e){let t=this._validateRange(e);if(t.isEmpty)return``;if(t.isSingleLine)return this._lines[t.start.line].substring(t.start.character,t.end.character);let n=this._eol,r=t.start.line,i=t.end.line,a=[];a.push(this._lines[r].substring(t.start.character));for(let e=r+1;e<i;e++)a.push(this._lines[e]);return a.push(this._lines[i].substring(0,t.end.character)),a.join(n)}_lineAt(e){let t;if(e instanceof eT?t=e.line:typeof e==`number`?t=e:!this._strictInstanceofChecks&&eT.isPosition(e)&&(t=e.line),typeof t!=`number`||t<0||t>=this._lines.length||Math.floor(t)!==t)throw Error("Illegal value for `line`");return new Tz(t,this._lines[t],t===this._lines.length-1)}_offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.line-1)+e.character}_positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();let t=this._lineStarts.getIndexOf(e),n=this._lines[t.index].length;return new eT(t.index,Math.min(t.remainder,n))}_validateRange(e){if(this._strictInstanceofChecks){if(!(e instanceof nT))throw Error(`Invalid argument`)}else if(!nT.isRange(e))throw Error(`Invalid argument`);let t=this._validatePosition(e.start),n=this._validatePosition(e.end);return t===e.start&&n===e.end?e:new nT(t.line,t.character,n.line,n.character)}_validatePosition(e){if(this._strictInstanceofChecks){if(!(e instanceof eT))throw Error(`Invalid argument`)}else if(!eT.isPosition(e))throw Error(`Invalid argument`);if(this._lines.length===0)return e.with(0,0);let{line:t,character:n}=e,r=!1;if(t<0)t=0,n=0,r=!0;else if(t>=this._lines.length)t=this._lines.length-1,n=this._lines[t].length,r=!0;else{let e=this._lines[t].length;n<0?(n=0,r=!0):n>e&&(n=e,r=!0)}return r?new eT(t,n):e}_getWordRangeAtPosition(e,t){let n=this._validatePosition(e);if(!t)t=Cz(this._languageId);else if(Qi(t))throw Error(`[getWordRangeAtPosition]: ignoring custom regexp '${t.source}' because it matches the empty string.`);let r=ud(n.character+1,cd(t),this._lines[n.line],0);if(r)return new nT(n.line,r.startColumn-1,n.line,r.endColumn-1)}},Tz=class{constructor(e,t,n){this._line=e,this._text=t,this._isLastLine=n}get lineNumber(){return this._line}get text(){return this._text}get range(){return new nT(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new nT(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}},Ez=class{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}};new Ez(`id#`);var Dz=class e{static{this._Keys=new Ez(`TextEditorDecorationType`)}constructor(t,n,r){let i=e._Keys.nextId();t.$registerTextEditorDecorationType(n.identifier,i,xj.from(r)),this.value=Object.freeze({key:i,dispose(){t.$removeTextEditorDecorationType(i)}})}},Oz=class{constructor(e,t){this._collectedEdits=[],this._setEndOfLine=void 0,this._finalized=!1,this._document=e,this._documentVersionId=e.version,this._undoStopBefore=t.undoStopBefore,this._undoStopAfter=t.undoStopAfter}finalize(){return this._finalized=!0,{documentVersionId:this._documentVersionId,edits:this._collectedEdits,setEndOfLine:this._setEndOfLine,undoStopBefore:this._undoStopBefore,undoStopAfter:this._undoStopAfter}}_throwIfFinalized(){if(this._finalized)throw Error(`Edit is only valid while callback runs`)}replace(e,t){this._throwIfFinalized();let n=null;if(e instanceof eT)n=new nT(e,e);else if(e instanceof nT)n=e;else throw Error(`Unrecognized location`);this._pushEdit(n,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new nT(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof nT)t=e;else throw Error(`Unrecognized location`);this._pushEdit(t,null,!0)}_pushEdit(e,t,n){let r=this._document.validateRange(e);this._collectedEdits.push({range:r,text:t,forceMoveMarkers:n})}setEndOfLine(e){if(this._throwIfFinalized(),e!==AT.LF&&e!==AT.CRLF)throw h(`endOfLine`);this._setEndOfLine=e}},kz=class{constructor(e,t,n,r){this._proxy=e,this._id=t,this._accept(n),this._logService=r;let i=this;this.value={get tabSize(){return i._tabSize},set tabSize(e){i._setTabSize(e)},get indentSize(){return i._indentSize},set indentSize(e){i._setIndentSize(e)},get insertSpaces(){return i._insertSpaces},set insertSpaces(e){i._setInsertSpaces(e)},get cursorStyle(){return i._cursorStyle},set cursorStyle(e){i._setCursorStyle(e)},get lineNumbers(){return i._lineNumbers},set lineNumbers(e){i._setLineNumbers(e)}}}_accept(e){this._tabSize=e.tabSize,this._indentSize=e.indentSize,this._originalIndentSize=e.originalIndentSize,this._insertSpaces=e.insertSpaces,this._cursorStyle=e.cursorStyle,this._lineNumbers=nM.to(e.lineNumbers)}_validateTabSize(e){if(e===`auto`)return`auto`;if(typeof e==`number`){let t=Math.floor(e);return t>0?t:null}if(typeof e==`string`){let t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setTabSize(e){let t=this._validateTabSize(e);if(t!==null){if(typeof t==`number`){if(this._tabSize===t)return;this._tabSize=t}this._warnOnError(`setTabSize`,this._proxy.$trySetOptions(this._id,{tabSize:t}))}}_validateIndentSize(e){if(e===`tabSize`)return`tabSize`;if(typeof e==`number`){let t=Math.floor(e);return t>0?t:null}if(typeof e==`string`){let t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setIndentSize(e){let t=this._validateIndentSize(e);if(t!==null){if(typeof t==`number`){if(this._originalIndentSize===t)return;this._indentSize=t,this._originalIndentSize=t}this._warnOnError(`setIndentSize`,this._proxy.$trySetOptions(this._id,{indentSize:t}))}}_validateInsertSpaces(e){return e===`auto`?`auto`:e===`false`?!1:!!e}_setInsertSpaces(e){let t=this._validateInsertSpaces(e);if(typeof t==`boolean`){if(this._insertSpaces===t)return;this._insertSpaces=t}this._warnOnError(`setInsertSpaces`,this._proxy.$trySetOptions(this._id,{insertSpaces:t}))}_setCursorStyle(e){this._cursorStyle!==e&&(this._cursorStyle=e,this._warnOnError(`setCursorStyle`,this._proxy.$trySetOptions(this._id,{cursorStyle:e})))}_setLineNumbers(e){this._lineNumbers!==e&&(this._lineNumbers=e,this._warnOnError(`setLineNumbers`,this._proxy.$trySetOptions(this._id,{lineNumbers:nM.from(e)})))}assign(e){let t={},n=!1;if(e.tabSize!==void 0){let r=this._validateTabSize(e.tabSize);r===`auto`?(n=!0,t.tabSize=r):typeof r==`number`&&this._tabSize!==r&&(this._tabSize=r,n=!0,t.tabSize=r)}if(e.indentSize!==void 0){let r=this._validateIndentSize(e.indentSize);r===`tabSize`?(n=!0,t.indentSize=r):typeof r==`number`&&this._originalIndentSize!==r&&(this._indentSize=r,this._originalIndentSize=r,n=!0,t.indentSize=r)}if(e.insertSpaces!==void 0){let r=this._validateInsertSpaces(e.insertSpaces);r===`auto`?(n=!0,t.insertSpaces=r):this._insertSpaces!==r&&(this._insertSpaces=r,n=!0,t.insertSpaces=r)}e.cursorStyle!==void 0&&this._cursorStyle!==e.cursorStyle&&(this._cursorStyle=e.cursorStyle,n=!0,t.cursorStyle=e.cursorStyle),e.lineNumbers!==void 0&&this._lineNumbers!==e.lineNumbers&&(this._lineNumbers=e.lineNumbers,n=!0,t.lineNumbers=nM.from(e.lineNumbers)),n&&this._warnOnError(`setOptions`,this._proxy.$trySetOptions(this._id,t))}_warnOnError(e,t){t.catch(t=>{this._logService.warn(`ExtHostTextEditorOptions '${e}' failed:'`),this._logService.warn(t)})}},Az=class{constructor(e,t,n,r,i,a,o,s){this.id=e,this._proxy=t,this._logService=n,this._disposed=!1,this._hasDecorationsForKey=new Set,this._selections=i,this._options=new kz(this._proxy,this.id,a,n),this._visibleRanges=o,this._viewColumn=s;let c=this;this.value=Object.freeze({get document(){return r.value},set document(e){throw new te(`document`)},get selection(){return c._selections&&c._selections[0]},set selection(e){if(!(e instanceof xT))throw h(`selection`);c._selections=[e],c._trySetSelection()},get selections(){return c._selections},set selections(e){if(!Array.isArray(e)||e.some(e=>!(e instanceof xT)))throw h(`selections`);e.length===0&&(e=[new xT(0,0,0,0)]),c._selections=e,c._trySetSelection()},get visibleRanges(){return c._visibleRanges},set visibleRanges(e){throw new te(`visibleRanges`)},get diffInformation(){return c._diffInformation},get options(){return c._options.value},set options(e){c._disposed||c._options.assign(e)},get viewColumn(){return c._viewColumn},set viewColumn(e){throw new te(`viewColumn`)},edit(e,t={undoStopBefore:!0,undoStopAfter:!0}){if(c._disposed)return Promise.reject(Error(`TextEditor#edit not possible on closed editors`));let n=new Oz(r.value,t);return e(n),c._applyEdit(n)},insertSnippet(n,i,a={undoStopBefore:!0,undoStopAfter:!0}){if(c._disposed)return Promise.reject(Error(`TextEditor#insertSnippet not possible on closed editors`));let o;if(!i||Array.isArray(i)&&i.length===0)o=c._selections.map(e=>J.from(e));else if(i instanceof eT){let{lineNumber:e,column:t}=sj.from(i);o=[{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}]}else if(i instanceof nT)o=[J.from(i)];else{o=[];for(let e of i)if(e instanceof nT)o.push(J.from(e));else{let{lineNumber:t,column:n}=sj.from(e);o.push({startLineNumber:t,startColumn:n,endLineNumber:t,endColumn:n})}}return a.keepWhitespace===void 0&&(a.keepWhitespace=!1),t.$tryInsertSnippet(e,r.value.version,n.value,o,a)},setDecorations(n,r){let i=r.length===0;i&&!c._hasDecorationsForKey.has(n.key)||(i?c._hasDecorationsForKey.delete(n.key):c._hasDecorationsForKey.add(n.key),c._runOnProxy(()=>{if(hj(r))return t.$trySetDecorations(e,n.key,gj(r));{let i=Array(4*r.length);for(let e=0,t=r.length;e<t;e++){let t=r[e];i[4*e]=t.start.line+1,i[4*e+1]=t.start.character+1,i[4*e+2]=t.end.line+1,i[4*e+3]=t.end.character+1}return t.$trySetDecorationsFast(e,n.key,i)}}))},revealRange(n,r){c._runOnProxy(()=>t.$tryRevealRange(e,J.from(n),r||NE.Default))},show(n){t.$tryShowEditor(e,pj.from(n))},hide(){t.$tryHideEditor(e)},[Symbol.for(`debug.description`)](){return`TextEditor(${this.document.uri.toString()})`}})}dispose(){Ve(!this._disposed),this._disposed=!0}_acceptOptions(e){Ve(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){Ve(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){Ve(!this._disposed),this._viewColumn=e}_acceptSelections(e){Ve(!this._disposed),this._selections=e}_acceptDiffInformation(e){Ve(!this._disposed),this._diffInformation=e}async _trySetSelection(){let e=this._selections.map(ij.from);return await this._runOnProxy(()=>this._proxy.$trySetSelections(this.id,e)),this.value}_applyEdit(e){let t=e.finalize();if(t.edits.length===0&&!t.setEndOfLine)return Promise.resolve(!0);let n=t.edits.map(e=>e.range);n.sort((e,t)=>e.end.line===t.end.line?e.end.character===t.end.character?e.start.line===t.start.line?e.start.character-t.start.character:e.start.line-t.start.line:e.end.character-t.end.character:e.end.line-t.end.line);for(let e=0,t=n.length-1;e<t;e++){let t=n[e].end;if(n[e+1].start.isBefore(t))return Promise.reject(Error(`Overlapping ranges are not allowed!`))}let r=t.edits.map(e=>({range:J.from(e.range),text:e.text,forceMoveMarkers:e.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,r,{setEndOfLine:typeof t.setEndOfLine==`number`?rM.from(t.setEndOfLine):void 0,undoStopBefore:t.undoStopBefore,undoStopAfter:t.undoStopAfter})}_runOnProxy(e){return this._disposed?(this._logService.warn(`TextEditor is closed/disposed`),Promise.resolve(void 0)):e().then(()=>this,e=>(e instanceof Error&&e.name===`DISPOSED`||this._logService.warn(e),null))}},jz=class{constructor(e){this.value=e,this._count=0}ref(){this._count++}unref(){return--this._count===0}};let Mz=class{constructor(e,t){this._extHostRpc=e,this._logService=t,this._activeEditorId=null,this._editors=new Map,this._documents=new Ne,this._onDidAddDocuments=new S,this._onDidRemoveDocuments=new S,this._onDidChangeVisibleTextEditors=new S,this._onDidChangeActiveTextEditor=new S,this.onDidAddDocuments=this._onDidAddDocuments.event,this.onDidRemoveDocuments=this._onDidRemoveDocuments.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event}$acceptDocumentsAndEditorsDelta(e){this.acceptDocumentsAndEditorsDelta(e)}acceptDocumentsAndEditorsDelta(e){let t=[],r=[],i=[];if(e.removedDocuments)for(let n of e.removedDocuments){let e=w.revive(n),r=this._documents.get(e);r?.unref()&&(this._documents.delete(e),t.push(r.value))}if(e.addedDocuments)for(let t of e.addedDocuments){let e=w.revive(t.uri),n=this._documents.get(e);if(n&&e.scheme!==O.vscodeNotebookCell&&e.scheme!==O.vscodeInteractiveInput)throw Error(`document '${e} already exists!'`);n||(n=new jz(new wz(this._extHostRpc.getProxy(E.MainThreadDocuments),e,t.lines,t.EOL,t.versionId,t.languageId,t.isDirty,t.encoding)),this._documents.set(e,n),r.push(n.value)),n.ref()}if(e.removedEditors)for(let t of e.removedEditors){let e=this._editors.get(t);this._editors.delete(t),e&&i.push(e)}if(e.addedEditors)for(let t of e.addedEditors){let e=w.revive(t.documentUri);Ve(this._documents.has(e),`document '${e}' does not exist`),Ve(!this._editors.has(t.id),`editor '${t.id}' already exists!`);let r=this._documents.get(e).value,i=new Az(t.id,this._extHostRpc.getProxy(E.MainThreadTextEditors),this._logService,new n(()=>r.document),t.selections.map(ij.to),t.options,t.visibleRanges.map(e=>J.to(e)),typeof t.editorPosition==`number`?pj.to(t.editorPosition):void 0);this._editors.set(t.id,i)}e.newActiveEditor!==void 0&&(Ve(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),ht(t),ht(i),e.removedDocuments&&this._onDidRemoveDocuments.fire(t),e.addedDocuments&&this._onDidAddDocuments.fire(r),(e.removedEditors||e.addedEditors)&&this._onDidChangeVisibleTextEditors.fire(this.allEditors().map(e=>e.value)),e.newActiveEditor!==void 0&&this._onDidChangeActiveTextEditor.fire(this.activeEditor())}getDocument(e){return this._documents.get(e)?.value}allDocuments(){return lt.map(this._documents.values(),e=>e.value)}getEditor(e){return this._editors.get(e)}activeEditor(e){if(!this._activeEditorId)return;let t=this._editors.get(this._activeEditorId);return e?t:t?.value}allEditors(){return[...this._editors.values()]}};Mz=A([j(0,Hs),j(1,Ds)],Mz);const Nz=k(`IExtHostDocumentsAndEditors`),Pz={type:`object`,additionalProperties:!1,properties:{type:{type:`string`,description:x(14075,`The actual task type. Please note that types starting with a '$' are reserved for internal usage.`)},required:{type:`array`,markdownDescription:x(14076,"The names of the properties from the `properties` object that must be provided for a task of this type to be considered a match. Used by VS Code to associate a `tasks.json` entry with a registered task provider."),items:{type:`string`}},properties:{type:`object`,description:x(14077,`Additional properties of the task type`),additionalProperties:{$ref:`http://json-schema.org/draft-07/schema#`}},when:{type:`string`,markdownDescription:x(14078,"Condition which must be true to enable this type of task. Consider using `shellExecutionSupported`, `processExecutionSupported`, and `customExecutionSupported` as appropriate for this task definition. See the [API documentation](https://code.visualstudio.com/api/extension-guides/task-provider#when-clause) for more information."),default:``}}};var Fz;(function(e){function t(e,t,n){if(!e)return;let r=Ge(e.type)?e.type:void 0;if(!r||r.length===0){n.error(x(14079,`The task type configuration is missing the required 'taskType' property`));return}let i=[];if(Array.isArray(e.required))for(let t of e.required)Ge(t)&&i.push(t);return{extensionId:t.value,taskType:r,required:i,properties:e.properties?tc(e.properties):{},when:e.when?kd.deserialize(e.when):void 0}}e.from=t})(Fz||={});const Iz=dx.registerExtensionPoint({extensionPoint:`taskDefinitions`,activationEventsGenerator:function*(e){for(let t of e)t.type&&(yield`onTaskType:${t.type}`)},jsonSchema:{description:x(14080,`Contributes task kinds`),type:`array`,items:Pz}}),Lz=new class{constructor(){this._onDefinitionsChanged=new S,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{Iz.setHandler((t,n)=>{this._schema=void 0;try{for(let e of n.removed){let t=e.value;for(let e of t)this.taskTypes&&e.type&&this.taskTypes[e.type]&&delete this.taskTypes[e.type]}for(let e of n.added){let t=e.value;for(let n of t){let t=Fz.from(n,e.description.identifier,e.collector);t&&(this.taskTypes[t.taskType]=t)}}(n.removed.length>0||n.added.length>0)&&this._onDefinitionsChanged.fire()}catch{}e(void 0)})})}onReady(){return this.readyPromise}get(e){return this.taskTypes[e]}all(){return Object.keys(this.taskTypes).map(e=>this.taskTypes[e])}getJsonSchema(){if(this._schema===void 0){let e=[];for(let t of this.all()){let n={type:`object`,additionalProperties:!1};t.required.length>0&&(n.required=t.required.slice(0)),t.properties===void 0?n.properties=Object.create(null):n.properties=tc(t.properties),n.properties.type={type:`string`,enum:[t.taskType]},e.push(n)}this._schema={oneOf:e}}return this._schema}},Rz={IconContribution:`base.contributions.icons`};var zz;(function(e){function t(e,t){let n=e.defaults;for(;fl.isThemeIcon(n);){let e=Uz.getIcon(n.id);if(!e)return;n=e.defaults}return n}e.getDefinition=t})(zz||={});var Bz;(function(e){function t(e){return{weight:e.weight,style:e.style,src:e.src.map(e=>({format:e.format,location:e.location.toString()}))}}e.toJSONObject=t;function n(e){let t=e=>Ge(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every(e=>Ge(e.format)&&Ge(e.location)))return{weight:t(e.weight),style:t(e.style),src:e.src.map(e=>({format:e.format,location:w.parse(e.location)}))}}e.fromJSONObject=n})(Bz||={});const Vz=/^([\w_-]+)$/,Hz=x(2485,`The font ID must only contain letters, numbers, underscores and dashes.`),Uz=new class extends y{constructor(){super(),this._onDidChange=this._register(new S),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:`object`,properties:{fontId:{type:`string`,description:x(2486,`The id of the font to use. If not set, the font that is defined first is used.`),pattern:Vz.source,patternErrorMessage:Hz},fontCharacter:{type:`string`,description:x(2487,`The font character associated with the icon definition.`)}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:`\\\\e030`}}]}},type:`object`,properties:{}},this.iconReferenceSchema={type:`string`,pattern:`^${fl.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,n,r){let i=this.iconsById[e];if(i){if(n&&!i.description){i.description=n,this.iconSchema.properties[e].markdownDescription=`${n} $(${e})`;let t=this.iconReferenceSchema.enum.indexOf(e);t!==-1&&(this.iconReferenceSchema.enumDescriptions[t]=n),this._onDidChange.fire()}return i}let a={id:e,description:n,defaults:t,deprecationMessage:r};this.iconsById[e]=a;let o={$ref:`#/definitions/icons`};return r&&(o.deprecationMessage=r),n&&(o.markdownDescription=`${n}: $(${e})`),this.iconSchema.properties[e]=o,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(n||``),this._onDidChange.fire(),{id:e}}deregisterIcon(e){delete this.iconsById[e],delete this.iconSchema.properties[e];let t=this.iconReferenceSchema.enum.indexOf(e);t!==-1&&(this.iconReferenceSchema.enum.splice(t,1),this.iconReferenceSchema.enumDescriptions.splice(t,1)),this._onDidChange.fire()}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}getIconReferenceSchema(){return this.iconReferenceSchema}registerIconFont(e,t){return this.iconFontsById[e]||(this.iconFontsById[e]=t,this._onDidChange.fire(),t)}deregisterIconFont(e){delete this.iconFontsById[e]}getIconFont(e){return this.iconFontsById[e]}toString(){let e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;fl.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:``}`},n=[];n.push(`| preview | identifier | default codicon ID | description`),n.push(`| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |`);let r=Object.keys(this.iconsById).map(e=>this.iconsById[e]);for(let i of r.filter(e=>!!e.description).sort(e))n.push(`|<i class="${t(i)}"></i>|${i.id}|${fl.isThemeIcon(i.defaults)?i.defaults.id:i.id}|${i.description||``}|`);n.push(`| preview | identifier `),n.push(`| ----------- | --------------------------------- |`);for(let i of r.filter(e=>!fl.isThemeIcon(e.defaults)).sort(e))n.push(`|<i class="${t(i)}"></i>|${i.id}|`);return n.join(`
102
- `)}};wm.add(Rz.IconContribution,Uz);function Wz(e,t,n,r){return Uz.registerIcon(e,t,n,r)}function Gz(){let e=cl();for(let t in e){let n=`\\`+e[t].toString(16);Uz.registerIcon(t,{fontCharacter:n})}}Gz();const Kz=`vscode://schemas/icons`,qz=wm.as(tg.JSONContribution);qz.registerSchema(Kz,Uz.getIconSchema());const Jz=new Mo(()=>qz.notifySchemaChanged(Kz),200);Uz.onDidChange(()=>{Jz.isScheduled()||Jz.schedule()}),Wz(`widget-close`,P.close,x(2488,`Icon for the close action in widgets.`)),Wz(`goto-previous-location`,P.arrowUp,x(2489,`Icon for goto previous editor location.`)),Wz(`goto-next-location`,P.arrowDown,x(2490,`Icon for goto next editor location.`)),fl.modify(P.sync,`spin`),fl.modify(P.loading,`spin`),Wz(`rerun-task`,P.refresh,x(13866,`View icon of the rerun task.`)),new I(`taskRunning`,!1,x(14091,`Whether a task is currently running.`)),new I(`taskTerminalActive`,!1,x(14092,`Whether the active terminal is a task terminal.`)),nn(14093,`Tasks`);var Yz;(function(e){e[e.Escape=1]=`Escape`,e[e.Strong=2]=`Strong`,e[e.Weak=3]=`Weak`})(Yz||={}),(function(e){function t(t){if(!t)return e.Strong;switch(t.toLowerCase()){case`escape`:return e.Escape;case`strong`:return e.Strong;case`weak`:return e.Weak;default:return e.Strong}}e.from=t})(Yz||={});var Xz;(function(e){e.defaults={cwd:"${workspaceFolder}"}})(Xz||={});var Zz;(function(e){e[e.Always=1]=`Always`,e[e.Silent=2]=`Silent`,e[e.Never=3]=`Never`})(Zz||={}),(function(e){function t(t){switch(t.toLowerCase()){case`always`:return e.Always;case`silent`:return e.Silent;case`never`:return e.Never;default:return e.Always}}e.fromString=t})(Zz||={});var Qz;(function(e){e[e.Never=1]=`Never`,e[e.OnProblem=2]=`OnProblem`,e[e.Always=3]=`Always`})(Qz||={}),(function(e){function t(t){switch(t.toLowerCase()){case`always`:return e.Always;case`never`:return e.Never;case`onproblem`:return e.OnProblem;default:return e.OnProblem}}e.fromString=t})(Qz||={});var $z;(function(e){e[e.Shared=1]=`Shared`,e[e.Dedicated=2]=`Dedicated`,e[e.New=3]=`New`})($z||={}),(function(e){function t(t){switch(t.toLowerCase()){case`shared`:return e.Shared;case`dedicated`:return e.Dedicated;case`new`:return e.New;default:return e.Shared}}e.fromString=t})($z||={});var eB;(function(e){e.defaults={echo:!0,reveal:Zz.Always,revealProblems:Qz.Never,focus:!1,panel:$z.Shared,showReuseMessage:!0,clear:!1,preserveTerminalName:!1}})(eB||={});var tB;(function(e){e[e.Shell=1]=`Shell`,e[e.Process=2]=`Process`,e[e.CustomExecution=3]=`CustomExecution`})(tB||={}),(function(e){function t(t){switch(t.toLowerCase()){case`shell`:return e.Shell;case`process`:return e.Process;case`customExecution`:return e.CustomExecution;default:return e.Process}}e.fromString=t;function n(t){switch(t){case e.Shell:return`shell`;case e.Process:return`process`;case e.CustomExecution:return`customExecution`;default:return`process`}}e.toString=n})(tB||={});var nB;(function(e){function t(e){return Ge(e)?e:e.value}e.value=t})(nB||={});var rB;(function(e){e.Clean={_id:`clean`,isDefault:!1},e.Build={_id:`build`,isDefault:!1},e.Rebuild={_id:`rebuild`,isDefault:!1},e.Test={_id:`test`,isDefault:!1};function t(t){return t===e.Clean._id||t===e.Build._id||t===e.Rebuild._id||t===e.Test._id}e.is=t;function n(e){if(e!==void 0)return Ge(e)?t(e)?{_id:e,isDefault:!1}:void 0:e}e.from=n})(rB||={});var iB;(function(e){e[e.Global=1]=`Global`,e[e.Workspace=2]=`Workspace`,e[e.Folder=3]=`Folder`})(iB||={});var aB;(function(e){e.Workspace=`workspace`,e.Extension=`extension`,e.InMemory=`inMemory`,e.WorkspaceFile=`workspaceFile`,e.User=`user`;function t(t){switch(t){case e.User:return Gh.USER;case e.WorkspaceFile:return Gh.WORKSPACE;default:return Gh.WORKSPACE_FOLDER}}e.toConfigurationTarget=t})(aB||={});var oB;(function(e){e.parallel=`parallel`,e.sequence=`sequence`})(oB||={});var sB;(function(e){e[e.default=1]=`default`,e[e.folderOpen=2]=`folderOpen`,e[e.worktreeCreated=3]=`worktreeCreated`})(sB||={});var cB;(function(e){e.terminateNewest=`terminateNewest`,e.terminateOldest=`terminateOldest`,e.prompt=`prompt`,e.warn=`warn`,e.silent=`silent`})(cB||={});var lB;(function(e){e.defaults={reevaluateOnRerun:!0,runOn:sB.default,instanceLimit:1,instancePolicy:cB.prompt}})(lB||={});var uB;(function(e){e[e.Process=1]=`Process`,e[e.Terminal=2]=`Terminal`})(uB||={}),(function(e){e._default=e.Terminal})(uB||={});var dB;(function(e){e[e.V0_1_0=1]=`V0_1_0`,e[e.V2_0_0=2]=`V2_0_0`})(dB||={});var fB;(function(e){e.SingleRun=`singleRun`,e.Background=`background`})(fB||={});var pB;(function(e){e.Changed=`changed`,e.ProcessStarted=`processStarted`,e.ProcessEnded=`processEnded`,e.Terminated=`terminated`,e.Start=`start`,e.AcquiredInput=`acquiredInput`,e.DependsOnStarted=`dependsOnStarted`,e.Active=`active`,e.Inactive=`inactive`,e.End=`end`,e.ProblemMatcherStarted=`problemMatcherStarted`,e.ProblemMatcherEnded=`problemMatcherEnded`,e.ProblemMatcherFoundErrors=`problemMatcherFoundErrors`})(pB||={});var mB;(function(e){e[e.System=0]=`System`,e[e.User=1]=`User`,e[e.FolderOpen=2]=`FolderOpen`,e[e.ConfigurationChange=3]=`ConfigurationChange`,e[e.Reconnect=4]=`Reconnect`,e[e.ChatAgent=5]=`ChatAgent`})(mB||={});var hB;(function(e){function t(e){return{taskId:e._id,taskName:e.configurationProperties.name,runType:e.configurationProperties.isBackground?fB.Background:fB.SingleRun,group:e.configurationProperties.group,__task:e}}function n(e,n,r){return{...t(e),kind:pB.Start,terminalId:n,resolvedVariables:r}}e.start=n;function r(e,n,r){return{...t(e),kind:pB.ProcessStarted,terminalId:n,processId:r}}e.processStarted=r;function i(e,n,r,i){return{...t(e),kind:pB.ProcessEnded,terminalId:n,exitCode:r,durationMs:i}}e.processEnded=i;function a(e,n,r){return{...t(e),kind:pB.Inactive,terminalId:n,durationMs:r}}e.inactive=a;function o(e,n,r){return{...t(e),kind:pB.Terminated,exitReason:r,terminalId:n}}e.terminated=o;function s(e,n,r){return{...t(n),kind:e,terminalId:r}}e.general=s;function c(e,n,r){return{...t(e),kind:pB.ProblemMatcherEnded,hasErrors:n}}e.problemMatcherEnded=c;function l(){return{kind:pB.Changed}}e.changed=l})(hB||={});var gB;(function(e){function t(e){let n=Object.keys(e).sort(),r=``;for(let i of n){let n=e[i];n instanceof Object?n=t(n):typeof n==`string`&&(n=n.replace(/,/g,`,,`)),r+=i+`,`+n+`,`}return r}function n(e){let n={_key:t(e),type:e.taskType};return Object.assign(n,e),n}e.create=n})(gB||={});var _B;(function(e){e.AutoDetect=`task.autoDetect`,e.SaveBeforeRun=`task.saveBeforeRun`,e.ShowDecorations=`task.showDecorations`,e.ProblemMatchersNeverPrompt=`task.problemMatchers.neverPrompt`,e.SlowProviderWarning=`task.slowProviderWarning`,e.QuickOpenHistory=`task.quickOpen.history`,e.QuickOpenDetail=`task.quickOpen.detail`,e.QuickOpenSkip=`task.quickOpen.skip`,e.QuickOpenShowAll=`task.quickOpen.showAll`,e.AllowAutomaticTasks=`task.allowAutomaticTasks`,e.Reconnection=`task.reconnection`,e.VerboseLogging=`task.verboseLogging`,e.NotifyWindowOnTaskCompletion=`task.notifyWindowOnTaskCompletion`})(_B||={});var vB;(function(e){e.Tasks=`tasks`,e.SuppressTaskName=`tasks.suppressTaskName`,e.Windows=`tasks.windows`,e.Osx=`tasks.osx`,e.Linux=`tasks.linux`,e.ShowOutput=`tasks.showOutput`,e.IsShellCommand=`tasks.isShellCommand`,e.ServiceTestSetting=`tasks.service.testSetting`})(vB||={});var yB;(function(e){function t(e,t){let n=Lz.get(e.type);if(n===void 0){let t=tc(e);return delete t._key,gB.create(t)}let r=Object.create(null);r.type=n.taskType;let i=new Set;n.required.forEach(e=>i.add(e));let a=n.properties;for(let n of Object.keys(a)){let o=e[n];if(o!=null)r[n]=o;else if(i.has(n)){let i=a[n];if(i.default!==void 0)r[n]=tc(i.default);else switch(i.type){case`boolean`:r[n]=!1;break;case`number`:case`integer`:r[n]=0;break;case`string`:r[n]=``;break;default:t.error(x(14094,`Error: the task identifier '{0}' is missing the required property '{1}'. The task identifier will be ignored.`,JSON.stringify(e,void 0,0),n));return}}}return gB.create(r)}e.createTaskIdentifier=t})(yB||={});var bB;(function(e){function t(e){if(e!=null)return e}e.from=t;function n(e){if(e!=null)return e}e.to=n})(bB||={});var xB;(function(e){function t(e){if(e!=null)return e}e.from=t;function n(e){if(e!=null)return e}e.to=n})(xB||={});var SB;(function(e){function t(e){if(e!=null)return e}e.from=t;function n(e){if(e!=null)return e}e.to=n})(SB||={});var CB;(function(e){function t(e){if(e){let t=e;return t&&!!t.process}else return!1}e.is=t;function n(e){if(e==null)return;let t={process:e.process,args:e.args};return e.options&&(t.options=SB.from(e.options)),t}e.from=n;function r(e){if(e!=null)return new sD(e.process,e.args,e.options)}e.to=r})(CB||={});var wB;(function(e){function t(e){if(e!=null)return e}e.from=t;function n(e){if(e!=null)return e}e.to=n})(wB||={});var TB;(function(e){function t(e){if(e){let t=e;return t&&(!!t.commandLine||!!t.command)}else return!1}e.is=t;function n(e){if(e==null)return;let t={};return e.commandLine===void 0?(t.command=e.command,t.args=e.args):t.commandLine=e.commandLine,e.options&&(t.options=wB.from(e.options)),t}e.from=n;function r(e){if(!(e==null||e.command===void 0&&e.commandLine===void 0))return e.commandLine?new cD(e.commandLine,e.options):new cD(e.command,e.args?e.args:[],e.options)}e.to=r})(TB||={});var EB;(function(e){function t(e){if(e){let t=e;return t&&t.customExecution===`customExecution`}else return!1}e.is=t;function n(e){return{customExecution:`customExecution`}}e.from=n;function r(e,t){return t.get(e)}e.to=r})(EB||={});var DB;(function(e){function t(e,t){let n;return e.scope!==void 0&&typeof e.scope!=`number`?n=e.scope.uri:e.scope!==void 0&&typeof e.scope==`number`&&(n=e.scope===uD.Workspace&&t&&t.workspaceFile?t.workspaceFile:`settings`),{id:e._id,workspaceFolder:n}}e.from=t})(DB||={});var OB;(function(e){function t(e){if(e!=null)return{_id:e.id,isDefault:e.isDefault}}e.from=t})(OB||={});var kB;(function(e){function t(e,t){if(e==null)return[];let r=[];for(let i of e){let e=n(i,t);e&&r.push(e)}return r}e.fromMany=t;function n(e,t){if(e==null)return;let n;e.execution instanceof sD?n=CB.from(e.execution):e.execution instanceof cD?n=TB.from(e.execution):e.execution&&e.execution instanceof fD&&(n=EB.from(e.execution));let r=bB.from(e.definition),i;if(i=e.scope?typeof e.scope==`number`?e.scope:e.scope.uri:uD.Workspace,!(!r||!i))return{_id:e._id,definition:r,name:e.name,source:{extensionId:t.identifier.value,label:e.source,scope:i},execution:n,isBackground:e.isBackground,group:OB.from(e.group),presentationOptions:xB.from(e.presentationOptions),problemMatchers:be(e.problemMatchers),hasDefinedMatchers:e.hasDefinedMatchers,runOptions:e.runOptions?e.runOptions:{reevaluateOnRerun:!0},detail:e.detail}}e.from=n;async function r(e,t,n){if(e==null)return;let r;CB.is(e.execution)?r=CB.to(e.execution):TB.is(e.execution)?r=TB.to(e.execution):EB.is(e.execution)&&(r=EB.to(e._id,n));let i=bB.to(e.definition),a;if(e.source&&(a=e.source.scope===void 0?uD.Workspace:typeof e.source.scope==`number`?e.source.scope:await t.resolveWorkspaceFolder(w.revive(e.source.scope))),!i||!a)return;let o=new pD(i,a,e.name,e.source.label,r,e.problemMatchers);return e.isBackground!==void 0&&(o.isBackground=e.isBackground),e.group!==void 0&&(o.group=aD.from(e.group._id),o.group&&e.group.isDefault&&(o.group=new aD(o.group.id,o.group.label),e.group.isDefault===!0&&(o.group.isDefault=e.group.isDefault))),e.presentationOptions&&(o.presentationOptions=xB.to(e.presentationOptions)),e.runOptions&&(o.runOptions=e.runOptions),e._id&&(o._id=e._id),e.detail&&(o.detail=e.detail),o}e.to=r})(kB||={});var AB;(function(e){function t(e){return e}e.from=t;function n(e){if(e)return Object.assign(Object.create(null),e)}e.to=n})(AB||={});var jB=class{#e;constructor(e,t,n){this._id=t,this._task=n,this.#e=e}get task(){return this._task}terminate(){this.#e.terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}get terminal(){return this._terminal}set terminal(e){this._terminal=e}};let MB=class{constructor(e,t,n,r,i,a,o,s){this._onDidExecuteTask=new S,this._onDidTerminateTask=new S,this._onDidTaskProcessStarted=new S,this._onDidTaskProcessEnded=new S,this._onDidStartTaskProblemMatchers=new S,this._onDidEndTaskProblemMatchers=new S,this._proxy=e.getProxy(E.MainThreadTask),this._workspaceProvider=n,this._editorService=r,this._configurationService=i,this._terminalService=a,this._handleCounter=0,this._handlers=new Map,this._taskExecutions=new Map,this._taskExecutionPromises=new Map,this._providedCustomExecutions2=new Map,this._notProvidedCustomExecutions=new Set,this._activeCustomExecutions2=new Map,this._logService=o,this._deprecationService=s,this._proxy.$registerSupportedExecutions(!0)}registerTaskProvider(e,t,n){if(!n)return new WT(()=>{});let r=this.nextHandle();return this._handlers.set(r,{type:t,provider:n,extension:e}),this._proxy.$registerTaskProvider(r,t),new WT(()=>{this._handlers.delete(r),this._proxy.$unregisterTaskProvider(r)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(AB.from(e)).then(async e=>{let t=[];for(let n of e){let e=await kB.to(n,this._workspaceProvider,this._providedCustomExecutions2);e&&t.push(e)}return t})}get taskExecutions(){let e=[];return this._taskExecutions.forEach(t=>e.push(t)),e}terminateTask(e){if(!(e instanceof jB))throw Error(`No valid task execution provided`);return this._proxy.$terminateTask(e._id)}get onDidStartTask(){return this._onDidExecuteTask.event}async $onDidStartTask(e,t,n){let r=this._providedCustomExecutions2.get(e.id);r&&(this._activeCustomExecutions2.set(e.id,r),this._terminalService.attachPtyToTerminal(t,await r.callback(n))),this._lastStartedTask=e.id;let i=await this.getTaskExecution(e),a=this._terminalService.getTerminalById(t)?.value;i&&(i.terminal=a),this._onDidExecuteTask.fire({execution:i})}get onDidEndTask(){return this._onDidTerminateTask.event}async $OnDidEndTask(e){if(!this._taskExecutionPromises.has(e.id))return;let t=await this.getTaskExecution(e);this._taskExecutionPromises.delete(e.id),this._taskExecutions.delete(e.id),this.customExecutionComplete(e),this._onDidTerminateTask.fire({execution:t})}get onDidStartTaskProcess(){return this._onDidTaskProcessStarted.event}async $onDidStartTaskProcess(e){let t=await this.getTaskExecution(e.id);this._onDidTaskProcessStarted.fire({execution:t,processId:e.processId})}get onDidEndTaskProcess(){return this._onDidTaskProcessEnded.event}async $onDidEndTaskProcess(e){let t=await this.getTaskExecution(e.id);this._onDidTaskProcessEnded.fire({execution:t,exitCode:e.exitCode})}get onDidStartTaskProblemMatchers(){return this._onDidStartTaskProblemMatchers.event}async $onDidStartTaskProblemMatchers(e){let t;try{t=await this.getTaskExecution(e.execution.id)}catch{return}this._onDidStartTaskProblemMatchers.fire({execution:t})}get onDidEndTaskProblemMatchers(){return this._onDidEndTaskProblemMatchers.event}async $onDidEndTaskProblemMatchers(e){let t;try{t=await this.getTaskExecution(e.execution.id)}catch{return}this._onDidEndTaskProblemMatchers.fire({execution:t,hasErrors:e.hasErrors})}$provideTasks(e,t){let n=this._handlers.get(e);if(!n)return Promise.reject(Error(`no handler found`));let r=[],i=go(()=>n.provider.provideTasks(Pi.None)).then(e=>this.provideTasksInternal(t,r,n,e));return new Promise(e=>{i.then(t=>{Promise.all(r).then(()=>{e(t)})})})}async $resolveTask(e,t){let n=this._handlers.get(e);if(!n)return Promise.reject(Error(`no handler found`));if(t.definition.type!==n.type)throw Error(`Unexpected: Task of type [${t.definition.type}] cannot be resolved by provider of type [${n.type}].`);let r=await kB.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!r)throw Error(`Unexpected: Task cannot be resolved.`);let i=await n.provider.resolveTask(r,Pi.None);if(!i)return;this.checkDeprecation(i,n);let a=kB.from(i,n.extension);if(!a)throw Error(`Unexpected: Task cannot be resolved.`);if(i.definition!==r.definition)throw Error(`Unexpected: The resolved task definition must be the same object as the original task definition. The task definition cannot be changed.`);return EB.is(a.execution)&&await this.addCustomExecution(a,i,!0),await this.resolveTaskInternal(a)}nextHandle(){return this._handleCounter++}async addCustomExecution(e,t,n){let r=await this._proxy.$createTaskId(e);!n&&!this._providedCustomExecutions2.has(r)&&(this._notProvidedCustomExecutions.add(r),this._activeCustomExecutions2.set(r,t.execution)),this._providedCustomExecutions2.set(r,t.execution)}async getTaskExecution(e,t){if(typeof e==`string`){let t=this._taskExecutionPromises.get(e);if(!t)throw new ie(`Unexpected: The specified task is missing an execution`);return t}let n=this._taskExecutionPromises.get(e.id);if(n)return n;let r;return r=t?Promise.resolve(new jB(this,e.id,t)):kB.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(t=>{if(!t)throw new ie(`Unexpected: Task does not exist.`);return new jB(this,e.id,t)}),this._taskExecutionPromises.set(e.id,r),r.then(t=>(this._taskExecutions.set(e.id,t),t))}checkDeprecation(e,t){e._deprecated&&this._deprecationService.report(`Task.constructor`,t.extension,"Use the Task constructor that takes a `scope` instead.")}customExecutionComplete(e){this._activeCustomExecutions2.get(e.id)&&this._activeCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.has(e.id)&&this._lastStartedTask!==e.id&&(this._providedCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.delete(e.id));let t=this._notProvidedCustomExecutions.values(),n=t.next();for(;!n.done;)!this._activeCustomExecutions2.has(n.value)&&this._lastStartedTask!==n.value&&(this._providedCustomExecutions2.delete(n.value),this._notProvidedCustomExecutions.delete(n.value)),n=t.next()}};MB=A([j(0,Hs),j(1,Fs),j(2,YP),j(3,Nz),j(4,mF),j(5,HI),j(6,Ds),j(7,ZR)],MB);let NB=class extends MB{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o,s),this.registerTaskSystem(O.vscodeRemote,{scheme:O.vscodeRemote,authority:``,platform:vn(_n.Web)})}async executeTask(e,t){if(!t.execution)throw Error(`Tasks to execute must include an execution`);let n=kB.from(t,e);if(n===void 0)throw Error(`Task is not valid`);if(EB.is(n.execution))await this.addCustomExecution(n,t,!1);else throw new re;let r=await this.getTaskExecution(await this._proxy.$getTaskExecution(n),t);return this._proxy.$executeTask(n).catch(e=>{throw Error(e)}),r}provideTasksInternal(e,t,n,r){let i=[];if(r)for(let a of r){if(this.checkDeprecation(a,n),!a.definition||!e[a.definition.type]){let e=a.source?a.source:`No task source`;this._logService.warn(`The task [${e}, ${a.name}] uses an undefined task type. The task will be ignored in the future.`)}let r=kB.from(a,n.extension);r&&EB.is(r.execution)?(i.push(r),t.push(this.addCustomExecution(r,a,!0))):this._logService.warn(`Only custom execution tasks supported.`)}return{tasks:i,extension:n.extension}}async resolveTaskInternal(e){if(EB.is(e.execution))return e;this._logService.warn(`Only custom execution tasks supported.`)}async $resolveVariables(e,t){return{process:void 0,variables:Object.create(null)}}async $jsonTasksSupported(){return!1}async $findExecutable(e,t,n){}};NB=A([j(0,Hs),j(1,Fs),j(2,YP),j(3,Nz),j(4,mF),j(5,HI),j(6,Ds),j(7,ZR)],NB);const PB=k(`IExtHostTask`);var FB=class{constructor(){this.pendingRequests=new Map,this.pendingRequestTimers=new Map,this.queue=[],this._onError=new S,this._onExit=new S,this.sequence=1}get onError(){return this._onError.event}get onExit(){return this._onExit.event}onMessage(e){this.messageCallback&&this._onError.fire(Error(`attempt to set more than one 'Message' callback`)),this.messageCallback=e}onEvent(e){this.eventCallback&&this._onError.fire(Error(`attempt to set more than one 'Event' callback`)),this.eventCallback=e}onRequest(e){this.requestCallback&&this._onError.fire(Error(`attempt to set more than one 'Request' callback`)),this.requestCallback=e}sendResponse(e){e.seq>0?this._onError.fire(Error(`attempt to send more than one response for command ${e.command}`)):this.internalSend(`response`,e)}sendRequest(e,t,n,r){let i={command:e};if(t&&Object.keys(t).length>0&&(i.arguments=t),this.internalSend(`request`,i),typeof r==`number`){let t=setTimeout(()=>{this.pendingRequestTimers.delete(i.seq);let t=this.pendingRequests.get(i.seq);t&&(this.pendingRequests.delete(i.seq),t({type:`response`,seq:0,request_seq:i.seq,success:!1,command:e,message:x(9373,`Timeout after {0} ms for '{1}'`,r,e)}))},r);this.pendingRequestTimers.set(i.seq,t)}return n&&this.pendingRequests.set(i.seq,n),i.seq}acceptMessage(e){this.messageCallback?this.messageCallback(e):(this.queue.push(e),this.queue.length===1&&this.processQueue())}needsTaskBoundaryBetween(e,t){return e.type!==`event`||t.type!==`event`}async processQueue(){let e;for(;this.queue.length;){if((!e||this.needsTaskBoundaryBetween(this.queue[0],e))&&await Eo(0),e=this.queue.shift(),!e)return;switch(e.type){case`event`:this.eventCallback?.(e);break;case`request`:this.requestCallback?.(e);break;case`response`:{let t=e,n=this.pendingRequests.get(t.request_seq);n&&(this.pendingRequests.delete(t.request_seq),this.clearPendingRequestTimer(t.request_seq),n(t));break}}}}internalSend(e,t){t.type=e,t.seq=this.sequence++,this.sendMessage(t)}async cancelPendingRequests(){if(this.pendingRequests.size===0)return Promise.resolve();let e=new Map;this.pendingRequests.forEach((t,n)=>e.set(n,t)),await Eo(500),e.forEach((e,t)=>{e({type:`response`,seq:0,request_seq:t,success:!1,command:`canceled`,message:`canceled`}),this.pendingRequests.delete(t),this.clearPendingRequestTimer(t)})}clearPendingRequestTimer(e){clearTimeout(this.pendingRequestTimers.get(e)),this.pendingRequestTimers.delete(e)}getPendingRequestIds(){return Array.from(this.pendingRequests.keys())}dispose(){for(let e of this.pendingRequestTimers.values())clearTimeout(e);this.pendingRequestTimers.clear(),this._onError.dispose(),this._onExit.dispose(),this.queue=[]}};function IB(e){return e.type&&(e.label||e.program||e.runtime)}const LB=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function RB(e){return!!(e&&e.match(LB))}function zB(e){if(typeof e.path==`string`&&!(typeof e.sourceReference==`number`&&e.sourceReference>0)){if(RB(e.path))return w.parse(e.path);if(Vr(e.path))return w.file(e.path)}return e.path}function BB(e){if(typeof e.path==`object`){let t=w.revive(e.path);if(t)return t.scheme===O.file?t.fsPath:t.toString()}return e.path}function VB(e,t){let n=t?zB:BB,r=tc(e);return UB(r,(e,t)=>{e&&t&&(t.path=n(t))}),r}function HB(e,t){let n=t?zB:BB,r=tc(e);return UB(r,(e,t)=>{!e&&t&&(t.path=n(t))}),r}function UB(e,t){switch(e.type){case`event`:{let n=e;switch(n.event){case`output`:t(!1,n.body.source);break;case`loadedSource`:t(!1,n.body.source);break;case`breakpoint`:t(!1,n.body.breakpoint.source);break}break}case`request`:{let n=e;switch(n.command){case`setBreakpoints`:t(!0,n.arguments.source);break;case`breakpointLocations`:t(!0,n.arguments.source);break;case`source`:t(!0,n.arguments.source);break;case`gotoTargets`:t(!0,n.arguments.source);break;case`launchVSCode`:n.arguments.args.forEach(e=>t(!1,e));break}break}case`response`:{let n=e;if(n.success&&n.body)switch(n.command){case`stackTrace`:n.body.stackFrames.forEach(e=>t(!1,e.source));break;case`loadedSources`:n.body.sources.forEach(e=>t(!1,e));break;case`scopes`:n.body.scopes.forEach(e=>t(!1,e.source));break;case`setFunctionBreakpoints`:n.body.breakpoints.forEach(e=>t(!1,e.source));break;case`setBreakpoints`:n.body.breakpoints.forEach(e=>t(!1,e.source));break;case`disassemble`:n.body?.instructions.forEach(e=>t(!1,e.location));break;case`locations`:t(!1,n.body?.source);break}break}}}const WB=k(`IExtHostEditorTabs`);var GB=class{constructor(e,t,n){this._activeTabIdGetter=n,this._parentGroup=t,this.acceptDtoUpdate(e)}get apiObject(){if(!this._apiObject){let e=this;this._apiObject=Object.freeze({get isActive(){return e._dto.id===e._activeTabIdGetter()},get label(){return e._dto.label},get input(){return e._input},get isDirty(){return e._dto.isDirty},get isPinned(){return e._dto.isPinned},get isPreview(){return e._dto.isPreview},get group(){return e._parentGroup.apiObject}})}return this._apiObject}get tabId(){return this._dto.id}acceptDtoUpdate(e){this._dto=e,this._input=this._initInput()}_initInput(){switch(this._dto.input.kind){case yi.TextInput:return new ak(w.revive(this._dto.input.uri));case yi.TextDiffInput:return new ok(w.revive(this._dto.input.original),w.revive(this._dto.input.modified));case yi.TextMergeInput:return new sk(w.revive(this._dto.input.base),w.revive(this._dto.input.input1),w.revive(this._dto.input.input2),w.revive(this._dto.input.result));case yi.CustomEditorInput:return new ck(w.revive(this._dto.input.uri),this._dto.input.viewType);case yi.WebviewEditorInput:return new lk(this._dto.input.viewType);case yi.NotebookInput:return new uk(w.revive(this._dto.input.uri),this._dto.input.notebookType);case yi.NotebookDiffInput:return new dk(w.revive(this._dto.input.original),w.revive(this._dto.input.modified),this._dto.input.notebookType);case yi.TerminalEditorInput:return new fk;case yi.InteractiveEditorInput:return new pk(w.revive(this._dto.input.uri),w.revive(this._dto.input.inputBoxUri));case yi.ChatEditorInput:return new mk;case yi.MultiDiffEditorInput:return new hk(this._dto.input.diffEditors.map(e=>new ok(w.revive(e.original),w.revive(e.modified))));default:return}}},KB=class{constructor(e,t){this._tabs=[],this._activeTabId=``,this._dto=e,this._activeGroupIdGetter=t;for(let t of e.tabs)t.isActive&&(this._activeTabId=t.id),this._tabs.push(new GB(t,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){let e=this;this._apiObject=Object.freeze({get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return pj.to(e._dto.viewColumn)},get activeTab(){return e._tabs.find(t=>t.tabId===e._activeTabId)?.apiObject},get tabs(){return Object.freeze(e._tabs.map(e=>e.apiObject))}})}return this._apiObject}get groupId(){return this._dto.groupId}get tabs(){return this._tabs}acceptGroupDtoUpdate(e){this._dto=e}acceptTabOperation(e){if(e.kind===bi.TAB_OPEN){let t=new GB(e.tabDto,this,()=>this.activeTabId());return this._tabs.splice(e.index,0,t),e.tabDto.isActive&&(this._activeTabId=t.tabId),t}else if(e.kind===bi.TAB_CLOSE){let t=this._tabs.splice(e.index,1)[0];if(!t)throw Error(`Tab close updated received for index ${e.index} which does not exist`);return t.tabId===this._activeTabId&&(this._activeTabId=``),t}else if(e.kind===bi.TAB_MOVE){if(e.oldIndex===void 0)throw Error(`Invalid old index on move IPC`);let t=this._tabs.splice(e.oldIndex,1)[0];if(!t)throw Error(`Tab move updated received for index ${e.oldIndex} which does not exist`);return this._tabs.splice(e.index,0,t),t}let t=this._tabs.find(t=>t.tabId===e.tabDto.id);if(!t)throw Error(`INVALID tab`);return e.tabDto.isActive?this._activeTabId=e.tabDto.id:this._activeTabId===e.tabDto.id&&!e.tabDto.isActive&&(this._activeTabId=``),t.acceptDtoUpdate(e.tabDto),t}activeTabId(){return this._activeTabId}};let qB=class{constructor(e){this._onDidChangeTabs=new S,this._onDidChangeTabGroups=new S,this._extHostTabGroups=[],this._proxy=e.getProxy(E.MainThreadEditorTabs)}get tabGroups(){if(!this._apiObject){let e=this,t={onDidChangeTabGroups:e._onDidChangeTabGroups.event,onDidChangeTabs:e._onDidChangeTabs.event,get all(){return Object.freeze(e._extHostTabGroups.map(e=>e.apiObject))},get activeTabGroup(){let t=e._activeGroupId;return nt(e._extHostTabGroups.find(e=>e.groupId===t)?.apiObject)},close:async(e,t)=>{let n=Array.isArray(e)?e:[e];return n.length?JB(n[0])?this._closeGroups(n,t):this._closeTabs(n,t):!0}};this._apiObject=Object.freeze(t)}return this._apiObject}$acceptEditorTabModel(e){let t=Ee(new Set(this._extHostTabGroups.map(e=>e.groupId)),new Set(e.map(e=>e.groupId))),n=this._extHostTabGroups.filter(e=>t.removed.includes(e.groupId)).map(e=>e.apiObject),r=[],i=[];this._extHostTabGroups=e.map(e=>{let n=new KB(e,()=>this._activeGroupId);return t.added.includes(n.groupId)?r.push(n.apiObject):i.push(n.apiObject),n});let a=nt(e.find(e=>e.isActive===!0)?.groupId);a!==void 0&&this._activeGroupId!==a&&(this._activeGroupId=a),this._onDidChangeTabGroups.fire(Object.freeze({opened:r,closed:n,changed:i}))}$acceptTabGroupUpdate(e){let t=this._extHostTabGroups.find(t=>t.groupId===e.groupId);if(!t)throw Error(`Update Group IPC call received before group creation.`);t.acceptGroupDtoUpdate(e),e.isActive&&(this._activeGroupId=e.groupId),this._onDidChangeTabGroups.fire(Object.freeze({changed:[t.apiObject],opened:[],closed:[]}))}$acceptTabOperation(e){let t=this._extHostTabGroups.find(t=>t.groupId===e.groupId);if(!t)throw Error(`Update Tabs IPC call received before group creation.`);let n=t.acceptTabOperation(e);switch(e.kind){case bi.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[n.apiObject],closed:[],changed:[]}));return;case bi.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[n.apiObject],changed:[]}));return;case bi.TAB_MOVE:case bi.TAB_UPDATE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[],changed:[n.apiObject]}));return}}_findExtHostTabFromApi(e){for(let t of this._extHostTabGroups)for(let n of t.tabs)if(n.apiObject===e)return n}_findExtHostTabGroupFromApi(e){return this._extHostTabGroups.find(t=>t.apiObject===e)}async _closeTabs(e,t){let n=[];for(let t of e){let e=this._findExtHostTabFromApi(t);if(!e)throw Error(`Tab close: Invalid tab not found!`);n.push(e.tabId)}return this._proxy.$closeTab(n,t)}async _closeGroups(e,t){let n=[];for(let t of e){let e=this._findExtHostTabGroupFromApi(t);if(!e)throw Error(`Group close: Invalid group not found!`);n.push(e.groupId)}return this._proxy.$closeGroup(n,t)}};qB=A([j(0,Hs)],qB);function JB(e){return e.tabs!==void 0}var YB;(function(e){e.ViewletId=`workbench.view.extension.test`,e.ExplorerViewId=`workbench.view.testing`,e.OutputPeekContributionId=`editor.contrib.testingOutputPeek`,e.DecorationsContributionId=`editor.contrib.testingDecorations`,e.CoverageDecorationsContributionId=`editor.contrib.coverageDecorations`,e.CoverageViewId=`workbench.view.testCoverage`,e.ResultsPanelId=`workbench.panel.testResults`,e.ResultsViewId=`workbench.panel.testResults.view`,e.MessageLanguageId=`vscodeInternalTestMessage`})(YB||={});var XB;(function(e){e.List=`list`,e.Tree=`true`})(XB||={});var ZB;(function(e){e.ByLocation=`location`,e.ByStatus=`status`,e.ByDuration=`duration`})(ZB||={}),OC.Errored,x(15472,`Errored`),OC.Failed,x(15473,`Failed`),OC.Passed,x(15474,`Passed`),OC.Queued,x(15475,`Queued`),OC.Running,x(15476,`Running`),OC.Skipped,x(15477,`Skipped`),OC.Unset,x(15478,`Not yet run`),jC.Debug,x(15480,`Debug`),jC.Run,x(15481,`Run`),jC.Coverage,x(15482,`Coverage`);var QB;(function(e){e.CancelTestRefreshAction=`testing.cancelTestRefresh`,e.CancelTestRunAction=`testing.cancelRun`,e.ClearTestResultsAction=`testing.clearTestResults`,e.CollapseAllAction=`testing.collapseAll`,e.ConfigureTestProfilesAction=`testing.configureProfile`,e.ContinousRunUsingForTest=`testing.continuousRunUsingForTest`,e.CoverageAtCursor=`testing.coverageAtCursor`,e.CoverageByUri=`testing.coverage.uri`,e.CoverageClear=`testing.coverage.close`,e.CoverageCurrentFile=`testing.coverageCurrentFile`,e.CoverageFilterToTest=`testing.coverageFilterToTest`,e.CoverageFilterToTestInEditor=`testing.coverageFilterToTestInEditor`,e.CoverageGoToNextMissedLine=`testing.coverage.goToNextMissedLine`,e.CoverageGoToPreviousMissedLine=`testing.coverage.goToPreviousMissedLine`,e.CoverageLastRun=`testing.coverageLastRun`,e.CoverageSelectedAction=`testing.coverageSelected`,e.CoverageToggleInExplorer=`testing.toggleCoverageInExplorer`,e.CoverageToggleToolbar=`testing.coverageToggleToolbar`,e.CoverageViewChangeSorting=`testing.coverageViewChangeSorting`,e.CoverageViewCollapseAll=`testing.coverageViewCollapseAll`,e.DebugAction=`testing.debug`,e.DebugAllAction=`testing.debugAll`,e.DebugAtCursor=`testing.debugAtCursor`,e.DebugByUri=`testing.debug.uri`,e.DebugCurrentFile=`testing.debugCurrentFile`,e.DebugFailedTests=`testing.debugFailTests`,e.DebugFailedFromLastRun=`testing.debugFailedFromLastRun`,e.DebugLastRun=`testing.debugLastRun`,e.DebugSelectedAction=`testing.debugSelected`,e.FilterAction=`workbench.actions.treeView.testExplorer.filter`,e.GetExplorerSelection=`_testing.getExplorerSelection`,e.GetSelectedProfiles=`testing.getSelectedProfiles`,e.GoToTest=`testing.editFocusedTest`,e.GoToRelatedTest=`testing.goToRelatedTest`,e.PeekRelatedTest=`testing.peekRelatedTest`,e.GoToRelatedCode=`testing.goToRelatedCode`,e.PeekRelatedCode=`testing.peekRelatedCode`,e.HideTestAction=`testing.hideTest`,e.OpenCoverage=`testing.openCoverage`,e.OpenOutputPeek=`testing.openOutputPeek`,e.RefreshTestsAction=`testing.refreshTests`,e.ReRunFailedTests=`testing.reRunFailTests`,e.ReRunFailedFromLastRun=`testing.reRunFailedFromLastRun`,e.ReRunLastRun=`testing.reRunLastRun`,e.RunAction=`testing.run`,e.RunAllAction=`testing.runAll`,e.RunAllWithCoverageAction=`testing.coverageAll`,e.RunAtCursor=`testing.runAtCursor`,e.RunByUri=`testing.run.uri`,e.RunCurrentFile=`testing.runCurrentFile`,e.RunSelectedAction=`testing.runSelected`,e.RunUsingProfileAction=`testing.runUsing`,e.RunWithCoverageAction=`testing.coverage`,e.SearchForTestExtension=`testing.searchForTestExtension`,e.SelectDefaultTestProfiles=`testing.selectDefaultTestProfiles`,e.ShowMostRecentOutputAction=`testing.showMostRecentOutput`,e.StartContinousRun=`testing.startContinuousRun`,e.StartContinousRunFromExtension=`testing.startContinuousRunFromExtension`,e.StopContinousRunFromExtension=`testing.stopContinuousRunFromExtension`,e.StopContinousRun=`testing.stopContinuousRun`,e.TestingSortByDurationAction=`testing.sortByDuration`,e.TestingSortByLocationAction=`testing.sortByLocation`,e.TestingSortByStatusAction=`testing.sortByStatus`,e.TestingViewAsListAction=`testing.viewAsList`,e.TestingViewAsTreeAction=`testing.viewAsTree`,e.ToggleContinousRunForTest=`testing.toggleContinuousRunForTest`,e.ToggleResultsViewLayoutAction=`testing.toggleResultsViewLayout`,e.ToggleInlineTestOutput=`testing.toggleInlineTestOutput`,e.UnhideAllTestsAction=`testing.unhideAllTests`,e.UnhideTestAction=`testing.unhideTest`})(QB||={});let $B=0;const eV=new WeakMap,tV=k(`IExtHostTesting`);let nV=class extends y{constructor(e,t,n,r){super(),this.logService=t,this.commands=n,this.editors=r,this.resultsChangedEmitter=this._register(new S),this.controllers=new Map,this.defaultProfilesChangedEmitter=this._register(new S),this.followupProviders=new Set,this.testFollowups=new Map,this.onResultsChanged=this.resultsChangedEmitter.event,this.results=[],this.proxy=e.getProxy(E.MainThreadTesting),this.observer=new uV(this.proxy),this.runTracker=new aV(this.proxy,t),n.registerArgumentProcessor({processArgument:e=>{switch(e?.$mid){case Er.TestItemContext:{let t=e,n=t.tests[t.tests.length-1].item.extId;return this.controllers.get(DC.root(n))?.collection.tree.get(n)?.actual??kI(e)}case Er.TestMessageMenuArgs:{let{test:t,message:n}=e,r=t.item.extId;return{test:this.controllers.get(DC.root(r))?.collection.tree.get(r)?.actual??kI({tests:[t]}),message:SM.to(n)}}default:return e}}}),n.registerCommand(!1,`testing.getExplorerSelection`,async()=>{let e=await n.executeCommand(QB.GetExplorerSelection),t=e=>{let t=this.controllers.get(DC.root(e));if(t)return DC.isRoot(e)?t.controller:t.collection.tree.get(e)?.actual};return{include:e?.include.map(t).filter($e)||[],exclude:e?.exclude.map(t).filter($e)||[]}})}createTestController(e,t,n,r){if(this.controllers.has(t))throw Error(`Attempt to insert a duplicate controller with ID "${t}"`);let i=new v,a=i.add(new MI(t,n,this.editors));a.root.label=n;let o=new Map,s=new Set,c=this.proxy,l=()=>{let e=0;r&&(e|=AC.Refresh);let t=d.relatedCodeProvider;return t&&(t?.provideRelatedTests&&(e|=AC.TestRelatedToCode),t?.provideRelatedCode&&(e|=AC.CodeRelatedToTest)),e},u={items:a.root.children,get label(){return n},set label(e){n=e,a.root.label=e,c.$updateController(t,{label:n})},get refreshHandler(){return r},set refreshHandler(e){r=e,c.$updateController(t,{capabilities:l()})},get id(){return t},get relatedCodeProvider(){return d.relatedCodeProvider},set relatedCodeProvider(n){K(e,`testRelatedCode`),d.relatedCodeProvider=n,c.$updateController(t,{capabilities:l()})},createRunProfile:(e,n,r,i,a,c)=>{let l=Th(e);for(;o.has(l);)l++;return new fV(this.proxy,o,s,this.defaultProfilesChangedEmitter.event,t,l,e,n,r,i,a,c)},createTestItem(e,n,r){return new AI(t,e,n,r)},createTestRun:(n,r,i=!0)=>this.runTracker.createTestRun(e,t,a,n,r,i),invalidateTestResults:e=>{if(e===void 0)this.proxy.$markTestRetired(void 0);else{let n=e instanceof Array?e:[e];this.proxy.$markTestRetired(n.map(e=>DC.fromExtHostTestItem(e,t).toString()))}},set resolveHandler(e){a.resolveHandler=e},get resolveHandler(){return a.resolveHandler},dispose:()=>{i.dispose()}},d={controller:u,collection:a,profiles:o,extension:e,activeProfiles:s};return c.$registerTestController(t,n,l()),i.add(_(()=>c.$unregisterTestController(t))),this.controllers.set(t,d),i.add(_(()=>this.controllers.delete(t))),i.add(a.onDidGenerateDiff(e=>c.$publishDiff(t,e.map(iw.serialize)))),u}createTestObserver(){return this.observer.checkout()}async runTests(e,t=Pi.None){let n=oV(e);if(!n)throw Error("The request passed to `vscode.test.runTests` must include a profile");let r=this.controllers.get(n.controllerId);if(!r)throw Error(`Controller not found`);await this.proxy.$runTests({preserveFocus:e.preserveFocus??!0,group:TM.from(n.kind),targets:[{testIds:e.include?.map(e=>DC.fromExtHostTestItem(e,r.collection.root.id).toString())??[r.collection.root.id],profileId:n.profileId,controllerId:n.controllerId}],exclude:e.exclude?.map(e=>e.id)},t)}registerTestFollowupProvider(e){return this.followupProviders.add(e),{dispose:()=>{this.followupProviders.delete(e)}}}async $getTestsRelatedToCode(e,t,n){let r=this.editors.getDocument(w.revive(e));if(!r)return[];let i=sj.to(t),a=[];return await Promise.all([...this.controllers.values()].map(async e=>{let t;try{t=await e.relatedCodeProvider?.provideRelatedTests?.(r.document,i,n)}catch(t){n.isCancellationRequested||this.logService.warn(`Error thrown while providing related tests for ${e.controller.label}`,t)}if(t){for(let n of t)a.push(DC.fromExtHostTestItem(n,e.controller.id).toString());e.collection.flushDiff()}})),a}async $getCodeRelatedToTest(e,t){let n=this.controllers.get(DC.root(e));if(!n)return[];let r=n.collection.tree.get(e);return r?(await n.relatedCodeProvider?.provideRelatedCode?.(r.actual,t))?.map(jj.from)??[]:[]}$syncTests(){for(let{collection:e}of this.controllers.values())e.flushDiff();return Promise.resolve()}async $getCoverageDetails(e,t,n){return(await this.runTracker.getCoverageDetails(e,t,n))?.map(OM.fromDetails)}async $disposeRun(e){this.runTracker.disposeTestRun(e)}$configureRunProfile(e,t){this.controllers.get(e)?.profiles.get(t)?.configureHandler?.()}$setDefaultRunProfiles(e){let t=new Map;for(let[n,r]of Object.entries(e)){let e=this.controllers.get(n);if(!e)continue;let i=new Map,a=r.filter(t=>!e.activeProfiles.has(t)),o=[...e.activeProfiles].filter(e=>!r.includes(e));for(let t of a)i.set(t,!0),e.activeProfiles.add(t);for(let t of o)i.set(t,!1),e.activeProfiles.delete(t);i.size&&t.set(n,i)}this.defaultProfilesChangedEmitter.fire(t)}async $refreshTests(e,t){await this.controllers.get(e)?.controller.refreshHandler?.(t)}$publishTestResults(e){this.results=Object.freeze(e.map(e=>{let t=DM.to(e),n=e.tasks.findIndex(e=>e.hasCoverage);return n!==-1&&(t.getDetailedCoverage=(t,r=Pi.None)=>this.proxy.$getCoverageDetails(e.id,n,t,r).then(e=>e.map(OM.to))),eV.set(t,e.id),t}).concat(this.results).sort((e,t)=>t.completedAt-e.completedAt).slice(0,32)),this.resultsChangedEmitter.fire()}async $expandTest(e,t){let n=this.controllers.get(DC.fromString(e).controllerId)?.collection;n&&(await n.expand(e,t<0?1/0:t),n.flushDiff())}$acceptDiff(e){this.observer.applyDiff(e.map(e=>iw.deserialize({asCanonicalUri:e=>e},e)))}async $runControllerTests(e,t){return Promise.all(e.map(e=>this.runControllerTestRequest(e,!1,t)))}async $startContinuousRun(e,t){let n=new Ii(t),r=await Promise.all(e.map(e=>this.runControllerTestRequest(e,!0,n.token)));return!t.isCancellationRequested&&!r.some(e=>e.error)&&await new Promise(e=>t.onCancellationRequested(e)),n.dispose(!0),r}async $provideTestFollowups(e,t){let n=this.results.find(t=>eV.get(t)===e.resultId),r=n&&pV(DC.fromString(e.extId),n?.results);if(!r)return[];let i=[];return await Promise.all([...this.followupProviders].map(async a=>{try{let o=await a.provideFollowup(n,r,e.taskIndex,e.messageIndex,t);o&&(i=i.concat(o))}catch(e){this.logService.error(`Error thrown while providing followup for test message`,e)}})),t.isCancellationRequested?[]:i.map(e=>{let t=$B++;return this.testFollowups.set(t,e),{title:e.title,id:t}})}$disposeTestFollowups(e){for(let t of e)this.testFollowups.delete(t)}$executeTestFollowup(e){let t=this.testFollowups.get(e);return t?this.commands.executeCommand(t.command,...t.arguments||[]):Promise.resolve()}$cancelExtensionTestRun(e,t){e===void 0?this.runTracker.cancelAllRuns():this.runTracker.cancelRunById(e,t)}getMetadataForRun(e){for(let t of this.runTracker.trackers){let n=t.getTaskIdForRun(e);if(n)return{taskId:n,runId:t.id}}}async runControllerTestRequest(e,t,n){let r=this.controllers.get(e.controllerId);if(!r)return{};let{collection:i,profiles:a,extension:o}=r,s=a.get(e.profileId);if(!s)return{};let c=e.testIds.map(e=>i.tree.get(e)).filter($e),l=e.excludeExtIds.map(e=>r.collection.tree.get(e)).filter($e).filter(e=>c.some(t=>t.fullId.compare(e.fullId)===EC.IsChild));if(!c.length)return{};let u=new GO(c.some(e=>e.actual instanceof jI)?void 0:c.map(e=>e.actual),l.map(e=>e.actual),s,t),d=MC(e)&&this.runTracker.prepareForMainThreadTestRun(o,u,sV.fromInternal(e,r.collection),s,n);try{return await s.runHandler(u,n),{}}catch(e){return{error:String(e)}}finally{d&&d.hasRunningTasks&&!n.isCancellationRequested&&await Qn.toPromise(d.onEnd)}}};nV=A([j(0,Hs),j(1,Ds),j(2,RI),j(3,Nz)],nV);var rV;(function(e){e[e.Running=0]=`Running`,e[e.Cancelling=1]=`Cancelling`,e[e.Ended=2]=`Ended`})(rV||={});var iV=class extends y{get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}constructor(e,t,n,r,i,a){super(),this.dto=e,this.proxy=t,this.logService=n,this.profile=r,this.extension=i,this.state=rV.Running,this.running=0,this.tasks=new Map,this.sharedTestIds=new Set,this.endEmitter=this._register(new S),this.publishedCoverage=new Map,this.onEnd=this.endEmitter.event,this.cts=this._register(new Ii(a));let o=this._register(new Mo(()=>this.forciblyEndTasks(),1e4));this._register(this.cts.token.onCancellationRequested(()=>o.schedule()));let s=new S;this.onDidDispose=s.event,this._register(_(()=>{s.fire(),s.dispose()}))}getTaskIdForRun(e){for(let[t,{run:n}]of this.tasks)if(n===e)return t}cancel(e){e?this.tasks.get(e)?.cts.cancel():this.state===rV.Running?(this.cts.cancel(),this.state=rV.Cancelling):this.state===rV.Cancelling&&this.forciblyEndTasks()}async getCoverageDetails(e,t,n){let[,r]=DC.fromString(e).path,i=this.publishedCoverage.get(e);if(!i)return[];let{report:a,extIds:o}=i,s=this.tasks.get(r);if(!s)throw Error(`unreachable: run task was not found`);let c;if(t&&a instanceof ZO){let e=o.indexOf(t);if(e===-1)return[];c=a.includesTests[e]}return await(c?this.profile?.loadDetailedCoverageForTest?.(s.run,a,c,n):this.profile?.loadDetailedCoverage?.(s.run,a,n))??[]}createRun(e){let t=this.dto.id,n=this.dto.controllerId,r=zc(),i=e=>(t,...n)=>{if(o){this.logService.warn(`Setting the state of test "${t.id}" is a no-op after the run ends.`);return}this.ensureTestIsKnown(t),e(t,...n)},a=(e,i)=>{let a=i instanceof Array?i.map(SM.from):[SM.from(i)];if(e.uri&&e.range){let t={range:J.from(e.range),uri:e.uri};for(let e of a)e.location=e.location||t}this.proxy.$appendTestMessagesInRun(t,r,DC.fromExtHostTestItem(e,n).toString(),a)},o=!1,s=this._register(new Ii(this.cts.token)),c={isPersisted:this.dto.isPersisted,token:s.token,name:e,onDidDispose:this.onDidDispose,addCoverage:e=>{if(o)return;let i=e instanceof ZO?e.includesTests:[];if(i.length)for(let e of i)this.ensureTestIsKnown(e);let a=new DC([t,r,e.uri.toString()]).toString();this.publishedCoverage.set(a,{report:e,extIds:i.map(e=>DC.fromExtHostTestItem(e,n).toString())}),this.proxy.$appendCoverage(t,r,OM.fromFile(n,a,e))},enqueued:i(e=>{this.proxy.$updateTestStateInRun(t,r,DC.fromExtHostTestItem(e,n).toString(),OC.Queued)}),skipped:i(e=>{this.proxy.$updateTestStateInRun(t,r,DC.fromExtHostTestItem(e,n).toString(),OC.Skipped)}),started:i(e=>{this.proxy.$updateTestStateInRun(t,r,DC.fromExtHostTestItem(e,n).toString(),OC.Running)}),errored:i((e,i,o)=>{a(e,i),this.proxy.$updateTestStateInRun(t,r,DC.fromExtHostTestItem(e,n).toString(),OC.Errored,o)}),failed:i((e,i,o)=>{a(e,i),this.proxy.$updateTestStateInRun(t,r,DC.fromExtHostTestItem(e,n).toString(),OC.Failed,o)}),passed:i((e,n)=>{this.proxy.$updateTestStateInRun(t,r,DC.fromExtHostTestItem(e,this.dto.controllerId).toString(),OC.Passed,n)}),appendOutput:(e,i,a)=>{o||(a&&this.ensureTestIsKnown(a),this.proxy.$appendOutputToRun(t,r,b.fromString(e),i&&jj.from(i),a&&DC.fromExtHostTestItem(a,n).toString()))},end:()=>{o||(o=!0,this.proxy.$finishedTestRunTask(t,r),--this.running||this.markEnded())}};return this.running++,this.tasks.set(r,{run:c,cts:s}),this.proxy.$startedTestRunTask(t,{id:r,ctrlId:this.dto.controllerId,name:e||this.extension.displayName||this.extension.identifier.value,running:!0}),c}forciblyEndTasks(){for(let{run:e}of this.tasks.values())e.end()}markEnded(){this.state!==rV.Ended&&(this.state=rV.Ended,this.endEmitter.fire())}ensureTestIsKnown(e){if(!(e instanceof AI))throw new Fw(e.id);if(this.sharedTestIds.has(DC.fromExtHostTestItem(e,this.dto.controllerId).toString()))return;let t=[],n=this.dto.colllection.root;for(;;){let r=EM.from(e);if(t.unshift(r),this.sharedTestIds.has(r.extId)||(this.sharedTestIds.add(r.extId),e===n))break;e=e.parent||n}this.proxy.$addTestsToRun(this.dto.controllerId,this.dto.id,t)}dispose(){this.markEnded(),super.dispose()}},aV=class{get trackers(){return this.tracked.values()}constructor(e,t){this.proxy=e,this.logService=t,this.tracked=new Map,this.trackedById=new Map}getCoverageDetails(e,t,n){let r=DC.root(e);return this.trackedById.get(r)?.getCoverageDetails(e,t,n)||[]}disposeTestRun(e){this.trackedById.get(e)?.dispose(),this.trackedById.delete(e);for(let[t,{id:n}]of this.tracked)n===e&&this.tracked.delete(t)}prepareForMainThreadTestRun(e,t,n,r,i){return this.getTracker(t,n,r,e,i)}cancelRunById(e,t){this.trackedById.get(e)?.cancel(t)}cancelAllRuns(){for(let e of this.tracked.values())e.cancel()}createTestRun(e,t,n,r,i,a){let o=this.tracked.get(r);if(o)return o.createRun(i);let s=sV.fromPublic(t,n,r,a),c=oV(r);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!r.continuous,profile:c&&{group:TM.from(c.kind),id:c.profileId},exclude:r.exclude?.map(e=>DC.fromExtHostTestItem(e,n.root.id).toString())??[],id:s.id,include:r.include?.map(e=>DC.fromExtHostTestItem(e,n.root.id).toString())??[n.root.id],preserveFocus:r.preserveFocus??!0,persist:a});let l=this.getTracker(r,s,r.profile,e);return Qn.once(l.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(s.id)}),l.createRun(i)}getTracker(e,t,n,r,i){let a=new iV(t,this.proxy,this.logService,n,r,i);return this.tracked.set(e,a),this.trackedById.set(a.id,a),a}};const oV=e=>{if(e.profile){if(!(e.profile instanceof fV))throw Error(`TestRunRequest.profile is not an instance created from TestController.createRunProfile`);return e.profile}};var sV=class e{static fromPublic(t,n,r,i){return new e(t,zc(),i,n)}static fromInternal(t,n){return new e(t.controllerId,t.runId,!0,n)}constructor(e,t,n,r){this.controllerId=e,this.id=t,this.isPersisted=n,this.colllection=r}},cV=class{get isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}constructor(e){this.emitter=e,this.added=new Set,this.updated=new Set,this.removed=new Set,this.alreadyRemoved=new Set}add(e){this.added.add(e)}update(e){Object.assign(e.revived,EM.toPlain(e.item)),this.added.has(e)||this.updated.add(e)}remove(e){if(this.added.delete(e))return;this.updated.delete(e);let t=DC.parentId(e.item.extId);if(t&&this.alreadyRemoved.has(t.toString())){this.alreadyRemoved.add(e.item.extId);return}this.removed.add(e)}getChangeEvent(){let{added:e,updated:t,removed:n}=this;return{get added(){return[...e].map(e=>e.revived)},get updated(){return[...t].map(e=>e.revived)},get removed(){return[...n].map(e=>e.revived)}}}complete(){this.isEmpty||this.emitter.fire(this.getChangeEvent())}},lV=class extends aw{constructor(){super(...arguments),this.changeEmitter=new S,this.onDidChangeTests=this.changeEmitter.event}get rootTests(){return this.roots}getMirroredTestDataById(e){return this.items.get(e)}getMirroredTestDataByReference(e){return this.items.get(e.id)}createItem(e,t){return{...e,revived:EM.toPlain(e.item),depth:t?t.depth+1:0,children:new Set}}createChangeCollector(){return new cV(this.changeEmitter)}},uV=class{constructor(e){this.proxy=e}checkout(){this.current||=this.createObserverData();let e=this.current;return e.observers++,{onDidChangeTest:e.tests.onDidChangeTests,get tests(){return[...e.tests.rootTests].map(e=>e.revived)},dispose:Be(()=>{--e.observers===0&&(this.proxy.$unsubscribeFromDiffs(),this.current=void 0)})}}getMirroredTestDataByReference(e){return this.current?.tests.getMirroredTestDataByReference(e)}applyDiff(e){this.current?.tests.apply(e)}createObserverData(){let e=new lV({asCanonicalUri:e=>e});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}};const dV=(e,t,n,r)=>{n?Object.assign(n,r):t.$updateTestRunConfig(e.controllerId,e.profileId,r)};var fV=class extends WO{#e;#t;#n;#r;#i;get label(){return this._label}set label(e){e!==this._label&&(this._label=e,dV(this,this.#e,this.#r,{label:e}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(e){e!==this._supportsContinuousRun&&(this._supportsContinuousRun=e,dV(this,this.#e,this.#r,{supportsContinuousRun:e}))}get isDefault(){return this.#t.has(this.profileId)}set isDefault(e){e!==this.isDefault&&(e?this.#t.add(this.profileId):this.#t.delete(this.profileId),dV(this,this.#e,this.#r,{isDefault:e}))}get tag(){return this._tag}set tag(e){e?.id!==this._tag?.id&&(this._tag=e,dV(this,this.#e,this.#r,{tag:e?CM.namespace(this.controllerId,e.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(e){e!==this._configureHandler&&(this._configureHandler=e,dV(this,this.#e,this.#r,{hasConfigurationHandler:!!e}))}get onDidChangeDefault(){return Qn.chain(this.#n,e=>e.map(e=>e.get(this.controllerId)?.get(this.profileId)).filter($e))}constructor(e,t,n,r,i,a,o,s,c,l=!1,u=void 0,d=!1){super(i,a,s),this._label=o,this.runHandler=c,this._tag=u,this._supportsContinuousRun=d,this.#e=e,this.#i=t,this.#t=n,this.#n=r,t.set(a,this);let f=TM.from(s);l&&n.add(a),this.#r={profileId:a,controllerId:i,tag:u?CM.namespace(this.controllerId,u.id):null,label:o,group:f,isDefault:l,hasConfigurationHandler:!1,supportsContinuousRun:d},queueMicrotask(()=>{this.#r&&=(this.#e.$publishTestRunProfile(this.#r),void 0)})}dispose(){this.#i?.delete(this.profileId)&&(this.#i=void 0,this.#e.$removeTestProfile(this.controllerId,this.profileId)),this.#r=void 0}};function pV(e,t){for(let n=0;n<e.path.length;n++){let r=t.find(t=>t.id===e.path[n]);if(!r)return;if(n===e.path.length-1)return r;t=r.children}}var mV;(function(e){e.Unknown=`unknown`,e.Env=`env`,e.Config=`config`,e.Command=`command`,e.Input=`input`,e.ExtensionInstallFolder=`extensionInstallFolder`,e.TaskVar=`taskVar`,e.WorkspaceFolder=`workspaceFolder`,e.Cwd=`cwd`,e.WorkspaceFolderBasename=`workspaceFolderBasename`,e.UserHome=`userHome`,e.LineNumber=`lineNumber`,e.ColumnNumber=`columnNumber`,e.SelectedText=`selectedText`,e.File=`file`,e.FileWorkspaceFolder=`fileWorkspaceFolder`,e.FileWorkspaceFolderBasename=`fileWorkspaceFolderBasename`,e.RelativeFile=`relativeFile`,e.RelativeFileDirname=`relativeFileDirname`,e.FileDirname=`fileDirname`,e.FileExtname=`fileExtname`,e.FileBasename=`fileBasename`,e.FileBasenameNoExtension=`fileBasenameNoExtension`,e.FileDirnameBasename=`fileDirnameBasename`,e.ExecPath=`execPath`,e.ExecInstallFolder=`execInstallFolder`,e.PathSeparator=`pathSeparator`,e.PathSeparatorAlias=`/`})(mV||={});const hV=Object.values(mV).filter(e=>typeof e==`string`);var gV=class extends ie{constructor(e,t){super(t),this.variable=e}},_V=class e{static{this.VARIABLE_LHS="${"}constructor(e){this.locations=new Map,this.newReplacementNotifiers=new Set,typeof e==`string`?(this.stringRoot=!0,this.root={value:e}):(this.stringRoot=!1,this.root=structuredClone(e))}static parse(t){if(t instanceof e)return t;let n=new e(t);return n.applyPlatformSpecificKeys(),n.parseObject(n.root),n}applyPlatformSpecificKeys(){let e=this.root,t=yn?`windows`:bn?`osx`:xn?`linux`:void 0;t&&e&&typeof e==`object`&&e.hasOwnProperty(t)&&Object.keys(e[t]).forEach(n=>e[n]=e[t][n]),delete e.windows,delete e.osx,delete e.linux}parseVariable(e,t){if(e[t]!==`$`||e[t+1]!==`{`)return;let n=t+2,r=1;for(;n<e.length;){if(e[n]===`{`)r++;else if(e[n]===`}`&&(r--,r===0))break;n++}if(r!==0)return;let i=e.slice(t,n+1),a=e.substring(t+2,n),o=a.indexOf(`:`);return o===-1?{replacement:{id:i,name:a,inner:a},end:n}:{replacement:{id:i,inner:a,name:a.slice(0,o),arg:a.slice(o+1)},end:n}}parseObject(e){if(!(typeof e!=`object`||!e)){if(Array.isArray(e)){for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`?this.parseString(e,t,n):this.parseObject(n)}return}for(let[t,n]of Object.entries(e))this.parseString(e,t,t,!0),typeof n==`string`?this.parseString(e,t,n):this.parseObject(n)}}parseString(e,t,n,r,i){let a=0;for(;a<n.length;){let o=n.indexOf("${",a);if(o===-1)break;let s=this.parseVariable(n,o);if(s){if(a=s.end+1,i?.includes(s.replacement.id))continue;let n=this.locations.get(s.replacement.id)||{locations:[],replacement:s.replacement},o={object:e,propertyName:t,replaceKeyName:r};n.locations.push(o),this.locations.set(s.replacement.id,n),n.resolved?this._resolveAtLocation(s.replacement,o,n.resolved,i):this.newReplacementNotifiers.forEach(e=>e(s.replacement))}else a=o+2}}*unresolved(){let e=new Map,t=t=>{e.set(t.id,t)};for(let t of this.locations.values())t.resolved===void 0&&e.set(t.replacement.id,t.replacement);for(this.newReplacementNotifiers.add(t);;){let t=lt.first(e);if(!t)break;let[n,r]=t;yield r,e.delete(n)}this.newReplacementNotifiers.delete(t)}resolved(){return lt.map(lt.filter(this.locations.values(),e=>!!e.resolved),e=>[e.replacement,e.resolved])}resolve(e,t){typeof t!=`object`&&(t={value:String(t)});let n=this.locations.get(e.id);if(n&&(n.resolved=t,t.value!==void 0))for(let r of n.locations||lt.empty())this._resolveAtLocation(e,r,t)}_resolveAtLocation(e,{replaceKeyName:t,propertyName:n,object:r},i,a=[]){if(i.value!==void 0){if(a.push(e.id),t&&typeof n==`string`){let t=r[n],o=n.replaceAll(e.id,i.value);delete r[n],r[o]=t,this._renameKeyInLocations(r,n,o),this.parseString(r,o,i.value,!0,a)}else r[n]=r[n].replaceAll(e.id,i.value),this.parseString(r,n,i.value,!1,a);a.pop()}}_renameKeyInLocations(e,t,n){for(let r of this.locations.values())for(let i of r.locations)i.object===e&&i.propertyName===t&&(i.propertyName=n)}toObject(){return this.stringRoot?this.root.value:this.root}},vV=class{constructor(e,t,n,r){this._contributedVariables=new Map,this.resolvableVariables=new Set(hV),this._context=e,this._labelService=t,this._userHomePromise=n,r&&(this._envVariablesPromise=r.then(e=>this.prepareEnv(e)))}prepareEnv(e){if(yn){let t=Object.create(null);return Object.keys(e).forEach(n=>{t[n.toLowerCase()]=e[n]}),t}return e}async resolveWithEnvironment(e,t,n){let r=_V.parse(n);for(let n of r.unresolved()){let i=await this.evaluateSingleVariable(n,t?.uri,e);i!==void 0&&r.resolve(n,String(i))}return r.toObject()}async resolveAsync(e,t){let n=_V.parse(t);for(let t of n.unresolved()){let r=await this.evaluateSingleVariable(t,e?.uri);r!==void 0&&n.resolve(t,String(r))}return n.toObject()}resolveWithInteractionReplace(e,t){throw Error(`resolveWithInteractionReplace not implemented.`)}resolveWithInteraction(e,t){throw Error(`resolveWithInteraction not implemented.`)}contributeVariable(e,t){if(this._contributedVariables.has(e))throw Error(`Variable `+e+` is contributed twice.`);this.resolvableVariables.add(e),this._contributedVariables.set(e,t)}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,n,r){let i={env:n===void 0?await this._envVariablesPromise:this.prepareEnv(n),userHome:n===void 0?await this._userHomePromise:void 0},{name:a,arg:o}=e,s=t=>{let n=this._context.getFilePath();if(n)return _y(n);throw new gV(t,x(16803,`Variable {0} can not be resolved. Please open an editor.`,e.id))},c=t=>{let n=s(t);if(this._context.getWorkspaceFolderPathForFile){let e=this._context.getWorkspaceFolderPathForFile();if(e)return _y(e)}throw new gV(t,x(16804,`Variable {0}: can not find workspace folder of '{1}'.`,e.id,Kr(n)))},l=e=>{if(o){let t=this._context.getFolderUri(o);if(t)return t;throw new gV(e,x(16805,`Variable {0} can not be resolved. No such folder '{1}'.`,e,o))}if(t)return t;throw this._context.getWorkspaceFolderCount()>1?new gV(e,x(16806,`Variable {0} can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.`,e)):new gV(e,x(16807,`Variable {0} can not be resolved. Please open a folder.`,e))};switch(a){case`env`:if(o){if(i.env){let e=i.env[yn?o.toLowerCase():o];if(Ge(e))return e}return``}throw new gV(mV.Env,x(16808,`Variable {0} can not be resolved because no environment variable name is given.`,e.id));case`config`:if(o){let n=this._context.getConfigurationValue(t,o);if(et(n))throw new gV(mV.Config,x(16809,`Variable {0} can not be resolved because setting '{1}' not found.`,e.id,o));if(Je(n))throw new gV(mV.Config,x(16810,`Variable {0} can not be resolved because '{1}' is a structured value.`,e.id,o));return n}throw new gV(mV.Config,x(16811,`Variable {0} can not be resolved because no settings name is given.`,e.id));case`command`:return this.resolveFromMap(mV.Command,e.id,o,r,`command`);case`input`:return this.resolveFromMap(mV.Input,e.id,o,r,`input`);case`extensionInstallFolder`:if(o){let t=await this._context.getExtension(o);if(!t)throw new gV(mV.ExtensionInstallFolder,x(16812,`Variable {0} can not be resolved because the extension {1} is not installed.`,e.id,o));return this.fsPath(t.extensionLocation)}throw new gV(mV.ExtensionInstallFolder,x(16813,`Variable {0} can not be resolved because no extension name is given.`,e.id));default:switch(a){case`workspaceRoot`:case`workspaceFolder`:{let e=l(mV.WorkspaceFolder);return e?_y(this.fsPath(e)):void 0}case`cwd`:{if(!t&&!o)return Gn();let e=l(mV.Cwd);return e?_y(this.fsPath(e)):void 0}case`workspaceRootFolderName`:case`workspaceFolderBasename`:{let e=l(mV.WorkspaceFolderBasename);return e?_y(Kr(this.fsPath(e))):void 0}case`userHome`:if(i.userHome)return i.userHome;throw new gV(mV.UserHome,x(16814,`Variable {0} can not be resolved. UserHome path is not defined`,e.id));case`lineNumber`:{let t=this._context.getLineNumber();if(t)return t;throw new gV(mV.LineNumber,x(16815,`Variable {0} can not be resolved. Make sure to have a line selected in the active editor.`,e.id))}case`columnNumber`:{let t=this._context.getColumnNumber();if(t)return t;throw Error(x(16816,`Variable {0} can not be resolved. Make sure to have a column selected in the active editor.`,e.id))}case`selectedText`:{let t=this._context.getSelectedText();if(t)return t;throw new gV(mV.SelectedText,x(16817,`Variable {0} can not be resolved. Make sure to have some text selected in the active editor.`,e.id))}case`file`:return s(mV.File);case`fileWorkspaceFolder`:return c(mV.FileWorkspaceFolder);case`fileWorkspaceFolderBasename`:return Kr(c(mV.FileWorkspaceFolderBasename));case`relativeFile`:return t||o?Wr(this.fsPath(l(mV.RelativeFile)),s(mV.RelativeFile)):s(mV.RelativeFile);case`relativeFileDirname`:{let e=Gr(s(mV.RelativeFileDirname));if(t||o){let t=Wr(this.fsPath(l(mV.RelativeFileDirname)),e);return t.length===0?`.`:t}return e}case`fileDirname`:return Gr(s(mV.FileDirname));case`fileExtname`:return qr(s(mV.FileExtname));case`fileBasename`:return Kr(s(mV.FileBasename));case`fileBasenameNoExtension`:{let e=Kr(s(mV.FileBasenameNoExtension));return e.slice(0,e.length-qr(e).length)}case`fileDirnameBasename`:return Kr(Gr(s(mV.FileDirnameBasename)));case`execPath`:return this._context.getExecPath()||e.id;case`execInstallFolder`:return this._context.getAppRoot()||e.id;case`pathSeparator`:case`/`:return Jr;default:try{return this.resolveFromMap(mV.Unknown,e.id,o,r,void 0)}catch{return e.id}}}}resolveFromMap(e,t,n,r,i){if(n&&r){let a=i===void 0?r[n]:r[i+`:`+n];if(typeof a==`string`)return a;throw new gV(e,x(16818,`Variable {0} can not be resolved because the command has no value.`,t))}return t}};const yV=k(`IExtHostVariableResolverProvider`);var bV=class extends vV{constructor(e,t,n,r,i,a,o){function s(){if(n){let e=n.activeEditor();if(e)return e.document.uri;let t=r.tabGroups.all.find(e=>e.isActive)?.activeTab;if(t!==void 0){if(t.input instanceof ok||t.input instanceof dk)return t.input.modified;if(t.input instanceof ak||t.input instanceof uk||t.input instanceof ck)return t.input.uri}}}super({getFolderUri:e=>{let t=a.folders.filter(t=>t.name===e);if(t&&t.length>0)return t[0].uri},getWorkspaceFolderCount:()=>a.folders.length,getConfigurationValue:(e,t)=>i.getConfiguration(void 0,e).get(t),getAppRoot:()=>Gn(),getExecPath:()=>Kn.VSCODE_EXEC_PATH,getFilePath:()=>{let e=s();if(e)return Br(e.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){let e=s();if(e){let n=t.getWorkspaceFolder(e);if(n)return Br(n.uri.fsPath)}}},getSelectedText:()=>{if(n){let e=n.activeEditor();if(e&&!e.selection.isEmpty)return e.document.getText(e.selection)}},getLineNumber:()=>{if(n){let e=n.activeEditor();if(e)return String(e.selection.end.line+1)}},getColumnNumber:()=>{if(n){let e=n.activeEditor();if(e)return String(e.selection.end.character+1)}},getExtension:t=>e.getExtension(t)},void 0,o?Promise.resolve(o):void 0,Promise.resolve(Kn))}};let xV=class extends y{constructor(e,t,r,i,a){super(),this.extensionService=e,this.workspaceService=t,this.editorService=r,this.configurationService=i,this.editorTabs=a,this._resolver=new n(async()=>{let e=await this.configurationService.getConfigProvider(),t={folders:await this.workspaceService.getWorkspaceFolders2()||[]};return this._register(this.workspaceService.onDidChangeWorkspace(async e=>{t.folders=await this.workspaceService.getWorkspaceFolders2()||[]})),new bV(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,e,t,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};xV=A([j(0,KR),j(1,YP),j(2,Nz),j(3,mF),j(4,WB)],xV);const SV=k(`IExtHostDebugService`);let CV=class extends y{get onDidStartDebugSession(){return this._onDidStartDebugSession.event}get onDidTerminateDebugSession(){return this._onDidTerminateDebugSession.event}get onDidChangeActiveDebugSession(){return this._onDidChangeActiveDebugSession.event}get activeDebugSession(){return this._activeDebugSession?.api}get onDidReceiveDebugSessionCustomEvent(){return this._onDidReceiveDebugSessionCustomEvent.event}get activeDebugConsole(){return this._activeDebugConsole.value}constructor(e,t,n,r,i,a,o,s){super(),this._workspaceService=t,this._extensionService=n,this._configurationService=r,this._editorTabs=i,this._variableResolver=a,this._commands=o,this._testing=s,this._debugSessions=new Map,this._debugVisualizationTreeItemIdsCounter=0,this._debugVisualizationProviders=new Map,this._debugVisualizationTrees=new Map,this._debugVisualizationTreeItemIds=new WeakMap,this._debugVisualizationElements=new Map,this._visualizers=new Map,this._visualizerIdCounter=0,this._configProviderHandleCounter=0,this._configProviders=[],this._adapterFactoryHandleCounter=0,this._adapterFactories=[],this._trackerFactoryHandleCounter=0,this._trackerFactories=[],this._debugAdapters=new Map,this._debugAdaptersTrackers=new Map,this._onDidStartDebugSession=this._register(new S),this._onDidTerminateDebugSession=this._register(new S),this._onDidChangeActiveDebugSession=this._register(new S),this._onDidReceiveDebugSessionCustomEvent=this._register(new S),this._debugServiceProxy=e.getProxy(E.MainThreadDebugService),this._onDidChangeBreakpoints=this._register(new S),this._onDidChangeActiveStackItem=this._register(new S),this._activeDebugConsole=new TV(this._debugServiceProxy),this._breakpoints=new Map,this._extensionService.getExtensionRegistry().then(e=>{this._register(e.onDidChange(t=>{this.registerAllDebugTypes(e)})),this.registerAllDebugTypes(e)}),this._telemetryProxy=e.getProxy(E.MainThreadTelemetry)}async $getVisualizerTreeItem(e,t){let n=this.hydrateVisualizationContext(t);if(!n)return;let r=await this._debugVisualizationTrees.get(e)?.getTreeItem?.(n);return r?this.convertVisualizerTreeItem(e,r):void 0}registerDebugVisualizationTree(e,t,n){let r=ys.toKey(e.identifier),i=this.extensionVisKey(r,t);if(this._debugVisualizationProviders.has(i))throw Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationTrees.set(i,n),this._debugServiceProxy.$registerDebugVisualizerTree(i,!!n.editItem),_(()=>{this._debugServiceProxy.$unregisterDebugVisualizerTree(i),this._debugVisualizationTrees.delete(t)})}async $getVisualizerTreeItemChildren(e,t){let n=this._debugVisualizationElements.get(t)?.item;return n&&(await this._debugVisualizationTrees.get(e)?.getChildren?.(n))?.map(t=>this.convertVisualizerTreeItem(e,t))||[]}async $editVisualizerTreeItem(e,t){let n=this._debugVisualizationElements.get(e);if(!n)return;let r=await this._debugVisualizationTrees.get(n.provider)?.editItem?.(n.item,t);return this.convertVisualizerTreeItem(n.provider,r||n.item)}$disposeVisualizedTree(e){let t=this._debugVisualizationElements.get(e);if(!t)return;let n=[t.children];for(let e of n)if(e)for(let t of e)n.push(this._debugVisualizationElements.get(t)?.children),this._debugVisualizationElements.delete(t)}convertVisualizerTreeItem(e,t){let n=this._debugVisualizationTreeItemIds.get(t);return n||(n=this._debugVisualizationTreeItemIdsCounter++,this._debugVisualizationTreeItemIds.set(t,n),this._debugVisualizationElements.set(n,{provider:e,item:t})),AN.from(t,n)}asDebugSourceUri(e,t){let n=e;if(typeof n.sourceReference==`number`&&n.sourceReference>0){let e=`debug:${encodeURIComponent(n.path||``)}`,r=`?`;return t&&(e+=`${r}session=${encodeURIComponent(t.id)}`,r=`&`),e+=`${r}ref=${n.sourceReference}`,w.parse(e)}else if(n.path)return w.file(n.path);else throw Error(`cannot create uri from DAP 'source' object; properties 'path' and 'sourceReference' are both missing.`)}registerAllDebugTypes(e){let t=[];for(let n of e.getAllExtensionDescriptions())if(n.contributes){let e=n.contributes.debuggers;if(e&&e.length>0)for(let n of e)IB(n)&&t.push(n.type)}this._debugServiceProxy.$registerDebugTypes(t)}get activeStackItem(){return this._activeStackItem}get onDidChangeActiveStackItem(){return this._onDidChangeActiveStackItem.event}get onDidChangeBreakpoints(){return this._onDidChangeBreakpoints.event}get breakpoints(){let e=[];return this._breakpoints.forEach(t=>e.push(t)),e}async $resolveDebugVisualizer(e,t){let n=this._visualizers.get(e);if(!n)throw Error(`No debug visualizer found with id '${e}'`);let{v:r,provider:i,extensionId:a}=n;if(r.visualization||(r=await i.resolveDebugVisualization?.(r,t)||r,n.v=r),!r.visualization)throw Error(`No visualization returned from resolveDebugVisualization in '${i}'`);return this.serializeVisualization(a,r.visualization)}async $executeDebugVisualizerCommand(e){let t=this._visualizers.get(e);if(!t)throw Error(`No debug visualizer found with id '${e}'`);let n=t.v.visualization;n&&`command`in n&&this._commands.executeCommand(n.command,...n.arguments||[])}hydrateVisualizationContext(e){let t=this._debugSessions.get(e.sessionId);return t&&{session:t.api,variable:e.variable,containerId:e.containerId,frameId:e.frameId,threadId:e.threadId}}async $provideDebugVisualizers(e,t,n,r){let i=this.hydrateVisualizationContext(n),a=this.extensionVisKey(e,t),o=this._debugVisualizationProviders.get(a);if(!i||!o)return[];let s=await o.provideDebugVisualization(i,r);return s?s.map(t=>{let n=++this._visualizerIdCounter;this._visualizers.set(n,{v:t,provider:o,extensionId:e});let r=t.iconPath?this.getIconPathOrClass(t.iconPath):void 0;return{id:n,name:t.name,iconClass:r?.iconClass,iconPath:r?.iconPath,visualization:this.serializeVisualization(e,t.visualization)}}):[]}$disposeDebugVisualizers(e){for(let t of e)this._visualizers.delete(t)}registerDebugVisualizationProvider(e,t,n){if(!e.contributes?.debugVisualizers?.some(e=>e.id===t))throw Error(`Extensions may only call registerDebugVisualizationProvider() for renderers they contribute (got ${t})`);let r=ys.toKey(e.identifier),i=this.extensionVisKey(r,t);if(this._debugVisualizationProviders.has(i))throw Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationProviders.set(i,n),this._debugServiceProxy.$registerDebugVisualizer(r,t),_(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(r,t),this._debugVisualizationProviders.delete(t)})}addBreakpoints(e){let t=e.filter(e=>{let t=e.id;return this._breakpoints.has(t)?!1:(this._breakpoints.set(t,e),!0)});this.fireBreakpointChanges(t,[],[]);let n=[],r=new Map;for(let e of t)if(e instanceof FD){let t=r.get(e.location.uri.toString());t||(t={type:`sourceMulti`,uri:e.location.uri,lines:[]},r.set(e.location.uri.toString(),t),n.push(t)),t.lines.push({id:e.id,enabled:e.enabled,condition:e.condition,hitCondition:e.hitCondition,logMessage:e.logMessage,line:e.location.range.start.line,character:e.location.range.start.character,mode:e.mode})}else e instanceof ID&&n.push({type:`function`,id:e.id,enabled:e.enabled,hitCondition:e.hitCondition,logMessage:e.logMessage,condition:e.condition,functionName:e.functionName,mode:e.mode});return this._debugServiceProxy.$registerBreakpoints(n)}removeBreakpoints(e){let t=e.filter(e=>this._breakpoints.delete(e.id));this.fireBreakpointChanges([],t,[]);let n=t.filter(e=>e instanceof FD).map(e=>e.id),r=t.filter(e=>e instanceof ID).map(e=>e.id),i=t.filter(e=>e instanceof LD).map(e=>e.id);return this._debugServiceProxy.$unregisterBreakpoints(n,r,i)}startDebugging(e,t,n){let r=n.testRun&&this._testing.getMetadataForRun(n.testRun);return this._debugServiceProxy.$startDebugging(e?e.uri:void 0,t,{parentSessionID:n.parentSession?n.parentSession.id:void 0,lifecycleManagedByParent:n.lifecycleManagedByParent,repl:n.consoleMode===gO.MergeWithParent?`mergeWithParent`:`separate`,noDebug:n.noDebug,compact:n.compact,suppressSaveBeforeStart:n.suppressSaveBeforeStart,testRun:r&&{runId:r.runId,taskId:r.taskId},suppressDebugStatusbar:n.suppressDebugStatusbar??n.debugUI?.simple,suppressDebugToolbar:n.suppressDebugToolbar??n.debugUI?.simple,suppressDebugView:n.suppressDebugView??n.debugUI?.simple})}stopDebugging(e){return this._debugServiceProxy.$stopDebugging(e?e.id:void 0)}registerDebugConfigurationProvider(e,t,n){if(!t)return new WT(()=>{});let r=this._configProviderHandleCounter++;return this._configProviders.push({type:e,handle:r,provider:t}),this._debugServiceProxy.$registerDebugConfigurationProvider(e,n,!!t.provideDebugConfigurations,!!t.resolveDebugConfiguration,!!t.resolveDebugConfigurationWithSubstitutedVariables,r),new WT(()=>{this._configProviders=this._configProviders.filter(e=>e.provider!==t),this._debugServiceProxy.$unregisterDebugConfigurationProvider(r)})}registerDebugAdapterDescriptorFactory(e,t,n){if(!n)return new WT(()=>{});if(!this.definesDebugType(e,t))throw Error(`a DebugAdapterDescriptorFactory can only be registered from the extension that defines the '${t}' debugger.`);if(this.getAdapterDescriptorFactoryByType(t))throw Error(`a DebugAdapterDescriptorFactory can only be registered once per a type.`);let r=this._adapterFactoryHandleCounter++;return this._adapterFactories.push({type:t,handle:r,factory:n}),this._debugServiceProxy.$registerDebugAdapterDescriptorFactory(t,r),new WT(()=>{this._adapterFactories=this._adapterFactories.filter(e=>e.factory!==n),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(r)})}registerDebugAdapterTrackerFactory(e,t){if(!t)return new WT(()=>{});let n=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:e,handle:n,factory:t}),new WT(()=>{this._trackerFactories=this._trackerFactories.filter(e=>e.factory!==t)})}async $runInTerminal(e,t){return Promise.resolve(void 0)}async $substituteVariables(e,t){let n,r=await this.getFolder(e);return r&&(n={uri:r.uri,name:r.name,index:r.index}),(await this._variableResolver.getResolver()).resolveAsync(n,t)}createDebugAdapter(e,t){if(e instanceof VD)return new DV(e.implementation)}createSignService(){}async $startDASession(e,t){let n=this,r=await this.getSession(t);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(r.type),r).then(t=>{if(!t)throw Error(`Couldn't find a debug adapter descriptor for debug type '${r.type}' (extension might have failed to activate)`);let i=this.createDebugAdapter(t,r);if(!i)throw Error(`Couldn't create a debug adapter for type '${r.type}'.`);let a=i;return this._debugAdapters.set(e,a),this.getDebugAdapterTrackers(r).then(t=>(t&&this._debugAdaptersTrackers.set(e,t),a.onMessage(async i=>{if(i.type===`request`&&i.command===`handshake`){let e=i,t={type:`response`,seq:0,command:e.command,request_seq:e.seq,success:!0};this._signService||=this.createSignService();try{if(this._signService)t.body={signature:await this._signService.sign(e.arguments.value)},a.sendResponse(t);else throw Error(`no signer`)}catch(e){t.success=!1,t.message=e.message,a.sendResponse(t)}}else{t&&t.onDidSendMessage&&t.onDidSendMessage(i);try{i=HB(i,!0)}catch(e){let t=i.type+`_`+(i.command??i.event??``);throw this._telemetryProxy.$publicLog2(`debugProtocolMessageError`,{type:t,from:r.type}),e}n._debugServiceProxy.$acceptDAMessage(e,i)}}),a.onError(n=>{t&&t.onError&&t.onError(n),this._debugServiceProxy.$acceptDAError(e,n.name,n.message,n.stack)}),a.onExit(n=>{t&&t.onExit&&t.onExit(n??void 0,void 0),this._debugServiceProxy.$acceptDAExit(e,n??void 0,void 0)}),t&&t.onWillStartSession&&t.onWillStartSession(),a.startSession()))})}$sendDAMessage(e,t){t=VB(t,!1);let n=this._debugAdaptersTrackers.get(e);n&&n.onWillReceiveMessage&&n.onWillReceiveMessage(t),this._debugAdapters.get(e)?.sendMessage(t)}$stopDASession(e){let t=this._debugAdaptersTrackers.get(e);this._debugAdaptersTrackers.delete(e),t&&t.onWillStopSession&&t.onWillStopSession();let n=this._debugAdapters.get(e);return this._debugAdapters.delete(e),n?n.stopSession():Promise.resolve(void 0)}$acceptBreakpointsDelta(e){let t=[],n=[],r=[];if(e.added)for(let n of e.added){let e=n.id;if(e&&!this._breakpoints.has(e)){let r;r=n.type===`function`?new ID(n.functionName,n.enabled,n.condition,n.hitCondition,n.logMessage,n.mode):n.type===`data`?new LD(n.label,n.dataId,n.canPersist,n.enabled,n.hitCondition,n.condition,n.logMessage,n.mode):new FD(new dT(w.revive(n.uri),new eT(n.line,n.character)),n.enabled,n.condition,n.hitCondition,n.logMessage,n.mode),ND(r,e),this._breakpoints.set(e,r),t.push(r)}}if(e.removed)for(let t of e.removed){let e=this._breakpoints.get(t);e&&(this._breakpoints.delete(t),n.push(e))}if(e.changed){for(let t of e.changed)if(t.id){let e=this._breakpoints.get(t.id);if(e){if(e instanceof ID&&t.type===`function`){let n=e;n.enabled=t.enabled,n.condition=t.condition,n.hitCondition=t.hitCondition,n.logMessage=t.logMessage,n.functionName=t.functionName}else if(e instanceof FD&&t.type===`source`){let n=e;n.enabled=t.enabled,n.condition=t.condition,n.hitCondition=t.hitCondition,n.logMessage=t.logMessage,n.location=new dT(w.revive(t.uri),new eT(t.line,t.character))}r.push(e)}}}this.fireBreakpointChanges(t,n,r)}async $acceptStackFrameFocus(e){let t;if(e){let n=await this.getSession(e.sessionId);t=e.kind===`thread`?new UD(n.api,e.threadId):new HD(n.api,e.threadId,e.frameId)}this._activeStackItem=t,this._onDidChangeActiveStackItem.fire(this._activeStackItem)}$provideDebugConfigurations(e,t,n){return go(async()=>{let r=this.getConfigProviderByHandle(e);if(!r)throw Error(`no DebugConfigurationProvider found`);if(!r.provideDebugConfigurations)throw Error(`DebugConfigurationProvider has no method provideDebugConfigurations`);let i=await this.getFolder(t);return r.provideDebugConfigurations(i,n)}).then(e=>{if(!e)throw Error(`nothing returned from DebugConfigurationProvider.provideDebugConfigurations`);return e})}$resolveDebugConfiguration(e,t,n,r){return go(async()=>{let i=this.getConfigProviderByHandle(e);if(!i)throw Error(`no DebugConfigurationProvider found`);if(!i.resolveDebugConfiguration)throw Error(`DebugConfigurationProvider has no method resolveDebugConfiguration`);let a=await this.getFolder(t);return i.resolveDebugConfiguration(a,n,r)})}$resolveDebugConfigurationWithSubstitutedVariables(e,t,n,r){return go(async()=>{let i=this.getConfigProviderByHandle(e);if(!i)throw Error(`no DebugConfigurationProvider found`);if(!i.resolveDebugConfigurationWithSubstitutedVariables)throw Error(`DebugConfigurationProvider has no method resolveDebugConfigurationWithSubstitutedVariables`);let a=await this.getFolder(t);return i.resolveDebugConfigurationWithSubstitutedVariables(a,n,r)})}async $provideDebugAdapter(e,t){let n=this.getAdapterDescriptorFactoryByHandle(e);if(!n)return Promise.reject(Error(`no adapter descriptor factory found for handle`));let r=await this.getSession(t);return this.getAdapterDescriptor(n,r).then(e=>{if(!e)throw Error(`Couldn't find a debug adapter descriptor for debug type '${r.type}'`);return this.convertToDto(e)})}async $acceptDebugSessionStarted(e){let t=await this.getSession(e);this._onDidStartDebugSession.fire(t.api)}async $acceptDebugSessionTerminated(e){let t=await this.getSession(e);t&&(this._onDidTerminateDebugSession.fire(t.api),this._debugSessions.delete(t.id))}async $acceptDebugSessionActiveChanged(e){this._activeDebugSession=e?await this.getSession(e):void 0,this._onDidChangeActiveDebugSession.fire(this._activeDebugSession?.api)}async $acceptDebugSessionNameChanged(e,t){(await this.getSession(e))?._acceptNameChanged(t)}async $acceptDebugSessionCustomEvent(e,t){let n={session:(await this.getSession(e)).api,event:t.event,body:t.body};this._onDidReceiveDebugSessionCustomEvent.fire(n)}convertToDto(e){if(e instanceof RD)return this.convertExecutableToDto(e);if(e instanceof zD)return this.convertServerToDto(e);if(e instanceof BD)return this.convertPipeServerToDto(e);if(e instanceof VD)return this.convertImplementationToDto(e);throw Error(`convertToDto unexpected type`)}convertExecutableToDto(e){return{type:`executable`,command:e.command,args:e.args,options:e.options}}convertServerToDto(e){return{type:`server`,port:e.port,host:e.host}}convertPipeServerToDto(e){return{type:`pipeServer`,path:e.path}}convertImplementationToDto(e){return{type:`implementation`}}getAdapterDescriptorFactoryByType(e){let t=this._adapterFactories.filter(t=>t.type===e);if(t.length>0)return t[0].factory}getAdapterDescriptorFactoryByHandle(e){let t=this._adapterFactories.filter(t=>t.handle===e);if(t.length>0)return t[0].factory}getConfigProviderByHandle(e){let t=this._configProviders.filter(t=>t.handle===e);if(t.length>0)return t[0].provider}definesDebugType(e,t){if(e.contributes){let n=e.contributes.debuggers;if(n&&n.length>0){for(let e of n)if(e.label&&e.type&&e.type===t)return!0}}return!1}getDebugAdapterTrackers(e){let t=e.configuration.type,n=this._trackerFactories.filter(e=>e.type===t||e.type===`*`).map(t=>go(()=>t.factory.createDebugAdapterTracker(e.api)).then(e=>e,e=>null));return Promise.race([Promise.all(n).then(e=>{let t=pe(e);if(t.length>0)return new EV(t)}),new Promise(e=>setTimeout(()=>e(void 0),1e3))]).catch(e=>{})}async getAdapterDescriptor(e,t){let n=t.configuration.debugServer;if(typeof n==`number`)return Promise.resolve(new zD(n));if(e){let n=await this._extensionService.getExtensionRegistry();return go(()=>e.createDebugAdapterDescriptor(t.api,this.daExecutableFromPackage(t,n))).then(e=>{if(e)return e})}let r=await this._extensionService.getExtensionRegistry();return Promise.resolve(this.daExecutableFromPackage(t,r))}daExecutableFromPackage(e,t){}fireBreakpointChanges(e,t,n){(e.length>0||t.length>0||n.length>0)&&this._onDidChangeBreakpoints.fire(Object.freeze({added:e,removed:t,changed:n}))}async getSession(e){if(e)if(typeof e==`string`){let t=this._debugSessions.get(e);if(t)return t}else{let t=this._debugSessions.get(e.id);if(!t){let n=await this.getFolder(e.folderUri),r=e.parent?this._debugSessions.get(e.parent):void 0;t=new wV(this._debugServiceProxy,e.id,e.type,e.name,n,e.configuration,r?.api),this._debugSessions.set(t.id,t),this._debugServiceProxy.$sessionCached(t.id)}return t}throw Error(`cannot find session`)}getFolder(e){if(e){let t=w.revive(e);return this._workspaceService.resolveWorkspaceFolder(t)}return Promise.resolve(void 0)}extensionVisKey(e,t){return`${e}\0${t}`}serializeVisualization(e,t){if(t){if(`title`in t&&`command`in t)return{type:Bx.Command};if(`treeId`in t)return{type:Bx.Tree,id:`${e}\0${t.treeId}`};throw Error(`Unsupported debug visualization type`)}}getIconPathOrClass(e){let t=this.getIconUris(e),n,r;return`id`in t?r=fl.asClassName(t):n=t,{iconPath:n,iconClass:r}}getIconUris(e){if(e instanceof OD)return{id:e.id};let t=typeof e==`object`&&`dark`in e?e.dark:e,n=typeof e==`object`&&`light`in e?e.light:e;return{dark:typeof t==`string`?w.file(t):t,light:typeof n==`string`?w.file(n):n}}};CV=A([j(0,Hs),j(1,YP),j(2,KR),j(3,mF),j(4,WB),j(5,yV),j(6,RI),j(7,tV)],CV);var wV=class{constructor(e,t,n,r,i,a,o){this._debugServiceProxy=e,this._id=t,this._type=n,this._name=r,this._workspaceFolder=i,this._configuration=a,this._parentSession=o}get api(){let e=this;return this.apiSession??=Object.freeze({id:e._id,type:e._type,get name(){return e._name},set name(t){e._name=t,e._debugServiceProxy.$setDebugSessionName(e._id,t)},parentSession:e._parentSession,workspaceFolder:e._workspaceFolder,configuration:e._configuration,customRequest(t,n){return e._debugServiceProxy.$customDebugAdapterRequest(e._id,t,n)},getDebugProtocolBreakpoint(t){return e._debugServiceProxy.$getDebugProtocolBreakpoint(e._id,t.id)}})}get id(){return this._id}get type(){return this._type}_acceptNameChanged(e){this._name=e}get configuration(){return this._configuration}},TV=class{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(e){this.append(e+`
103
- `)}})}},EV=class{constructor(e){this.trackers=e}onWillStartSession(){this.trackers.forEach(e=>e.onWillStartSession?e.onWillStartSession():void 0)}onWillReceiveMessage(e){this.trackers.forEach(t=>t.onWillReceiveMessage?t.onWillReceiveMessage(e):void 0)}onDidSendMessage(e){this.trackers.forEach(t=>t.onDidSendMessage?t.onDidSendMessage(e):void 0)}onWillStopSession(){this.trackers.forEach(e=>e.onWillStopSession?e.onWillStopSession():void 0)}onError(e){this.trackers.forEach(t=>t.onError?t.onError(e):void 0)}onExit(e,t){this.trackers.forEach(n=>n.onExit?n.onExit(e,t):void 0)}},DV=class extends FB{constructor(e){super(),this.implementation=e,e.onDidSendMessage(e=>{this.acceptMessage(e)})}startSession(){return Promise.resolve(void 0)}sendMessage(e){this.implementation.handleMessage(e)}stopSession(){return this.implementation.dispose(),Promise.resolve(void 0)}};let OV=class extends CV{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o,s)}};OV=A([j(0,Hs),j(1,YP),j(2,KR),j(3,mF),j(4,WB),j(5,yV),j(6,RI),j(7,tV)],OV);function kV(e){return`uri`in e&&`ranges`in e&&`preview`in e}function AV(e){return e.folderOptions.map(t=>({folder:t.folder,excludes:t.excludes.map(e=>typeof e==`string`?e:e.pattern),includes:t.includes,useGlobalIgnoreFiles:t.useIgnoreFiles.global,useIgnoreFiles:t.useIgnoreFiles.local,useParentIgnoreFiles:t.useIgnoreFiles.parent,followSymlinks:t.followSymlinks,maxResults:e.maxResults,session:e.session}))}var jV=class{constructor(e){this.provider=e}provideFileSearchResults(e,t,n){return(async()=>{let r=AV(t);return Promise.all(r.map(t=>this.provider.provideFileSearchResults({pattern:e},t,n)))})().then(e=>pe(e).flat())}};function MV(e){return e.folderOptions.map(t=>({folder:t.folder,excludes:t.excludes.map(e=>typeof e==`string`?e:e.pattern),includes:t.includes,useGlobalIgnoreFiles:t.useIgnoreFiles.global,useIgnoreFiles:t.useIgnoreFiles.local,useParentIgnoreFiles:t.useIgnoreFiles.parent,followSymlinks:t.followSymlinks,maxResults:e.maxResults,previewOptions:NV(e.previewOptions),maxFileSize:e.maxFileSize,encoding:t.encoding,afterContext:e.surroundingContext,beforeContext:e.surroundingContext}))}function NV(e){return{matchLines:e?.matchLines??fP.matchLines,charsPerLine:e?.charsPerLine??fP.charsPerLine}}function PV(e){if(kV(e)){let t=be(e.ranges).map((t,n)=>({sourceRange:t,previewRange:be(e.preview.matches)[n]}));return new BN(e.uri,t,e.preview.text)}else return new VN(e.uri,e.text,e.lineNumber)}var FV=class{constructor(e){this.provider=e}provideTextSearchResults(e,t,n,r){let i=e=>{IV(e)&&n.report(PV(e))};return(async()=>pe(await Promise.all(MV(t).map(t=>this.provider.provideTextSearchResults(e,t,{report:e=>i(e)},r)))).reduce((e,t)=>({limitHit:e.limitHit||t.limitHit}),{limitHit:!1}))().then(e=>({limitHit:e.limitHit,message:pe(be(e.message))}))}};function IV(e){if(LV(e)){if(Array.isArray(e.ranges)){if(!Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same type."),!1;if(e.preview.matches.length!==e.ranges.length)return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}else if(Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}return!0}function LV(e){return!!e.preview}var RV=class extends ec{constructor(e,t,n=()=>!1){let r=new Xs(n,()=>!1);super(r);let i=new Ne;e.forEach((e,t)=>{let n=e.folder.with({query:``,fragment:``});i.has(n)?i.get(n).push({fq:e,i:t}):i.set(n,[{fq:e,i:t}])}),i.forEach((e,n)=>{let r=new Map;for(let n of e){let e=t(n.fq,n.i);r.set(this.encodeKey(n.fq.folder),e)}super.set(n,r)})}findQueryFragmentAwareSubstr(e){let t=super.findSubstr(e.with({query:``,fragment:``}));if(!t)return;let n=this.encodeKey(e);return t.get(n)}forEachFolderQueryInfo(e){return this.forEach(t=>t.forEach(t=>e(t)))}encodeKey(e){let t=``;return e.query&&(t+=e.query),e.fragment&&(t+=`#`+e.fragment),t}},zV=class{constructor(e,t,n){this.config=e,this.provider=t,this.sessionLifecycle=n,this.isLimitHit=!1,this.resultCount=0,this.isCanceled=!1,this.filePattern=e.filePattern;let r=e.ignoreGlobCase?{ignoreCase:!0}:void 0;this.includePattern=e.includePattern&&VS(e.includePattern,r),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&VS(e.excludePattern,r)}cancel(){this.isCanceled=!0,this.activeCancellationTokens.forEach(e=>e.cancel()),this.activeCancellationTokens=new Set}search(e){let t=this.config.folderQueries||[];return new Promise((n,r)=>{let i=t=>{this.resultCount++,e(t)};if(this.isCanceled)return n({limitHit:this.isLimitHit});this.config.extraFileResources&&this.config.extraFileResources.forEach(e=>{let t=e.toString(),n=Kr(t);this.globalExcludePattern&&this.globalExcludePattern(t,n)||this.matchFile(i,{base:e,basename:n})}),this.doSearch(t,i).then(e=>{n({limitHit:this.isLimitHit,stats:e||void 0})},e=>{r(Error(Om(e)))})})}async doSearch(e,t){let n=new Ii,r=e.map(e=>this.getSearchOptionsForFolder(e)),i=this.provider instanceof jV?this.sessionLifecycle?.tokenSource.token:this.sessionLifecycle?.obj,a={folderOptions:r,maxResults:this.config.maxResults??2e4,session:i},o=new RV(e,e=>{let t=new oP(this.config,e);return{queryTester:t,noSiblingsClauses:!t.hasSiblingExcludeClauses(),folder:e.folder,tree:this.initDirectoryTree()}}),s;try{this.activeCancellationTokens.add(n),s=Yn.create();let e=await this.provider.provideFileSearchResults(this.config.filePattern||``,a,n.token),r=s.elapsed(),i=Yn.create();return this.isCanceled&&!this.isLimitHit||(e&&e.forEach(e=>{let n=o.findQueryFragmentAwareSubstr(e),r=zr.relative(n.folder.path,e.path);if(n.noSiblingsClauses){let i=Kr(e.path);this.matchFile(t,{base:n.folder,relativePath:r,basename:i});return}this.addDirectoryEntries(n.tree,n.folder,r,t)}),this.isCanceled&&!this.isLimitHit)?null:(o.forEachFolderQueryInfo(e=>{this.matchDirectoryTree(e.tree,e.queryTester,t)}),{providerTime:r,postProcessTime:i.elapsed()})}finally{n.dispose(),this.activeCancellationTokens.delete(n)}}getSearchOptionsForFolder(e){let t=aP(this.config.includePattern,e.includePattern),n=e.excludePattern?.map(e=>({folder:e.folder,patterns:aP(this.config.excludePattern,e.pattern)}));n?.length||(n=[{folder:void 0,patterns:aP(this.config.excludePattern,void 0)}]);let r=dP(n);return{folder:e.folder,excludes:r,includes:t,useIgnoreFiles:{local:!e.disregardIgnoreFiles,parent:!e.disregardParentIgnoreFiles,global:!e.disregardGlobalIgnoreFiles},followSymlinks:!e.ignoreSymlinks}}initDirectoryTree(){let e={rootEntries:[],pathToEntries:Object.create(null)};return e.pathToEntries[`.`]=e.rootEntries,e}addDirectoryEntries({pathToEntries:e},t,n,r){if(this.filePattern&&ca(n,this.filePattern,this.config.ignoreGlobCase)){let e=Kr(this.filePattern);this.matchFile(r,{base:t,relativePath:this.filePattern,basename:e})}function i(n){let r=Kr(n),a=Gr(n),o=e[a];o||(o=e[a]=[],i(a)),o.push({base:t,relativePath:n,basename:r})}i(n)}matchDirectoryTree({rootEntries:e,pathToEntries:t},n,r){let i=this,a=this.filePattern,o=this.config.ignoreGlobCase;function s(e){let c=lP(()=>e.map(e=>e.basename));for(let l=0,u=e.length;l<u;l++){let u=e[l],{relativePath:d,basename:f}=u;if(n.matchesExcludesSync(d,f,ca(a,f,o)?void 0:c))continue;let p=t[d];if(p)s(p);else{if(ca(d,a,o))continue;i.matchFile(r,u)}if(i.isLimitHit)break}}s(e)}matchFile(e,t){(!this.includePattern||t.relativePath&&this.includePattern(t.relativePath,t.basename))&&((this.exists||this.maxResults&&this.resultCount>=this.maxResults)&&(this.isLimitHit=!0,this.cancel()),this.isLimitHit||e(t))}},BV=class{constructor(){this._obj={},this.tokenSource=new Ii}get obj(){if(this._obj)return this._obj;throw Error(`Session object has been dereferenced.`)}cancel(){this.tokenSource.cancel(),this._obj=void 0}},VV=class e{constructor(){this.sessions=new Map}static{this.BATCH_SIZE=512}fileSearch(t,n,r,i){let a=new zV(t,n,this.getSessionTokenSource(t.cacheKey)),o=0;return this.doSearch(a,e.BATCH_SIZE,e=>{o+=e.length,r(e.map(e=>this.rawMatchToSearchItem(e)))},i).then(e=>({limitHit:e.limitHit,stats:e.stats?{fromCache:!1,type:`fileSearchProvider`,resultCount:o,detailStats:e.stats}:void 0,messages:[]}))}clearCache(e){this.sessions.get(e)?.cancel(),this.sessions.delete(e)}getSessionTokenSource(e){if(e)return this.sessions.has(e)||this.sessions.set(e,new BV),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:io(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,n,r){let i=r.onCancellationRequested(()=>{e.cancel()}),a=e=>{e&&(o.push(e),t>0&&o.length>=t&&(n(o),o=[]))},o=[];return e.search(a).then(e=>(o.length&&n(o),i.dispose(),e),e=>(o.length&&n(o),i.dispose(),Promise.reject(e)))}},HV=class{constructor(e,t,n){this.queryProviderPair=e,this.fileUtils=t,this.processType=n,this.collector=null,this.isLimitHit=!1,this.resultCount=0}get query(){return this.queryProviderPair.query}search(e,t,n){let r=this.query.folderQueries||[],i=new Ii(t);return new Promise((t,a)=>{this.collector=new WV(e);let o=!1;this.doSearch(r,(e,t)=>{if(!(e instanceof HN)&&!o&&!this.isLimitHit){let n=this.resultSize(e);e instanceof BN&&typeof this.query.maxResults==`number`&&this.resultCount+n>this.query.maxResults&&(this.isLimitHit=!0,o=!0,i.cancel(),e=this.trimResultToSize(e,this.query.maxResults-this.resultCount));let r=this.resultSize(e);this.resultCount+=r;let a=e instanceof BN;(r>0||!a)&&this.collector.add(e,t)}},i.token,n).then(e=>{i.dispose(),this.collector.flush(),t({limitHit:this.isLimitHit||e?.limitHit,messages:this.getMessagesFromResults(e),stats:{type:this.processType}})},e=>{i.dispose();let t=Om(e);a(Error(t))})})}getMessagesFromResults(e){return e?.message?Array.isArray(e.message)?e.message:[e.message]:[]}resultSize(e){return e instanceof BN?Array.isArray(e.ranges)?e.ranges.length:1:0}trimResultToSize(e,t){return new BN(e.uri,e.ranges.slice(0,t),e.previewText)}async doSearch(e,t,n,r){let i=new RV(e,(e,t)=>({queryTester:new oP(this.query,e),folder:e.folder,folderIdx:t}),()=>!0),a=[],o={report:e=>{if(e instanceof HN)r?.(e);else{if(e.uri===void 0)throw Error(`Text search result URI is undefined. Please check provider implementation.`);let n=i.findQueryFragmentAwareSubstr(e.uri);if(n?.folder?.scheme){let r=n.folder.scheme===O.file?cP(()=>this.fileUtils.readdir(ro(e.uri))):void 0,i=ao(n.folder,e.uri);if(i){let o=n.queryTester.includedInQuery(i,Kr(i),r);fo(o)?a.push(o.then(r=>{r&&t(e,n.folderIdx)})):o&&t(e,n.folderIdx)}}}}},s={folderOptions:e.map(e=>this.getSearchOptionsForFolder(e)),maxFileSize:this.query.maxFileSize,maxResults:this.query.maxResults??2e4,previewOptions:this.query.previewOptions??fP,surroundingContext:this.query.surroundingContext??0};`usePCRE2`in this.query&&(s.usePCRE2=this.query.usePCRE2);let c;return c=this.queryProviderPair.query.type===KN.aiText?await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,s,o,n):await this.queryProviderPair.provider.provideTextSearchResults(UV(this.queryProviderPair.query.contentPattern),s,o,n),a.length&&await Promise.all(a),c}getSearchOptionsForFolder(e){let t=aP(this.query.includePattern,e.includePattern),n=e.excludePattern?.map(e=>({folder:e.folder,patterns:aP(this.query.excludePattern,e.pattern)}));(!n||n.length===0)&&(n=[{folder:void 0,patterns:aP(this.query.excludePattern,void 0)}]);let r=dP(n);return{folder:w.from(e.folder),excludes:r,includes:t,useIgnoreFiles:{local:!e.disregardIgnoreFiles,parent:!e.disregardParentIgnoreFiles,global:!e.disregardGlobalIgnoreFiles},followSymlinks:!e.ignoreSymlinks,encoding:(e.fileEncoding&&this.fileUtils.toCanonicalName(e.fileEncoding))??``,ignoreGlobCase:this.query.ignoreGlobCase||e.ignoreGlobCase}}};function UV(e){return{isCaseSensitive:e.isCaseSensitive||!1,isRegExp:e.isRegExp||!1,isWordMatch:e.isWordMatch||!1,isMultiline:e.isMultiline||!1,pattern:e.pattern}}var WV=class{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new KV(512,e=>this.sendItems(e))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!$a(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||=(this._currentFolderIdx=t,this._currentUri=e.uri,{resource:e.uri,results:[]}),this._currentFileMatch.results.push(GV(e))}pushToCollector(){let e=this._currentFileMatch&&this._currentFileMatch.results?this._currentFileMatch.results.length:0;this._batchedCollector.addItem(this._currentFileMatch,e)}flush(){this.pushToCollector(),this._batchedCollector.flush()}sendItems(e){this._onResult(e)}};function GV(e){return e instanceof BN?{previewText:e.previewText,rangeLocations:e.ranges.map(e=>({preview:{startLineNumber:e.previewRange.start.line,startColumn:e.previewRange.start.character,endLineNumber:e.previewRange.end.line,endColumn:e.previewRange.end.character},source:{startLineNumber:e.sourceRange.start.line,startColumn:e.sourceRange.start.character,endLineNumber:e.sourceRange.end.line,endColumn:e.sourceRange.end.character}}))}:{text:e.text,lineNumber:e.lineNumber}}var KV=class e{static{this.TIMEOUT=4e3}static{this.START_BATCH_AFTER_COUNT=50}constructor(e,t){this.maxBatchSize=e,this.cb=t,this.totalNumberCompleted=0,this.batch=[],this.batchSize=0}addItem(e,t){e&&this.addItemToBatch(e,t)}addItems(e,t){e&&this.addItemsToBatch(e,t)}addItemToBatch(e,t){this.batch.push(e),this.batchSize+=t,this.onUpdate()}addItemsToBatch(e,t){this.batch=this.batch.concat(e),this.batchSize+=t,this.onUpdate()}onUpdate(){this.totalNumberCompleted<e.START_BATCH_AFTER_COUNT||this.batchSize>=this.maxBatchSize?this.flush():this.timeoutHandle||=setTimeout(()=>{this.flush()},e.TIMEOUT)}flush(){this.batchSize&&(this.totalNumberCompleted+=this.batchSize,this.cb(this.batch),this.batch=[],this.batchSize=0,this.timeoutHandle&&=(clearTimeout(this.timeoutHandle),void 0))}};const qV=k(`IExtHostSearch`);let JV=class{constructor(e,t,n){this.extHostRpc=e,this._uriTransformer=t,this._logService=n,this._proxy=this.extHostRpc.getProxy(E.MainThreadSearch),this._handlePool=0,this._textSearchProvider=new Map,this._textSearchUsedSchemes=new Set,this._aiTextSearchProvider=new Map,this._aiTextSearchUsedSchemes=new Set,this._fileSearchProvider=new Map,this._fileSearchUsedSchemes=new Set,this._fileSearchManager=new VV}_transformScheme(e){return this._uriTransformer.transformOutgoingScheme(e)}registerTextSearchProviderOld(e,t){if(this._textSearchUsedSchemes.has(e))throw Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);let n=this._handlePool++;return this._textSearchProvider.set(n,new FV(t)),this._proxy.$registerTextSearchProvider(n,this._transformScheme(e)),_(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerTextSearchProvider(e,t){if(this._textSearchUsedSchemes.has(e))throw Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);let n=this._handlePool++;return this._textSearchProvider.set(n,t),this._proxy.$registerTextSearchProvider(n,this._transformScheme(e)),_(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerAITextSearchProvider(e,t){if(this._aiTextSearchUsedSchemes.has(e))throw Error(`an AI text search provider for the scheme '${e}'is already registered`);this._aiTextSearchUsedSchemes.add(e);let n=this._handlePool++;return this._aiTextSearchProvider.set(n,t),this._proxy.$registerAITextSearchProvider(n,this._transformScheme(e)),_(()=>{this._aiTextSearchUsedSchemes.delete(e),this._aiTextSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerFileSearchProviderOld(e,t){if(this._fileSearchUsedSchemes.has(e))throw Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);let n=this._handlePool++;return this._fileSearchProvider.set(n,new jV(t)),this._proxy.$registerFileSearchProvider(n,this._transformScheme(e)),_(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerFileSearchProvider(e,t){if(this._fileSearchUsedSchemes.has(e))throw Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);let n=this._handlePool++;return this._fileSearchProvider.set(n,t),this._proxy.$registerFileSearchProvider(n,this._transformScheme(e)),_(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}$provideFileSearchResults(e,t,n,r){let i=YV(n),a=this._fileSearchProvider.get(e);if(a)return this._fileSearchManager.fileSearch(i,a,n=>{this._proxy.$handleFileMatch(e,t,n.map(e=>e.resource))},r);throw Error(`unknown provider: `+e)}async doInternalFileSearchWithCustomCallback(e,t,n){return{messages:[]}}$clearCache(e){return this._fileSearchManager.clearCache(e),Promise.resolve(void 0)}$provideTextSearchResults(e,t,n,r){let i=this._textSearchProvider.get(e);if(!i||!i.provideTextSearchResults)throw Error(`Unknown Text Search Provider ${e}`);let a=YV(n);return this.createTextSearchManager(a,i).search(n=>this._proxy.$handleTextMatch(e,t,n),r)}$provideAITextSearchResults(e,t,n,r){let i=this._aiTextSearchProvider.get(e);if(!i||!i.provideAITextSearchResults)throw Error(`Unknown AI Text Search Provider ${e}`);let a=YV(n);return this.createAITextSearchManager(a,i).search(n=>this._proxy.$handleTextMatch(e,t,n),r,n=>this._proxy.$handleKeywordResult(e,t,n))}$enableExtensionHostSearch(){}async $getAIName(e){let t=this._aiTextSearchProvider.get(e);if(!(!t||!t.provideAITextSearchResults))return t.name??`AI`}createTextSearchManager(e,t){return new HV({query:e,provider:t},{readdir:e=>Promise.resolve([]),toCanonicalName:e=>e},`textSearchProvider`)}createAITextSearchManager(e,t){return new HV({query:e,provider:t},{readdir:e=>Promise.resolve([]),toCanonicalName:e=>e},`aiTextSearchProvider`)}};JV=A([j(0,Hs),j(1,Ws),j(2,Ds)],JV);function YV(e){return{...e,folderQueries:e.folderQueries&&e.folderQueries.map(XV),extraFileResources:e.extraFileResources&&e.extraFileResources.map(e=>w.revive(e))}}function XV(e){return Hu(e)}let ZV=class extends y{constructor(e){super(),this._onDidSuspend=this._register(new S),this.onDidSuspend=this._onDidSuspend.event,this._onDidResume=this._register(new S),this.onDidResume=this._onDidResume.event,this._onDidChangeOnBatteryPower=this._register(new S),this.onDidChangeOnBatteryPower=this._onDidChangeOnBatteryPower.event,this._onDidChangeThermalState=this._register(new S),this.onDidChangeThermalState=this._onDidChangeThermalState.event,this._onDidChangeSpeedLimit=this._register(new S),this.onDidChangeSpeedLimit=this._onDidChangeSpeedLimit.event,this._onWillShutdown=this._register(new S),this.onWillShutdown=this._onWillShutdown.event,this._onDidLockScreen=this._register(new S),this.onDidLockScreen=this._onDidLockScreen.event,this._onDidUnlockScreen=this._register(new S),this.onDidUnlockScreen=this._onDidUnlockScreen.event,this._proxy=e.getProxy(E.MainThreadPower)}$onDidSuspend(){this._onDidSuspend.fire()}$onDidResume(){this._onDidResume.fire()}$onDidChangeOnBatteryPower(e){this._onDidChangeOnBatteryPower.fire(e)}$onDidChangeThermalState(e){this._onDidChangeThermalState.fire(e)}$onDidChangeSpeedLimit(e){this._onDidChangeSpeedLimit.fire(e)}$onWillShutdown(){this._onWillShutdown.fire()}$onDidLockScreen(){this._onDidLockScreen.fire()}$onDidUnlockScreen(){this._onDidUnlockScreen.fire()}getSystemIdleState(e){return this._proxy.$getSystemIdleState(e)}getSystemIdleTime(){return this._proxy.$getSystemIdleTime()}getCurrentThermalState(){return this._proxy.$getCurrentThermalState()}isOnBatteryPower(){return this._proxy.$isOnBatteryPower()}async startPowerSaveBlocker(e){let t=await this._proxy.$startPowerSaveBlocker(e),n=this._proxy,r=t>=0,i=!1;return{id:t,get isStarted(){return r&&!i},dispose:()=>{r&&!i&&(i=!0,n.$stopPowerSaveBlocker(t))}}}};ZV=A([j(0,Hs)],ZV);const QV=k(`IExtHostPower`),$V=k(`IExtHostTerminalShellIntegration`);let eH=class extends y{constructor(e,t){super(),this._extHostTerminalService=t,this._activeShellIntegrations=new Map,this._onDidChangeTerminalShellIntegration=this._register(new S),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidStartTerminalShellExecution=this._register(new S),this.onDidStartTerminalShellExecution=this._onDidStartTerminalShellExecution.event,this._onDidEndTerminalShellExecution=this._register(new S),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._proxy=e.getProxy(E.MainThreadTerminalShellIntegration),this._register(_(()=>{for(let[e,t]of this._activeShellIntegrations)t.dispose();this._activeShellIntegrations.clear()}))}$shellIntegrationChange(e,t){let n=this._extHostTerminalService.getTerminalById(e);if(!n)return;let r=n.value,i=this._activeShellIntegrations.get(e);i||(i=new tH(n.value,t,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,i),i.store.add(n.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),i.store.add(i.onDidRequestShellExecution(t=>this._proxy.$executeCommand(e,t))),i.store.add(i.onDidRequestEndExecution(e=>this._onDidEndTerminalShellExecution.fire(e))),i.store.add(i.onDidRequestChangeShellIntegration(e=>this._onDidChangeTerminalShellIntegration.fire(e))),n.shellIntegration=i.value),this._onDidChangeTerminalShellIntegration.fire({terminal:r,shellIntegration:i.value})}$shellExecutionStart(e,t,n,r,i,a){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e,t);let o={value:n,confidence:r,isTrusted:i};this._activeShellIntegrations.get(e)?.startShellExecution(o,this._convertCwdToUri(a))}$shellExecutionEnd(e,t,n,r,i){let a={value:t,confidence:n,isTrusted:r};this._activeShellIntegrations.get(e)?.endShellExecution(a,i)}$shellExecutionData(e,t){this._activeShellIntegrations.get(e)?.emitData(t)}$shellEnvChange(e,t,n,r){this._activeShellIntegrations.get(e)?.setEnv(t,n,r)}$cwdChange(e,t){this._activeShellIntegrations.get(e)?.setCwd(this._convertCwdToUri(t))}$closeTerminal(e){this._activeShellIntegrations.get(e)?.dispose(),this._activeShellIntegrations.delete(e)}_convertCwdToUri(e){return e?w.file(e):void 0}};eH=A([j(0,Hs),j(1,HI)],eH);var tH=class extends y{get currentExecution(){return this._currentExecution}constructor(e,t,n){super(),this._terminal=e,this._onDidStartTerminalShellExecution=n,this._pendingExecutions=[],this.store=this._register(new v),this._onDidRequestChangeShellIntegration=this._register(new S),this.onDidRequestChangeShellIntegration=this._onDidRequestChangeShellIntegration.event,this._onDidRequestShellExecution=this._register(new S),this.onDidRequestShellExecution=this._onDidRequestShellExecution.event,this._onDidRequestEndExecution=this._register(new S),this.onDidRequestEndExecution=this._onDidRequestEndExecution.event,this._onDidRequestNewExecution=this._register(new S),this.onDidRequestNewExecution=this._onDidRequestNewExecution.event;let r=this;this.value={get cwd(){return r._cwd},get env(){if(r._env)return Object.freeze({isTrusted:r._env.isTrusted,value:Object.freeze({...r._env.value})})},executeCommand(e,n){if(!t)throw Error(`This terminal does not support the executeCommand API.`);let i=e;if(n)for(let e of n)!e.match(/["'`]/)&&e.match(/\s/)?i+=` "${e}"`:i+=` ${e}`;r._onDidRequestShellExecution.fire(i);let a={value:i,confidence:KE.High,isTrusted:!0};return r.requestNewShellExecution(a,r._cwd).value}}}requestNewShellExecution(e,t){let n=new nH(e,t??this._cwd);return iH(e.value).length>1&&(this._currentExecutionProperties={isMultiLine:!0,unresolvedCommandLines:iH(e.value)}),this._pendingExecutions.push(n),this._onDidRequestNewExecution.fire(e.value),n}startShellExecution(e,t){if(this._pendingEndingExecution&&=(this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._pendingEndingExecution.value,exitCode:void 0}),void 0),this._currentExecution){if(this._currentExecutionProperties?.isMultiLine&&this._currentExecutionProperties.unresolvedCommandLines){let t=aH(this._currentExecutionProperties.unresolvedCommandLines,e);if(t){this._currentExecutionProperties.unresolvedCommandLines=t.unresolvedCommandLines;return}}this._currentExecution.endExecution(void 0),this._currentExecution.flush(),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:void 0})}let n;if(e.confidence===KE.High)for(let[t,r]of this._pendingExecutions.entries())if(r.value.commandLine.value===e.value){n=r,this._currentExecutionProperties={isMultiLine:!1,unresolvedCommandLines:void 0},n=r,this._pendingExecutions.splice(t,1);break}else{let i=aH(iH(r.value.commandLine.value),e);if(i){this._currentExecutionProperties={isMultiLine:!0,unresolvedCommandLines:i.unresolvedCommandLines},n=r,this._pendingExecutions.splice(t,1);break}}else n=this._pendingExecutions.shift();n||=new nH(e,t??this._cwd),this._currentExecution=n,this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value})}emitData(e){this.currentExecution?.emitData(e)}endShellExecution(e,t){if(!(this._currentExecutionProperties?.isMultiLine&&this._currentExecutionProperties.unresolvedCommandLines&&this._currentExecutionProperties.unresolvedCommandLines.length>0)&&this._currentExecution){let n=this._currentExecutionProperties?.isMultiLine?this._currentExecution.value.commandLine:e;this._currentExecution.endExecution(n);let r=this._currentExecution;this._pendingEndingExecution=r,this._currentExecution=void 0,r.flush().then(()=>{this._pendingEndingExecution===r&&(this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:r.value,exitCode:t}),this._pendingEndingExecution=void 0)})}}setEnv(e,t,n){let r={};for(let n=0;n<e.length;n++)r[e[n]]=t[n];this._env={value:r,isTrusted:n},this._fireChangeEvent()}setCwd(e){let t=!1;w.isUri(this._cwd)?t=!w.isUri(e)||this._cwd.toString()!==e.toString():this._cwd!==e&&(t=!0),t&&(this._cwd=e,this._fireChangeEvent())}_fireChangeEvent(){this._onDidRequestChangeShellIntegration.fire({terminal:this._terminal,shellIntegration:this.value})}},nH=class{constructor(e,t){this._commandLine=e,this.cwd=t,this._isEnded=!1;let n=this;this.value={get commandLine(){return n._commandLine},get cwd(){return n.cwd},read(){return n._createDataStream()}}}_createDataStream(){if(!this._dataStream){if(this._isEnded)return Vo.EMPTY;this._dataStream=new rH}return this._dataStream.createIterable()}emitData(e){this._isEnded||this._dataStream?.emitData(e)}endExecution(e){e&&(this._commandLine=e),this._dataStream?.endExecution(),this._isEnded=!0}async flush(){this._dataStream&&=(await this._dataStream.flush(),this._dataStream.dispose(),void 0)}},rH=class extends y{constructor(){super(...arguments),this._iterables=[],this._emitters=[]}createIterable(){this._barrier||=new To;let e=this._barrier,t=new Vo(async t=>{this._emitters.push(t),await e.wait()});return this._iterables.push(t),t}emitData(e){for(let t of this._emitters)t.emitOne(e)}endExecution(){this._barrier?.open()}async flush(){await Promise.all(this._iterables.map(e=>e.toPromise()))}};function iH(e){return e.split(`
104
- `).map(e=>e.trim()).filter(e=>e.length>0)}function aH(e,t){if(e.length===0)return!1;let n=[...e],r=iH(t.value);if(n&&n.length>0){for(;n.length>0&&n[0]===r[0];)n.shift(),r.shift();if(r.length===0)return{unresolvedCommandLines:n}}return!1}var oH;(function(e){e[e.CR=13]=`CR`,e[e.LF=10]=`LF`,e[e.COLON=58]=`COLON`,e[e.SPACE=32]=`SPACE`})(oH||={});var sH=class{constructor(e){this.dataBuffer=``,this.eventTypeBuffer=``,this.buffer=[],this.endedOnCR=!1,this.onEventHandler=e,this.decoder=new TextDecoder(`utf-8`)}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let t=0;for(this.endedOnCR&&e[0]===oH.LF&&t++,this.endedOnCR=!1;t<e.length;){let n=e.indexOf(oH.CR,t),r=e.indexOf(oH.LF,t),i=n===-1?r:r===-1?n:Math.min(n,r);if(i===-1)break;let a=``;for(let e of this.buffer)a+=this.decoder.decode(e,{stream:!0});a+=this.decoder.decode(e.subarray(t,i)),this.processLine(a),this.buffer.length=0,t=i+(e[i]===oH.CR&&e[i+1]===oH.LF?2:1)}t<e.length?this.buffer.push(e.subarray(t)):this.endedOnCR=e[e.length-1]===oH.CR}processLine(e){if(!e.length){this.dispatchEvent();return}if(e.startsWith(`:`))return;let t,n,r=e.indexOf(`:`);r===-1?(t=e,n=``):(t=e.substring(0,r),n=e.substring(r+1),n.startsWith(` `)&&(n=n.substring(1))),this.processField(t,n)}processField(e,t){switch(e){case`event`:this.eventTypeBuffer=t;break;case`data`:this.dataBuffer+=t,this.dataBuffer+=`
105
- `;break;case`id`:t.includes(`\0`)?this.currentEventId=void 0:this.currentEventId=this.lastEventIdBuffer=t;break;case`retry`:/^\d+$/.test(t)&&(this.reconnectionTime=parseInt(t,10));break}}dispatchEvent(){if(this.dataBuffer===``){this.dataBuffer=``,this.eventTypeBuffer=``;return}this.dataBuffer.endsWith(`
106
- `)&&(this.dataBuffer=this.dataBuffer.substring(0,this.dataBuffer.length-1));let e={type:this.eventTypeBuffer||`message`,data:this.dataBuffer};this.currentEventId!==void 0&&(e.id=this.currentEventId),this.reconnectionTime!==void 0&&(e.retry=this.reconnectionTime),this.onEventHandler(e),this.reset()}reset(){this.dataBuffer=``,this.eventTypeBuffer=``,this.currentEventId=void 0}},cH=class{validateOrThrow(e){let t=this.validate(e);if(t.error)throw Error(t.error.message);return t.content}},lH=class extends cH{constructor(e){super(),this.type=e}validate(e){return typeof e===this.type?{content:e,error:void 0}:{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}}getJSONSchema(){return{type:this.type}}};const uH=new lH(`string`);function dH(){return uH}const fH=new lH(`number`);function pH(){return fH}new lH(`boolean`);const mH=new lH(`object`);function hH(){return mH}var gH=class{constructor(e){this.validator=e}};function _H(e){return new gH(e)}var vH=class extends cH{constructor(e){super(),this.properties=e}validate(e){if(typeof e!=`object`||!e)return{content:void 0,error:{message:`Expected object`}};let t={};for(let n in this.properties){let r=this.properties[n],i=e[n],a=r instanceof gH,o=a?r.validator:r;if(a&&i===void 0)continue;let{content:s,error:c}=o.validate(i);if(c)return{content:void 0,error:{message:`Error in property '${n}': ${c.message}`}};t[n]=s}return{content:t,error:void 0}}getJSONSchema(){let e=[],t={};for(let[n,r]of Object.entries(this.properties)){let i=r instanceof gH;t[n]=(i?r.validator:r).getJSONSchema(),i||e.push(n)}return{type:`object`,properties:t,...e.length>0?{required:e}:{}}}};function yH(e){return new vH(e)}var bH=class extends cH{constructor(e){super(),this.validator=e}validate(e){if(!Array.isArray(e))return{content:void 0,error:{message:`Expected array`}};let t=[];for(let n=0;n<e.length;n++){let{content:r,error:i}=this.validator.validate(e[n]);if(i)return{content:void 0,error:{message:`Error in element ${n}: ${i.message}`}};t.push(r)}return{content:t,error:void 0}}getJSONSchema(){return{type:`array`,items:this.validator.getJSONSchema()}}};function xH(e){return new bH(e)}const SH=k(`IExtHostMpcService`),CH=yH({label:dH(),version:_H(dH()),metadata:_H(yH({capabilities:_H(hH()),serverInfo:_H(hH()),tools:_H(xH(yH({availability:pH(),definition:hH()})))})),authentication:_H(yH({providerId:dH(),scopes:xH(dH())}))});let wH=class extends y{constructor(e,t,n,r,i){super(),this._logService=t,this._extHostInitData=n,this._workspaceService=r,this._variableResolver=i,this._initialProviderPromises=new Set,this._sseEventSources=this._register(new yt),this._unresolvedMcpServers=new Map,this._onDidChangeMcpServerDefinitions=this._register(new S),this.onDidChangeMcpServerDefinitions=this._onDidChangeMcpServerDefinitions.event,this._mcpServerDefinitions=[],this._activeGateways=new Map,this._proxy=e.getProxy(E.MainThreadMcp)}get mcpServerDefinitions(){return this._mcpServerDefinitions}$onDidChangeMcpServerDefinitions(e){this._mcpServerDefinitions=e.map(e=>FN.to(e)),this._onDidChangeMcpServerDefinitions.fire()}$startMcp(e,t){this._startMcp(e,oS.fromSerialized(t.launch),t.defaultCwd&&w.revive(t.defaultCwd),t.errorOnUserInteraction)}_startMcp(e,t,n,r){if(t.type===aS.HTTP){this._sseEventSources.set(e,new OH(e,t,this._proxy,this._logService,r));return}throw Error(`not implemented`)}async $substituteVariables(e,t){let n=w.revive(e),r=n&&await this._workspaceService.resolveWorkspaceFolder(n);return(await this._variableResolver.getResolver()).resolveAsync(r&&{uri:r.uri,name:r.name,index:r.index},t)}$stopMcp(e){this._sseEventSources.get(e)?.close().then(()=>this._didClose(e))}_didClose(e){this._sseEventSources.deleteAndDispose(e)}$sendMessage(e,t){this._sseEventSources.get(e)?.send(t)}async $waitForInitialCollectionProviders(){await Promise.all(this._initialProviderPromises)}async $resolveMcpLaunch(e,t){let n=this._unresolvedMcpServers.get(e);if(!n)return;let r=n.servers.find(e=>e.label===t);if(!r)return;if(!n.provider.resolveMcpServerDefinition)return FN.from(r);let i=await n.provider.resolveMcpServerDefinition(r,Pi.None);return i?FN.from(i):void 0}registerMcpConfigurationProvider(e,t,n){let r=new v,i=e.contributes?.mcpServerDefinitionProviders?.find(e=>e.id===t);if(!i)throw Error(`MCP configuration providers must be registered in the contributes.mcpServerDefinitionProviders array within your package.json, but "${t}" was not`);let a={id:Jx(e.identifier,t),isTrustedByDefault:!0,label:i?.label??e.displayName??e.name,scope:Zg.WORKSPACE,canResolveLaunch:typeof n.resolveMcpServerDefinition==`function`,extensionId:e.identifier.value,configTarget:this._extHostInitData.remote.isRemote?Gh.USER_REMOTE:Gh.USER},o=async()=>{let t=await n.provideMcpServerDefinitions(Pi.None);this._unresolvedMcpServers.set(a.id,{servers:t??[],provider:n});let r=[];for(let n of t??[]){let t=ys.toKey(e.identifier)+`/`+n.label;if(r.some(e=>e.id===t)){let e=2;for(;r.some(n=>n.id===t+e);)e++;t+=e}CH.validateOrThrow(n),n.authentication&&K(e,`mcpToolDefinitions`);let i,a=n;Dw(e)&&a.metadata&&(i={capabilities:a.metadata.capabilities,instructions:a.metadata.instructions,serverInfo:a.metadata.serverInfo,tools:a.metadata.tools?.map(e=>({availability:e.availability===tj.Dynamic?Zx.Dynamic:Zx.Initial,definition:e.definition}))}),r.push({id:t,label:n.label,cacheNonce:n.version||`$$NONE`,staticMetadata:i,launch:FN.from(n)})}this._proxy.$upsertMcpCollection(a,r)};r.add(_(()=>{this._unresolvedMcpServers.delete(a.id),this._proxy.$deleteMcpCollection(a.id)})),n.onDidChangeMcpServerDefinitions&&r.add(n.onDidChangeMcpServerDefinitions(o)),n.onDidChangeServerDefinitions&&r.add(n.onDidChangeServerDefinitions(o)),n.onDidChange&&r.add(n.onDidChange(o));let s=new Promise(e=>{setTimeout(()=>o().finally(()=>{this._initialProviderPromises.delete(s),e()}),0)});return this._initialProviderPromises.add(s),r}async startMcpGateway(e){let t=await this._proxy.$startMcpGateway(e?.toJSON());if(!t)return;let n=t.gatewayId,r=t.servers.map(e=>({label:e.label,address:w.revive(e.address)})),i=new S;return this._activeGateways.set(n,{servers:r,onDidChangeServers:i}),{get servers(){return r},onDidChangeServers:i.event,dispose:()=>{this._activeGateways.delete(n),i.dispose(),this._proxy.$disposeMcpGateway(n)}}}$onDidChangeGatewayServers(e,t){let n=this._activeGateways.get(e);if(!n)return;let r=t.map(e=>({label:e.label,address:w.revive(e.address)}));n.servers.length=0,n.servers.push(...r),n.onDidChangeServers.fire(r)}};wH=A([j(0,Hs),j(1,Ds),j(2,Fs),j(3,YP),j(4,yV)],wH);function TH(e){if(!(e instanceof Error))return String(e);let t=String(e),n=e.cause;for(let e=0;n!==void 0&&e<5;e++)t+=`: ${n instanceof Error&&n.message||String(n)}`,n=n instanceof Error?n.cause:void 0;return t}var EH;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Http=1]=`Http`,e[e.SSE=2]=`SSE`})(EH||={});const DH=[301,302,303,307,308];var OH=class extends y{constructor(e,t,n,r,i){super(),this._id=e,this._launch=t,this._proxy=n,this._logService=r,this._errorOnUserInteraction=i,this._requestSequencer=new yo,this._postEndpoint=new Ro,this._mode={value:EH.Unknown},this._cts=new Ii,this._abortCtrl=new AbortController,this._didSendClose=!1,this._register(_(()=>{this._abortCtrl.abort(),this._cts.dispose(!0)})),this._proxy.$onDidChangeState(this._id,{state:sS.Kind.Running})}async send(e){try{this._mode.value===EH.Unknown?await this._requestSequencer.queue(()=>this._send(e)):await this._send(e)}catch(e){let t=`Error sending message to ${this._launch.uri}: ${TH(e)}`;this._proxy.$onDidChangeState(this._id,{state:sS.Kind.Error,message:t})}}async close(){if(this._mode.value===EH.Http&&this._mode.sessionId&&!this._didSendClose){this._didSendClose=!0;try{await this._closeSession(this._mode.sessionId)}catch{}}this._proxy.$onDidChangeState(this._id,{state:sS.Kind.Stopped})}async _closeSession(e){let t={...Object.fromEntries(this._launch.headers),"Mcp-Session-Id":e};try{await this._addAuthHeader(t,{errorOnUserInteraction:!0})}catch{this._log(U.Debug,`Skipping session close: authentication no longer available`);return}await this._fetch(this._launch.uri.toString(!0),{method:`DELETE`,headers:t})}_send(e){return this._mode.value===EH.SSE?this._sendLegacySSE(this._mode.endpoint,e):this._sendStreamableHttp(e,this._mode.value===EH.Http?this._mode.sessionId:void 0)}async _sendStreamableHttp(e,t){let n=new TextEncoder().encode(e),r={...Object.fromEntries(this._launch.headers),"Content-Type":`application/json`,Accept:`text/event-stream, application/json`};t&&(r[`Mcp-Session-Id`]=t),await this._addAuthHeader(r);let i=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:`POST`,headers:r,body:n},r),a=this._mode.value===EH.Unknown,o=i.headers.get(`Mcp-Session-Id`);if(o&&(this._mode={value:EH.Http,sessionId:o}),this._mode.value===EH.Unknown&&i.status>=400&&i.status<500&&!AH(i.status)){this._log(U.Info,`${i.status} status sending message to ${this._launch.uri}, will attempt to fall back to legacy SSE`),this._sseFallbackWithMessage(e);return}if(i.status>=300){let e=this._mode.value===EH.Http&&!!this._mode.sessionId&&(i.status===400||i.status===404);this._proxy.$onDidChangeState(this._id,{state:sS.Kind.Error,message:`${i.status} status sending message to ${this._launch.uri}: ${await this._getErrText(i)}`+(e?`; will retry with new session ID`:``),shouldRetry:e});return}this._mode.value===EH.Unknown&&(this._mode={value:EH.Http,sessionId:void 0}),a&&this._attachStreamableBackchannel(),await this._handleSuccessfulStreamableHttp(i,e)}async _sseFallbackWithMessage(e){let t=await this._attachSSE();t&&(this._mode={value:EH.SSE,endpoint:t},await this._sendLegacySSE(t,e))}async _handleSuccessfulStreamableHttp(e,t){if(e.status===202)return;let n=e.headers.get(`Content-Type`)?.toLowerCase()||``;if(n.startsWith(`text/event-stream`)){let n=new sH(e=>{if(e.type===`message`)this._proxy.$onDidReceiveMessage(this._id,e.data);else if(e.type===`endpoint`)throw this._log(U.Warning,`Received SSE endpoint from a POST to ${this._launch.uri}, will fall back to legacy SSE`),this._sseFallbackWithMessage(t),new f});try{await this._doSSE(n,e)}catch(e){this._log(U.Warning,`Error reading SSE stream: ${TH(e)}`)}}else if(n.startsWith(`application/json`))this._proxy.$onDidReceiveMessage(this._id,await e.text());else{let t=await e.text();kH(t)?this._proxy.$onDidReceiveMessage(this._id,t):this._log(U.Warning,`Unexpected ${e.status} response for request: ${t}`)}}async _attachStreamableBackchannel(){let e,t;for(let n=0;!this._store.isDisposed;n++){t===void 0?await Eo(Math.min(n*1e3,3e4),this._cts.token):(await Eo(Math.max(0,t-Date.now()),this._cts.token),t=void 0);let r;try{let t={...Object.fromEntries(this._launch.headers),Accept:`text/event-stream`};await this._addAuthHeader(t),this._mode.value===EH.Http&&this._mode.sessionId!==void 0&&(t[`Mcp-Session-Id`]=this._mode.sessionId),e&&(t[`Last-Event-ID`]=e),r=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:`GET`,headers:t},t)}catch{this._log(U.Info,`Error connecting to ${this._launch.uri} for async notifications, will retry`);continue}if(r.status>=400){this._log(U.Debug,`${r.status} status connecting to ${this._launch.uri} for async notifications; they will be disabled: ${await this._getErrText(r)}`);return}r.headers.get(`content-type`)?.toLowerCase().includes(`text/event-stream`)&&(n=0);let i=new sH(n=>{n.retry&&(t=Date.now()+n.retry),n.type===`message`&&n.data&&this._proxy.$onDidReceiveMessage(this._id,n.data),n.id&&(e=n.id)});try{await this._doSSE(i,r)}catch(e){this._log(U.Info,`Error reading from async stream, we will reconnect: ${e}`)}}}async _attachSSE(){let e=new Ro,t={...Object.fromEntries(this._launch.headers),Accept:`text/event-stream`};await this._addAuthHeader(t);let n;try{if(n=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:`GET`,headers:t},t),n.status>=300){this._proxy.$onDidChangeState(this._id,{state:sS.Kind.Error,message:`${n.status} status connecting to ${this._launch.uri} as SSE: ${await this._getErrText(n)}`});return}}catch(e){this._proxy.$onDidChangeState(this._id,{state:sS.Kind.Error,message:`Error connecting to ${this._launch.uri} as SSE: ${e}`});return}let r=new sH(t=>{t.type===`message`?this._proxy.$onDidReceiveMessage(this._id,t.data):t.type===`endpoint`&&e.complete(new URL(t.data,this._launch.uri.toString(!0)).toString())});return this._register(_(()=>e.cancel())),this._doSSE(r,n).catch(e=>{this._proxy.$onDidChangeState(this._id,{state:sS.Kind.Error,message:`Error reading SSE stream: ${TH(e)}`})}),e.p}async _sendLegacySSE(e,t){let n=new TextEncoder().encode(t),r={...Object.fromEntries(this._launch.headers),"Content-Type":`application/json`};await this._addAuthHeader(r);let i=await this._fetch(e,{method:`POST`,headers:r,body:n});i.status>=300&&this._log(U.Warning,`${i.status} status sending message to ${this._postEndpoint}: ${await this._getErrText(i)}`)}async _doSSE(e,t){if(!t.body)return;let n=t.body.getReader(),r;do{try{r=await ho(n.read(),this._cts.token)}catch(e){if(n.cancel(),this._store.isDisposed)return;throw e}r.value&&e.feed(r.value)}while(!r.done)}async _addAuthHeader(e,t){let n=t?.errorOnUserInteraction??this._errorOnUserInteraction;if(this._authMetadata)try{let r={authorizationServer:this._authMetadata.authorizationServer.toJSON(),authorizationServerMetadata:this._authMetadata.serverMetadata,resourceMetadata:this._authMetadata.resourceMetadata,scopes:this._authMetadata.scopes,clientId:this._launch.oauth?.clientId,enterpriseManaged:this._launch.oauth?.enterpriseManaged},i=await this._proxy.$getTokenFromServerMetadata(this._id,r,{errorOnUserInteraction:n,forceNewRegistration:t?.forceNewRegistration});i&&(e.Authorization=`Bearer ${i}`)}catch(e){if(cS.is(e))throw this._proxy.$onDidChangeState(this._id,{state:sS.Kind.Stopped,reason:`needs-user-interaction`}),new f;this._log(U.Warning,`Error getting token from server metadata: ${String(e)}`)}if(this._launch.authentication)try{this._log(U.Debug,`Using provided authentication config: providerId=${this._launch.authentication.providerId}, scopes=${this._launch.authentication.scopes.join(`, `)}`);let r=await this._proxy.$getTokenForProviderId(this._id,this._launch.authentication.providerId,this._launch.authentication.scopes,{errorOnUserInteraction:n,forceNewRegistration:t?.forceNewRegistration,clientId:this._launch.oauth?.clientId});r&&(e.Authorization=`Bearer ${r}`,this._log(U.Info,`Successfully obtained token from provided authentication config`))}catch(e){if(cS.is(e))throw this._proxy.$onDidChangeState(this._id,{state:sS.Kind.Stopped,reason:`needs-user-interaction`}),new f;this._log(U.Warning,`Error getting token from provided authentication config: ${String(e)}`)}return e}_log(e,t){this._store.isDisposed||this._proxy.$onDidPublishLog(this._id,e,t)}async _getErrText(e){try{return await e.text()}catch{return e.statusText}}async _fetchWithAuthRetry(e,t,n){let r=()=>this._fetch(e,t),i=await r();if(AH(i.status)&&(this._authMetadata?this._authMetadata.update(i.headers)&&(await this._addAuthHeader(n),n.Authorization&&(t.headers=n,i=await r())):(this._authMetadata=await MH(e,i.headers,{sameOriginHeaders:{...Object.fromEntries(this._launch.headers),"MCP-Protocol-Version":Kx.LATEST_PROTOCOL_VERSION},fetch:(e,t)=>this._fetch(e,t),log:(e,t)=>this._log(e,t)}),this._proxy.$logMcpAuthSetup(this._authMetadata.telemetry),await this._addAuthHeader(n),n.Authorization&&(t.headers=n,i=await r()))),n.Authorization&&AH(i.status)){let e=await this._getErrText(i);this._log(U.Info,`Received ${i.status} status with Authorization header, retrying with new auth registration. Error details: ${e||`no additional details`}`),await this._addAuthHeader(n,{forceNewRegistration:!0}),i=await r()}return i}async _fetch(e,t){if(t.headers[`user-agent`]=`${xh.nameLong}/${xh.version}`,Ih(this._logService.getLevel(),U.Trace)){let n={...t,headers:{...t.headers}};n.body&&=new TextDecoder().decode(n.body),n.headers?.Authorization&&(n.headers.Authorization=`***`),this._log(U.Trace,`Fetching ${e} with options: ${JSON.stringify(n)}`)}let n=e,r;for(let e=0;e<5&&(r=await this._fetchInternal(n,{...t,signal:this._abortCtrl.signal,redirect:`manual`}),DH.includes(r.status));e++){let e=r.headers.get(`location`);if(!e)break;let i=new URL(e,n).toString();this._log(U.Trace,`Redirect (${r.status}) from ${n} to ${i}`),n=i,(r.status===303||(r.status===301||r.status===302)&&t.method===`POST`)&&(t.method=`GET`,delete t.body)}if(Ih(this._logService.getLevel(),U.Trace)){let e={};r.headers.forEach((t,n)=>{e[n]=t}),this._log(U.Trace,`Fetched ${n}: ${JSON.stringify({status:r.status,headers:e})}`)}return r}_fetchInternal(e,t){return fetch(e,t)}};function kH(e){try{return JSON.parse(e),!0}catch{return!1}}function AH(e){return e===401||e===403}var jH=class{constructor(e,t,n,r,i,a){this.authorizationServer=e,this.serverMetadata=t,this.resourceMetadata=n,this.telemetry=i,this._log=a,this._scopes=r}get scopes(){return this._scopes}update(e){let t=this._parseScopesFromResponse(e);return xL(t,this._scopes)?!1:(this._log(U.Info,`Scopes changed from ${JSON.stringify(this._scopes)} to ${JSON.stringify(t)}, updating`),this._scopes=t,!0)}_parseScopesFromResponse(e){let t=e.get(`WWW-Authenticate`);if(!t)return;let n=yL(t);for(let e of n)if(e.scheme===`Bearer`&&e.params.scope){let t=e.params.scope.split(` `).filter(e=>e.trim().length);if(t.length)return this._log(U.Info,`Found scope challenge in WWW-Authenticate header: ${e.params.scope}`),t}}};async function MH(e,t,n){let{sameOriginHeaders:r,fetch:i,log:a}=n,o=ki.None,s,{resourceMetadataChallenge:c,scopesChallenge:l}=NH(t.get(`WWW-Authenticate`)??void 0,a),u,d,f=l;try{let{metadata:t,discoveryUrl:n,errors:l}=await SL(e,c,{sameOriginHeaders:r,fetch:(e,t)=>i(e,t)});for(let e of l)a(U.Warning,`Error fetching resource metadata: ${e}`);a(U.Info,`Discovered resource metadata at ${n}`),o=c?ki.Header:ki.WellKnown,u=t.authorization_servers?.[0],u?(a(U.Info,`Using auth server metadata url: ${u}`),s=Ai.ResourceMetadata):a(U.Warning,`No authorization_servers found in resource metadata ${n} - Is this resource metadata configured correctly?`),f??=t.scopes_supported,d=t}catch(e){a(U.Warning,`Could not fetch resource metadata: ${String(e)}`)}let p=new URL(e).origin,m={};u||(u=p,r&&(m=r));try{a(U.Debug,`Fetching auth server metadata for: ${u} ...`);let{metadata:e,discoveryUrl:t,errors:n}=await TL(u,{additionalHeaders:m,fetch:(e,t)=>i(e,t)});for(let e of n)a(U.Warning,`Error fetching authorization server metadata: ${e}`);return a(U.Info,`Discovered authorization server metadata at ${t}`),s??=Ai.WellKnown,new jH(w.parse(u),e,d,f,{resourceMetadataSource:o,serverMetadataSource:s},a)}catch(e){a(U.Warning,`Error populating auth server metadata for ${u}: ${String(e)}`)}let h=gL(new URL(p));return a(U.Info,`Using default auth metadata`),new jH(w.parse(p),h,d,f,{resourceMetadataSource:o,serverMetadataSource:Ai.Default},a)}function NH(e,t){if(!e)return{};let n,r,i=yL(e);for(let e of i)if(e.scheme===`Bearer`){if(!n&&e.params.resource_metadata&&(n=e.params.resource_metadata,t(U.Debug,`Found resource_metadata challenge in WWW-Authenticate header: ${n}`)),!r&&e.params.scope){let n=e.params.scope.split(` `).filter(e=>e.trim().length);n.length&&(t(U.Debug,`Found scope challenge in WWW-Authenticate header: ${e.params.scope}`),r=n)}if(n&&r)break}return{resourceMetadataChallenge:n,scopesChallenge:r}}const PH=k(`IExtHostDataChannels`);var FH=class{constructor(){this._channels=new Map}createDataChannel(e,t){K(e,`dataChannels`);let n=this._channels.get(t);return n||(n=new IH(t),this._channels.set(t,n)),n}$onDidReceiveData(e,t){let n=this._channels.get(e);n&&n._fireDidReceiveData(t)}},IH=class extends y{constructor(e){super(),this.channelId=e,this._onDidReceiveData=new S,this.onDidReceiveData=this._onDidReceiveData.event,this._register(this._onDidReceiveData)}_fireDidReceiveData(e){this._onDidReceiveData.fire({data:e})}toString(){return`DataChannel(${this.channelId})`}};const LH=k(`IExtHostMeteredConnection`);var RH=class extends y{constructor(){super(),this._isConnectionMetered=!1,this._onDidChangeIsConnectionMetered=this._register(new S),this.onDidChangeIsConnectionMetered=this._onDidChangeIsConnectionMetered.event}get isConnectionMetered(){return this._isConnectionMetered}$initializeIsConnectionMetered(e){this._isConnectionMetered=e}$onDidChangeIsConnectionMetered(e){this._isConnectionMetered!==e&&(this._isConnectionMetered=e,this._onDidChangeIsConnectionMetered.fire(e))}},zH;const BH=`vscode.git`;function VH(e){switch(e){case KH.Head:return Mi.Head;case KH.RemoteHead:return Mi.RemoteHead;case KH.Tag:return Mi.Tag;default:throw Error(`Unknown GitRefType: ${e}`)}}function HH(e){return{name:e.name,commit:e.commit,type:VH(e.type),remote:e.remote,upstream:e.upstream?UH(e.upstream):void 0,ahead:e.ahead,behind:e.behind}}function UH(e){return{remote:e.remote,name:e.name,commit:e.commit}}var WH;(function(e){e[e.INDEX_ADDED=1]=`INDEX_ADDED`,e[e.INDEX_DELETED=2]=`INDEX_DELETED`,e[e.INDEX_RENAMED=3]=`INDEX_RENAMED`,e[e.MODIFIED=5]=`MODIFIED`,e[e.DELETED=6]=`DELETED`,e[e.UNTRACKED=7]=`UNTRACKED`,e[e.INTENT_TO_ADD=9]=`INTENT_TO_ADD`,e[e.INTENT_TO_RENAME=10]=`INTENT_TO_RENAME`})(WH||={});function GH(e){switch(e.status){case WH.INDEX_ADDED:case WH.UNTRACKED:case WH.INTENT_TO_ADD:return{uri:e.uri,originalUri:void 0,modifiedUri:e.uri};case WH.INDEX_DELETED:case WH.DELETED:return{uri:e.uri,originalUri:e.uri,modifiedUri:void 0};case WH.INDEX_RENAMED:case WH.INTENT_TO_RENAME:return{uri:e.uri,originalUri:e.originalUri,modifiedUri:e.renameUri};default:return{uri:e.uri,originalUri:e.originalUri,modifiedUri:e.uri}}}var KH;(function(e){e[e.Head=0]=`Head`,e[e.RemoteHead=1]=`RemoteHead`,e[e.Tag=2]=`Tag`})(KH||={});const qH=k(`IExtHostGitExtensionService`);let JH=class extends y{static{zH=this}static{this._handlePool=0}constructor(e,t){super(),this._extHostExtensionService=t,this._repositories=new Map,this._repositoryByUri=new Ne,this._repositoryStateChangeListeners=new yt,this._proxy=e.getProxy(E.MainThreadGitExtension)}async $isGitExtensionAvailable(){return!!(await this._extHostExtensionService.getExtensionRegistry()).getExtensionDescription(BH)}async $openRepository(e){let t=await this._ensureGitApi();if(!t)return;let n=await t.openRepository(w.revive(e));if(!n)return;let r=this._repositoryByUri.get(n.rootUri);if(r!==void 0){this._repositories.get(r)!==n&&(this._repositories.set(r,n),this._repositoryByUri.set(n.rootUri,r),this._setRepositoryStateChangeListener(r,n));let e=this._getRepositoryState(n);return{handle:r,rootUri:n.rootUri,state:e}}let i=zH._handlePool++;this._repositories.set(i,n),this._repositoryByUri.set(n.rootUri,i),this._setRepositoryStateChangeListener(i,n);let a=this._getRepositoryState(n);return{handle:i,rootUri:n.rootUri,state:a}}async $getRefs(e,t,n){let r=this._repositories.get(e);if(!r)return[];try{return(await r.getRefs(t,n)).map(e=>{if(!(!e.name||!e.commit))return{id:e.type===KH.Head?`refs/heads/${e.name}`:e.type===KH.RemoteHead?`refs/remotes/${e.remote}/${e.name}`:`refs/tags/${e.name}`,name:e.name,type:VH(e.type),revision:e.commit}}).filter(e=>!!e)}catch{return[]}}async $getRepositoryState(e){let t=this._repositories.get(e);if(t)return this._getRepositoryState(t)}_getRepositoryState(e){let t=e.state;return{HEAD:t.HEAD?HH(t.HEAD):void 0,remotes:t.remotes,mergeChanges:t.mergeChanges.map(GH),indexChanges:t.indexChanges.map(GH),workingTreeChanges:t.workingTreeChanges.map(GH),untrackedChanges:t.untrackedChanges.map(GH)}}_setRepositoryStateChangeListener(e,t){this._repositoryStateChangeListeners.set(e,t.state.onDidChange(()=>{this._proxy.$onDidChangeRepository(e)}))}async $diffBetweenWithStats(e,t,n,r){let i=this._repositories.get(e);if(!i)return[];try{return(await i.diffBetweenWithStats(t,n,r)).map(e=>({...GH(e),insertions:e.insertions,deletions:e.deletions}))}catch{return[]}}async $diffBetweenWithStats2(e,t,n){let r=this._repositories.get(e);if(!r)return[];try{return(await r.diffBetweenWithStats2(t,n)).map(e=>({...GH(e),insertions:e.insertions,deletions:e.deletions}))}catch{return[]}}async _ensureGitApi(){if(this._gitApi)return this._gitApi;try{await this._extHostExtensionService.activateByIdWithErrors(new ys(BH),{startup:!1,extensionId:new ys(BH),activationEvent:`api`});let e=this._extHostExtensionService.getExtensionExports(new ys(BH));e&&typeof e.getAPI==`function`&&(this._gitApi=e.getAPI(1))}catch{}return this._gitApi}dispose(){this._repositoryStateChangeListeners.dispose(),super.dispose()}};JH=zH=A([j(0,Hs),j(1,KR)],JH),Ms(FR,PR,js.Delayed),Ms(Os,$R,js.Delayed),Ms(ZR,QR,js.Delayed),Ms(RI,LI,js.Eager),Ms(FL,IL,js.Eager),Ms(ZL,$L,js.Eager),Ms(mF,fF,js.Eager),Ms(FF,PF,js.Eager),Ms(tV,nV,js.Eager),Ms(SV,OV,js.Eager),Ms(_z,gz,js.Eager),Ms(Nz,Mz,js.Eager),Ms(IR,LR,js.Eager),Ms(Rc,Lc,js.Eager),Ms(mz,pz,js.Delayed),Ms(qV,JV,js.Eager),Ms(AF,kF,js.Eager),Ms(PB,NB,js.Eager),Ms(HI,YI,js.Eager),Ms($V,eH,js.Eager),Ms(XF,ZF,js.Eager),Ms(OL,DL,js.Eager),Ms(QV,ZV,js.Eager),Ms(jL,AL,js.Eager),Ms(YP,JP,js.Eager),Ms(MR,jR,js.Eager),Ms(WB,qB,js.Eager),Ms(yV,xV,js.Eager),Ms(SH,wH,js.Eager),Ms(PH,FH,js.Eager),Ms(LH,RH,js.Eager),Ms(qH,JH,js.Delayed);function YH(e,t,n,r,i,a){if(Array.isArray(e)){let o=0;for(let s of e){let e=YH(s,t,n,r,i,a);if(e===10)return e;e>o&&(o=e)}return o}else if(typeof e==`string`)return r?e===`*`?5:e===n?10:0:0;else if(e){let{language:o,pattern:s,scheme:c,hasAccessToAllModels:l,notebookType:u}=e;if(!r&&!l)return 0;u&&i&&(t=i);let d=0;if(c)if(c===t.scheme)d=10;else if(c===`*`)d=5;else return 0;if(o)if(o===n)d=10;else if(o===`*`)d=Math.max(d,5);else return 0;if(u)if(u===a)d=10;else if(u===`*`&&a!==void 0)d=Math.max(d,5);else return 0;if(s){let e;if(e=typeof s==`string`?s:{...s,base:Br(s.base)},e===t.fsPath||BS(e,t.fsPath))d=10;else return 0}return d}else return 0}function XH(e){return typeof e==`string`?!1:Array.isArray(e)?e.some(XH):!!e.notebookType}var ZH;(function(e){e[e.None=0]=`None`,e[e.Indent=1]=`Indent`,e[e.IndentOutdent=2]=`IndentOutdent`,e[e.Outdent=3]=`Outdent`})(ZH||={});var QH;(function(e){e[e.Complete=100]=`Complete`,e[e.Partial=50]=`Partial`,e[e.None=0]=`None`})(QH||={});var $H=class{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(E.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,n){if(this._relatedInformationProviders.size===0)throw Error(`No related information providers registered`);let r=this._relatedInformationProviders.get(e);if(!r)throw Error(`related information provider not found`);return await r.provideRelatedInformation(t,n)??[]}getRelatedInformation(e,t,n){return this._proxy.$getAiRelatedInformation(t,n)}registerRelatedInformationProvider(e,t,n){let r=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(r,n),this._proxy.$registerAiRelatedInformationProvider(r,t),new WT(()=>{this._proxy.$unregisterAiRelatedInformationProvider(r),this._relatedInformationProviders.delete(r)})}},eU=class{constructor(e){this._settingsSearchProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(E.MainThreadAiSettingsSearch)}async $startSearch(e,t,n,r){if(this._settingsSearchProviders.size===0)throw Error(`No related information providers registered`);let i=this._settingsSearchProviders.get(e);if(!i)throw Error(`Settings search provider not found`);let a=new Sm(t=>{this._proxy.$handleSearchResult(e,PN.fromSettingsSearchResult(t))});return i.provideSettingsSearchResults(t,n,a,r)}registerSettingsSearchProvider(e,t){let n=this._nextHandle;return this._nextHandle++,this._settingsSearchProviders.set(n,t),this._proxy.$registerAiSettingsSearchProvider(n),new WT(()=>{this._proxy.$unregisterAiSettingsSearchProvider(n),this._settingsSearchProviders.delete(n)})}},tU;(function(e){e[e.Full=1]=`Full`,e[e.Delta=2]=`Delta`})(tU||={});function nU(e){for(let t=0,n=e.length;t<n;t+=4){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];e[t+0]=a,e[t+1]=i,e[t+2]=r,e[t+3]=n}}function rU(e){let t=new Uint8Array(e.buffer,e.byteOffset,e.length*4);return Rn()||nU(t),b.wrap(t)}function iU(e){let t=e.buffer;if(Rn()||nU(t),t.byteOffset%4==0)return new Uint32Array(t.buffer,t.byteOffset,t.length/4);{let e=new Uint8Array(t.byteLength);return e.set(t),new Uint32Array(e.buffer,e.byteOffset,e.length/4)}}function aU(e){let t=new Uint32Array(oU(e)),n=0;if(t[n++]=e.id,e.type===`full`)t[n++]=tU.Full,t[n++]=e.data.length,t.set(e.data,n),n+=e.data.length;else{t[n++]=tU.Delta,t[n++]=e.deltas.length;for(let r of e.deltas)t[n++]=r.start,t[n++]=r.deleteCount,r.data?(t[n++]=r.data.length,t.set(r.data,n),n+=r.data.length):t[n++]=0}return rU(t)}function oU(e){let t=0;if(t+=2,e.type===`full`)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(let n of e.deltas)n.data&&(t+=n.data.length)}return t}function sU(e){let t=iU(e),n=0,r=t[n++];if(t[n++]===tU.Full){let e=t[n++],i=t.subarray(n,n+e);return n+=e,{id:r,type:`full`,data:i}}let i=t[n++],a=[];for(let e=0;e<i;e++){let r=t[n++],i=t[n++],o=t[n++],s;o>0&&(s=t.subarray(n,n+o),n+=o),a[e]={start:r,deleteCount:i,data:s}}return{id:r,type:`delta`,deltas:a}}const cU=[new VI(`vscode.executeDocumentHighlights`,`_executeDocumentHighlights`,`Execute document highlight provider.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of DocumentHighlight-instances.`,uU(Lj.to))),new VI(`vscode.executeDocumentSymbolProvider`,`_executeDocumentSymbolProvider`,`Execute document symbol provider.`,[X.Uri],new BI(`A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.`,(e,t)=>{if(he(e))return;class n extends OT{constructor(){super(...arguments),this.containerName=``}static to(e){let r=new n(e.name,wj.to(e.kind),e.containerName||``,new dT(t[0],J.to(e.range)));return r.detail=e.detail,r.range=r.location.range,r.selectionRange=J.to(e.selectionRange),r.children=e.children?e.children.map(n.to):[],r}}return e.map(n.to)})),new VI(`vscode.executeFormatDocumentProvider`,`_executeFormatDocumentProvider`,`Execute document format provider.`,[X.Uri,new X(`options`,`Formatting options`,e=>!0,e=>e)],new BI(`A promise that resolves to an array of TextEdits.`,uU(Sj.to))),new VI(`vscode.executeFormatRangeProvider`,`_executeFormatRangeProvider`,`Execute range format provider.`,[X.Uri,X.Range,new X(`options`,`Formatting options`,e=>!0,e=>e)],new BI(`A promise that resolves to an array of TextEdits.`,uU(Sj.to))),new VI(`vscode.executeFormatOnTypeProvider`,`_executeFormatOnTypeProvider`,`Execute format on type provider.`,[X.Uri,X.Position,new X(`ch`,`Trigger character`,e=>typeof e==`string`,e=>e),new X(`options`,`Formatting options`,e=>!0,e=>e)],new BI(`A promise that resolves to an array of TextEdits.`,uU(Sj.to))),new VI(`vscode.executeDefinitionProvider`,`_executeDefinitionProvider`,`Execute all definition providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Location or LocationLink instances.`,dU)),new VI(`vscode.experimental.executeDefinitionProvider_recursive`,`_executeDefinitionProvider_recursive`,`Execute all definition providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Location or LocationLink instances.`,dU)),new VI(`vscode.executeTypeDefinitionProvider`,`_executeTypeDefinitionProvider`,`Execute all type definition providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Location or LocationLink instances.`,dU)),new VI(`vscode.experimental.executeTypeDefinitionProvider_recursive`,`_executeTypeDefinitionProvider_recursive`,`Execute all type definition providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Location or LocationLink instances.`,dU)),new VI(`vscode.executeDeclarationProvider`,`_executeDeclarationProvider`,`Execute all declaration providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Location or LocationLink instances.`,dU)),new VI(`vscode.experimental.executeDeclarationProvider_recursive`,`_executeDeclarationProvider_recursive`,`Execute all declaration providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Location or LocationLink instances.`,dU)),new VI(`vscode.executeImplementationProvider`,`_executeImplementationProvider`,`Execute all implementation providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Location or LocationLink instances.`,dU)),new VI(`vscode.experimental.executeImplementationProvider_recursive`,`_executeImplementationProvider_recursive`,`Execute all implementation providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Location or LocationLink instances.`,dU)),new VI(`vscode.executeReferenceProvider`,`_executeReferenceProvider`,`Execute all reference providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Location-instances.`,uU(jj.to))),new VI(`vscode.experimental.executeReferenceProvider`,`_executeReferenceProvider_recursive`,`Execute all reference providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Location-instances.`,uU(jj.to))),new VI(`vscode.executeHoverProvider`,`_executeHoverProvider`,`Execute all hover providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Hover-instances.`,uU(Nj.to))),new VI(`vscode.experimental.executeHoverProvider_recursive`,`_executeHoverProvider_recursive`,`Execute all hover providers.`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of Hover-instances.`,uU(Nj.to))),new VI(`vscode.executeSelectionRangeProvider`,`_executeSelectionRangeProvider`,`Execute selection range provider.`,[X.Uri,new X(`position`,`A position in a text document`,e=>Array.isArray(e)&&e.every(e=>eT.isPosition(e)),e=>e.map(sj.from))],new BI(`A promise that resolves to an array of ranges.`,e=>e.map(e=>{let t;for(let n of e.reverse())t=new aE(J.to(n),t);return t}))),new VI(`vscode.executeWorkspaceSymbolProvider`,`_executeWorkspaceSymbolProvider`,`Execute all workspace symbol providers.`,[X.String.with(`query`,`Search string`)],new BI(`A promise that resolves to an array of SymbolInformation-instances.`,e=>e.map(Ej.to))),new VI(`vscode.prepareCallHierarchy`,`_executePrepareCallHierarchy`,`Prepare call hierarchy at a position inside a document`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of CallHierarchyItem-instances`,e=>e.map(Oj.to))),new VI(`vscode.provideIncomingCalls`,`_executeProvideIncomingCalls`,`Compute incoming calls for an item`,[X.CallHierarchyItem],new BI(`A promise that resolves to an array of CallHierarchyIncomingCall-instances`,e=>e.map(kj.to))),new VI(`vscode.provideOutgoingCalls`,`_executeProvideOutgoingCalls`,`Compute outgoing calls for an item`,[X.CallHierarchyItem],new BI(`A promise that resolves to an array of CallHierarchyOutgoingCall-instances`,e=>e.map(Aj.to))),new VI(`vscode.prepareRename`,`_executePrepareRename`,`Execute the prepareRename of rename provider.`,[X.Uri,X.Position],new BI(`A promise that resolves to a range and placeholder text.`,e=>{if(e)return{range:J.to(e.range),placeholder:e.text}})),new VI(`vscode.executeDocumentRenameProvider`,`_executeDocumentRenameProvider`,`Execute rename provider.`,[X.Uri,X.Position,X.String.with(`newName`,`The new symbol name`)],new BI(`A promise that resolves to a WorkspaceEdit.`,e=>{if(e){if(e.rejectReason)throw Error(e.rejectReason);return Cj.to(e)}})),new VI(`vscode.executeLinkProvider`,`_executeLinkProvider`,`Execute document link provider.`,[X.Uri,X.Number.with(`linkResolveCount`,`Number of links that should be resolved, only when links are unresolved.`).optional()],new BI(`A promise that resolves to an array of DocumentLink-instances.`,e=>e.map(Zj.to))),new VI(`vscode.provideDocumentSemanticTokensLegend`,`_provideDocumentSemanticTokensLegend`,`Provide semantic tokens legend for a document`,[X.Uri],new BI(`A promise that resolves to SemanticTokensLegend.`,e=>{if(e)return new uO(e.tokenTypes,e.tokenModifiers)})),new VI(`vscode.provideDocumentSemanticTokens`,`_provideDocumentSemanticTokens`,`Provide semantic tokens for a document`,[X.Uri],new BI(`A promise that resolves to SemanticTokens.`,e=>{if(!e)return;let t=sU(e);if(t.type===`full`)return new pO(t.data,void 0)})),new VI(`vscode.provideDocumentRangeSemanticTokensLegend`,`_provideDocumentRangeSemanticTokensLegend`,`Provide semantic tokens legend for a document range`,[X.Uri,X.Range.optional()],new BI(`A promise that resolves to SemanticTokensLegend.`,e=>{if(e)return new uO(e.tokenTypes,e.tokenModifiers)})),new VI(`vscode.provideDocumentRangeSemanticTokens`,`_provideDocumentRangeSemanticTokens`,`Provide semantic tokens for a document range`,[X.Uri,X.Range],new BI(`A promise that resolves to SemanticTokens.`,e=>{if(!e)return;let t=sU(e);if(t.type===`full`)return new pO(t.data,void 0)})),new VI(`vscode.executeCompletionItemProvider`,`_executeCompletionItemProvider`,`Execute completion item provider.`,[X.Uri,X.Position,X.String.with(`triggerCharacter`,"Trigger completion when the user types the character, like `,` or `(`").optional(),X.Number.with(`itemResolveCount`,`Number of completions to resolve (too large numbers slow down completions)`).optional()],new BI(`A promise that resolves to a CompletionList-instance.`,(e,t,n)=>e?new SE(e.suggestions.map(e=>Wj.to(e,n)),e.incomplete):new SE([]))),new VI(`vscode.executeSignatureHelpProvider`,`_executeSignatureHelpProvider`,`Execute signature help provider.`,[X.Uri,X.Position,X.String.with(`triggerCharacter`,"Trigger signature help when the user types the character, like `,` or `(`").optional()],new BI(`A promise that resolves to SignatureHelp.`,e=>{if(e)return qj.to(e)})),new VI(`vscode.executeCodeLensProvider`,`_executeCodeLensProvider`,`Execute code lens provider.`,[X.Uri,X.Number.with(`itemResolveCount`,`Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)`).optional()],new BI(`A promise that resolves to an array of CodeLens-instances.`,(e,t,n)=>uU(e=>new uE(J.to(e.range),e.command&&n.fromInternal(e.command)))(e))),new VI(`vscode.executeCodeActionProvider`,`_executeCodeActionProvider`,`Execute code action provider.`,[X.Uri,new X(`rangeOrSelection`,`Range in a text document. Some refactoring provider requires Selection object.`,e=>nT.isRange(e),e=>xT.isSelection(e)?ij.from(e):J.from(e)),X.String.with(`kind`,`Code action kind to return code actions for`).optional(),X.Number.with(`itemResolveCount`,`Number of code actions to resolve (too large numbers slow down code actions)`).optional()],new BI(`A promise that resolves to an array of Command-instances.`,(e,t,n)=>uU(e=>{if(e._isSynthetic){if(!e.command)throw Error(`Synthetic code actions must have a command`);return n.fromInternal(e.command)}else{let t=new iE(e.title,e.kind?new aT(e.kind):void 0);return e.edit&&(t.edit=Cj.to(e.edit)),e.command&&(t.command=n.fromInternal(e.command)),t.isPreferred=e.isPreferred,t}})(e))),new VI(`vscode.executeDocumentColorProvider`,`_executeDocumentColorProvider`,`Execute document color provider.`,[X.Uri],new BI(`A promise that resolves to an array of ColorInformation objects.`,e=>e?e.map(e=>new VE(J.to(e.range),$j.to(e.color))):[])),new VI(`vscode.executeColorPresentationProvider`,`_executeColorPresentationProvider`,`Execute color presentation provider.`,[new X(`color`,`The color to show and insert`,e=>e instanceof BE,$j.from),new X(`context`,`Context object with uri and range`,e=>!0,e=>({uri:e.uri,range:J.from(e.range)}))],new BI(`A promise that resolves to an array of ColorPresentation objects.`,e=>e?e.map(Qj.to):[])),new VI(`vscode.executeInlayHintProvider`,`_executeInlayHintProvider`,`Execute inlay hints provider`,[X.Uri,X.Range],new BI(`A promise that resolves to an array of Inlay objects`,(e,t,n)=>e.map(Jj.to.bind(void 0,n)))),new VI(`vscode.executeFoldingRangeProvider`,`_executeFoldingRangeProvider`,`Execute folding range provider`,[X.Uri],new BI(`A promise that resolves to an array of FoldingRange objects`,(e,t)=>{if(e)return e.map(aM.to)})),new VI(`vscode.resolveNotebookContentProviders`,`_resolveNotebookContentProvider`,`Resolve Notebook Content Providers`,[],new BI(`A promise that resolves to an array of NotebookContentProvider static info objects.`,uU(e=>({viewType:e.viewType,displayName:e.displayName,options:{transientOutputs:e.options.transientOutputs,transientCellMetadata:e.options.transientCellMetadata,transientDocumentMetadata:e.options.transientDocumentMetadata},filenamePattern:e.filenamePattern.map(e=>_M.to(e))})))),new VI(`vscode.executeInlineValueProvider`,`_executeInlineValueProvider`,`Execute inline value provider`,[X.Uri,X.Range,new X(`context`,`An InlineValueContext`,e=>e&&typeof e.frameId==`number`&&e.stoppedLocation instanceof nT,e=>Ij.from(e))],new BI(`A promise that resolves to an array of InlineValue objects`,e=>e.map(Fj.to))),new VI(`vscode.open`,`_workbench.open`,`Opens the provided resource in the editor. Can be a text or binary file, or an http(s) URL. If you need more control over the options for opening a text file, use vscode.window.showTextDocument instead.`,[new X(`uriOrString`,`Uri-instance or string (only http/https)`,e=>w.isUri(e)||typeof e==`string`&&Wa(e,O.http,O.https),e=>e),new X(`columnOrOptions`,`Either the column in which to open or editor options, see vscode.TextDocumentShowOptions`,e=>e===void 0||typeof e==`number`||typeof e==`object`,e=>e&&(typeof e==`number`?[pj.from(e),void 0]:[pj.from(e.viewColumn),sM.from(e)])).optional(),X.String.with(`label`,``).optional()],BI.Void),new VI(`vscode.openWith`,`_workbench.openWith`,`Opens the provided resource with a specific editor.`,[X.Uri.with(`resource`,`Resource to open`),X.String.with(`viewId`,`Custom editor view id. This should be the viewType string for custom editors or the notebookType string for notebooks. Use 'default' to use VS Code's default text editor`),new X(`columnOrOptions`,`Either the column in which to open or editor options, see vscode.TextDocumentShowOptions`,e=>e===void 0||typeof e==`number`||typeof e==`object`,e=>e&&(typeof e==`number`?[pj.from(e),void 0]:[pj.from(e.viewColumn),sM.from(e)])).optional()],BI.Void),new VI(`vscode.diff`,`_workbench.diff`,`Opens the provided resources in the diff editor to compare their contents.`,[X.Uri.with(`left`,`Left-hand side resource of the diff editor`),X.Uri.with(`right`,`Right-hand side resource of the diff editor`),X.String.with(`title`,`Human readable title for the diff editor`).optional(),new X(`columnOrOptions`,`Either the column in which to open or editor options, see vscode.TextDocumentShowOptions`,e=>e===void 0||typeof e==`object`,e=>e&&[pj.from(e.viewColumn),sM.from(e)]).optional()],BI.Void),new VI(`vscode.changes`,`_workbench.changes`,`Opens a list of resources in the changes editor to compare their contents.`,[X.String.with(`title`,`Human readable title for the changes editor`),new X(`resourceList`,`List of resources to compare`,e=>{for(let t of e){if(t.length!==3)return!1;let[e,n,r]=t;if(!w.isUri(e)||!w.isUri(n)&&n!=null||!w.isUri(r)&&r!=null)return!1}return!0},e=>e)],BI.Void),new VI(`vscode.prepareTypeHierarchy`,`_executePrepareTypeHierarchy`,`Prepare type hierarchy at a position inside a document`,[X.Uri,X.Position],new BI(`A promise that resolves to an array of TypeHierarchyItem-instances`,e=>e.map(AM.to))),new VI(`vscode.provideSupertypes`,`_executeProvideSupertypes`,`Compute supertypes for an item`,[X.TypeHierarchyItem],new BI(`A promise that resolves to an array of TypeHierarchyItem-instances`,e=>e.map(AM.to))),new VI(`vscode.provideSubtypes`,`_executeProvideSubtypes`,`Compute subtypes for an item`,[X.TypeHierarchyItem],new BI(`A promise that resolves to an array of TypeHierarchyItem-instances`,e=>e.map(AM.to))),new VI(`vscode.revealTestInExplorer`,`_revealTestInExplorer`,`Reveals a test instance in the explorer`,[X.TestItem],BI.Void),new VI(`vscode.startContinuousTestRun`,`testing.startContinuousRunFromExtension`,`Starts running the given tests with continuous run mode.`,[X.TestProfile,X.Arr(X.TestItem)],BI.Void),new VI(`vscode.stopContinuousTestRun`,`testing.stopContinuousRunFromExtension`,`Stops running the given tests with continuous run mode.`,[X.Arr(X.TestItem)],BI.Void),new VI(`vscode.experimental.editSession.continue`,`_workbench.editSessions.actions.continueEditSession`,`Continue the current edit session in a different workspace`,[X.Uri.with(`workspaceUri`,`The target workspace to continue the current edit session in`)],BI.Void),new VI(`setContext`,`_setContext`,`Set a custom context key value that can be used in when clauses.`,[X.String.with(`name`,`The context key name`),new X(`value`,`The context key value`,()=>!0,e=>e)],BI.Void),new VI(`vscode.editorChat.start`,`inlineChat.start`,`Invoke a new editor chat session`,[new X(`Run arguments`,``,e=>!0,e=>{if(e)return{initialRange:e.initialRange?J.from(e.initialRange):void 0,initialSelection:xT.isSelection(e.initialSelection)?ij.from(e.initialSelection):void 0,message:e.message,attachments:e.attachments,autoSend:e.autoSend,position:e.position?sj.from(e.position):void 0,resolveOnResponse:e.resolveOnResponse}})],BI.Void),new VI(`vscode.extensionPromptFileProvider`,`_listExtensionPromptFiles`,`Get all extension-contributed prompt files (custom agents, instructions, and prompt files).`,[],new BI(`A promise that resolves to an array of objects containing uri, type, and extensionId.`,e=>e?e.map(e=>({uri:w.revive(e.uri),type:e.type,extensionId:e.extensionId})):[]))];var lU=class{static register(e){cU.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,`_validateWhenClauses`,Ad)}};function uU(e){return t=>{if(Array.isArray(t))return t.map(e)}}function dU(e){if(!Array.isArray(e))return;let t=[];for(let n of e)Vp(n)?t.push(Mj.to(n)):t.push(jj.to(n));return t}let fU=class{constructor(e,t){this._proxy=e.getProxy(E.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:e=>t.getDocument(e)?.version,getNotebookDocumentVersion:()=>void 0}}applyWorkspaceEdit(e,t,n){let r=new _i(Cj.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(r,void 0,n?.isRefactoring??!1)}};fU=A([j(0,Hs)],fU);var pU;(function(e){function t(e,t){return e.callstack<t.callstack?-1:+(e.callstack>t.callstack)}e.compare=t})(pU||={});function mU(e){return!e||typeof e!=`object`?{callstack:void 0,msg:cc(e)}:{callstack:Array.isArray(e.stack)?e.stack.join(`
107
- `):e.stack,msg:e.message?e.message:cc(e)}}(class e{static{this.ERROR_FLUSH_TIMEOUT=5*1e3}constructor(t,n=e.ERROR_FLUSH_TIMEOUT){this._flushHandle=void 0,this._buffer=[],this._disposables=new v,this._telemetryService=t,this._flushDelay=n;let i=r.addListener(e=>this._onErrorEvent(e));this._disposables.add(_(i)),this.installErrorListeners()}dispose(){clearTimeout(this._flushHandle),this._flushBuffer(),this._disposables.dispose()}installErrorListeners(){}_onErrorEvent(e){if(!e||e.code||(e.detail&&e.detail.stack&&(e=e.detail),ie.isErrorNoTelemetry(e)||e instanceof Sc||p.is(e)||typeof e?.message==`string`&&e.message.includes(`Unable to read file`)))return;let{callstack:t,msg:n}=mU(e);if(!t)return;let r={msg:n,callstack:t};nr.is(e)&&(r.kind=e.kind,r.listenerCount=e.listenerCount),this._enqueue(r)}_enqueue(e){let t=ce(this._buffer,e,pU.compare);t<0?(e.count=1,this._buffer.splice(~t,0,e)):(this._buffer[t].count||(this._buffer[t].count=0),this._buffer[t].count+=1),this._flushHandle===void 0&&(this._flushHandle=setTimeout(()=>{this._flushBuffer(),this._flushHandle=void 0},this._flushDelay))}_flushBuffer(){for(let e of this._buffer)this._telemetryService.publicLogError2(`UnhandledError`,e);this._buffer.length=0}});function hU(e){return!!e&&w.isUri(e.sessionResource)&&e.$mid===Er.ChatViewContext}var gU;(function(e){e[e.Info=0]=`Info`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(gU||={});var _U;(function(e){e[e.Complete=1]=`Complete`,e[e.Partial=2]=`Partial`,e[e.Omitted=3]=`Omitted`})(_U||={});var vU;(function(e){e[e.NoReason=0]=`NoReason`,e[e.FilteredContentRetry=1]=`FilteredContentRetry`,e[e.CopyrightContentRetry=2]=`CopyrightContentRetry`})(vU||={});var yU;(function(e){e.Pending=`pending`,e.Accepted=`accepted`,e.Rejected=`rejected`})(yU||={});var bU;(function(e){e[e.Denied=0]=`Denied`,e[e.ConfirmationNotNeeded=1]=`ConfirmationNotNeeded`,e[e.Setting=2]=`Setting`,e[e.LmServicePerTool=3]=`LmServicePerTool`,e[e.UserAction=4]=`UserAction`,e[e.Skipped=5]=`Skipped`})(bU||={});var xU;(function(e){let t;(function(e){e[e.Streaming=0]=`Streaming`,e[e.WaitingForConfirmation=1]=`WaitingForConfirmation`,e[e.Executing=2]=`Executing`,e[e.WaitingForPostApproval=3]=`WaitingForPostApproval`,e[e.Completed=4]=`Completed`,e[e.Cancelled=5]=`Cancelled`})(t=e.StateKind||={});function n(e,n){if(e.kind===`toolInvocationSerialized`)return e.isConfirmed===void 0||typeof e.isConfirmed==`boolean`?{type:e.isConfirmed?bU.UserAction:bU.Denied}:e.isConfirmed;let r=e.state.read(n);if(!(r.type===t.Streaming||r.type===t.WaitingForConfirmation))return r.type===t.Cancelled?{type:r.reason}:r.confirmed}e.executionConfirmedOrDenied=n;function r(e,t){let r=n(e);if(r)return Promise.resolve(r);let i=new v;return new Promise(r=>{t&&i.add(t.onCancellationRequested(()=>{r({type:bU.Denied})})),i.add(sv(t=>{let a=n(e,t);a&&(i.dispose(),r(a))}))}).finally(()=>{i.dispose()})}e.awaitConfirmation=r;function i(e,n){let r=e.state.read(n);if(r.type===t.Completed)return r.postConfirmed||{type:bU.ConfirmationNotNeeded};if(r.type===t.Cancelled)return{type:r.reason}}function a(e,n){let r=e?.state.get();return r?.type===t.WaitingForConfirmation||r?.type===t.WaitingForPostApproval?(r.confirm(n),!0):!1}e.confirmWith=a;function o(e,t){let n=i(e);if(n)return Promise.resolve(n);let r=new v;return new Promise(n=>{t&&r.add(t.onCancellationRequested(()=>{n({type:bU.Denied})})),r.add(sv(t=>{let a=i(e,t);a&&(r.dispose(),n(a))}))}).finally(()=>{r.dispose()})}e.awaitPostConfirmation=o;function s(e,n){if(e.kind===`toolInvocationSerialized`)return e.resultDetails;let r=e.state.read(n);if(r.type===t.Completed||r.type===t.WaitingForPostApproval)return r.resultDetails}e.resultDetails=s;function c(e,n){if(e.kind===`toolInvocationSerialized`)return!0;let r=e.state.read(n);return r.type===t.Completed||r.type===t.Cancelled}e.isComplete=c;function l(e,t){return!!(e.presentation===`hidden`||e.presentation===`hiddenAfterComplete`&&c(e,t))}e.isEffectivelyHidden=l;function u(e,n){return e.kind===`toolInvocationSerialized`?!1:e.state.read(n).type===t.Streaming}e.isStreaming=u;function d(e,n){if(e.kind===`toolInvocationSerialized`)return;let r=e.state.read(n);if(r.type!==t.Streaming)return r.parameters}e.getParameters=d;function f(e,n){if(e.kind===`toolInvocationSerialized`)return;let r=e.state.read(n);if(r.type!==t.Streaming)return r.confirmationMessages}e.getConfirmationMessages=f})(xU||={});var SU;(function(e){e[e.Down=0]=`Down`,e[e.Up=1]=`Up`})(SU||={});var CU;(function(e){e[e.Action=1]=`Action`,e[e.Toolbar=2]=`Toolbar`})(CU||={});var wU;(function(e){e[e.Pending=0]=`Pending`,e[e.Complete=1]=`Complete`,e[e.Cancelled=2]=`Cancelled`,e[e.Failed=3]=`Failed`,e[e.NeedsInput=4]=`NeedsInput`})(wU||={});var TU;(function(e){function t(e){return e.kind===`sent`}e.isSent=t;function n(e){return e.kind===`rejected`}e.isRejected=n;function r(e){return e.kind===`queued`}e.isQueued=r;function i(e){if(e.kind!==`sent`)throw Error(`Expected ChatSendResult to be 'sent', but was '${e.kind}'`)}e.assertSent=i})(TU||={});var EU;(function(e){e.Queued=`queued`,e.Steering=`steering`})(EU||={});var DU=class{constructor(e,t,n,r,i,a,o){this._extension=e,this._request=t,this._proxy=n,this._commandsConverter=r,this._sessionDisposables=i,this._pendingCarouselResolvers=a,this._token=o,this._stopWatch=Yn.create(!1),this._isClosed=!1}close(){this._isClosed=!0}get timings(){return{firstProgress:this._firstProgress,totalElapsed:this._stopWatch.elapsed()}}get apiObject(){if(!this._apiObject){let e=this;this._stopWatch.reset();let t=0;function n(t){if(e._isClosed){let e=Error(`Response stream has been closed`);throw Error.captureStackTrace(e,t),e}}let r=[],i=[];function a(t,n){if(r.push(n===void 0?t:[t,n])===1&&queueMicrotask(()=>{let t=i;i=[],e._proxy.$handleProgressChunk(e._request.requestId,r).finally(()=>{t.forEach(e=>e())}),r.length=0}),n!==void 0)return new Promise(e=>{i.push(e)})}let o=(e,n)=>{if(this._firstProgress===void 0&&(e.kind===`markdownContent`||e.kind===`markdownVuln`||e.kind===`beginToolInvocation`)&&(this._firstProgress=this._stopWatch.elapsed()),n){let r=t++,i=a(e,r);Promise.all([i,n({report:e=>{i.then(()=>{Qw.isMarkdownString(e.value)?a(XM.from(e),r):a(lN.from(e),r)})}})]).then(([e,t])=>{a(rN.from(t),r)})}else a(e)};this._apiObject=Object.freeze({clearToPreviousToolInvocation(e){return n(this.markdown),a({kind:`clearToPreviousToolInvocation`,reason:e}),this},markdown(e){n(this.markdown);let t=new wk(e);return o(zM.from(t)),this},markdownWithVulnerabilities(t,r){n(this.markdown),r&&K(e._extension,`chatParticipantAdditions`);let i=new Tk(t,r);return o(VM.from(i)),this},codeblockUri(t,r){n(this.codeblockUri),K(e._extension,`chatParticipantAdditions`);let i=new Vk(t,r);return o(BM.from(i)),this},filetree(e,t){n(this.filetree);let r=new Dk(e,t);return o(WM.from(r)),this},anchor(e,t){let n=new Mk(e,t);return this.push(n)},button(t){n(this.anchor);let r=new zk(t);return o(iN.from(r,e._commandsConverter,e._sessionDisposables)),this},progress(e,t){n(this.progress);let r=new Pk(e,t);return o(t?nN.from(r):qM.from(r),t),this},thinkingProgress(t){n(this.thinkingProgress),K(e._extension,`chatParticipantAdditions`);let r=new Fk(t.text??``,t.id,t.metadata);return o(JM.from(r)),this},hookProgress(t,r,i){n(this.hookProgress),K(e._extension,`chatParticipantAdditions`);let a=new Ik(t,r,i);return o(YM.from(a)),this},warning(t){n(this.progress),K(e._extension,`chatParticipantAdditions`);let r=new Lk(t);return o(XM.from(r)),this},info(t){n(this.progress),K(e._extension,`chatParticipantAdditions`);let r=new Rk(t);return o(ZM.from(r)),this},reference(e,t){return this.reference2(e,t)},reference2(t,r,i){if(n(this.reference),typeof t==`object`&&`variableName`in t&&K(e._extension,`chatParticipantAdditions`),typeof t==`object`&&`variableName`in t&&!t.value){let n=e._request.variables.variables.find(e=>e.name===t.variableName);if(n){let e;if(n.references?.length)e=n.references.map(e=>({kind:`reference`,reference:{variableName:t.variableName,value:e.reference}}));else{let n=new Bk(t,r,i);e=[lN.from(n)]}return e.forEach(e=>o(e)),this}}else{let e=new Bk(t,r,i);o(lN.from(e))}return this},codeCitation(t,r,i){n(this.codeCitation),K(e._extension,`chatParticipantAdditions`);let a=new Hk(t,r,i);o(uN.from(a))},textEdit(t,r){n(this.textEdit),K(e._extension,`chatParticipantAdditions`);let i=new Yk(t,r);return i.isDone=r===!0?!0:void 0,o(aN.from(i)),this},notebookEdit(t,r){n(this.notebookEdit),K(e._extension,`chatParticipantAdditions`);let i=new Xk(t,r);return o(sN.from(i)),this},workspaceEdit(t){n(this.workspaceEdit),K(e._extension,`chatParticipantAdditions`);let r=new Zk(t);return o(cN.from(r)),this},async externalEdit(e,r){n(this.externalEdit);let i=Array.isArray(e)?e:[e],o=t++,s=zc();await a({kind:`externalEdits`,start:!0,resources:i,undoStopId:s},o);try{return await r(),s}finally{await a({kind:`externalEdits`,start:!1,resources:i,undoStopId:s},o)}},confirmation(t,r,i,a){n(this.confirmation),K(e._extension,`chatParticipantAdditions`);let s=new Ek(t,r,i,a);return o(HM.from(s)),this},async questionCarousel(t,r=!0){n(this.questionCarousel),K(e._extension,`chatParticipantAdditions`);let i=zc(),a=new Jk(t,r),s=UM.from(a);s.resolveId=i;let c=new Ro;return e._pendingCarouselResolvers.has(e._request.requestId)||e._pendingCarouselResolvers.set(e._request.requestId,new Map),e._pendingCarouselResolvers.get(e._request.requestId).set(i,c),o(s),mo(c.p,e._token)},beginToolInvocation(t,r,i){return n(this.beginToolInvocation),K(e._extension,`chatParticipantAdditions`),o({kind:`beginToolInvocation`,toolCallId:t,toolName:r,streamData:i?{partialInput:i.partialInput}:void 0,subagentInvocationId:i?.subagentInvocationId}),this},updateToolInvocation(t,r){return n(this.updateToolInvocation),K(e._extension,`chatParticipantAdditions`),o({kind:`updateToolInvocation`,toolCallId:t,streamData:{partialInput:r.partialInput}}),this},push(t){if(n(this.push),(t instanceof Yk||t instanceof Xk||t instanceof Tk||t instanceof Lk||t instanceof Ek||t instanceof Jk||t instanceof Hk||t instanceof Uk||t instanceof Wk||t instanceof jk||t instanceof Fk||t instanceof Gk||t instanceof Pk)&&K(e._extension,`chatParticipantAdditions`),t instanceof Bk)this.reference2(t.value,t.iconPath,t.options);else if(t instanceof Pk)o(t.task?nN.from(t):qM.from(t),t.task);else if(t instanceof Fk)o(JM.from(t));else if(t instanceof Mk){let n=KM.from(t);if(t.resolve&&(K(e._extension,`chatParticipantAdditions`),n.resolveId=zc()),o(n),t.resolve){let r=new Ii;t.resolve(r.token).then(()=>{let r=KM.from(t);e._proxy.$handleAnchorResolve(e._request.requestId,n.resolveId,r)}).then(()=>r.dispose(),()=>r.dispose()),e._sessionDisposables.add(_(()=>r.dispose(!0)))}}else if(t instanceof jk)return this.externalEdit(t.uris,t.callback).then(e=>t.didGetApplied(e)),this;else o(dN.from(t,e._commandsConverter,e._sessionDisposables));return this},usage(t){return n(this.usage),K(e._extension,`chatParticipantAdditions`),o({kind:`usage`,promptTokens:t.promptTokens,completionTokens:t.completionTokens,outputBuffer:t.outputBuffer,promptTokenDetails:t.promptTokenDetails}),this}})}return this._apiObject}},OU=class e extends y{static{this._idPool=0}static{this._participantDetectionProviderIdPool=0}static{this._contributionsProviderIdPool=0}static{this._customizationProviderIdPool=0}get activeChatPanelSessionResource(){return this._activeChatPanelSessionResource}toCustomAgent(e){return Object.freeze({uri:w.revive(e.uri),name:e.name,description:e.description,source:e.source,extensionId:e.extensionId,pluginUri:e.pluginUri?w.revive(e.pluginUri):void 0,sessionTypes:e.sessionTypes,argumentHint:e.argumentHint,tools:e.tools,model:e.model,userInvocable:e.userInvocable,disableModelInvocation:e.disableModelInvocation,enabled:e.enabled})}toInstruction(e){return Object.freeze({uri:w.revive(e.uri),name:e.name,description:e.description,source:e.source,extensionId:e.extensionId,pluginUri:e.pluginUri?w.revive(e.pluginUri):void 0,sessionTypes:e.sessionTypes,pattern:e.pattern})}toSkill(e){return Object.freeze({uri:w.revive(e.uri),name:e.name,description:e.description,source:e.source,extensionId:e.extensionId,pluginUri:e.pluginUri?w.revive(e.pluginUri):void 0,sessionTypes:e.sessionTypes,userInvocable:e.userInvocable,disableModelInvocation:e.disableModelInvocation})}toSlashCommand(e){return Object.freeze({uri:w.revive(e.uri),name:e.name,description:e.description,source:e.source,extensionId:e.extensionId,pluginUri:e.pluginUri?w.revive(e.pluginUri):void 0,sessionTypes:e.sessionTypes,argumentHint:e.argumentHint,userInvocable:e.userInvocable})}toHook(e){return Object.freeze({uri:w.revive(e.uri),sessionTypes:e.sessionTypes,source:e.source,extensionId:e.extensionId,pluginUri:e.pluginUri?w.revive(e.pluginUri):void 0})}toPlugin(e){return Object.freeze({uri:w.revive(e.uri)})}provideCustomAgents(e){return this._customAgents.get(e)}provideInstructions(e){return this._instructions.get(e)}provideSkills(e){return this._skills.get(e)}provideSlashCommands(e){return this._slashCommands.get(e)}provideHooks(e){return this._hooks.get(e)}providePlugins(e){return this._plugins.get(e)}$onDidChangeCustomAgents(){this._customAgents.clear(),this._onDidChangeCustomAgents.fire()}$onDidChangeInstructions(){this._instructions.clear(),this._onDidChangeInstructions.fire()}$onDidChangeSkills(){this._skills.clear(),this._onDidChangeSkills.fire()}$onDidChangeSlashCommands(){this._slashCommands.clear(),this._onDidChangeSlashCommands.fire()}$onDidChangeHooks(){this._hooks.clear(),this._onDidChangeHooks.fire()}$onDidChangePlugins(){this._plugins.clear(),this._onDidChangePlugins.fire()}constructor(e,t,n,r,i,a,o,s,c){super(),this._logService=t,this._commands=n,this._documents=r,this._editorsAndDocuments=i,this._languageModels=a,this._diagnostics=o,this._tools=s,this._chatSessions=c,this._agents=new Map,this._participantDetectionProviders=new Map,this._promptFileProviders=new Map,this._customizationProviders=new Map,this._sessionDisposables=this._register(new bt),this._completionDisposables=this._register(new yt),this._inFlightRequests=new Set,this._pendingCarouselResolvers=new Map,this._onDidChangeChatRequestTools=this._register(new S),this.onDidChangeChatRequestTools=this._onDidChangeChatRequestTools.event,this._onDidDisposeChatSession=this._register(new S),this.onDidDisposeChatSession=this._onDidDisposeChatSession.event,this._onDidChangeCustomAgents=this._register(new S),this.onDidChangeCustomAgents=this._onDidChangeCustomAgents.event,this._onDidChangeInstructions=this._register(new S),this.onDidChangeInstructions=this._onDidChangeInstructions.event,this._onDidChangeSkills=this._register(new S),this.onDidChangeSkills=this._onDidChangeSkills.event,this._onDidChangeSlashCommands=this._register(new S),this.onDidChangeSlashCommands=this._onDidChangeSlashCommands.event,this._onDidChangeHooks=this._register(new S),this.onDidChangeHooks=this._onDidChangeHooks.event,this._onDidChangePlugins=this._register(new S),this.onDidChangePlugins=this._onDidChangePlugins.event,this._customAgents=new MU(()=>this._proxy.$provideCustomAgents(Pi.None).then(e=>e.map(e=>this.toCustomAgent(e)))),this._instructions=new MU(()=>this._proxy.$provideInstructions(Pi.None).then(e=>e.map(e=>this.toInstruction(e)))),this._skills=new MU(()=>this._proxy.$provideSkills(Pi.None).then(e=>e.map(e=>this.toSkill(e)))),this._slashCommands=new MU(()=>this._proxy.$provideSlashCommands(Pi.None).then(e=>e.map(e=>this.toSlashCommand(e)))),this._hooks=new MU(()=>this._proxy.$provideHooks(Pi.None).then(e=>e.map(e=>this.toHook(e)))),this._plugins=new MU(()=>this._proxy.$providePlugins(Pi.None).then(e=>e.map(e=>this.toPlugin(e)))),this._onDidChangeActiveChatPanelSessionResource=this._register(new S),this.onDidChangeActiveChatPanelSessionResource=this._onDidChangeActiveChatPanelSessionResource.event,this._proxy=e.getProxy(E.MainThreadChatAgents2),n.registerArgumentProcessor({processArgument:e=>hU(e)?null:e})}async transferActiveChat(e){await this._proxy.$transferActiveChatSession(e)}createChatAgent(t,n,r){let i=e._idPool++,a=new AU(t,n,this._proxy,i,r);return this._agents.set(i,a),this._proxy.$registerAgent(i,t.identifier,n,{},void 0),a.apiAgent}createDynamicChatAgent(t,n,r,i){let a=e._idPool++,o=new AU(t,n,this._proxy,a,i);return this._agents.set(a,o),this._proxy.$registerAgent(a,t.identifier,n,{isSticky:!0},r),o.apiAgent}registerChatParticipantDetectionProvider(t,n){let r=e._participantDetectionProviderIdPool++;return this._participantDetectionProviders.set(r,new kU(t,n)),this._proxy.$registerChatParticipantDetectionProvider(r),_(()=>{this._participantDetectionProviders.delete(r),this._proxy.$unregisterChatParticipantDetectionProvider(r)})}registerPromptFileProvider(t,n,r){let i=e._contributionsProviderIdPool++;this._promptFileProviders.set(i,{extension:t,provider:r}),this._proxy.$registerPromptFileProvider(i,n,t.identifier);let a=new v,o;switch(n){case hb.agent:o=r.onDidChangeCustomAgents;break;case hb.instructions:o=r.onDidChangeInstructions;break;case hb.prompt:o=r.onDidChangePromptFiles;break;case hb.skill:o=r.onDidChangeSkills;break;case hb.hook:o=r.onDidChangeHooks;break}return o&&a.add(o(()=>{this._proxy.$onDidChangePromptFiles(i)})),a.add(_(()=>{this._promptFileProviders.delete(i),this._proxy.$unregisterPromptFileProvider(i)})),a}async $providePromptFiles(e,t,n,r){let i=this._promptFileProviders.get(e);if(!i)return;let a=i.provider,o;switch(t){case hb.agent:o=await a.provideCustomAgents(n,r)??void 0;break;case hb.instructions:o=await a.provideInstructions(n,r)??void 0;break;case hb.prompt:o=await a.providePromptFiles(n,r)??void 0;break;case hb.skill:o=await a.provideSkills(n,r)??void 0;break;case hb.hook:o=await a.provideHooks(n,r)??void 0;break}return o}registerChatSessionCustomizationProvider(t,n,r,i){let a=e._customizationProviderIdPool++;this._customizationProviders.set(a,{extension:t,provider:i});let o={label:r.label,iconId:r.iconId,supportedTypes:r.supportedTypes?.map(e=>mN.from(e))};this._proxy.$registerChatSessionCustomizationProvider(a,n,o,t.identifier);let s=new v;return i.onDidChange&&s.add(i.onDidChange(()=>{this._proxy.$onDidChangeCustomizations(a)})),s.add(_(()=>{this._customizationProviders.delete(a),this._proxy.$unregisterChatSessionCustomizationProvider(a)})),s}async $provideChatSessionCustomizations(e,t,n){let r=this._customizationProviders.get(e);if(r&&t)try{let e=await r.provider.provideChatSessionCustomizations(w.revive(t),n);return e?e.map(e=>({uri:e.uri,type:mN.from(e.type),name:e.name,description:e.description,source:e.source,groupKey:e.groupKey,badge:e.badge,badgeTooltip:e.badgeTooltip,extensionId:e.extensionId,pluginUri:e.pluginUri,userInvocable:e.userInvocable})):void 0}catch{return}}async $detectChatParticipant(e,t,n,r,i){let a=this._participantDetectionProviders.get(e);if(!a)return;let{request:o,location:s,history:c}=await this._createRequest(t,n,a.extension),l=await this.getModelForRequest(o,a.extension),u=await this.getToolsForRequest(a.extension,o.userSelectedTools,l.id,i),d=fN.to(o,s,l,o.modelConfiguration,this.getDiagnosticsWhenEnabled(a.extension),u,a.extension,this._logService);return a.provider.provideParticipantDetection(d,{history:c,yieldRequested:!1},{participants:r.participants,location:pN.to(r.location)},i)}async _createRequest(e,t,n){let r=Hu(e),i=await this.prepareHistoryTurns(n,r.agentId,t),a;if(r.locationData?.type===hy.EditorInline){let e=this._documents.getDocument(r.locationData.document);a=new EA(this._editorsAndDocuments.getEditor(r.locationData.id).value,e,ij.to(r.locationData.selection),J.to(r.locationData.wholeRange))}else r.locationData?.type===hy.Notebook&&(a=new DA(this._documents.getDocument(r.locationData.sessionInputUri)));return{request:r,location:a,history:i}}async getModelForRequest(e,t){let n;if(e.userSelectedModelId&&(n=await this._languageModels.getLanguageModelByIdentifier(t,e.userSelectedModelId)),!n&&(n=await this._languageModels.getDefaultLanguageModel(t),!n))throw Error(`Language model unavailable`);return n}async $setRequestTools(e,t){let n=[...this._inFlightRequests].find(t=>t.requestId===e);if(!n)return;n.extRequest.tools.clear();let r=await this.getToolsForRequest(n.extension,t,n.extRequest.model.id,Pi.None);for(let[e,t]of r)n.extRequest.tools.set(e,t);this._onDidChangeChatRequestTools.fire(n.extRequest)}$setYieldRequested(e,t){let n=[...this._inFlightRequests].find(t=>t.requestId===e);n&&(n.yieldRequested=t)}async $invokeAgent(e,t,n,r){let i=this._agents.get(e);if(!i)throw Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);let a,o;try{let{request:e,location:s,history:c}=await this._createRequest(t,n,i.extension),l=this._sessionDisposables.get(e.sessionResource);l||(l=new v,this._sessionDisposables.set(e.sessionResource,l)),a=new DU(i.extension,e,this._proxy,this._commands.converter,l,this._pendingCarouselResolvers,r);let u=await this.getModelForRequest(e,i.extension),d=await this.getToolsForRequest(i.extension,e.userSelectedTools,u.id,r),f=fN.to(e,s,u,e.modelConfiguration,this.getDiagnosticsWhenEnabled(i.extension),d,i.extension,this._logService);o={requestId:t.requestId,extRequest:f,extension:i.extension,hooks:e.hooks,yieldRequested:!1},this._inFlightRequests.add(o);let p;if(n.chatSessionContext){let e=w.revive(n.chatSessionContext.chatSessionResource),t=await this._chatSessions.getInputStateForSession(e,n.chatSessionContext.initialSessionOptions,r);p={chatSessionItem:{resource:e,label:n.chatSessionContext.isUntitled?`Untitled Session`:`Session`},isUntitled:n.chatSessionContext.isUntitled,initialSessionOptions:n.chatSessionContext.initialSessionOptions,inputState:t}}let m={history:c,chatSessionContext:p,get yieldRequested(){return o?.yieldRequested??!1}},h=i.invoke(f,m,a.apiObject,r);return await jU(1e3,Promise.resolve(h).then(e=>{if(e?.metadata)try{JSON.stringify(e.metadata)}catch(t){let n=`result.metadata MUST be JSON.stringify-able. Got error: ${t.message}`;return this._logService.error(`[${i.extension.identifier.value}] [@${i.id}] ${n}`,i.extension),{errorDetails:{message:n},timings:a?.timings,nextQuestion:e.nextQuestion}}let t;return e?.errorDetails&&(t={...e.errorDetails,responseIsIncomplete:!0}),(t?.responseIsRedacted||t?.isQuotaExceeded||t?.isRateLimited||t?.isExpectedError||t?.confirmationButtons||t?.code)&&K(i.extension,`chatParticipantPrivate`),{errorDetails:t,timings:a?.timings,metadata:e?.metadata,nextQuestion:e?.nextQuestion,details:e?.details}}),r)}catch(e){this._logService.error(e,i.extension),e instanceof UA&&e.cause&&(e=e.cause);let t=e instanceof Error&&e.name===`ChatQuotaExceeded`,n=e instanceof Error&&e.name===`ChatRateLimited`,r=e instanceof Error&&e.name===`ChatExpectedError`,{callstack:a}=mU(e),o=e instanceof Error?e.name:void 0;return{errorDetails:{message:Om(e),responseIsIncomplete:!0,isQuotaExceeded:t,isRateLimited:n,isExpectedError:r},errorCallstack:a,errorName:o}}finally{o&&this._inFlightRequests.delete(o);let e=this._pendingCarouselResolvers.get(t.requestId);if(e){for(let t of e.values())t.complete(void 0);this._pendingCarouselResolvers.delete(t.requestId)}a?.close()}}getDiagnosticsWhenEnabled(e){return Dw(e)?this._diagnostics.getDiagnostics():[]}async getToolsForRequest(e,t,n,r){if(!t)return new Map;let i=new Map;for(let n of this._tools.getTools(e))typeof t[n.name]==`boolean`&&i.set(n,t[n.name]);return i}async prepareHistoryTurns(e,t,n){let r=[];for(let i of n.history){let n=bN.to(i.result),a=t===i.request.agentId||NU(i.request.agentId)&&NU(t)?n:{...n,metadata:void 0},o=[],s=[];for(let t of i.request.variables.variables)if(t.kind===`tool`)s.push(gN.to(t));else if(t.kind===`toolset`)s.push(...t.value.map(gN.to));else{let n=hN.to(t,this.getDiagnosticsWhenEnabled(e),this._logService);n&&o.push(n)}let c=Dw(e)?i.request.editedFileEvents:void 0,l=Dw(e)&&i.request.modeInstructions?vN.to(i.request.modeInstructions):void 0,u=new tA(i.request.message,i.request.command,o,i.request.agentId,s,c,i.request.requestId,void 0,l);r.push(u);let d=pe(i.response.map(e=>dN.toContent(e,this._commands.converter)));r.push(new nA(d,a,i.request.agentId,i.request.command))}return r}$releaseSession(e){let t=w.revive(e);this._sessionDisposables.deleteAndDispose(t);let n=oh.parseLocalSessionId(t);n&&this._onDidDisposeChatSession.fire(n)}$acceptActiveChatSession(e){let t=e?w.revive(e):void 0;this._activeChatPanelSessionResource?.toString()!==t?.toString()&&(this._activeChatPanelSessionResource=t,this._onDidChangeActiveChatPanelSessionResource.fire(t))}async $provideFollowups(e,t,n,r,i){let a=this._agents.get(t);if(!a)return Promise.resolve([]);let o=Hu(e),s=await this.prepareHistoryTurns(a.extension,a.id,r),c=bN.to(n);return(await a.provideFollowups(c,{history:s,yieldRequested:!1},i)).filter(e=>{let t=!e.participant||lt.some(this._agents.values(),t=>t.id===e.participant&&ys.equals(t.extension.identifier,a.extension.identifier));return t||this._logService.warn(`[@${a.id}] ChatFollowup refers to an unknown participant: ${e.participant}`),t}).map(e=>PM.from(e,o))}$acceptFeedback(e,t,n){let r=this._agents.get(e);if(!r)return;let i=bN.to(t),a;switch(n.direction){case SU.Down:a=Ck.Unhelpful;break;case SU.Up:a=Ck.Helpful;break}let o={result:i,kind:a};r.acceptFeedback(Object.freeze(o))}$handleQuestionCarouselAnswer(e,t,n){let r=this._pendingCarouselResolvers.get(e);if(!r)return;let i=r.get(t);i&&(i.complete(n),r.delete(t)),r.size===0&&this._pendingCarouselResolvers.delete(e)}$acceptAction(e,t,n){let r=this._agents.get(e);if(!r||n.action.kind===`vote`)return;let i=xN.to(t,n,this._commands.converter);i&&r.acceptAction(Object.freeze(i))}async $invokeCompletionProvider(e,t,n){let r=this._agents.get(e);if(!r)return[];let i=this._completionDisposables.get(e);return i?i.clear():(i=new v,this._completionDisposables.set(e,i)),(await r.invokeCompletionProvider(t,n)).map(e=>yN.from(e,this._commands.converter,i))}async $provideChatTitle(e,t,n){let r=this._agents.get(e);if(!r)return;let i=await this.prepareHistoryTurns(r.extension,r.id,{history:t}),a=t[0]?.request.sessionResource?w.revive(t[0].request.sessionResource):void 0;return await r.provideTitle({history:i,sessionResource:a,yieldRequested:!1},n)}async $provideChatSummary(e,t,n){let r=this._agents.get(e);if(!r)return;let i=await this.prepareHistoryTurns(r.extension,r.id,{history:t}),a=t[0]?.request.sessionResource?w.revive(t[0].request.sessionResource):void 0;return await r.provideSummary({history:i,sessionResource:a,yieldRequested:!1},n)}},kU=class{constructor(e,t){this.extension=e,this.provider=t}},AU=class{constructor(e,t,n,r,i){this.extension=e,this.id=t,this._proxy=n,this._handle=r,this._requestHandler=i,this._onDidReceiveFeedback=new S,this._onDidPerformAction=new S,this._pauseStateEmitter=new S}acceptFeedback(e){this._onDidReceiveFeedback.fire(e)}acceptAction(e){this._onDidPerformAction.fire(e)}setChatRequestPauseState(e){this._pauseStateEmitter.fire(e)}async invokeCompletionProvider(e,t){return this._agentVariableProvider?await this._agentVariableProvider.provider.provideCompletionItems(e,t)??[]:[]}async provideFollowups(e,t,n){if(!this._followupProvider)return[];let r=await this._followupProvider.provideFollowups(e,t,n);return r?r.filter(e=>!(e&&`commandId`in e)).filter(e=>!(e&&`message`in e)):[]}async provideTitle(e,t){if(this._titleProvider)return await this._titleProvider.provideChatTitle(e,t)??void 0}async provideSummary(e,t){if(this._summarizer)return await this._summarizer.provideChatSummary(e,t)??void 0}get apiAgent(){let e=!1,t=!1,n=()=>{e||t||(t=!0,queueMicrotask(()=>{this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof w?this._iconPath:`light`in this._iconPath?this._iconPath.light:void 0:void 0,iconDark:this._iconPath&&`dark`in this._iconPath?this._iconPath.dark:void 0,themeIcon:this._iconPath instanceof OD?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix==`string`?this._helpTextPrefix:Y.from(this._helpTextPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix==`string`?this._helpTextPostfix:Y.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,additionalWelcomeMessage:!this._additionalWelcomeMessage||typeof this._additionalWelcomeMessage==`string`?this._additionalWelcomeMessage:Y.from(this._additionalWelcomeMessage)}),t=!1}))},r=this;return{get id(){return r.id},get iconPath(){return r._iconPath},set iconPath(e){r._iconPath=e,n()},get requestHandler(){return r._requestHandler},set requestHandler(e){tt(typeof e==`function`,`Invalid request handler`),r._requestHandler=e},get followupProvider(){return r._followupProvider},set followupProvider(e){r._followupProvider=e,n()},get helpTextPrefix(){return K(r.extension,`defaultChatParticipant`),r._helpTextPrefix},set helpTextPrefix(e){K(r.extension,`defaultChatParticipant`),r._helpTextPrefix=e,n()},get helpTextPostfix(){return K(r.extension,`defaultChatParticipant`),r._helpTextPostfix},set helpTextPostfix(e){K(r.extension,`defaultChatParticipant`),r._helpTextPostfix=e,n()},get supportIssueReporting(){return K(r.extension,`chatParticipantPrivate`),r._supportIssueReporting},set supportIssueReporting(e){K(r.extension,`chatParticipantPrivate`),r._supportIssueReporting=e,n()},get onDidReceiveFeedback(){return r._onDidReceiveFeedback.event},set participantVariableProvider(e){if(K(r.extension,`chatParticipantAdditions`),r._agentVariableProvider=e,e){if(!e.triggerCharacters.length)throw Error(`triggerCharacters are required`);r._proxy.$registerAgentCompletionsProvider(r._handle,r.id,e.triggerCharacters)}else r._proxy.$unregisterAgentCompletionsProvider(r._handle,r.id)},get participantVariableProvider(){return K(r.extension,`chatParticipantAdditions`),r._agentVariableProvider},set additionalWelcomeMessage(e){K(r.extension,`defaultChatParticipant`),r._additionalWelcomeMessage=e,n()},get additionalWelcomeMessage(){return K(r.extension,`defaultChatParticipant`),r._additionalWelcomeMessage},set titleProvider(e){K(r.extension,`defaultChatParticipant`),r._titleProvider=e,n()},get titleProvider(){return K(r.extension,`defaultChatParticipant`),r._titleProvider},set summarizer(e){K(r.extension,`defaultChatParticipant`),r._summarizer=e},get summarizer(){return K(r.extension,`defaultChatParticipant`),r._summarizer},get onDidChangePauseState(){return K(r.extension,`chatParticipantAdditions`),r._pauseStateEmitter.event},onDidPerformAction:Dw(this.extension)?this._onDidPerformAction.event:void 0,dispose(){e=!0,r._followupProvider=void 0,r._onDidReceiveFeedback.dispose(),r._onDidPerformAction.dispose(),r._pauseStateEmitter.dispose(),r._proxy.$unregisterAgent(r._handle)}}}invoke(e,t,n,r){return this._requestHandler(e,t,n,r)}};function jU(e,t,n){return new Promise((r,i)=>{let a=n.onCancellationRequested(async()=>{a.dispose(),await Eo(e),r(void 0)});t.then(r,i).finally(()=>a.dispose())})}var MU=class{constructor(e){this.computeFn=e}get(e){if(!this.cachedPromise){let e=this.computeFn().catch(t=>{throw this.cachedPromise===e&&(this.cachedPromise=void 0),t});this.cachedPromise=e}return mo(this.cachedPromise,e,[])}clear(){this.cachedPromise=void 0}};function NU(e){return e.startsWith(`github.copilot`)}var PU=class{constructor(e,t){this.webviews=t,this._renderers=new Map,this._proxy=e.getProxy(E.MainThreadChatOutputRenderer)}registerChatOutputRenderer(e,t,n){if(this._renderers.has(t))throw Error(`Chat output renderer already registered for: ${t}`);return this._renderers.set(t,{extension:e,renderer:n}),this._proxy.$registerChatOutputRenderer(t,e.identifier,e.extensionLocation),new WT(()=>{this._renderers.delete(t),this._proxy.$unregisterChatOutputRenderer(t)})}async $renderChatOutput(e,t,n,r,i,a){let o=this._renderers.get(e);if(!o)throw Error(`No chat output renderer registered for: ${e}`);let s=this.webviews.createNewWebview(r,{},o.extension),c=Object.freeze({webview:s,onDidDispose:s._onDidDispose});return o.renderer.renderChatOutput(Object.freeze({mime:t,value:n.buffer}),c,Object.freeze(i),a)}},FU=class{#e;#t;#n;#r;#i;get sessionResource(){return this.#i}set sessionResource(e){this.#i=e}#a;get untitledSessionResource(){return this.#a}set untitledSessionResource(e){this.#a=e}constructor(e,t){this.#n=new S,this.onDidChange=this.#n.event,this.#r=new S,this.onDidDispose=this.#r.event,this.#e=e,this.#t=t}get groups(){return this.#e}set groups(e){this.#e=e,this.#t?.()}_fireDidChange(){this.#n.fire()}_setGroups(e){this.#e=e}_dispose(){this.#r.fire(),this.#r.dispose(),this.#n.dispose()}},IU=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;constructor(e,t,n){this.resource=e,this.#e=t,this.#u=n}get label(){return this.#e}set label(e){this.#e!==e&&(this.#e=e,this.#u())}get iconPath(){return this.#t}set iconPath(e){this.#t!==e&&(this.#t=e,this.#u())}get description(){return this.#n}set description(e){this.#n!==e&&(this.#n=e,this.#u())}get badge(){return this.#r}set badge(e){this.#r!==e&&(this.#r=e,this.#u())}get status(){return this.#i}set status(e){this.#i!==e&&(this.#i=e,this.#u())}get archived(){return this.#a}set archived(e){this.#a!==e&&(this.#a=e,this.#u())}get tooltip(){return this.#o}set tooltip(e){this.#o!==e&&(this.#o=e,this.#u())}get timing(){return this.#s}set timing(e){this.#s!==e&&(this.#s=e,this.#u())}get changes(){return this.#c}set changes(e){this.#c!==e&&(this.#c=e,this.#u())}get metadata(){return this.#l}set metadata(e){if(e!==void 0)try{JSON.stringify(e)}catch{throw Error(`metadata must be JSON-serializable`)}sc(this.#l,e)||(this.#l=e,this.#u())}};function LU(e,t){let n={addedOrUpdated:new Ne,removed:new Pe};for(let[r,i]of t)e.get(r)!==i&&n.addedOrUpdated.set(r,i);for(let r of e.keys())t.has(r)||n.removed.add(r);return n}function RU(e){return{addedOrUpdated:e.addedOrUpdated?Array.from(e.addedOrUpdated.values(),zN.from):[],removed:e.removed?Array.from(e.removed.keys()):[]}}var zU=class{#e=new Ne;#t;#n;constructor(e,t){this.#t=t,this.#n=e}get size(){return this.#e.size}replace(e){if(!e.length&&!this.#e.size)return;let t=new Ne(e.map(e=>[e.resource,e])),n=LU(this.#e,t);!n.addedOrUpdated?.size&&!n.removed?.size||(this.#e=t,this.#t.$updateChatSessionItems(this.#n,RU(n)))}forEach(e,t){for(let[n,r]of this.#e)e.call(t,r,this)}add(e){let t=this.#e.get(e.resource);t&&t===e||(this.#e.set(e.resource,e),this.#t.$addOrUpdateChatSessionItem(this.#n,zN.from(e)))}delete(e){this.#e.delete(e)&&this.#t.$updateChatSessionItems(this.#n,{addedOrUpdated:[],removed:[e]})}get(e){return this.#e.get(e)}[Symbol.iterator](){return this.#e.entries()}},BU=class{constructor(e,t,n,r,i,a){this.session=e,this.extension=t,this.proxy=r,this.commandsConverter=i,this.sessionDisposables=a,this._pendingCarouselResolvers=new Map,this._stream=new DU(t,n,r,i,a,this._pendingCarouselResolvers,Pi.None)}get activeResponseStream(){return this._stream}getActiveRequestStream(e){return new DU(this.extension,e,this.proxy,this.commandsConverter,this.sessionDisposables,this._pendingCarouselResolvers,Pi.None)}};let VU=class extends y{constructor(e,t,n,r){super(),this.commands=e,this._languageModels=t,this._extHostRpc=n,this._logService=r,this._itemControllerHandlePool=0,this._chatSessionItemControllers=new Map,this._contentProviderHandlePool=0,this._chatSessionContentProviders=new Map,this._extHostChatSessions=new Ne,this._proxyCommands=new Map,this._proxy=this._extHostRpc.getProxy(E.MainThreadChatSessions),e.registerArgumentProcessor({processArgument:e=>{if(e&&e.$mid===Er.AgentSessionContext){let t=e.session.resource;for(let{controller:e}of this._chatSessionItemControllers.values()){let n=e.items.get(t);if(n)return n}return this._logService.warn(`No chat session found with uri: ${t}`),e}return e}})}registerChatSessionItemProvider(e,t,n){let r=this._itemControllerHandlePool++,i=new v,a=i.add(new S),o=new zU(r,this._proxy),s={id:t,items:o,createChatSessionItem:(e,t)=>{throw Error(`Not implemented for providers`)},createChatSessionInputState:e=>new FU([]),onDidChangeChatSessionItemState:a.event,newChatSessionItemHandler:void 0,resolveChatSessionItem:n.resolveChatSessionItem?async(e,t)=>{let r=await n.resolveChatSessionItem(e,t);r&&o.add(r)}:void 0,dispose:()=>{i.dispose()},refreshHandler:async e=>{let t=await n.provideChatSessionItems(e)??[];o.replace(t)}};return this._chatSessionItemControllers.set(r,{chatSessionType:t,controller:s,extension:e,disposable:i,onDidChangeChatSessionItemStateEmitter:a,inputStates:new Set}),this._proxy.$registerChatSessionItemController(r,t,!!n.resolveChatSessionItem),n.onDidChangeChatSessionItems&&i.add(n.onDidChangeChatSessionItems(()=>{this._logService.trace(`ExtHostChatSessions. Provider items changed for ${t}`),s.refreshHandler(Pi.None)})),n.onDidCommitChatSessionItem&&i.add(n.onDidCommitChatSessionItem(e=>{let{original:t,modified:n}=e;this._proxy.$onDidCommitChatSessionItem(r,t.resource,n.resource)})),Object.assign({dispose:()=>{this._chatSessionItemControllers.delete(r),i.dispose(),this._proxy.$unregisterChatSessionItemController(r)}},{onDidChangeChatSessionItemState:a.event})}createChatSessionItemController(e,t,n){let r=this._itemControllerHandlePool++,i=new v,a=!1,o,s,c,l,u=i.add(new S),d=new Set,f=new zU(r,this._proxy),p=this._proxy,m=Object.freeze({id:t,refreshHandler:async e=>{if(a)throw Error(`ChatSessionItemController has been disposed`);this._logService.trace(`ExtHostChatSessions. Controller(${t}).refresh()`),await n(e)},items:f,onDidChangeChatSessionItemState:u.event,createChatSessionItem:(e,t)=>{if(a)throw Error(`ChatSessionItemController has been disposed`);let n=new IU(e,t,()=>{f.get(e)===n&&this._proxy.$addOrUpdateChatSessionItem(r,zN.from(n))});return n},get newChatSessionItemHandler(){return o},set newChatSessionItemHandler(e){o=e},get forkHandler(){return s},set forkHandler(e){s=e},get resolveChatSessionItem(){return c},set resolveChatSessionItem(e){let t=!!c;c=e;let n=!!e;t!==n&&!a&&p.$updateChatSessionItemControllerCapabilities(r,n)},get getChatSessionInputState(){return l},set getChatSessionInputState(e){l=e},createChatSessionInputState:e=>{if(a)throw Error(`ChatSessionItemController has been disposed`);let t=new FU(e,()=>{let e=this._chatSessionItemControllers.get(r);e&&(e.optionGroups=t.groups);let n=this._wrapOptionGroupCommands(r,t.groups).map(e=>({id:e.id,name:e.name,description:e.description,items:e.items,selected:e.selected,when:e.when,icon:e.icon,commands:e.commands,kind:e.kind})),i=t.sessionResource??t.untitledSessionResource;i&&this._proxy.$updateChatSessionInputState(r,i,n)});return d.add(t),t},dispose:()=>{a=!0;for(let e of d)e._dispose();d.clear(),i.dispose()}});return this._chatSessionItemControllers.set(r,{controller:m,extension:e,disposable:i,chatSessionType:t,onDidChangeChatSessionItemStateEmitter:u,inputStates:d}),this._proxy.$registerChatSessionItemController(r,t,!!c),i.add(_(()=>{this._chatSessionItemControllers.delete(r),this._proxy.$unregisterChatSessionItemController(r)})),m}registerChatSessionContentProvider(e,t,n,r,i){let a=this._contentProviderHandlePool++,o=new v;return this._chatSessionContentProviders.set(a,{chatSessionScheme:t,provider:r,extension:e,capabilities:i,disposable:o}),this._proxy.$registerChatSessionContentProvider(a,t),r.onDidChangeChatSessionOptions&&o.add(r.onDidChangeChatSessionOptions(e=>{let t=Object.create(null);for(let n of e.updates)t[n.optionId]=n.value;this._proxy.$onDidChangeChatSessionOptions(a,e.resource,t)})),r.onDidChangeChatSessionProviderOptions&&o.add(r.onDidChangeChatSessionProviderOptions(()=>{this._proxy.$onDidChangeChatSessionProviderOptions(a)})),new WT(()=>{this._chatSessionContentProviders.delete(a),o.dispose(),this._proxy.$unregisterChatSessionContentProvider(a)})}async $provideChatSessionContent(e,t,n,r){let i=this._chatSessionContentProviders.get(e);if(!i)throw Error(`No provider for handle ${e}`);let a=w.revive(t),o=this.getChatSessionItemController(sh(a)),s;if(o?.controller.getChatSessionInputState){let e=await o.controller.getChatSessionInputState(ch(a)?void 0:a,{previousInputState:this._createInputStateFromOptions(o.optionGroups??[],n.initialSessionOptions)},r);e&&(s=e)}s??=this._createInputStateFromOptions(o?.optionGroups??[],n.initialSessionOptions),s instanceof FU&&(o&&this._disposeInputStatesForResource(o.inputStates,a),ch(a)?s.untitledSessionResource=a:s.sessionResource=a);let c=await i.provider.provideChatSessionContent(a,r,{inputState:s});if(r.isCancellationRequested)throw new f;let l=new v,u=a.toString(),d=new BU(c,i.extension,{sessionResource:a,requestId:`ongoing`,agentId:u,message:``,variables:{variables:[]},location:hy.Chat},{$handleProgressChunk:(t,n)=>this._proxy.$handleProgressChunk(e,a,t,n),$handleAnchorResolve:(t,n,r)=>{this._proxy.$handleAnchorResolve(e,a,t,n,r)}},this.commands.converter,l),p=l.add(new Ii);this._extHostChatSessions.set(a,{sessionObj:d,disposeCts:p}),c.activeResponseCallback&&Promise.resolve(c.activeResponseCallback(d.activeResponseStream.apiObject,p.token)).finally(()=>{this._proxy.$handleProgressComplete(e,a,`ongoing`)});let{capabilities:m}=i;return{resource:w.revive(a),title:c.title,hasActiveResponseCallback:!!c.activeResponseCallback,hasRequestHandler:!!c.requestHandler,hasForkHandler:!!o?.controller.forkHandler||!!c.forkHandler,supportsInterruption:!!m?.supportsInterruptions,options:c.options,history:c.history.map(e=>e instanceof tA?this.convertRequestTurn(e):this.convertResponseTurn(e,l))}}async $provideHandleOptionsChange(e,t,n,r){let i=w.revive(t),a=this._chatSessionContentProviders.get(e);if(!a){this._logService.warn(`No provider for handle ${e}`);return}if(a.provider.provideHandleOptionsChange){try{let e=Object.entries(n).map(([e,t])=>({optionId:e,value:t===void 0?void 0:typeof t==`string`?t:t.id}));a.provider.provideHandleOptionsChange(i,e,r)}catch(t){this._logService.error(`Error calling provideHandleOptionsChange for handle ${e}, sessionResource ${i}:`,t)}return}let o=sh(i),s=this.getChatSessionItemController(o);if(!s||!s.controller.getChatSessionInputState){this._logService.warn(`No valid controller found for session type ${o}`);return}for(let e of s?.inputStates??[]){let t=e.groups.map(e=>{let t=n[e.id];if(!t)return e;let r=typeof t==`string`?t:t.id,i=e.items.find(e=>e.id===r);return i?{...e,selected:i}:e});e._setGroups(t),e._fireDidChange()}}async $provideChatSessionProviderOptions(e,t){let n=this._chatSessionContentProviders.get(e);if(!n){this._logService.warn(`No provider for handle ${e} when requesting chat session options`);return}let r=n.provider;if(r.provideChatSessionProviderOptions)try{let e=await r.provideChatSessionProviderOptions(t);if(!e)return;let{optionGroups:i,newSessionOptions:a}=e;if(i){let e=this.getChatSessionItemController(n.chatSessionScheme);e&&(e.optionGroups=i)}return{optionGroups:i,newSessionOptions:a}}catch(t){this._logService.error(`Error calling provideChatSessionProviderOptions for handle ${e}:`,t);return}}async $interruptChatSessionActiveResponse(e,t,n){this._extHostChatSessions.get(w.revive(t))?.disposeCts.cancel()}async $disposeChatSessionContent(e,t){let n=w.revive(t),r=this._extHostChatSessions.get(n);if(!r){this._logService.warn(`No chat session found for resource: ${t}`);return}let i=this.getChatSessionItemController(n.scheme);i&&this._disposeInputStatesForResource(i.inputStates,n),r.disposeCts.cancel(),r.sessionObj.sessionDisposables.dispose(),this._extHostChatSessions.delete(n)}async $invokeChatSessionRequestHandler(e,t,n,r,i){let a=this._extHostChatSessions.get(w.revive(t));if(!a||!a.sessionObj.session.requestHandler)return{};let o=fN.to(n,void 0,await this.getModelForRequest(n,a.sessionObj.extension),n.modelConfiguration,[],new Map,a.sessionObj.extension,this._logService),s=a.sessionObj.getActiveRequestStream(n);return await a.sessionObj.session.requestHandler(o,{history:r,yieldRequested:!1},s.apiObject,i),{}}async $forkChatSession(e,t,n,r){let i=w.revive(t),a=this._extHostChatSessions.get(i);if(!a)throw Error(`No chat session found for resource ${i.toString()}`);let o=this.convertRequestDtoToRequestTurn(n),s=this.getChatSessionItemController(sh(i));if(s?.controller.forkHandler){let e=await s.controller.forkHandler(i,o,r);return zN.from(e)}if(!a.sessionObj.session.forkHandler)throw Error(`No fork handler for session ${i.toString()}`);let c=await a.sessionObj.session.forkHandler(i,o,r);return zN.from(c)}convertRequestDtoToRequestTurn(e){if(e)return new tA(e.prompt,e.command,[],e.participant,[],void 0,e.id,e.modelId,vN.to(e.modeInstructions))}getChatSessionItemController(e){for(let t of this._chatSessionItemControllers.values())if(t.chatSessionType===e)return t}_disposeInputStatesForResource(e,t){for(let n of e){let r=n.sessionResource??n.untitledSessionResource;r&&$a(t,r)&&(n._dispose(),e.delete(n))}}_createInputStateFromOptions(e,t){return t?.length?new FU(e.map(e=>{let n=t.find(t=>t.optionId===e.id);if(!n)return e;let r=e.items.find(e=>e.id===n.value);return r?{...e,selected:r}:e})):new FU(e)}async getInputStateForSession(e,t,n){let r=e?sh(e):void 0,i=r?this.getChatSessionItemController(r):void 0,a=e&&!ch(e)?e:void 0;if(i?.controller.getChatSessionInputState){let r=await i.controller.getChatSessionInputState(a,{previousInputState:this._createInputStateFromOptions(i.optionGroups??[],t)},n);if(r)return r instanceof FU&&(e&&i&&this._disposeInputStatesForResource(i.inputStates,e),e&&ch(e)?r.untitledSessionResource=e:e&&(r.sessionResource=a)),r}let o=this._createInputStateFromOptions(i?.optionGroups??[],t);return o.sessionResource=a,o}_wrapOptionGroupCommands(e,t){return this._chatSessionItemControllers.get(e)?.controller.getChatSessionInputState?t.map(t=>t.commands?.length?{...t,commands:t.commands.map(t=>{let n=`_chatSession.proxyCommand.${zc()}`;return this._proxyCommands.set(n,{originalCommandId:t.command,controllerHandle:e}),this.commands.registerCommand(!0,n,async(...e)=>{let n=e[0]instanceof w?e[0]:void 0,r=await this.getInputStateForSession(n,void 0,Pi.None);return this.commands.executeCommand(t.command,{inputState:r,sessionResource:n},...t.arguments??[])}),{...t,command:n}})}:t):t}async getModelForRequest(e,t){let n;if(e.userSelectedModelId&&(n=await this._languageModels.getLanguageModelByIdentifier(t,e.userSelectedModelId)),!n&&(n=await this._languageModels.getDefaultLanguageModel(t),!n))throw Error(`Language model unavailable`);return n}convertRequestTurn(e){let t=e.references.map(e=>this.convertReferenceToVariable(e));return{type:`request`,id:e.id,prompt:e.prompt,participant:e.participant,command:e.command,variableData:t.length>0?{variables:t}:void 0,modelId:e.modelId,modeInstructions:vN.from(e.modeInstructions2)}}convertReferenceToVariable(e){let t=e.value&&typeof e.value==`object`&&`uri`in e.value&&`range`in e.value?aj.from(e.value):e.value,n=e.range?{start:e.range[0],endExclusive:e.range[1]}:void 0;if(t&&t instanceof kA&&Array.isArray(t.diagnostics)&&t.diagnostics.length&&t.diagnostics[0][1].length){let e=uj.from(t.diagnostics[0][1][0]),n={filterRange:{startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn},filterSeverity:e.severity,filterUri:t.diagnostics[0][0],problemMessage:t.diagnostics[0][1][0].message};return uh.toEntry(n)}if(dT.isLocation(e.value)&&e.name.startsWith(`sym:`)){let t=aj.from(e.value);return{id:e.id,name:e.name,fullName:e.name.substring(4),value:{uri:e.value.uri,range:t.range},symbolKind:H.Property,icon:Wp.toIcon(H.Property),kind:`symbol`,range:n}}if(w.isUri(t)&&e.name.startsWith(`prompt:`)){if(e.id.startsWith(hh.Instruction))return gh(t,hh.Instruction);if(e.id.startsWith(hh.InstructionReference))return gh(t,hh.InstructionReference);if(e.id.startsWith(hh.PromptFile))return gh(t,hh.PromptFile)}let r=w.isUri(t)||t&&typeof t==`object`&&`uri`in t,i=r&&w.isUri(t)&&t.path.endsWith(`/`);return{id:e.id,name:e.name,value:t,modelDescription:e.modelDescription,range:n,kind:i?`directory`:r?`file`:`generic`}}convertResponseTurn(e,t){return{type:`response`,parts:pe(e.response.map(e=>dN.from(e,this.commands.converter,t))),participant:e.participant,details:e.result?.details}}async $refreshChatSessionItems(e,t){let n=this._chatSessionItemControllers.get(e);if(!n){this._logService.warn(`No controller found for handle ${e}`);return}await n.controller.refreshHandler(t)}async $newChatSessionItem(e,t,n){let r=this._chatSessionItemControllers.get(e);if(!r){this._logService.warn(`No controller found for handle ${e}`);return}let i=r.controller.newChatSessionItemHandler;if(!i)return;let a=this._createInputStateFromOptions(r.optionGroups??[],t.initialSessionOptions),o;o=r.controller.getChatSessionInputState?await r.controller.getChatSessionInputState(void 0,{previousInputState:a},n):a;let s=await i({request:{prompt:t.prompt,command:t.command},inputState:o},n);if(s)return r.controller.items.add(s),zN.from(s)}$onDidChangeChatSessionItemState(e,t,n){let r=this._chatSessionItemControllers.get(e);if(!r){this._logService.warn(`No controller found for handle ${e}`);return}let i=w.revive(t),a=r.controller.items.get(i);if(!a){this._logService.warn(`No item found for session resource ${i.toString()}`);return}a.archived=n,r.onDidChangeChatSessionItemStateEmitter.fire(a)}async $resolveChatSessionItem(e,t,n){let r=w.revive(t),i=this._chatSessionItemControllers.get(e);if(!i?.controller.resolveChatSessionItem)return;let a=i.controller.items.get(r);if(!a){this._logService.warn(`No item found for session resource ${r.toString()}`);return}await i.controller.resolveChatSessionItem(a,n);let o=i.controller.items.get(r);if(o)return zN.from(o)}async $provideChatSessionInputState(e,t,n){let r=this._chatSessionItemControllers.get(e);if(!r){this._logService.warn(`No controller found for handle ${e}`);return}let i=r.controller.getChatSessionInputState;if(!i)return;let a=t?w.revive(t):void 0,o=await i(!a||ch(a)?void 0:a,{previousInputState:void 0},n);if(o)return o instanceof FU&&a&&(this._disposeInputStatesForResource(r.inputStates,a),ch(a)?o.untitledSessionResource=a:o.sessionResource=a),r.optionGroups=o.groups,this._wrapOptionGroupCommands(e,o.groups).map(e=>({id:e.id,name:e.name,description:e.description,items:e.items,selected:e.selected,when:e.when,icon:e.icon,commands:e.commands,kind:e.kind}))}};VU=A([j(2,Hs),j(3,Ds)],VU);var HU=class{constructor(e){this._items=new Map,this._proxy=e.getProxy(E.MainThreadChatStatus)}createChatStatusItem(e,t){let n=UU(e.identifier,t);if(this._items.has(n))throw Error(`Chat status item '${t}' already exists`);let r={id:n,title:``,description:``,detail:``,tooltip:void 0},i=!1,a=!1,o=()=>{if(i)throw Error(`Chat status item is disposed`);a&&this._proxy.$setEntry(t,r)},s=Object.freeze({id:t,get title(){return r.title},set title(e){r.title=e,o()},get description(){return r.description},set description(e){r.description=e,o()},get detail(){return r.detail},set detail(e){r.detail=e,o()},get tooltip(){return r.tooltip},set tooltip(e){r.tooltip=e,o()},show:()=>{a=!0,o()},hide:()=>{a=!1,this._proxy.$disposeEntry(t)},dispose:()=>{i=!0,this._proxy.$disposeEntry(t),this._items.delete(n)}});return this._items.set(n,s),s}};function UU(e,t){return`${ys.toKey(e)}.${t}`}var WU=class extends y{constructor(e){super(),this._proxy=e.getProxy(E.MainThreadChatQuota)}updateQuotas(e){this._proxy.$updateQuotas(e)}},GU=class{constructor(e){this._items=new Map,this._proxy=e.getProxy(E.MainThreadChatInputNotification)}createInputNotification(e,t){let n=KU(e.identifier,t);if(this._items.has(n))throw Error(`Chat input notification '${t}' already exists`);let r={id:n,severity:ji.Info,message:``,description:void 0,actions:[],dismissible:!0,autoDismissOnMessage:!1},i=!1,a=!1,o=()=>{if(i)throw Error(`Chat input notification is disposed`);a&&this._proxy.$setNotification({...r})},s=Object.freeze({id:t,get severity(){return r.severity},set severity(e){r.severity=e,o()},get message(){return r.message},set message(e){r.message=e,o()},get description(){return r.description},set description(e){r.description=e,o()},get actions(){return r.actions},set actions(e){r.actions=e.map(e=>({label:e.label,commandId:e.commandId,commandArgs:e.commandArgs})),o()},get dismissible(){return r.dismissible},set dismissible(e){r.dismissible=e,o()},get autoDismissOnMessage(){return r.autoDismissOnMessage},set autoDismissOnMessage(e){r.autoDismissOnMessage=e,o()},show:()=>{a=!0,o()},hide:()=>{i||(a=!1,this._proxy.$disposeNotification(n))},dispose:()=>{i||(i=!0,a=!1,this._proxy.$disposeNotification(n),this._items.delete(n))}});return this._items.set(n,s),s}};function KU(e,t){return`${ys.toKey(e)}.${t}`}var qU=class{constructor(e){let t=e.getProxy(E.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(e){return t.$writeText(e)}})}};const JU=`vscode-cdn.net`,YU=`vscode-resource.${JU}`,XU=`'self' https://*.${JU}`;function ZU(e,t){return e.scheme===O.http||e.scheme===O.https?e:(t&&t.authority&&t.isRemote&&e.scheme===O.file&&(e=w.from({scheme:O.vscodeRemote,authority:t.authority,path:e.path})),w.from({scheme:O.https,authority:`${e.scheme}+${QU(e.authority)}.${YU}`,path:e.path,fragment:e.fragment,query:e.query}))}function QU(e){return e.replace(/./g,e=>{let t=e.charCodeAt(0);return t>=C.a&&t<=C.z||t>=C.A&&t<=C.Z||t>=C.Digit0&&t<=C.Digit9?e:`-`+t.toString(16).padStart(4,`0`)})}var $U=class{constructor(e,t,n){this._proxy=e,this._editors=t,this._remoteInfo=n,this._handlePool=0,this._disposables=new v,this._insets=new Map,this._disposables.add(t.onDidChangeVisibleTextEditors(()=>{let e=t.getVisibleTextEditors();for(let t of this._insets.values())e.indexOf(t.editor)<0&&t.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,n,r,i){let a;for(let t of this._editors.getVisibleTextEditors(!0))if(t.value===e){a=t;break}if(!a)throw Error(`not a visible editor`);let o=this,s=this._handlePool++,c=new S,l=new S,u=new class{constructor(){this._html=``,this._options=Object.create(null)}asWebviewUri(e){return ZU(e,o._remoteInfo)}get cspSource(){return XU}set options(e){this._options=e,o._proxy.$setOptions(s,e)}get options(){return this._options}set html(e){this._html=e,o._proxy.$setHtml(s,e)}get html(){return this._html}get onDidReceiveMessage(){return c.event}postMessage(e){return o._proxy.$postMessage(s,e)}},d=new class{constructor(){this.editor=e,this.line=t,this.height=n,this.webview=u,this.onDidDispose=l.event}dispose(){o._insets.delete(s)&&(o._proxy.$disposeEditorInset(s),l.fire(),l.dispose(),c.dispose())}};return this._proxy.$createEditorInset(s,a.id,a.value.document.uri,t+1,n,r||{},i.identifier,i.extensionLocation),this._insets.set(s,{editor:e,inset:d,onDidReceiveMessage:c}),d}$onDidDispose(e){let t=this._insets.get(e);t&&t.inset.dispose()}$onDidReceiveMessage(e,t){this._insets.get(e)?.onDidReceiveMessage.fire(t)}},eW=class e{static{this._providerHandlePool=0}constructor(e){this.providers=new Map,this._proxy=e.getProxy(E.MainThreadCodeMapper)}async $mapCode(e,t,n){let r=this.providers.get(e);if(!r)throw Error(`Received request to map code for unknown provider handle ${e}`);let i={textEdit:(e,n)=>{n=be(n),this._proxy.$handleProgress(t.requestId,{uri:e,edits:n.map(Sj.from)})},notebookEdit:(e,n)=>{n=be(n),this._proxy.$handleProgress(t.requestId,{uri:e,edits:n.map(oN.from)})}},a={location:t.location,chatRequestId:t.chatRequestId,chatRequestModel:t.chatRequestModel,chatSessionId:t.chatSessionResource?oh.parseLocalSessionId(w.revive(t.chatSessionResource)):void 0,codeBlocks:t.codeBlocks.map(e=>({code:e.code,resource:w.revive(e.resource),markdownBeforeBlock:e.markdownBeforeBlock}))};return await r.provideMappedEdits(a,i,n)??null}registerMappedEditsProvider(t,n){let r=e._providerHandlePool++;return this._proxy.$registerCodeMapperProvider(r,t.displayName??t.name),this.providers.set(r,n),{dispose:()=>this._proxy.$unregisterCodeMapperProvider(r)}}};function tW(e,t,n){let r=e.getProxy(E.MainThreadComments);class i{static{this.handlePool=0}constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new xs,t.registerArgumentProcessor({processArgument:e=>{if(e&&e.$mid===Er.CommentController){let t=this._commentControllers.get(e.handle);return t?t.value:e}else if(e&&e.$mid===Er.CommentThread){let t=e,n=this._commentControllers.get(t.commentControlHandle);if(!n)return t;let r=n.getCommentThread(t.commentThreadHandle);return r?r.value:t}else if(e&&(e.$mid===Er.CommentThreadReply||e.$mid===Er.CommentThreadInstance)){let t=this._commentControllers.get(e.thread.commentControlHandle);if(!t)return e;let n=t.getCommentThread(e.thread.commentThreadHandle);return n?e.$mid===Er.CommentThreadInstance?n.value:{thread:n.value,text:e.text}:e}else if(e&&e.$mid===Er.CommentNode){let t=this._commentControllers.get(e.thread.commentControlHandle);if(!t)return e;let n=t.getCommentThread(e.thread.commentThreadHandle);if(!n)return e;let r=e.commentUniqueId;return n.getCommentByUniqueId(r)||e}else if(e&&e.$mid===Er.CommentThreadNode){let t=this._commentControllers.get(e.thread.commentControlHandle);if(!t)return e;let n=t.getCommentThread(e.thread.commentThreadHandle);if(!n)return e;let r=e.text,i=e.commentUniqueId,a=n.getCommentByUniqueId(i);return a?(typeof a.body==`string`?a.body=r:a.body=new Qw(r),a):e}return e}})}createCommentController(e,t,n){let r=new o(e,i.handlePool++,t,n);this._commentControllers.set(r.handle,r);let a=this._commentControllersByExtension.get(e.identifier)||[];return a.push(r),this._commentControllersByExtension.set(e.identifier,a),r.value}async $createCommentThreadTemplate(e,t,n,r){let i=this._commentControllers.get(e);i&&i.$createCommentThreadTemplate(t,n,r)}async $setActiveComment(e,t){let n=this._commentControllers.get(e);n&&n.$setActiveComment(t??void 0)}async $updateCommentThreadTemplate(e,t,n){let r=this._commentControllers.get(e);r&&r.$updateCommentThreadTemplate(t,n)}$deleteCommentThread(e,t){this._commentControllers.get(e)?.$deleteCommentThread(t)}async $updateCommentThread(e,t,n){this._commentControllers.get(e)?.$updateCommentThread(t,n)}async $provideCommentingRanges(e,t,r){let i=this._commentControllers.get(e);if(!i||!i.commentingRangeProvider)return Promise.resolve(void 0);let a=await n.ensureDocumentData(w.revive(t));return go(async()=>{let e=await i.commentingRangeProvider?.provideCommentingRanges(a.document,r),t;return t=Array.isArray(e)?{ranges:e,fileComments:!1}:e?{ranges:e.ranges||[],fileComments:e.enableFileComments||!1}:e??void 0,t}).then(e=>{let t;return e&&(t={ranges:e.ranges.map(e=>J.from(e)),fileComments:e.fileComments}),t})}$toggleReaction(e,t,n,r,i){let a=this._commentControllers.get(e);return!a||!a.reactionHandler?Promise.resolve(void 0):go(()=>{let e=a.getCommentThread(t);if(e){let t=e.getCommentByUniqueId(r.uniqueIdInThread);if(a!==void 0&&t&&a.reactionHandler)return a.reactionHandler(t,l(i))}return Promise.resolve(void 0)})}}class a{static{this._handlePool=0}set threadId(e){this._id=e}get threadId(){return this._id}get id(){return this._id}get resource(){return this._uri}get uri(){return this._uri}set range(e){(e===void 0!=(this._range===void 0)||!e||!this._range||!e.isEqual(this._range))&&(this._range=e,this.modifications.range=e,this._onDidUpdateCommentThread.fire())}get range(){return this._range}set canReply(e){this._canReply!==e&&(this._canReply=e,this.modifications.canReply=e,this._onDidUpdateCommentThread.fire())}get canReply(){return this._canReply}get label(){return this._label}set label(e){this._label=e,this.modifications.label=e,this._onDidUpdateCommentThread.fire()}get contextValue(){return this._contextValue}set contextValue(e){this._contextValue=e,this.modifications.contextValue=e,this._onDidUpdateCommentThread.fire()}get comments(){return this._comments}set comments(e){this._comments=e,this.modifications.comments=e,this._onDidUpdateCommentThread.fire()}get collapsibleState(){return this._collapseState}set collapsibleState(e){this._collapseState!==e&&(this._collapseState=e,this.modifications.collapsibleState=e,this._onDidUpdateCommentThread.fire())}get state(){return this._state}set state(e){this._state=e,typeof e==`object`?(K(this.extensionDescription,`commentThreadApplicability`),this.modifications.state=e.resolved,this.modifications.applicability=e.applicability):this.modifications.state=e,this._onDidUpdateCommentThread.fire()}get isDisposed(){return this._isDiposed}constructor(e,t,n,i,o,c,l,u,d){this._commentControllerHandle=t,this._id=n,this._uri=i,this._range=o,this._comments=c,this.extensionDescription=l,this._isTemplate=u,this.handle=a._handlePool++,this.commentHandle=0,this.modifications=Object.create(null),this._onDidUpdateCommentThread=new S,this.onDidUpdateCommentThread=this._onDidUpdateCommentThread.event,this._canReply=!0,this._commentsMap=new Map,this._acceptInputDisposables=new vt,this._acceptInputDisposables.value=new v,this._id===void 0&&(this._id=`${e}.${this.handle}`),r.$createCommentThread(t,this.handle,this._id,this._uri,J.from(this._range),this._comments.map(e=>s(this,e,this._commentsMap,this.extensionDescription)),l.identifier,this._isTemplate,d),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this._localDisposables.push({dispose:()=>{r.$deleteCommentThread(t,this.handle)}});let f=this;this.value={get uri(){return f.uri},get range(){return f.range},set range(e){f.range=e},get comments(){return f.comments},set comments(e){f.comments=e},get collapsibleState(){return f.collapsibleState},set collapsibleState(e){f.collapsibleState=e},get canReply(){return f.canReply},set canReply(e){f.canReply=e},get contextValue(){return f.contextValue},set contextValue(e){f.contextValue=e},get label(){return f.label},set label(e){f.label=e},get state(){return f.state},set state(e){f.state=e},reveal:(e,t)=>f.reveal(e,t),hide:()=>f.hide(),dispose:()=>{f.dispose()}}}updateIsTemplate(){this._isTemplate&&(this._isTemplate=!1,this.modifications.isTemplate=!1)}eventuallyUpdateCommentThread(){if(this._isDiposed)return;this.updateIsTemplate(),this._acceptInputDisposables.value||(this._acceptInputDisposables.value=new v);let e=e=>Object.prototype.hasOwnProperty.call(this.modifications,e),t={};e(`range`)&&(t.range=J.from(this._range)),e(`label`)&&(t.label=this.label),e(`contextValue`)&&(t.contextValue=this.contextValue??null),e(`comments`)&&(t.comments=this._comments.map(e=>s(this,e,this._commentsMap,this.extensionDescription))),e(`collapsibleState`)&&(t.collapseState=u(this._collapseState)),e(`canReply`)&&(t.canReply=this.canReply),e(`state`)&&(t.state=d(this._state)),e(`applicability`)&&(t.applicability=f(this._state)),e(`isTemplate`)&&(t.isTemplate=this._isTemplate),this.modifications={},r.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,t)}getCommentByUniqueId(e){for(let t of this._commentsMap){let n=t[0];if(e===t[1])return n}}async reveal(e,t){K(this.extensionDescription,`commentReveal`);let n;e&&e.body!==void 0?n=e:t??=e;let i=n?this._commentsMap.get(n):void 0;i??=this._commentsMap.get(this._comments[0]);let a=!0,o=!1;return t?.focus===lO.Reply?(o=!0,a=!1):t?.focus===lO.Comment&&(a=!1),r.$revealCommentThread(this._commentControllerHandle,this.handle,i,{preserveFocus:a,focusReply:o})}async hide(){return r.$hideCommentThread(this._commentControllerHandle,this.handle)}dispose(){this._isDiposed=!0,this._acceptInputDisposables.dispose(),this._onDidUpdateCommentThread.dispose(),this._localDisposables.forEach(e=>e.dispose())}}class o{get id(){return this._id}get label(){return this._label}get handle(){return this._handle}get commentingRangeProvider(){return this._commentingRangeProvider}set commentingRangeProvider(e){this._commentingRangeProvider=e,e?.resourceHints&&K(this._extension,`commentingRangeHint`),r.$updateCommentingRanges(this.handle,e?.resourceHints)}get reactionHandler(){return this._reactionHandler}set reactionHandler(e){this._reactionHandler=e,r.$updateCommentControllerFeatures(this.handle,{reactionHandler:!!e})}get options(){return this._options}set options(e){this._options=e,r.$updateCommentControllerFeatures(this.handle,{options:this._options})}get activeComment(){return K(this._extension,`activeComment`),this._activeComment}get activeCommentThread(){return K(this._extension,`activeComment`),this._activeThread?.value}constructor(e,t,n,i){this._extension=e,this._handle=t,this._id=n,this._label=i,this._threads=new Map,r.$registerCommentController(this.handle,n,i,this._extension.identifier.value);let a=this;this.value=Object.freeze({id:a.id,label:a.label,get options(){return a.options},set options(e){a.options=e},get commentingRangeProvider(){return a.commentingRangeProvider},set commentingRangeProvider(e){a.commentingRangeProvider=e},get reactionHandler(){return a.reactionHandler},set reactionHandler(e){a.reactionHandler=e},get activeCommentThread(){return a.activeCommentThread},createCommentThread(e,t,n){return a.createCommentThread(e,t,n).value},dispose:()=>{a.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{r.$unregisterCommentController(this.handle)}})}createCommentThread(e,t,n){let r=new a(this.id,this.handle,void 0,e,t,n,this._extension,!1);return this._threads.set(r.handle,r),r}$setActiveComment(e){if(!e){this._activeComment=void 0,this._activeThread=void 0;return}let t=this._threads.get(e.commentThreadHandle);t&&(this._activeComment=e.uniqueIdInThread?t.getCommentByUniqueId(e.uniqueIdInThread):void 0,this._activeThread=t)}$createCommentThreadTemplate(e,t,n){let r=new a(this.id,this.handle,void 0,w.revive(e),J.to(t),[],this._extension,!0,n);return r.collapsibleState=Yp.Expanded,this._threads.set(r.handle,r),r}$updateCommentThreadTemplate(e,t){let n=this._threads.get(e);n&&(n.range=J.to(t))}$updateCommentThread(e,t){let n=this._threads.get(e);n&&(e=>Object.prototype.hasOwnProperty.call(t,e))(`collapseState`)&&(n.collapsibleState=u(t.collapseState))}$deleteCommentThread(e){this._threads.get(e)?.dispose(),this._threads.delete(e)}getCommentThread(e){return this._threads.get(e)}dispose(){this._threads.forEach(e=>{e.dispose()}),this._localDisposables.forEach(e=>e.dispose())}}function s(e,t,n,r){let i=n.get(t);return i||(i=++e.commentHandle,n.set(t,i)),t.state!==void 0&&K(r,`commentsDraftState`),t.reactions?.some(e=>e.reactors!==void 0)&&K(r,`commentReactor`),{mode:t.mode,contextValue:t.contextValue,uniqueIdInThread:i,body:typeof t.body==`string`?t.body:Y.from(t.body),userName:t.author.name,userIconPath:t.author.iconPath,label:t.label,commentReactions:t.reactions?t.reactions.map(e=>c(e)):void 0,state:t.state,timestamp:t.timestamp?.toJSON()}}function c(e){return{label:e.label,iconPath:e.iconPath?_j(e.iconPath):void 0,count:e.count,hasReacted:e.authorHasReacted,reactors:e.reactors&&e.reactors.length>0&&typeof e.reactors[0]!=`string`?e.reactors.map(e=>e.name):e.reactors}}function l(e){return{label:e.label||``,count:e.count||0,iconPath:e.iconPath?w.revive(e.iconPath):``,authorHasReacted:e.hasReacted||!1,reactors:e.reactors?.map(e=>({name:e}))}}function u(e){if(e!==void 0)switch(e){case iO.Expanded:return Yp.Expanded;case iO.Collapsed:return Yp.Collapsed}return Yp.Collapsed}function d(e){let t;if(t=typeof e==`object`?e.resolved:e,t!==void 0)switch(t){case sO.Unresolved:return Xp.Unresolved;case sO.Resolved:return Xp.Resolved}return Xp.Unresolved}function f(e){let t;if(typeof e==`object`&&(t=e.applicability),t!==void 0)switch(t){case cO.Current:return Zp.Current;case cO.Outdated:return Zp.Outdated}return Zp.Current}return new i}var nW={exports:{}},rW;function iW(){return rW?nW.exports:(rW=1,(function(e,t){t=e.exports=Ie;var n=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift(`SEMVER`),console.log.apply(console,e)}:function(){};t.SEMVER_SPEC_VERSION=`2.0.0`;var r=256,i=2**53-1||9007199254740991,a=16,o=t.re=[],s=t.src=[],c=0,l=c++;s[l]=`0|[1-9]\\d*`;var u=c++;s[u]=`[0-9]+`;var d=c++;s[d]=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`;var f=c++;s[f]=`(`+s[l]+`)\\.(`+s[l]+`)\\.(`+s[l]+`)`;var p=c++;s[p]=`(`+s[u]+`)\\.(`+s[u]+`)\\.(`+s[u]+`)`;var m=c++;s[m]=`(?:`+s[l]+`|`+s[d]+`)`;var h=c++;s[h]=`(?:`+s[u]+`|`+s[d]+`)`;var ee=c++;s[ee]=`(?:-(`+s[m]+`(?:\\.`+s[m]+`)*))`;var te=c++;s[te]=`(?:-?(`+s[h]+`(?:\\.`+s[h]+`)*))`;var g=c++;s[g]=`[0-9A-Za-z-]+`;var ne=c++;s[ne]=`(?:\\+(`+s[g]+`(?:\\.`+s[g]+`)*))`;var re=c++,ie=`v?`+s[f]+s[ee]+`?`+s[ne]+`?`;s[re]=`^`+ie+`$`;var ae=`[v=\\s]*`+s[p]+s[te]+`?`+s[ne]+`?`,oe=c++;s[oe]=`^`+ae+`$`;var se=c++;s[se]=`((?:<|>)?=?)`;var ce=c++;s[ce]=s[u]+`|x|X|\\*`;var le=c++;s[le]=s[l]+`|x|X|\\*`;var ue=c++;s[ue]=`[v=\\s]*(`+s[le]+`)(?:\\.(`+s[le]+`)(?:\\.(`+s[le]+`)(?:`+s[ee]+`)?`+s[ne]+`?)?)?`;var de=c++;s[de]=`[v=\\s]*(`+s[ce]+`)(?:\\.(`+s[ce]+`)(?:\\.(`+s[ce]+`)(?:`+s[te]+`)?`+s[ne]+`?)?)?`;var fe=c++;s[fe]=`^`+s[se]+`\\s*`+s[ue]+`$`;var pe=c++;s[pe]=`^`+s[se]+`\\s*`+s[de]+`$`;var me=c++;s[me]=`(?:^|[^\\d])(\\d{1,`+a+`})(?:\\.(\\d{1,`+a+`}))?(?:\\.(\\d{1,`+a+`}))?(?:$|[^\\d])`;var he=c++;s[he]=`(?:~>?)`;var ge=c++;s[ge]=`(\\s*)`+s[he]+`\\s+`,o[ge]=new RegExp(s[ge],`g`);var _e=`$1~`,ve=c++;s[ve]=`^`+s[he]+s[ue]+`$`;var ye=c++;s[ye]=`^`+s[he]+s[de]+`$`;var be=c++;s[be]=`(?:\\^)`;var xe=c++;s[xe]=`(\\s*)`+s[be]+`\\s+`,o[xe]=new RegExp(s[xe],`g`);var Se=`$1^`,Ce=c++;s[Ce]=`^`+s[be]+s[ue]+`$`;var we=c++;s[we]=`^`+s[be]+s[de]+`$`;var Te=c++;s[Te]=`^`+s[se]+`\\s*(`+ae+`)$|^$`;var Ee=c++;s[Ee]=`^`+s[se]+`\\s*(`+ie+`)$|^$`;var De=c++;s[De]=`(\\s*)`+s[se]+`\\s*(`+ae+`|`+s[ue]+`)`,o[De]=new RegExp(s[De],`g`);var Oe=`$1$2$3`,ke=c++;s[ke]=`^\\s*(`+s[ue]+`)\\s+-\\s+(`+s[ue]+`)\\s*$`;var Ae=c++;s[Ae]=`^\\s*(`+s[de]+`)\\s+-\\s+(`+s[de]+`)\\s*$`;var je=c++;s[je]=`(<|>)?=?\\s*\\*`;for(var Me=0;Me<c;Me++)n(Me,s[Me]),o[Me]||(o[Me]=new RegExp(s[Me]));t.parse=Ne;function Ne(e,t){if(e instanceof Ie)return e;if(typeof e!=`string`||e.length>r||!(t?o[oe]:o[re]).test(e))return null;try{return new Ie(e,t)}catch{return null}}t.valid=Pe;function Pe(e,t){var n=Ne(e,t);return n?n.version:null}t.clean=Fe;function Fe(e,t){var n=Ne(e.trim().replace(/^[=v]+/,``),t);return n?n.version:null}t.SemVer=Ie;function Ie(e,t){if(e instanceof Ie){if(e.loose===t)return e;e=e.version}else if(typeof e!=`string`)throw TypeError(`Invalid Version: `+e);if(e.length>r)throw TypeError(`version is longer than `+r+` characters`);if(!(this instanceof Ie))return new Ie(e,t);n(`SemVer`,e,t),this.loose=t;var a=e.trim().match(t?o[oe]:o[re]);if(!a)throw TypeError(`Invalid Version: `+e);if(this.raw=e,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);a[4]?this.prerelease=a[4].split(`.`).map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=a[5]?a[5].split(`.`):[],this.format()}Ie.prototype.format=function(){return this.version=this.major+`.`+this.minor+`.`+this.patch,this.prerelease.length&&(this.version+=`-`+this.prerelease.join(`.`)),this.version},Ie.prototype.toString=function(){return this.version},Ie.prototype.compare=function(e){return n(`SemVer.compare`,this.version,this.loose,e),e instanceof Ie||(e=new Ie(e,this.loose)),this.compareMain(e)||this.comparePre(e)},Ie.prototype.compareMain=function(e){return e instanceof Ie||(e=new Ie(e,this.loose)),Be(this.major,e.major)||Be(this.minor,e.minor)||Be(this.patch,e.patch)},Ie.prototype.comparePre=function(e){if(e instanceof Ie||(e=new Ie(e,this.loose)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],i=e.prerelease[t];if(n(`prerelease compare`,t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Be(r,i)}while(++t)},Ie.prototype.inc=function(e,t){switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t),this.inc(`pre`,t);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t),this.inc(`pre`,t);break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:if(this.prerelease.length===0)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)typeof this.prerelease[n]==`number`&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw Error(`invalid increment argument: `+e)}return this.format(),this.raw=this.version,this},t.inc=Le;function Le(e,t,n,r){typeof n==`string`&&(r=n,n=void 0);try{return new Ie(e,n).inc(t,r).version}catch{return null}}t.diff=Re;function Re(e,t){if(Qe(e,t))return null;var n=Ne(e),r=Ne(t);if(n.prerelease.length||r.prerelease.length){for(var i in n)if((i===`major`||i===`minor`||i===`patch`)&&n[i]!==r[i])return`pre`+i;return`prerelease`}for(var i in n)if((i===`major`||i===`minor`||i===`patch`)&&n[i]!==r[i])return i}t.compareIdentifiers=Be;var ze=/^[0-9]+$/;function Be(e,t){var n=ze.test(e),r=ze.test(t);return n&&r&&(e=+e,t=+t),n&&!r?-1:r&&!n?1:e<t?-1:+(e>t)}t.rcompareIdentifiers=Ve;function Ve(e,t){return Be(t,e)}t.major=He;function He(e,t){return new Ie(e,t).major}t.minor=Ue;function Ue(e,t){return new Ie(e,t).minor}t.patch=We;function We(e,t){return new Ie(e,t).patch}t.compare=Ge;function Ge(e,t,n){return new Ie(e,n).compare(new Ie(t,n))}t.compareLoose=Ke;function Ke(e,t){return Ge(e,t,!0)}t.rcompare=qe;function qe(e,t,n){return Ge(t,e,n)}t.sort=Je;function Je(e,n){return e.sort(function(e,r){return t.compare(e,r,n)})}t.rsort=Ye;function Ye(e,n){return e.sort(function(e,r){return t.rcompare(e,r,n)})}t.gt=Xe;function Xe(e,t,n){return Ge(e,t,n)>0}t.lt=Ze;function Ze(e,t,n){return Ge(e,t,n)<0}t.eq=Qe;function Qe(e,t,n){return Ge(e,t,n)===0}t.neq=$e;function $e(e,t,n){return Ge(e,t,n)!==0}t.gte=et;function et(e,t,n){return Ge(e,t,n)>=0}t.lte=tt;function tt(e,t,n){return Ge(e,t,n)<=0}t.cmp=nt;function nt(e,t,n,r){var i;switch(t){case`===`:typeof e==`object`&&(e=e.version),typeof n==`object`&&(n=n.version),i=e===n;break;case`!==`:typeof e==`object`&&(e=e.version),typeof n==`object`&&(n=n.version),i=e!==n;break;case``:case`=`:case`==`:i=Qe(e,n,r);break;case`!=`:i=$e(e,n,r);break;case`>`:i=Xe(e,n,r);break;case`>=`:i=et(e,n,r);break;case`<`:i=Ze(e,n,r);break;case`<=`:i=tt(e,n,r);break;default:throw TypeError(`Invalid operator: `+t)}return i}t.Comparator=rt;function rt(e,t){if(e instanceof rt){if(e.loose===t)return e;e=e.value}if(!(this instanceof rt))return new rt(e,t);n(`comparator`,e,t),this.loose=t,this.parse(e),this.semver===it?this.value=``:this.value=this.operator+this.semver.version,n(`comp`,this)}var it={};rt.prototype.parse=function(e){var t=this.loose?o[Te]:o[Ee],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: `+e);this.operator=n[1],this.operator===`=`&&(this.operator=``),n[2]?this.semver=new Ie(n[2],this.loose):this.semver=it},rt.prototype.toString=function(){return this.value},rt.prototype.test=function(e){return n(`Comparator.test`,e,this.loose),this.semver===it?!0:(typeof e==`string`&&(e=new Ie(e,this.loose)),nt(e,this.operator,this.semver,this.loose))},rt.prototype.intersects=function(e,t){if(!(e instanceof rt))throw TypeError(`a Comparator is required`);var n;if(this.operator===``)return n=new at(e.value,t),_(this.value,n,t);if(e.operator===``)return n=new at(this.value,t),_(e.semver,n,t);var r=(this.operator===`>=`||this.operator===`>`)&&(e.operator===`>=`||e.operator===`>`),i=(this.operator===`<=`||this.operator===`<`)&&(e.operator===`<=`||e.operator===`<`),a=this.semver.version===e.semver.version,o=(this.operator===`>=`||this.operator===`<=`)&&(e.operator===`>=`||e.operator===`<=`),s=nt(this.semver,`<`,e.semver,t)&&(this.operator===`>=`||this.operator===`>`)&&(e.operator===`<=`||e.operator===`<`),c=nt(this.semver,`>`,e.semver,t)&&(this.operator===`<=`||this.operator===`<`)&&(e.operator===`>=`||e.operator===`>`);return r||i||a&&o||s||c},t.Range=at;function at(e,t){if(e instanceof at)return e.loose===t?e:new at(e.raw,t);if(e instanceof rt)return new at(e.value,t);if(!(this instanceof at))return new at(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw TypeError(`Invalid SemVer Range: `+e);this.format()}at.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(` `).trim()}).join(`||`).trim(),this.range},at.prototype.toString=function(){return this.range},at.prototype.parseRange=function(e){var t=this.loose;e=e.trim(),n(`range`,e,t);var r=t?o[Ae]:o[ke];e=e.replace(r,gt),n(`hyphen replace`,e),e=e.replace(o[De],Oe),n(`comparator trim`,e,o[De]),e=e.replace(o[ge],_e),e=e.replace(o[xe],Se),e=e.split(/\s+/).join(` `);var i=t?o[Te]:o[Ee],a=e.split(` `).map(function(e){return st(e,t)}).join(` `).split(/\s+/);return this.loose&&(a=a.filter(function(e){return!!e.match(i)})),a=a.map(function(e){return new rt(e,t)}),a},at.prototype.intersects=function(e,t){if(!(e instanceof at))throw TypeError(`a Range is required`);return this.set.some(function(n){return n.every(function(n){return e.set.some(function(e){return e.every(function(e){return n.intersects(e,t)})})})})},t.toComparators=ot;function ot(e,t){return new at(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(` `).trim().split(` `)})}function st(e,t){return n(`comp`,e),e=dt(e,t),n(`caret`,e),e=lt(e,t),n(`tildes`,e),e=pt(e,t),n(`xrange`,e),e=ht(e,t),n(`stars`,e),e}function ct(e){return!e||e.toLowerCase()===`x`||e===`*`}function lt(e,t){return e.trim().split(/\s+/).map(function(e){return ut(e,t)}).join(` `)}function ut(e,t){var r=t?o[ye]:o[ve];return e.replace(r,function(t,r,i,a,o){n(`tilde`,e,t,r,i,a,o);var s;return ct(r)?s=``:ct(i)?s=`>=`+r+`.0.0 <`+(+r+1)+`.0.0`:ct(a)?s=`>=`+r+`.`+i+`.0 <`+r+`.`+(+i+1)+`.0`:o?(n(`replaceTilde pr`,o),o.charAt(0)!==`-`&&(o=`-`+o),s=`>=`+r+`.`+i+`.`+a+o+` <`+r+`.`+(+i+1)+`.0`):s=`>=`+r+`.`+i+`.`+a+` <`+r+`.`+(+i+1)+`.0`,n(`tilde return`,s),s})}function dt(e,t){return e.trim().split(/\s+/).map(function(e){return ft(e,t)}).join(` `)}function ft(e,t){n(`caret`,e,t);var r=t?o[we]:o[Ce];return e.replace(r,function(t,r,i,a,o){n(`caret`,e,t,r,i,a,o);var s;return ct(r)?s=``:ct(i)?s=`>=`+r+`.0.0 <`+(+r+1)+`.0.0`:ct(a)?s=r===`0`?`>=`+r+`.`+i+`.0 <`+r+`.`+(+i+1)+`.0`:`>=`+r+`.`+i+`.0 <`+(+r+1)+`.0.0`:o?(n(`replaceCaret pr`,o),o.charAt(0)!==`-`&&(o=`-`+o),s=r===`0`?i===`0`?`>=`+r+`.`+i+`.`+a+o+` <`+r+`.`+i+`.`+(+a+1):`>=`+r+`.`+i+`.`+a+o+` <`+r+`.`+(+i+1)+`.0`:`>=`+r+`.`+i+`.`+a+o+` <`+(+r+1)+`.0.0`):(n(`no pr`),s=r===`0`?i===`0`?`>=`+r+`.`+i+`.`+a+` <`+r+`.`+i+`.`+(+a+1):`>=`+r+`.`+i+`.`+a+` <`+r+`.`+(+i+1)+`.0`:`>=`+r+`.`+i+`.`+a+` <`+(+r+1)+`.0.0`),n(`caret return`,s),s})}function pt(e,t){return n(`replaceXRanges`,e,t),e.split(/\s+/).map(function(e){return mt(e,t)}).join(` `)}function mt(e,t){e=e.trim();var r=t?o[pe]:o[fe];return e.replace(r,function(t,r,i,a,o,s){n(`xRange`,e,t,r,i,a,o,s);var c=ct(i),l=c||ct(a),u=l||ct(o),d=u;return r===`=`&&d&&(r=``),c?t=r===`>`||r===`<`?`<0.0.0`:`*`:r&&d?(l&&(a=0),u&&(o=0),r===`>`?(r=`>=`,l?(i=+i+1,a=0,o=0):u&&(a=+a+1,o=0)):r===`<=`&&(r=`<`,l?i=+i+1:a=+a+1),t=r+i+`.`+a+`.`+o):l?t=`>=`+i+`.0.0 <`+(+i+1)+`.0.0`:u&&(t=`>=`+i+`.`+a+`.0 <`+i+`.`+(+a+1)+`.0`),n(`xRange return`,t),t})}function ht(e,t){return n(`replaceStars`,e,t),e.trim().replace(o[je],``)}function gt(e,t,n,r,i,a,o,s,c,l,u,d,f){return t=ct(n)?``:ct(r)?`>=`+n+`.0.0`:ct(i)?`>=`+n+`.`+r+`.0`:`>=`+t,s=ct(c)?``:ct(l)?`<`+(+c+1)+`.0.0`:ct(u)?`<`+c+`.`+(+l+1)+`.0`:d?`<=`+c+`.`+l+`.`+u+`-`+d:`<=`+s,(t+` `+s).trim()}at.prototype.test=function(e){if(!e)return!1;typeof e==`string`&&(e=new Ie(e,this.loose));for(var t=0;t<this.set.length;t++)if(_t(this.set[t],e))return!0;return!1};function _t(e,t){for(var r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length){for(var r=0;r<e.length;r++)if(n(e[r].semver),e[r].semver!==it&&e[r].semver.prerelease.length>0){var i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}t.satisfies=_;function _(e,t,n){try{t=new at(t,n)}catch{return!1}return t.test(e)}t.maxSatisfying=v;function v(e,t,n){var r=null,i=null;try{var a=new at(t,n)}catch{return null}return e.forEach(function(e){a.test(e)&&(!r||i.compare(e)===-1)&&(r=e,i=new Ie(r,n))}),r}t.minSatisfying=y;function y(e,t,n){var r=null,i=null;try{var a=new at(t,n)}catch{return null}return e.forEach(function(e){a.test(e)&&(!r||i.compare(e)===1)&&(r=e,i=new Ie(r,n))}),r}t.validRange=vt;function vt(e,t){try{return new at(e,t).range||`*`}catch{return null}}t.ltr=yt;function yt(e,t,n){return xt(e,t,`<`,n)}t.gtr=bt;function bt(e,t,n){return xt(e,t,`>`,n)}t.outside=xt;function xt(e,t,n,r){e=new Ie(e,r),t=new at(t,r);var i,a,o,s,c;switch(n){case`>`:i=Xe,a=tt,o=Ze,s=`>`,c=`>=`;break;case`<`:i=Ze,a=et,o=Xe,s=`<`,c=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(_(e,t,r))return!1;for(var l=0;l<t.set.length;++l){var u=t.set[l],d=null,f=null;if(u.forEach(function(e){e.semver===it&&(e=new rt(`>=0.0.0`)),d||=e,f||=e,i(e.semver,d.semver,r)?d=e:o(e.semver,f.semver,r)&&(f=e)}),d.operator===s||d.operator===c||(!f.operator||f.operator===s)&&a(e,f.semver)||f.operator===c&&o(e,f.semver))return!1}return!0}t.prerelease=St;function St(e,t){var n=Ne(e,t);return n&&n.prerelease.length?n.prerelease:null}t.intersects=Ct;function Ct(e,t,n){return e=new at(e,n),t=new at(t,n),e.intersects(t)}t.coerce=wt;function wt(e){if(e instanceof Ie)return e;if(typeof e!=`string`)return null;var t=e.match(o[me]);return t==null?null:Ne((t[1]||`0`)+`.`+(t[2]||`0`)+`.`+(t[3]||`0`))}})(nW,nW.exports),nW.exports)}iW();const aW=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,oW=/^-(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?$/;function sW(e){return e=e.trim(),e===`*`||aW.test(e)}function cW(e){if(!sW(e))return null;if(e=e.trim(),e===`*`)return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};let t=e.match(aW);return t?{hasCaret:t[1]===`^`,hasGreaterEquals:t[1]===`>=`,majorBase:t[2]===`x`?0:parseInt(t[2],10),majorMustEqual:t[2]!==`x`,minorBase:t[4]===`x`?0:parseInt(t[4],10),minorMustEqual:t[4]!==`x`,patchBase:t[6]===`x`?0:parseInt(t[6],10),patchMustEqual:t[6]!==`x`,preRelease:t[8]||null}:null}function lW(e){if(!e)return null;let t=e.majorBase,n=e.majorMustEqual,r=e.minorBase,i=e.minorMustEqual,a=e.patchBase,o=e.patchMustEqual;e.hasCaret&&(t===0||(i=!1),o=!1);let s=0;if(e.preRelease){let t=oW.exec(e.preRelease);if(t){let[,e,n,r,i,a]=t;s=Date.UTC(Number(e),Number(n)-1,Number(r),Number(i)||0,Number(a)||0)}}return{majorBase:t,majorMustEqual:n,minorBase:r,minorMustEqual:i,patchBase:a,patchMustEqual:o,isMinimum:e.hasGreaterEquals,notBefore:s}}var uW=class{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}};function dW(e,t){if(t.serializeBuffersForPostMessage){let t=new uW;return{message:JSON.stringify(e,(e,n)=>{if(n instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(n)};if(ArrayBuffer.isView(n)){let e=fW(n);if(e)return{$$vscode_array_buffer_reference$$:!0,index:t.add(n.buffer),view:{type:e,byteLength:n.byteLength,byteOffset:n.byteOffset}}}return n}),buffers:t.buffers.map(e=>{let t=new Uint8Array(e);return b.wrap(t)})}}else return{message:JSON.stringify(e),buffers:[]}}function fW(e){switch(e.constructor.name){case`Int8Array`:return Si.Int8Array;case`Uint8Array`:return Si.Uint8Array;case`Uint8ClampedArray`:return Si.Uint8ClampedArray;case`Int16Array`:return Si.Int16Array;case`Uint16Array`:return Si.Uint16Array;case`Int32Array`:return Si.Int32Array;case`Uint32Array`:return Si.Uint32Array;case`Float32Array`:return Si.Float32Array;case`Float64Array`:return Si.Float64Array;case`BigInt64Array`:return Si.BigInt64Array;case`BigUint64Array`:return Si.BigUint64Array}}function pW(e,t){let n=t.map(e=>{let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e.buffer),t}),r=t.length?(e,t)=>{if(t&&typeof t==`object`&&t.$$vscode_array_buffer_reference$$){let e=t,{index:r}=e,i=n[r];if(e.view)switch(e.view.type){case Si.Int8Array:return new Int8Array(i,e.view.byteOffset,e.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case Si.Uint8Array:return new Uint8Array(i,e.view.byteOffset,e.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case Si.Uint8ClampedArray:return new Uint8ClampedArray(i,e.view.byteOffset,e.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case Si.Int16Array:return new Int16Array(i,e.view.byteOffset,e.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case Si.Uint16Array:return new Uint16Array(i,e.view.byteOffset,e.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case Si.Int32Array:return new Int32Array(i,e.view.byteOffset,e.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case Si.Uint32Array:return new Uint32Array(i,e.view.byteOffset,e.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case Si.Float32Array:return new Float32Array(i,e.view.byteOffset,e.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case Si.Float64Array:return new Float64Array(i,e.view.byteOffset,e.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case Si.BigInt64Array:return new BigInt64Array(i,e.view.byteOffset,e.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case Si.BigUint64Array:return new BigUint64Array(i,e.view.byteOffset,e.view.byteLength/BigUint64Array.BYTES_PER_ELEMENT);default:throw Error(`Unknown array buffer view type`)}return i}return t}:void 0;return{message:JSON.parse(e,r),arrayBuffers:n}}var mW=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;constructor(e,t,n,r,i,a,o){this.#o=``,this.#c=!1,this.#l=!1,this._onMessageEmitter=new S,this.onDidReceiveMessage=this._onMessageEmitter.event,this.#f=new S,this._onDidDispose=this.#f.event,this.#e=e,this.#t=t,this.#s=n,this.#r=r,this.#i=i,this.#a=a,this.#u=hW(a),this.#d=gW(a),this.#n=o}#f;dispose(){this.#c=!0,this.#f.fire(),this.#f.dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return this.#l=!0,ZU(e,this.#r)}get cspSource(){let e=this.#a.extensionLocation;if(e.scheme===O.https||e.scheme===O.http){let t=e.toString();return t.endsWith(`/`)||(t+=`/`),t+` `+XU}return XU}get html(){return this.assertNotDisposed(),this.#o}set html(e){this.assertNotDisposed(),this.#o!==e&&(this.#o=e,this.#d&&!this.#l&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(this.#l=!0,this.#n.report(`Webview vscode-resource: uris`,this.#a,`Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri`)),this.#t.$setHtml(this.#e,this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),this.#s}set options(e){this.assertNotDisposed(),sc(this.#s,e)||this.#t.$setOptions(this.#e,yW(this.#a,this.#i,e)),this.#s=e}async postMessage(e){if(this.#c)return!1;let t=dW(e,{serializeBuffersForPostMessage:this.#u});return this.#t.$postMessage(this.#e,t.message,...t.buffers)}assertNotDisposed(){if(this.#c)throw Error(`Webview is disposed`)}rewriteOldResourceUrlsIfNeeded(e){if(!this.#d)return e;let t=this.#a.extensionLocation?.scheme===O.vscodeRemote,n=this.#a.extensionLocation.scheme===O.vscodeRemote?this.#a.extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(e,r,i,a,o,s)=>`${r}${ZU(w.from({scheme:a||`file`,path:decodeURIComponent(o)}),{isRemote:t,authority:n}).toString()}${s}`).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(e,r,i,a,o,s)=>`${r}${ZU(w.from({scheme:a||`file`,path:decodeURIComponent(o)}),{isRemote:t,authority:n}).toString()}${s}`)}};function hW(e){try{let t=lW(cW(e.engines.vscode));return!!t&&t.majorBase>=1&&t.minorBase>=57}catch{return!1}}function gW(e){try{let t=lW(cW(e.engines.vscode));return t?t.majorBase<1||t.majorBase===1&&t.minorBase<60:!1}catch{return!1}}var _W=class extends y{constructor(e,t,n,r,i){super(),this.remoteInfo=t,this.workspace=n,this._logService=r,this._deprecationService=i,this._webviews=new Map,this._webviewProxy=e.getProxy(E.MainThreadWebviews)}dispose(){super.dispose();for(let e of this._webviews.values())e.dispose();this._webviews.clear()}$onMessage(e,t,n){let r=this.getWebview(e);if(r){let{message:e}=pW(t,n.value);r._onMessageEmitter.fire(e)}}$onMissingCsp(e,t){this._logService.warn(`${t} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`)}createNewWebview(e,t,n){let r=new mW(e,this._webviewProxy,bW(t),this.remoteInfo,this.workspace,n,this._deprecationService);this._webviews.set(e,r);let i=r._onDidDispose(()=>{i.dispose(),this.deleteWebview(e)});return r}ensureDefaultContentOptions(e,t,n){t.localResourceRoots||this._webviewProxy.$setOptions(e,{...t,localResourceRoots:xW(n,this.workspace)})}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}};function vW(e){return{id:e.identifier,location:e.extensionLocation}}function yW(e,t,n){return{enableCommandUris:n.enableCommandUris,enableScripts:n.enableScripts,enableForms:n.enableForms,portMapping:n.portMapping,localResourceRoots:n.localResourceRoots||xW(e,t)}}function bW(e){return{enableCommandUris:e.enableCommandUris,enableScripts:e.enableScripts,enableForms:e.enableForms,portMapping:e.portMapping,localResourceRoots:e.localResourceRoots?.map(e=>w.from(e))}}function xW(e,t){return[...(t?.getWorkspaceFolders()||[]).map(e=>e.uri),e.extensionLocation]}var SW=class e{static{this.enableDebugLogging=!1}constructor(e){this.id=e,this._data=new Map,this._idPool=1}add(e){let t=this._idPool++;return this._data.set(t,e),this.logDebugInfo(),t}get(e,t){return this._data.has(e)?this._data.get(e)[t]:void 0}delete(e){this._data.delete(e),this.logDebugInfo()}logDebugInfo(){e.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}},CW=class{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new SW(`custom documents`)}addEdit(e){return this._edits.add([e])}async undo(e,t){await this.getEdit(e).undo(),t||this.disposeBackup()}async redo(e,t){await this.getEdit(e).redo(),t||this.disposeBackup()}disposeEdits(e){for(let t of e)this._edits.delete(t)}getNewBackupUri(){if(!this._storagePath)throw Error(`Backup requires a valid storage path`);let e=FW(this.document.uri)+ this._backupCounter++;return io(this._storagePath,e)}updateBackup(e){this._backup?.delete(),this._backup=e}disposeBackup(){this._backup?.delete(),this._backup=void 0}getEdit(e){let t=this._edits.get(e,0);if(!t)throw Error(`No edit found`);return t}},wW=class{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,n){let r=this.key(e,t.uri);if(this._documents.has(r))throw Error(`Document already exists for viewType:${e} resource:${t.uri}`);let i=new CW(t,n);return this._documents.set(r,i),i}delete(e,t){let n=this.key(e,t);this._documents.delete(n)}key(e,t){return`${e}@@@${t}`}},TW;(function(e){e[e.Text=0]=`Text`,e[e.Custom=1]=`Custom`})(TW||={});var EW=class{constructor(){this._providers=new Map}addTextProvider(e,t,n){return this.add(e,{type:TW.Text,extension:t,provider:n})}addCustomProvider(e,t,n){return this.add(e,{type:TW.Custom,extension:t,provider:n})}get(e){return this._providers.get(e)}add(e,t){if(this._providers.has(e))throw Error(`Provider for viewType:${e} already registered`);return this._providers.set(e,t),new WT(()=>this._providers.delete(e))}},DW=class{constructor(e,t,n,r,i){this._extHostDocuments=t,this._extensionStoragePaths=n,this._extHostWebview=r,this._extHostWebviewPanels=i,this._editorProviders=new EW,this._documents=new wW,this._proxy=e.getProxy(E.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,n,r){let i=new v;if(kW(n))i.add(this._editorProviders.addTextProvider(t,e,n)),this._proxy.$registerTextEditorProvider(vW(e),t,r.webviewOptions||{},{supportsMove:!!n.moveCustomTextEditor,supportsInlineDiff:Dw(e)&&AW(n),supportsSideBySideDiff:Dw(e)&&jW(n)},hW(e));else{i.add(this._editorProviders.addCustomProvider(t,e,n));let a=Dw(e);OW(n)&&i.add(n.onDidChangeCustomDocument(e=>{let n=this.getCustomDocumentEntry(t,e.document.uri);if(PW(e)){let r=n.addEdit(e);this._proxy.$onDidEdit(e.document.uri,t,r,e.label)}else this._proxy.$onContentChange(e.document.uri,t)})),this._proxy.$registerCustomEditorProvider(vW(e),t,r.webviewOptions||{},{supportsInlineDiff:a&&MW(n),supportsSideBySideDiff:a&&NW(n)},!!r.supportsMultipleEditorsPerDocument,hW(e))}return WT.from(i,new WT(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,n,r,i){let a=this._editorProviders.get(t);if(!a)throw Error(`No provider found for '${t}'`);if(a.type!==TW.Custom)throw Error(`Invalid provide type for '${t}'`);let o=w.revive(e),s=await a.provider.openCustomDocument(o,{backupId:n,untitledDocumentData:r?.buffer},i),c;return OW(a.provider)&&this._extensionStoragePaths&&(c=this._extensionStoragePaths.workspaceValue(a.extension)??this._extensionStoragePaths.globalValue(a.extension)),this._documents.add(t,s,c),{editable:OW(a.provider)}}async $disposeCustomDocument(e,t){let n=this._editorProviders.get(t);if(!n)throw Error(`No provider found for '${t}'`);if(n.type!==TW.Custom)throw Error(`Invalid provider type for '${t}'`);let r=w.revive(e),{document:i}=this.getCustomDocumentEntry(t,r);this._documents.delete(t,r),i.dispose()}async $resolveCustomEditor(e,t,n,r,i,a){let o=this._editorProviders.get(n);if(!o)throw Error(`No provider found for '${n}'`);let s=pj.to(i),c=this._extHostWebview.createNewWebview(t,r.contentOptions,o.extension);this._extHostWebview.ensureDefaultContentOptions(t,r.contentOptions,o.extension);let l=this._extHostWebviewPanels.createNewWebviewPanel(t,n,r.title,s,r.options,c,r.active),u=w.revive(e);switch(o.type){case TW.Custom:{let{document:e}=this.getCustomDocumentEntry(n,u);return o.provider.resolveCustomEditor(e,l,a)}case TW.Text:{let e=this._extHostDocuments.getDocument(u);return o.provider.resolveCustomTextEditor(e,l,a)}default:throw Error(`Unknown webview provider type`)}}async $resolveCustomEditorInlineDiff(e,t,n,r,i,a,o){let{entry:s,panel:c}=this.createCustomEditorDiffPanel(n,r,i,a),l=w.revive(e),u=w.revive(t);if(s.type===TW.Text){if(!AW(s.provider))throw Error(`Provider for '${r}' does not support inline custom text editor diffs`);let e=this._extHostDocuments.getDocument(l),t=this._extHostDocuments.getDocument(u);return s.provider.resolveCustomTextEditorInlineDiff({original:e,modified:t},c,o)}if(!MW(s.provider))throw Error(`Provider for '${r}' does not support inline custom editor diffs`);let{document:d}=this.getCustomDocumentEntry(r,l),{document:f}=this.getCustomDocumentEntry(r,u);return s.provider.resolveCustomEditorInlineDiff({original:d,modified:f},c,o)}async $resolveCustomEditorSideBySideDiff(e,t,n,r,i,a,o){let{entry:s,panel:c}=this.createCustomEditorDiffPanel(n.original,r,i.original,a),{panel:l}=this.createCustomEditorDiffPanel(n.modified,r,i.modified,a),u=w.revive(e),d=w.revive(t);if(s.type===TW.Text){if(!jW(s.provider))throw Error(`Provider for '${r}' does not support side by side custom text editor diffs`);let e=this._extHostDocuments.getDocument(u),t=this._extHostDocuments.getDocument(d);return s.provider.resolveCustomTextEditorSideBySideDiff({original:e,modified:t},{original:c,modified:l},o)}if(!NW(s.provider))throw Error(`Provider for '${r}' does not support side by side custom editor diffs`);let{document:f}=this.getCustomDocumentEntry(r,u),{document:p}=this.getCustomDocumentEntry(r,d);return s.provider.resolveCustomEditorSideBySideDiff({original:f,modified:p},{original:c,modified:l},o)}createCustomEditorDiffPanel(e,t,n,r){let i=this._editorProviders.get(t);if(!i)throw Error(`No provider found for '${t}'`);let a=pj.to(r),o=this._extHostWebview.createNewWebview(e,n.contentOptions,i.extension);return this._extHostWebview.ensureDefaultContentOptions(e,n.contentOptions,i.extension),{entry:i,panel:this._extHostWebviewPanels.createNewWebviewPanel(e,t,n.title,a,n.options,o,n.active)}}$disposeEdits(e,t,n){this.getCustomDocumentEntry(t,e).disposeEdits(n)}async $onMoveCustomEditor(e,t,n){let r=this._editorProviders.get(n);if(!r)throw Error(`No provider found for '${n}'`);if(!r.provider.moveCustomTextEditor)throw Error(`Provider does not implement move '${n}'`);let i=this._extHostWebviewPanels.getWebviewPanel(e);if(!i)throw Error(`No webview found`);let a=w.revive(t),o=this._extHostDocuments.getDocument(a);await r.provider.moveCustomTextEditor(o,i,Pi.None)}async $undo(e,t,n,r){return this.getCustomDocumentEntry(t,e).undo(n,r)}async $redo(e,t,n,r){return this.getCustomDocumentEntry(t,e).redo(n,r)}async $revert(e,t,n){let r=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(r.document,n),r.disposeBackup()}async $onSave(e,t,n){let r=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(r.document,n),r.disposeBackup()}async $onSaveAs(e,t,n,r){let i=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(i.document,w.revive(n),r)}async $backup(e,t,n){let r=this.getCustomDocumentEntry(t,e),i=await this.getCustomEditorProvider(t).backupCustomDocument(r.document,{destination:r.getNewBackupUri()},n);return r.updateBackup(i),i.id}getCustomDocumentEntry(e,t){let n=this._documents.get(e,w.revive(t));if(!n)throw Error(`No custom document found`);return n}getCustomEditorProvider(e){let t=this._editorProviders.get(e)?.provider;if(!t||!OW(t))throw Error(`Custom document is not editable`);return t}};function OW(e){return!!e.onDidChangeCustomDocument}function kW(e){return typeof e.resolveCustomTextEditor==`function`}function AW(e){return typeof e.resolveCustomTextEditorInlineDiff==`function`}function jW(e){return typeof e.resolveCustomTextEditorSideBySideDiff==`function`}function MW(e){return typeof e.resolveCustomEditorInlineDiff==`function`}function NW(e){return typeof e.resolveCustomEditorSideBySideDiff==`function`}function PW(e){return typeof e.undo==`function`&&typeof e.redo==`function`}function FW(e){return Th(e.scheme===O.file||e.scheme===O.untitled?e.fsPath:e.toString())+``}var IW,LW=class e{#e;#t;#n;constructor(e,t,n,r,i,a,o,s){this._name=e,this._owner=t,this._maxDiagnosticsTotal=n,this._maxDiagnosticsPerFile=r,this._modelVersionIdProvider=i,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(r,n),this.#n=new Ne(e=>a.getComparisonKey(e)),this.#e=o,this.#t=s}dispose(){this._isDisposed||=(this.#t.fire([...this.#n.keys()]),this.#e?.$clear(this._owner),this.#n.clear(),!0)}get name(){return this._checkDisposed(),this._name}set(t,n){if(!t){this.clear();return}this._checkDisposed();let r=[];if(w.isUri(t)){if(!n){this.delete(t);return}this.#n.set(t,pe(n)),r=[t]}else if(Array.isArray(t)){r=[];let n;t=[...t].sort(e._compareIndexedTuplesByUri);for(let e of t){let[t,i]=e;if((!n||t.toString()!==n.toString())&&(n&&this.#n.get(n).length===0&&this.#n.delete(n),n=t,r.push(t),this.#n.set(t,[])),i)this.#n.get(t)?.push(...pe(i));else{let e=this.#n.get(t);e&&(e.length=0)}}}if(this.#t.fire(r),!this.#e)return;let i=[],a=0;for(let e of r){let t=[],n=this.#n.get(e);if(n)if(n.length>this._maxDiagnosticsPerFile){t=[];let r=[sT.Error,sT.Warning,sT.Information,sT.Hint];orderLoop:for(let i=0;i<4;i++)for(let a of n)if(a.severity===r[i]&&t.push({...uj.from(a),modelVersionId:this._modelVersionIdProvider(e)})===this._maxDiagnosticsPerFile)break orderLoop;t.push({severity:vm.Info,message:x(2864,`Not showing {0} further errors and warnings.`,n.length-this._maxDiagnosticsPerFile),startLineNumber:t[t.length-1].startLineNumber,startColumn:t[t.length-1].startColumn,endLineNumber:t[t.length-1].endLineNumber,endColumn:t[t.length-1].endColumn})}else t=n.map(t=>({...uj.from(t),modelVersionId:this._modelVersionIdProvider(e)}));if(i.push([e,t]),a+=t.length,a>this._maxDiagnosticsTotal)break}this.#e.$changeMany(this._owner,i)}delete(e){this._checkDisposed(),this.#t.fire([e]),this.#n.delete(e),this.#e?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),this.#t.fire([...this.#n.keys()]),this.#n.clear(),this.#e?.$clear(this._owner)}forEach(e,t){this._checkDisposed();for(let[n,r]of this)e.call(t,n,r,this)}*[Symbol.iterator](){this._checkDisposed();for(let e of this.#n.keys())yield[e,this.get(e)]}get(e){this._checkDisposed();let t=this.#n.get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(this.#n.get(e))}_checkDisposed(){if(this._isDisposed)throw Error(`illegal state - object is disposed`)}static _compareIndexedTuplesByUri(e,t){return e[0].toString()<t[0].toString()?-1:+(e[0].toString()>t[0].toString())}};let RW=class{static{IW=this}static{this._idPool=0}static{this._maxDiagnosticsPerFile=1e3}static{this._maxDiagnosticsTotal=1.1*this._maxDiagnosticsPerFile}static _mapper(e){let t=new Ne;for(let n of e)t.set(n,n);return{uris:Object.freeze(Array.from(t.values()))}}constructor(e,t,n,r){this._logService=t,this._fileSystemInfoService=n,this._extHostDocumentsAndEditors=r,this._collections=new Map,this._onDidChangeDiagnostics=new ur({merge:e=>e.flat(),delay:50}),this.onDidChangeDiagnostics=Qn.map(this._onDidChangeDiagnostics.event,IW._mapper),this._proxy=e.getProxy(E.MainThreadDiagnostics)}createDiagnosticCollection(e,t){let{_collections:n,_proxy:r,_onDidChangeDiagnostics:i,_logService:a,_fileSystemInfoService:o,_extHostDocumentsAndEditors:s}=this,c=new class{$changeMany(t,n){r.$changeMany(t,n),a.trace(`[DiagnosticCollection] change many (extension, owner, uris)`,e.value,t,n.length===0?`CLEARING`:n)}$clear(t){r.$clear(t),a.trace(`[DiagnosticCollection] remove all (extension, owner)`,e.value,t)}dispose(){r.dispose()}},l;if(!t)t=`_generated_diagnostic_collection_name_#`+ IW._idPool++,l=t;else if(!n.has(t))l=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do l=t+ IW._idPool++;while(n.has(l))}return new class extends LW{constructor(){super(t,l,IW._maxDiagnosticsTotal,IW._maxDiagnosticsPerFile,e=>s.getDocument(e)?.version,o.extUri,c,i),n.set(l,this)}dispose(){super.dispose(),n.delete(l)}}}getDiagnostics(e){if(e)return this._getDiagnostics(e);{let e=new Map,t=[];for(let n of this._collections.values())n.forEach((n,r)=>{let i=e.get(n.toString());i===void 0&&(i=t.length,e.set(n.toString(),i),t.push([n,[]])),t[i][1]=t[i][1].concat(...r)});return t}}_getDiagnostics(e){let t=[];for(let n of this._collections.values())n.has(e)&&(t=t.concat(n.get(e)));return t}$acceptMarkersChange(e){if(!this._mirrorCollection){let e=`_generated_mirror`,t=new LW(e,e,2**53-1,2**53-1,e=>void 0,this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(e,t),this._mirrorCollection=t}for(let[t,n]of e)this._mirrorCollection.set(w.revive(t),n.map(uj.to))}};RW=IW=A([j(1,Ds),j(2,Rc)],RW);var zW=class{constructor(e){this._proxy=e.getProxy(E.MainThreadDialogs)}showOpenDialog(e){return this._proxy.$showOpenDialog(e).then(e=>e?e.map(e=>w.revive(e)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(e=>e?w.revive(e):void 0)}},BW=class e{static{this._handlePool=0}constructor(e,t,n){this._documentsAndEditors=t,this._logService=n,this._documentContentProviders=new Map,this._proxy=e.getProxy(E.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(t,n){if(Object.keys(O).indexOf(t)>=0)throw Error(`scheme '${t}' already registered`);let r=e._handlePool++;this._documentContentProviders.set(r,n),this._proxy.$registerTextContentProvider(r,t);let i;if(typeof n.onDidChange==`function`){let e;i=n.onDidChange(async n=>{if(n.scheme!==t){this._logService.warn(`Provider for scheme '${t}' is firing event for schema '${n.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(n))return;e&&await e;let i=this.$provideTextDocumentContent(r,n).then(async e=>{if(!e&&typeof e!=`string`)return;let t=this._documentsAndEditors.getDocument(n);if(!t)return;let r=$i(e);if(!t.equalLines(r))return this._proxy.$onVirtualDocumentChange(n,e)}).catch(o).finally(()=>{e===i&&(e=void 0)});e=i})}return new WT(()=>{this._documentContentProviders.delete(r)&&this._proxy.$unregisterTextContentProvider(r),i&&=(i.dispose(),void 0)})}$provideTextDocumentContent(e,t){let n=this._documentContentProviders.get(e);return n?Promise.resolve(n.provideTextDocumentContent(w.revive(t),Pi.None)):Promise.reject(Error(`unsupported uri-scheme: ${t.scheme}`))}},VW=class{constructor(e,t,n,r={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=n,this._thresholds=r,this._callbacks=new Xt,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,n,r)=>{let i={dispose:this._callbacks.push([t,n,e])};return Array.isArray(r)&&r.push(i),i}}async $participateInSave(e,t){let n=w.revive(e),r=!1,i=setTimeout(()=>r=!0,this._thresholds.timeout),a=[];try{for(let e of[...this._callbacks]){if(r)break;let i=this._documents.getDocument(n),o=await this._deliverEventAsyncAndBlameBadListeners(e,{document:i,reason:tM.to(t)});a.push(o)}}finally{clearTimeout(i)}return a}_deliverEventAsyncAndBlameBadListeners([e,t,n],r){let i=this._badListeners.get(e);return typeof i==`number`&&i>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(n,e,t,r).then(()=>!0,t=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${n.identifier.value}' threw ERROR`),this._logService.error(t),!(t instanceof Error)||t.message!==`concurrent_edits`){let t=this._badListeners.get(e);this._badListeners.set(e,t?t+1:1),typeof t==`number`&&t>this._thresholds.errors&&this._logService.info(`onWillSaveTextDocument-listener from extension '${n.identifier.value}' will now be IGNORED because of timeouts and/or errors`)}return!1})}_deliverEventAsync(e,t,n,r){let i=[],a=Date.now(),{document:o,reason:s}=r,{version:c}=o,l=Object.freeze({document:o,reason:s,waitUntil(e){if(Object.isFrozen(i))throw ee(`waitUntil can not be called async`);i.push(Promise.resolve(e))}});try{t.apply(n,[l])}catch(e){return Promise.reject(e)}return new Promise((t,n)=>{let r=setTimeout(()=>n(Error(`timeout`)),this._thresholds.timeout);return Promise.all(i).then(n=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-a}ms`),clearTimeout(r),t(n)}).catch(e=>{clearTimeout(r),n(e)})}).then(e=>{let t={edits:[]};for(let n of e)if(Array.isArray(n)&&n.every(e=>e instanceof jT))for(let{newText:e,newEol:r,range:i}of n)t.edits.push({resource:o.uri,versionId:void 0,textEdit:{range:i&&J.from(i),text:e,eol:r&&rM.from(r)}});if(t.edits.length!==0)return c===o.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new _i(t)):Promise.reject(Error(`concurrent_edits`))})}},HW=class{constructor(e,t){this._toDispose=new v,this._onDidAddDocument=this._toDispose.add(new S),this._onDidRemoveDocument=this._toDispose.add(new S),this._onDidChangeDocument=this._toDispose.add(new S),this._onDidChangeDocumentWithReason=this._toDispose.add(new S),this._onDidSaveDocument=this._toDispose.add(new S),this.onDidAddDocument=this._onDidAddDocument.event,this.onDidRemoveDocument=this._onDidRemoveDocument.event,this.onDidChangeDocument=this._onDidChangeDocument.event,this.onDidChangeDocumentWithReason=this._onDidChangeDocumentWithReason.event,this.onDidSaveDocument=this._onDidSaveDocument.event,this._documentLoader=new Map,this._proxy=e.getProxy(E.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(e=>{for(let t of e)this._onDidRemoveDocument.fire(t.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(e=>{for(let t of e)this._onDidAddDocument.fire(t.document)},void 0,this._toDispose)}dispose(){this._toDispose.dispose()}getAllDocumentData(){return[...this._documentsAndEditors.allDocuments()]}getDocumentData(e){if(!e)return;let t=this._documentsAndEditors.getDocument(e);if(t)return t}getDocument(e){let t=this.getDocumentData(e);if(!t?.document)throw Error(`Unable to retrieve document from URI '${e}'`);return t.document}ensureDocumentData(e,t){let n=this._documentsAndEditors.getDocument(e);if(n&&(!t?.encoding||n.document.encoding===t.encoding))return Promise.resolve(n);let r=this._documentLoader.get(e.toString());return r?t?.encoding&&(r=r.then(n=>n.document.encoding===t.encoding?n:this.ensureDocumentData(e,t))):(r=this._proxy.$tryOpenDocument(e,t).then(t=>{this._documentLoader.delete(e.toString());let n=w.revive(t);return nt(this._documentsAndEditors.getDocument(n))},t=>(this._documentLoader.delete(e.toString()),Promise.reject(t))),this._documentLoader.set(e.toString(),r)),r}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(e=>w.revive(e))}$acceptModelLanguageChanged(e,t){let n=w.revive(e),r=this._documentsAndEditors.getDocument(n);if(!r)throw Error(`unknown document`);this._onDidRemoveDocument.fire(r.document),r._acceptLanguageId(t),this._onDidAddDocument.fire(r.document)}$acceptModelSaved(e){let t=w.revive(e),n=this._documentsAndEditors.getDocument(t);if(!n)throw Error(`unknown document`);this.$acceptDirtyStateChanged(e,!1),this._onDidSaveDocument.fire(n.document)}$acceptDirtyStateChanged(e,t){let n=w.revive(e),r=this._documentsAndEditors.getDocument(n);if(!r)throw Error(`unknown document`);r._acceptIsDirty(t),this._onDidChangeDocument.fire({document:r.document,contentChanges:[],reason:void 0}),this._onDidChangeDocumentWithReason.fire({document:r.document,contentChanges:[],reason:void 0,detailedReason:void 0})}$acceptEncodingChanged(e,t){let n=w.revive(e),r=this._documentsAndEditors.getDocument(n);if(!r)throw Error(`unknown document`);r._acceptEncoding(t),this._onDidChangeDocument.fire({document:r.document,contentChanges:[],reason:void 0}),this._onDidChangeDocumentWithReason.fire({document:r.document,contentChanges:[],reason:void 0,detailedReason:void 0})}$acceptModelChanged(e,t,n){let r=w.revive(e),i=this._documentsAndEditors.getDocument(r);if(!i)throw Error(`unknown document`);i._acceptIsDirty(n),i.onEvents(t);let a;t.isUndoing?a=IE.Undo:t.isRedoing&&(a=IE.Redo),this._onDidChangeDocument.fire(nc({document:i.document,contentChanges:t.changes.map(e=>({range:J.to(e.range),rangeOffset:e.rangeOffset,rangeLength:e.rangeLength,text:e.text})),reason:a})),this._onDidChangeDocumentWithReason.fire(nc({document:i.document,contentChanges:t.changes.map(e=>({range:J.to(e.range),rangeOffset:e.rangeOffset,rangeLength:e.rangeLength,text:e.text})),reason:a,detailedReason:t.detailedReason?{source:t.detailedReason.source,metadata:t.detailedReason}:void 0}))}setWordDefinitionFor(e,t){Sz(e,t)}},UW=class{constructor(e){this._provider=new Map,this._onDidChange=new S,this.onDidChange=this._onDidChange.event,this._allKnownModels=new Set,this._handlePool=0,this._proxy=e.getProxy(E.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,n){if(this._allKnownModels.has(t))throw Error(`An embeddings provider for this model is already registered`);let r=this._handlePool++;return this._proxy.$registerEmbeddingProvider(r,t),this._provider.set(r,{id:t,provider:n}),_(()=>{this._allKnownModels.delete(t),this._proxy.$unregisterEmbeddingProvider(r),this._provider.delete(r)})}async computeEmbeddings(e,t,n){n??=Pi.None;let r=!1;typeof t==`string`&&(t=[t],r=!0);let i=await this._proxy.$computeEmbeddings(e,t,n);if(i.length!==t.length)throw Error();if(r){if(i.length!==1)throw Error();return i[0]}return i}async $provideEmbeddings(e,t,n){let r=this._provider.get(e);return r&&await r.provider.provideEmbeddings(t,n)||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}},WW=class{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(E.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,n){if(this._AiEmbeddingVectorProviders.size===0)throw Error(`No embedding vector providers registered`);let r=this._AiEmbeddingVectorProviders.get(e);if(!r)throw Error(`Embedding vector provider not found`);let i=await r.provideEmbeddingVector(t,n);if(!i)throw Error(`Embedding vector provider returned undefined`);return i}registerEmbeddingVectorProvider(e,t,n){let r=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(r,n),this._proxy.$registerAiEmbeddingVectorProvider(t,r),new WT(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(r),this._AiEmbeddingVectorProviders.delete(r)})}},GW;(function(e){e[e.Invalid=0]=`Invalid`,e[e.Start=1]=`Start`,e[e.H=2]=`H`,e[e.HT=3]=`HT`,e[e.HTT=4]=`HTT`,e[e.HTTP=5]=`HTTP`,e[e.F=6]=`F`,e[e.FI=7]=`FI`,e[e.FIL=8]=`FIL`,e[e.BeforeColon=9]=`BeforeColon`,e[e.AfterColon=10]=`AfterColon`,e[e.AlmostThere=11]=`AlmostThere`,e[e.End=12]=`End`,e[e.Accept=13]=`Accept`,e[e.LastKnownState=14]=`LastKnownState`})(GW||={});var KW=class{constructor(e,t,n){let r=new Uint8Array(e*t);for(let i=0,a=e*t;i<a;i++)r[i]=n;this._data=r,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,n){this._data[e*this.cols+t]=n}},qW=class{constructor(e){let t=0,n=GW.Invalid;for(let r=0,i=e.length;r<i;r++){let[i,a,o]=e[r];a>t&&(t=a),i>n&&(n=i),o>n&&(n=o)}t++,n++;let r=new KW(n,t,GW.Invalid);for(let t=0,n=e.length;t<n;t++){let[n,i,a]=e[t];r.set(n,i,a)}this._states=r,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?GW.Invalid:this._states.get(e,t)}};let JW=null;function YW(){return JW===null&&(JW=new qW([[GW.Start,C.h,GW.H],[GW.Start,C.H,GW.H],[GW.Start,C.f,GW.F],[GW.Start,C.F,GW.F],[GW.H,C.t,GW.HT],[GW.H,C.T,GW.HT],[GW.HT,C.t,GW.HTT],[GW.HT,C.T,GW.HTT],[GW.HTT,C.p,GW.HTTP],[GW.HTT,C.P,GW.HTTP],[GW.HTTP,C.s,GW.BeforeColon],[GW.HTTP,C.S,GW.BeforeColon],[GW.HTTP,C.Colon,GW.AfterColon],[GW.F,C.i,GW.FI],[GW.F,C.I,GW.FI],[GW.FI,C.l,GW.FIL],[GW.FI,C.L,GW.FIL],[GW.FIL,C.e,GW.BeforeColon],[GW.FIL,C.E,GW.BeforeColon],[GW.BeforeColon,C.Colon,GW.AfterColon],[GW.AfterColon,C.Slash,GW.AlmostThere],[GW.AlmostThere,C.Slash,GW.End]])),JW}var XW;(function(e){e[e.None=0]=`None`,e[e.ForceTermination=1]=`ForceTermination`,e[e.CannotEndIn=2]=`CannotEndIn`})(XW||={});let ZW=null;function QW(){if(ZW===null){ZW=new rR(XW.None);for(let e=0;e<36;e++)ZW.set(` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…|`.charCodeAt(e),XW.ForceTermination);for(let e=0;e<4;e++)ZW.set(`.,;:`.charCodeAt(e),XW.CannotEndIn)}return ZW}var $W=class e{static _createLink(e,t,n,r,i){let a=i-1;do{let n=t.charCodeAt(a);if(e.get(n)!==XW.CannotEndIn)break;a--}while(a>r);if(r>0){let e=t.charCodeAt(r-1),n=t.charCodeAt(a);(e===C.OpenParen&&n===C.CloseParen||e===C.OpenSquareBracket&&n===C.CloseSquareBracket||e===C.OpenCurlyBrace&&n===C.CloseCurlyBrace)&&a--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:a+2},url:t.substring(r,a+1)}}static computeLinks(t,n=YW()){let r=QW(),i=[];for(let a=1,o=t.getLineCount();a<=o;a++){let o=t.getLineContent(a),s=o.length,c=0,l=0,u=0,d=GW.Start,f=!1,p=!1,m=!1,h=!1;for(;c<s;){let t=!1,s=o.charCodeAt(c);if(d===GW.Accept){let n;switch(s){case C.OpenParen:f=!0,n=XW.None;break;case C.CloseParen:n=f?XW.None:XW.ForceTermination;break;case C.OpenSquareBracket:m=!0,p=!0,n=XW.None;break;case C.CloseSquareBracket:m=!1,n=p?XW.None:XW.ForceTermination;break;case C.OpenCurlyBrace:h=!0,n=XW.None;break;case C.CloseCurlyBrace:n=h?XW.None:XW.ForceTermination;break;case C.SingleQuote:case C.DoubleQuote:case C.BackTick:n=u===s?XW.ForceTermination:u===C.SingleQuote||u===C.DoubleQuote||u===C.BackTick?XW.None:XW.ForceTermination;break;case C.Asterisk:n=u===C.Asterisk?XW.ForceTermination:XW.None;break;case C.Space:n=m?XW.None:XW.ForceTermination;break;default:n=r.get(s)}n===XW.ForceTermination&&(i.push(e._createLink(r,o,a,l,c)),t=!0)}else if(d===GW.End){let e;s===C.OpenSquareBracket?(p=!0,e=XW.None):e=r.get(s),e===XW.ForceTermination?t=!0:d=GW.Accept}else d=n.nextState(d,s),d===GW.Invalid&&(t=!0);t&&(d=GW.Start,f=!1,p=!1,h=!1,l=c+1,u=s),c++}d===GW.Accept&&i.push(e._createLink(r,o,a,l,s))}return i}},eG=class{constructor(){this._schemes=[]}add(e){this._stateMachine=void 0,this._schemes.push(e)}delete(e){let t=this._schemes.indexOf(e);t>=0&&(this._schemes.splice(t,1),this._stateMachine=void 0)}_initStateMachine(){if(!this._stateMachine){let e=this._schemes.sort(),t=[],n,r,i=GW.LastKnownState,a=GW.LastKnownState;for(let o of e){let e=n?da(n,o):0;for(r=e===0?GW.Start:a;e<o.length;e++)e+1===o.length?(i=a,a=GW.BeforeColon):a+=1,t.push([r,o.toUpperCase().charCodeAt(e),a]),t.push([r,o.toLowerCase().charCodeAt(e),a]),r=a;n=o,a=i}t.push([GW.BeforeColon,C.Colon,GW.AfterColon]),t.push([GW.AfterColon,C.Slash,GW.End]),this._stateMachine=new qW(t)}}provideDocumentLinks(e){this._initStateMachine();let t=[],n=$W.computeLinks({getLineContent(t){return e.lineAt(t-1).text},getLineCount(){return e.lineCount}},this._stateMachine);for(let e of n){let n=Zj.to(e);n.target&&t.push(n)}return t}},tG=class e{constructor(e,t){this._extHostLanguageFeatures=t,this._linkProvider=new eG,this._fsProvider=new Map,this._registeredSchemes=new Set,this._watches=new Map,this._handlePool=0,this._proxy=e.getProxy(E.MainThreadFileSystem)}dispose(){this._linkProviderRegistration?.dispose()}registerFileSystemProvider(t,n,r,i={}){if(e._validateFileSystemProvider(r),this._registeredSchemes.has(n))throw Error(`a provider for the scheme '${n}' is already registered`);this._linkProviderRegistration||=this._extHostLanguageFeatures.registerDocumentLinkProvider(t,`*`,this._linkProvider);let a=this._handlePool++;this._linkProvider.add(n),this._registeredSchemes.add(n),this._fsProvider.set(a,r);let o=mc.FileReadWrite;i.isCaseSensitive&&(o+=mc.PathCaseSensitive),i.isReadonly&&(o+=mc.Readonly),typeof r.copy==`function`&&(o+=mc.FileFolderCopy),typeof r.open==`function`&&typeof r.close==`function`&&typeof r.read==`function`&&typeof r.write==`function`&&(K(t,`fsChunks`),o+=mc.FileOpenReadWriteClose);let s;i.isReadonly&&vl(i.isReadonly)&&i.isReadonly.value!==``&&(s={value:i.isReadonly.value,isTrusted:i.isReadonly.isTrusted,supportThemeIcons:i.isReadonly.supportThemeIcons,supportHtml:i.isReadonly.supportHtml,baseUri:i.isReadonly.baseUri,uris:i.isReadonly.uris}),this._proxy.$registerFileSystemProvider(a,n,o,s).catch(e=>{console.error(`FAILED to register filesystem provider of ${t.identifier.value}-extension for the scheme ${n}`),console.error(e)});let c=r.onDidChangeFile(e=>{let t=[];for(let r of e){let{uri:e,type:i}=r;if(e.scheme!==n)continue;let a;switch(i){case eO.Changed:a=xc.UPDATED;break;case eO.Created:a=xc.ADDED;break;case eO.Deleted:a=xc.DELETED;break;default:throw Error(`Unknown FileChangeType`)}t.push({resource:e,type:a})}this._proxy.$onFileSystemChange(a,t)});return _(()=>{c.dispose(),this._linkProvider.delete(n),this._registeredSchemes.delete(n),this._fsProvider.delete(a),this._proxy.$unregisterProvider(a)})}static _validateFileSystemProvider(e){if(!e)throw Error(`MISSING provider`);if(typeof e.watch!=`function`)throw Error(`Provider does NOT implement watch`);if(typeof e.stat!=`function`)throw Error(`Provider does NOT implement stat`);if(typeof e.readDirectory!=`function`)throw Error(`Provider does NOT implement readDirectory`);if(typeof e.createDirectory!=`function`)throw Error(`Provider does NOT implement createDirectory`);if(typeof e.readFile!=`function`)throw Error(`Provider does NOT implement readFile`);if(typeof e.writeFile!=`function`)throw Error(`Provider does NOT implement writeFile`);if(typeof e.delete!=`function`)throw Error(`Provider does NOT implement delete`);if(typeof e.rename!=`function`)throw Error(`Provider does NOT implement rename`)}static _asIStat(e){let{type:t,ctime:n,mtime:r,size:i,permissions:a}=e;return{type:t,ctime:n,mtime:r,size:i,permissions:a}}$stat(t,n){return Promise.resolve(this._getFsProvider(t).stat(w.revive(n))).then(t=>e._asIStat(t))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(w.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(w.revive(t))).then(e=>b.wrap(e))}$writeFile(e,t,n,r){return Promise.resolve(this._getFsProvider(e).writeFile(w.revive(t),n.buffer,r))}$delete(e,t,n){return Promise.resolve(this._getFsProvider(e).delete(w.revive(t),n))}$rename(e,t,n,r){return Promise.resolve(this._getFsProvider(e).rename(w.revive(t),w.revive(n),r))}$copy(e,t,n,r){let i=this._getFsProvider(e);if(!i.copy)throw Error(`FileSystemProvider does not implement "copy"`);return Promise.resolve(i.copy(w.revive(t),w.revive(n),r))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(w.revive(t)))}$watch(e,t,n,r){let i=this._getFsProvider(e).watch(w.revive(n),r);this._watches.set(t,i)}$unwatch(e,t){let n=this._watches.get(t);n&&(n.dispose(),this._watches.delete(t))}$open(e,t,n){let r=this._getFsProvider(e);if(!r.open)throw Error(`FileSystemProvider does not implement "open"`);return Promise.resolve(r.open(w.revive(t),n))}$close(e,t){let n=this._getFsProvider(e);if(!n.close)throw Error(`FileSystemProvider does not implement "close"`);return Promise.resolve(n.close(t))}$read(e,t,n,r){let i=this._getFsProvider(e);if(!i.read)throw Error(`FileSystemProvider does not implement "read"`);let a=b.alloc(r);return Promise.resolve(i.read(t,n,a.buffer,0,r)).then(e=>a.slice(0,e))}$write(e,t,n,r){let i=this._getFsProvider(e);if(!i.write)throw Error(`FileSystemProvider does not implement "write"`);return Promise.resolve(i.write(t,n,r.buffer,0,r.byteLength))}_getFsProvider(e){let t=this._fsProvider.get(e);if(!t){let e=Error();throw e.name=`ENOPRO`,e.message=`no provider`,e}return t}};(class e extends y{static{this.MAX_RESTARTS=5}constructor(e,t,n,r){super(),this.onFileChanges=e,this.onLogMessage=t,this.verboseLogging=n,this.options=r,this.watcherDisposables=this._register(new vt),this.requests=void 0,this.restartCounter=0}init(){let e=new v;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(e=>this.onFileChanges(e))),e.add(this.watcher.onDidLogMessage(e=>this.onLogMessage(e))),e.add(this.watcher.onDidError(e=>this.onError(e.error,e.request)))}onError(t,n){this.canRestart(t,n)?this.restartCounter<e.MAX_RESTARTS&&this.requests?(this.error(`restarting watcher after unexpected error: ${t}`),this.restart(this.requests)):this.error(`gave up attempting to restart watcher after unexpected error: ${t}`):this.error(t)}canRestart(e,t){return!(!this.options.restartOnError||t||e.indexOf(`No space left on device`)!==-1||e.indexOf(`EMFILE`)!==-1)}restart(e){this.restartCounter++,this.init(),this.watch(e)}async watch(e){this.requests=e,await this.watcher?.watch(e)}async setVerboseLogging(e){this.verboseLogging=e,await this.watcher?.setVerboseLogging(e)}error(e){this.onLogMessage({type:`error`,message:`[File Watcher (${this.options.type})] ${e}`})}trace(e){this.onLogMessage({type:`trace`,message:`[File Watcher (${this.options.type})] ${e}`})}dispose(){return this.watcher=void 0,super.dispose()}});function nG(e,t){return typeof t==`string`&&!t.startsWith(`**`)&&!Vr(t)?{base:e,pattern:t}:t}var rG=class{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,n,r,i,a,o,s){this.session=Math.random(),this._onDidCreate=new S,this._onDidChange=new S,this._onDidDelete=new S,this._config=0,s.ignoreCreateEvents&&(this._config+=1),s.ignoreChangeEvents&&(this._config+=2),s.ignoreDeleteEvents&&(this._config+=4);let c=typeof o==`string`?!((n.getCapabilities(O.file)??0)&mc.PathCaseSensitive):n.extUri.ignorePathCasing(w.revive(o.baseUri)),l=o;c&&(l=typeof o==`string`?o.toLowerCase():{base:o.base.toLowerCase(),pattern:o.pattern.toLowerCase()});let u=VS(l,{ignoreCase:!1}),d=typeof o==`string`,f=a(e=>{if(!(typeof e.session==`number`&&e.session!==this.session)){if(!s.ignoreCreateEvents)for(let{uri:t,lowerCaseFsPath:n}of e.created)u(c?n:t.fsPath)&&(!d||r.getWorkspaceFolder(t))&&this._onDidCreate.fire(t);if(!s.ignoreChangeEvents)for(let{uri:t,lowerCaseFsPath:n}of e.changed)u(c?n:t.fsPath)&&(!d||r.getWorkspaceFolder(t))&&this._onDidChange.fire(t);if(!s.ignoreDeleteEvents)for(let{uri:t,lowerCaseFsPath:n}of e.deleted)u(c?n:t.fsPath)&&(!d||r.getWorkspaceFolder(t))&&this._onDidDelete.fire(t)}});this._disposable=WT.from(this.ensureWatching(e,r,t,i,o,s,!1),this._onDidCreate,this._onDidChange,this._onDidDelete,f)}ensureWatching(e,t,n,r,i,a,o){let s=WT.from();if(typeof i==`string`||a.ignoreChangeEvents&&a.ignoreCreateEvents&&a.ignoreDeleteEvents)return s;let c=e.getProxy(E.MainThreadFileSystemEventService),l=!1;(i.pattern.includes(`**`)||i.pattern.includes(`/`))&&(l=!0);let u=[],d,f;if(o)(a.ignoreChangeEvents||a.ignoreCreateEvents||a.ignoreDeleteEvents)&&(f=pc.UPDATED|pc.ADDED|pc.DELETED,a.ignoreChangeEvents&&(f&=~pc.UPDATED),a.ignoreCreateEvents&&(f&=~pc.ADDED),a.ignoreDeleteEvents&&(f&=~pc.DELETED));else if(l&&u.length===0){let e=t.getWorkspaceFolder(w.revive(i.baseUri)),r=n.getConfiguration(`files`,e).get(`watcherExclude`);if(r)for(let e in r)e&&r[e]===!0&&u.push(e)}else if(!l){let e=t.getWorkspaceFolder(w.revive(i.baseUri));if(e){let t=n.getConfiguration(`files`,e).get(`watcherExclude`);if(t){for(let n in t)if(n&&t[n]===!0){let t=`${Xi(n,`/`)}/**`;d||=[],d.push(nG(e.uri.fsPath,t))}}if(!d||d.length===0)return s}}return c.$watch(r.identifier.value,this.session,i.baseUri,{recursive:l,excludes:u,includes:d,filter:f},!!o),WT.from({dispose:()=>c.$unwatch(this.session)})}dispose(){this._disposable.dispose()}get onDidCreate(){return this._onDidCreate.event}get onDidChange(){return this._onDidChange.event}get onDidDelete(){return this._onDidDelete.event}},iG=class e{get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}static _revive(e){let t=w.revive(e);return{uri:t,lowerCaseFsPath:t.fsPath.toLowerCase()}}constructor(t){this._events=t,this._created=new n(()=>this._events.created.map(e._revive)),this._changed=new n(()=>this._events.changed.map(e._revive)),this._deleted=new n(()=>this._events.deleted.map(e._revive)),this.session=this._events.session}},aG=class{constructor(e,t,n){this._mainContext=e,this._logService=t,this._extHostDocumentsAndEditors=n,this._onFileSystemEvent=new S,this._onDidRenameFile=new S,this._onDidCreateFile=new S,this._onDidDeleteFile=new S,this._onWillRenameFile=new cr,this._onWillCreateFile=new cr,this._onWillDeleteFile=new cr,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,n,r,i,a){return new rG(this._mainContext,t,n,e,r,this._onFileSystemEvent.event,cM.from(i),a)}$onFileEvent(e){this._onFileSystemEvent.fire(new iG(e))}$onDidRunFileOperation(e,t){switch(e){case bc.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(e=>({oldUri:w.revive(e.source),newUri:w.revive(e.target)}))}));break;case bc.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(e=>w.revive(e.target))}));break;case bc.CREATE:case bc.COPY:this._onDidCreateFile.fire(Object.freeze({files:t.map(e=>w.revive(e.target))}));break}}getOnWillRenameFileEvent(e){return this._createWillExecuteEvent(e,this._onWillRenameFile)}getOnWillCreateFileEvent(e){return this._createWillExecuteEvent(e,this._onWillCreateFile)}getOnWillDeleteFileEvent(e){return this._createWillExecuteEvent(e,this._onWillDeleteFile)}_createWillExecuteEvent(e,t){return(n,r,i)=>{let a=function(e){n.call(r,e)};return a.extension=e,t.event(a,void 0,i)}}async $onWillRunFileOperation(e,t,n,r){switch(e){case bc.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(e=>({oldUri:w.revive(e.source),newUri:w.revive(e.target)}))},n,r);case bc.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(e=>w.revive(e.target))},n,r);case bc.CREATE:case bc.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(e=>w.revive(e.target))},n,r)}}async _fireWillEvent(e,t,n,r){let i=new Set,a=[];if(await e.fireAsync(t,r,async(e,t)=>{let r=Date.now(),o=await Promise.resolve(e);o instanceof PT&&(a.push([t.extension,o]),i.add(t.extension.displayName??t.extension.identifier.value)),Date.now()-r>n&&this._logService.warn(`SLOW file-participant`,t.extension.identifier)}),r.isCancellationRequested||a.length===0)return;let o={edits:[]};for(let[,e]of a){let{edits:t}=Cj.from(e,{getTextDocumentVersion:e=>this._extHostDocumentsAndEditors.getDocument(e)?.version,getNotebookDocumentVersion:()=>void 0});o.edits=o.edits.concat(t)}return{edit:o,extensionNames:Array.from(i)}}},oG=class{constructor(e,t,n,r,i){this._extHostNotebooks=t,this._textDocumentsAndEditors=n,this._commands=r;let a=new VI(`interactive.open`,`_interactive.open`,`Open interactive window and return notebook editor and input URI`,[new X(`showOptions`,`Show Options`,e=>!0,e=>e),new X(`resource`,`Interactive resource Uri`,e=>!0,e=>e),new X(`controllerId`,`Notebook controller Id`,e=>!0,e=>e),new X(`title`,`Interactive editor title`,e=>!0,e=>e)],new BI(`Notebook and input URI`,e=>{if(i.debug(`[ExtHostInteractive] open iw with notebook editor id`,e.notebookEditorId),e.notebookEditorId!==void 0){let t=this._extHostNotebooks.getEditorById(e.notebookEditorId);return i.debug(`[ExtHostInteractive] notebook editor found`,t.id),{notebookUri:w.revive(e.notebookUri),inputUri:w.revive(e.inputUri),notebookEditor:t.apiEditor}}return i.debug(`[ExtHostInteractive] notebook editor not found, uris for the interactive document`,e.notebookUri,e.inputUri),{notebookUri:w.revive(e.notebookUri),inputUri:w.revive(e.inputUri)}}));this._commands.registerApiCommand(a)}$willAddInteractiveDocument(e,t,n,r){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[``],languageId:n,uri:e,isDirty:!1,versionId:1,encoding:`utf8`}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}},sG=class{constructor(e){this._handlePool=0,this._proxy=e.getProxy(E.MainThreadLabelService)}$registerResourceLabelFormatter(e){let t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),_(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}},cG;(function(e){e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`})(cG||={});var lG=class e extends bp{constructor(e,t,n,r){super(e,t,n,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=r}toString(){return`[`+this.selectionStartLineNumber+`,`+this.selectionStartColumn+` -> `+this.positionLineNumber+`,`+this.positionColumn+`]`}equalsSelection(t){return e.selectionsEqual(this,t)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?cG.LTR:cG.RTL}setEndPosition(t,n){return this.getDirection()===cG.LTR?new e(this.startLineNumber,this.startColumn,t,n):new e(t,n,this.startLineNumber,this.startColumn)}getPosition(){return new yp(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new yp(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(t,n){return this.getDirection()===cG.LTR?new e(t,n,this.endLineNumber,this.endColumn):new e(this.endLineNumber,this.endColumn,t,n)}static fromPositions(t,n=t){return new e(t.lineNumber,t.column,n.lineNumber,n.column)}static fromRange(t,n){return n===cG.LTR?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new e(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}static liftSelection(t){return new e(t.selectionStartLineNumber,t.selectionStartColumn,t.positionLineNumber,t.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!this.selectionsEqual(e[n],t[n]))return!1;return!0}static isISelection(e){return!!e&&typeof e.selectionStartLineNumber==`number`&&typeof e.selectionStartColumn==`number`&&typeof e.positionLineNumber==`number`&&typeof e.positionColumn==`number`}static createWithDirection(t,n,r,i,a){return a===cG.LTR?new e(t,n,r,i):new e(r,i,t,n)}},uG=class e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentSymbols(t,n){let r=this._documents.getDocument(t),i=await this._provider.provideDocumentSymbols(r,n);if(!he(i))return i[0]instanceof nE?i.map(Dj.from):e._asDocumentSymbolTree(i)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((e,t)=>{let n=e.location.range.start.compareTo(t.location.range.start);return n===0&&(n=t.location.range.end.compareTo(e.location.range.end)),n});let t=[],n=[];for(let r of e){let e={name:r.name||`!!MISSING: name!!`,kind:wj.from(r.kind),tags:r.tags?.map(Tj.from)||[],detail:``,containerName:r.containerName,range:J.from(r.location.range),selectionRange:J.from(r.location.range),children:[]};for(;;){if(n.length===0){n.push(e),t.push(e);break}let r=n[n.length-1];if(bp.containsRange(r.range,e.range)&&!bp.equalsRange(r.range,e.range)){r.children?.push(e),n.push(e);break}n.pop()}}return t}},dG=class{constructor(e,t,n,r,i,a){this._documents=e,this._commands=t,this._provider=n,this._extension=r,this._extTelemetry=i,this._logService=a,this._cache=new SW(`CodeLens`),this._disposables=new Map}async provideCodeLenses(e,t){let n=this._documents.getDocument(e),r=await this._provider.provideCodeLenses(n,t);if(!r||t.isCancellationRequested)return;let i=this._cache.add(r),a=new v;this._disposables.set(i,a);let o={cacheId:i,lenses:[]};for(let e=0;e<r.length;e++){if(!nT.isRange(r[e].range)){console.warn(`INVALID code lens, range is not defined`,this._extension.identifier.value);continue}o.lenses.push({cacheId:[i,e],range:J.from(r[e].range),command:this._commands.toInternal(r[e].command,a)})}return o}async resolveCodeLens(e,t){let n=e.cacheId&&this._cache.get(...e.cacheId);if(!n)return;let r;if(r=typeof this._provider.resolveCodeLens!=`function`||n.isResolved?n:await this._provider.resolveCodeLens(n,t),r||=n,t.isCancellationRequested)return;let i=e.cacheId&&this._disposables.get(e.cacheId[0]);if(i){if(!r.command){let e=Error(`INVALID code lens resolved, lacks command: `+this._extension.identifier.value);this._extTelemetry.onExtensionError(this._extension.identifier,e),this._logService.error(e);return}return e.command=this._commands.toInternal(r.command,i),e}}releaseCodeLenses(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}};function fG(e){return Array.isArray(e)?e.map(Mj.from):e?[Mj.from(e)]:[]}var pG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDefinition(e,t,n){let r=this._documents.getDocument(e),i=sj.to(t);return fG(await this._provider.provideDefinition(r,i,n))}},mG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDeclaration(e,t,n){let r=this._documents.getDocument(e),i=sj.to(t);return fG(await this._provider.provideDeclaration(r,i,n))}},hG=class{constructor(e,t){this._documents=e,this._provider=t}async provideImplementation(e,t,n){let r=this._documents.getDocument(e),i=sj.to(t);return fG(await this._provider.provideImplementation(r,i,n))}},gG=class{constructor(e,t){this._documents=e,this._provider=t}async provideTypeDefinition(e,t,n){let r=this._documents.getDocument(e),i=sj.to(t);return fG(await this._provider.provideTypeDefinition(r,i,n))}},_G=class e{static{this.HOVER_MAP_MAX_SIZE=10}constructor(e,t){this._documents=e,this._provider=t,this._hoverCounter=0,this._hoverMap=new Map}async provideHover(t,n,r,i){let a=this._documents.getDocument(t),o=sj.to(n),s;if(r&&r.verbosityRequest){let e=r.verbosityRequest.previousHover.id,t=this._hoverMap.get(e);if(!t)throw Error(`Hover with id ${e} not found`);let n={verbosityDelta:r.verbosityRequest.verbosityDelta,previousHover:t};s=await this._provider.provideHover(a,o,i,n)}else s=await this._provider.provideHover(a,o,i);if(!s||he(s.contents))return;s.range||=a.getWordRangeAtPosition(o),s.range||=new nT(o,o);let c=Nj.from(s),l=this._hoverCounter;if(this._hoverMap.size===e.HOVER_MAP_MAX_SIZE){let e=Math.min(...this._hoverMap.keys());this._hoverMap.delete(e)}return this._hoverMap.set(l,s),this._hoverCounter+=1,{...c,id:l}}releaseHover(e){this._hoverMap.delete(e)}},vG=class{constructor(e,t){this._documents=e,this._provider=t}async provideEvaluatableExpression(e,t,n){let r=this._documents.getDocument(e),i=sj.to(t),a=await this._provider.provideEvaluatableExpression(r,i,n);if(a)return Pj.from(a)}},yG=class{constructor(e,t){this._documents=e,this._provider=t}async provideInlineValues(e,t,n,r){let i=this._documents.getDocument(e),a=await this._provider.provideInlineValues(i,J.to(t),Ij.to(n),r);if(Array.isArray(a))return a.map(e=>Fj.from(e))}},bG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,n){let r=this._documents.getDocument(e),i=sj.to(t),a=await this._provider.provideDocumentHighlights(r,i,n);if(Array.isArray(a))return a.map(Lj.from)}},xG=class{constructor(e,t,n){this._documents=e,this._provider=t,this._logService=n}async provideMultiDocumentHighlights(e,t,n,r){let i=this._documents.getDocument(e),a=n.map(e=>{try{return this._documents.getDocument(e)}catch(t){this._logService.error(`Error: Unable to retrieve document from URI: `+e+`. Error message: `+t);return}}).filter(e=>e!==void 0),o=sj.to(t),s=await this._provider.provideMultiDocumentHighlights(i,o,a,r);if(Array.isArray(s))return s.map(Rj.from)}},SG=class{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,n){let r=this._documents.getDocument(e),i=sj.to(t),a=await this._provider.provideLinkedEditingRanges(r,i,n);if(a&&Array.isArray(a.ranges))return{ranges:pe(a.ranges.map(J.from)),wordPattern:a.wordPattern}}},CG=class{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,n,r){let i=this._documents.getDocument(e),a=sj.to(t),o=await this._provider.provideReferences(i,a,n,r);if(Array.isArray(o))return o.map(jj.from)}},wG=class e{static{this._maxCodeActionsPerFile=1e3}constructor(e,t,n,r,i,a,o){this._documents=e,this._commands=t,this._diagnostics=n,this._provider=r,this._logService=i,this._extension=a,this._apiDeprecation=o,this._cache=new SW(`CodeAction`),this._disposables=new Map}async provideCodeActions(t,n,r,i){let a=this._documents.getDocument(t),o=lG.isISelection(n)?ij.to(n):J.to(n),s=[];for(let n of this._diagnostics.getDiagnostics(t))if(o.intersection(n.range)&&s.push(n)>e._maxCodeActionsPerFile)break;let c={diagnostics:s,only:r.only?new aT(r.only):void 0,triggerKind:kM.to(r.trigger)},l=await this._provider.provideCodeActions(a,o,c,i);if(!ge(l)||i.isCancellationRequested)return;let u=this._cache.add(l),d=new v;this._disposables.set(u,d);let f=[];for(let t=0;t<l.length;t++){let n=l[t];if(n)if(e._isCommand(n)&&!(n instanceof iE))this._apiDeprecation.report(`CodeActionProvider.provideCodeActions - return commands`,this._extension,`Return 'CodeAction' instances instead.`),f.push({_isSynthetic:!0,title:n.title,command:this._commands.toInternal(n,d)});else{let e=n;c.only&&(e.kind?c.only.contains(e.kind)||this._logService.warn(`${this._extension.identifier.value} - Code actions of kind '${c.only.value}' requested but returned code action is of kind '${e.kind.value}'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.`):this._logService.warn(`${this._extension.identifier.value} - Code actions of kind '${c.only.value}' requested but returned code action does not have a 'kind'. Code action will be dropped. Please set 'CodeAction.kind'.`));let r=e.ranges??[];f.push({cacheId:[u,t],title:e.title,command:e.command&&this._commands.toInternal(e.command,d),diagnostics:e.diagnostics&&e.diagnostics.map(uj.from),edit:e.edit&&Cj.from(e.edit,void 0),kind:e.kind&&e.kind.value,isPreferred:e.isPreferred,isAI:Dw(this._extension)?e.isAI:!1,ranges:Dw(this._extension)?pe(r.map(J.from)):void 0,disabled:e.disabled?.reason})}}return{cacheId:u,actions:f}}async resolveCodeAction(t,n){let[r,i]=t,a=this._cache.get(r,i);if(!a||e._isCommand(a)||!this._provider.resolveCodeAction)return{};let o=await this._provider.resolveCodeAction(a,n)??a,s;o.edit&&(s=Cj.from(o.edit,void 0));let c;if(o.command){let e=this._disposables.get(r);e&&(c=this._commands.toInternal(o.command,e))}return{edit:s,command:c}}releaseCodeActions(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}static _isCommand(e){return typeof e.command==`string`&&typeof e.title==`string`}},TG=class{constructor(e,t,n,r,i){this._proxy=e,this._documents=t,this._provider=n,this._handle=r,this._extension=i,this._editsCache=new SW(`DocumentPasteEdit.edits`)}async prepareDocumentPaste(e,t,n,r){if(!this._provider.prepareDocumentPaste)return;this._cachedPrepare=void 0;let i=this._documents.getDocument(e),a=t.map(e=>J.to(e)),o=NM.toDataTransfer(n,()=>{throw new ne});if(await this._provider.prepareDocumentPaste(i,a,o,r),r.isCancellationRequested)return;let s=Array.from(o).filter(([,e])=>!(e instanceof bD)),c=new Map,l=await Promise.all(Array.from(s,async([e,t])=>{let n=zc();return c.set(n,t),[e,await MM.from(e,t,n)]}));return this._cachedPrepare=c,{items:l}}async providePasteEdits(e,t,n,r,i,a){if(!this._provider.provideDocumentPasteEdits)return[];let o=this._documents.getDocument(t),s=n.map(e=>J.to(e)),c=new CD(r.items.map(([t,n])=>{let r=this._cachedPrepare?.get(n.id);return r?[t,r]:[t,MM.to(t,n,async t=>(await this._proxy.$resolvePasteFileData(this._handle,e,t)).buffer)]})),l=await this._provider.provideDocumentPasteEdits(o,s,c,{only:i.only?new ED(i.only):void 0,triggerKind:i.triggerKind},a);if(!l||a.isCancellationRequested)return[];let u=this._editsCache.add(l);return l.map((e,t)=>({_cacheId:[u,t],title:e.title??x(2867,`Paste using '{0}' extension`,this._extension.displayName||this._extension.name),kind:e.kind,yieldTo:e.yieldTo?.map(e=>e.value),insertText:typeof e.insertText==`string`?e.insertText:{snippet:e.insertText.value},additionalEdit:e.additionalEdit?Cj.from(e.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){let[n,r]=e,i=this._editsCache.get(n,r);if(!i||!this._provider.resolveDocumentPasteEdit)return{};let a=await this._provider.resolveDocumentPasteEdit(i,t)??i;return{insertText:a.insertText,additionalEdit:a.additionalEdit?Cj.from(a.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._editsCache.delete(e)}},EG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,n){let r=this._documents.getDocument(e),i=await this._provider.provideDocumentFormattingEdits(r,t,n);if(Array.isArray(i))return i.map(Sj.from)}},DG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,n,r){let i=this._documents.getDocument(e),a=J.to(t),o=await this._provider.provideDocumentRangeFormattingEdits(i,a,n,r);if(Array.isArray(o))return o.map(Sj.from)}async provideDocumentRangesFormattingEdits(e,t,n,r){tt(typeof this._provider.provideDocumentRangesFormattingEdits==`function`,"INVALID invocation of `provideDocumentRangesFormattingEdits`");let i=this._documents.getDocument(e),a=t.map(J.to),o=await this._provider.provideDocumentRangesFormattingEdits(i,a,n,r);if(Array.isArray(o))return o.map(Sj.from)}},OG=class{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,n,r,i){let a=this._documents.getDocument(e),o=sj.to(t),s=await this._provider.provideOnTypeFormattingEdits(a,o,n,r,i);if(Array.isArray(s))return s.map(Sj.from)}},kG=class{constructor(e,t){this._provider=e,this._logService=t,this._cache=new SW(`WorkspaceSymbols`)}async provideWorkspaceSymbols(e,t){let n=await this._provider.provideWorkspaceSymbols(e,t);if(!ge(n))return{symbols:[]};let r=this._cache.add(n),i={cacheId:r,symbols:[]};for(let e=0;e<n.length;e++){let t=n[e];if(!t||!t.name){this._logService.warn(`INVALID SymbolInformation`,t);continue}i.symbols.push({...Ej.from(t),cacheId:[r,e]})}return i}async resolveWorkspaceSymbol(e,t){if(typeof this._provider.resolveWorkspaceSymbol!=`function`||!e.cacheId)return e;let n=this._cache.get(...e.cacheId);if(n){let r=await this._provider.resolveWorkspaceSymbol(n,t);return r&&oc(e,Ej.from(r),!0)}}releaseWorkspaceSymbols(e){this._cache.delete(e)}},AG=class e{static supportsResolving(e){return typeof e.prepareRename==`function`}constructor(e,t,n){this._documents=e,this._provider=t,this._logService=n}async provideRenameEdits(t,n,r,i){let a=this._documents.getDocument(t),o=sj.to(n);try{let e=await this._provider.provideRenameEdits(a,o,r,i);return e?Cj.from(e):void 0}catch(t){let n=e._asMessage(t);return n?{rejectReason:n,edits:void 0}:Promise.reject(t)}}async resolveRenameLocation(t,n,r){if(typeof this._provider.prepareRename!=`function`)return Promise.resolve(void 0);let i=this._documents.getDocument(t),a=sj.to(n);try{let e=await this._provider.prepareRename(i,a,r),t,n;if(nT.isRange(e)?(t=e,n=i.getText(e)):Je(e)&&(t=e.range,n=e.placeholder),!t||!n)return;if(t.start.line>a.line||t.end.line<a.line){this._logService.warn(`INVALID rename location: position line must be within range start/end lines`);return}return{range:J.from(t),text:n}}catch(t){let n=e._asMessage(t);return n?{rejectReason:n,range:void 0,text:void 0}:Promise.reject(t)}}static _asMessage(e){if(typeof e==`string`)return e;if(e instanceof Error&&typeof e.message==`string`)return e.message}},jG=class e{static{this.languageTriggerKindToVSCodeTriggerKind={[qp.Invoke]:QD.Invoke,[qp.Automatic]:QD.Automatic}}constructor(e,t,n){this._documents=e,this._provider=t,this._logService=n}async supportsAutomaticNewSymbolNamesTriggerKind(){return this._provider.supportsAutomaticTriggerKind}async provideNewSymbolNames(t,n,r,i){let a=this._documents.getDocument(t),o=J.to(n);try{let t=e.languageTriggerKindToVSCodeTriggerKind[r],n=await this._provider.provideNewSymbolNames(a,o,t,i);return n?n.map(e=>typeof e==`string`?{newSymbolName:e}:{newSymbolName:e.newSymbolName,tags:e.tags}):void 0}catch(t){this._logService.error(e._asMessage(t)??JSON.stringify(t,null,` `));return}}static _asMessage(e){if(typeof e==`string`)return e;if(e instanceof Error&&typeof e.message==`string`)return e.message}},MG=class{constructor(e,t){this.resultId=e,this.tokens=t}},NG=class e{constructor(e,t){this._documents=e,this._provider=t,this._nextResultId=1,this._previousResults=new Map}async provideDocumentSemanticTokens(t,n,r){let i=this._documents.getDocument(t),a=n===0?null:this._previousResults.get(n),o=typeof a?.resultId==`string`&&typeof this._provider.provideDocumentSemanticTokensEdits==`function`?await this._provider.provideDocumentSemanticTokensEdits(i,a.resultId,r):await this._provider.provideDocumentSemanticTokens(i,r);return a&&this._previousResults.delete(n),o?(o=e._fixProvidedSemanticTokens(o),this._send(e._convertToEdits(a,o),o)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(t){return e._isSemanticTokens(t)?e._isCorrectSemanticTokens(t)?t:new pO(new Uint32Array(t.data),t.resultId):e._isSemanticTokensEdits(t)?e._isCorrectSemanticTokensEdits(t)?t:new hO(t.edits.map(e=>new mO(e.start,e.deleteCount,e.data?new Uint32Array(e.data):e.data)),t.resultId):t}static _isSemanticTokens(e){return e&&!!e.data}static _isCorrectSemanticTokens(e){return e.data instanceof Uint32Array}static _isSemanticTokensEdits(e){return e&&Array.isArray(e.edits)}static _isCorrectSemanticTokensEdits(e){for(let t of e.edits)if(!(t.data instanceof Uint32Array))return!1;return!0}static _convertToEdits(t,n){if(!e._isSemanticTokens(n)||!t||!t.tokens)return n;let r=t.tokens,i=r.length,a=n.data,o=a.length,s=0,c=Math.min(i,o);for(;s<c&&r[s]===a[s];)s++;if(s===i&&s===o)return new hO([],n.resultId);let l=0,u=c-s;for(;l<u&&r[i-l-1]===a[o-l-1];)l++;return new hO([{start:s,deleteCount:i-s-l,data:a.subarray(s,o-l)}],n.resultId)}_send(t,n){if(e._isSemanticTokens(t)){let e=this._nextResultId++;return this._previousResults.set(e,new MG(t.resultId,t.data)),aU({id:e,type:`full`,data:t.data})}if(e._isSemanticTokensEdits(t)){let r=this._nextResultId++;return e._isSemanticTokens(n)?this._previousResults.set(r,new MG(n.resultId,n.data)):this._previousResults.set(r,new MG(t.resultId)),aU({id:r,type:`delta`,deltas:(t.edits||[]).map(e=>({start:e.start,deleteCount:e.deleteCount,data:e.data}))})}return null}},PG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,n){let r=this._documents.getDocument(e),i=await this._provider.provideDocumentRangeSemanticTokens(r,J.to(t),n);return i?this._send(i):null}_send(e){return aU({id:0,type:`full`,data:e.data})}},FG=class e{static supportsResolving(e){return typeof e.resolveCompletionItem==`function`}constructor(e,t,n,r,i){this._documents=e,this._commands=t,this._provider=n,this._apiDeprecation=r,this._extension=i,this._cache=new SW(`CompletionItem`),this._disposables=new Map}async provideCompletionItems(t,n,r,i){let a=this._documents.getDocument(t),o=sj.to(n),s=a.getWordRangeAtPosition(o)||new nT(o,o),c=s.with({end:o}),l=new Yn,u=await this._provider.provideCompletionItems(a,o,i,Bj.to(r));if(!u||i.isCancellationRequested)return;let d=Array.isArray(u)?new SE(u):u,f=e.supportsResolving(this._provider)?this._cache.add(d.items):this._cache.add([]),p=new v;this._disposables.set(f,p);let m=[],h={x:f,[Di.completions]:m,[Di.defaultRanges]:{replace:J.from(s),insert:J.from(c)},[Di.isIncomplete]:d.isIncomplete||void 0,[Di.duration]:l.elapsed()};for(let e=0;e<d.items.length;e++){let t=d.items[e],n=this._convertCompletionItem(t,[f,e],c,s);m.push(n)}return h}async resolveCompletionItem(e,t){if(typeof this._provider.resolveCompletionItem!=`function`)return;let n=this._cache.get(...e);if(!n)return;let r=this._convertCompletionItem(n,e),i=await this._provider.resolveCompletionItem(n,t);if(!i)return;let a=this._convertCompletionItem(i,e);return(r[Ei.insertText]!==a[Ei.insertText]||r[Ei.insertTextRules]!==a[Ei.insertTextRules])&&this._apiDeprecation.report(`CompletionItem.insertText`,this._extension,`extension MAY NOT change 'insertText' of a CompletionItem during resolve`),(r[Ei.commandIdent]!==a[Ei.commandIdent]||r[Ei.commandId]!==a[Ei.commandId]||!sc(r[Ei.commandArguments],a[Ei.commandArguments]))&&this._apiDeprecation.report(`CompletionItem.command`,this._extension,`extension MAY NOT change 'command' of a CompletionItem during resolve`),{...r,[Ei.documentation]:a[Ei.documentation],[Ei.detail]:a[Ei.detail],[Ei.additionalTextEdits]:a[Ei.additionalTextEdits],[Ei.insertText]:a[Ei.insertText],[Ei.insertTextRules]:a[Ei.insertTextRules],[Ei.commandIdent]:a[Ei.commandIdent],[Ei.commandId]:a[Ei.commandId],[Ei.commandArguments]:a[Ei.commandArguments]}}releaseCompletionItems(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}_convertCompletionItem(e,t,n,r){let i=this._disposables.get(t[0]);if(!i)throw Error(`DisposableStore is missing...`);let a=this._commands.toInternal(e.command,i),o={x:t,[Ei.label]:e.label,[Ei.kind]:e.kind===void 0?void 0:Uj.from(e.kind),[Ei.kindModifier]:e.tags&&e.tags.map(Vj.from),[Ei.detail]:e.detail,[Ei.documentation]:e.documentation===void 0?void 0:Y.fromStrict(e.documentation),[Ei.sortText]:e.sortText===e.label?void 0:e.sortText,[Ei.filterText]:e.filterText===e.label?void 0:e.filterText,[Ei.preselect]:e.preselect||void 0,[Ei.insertTextRules]:e.keepWhitespace?jp.KeepWhitespace:jp.None,[Ei.commitCharacters]:e.commitCharacters?.join(``),[Ei.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(Sj.from),[Ei.commandIdent]:a?.$ident,[Ei.commandId]:a?.id,[Ei.commandArguments]:a?.$ident?void 0:a?.arguments};e.textEdit?(this._apiDeprecation.report(`CompletionItem.textEdit`,this._extension,`Use 'CompletionItem.insertText' and 'CompletionItem.range' instead.`),o[Ei.insertText]=e.textEdit.newText):typeof e.insertText==`string`?o[Ei.insertText]=e.insertText:e.insertText instanceof wT&&(o[Ei.insertText]=e.insertText.value,o[Ei.insertTextRules]|=jp.InsertAsSnippet);let s;return e.textEdit?s=e.textEdit.range:e.range&&(s=e.range),nT.isRange(s)?o[Ei.range]=J.from(s):s&&(!n?.isEqual(s.inserting)||!r?.isEqual(s.replacing))&&(o[Ei.range]={insert:J.from(s.inserting),replace:J.from(s.replacing)}),o}},IG=class{constructor(e,t,n,r){this._extension=e,this._documents=t,this._provider=n,this._commands=r,this._references=new LG,this.languageTriggerKindToVSCodeTriggerKind={[Pp.Automatic]:GD.Automatic,[Pp.Explicit]:GD.Invoke},this._isAdditionsProposedApiEnabled=Dw(this._extension)}get supportsHandleEvents(){return Dw(this._extension)&&(typeof this._provider.handleDidShowCompletionItem==`function`||typeof this._provider.handleDidPartiallyAcceptCompletionItem==`function`||typeof this._provider.handleDidRejectCompletionItem==`function`||typeof this._provider.handleEndOfLifetime==`function`)}get supportsSetModelId(){return Dw(this._extension)&&typeof this._provider.setCurrentModelId==`function`}get supportsSetProviderOption(){return Dw(this._extension)&&typeof this._provider.setProviderOptionValue==`function`}get modelInfo(){if(this._isAdditionsProposedApiEnabled)return this._provider.modelInfo?{models:this._provider.modelInfo.models,currentModelId:this._provider.modelInfo.currentModelId}:void 0}setCurrentModelId(e){this._isAdditionsProposedApiEnabled&&this._provider.setCurrentModelId?.(e)}get providerOptions(){if(this._isAdditionsProposedApiEnabled)return this._provider.providerOptions?.map(e=>({id:e.id,label:e.label,values:e.values.map(e=>({id:e.id,label:e.label})),currentValueId:e.currentValueId}))}setProviderOption(e,t){this._isAdditionsProposedApiEnabled&&this._provider.setProviderOptionValue?.(e,t)}async provideInlineCompletions(e,t,n,r){let i=this._documents.getDocument(e),a=sj.to(t),o=await this._provider.provideInlineCompletionItems(i,a,{selectedCompletionInfo:n.selectedSuggestionInfo?{range:J.to(n.selectedSuggestionInfo.range),text:n.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[n.triggerKind],requestUuid:n.requestUuid,requestIssuedDateTime:n.requestIssuedDateTime,earliestShownDateTime:n.earliestShownDateTime,changeHint:n.changeHint},r);if(!o)return;let{resultItems:s,list:c}=Array.isArray(o)?{resultItems:o,list:void 0}:{resultItems:o.items,list:o},l=this._isAdditionsProposedApiEnabled?Array.isArray(o)?[]:o.commands||[]:[],u=this._isAdditionsProposedApiEnabled&&!Array.isArray(o)?o.enableForwardStability:void 0,d;return{pid:this._references.createReferenceId({dispose(){d?.dispose()},items:s,list:c}),languageId:i.languageId,items:s.map((e,t)=>{let n;e.command&&(d||=new v,n=this._commands.toInternal(e.command,d));let r;e.action&&(d||=new v,r=this._commands.toInternal(e.action,d));let i=e.insertText;return{insertText:i===void 0?void 0:typeof i==`string`?i:{snippet:i.value},range:e.range?J.from(e.range):void 0,showRange:this._isAdditionsProposedApiEnabled&&e.showRange?J.from(e.showRange):void 0,command:n,gutterMenuLinkAction:r,idx:t,completeBracketPairs:this._isAdditionsProposedApiEnabled?e.completeBracketPairs:!1,isInlineEdit:this._isAdditionsProposedApiEnabled?e.isInlineEdit:!1,showInlineEditMenu:this._isAdditionsProposedApiEnabled?e.showInlineEditMenu:!1,hint:e.displayLocation&&this._isAdditionsProposedApiEnabled?{range:J.from(e.displayLocation.range),content:e.displayLocation.label,style:e.displayLocation.kind?kN.from(e.displayLocation.kind):Fp.Code}:void 0,warning:e.warning&&this._isAdditionsProposedApiEnabled?{message:Y.from(e.warning.message),icon:e.warning.icon?NN.fromThemeIcon(e.warning.icon):void 0}:void 0,correlationId:this._isAdditionsProposedApiEnabled?e.correlationId:void 0,suggestionId:void 0,uri:this._isAdditionsProposedApiEnabled&&e.uri?e.uri:void 0,supportsRename:this._isAdditionsProposedApiEnabled?e.supportsRename:!1,jumpToPosition:this._isAdditionsProposedApiEnabled&&e.jumpToPosition?sj.from(e.jumpToPosition):void 0}}),commands:l.map(e=>(d||=new v,Hj.from(e,this._commands,d))),suppressSuggestions:!1,enableForwardStability:u}}disposeCompletions(e,t){let n=this._references.get(e);if(this._provider.handleListEndOfLifetime&&this._isAdditionsProposedApiEnabled&&n?.list){function e(e){switch(e.kind){case`lostRace`:return{kind:KD.LostRace};case`tokenCancellation`:return{kind:KD.TokenCancellation};case`other`:return{kind:KD.Other};case`empty`:return{kind:KD.Empty};case`notTaken`:return{kind:KD.NotTaken};default:return{kind:KD.Other}}}this._provider.handleListEndOfLifetime(n.list,e(t))}this._references.disposeReferenceId(e)?.dispose()}handleDidShowCompletionItem(e,t,n){let r=this._references.get(e)?.items[t];r&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(r,n)}handlePartialAccept(e,t,n,r){let i=this._references.get(e)?.items[t];i&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(i,n),this._provider.handleDidPartiallyAcceptCompletionItem(i,EN.to(r)))}handleEndOfLifetime(e,t,n){let r=this._references.get(e)?.items[t];if(r&&this._provider.handleEndOfLifetime&&this._isAdditionsProposedApiEnabled){let e=ON.to(n,e=>this._references.get(e.pid)?.items[e.idx]);this._provider.handleEndOfLifetime(r,e)}}handleRejection(e,t){let n=this._references.get(e)?.items[t];n&&this._provider.handleDidRejectCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidRejectCompletionItem(n)}},LG=class{constructor(){this._references=new Map,this._idPool=1}createReferenceId(e){let t=this._idPool++;return this._references.set(t,e),t}disposeReferenceId(e){let t=this._references.get(e);return this._references.delete(e),t}get(e){return this._references.get(e)}},RG=class{constructor(e,t){this._documents=e,this._provider=t,this._cache=new SW(`SignatureHelp`)}async provideSignatureHelp(e,t,n,r){let i=this._documents.getDocument(e),a=sj.to(t),o=this.reviveContext(n),s=await this._provider.provideSignatureHelp(i,a,r,o);if(s){let e=this._cache.add([s]);return{...qj.from(s),id:e}}}reviveContext(e){let t;if(e.activeSignatureHelp){let n=qj.to(e.activeSignatureHelp),r=this._cache.get(e.activeSignatureHelp.id,0);r?(t=r,t.activeSignature=n.activeSignature,t.activeParameter=n.activeParameter):t=n}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}},zG=class{constructor(e,t,n,r,i){this._documents=e,this._commands=t,this._provider=n,this._logService=r,this._extension=i,this._cache=new SW(`InlayHints`),this._disposables=new Map}async provideInlayHints(e,t,n){let r=this._documents.getDocument(e),i=J.to(t),a=await this._provider.provideInlayHints(r,i,n);if(!Array.isArray(a)||a.length===0){this._logService.trace(`[InlayHints] NO inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`);return}if(n.isCancellationRequested)return;let o=this._cache.add(a);this._disposables.set(o,new v);let s={hints:[],cacheId:o};for(let e=0;e<a.length;e++)this._isValidInlayHint(a[e],i)&&s.hints.push(this._convertInlayHint(a[e],[o,e]));return this._logService.trace(`[InlayHints] ${s.hints.length} inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`),s}async resolveInlayHint(e,t){if(typeof this._provider.resolveInlayHint!=`function`)return;let n=this._cache.get(...e);if(!n)return;let r=await this._provider.resolveInlayHint(n,t);if(r&&this._isValidInlayHint(r))return this._convertInlayHint(r,e)}releaseHints(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}_isValidInlayHint(e,t){return e.label.length===0||Array.isArray(e.label)&&e.label.every(e=>e.value.length===0)?(console.log(`INVALID inlay hint, empty label`,e),!1):!(t&&!t.contains(e.position))}_convertInlayHint(e,t){let n=this._disposables.get(t[0]);if(!n)throw Error(`DisposableStore is missing...`);let r={label:``,cacheId:t,tooltip:Y.fromStrict(e.tooltip),position:sj.from(e.position),textEdits:e.textEdits&&e.textEdits.map(Sj.from),kind:e.kind&&Xj.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label==`string`)r.label=e.label;else{let t=[];r.label=t;for(let r of e.label){if(!r.value){console.warn(`INVALID inlay hint, empty label part`,this._extension.identifier.value);continue}let e={label:r.value,tooltip:Y.fromStrict(r.tooltip)};dT.isLocation(r.location)&&(e.location=jj.from(r.location)),r.command&&(e.command=this._commands.toInternal(r.command,n)),t.push(e)}}return r}},BG=class e{constructor(e,t){this._documents=e,this._provider=t,this._cache=new SW(`DocumentLink`)}async provideLinks(t,n){let r=this._documents.getDocument(t),i=await this._provider.provideDocumentLinks(r,n);if(!(!Array.isArray(i)||i.length===0)&&!n.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!=`function`)return{links:i.filter(e._validateLink).map(Zj.from)};{let t=this._cache.add(i),n={links:[],cacheId:t};for(let r=0;r<i.length;r++){if(!e._validateLink(i[r]))continue;let a=Zj.from(i[r]);a.cacheId=[t,r],n.links.push(a)}return n}}}static _validateLink(e){return e.target&&e.target.path.length>5e4?(console.warn(`DROPPING link because it is too long`),!1):!0}async resolveLink(t,n){if(typeof this._provider.resolveDocumentLink!=`function`)return;let r=this._cache.get(...t);if(!r)return;let i=await this._provider.resolveDocumentLink(r,n);if(!(!i||!e._validateLink(i)))return Zj.from(i)}releaseLinks(e){this._cache.delete(e)}},VG=class{constructor(e,t){this._documents=e,this._provider=t}async provideColors(e,t){let n=this._documents.getDocument(e),r=await this._provider.provideDocumentColors(n,t);return Array.isArray(r)?r.map(e=>({color:$j.from(e.color),range:J.from(e.range)})):[]}async provideColorPresentations(e,t,n){let r=this._documents.getDocument(e),i=J.to(t.range),a=$j.to(t.color),o=await this._provider.provideColorPresentations(a,{document:r,range:i},n);if(Array.isArray(o))return o.map(Qj.from)}},HG=class{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,n){let r=this._documents.getDocument(e),i=await this._provider.provideFoldingRanges(r,t,n);if(Array.isArray(i))return i.map(aM.from)}},UG=class{constructor(e,t,n){this._documents=e,this._provider=t,this._logService=n}async provideSelectionRanges(e,t,n){let r=this._documents.getDocument(e),i=t.map(sj.to),a=await this._provider.provideSelectionRanges(r,i,n);if(!ge(a))return[];if(a.length!==i.length)return this._logService.warn(`BAD selection ranges, provider must return ranges for each position`),[];let o=[];for(let e=0;e<i.length;e++){let t=[];o.push(t);let n=i[e],r=a[e];for(;;){if(!r.range.contains(n))throw Error(`INVALID selection range, must contain the previous range`);if(t.push(eM.from(r)),!r.parent)break;n=r.range,r=r.parent}}return o}},WG=class{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new Ez(``),this._cache=new Map}async prepareSession(e,t,n){let r=this._documents.getDocument(e),i=sj.to(t),a=await this._provider.prepareCallHierarchy(r,i,n);if(!a)return;let o=this._idPool.nextId();return this._cache.set(o,new Map),Array.isArray(a)?a.map(e=>this._cacheAndConvertItem(o,e)):[this._cacheAndConvertItem(o,a)]}async provideCallsTo(e,t,n){let r=this._itemFromCache(e,t);if(!r)throw Error(`missing call hierarchy item`);let i=await this._provider.provideCallHierarchyIncomingCalls(r,n);if(i)return i.map(t=>({from:this._cacheAndConvertItem(e,t.from),fromRanges:t.fromRanges.map(e=>J.from(e))}))}async provideCallsFrom(e,t,n){let r=this._itemFromCache(e,t);if(!r)throw Error(`missing call hierarchy item`);let i=await this._provider.provideCallHierarchyOutgoingCalls(r,n);if(i)return i.map(t=>({to:this._cacheAndConvertItem(e,t.to),fromRanges:t.fromRanges.map(e=>J.from(e))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){let n=this._cache.get(e),r=Oj.from(t,e,n.size.toString(36));return n.set(r._itemId,t),r}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}},GG=class{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new Ez(``),this._cache=new Map}async prepareSession(e,t,n){let r=this._documents.getDocument(e),i=sj.to(t),a=await this._provider.prepareTypeHierarchy(r,i,n);if(!a)return;let o=this._idPool.nextId();return this._cache.set(o,new Map),Array.isArray(a)?a.map(e=>this._cacheAndConvertItem(o,e)):[this._cacheAndConvertItem(o,a)]}async provideSupertypes(e,t,n){let r=this._itemFromCache(e,t);if(!r)throw Error(`missing type hierarchy item`);let i=await this._provider.provideTypeHierarchySupertypes(r,n);if(i)return i.map(t=>this._cacheAndConvertItem(e,t))}async provideSubtypes(e,t,n){let r=this._itemFromCache(e,t);if(!r)throw Error(`missing type hierarchy item`);let i=await this._provider.provideTypeHierarchySubtypes(r,n);if(i)return i.map(t=>this._cacheAndConvertItem(e,t))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){let n=this._cache.get(e),r=AM.from(t,e,n.size.toString(36));return n.set(r._itemId,t),r}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}},KG=class{constructor(e,t,n,r,i){this._proxy=e,this._documents=t,this._provider=n,this._handle=r,this._extension=i,this._cache=new SW(`DocumentDropEdit`)}async provideDocumentOnDropEdits(e,t,n,r,i){let a=this._documents.getDocument(t),o=sj.to(n),s=NM.toDataTransfer(r,async t=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,t)).buffer),c=await this._provider.provideDocumentDropEdits(a,o,s,i);if(!c)return;let l=be(c),u=this._cache.add(l);return l.map((e,t)=>({_cacheId:[u,t],title:e.title??x(2868,`Drop using '{0}' extension`,this._extension.displayName||this._extension.name),kind:e.kind?.value,yieldTo:e.yieldTo?.map(e=>e.value),insertText:typeof e.insertText==`string`?e.insertText:{snippet:e.insertText.value},additionalEdit:e.additionalEdit?Cj.from(e.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){let[n,r]=e,i=this._cache.get(n,r);if(!i||!this._provider.resolveDocumentDropEdit)return{};let a=await this._provider.resolveDocumentDropEdit(i,t)??i;return{additionalEdit:a.additionalEdit?Cj.from(a.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}},qG=class{constructor(e,t){this.adapter=e,this.extension=t}},JG=class e extends y{static{this._handlePool=0}get inlineCompletionsUnificationState(){return this._inlineCompletionsUnificationState}constructor(e,t,n,r,i,a,o,s){super(),this._uriTransformer=t,this._documents=n,this._commands=r,this._diagnostics=i,this._logService=a,this._apiDeprecation=o,this._extensionTelemetry=s,this._adapter=new Map,this._onDidChangeInlineCompletionsUnificationState=this._register(new S),this.onDidChangeInlineCompletionsUnificationState=this._onDidChangeInlineCompletionsUnificationState.event,this._proxy=e.getProxy(E.MainThreadLanguageFeatures),this._inlineCompletionsUnificationState={codeUnification:!1,modelUnification:!1,extensionUnification:!1,expAssignments:[]}}_transformDocumentSelector(e,t){return cj.from(e,this._uriTransformer,t)}_createDisposable(e){return new WT(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return e._handlePool++}async _withAdapter(e,t,n,r,i,a=!1){let o=this._adapter.get(e);if(!o||!(o.adapter instanceof t))return r;let s=Date.now();a||this._logService.trace(`[${o.extension.identifier.value}] INVOKE provider '${n.toString().replace(/[\r\n]/g,``)}'`);let c=n(o.adapter,o.extension);return Promise.resolve(c).catch(e=>{d(e)||(this._logService.error(`[${o.extension.identifier.value}] provider FAILED`),this._logService.error(e),this._extensionTelemetry.onExtensionError(o.extension.identifier,e))}).finally(()=>{a||this._logService.trace(`[${o.extension.identifier.value}] provider DONE after ${Date.now()-s}ms`)}),Pi.isCancellationToken(i)?ho(c,i):c}_addNewAdapter(e,t){let n=this._nextHandle();return this._adapter.set(n,new qG(e,t)),n}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(t,n,r,i){let a=this._addNewAdapter(new uG(this._documents,r),t),o=i&&i.label||e._extLabel(t);return this._proxy.$registerDocumentSymbolProvider(a,this._transformDocumentSelector(n,t),o),this._createDisposable(a)}$provideDocumentSymbols(e,t,n){return this._withAdapter(e,uG,e=>e.provideDocumentSymbols(w.revive(t),n),void 0,n)}registerCodeLensProvider(e,t,n){let r=this._nextHandle(),i=typeof n.onDidChangeCodeLenses==`function`?this._nextHandle():void 0;this._adapter.set(r,new qG(new dG(this._documents,this._commands.converter,n,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(r,this._transformDocumentSelector(t,e),i);let a=this._createDisposable(r);if(i!==void 0){let e=n.onDidChangeCodeLenses(e=>this._proxy.$emitCodeLensEvent(i));a=WT.from(a,e)}return a}$provideCodeLenses(e,t,n){return this._withAdapter(e,dG,e=>e.provideCodeLenses(w.revive(t),n),void 0,n,t.scheme===`output`)}$resolveCodeLens(e,t,n){return this._withAdapter(e,dG,e=>e.resolveCodeLens(t,n),void 0,void 0,!0)}$releaseCodeLenses(e,t){this._withAdapter(e,dG,e=>Promise.resolve(e.releaseCodeLenses(t)),void 0,void 0,!0)}registerDefinitionProvider(e,t,n){let r=this._addNewAdapter(new pG(this._documents,n),e);return this._proxy.$registerDefinitionSupport(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideDefinition(e,t,n,r){return this._withAdapter(e,pG,e=>e.provideDefinition(w.revive(t),n,r),[],r)}registerDeclarationProvider(e,t,n){let r=this._addNewAdapter(new mG(this._documents,n),e);return this._proxy.$registerDeclarationSupport(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideDeclaration(e,t,n,r){return this._withAdapter(e,mG,e=>e.provideDeclaration(w.revive(t),n,r),[],r)}registerImplementationProvider(e,t,n){let r=this._addNewAdapter(new hG(this._documents,n),e);return this._proxy.$registerImplementationSupport(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideImplementation(e,t,n,r){return this._withAdapter(e,hG,e=>e.provideImplementation(w.revive(t),n,r),[],r)}registerTypeDefinitionProvider(e,t,n){let r=this._addNewAdapter(new gG(this._documents,n),e);return this._proxy.$registerTypeDefinitionSupport(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideTypeDefinition(e,t,n,r){return this._withAdapter(e,gG,e=>e.provideTypeDefinition(w.revive(t),n,r),[],r)}registerHoverProvider(e,t,n,r){let i=this._addNewAdapter(new _G(this._documents,n),e);return this._proxy.$registerHoverProvider(i,this._transformDocumentSelector(t,e)),this._createDisposable(i)}$provideHover(e,t,n,r,i){return this._withAdapter(e,_G,e=>e.provideHover(w.revive(t),n,r,i),void 0,i)}$releaseHover(e,t){this._withAdapter(e,_G,e=>Promise.resolve(e.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,n,r){let i=this._addNewAdapter(new vG(this._documents,n),e);return this._proxy.$registerEvaluatableExpressionProvider(i,this._transformDocumentSelector(t,e)),this._createDisposable(i)}$provideEvaluatableExpression(e,t,n,r){return this._withAdapter(e,vG,e=>e.provideEvaluatableExpression(w.revive(t),n,r),void 0,r)}registerInlineValuesProvider(e,t,n,r){let i=typeof n.onDidChangeInlineValues==`function`?this._nextHandle():void 0,a=this._addNewAdapter(new yG(this._documents,n),e);this._proxy.$registerInlineValuesProvider(a,this._transformDocumentSelector(t,e),i);let o=this._createDisposable(a);if(i!==void 0){let e=n.onDidChangeInlineValues(e=>this._proxy.$emitInlineValuesEvent(i));o=WT.from(o,e)}return o}$provideInlineValues(e,t,n,r,i){return this._withAdapter(e,yG,e=>e.provideInlineValues(w.revive(t),n,r,i),void 0,i)}registerDocumentHighlightProvider(e,t,n){let r=this._addNewAdapter(new bG(this._documents,n),e);return this._proxy.$registerDocumentHighlightProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}registerMultiDocumentHighlightProvider(e,t,n){let r=this._addNewAdapter(new xG(this._documents,n,this._logService),e);return this._proxy.$registerMultiDocumentHighlightProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideDocumentHighlights(e,t,n,r){return this._withAdapter(e,bG,e=>e.provideDocumentHighlights(w.revive(t),n,r),void 0,r)}$provideMultiDocumentHighlights(e,t,n,r,i){return this._withAdapter(e,xG,e=>e.provideMultiDocumentHighlights(w.revive(t),n,r.map(e=>w.revive(e)),i),void 0,i)}registerLinkedEditingRangeProvider(e,t,n){let r=this._addNewAdapter(new SG(this._documents,n),e);return this._proxy.$registerLinkedEditingRangeProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideLinkedEditingRanges(t,n,r,i){return this._withAdapter(t,SG,async t=>{let a=await t.provideLinkedEditingRanges(w.revive(n),r,i);if(a)return{ranges:a.ranges,wordPattern:a.wordPattern?e._serializeRegExp(a.wordPattern):void 0}},void 0,i)}registerReferenceProvider(e,t,n){let r=this._addNewAdapter(new CG(this._documents,n),e);return this._proxy.$registerReferenceSupport(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideReferences(e,t,n,r,i){return this._withAdapter(e,CG,e=>e.provideReferences(w.revive(t),n,r,i),void 0,i)}registerCodeActionProvider(t,n,r,i){let a=new v,o=this._addNewAdapter(new wG(this._documents,this._commands.converter,this._diagnostics,r,this._logService,t,this._apiDeprecation),t);return this._proxy.$registerCodeActionSupport(o,this._transformDocumentSelector(n,t),{providedKinds:i?.providedCodeActionKinds?.map(e=>e.value),documentation:i?.documentation?.map(e=>({kind:e.kind.value,command:this._commands.converter.toInternal(e.command,a)}))},e._extLabel(t),e._extId(t),!!r.resolveCodeAction),a.add(this._createDisposable(o)),a}$provideCodeActions(e,t,n,r,i){return this._withAdapter(e,wG,e=>e.provideCodeActions(w.revive(t),n,r,i),void 0,i)}$resolveCodeAction(e,t,n){return this._withAdapter(e,wG,e=>e.resolveCodeAction(t,n),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,wG,e=>Promise.resolve(e.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,n){let r=this._addNewAdapter(new EG(this._documents,n),e);return this._proxy.$registerDocumentFormattingSupport(r,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name),this._createDisposable(r)}$provideDocumentFormattingEdits(e,t,n,r){return this._withAdapter(e,EG,e=>e.provideDocumentFormattingEdits(w.revive(t),n,r),void 0,r)}registerDocumentRangeFormattingEditProvider(e,t,n){let r=typeof n.provideDocumentRangesFormattingEdits==`function`,i=this._addNewAdapter(new DG(this._documents,n),e);return this._proxy.$registerRangeFormattingSupport(i,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,r),this._createDisposable(i)}$provideDocumentRangeFormattingEdits(e,t,n,r,i){return this._withAdapter(e,DG,e=>e.provideDocumentRangeFormattingEdits(w.revive(t),n,r,i),void 0,i)}$provideDocumentRangesFormattingEdits(e,t,n,r,i){return this._withAdapter(e,DG,e=>e.provideDocumentRangesFormattingEdits(w.revive(t),n,r,i),void 0,i)}registerOnTypeFormattingEditProvider(e,t,n,r){let i=this._addNewAdapter(new OG(this._documents,n),e);return this._proxy.$registerOnTypeFormattingSupport(i,this._transformDocumentSelector(t,e),r,e.identifier),this._createDisposable(i)}$provideOnTypeFormattingEdits(e,t,n,r,i,a){return this._withAdapter(e,OG,e=>e.provideOnTypeFormattingEdits(w.revive(t),n,r,i,a),void 0,a)}registerWorkspaceSymbolProvider(e,t){let n=this._addNewAdapter(new kG(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(n,typeof t.resolveWorkspaceSymbol==`function`),this._createDisposable(n)}$provideWorkspaceSymbols(e,t,n){return this._withAdapter(e,kG,e=>e.provideWorkspaceSymbols(t,n),{symbols:[]},n)}$resolveWorkspaceSymbol(e,t,n){return this._withAdapter(e,kG,e=>e.resolveWorkspaceSymbol(t,n),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,kG,e=>e.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,n){let r=this._addNewAdapter(new AG(this._documents,n,this._logService),e);return this._proxy.$registerRenameSupport(r,this._transformDocumentSelector(t,e),AG.supportsResolving(n)),this._createDisposable(r)}$provideRenameEdits(e,t,n,r,i){return this._withAdapter(e,AG,e=>e.provideRenameEdits(w.revive(t),n,r,i),void 0,i)}$resolveRenameLocation(e,t,n,r){return this._withAdapter(e,AG,e=>e.resolveRenameLocation(w.revive(t),n,r),void 0,r)}registerNewSymbolNamesProvider(e,t,n){let r=this._addNewAdapter(new jG(this._documents,n,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,jG,e=>e.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,n,r,i){return this._withAdapter(e,jG,e=>e.provideNewSymbolNames(w.revive(t),n,r,i),void 0,i)}registerDocumentSemanticTokensProvider(e,t,n,r){let i=this._addNewAdapter(new NG(this._documents,n),e),a=typeof n.onDidChangeSemanticTokens==`function`?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(i,this._transformDocumentSelector(t,e),r,a);let o=this._createDisposable(i);if(a){let e=n.onDidChangeSemanticTokens(e=>this._proxy.$emitDocumentSemanticTokensEvent(a));o=WT.from(o,e)}return o}$provideDocumentSemanticTokens(e,t,n,r){return this._withAdapter(e,NG,e=>e.provideDocumentSemanticTokens(w.revive(t),n,r),null,r)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,NG,e=>e.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,n,r){let i=this._addNewAdapter(new PG(this._documents,n),e),a=typeof n.onDidChangeSemanticTokens==`function`?this._nextHandle():void 0;this._proxy.$registerDocumentRangeSemanticTokensProvider(i,this._transformDocumentSelector(t,e),r,a);let o=this._createDisposable(i);if(a){let e=n.onDidChangeSemanticTokens(e=>this._proxy.$emitDocumentRangeSemanticTokensEvent(a));o=WT.from(o,e)}return o}$provideDocumentRangeSemanticTokens(e,t,n,r){return this._withAdapter(e,PG,e=>e.provideDocumentRangeSemanticTokens(w.revive(t),n,r),null,r)}registerCompletionItemProvider(e,t,n,r){let i=this._addNewAdapter(new FG(this._documents,this._commands.converter,n,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(i,this._transformDocumentSelector(t,e),r,FG.supportsResolving(n),e.identifier),this._createDisposable(i)}$provideCompletionItems(e,t,n,r,i){return this._withAdapter(e,FG,e=>e.provideCompletionItems(w.revive(t),n,r,i),void 0,i)}$resolveCompletionItem(e,t,n){return this._withAdapter(e,FG,e=>e.resolveCompletionItem(t,n),void 0,n)}$releaseCompletionItems(e,t){this._withAdapter(e,FG,e=>e.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,n,r){let i=new IG(e,this._documents,n,this._commands.converter),a=this._addNewAdapter(i,e),o=this._createDisposable(a),s=Dw(e)&&typeof n.onDidChange==`function`;if(s){let e=n.onDidChange(e=>this._proxy.$emitInlineCompletionsChange(a,e?{data:e.data}:void 0));o=WT.from(o,e)}let c=Dw(e)&&typeof n.onDidChangeModelInfo==`function`;if(c){let e=n.onDidChangeModelInfo(e=>this._proxy.$emitInlineCompletionModelInfoChange(a,i.modelInfo));o=WT.from(o,e)}let l=Dw(e)&&typeof n.onDidChangeProviderOptions==`function`;if(l){let e=n.onDidChangeProviderOptions(e=>this._proxy.$emitInlineCompletionProviderOptionsChange(a,i.providerOptions));o=WT.from(o,e)}return this._proxy.$registerInlineCompletionsSupport(a,this._transformDocumentSelector(t,e),i.supportsHandleEvents,ys.toKey(e.identifier.value),e.version,r?.groupId?ys.toKey(r.groupId):void 0,r?.yieldTo?.map(e=>ys.toKey(e))||[],r?.displayName,r?.debounceDelayMs,r?.excludes?.map(e=>ys.toKey(e))||[],s,i.supportsSetModelId,i.modelInfo,c,i.supportsSetProviderOption,i.providerOptions,l),o}$provideInlineCompletions(e,t,n,r,i){return this._withAdapter(e,IG,e=>e.provideInlineCompletions(w.revive(t),n,r,i),void 0,void 0)}$handleInlineCompletionDidShow(e,t,n,r){this._withAdapter(e,IG,async e=>{e.handleDidShowCompletionItem(t,n,r)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,n,r,i){this._withAdapter(e,IG,async e=>{e.handlePartialAccept(t,n,r,i)},void 0,void 0)}$handleInlineCompletionEndOfLifetime(e,t,n,r){this._withAdapter(e,IG,async e=>{e.handleEndOfLifetime(t,n,r)},void 0,void 0)}$handleInlineCompletionRejection(e,t,n){this._withAdapter(e,IG,async e=>{e.handleRejection(t,n)},void 0,void 0)}$freeInlineCompletionsList(e,t,n){this._withAdapter(e,IG,async e=>{e.disposeCompletions(t,n)},void 0,void 0)}$acceptInlineCompletionsUnificationState(e){this._inlineCompletionsUnificationState=e,this._onDidChangeInlineCompletionsUnificationState.fire()}$handleInlineCompletionSetCurrentModelId(e,t){this._withAdapter(e,IG,async e=>{e.setCurrentModelId(t)},void 0,void 0)}$handleInlineCompletionSetProviderOption(e,t,n){this._withAdapter(e,IG,async e=>{e.setProviderOption(t,n)},void 0,void 0)}registerSignatureHelpProvider(e,t,n,r){let i=Array.isArray(r)?{triggerCharacters:r,retriggerCharacters:[]}:r,a=this._addNewAdapter(new RG(this._documents,n),e);return this._proxy.$registerSignatureHelpProvider(a,this._transformDocumentSelector(t,e),i),this._createDisposable(a)}$provideSignatureHelp(e,t,n,r,i){return this._withAdapter(e,RG,e=>e.provideSignatureHelp(w.revive(t),n,r,i),void 0,i)}$releaseSignatureHelp(e,t){this._withAdapter(e,RG,e=>e.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(t,n,r){let i=typeof r.onDidChangeInlayHints==`function`?this._nextHandle():void 0,a=this._addNewAdapter(new zG(this._documents,this._commands.converter,r,this._logService,t),t);this._proxy.$registerInlayHintsProvider(a,this._transformDocumentSelector(n,t),typeof r.resolveInlayHint==`function`,i,e._extLabel(t));let o=this._createDisposable(a);if(i!==void 0){let e=r.onDidChangeInlayHints(e=>this._proxy.$emitInlayHintsEvent(i));o=WT.from(o,e)}return o}$provideInlayHints(e,t,n,r){return this._withAdapter(e,zG,e=>e.provideInlayHints(w.revive(t),n,r),void 0,r)}$resolveInlayHint(e,t,n){return this._withAdapter(e,zG,e=>e.resolveInlayHint(t,n),void 0,n)}$releaseInlayHints(e,t){this._withAdapter(e,zG,e=>e.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,n){let r=this._addNewAdapter(new BG(this._documents,n),e);return this._proxy.$registerDocumentLinkProvider(r,this._transformDocumentSelector(t,e),typeof n.resolveDocumentLink==`function`),this._createDisposable(r)}$provideDocumentLinks(e,t,n){return this._withAdapter(e,BG,e=>e.provideLinks(w.revive(t),n),void 0,n,t.scheme===`output`)}$resolveDocumentLink(e,t,n){return this._withAdapter(e,BG,e=>e.resolveLink(t,n),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,BG,e=>e.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,n){let r=this._addNewAdapter(new VG(this._documents,n),e);return this._proxy.$registerDocumentColorProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideDocumentColors(e,t,n){return this._withAdapter(e,VG,e=>e.provideColors(w.revive(t),n),[],n)}$provideColorPresentations(e,t,n,r){return this._withAdapter(e,VG,e=>e.provideColorPresentations(w.revive(t),n,r),void 0,r)}registerFoldingRangeProvider(e,t,n){let r=this._nextHandle(),i=typeof n.onDidChangeFoldingRanges==`function`?this._nextHandle():void 0;this._adapter.set(r,new qG(new HG(this._documents,n),e)),this._proxy.$registerFoldingRangeProvider(r,this._transformDocumentSelector(t,e),e.identifier,i);let a=this._createDisposable(r);if(i!==void 0){let e=n.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(i));a=WT.from(a,e)}return a}$provideFoldingRanges(e,t,n,r){return this._withAdapter(e,HG,e=>e.provideFoldingRanges(w.revive(t),n,r),void 0,r)}registerSelectionRangeProvider(e,t,n){let r=this._addNewAdapter(new UG(this._documents,n,this._logService),e);return this._proxy.$registerSelectionRangeProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideSelectionRanges(e,t,n,r){return this._withAdapter(e,UG,e=>e.provideSelectionRanges(w.revive(t),n,r),[],r)}registerCallHierarchyProvider(e,t,n){let r=this._addNewAdapter(new WG(this._documents,n),e);return this._proxy.$registerCallHierarchyProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$prepareCallHierarchy(e,t,n,r){return this._withAdapter(e,WG,e=>Promise.resolve(e.prepareSession(w.revive(t),n,r)),void 0,r)}$provideCallHierarchyIncomingCalls(e,t,n,r){return this._withAdapter(e,WG,e=>e.provideCallsTo(t,n,r),void 0,r)}$provideCallHierarchyOutgoingCalls(e,t,n,r){return this._withAdapter(e,WG,e=>e.provideCallsFrom(t,n,r),void 0,r)}$releaseCallHierarchy(e,t){this._withAdapter(e,WG,e=>Promise.resolve(e.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,n){let r=this._addNewAdapter(new GG(this._documents,n),e);return this._proxy.$registerTypeHierarchyProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$prepareTypeHierarchy(e,t,n,r){return this._withAdapter(e,GG,e=>Promise.resolve(e.prepareSession(w.revive(t),n,r)),void 0,r)}$provideTypeHierarchySupertypes(e,t,n,r){return this._withAdapter(e,GG,e=>e.provideSupertypes(t,n,r),void 0,r)}$provideTypeHierarchySubtypes(e,t,n,r){return this._withAdapter(e,GG,e=>e.provideSubtypes(t,n,r),void 0,r)}$releaseTypeHierarchy(e,t){this._withAdapter(e,GG,e=>Promise.resolve(e.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,n,r){let i=this._nextHandle();return this._adapter.set(i,new qG(new KG(this._proxy,this._documents,n,i,e),e)),this._proxy.$registerDocumentOnDropEditProvider(i,this._transformDocumentSelector(t,e),r?{supportsResolve:!!n.resolveDocumentDropEdit,dropMimeTypes:r.dropMimeTypes,providedDropKinds:r.providedDropEditKinds?.map(e=>e.value)}:void 0),this._createDisposable(i)}$provideDocumentOnDropEdits(e,t,n,r,i,a){return this._withAdapter(e,KG,e=>Promise.resolve(e.provideDocumentOnDropEdits(t,w.revive(n),r,i,a)),void 0,void 0)}$resolveDropEdit(e,t,n){return this._withAdapter(e,KG,e=>e.resolveDropEdit(t,n),{},void 0)}$releaseDocumentOnDropEdits(e,t){this._withAdapter(e,KG,e=>Promise.resolve(e.releaseDropEdits(t)),void 0,void 0)}registerDocumentPasteEditProvider(e,t,n,r){let i=this._nextHandle();return this._adapter.set(i,new qG(new TG(this._proxy,this._documents,n,i,e),e)),this._proxy.$registerPasteEditProvider(i,this._transformDocumentSelector(t,e),{supportsCopy:!!n.prepareDocumentPaste,supportsPaste:!!n.provideDocumentPasteEdits,supportsResolve:!!n.resolveDocumentPasteEdit,providedPasteEditKinds:r.providedPasteEditKinds?.map(e=>e.value),copyMimeTypes:r.copyMimeTypes,pasteMimeTypes:r.pasteMimeTypes}),this._createDisposable(i)}$prepareDocumentPaste(e,t,n,r,i){return this._withAdapter(e,TG,e=>e.prepareDocumentPaste(w.revive(t),n,r,i),void 0,i)}$providePasteEdits(e,t,n,r,i,a,o){return this._withAdapter(e,TG,e=>e.providePasteEdits(t,w.revive(n),r,i,a,o),void 0,o)}$resolvePasteEdit(e,t,n){return this._withAdapter(e,TG,e=>e.resolvePasteEdit(t,n),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,TG,e=>Promise.resolve(e.releasePasteEdits(t)),void 0,void 0)}static _serializeRegExp(e){return{pattern:e.source,flags:e.flags}}static _serializeIndentationRule(t){return{decreaseIndentPattern:e._serializeRegExp(t.decreaseIndentPattern),increaseIndentPattern:e._serializeRegExp(t.increaseIndentPattern),indentNextLinePattern:t.indentNextLinePattern?e._serializeRegExp(t.indentNextLinePattern):void 0,unIndentedLinePattern:t.unIndentedLinePattern?e._serializeRegExp(t.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(t){return{beforeText:e._serializeRegExp(t.beforeText),afterText:t.afterText?e._serializeRegExp(t.afterText):void 0,previousLineText:t.previousLineText?e._serializeRegExp(t.previousLineText):void 0,action:t.action}}static _serializeOnEnterRules(t){return t.map(e._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(e=>RE.toString(e)):void 0}}static _serializeAutoClosingPairs(t){return t.map(e._serializeAutoClosingPair)}setLanguageConfiguration(t,n,r){let{wordPattern:i}=r;if(i&&Qi(i))throw Error(`Invalid language configuration: wordPattern '${i}' is not allowed to match the empty string.`);i?this._documents.setWordDefinitionFor(n,i):this._documents.setWordDefinitionFor(n,void 0),r.__electricCharacterSupport&&this._apiDeprecation.report(`LanguageConfiguration.__electricCharacterSupport`,t,`Do not use.`),r.__characterPairSupport&&this._apiDeprecation.report(`LanguageConfiguration.__characterPairSupport`,t,`Do not use.`);let a=this._nextHandle(),o={comments:r.comments,brackets:r.brackets,wordPattern:r.wordPattern?e._serializeRegExp(r.wordPattern):void 0,indentationRules:r.indentationRules?e._serializeIndentationRule(r.indentationRules):void 0,onEnterRules:r.onEnterRules?e._serializeOnEnterRules(r.onEnterRules):void 0,__electricCharacterSupport:r.__electricCharacterSupport,__characterPairSupport:r.__characterPairSupport,autoClosingPairs:r.autoClosingPairs?e._serializeAutoClosingPairs(r.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(a,n,o),this._createDisposable(a)}$setWordDefinitions(e){for(let t of e)this._documents.setWordDefinitionFor(t.languageId,new RegExp(t.regexSource,t.regexFlags))}};async function YG(e,t){let n=e+`:`+JSON.stringify(t),r=new TextEncoder().encode(n),i=await crypto.subtle.digest(`SHA-256`,r),a=Array.from(new Uint8Array(i)).map(e=>e.toString(16).padStart(2,`0`)).join(``);return e+`:combination:`+a}const XG=k(`notebookService`),ZG=k(`codeMapperService`),QG=k(`IChatService`),$G=`vscode_editFile_internal`,eK={id:$G,displayName:``,modelDescription:``,source:Ab.Internal};let tK=class{constructor(e,t,n){this.chatService=e,this.codeMapperService=t,this.notebookService=n}async invoke(e,t,n,r){if(!e.context)throw Error(`toolInvocationToken is required for this tool`);let i=e.parameters,a=w.revive(i.uri),o=lC.parse(a)?.notebook||a,s=this.chatService.getSession(e.context.sessionResource),c=s.getRequests().at(-1);s.acceptResponseProgress(c,{kind:`markdownContent`,content:new _l("\n````\n")}),s.acceptResponseProgress(c,{kind:`codeblockUri`,uri:o,isEdit:!0}),s.acceptResponseProgress(c,{kind:`markdownContent`,content:new _l("\n````\n")}),this.notebookService.hasSupportedNotebooks(o)&&this.notebookService.getNotebookTextModel(o)?s.acceptResponseProgress(c,{kind:`notebookEdit`,edits:[],uri:o}):s.acceptResponseProgress(c,{kind:`textEdit`,edits:[],uri:o});let l=s.editingSession;if(!l)throw Error(`This tool must be called from within an editing session`);let u=await this.codeMapperService.mapCode({codeBlocks:[{code:i.code,resource:o,markdownBeforeBlock:i.explanation}],location:`tool`,chatRequestId:e.chatRequestId,chatRequestModel:e.modelId,chatSessionResource:e.context.sessionResource},{textEdit:(e,t)=>{s.acceptResponseProgress(c,{kind:`textEdit`,uri:e,edits:t})},notebookEdit(e,t){s.acceptResponseProgress(c,{kind:`notebookEdit`,uri:e,edits:t})}},r);if(this.notebookService.hasSupportedNotebooks(o)&&this.notebookService.getNotebookTextModel(o)?s.acceptResponseProgress(c,{kind:`notebookEdit`,uri:o,edits:[],done:!0}):s.acceptResponseProgress(c,{kind:`textEdit`,uri:o,edits:[],done:!0}),u?.errorMessage)throw Error(u.errorMessage);let d;return await new Promise(e=>{let t=!1;d=sv(n=>{let r=l.entries.read(n)?.find(e=>$a(e.modifiedURI,o));r&&(r.isCurrentlyBeingModifiedBy.read(n)?t=!0:t&&e(!0))})}).finally(()=>{d.dispose()}),{content:[{kind:`text`,value:`The file was edited successfully`}]}}async prepareToolInvocation(e,t){return{presentation:Mb.Hidden}}};tK=A([j(0,QG),j(1,ZG),j(2,XG)],tK);const nK=k(`ILanguageModelToolsService`);var rK=class{dismiss(e){this.isUsed||(this.data=e??{},this.isUsed=!0,this.draftAnswers=void 0,this.draftCurrentIndex=void 0,this.draftCollapsed=void 0,this.completion.complete({answers:e}))}constructor(e,t,n,r,i,a,o,s){this.questions=e,this.allowSkip=t,this.resolveId=n,this.data=r,this.isUsed=i,this.message=a,this.source=o,this.terminalId=s,this.kind=`questionCarousel`,this.completion=new Ro}toJSON(){return{kind:this.kind,questions:this.questions,allowSkip:this.allowSkip,resolveId:this.resolveId,data:this.data,isUsed:this.isUsed,message:this.message,source:this.source,terminalId:this.terminalId}}},iK;(function(e){e.RunInTerminal=`run_in_terminal`,e.SendToTerminal=`send_to_terminal`,e.GetTerminalOutput=`get_terminal_output`,e.KillTerminal=`kill_terminal`,e.TerminalSelection=`terminal_selection`,e.TerminalLastCommand=`terminal_last_command`,e.ConfirmTerminalCommand=`vscode_get_terminal_confirmation`,e.CreateAndRunTask=`create_and_run_task`,e.GetTaskOutput=`get_task_output`,e.RunTask=`run_task`})(iK||={});const aK=`The user is not available to respond and will review your work later. Work autonomously and make good decisions.`,oK=`vscode_askQuestions`,sK={header:50,question:200},cK={header:75};function lK(e,t){if(e!==void 0)return e.length>t?e.slice(0,t-3)+`...`:e}function uK(){let e={type:`object`,properties:{questions:{type:`array`,description:`List of questions to ask the user. Order is preserved.`,items:{type:`object`,properties:{header:{type:`string`,description:`Short identifier for the question. Must be unique so answers can be mapped back to the question. Maximum ${sK.header} characters.`,maxLength:sK.header},question:{type:`string`,description:`The question text to display to the user. Keep it concise, ideally one sentence. Maximum ${sK.question} characters.`,maxLength:sK.question},multiSelect:{type:`boolean`,description:`Allow selecting multiple options when options are provided.`},allowFreeformInput:{type:`boolean`,description:`Allow freeform text answers in addition to option selection. Defaults to true; set to false to restrict to predefined options only.`},message:{type:`string`,description:`Optional markdown message to display below the question text, providing additional context or details.`},options:{type:`array`,description:`Optional list of selectable answers. If omitted, the question is free text.`,items:{type:`object`,properties:{label:{type:`string`,description:`Display label and value for the option.`},description:{type:`string`,description:`Optional secondary text shown with the option.`},recommended:{type:`boolean`,description:`Mark this option as the recommended default.`}},required:[`label`]}}},required:[`header`,`question`]},minItems:1}},required:[`questions`]};return{id:oK,toolReferenceName:`askQuestions`,legacyToolReferenceFullNames:[oK,`vscode/askQuestions`],canBeReferencedInPrompt:!1,icon:fl.fromId(P.question.id),displayName:x(8327,`Ask Clarifying Questions`),userDescription:x(8328,`Ask structured clarifying questions using single select, multi-select, or freeform inputs to collect task requirements before proceeding.`),modelDescription:`Use this tool to ask the user a small number of clarifying questions before proceeding. Provide the questions array with concise headers and prompts. Use options for fixed choices, set multiSelect when multiple selections are allowed. Users can always provide a freeform text answer alongside options unless you set allowFreeformInput to false.`,source:Ab.Internal,inputSchema:e}}const dK=uK();let fK=class extends y{constructor(e,t,n,r){super(),this.chatService=e,this.telemetryService=t,this.logService=n,this.configService=r}async invoke(e,t,n,r){let i=Yn.create(!0),{questions:a}=e.parameters;if(this.logService.trace(`[AskQuestionsTool] Invoking with ${a?.length??0} question(s)`),!a||a.length===0)throw Error(x(8329,`No questions provided. The questions array must contain at least one question.`));let o=e.context?.sessionResource,s=e.chatRequestId,{request:c,sessionResource:l}=this.getRequest(o,s);if(!l||!c)return this.logService.warn(`[AskQuestionsTool] Missing chat context; marking all questions as skipped.`),this.createSkippedResult(a);let u=e.chatStreamToolCallId??e.callId;if(c.modeInfo?.permissionLevel===dy.Autopilot||this.configService.getValue(ly.AutoReply)){let e=c.modeInfo?.permissionLevel===dy.Autopilot?`Autopilot mode`:`Auto-reply enabled`;this.logService.info(`[AskQuestionsTool] ${e}: auto-responding to questions`);let{carousel:t,idToHeaderMap:n}=this.toQuestionCarousel(a,u);return t.terminalId=this.extractTerminalId(c),t.data=this.buildAutopilotCarouselAnswers(a,t,n),t.isUsed=!0,this.chatService.appendProgress(c,t),this.createAutopilotResult(a)}let{carousel:d,idToHeaderMap:p}=this.toQuestionCarousel(a,u);d.terminalId=this.extractTerminalId(c),this.logService.trace(`[AskQuestionsTool] request=${c.id} terminalExecutionId=${c.terminalExecutionId??`undefined`} carousel.terminalId=${d.terminalId??`undefined`}`),this.chatService.appendProgress(c,d);let m=this.chatService.onDidReceiveQuestionCarouselAnswer(e=>{e.resolveId!==d.resolveId||d.isUsed||d.dismiss(e.answers)}),h;try{h=await mo(d.completion.p,r)}catch(e){throw e instanceof f&&d.dismiss(void 0),e}finally{m.dispose()}if(!h)throw d.dismiss(void 0),new f;if(r.isCancellationRequested)throw new f;if(d.dismissedByTerminalInput&&d.terminalId)return this.logService.info(`[AskQuestionsTool] Carousel dismissed because user typed directly in terminal ${d.terminalId}`),{content:[{kind:`text`,value:`The user is replying to the terminal prompts directly. Do not ask more questions or send input to the terminal. You will be automatically notified when the command in terminal ${d.terminalId} completes.`}]};n.report({message:x(8330,`Analyzing your answers...`)});let ee=this.convertCarouselAnswers(a,h?.answers,p),{answeredCount:te,skippedCount:g,freeTextCount:ne,recommendedAvailableCount:re,recommendedSelectedCount:ie}=this.collectMetrics(a,ee);this.sendTelemetry(e.chatRequestId,a.length,te,g,ne,re,ie,i.elapsed());let ae=JSON.stringify(ee);return this.logService.trace(`[AskQuestionsTool] Returning tool result with metrics: questions=${a.length}, answered=${te}, skipped=${g}, freeText=${ne}, recommendedAvailable=${re}, recommendedSelected=${ie}`),{content:[{kind:`text`,value:ae}]}}async prepareToolInvocation(e,t){let{questions:n}=e.parameters;if(!n||n.length===0)throw Error(x(8329,`No questions provided. The questions array must contain at least one question.`));for(let e of n)if(e.options&&e.options.length===1)throw Error(x(8331,`Question "{0}" must have at least two options, or none for free text input.`,e.header));let r=n.length,i=n.map(e=>e.header).join(`, `),a=r===1?x(8332,`Asking a question ({0})`,i):x(8333,`Asking {0} questions ({1})`,r,i),o=r===1?x(8334,`Asked a question ({0})`,i):x(8335,`Asked {0} questions ({1})`,r,i);return{invocationMessage:new _l(a),pastTenseMessage:new _l(o)}}getRequest(e,t){if(!e)return{request:void 0,sessionResource:void 0};let n=this.chatService.getSession(e),r;return n&&(t&&(r=n.getRequests().find(e=>e.id===t)),r||=n.getRequests().at(-1)),r?{request:r,sessionResource:e}:{request:void 0,sessionResource:e}}extractTerminalId(e){if(e.terminalExecutionId)return e.terminalExecutionId;let t=e.message.text.match(/\[Terminal (?<termId>\S+) notification:/);if(t?.groups?.termId)return t.groups.termId;let n=e.response;if(n){let e=n.response.value;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.kind===`toolInvocation`&&n.toolId===iK.RunInTerminal){let e=n.state.get();if(e.type===xU.StateKind.Completed&&e.contentForModel){for(let t of e.contentForModel)if(t.kind===`text`){let e=t.value.match(/(?:running in terminal ID|may still be running in terminal ID) ([0-9a-fA-F-]+)/);if(e)return e[1]}}}}}}toQuestionCarousel(e,t){let n=new Map,r=t??zc();return{carousel:new rK(e.map((e,t)=>this.toChatQuestion(e,n,r,t)),!0,r),idToHeaderMap:n}}toChatQuestion(e,t,n,r){let i;i=!e.options||e.options.length===0?`text`:e.multiSelect?`multiSelect`:`singleSelect`;let a;if(e.options){let t=e.options.filter(e=>e.recommended);t.length>0&&(a=e.multiSelect?t.map(e=>e.label):t[0].label)}let o=`${n}:${r}`;t.set(o,e.header);let s=lK(e.header,cK.header)??e.header;return{id:o,type:i,title:s,message:e.question,detailedMessage:e.message,options:e.options?.map(e=>({id:e.label,label:e.description?`${e.label} - ${e.description}`:e.label,value:e.label})),defaultValue:a,allowFreeformInput:e.allowFreeformInput??!0}}convertCarouselAnswers(e,t,n){let r={answers:{}};t&&(this.logService.trace(`[AskQuestionsTool] Carousel answer keys: ${Object.keys(t).join(`, `)}`),this.logService.trace(`[AskQuestionsTool] Question headers: ${e.map(e=>e.header).join(`, `)}`));let i=new Map;for(let[e,t]of n)i.set(t,e);for(let n of e){if(!t){r.answers[n.header]={selected:[],freeText:null,skipped:!0};continue}let e=i.get(n.header),a=e?t[e]:void 0;if(this.logService.trace(`[AskQuestionsTool] Processing question "${n.header}" (internal ID: ${e}), raw answer: ${JSON.stringify(a)}, type: ${typeof a}`),a===void 0)r.answers[n.header]={selected:[],freeText:null,skipped:!0};else if(typeof a==`string`)n.options?.some(e=>e.label===a)?r.answers[n.header]={selected:[a],freeText:null,skipped:!1}:r.answers[n.header]={selected:[],freeText:a,skipped:!1};else if(Array.isArray(a))r.answers[n.header]={selected:a.map(e=>String(e)),freeText:null,skipped:!1};else if(typeof a==`object`&&ct(a,{selectedValues:!0})){let{selectedValues:e,freeformValue:t}=a;r.answers[n.header]={selected:e,freeText:t??null,skipped:!1}}else if(typeof a==`object`&&(ct(a,{selectedValue:!0})||ct(a,{freeformValue:!0}))){let{selectedValue:e,freeformValue:t}=a;t?r.answers[n.header]={selected:[],freeText:t,skipped:!1}:e===void 0?r.answers[n.header]={selected:[],freeText:null,skipped:!0}:n.options?.some(t=>t.label===e)?r.answers[n.header]={selected:[e],freeText:null,skipped:!1}:r.answers[n.header]={selected:[],freeText:e,skipped:!1}}else this.logService.warn(`[AskQuestionsTool] Unknown answer format for "${n.header}": ${JSON.stringify(a)}`),r.answers[n.header]={selected:[],freeText:null,skipped:!0}}return r}collectMetrics(e,t){let n=Object.values(t.answers);return{answeredCount:n.filter(e=>!e.skipped).length,skippedCount:n.filter(e=>e.skipped).length,freeTextCount:n.filter(e=>e.freeText!==null).length,recommendedAvailableCount:e.filter(e=>e.options?.some(e=>e.recommended)).length,recommendedSelectedCount:e.filter(e=>{let n=t.answers[e.header],r=e.options?.find(e=>e.recommended);return n&&!n.skipped&&r&&n.selected.includes(r.label)}).length}}createSkippedResult(e){let t={};for(let n of e)t[n.header]={selected:[],freeText:null,skipped:!0};return{content:[{kind:`text`,value:JSON.stringify({answers:t})}]}}createAutopilotResult(e){let t={};for(let n of e)t[n.header]={selected:[],freeText:aK,skipped:!1};return{content:[{kind:`text`,value:JSON.stringify({answers:t})}]}}buildAutopilotCarouselAnswers(e,t,n){let r={},i=new Map;for(let[e,t]of n)i.set(t,e);for(let n of e){let e=i.get(n.header);if(!e)continue;let a=t.questions.find(t=>t.id===e);a&&(a.type===`multiSelect`?r[e]={selectedValues:[],freeformValue:aK}:a.type===`singleSelect`?r[e]={freeformValue:aK}:r[e]=aK)}return r}sendTelemetry(e,t,n,r,i,a,o,s){this.telemetryService.publicLog2(`askQuestionsToolInvoked`,{requestId:e,questionCount:t,answeredCount:n,skippedCount:r,freeTextCount:i,recommendedAvailableCount:a,recommendedSelectedCount:o,duration:s})}};fK=A([j(0,QG),j(1,a_),j(2,Ds),j(3,Sh)],fK);const pK={id:`vscode_get_confirmation`,displayName:`Confirmation Tool`,modelDescription:`A tool that demonstrates different types of confirmations. Takes a title, message, and confirmation type (basic or terminal).`,source:Ab.Internal,inputSchema:{type:`object`,properties:{title:{type:`string`,description:`Title for the confirmation dialog`},message:{type:`string`,description:`Message to show in the confirmation dialog`},confirmationType:{type:`string`,enum:[`basic`,`terminal`],description:`Type of confirmation to show - basic for simple confirmation, terminal for terminal command confirmation`},terminalCommand:{type:`string`,description:`Terminal command to show (only used when confirmationType is "terminal")`}},required:[`title`,`message`,`confirmationType`],additionalProperties:!1}},mK={id:`vscode_get_confirmation_with_options`,displayName:`Confirmation Tool with Options`,modelDescription:`A tool that demonstrates different types of confirmations. Takes a title, message, and buttons.`,source:Ab.Internal,inputSchema:{type:`object`,properties:{title:{type:`string`,description:`Title for the confirmation dialog`},message:{type:`string`,description:`Message to show in the confirmation dialog`},buttons:{type:`array`,items:{type:`string`},description:`Custom button labels to display.`}},required:[`title`,`message`,`buttons`],additionalProperties:!1}},hK={id:`vscode_get_modified_files_confirmation`,displayName:`Modified Files Confirmation Tool`,modelDescription:`A tool that shows a modified-files confirmation UI with a split primary button and a hardcoded cancel action.`,source:Ab.Internal,inputSchema:{type:`object`,properties:{title:{type:`string`,description:`Title for the confirmation dialog`},message:{type:`string`,description:`Message to show in the confirmation dialog`},options:{type:`array`,items:{type:`string`},minItems:1,description:`Selectable option labels. The first option is used for the primary split button and the remaining options are placed in the dropdown menu.`},modifiedFiles:{type:`array`,items:{type:`object`,properties:{uri:{type:`string`,description:`URI of the modified file.`},originalUri:{type:`string`,description:`Optional original URI used when opening a diff.`},insertions:{type:`number`,description:`Optional number of lines added.`},deletions:{type:`number`,description:`Optional number of lines removed.`},title:{type:`string`,description:`Optional title shown in the file tooltip.`},description:{type:`string`,description:`Optional secondary label shown for the file entry.`}},required:[`uri`],additionalProperties:!1},description:`Modified files to show in the confirmation UI.`}},required:[`title`,`message`,`options`,`modifiedFiles`],additionalProperties:!1}};var gK=class{async prepareToolInvocation(e,t){let n=e.parameters;if(!n.title||!n.message)throw Error(`Missing required parameters for ConfirmationTool`);let r=n.confirmationType??`basic`,i;return i=r===`terminal`?{kind:`terminal`,commandLine:{original:n.terminalCommand??``},language:`bash`}:void 0,{confirmationMessages:{title:n.title,message:new _l(n.message),allowAutoConfirm:!(n.buttons||[]).length,customOptions:n.buttons?.map((e,t)=>({id:e,label:e,kind:t===0?qy.Approve:qy.Deny}))},toolSpecificData:i,presentation:Mb.HiddenAfterComplete}}async invoke(e,t,n,r){return e.selectedCustomButton?{content:[{kind:`text`,value:e.selectedCustomButton}]}:{content:[{kind:`text`,value:`yes`}]}}},_K=class{async prepareToolInvocation(e,t){let n=e.parameters;if(!n.title||!n.message)throw Error(`Missing required parameters for ModifiedFilesConfirmationTool`);if(!n.options?.length)throw Error(`ModifiedFilesConfirmationTool requires at least one option`);let r={kind:`modifiedFilesConfirmation`,options:n.options,modifiedFiles:n.modifiedFiles.map(e=>({uri:w.parse(e.uri).toJSON(),originalUri:e.originalUri?w.parse(e.originalUri).toJSON():void 0,insertions:e.insertions,deletions:e.deletions,title:e.title,description:e.description}))};return{confirmationMessages:{title:n.title,message:new _l(n.message),allowAutoConfirm:!1},toolSpecificData:r,presentation:Mb.HiddenAfterComplete}}async invoke(e,t,n,r){return e.selectedCustomButton?{content:[{kind:`text`,value:e.selectedCustomButton}]}:{content:[{kind:`text`,value:`yes`}]}}};const vK=k(`chatTodoListService`),yK=`manage_todo_list`;function bK(){return{id:yK,toolReferenceName:`todo`,legacyToolReferenceFullNames:[`todos`],canBeReferencedInPrompt:!0,icon:fl.fromId(P.checklist.id),displayName:x(8336,`Manage and track todo items for task planning`),userDescription:x(8337,`Manage and track todo items for task planning`),modelDescription:`Manage a structured todo list to track progress and plan tasks throughout your coding session. Use this tool VERY frequently to ensure task visibility and proper planning.
108
-
109
- When to use this tool:
110
- - Complex multi-step work requiring planning and tracking
111
- - When user provides multiple tasks or requests (numbered/comma-separated)
112
- - After receiving new instructions that require multiple steps
113
- - BEFORE starting work on any todo (mark as in-progress)
114
- - IMMEDIATELY after completing each todo (mark completed individually)
115
- - When breaking down larger tasks into smaller actionable steps
116
- - To give users visibility into your progress and planning
117
-
118
- When NOT to use:
119
- - Single, trivial tasks that can be completed in one step
120
- - Purely conversational/informational requests
121
- - When just reading files or performing simple searches
122
-
123
- CRITICAL workflow:
124
- 1. Plan tasks by writing todo list with specific, actionable items
125
- 2. Mark ONE todo as in-progress before starting work
126
- 3. Complete the work for that specific todo
127
- 4. Mark that todo as completed IMMEDIATELY
128
- 5. Move to next todo and repeat
129
-
130
- Todo states:
131
- - not-started: Todo not yet begun
132
- - in-progress: Currently working (limit ONE at a time)
133
- - completed: Finished successfully
134
-
135
- IMPORTANT: Mark todos completed as soon as they are done. Do not batch completions.`,source:Ab.Internal,inputSchema:{type:`object`,properties:{todoList:{type:`array`,description:`Complete array of all todo items. Must include ALL items - both existing and new.`,items:{type:`object`,properties:{id:{type:`number`,description:`Unique identifier for the todo. Use sequential numbers starting from 1.`},title:{type:`string`,description:`Concise action-oriented todo label (3-7 words). Displayed in UI.`},status:{type:`string`,enum:[`not-started`,`in-progress`,`completed`],description:`not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers`}},required:[`id`,`title`,`status`]}}},required:[`todoList`]}}}bK();let xK=class extends y{constructor(e,t,n){super(),this.chatTodoListService=e,this.logService=t,this.telemetryService=n}async invoke(e,t,n,r){let i=e.parameters,a=e.context?.sessionResource;if(!a&&i.operation===`read`&&i.chatSessionResource)try{a=w.parse(i.chatSessionResource)}catch(e){this.logService.error(`ManageTodoListTool: Invalid chatSessionResource URI`,e)}if(!a)return{content:[{kind:`text`,value:`Error: No session resource available`}]};this.logService.debug(`ManageTodoListTool: Invoking with options ${JSON.stringify(i)}`);try{return i.operation===`read`?this.handleReadOperation(a):this.handleWriteOperation(i,a)}catch(e){return{content:[{kind:`text`,value:`Error: ${e instanceof Error?e.message:`Unknown error`}`}]}}}async prepareToolInvocation(e,t){let n=e.parameters,r=e.chatSessionResource;if(!r)return;let i=this.chatTodoListService.getTodos(r),a;n.operation===`read`?a=x(8338,`Read todo list`):n.todoList&&(a=this.generatePastTenseMessage(i,n.todoList));let o=n.todoList??i,s=o.map(e=>({id:e.id.toString(),title:e.title,status:e.status}));return{invocationMessage:new _l(a?.replace(/^(Starting|Completed): /i,``)??x(8339,`Updating todo list`)),presentation:o.length?void 0:Mb.Hidden,pastTenseMessage:new _l(a??x(8340,`Updated todo list`)),toolSpecificData:{kind:`todoList`,todoList:s}}}generatePastTenseMessage(e,t){if(e.length===0&&t.length>0)return t.length===1?x(8341,`Created 1 todo`):x(8342,`Created {0} todos`,t.length);let n=new Map(e.map(e=>[e.id,e])),r=t.filter(e=>{let t=n.get(e.id);return t&&t.status!==`in-progress`&&e.status===`in-progress`});if(r.length>0){let e=r[0],n=t.length,i=t.findIndex(t=>t.id===e.id)+1;return x(8343,`Starting: *{0}* ({1}/{2})`,e.title,i,n)}let i=t.filter(e=>{let t=n.get(e.id);return t&&t.status!==`completed`&&e.status===`completed`});if(i.length>0){let e=i[0],n=t.length,r=t.findIndex(t=>t.id===e.id)+1;return x(8344,`Completed: *{0}* ({1}/{2})`,e.title,r,n)}let a=t.filter(e=>!n.has(e.id));return a.length>0?a.length===1?x(8345,`Added 1 todo`):x(8346,`Added {0} todos`,a.length):x(8347,`Updated todo list`)}handleRead(e,t){return e.length===0?`No todo list found.`:`# Todo List\n\n${this.formatTodoListAsMarkdownTaskList(e)}`}handleReadOperation(e){let t=this.chatTodoListService.getTodos(e),n=this.handleRead(t,e),r=this.calculateStatusCounts(t);return this.telemetryService.publicLog2(`todoListToolInvoked`,{operation:`read`,notStartedCount:r.notStartedCount,inProgressCount:r.inProgressCount,completedCount:r.completedCount}),{content:[{kind:`text`,value:n}]}}handleWriteOperation(e,t){if(!e.todoList)return{content:[{kind:`text`,value:`Error: todoList is required for write operation`}]};let n=e.todoList.map(e=>({id:e.id,title:e.title,status:e.status})),r=this.chatTodoListService.getTodos(t),i=this.calculateTodoChanges(r,n);this.chatTodoListService.setTodos(t,n);let a=this.calculateStatusCounts(n),o=[];return n.length<3?o.push(`Warning: Small todo list (<3 items). This task might not need a todo list.`):n.length>10&&o.push(`Warning: Large todo list (>10 items). Consider keeping the list focused and actionable.`),i>3&&o.push(`Warning: Did you mean to update so many todos at the same time? Consider working on them one by one.`),this.telemetryService.publicLog2(`todoListToolInvoked`,{operation:`write`,notStartedCount:a.notStartedCount,inProgressCount:a.inProgressCount,completedCount:a.completedCount}),{content:[{kind:`text`,value:`Successfully wrote todo list${o.length?`
136
-
137
- `+o.join(`
138
- `):``}`}],toolMetadata:{warnings:o}}}calculateStatusCounts(e){return{notStartedCount:e.filter(e=>e.status===`not-started`).length,inProgressCount:e.filter(e=>e.status===`in-progress`).length,completedCount:e.filter(e=>e.status===`completed`).length}}formatTodoListAsMarkdownTaskList(e){return e.length===0?``:e.map(e=>{let t;switch(e.status){case`completed`:t=`[x]`;break;case`in-progress`:t=`[-]`;break;default:t=`[ ]`;break}return[`- ${t} ${e.title}`].join(`
139
- `)}).join(`
140
- `)}calculateTodoChanges(e,t){let n=0,r=Math.min(e.length,t.length);for(let i=0;i<r;i++){let r=e[i],a=t[i];(r.title!==a.title||r.status!==a.status)&&n++}return Math.max(0,t.length-e.length)+Math.max(0,e.length-t.length)+n}};xK=A([j(0,vK),j(1,Ds),j(2,a_)],xK);var SK=class{constructor(e,t,n,r,i,a,o,s,c){this.title=e,this.content=t,this.actions=n,this.canProvideFeedback=r,this.planUri=i,this.resolveId=a,this.data=o,this.isUsed=s,this.source=c,this.kind=`planReview`,this.completion=new Ro}dismiss(){this.isUsed||(this.isUsed=!0,this.draftFeedback=void 0,this.draftCollapsed=void 0,this.completion.complete(void 0))}toJSON(){return{kind:this.kind,title:this.title,content:this.content,actions:this.actions,canProvideFeedback:this.canProvideFeedback,planUri:this.planUri,resolveId:this.resolveId,data:this.data,isUsed:this.isUsed,source:this.source}}};function CK(){return{id:`vscode_reviewPlan`,toolReferenceName:`reviewPlan`,canBeReferencedInPrompt:!1,icon:fl.fromId(P.checklist.id),displayName:x(8348,`Review Plan`),userDescription:x(8349,`Ask the user to review and approve a plan before proceeding.`),modelDescription:`Use this tool to present a plan to the user for review. Provide the plan content as markdown, a list of approval actions (with optional default), and whether the user can provide freeform feedback. Optionally provide a URI to the backing plan file so the user can edit it. The tool returns the chosen action, whether the plan was rejected, and any feedback.`,source:Ab.Internal,inputSchema:{type:`object`,properties:{title:{type:`string`,description:`Title displayed in the widget header. Defaults to "Review plan" if omitted.`},plan:{type:`string`,description:`Optional URI of an editable plan file. An Edit button in the widget header opens it in the editor.`},content:{type:`string`,description:`Markdown content rendered in the body of the widget. May be the plan summary or full plan text.`},actions:{type:`array`,description:`List of approval actions offered in the primary dropdown button. Order is preserved.`,items:{type:`object`,properties:{label:{type:`string`,description:`Short action label shown in the dropdown button.`},description:{type:`string`,description:`Optional detail shown below the label in the dropdown list.`},default:{type:`boolean`,description:`Whether this action should be selected by default.`},permissionLevel:{type:`string`,enum:[`autopilot`],description:`When set to "autopilot", a confirmation dialog is shown before proceeding.`}},required:[`label`]},minItems:1},canProvideFeedback:{type:`boolean`,description:`When true, an additional feedback textarea is shown below the plan content.`}},required:[`content`,`actions`,`canProvideFeedback`]}}}const wK=CK();let TK=class extends y{constructor(e,t){super(),this.chatService=e,this.logService=t}async invoke(e,t,n,r){let{title:i,plan:a,content:o,actions:s,canProvideFeedback:c}=e.parameters;if(!s||s.length===0)throw Error(x(8350,`At least one approval action must be provided.`));let{request:l}=this.getRequest(e.context?.sessionResource,e.chatRequestId);if(!l)return this.logService.warn(`[ReviewPlanTool] Missing chat context; returning rejected result.`),this.toResult({rejected:!0});let u;if(a)try{u=w.parse(a)}catch{try{u=w.file(a)}catch{u=void 0}}let d=new SK(i??x(8351,`Review plan`),o,s,c,u?.toJSON(),zc());this.chatService.appendProgress(l,d);let p=await mo(d.completion.p,r);if(r.isCancellationRequested)throw new f;return this.toResult(p??{rejected:!0})}async prepareToolInvocation(e,t){let n=e.parameters;if(!n.actions||n.actions.length===0)throw Error(x(8350,`At least one approval action must be provided.`));return{invocationMessage:new _l(x(8352,`Asking you to review the plan`)),pastTenseMessage:new _l(x(8353,`Asked you to review the plan`))}}toResult(e){return{content:[{kind:`text`,value:JSON.stringify(e)}]}}getRequest(e,t){if(!e)return{request:void 0};let n=this.chatService.getSession(e);if(!n)return{request:void 0};let r;return t&&(r=n.getRequests().find(e=>e.id===t)),r||=n.getRequests().at(-1),{request:r}}};TK=A([j(0,QG),j(1,Ds)],TK);const EK=k(`ILanguageModelsService`),DK=k(`chatAgentService`);k(`chatAgentNameService`);const OK=k(`labelService`),kK=k(`remoteAgentService`);function AK(){return{applyingInstructionsCount:0,referencedInstructionsCount:0,agentInstructionsCount:0,listedInstructionsCount:0,totalInstructionsCount:0,claudeRulesCount:0,claudeMdCount:0,claudeAgentsCount:0}}function jK(){return{debugDetails:[],durationInMillis:0}}function MK(e,t){return e===void 0||t===void 0||e.includes(t)}var NK;(function(e){e.local=`local`,e.user=`user`,e.extension=`extension`,e.plugin=`plugin`})(NK||={});var PK;(function(e){function t(e){return e.storage===NK.extension?{storage:NK.extension,extensionId:e.extension.identifier}:e.storage===NK.plugin?{storage:NK.plugin,pluginUri:e.pluginUri}:{storage:e.storage}}e.fromPromptPath=t;function n(e,t){return e===t?!0:!e||!t||e.storage!==t.storage?!1:e.storage===NK.extension&&t.storage===NK.extension?ys.equals(e.extensionId,t.extensionId):e.storage===NK.plugin&&t.storage===NK.plugin?$a(e.pluginUri,t.pluginUri):!0}e.isEquals=n})(PK||={});var FK;(function(e){e.agentsMd=`agentsMd`,e.claudeMd=`claudeMd`,e.copilotInstructionsMd=`copilotInstructionsMd`})(FK||={});function IK(e){return ia(e,`SKILL.md`)===0}const LK=`.claude/agents`,RK=`~/.copilot/agents`,zK=`.claude/rules`,BK=[{path:`.agents/skills`,source:_b.AgentsWorkspace,storage:NK.local},{path:`.github/skills`,source:_b.GitHubWorkspace,storage:NK.local},{path:`.claude/skills`,source:_b.ClaudeWorkspace,storage:NK.local},{path:`~/.agents/skills`,source:_b.AgentsPersonal,storage:NK.user},{path:`~/.copilot/skills`,source:_b.CopilotPersonal,storage:NK.user},{path:`~/.claude/skills`,source:_b.ClaudePersonal,storage:NK.user}],VK=[{path:`.github/instructions`,source:_b.GitHubWorkspace,storage:NK.local},{path:zK,source:_b.ClaudeWorkspace,storage:NK.local},{path:`~/.copilot/instructions`,source:_b.CopilotPersonal,storage:NK.user},{path:`~/`+zK,source:_b.ClaudePersonal,storage:NK.user}],HK=[{path:`.github/prompts`,source:_b.GitHubWorkspace,storage:NK.local}],UK=[{path:`.github/agents`,source:_b.GitHubWorkspace,storage:NK.local},{path:LK,source:_b.ClaudeWorkspace,storage:NK.local},{path:RK,source:_b.CopilotPersonal,storage:NK.user},{path:`~/`+LK,source:_b.ClaudePersonal,storage:NK.user}],WK=[{path:`.github/hooks`,source:_b.GitHubWorkspace,storage:NK.local},{path:`.claude/settings.local.json`,source:_b.ClaudeWorkspaceLocal,storage:NK.local},{path:`.claude/settings.json`,source:_b.ClaudeWorkspace,storage:NK.local},{path:`~/.copilot/hooks`,source:_b.CopilotPersonal,storage:NK.user},{path:`~/.claude/settings.json`,source:_b.ClaudePersonal,storage:NK.user}];function GK(e){let t=ro(e).path;return t.endsWith(`/.github/agents`)||t.endsWith(`/.claude/agents`)||qK(e)}function KK(e){return ro(e).path.endsWith(`/`+LK)}function qK(e){return ro(e).path.endsWith(RK.substring(1))}function JK(e){return e.path.includes(`/`+zK+`/`)}function YK(e){let t=to(e);if(t.endsWith(`.prompt.md`))return hb.prompt;if(t.endsWith(`.instructions.md`)||t===`copilot-instructions.md`)return hb.instructions;if(t.endsWith(`.chatmode.md`)||t.endsWith(`.agent.md`))return hb.agent;if(IK(t))return hb.skill;if(t.endsWith(`.md`)&&t!==`README.md`&&GK(e))return hb.agent;if(t.endsWith(`.md`)&&t!==`README.md`&&JK(e))return hb.instructions;if(t.toLowerCase().endsWith(`.json`))return hb.hook}function XK(e){return YK(e)!==void 0}function ZK(e){switch(e){case hb.instructions:return VK;case hb.prompt:return HK;case hb.agent:return UK;case hb.skill:return BK;case hb.hook:return WK;default:throw Error(`Unknown prompt type`)}}var QK;(function(e){e.PROMPT_LOCATIONS_KEY=`chat.promptFilesLocations`,e.INSTRUCTIONS_LOCATION_KEY=`chat.instructionsFilesLocations`,e.MODE_LOCATION_KEY=`chat.modeFilesLocations`,e.AGENTS_LOCATION_KEY=`chat.agentFilesLocations`,e.SKILLS_LOCATION_KEY=`chat.agentSkillsLocations`,e.HOOKS_LOCATION_KEY=`chat.hookFilesLocations`,e.PROMPT_FILES_SUGGEST_KEY=`chat.promptFilesRecommendations`,e.USE_COPILOT_INSTRUCTION_FILES=`github.copilot.chat.codeGeneration.useInstructionFiles`,e.USE_AGENT_MD=`chat.useAgentsMdFile`,e.USE_NESTED_AGENT_MD=`chat.useNestedAgentsMdFiles`,e.USE_CLAUDE_MD=`chat.useClaudeMdFile`,e.USE_AGENT_SKILLS=`chat.useAgentSkills`,e.USE_CHAT_HOOKS=`chat.useHooks`,e.USE_CLAUDE_HOOKS=`chat.useClaudeHooks`,e.USE_SKILL_ADHERENCE_PROMPT=`chat.experimental.useSkillAdherencePrompt`,e.INCLUDE_APPLYING_INSTRUCTIONS=`chat.includeApplyingInstructions`,e.INCLUDE_REFERENCED_INSTRUCTIONS=`chat.includeReferencedInstructions`,e.USE_CUSTOMIZATIONS_IN_PARENT_REPOS=`chat.useCustomizationsInParentRepositories`;function t(e,t){let n=$K(t),r=e.getValue(n);if(!(r==null||Array.isArray(r))&&typeof r==`object`){let e={};for(let[t,n]of Object.entries(r)){let r=t.trim(),i=eq(n);i!==void 0&&r&&(e[r]=i)}return e}}e.getLocationsValue=t;function n(e,n){let r=t(e,n),i=ZK(n);if(r&&typeof r==`object`){let e=[],t=new Set(i.map(e=>e.path));for(let t of i)r[t.path]!==!1&&e.push(t);for(let[n,i]of Object.entries(r)){if(i===!1||t.has(n))continue;let r=tq(n)?NK.user:NK.local;e.push({path:n,source:r===NK.local?_b.ConfigWorkspace:_b.ConfigPersonal,storage:r})}return e}return[]}e.promptSourceFolders=n;function r(t,n){let r=t.getValue(e.PROMPT_FILES_SUGGEST_KEY,{resource:n});if(!r||typeof r!=`object`||Array.isArray(r))return;let i={};for(let[e,t]of Object.entries(r)){let n=e.trim();if(!n)continue;if(typeof t==`boolean`){i[n]=t;continue}if(typeof t==`string`){let e=t.trim();e&&(i[n]=e);continue}let r=eq(t);r!==void 0&&(i[n]=r)}return Object.keys(i).length>0?i:void 0}e.getPromptFilesRecommendationsValue=r})(QK||={});function $K(e){switch(e){case hb.instructions:return QK.INSTRUCTIONS_LOCATION_KEY;case hb.prompt:return QK.PROMPT_LOCATIONS_KEY;case hb.agent:return QK.AGENTS_LOCATION_KEY;case hb.skill:return QK.SKILLS_LOCATION_KEY;case hb.hook:return QK.HOOKS_LOCATION_KEY;default:throw Error(`Unknown prompt type`)}}function eq(e){if(typeof e==`boolean`)return e;if(typeof e==`string`){let t=e.trim().toLowerCase();return t===`true`?!0:t===`false`?!1:void 0}}function tq(e){return e.startsWith(`~/`)}const nq=k(`IPromptsService`);var rq=class e{static fromTo(t,n){return new e(t,n)}static equals(e,t){return e.start===t.start&&e.endExclusive===t.endExclusive}static addRange(t,n){let r=0;for(;r<n.length&&n[r].endExclusive<t.start;)r++;let i=r;for(;i<n.length&&n[i].start<=t.endExclusive;)i++;if(r===i)n.splice(r,0,t);else{let a=Math.min(t.start,n[r].start),o=Math.max(t.endExclusive,n[i-1].endExclusive);n.splice(r,i-r,new e(a,o))}}static tryCreate(t,n){if(!(t>n))return new e(t,n)}static ofLength(t){return new e(0,t)}static ofStartAndLength(t,n){return new e(t,t+n)}static emptyAt(t){return new e(t,t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new ae(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(t){return new e(this.start+t,this.endExclusive+t)}deltaStart(t){return new e(this.start+t,this.endExclusive)}deltaEnd(t){return new e(this.start,this.endExclusive+t)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(t){return new e(Math.min(this.start,t.start),Math.max(this.endExclusive,t.endExclusive))}intersect(t){let n=Math.max(this.start,t.start),r=Math.min(this.endExclusive,t.endExclusive);if(n<=r)return new e(n,r)}intersectionLength(e){let t=Math.max(this.start,e.start),n=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,n-t)}intersects(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)}intersectsOrTouches(e){return Math.max(this.start,e.start)<=Math.min(this.endExclusive,e.endExclusive)}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new ae(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new ae(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let t=[];for(let n=this.start;n<this.endExclusive;n++)t.push(e(n));return t}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}joinRightTouching(t){if(this.endExclusive!==t.start)throw new ae(`Invalid join: ${this.toString()} and ${t.toString()}`);return new e(this.start,t.endExclusive)}withMargin(t,n){return n===void 0&&(n=t),new e(this.start-t,this.endExclusive+n)}};const iq=k(`agentPluginService`);let aq=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){this._modeKind=e,this._enabledTools=t,this._enabledSubagents=n,this._currentSessionType=r,this._promptsService=i,this._logService=a,this._labelService=o,this._configurationService=s,this._workspaceService=c,this._fileService=l,this._remoteAgentService=u,this._telemetryService=d,this._languageModelToolsService=f,this._agentPluginService=p,this._parseResults=new Ne}async _parseInstructionsFile(e,t){if(this._parseResults.has(e))return this._parseResults.get(e);try{let n=await this._promptsService.parseNew(e,t);return this._parseResults.set(e,n),n}catch(t){this._logService.error(`[InstructionsContextComputer] Failed to parse instruction file: ${e}`,t);return}}async collect(e,t){let n=performance.now(),r=await this._promptsService.getInstructionFiles(t);this._logService.trace(`[InstructionsContextComputer] ${r.length} instruction files available.`);let i=AK(),a=jK(),o=this._getContext(e);await this.addApplyingInstructions(r,o,e,i,a,t),await this._addReferencedInstructions(e,i,a,t),await this._addAgentInstructions(e,i,a,t);let s=await this._getCustomizationsIndex(r,e,i,a,t);s&&(e.add(s),i.listedInstructionsCount++),a.durationInMillis=performance.now()-n,this.sendTelemetry(i)}sendTelemetry(e){e.totalInstructionsCount=e.agentInstructionsCount+e.referencedInstructionsCount+e.applyingInstructionsCount+e.listedInstructionsCount,this._telemetryService.publicLog2(`instructionsCollected`,e)}async _logSkillLoadedTelemetry(e){try{let t=new Ne,n=this._agentPluginService.plugins.get();for(let e of n)t.set(e.uri,e);let r=e=>e===void 0?``:String(Th(e));for(let n of e){let e=n.pluginUri?t.get(n.pluginUri):void 0;this._telemetryService.publicLog2(`skillLoadedIntoContext`,{skillNameHash:r(n.name),skillStorage:n.storage,extensionIdHash:r(n.extension?.identifier.value),extensionVersion:n.extension?.version??``,pluginNameHash:r(e?.label),pluginVersion:e?.fromMarketplace?.version??``})}}catch(e){this._logService.error(`[InstructionsContextComputer] Failed to log skill telemetry`,e)}}async addApplyingInstructions(e,t,n,r,i,a){if(!this._configurationService.getValue(QK.INCLUDE_APPLYING_INSTRUCTIONS)&&this._modeKind!==uy.Edit){this._logService.trace(`[InstructionsContextComputer] includeApplyingInstructions is disabled and agent kind is not Edit. No applying instructions will be added.`);return}let o=this._currentSessionType;for(let s of e){if(a.isCancellationRequested)return;let{uri:e,pattern:c}=s;if(!MK(s.sessionTypes,o))continue;if(!c){this._logService.trace(`[InstructionsContextComputer] No pattern (applyTo / paths) found: ${e}`),i.debugDetails.push({category:`skipped`,name:to(e).toString(),uri:e,reason:x(8014,`no applyTo pattern`)});continue}let l=JK(e);if(t.instructions.has(e)){this._logService.trace(`[InstructionsContextComputer] Skipping already processed instruction file: ${e}`),i.debugDetails.push({category:`skipped`,name:to(e).toString(),uri:e,reason:x(8015,`already processed`)});continue}let u=this._matches(t.files,c);if(u){this._logService.trace(`[InstructionsContextComputer] Match for ${e} with ${u.pattern}${u.file?` for file ${u.file}`:``}`);let t=u.file?x(8017,`automatically attached as pattern {0} matches {1}`,c,this._labelService.getUriLabel(u.file,{relative:!0})):x(8016,`automatically attached as pattern is **`);n.add(gh(e,hh.Instruction,t,!0)),r.applyingInstructionsCount++,i.debugDetails.push({category:`applying`,name:to(e).toString(),uri:e,reason:t}),l&&r.claudeRulesCount++}else this._logService.trace(`[InstructionsContextComputer] No match for ${e} with ${c}`),i.debugDetails.push({category:`skipped`,name:to(e).toString(),uri:e,reason:x(8018,`applyTo '{0}' did not match any attached files`,c)})}}_getContext(e){let t=new Pe,n=new Pe;for(let r of e.asArray())if(ph(r))n.add(r.value);else{let e=dh.toUri(r);e&&t.add(e)}return{files:t,instructions:n}}async _addAgentInstructions(e,t,n,r){let i={logInfo:e=>this._logService.trace(`[InstructionsContextComputer] ${e}`)},a=await this._promptsService.listAgentInstructions(r,i),o=new bh,s=new bh;for(let{uri:e,type:r}of a){let a=gh(e,hh.Instruction,void 0,!0);o.add(a),r===FK.copilotInstructionsMd&&s.add(a),t.agentInstructionsCount++,r===FK.claudeMd&&t.claudeMdCount++,n.debugDetails.push({category:`applying`,name:to(e).toString(),uri:e,reason:x(8019,`always added`)}),i.logInfo(`Agent instruction file added: ${e.toString()}`)}if(s.length>0){await this._addReferencedInstructions(s,t,n,r);for(let t of s.asArray())e.add(t)}for(let t of o.asArray())e.add(t)}_matches(e,t){let n=xS(t,`,`),r=t=>{if(t=t.trim(),t.length!==0){if(t===`**`||t===`**/*`||t===`*`)return{pattern:t};!t.startsWith(`/`)&&!t.startsWith(`**/`)&&(t=`**/`+t);for(let n of e)if(BS(t,n.path,{ignoreCase:!0}))return{pattern:t,file:n}}};for(let e of n){let t=r(e);if(t)return t}}_getTool(e){if(!this._enabledTools)return;let t=this._languageModelToolsService.getToolByName(e);if(t&&this._enabledTools[t.id])return{tool:t,variable:`#tool:${this._languageModelToolsService.getFullReferenceName(t)}`}}async _getCustomizationsIndex(e,t,n,r,i){let a=this._getTool(`readFile`),o=this._getTool(`runInTerminal`),s=a??o,c=this._getTool(Fb.runSubagent),l=this._getTool(`skill`),u=this._currentSessionType,d=(await this._remoteAgentService.getEnvironment())?.os,f=e=>oq(e,d),p=[];if(s){let t=this._configurationService.getValue(QK.USE_NESTED_AGENT_MD)?this._promptsService.listNestedAgentMDs(i):Promise.resolve([]);p.push(`<instructions>`),p.push(`Here is a list of instruction files that contain rules for working with this codebase.`),p.push(`These files are important for understanding the codebase structure, conventions, and best practices.`),p.push(`When an instruction file applies to your task (based on its description or applyTo pattern), follow the rules specified in it.`),p.push(`If the file content is not already included in the context, use the ${s.variable} tool to read it before proceeding. Use the exact value from the <file> element as-is with the tool; do not add or remove prefixes or otherwise modify it.`),p.push(`Only load instruction files when they are relevant to the current task. Do not eagerly load all instructions upfront.`),p.push(`When modifying or creating files, check for instructions whose applyTo pattern matches the file path and follow them.`);let n=!1;for(let t of e)MK(t.sessionTypes,u)&&(p.push(`<instruction>`),p.push(`<file>${f(t.uri)}</file>`),t.description&&p.push(`<description>${t.description}</description>`),t.pattern&&p.push(`<applyTo>${t.pattern}</applyTo>`),p.push(`</instruction>`),n=!0);let a=await t;for(let{uri:e}of a){let t=this._labelService.getUriLabel(ro(e),{relative:!0}),r=t.trim().length===0?x(8020,`Instructions for the workspace`):x(8021,`Instructions for folder '{0}'`,t);p.push(`<instruction>`),p.push(`<file>${f(e)}</file>`),p.push(`<description>${r}</description>`),p.push(`</instruction>`),n=!0}n?p.push(`</instructions>`,``,``):p.length=0;let o=await this._promptsService.findAgentSkills(i),c=this._configurationService.getValue(`github.copilot.chat.agentDebugLog.fileLogging.enabled`),d=o?.filter(e=>e.description?e.disableModelInvocation?(r.debugDetails.push({category:`skipped`,name:e.name,uri:e.uri,reason:x(8023,`model invocation disabled`)}),!1):MK(e.sessionTypes,u)?!c&&e.uri.path.includes(`troubleshoot/SKILL.md`)?(r.debugDetails.push({category:`skipped`,name:e.name,uri:e.uri,reason:x(8025,`debug logging disabled`)}),!1):!0:(r.debugDetails.push({category:`skipped`,name:e.name,uri:e.uri,reason:x(8024,`session type not matched`)}),!1):(r.debugDetails.push({category:`skipped`,name:e.name,uri:e.uri,reason:x(8022,`no description for model invocation`)}),!1));if(d&&d.length>0){this._logSkillLoadedTelemetry(d);for(let e of d)r.debugDetails.push({category:`skill`,name:e.name,uri:e.uri,reason:e.storage});let e=this._configurationService.getValue(QK.USE_SKILL_ADHERENCE_PROMPT),t=l??s;p.push(`<skills>`),e?(p.push(`Skills provide specialized capabilities, domain knowledge, and refined workflows for producing high-quality outputs. Each skill folder contains tested instructions for specific domains like testing strategies, API design, or performance optimization. Multiple skills can be combined when a task spans different domains.`),l?p.push(`BLOCKING REQUIREMENT: When a skill applies to the user's request, you MUST invoke it IMMEDIATELY as your first action, BEFORE generating any other response or taking action on the task. Use ${l.variable} with the skill name to load the relevant skill(s).`):p.push(`BLOCKING REQUIREMENT: When a skill applies to the user's request, you MUST load and read the SKILL.md file IMMEDIATELY as your first action, BEFORE generating any other response or taking action on the task. Use ${s.variable} to load the relevant skill(s).`),p.push(`NEVER just mention or reference a skill in your response without actually loading it first. If a skill is relevant, load it before proceeding.`),p.push(`How to determine if a skill applies:`),p.push(`1. Review the available skills below and match their descriptions against the user's request`),p.push(`2. If any skill's domain overlaps with the task, load that skill immediately`),p.push(`3. When multiple skills apply (e.g., a flowchart in documentation), load all relevant skills`),p.push(`Examples:`),p.push(`- "Help me write unit tests for this module" -> Load the testing skill via ${t.variable} FIRST, then proceed`),p.push(`- "Optimize this slow function" -> Load the performance-profiling skill via ${t.variable} FIRST, then proceed`),p.push(`- "Add a discount code field to checkout" -> Load both the checkout-flow and form-validation skills FIRST`),p.push(`Available skills:`)):l?(p.push(`Here is a list of skills that contain domain specific knowledge on a variety of topics.`),p.push(`When a user asks you to perform a task that falls within the domain of a skill, use the ${l.variable} tool with the skill name to load it.`)):(p.push(`Here is a list of skills that contain domain specific knowledge on a variety of topics.`),p.push(`Each skill comes with a description of the topic and a file path that contains the detailed instructions.`),p.push(`When a user asks you to perform a task that falls within the domain of a skill, use the ${s.variable} tool to acquire the full instructions from the file URI.`));let n=0,i=d.length;for(let e=0;e<d.length;e++){let t=d[e],r=[`<skill>`,`<name>${t.name}</name>`];t.description&&r.push(`<description>${t.description}</description>`),r.push(`<file>${f(t.uri)}</file>`),r.push(`</skill>`);let a=r.join(`
141
- `).length+1;if(l&&n+a>15e3){i=e;break}n+=a,p.push(...r)}if(i<d.length){let e=d.slice(i),t=[],n=0;for(let r of e){let e=(t.length>0?2:0)+r.name.length;if(n+e>5e3)break;n+=e,t.push(r.name)}let r=e.length-t.length,a=t.join(`, `);p.push(r>0?`Additional skills available (invoke by name): ${a}... and ${r} more`:`Additional skills available (invoke by name): ${a}`)}p.push(`</skills>`,``,``)}}if(c){let e=!!this._configurationService.getValue(ly.GeneralPurposeAgentEnabled),t=(()=>{if(!this._enabledSubagents||this._enabledSubagents.includes(`*`))return e=>e.visibility.agentInvocable&&MK(e.sessionTypes,u);{let e=this._enabledSubagents;return t=>e.includes(t.name)&&MK(t.sessionTypes,u)}})(),a=(await this._promptsService.getCustomAgents(i)).filter(e=>e.enabled);if(e||a.length>0){p.push(`<agents>`),p.push(`Here is a list of agents that can be used when running a subagent.`),p.push(`Each agent has optionally a description with the agent's purpose and expertise. When asked to run a subagent, choose the most appropriate agent from this list.`),p.push(`Use the ${c.variable} tool with the agent name to run the subagent.`),e&&(p.push(`<agent>`),p.push(`<name>${gy}</name>`),p.push(`<description>Full-capability agent for complex multi-step tasks requiring high-quality reasoning. Has access to the same tools and capabilities as the current agent and inherits the parent agent's model and system prompt. Use for tasks that don't fit a more specialized agent.</description>`),p.push(`</agent>`));for(let e of a)t(e)?(p.push(`<agent>`),p.push(`<name>${e.name}</name>`),e.description&&p.push(`<description>${e.description}</description>`),e.argumentHint&&p.push(`<argumentHint>${e.argumentHint}</argumentHint>`),p.push(`</agent>`),r.debugDetails.push({category:`custom-agent`,name:e.name,uri:e.uri}),KK(e.uri)&&n.claudeAgentsCount++):r.debugDetails.push({category:`skipped`,name:e.name,uri:e.uri,reason:x(8026,`not invocable by model`)});p.push(`</agents>`,``,``)}}if(p.length===0)return;let m=p.join(`
142
- `),h=[],ee=e=>{if(e){let t=m.indexOf(e.variable);for(;t>=0;)h.push(yh(e.tool,new rq(t,t+e.variable.length))),t=m.indexOf(e.variable,t+1)}};return ee(s),ee(c),ee(l),vh(m,!0,h)}async _addReferencedInstructions(e,t,n,r){if(!this._configurationService.getValue(QK.INCLUDE_REFERENCED_INSTRUCTIONS)&&this._modeKind!==uy.Edit){this._logService.trace(`[InstructionsContextComputer] includeReferencedInstructions is disabled and agent kind is not Edit. No referenced instructions will be added.`);return}let i=new Pe,a=[];for(let t of e.asArray())ph(t)&&(i.has(t.value)||(a.push(t.value),i.add(t.value)));let o=a.pop();for(;o;){let s=await this._parseInstructionsFile(o,r);if(s&&s.body){let r=[];for(let e of s.body.fileReferences){let t=s.body.resolveFilePath(e.content);t&&!i.has(t)&&(XK(t)||this._workspaceService.getWorkspaceFolder(t)!==void 0)&&(r.push({resource:t}),i.add(t))}if(r.length>0){let i=await this._fileService.resolveAll(r);for(let s=0;s<i.length;s++){let c=i[s],l=r[s].resource;if(c.success&&c.stat?.isFile){XK(l)&&a.push(l);let r=x(8027,`Referenced by {0}`,to(o));e.add(gh(l,hh.InstructionReference,r,!0)),t.referencedInstructionsCount++,n.debugDetails.push({category:`referenced`,name:to(l).toString(),uri:l,reason:r}),this._logService.trace(`[InstructionsContextComputer] ${l.toString()} added, referenced by ${o.toString()}`)}}}}o=a.pop()}}};aq=A([j(4,nq),j(5,Ds),j(6,OK),j(7,Sh),j(8,gR),j(9,Vg),j(10,kK),j(11,a_),j(12,nK),j(13,iq)],aq);function oq(e,t){if(e.scheme===O.file||e.scheme===O.vscodeRemote){let n=e.fsPath;return t===void 0?n:t===Pn.Windows?n.replace(/\//g,`\\`):n.replace(/\\/g,`/`)}return e.toString()}function sq(e,t,n){let r=n.defaultChatAgent?.chatExtensionId;if(!r)return!1;let i=ys.equals(t,r),a=e.path.includes(`/github/`);return i&&a}function cq(e,t,n){if(e.storage!==NK.extension)return!1;let r=n.defaultChatAgent?.chatExtensionId;return!r||!ys.equals(e.extensionId,r)?!1:!sq(t,e.extensionId,n)}function lq(e){return{content:[{kind:`text`,value:e}]}}var uq;let dq=class extends y{static{uq=this}static{this.Id=`runSubagent`}constructor(e,t,n,r,i,a,o,s,c){super(),this.chatAgentService=e,this.chatService=t,this.languageModelToolsService=n,this.languageModelsService=r,this.logService=i,this.configurationService=a,this.promptsService=o,this.instantiationService=s,this.productService=c,this._onDidUpdateToolData=this._register(new S),this.onDidUpdateToolData=this._onDidUpdateToolData.event,this._resolvedModels=new Map,this._sessionDepth=new Map,this._register(Qn.filter(this.configurationService.onDidChangeConfiguration,e=>e.affectsConfiguration(ly.GeneralPurposeAgentEnabled))(()=>this._onDidUpdateToolData.fire()))}getToolData(){let e=this.configurationService.getValue(ly.GeneralPurposeAgentEnabled),t={prompt:{type:`string`,description:`A detailed description of the task for the agent to perform`},description:{type:`string`,description:`A short (3-5 word) description of the task`}};t.agentName={type:`string`,description:e?`Name of the agent to invoke.`:`Optional name of a specific agent to invoke. If not provided, uses the current agent.`},t.model={type:`string`,description:`Optional model for the subagent. Format: "Model Name (Vendor)", vendor is usually "copilot". Only use to enforce a specific model.`};let n=[`prompt`,`description`];e&&n.push(`agentName`);let r={type:`object`,properties:t,required:n};return{id:uq.Id,toolReferenceName:Fb.runSubagent,icon:fl.fromId(P.organization.id),displayName:x(8354,`Run Subagent`),userDescription:x(8355,`Run a task within an isolated subagent context to enable efficient organization of tasks and context window management.`),modelDescription:`Launch a new agent to handle complex, multi-step tasks autonomously. This tool is good at researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries, use this agent to perform the search for you.
143
-
144
- - Agents do not run async or in the background, you will wait for the agent's result.
145
- - When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.
146
- - Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.
147
- - The agent's outputs should generally be trusted
148
- - Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent
149
- - If the user asks for a certain agent, you MUST provide that EXACT agent name (case-sensitive) to invoke that specific agent.`,source:Ab.Internal,inputSchema:r}}async invoke(e,t,n,r){let i=e.parameters;if(this.logService.debug(`RunSubagentTool: Invoking with prompt: ${i.prompt.substring(0,100)}...`),!e.context)throw Error(`toolInvocationToken is required for this tool`);let a=this.chatService.getSession(e.context.sessionResource);if(!a)throw Error(`Chat model not found for session`);let o=a.getRequests().at(-1),s=new v;try{let t=this.chatAgentService.getDefaultAgent(hy.Chat,uy.Agent);if(!t)return lq(`Error: No default agent available`);let n=e.modelId,c=e.userSelectedTools,l,u,d,f=i.agentName,p=this.configurationService.getValue(ly.GeneralPurposeAgentEnabled),m=p&&(!f||f===`General Purpose`),h=m?gy:f;if(f&&!m)if(u=await this.getSubAgentByName(f),u){let t=this._resolvedModels.get(e.callId);if(t)this._resolvedModels.delete(e.callId),n=t.modeModelId,d=t.resolvedModelName;else{let t=this.resolveSubagentModel(u,e.modelId,i.model);n=t.modeModelId,d=t.resolvedModelName}let r=u.tools;if(r){let e=this.languageModelToolsService.toToolAndToolSetEnablementMap(r,void 0);c={};for(let[t,n]of e)Nb(t)||(c[t.id]=n)}let a=u.agentInstructions;l=a&&{name:f,content:a.content,toolReferences:this.languageModelToolsService.toToolReferences(a.toolReferences),metadata:a.metadata,isBuiltin:cq(u.source,u.uri,this.productService)}}else{this._resolvedModels.delete(e.callId);let t=p?` Additionally, you can use '${gy}' for a full-capability agent.`:``;throw Error(`Requested agent '${f}' not found. Try again with the correct agent name, or omit agentName to use the current agent.${t}`)}else{let t=this._resolvedModels.get(e.callId);if(t)this._resolvedModels.delete(e.callId),n=t.modeModelId,d=t.resolvedModelName;else{let t=this.resolveSubagentModel(void 0,e.modelId,i.model);n=t.modeModelId,d=t.resolvedModelName}}let ee=[],te=e.chatStreamToolCallId??e.callId??`subagent-${zc()}`,g=!1,ne=e=>{for(let t of e)t.kind===`textEdit`||t.kind===`notebookEdit`||t.kind===`codeblockUri`?(t.kind===`codeblockUri`&&!g&&(g=!0,a.acceptResponseProgress(o,{kind:`markdownContent`,content:new _l("```\n")})),t.kind===`codeblockUri`?a.acceptResponseProgress(o,{...t,subAgentInvocationId:te}):a.acceptResponseProgress(o,t)):t.kind===`hook`?a.acceptResponseProgress(o,{...t,subAgentInvocationId:te}):t.kind===`markdownContent`&&(g&&=(a.acceptResponseProgress(o,{kind:`markdownContent`,content:new _l(`
150
- \`\`\`
151
-
152
- `)}),!1),ee.push(t.content.value))},re=this.configurationService.getValue(ly.SubagentsAllowInvocationsFromSubagents)??!1,ie=re?5:0,ae=e.context.sessionResource.toString(),oe=this._sessionDepth.get(ae)??0,se=oe+1<=ie;c||={},c[uq.Id]!==!1&&(c[uq.Id]=se),c[yK]=!1,c.copilot_askQuestions=!1,ie>0&&this.logService.debug(`RunSubagentTool: Nested subagents enabling ${c[uq.Id]}: session ${ae}, currentDepth: ${oe}, maxDepth: ${ie}, allowInvocationsFromSubagents: ${re}`);let ce=new bh;await this.instantiationService.createInstance(aq,uy.Agent,c,void 0,sh(e.context.sessionResource)).collect(ce,r);let le;try{le=(await this.promptsService.getHooks(r))?.hooks}catch(e){this.logService.warn(`[ChatService] Failed to collect hooks:`,e)}if(u?.hooks){let e={...u.hooks};if(e[vb.Stop]){let t=e[vb.Stop];e[vb.SubagentStop]=e[vb.SubagentStop]?[...e[vb.SubagentStop],...t]:t,e[vb.Stop]=void 0}le=Sb(le,e)}let ue={sessionResource:e.context.sessionResource,requestId:e.callId??`subagent-${Date.now()}`,agentId:t.id,message:i.prompt,variables:{variables:ce.asArray()},location:hy.Chat,subAgentInvocationId:te,subAgentName:h,userSelectedModelId:n,modelConfiguration:n?this.languageModelsService.getModelConfiguration(n):void 0,userSelectedTools:c,modeInstructions:l,parentRequestId:e.chatRequestId,hooks:le,hasHooksEnabled:!!le&&Object.values(le).some(e=>e&&e.length>0)};s.add(this.languageModelToolsService.onDidInvokeTool(e=>{e.subagentInvocationId===te&&(ee.length=0)})),this._sessionDepth.set(ae,oe+1);let de;try{de=await this.chatAgentService.invokeAgent(t.id,ue,ne,[],r)}finally{let e=(this._sessionDepth.get(ae)??1)-1;e<=0?this._sessionDepth.delete(ae):this._sessionDepth.set(ae,e)}if(de?.errorDetails)return lq(`Agent error: ${de.errorDetails.message}`);let fe=ee.join(``).replace(/^\n*```\n+```\n*/g,``).trim()||`Agent completed with no output`;return e.toolSpecificData?.kind===`subagent`&&(e.toolSpecificData.result=fe,e.toolSpecificData.modelName=d),{content:[{kind:`text`,value:fe}],toolMetadata:{subAgentInvocationId:te,description:i.description,agentName:ue.subAgentName,modelName:d}}}catch(e){let t=`Error invoking subagent: ${e instanceof Error?e.message:`Unknown error`}`;return this.logService.error(t,e),lq(t)}finally{s.dispose()}}async getSubAgentByName(e){return(await this.promptsService.getCustomAgents(Pi.None)).find(t=>t.name===e&&t.enabled)}checkMultiplierConstraint(e,t){if(!t||e===t)return{exceeds:!1};let n=this.languageModelsService.lookupLanguageModel(t),r=this.languageModelsService.lookupLanguageModel(e),i=n?.multiplierNumeric,a=r?.multiplierNumeric;return i!==void 0&&a!==void 0&&a>i?{exceeds:!0,reason:`exceeds the current model's cost tier (${a}x vs ${i}x)`}:{exceeds:!1}}getAvailableModelsInfo(e){let t=this.languageModelsService.getLanguageModelIds().map(e=>({id:e,metadata:this.languageModelsService.lookupLanguageModel(e)})).filter(e=>!!e.metadata&&wx.suitableForAgentMode(e.metadata)&&e.metadata.isUserSelectable!==!1&&!e.metadata.targetChatSessionType);if(t.length===0)return`No models available.`;let n=[],r=[];for(let{id:i,metadata:a}of t){let t=wx.asQualifiedName(a);this.checkMultiplierConstraint(i,e).exceeds?r.push(t):n.push(t)}let i=[];return n.length>0&&i.push(`Available models: ${n.join(`, `)}`),r.length>0&&i.push(`Unavailable (exceeds current model's cost tier): ${r.join(`, `)}`),i.join(`. `)||`No models available.`}resolveSubagentModel(e,t,n){let r=t,i=!1;if(n){let e=this.languageModelsService.lookupLanguageModelByQualifiedName(n);if(e?.identifier)r=e.identifier,i=!0;else throw Error(`Requested model '${n}' not found. ${this.getAvailableModelsInfo(t)}`)}if(e&&!i){let t=e.model;if(t)for(let e of t){let t=this.languageModelsService.lookupLanguageModelByQualifiedName(e);if(t?.identifier){r=t.identifier;break}}}if(r){let e=this.checkMultiplierConstraint(r,t);if(e.exceeds){let n=this.languageModelsService.lookupLanguageModel(r);throw Error(`Requested model '${n?.name}' ${e.reason}. ${this.getAvailableModelsInfo(t)}`)}}let a=r?this.languageModelsService.lookupLanguageModel(r):void 0;return{modeModelId:r,resolvedModelName:a?.name}}async prepareToolInvocation(e,t){let n=e.parameters,r=this.configurationService.getValue(ly.GeneralPurposeAgentEnabled)&&(!n.agentName||n.agentName===`General Purpose`),i=n.agentName&&!r?await this.getSubAgentByName(n.agentName):void 0,a=this.resolveSubagentModel(i,e.modelId,n.model);return this._resolvedModels.set(e.toolCallId,a),{invocationMessage:n.description,toolSpecificData:{kind:`subagent`,description:n.description,agentName:r?gy:i?.name??n.agentName,prompt:n.prompt,modelName:a.resolvedModelName}}}};dq=uq=A([j(0,DK),j(1,QG),j(2,nK),j(3,EK),j(4,Ds),j(5,Sh),j(6,nq),j(7,ws),j(8,Wh)],dq);const fq=k(`chatArtifactsService`),pq={id:`setArtifacts`,toolReferenceName:`artifacts`,legacyToolReferenceFullNames:[`Set Session Artifacts`],displayName:x(8359,`Set Session Artifacts`),modelDescription:`Set the list of artifacts for the current session. Each artifact has a label and either a uri or a toolCallId+dataPartIndex reference, plus an optional type (devServer, screenshot, plan). This overwrites the entire artifact list. URIs must be fully qualified with a scheme (e.g. https://localhost:3000, file:///tmp/plan.md). To reference a screenshot or image from a previous tool result, use toolCallId and dataPartIndex instead of uri.
153
-
154
- When to use this tool:
155
- - When creating or updating a plan saved to session memory — set a plan artifact so the user can view it in the artifact panel
156
- - When taking screenshots or producing visual output — set a screenshot artifact to surface the image
157
- - When starting a dev server — set a devServer artifact with the URL so the user can access it
158
- - When producing important documents, drafts, or temporary markdown files — set an artifact to make them easily accessible
159
- - After verification steps that produce visual results — update artifacts with screenshots showing the outcome
160
-
161
- Workflow:
162
- - Prefer artifacts over printing long content inline in chat. Save content to a file or memory, then set an artifact pointing to it.
163
- - When updating plans or documents, update both the underlying file AND the artifact list.
164
- - Keep artifact labels concise and descriptive.`,canBeReferencedInPrompt:!0,source:Ab.Internal,inputSchema:{type:`object`,properties:{artifacts:{type:`array`,description:`The complete list of artifacts for this session. Overwrites any existing artifacts.`,items:{type:`object`,properties:{label:{type:`string`,description:`Display label for the artifact.`},uri:{type:`string`,description:`Fully qualified URI of the artifact (e.g. https://localhost:3000 or file:///path/to/file). Must include the scheme.`},type:{type:`string`,enum:[`devServer`,`screenshot`,`plan`],description:`The type of artifact.`}},required:[`label`]}}},required:[`artifacts`]}};let mq=class{constructor(e,t,n){this._chatArtifactsService=e,this._fileService=t,this._chatService=n}async prepareToolInvocation(e,t){return{pastTenseMessage:new _l(x(8360,`Updated session artifacts`)),presentation:Mb.Hidden}}async invoke(e,t,n,r){let i=e.parameters,a=e.context?.sessionResource;if(!a)return{content:[{kind:`text`,value:`Error: No session resource available`}]};let o=[];for(let e of i.artifacts??[]){let t=e.uri;if(t||=``,t){let e=w.parse(t);if(e.scheme!==`http`&&e.scheme!==`https`&&!await this._fileService.exists(e))throw Error(x(8361,`Artifact URI does not exist: {0}`,t))}o.push({label:e.label,uri:t,type:e.type})}let s=this._chatArtifactsService.getArtifacts(a),c=e.subAgentInvocationId;if(c){let e=this._resolveSubagentName(a,c);s.setSubagentArtifacts(c,e,o)}else s.setAgentArtifacts(o);return{content:[{kind:`text`,value:x(8362,`Set {0} artifact(s)`,o.length)}]}}_resolveSubagentName(e,t){let n=this._chatService.getSession(e);if(n)for(let e of n.getRequests()){let n=e.response;if(n){for(let e of n.response.value)if((e.kind===`toolInvocation`||e.kind===`toolInvocationSerialized`)&&e.toolCallId===t&&e.toolSpecificData?.kind===`subagent`)return e.toolSpecificData.agentName}}}};mq=A([j(0,fq),j(1,Vg),j(2,QG)],mq);const hq={type:`object`,properties:{groupName:{type:`string`,description:`Display name for the artifact group.`},onlyShowGroup:{type:`boolean`,description:`When true, show only the group header instead of individual items.`}},required:[`groupName`]},gq={type:`object`,properties:{byMimeType:{type:`object`,description:`Rules for extracting artifacts from tool results by MIME type. Maps MIME type patterns (e.g. 'image/*') to group configuration.`,additionalProperties:hq},byFilePath:{type:`object`,description:`Rules for extracting artifacts from written files by file path glob pattern. Maps glob patterns (e.g. '**/*plan*.md') to group configuration.`,additionalProperties:hq},byMemoryFilePath:{type:`object`,description:`Rules for extracting artifacts from memory tool writes by memory file path glob pattern. Maps glob patterns to group configuration.`,additionalProperties:hq}}},_q={id:`setArtifactRules`,toolReferenceName:`artifactRules`,legacyToolReferenceFullNames:[],displayName:x(8356,`Set Artifact Rules`),modelDescription:`Override the artifact extraction rules for this session. Rules control which tool results, files, and memory writes are automatically surfaced as artifacts.
165
-
166
- Provide rules as MIME type patterns, file path globs, or memory file path globs, each mapped to a group configuration with a groupName and optional onlyShowGroup flag.
167
-
168
- Examples:
169
- - byMimeType: { "image/*": { "groupName": "Screenshots", "onlyShowGroup": true } }
170
- - byFilePath: { "**/*plan*.md": { "groupName": "Plans" } }
171
- - byMemoryFilePath: { "**/*plan*.md": { "groupName": "Plans" } }
172
-
173
- This fully replaces any settings-based rules for the duration of this session.`,canBeReferencedInPrompt:!0,source:Ab.Internal,inputSchema:gq};let vq=class{constructor(e){this._chatArtifactsService=e}async prepareToolInvocation(e,t){return{pastTenseMessage:new _l(x(8357,`Updated artifact rules`)),presentation:Mb.Hidden}}async invoke(e,t,n,r){let i=e.parameters,a=e.context?.sessionResource;if(!a)return{content:[{kind:`text`,value:`Error: No session resource available`}]};let o={byMimeType:i.byMimeType,byFilePath:i.byFilePath,byMemoryFilePath:i.byMemoryFilePath};return this._chatArtifactsService.getArtifacts(a).setRuleOverrides(o),{content:[{kind:`text`,value:x(8358,`Updated artifact rules`)}]}}};vq=A([j(0,fq)],vq);const yq={id:`task_complete`,displayName:`Task Complete`,modelDescription:`Signal that the user's task is fully done. You MUST call this tool when your work is complete — whether you made code changes, answered a question, or completed any other kind of task. Provide a brief summary of what was accomplished. Do not restate the summary in your message text — it is shown to the user directly.
174
-
175
- IMPORTANT: Before calling this tool, you MUST output a brief text message summarizing what was done. The task is not complete until both your summary message AND this tool call are present.
176
-
177
- When to call:
178
- - After answering the user's question or completing a conversational request
179
- - After you have completed ALL requested changes
180
- - After verifying results: tests pass, terminal commands succeeded, tool calls returned expected output
181
-
182
- When NOT to call:
183
- - If a terminal command failed or produced unexpected output
184
- - If an MCP or external tool call returned an error
185
- - If you encountered errors you have not resolved
186
- - If there are remaining steps to complete
187
- - If you have not verified your changes work`,source:Ab.Internal,inputSchema:{type:`object`,properties:{summary:{type:`string`,description:`Brief summary of what was accomplished. Omit for trivial interactions.`}}}};var bq=class{async prepareToolInvocation(e,t){return{presentation:Mb.Hidden}}async invoke(e,t,n,r){return{content:[{kind:`text`,value:e.parameters?.summary??`All done!`}]}}};let xq=class extends y{static{this.ID=`chat.builtinTools`}constructor(e,t,n){super();let r=t.createInstance(tK);this._register(e.registerTool(eK,r));let i=this._register(t.createInstance(fK));this._register(e.registerTool(dK,i)),this._register(e.vscodeToolSet.addTool(dK));let a=this._register(t.createInstance(TK));this._register(e.registerTool(wK,a));let o=bK(),s=this._register(t.createInstance(xK));this._register(e.registerTool(o,s));let c=t.createInstance(gK);this._register(e.registerTool(pK,c)),this._register(e.registerTool(mK,c));let l=t.createInstance(_K);this._register(e.registerTool(hK,l));let u=t.createInstance(bq);this._register(e.registerTool(yq,u));let d=t.createInstance(mq),f=t.createInstance(vq),p=this._register(new vt),m=this._register(new vt),h=()=>{n.getValue(ly.ArtifactsEnabled)?(p.value||=e.registerTool(pq,d),m.value||=e.registerTool(_q,f)):(p.clear(),m.clear())};h(),this._register(n.onDidChangeConfiguration(e=>{e.affectsConfiguration(ly.ArtifactsEnabled)&&h()}));let ee=this._register(t.createInstance(dq)),te,g,ne=()=>{te?.dispose(),g?.dispose(),e.flushToolUpdates();let t=ee.getToolData();te=e.registerTool(t,ee),g=e.agentToolSet.addTool(t)};ne(),this._register(ee.onDidUpdateToolData(ne)),this._register({dispose:()=>{te?.dispose(),g?.dispose()}})}};xq=A([j(0,nK),j(1,ws),j(2,Sh)],xq);const Sq=k(`commandService`),Cq=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new S,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw Error(`invalid command`);if(typeof e==`string`){if(!t)throw Error(`invalid command`);return this.registerCommand({id:e,handler:t})}if(e.metadata&&Array.isArray(e.metadata.args)){let t=[];for(let n of e.metadata.args)t.push(n.constraint);let n=e.handler;e.handler=function(e,...r){return ot(r,t),n(e,...r)}}let{id:n}=e,r=this._commands.get(n);r||(r=new Xt,this._commands.set(n,r));let i=r.unshift(e),a=_(()=>{i(),this._commands.get(n)?.isEmpty()&&this._commands.delete(n)});return this._onDidRegisterCommand.fire(n),pt(a)}registerCommandAlias(e,t){return Cq.registerCommand(e,(e,...n)=>e.get(Sq).executeCommand(t,...n))}getCommand(e){let t=this._commands.get(e);if(!(!t||t.isEmpty()))return lt.first(t)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let n=this.getCommand(t);n&&e.set(t,n)}return e}};Cq.registerCommand(`noop`,()=>{});var Z;(function(e){e[e.DependsOnKbLayout=-1]=`DependsOnKbLayout`,e[e.Unknown=0]=`Unknown`,e[e.Backspace=1]=`Backspace`,e[e.Tab=2]=`Tab`,e[e.Enter=3]=`Enter`,e[e.Shift=4]=`Shift`,e[e.Ctrl=5]=`Ctrl`,e[e.Alt=6]=`Alt`,e[e.PauseBreak=7]=`PauseBreak`,e[e.CapsLock=8]=`CapsLock`,e[e.Escape=9]=`Escape`,e[e.Space=10]=`Space`,e[e.PageUp=11]=`PageUp`,e[e.PageDown=12]=`PageDown`,e[e.End=13]=`End`,e[e.Home=14]=`Home`,e[e.LeftArrow=15]=`LeftArrow`,e[e.UpArrow=16]=`UpArrow`,e[e.RightArrow=17]=`RightArrow`,e[e.DownArrow=18]=`DownArrow`,e[e.Insert=19]=`Insert`,e[e.Delete=20]=`Delete`,e[e.Digit0=21]=`Digit0`,e[e.Digit1=22]=`Digit1`,e[e.Digit2=23]=`Digit2`,e[e.Digit3=24]=`Digit3`,e[e.Digit4=25]=`Digit4`,e[e.Digit5=26]=`Digit5`,e[e.Digit6=27]=`Digit6`,e[e.Digit7=28]=`Digit7`,e[e.Digit8=29]=`Digit8`,e[e.Digit9=30]=`Digit9`,e[e.KeyA=31]=`KeyA`,e[e.KeyB=32]=`KeyB`,e[e.KeyC=33]=`KeyC`,e[e.KeyD=34]=`KeyD`,e[e.KeyE=35]=`KeyE`,e[e.KeyF=36]=`KeyF`,e[e.KeyG=37]=`KeyG`,e[e.KeyH=38]=`KeyH`,e[e.KeyI=39]=`KeyI`,e[e.KeyJ=40]=`KeyJ`,e[e.KeyK=41]=`KeyK`,e[e.KeyL=42]=`KeyL`,e[e.KeyM=43]=`KeyM`,e[e.KeyN=44]=`KeyN`,e[e.KeyO=45]=`KeyO`,e[e.KeyP=46]=`KeyP`,e[e.KeyQ=47]=`KeyQ`,e[e.KeyR=48]=`KeyR`,e[e.KeyS=49]=`KeyS`,e[e.KeyT=50]=`KeyT`,e[e.KeyU=51]=`KeyU`,e[e.KeyV=52]=`KeyV`,e[e.KeyW=53]=`KeyW`,e[e.KeyX=54]=`KeyX`,e[e.KeyY=55]=`KeyY`,e[e.KeyZ=56]=`KeyZ`,e[e.Meta=57]=`Meta`,e[e.ContextMenu=58]=`ContextMenu`,e[e.F1=59]=`F1`,e[e.F2=60]=`F2`,e[e.F3=61]=`F3`,e[e.F4=62]=`F4`,e[e.F5=63]=`F5`,e[e.F6=64]=`F6`,e[e.F7=65]=`F7`,e[e.F8=66]=`F8`,e[e.F9=67]=`F9`,e[e.F10=68]=`F10`,e[e.F11=69]=`F11`,e[e.F12=70]=`F12`,e[e.F13=71]=`F13`,e[e.F14=72]=`F14`,e[e.F15=73]=`F15`,e[e.F16=74]=`F16`,e[e.F17=75]=`F17`,e[e.F18=76]=`F18`,e[e.F19=77]=`F19`,e[e.F20=78]=`F20`,e[e.F21=79]=`F21`,e[e.F22=80]=`F22`,e[e.F23=81]=`F23`,e[e.F24=82]=`F24`,e[e.NumLock=83]=`NumLock`,e[e.ScrollLock=84]=`ScrollLock`,e[e.Semicolon=85]=`Semicolon`,e[e.Equal=86]=`Equal`,e[e.Comma=87]=`Comma`,e[e.Minus=88]=`Minus`,e[e.Period=89]=`Period`,e[e.Slash=90]=`Slash`,e[e.Backquote=91]=`Backquote`,e[e.BracketLeft=92]=`BracketLeft`,e[e.Backslash=93]=`Backslash`,e[e.BracketRight=94]=`BracketRight`,e[e.Quote=95]=`Quote`,e[e.OEM_8=96]=`OEM_8`,e[e.IntlBackslash=97]=`IntlBackslash`,e[e.Numpad0=98]=`Numpad0`,e[e.Numpad1=99]=`Numpad1`,e[e.Numpad2=100]=`Numpad2`,e[e.Numpad3=101]=`Numpad3`,e[e.Numpad4=102]=`Numpad4`,e[e.Numpad5=103]=`Numpad5`,e[e.Numpad6=104]=`Numpad6`,e[e.Numpad7=105]=`Numpad7`,e[e.Numpad8=106]=`Numpad8`,e[e.Numpad9=107]=`Numpad9`,e[e.NumpadMultiply=108]=`NumpadMultiply`,e[e.NumpadAdd=109]=`NumpadAdd`,e[e.NUMPAD_SEPARATOR=110]=`NUMPAD_SEPARATOR`,e[e.NumpadSubtract=111]=`NumpadSubtract`,e[e.NumpadDecimal=112]=`NumpadDecimal`,e[e.NumpadDivide=113]=`NumpadDivide`,e[e.KEY_IN_COMPOSITION=114]=`KEY_IN_COMPOSITION`,e[e.ABNT_C1=115]=`ABNT_C1`,e[e.ABNT_C2=116]=`ABNT_C2`,e[e.AudioVolumeMute=117]=`AudioVolumeMute`,e[e.AudioVolumeUp=118]=`AudioVolumeUp`,e[e.AudioVolumeDown=119]=`AudioVolumeDown`,e[e.BrowserSearch=120]=`BrowserSearch`,e[e.BrowserHome=121]=`BrowserHome`,e[e.BrowserBack=122]=`BrowserBack`,e[e.BrowserForward=123]=`BrowserForward`,e[e.MediaTrackNext=124]=`MediaTrackNext`,e[e.MediaTrackPrevious=125]=`MediaTrackPrevious`,e[e.MediaStop=126]=`MediaStop`,e[e.MediaPlayPause=127]=`MediaPlayPause`,e[e.LaunchMediaPlayer=128]=`LaunchMediaPlayer`,e[e.LaunchMail=129]=`LaunchMail`,e[e.LaunchApp2=130]=`LaunchApp2`,e[e.Clear=131]=`Clear`,e[e.MAX_VALUE=132]=`MAX_VALUE`})(Z||={});var Q;(function(e){e[e.DependsOnKbLayout=-1]=`DependsOnKbLayout`,e[e.None=0]=`None`,e[e.Hyper=1]=`Hyper`,e[e.Super=2]=`Super`,e[e.Fn=3]=`Fn`,e[e.FnLock=4]=`FnLock`,e[e.Suspend=5]=`Suspend`,e[e.Resume=6]=`Resume`,e[e.Turbo=7]=`Turbo`,e[e.Sleep=8]=`Sleep`,e[e.WakeUp=9]=`WakeUp`,e[e.KeyA=10]=`KeyA`,e[e.KeyB=11]=`KeyB`,e[e.KeyC=12]=`KeyC`,e[e.KeyD=13]=`KeyD`,e[e.KeyE=14]=`KeyE`,e[e.KeyF=15]=`KeyF`,e[e.KeyG=16]=`KeyG`,e[e.KeyH=17]=`KeyH`,e[e.KeyI=18]=`KeyI`,e[e.KeyJ=19]=`KeyJ`,e[e.KeyK=20]=`KeyK`,e[e.KeyL=21]=`KeyL`,e[e.KeyM=22]=`KeyM`,e[e.KeyN=23]=`KeyN`,e[e.KeyO=24]=`KeyO`,e[e.KeyP=25]=`KeyP`,e[e.KeyQ=26]=`KeyQ`,e[e.KeyR=27]=`KeyR`,e[e.KeyS=28]=`KeyS`,e[e.KeyT=29]=`KeyT`,e[e.KeyU=30]=`KeyU`,e[e.KeyV=31]=`KeyV`,e[e.KeyW=32]=`KeyW`,e[e.KeyX=33]=`KeyX`,e[e.KeyY=34]=`KeyY`,e[e.KeyZ=35]=`KeyZ`,e[e.Digit1=36]=`Digit1`,e[e.Digit2=37]=`Digit2`,e[e.Digit3=38]=`Digit3`,e[e.Digit4=39]=`Digit4`,e[e.Digit5=40]=`Digit5`,e[e.Digit6=41]=`Digit6`,e[e.Digit7=42]=`Digit7`,e[e.Digit8=43]=`Digit8`,e[e.Digit9=44]=`Digit9`,e[e.Digit0=45]=`Digit0`,e[e.Enter=46]=`Enter`,e[e.Escape=47]=`Escape`,e[e.Backspace=48]=`Backspace`,e[e.Tab=49]=`Tab`,e[e.Space=50]=`Space`,e[e.Minus=51]=`Minus`,e[e.Equal=52]=`Equal`,e[e.BracketLeft=53]=`BracketLeft`,e[e.BracketRight=54]=`BracketRight`,e[e.Backslash=55]=`Backslash`,e[e.IntlHash=56]=`IntlHash`,e[e.Semicolon=57]=`Semicolon`,e[e.Quote=58]=`Quote`,e[e.Backquote=59]=`Backquote`,e[e.Comma=60]=`Comma`,e[e.Period=61]=`Period`,e[e.Slash=62]=`Slash`,e[e.CapsLock=63]=`CapsLock`,e[e.F1=64]=`F1`,e[e.F2=65]=`F2`,e[e.F3=66]=`F3`,e[e.F4=67]=`F4`,e[e.F5=68]=`F5`,e[e.F6=69]=`F6`,e[e.F7=70]=`F7`,e[e.F8=71]=`F8`,e[e.F9=72]=`F9`,e[e.F10=73]=`F10`,e[e.F11=74]=`F11`,e[e.F12=75]=`F12`,e[e.PrintScreen=76]=`PrintScreen`,e[e.ScrollLock=77]=`ScrollLock`,e[e.Pause=78]=`Pause`,e[e.Insert=79]=`Insert`,e[e.Home=80]=`Home`,e[e.PageUp=81]=`PageUp`,e[e.Delete=82]=`Delete`,e[e.End=83]=`End`,e[e.PageDown=84]=`PageDown`,e[e.ArrowRight=85]=`ArrowRight`,e[e.ArrowLeft=86]=`ArrowLeft`,e[e.ArrowDown=87]=`ArrowDown`,e[e.ArrowUp=88]=`ArrowUp`,e[e.NumLock=89]=`NumLock`,e[e.NumpadDivide=90]=`NumpadDivide`,e[e.NumpadMultiply=91]=`NumpadMultiply`,e[e.NumpadSubtract=92]=`NumpadSubtract`,e[e.NumpadAdd=93]=`NumpadAdd`,e[e.NumpadEnter=94]=`NumpadEnter`,e[e.Numpad1=95]=`Numpad1`,e[e.Numpad2=96]=`Numpad2`,e[e.Numpad3=97]=`Numpad3`,e[e.Numpad4=98]=`Numpad4`,e[e.Numpad5=99]=`Numpad5`,e[e.Numpad6=100]=`Numpad6`,e[e.Numpad7=101]=`Numpad7`,e[e.Numpad8=102]=`Numpad8`,e[e.Numpad9=103]=`Numpad9`,e[e.Numpad0=104]=`Numpad0`,e[e.NumpadDecimal=105]=`NumpadDecimal`,e[e.IntlBackslash=106]=`IntlBackslash`,e[e.ContextMenu=107]=`ContextMenu`,e[e.Power=108]=`Power`,e[e.NumpadEqual=109]=`NumpadEqual`,e[e.F13=110]=`F13`,e[e.F14=111]=`F14`,e[e.F15=112]=`F15`,e[e.F16=113]=`F16`,e[e.F17=114]=`F17`,e[e.F18=115]=`F18`,e[e.F19=116]=`F19`,e[e.F20=117]=`F20`,e[e.F21=118]=`F21`,e[e.F22=119]=`F22`,e[e.F23=120]=`F23`,e[e.F24=121]=`F24`,e[e.Open=122]=`Open`,e[e.Help=123]=`Help`,e[e.Select=124]=`Select`,e[e.Again=125]=`Again`,e[e.Undo=126]=`Undo`,e[e.Cut=127]=`Cut`,e[e.Copy=128]=`Copy`,e[e.Paste=129]=`Paste`,e[e.Find=130]=`Find`,e[e.AudioVolumeMute=131]=`AudioVolumeMute`,e[e.AudioVolumeUp=132]=`AudioVolumeUp`,e[e.AudioVolumeDown=133]=`AudioVolumeDown`,e[e.NumpadComma=134]=`NumpadComma`,e[e.IntlRo=135]=`IntlRo`,e[e.KanaMode=136]=`KanaMode`,e[e.IntlYen=137]=`IntlYen`,e[e.Convert=138]=`Convert`,e[e.NonConvert=139]=`NonConvert`,e[e.Lang1=140]=`Lang1`,e[e.Lang2=141]=`Lang2`,e[e.Lang3=142]=`Lang3`,e[e.Lang4=143]=`Lang4`,e[e.Lang5=144]=`Lang5`,e[e.Abort=145]=`Abort`,e[e.Props=146]=`Props`,e[e.NumpadParenLeft=147]=`NumpadParenLeft`,e[e.NumpadParenRight=148]=`NumpadParenRight`,e[e.NumpadBackspace=149]=`NumpadBackspace`,e[e.NumpadMemoryStore=150]=`NumpadMemoryStore`,e[e.NumpadMemoryRecall=151]=`NumpadMemoryRecall`,e[e.NumpadMemoryClear=152]=`NumpadMemoryClear`,e[e.NumpadMemoryAdd=153]=`NumpadMemoryAdd`,e[e.NumpadMemorySubtract=154]=`NumpadMemorySubtract`,e[e.NumpadClear=155]=`NumpadClear`,e[e.NumpadClearEntry=156]=`NumpadClearEntry`,e[e.ControlLeft=157]=`ControlLeft`,e[e.ShiftLeft=158]=`ShiftLeft`,e[e.AltLeft=159]=`AltLeft`,e[e.MetaLeft=160]=`MetaLeft`,e[e.ControlRight=161]=`ControlRight`,e[e.ShiftRight=162]=`ShiftRight`,e[e.AltRight=163]=`AltRight`,e[e.MetaRight=164]=`MetaRight`,e[e.BrightnessUp=165]=`BrightnessUp`,e[e.BrightnessDown=166]=`BrightnessDown`,e[e.MediaPlay=167]=`MediaPlay`,e[e.MediaRecord=168]=`MediaRecord`,e[e.MediaFastForward=169]=`MediaFastForward`,e[e.MediaRewind=170]=`MediaRewind`,e[e.MediaTrackNext=171]=`MediaTrackNext`,e[e.MediaTrackPrevious=172]=`MediaTrackPrevious`,e[e.MediaStop=173]=`MediaStop`,e[e.Eject=174]=`Eject`,e[e.MediaPlayPause=175]=`MediaPlayPause`,e[e.MediaSelect=176]=`MediaSelect`,e[e.LaunchMail=177]=`LaunchMail`,e[e.LaunchApp2=178]=`LaunchApp2`,e[e.LaunchApp1=179]=`LaunchApp1`,e[e.SelectTask=180]=`SelectTask`,e[e.LaunchScreenSaver=181]=`LaunchScreenSaver`,e[e.BrowserSearch=182]=`BrowserSearch`,e[e.BrowserHome=183]=`BrowserHome`,e[e.BrowserBack=184]=`BrowserBack`,e[e.BrowserForward=185]=`BrowserForward`,e[e.BrowserStop=186]=`BrowserStop`,e[e.BrowserRefresh=187]=`BrowserRefresh`,e[e.BrowserFavorites=188]=`BrowserFavorites`,e[e.ZoomToggle=189]=`ZoomToggle`,e[e.MailReply=190]=`MailReply`,e[e.MailForward=191]=`MailForward`,e[e.MailSend=192]=`MailSend`,e[e.MAX_VALUE=193]=`MAX_VALUE`})(Q||={});var wq=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||Z.Unknown}};const Tq=new wq,Eq=new wq,Dq=new wq,Oq=Array(230),kq={},Aq=[],jq=Object.create(null),Mq=Object.create(null),Nq=[],Pq=[];for(let e=0;e<=Q.MAX_VALUE;e++)Nq[e]=Z.DependsOnKbLayout;for(let e=0;e<=Z.MAX_VALUE;e++)Pq[e]=Q.DependsOnKbLayout;(function(){let e=[[1,Q.None,`None`,Z.Unknown,`unknown`,0,`VK_UNKNOWN`,``,``],[1,Q.Hyper,`Hyper`,Z.Unknown,``,0,``,``,``],[1,Q.Super,`Super`,Z.Unknown,``,0,``,``,``],[1,Q.Fn,`Fn`,Z.Unknown,``,0,``,``,``],[1,Q.FnLock,`FnLock`,Z.Unknown,``,0,``,``,``],[1,Q.Suspend,`Suspend`,Z.Unknown,``,0,``,``,``],[1,Q.Resume,`Resume`,Z.Unknown,``,0,``,``,``],[1,Q.Turbo,`Turbo`,Z.Unknown,``,0,``,``,``],[1,Q.Sleep,`Sleep`,Z.Unknown,``,0,`VK_SLEEP`,``,``],[1,Q.WakeUp,`WakeUp`,Z.Unknown,``,0,``,``,``],[0,Q.KeyA,`KeyA`,Z.KeyA,`A`,65,`VK_A`,``,``],[0,Q.KeyB,`KeyB`,Z.KeyB,`B`,66,`VK_B`,``,``],[0,Q.KeyC,`KeyC`,Z.KeyC,`C`,67,`VK_C`,``,``],[0,Q.KeyD,`KeyD`,Z.KeyD,`D`,68,`VK_D`,``,``],[0,Q.KeyE,`KeyE`,Z.KeyE,`E`,69,`VK_E`,``,``],[0,Q.KeyF,`KeyF`,Z.KeyF,`F`,70,`VK_F`,``,``],[0,Q.KeyG,`KeyG`,Z.KeyG,`G`,71,`VK_G`,``,``],[0,Q.KeyH,`KeyH`,Z.KeyH,`H`,72,`VK_H`,``,``],[0,Q.KeyI,`KeyI`,Z.KeyI,`I`,73,`VK_I`,``,``],[0,Q.KeyJ,`KeyJ`,Z.KeyJ,`J`,74,`VK_J`,``,``],[0,Q.KeyK,`KeyK`,Z.KeyK,`K`,75,`VK_K`,``,``],[0,Q.KeyL,`KeyL`,Z.KeyL,`L`,76,`VK_L`,``,``],[0,Q.KeyM,`KeyM`,Z.KeyM,`M`,77,`VK_M`,``,``],[0,Q.KeyN,`KeyN`,Z.KeyN,`N`,78,`VK_N`,``,``],[0,Q.KeyO,`KeyO`,Z.KeyO,`O`,79,`VK_O`,``,``],[0,Q.KeyP,`KeyP`,Z.KeyP,`P`,80,`VK_P`,``,``],[0,Q.KeyQ,`KeyQ`,Z.KeyQ,`Q`,81,`VK_Q`,``,``],[0,Q.KeyR,`KeyR`,Z.KeyR,`R`,82,`VK_R`,``,``],[0,Q.KeyS,`KeyS`,Z.KeyS,`S`,83,`VK_S`,``,``],[0,Q.KeyT,`KeyT`,Z.KeyT,`T`,84,`VK_T`,``,``],[0,Q.KeyU,`KeyU`,Z.KeyU,`U`,85,`VK_U`,``,``],[0,Q.KeyV,`KeyV`,Z.KeyV,`V`,86,`VK_V`,``,``],[0,Q.KeyW,`KeyW`,Z.KeyW,`W`,87,`VK_W`,``,``],[0,Q.KeyX,`KeyX`,Z.KeyX,`X`,88,`VK_X`,``,``],[0,Q.KeyY,`KeyY`,Z.KeyY,`Y`,89,`VK_Y`,``,``],[0,Q.KeyZ,`KeyZ`,Z.KeyZ,`Z`,90,`VK_Z`,``,``],[0,Q.Digit1,`Digit1`,Z.Digit1,`1`,49,`VK_1`,``,``],[0,Q.Digit2,`Digit2`,Z.Digit2,`2`,50,`VK_2`,``,``],[0,Q.Digit3,`Digit3`,Z.Digit3,`3`,51,`VK_3`,``,``],[0,Q.Digit4,`Digit4`,Z.Digit4,`4`,52,`VK_4`,``,``],[0,Q.Digit5,`Digit5`,Z.Digit5,`5`,53,`VK_5`,``,``],[0,Q.Digit6,`Digit6`,Z.Digit6,`6`,54,`VK_6`,``,``],[0,Q.Digit7,`Digit7`,Z.Digit7,`7`,55,`VK_7`,``,``],[0,Q.Digit8,`Digit8`,Z.Digit8,`8`,56,`VK_8`,``,``],[0,Q.Digit9,`Digit9`,Z.Digit9,`9`,57,`VK_9`,``,``],[0,Q.Digit0,`Digit0`,Z.Digit0,`0`,48,`VK_0`,``,``],[1,Q.Enter,`Enter`,Z.Enter,`Enter`,13,`VK_RETURN`,``,``],[1,Q.Escape,`Escape`,Z.Escape,`Escape`,27,`VK_ESCAPE`,``,``],[1,Q.Backspace,`Backspace`,Z.Backspace,`Backspace`,8,`VK_BACK`,``,``],[1,Q.Tab,`Tab`,Z.Tab,`Tab`,9,`VK_TAB`,``,``],[1,Q.Space,`Space`,Z.Space,`Space`,32,`VK_SPACE`,``,``],[0,Q.Minus,`Minus`,Z.Minus,`-`,189,`VK_OEM_MINUS`,`-`,`OEM_MINUS`],[0,Q.Equal,`Equal`,Z.Equal,`=`,187,`VK_OEM_PLUS`,`=`,`OEM_PLUS`],[0,Q.BracketLeft,`BracketLeft`,Z.BracketLeft,`[`,219,`VK_OEM_4`,`[`,`OEM_4`],[0,Q.BracketRight,`BracketRight`,Z.BracketRight,`]`,221,`VK_OEM_6`,`]`,`OEM_6`],[0,Q.Backslash,`Backslash`,Z.Backslash,`\\`,220,`VK_OEM_5`,`\\`,`OEM_5`],[0,Q.IntlHash,`IntlHash`,Z.Unknown,``,0,``,``,``],[0,Q.Semicolon,`Semicolon`,Z.Semicolon,`;`,186,`VK_OEM_1`,`;`,`OEM_1`],[0,Q.Quote,`Quote`,Z.Quote,`'`,222,`VK_OEM_7`,`'`,`OEM_7`],[0,Q.Backquote,`Backquote`,Z.Backquote,"`",192,`VK_OEM_3`,"`",`OEM_3`],[0,Q.Comma,`Comma`,Z.Comma,`,`,188,`VK_OEM_COMMA`,`,`,`OEM_COMMA`],[0,Q.Period,`Period`,Z.Period,`.`,190,`VK_OEM_PERIOD`,`.`,`OEM_PERIOD`],[0,Q.Slash,`Slash`,Z.Slash,`/`,191,`VK_OEM_2`,`/`,`OEM_2`],[1,Q.CapsLock,`CapsLock`,Z.CapsLock,`CapsLock`,20,`VK_CAPITAL`,``,``],[1,Q.F1,`F1`,Z.F1,`F1`,112,`VK_F1`,``,``],[1,Q.F2,`F2`,Z.F2,`F2`,113,`VK_F2`,``,``],[1,Q.F3,`F3`,Z.F3,`F3`,114,`VK_F3`,``,``],[1,Q.F4,`F4`,Z.F4,`F4`,115,`VK_F4`,``,``],[1,Q.F5,`F5`,Z.F5,`F5`,116,`VK_F5`,``,``],[1,Q.F6,`F6`,Z.F6,`F6`,117,`VK_F6`,``,``],[1,Q.F7,`F7`,Z.F7,`F7`,118,`VK_F7`,``,``],[1,Q.F8,`F8`,Z.F8,`F8`,119,`VK_F8`,``,``],[1,Q.F9,`F9`,Z.F9,`F9`,120,`VK_F9`,``,``],[1,Q.F10,`F10`,Z.F10,`F10`,121,`VK_F10`,``,``],[1,Q.F11,`F11`,Z.F11,`F11`,122,`VK_F11`,``,``],[1,Q.F12,`F12`,Z.F12,`F12`,123,`VK_F12`,``,``],[1,Q.PrintScreen,`PrintScreen`,Z.Unknown,``,0,``,``,``],[1,Q.ScrollLock,`ScrollLock`,Z.ScrollLock,`ScrollLock`,145,`VK_SCROLL`,``,``],[1,Q.Pause,`Pause`,Z.PauseBreak,`PauseBreak`,19,`VK_PAUSE`,``,``],[1,Q.Insert,`Insert`,Z.Insert,`Insert`,45,`VK_INSERT`,``,``],[1,Q.Home,`Home`,Z.Home,`Home`,36,`VK_HOME`,``,``],[1,Q.PageUp,`PageUp`,Z.PageUp,`PageUp`,33,`VK_PRIOR`,``,``],[1,Q.Delete,`Delete`,Z.Delete,`Del`,46,`VK_DELETE`,`Delete`,``],[1,Q.End,`End`,Z.End,`End`,35,`VK_END`,``,``],[1,Q.PageDown,`PageDown`,Z.PageDown,`PageDown`,34,`VK_NEXT`,``,``],[1,Q.ArrowRight,`ArrowRight`,Z.RightArrow,`RightArrow`,39,`VK_RIGHT`,`Right`,``],[1,Q.ArrowLeft,`ArrowLeft`,Z.LeftArrow,`LeftArrow`,37,`VK_LEFT`,`Left`,``],[1,Q.ArrowDown,`ArrowDown`,Z.DownArrow,`DownArrow`,40,`VK_DOWN`,`Down`,``],[1,Q.ArrowUp,`ArrowUp`,Z.UpArrow,`UpArrow`,38,`VK_UP`,`Up`,``],[1,Q.NumLock,`NumLock`,Z.NumLock,`NumLock`,144,`VK_NUMLOCK`,``,``],[1,Q.NumpadDivide,`NumpadDivide`,Z.NumpadDivide,`NumPad_Divide`,111,`VK_DIVIDE`,``,``],[1,Q.NumpadMultiply,`NumpadMultiply`,Z.NumpadMultiply,`NumPad_Multiply`,106,`VK_MULTIPLY`,``,``],[1,Q.NumpadSubtract,`NumpadSubtract`,Z.NumpadSubtract,`NumPad_Subtract`,109,`VK_SUBTRACT`,``,``],[1,Q.NumpadAdd,`NumpadAdd`,Z.NumpadAdd,`NumPad_Add`,107,`VK_ADD`,``,``],[1,Q.NumpadEnter,`NumpadEnter`,Z.Enter,``,0,``,``,``],[1,Q.Numpad1,`Numpad1`,Z.Numpad1,`NumPad1`,97,`VK_NUMPAD1`,``,``],[1,Q.Numpad2,`Numpad2`,Z.Numpad2,`NumPad2`,98,`VK_NUMPAD2`,``,``],[1,Q.Numpad3,`Numpad3`,Z.Numpad3,`NumPad3`,99,`VK_NUMPAD3`,``,``],[1,Q.Numpad4,`Numpad4`,Z.Numpad4,`NumPad4`,100,`VK_NUMPAD4`,``,``],[1,Q.Numpad5,`Numpad5`,Z.Numpad5,`NumPad5`,101,`VK_NUMPAD5`,``,``],[1,Q.Numpad6,`Numpad6`,Z.Numpad6,`NumPad6`,102,`VK_NUMPAD6`,``,``],[1,Q.Numpad7,`Numpad7`,Z.Numpad7,`NumPad7`,103,`VK_NUMPAD7`,``,``],[1,Q.Numpad8,`Numpad8`,Z.Numpad8,`NumPad8`,104,`VK_NUMPAD8`,``,``],[1,Q.Numpad9,`Numpad9`,Z.Numpad9,`NumPad9`,105,`VK_NUMPAD9`,``,``],[1,Q.Numpad0,`Numpad0`,Z.Numpad0,`NumPad0`,96,`VK_NUMPAD0`,``,``],[1,Q.NumpadDecimal,`NumpadDecimal`,Z.NumpadDecimal,`NumPad_Decimal`,110,`VK_DECIMAL`,``,``],[0,Q.IntlBackslash,`IntlBackslash`,Z.IntlBackslash,`OEM_102`,226,`VK_OEM_102`,``,``],[1,Q.ContextMenu,`ContextMenu`,Z.ContextMenu,`ContextMenu`,93,``,``,``],[1,Q.Power,`Power`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadEqual,`NumpadEqual`,Z.Unknown,``,0,``,``,``],[1,Q.F13,`F13`,Z.F13,`F13`,124,`VK_F13`,``,``],[1,Q.F14,`F14`,Z.F14,`F14`,125,`VK_F14`,``,``],[1,Q.F15,`F15`,Z.F15,`F15`,126,`VK_F15`,``,``],[1,Q.F16,`F16`,Z.F16,`F16`,127,`VK_F16`,``,``],[1,Q.F17,`F17`,Z.F17,`F17`,128,`VK_F17`,``,``],[1,Q.F18,`F18`,Z.F18,`F18`,129,`VK_F18`,``,``],[1,Q.F19,`F19`,Z.F19,`F19`,130,`VK_F19`,``,``],[1,Q.F20,`F20`,Z.F20,`F20`,131,`VK_F20`,``,``],[1,Q.F21,`F21`,Z.F21,`F21`,132,`VK_F21`,``,``],[1,Q.F22,`F22`,Z.F22,`F22`,133,`VK_F22`,``,``],[1,Q.F23,`F23`,Z.F23,`F23`,134,`VK_F23`,``,``],[1,Q.F24,`F24`,Z.F24,`F24`,135,`VK_F24`,``,``],[1,Q.Open,`Open`,Z.Unknown,``,0,``,``,``],[1,Q.Help,`Help`,Z.Unknown,``,0,``,``,``],[1,Q.Select,`Select`,Z.Unknown,``,0,``,``,``],[1,Q.Again,`Again`,Z.Unknown,``,0,``,``,``],[1,Q.Undo,`Undo`,Z.Unknown,``,0,``,``,``],[1,Q.Cut,`Cut`,Z.Unknown,``,0,``,``,``],[1,Q.Copy,`Copy`,Z.Unknown,``,0,``,``,``],[1,Q.Paste,`Paste`,Z.Unknown,``,0,``,``,``],[1,Q.Find,`Find`,Z.Unknown,``,0,``,``,``],[1,Q.AudioVolumeMute,`AudioVolumeMute`,Z.AudioVolumeMute,`AudioVolumeMute`,173,`VK_VOLUME_MUTE`,``,``],[1,Q.AudioVolumeUp,`AudioVolumeUp`,Z.AudioVolumeUp,`AudioVolumeUp`,175,`VK_VOLUME_UP`,``,``],[1,Q.AudioVolumeDown,`AudioVolumeDown`,Z.AudioVolumeDown,`AudioVolumeDown`,174,`VK_VOLUME_DOWN`,``,``],[1,Q.NumpadComma,`NumpadComma`,Z.NUMPAD_SEPARATOR,`NumPad_Separator`,108,`VK_SEPARATOR`,``,``],[0,Q.IntlRo,`IntlRo`,Z.ABNT_C1,`ABNT_C1`,193,`VK_ABNT_C1`,``,``],[1,Q.KanaMode,`KanaMode`,Z.Unknown,``,0,``,``,``],[0,Q.IntlYen,`IntlYen`,Z.Unknown,``,0,``,``,``],[1,Q.Convert,`Convert`,Z.Unknown,``,0,``,``,``],[1,Q.NonConvert,`NonConvert`,Z.Unknown,``,0,``,``,``],[1,Q.Lang1,`Lang1`,Z.Unknown,``,0,``,``,``],[1,Q.Lang2,`Lang2`,Z.Unknown,``,0,``,``,``],[1,Q.Lang3,`Lang3`,Z.Unknown,``,0,``,``,``],[1,Q.Lang4,`Lang4`,Z.Unknown,``,0,``,``,``],[1,Q.Lang5,`Lang5`,Z.Unknown,``,0,``,``,``],[1,Q.Abort,`Abort`,Z.Unknown,``,0,``,``,``],[1,Q.Props,`Props`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadParenLeft,`NumpadParenLeft`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadParenRight,`NumpadParenRight`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadBackspace,`NumpadBackspace`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadMemoryStore,`NumpadMemoryStore`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadMemoryRecall,`NumpadMemoryRecall`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadMemoryClear,`NumpadMemoryClear`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadMemoryAdd,`NumpadMemoryAdd`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadMemorySubtract,`NumpadMemorySubtract`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadClear,`NumpadClear`,Z.Clear,`Clear`,12,`VK_CLEAR`,``,``],[1,Q.NumpadClearEntry,`NumpadClearEntry`,Z.Unknown,``,0,``,``,``],[1,Q.None,``,Z.Ctrl,`Ctrl`,17,`VK_CONTROL`,``,``],[1,Q.None,``,Z.Shift,`Shift`,16,`VK_SHIFT`,``,``],[1,Q.None,``,Z.Alt,`Alt`,18,`VK_MENU`,``,``],[1,Q.None,``,Z.Meta,`Meta`,91,`VK_COMMAND`,``,``],[1,Q.ControlLeft,`ControlLeft`,Z.Ctrl,``,0,`VK_LCONTROL`,``,``],[1,Q.ShiftLeft,`ShiftLeft`,Z.Shift,``,0,`VK_LSHIFT`,``,``],[1,Q.AltLeft,`AltLeft`,Z.Alt,``,0,`VK_LMENU`,``,``],[1,Q.MetaLeft,`MetaLeft`,Z.Meta,``,0,`VK_LWIN`,``,``],[1,Q.ControlRight,`ControlRight`,Z.Ctrl,``,0,`VK_RCONTROL`,``,``],[1,Q.ShiftRight,`ShiftRight`,Z.Shift,``,0,`VK_RSHIFT`,``,``],[1,Q.AltRight,`AltRight`,Z.Alt,``,0,`VK_RMENU`,``,``],[1,Q.MetaRight,`MetaRight`,Z.Meta,``,0,`VK_RWIN`,``,``],[1,Q.BrightnessUp,`BrightnessUp`,Z.Unknown,``,0,``,``,``],[1,Q.BrightnessDown,`BrightnessDown`,Z.Unknown,``,0,``,``,``],[1,Q.MediaPlay,`MediaPlay`,Z.Unknown,``,0,``,``,``],[1,Q.MediaRecord,`MediaRecord`,Z.Unknown,``,0,``,``,``],[1,Q.MediaFastForward,`MediaFastForward`,Z.Unknown,``,0,``,``,``],[1,Q.MediaRewind,`MediaRewind`,Z.Unknown,``,0,``,``,``],[1,Q.MediaTrackNext,`MediaTrackNext`,Z.MediaTrackNext,`MediaTrackNext`,176,`VK_MEDIA_NEXT_TRACK`,``,``],[1,Q.MediaTrackPrevious,`MediaTrackPrevious`,Z.MediaTrackPrevious,`MediaTrackPrevious`,177,`VK_MEDIA_PREV_TRACK`,``,``],[1,Q.MediaStop,`MediaStop`,Z.MediaStop,`MediaStop`,178,`VK_MEDIA_STOP`,``,``],[1,Q.Eject,`Eject`,Z.Unknown,``,0,``,``,``],[1,Q.MediaPlayPause,`MediaPlayPause`,Z.MediaPlayPause,`MediaPlayPause`,179,`VK_MEDIA_PLAY_PAUSE`,``,``],[1,Q.MediaSelect,`MediaSelect`,Z.LaunchMediaPlayer,`LaunchMediaPlayer`,181,`VK_MEDIA_LAUNCH_MEDIA_SELECT`,``,``],[1,Q.LaunchMail,`LaunchMail`,Z.LaunchMail,`LaunchMail`,180,`VK_MEDIA_LAUNCH_MAIL`,``,``],[1,Q.LaunchApp2,`LaunchApp2`,Z.LaunchApp2,`LaunchApp2`,183,`VK_MEDIA_LAUNCH_APP2`,``,``],[1,Q.LaunchApp1,`LaunchApp1`,Z.Unknown,``,0,`VK_MEDIA_LAUNCH_APP1`,``,``],[1,Q.SelectTask,`SelectTask`,Z.Unknown,``,0,``,``,``],[1,Q.LaunchScreenSaver,`LaunchScreenSaver`,Z.Unknown,``,0,``,``,``],[1,Q.BrowserSearch,`BrowserSearch`,Z.BrowserSearch,`BrowserSearch`,170,`VK_BROWSER_SEARCH`,``,``],[1,Q.BrowserHome,`BrowserHome`,Z.BrowserHome,`BrowserHome`,172,`VK_BROWSER_HOME`,``,``],[1,Q.BrowserBack,`BrowserBack`,Z.BrowserBack,`BrowserBack`,166,`VK_BROWSER_BACK`,``,``],[1,Q.BrowserForward,`BrowserForward`,Z.BrowserForward,`BrowserForward`,167,`VK_BROWSER_FORWARD`,``,``],[1,Q.BrowserStop,`BrowserStop`,Z.Unknown,``,0,`VK_BROWSER_STOP`,``,``],[1,Q.BrowserRefresh,`BrowserRefresh`,Z.Unknown,``,0,`VK_BROWSER_REFRESH`,``,``],[1,Q.BrowserFavorites,`BrowserFavorites`,Z.Unknown,``,0,`VK_BROWSER_FAVORITES`,``,``],[1,Q.ZoomToggle,`ZoomToggle`,Z.Unknown,``,0,``,``,``],[1,Q.MailReply,`MailReply`,Z.Unknown,``,0,``,``,``],[1,Q.MailForward,`MailForward`,Z.Unknown,``,0,``,``,``],[1,Q.MailSend,`MailSend`,Z.Unknown,``,0,``,``,``],[1,Q.None,``,Z.KEY_IN_COMPOSITION,`KeyInComposition`,229,``,``,``],[1,Q.None,``,Z.ABNT_C2,`ABNT_C2`,194,`VK_ABNT_C2`,``,``],[1,Q.None,``,Z.OEM_8,`OEM_8`,223,`VK_OEM_8`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_KANA`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_HANGUL`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_JUNJA`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_FINAL`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_HANJA`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_KANJI`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_CONVERT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_NONCONVERT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_ACCEPT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_MODECHANGE`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_SELECT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_PRINT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_EXECUTE`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_SNAPSHOT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_HELP`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_APPS`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_PROCESSKEY`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_PACKET`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_DBE_SBCSCHAR`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_DBE_DBCSCHAR`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_ATTN`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_CRSEL`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_EXSEL`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_EREOF`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_PLAY`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_ZOOM`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_NONAME`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_PA1`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_OEM_CLEAR`,``,``]],t=[],n=[];for(let r of e){let[e,i,a,o,s,c,l,u,d]=r;if(n[i]||(n[i]=!0,Aq[i]=a,jq[a]=i,Mq[a.toLowerCase()]=i,e&&(Nq[i]=o,o!==Z.Unknown&&o!==Z.Enter&&!Lq(o)&&(Pq[o]=i))),!t[o]){if(t[o]=!0,!s)throw Error(`String representation missing for key code ${o} around scan code ${a}`);Tq.define(o,s),Eq.define(o,u||s),Dq.define(o,d||u||s)}c&&(Oq[c]=o),l&&(kq[l]=o)}Pq[Z.Enter]=Q.Enter})();var Fq;(function(e){function t(e){return Tq.keyCodeToStr(e)}e.toString=t;function n(e){return Tq.strToKeyCode(e)}e.fromString=n;function r(e){return Eq.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return Dq.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return Eq.strToKeyCode(e)||Dq.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=Z.Numpad0&&e<=Z.NumpadDivide)return null;switch(e){case Z.UpArrow:return`Up`;case Z.DownArrow:return`Down`;case Z.LeftArrow:return`Left`;case Z.RightArrow:return`Right`;case Z.Delete:return`Delete`}return Tq.keyCodeToStr(e)}e.toElectronAccelerator=o})(Fq||={});var Iq;(function(e){e[e.CtrlCmd=2048]=`CtrlCmd`,e[e.Shift=1024]=`Shift`,e[e.Alt=512]=`Alt`,e[e.WinCtrl=256]=`WinCtrl`})(Iq||={});function Lq(e){return e===Z.Ctrl||e===Z.Shift||e===Z.Alt||e===Z.Meta}var Rq;(function(e){e[e.CtrlCmd=2048]=`CtrlCmd`,e[e.Shift=1024]=`Shift`,e[e.Alt=512]=`Alt`,e[e.WinCtrl=256]=`WinCtrl`,e[e.KeyCode=255]=`KeyCode`})(Rq||={});function zq(e,t){if(typeof e==`number`){if(e===0)return null;let n=(e&65535)>>>0,r=(e&4294901760)>>>16;return r===0?new Hq([Bq(n,t)]):new Hq([Bq(n,t),Bq(r,t)])}else{let n=[];for(let r=0;r<e.length;r++)n.push(Bq(e[r],t));return new Hq(n)}}function Bq(e,t){let n=!!(e&Rq.CtrlCmd),r=!!(e&Rq.WinCtrl);return new Vq(t===Pn.Macintosh?r:n,!!(e&Rq.Shift),!!(e&Rq.Alt),t===Pn.Macintosh?n:r,e&Rq.KeyCode)}var Vq=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===Z.Unknown||this.keyCode===Z.Ctrl||this.keyCode===Z.Meta||this.keyCode===Z.Alt||this.keyCode===Z.Shift}toKeybinding(){return new Hq([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===Z.Ctrl||this.shiftKey&&this.keyCode===Z.Shift||this.altKey&&this.keyCode===Z.Alt||this.metaKey&&this.keyCode===Z.Meta}},Hq=class{constructor(e){if(e.length===0)throw h(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=`;`),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}},Uq;(function(e){e[e.EditorCore=0]=`EditorCore`,e[e.EditorContrib=100]=`EditorContrib`,e[e.WorkbenchContrib=200]=`WorkbenchContrib`,e[e.BuiltinExtension=300]=`BuiltinExtension`,e[e.ExternalExtension=400]=`ExternalExtension`})(Uq||={});const Wq=new class e{constructor(){this._coreKeybindings=new Xt,this._coreKeybindingRules=new Xt,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToPlatform(e,t){if(t===Pn.Windows){if(e&&e.win)return e.win}else if(t===Pn.Macintosh){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}static bindToCurrentPlatform(t){return e.bindToPlatform(t,Fn)}registerKeybindingRule(t){let n=e.bindToCurrentPlatform(t),r=new v;if(n&&n.primary){let e=zq(n.primary,Fn);e&&r.add(this._registerDefaultKeybinding(e,t.id,t.args,t.weight,0,t.when))}if(n&&Array.isArray(n.secondary))for(let e=0,i=n.secondary.length;e<i;e++){let i=n.secondary[e],a=zq(i,Fn);a&&r.add(this._registerDefaultKeybinding(a,t.id,t.args,t.weight,-e-1,t.when))}let i=this._coreKeybindingRules.push(t);return r.add(_(()=>{i()})),r}setExtensionKeybindings(e){let t=[],n=0;for(let r of e)r.keybinding&&(t[n++]={keybinding:r.keybinding,command:r.id,commandArgs:r.args,when:r.when,weight1:r.weight,weight2:0,extensionId:r.extensionId||null,isBuiltinExtension:r.isBuiltinExtension||!1});this._extensionKeybindings=t,this._cachedMergedKeybindings=null}registerCommandAndKeybindingRule(e){return gt(this.registerKeybindingRule(e),Cq.registerCommand(e))}_registerDefaultKeybinding(e,t,n,r,i,a){let o=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:n,when:a,weight1:r,weight2:i,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,_(()=>{o(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Gq)),this._cachedMergedKeybindings.slice(0)}getDefaultKeybindingsForOS(t){let n=[];for(let r of this._coreKeybindingRules){let i=e.bindToPlatform(r,t);if(i&&i.primary){let e=zq(i.primary,t);e&&n.push({keybinding:e,command:r.id,commandArgs:r.args,when:r.when,weight1:r.weight,weight2:0,extensionId:null,isBuiltinExtension:!1})}if(i&&Array.isArray(i.secondary))for(let e=0,a=i.secondary.length;e<a;e++){let a=i.secondary[e],o=zq(a,t);o&&n.push({keybinding:o,command:r.id,commandArgs:r.args,when:r.when,weight1:r.weight,weight2:-e-1,extensionId:null,isBuiltinExtension:!1})}}return n.sort(Gq),n}};wm.add({EditorModes:`platform.keybindingsRegistry`}.EditorModes,Wq);function Gq(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.command<t.command)return-1;if(e.command>t.command)return 1}return e.weight2-t.weight2}var Kq;function qq(e){return e.command!==void 0}var Jq=class e{static{this._instances=new Map}static{this.CommandPalette=new e(`CommandPalette`)}static{this.DebugBreakpointsContext=new e(`DebugBreakpointsContext`)}static{this.DebugCallStackContext=new e(`DebugCallStackContext`)}static{this.DebugConsoleContext=new e(`DebugConsoleContext`)}static{this.DebugVariablesContext=new e(`DebugVariablesContext`)}static{this.NotebookVariablesContext=new e(`NotebookVariablesContext`)}static{this.DebugHoverContext=new e(`DebugHoverContext`)}static{this.DebugWatchContext=new e(`DebugWatchContext`)}static{this.DebugToolBar=new e(`DebugToolBar`)}static{this.DebugToolBarStop=new e(`DebugToolBarStop`)}static{this.DebugDisassemblyContext=new e(`DebugDisassemblyContext`)}static{this.DebugCallStackToolbar=new e(`DebugCallStackToolbar`)}static{this.DebugCreateConfiguration=new e(`DebugCreateConfiguration`)}static{this.DebugScopesContext=new e(`DebugScopesContext`)}static{this.EditorContext=new e(`EditorContext`)}static{this.SimpleEditorContext=new e(`SimpleEditorContext`)}static{this.EditorContent=new e(`EditorContent`)}static{this.EditorLineNumberContext=new e(`EditorLineNumberContext`)}static{this.EditorContextCopy=new e(`EditorContextCopy`)}static{this.EditorContextPeek=new e(`EditorContextPeek`)}static{this.EditorContextShare=new e(`EditorContextShare`)}static{this.EditorTitle=new e(`EditorTitle`)}static{this.EditorTitleLayout=new e(`EditorTitleLayout`)}static{this.ModalEditorTitle=new e(`ModalEditorTitle`)}static{this.ModalEditorTitleContext=new e(`ModalEditorTitleContext`)}static{this.ModalEditorEditorTitle=new e(`ModalEditorEditorTitle`)}static{this.CompactWindowEditorTitle=new e(`CompactWindowEditorTitle`)}static{this.EditorTitleRun=new e(`EditorTitleRun`)}static{this.EditorTitleContext=new e(`EditorTitleContext`)}static{this.EditorTitleContextShare=new e(`EditorTitleContextShare`)}static{this.EmptyEditorGroup=new e(`EmptyEditorGroup`)}static{this.EmptyEditorGroupContext=new e(`EmptyEditorGroupContext`)}static{this.EditorTabsBarContext=new e(`EditorTabsBarContext`)}static{this.EditorTabsBarShowTabsSubmenu=new e(`EditorTabsBarShowTabsSubmenu`)}static{this.EditorTabsBarShowTabsZenModeSubmenu=new e(`EditorTabsBarShowTabsZenModeSubmenu`)}static{this.EditorActionsPositionSubmenu=new e(`EditorActionsPositionSubmenu`)}static{this.EditorRenderWhitespaceSubmenu=new e(`EditorRenderWhitespaceSubmenu`)}static{this.EditorSplitMoveSubmenu=new e(`EditorSplitMoveSubmenu`)}static{this.ExplorerContext=new e(`ExplorerContext`)}static{this.ExplorerContextShare=new e(`ExplorerContextShare`)}static{this.ExtensionContext=new e(`ExtensionContext`)}static{this.ExtensionEditorContextMenu=new e(`ExtensionEditorContextMenu`)}static{this.GlobalActivity=new e(`GlobalActivity`)}static{this.CommandCenter=new e(`CommandCenter`)}static{this.CommandCenterCenter=new e(`CommandCenterCenter`)}static{this.LayoutControlMenuSubmenu=new e(`LayoutControlMenuSubmenu`)}static{this.LayoutControlMenu=new e(`LayoutControlMenu`)}static{this.MenubarMainMenu=new e(`MenubarMainMenu`)}static{this.MenubarAppearanceMenu=new e(`MenubarAppearanceMenu`)}static{this.MenubarDebugMenu=new e(`MenubarDebugMenu`)}static{this.MenubarEditMenu=new e(`MenubarEditMenu`)}static{this.MenubarCopy=new e(`MenubarCopy`)}static{this.MenubarFileMenu=new e(`MenubarFileMenu`)}static{this.MenubarGoMenu=new e(`MenubarGoMenu`)}static{this.MenubarHelpMenu=new e(`MenubarHelpMenu`)}static{this.MenubarLayoutMenu=new e(`MenubarLayoutMenu`)}static{this.MenubarNewBreakpointMenu=new e(`MenubarNewBreakpointMenu`)}static{this.PanelAlignmentMenu=new e(`PanelAlignmentMenu`)}static{this.PanelPositionMenu=new e(`PanelPositionMenu`)}static{this.ActivityBarPositionMenu=new e(`ActivityBarPositionMenu`)}static{this.NotificationsCenterPositionMenu=new e(`NotificationsCenterPositionMenu`)}static{this.MenubarPreferencesMenu=new e(`MenubarPreferencesMenu`)}static{this.MenubarRecentMenu=new e(`MenubarRecentMenu`)}static{this.MenubarSelectionMenu=new e(`MenubarSelectionMenu`)}static{this.MenubarShare=new e(`MenubarShare`)}static{this.MenubarSwitchEditorMenu=new e(`MenubarSwitchEditorMenu`)}static{this.MenubarSwitchGroupMenu=new e(`MenubarSwitchGroupMenu`)}static{this.MenubarTerminalMenu=new e(`MenubarTerminalMenu`)}static{this.MenubarTerminalSuggestStatusMenu=new e(`MenubarTerminalSuggestStatusMenu`)}static{this.MenubarViewMenu=new e(`MenubarViewMenu`)}static{this.MenubarHomeMenu=new e(`MenubarHomeMenu`)}static{this.OpenEditorsContext=new e(`OpenEditorsContext`)}static{this.OpenEditorsContextShare=new e(`OpenEditorsContextShare`)}static{this.ProblemsPanelContext=new e(`ProblemsPanelContext`)}static{this.SCMInputBox=new e(`SCMInputBox`)}static{this.SCMChangeContext=new e(`SCMChangeContext`)}static{this.SCMResourceContext=new e(`SCMResourceContext`)}static{this.SCMResourceContextShare=new e(`SCMResourceContextShare`)}static{this.SCMResourceFolderContext=new e(`SCMResourceFolderContext`)}static{this.SCMResourceGroupContext=new e(`SCMResourceGroupContext`)}static{this.SCMSourceControl=new e(`SCMSourceControl`)}static{this.SCMSourceControlInline=new e(`SCMSourceControlInline`)}static{this.SCMSourceControlTitle=new e(`SCMSourceControlTitle`)}static{this.SCMHistoryTitle=new e(`SCMHistoryTitle`)}static{this.SCMHistoryItemContext=new e(`SCMHistoryItemContext`)}static{this.SCMHistoryItemChangeContext=new e(`SCMHistoryItemChangeContext`)}static{this.SCMHistoryItemRefContext=new e(`SCMHistoryItemRefContext`)}static{this.SCMArtifactGroupContext=new e(`SCMArtifactGroupContext`)}static{this.SCMArtifactContext=new e(`SCMArtifactContext`)}static{this.SCMQuickDiffDecorations=new e(`SCMQuickDiffDecorations`)}static{this.SCMTitle=new e(`SCMTitle`)}static{this.SearchContext=new e(`SearchContext`)}static{this.SearchActionMenu=new e(`SearchActionContext`)}static{this.StatusBarWindowIndicatorMenu=new e(`StatusBarWindowIndicatorMenu`)}static{this.StatusBarRemoteIndicatorMenu=new e(`StatusBarRemoteIndicatorMenu`)}static{this.StickyScrollContext=new e(`StickyScrollContext`)}static{this.TestItem=new e(`TestItem`)}static{this.TestItemGutter=new e(`TestItemGutter`)}static{this.TestProfilesContext=new e(`TestProfilesContext`)}static{this.TestMessageContext=new e(`TestMessageContext`)}static{this.TestMessageContent=new e(`TestMessageContent`)}static{this.TestPeekElement=new e(`TestPeekElement`)}static{this.TestPeekTitle=new e(`TestPeekTitle`)}static{this.TestCallStack=new e(`TestCallStack`)}static{this.TestCoverageFilterItem=new e(`TestCoverageFilterItem`)}static{this.TouchBarContext=new e(`TouchBarContext`)}static{this.TitleBar=new e(`TitleBar`)}static{this.TitleBarAdjacentCenter=new e(`TitleBarAdjacentCenter`)}static{this.TitleBarContext=new e(`TitleBarContext`)}static{this.TitleBarTitleContext=new e(`TitleBarTitleContext`)}static{this.TunnelContext=new e(`TunnelContext`)}static{this.TunnelPrivacy=new e(`TunnelPrivacy`)}static{this.TunnelProtocol=new e(`TunnelProtocol`)}static{this.TunnelPortInline=new e(`TunnelInline`)}static{this.TunnelTitle=new e(`TunnelTitle`)}static{this.TunnelLocalAddressInline=new e(`TunnelLocalAddressInline`)}static{this.TunnelOriginInline=new e(`TunnelOriginInline`)}static{this.ViewItemContext=new e(`ViewItemContext`)}static{this.ViewContainerTitle=new e(`ViewContainerTitle`)}static{this.ViewContainerTitleContext=new e(`ViewContainerTitleContext`)}static{this.ViewTitle=new e(`ViewTitle`)}static{this.ViewTitleContext=new e(`ViewTitleContext`)}static{this.CommentEditorActions=new e(`CommentEditorActions`)}static{this.CommentThreadTitle=new e(`CommentThreadTitle`)}static{this.CommentThreadActions=new e(`CommentThreadActions`)}static{this.CommentThreadAdditionalActions=new e(`CommentThreadAdditionalActions`)}static{this.CommentThreadTitleContext=new e(`CommentThreadTitleContext`)}static{this.CommentThreadCommentContext=new e(`CommentThreadCommentContext`)}static{this.CommentTitle=new e(`CommentTitle`)}static{this.CommentActions=new e(`CommentActions`)}static{this.CommentsViewThreadActions=new e(`CommentsViewThreadActions`)}static{this.InteractiveToolbar=new e(`InteractiveToolbar`)}static{this.InteractiveCellTitle=new e(`InteractiveCellTitle`)}static{this.InteractiveCellDelete=new e(`InteractiveCellDelete`)}static{this.InteractiveCellExecute=new e(`InteractiveCellExecute`)}static{this.InteractiveInputExecute=new e(`InteractiveInputExecute`)}static{this.InteractiveInputConfig=new e(`InteractiveInputConfig`)}static{this.ReplInputExecute=new e(`ReplInputExecute`)}static{this.IssueReporter=new e(`IssueReporter`)}static{this.NotebookToolbar=new e(`NotebookToolbar`)}static{this.NotebookToolbarContext=new e(`NotebookToolbarContext`)}static{this.NotebookStickyScrollContext=new e(`NotebookStickyScrollContext`)}static{this.NotebookCellTitle=new e(`NotebookCellTitle`)}static{this.NotebookCellDelete=new e(`NotebookCellDelete`)}static{this.NotebookCellInsert=new e(`NotebookCellInsert`)}static{this.NotebookCellBetween=new e(`NotebookCellBetween`)}static{this.NotebookCellListTop=new e(`NotebookCellTop`)}static{this.NotebookCellExecute=new e(`NotebookCellExecute`)}static{this.NotebookCellExecuteGoTo=new e(`NotebookCellExecuteGoTo`)}static{this.NotebookCellExecutePrimary=new e(`NotebookCellExecutePrimary`)}static{this.NotebookDiffCellInputTitle=new e(`NotebookDiffCellInputTitle`)}static{this.NotebookDiffDocumentMetadata=new e(`NotebookDiffDocumentMetadata`)}static{this.NotebookDiffCellMetadataTitle=new e(`NotebookDiffCellMetadataTitle`)}static{this.NotebookDiffCellOutputsTitle=new e(`NotebookDiffCellOutputsTitle`)}static{this.NotebookOutputToolbar=new e(`NotebookOutputToolbar`)}static{this.NotebookOutlineFilter=new e(`NotebookOutlineFilter`)}static{this.NotebookOutlineActionMenu=new e(`NotebookOutlineActionMenu`)}static{this.NotebookEditorLayoutConfigure=new e(`NotebookEditorLayoutConfigure`)}static{this.NotebookKernelSource=new e(`NotebookKernelSource`)}static{this.BulkEditTitle=new e(`BulkEditTitle`)}static{this.BulkEditContext=new e(`BulkEditContext`)}static{this.TimelineItemContext=new e(`TimelineItemContext`)}static{this.TimelineTitle=new e(`TimelineTitle`)}static{this.TimelineTitleContext=new e(`TimelineTitleContext`)}static{this.TimelineFilterSubMenu=new e(`TimelineFilterSubMenu`)}static{this.AccountsContext=new e(`AccountsContext`)}static{this.SidebarTitle=new e(`SidebarTitle`)}static{this.PanelTitle=new e(`PanelTitle`)}static{this.AuxiliaryBarTitle=new e(`AuxiliaryBarTitle`)}static{this.TerminalInstanceContext=new e(`TerminalInstanceContext`)}static{this.TerminalEditorInstanceContext=new e(`TerminalEditorInstanceContext`)}static{this.TerminalNewDropdownContext=new e(`TerminalNewDropdownContext`)}static{this.TerminalTabContext=new e(`TerminalTabContext`)}static{this.TerminalTabEmptyAreaContext=new e(`TerminalTabEmptyAreaContext`)}static{this.TerminalStickyScrollContext=new e(`TerminalStickyScrollContext`)}static{this.WebviewContext=new e(`WebviewContext`)}static{this.InlineCompletionsActions=new e(`InlineCompletionsActions`)}static{this.InlineEditsActions=new e(`InlineEditsActions`)}static{this.NewFile=new e(`NewFile`)}static{this.MergeInput1Toolbar=new e(`MergeToolbar1Toolbar`)}static{this.MergeInput2Toolbar=new e(`MergeToolbar2Toolbar`)}static{this.MergeBaseToolbar=new e(`MergeBaseToolbar`)}static{this.MergeInputResultToolbar=new e(`MergeToolbarResultToolbar`)}static{this.InlineSuggestionToolbar=new e(`InlineSuggestionToolbar`)}static{this.InlineEditToolbar=new e(`InlineEditToolbar`)}static{this.ChatContext=new e(`ChatContext`)}static{this.ChatCodeBlock=new e(`ChatCodeblock`)}static{this.ChatCompareBlock=new e(`ChatCompareBlock`)}static{this.ChatMessageTitle=new e(`ChatMessageTitle`)}static{this.ChatWelcomeContext=new e(`ChatWelcomeContext`)}static{this.ChatMessageFooter=new e(`ChatMessageFooter`)}static{this.ChatExecute=new e(`ChatExecute`)}static{this.ChatExecuteQueue=new e(`ChatExecuteQueue`)}static{this.ChatInput=new e(`ChatInput`)}static{this.ChatInputSecondary=new e(`ChatInputSecondary`)}static{this.ChatInputStatus=new e(`ChatInputStatus`)}static{this.ChatInputSide=new e(`ChatInputSide`)}static{this.ChatModePicker=new e(`ChatModePicker`)}static{this.ChatEditingWidgetToolbar=new e(`ChatEditingWidgetToolbar`)}static{this.ChatEditingSessionChangesToolbar=new e(`ChatEditingSessionChangesToolbar`)}static{this.ChatEditingSessionTitleToolbar=new e(`ChatEditingSessionTitleToolbar`)}static{this.ChatEditingSessionChangesVersionsSubmenu=new e(`ChatEditingSessionChangesVersionsSubmenu`)}static{this.ChatEditingSessionChangesFileHeaderToolbar=new e(`ChatEditingSessionChangesFileHeaderToolbar`)}static{this.ChatEditingSessionChangesFileHeaderRightToolbar=new e(`ChatEditingSessionChangesFileHeaderRightToolbar`)}static{this.ChatEditingEditorContent=new e(`ChatEditingEditorContent`)}static{this.ChatEditingEditorHunk=new e(`ChatEditingEditorHunk`)}static{this.ChatEditingDeletedNotebookCell=new e(`ChatEditingDeletedNotebookCell`)}static{this.ChatInputAttachmentToolbar=new e(`ChatInputAttachmentToolbar`)}static{this.ChatEditingWidgetModifiedFilesToolbar=new e(`ChatEditingWidgetModifiedFilesToolbar`)}static{this.ChatInputResourceAttachmentContext=new e(`ChatInputResourceAttachmentContext`)}static{this.ChatInputSymbolAttachmentContext=new e(`ChatInputSymbolAttachmentContext`)}static{this.ChatInlineResourceAnchorContext=new e(`ChatInlineResourceAnchorContext`)}static{this.ChatInlineSymbolAnchorContext=new e(`ChatInlineSymbolAnchorContext`)}static{this.ChatMessageCheckpoint=new e(`ChatMessageCheckpoint`)}static{this.ChatMessageRestoreCheckpoint=new e(`ChatMessageRestoreCheckpoint`)}static{this.ChatNewMenu=new e(`ChatNewMenu`)}static{this.ChatEditingCodeBlockContext=new e(`ChatEditingCodeBlockContext`)}static{this.ChatTitleBarMenu=new e(`ChatTitleBarMenu`)}static{this.ChatAttachmentsContext=new e(`ChatAttachmentsContext`)}static{this.ChatTipContext=new e(`ChatTipContext`)}static{this.ChatTipToolbar=new e(`ChatTipToolbar`)}static{this.ChatToolOutputResourceToolbar=new e(`ChatToolOutputResourceToolbar`)}static{this.ChatTextEditorMenu=new e(`ChatTextEditorMenu`)}static{this.ChatToolOutputResourceContext=new e(`ChatToolOutputResourceContext`)}static{this.ChatMultiDiffContext=new e(`ChatMultiDiffContext`)}static{this.ChatConfirmationMenu=new e(`ChatConfirmationMenu`)}static{this.ChatEditorInlineMenu=new e(`ChatEditorInlineGutter`)}static{this.ChatEditorInlineExecute=new e(`ChatEditorInputExecute`)}static{this.ChatEditorInlineInputSide=new e(`ChatEditorInputSide`)}static{this.InlineChatEditorAffordance=new e(`InlineChatEditorAffordance`)}static{this.AccessibleView=new e(`AccessibleView`)}static{this.MultiDiffEditorContent=new e(`MultiDiffEditorContent`)}static{this.MultiDiffEditorFileToolbar=new e(`MultiDiffEditorFileToolbar`)}static{this.DiffEditorHunkToolbar=new e(`DiffEditorHunkToolbar`)}static{this.DiffEditorSelectionToolbar=new e(`DiffEditorSelectionToolbar`)}static{this.BrowserNavigationToolbar=new e(`BrowserNavigationToolbar`)}static{this.BrowserActionsToolbar=new e(`BrowserActionsToolbar`)}static{this.BrowserChatActionsMenu=new e(`BrowserChatActionsMenu`)}static{this.BrowserEmulationToolbar=new e(`BrowserEmulationToolbar`)}static{this.AgentSessionsViewerFilterSubMenu=new e(`AgentSessionsViewerFilterSubMenu`)}static{this.AgentSessionsContext=new e(`AgentSessionsContext`)}static{this.AgentSessionSectionContext=new e(`AgentSessionSectionContext`)}static{this.AgentSessionsCreateSubMenu=new e(`AgentSessionsCreateSubMenu`)}static{this.AgentSessionsToolbar=new e(`AgentSessionsToolbar`)}static{this.AgentSessionItemToolbar=new e(`AgentSessionItemToolbar`)}static{this.AgentSessionSectionToolbar=new e(`AgentSessionSectionToolbar`)}static{this.SessionItemContextMenu=new e(`SessionItemContextMenu`)}static{this.SessionHeaderContext=new e(`SessionsSessionHeaderContext`)}static{this.AgentsTitleBarControlMenu=new e(`AgentsTitleBarControlMenu`)}static{this.AgentsChangesToolbar=new e(`AgentsChangesToolbar`)}static{this.AgentsChangesPrimaryActionSubMenu=new e(`AgentsChangesPrimaryActionSubMenu`)}static{this.AgentsChangeInlineToolbar=new e(`AgentsChangeInlineToolbar`)}static{this.ChatViewSessionTitleNavigationToolbar=new e(`ChatViewSessionTitleNavigationToolbar`)}static{this.ChatViewSessionTitleToolbar=new e(`ChatViewSessionTitleToolbar`)}static{this.ChatContextUsageActions=new e(`ChatContextUsageActions`)}static{this.MarkerHoverStatusBar=new e(`MarkerHoverParticipant.StatusBar`)}static for(t){return e._instances.get(t)??new e(t)}constructor(t){if(e._instances.has(t))throw TypeError(`MenuId with identifier '${t}' already exists. Use MenuId.for(ident) or a unique identifier`);e._instances.set(t,this),this.id=t}},Yq=class e{static{this._all=new Map}static for(t){let n=this._all.get(t);return n||(n=new e(t),this._all.set(t,n)),n}static merge(t){let n=new Set;for(let r of t)r instanceof e&&n.add(r.id);return n}constructor(e){this.id=e,this.has=t=>t===e}};new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new dr({merge:Yq.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(Yq.for(Jq.CommandPalette)),pt(_(()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(Yq.for(Jq.CommandPalette))}))}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;return this._commands.forEach((t,n)=>e.set(n,t)),e}appendMenuItem(e,t){let n=this._menuItems.get(e);n||(n=new Xt,this._menuItems.set(e,n));let r=n.push(t);return this._onDidChangeMenu.fire(Yq.for(e)),pt(_(()=>{r(),this._onDidChangeMenu.fire(Yq.for(e))}))}appendMenuItems(e){let t=new v;for(let{id:n,item:r}of e)t.add(this.appendMenuItem(n,r));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===Jq.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){let t=new Set;for(let n of e)qq(n)&&(t.add(n.command.id),n.alt&&t.add(n.alt.id));this._commands.forEach((n,r)=>{t.has(r)||e.push({command:n})})}};let Xq=Kq=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle==`string`?e.shortTitle:e.shortTitle.value:typeof e.title==`string`?e.title:e.title.value}constructor(e,t,n,r,i,a,o){this.hideActions=r,this.menuKeybinding=i,this._commandService=o,this.id=e.id,this.label=Kq.label(e,n),this.tooltip=(typeof e.tooltip==`string`?e.tooltip:e.tooltip?.value)??``,this.enabled=!e.precondition||a.contextMatchesRules(e.precondition),this.checked=void 0;let s;if(e.toggled){let t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=a.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip=typeof t.tooltip==`string`?t.tooltip:t.tooltip.value),this.checked&&fl.isThemeIcon(t.icon)&&(s=t.icon),this.checked&&t.title&&(this.label=typeof t.title==`string`?t.title:t.title.value)}s||=fl.isThemeIcon(e.icon)?e.icon:void 0,this.item=e,this.alt=t?new Kq(t,void 0,n,r,void 0,a,o):void 0,this._options=n,this.class=s&&fl.asClassName(s)}run(...e){let t=[];return this._options?.args?t=[...t,...this._options.args]:this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};Xq=Kq=A([j(5,Ch),j(6,Sq)],Xq);var Zq;(function(e){e.ExtensionQueryService=`ExtensionQueryService`,e.ExtensionLatestVersionUri=`ExtensionLatestVersionUriTemplate`,e.ExtensionStatisticsUri=`ExtensionStatisticsUriTemplate`,e.PublisherViewUri=`PublisherViewUriTemplate`,e.ExtensionDetailsViewUri=`ExtensionDetailsViewUriTemplate`,e.ExtensionRatingViewUri=`ExtensionRatingViewUriTemplate`,e.ExtensionResourceUri=`ExtensionResourceUriTemplate`,e.ContactSupportUri=`ContactSupportUri`})(Zq||={});var Qq;(function(e){e.None=`None`,e.IncludeVersions=`IncludeVersions`,e.IncludeFiles=`IncludeFiles`,e.IncludeCategoryAndTags=`IncludeCategoryAndTags`,e.IncludeSharedAccounts=`IncludeSharedAccounts`,e.IncludeVersionProperties=`IncludeVersionProperties`,e.ExcludeNonValidated=`ExcludeNonValidated`,e.IncludeInstallationTargets=`IncludeInstallationTargets`,e.IncludeAssetUri=`IncludeAssetUri`,e.IncludeStatistics=`IncludeStatistics`,e.IncludeLatestVersionOnly=`IncludeLatestVersionOnly`,e.Unpublished=`Unpublished`,e.IncludeNameConflictInfo=`IncludeNameConflictInfo`,e.IncludeLatestPrereleaseAndStableVersionOnly=`IncludeLatestPrereleaseAndStableVersionOnly`})(Qq||={});var $q;(function(e){e.Available=`available`,e.RequiresSignIn=`requiresSignIn`,e.AccessDenied=`accessDenied`,e.Unavailable=`unavailable`})($q||={});const eJ=k(`extensionsWorkbenchService`);nn(10236,`Extensions`);var tJ;(function(e){e[e.Installing=0]=`Installing`,e[e.Installed=1]=`Installed`,e[e.Uninstalling=2]=`Uninstalling`,e[e.Uninstalled=3]=`Uninstalled`})(tJ||={});var nJ;(function(e){e.ReloadWindow=`reloadWindow`,e.RestartExtensions=`restartExtensions`,e.DownloadUpdate=`downloadUpdate`,e.ApplyUpdate=`applyUpdate`,e.QuitAndInstall=`quitAndInstall`})(nJ||={});var rJ;(function(e){e.Readme=`readme`,e.Features=`features`,e.Changelog=`changelog`,e.Dependencies=`dependencies`,e.ExtensionPack=`extensionPack`})(rJ||={});let iJ=class extends y{constructor(e,t){super(),this.containers=e,this._register(t.onChange(this.update,this))}set extension(e){this.containers.forEach(t=>t.extension=e)}update(e){for(let t of this.containers)e&&t.extension?Cw(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};iJ=A([j(1,eJ)],iJ),new I(`defaultExtensionViews`,!0),new I(`hasOutdatedExtensions`,!1),new I(`hasGallery`,!1),new I(`extensionsGalleryStatus`,$q.Unavailable),new I(`extensionResultListFocused `,!0),new I(`searchMcpServers`,!1),new I(`searchAgentPlugins`,!1),new Jq(`extensionsSearchActionsMenu`),new Jq(`extensionsFilterSubMenu`),fl.fromId(P.extensions.id),x(10249,`Search Extensions`),x(10250,`Search for VS Code extensions`),Ab.Internal;let aJ=class{constructor(e){this.extensionWorkbenchService=e}async invoke(e,t,n,r){let i=e.parameters;if(!i.keywords?.length&&!i.category&&!i.ids?.length)return{content:[{kind:`text`,value:x(10251,`Please provide a category or keywords or ids to search for.`)}]};let a=new Map,o=e=>{for(let t of e)t.deprecationInfo||t.isMalicious||a.set(t.identifier.id.toLowerCase(),{id:t.identifier.id,name:t.displayName,description:t.description,installed:t.state===tJ.Installed,installCount:t.installCount??0,rating:t.rating??0,categories:t.categories??[],tags:t.gallery?.tags??[]})},s=async e=>{let t=await this.extensionWorkbenchService.queryGallery({text:e,pageSize:10,sortBy:qb.InstallCount},r);t.firstPage.length&&o(t.firstPage)};if(i.ids?.length&&o(await this.extensionWorkbenchService.getExtensions(i.ids.map(e=>({id:e})),r)),i.keywords?.length)for(let e of i.keywords??[])if(e===`featured`)await s(`featured`);else{let t=i.category?`category:"${i.category}"`:``;t=e?`${t} ${e}`.trim():t,await s(t)}else await s(`category:"${i.category}"`);let c=Array.from(a.values());return{content:[{kind:`text`,value:`Here are the list of extensions:\n${JSON.stringify(c)}\n. Important: Use the following format to display extensions to the user because there is a renderer available to parse these extensions in this format and display them with all details. So, do not describe about the extensions to the user.\n\`\`\`vscode-extensions\nextensionId1,extensionId2\n\`\`\`\n.`}],toolResultDetails:{input:JSON.stringify(i),output:[{type:`embed`,isText:!0,value:JSON.stringify(c.map(e=>e.id))}]}}}};aJ=A([j(0,eJ)],aJ);var oJ=class{constructor(e){this._data=e}update(e){this._data=e,this._apiObject=void 0,this._apiObjectWithChatParticipantAdditions=void 0}get data(){return this._data}get apiObject(){return this._apiObject||=Object.freeze({name:this._data.id,description:this._data.modelDescription,inputSchema:this._data.inputSchema,tags:this._data.tags??[],source:void 0}),this._apiObject}get apiObjectWithChatParticipantAdditions(){return this._apiObjectWithChatParticipantAdditions||=Object.freeze({name:this._data.id,description:this._data.modelDescription,inputSchema:this._data.inputSchema,tags:this._data.tags??[],source:jN.to(this._data.source),fullReferenceName:this._data.fullReferenceName}),this._apiObjectWithChatParticipantAdditions}},sJ=class{constructor(e,t){this._languageModels=t,this._registeredTools=new Map,this._tokenCountFuncs=new Map,this._allTools=new Map,this._proxy=e.getProxy(E.MainThreadLanguageModelTools),this._proxy.$getTools().then(e=>{for(let t of e)this._allTools.set(t.id,new oJ(Hu(t)))})}async $countTokensForInvocation(e,t,n){let r=this._tokenCountFuncs.get(e);if(!r)throw Error(`Tool invocation call ${e} not found`);return await r(t,n)}async invokeTool(e,t,n,r){let i=typeof t==`string`?t:t.name,a=zc();n.tokenizationOptions&&this._tokenCountFuncs.set(a,n.tokenizationOptions.countTokens);try{if(n.toolInvocationToken&&!jb(n.toolInvocationToken))throw Error(`Invalid tool invocation token`);if((i===`vscode_editFile_internal`||i===`vscode_editFile`)&&!Dw(e,`chatParticipantPrivate`))throw Error(`Invalid tool: ${i}`);let t=await this._proxy.$invokeTool({toolId:i,callId:a,parameters:n.input,tokenBudget:n.tokenizationOptions?.tokenBudget,context:n.toolInvocationToken,chatRequestId:Dw(e,`chatParticipantPrivate`)?n.chatRequestId:void 0,chatInteractionId:Dw(e,`chatParticipantPrivate`)?n.chatInteractionId:void 0,subAgentInvocationId:Dw(e,`chatParticipantPrivate`)?n.subAgentInvocationId:void 0,chatStreamToolCallId:Dw(e,`chatParticipantAdditions`)?n.chatStreamToolCallId:void 0,preToolUseResult:Dw(e,`chatParticipantPrivate`)?n.preToolUseResult:void 0,traceparent:Dw(e,`chatParticipantPrivate`)?n.traceparent:void 0,tracestate:Dw(e,`chatParticipantPrivate`)?n.tracestate:void 0},r),o=t instanceof _i?t.value:t;return MN.to(Hu(o))}finally{this._tokenCountFuncs.delete(a)}}$onDidChangeTools(e){let t=new Set(this._allTools.keys());for(let n of e){t.delete(n.id);let e=this._allTools.get(n.id);e?e.update(n):this._allTools.set(n.id,new oJ(Hu(n)))}for(let e of t)this._allTools.delete(e)}getTools(e){let t=Dw(e);return Array.from(this._allTools.values()).map(e=>t?e.apiObjectWithChatParticipantAdditions:e.apiObject).filter(t=>{switch(t.name){case $G:case`vscode_editFile`:case`vscode_fetchWebPage_internal`:case`vscode_searchExtensions_internal`:return Dw(e);default:return!0}})}async $invokeTool(e,t){let n=this._registeredTools.get(e.toolId);if(!n)throw Error(`Unknown tool ${e.toolId}`);let r={input:e.parameters,toolInvocationToken:Hu(e.context)};Dw(n.extension)&&(r.chatRequestId=e.chatRequestId,r.chatInteractionId=e.chatInteractionId,r.chatSessionResource=w.revive(e.context?.sessionResource),r.workingDirectory=w.revive(e.context?.workingDirectory),r.subAgentInvocationId=e.subAgentInvocationId,r.traceparent=e.traceparent,r.tracestate=e.tracestate),Dw(n.extension)&&e.modelId&&(r.model=await this.getModel(e.modelId,n.extension)),Dw(n.extension)&&e.chatStreamToolCallId&&(r.chatStreamToolCallId=e.chatStreamToolCallId),e.tokenBudget!==void 0&&(r.tokenizationOptions={tokenBudget:e.tokenBudget,countTokens:this._tokenCountFuncs.get(e.callId)||((t,n=Pi.None)=>this._proxy.$countTokensForInvocation(e.callId,t,n))});let i;if(Dw(n.extension)){let t;i={report:n=>{n.increment!==void 0&&(t=(t??0)+n.increment),this._proxy.$acceptToolProgress(e.callId,{message:Y.fromStrict(n.message),progress:t===void 0?void 0:t/100})}}}let a=await mo(Promise.resolve(n.tool.invoke(r,t,i)),t);if(!a)throw new f;return MN.from(a,n.extension)}async getModel(e,t){let n;if(e&&(n=await this._languageModels.getLanguageModelByIdentifier(t,e)),!n&&(n=await this._languageModels.getDefaultLanguageModel(t),!n))throw Error(`Language model unavailable`);return n}async $handleToolStream(e,t,n){let r=this._registeredTools.get(e);if(!r)throw Error(`Unknown tool ${e}`);if(!r.tool.handleToolStream)return;K(r.extension,`chatParticipantAdditions`);let i={rawInput:t.rawInput,chatRequestId:t.chatRequestId,chatSessionResource:t.chatSessionResource,chatInteractionId:t.chatInteractionId},a=await r.tool.handleToolStream(i,n);if(a)return{invocationMessage:Y.fromStrict(a.invocationMessage)}}async $prepareToolInvocation(e,t,n){let r=this._registeredTools.get(e);if(!r)throw Error(`Unknown tool ${e}`);let i={input:t.parameters,chatRequestId:t.chatRequestId,chatSessionResource:t.chatSessionResource,chatInteractionId:t.chatInteractionId,workingDirectory:w.revive(t.workingDirectory),forceConfirmationReason:t.forceConfirmationReason};if(t.forceConfirmationReason&&K(r.extension,`chatParticipantPrivate`),r.tool.prepareInvocation){let a=await r.tool.prepareInvocation(i,n);if(!a)return;(a.pastTenseMessage||a.presentation)&&K(r.extension,`chatParticipantPrivate`),a.confirmationMessages?.approveCombination!==void 0&&K(r.extension,`toolInvocationApproveCombination`);let o=a.confirmationMessages?.approveCombination,s=o?Y.fromStrict(o.message):void 0,c=s?await YG(e,t.parameters):void 0;return{confirmationMessages:a.confirmationMessages?{title:typeof a.confirmationMessages.title==`string`?a.confirmationMessages.title:Y.from(a.confirmationMessages.title),message:typeof a.confirmationMessages.message==`string`?a.confirmationMessages.message:Y.from(a.confirmationMessages.message),approveCombination:s&&c?{label:s,key:c,arguments:o.arguments}:void 0}:void 0,invocationMessage:Y.fromStrict(a.invocationMessage),pastTenseMessage:Y.fromStrict(a.pastTenseMessage),presentation:a.presentation}}}registerTool(e,t,n){return this._registeredTools.set(t,{extension:e,tool:n}),this._proxy.$registerTool(t,typeof n.handleToolStream==`function`),_(()=>{this._registeredTools.delete(t),this._proxy.$unregisterTool(t)})}registerToolDefinition(e,t,n){K(e,`languageModelToolSupportsModel`);let r=t.name,i={id:r,displayName:t.displayName,toolReferenceName:t.toolReferenceName,userDescription:t.userDescription,modelDescription:t.description,inputSchema:t.inputSchema,source:{type:`extension`,label:e.displayName??e.name,extensionId:e.identifier},icon:NN.from(t.icon),models:t.models,toolSet:t.toolSet};return this._registeredTools.set(r,{extension:e,tool:n}),this._proxy.$registerToolWithDefinition(e.identifier,i,typeof n.handleToolStream==`function`),_(()=>{this._registeredTools.delete(r),this._proxy.$unregisterTool(r)})}},cJ=class{constructor(e,t,n,r){this._documents=t,this._commands=n,this._uriTransformer=r,this._languageIds=[],this._handlePool=0,this._ids=new Set,this._proxy=e.getProxy(E.MainThreadLanguages)}$acceptLanguageIds(e){this._languageIds=e}async getLanguages(){return this._languageIds.slice(0)}async changeLanguage(e,t){await this._proxy.$changeLanguage(e,t);let n=this._documents.getDocumentData(e);if(!n)throw Error(`document '${e.toString()}' NOT found`);return n.document}async tokenAtPosition(e,t){let n=e.version,r=sj.from(t),i=await this._proxy.$tokensAtPosition(e.uri,r),a={type:zO.Other,range:e.getWordRangeAtPosition(t)??new nT(t.line,t.character,t.line,t.character)};if(!i)return a;let o={range:J.to(i.range),type:oj.to(i.type)};return!o.range.contains(t)||n!==e.version?a:o}createLanguageStatusItem(e,t,n){let r=this._handlePool++,i=this._proxy,a=this._ids,o=`${e.identifier.value}/${t}`;if(a.has(o))throw Error(`LanguageStatusItem with id '${t}' ALREADY exists`);a.add(o);let s={selector:n,id:t,name:e.displayName??e.name,severity:lE.Information,command:void 0,text:``,detail:``,busy:!1},c,l=new v,u=()=>{if(c?.dispose(),!a.has(o)){console.warn(`LanguageStatusItem (${t}) from ${e.identifier.value} has been disposed and CANNOT be updated anymore`);return}c=Do(()=>{l.clear(),this._proxy.$setLanguageStatus(r,{id:o,name:s.name??e.displayName??e.name,source:e.displayName??e.name,selector:cj.from(s.selector,this._uriTransformer),label:s.text,detail:s.detail??``,severity:s.severity===lE.Error?Dc.Error:s.severity===lE.Warning?Dc.Warning:Dc.Info,command:s.command&&this._commands.toInternal(s.command,l),accessibilityInfo:s.accessibilityInformation,busy:s.busy})},0)};return u(),{dispose(){l.dispose(),c?.dispose(),i.$removeLanguageStatus(r),a.delete(o)},get id(){return s.id},get name(){return s.name},set name(e){s.name=e,u()},get selector(){return s.selector},set selector(e){s.selector=e,u()},get text(){return s.text},set text(e){s.text=e,u()},set text2(t){K(e,`languageStatusText`),s.text=t,u()},get text2(){return K(e,`languageStatusText`),s.text},get detail(){return s.detail},set detail(e){s.detail=e,u()},get severity(){return s.severity},set severity(e){s.severity=e,u()},get accessibilityInformation(){return s.accessibilityInformation},set accessibilityInformation(e){s.accessibilityInformation=e,u()},get command(){return s.command},set command(e){s.command=e,u()},get busy(){return s.busy},set busy(e){s.busy=e,u()}}}};function lJ(e){return e&&e.title}let uJ=class{constructor(e,t){this._logService=t,this._proxy=e.getProxy(E.MainThreadMessageService)}showMessage(e,t,n,r,i){let a={source:{identifier:e.identifier,label:e.displayName||e.name}},o;typeof r==`string`||lJ(r)?o=[r,...i]:(a.modal=r?.modal,a.useCustom=r?.useCustom,a.detail=r?.detail,o=i),a.useCustom&&K(e,`resolvers`);let s=[],c=!1;for(let t=0;t<o.length;t++){let n=o[t];if(typeof n==`string`)s.push({title:n,handle:t,isCloseAffordance:!1});else if(typeof n==`object`){let{title:r,isCloseAffordance:i}=n;s.push({title:r,isCloseAffordance:!!i,handle:t}),i&&(c?this._logService.warn(`[${e.identifier}] Only one message item can have 'isCloseAffordance':`,n):c=!0)}else this._logService.warn(`[${e.identifier}] Invalid message item:`,n)}return this._proxy.$showMessage(t,n,a,s).then(e=>{if(typeof e==`number`)return o[e]})}};uJ=A([j(1,Ds)],uJ);var dJ=class{constructor(e,t,n,r){this.start=e,this.deletedCount=t,this.deletedItems=n,this.items=r}asApiEvent(){return{range:new mT(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}},fJ=class{static asModelAddData(e){return{EOL:e.eol,lines:e.source,languageId:e.language,uri:e.uri,isDirty:!1,versionId:1,encoding:`utf8`}}constructor(e,t,n){this.notebook=e,this._extHostDocument=t,this._cellData=n,this.handle=n.handle,this.uri=w.revive(n.uri),this.cellKind=n.cellKind,this._outputs=n.outputs.map(gM.to),this._internalMetadata=n.internalMetadata??{},this._metadata=Object.freeze(n.metadata??{}),this._previousResult=Object.freeze(dM.to(n.internalMetadata??{}))}get internalMetadata(){return this._internalMetadata}get apiCell(){if(!this._apiCell){let e=this,t=this._extHostDocument.getDocument(this.uri);if(!t)throw Error(`MISSING extHostDocument for notebook cell: ${this.uri}`);let n={get index(){return e.notebook.getCellIndex(e)},notebook:e.notebook.apiNotebook,kind:fM.to(this._cellData.cellKind),document:t.document,get mime(){return e._mime},set mime(t){e._mime=t},get outputs(){return e._outputs.slice(0)},get metadata(){return e._metadata},get executionSummary(){return e._previousResult}};this._apiCell=Object.freeze(n)}return this._apiCell}setOutputs(e){this._outputs=e.map(gM.to)}setOutputItems(e,t,n){let r=n.map(hM.to),i=this._outputs.find(t=>t.id===e);if(i&&(t||(i.items.length=0),i.items.push(...r),i.items.length>1&&i.items.every(e=>Ku(e.mime)))){let e=new Map,t=[];i.items.forEach(n=>{let r;e.has(n.mime)?r=e.get(n.mime):(r=[],e.set(n.mime,r),t.push(n.mime)),r.push(n.data)}),i.items.length=0,t.forEach(t=>{let n=mC(e.get(t));i.items.push({mime:t,data:n.data.buffer})})}}setMetadata(e){this._metadata=Object.freeze(e)}setInternalMetadata(e){this._internalMetadata=e,this._previousResult=Object.freeze(dM.to(e))}setMime(e){}},pJ=class e{static{this._handlePool=0}constructor(t,n,r,i,a){this._proxy=t,this._textDocumentsAndEditors=n,this._textDocuments=r,this.uri=i,this.handle=e._handlePool++,this._cells=[],this._versionId=0,this._isDirty=!1,this._disposed=!1,this._notebookType=a.viewType,this._metadata=Object.freeze(a.metadata??Object.create(null)),this._spliceNotebookCells([[0,0,a.cells]],!0,void 0),this._versionId=a.versionId}dispose(){this._disposed=!0}get versionId(){return this._versionId}get apiNotebook(){if(!this._notebook){let e=this;this._notebook=Object.freeze({get uri(){return e.uri},get version(){return e._versionId},get notebookType(){return e._notebookType},get isDirty(){return e._isDirty},get isUntitled(){return e.uri.scheme===O.untitled},get isClosed(){return e._disposed},get metadata(){return e._metadata},get cellCount(){return e._cells.length},cellAt(t){return t=e._validateIndex(t),e._cells[t].apiCell},getCells(t){return(t?e._getCells(t):e._cells).map(e=>e.apiCell)},save(){return e._save()},[Symbol.for(`debug.description`)](){return`NotebookDocument(${this.uri.toString()})`}})}return this._notebook}acceptDocumentPropertiesChanged(e){e.metadata&&(this._metadata=Object.freeze({...this._metadata,...e.metadata}))}acceptDirty(e){this._isDirty=e}acceptModelChanged(e,t,n){this._versionId=e.versionId,this._isDirty=t,this.acceptDocumentPropertiesChanged({metadata:n});let r={notebook:this.apiNotebook,metadata:n,cellChanges:[],contentChanges:[]},i=[];for(let t of e.rawEvents)t.kind===aC.ModelChange?this._spliceNotebookCells(t.changes,!1,r.contentChanges):t.kind===aC.Move?this._moveCells(t.index,t.length,t.newIdx,r.contentChanges):t.kind===aC.Output?(this._setCellOutputs(t.index,t.outputs),i.push({cell:this._cells[t.index].apiCell,outputs:this._cells[t.index].apiCell.outputs})):t.kind===aC.OutputItem?(this._setCellOutputItems(t.index,t.outputId,t.append,t.outputItems),i.push({cell:this._cells[t.index].apiCell,outputs:this._cells[t.index].apiCell.outputs})):t.kind===aC.ChangeCellLanguage?(this._changeCellLanguage(t.index,t.language),i.push({cell:this._cells[t.index].apiCell,document:this._cells[t.index].apiCell.document})):t.kind===aC.ChangeCellContent?i.push({cell:this._cells[t.index].apiCell,document:this._cells[t.index].apiCell.document}):t.kind===aC.ChangeCellMime?this._changeCellMime(t.index,t.mime):t.kind===aC.ChangeCellMetadata?(this._changeCellMetadata(t.index,t.metadata),i.push({cell:this._cells[t.index].apiCell,metadata:this._cells[t.index].apiCell.metadata})):t.kind===aC.ChangeCellInternalMetadata&&(this._changeCellInternalMetadata(t.index,t.internalMetadata),i.push({cell:this._cells[t.index].apiCell,executionSummary:this._cells[t.index].apiCell.executionSummary}));let a=new Map;for(let e=0;e<i.length;e++){let t=i[e],n=a.get(t.cell);if(n===void 0){let e=r.cellChanges.push({document:void 0,executionSummary:void 0,metadata:void 0,outputs:void 0,...t});a.set(t.cell,e-1)}else r.cellChanges[n]={...r.cellChanges[n],...t}}return r}_validateIndex(e){return e|=0,e<0?0:e>=this._cells.length?this._cells.length-1:e}_validateRange(e){let t=e.start|0,n=e.end|0;return t<0&&(t=0),n>this._cells.length&&(n=this._cells.length),e.with({start:t,end:n})}_getCells(e){e=this._validateRange(e);let t=[];for(let n=e.start;n<e.end;n++)t.push(this._cells[n]);return t}async _save(){return this._disposed?Promise.reject(Error(`Notebook has been closed`)):this._proxy.$trySaveNotebook(this.uri)}_spliceNotebookCells(e,t,n){if(this._disposed)return;let r=[],i=[],a=[];if(e.reverse().forEach(e=>{let n=e[2].map(e=>{let n=new fJ(this,this._textDocumentsAndEditors,e);return t||i.push(fJ.asModelAddData(e)),n}),o=new dJ(e[0],e[1],[],n),s=this._cells.splice(e[0],e[1],...n);for(let e of s)a.push(e.uri),o.deletedItems.push(e.apiCell);r.push(o)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:i,removedDocuments:a}),n)for(let e of r)n.push(e.asApiEvent())}_moveCells(e,t,n,r){let i=this._cells.splice(e,t);this._cells.splice(n,0,...i);let a=[new dJ(e,t,i.map(e=>e.apiCell),[]),new dJ(n,0,[],i)];for(let e of a)r.push(e.asApiEvent())}_setCellOutputs(e,t){this._cells[e].setOutputs(t)}_setCellOutputItems(e,t,n,r){this._cells[e].setOutputItems(t,n,r)}_changeCellLanguage(e,t){let n=this._cells[e];n.apiCell.document.languageId!==t&&this._textDocuments.$acceptModelLanguageChanged(n.uri,t)}_changeCellMime(e,t){let n=this._cells[e];n.apiCell.mime=t}_changeCellMetadata(e,t){this._cells[e].setMetadata(t)}_changeCellInternalMetadata(e,t){this._cells[e].setInternalMetadata(t)}getCellFromApiCell(e){return this._cells.find(t=>t.apiCell===e)}getCellFromIndex(e){return this._cells[e]}getCell(e){return this._cells.find(t=>t.handle===e)}getCellIndex(e){return this._cells.indexOf(e)}},mJ=class e{static{this.apiEditorsToExtHost=new WeakMap}constructor(e,t,n,r,i,a,o){this.id=e,this._proxy=t,this.notebookData=n,this._visibleRanges=r,this._selections=i,this._viewColumn=a,this.viewType=o,this._visible=!1}get apiEditor(){if(!this._editor){let t=this;this._editor={get notebook(){return t.notebookData.apiNotebook},get selection(){return t._selections[0]},set selection(e){this.selections=[e]},get selections(){return t._selections},set selections(e){if(!Array.isArray(e)||!e.every(mT.isNotebookRange))throw h(`selections`);t._selections=e.length===0?[new mT(0,0)]:e,t._trySetSelections(t._selections)},get visibleRanges(){return t._visibleRanges},revealRange(e,n){t._proxy.$tryRevealRange(t.id,uM.from(e),n??kO.Default)},get viewColumn(){return t._viewColumn},get replOptions(){if(t.viewType===`repl`)return{appendIndex:this.notebook.cellCount-1}},[Symbol.for(`debug.description`)](){return`NotebookEditor(${this.notebook.uri.toString()})`}},e.apiEditorsToExtHost.set(this._editor,this)}return this._editor}get visible(){return this._visible}_acceptVisibility(e){this._visible=e}_acceptVisibleRanges(e){this._visibleRanges=e}_acceptSelections(e){this._selections=e}_trySetSelections(e){this._proxy.$trySetSelections(this.id,e.map(uM.from))}_acceptViewColumn(e){this._viewColumn=e}},hJ=class{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==$)return _J(this.right);let e=this;for(;e.parent!==$&&e.parent.left!==e;)e=e.parent;return e.parent===$?$:e.parent}prev(){if(this.left!==$)return vJ(this.left);let e=this;for(;e.parent!==$&&e.parent.right!==e;)e=e.parent;return e.parent===$?$:e.parent}detach(){this.parent=null,this.left=null,this.right=null}},gJ;(function(e){e[e.Black=0]=`Black`,e[e.Red=1]=`Red`})(gJ||={});const $=new hJ(null,gJ.Black);$.parent=$,$.left=$,$.right=$,$.color=gJ.Black;function _J(e){for(;e.left!==$;)e=e.left;return e}function vJ(e){for(;e.right!==$;)e=e.right;return e}function yJ(e){return e===$?0:e.size_left+e.piece.length+yJ(e.right)}function bJ(e){return e===$?0:e.lf_left+e.piece.lineFeedCnt+bJ(e.right)}function xJ(){$.parent=$}function SJ(e,t){let n=t.right;n.size_left+=t.size_left+(t.piece?t.piece.length:0),n.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=n.left,n.left!==$&&(n.left.parent=t),n.parent=t.parent,t.parent===$?e.root=n:t.parent.left===t?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}function CJ(e,t){let n=t.left;t.left=n.right,n.right!==$&&(n.right.parent=t),n.parent=t.parent,t.size_left-=n.size_left+(n.piece?n.piece.length:0),t.lf_left-=n.lf_left+(n.piece?n.piece.lineFeedCnt:0),t.parent===$?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}function wJ(e,t){let n,r;if(t.left===$?(r=t,n=r.right):t.right===$?(r=t,n=r.left):(r=_J(t.right),n=r.right),r===e.root){e.root=n,n.color=gJ.Black,t.detach(),xJ(),e.root.parent=$;return}let i=r.color===gJ.Red;if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===t?(n.parent=r.parent,DJ(e,n)):(r.parent===t?n.parent=r:n.parent=r.parent,DJ(e,n),r.left=t.left,r.right=t.right,r.parent=t.parent,r.color=t.color,t===e.root?e.root=r:t===t.parent.left?t.parent.left=r:t.parent.right=r,r.left!==$&&(r.left.parent=r),r.right!==$&&(r.right.parent=r),r.size_left=t.size_left,r.lf_left=t.lf_left,DJ(e,r)),t.detach(),n.parent.left===n){let t=yJ(n),r=bJ(n);if(t!==n.parent.size_left||r!==n.parent.lf_left){let i=t-n.parent.size_left,a=r-n.parent.lf_left;n.parent.size_left=t,n.parent.lf_left=r,EJ(e,n.parent,i,a)}}if(DJ(e,n.parent),i){xJ();return}let a;for(;n!==e.root&&n.color===gJ.Black;)n===n.parent.left?(a=n.parent.right,a.color===gJ.Red&&(a.color=gJ.Black,n.parent.color=gJ.Red,SJ(e,n.parent),a=n.parent.right),a.left.color===gJ.Black&&a.right.color===gJ.Black?(a.color=gJ.Red,n=n.parent):(a.right.color===gJ.Black&&(a.left.color=gJ.Black,a.color=gJ.Red,CJ(e,a),a=n.parent.right),a.color=n.parent.color,n.parent.color=gJ.Black,a.right.color=gJ.Black,SJ(e,n.parent),n=e.root)):(a=n.parent.left,a.color===gJ.Red&&(a.color=gJ.Black,n.parent.color=gJ.Red,CJ(e,n.parent),a=n.parent.left),a.left.color===gJ.Black&&a.right.color===gJ.Black?(a.color=gJ.Red,n=n.parent):(a.left.color===gJ.Black&&(a.right.color=gJ.Black,a.color=gJ.Red,SJ(e,a),a=n.parent.left),a.color=n.parent.color,n.parent.color=gJ.Black,a.left.color=gJ.Black,CJ(e,n.parent),n=e.root));n.color=gJ.Black,xJ()}function TJ(e,t){for(DJ(e,t);t!==e.root&&t.parent.color===gJ.Red;)if(t.parent===t.parent.parent.left){let n=t.parent.parent.right;n.color===gJ.Red?(t.parent.color=gJ.Black,n.color=gJ.Black,t.parent.parent.color=gJ.Red,t=t.parent.parent):(t===t.parent.right&&(t=t.parent,SJ(e,t)),t.parent.color=gJ.Black,t.parent.parent.color=gJ.Red,CJ(e,t.parent.parent))}else{let n=t.parent.parent.left;n.color===gJ.Red?(t.parent.color=gJ.Black,n.color=gJ.Black,t.parent.parent.color=gJ.Red,t=t.parent.parent):(t===t.parent.left&&(t=t.parent,CJ(e,t)),t.parent.color=gJ.Black,t.parent.parent.color=gJ.Red,SJ(e,t.parent.parent))}e.root.color=gJ.Black}function EJ(e,t,n,r){for(;t!==e.root&&t!==$;)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}function DJ(e,t){let n=0,r=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(t=t.parent,n=yJ(t.left)-t.size_left,r=bJ(t.left)-t.lf_left,t.size_left+=n,t.lf_left+=r;t!==e.root&&(n!==0||r!==0);)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}}const OJ=65535;function kJ(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}var AJ=class{constructor(e,t,n,r,i){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=r,this.isBasicASCII=i}};function jJ(e,t=!0){let n=[0],r=1;for(let t=0,i=e.length;t<i;t++){let a=e.charCodeAt(t);a===C.CarriageReturn?t+1<i&&e.charCodeAt(t+1)===C.LineFeed?(n[r++]=t+2,t++):n[r++]=t+1:a===C.LineFeed&&(n[r++]=t+1)}return t?kJ(n):n}function MJ(e,t){e.length=0,e[0]=0;let n=1,r=0,i=0,a=0,o=!0;for(let s=0,c=t.length;s<c;s++){let l=t.charCodeAt(s);l===C.CarriageReturn?s+1<c&&t.charCodeAt(s+1)===C.LineFeed?(a++,e[n++]=s+2,s++):(r++,e[n++]=s+1):l===C.LineFeed?(i++,e[n++]=s+1):o&&l!==C.Tab&&(l<32||l>126)&&(o=!1)}let s=new AJ(kJ(e),r,i,a,o);return e.length=0,s}var NJ=class{constructor(e,t,n,r,i){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=r,this.length=i}},PJ=class{constructor(e,t){this.buffer=e,this.lineStarts=t}},FJ=class{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==$&&e.iterate(e.root,e=>(e!==$&&this._pieces.push(e.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}},IJ=class{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber<e&&n.nodeStartLineNumber+n.node.piece.lineFeedCnt>=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,n=this._cache;for(let r=0;r<n.length;r++){let i=n[r];if(i.node.parent===null||i.nodeStartOffset>=e){n[r]=null,t=!0;continue}}if(t){let e=[];for(let t of n)t!==null&&e.push(t);this._cache=e}}},LJ=class{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new PJ(``,[0])],this._lastChangeBufferPos={line:0,column:0},this.root=$,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let r=null;for(let t=0,n=e.length;t<n;t++)if(e[t].buffer.length>0){e[t].lineStarts||(e[t].lineStarts=jJ(e[t].buffer));let n=new NJ(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),r=this.rbInsertRight(r,n)}this._searchCache=new IJ(1),this._lastVisitedLine={lineNumber:0,value:``},this.computeBufferMetadata()}normalizeEOL(e){let t=OJ,n=t-Math.floor(t/3),r=n*2,i=``,a=0,o=[];if(this.iterate(this.root,t=>{let s=this.getNodeContent(t),c=s.length;if(a<=n||a+c<r)return i+=s,a+=c,!0;let l=i.replace(/\r\n|\r|\n/g,e);return o.push(new PJ(l,jJ(l))),i=s,a=c,!0}),a>0){let t=i.replace(/\r\n|\r|\n/g,e);o.push(new PJ(t,jJ(t)))}this.create(o,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new FJ(this,e)}equal(e){if(this.getLength()!==e.getLength()||this.getLineCount()!==e.getLineCount())return!1;let t=0;return this.iterate(this.root,n=>{if(n===$)return!0;let r=this.getNodeContent(n),i=r.length,a=e.nodeAt(t),o=e.nodeAt(t+i),s=e.getValueInRange2(a,o);return t+=i,r===s})}getOffsetAt(e,t){let n=0,r=this.root;for(;r!==$;)if(r.left!==$&&r.lf_left+1>=e)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt+1>=e){n+=r.size_left;let i=this.getAccumulatedValue(r,e-r.lf_left-2);return n+=i+t-1}else e-=r.lf_left+r.piece.lineFeedCnt,n+=r.size_left+r.piece.length,r=r.right;return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0,r=e;for(;t!==$;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){let i=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+i.index,i.index===0){let e=r-this.getOffsetAt(n+1,1);return new yp(n+1,e+1)}return new yp(n+1,i.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===$){let t=this.getOffsetAt(n+1,1),i=r-e-t;return new yp(n+1,i+1)}else t=t.right;return new yp(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return``;let n=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),i=this.getValueInRange2(n,r);return t?t!==this._EOL||!this._EOLNormalized?i.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?i:i.replace(/\r\n|\r|\n/g,t):i}getValueInRange2(e,t){if(e.node===t.node){let n=e.node,r=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r.substring(i+e.remainder,i+t.remainder)}let n=e.node,r=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start),a=r.substring(i+e.remainder,i+n.piece.length);for(n=n.next();n!==$;){let e=this._buffers[n.piece.bufferIndex].buffer,r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){a+=e.substring(r,r+t.remainder);break}else a+=e.substr(r,n.piece.length);n=n.next()}return a}getLinesContent(){let e=[],t=0,n=``,r=!1;return this.iterate(this.root,i=>{if(i===$)return!0;let a=i.piece,o=a.length;if(o===0)return!0;let s=this._buffers[a.bufferIndex].buffer,c=this._buffers[a.bufferIndex].lineStarts,l=a.start.line,u=a.end.line,d=c[l]+a.start.column;if(r&&(s.charCodeAt(d)===C.LineFeed&&(d++,o--),e[t++]=n,n=``,r=!1,o===0))return!0;if(l===u)return!this._EOLNormalized&&s.charCodeAt(d+o-1)===C.CarriageReturn?(r=!0,n+=s.substr(d,o-1)):n+=s.substr(d,o),!0;n+=this._EOLNormalized?s.substring(d,Math.max(d,c[l+1]-this._EOLLength)):s.substring(d,c[l+1]).replace(/(\r\n|\r|\n)$/,``),e[t++]=n;for(let r=l+1;r<u;r++)n=this._EOLNormalized?s.substring(c[r],c[r+1]-this._EOLLength):s.substring(c[r],c[r+1]).replace(/(\r\n|\r|\n)$/,``),e[t++]=n;return!this._EOLNormalized&&s.charCodeAt(c[u]+a.end.column-1)===C.CarriageReturn?(r=!0,a.end.column===0?t--:n=s.substr(c[u],a.end.column-1)):n=s.substr(c[u],a.end.column),!0}),r&&(e[t++]=n,n=``),e[t++]=n,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,``),this._lastVisitedLine.value)}_getCharCode(e){if(e.remainder===e.node.piece.length){let t=e.node.next();if(!t)return 0;let n=this._buffers[t.piece.bufferIndex],r=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return n.buffer.charCodeAt(r)}else{let t=this._buffers[e.node.piece.bufferIndex],n=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(n)}}getLineCharCode(e,t){let n=this.nodeAt2(e,t+1);return this._getCharCode(n)}getLineLength(e){if(e===this.getLineCount()){let t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}getCharCode(e){let t=this.nodeAt(e);return this._getCharCode(t)}getNearestChunk(e){let t=this.nodeAt(e);if(t.remainder===t.node.piece.length){let e=t.node.next();if(!e||e===$)return``;let n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start);return n.buffer.substring(r,r+e.piece.length)}else{let e=this._buffers[t.node.piece.bufferIndex],n=this.offsetInBuffer(t.node.piece.bufferIndex,t.node.piece.start),r=n+t.remainder,i=n+t.node.piece.length;return e.buffer.substring(r,i)}}findMatchesInNode(e,t,n,r,i,a,o,s,c,l,u){let d=this._buffers[e.piece.bufferIndex],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),p=this.offsetInBuffer(e.piece.bufferIndex,i),m=this.offsetInBuffer(e.piece.bufferIndex,a),h,ee={line:0,column:0},te,g;t._wordSeparators?(te=d.buffer.substring(p,m),g=e=>e+p,t.reset(0)):(te=d.buffer,g=e=>e,t.reset(p));do if(h=t.next(te),h){if(g(h.index)>=m)return l;this.positionInBuffer(e,g(h.index)-f,ee);let t=this.getLineFeedCnt(e.piece.bufferIndex,i,ee),a=ee.line===i.line?ee.column-i.column+r:ee.column+1,o=a+h[0].length;if(u[l++]=dR(new bp(n+t,a,n+t,o),h,s),g(h.index)+h[0].length>=m||l>=c)return l}while(h);return l}findMatchesLineByLine(e,t,n,r){let i=[],a=0,o=new hR(t.wordSeparators,t.regex),s=this.nodeAt2(e.startLineNumber,e.startColumn);if(s===null)return[];let c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let l=this.positionInBuffer(s.node,s.remainder),u=this.positionInBuffer(c.node,c.remainder);if(s.node===c.node)return this.findMatchesInNode(s.node,o,e.startLineNumber,e.startColumn,l,u,t,n,r,a,i),i;let d=e.startLineNumber,f=s.node;for(;f!==c.node;){let c=this.getLineFeedCnt(f.piece.bufferIndex,l,f.piece.end);if(c>=1){let s=this._buffers[f.piece.bufferIndex].lineStarts,u=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),p=s[l.line+c],m=d===e.startLineNumber?e.startColumn:1;if(a=this.findMatchesInNode(f,o,d,m,l,this.positionInBuffer(f,p-u),t,n,r,a,i),a>=r)return i;d+=c}let u=d===e.startLineNumber?e.startColumn-1:0;if(d===e.endLineNumber){let s=this.getLineContent(d).substring(u,e.endColumn-1);return a=this._findMatchesInLine(t,o,s,e.endLineNumber,u,a,i,n,r),i}if(a=this._findMatchesInLine(t,o,this.getLineContent(d).substr(u),d,u,a,i,n,r),a>=r)return i;d++,s=this.nodeAt2(d,1),f=s.node,l=this.positionInBuffer(s.node,s.remainder)}if(d===e.endLineNumber){let s=d===e.startLineNumber?e.startColumn-1:0,c=this.getLineContent(d).substring(s,e.endColumn-1);return a=this._findMatchesInLine(t,o,c,e.endLineNumber,s,a,i,n,r),i}let p=d===e.startLineNumber?e.startColumn:1;return a=this.findMatchesInNode(c.node,o,d,p,l,u,t,n,r,a,i),i}_findMatchesInLine(e,t,n,r,i,a,o,s,c){let l=e.wordSeparators;if(!s&&e.simpleSearch){let t=e.simpleSearch,s=t.length,u=n.length,d=-s;for(;(d=n.indexOf(t,d+s))!==-1;)if((!l||mR(l,n,u,d,s))&&(o[a++]=new dm(new bp(r,d+1+i,r,d+1+s+i),null),a>=c))return a;return a}let u;t.reset(0);do if(u=t.next(n),u&&(o[a++]=dR(new bp(r,u.index+1+i,r,u.index+1+u[0].length+i),u,s),a>=c))return a;while(u);return a}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value=``,this.root!==$){let{node:n,remainder:r,nodeStartOffset:i}=this.nodeAt(e),a=n.piece,o=a.bufferIndex,s=this.positionInBuffer(n,r);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&i+a.length===e&&t.length<OJ){this.appendToNode(n,t),this.computeBufferMetadata();return}if(i===e)this.insertContentToNodeLeft(t,n),this._searchCache.validate(e);else if(i+n.piece.length>e){let e=[],i=new NJ(a.bufferIndex,s,a.end,this.getLineFeedCnt(a.bufferIndex,s,a.end),this.offsetInBuffer(o,a.end)-this.offsetInBuffer(o,s));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(n,r)===10){let e={line:i.start.line+1,column:0};i=new NJ(i.bufferIndex,e,i.end,this.getLineFeedCnt(i.bufferIndex,e,i.end),i.length-1),t+=`
188
- `}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,r-1)===13){let i=this.positionInBuffer(n,r-1);this.deleteNodeTail(n,i),t=`\r`+t,n.piece.length===0&&e.push(n)}else this.deleteNodeTail(n,s);else this.deleteNodeTail(n,s);let c=this.createNewPieces(t);i.length>0&&this.rbInsertRight(n,i);let l=n;for(let e=0;e<c.length;e++)l=this.rbInsertRight(l,c[e]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,n)}else{let e=this.createNewPieces(t),n=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)n=this.rbInsertRight(n,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value=``,t<=0||this.root===$)return;let n=this.nodeAt(e),r=this.nodeAt(e+t),i=n.node,a=r.node;if(i===a){let a=this.positionInBuffer(i,n.remainder),o=this.positionInBuffer(i,r.remainder);if(n.nodeStartOffset===e){if(t===i.piece.length){let e=i.next();wJ(this,i),this.validateCRLFWithPrevNode(e),this.computeBufferMetadata();return}this.deleteNodeHead(i,o),this._searchCache.validate(e),this.validateCRLFWithPrevNode(i),this.computeBufferMetadata();return}if(n.nodeStartOffset+i.piece.length===e+t){this.deleteNodeTail(i,a),this.validateCRLFWithNextNode(i),this.computeBufferMetadata();return}this.shrinkNode(i,a,o),this.computeBufferMetadata();return}let o=[],s=this.positionInBuffer(i,n.remainder);this.deleteNodeTail(i,s),this._searchCache.validate(e),i.piece.length===0&&o.push(i);let c=this.positionInBuffer(a,r.remainder);this.deleteNodeHead(a,c),a.piece.length===0&&o.push(a);let l=i.next();for(let e=l;e!==$&&e!==a;e=e.next())o.push(e);let u=i.piece.length===0?i.prev():i;this.deleteNodes(o),this.validateCRLFWithNextNode(u),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){let n=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){let r=t.piece,i={line:r.start.line+1,column:0};t.piece=new NJ(r.bufferIndex,i,r.end,this.getLineFeedCnt(r.bufferIndex,i,r.end),r.length-1),e+=`
189
- `,EJ(this,t,-1,-1),t.piece.length===0&&n.push(t)}let r=this.createNewPieces(e),i=this.rbInsertLeft(t,r[r.length-1]);for(let e=r.length-2;e>=0;e--)i=this.rbInsertLeft(i,r[e]);this.validateCRLFWithPrevNode(i),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
190
- `);let n=this.createNewPieces(e),r=this.rbInsertRight(t,n[0]),i=r;for(let e=1;e<n.length;e++)i=this.rbInsertRight(i,n[e]);this.validateCRLFWithPrevNode(r)}positionInBuffer(e,t,n){let r=e.piece,i=e.piece.bufferIndex,a=this._buffers[i].lineStarts,o=a[r.start.line]+r.start.column+t,s=r.start.line,c=r.end.line,l=0,u=0,d=0;for(;s<=c&&(l=s+(c-s)/2|0,d=a[l],l!==c);)if(u=a[l+1],o<d)c=l-1;else if(o>=u)s=l+1;else break;return n?(n.line=l,n.column=o-d,null):{line:l,column:o-d}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;let r=this._buffers[e].lineStarts;if(n.line===r.length-1)return n.line-t.line;let i=r[n.line+1],a=r[n.line]+n.column;if(i>a+1)return n.line-t.line;let o=a-1;return this._buffers[e].buffer.charCodeAt(o)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)wJ(this,e[t])}createNewPieces(e){if(e.length>OJ){let t=[];for(;e.length>OJ;){let n=e.charCodeAt(OJ-1),r;n===C.CarriageReturn||n>=55296&&n<=56319?(r=e.substring(0,OJ-1),e=e.substring(OJ-1)):(r=e.substring(0,OJ),e=e.substring(OJ));let i=jJ(r);t.push(new NJ(this._buffers.length,{line:0,column:0},{line:i.length-1,column:r.length-i[i.length-1]},i.length-1,r.length)),this._buffers.push(new PJ(r,i))}let n=jJ(e);return t.push(new NJ(this._buffers.length,{line:0,column:0},{line:n.length-1,column:e.length-n[n.length-1]},n.length-1,e.length)),this._buffers.push(new PJ(e,n)),t}let t=this._buffers[0].buffer.length,n=jJ(e,!1),r=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},r=this._lastChangeBufferPos;for(let e=0;e<n.length;e++)n[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+=`_`+e,t+=1}else{if(t!==0)for(let e=0;e<n.length;e++)n[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+=e}let i=this._buffers[0].buffer.length,a=this._buffers[0].lineStarts.length-1,o={line:a,column:i-this._buffers[0].lineStarts[a]},s=new NJ(0,r,o,this.getLineFeedCnt(0,r,o),i-t);return this._lastChangeBufferPos=o,[s]}getLinesRawContent(){return this.getContentOfSubTree(this.root)}getLineRawContent(e,t=0){let n=this.root,r=``,i=this._searchCache.get2(e);if(i){n=i.node;let a=this.getAccumulatedValue(n,e-i.nodeStartLineNumber-1),o=this._buffers[n.piece.bufferIndex].buffer,s=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(i.nodeStartLineNumber+n.piece.lineFeedCnt===e)r=o.substring(s+a,s+n.piece.length);else{let r=this.getAccumulatedValue(n,e-i.nodeStartLineNumber);return o.substring(s+a,s+r-t)}}else{let i=0,a=e;for(;n!==$;)if(n.left!==$&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){let r=this.getAccumulatedValue(n,e-n.lf_left-2),o=this.getAccumulatedValue(n,e-n.lf_left-1),s=this._buffers[n.piece.bufferIndex].buffer,c=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:i,nodeStartLineNumber:a-(e-1-n.lf_left)}),s.substring(c+r,c+o-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){let t=this.getAccumulatedValue(n,e-n.lf_left-2),i=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r=i.substring(a+t,a+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==$;){let e=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){let i=this.getAccumulatedValue(n,0),a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r+=e.substring(a,a+i-t),r}else{let t=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r+=e.substr(t,n.piece.length)}n=n.next()}return r}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==$;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){let n=e.piece,r=this.positionInBuffer(e,t),i=r.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){let t=this.getLineFeedCnt(e.piece.bufferIndex,n.start,r);if(t!==i)return{index:t,remainder:0}}return{index:i,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;let n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,i=n.start.line+t+1;return i>n.end.line?r[n.end.line]+n.end.column-r[n.start.line]-n.start.column:r[i]-r[n.start.line]-n.start.column}deleteNodeTail(e,t){let n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.end),a=t,o=this.offsetInBuffer(n.bufferIndex,a),s=this.getLineFeedCnt(n.bufferIndex,n.start,a),c=s-r,l=o-i,u=n.length+l;e.piece=new NJ(n.bufferIndex,n.start,a,s,u),EJ(this,e,l,c)}deleteNodeHead(e,t){let n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.start),a=t,o=this.getLineFeedCnt(n.bufferIndex,a,n.end),s=this.offsetInBuffer(n.bufferIndex,a),c=o-r,l=i-s,u=n.length+l;e.piece=new NJ(n.bufferIndex,a,n.end,o,u),EJ(this,e,l,c)}shrinkNode(e,t,n){let r=e.piece,i=r.start,a=r.end,o=r.length,s=r.lineFeedCnt,c=t,l=this.getLineFeedCnt(r.bufferIndex,r.start,c),u=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,i);e.piece=new NJ(r.bufferIndex,r.start,c,l,u),EJ(this,e,u-o,l-s);let d=new NJ(r.bufferIndex,n,a,this.getLineFeedCnt(r.bufferIndex,n,a),this.offsetInBuffer(r.bufferIndex,a)-this.offsetInBuffer(r.bufferIndex,n)),f=this.rbInsertRight(e,d);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=`
191
- `);let n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),r=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;let i=jJ(t,!1);for(let e=0;e<i.length;e++)i[e]+=r;if(n){let e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:r-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1));let a=this._buffers[0].lineStarts.length-1,o={line:a,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[a]},s=e.piece.length+t.length,c=e.piece.lineFeedCnt,l=this.getLineFeedCnt(0,e.piece.start,o),u=l-c;e.piece=new NJ(e.piece.bufferIndex,e.piece.start,o,l,s),this._lastChangeBufferPos=o,EJ(this,e,t.length,u)}nodeAt(e){let t=this.root,n=this._searchCache.get(e);if(n)return{node:n.node,nodeStartOffset:n.nodeStartOffset,remainder:e-n.nodeStartOffset};let r=0;for(;t!==$;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){r+=t.size_left;let n={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(n),n}else e-=t.size_left+t.piece.length,r+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let n=this.root,r=0;for(;n!==$;)if(n.left!==$&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){let i=this.getAccumulatedValue(n,e-n.lf_left-2),a=this.getAccumulatedValue(n,e-n.lf_left-1);return r+=n.size_left,{node:n,remainder:Math.min(i+t-1,a),nodeStartOffset:r}}else if(n.lf_left+n.piece.lineFeedCnt===e-1){let i=this.getAccumulatedValue(n,e-n.lf_left-2);if(i+t-1<=n.piece.length)return{node:n,remainder:i+t-1,nodeStartOffset:r};t-=n.piece.length-i;break}else e-=n.lf_left+n.piece.lineFeedCnt,r+=n.size_left+n.piece.length,n=n.right;for(n=n.next();n!==$;){if(n.piece.lineFeedCnt>0){let e=this.getAccumulatedValue(n,0),r=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,e),nodeStartOffset:r}}else if(n.piece.length>=t-1){let e=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:e}}else t-=n.piece.length;n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;let n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(r)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
192
- `)}startWithLF(e){if(typeof e==`string`)return e.charCodeAt(0)===10;if(e===$||e.piece.lineFeedCnt===0)return!1;let t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,i=n[r]+t.start.column;return r===n.length-1||n[r+1]>i+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(i)===10}endWithCR(e){return typeof e==`string`?e.charCodeAt(e.length-1)===13:e===$||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let n=[],r=this._buffers[e.piece.bufferIndex].lineStarts,i;i=e.piece.end.column===0?{line:e.piece.end.line-1,column:r[e.piece.end.line]-r[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};let a=e.piece.length-1,o=e.piece.lineFeedCnt-1;e.piece=new NJ(e.piece.bufferIndex,e.piece.start,i,o,a),EJ(this,e,-1,-1),e.piece.length===0&&n.push(e);let s={line:t.piece.start.line+1,column:0},c=t.piece.length-1,l=this.getLineFeedCnt(t.piece.bufferIndex,s,t.piece.end);t.piece=new NJ(t.piece.bufferIndex,s,t.piece.end,l,c),EJ(this,t,-1,-1),t.piece.length===0&&n.push(t);let u=this.createNewPieces(`\r
193
- `);this.rbInsertRight(e,u[0]);for(let e=0;e<n.length;e++)wJ(this,n[e])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let n=t.next();if(this.startWithLF(n)){if(e+=`
194
- `,n.piece.length===1)wJ(this,n);else{let e=n.piece,t={line:e.start.line+1,column:0},r=e.length-1,i=this.getLineFeedCnt(e.bufferIndex,t,e.end);n.piece=new NJ(e.bufferIndex,t,e.end,i,r),EJ(this,n,-1,-1)}return!0}}return!1}iterate(e,t){return e===$?t($):this.iterate(e.left,t)&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===$)return``;let t=this._buffers[e.piece.bufferIndex],n=e.piece,r=this.offsetInBuffer(n.bufferIndex,n.start),i=this.offsetInBuffer(n.bufferIndex,n.end);return t.buffer.substring(r,i)}getPieceContent(e){let t=this._buffers[e.bufferIndex],n=this.offsetInBuffer(e.bufferIndex,e.start),r=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(n,r)}rbInsertRight(e,t){let n=new hJ(t,gJ.Red);if(n.left=$,n.right=$,n.parent=$,n.size_left=0,n.lf_left=0,this.root===$)this.root=n,n.color=gJ.Black;else if(e.right===$)e.right=n,n.parent=e;else{let t=_J(e.right);t.left=n,n.parent=t}return TJ(this,n),n}rbInsertLeft(e,t){let n=new hJ(t,gJ.Red);if(n.left=$,n.right=$,n.parent=$,n.size_left=0,n.lf_left=0,this.root===$)this.root=n,n.color=gJ.Black;else if(e.left===$)e.left=n,n.parent=e;else{let t=vJ(e.left);t.right=n,n.parent=t}return TJ(this,n),n}getContentOfSubTree(e){let t=``;return this.iterate(e,e=>(t+=this.getNodeContent(e),!0)),t}},RJ;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Invalid=3]=`Invalid`,e[e.LF=1]=`LF`,e[e.CRLF=2]=`CRLF`})(RJ||={});function zJ(e){let t=0,n=0,r=0,i=RJ.Unknown;for(let a=0,o=e.length;a<o;a++){let s=e.charCodeAt(a);s===C.CarriageReturn?(t===0&&(n=a),t++,a+1<o&&e.charCodeAt(a+1)===C.LineFeed?(i|=RJ.CRLF,a++):i|=RJ.Invalid,r=a+1):s===C.LineFeed&&(i|=RJ.LF,t===0&&(n=a),t++,r=a+1)}return t===0&&(n=e.length),[t,n,e.length-r,i]}let BJ;function VJ(){return BJ||=new TextDecoder(`UTF-16LE`),BJ}function HJ(e,t,n){let r=new Uint16Array(e.buffer,t,n);return n>0&&(r[0]===65279||r[0]===65534)?UJ(e,t,n):VJ().decode(r)}function UJ(e,t,n){let r=[],i=0;for(let a=0;a<n;a++){let n=Mt(e,t);t+=2,r[i++]=String.fromCharCode(n)}return r.join(``)}function WJ(e){return e.replace(/\n/g,`\\n`).replace(/\r/g,`\\r`)}var GJ=class e{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,r){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${WJ(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${WJ(this.oldText)}")`:`(replace@${this.oldPosition} "${WJ(this.oldText)}" with "${WJ(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){let r=t.length;Ft(e,r,n),n+=4;for(let i=0;i<r;i++)Nt(e,t.charCodeAt(i),n),n+=2;return n}static _readString(e,t){let n=Pt(e,t);return t+=4,HJ(e,t,n)}writeSize(){return 8+e._writeStringSize(this.oldText)+e._writeStringSize(this.newText)}write(t,n){return Ft(t,this.oldPosition,n),n+=4,Ft(t,this.newPosition,n),n+=4,n=e._writeString(t,this.oldText,n),n=e._writeString(t,this.newText,n),n}static read(t,n,r){let i=Pt(t,n);n+=4;let a=Pt(t,n);n+=4;let o=e._readString(t,n);n+=e._writeStringSize(o);let s=e._readString(t,n);return n+=e._writeStringSize(s),r.push(new e(i,o,a,s)),n}},KJ=class e extends y{get onDidChangeContent(){return this._onDidChangeContent.event}constructor(e,t,n,r,i,a,o){super(),this._onDidChangeContent=this._register(new S),this._BOM=t,this._mightContainNonBasicASCII=!a,this._mightContainRTL=r,this._mightContainUnusualLineTerminators=i,this._pieceTree=new LJ(e,n,o)}equals(t){return!(t instanceof e)||this._BOM!==t._BOM||this.getEOL()!==t.getEOL()?!1:this._pieceTree.equal(t._pieceTree)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:``)}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){let n=e+t,r=this.getPositionAt(e),i=this.getPositionAt(n);return new bp(r.lineNumber,r.column,i.lineNumber,i.column)}getValueInRange(e,t=cm.TextDefined){if(e.isEmpty())return``;let n=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,n)}getValueLengthInRange(e,t=cm.TextDefined){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;let n=this.getOffsetAt(e.startLineNumber,e.startColumn),r=this.getOffsetAt(e.endLineNumber,e.endColumn),i=0,a=this._getEndOfLine(t),o=this.getEOL();return a.length!==o.length&&(i=(a.length-o.length)*(e.endLineNumber-e.startLineNumber)),r-n+i}getCharacterCountInRange(e,t=cm.TextDefined){if(this._mightContainNonBasicASCII){let n=0,r=e.startLineNumber,i=e.endLineNumber;for(let t=r;t<=i;t++){let a=this.getLineContent(t),o=t===r?e.startColumn-1:0,s=t===i?e.endColumn-1:a.length;for(let e=o;e<s;e++)fa(a.charCodeAt(e))?(n+=1,e+=1):n+=1}return n+=this._getEndOfLine(t).length*(i-r),n}return this.getValueLengthInRange(e,t)}getNearestChunk(e){return this._pieceTree.getNearestChunk(e)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getCharCode(e){return this._pieceTree.getCharCode(e)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineMinColumn(e){return 1}getLineMaxColumn(e){return this.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){let t=ea(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){let t=ta(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case cm.LF:return`
195
- `;case cm.CRLF:return`\r
196
- `;case cm.TextDefined:return this.getEOL();default:throw Error(`Unknown EOL preference`)}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(t,n,r){let i=this._mightContainRTL,a=this._mightContainUnusualLineTerminators,o=this._mightContainNonBasicASCII,s=!0,c=[];for(let e=0;e<t.length;e++){let n=t[e];s&&n._isTracked&&(s=!1);let r=n.range;if(n.text){let e=!0;o||=(e=!wa(n.text),e),!i&&e&&(i=Sa(n.text)),!a&&e&&(a=Ea(n.text))}let l=``,u=0,d=0,f=0;if(n.text){let e;[u,d,f,e]=zJ(n.text);let t=this.getEOL(),r=t===`\r
197
- `?RJ.CRLF:RJ.LF;l=e===RJ.Unknown||e===r?n.text:n.text.replace(/\r\n|\r|\n/g,t)}c[e]={sortIndex:e,identifier:n.identifier||null,range:r,rangeOffset:this.getOffsetAt(r.startLineNumber,r.startColumn),rangeLength:this.getValueLengthInRange(r),text:l,eolCount:u,firstLineLength:d,lastLineLength:f,forceMoveMarkers:!!n.forceMoveMarkers,isAutoWhitespaceEdit:n.isAutoWhitespaceEdit||!1}}c.sort(e._sortOpsAscending);let l=!1;for(let e=0,t=c.length-1;e<t;e++){let t=c[e].range.getEndPosition(),n=c[e+1].range.getStartPosition();if(n.isBeforeOrEqual(t)){if(n.isBefore(t))throw Error(`Overlapping ranges are not allowed!`);l=!0}}s&&(c=this._reduceOperations(c));let u=r||n?e._getInverseEditRanges(c):[],d=[];if(n)for(let e=0;e<c.length;e++){let t=c[e],n=u[e];if(t.isAutoWhitespaceEdit&&t.range.isEmpty())for(let e=n.startLineNumber;e<=n.endLineNumber;e++){let r=``;e===n.startLineNumber&&(r=this.getLineContent(t.range.startLineNumber),ea(r)!==-1)||d.push({lineNumber:e,oldContent:r})}}let f=null;if(r){let e=0;f=[];for(let t=0;t<c.length;t++){let n=c[t],r=u[t],i=this.getValueInRange(n.range),a=n.rangeOffset+e;e+=n.text.length-i.length,f[t]={sortIndex:n.sortIndex,identifier:n.identifier,range:r,text:i,textChange:new GJ(n.rangeOffset,i,a,n.text)}}l||f.sort((e,t)=>e.sortIndex-t.sortIndex)}this._mightContainRTL=i,this._mightContainUnusualLineTerminators=a,this._mightContainNonBasicASCII=o;let p=this._doApplyEdits(c),m=null;if(n&&d.length>0){d.sort((e,t)=>t.lineNumber-e.lineNumber),m=[];for(let e=0,t=d.length;e<t;e++){let t=d[e].lineNumber;if(e>0&&d[e-1].lineNumber===t)continue;let n=d[e].oldContent,r=this.getLineContent(t);r.length===0||r===n||ea(r)!==-1||m.push(t)}}return this._onDidChangeContent.fire(),new gm(f,p,m)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1,n=e[0].range,r=e[e.length-1].range,i=new bp(n.startLineNumber,n.startColumn,r.endLineNumber,r.endColumn),a=n.startLineNumber,o=n.startColumn,s=[];for(let n=0,r=e.length;n<r;n++){let r=e[n],i=r.range;t||=r.forceMoveMarkers,s.push(this.getValueInRange(new bp(a,o,i.startLineNumber,i.startColumn))),r.text.length>0&&s.push(r.text),a=i.endLineNumber,o=i.endColumn}let c=s.join(``),[l,u,d]=zJ(c);return{sortIndex:0,identifier:e[0].identifier,range:i,rangeOffset:this.getOffsetAt(i.startLineNumber,i.startColumn),rangeLength:this.getValueLengthInRange(i,cm.TextDefined),text:c,eolCount:l,firstLineLength:u,lastLineLength:d,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(t){t.sort(e._sortOpsDescending);let n=[];for(let e=0;e<t.length;e++){let r=t[e],i=r.range.startLineNumber,a=r.range.startColumn,o=r.range.endLineNumber,s=r.range.endColumn;if(i===o&&a===s&&r.text.length===0)continue;r.text?(this._pieceTree.delete(r.rangeOffset,r.rangeLength),this._pieceTree.insert(r.rangeOffset,r.text,!0)):this._pieceTree.delete(r.rangeOffset,r.rangeLength);let c=new bp(i,a,o,s);n.push({range:c,rangeLength:r.rangeLength,text:r.text,rangeOffset:r.rangeOffset,forceMoveMarkers:r.forceMoveMarkers})}return n}findMatchesLineByLine(e,t,n,r){return this._pieceTree.findMatchesLineByLine(e,t,n,r)}getPieceTree(){return this._pieceTree}static _getInverseEditRange(e,t){let n=e.startLineNumber,r=e.startColumn,[i,a,o]=zJ(t),s;if(t.length>0){let e=i+1;s=e===1?new bp(n,r,n,r+a):new bp(n,r,n+e-1,o+1)}else s=new bp(n,r,n,r);return s}static _getInverseEditRanges(e){let t=[],n=0,r=0,i=null;for(let a=0,o=e.length;a<o;a++){let o=e[a],s,c;i?i.range.endLineNumber===o.range.startLineNumber?(s=n,c=r+(o.range.startColumn-i.range.endColumn)):(s=n+(o.range.startLineNumber-i.range.endLineNumber),c=o.range.startColumn):(s=o.range.startLineNumber,c=o.range.startColumn);let l;if(o.text.length>0){let e=o.eolCount+1;l=e===1?new bp(s,c,s,c+o.firstLineLength):new bp(s,c,s+e-1,o.lastLineLength+1)}else l=new bp(s,c,s,c);n=l.endLineNumber,r=l.endColumn,t.push(l),i=o}return t}static _sortOpsAscending(e,t){let n=bp.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){let n=bp.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}},qJ=class{constructor(e,t,n,r,i,a,o,s,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=r,this._crlf=i,this._containsRTL=a,this._containsUnusualLineTerminators=o,this._isBasicASCII=s,this._normalizeEOL=c}_getEOL(e){let t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===lm.LF?`
198
- `:`\r
199
- `:n>t/2?`\r
200
- `:`
201
- `}create(e){let t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&(t===`\r
202
- `&&(this._cr>0||this._lf>0)||t===`
203
- `&&(this._cr>0||this._crlf>0)))for(let e=0,r=n.length;e<r;e++){let r=n[e].buffer.replace(/\r\n|\r|\n/g,t);n[e]=new PJ(r,jJ(r))}let r=new KJ(n,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:r,disposable:r}}getFirstLineText(e){return this._chunks[0].buffer.substr(0,e).split(/\r\n|\r|\n/)[0]}},JJ=class{constructor(){this.chunks=[],this.BOM=``,this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&Oa(e)&&(this.BOM=Da,e=e.substr(1));let t=e.charCodeAt(e.length-1);t===C.CarriageReturn||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){let t=MJ(this._tmpLineStarts,e);this.chunks.push(new PJ(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||=Sa(e),this.containsUnusualLineTerminators||=Ea(e))}finish(e=!0){return this._finish(),new qJ(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1(``,!0),this._hasPreviousChar){this._hasPreviousChar=!1;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar),e.lineStarts=jJ(e.buffer),this._previousChar===C.CarriageReturn&&this.cr++}}},YJ=class extends y{constructor(e,t,n){super(),this._source=e,this._inputTextBuffer=t,this._outputs=n,this._outputTextBuffers=void 0}_getFullModelRange(e){let t=e.getLineCount();return new bp(1,1,t,this._getLineMaxColumn(e,t))}_getLineMaxColumn(e,t){if(t<1||t>e.getLineCount())throw Error(`Illegal value for lineNumber`);return e.getLineLength(t)+1}get inputTextBuffer(){if(!this._inputTextBuffer){let e=new JJ;e.acceptChunk(this._source);let{textBuffer:t,disposable:n}=e.finish(!0).create(lm.LF);this._inputTextBuffer=t,this._register(n)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||=this._outputs.map(e=>{let t=new JJ;t.acceptChunk(e);let{textBuffer:n,disposable:r}=t.finish(!0).create(lm.LF);return this._register(r),n}),this._outputTextBuffers}findInInputs(e){let t=new lR(e,!1,!1,null).parseSearchRequest();if(!t)return[];let n=this._getFullModelRange(this.inputTextBuffer);return this.inputTextBuffer.findMatchesLineByLine(n,t,!0,5e3)}findInOutputs(e){let t=new lR(e,!1,!1,null).parseSearchRequest();return t?this.outputTextBuffers.map(e=>{let n=e.findMatchesLineByLine(this._getFullModelRange(e),t,!0,5e3);if(n.length!==0)return{textBuffer:e,matches:n}}).filter(e=>!!e):[]}};function XJ(e,t){let n=-1,r=[],i=[];return e.forEach(e=>{e.range.startLineNumber!==n&&i.length>0&&(r.push([...i]),i=[]),i.push(e),n=e.range.endLineNumber}),i.length>0&&r.push([...i]),r.map(e=>{let n=[],r=e[0].range.startLineNumber,i=e[e.length-1].range.endLineNumber;for(let e=r;e<=i;e++)n.push(t.getLineContent(e));return new YN(n.join(`
204
- `)+`
205
- `,e.map(e=>new bp(e.range.startLineNumber-1,e.range.startColumn-1,e.range.endLineNumber-1,e.range.endColumn-1)))})}const ZJ=k(`IUserDataProfilesService`),QJ=Object.freeze({id:`workbench`,order:7,title:x(4198,`Workbench`),type:`object`}),$J=Object.freeze({id:`security`,scope:og.APPLICATION,title:x(4199,`Security`),type:`object`,order:7});Object.freeze({id:`problems`,title:x(4200,`Problems`),type:`object`,order:101});const eY=Object.freeze({id:`window`,order:8,title:x(4201,`Window`),type:`object`}),tY={ConfigurationMigration:`base.contributions.configuration.migration`},nY=new class{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new S,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}};wm.add(tY.ConfigurationMigration,nY);let rY=class extends y{static{this.ID=`workbench.contrib.configurationMigration`}constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async e=>{for(let t of e.added)await this.migrateConfigurationsForFolder(t,nY.migrations)})),this.migrateConfigurations(nY.migrations),this._register(nY.onDidRegisterConfigurationMigration(e=>this.migrateConfigurations(e)))}async migrateConfigurations(e){await this.migrateConfigurationsForFolder(void 0,e);for(let t of this.workspaceService.getWorkspace().folders)await this.migrateConfigurationsForFolder(t,e)}async migrateConfigurationsForFolder(e,t){await Promise.all([t.map(t=>this.migrateConfigurationsForFolderAndOverride(t,e?.uri))])}async migrateConfigurationsForFolderAndOverride(e,t){let n=this.configurationService.inspect(e.key,{resource:t}),r=this.workspaceService.getWorkbenchState()===Nc.WORKSPACE?[[`user`,Gh.USER],[`userLocal`,Gh.USER_LOCAL],[`userRemote`,Gh.USER_REMOTE],[`workspace`,Gh.WORKSPACE],[`workspaceFolder`,Gh.WORKSPACE_FOLDER]]:[[`user`,Gh.USER],[`userLocal`,Gh.USER_LOCAL],[`userRemote`,Gh.USER_REMOTE],[`workspace`,Gh.WORKSPACE]];for(let[i,a]of r){let r=n[i];if(!r)continue;let o=[];if(r.value!==void 0){let n=await this.runMigration(e,i,r.value,t,void 0);for(let e of n??[])o.push([e,[]])}for(let{identifiers:n,value:a}of r.overrides??[])if(a!==void 0){let r=await this.runMigration(e,i,a,t,n);for(let e of r??[])o.push([e,n])}o.length&&await Promise.allSettled(o.map(async([[e,n],r])=>this.configurationService.updateValue(e,n.value,{resource:t,overrideIdentifiers:r},a)))}}async runMigration(e,t,n,r,i){let a=await e.migrateFn(n,e=>{let n=this.configurationService.inspect(e,{resource:r})[t];if(n)return i?n.overrides?.find(({identifiers:e})=>sc(e,i))?.value:n.value});return Array.isArray(a)?a:[[e.key,a]]}};rY=A([j(0,Sh),j(1,gR)],rY);let iY=class extends y{static{this.ID=`workbench.contrib.dynamicWorkbenchSecurityConfiguration`}constructor(e){super(),this.remoteAgentService=e,this._ready=new Ro,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){!yn&&(await this.remoteAgentService.getEnvironment())?.os!==Pn.Windows||wm.as(ag.Configuration).registerConfiguration({...$J,properties:{"security.allowedUNCHosts":{type:`array`,items:{type:`string`,pattern:`^[^\\\\]+$`,patternErrorMessage:x(4202,`UNC host names must not contain backslashes.`)},default:[],markdownDescription:x(4203,"A set of UNC host names (without leading or trailing backslash, for example `192.168.0.1` or `my-server`) to allow without user confirmation. If a UNC host is being accessed that is not allowed via this setting or has not been acknowledged via user confirmation, an error will occur and the operation stopped. A restart is required when changing this setting. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:og.APPLICATION_MACHINE},"security.restrictUNCAccess":{type:`boolean`,default:!0,markdownDescription:x(4204,"If enabled, only allows access to UNC host names that are allowed by the `#security.allowedUNCHosts#` setting or after user confirmation. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:og.APPLICATION_MACHINE}}})}};iY=A([j(0,kK)],iY);const aY=`window.newWindowProfile`;let oY=class extends y{static{this.ID=`workbench.contrib.dynamicWindowConfiguration`}constructor(e,t){super(),this.userDataProfilesService=e,this.configurationService=t,this.registerNewWindowProfileConfiguration(),this._register(this.userDataProfilesService.onDidChangeProfiles(e=>this.registerNewWindowProfileConfiguration())),this.setNewWindowProfile(),this.checkAndResetNewWindowProfileConfig(),this._register(t.onDidChangeConfiguration(e=>{e.source!==Gh.DEFAULT&&e.affectsConfiguration(`window.newWindowProfile`)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){let e=wm.as(ag.Configuration),t={...eY,properties:{[aY]:{type:[`string`,`null`],default:null,enum:[...this.userDataProfilesService.profiles.map(e=>e.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(()=>``),x(4205,`Active Window`)],description:x(4206,`Specifies the profile to use when opening a new window. If a profile name is provided, the new window will use that profile. If no profile name is provided, the new window will use the profile of the active window or the Default profile if no active window exists.`),scope:og.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){let e=this.configurationService.getValue(aY);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){let e=this.configurationService.getValue(aY);if(!e)return;let t=this.newWindowProfile?this.userDataProfilesService.profiles.find(e=>e.id===this.newWindowProfile.id):void 0;e!==t?.name&&this.configurationService.updateValue(aY,t?.name)}};oY=A([j(0,ZJ),j(1,Sh)],oY);const sY=Object.freeze({"*.md":`vscode.markdown.preview.editor`}),cY=wm.as(ag.Configuration),lY={...QJ,properties:{"workbench.editorAssociations":{type:`object`,markdownDescription:x(16874,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `"*.hex": "hexEditor.hexedit"`). These have precedence over the default behavior.'),additionalProperties:{type:`string`},agentsWindow:{default:sY}},"workbench.diffEditorAssociations":{type:`object`,markdownDescription:x(16875,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors for diff views (for example `"*.md": "vscode.markdown.preview.editor"`). These override `workbench.editorAssociations` for diffs.'),additionalProperties:{type:`string`}}}};cY.registerConfiguration(lY);var uY;(function(e){e.builtin=`builtin`,e.option=`option`,e.exclusive=`exclusive`,e.default=`default`})(uY||={});var dY;(function(e){e[e.ABORT=1]=`ABORT`,e[e.NONE=2]=`NONE`})(dY||={});function fY(e,t){return new Set([O.extension,O.webviewPanel,O.vscodeWorkspaceTrust,O.vscodeSettings]).has(t.scheme)?!1:BS(e,typeof e==`string`&&e.indexOf(zr.sep)>=0?`${t.scheme}:${t.path}`:to(t),{ignoreCase:!0})}var pY=class e{static{this._notebookStatusBarItemProviderHandlePool=0}get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(t,n,r,i,a,o,s){this._textDocumentsAndEditors=r,this._textDocuments=i,this._extHostFileSystem=a,this._extHostSearch=o,this._logService=s,this._notebookStatusBarItemProviders=new Map,this._documents=new Ne,this._editors=new Map,this._onDidChangeActiveNotebookEditor=new S,this.onDidChangeActiveNotebookEditor=this._onDidChangeActiveNotebookEditor.event,this._visibleNotebookEditors=[],this._onDidOpenNotebookDocument=new S,this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event,this._onDidCloseNotebookDocument=new S,this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event,this._onDidChangeVisibleNotebookEditors=new S,this.onDidChangeVisibleNotebookEditors=this._onDidChangeVisibleNotebookEditors.event,this._statusBarCache=new SW(`NotebookCellStatusBarCache`),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=t.getProxy(E.MainThreadNotebook),this._notebookDocumentsProxy=t.getProxy(E.MainThreadNotebookDocuments),this._notebookEditorsProxy=t.getProxy(E.MainThreadNotebookEditors),this._commandsConverter=n.converter,n.registerArgumentProcessor({processArgument:e=>{if(e&&e.$mid===Er.NotebookCellActionContext){let t=e.notebookEditor?.notebookUri,n=e.cell.handle,r=this._documents.get(t)?.getCell(n);if(r)return r.apiCell}if(e&&e.$mid===Er.NotebookActionContext){let t=e.uri,n=this._documents.get(t);if(n)return n.apiNotebook}return e}}),e._registerApiCommands(n)}getEditorById(e){let t=this._editors.get(e);if(!t)throw Error(`unknown text editor: ${e}. known editors: ${[...this._editors.keys()]} `);return t}getIdByEditor(e){for(let[t,n]of this._editors)if(n.apiEditor===e)return t}get notebookDocuments(){return[...this._documents.values()]}getNotebookDocument(e,t){let n=this._documents.get(e);if(!n&&!t)throw Error(`NO notebook document for '${e}'`);return n}static _convertNotebookRegistrationData(e,t){if(!t)return;let n=t.filenamePattern.map(e=>_M.from(e)).filter(e=>e!==void 0);if(t.filenamePattern&&!n){console.warn(`Notebook content provider view options file name pattern is invalid ${t.filenamePattern}`);return}return{extension:e.identifier,providerDisplayName:e.displayName||e.name,displayName:t.displayName,filenamePattern:n,priority:t.exclusive?uY.exclusive:void 0}}registerNotebookCellStatusBarItemProvider(t,n,r){let i=e._notebookStatusBarItemProviderHandlePool++,a=typeof r.onDidChangeCellStatusBarItems==`function`?e._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(i,r),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(i,a,n);let o;return a!==void 0&&(o=r.onDidChangeCellStatusBarItems(e=>this._notebookProxy.$emitCellStatusBarEvent(a))),new WT(()=>{this._notebookStatusBarItemProviders.delete(i),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(i,a),o?.dispose()})}async createNotebookDocument(e){let t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&pM.from(e.content)});return w.revive(t)}async openNotebookDocument(e){let t=this._documents.get(e);if(t)return t.apiNotebook;let n=await this._notebookDocumentsProxy.$tryOpenNotebook(e);return nt(this._documents.get(w.revive(n))?.apiNotebook)}async showNotebookDocument(e,t){let n;n=typeof t==`object`?{position:pj.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(uM.from),pinned:typeof t.preview==`boolean`?!t.preview:void 0,label:typeof t.asRepl==`string`?t.asRepl:typeof t.asRepl==`object`?t.asRepl.label:void 0}:{preserveFocus:!1,pinned:!0};let r=t?.asRepl?`repl`:e.notebookType,i=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,r,n),a=i&&this._editors.get(i)?.apiEditor;if(a)return a;throw Error(i?`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`:`Could NOT open editor for "${e.uri.toString()}".`)}async $provideNotebookCellStatusBarItems(e,t,n,r){let i=this._notebookStatusBarItemProviders.get(e),a=w.revive(t),o=this._documents.get(a);if(!o||!i)return;let s=o.getCellFromIndex(n);if(!s)return;let c=await i.provideCellStatusBarItems(s.apiCell,r);if(!c)return;let l=new v;return{cacheId:this._statusBarCache.add([l]),items:(Array.isArray(c)?c:[c]).map(e=>vM.from(e,this._commandsConverter,l))}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(t,n,r,i,a){if(Hi(n))throw Error(`viewType cannot be empty or just whitespace`);let o=this._handlePool++;return this._notebookSerializer.set(o,{viewType:n,serializer:r,options:i}),this._notebookProxy.$registerNotebookSerializer(o,{id:t.identifier,location:t.extensionLocation},n,bM.from(i),e._convertNotebookRegistrationData(t,a)),_(()=>{this._notebookProxy.$unregisterNotebookSerializer(o)})}async $dataToNotebook(e,t,n){let r=this._notebookSerializer.get(e);if(!r)throw Error(`NO serializer found`);let i=await r.serializer.deserializeNotebook(t.buffer,n);return new _i(pM.from(i))}async $notebookToData(e,t,n){let r=this._notebookSerializer.get(e);if(!r)throw Error(`NO serializer found`);let i=await r.serializer.serializeNotebook(pM.to(t.value),n);return b.wrap(i)}async $saveNotebook(e,t,n,r,i){let a=w.revive(t),o=this._notebookSerializer.get(e);this.trace(`enter saveNotebook(versionId: ${n}, ${a.toString()})`);try{if(!o)throw new mY(`NO serializer found`);let e=this._documents.get(a);if(!e)throw new mY(`Document NOT found`);if(e.versionId!==n)throw new mY(`Document version mismatch, expected: `+n+`, actual: `+e.versionId);if(!this._extHostFileSystem.value.isWritableFileSystem(a.scheme))throw new Sc(x(2873,`Unable to modify read-only file '{0}'`,this._resourceForError(a)),Cc.FILE_PERMISSION_DENIED);let t={metadata:lc(e.apiNotebook.metadata,e=>!(o.options?.transientDocumentMetadata??{})[e]),cells:[]};for(let n of e.apiNotebook.getCells()){let e=new hT(n.kind,n.document.getText(),n.document.languageId,n.mime,o.options?.transientOutputs?[]:[...n.outputs],n.metadata,n.executionSummary);e.metadata=lc(n.metadata,e=>!(o.options?.transientCellMetadata??{})[e]),t.cells.push(e)}if(await this._validateWriteFile(a,r),i.isCancellationRequested)throw new f;let s=await o.serializer.serializeNotebook(t,i);if(i.isCancellationRequested)throw new f;this.trace(`serialized versionId: ${n} ${a.toString()}`),await this._extHostFileSystem.value.writeFile(a,s),this.trace(`Finished write versionId: ${n} ${a.toString()}`);let c=this._extHostFileSystem.getFileSystemProviderExtUri(a.scheme),l=await this._extHostFileSystem.value.stat(a),u={name:c.basename(a),isFile:(l.type&dc.File)!==0,isDirectory:(l.type&dc.Directory)!==0,isSymbolicLink:(l.type&dc.SymbolicLink)!==0,mtime:l.mtime,ctime:l.ctime,size:l.size,readonly:!!((l.permissions??0)&fc.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(a.scheme),locked:!!((l.permissions??0)&fc.Locked),executable:!!((l.permissions??0)&fc.Executable),etag:Tc({mtime:l.mtime,size:l.size})};return this.trace(`exit saveNotebook(versionId: ${n}, ${a.toString()})`),u}catch(e){if(e instanceof Sc)return{...e,message:e.message};throw e}}async $searchInNotebooks(e,t,n,r,i){let a=this._notebookSerializer.get(e)?.serializer;if(!a)return{limitHit:!1,results:[]};let o=new Pe;await(async(e,t,n)=>{await Promise.all(e.map(async e=>await Promise.all(e.filenamePatterns.map(i=>{let a={_reason:n._reason,folderQueries:n.folderQueries,includePattern:n.includePattern,excludePattern:n.excludePattern,maxResults:n.maxResults,type:KN.File,filePattern:i};return this._extHostSearch.doInternalFileSearchWithCustomCallback(a,t,t=>{t.forEach(t=>{o.has(t)||r.some(n=>e.isFromSettings&&!n.isFromSettings?!1:n.filenamePatterns.some(e=>fY(e,t)))||o.add(t)})}).catch(e=>{if(e.code===`ENOENT`)return console.warn(`Could not find notebook search results, ignoring notebook results.`),{limitHit:!1,messages:[]};throw e})}))))})(n,i,t);let s=new Ne,c=!1,l=Array.from(o).map(async e=>{let n=[];try{if(i.isCancellationRequested)return;if(t.maxResults&&[...s.values()].reduce((e,t)=>e+t.cellResults.length,0)>t.maxResults){c=!0;return}let r=[],o=this._documents.get(e);if(o)o.apiNotebook.getCells().forEach(e=>r.push({input:e.document.getText(),outputs:e.outputs.flatMap(e=>e.items.map(e=>e.data.toString()))}));else{let t=await this._extHostFileSystem.value.readFile(e),n=b.fromString(t.toString()),o=await a.deserializeNotebook(n.buffer,i);if(i.isCancellationRequested)return;pM.from(o).cells.forEach(e=>r.push({input:e.source,outputs:e.outputs.flatMap(e=>e.items.map(e=>e.valueBytes.toString()))}))}if(i.isCancellationRequested)return;r.forEach((e,r)=>{let i=t.contentPattern.pattern,a=new YJ(e.input,void 0,e.outputs),o=a.findInInputs(i),s=a.findInOutputs(i),c=s.flatMap(e=>XJ(e.matches,e.textBuffer)).map((e,t)=>(e.webviewIndex=t,e));if(o.length>0||s.length>0){let e={index:r,contentResults:XJ(o,a.inputTextBuffer),webviewResults:c};n.push(e)}});let l={resource:e,cellResults:n};s.set(e,l);return}catch{return}});return await Promise.all(l),{limitHit:c,results:[...s.values()]}}async _validateWriteFile(e,t){let n=await this._extHostFileSystem.value.stat(e);if(typeof t?.mtime==`number`&&typeof t.etag==`string`&&t.etag!==``&&typeof n.mtime==`number`&&typeof n.size==`number`&&t.mtime<n.mtime&&t.etag!==Tc({mtime:t.mtime,size:n.size}))throw new Sc(x(2874,`File Modified Since`),Cc.FILE_MODIFIED_SINCE,t)}_resourceForError(e){return e.scheme===O.file?e.fsPath:e.toString()}_createExtHostEditor(e,t,n){if(this._editors.has(t))throw Error(`editor with id ALREADY EXSIST: ${t}`);let r=new mJ(t,this._notebookEditorsProxy,e,n.visibleRanges.map(uM.to),n.selections.map(uM.to),typeof n.viewColumn==`number`?pj.to(n.viewColumn):void 0,n.viewType);this._editors.set(t,r)}$acceptDocumentAndEditorsDelta(e){if(e.value.removedDocuments)for(let t of e.value.removedDocuments){let e=w.revive(t),n=this._documents.get(e);n&&(n.dispose(),this._documents.delete(e),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({removedDocuments:n.apiNotebook.getCells().map(e=>e.document.uri)}),this._onDidCloseNotebookDocument.fire(n.apiNotebook));for(let t of this._editors.values())t.notebookData.uri.toString()===e.toString()&&this._editors.delete(t.id)}if(e.value.addedDocuments){let t=[];for(let n of e.value.addedDocuments){let e=w.revive(n.uri);if(this._documents.has(e))throw Error(`adding EXISTING notebook ${e} `);let r=new pJ(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,e,n);t.push(...n.cells.map(e=>fJ.asModelAddData(e))),this._documents.get(e)?.dispose(),this._documents.set(e,r),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:t}),this._onDidOpenNotebookDocument.fire(r.apiNotebook)}}if(e.value.addedEditors)for(let t of e.value.addedEditors){if(this._editors.has(t.id))return;let e=w.revive(t.documentUri),n=this._documents.get(e);n&&this._createExtHostEditor(n,t.id,t)}if(e.value.removedEditors)for(let t of e.value.removedEditors){let e=this._editors.get(t);e&&(this._editors.delete(t),this._activeNotebookEditor?.id===e.id&&(this._activeNotebookEditor=void 0))}if(e.value.visibleEditors){this._visibleNotebookEditors=e.value.visibleEditors.map(e=>this._editors.get(e)).filter(e=>!!e);let t=new Set;this._visibleNotebookEditors.forEach(e=>t.add(e.id));for(let e of this._editors.values()){let n=t.has(e.id);e._acceptVisibility(n)}this._visibleNotebookEditors=[...this._editors.values()].map(e=>e).filter(e=>e.visible),this._onDidChangeVisibleNotebookEditors.fire(this.visibleNotebookEditors)}e.value.newActiveEditor===null?this._activeNotebookEditor=void 0:e.value.newActiveEditor&&(this._editors.get(e.value.newActiveEditor)||console.error(`FAILED to find active notebook editor ${e.value.newActiveEditor}`),this._activeNotebookEditor=this._editors.get(e.value.newActiveEditor)),e.value.newActiveEditor!==void 0&&this._onDidChangeActiveNotebookEditor.fire(this._activeNotebookEditor?.apiEditor)}static _registerApiCommands(e){let t=X.String.with(`notebookType`,`A notebook type`),n=new VI(`vscode.executeDataToNotebook`,`_executeDataToNotebook`,`Invoke notebook serializer`,[t,new X(`data`,`Bytes to convert to data`,e=>e instanceof Uint8Array,e=>b.wrap(e))],new BI(`Notebook Data`,e=>pM.to(e.value))),r=new VI(`vscode.executeNotebookToData`,`_executeNotebookToData`,`Invoke notebook serializer`,[t,new X(`NotebookData`,`Notebook data to convert to bytes`,e=>!0,e=>new _i(pM.from(e)))],new BI(`Bytes`,e=>e.buffer));e.registerApiCommand(n),e.registerApiCommand(r)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}},mY=class extends Error{constructor(e){super(e),this.name=`NotebookSaveError`}},hY=class{constructor(e,t,n,r={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=n,this._thresholds=r,this._onWillSaveNotebookDocumentEvent=new cr}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,n,r)=>{let i=function(e){t.call(n,e)};return i.extension=e,this._onWillSaveNotebookDocumentEvent.event(i,void 0,r)}}async $participateInSave(e,t,n){let r=w.revive(e),i=this._notebooksAndEditors.getNotebookDocument(r);if(!i)throw Error(`Unable to resolve notebook document`);let a=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:i.apiNotebook,reason:tM.to(t)},n,async(e,t)=>{let r=Date.now(),i=await await Promise.resolve(e);Date.now()-r>this._thresholds.timeout&&this._logService.warn(`onWillSaveNotebookDocument-listener from extension`,t.extension.identifier),!n.isCancellationRequested&&i&&(i instanceof PT?a.push(i):this._logService.warn(`onWillSaveNotebookDocument-listener from extension`,t.extension.identifier,`ignored due to invalid data`))}),n.isCancellationRequested)return!1;if(a.length===0)return!0;let o={edits:[]};for(let e of a){let{edits:t}=Cj.from(e);o.edits=o.edits.concat(t)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new _i(o))}},gY=class{constructor(e){this._notebooksAndEditors=e,this._onDidSaveNotebookDocument=new S,this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event,this._onDidChangeNotebookDocument=new S,this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}$acceptModelChanged(e,t,n,r){let i=this._notebooksAndEditors.getNotebookDocument(w.revive(e)).acceptModelChanged(t.value,n,r);this._onDidChangeNotebookDocument.fire(i)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(w.revive(e)).acceptDirty(t)}$acceptModelSaved(e){let t=this._notebooksAndEditors.getNotebookDocument(w.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}};let _Y=class{constructor(e,t){this._logService=e,this._notebooksAndEditors=t,this._onDidChangeNotebookEditorSelection=new S,this._onDidChangeNotebookEditorVisibleRanges=new S,this.onDidChangeNotebookEditorSelection=this._onDidChangeNotebookEditorSelection.event,this.onDidChangeNotebookEditorVisibleRanges=this._onDidChangeNotebookEditorVisibleRanges.event}$acceptEditorPropertiesChanged(e,t){this._logService.debug(`ExtHostNotebook#$acceptEditorPropertiesChanged`,e,t);let n=this._notebooksAndEditors.getEditorById(e);t.visibleRanges&&n._acceptVisibleRanges(t.visibleRanges.ranges.map(uM.to)),t.selections&&n._acceptSelections(t.selections.selections.map(uM.to)),t.visibleRanges&&this._onDidChangeNotebookEditorVisibleRanges.fire({notebookEditor:n.apiEditor,visibleRanges:n.apiEditor.visibleRanges}),t.selections&&this._onDidChangeNotebookEditorSelection.fire(Object.freeze({notebookEditor:n.apiEditor,selections:n.apiEditor.selections}))}$acceptEditorViewColumns(e){for(let t in e)this._notebooksAndEditors.getEditorById(t)._acceptViewColumn(pj.to(e[t]))}};_Y=A([j(0,Ds)],_Y);var vY;(function(e){e[e.Output=1]=`Output`,e[e.OutputItems=2]=`OutputItems`,e[e.ExecutionState=3]=`ExecutionState`})(vY||={});var yY;(function(e){e[e.Disconnected=1]=`Disconnected`,e[e.Connected=2]=`Connected`,e[e.Initializing=3]=`Initializing`})(yY||={});let bY=class{constructor(e,t,n,r,i){this._initData=t,this._extHostNotebook=n,this._commands=r,this._logService=i,this._activeExecutions=new Ne,this._activeNotebookExecutions=new Ne,this._kernelDetectionTask=new Map,this._kernelDetectionTaskHandlePool=0,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProviderHandlePool=0,this._kernelData=new Map,this._handlePool=0,this.id=0,this.variableStore={},this._proxy=e.getProxy(E.MainThreadNotebookKernels);let a=new VI(`notebook.selectKernel`,`_notebook.selectKernel`,`Trigger kernel picker for specified notebook editor widget`,[new X(`options`,`Select kernel options`,e=>!0,e=>{if(e&&`notebookEditor`in e&&`id`in e){let t=this._extHostNotebook.getIdByEditor(e.notebookEditor);return{id:e.id,extension:e.extension,notebookEditorId:t}}else if(e&&`notebookEditor`in e){let t=this._extHostNotebook.getIdByEditor(e.notebookEditor);if(t===void 0)throw Error(`Cannot invoke 'notebook.selectKernel' for unrecognized notebook editor ${e.notebookEditor.notebook.uri.toString()}`);return`skipIfAlreadySelected`in e?{notebookEditorId:t,skipIfAlreadySelected:e.skipIfAlreadySelected}:{notebookEditorId:t}}return e})],BI.Void),o=new VI(`vscode.executeNotebookVariableProvider`,`_executeNotebookVariableProvider`,`Execute notebook variable provider`,[X.Uri],new BI(`A promise that resolves to an array of variables`,(e,t)=>e.map(e=>({variable:{name:e.name,value:e.value,expression:e.expression,type:e.type,language:e.language},hasNamedChildren:e.hasNamedChildren,indexedChildrenCount:e.indexedChildrenCount}))));this._commands.registerApiCommand(a),this._commands.registerApiCommand(o)}createNotebookController(e,t,n,r,i,a){for(let n of this._kernelData.values())if(n.controller.id===t&&ys.equals(e.identifier,n.extensionId))throw Error(`notebook controller with id '${t}' ALREADY exist`);let o=this._handlePool++,s=this;this._logService.trace(`NotebookController[${o}], CREATED by ${e.identifier.value}, ${t}`);let c=()=>console.warn(`NO execute handler from notebook controller '${f.id}' of extension: '${e.identifier}'`),l=!1,u=new S,d=new S,f={id:DY(e.identifier,t),notebookType:n,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:r||e.identifier.value,preloads:a?a.map(xM.from):[]},p=i??c,m,h,ee;this._proxy.$addKernel(o,f).catch(e=>{console.log(e),l=!0});let te=0,g=()=>{if(l)return;let e=++te;Promise.resolve().then(()=>{e===te&&this._proxy.$updateKernel(o,f)})},ne=new Ne,re={get id(){return t},get notebookType(){return f.notebookType},onDidChangeSelectedNotebooks:u.event,get label(){return f.label},set label(t){f.label=t??e.displayName??e.name,g()},get detail(){return f.detail??``},set detail(e){f.detail=e,g()},get description(){return f.description??``},set description(e){f.description=e,g()},get supportedLanguages(){return f.supportedLanguages},set supportedLanguages(e){f.supportedLanguages=e,g()},get supportsExecutionOrder(){return f.supportsExecutionOrder??!1},set supportsExecutionOrder(e){f.supportsExecutionOrder=e,g()},get rendererScripts(){return f.preloads?f.preloads.map(xM.to):[]},get executeHandler(){return p},set executeHandler(e){p=e??c},get interruptHandler(){return m},set interruptHandler(e){m=e,f.supportsInterrupt=!!e,g()},set variableProvider(t){K(e,`notebookVariableProvider`),ee?.dispose(),h=t,f.hasVariableProvider=!!t,ee=t?.onDidChangeVariables(e=>s._proxy.$variablesUpdated(e.uri)),g()},get variableProvider(){return h},createNotebookCellExecution(t){if(l)throw Error(`notebook controller is DISPOSED`);if(!ne.has(t.notebook.uri))throw s._logService.trace(`NotebookController[${o}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(ne.keys()).map(e=>e.toString())),Error(`notebook controller is NOT associated to notebook: ${t.notebook.uri.toString()}`);return s._createNotebookCellExecution(t,DY(e.identifier,this.id))},createNotebookExecution(t){if(K(e,`notebookExecution`),l)throw Error(`notebook controller is DISPOSED`);if(!ne.has(t.uri))throw s._logService.trace(`NotebookController[${o}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(ne.keys()).map(e=>e.toString())),Error(`notebook controller is NOT associated to notebook: ${t.uri.toString()}`);return s._createNotebookExecution(t,DY(e.identifier,this.id))},dispose:()=>{l||(this._logService.trace(`NotebookController[${o}], DISPOSED`),l=!0,this._kernelData.delete(o),u.dispose(),d.dispose(),ee?.dispose(),this._proxy.$removeKernel(o))},updateNotebookAffinity(t,n){n===MO.Hidden&&K(e,`notebookControllerAffinityHidden`),s._proxy.$updateNotebookPriority(o,t.uri,n)},onDidReceiveMessage:d.event,postMessage(t,n){return K(e,`notebookMessaging`),s._proxy.$postMessage(o,n&&s._extHostNotebook.getIdByEditor(n),t)},asWebviewUri(t){return K(e,`notebookMessaging`),ZU(t,s._initData.remote)}};return this._kernelData.set(o,{extensionId:e.identifier,controller:re,onDidReceiveMessage:d,onDidChangeSelection:u,associatedNotebooks:ne}),re}getIdByController(e){for(let[t,n]of this._kernelData)if(n.controller===e)return DY(n.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){let n=this._kernelDetectionTaskHandlePool++,r=this;this._logService.trace(`NotebookControllerDetectionTask[${n}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(n,t);let i={dispose:()=>{this._kernelDetectionTask.delete(n),r._proxy.$removeKernelDetectionTask(n)}};return this._kernelDetectionTask.set(n,i),i}registerKernelSourceActionProvider(e,t,n){let r=this._kernelSourceActionProviderHandlePool++,i=typeof n.onDidChangeNotebookKernelSourceActions==`function`?r:void 0,a=this;this._kernelSourceActionProviders.set(r,n),this._logService.trace(`NotebookKernelSourceActionProvider[${r}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(r,r,t);let o;return i!==void 0&&(o=n.onDidChangeNotebookKernelSourceActions(e=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(i))),{dispose:()=>{this._kernelSourceActionProviders.delete(r),a._proxy.$removeKernelSourceActionProvider(r,r),o?.dispose()}}}async $provideKernelSourceActions(e,t){let n=this._kernelSourceActionProviders.get(e);if(n){let e=new v;return(await n.provideNotebookKernelSourceActions(t)??[]).map(t=>yM.from(t,this._commands.converter,e))}return[]}$acceptNotebookAssociation(e,t,n){let r=this._kernelData.get(e);if(r){let i=this._extHostNotebook.getNotebookDocument(w.revive(t));n?r.associatedNotebooks.set(i.uri,!0):r.associatedNotebooks.delete(i.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,i.uri.toString(),n),r.onDidChangeSelection.fire({selected:n,notebook:i.apiNotebook})}}async $executeCells(e,t,n){let r=this._kernelData.get(e);if(!r)return;let i=this._extHostNotebook.getNotebookDocument(w.revive(t)),a=[];for(let e of n){let t=i.getCell(e);t&&a.push(t.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,i.uri.toString(),a.length),await r.controller.executeHandler.call(r.controller,a,i.apiNotebook,r.controller)}catch(t){this._logService.error(`NotebookController[${e}] execute cells FAILED`,t),console.error(t)}}async $cancelCells(e,t,n){let r=this._kernelData.get(e);if(!r)return;let i=this._extHostNotebook.getNotebookDocument(w.revive(t));if(r.controller.interruptHandler)await r.controller.interruptHandler.call(r.controller,i.apiNotebook);else for(let e of n){let t=i.getCell(e);t&&this._activeExecutions.get(t.uri)?.cancel()}if(r.controller.interruptHandler){let e=this._activeNotebookExecutions.get(i.uri);this._activeNotebookExecutions.delete(i.uri),n.length&&Array.isArray(e)&&e.length&&e.forEach(e=>e.dispose())}}async $provideVariables(e,t,n,r,i,a,o){let s=this._kernelData.get(e);if(!s)return;let c=this._extHostNotebook.getNotebookDocument(w.revive(n)),l=s.controller.variableProvider;if(!l)return;let u;if(r!==void 0){if(u=this.variableStore[r],!u)return}else this.variableStore={};let d=i===`named`?FO.Named:FO.Indexed,f=l.provideVariables(c.apiNotebook,u,d,a,o),p=0;for await(let e of f){if(o.isCancellationRequested)return;let n={id:this.id++,name:e.variable.name,value:e.variable.value,type:e.variable.type,interfaces:e.variable.interfaces,language:e.variable.language,expression:e.variable.expression,hasNamedChildren:e.hasNamedChildren,indexedChildrenCount:e.indexedChildrenCount,extensionId:s.extensionId.value};if(this.variableStore[n.id]=e.variable,this._proxy.$receiveVariable(t,n),p++>=100)return}}$acceptKernelMessageFromRenderer(e,t,n){let r=this._kernelData.get(e);if(!r)return;let i=this._extHostNotebook.getEditorById(t);r.onDidReceiveMessage.fire(Object.freeze({editor:i.apiEditor,message:n}))}_createNotebookCellExecution(e,t){if(e.index<0)throw Error(`CANNOT execute cell that has been REMOVED from notebook`);let n=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!n)throw Error(`invalid cell`);if(this._activeExecutions.has(n.uri))throw Error(`duplicate execution for ${n.uri}`);let r=new SY(t,n,this._proxy);this._activeExecutions.set(n.uri,r);let i=r.onDidChangeState(()=>{r.state===xY.Resolved&&(r.dispose(),i.dispose(),this._activeExecutions.delete(n.uri))});return r.asApiObject()}_createNotebookExecution(e,t){let n=this._extHostNotebook.getNotebookDocument(e.uri),r=e.getCells().find(e=>{let t=n.getCellFromApiCell(e);return t&&this._activeExecutions.has(t.uri)});if(r)throw Error(`duplicate cell execution for ${r.document.uri}`);if(this._activeNotebookExecutions.has(n.uri))throw Error(`duplicate notebook execution for ${n.uri}`);let i=new TY(t,n,this._proxy),a=i.onDidChangeState(()=>{i.state===wY.Resolved&&(i.dispose(),a.dispose(),this._activeNotebookExecutions.delete(n.uri))});return this._activeNotebookExecutions.set(n.uri,[i,a]),i.asApiObject()}};bY=A([j(4,Ds)],bY);var xY;(function(e){e[e.Init=0]=`Init`,e[e.Started=1]=`Started`,e[e.Resolved=2]=`Resolved`})(xY||={});var SY=class e extends y{static{this.HANDLE=0}get state(){return this._state}constructor(t,n,r){super(),this._cell=n,this._proxy=r,this._handle=e.HANDLE++,this._onDidChangeState=this._register(new S),this.onDidChangeState=this._onDidChangeState.event,this._state=xY.Init,this._tokenSource=this._register(new Ii),this._collector=new EY(10,e=>this.update(e)),this._executionOrder=n.internalMetadata.executionOrder,this._proxy.$createExecution(this._handle,t,this._cell.notebook.uri,this._cell.handle)}cancel(){this._tokenSource.cancel()}async updateSoon(e){await this._collector.addItem(e)}async update(e){let t=Array.isArray(e)?e:[e];return this._proxy.$updateExecution(this._handle,new _i(t))}verifyStateForOutput(){if(this._state===xY.Init)throw Error(`Must call start before modifying cell output`);if(this._state===xY.Resolved)throw Error(`Cannot modify cell output after calling resolve`)}cellIndexToHandle(e){let t=this._cell;if(e&&(t=this._cell.notebook.getCellFromApiCell(e)),!t)throw Error(`INVALID cell`);return t.handle}validateAndConvertOutputs(e){return e.map(e=>{let t=yT.ensureUniqueMimeTypes(e.items,!0);return t===e.items?gM.from(e):gM.from({items:t,id:e.id,metadata:e.metadata})})}async updateOutputs(e,t,n){let r=this.cellIndexToHandle(t),i=this.validateAndConvertOutputs(be(e));return this.updateSoon({editType:vY.Output,cellHandle:r,append:n,outputs:i})}async updateOutputItems(e,t,n){return e=yT.ensureUniqueMimeTypes(be(e),!0),this.updateSoon({editType:vY.OutputItems,items:e.map(hM.from),outputId:t.id,append:n})}asApiObject(){let e=this;return Object.freeze({get token(){return e._tokenSource.token},get cell(){return e._cell.apiCell},get executionOrder(){return e._executionOrder},set executionOrder(t){e._executionOrder=t,e.update([{editType:vY.ExecutionState,executionOrder:e._executionOrder}])},start(t){if(e._state===xY.Resolved||e._state===xY.Started)throw Error(`Cannot call start again`);e._state=xY.Started,e._onDidChangeState.fire(),e.update({editType:vY.ExecutionState,runStartTime:t})},end(t,n,r){if(e._state===xY.Resolved)throw Error(`Cannot call resolve twice`);e._state=xY.Resolved,e._onDidChangeState.fire(),e._collector.flush();let i=CY(r);e._proxy.$completeExecution(e._handle,new _i({runEndTime:n,lastRunSuccess:t,error:i}))},clearOutput(t){return e.verifyStateForOutput(),e.updateOutputs([],t,!1)},appendOutput(t,n){return e.verifyStateForOutput(),e.updateOutputs(t,n,!0)},replaceOutput(t,n){return e.verifyStateForOutput(),e.updateOutputs(t,n,!1)},appendOutputItems(t,n){return e.verifyStateForOutput(),e.updateOutputItems(t,n,!0)},replaceOutputItems(t,n){return e.verifyStateForOutput(),e.updateOutputItems(t,n,!1)}})}};function CY(e){let t=e=>e?{startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character}:void 0,n=e=>({uri:e.uri,position:e.position,label:e.label});return e?{name:e.name,message:e.message,stack:e.stack instanceof Array?e.stack.map(e=>n(e)):e.stack,location:t(e.location),uri:e.uri}:void 0}var wY;(function(e){e[e.Init=0]=`Init`,e[e.Started=1]=`Started`,e[e.Resolved=2]=`Resolved`})(wY||={});var TY=class e extends y{static{this.HANDLE=0}get state(){return this._state}constructor(t,n,r){super(),this._notebook=n,this._proxy=r,this._handle=e.HANDLE++,this._onDidChangeState=this._register(new S),this.onDidChangeState=this._onDidChangeState.event,this._state=wY.Init,this._tokenSource=this._register(new Ii),this._proxy.$createNotebookExecution(this._handle,t,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===wY.Resolved||this._state===wY.Started)throw Error(`Cannot call start again`);this._state=wY.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===wY.Resolved)throw Error(`Cannot call resolve twice`);this._state=wY.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}},EY=class{constructor(e,t){this.delay=e,this.callback=t,this.batch=[],this.startedTimer=Date.now()}addItem(e){return this.batch.push(e),this.currentDeferred||(this.currentDeferred=new Ro,this.startedTimer=Date.now(),Eo(this.delay).then(()=>this.flush())),Date.now()-this.startedTimer>this.delay?this.flush():this.currentDeferred.p}flush(){if(this.batch.length===0||!this.currentDeferred)return Promise.resolve();let e=this.currentDeferred;this.currentDeferred=void 0;let t=this.batch;return this.batch=[],this.callback(t).finally(()=>e.complete())}};function DY(e,t){return`${e.value}/${t}`}var OY=class{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(E.MainThreadNotebookRenderers)}$postRendererMessage(e,t,n){let r=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:r.apiEditor,message:n})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(e=>e.id===t))throw Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(e,n,r)=>this.getOrCreateEmitterFor(t).event(e,n,r),postMessage:(e,n)=>{mJ.apiEditorsToExtHost.has(e)&&([e,n]=[n,e]);let r=n&&mJ.apiEditorsToExtHost.get(n);return this.proxy.$postMessage(r?.id,t,e)}}}getOrCreateEmitterFor(e){let t=this._rendererMessageEmitters.get(e);return t||(t=new S({onDidRemoveLastListener:()=>{t?.dispose(),this._rendererMessageEmitters.delete(e)}}),this._rendererMessageEmitters.set(e,t),t)}},kY=class{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(E.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,n){if(K(e,`profileContentHandlers`),this.handlers.has(t))throw Error(`Handler with id '${t}' already registered`);return this.handlers.set(t,n),this.proxy.$registerProfileContentHandler(t,n.name,n.description,e.identifier.value),_(()=>{this.handlers.delete(t),this.proxy.$unregisterProfileContentHandler(t)})}async $saveProfile(e,t,n,r){let i=this.handlers.get(e);if(!i)throw Error(`Unknown handler with id: ${e}`);return i.saveProfile(t,n,r)}async $readProfile(e,t,n){let r=this.handlers.get(e);if(!r)throw Error(`Unknown handler with id: ${e}`);return r.readProfile(Ge(t)?t:w.revive(t),n)}},AY=class e{static{this.handlePool=0}constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(E.MainThreadQuickDiff)}$provideOriginalResource(e,t,n){let r=w.revive(t),i=this.providers.get(e);return i?go(()=>i.provideOriginalResource(r,n)).then(e=>e||null):Promise.resolve(null)}registerQuickDiffProvider(t,n,r,i,a,o){let s=e.handlePool++;this.providers.set(s,r);let c=ys.toKey(t.identifier);return this.proxy.$registerQuickDiffProvider(s,cj.from(n,this.uriTransformer),`${c}.${i}`,a,o),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(s),this.providers.delete(s)}}}};function jY(e,t,n){let r=e.getProxy(E.MainThreadQuickOpen);class i{constructor(e,t){this._sessions=new Map,this._instances=0,this._workspace=e,this._commands=t}showQuickPick(e,t,n,i=Pi.None){this._onDidSelectItem=void 0;let a=Promise.resolve(t),o=++this._instances,s=r.$show(o,{title:n?.title,placeHolder:n?.placeHolder,prompt:n?.prompt,matchOnDescription:n?.matchOnDescription,matchOnDetail:n?.matchOnDetail,ignoreFocusLost:n?.ignoreFocusOut,canPickMany:n?.canPickMany},i),c={},l=s.then(()=>c);return Promise.race([l,a]).then(t=>{if(t!==c)return a.then(t=>{let i=[];for(let n=0;n<t.length;n++){let r=t[n];typeof r==`string`?i.push({label:r,handle:n}):r.kind===bO.Separator?i.push({type:`separator`,label:r.label}):(r.tooltip&&K(e,`quickPickItemTooltip`),i.push({label:r.label,iconPathDto:NN.from(r.iconPath),description:r.description,detail:r.detail,picked:r.picked,alwaysShow:r.alwaysShow,tooltip:Y.fromStrict(r.tooltip),resourceUri:r.resourceUri,handle:n}))}return n&&typeof n.onDidSelectItem==`function`&&(this._onDidSelectItem=e=>{n.onDidSelectItem(t[e])}),r.$setItems(o,i),s.then(e=>{if(typeof e==`number`)return t[e];if(Array.isArray(e))return e.map(e=>t[e])})})}).then(void 0,e=>{if(!d(e))return r.$setError(o,e),Promise.reject(e)})}$onItemSelected(e){this._onDidSelectItem?.(e)}showInput(e,t=Pi.None){return this._validateInput=e?.validateInput,r.$input(e,typeof this._validateInput==`function`,t).then(void 0,e=>{if(!d(e))return Promise.reject(e)})}async $validateInput(e){if(!this._validateInput)return;let t=await this._validateInput(e);if(!t||typeof t==`string`)return t;let n;switch(t.severity){case xO.Info:n=Dc.Info;break;case xO.Warning:n=Dc.Warning;break;case xO.Error:n=Dc.Error;break;default:n=t.message?Dc.Error:Dc.Ignore;break}return{content:t.message,severity:n}}async showWorkspaceFolderPick(e,t=Pi.None){let n=await this._commands.executeCommand(`_workbench.pickWorkspaceFolder`,[e]);if(!n)return;let r=await this._workspace.getWorkspaceFolders2();if(r)return r.find(e=>e.uri.toString()===n.uri.toString())}createQuickPick(e){let t=new o(e,()=>this._sessions.delete(t._id));return this._sessions.set(t._id,t),t}createInputBox(e){let t=new s(e,()=>this._sessions.delete(t._id));return this._sessions.set(t._id,t),t}$onDidChangeValue(e,t){this._sessions.get(e)?._fireDidChangeValue(t)}$onDidAccept(e){this._sessions.get(e)?._fireDidAccept()}$onDidChangeActive(e,t){let n=this._sessions.get(e);n instanceof o&&n._fireDidChangeActive(t)}$onDidChangeSelection(e,t){let n=this._sessions.get(e);n instanceof o&&n._fireDidChangeSelection(t)}$onDidTriggerButton(e,t,n){this._sessions.get(e)?._fireDidTriggerButton(t,n)}$onDidTriggerItemButton(e,t,n,r){let i=this._sessions.get(e);i instanceof o&&i._fireDidTriggerItemButton(t,n,r)}$onDidHide(e){this._sessions.get(e)?._fireDidHide()}}class a{static{this._nextId=1}constructor(e,t){this._extension=e,this._onDidDispose=t,this._id=o._nextId++,this._visible=!1,this._expectingHide=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!0,this._value=``,this._valueSelection=void 0,this._buttons=[],this._handlesToButtons=new Map,this._onDidAcceptEmitter=new S,this._onDidChangeValueEmitter=new S,this._onDidTriggerButtonEmitter=new S,this._onDidHideEmitter=new S,this._pendingUpdate={id:this._id},this._disposed=!1,this._disposables=[this._onDidTriggerButtonEmitter,this._onDidHideEmitter,this._onDidAcceptEmitter,this._onDidChangeValueEmitter],this.onDidChangeValue=this._onDidChangeValueEmitter.event,this.onDidAccept=this._onDidAcceptEmitter.event,this.onDidTriggerButton=this._onDidTriggerButtonEmitter.event,this.onDidHide=this._onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update({title:e})}get step(){return this._steps}set step(e){this._steps=e,this.update({step:e})}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update({totalSteps:e})}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update({enabled:e})}get busy(){return this._busy}set busy(e){this._busy=e,this.update({busy:e})}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){this._ignoreFocusOut=e,this.update({ignoreFocusOut:e})}get value(){return this._value}set value(e){this._value=e,this.update({value:e})}get valueSelection(){return this._valueSelection}set valueSelection(e){this._valueSelection=e,this.update({valueSelection:e})}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update({placeholder:e})}get buttons(){return this._buttons}set buttons(e){this._buttons=e.slice(),this._handlesToButtons.clear(),e.forEach((e,t)=>{let n=e===yO.Back?-1:t;this._handlesToButtons.set(n,e)}),this.update({buttons:e.map((e,t)=>({iconPathDto:NN.from(e.iconPath),tooltip:e.tooltip,handle:e===yO.Back?-1:t,location:typeof e.location==`number`?e.location:void 0,toggle:typeof e.toggle==`object`&&typeof e.toggle.checked==`boolean`?{checked:e.toggle.checked}:void 0}))})}show(){this._visible=!0,this._expectingHide=!0,this.update({visible:!0})}hide(){this._visible=!1,this.update({visible:!1})}_fireDidAccept(){this._onDidAcceptEmitter.fire()}_fireDidChangeValue(e){this._value=e,this._onDidChangeValueEmitter.fire(e)}_fireDidTriggerButton(e,t){let n=this._handlesToButtons.get(e);n&&(t!==void 0&&n.toggle&&(n.toggle.checked=t),this._onDidTriggerButtonEmitter.fire(n))}_fireDidHide(){this._expectingHide&&(this._expectingHide=this._visible,this._onDidHideEmitter.fire())}dispose(){this._disposed||(this._disposed=!0,this._fireDidHide(),this._disposables=ht(this._disposables),this._updateTimeout&&=(clearTimeout(this._updateTimeout),void 0),this._onDidDispose(),r.$dispose(this._id))}update(e){if(!this._disposed){for(let t of Object.keys(e)){let n=e[t];this._pendingUpdate[t]=n===void 0?null:n}`visible`in this._pendingUpdate?(this._updateTimeout&&=(clearTimeout(this._updateTimeout),void 0),this.dispatchUpdate()):this._visible&&!this._updateTimeout&&(this._updateTimeout=setTimeout(()=>{this._updateTimeout=void 0,this.dispatchUpdate()},0))}}dispatchUpdate(){r.$createOrUpdate(this._pendingUpdate),this._pendingUpdate={id:this._id}}}class o extends a{constructor(e,t){super(e,t),this._items=[],this._handlesToItems=new Map,this._itemsToHandles=new Map,this._canSelectMany=!1,this._matchOnDescription=!0,this._matchOnDetail=!0,this._sortByLabel=!0,this._keepScrollPosition=!1,this._activeItems=[],this._onDidChangeActiveEmitter=new S,this._selectedItems=[],this._onDidChangeSelectionEmitter=new S,this._onDidTriggerItemButtonEmitter=new S,this.onDidChangeActive=this._onDidChangeActiveEmitter.event,this.onDidChangeSelection=this._onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this._onDidTriggerItemButtonEmitter.event,this._disposables.push(this._onDidChangeActiveEmitter,this._onDidChangeSelectionEmitter,this._onDidTriggerItemButtonEmitter),this.update({type:`quickPick`})}get items(){return this._items}set items(e){this._items=e.slice(),this._handlesToItems.clear(),this._itemsToHandles.clear(),e.forEach((e,t)=>{this._handlesToItems.set(t,e),this._itemsToHandles.set(e,t)});let t=[];for(let n=0;n<e.length;n++){let r=e[n];r.kind===bO.Separator?t.push({type:`separator`,label:r.label}):(r.tooltip&&K(this._extension,`quickPickItemTooltip`),t.push({handle:n,label:r.label,iconPathDto:NN.from(r.iconPath),description:r.description,detail:r.detail,picked:r.picked,alwaysShow:r.alwaysShow,tooltip:Y.fromStrict(r.tooltip),resourceUri:r.resourceUri,buttons:r.buttons?.map((e,t)=>({iconPathDto:NN.from(e.iconPath),tooltip:e.tooltip,handle:t,toggle:typeof e.toggle==`object`&&typeof e.toggle.checked==`boolean`?{checked:e.toggle.checked}:void 0}))}))}this.update({items:t})}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update({canSelectMany:e})}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update({matchOnDescription:e})}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update({matchOnDetail:e})}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update({sortByLabel:e})}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e,this.update({keepScrollPosition:e})}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.update({prompt:e})}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e.filter(e=>this._itemsToHandles.has(e)),this.update({activeItems:this._activeItems.map(e=>this._itemsToHandles.get(e))})}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e.filter(e=>this._itemsToHandles.has(e)),this.update({selectedItems:this._selectedItems.map(e=>this._itemsToHandles.get(e))})}_fireDidChangeActive(e){let t=pe(e.map(e=>this._handlesToItems.get(e)));this._activeItems=t,this._onDidChangeActiveEmitter.fire(t)}_fireDidChangeSelection(e){let t=pe(e.map(e=>this._handlesToItems.get(e)));this._selectedItems=t,this._onDidChangeSelectionEmitter.fire(t)}_fireDidTriggerItemButton(e,t,n){let r=this._handlesToItems.get(e);if(!r||!r.buttons||!r.buttons.length)return;let i=r.buttons[t];i&&(n!==void 0&&i.toggle&&(i.toggle.checked=n),this._onDidTriggerItemButtonEmitter.fire({button:i,item:r}))}}class s extends a{constructor(e,t){super(e,t),this._password=!1,this.update({type:`inputBox`})}get password(){return this._password}set password(e){this._password=e,this.update({password:e})}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.update({prompt:e})}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,e?typeof e==`string`?this.update({validationMessage:e,severity:Dc.Error}):this.update({validationMessage:e.message,severity:e.severity??Dc.Error}):this.update({validationMessage:void 0,severity:Dc.Ignore})}}return new i(t,n)}const MY=new n(()=>{let e=nR.Collator(void 0,{numeric:!0,sensitivity:`base`}).value;return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}});new n(()=>({collator:nR.Collator(void 0,{numeric:!0}).value})),new n(()=>({collator:nR.Collator(void 0,{numeric:!0,sensitivity:`accent`}).value}));function NY(e,t,n=!1){let r=e||``,i=t||``,a=MY.value.collator.compare(r,i);return MY.value.collatorIsNumeric&&a===0&&r!==i?r<i?-1:1:a}function PY(e,t,n=!1){return n||(e&&=e.toLowerCase(),t&&=t.toLowerCase()),e===t?0:e<t?-1:1}function FY(e,t,n=!1){let r=e.split(Jr),i=t.split(Jr),a=r.length-1,o=i.length-1,s,c;for(let e=0;;e++){if(s=a===e,c=o===e,s&&c)return NY(r[e],i[e],n);if(s)return-1;if(c)return 1;let t=PY(r[e],i[e],n);if(t!==0)return t}}function IY(e){return e instanceof w}function LY(e,t){return e.scheme===O.file&&t.scheme===O.file&&xn?e.toString()===t.toString():e.toString().toLowerCase()===t.toString().toLowerCase()}function RY(e){if(e){if(typeof e.iconPath==`string`)return w.file(e.iconPath);if(w.isUri(e.iconPath)||fl.isThemeIcon(e.iconPath))return e.iconPath}}function zY(e){if(e){if(w.isUri(e)||fl.isThemeIcon(e))return e;{let t=e;return{light:t.light,dark:t.dark}}}}function BY(e){let t=zY(e.authorIcon),n=Array.isArray(e.tooltip)?Y.fromMany(e.tooltip):e.tooltip?Y.from(e.tooltip):void 0,r=e.references?.map(e=>({...e,icon:zY(e.icon)}));return{...e,authorIcon:t,references:r,tooltip:n}}function VY(e){return e?{...e,icon:zY(e.icon)}:void 0}function HY(e,t){return!e.iconPath&&!t.iconPath?0:e.iconPath?t.iconPath?FY(typeof e.iconPath==`string`?e.iconPath:w.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id,typeof t.iconPath==`string`?t.iconPath:w.isUri(t.iconPath)?t.iconPath.fsPath:t.iconPath.id):1:-1}function UY(e,t){let n=0;if(e.strikeThrough!==t.strikeThrough)return e.strikeThrough?1:-1;if(e.faded!==t.faded)return e.faded?1:-1;if(e.tooltip!==t.tooltip)return(e.tooltip||``).localeCompare(t.tooltip||``);if(n=HY(e,t),n!==0)return n;if(e.light&&t.light)n=HY(e.light,t.light);else if(e.light)return 1;else if(t.light)return-1;if(n!==0)return n;if(e.dark&&t.dark)n=HY(e.dark,t.dark);else if(e.dark)return 1;else if(t.dark)return-1;return n}function WY(e,t){if(e.command!==t.command)return e.command<t.command?-1:1;if(e.title!==t.title)return e.title<t.title?-1:1;if(e.tooltip!==t.tooltip){if(e.tooltip!==void 0&&t.tooltip!==void 0)return e.tooltip<t.tooltip?-1:1;if(e.tooltip!==void 0)return 1;if(t.tooltip!==void 0)return-1}if(e.arguments===t.arguments)return 0;if(!e.arguments)return-1;if(!t.arguments)return 1;if(e.arguments.length!==t.arguments.length)return e.arguments.length-t.arguments.length;for(let n=0;n<e.arguments.length;n++){let r=e.arguments[n],i=t.arguments[n];if(r!==i&&!(IY(r)&&IY(i)&&LY(r,i)))return r<i?-1:1}return 0}function GY(e,t){let n=FY(e.resourceUri.fsPath,t.resourceUri.fsPath,!0);if(n!==0)return n;if(e.command&&t.command)n=WY(e.command,t.command);else if(e.command)return 1;else if(t.command)return-1;if(n!==0)return n;if(e.decorations&&t.decorations)n=UY(e.decorations,t.decorations);else if(e.decorations)return 1;else if(t.decorations)return-1;if(n!==0)return n;if(e.multiFileDiffEditorModifiedUri&&t.multiFileDiffEditorModifiedUri)n=FY(e.multiFileDiffEditorModifiedUri.fsPath,t.multiFileDiffEditorModifiedUri.fsPath,!0);else if(e.multiFileDiffEditorModifiedUri)return 1;else if(t.multiFileDiffEditorModifiedUri)return-1;if(n!==0)return n;if(e.multiDiffEditorOriginalUri&&t.multiDiffEditorOriginalUri)n=FY(e.multiDiffEditorOriginalUri.fsPath,t.multiDiffEditorOriginalUri.fsPath,!0);else if(e.multiDiffEditorOriginalUri)return 1;else if(t.multiDiffEditorOriginalUri)return-1;return n}function KY(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function qY(e,t){return e.command===t.command&&e.title===t.title&&e.tooltip===t.tooltip&&(e.arguments&&t.arguments?KY(e.arguments,t.arguments):e.arguments===t.arguments)}function JY(e,t){return se(e,t,qY)}var YY=class{#e;#t;get value(){return this._value}set value(e){e??=``,this.#e.$setInputBoxValue(this._sourceControlHandle,e),this.updateValue(e)}get onDidChange(){return this._onDidChange.event}get placeholder(){return this._placeholder}set placeholder(e){this.#e.$setInputBoxPlaceholder(this._sourceControlHandle,e),this._placeholder=e}get validateInput(){return K(this._extension,`scmValidation`),this._validateInput}set validateInput(e){if(K(this._extension,`scmValidation`),e&&typeof e!=`function`)throw Error(`[${this._extension.identifier.value}]: Invalid SCM input box validation function`);this._validateInput=e,this.#e.$setValidationProviderIsEnabled(this._sourceControlHandle,!!e)}get enabled(){return this._enabled}set enabled(e){e=!!e,this._enabled!==e&&(this._enabled=e,this.#e.$setInputBoxEnablement(this._sourceControlHandle,e))}get visible(){return this._visible}set visible(e){e=!!e,this._visible!==e&&(this._visible=e,this.#e.$setInputBoxVisibility(this._sourceControlHandle,e))}get document(){return K(this._extension,`scmTextDocument`),this.#t.getDocument(this._documentUri)}constructor(e,t,n,r,i){this._extension=e,this._sourceControlHandle=r,this._documentUri=i,this._value=``,this._onDidChange=new S,this._placeholder=``,this._enabled=!0,this._visible=!0,this.#t=t,this.#e=n}showValidationMessage(e,t){K(this._extension,`scmValidation`),this.#e.$showValidationMessage(this._sourceControlHandle,e,IN.from(t))}$onInputBoxValueChange(e){this.updateValue(e)}updateValue(e){this._value=e,this._onDidChange.fire(e)}},XY=class e{static{this._handlePool=0}get disposed(){return this._disposed}get id(){return this._id}get label(){return this._label}set label(e){this._label=e,this._proxy.$updateGroupLabel(this._sourceControlHandle,this.handle,e)}get contextValue(){return this._contextValue}set contextValue(e){this._contextValue=e,this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features)}get hideWhenEmpty(){return this._hideWhenEmpty}set hideWhenEmpty(e){this._hideWhenEmpty=e,this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features)}get features(){return{contextValue:this.contextValue,hideWhenEmpty:this.hideWhenEmpty}}get resourceStates(){return[...this._resourceStates]}set resourceStates(e){this._resourceStates=[...e],this._onDidUpdateResourceStates.fire()}constructor(t,n,r,i,a,o,s){this._proxy=t,this._commands=n,this._sourceControlHandle=r,this._id=i,this._label=a,this.multiDiffEditorEnableViewChanges=o,this._extension=s,this._resourceHandlePool=0,this._resourceStates=[],this._resourceStatesMap=new Map,this._resourceStatesCommandsMap=new Map,this._resourceStatesDisposablesMap=new Map,this._onDidUpdateResourceStates=new S,this.onDidUpdateResourceStates=this._onDidUpdateResourceStates.event,this._disposed=!1,this._onDidDispose=new S,this.onDidDispose=this._onDidDispose.event,this._handlesSnapshot=[],this._resourceSnapshot=[],this._contextValue=void 0,this._hideWhenEmpty=void 0,this.handle=e._handlePool++}getResourceState(e){return this._resourceStatesMap.get(e)}$executeResourceCommand(e,t){let n=this._resourceStatesCommandsMap.get(e);return n?go(()=>this._commands.executeCommand(n.command,...n.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){let e=[...this._resourceStates].sort(GY),t=de(this._resourceSnapshot,e,GY).map(e=>{let t=e.toInsert.map(e=>{let t=this._resourceHandlePool++;this._resourceStatesMap.set(t,e);let n=e.resourceUri,r;if(e.command)if(e.command.command===`vscode.open`||e.command.command===`vscode.diff`||e.command.command===`vscode.changes`){let n=new v;r=this._commands.converter.toInternal(e.command,n),this._resourceStatesDisposablesMap.set(t,n)}else this._resourceStatesCommandsMap.set(t,e.command);let i=Dw(this._extension),a=i?e.multiDiffEditorOriginalUri:void 0,o=i?e.multiFileDiffEditorModifiedUri:void 0,s=RY(e.decorations);return{rawResource:[t,n,[e.decorations&&RY(e.decorations.light)||s,e.decorations&&RY(e.decorations.dark)||s],e.decorations&&e.decorations.tooltip||``,e.decorations&&!!e.decorations.strikeThrough,e.decorations&&!!e.decorations.faded,e.contextValue||``,r,a,o],handle:t}});return{start:e.start,deleteCount:e.deleteCount,toInsert:t}}),n=t.map(({start:e,deleteCount:t,toInsert:n})=>[e,t,n.map(e=>e.rawResource)]),r=t.reverse();for(let{start:e,deleteCount:t,toInsert:n}of r){let r=n.map(e=>e.handle),i=this._handlesSnapshot.splice(e,t,...r);for(let e of i)this._resourceStatesMap.delete(e),this._resourceStatesCommandsMap.delete(e),this._resourceStatesDisposablesMap.get(e)?.dispose(),this._resourceStatesDisposablesMap.delete(e)}return this._resourceSnapshot=e,n}dispose(){this._disposed=!0,this._onDidDispose.fire(),this._onDidUpdateResourceStates.dispose(),this._onDidDispose.dispose()}},ZY=class e{static{this._handlePool=0}#e;get id(){return this._id}get label(){return this._label}get rootUri(){return this._rootUri}get contextValue(){return K(this._extension,`scmProviderOptions`),this._contextValue}set contextValue(e){K(this._extension,`scmProviderOptions`),this._contextValue!==e&&(this._contextValue=e,this.#e.$updateSourceControl(this.handle,{contextValue:e}))}get inputBox(){return this._inputBox}get count(){return this._count}set count(e){this._count!==e&&(this._count=e,this.#e.$updateSourceControl(this.handle,{count:e}))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;Dw(this._extension)&&(t=e?.label),this.#e.$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t})}get secondaryQuickDiffProvider(){return K(this._extension,`quickDiffProvider`),this._secondaryQuickDiffProvider}set secondaryQuickDiffProvider(e){K(this._extension,`quickDiffProvider`),this._secondaryQuickDiffProvider=e;let t=e?.label;this.#e.$updateSourceControl(this.handle,{hasSecondaryQuickDiffProvider:!!e,secondaryQuickDiffLabel:t})}get historyProvider(){return K(this._extension,`scmHistoryProvider`),this._historyProvider}set historyProvider(e){K(this._extension,`scmHistoryProvider`),this._historyProvider=e,this._historyProviderDisposable.value=new v,this.#e.$updateSourceControl(this.handle,{hasHistoryProvider:!!e}),e&&(this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemRefs(()=>{let t=VY(e?.currentHistoryItemRef),n=VY(e?.currentHistoryItemRemoteRef),r=VY(e?.currentHistoryItemBaseRef);this.#e.$onDidChangeHistoryProviderCurrentHistoryItemRefs(this.handle,t,n,r)})),this._historyProviderDisposable.value.add(e.onDidChangeHistoryItemRefs(e=>{if(e.added.length===0&&e.modified.length===0&&e.removed.length===0)return;let t=e.added.map(e=>({...e,icon:zY(e.icon)})),n=e.modified.map(e=>({...e,icon:zY(e.icon)})),r=e.removed.map(e=>({...e,icon:zY(e.icon)}));this.#e.$onDidChangeHistoryProviderHistoryItemRefs(this.handle,{added:t,modified:n,removed:r,silent:e.silent})})))}get artifactProvider(){return K(this._extension,`scmArtifactProvider`),this._artifactProvider}set artifactProvider(e){K(this._extension,`scmArtifactProvider`),this._artifactProvider=e,this._artifactProviderDisposable.value=new v,this.#e.$updateSourceControl(this.handle,{hasArtifactProvider:!!e}),e&&this._artifactProviderDisposable.value.add(e.onDidChangeArtifacts(e=>{e.length!==0&&this.#e.$onDidChangeArtifacts(this.handle,e)}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,this.#e.$updateSourceControl(this.handle,{commitTemplate:e}))}get acceptInputCommand(){return this._acceptInputCommand}set acceptInputCommand(e){this._acceptInputDisposables.value=new v,this._acceptInputCommand=e;let t=this._commands.converter.toInternal(e,this._acceptInputDisposables.value);this.#e.$updateSourceControl(this.handle,{acceptInputCommand:t})}get actionButton(){return K(this._extension,`scmActionButton`),this._actionButton}set actionButton(e){if(K(this._extension,`scmActionButton`),m_(this._actionButton,e))return;let t=this._actionButtonDisposables;this._actionButtonDisposables=new v,this._actionButton=e;let n=e===void 0?null:{command:{...this._commands.converter.toInternal(e.command,this._actionButtonDisposables),shortTitle:e.command.shortTitle},secondaryCommands:e.secondaryCommands?.map(e=>e.map(e=>this._commands.converter.toInternal(e,this._actionButtonDisposables))),enabled:e.enabled};this.#e.$updateSourceControl(this.handle,{actionButton:n}).finally(()=>t.dispose())}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&JY(this._statusBarCommands,e))return;let t=this._statusBarDisposables;this._statusBarDisposables=new v,this._statusBarCommands=e;let n=(e||[]).map(e=>this._commands.converter.toInternal(e,this._statusBarDisposables));this.#e.$updateSourceControl(this.handle,{statusBarCommands:n}).finally(()=>t.dispose())}get selected(){return this._selected}constructor(t,n,r,i,a,o,s,c,l,u){this._extension=t,this._commands=i,this._id=a,this._label=o,this._rootUri=s,this._onDidDispose=new S,this.onDidDispose=this._onDidDispose.event,this._groups=new Map,this._contextValue=void 0,this._count=void 0,this._quickDiffProvider=void 0,this._secondaryQuickDiffProvider=void 0,this._historyProviderDisposable=new vt,this._artifactProviderDisposable=new vt,this._commitTemplate=void 0,this._acceptInputDisposables=new vt,this._acceptInputCommand=void 0,this._actionButtonDisposables=new v,this._statusBarDisposables=new v,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new S,this.onDidChangeSelection=this._onDidChangeSelection.event,this._artifactCommandsDisposables=new yt,this.handle=e._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,this.#e=r;let d=w.from({scheme:O.vscodeSourceControl,path:`${a}/scm${this.handle}/input`,query:s?`rootUri=${encodeURIComponent(s.toString())}`:void 0});this._inputBox=new YY(t,n,this.#e,this.handle,d),this.#e.$registerSourceControl(this.handle,u?.handle,a,o,s,zY(c),l,d),this.onDidDisposeParent=u?u.onDidDispose:Qn.None}createResourceGroup(e,t,n){let r=Dw(this._extension)&&n?.multiDiffEditorEnableViewChanges===!0,i=new XY(this.#e,this._commands,this.handle,e,t,r,this._extension),a=Qn.once(i.onDidDispose)(()=>this.createdResourceGroups.delete(i));return this.createdResourceGroups.set(i,a),this.eventuallyAddResourceGroups(),i}eventuallyAddResourceGroups(){let e=[],t=[];for(let[n,r]of this.createdResourceGroups){r.dispose();let i=n.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(n),this.eventuallyUpdateResourceStates()});Qn.once(n.onDidDispose)(()=>{this.updatedResourceGroups.delete(n),i.dispose(),this._groups.delete(n.handle),this.#e.$unregisterGroup(this.handle,n.handle)}),e.push([n.handle,n.id,n.label,n.features,n.multiDiffEditorEnableViewChanges]);let a=n._takeResourceStateSnapshot();a.length>0&&t.push([n.handle,a]),this._groups.set(n.handle,n)}this.#e.$registerGroups(this.handle,e,t),this.createdResourceGroups.clear()}eventuallyUpdateResourceStates(){let e=[];this.updatedResourceGroups.forEach(t=>{let n=t._takeResourceStateSnapshot();n.length!==0&&e.push([t.handle,n])}),e.length>0&&this.#e.$spliceResourceStates(this.handle,e),this.updatedResourceGroups.clear()}getResourceGroup(e){return this._groups.get(e)}setSelectionState(e){this._selected=e,this._onDidChangeSelection.fire(e)}async provideArtifacts(e,t){let n=new v,r=(await this.artifactProvider?.provideArtifacts(e,t))?.map(e=>({...e,icon:zY(e.icon),command:e.command?this._commands.converter.toInternal(e.command,n):void 0}));return this._artifactCommandsDisposables.get(e)?.dispose(),this._artifactCommandsDisposables.set(e,n),r}dispose(){this._acceptInputDisposables.dispose(),this._actionButtonDisposables.dispose(),this._statusBarDisposables.dispose(),this._historyProviderDisposable.dispose(),this._artifactProviderDisposable.dispose(),this._artifactCommandsDisposables.dispose(),this._groups.forEach(e=>e.dispose()),this.#e.$unregisterSourceControl(this.handle),this._onDidChangeSelection.dispose(),this._onDidDispose.fire(),this._onDidDispose.dispose()}};ZY.__decorator=A([NL(100)],ZY.prototype,`eventuallyAddResourceGroups`,null),ZY.__decorator=A([NL(100)],ZY.prototype,`eventuallyUpdateResourceStates`,null);let QY=class{get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}constructor(e,t,n,r){this._commands=t,this._extHostDocuments=n,this.logService=r,this._sourceControls=new Map,this._sourceControlsByExtension=new xs,this._onDidChangeActiveProvider=new S,this._proxy=e.getProxy(E.MainThreadSCM),this._telemetry=e.getProxy(E.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:e=>{if(e&&e.$mid===Er.ScmResource){let t=this._sourceControls.get(e.sourceControlHandle);if(!t)return e;let n=t.getResourceGroup(e.groupHandle);return n?n.getResourceState(e.handle):e}else if(e&&e.$mid===Er.ScmResourceGroup){let t=this._sourceControls.get(e.sourceControlHandle);return t?t.getResourceGroup(e.groupHandle):e}else if(e&&e.$mid===Er.ScmProvider)return this._sourceControls.get(e.handle)||e;return e}})}createSourceControl(e,t,n,r,i,a,o){this.logService.trace(`ExtHostSCM#createSourceControl`,e.identifier.value,t,n,r),this._telemetry.$publicLog2(`api/scm/createSourceControl`,{extensionId:e.identifier.value});let s=o?lt.find(this._sourceControls.values(),e=>e===o):void 0,c=new ZY(e,this._extHostDocuments,this._proxy,this._commands,t,n,r,i,a,s);this._sourceControls.set(c.handle,c);let l=this._sourceControlsByExtension.get(e.identifier)||[];return l.push(c),this._sourceControlsByExtension.set(e.identifier,l),Qn.once(c.onDidDispose)(()=>{this.logService.trace(`ExtHostSCM#disposeSourceControl`,e.identifier.value,t,n,r),this._sourceControls.delete(c.handle);let i=this._sourceControlsByExtension.get(e.identifier);if(i){let t=i.indexOf(c);t!==-1&&i.splice(t,1),i.length===0&&this._sourceControlsByExtension.delete(e.identifier)}}),c}getLastInputBox(e){this.logService.trace(`ExtHostSCM#getLastInputBox`,e.identifier.value);let t=this._sourceControlsByExtension.get(e.identifier),n=t&&t[t.length-1];return n&&n.inputBox}$provideOriginalResource(e,t,n){let r=w.revive(t);this.logService.trace(`ExtHostSCM#$provideOriginalResource`,e,r.toString());let i=this._sourceControls.get(e);return!i||!i.quickDiffProvider||!i.quickDiffProvider.provideOriginalResource?Promise.resolve(null):go(()=>i.quickDiffProvider.provideOriginalResource(r,n)).then(e=>e||null)}$provideSecondaryOriginalResource(e,t,n){let r=w.revive(t);this.logService.trace(`ExtHostSCM#$provideSecondaryOriginalResource`,e,r.toString());let i=this._sourceControls.get(e);return!i||!i.secondaryQuickDiffProvider||!i.secondaryQuickDiffProvider.provideOriginalResource?Promise.resolve(null):go(()=>i.secondaryQuickDiffProvider.provideOriginalResource(r,n)).then(e=>e||null)}$onInputBoxValueChange(e,t){this.logService.trace(`ExtHostSCM#$onInputBoxValueChange`,e);let n=this._sourceControls.get(e);return n&&n.inputBox.$onInputBoxValueChange(t),Promise.resolve(void 0)}$executeResourceCommand(e,t,n,r){this.logService.trace(`ExtHostSCM#$executeResourceCommand`,e,t,n);let i=this._sourceControls.get(e);if(!i)return Promise.resolve(void 0);let a=i.getResourceGroup(t);return a?a.$executeResourceCommand(n,r):Promise.resolve(void 0)}$validateInput(e,t,n){this.logService.trace(`ExtHostSCM#$validateInput`,e);let r=this._sourceControls.get(e);return!r||!r.inputBox.validateInput?Promise.resolve(void 0):go(()=>r.inputBox.validateInput(t,n)).then(e=>{if(!e)return Promise.resolve(void 0);let t=Y.fromStrict(e.message);return t?Promise.resolve([t,e.type]):Promise.resolve(void 0)})}$setSelectedSourceControl(e){return this.logService.trace(`ExtHostSCM#$setSelectedSourceControl`,e),this._selectedSourceControlHandle===e?Promise.resolve(void 0):(e!==void 0&&this._sourceControls.get(e)?.setSelectionState(!0),this._selectedSourceControlHandle!==void 0&&this._sourceControls.get(this._selectedSourceControlHandle)?.setSelectionState(!1),this._selectedSourceControlHandle=e,Promise.resolve(void 0))}async $resolveHistoryItem(e,t,n){try{let r=await(this._sourceControls.get(e)?.historyProvider)?.resolveHistoryItem(t,n);return r?BY(r):void 0}catch(e){this.logService.error(`ExtHostSCM#$resolveHistoryItem`,e);return}}async $resolveHistoryItemChatContext(e,t,n){try{return await(this._sourceControls.get(e)?.historyProvider)?.resolveHistoryItemChatContext(t,n)??void 0}catch(e){this.logService.error(`ExtHostSCM#$resolveHistoryItemChatContext`,e);return}}async $resolveHistoryItemChangeRangeChatContext(e,t,n,r,i){try{return await(this._sourceControls.get(e)?.historyProvider)?.resolveHistoryItemChangeRangeChatContext?.(t,n,r,i)??void 0}catch(e){this.logService.error(`ExtHostSCM#$resolveHistoryItemChangeRangeChatContext`,e);return}}async $resolveHistoryItemRefsCommonAncestor(e,t,n){try{return await(this._sourceControls.get(e)?.historyProvider)?.resolveHistoryItemRefsCommonAncestor(t,n)??void 0}catch(e){this.logService.error(`ExtHostSCM#$resolveHistoryItemRefsCommonAncestor`,e);return}}async $provideHistoryItemRefs(e,t,n){try{return(await(this._sourceControls.get(e)?.historyProvider)?.provideHistoryItemRefs(t,n))?.map(e=>({...e,icon:zY(e.icon)}))??void 0}catch(e){this.logService.error(`ExtHostSCM#$provideHistoryItemRefs`,e);return}}async $provideHistoryItems(e,t,n){try{return(await(this._sourceControls.get(e)?.historyProvider)?.provideHistoryItems(t,n))?.map(e=>BY(e))??void 0}catch(e){this.logService.error(`ExtHostSCM#$provideHistoryItems`,e);return}}async $provideHistoryItemChanges(e,t,n,r){try{return await(this._sourceControls.get(e)?.historyProvider)?.provideHistoryItemChanges(t,n,r)??void 0}catch(e){this.logService.error(`ExtHostSCM#$provideHistoryItemChanges`,e);return}}async $provideArtifactGroups(e,t){try{return(await(this._sourceControls.get(e)?.artifactProvider)?.provideArtifactGroups(t))?.map(e=>({...e,icon:zY(e.icon)}))}catch(e){this.logService.error(`ExtHostSCM#$provideArtifactGroups`,e);return}}async $provideArtifacts(e,t,n){try{return this._sourceControls.get(e)?.provideArtifacts(t,n)}catch(e){this.logService.error(`ExtHostSCM#$provideArtifacts`,e);return}}};QY=A([j(3,Ds)],QY);var $Y=class e{static{this.handlePool=0}constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(E.MainThreadShare)}async $provideShare(e,t,n){return await this.providers.get(e)?.provideShare({selection:J.to(t.selection),resourceUri:w.revive(t.resourceUri)},n)??void 0}registerShareProvider(t,n){let r=e.handlePool++;return this.providers.set(r,n),this.proxy.$registerShareProvider(r,cj.from(t,this.uriTransformer),n.id,n.label,n.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(r),this.providers.delete(r)}}}},eX=class e{static{this.ID_POOL=1}constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(E.MainThreadSpeech)}async $createSpeechToTextSession(e,t,n){let r=this.providers.get(e);if(!r)return;let i=new v,a=new Ii;this.sessions.set(t,a);let o=await r.provideSpeechToTextSession(a.token,n?{language:n}:void 0);o&&(i.add(o.onDidChange(e=>{a.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,e)})),i.add(a.token.onCancellationRequested(()=>i.dispose())))}async $cancelSpeechToTextSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}async $createTextToSpeechSession(e,t,n){let r=this.providers.get(e);if(!r)return;let i=new v,a=new Ii;this.sessions.set(t,a);let o=await r.provideTextToSpeechSession(a.token,n?{language:n}:void 0);o&&(this.synthesizers.set(t,o),i.add(o.onDidChange(e=>{a.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,e)})),i.add(a.token.onCancellationRequested(()=>i.dispose())))}async $synthesizeSpeech(e,t){this.synthesizers.get(e)?.synthesize(t)}async $cancelTextToSpeechSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e),this.synthesizers.delete(e)}async $createKeywordRecognitionSession(e,t){let n=this.providers.get(e);if(!n)return;let r=new v,i=new Ii;this.sessions.set(t,i);let a=await n.provideKeywordRecognitionSession(i.token);a&&(r.add(a.onDidChange(e=>{i.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,e)})),r.add(i.token.onCancellationRequested(()=>r.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(t,n,r){let i=e.ID_POOL++;return this.providers.set(i,r),this.proxy.$registerProvider(i,n,{extension:t,displayName:t.value}),_(()=>{this.proxy.$unregisterProvider(i),this.providers.delete(i)})}},tX=class{constructor(e,t,n,r){this.id=e,this._proxy=t,this._sessions=n,this._url=r.url,this._title=r.title,this._favicon=r.favicon;let i=this;this.value={get url(){return i._url},get title(){return i._title},get icon(){return i._favicon?w.parse(i._favicon):new OD(P.globe.id)},startCDPSession(){return i._startCDPSession()},close(){return i._close()}}}update(e){let t=!1;return e.url!==this._url&&(this._url=e.url,t=!0),e.title!==this._title&&(this._title=e.title,t=!0),e.favicon!==this._favicon&&(this._favicon=e.favicon,t=!0),t}async _startCDPSession(){let e=zc();await this._proxy.$startCDPSession(e,this.id);let t=new nX(e,this._proxy);return this._sessions.set(e,t),t.value}async _close(){await this._proxy.$closeBrowserTab(this.id)}},nX=class{constructor(e,t){this.id=e,this._proxy=t,this._onDidReceiveMessage=new S,this._onDidClose=new S,this._closed=!1;let n=this;this.value={get onDidReceiveMessage(){return n._onDidReceiveMessage.event},get onDidClose(){return n._onDidClose.event},sendMessage(e){return n._sendMessage(e)},close(){return n._close()}}}dispose(){this._onDidReceiveMessage.dispose(),this._onDidClose.dispose()}async _sendMessage(e){if(this._closed)throw Error(`Session is closed`);if(!e||typeof e!=`object`)throw Error(`Message must be an object`);if(typeof e.id!=`number`)throw Error(`Message must have a numeric id`);if(typeof e.method!=`string`)throw Error(`Message must have a method string`);if(e.params!==void 0&&typeof e.params!=`object`)throw Error(`Message params must be an object`);if(e.sessionId!==void 0&&typeof e.sessionId!=`string`)throw Error(`Message sessionId must be a string`);await this._proxy.$sendCDPMessage(this.id,{id:e.id,method:e.method,params:e.params,sessionId:e.sessionId})}async _close(){this._closed=!0,await this._proxy.$closeCDPSession(this.id)}_acceptMessage(e){this._onDidReceiveMessage.fire(e)}_acceptClosed(){this._closed=!0,this._onDidClose.fire()}},rX=class extends y{constructor(e){super(),this._browserTabs=new Map,this._sessions=this._register(new yt),this._onDidOpenBrowserTab=this._register(new S),this.onDidOpenBrowserTab=this._onDidOpenBrowserTab.event,this._onDidCloseBrowserTab=this._register(new S),this.onDidCloseBrowserTab=this._onDidCloseBrowserTab.event,this._onDidChangeActiveBrowserTab=this._register(new S),this.onDidChangeActiveBrowserTab=this._onDidChangeActiveBrowserTab.event,this._onDidChangeBrowserTabState=this._register(new S),this.onDidChangeBrowserTabState=this._onDidChangeBrowserTabState.event,this._proxy=e.getProxy(E.MainThreadBrowsers)}get browserTabs(){return[...this._browserTabs.values()].map(e=>e.value)}get activeBrowserTab(){if(this._activeBrowserTabId)return this._browserTabs.get(this._activeBrowserTabId)?.value}async openBrowserTab(e,t){let n=pj.from(t?.viewColumn),r=await this._proxy.$openBrowserTab(e,n,{preserveFocus:t?.preserveFocus,inactive:t?.background});return this._getOrCreateTab(r).value}_getOrCreateTab(e){let t=this._browserTabs.get(e.id);return t?t.update(e):(t=new tX(e.id,this._proxy,this._sessions,e),this._browserTabs.set(e.id,t),this._onDidOpenBrowserTab.fire(t.value)),t}$onDidOpenBrowserTab(e){this._getOrCreateTab(e)}$onDidCloseBrowserTab(e){let t=this._browserTabs.get(e);t&&(this._browserTabs.delete(e),this._activeBrowserTabId===e&&(this._activeBrowserTabId=void 0),this._onDidCloseBrowserTab.fire(t.value))}$onDidChangeActiveBrowserTab(e){this._activeBrowserTabId=e,this._onDidChangeActiveBrowserTab.fire(this.activeBrowserTab)}$onDidChangeBrowserTabState(e){let t=this._browserTabs.get(e.id);t&&t.update(e)&&this._onDidChangeBrowserTabState.fire(t.value)}$onCDPSessionMessage(e,t){let n=this._sessions.get(e);n&&n._acceptMessage(t)}$onCDPSessionClosed(e){let t=this._sessions.get(e);t&&(t._acceptClosed(),this._sessions.deleteAndDispose(e))}},iX=class e{static{this.ID_GEN=0}static{this.ALLOWED_BACKGROUND_COLORS=new Map([[`statusBarItem.errorBackground`,new kD(`statusBarItem.errorForeground`)],[`statusBarItem.warningBackground`,new kD(`statusBarItem.warningForeground`)]])}#e;#t;constructor(t,n,r,i,a,o=kE.Left,s,c){if(this._onDispose=c,this._disposed=!1,this._text=``,this._staleCommandRegistrations=new v,this.#e=t,this.#t=n,a&&i){this._entryId=AE(i.identifier,a);let e=r.get(this._entryId);e&&(o=e.alignLeft?kE.Left:kE.Right,s=e.priority,this._visible=!0,this.name=e.name,this.text=e.text,this.tooltip=e.tooltip,this.command=e.command,this.accessibilityInformation=e.accessibilityInformation)}else this._entryId=String(e.ID_GEN++);this._extension=i,this._id=a,this._alignment=o,this._priority=this.validatePriority(s)}validatePriority(e){if(Xe(e))return e===1/0?Number.MAX_VALUE:e===-1/0?-Number.MAX_VALUE:e}get id(){return this._id??this._extension.identifier.value}get entryId(){return this._entryId}get alignment(){return this._alignment}get priority(){return this._priority}get text(){return this._text}get name(){return this._name}get tooltip(){return this._tooltip}get tooltip2(){return this._extension&&K(this._extension,`statusBarItemTooltip`),this._tooltip2}get color(){return this._color}get backgroundColor(){return this._backgroundColor}get command(){return this._command?.fromApi}get accessibilityInformation(){return this._accessibilityInformation}set text(e){this._text=e,this.update()}set name(e){this._name=e,this.update()}set tooltip(e){this._tooltip=e,this.update()}set tooltip2(e){this._extension&&K(this._extension,`statusBarItemTooltip`),this._tooltip2=e,this.update()}set color(e){this._color=e,this.update()}set backgroundColor(t){t&&!e.ALLOWED_BACKGROUND_COLORS.has(t.id)&&(t=void 0),this._backgroundColor=t,this.update()}set command(e){this._command?.fromApi!==e&&(this._latestCommandRegistration&&this._staleCommandRegistrations.add(this._latestCommandRegistration),this._latestCommandRegistration=new v,typeof e==`string`?this._command={fromApi:e,internal:this.#t.toInternal({title:``,command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:this.#t.toInternal(e,this._latestCommandRegistration)}:this._command=void 0,this.update())}set accessibilityInformation(e){this._accessibilityInformation=e,this.update()}show(){this._visible=!0,this.update()}hide(){clearTimeout(this._timeoutHandle),this._visible=!1,this.#e.$disposeEntry(this._entryId)}update(){this._disposed||!this._visible||(clearTimeout(this._timeoutHandle),this._timeoutHandle=setTimeout(()=>{this._timeoutHandle=void 0;let t;t=this._extension?this._id?`${this._extension.identifier.value}.${this._id}`:this._extension.identifier.value:this._id;let n;n=this._name?this._name:x(2875,`{0} (Extension)`,this._extension.displayName||this._extension.name);let r=this._color;this._backgroundColor&&(r=e.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));let i,a;typeof this._tooltip2==`function`?(i=Y.fromStrict(this._tooltip),a=!0):(i=Y.fromStrict(this._tooltip2??this._tooltip),a=!1),this.#e.$setEntry(this._entryId,t,this._extension?.identifier.value,n,this._text,i,a,this._command?.internal,r,this._backgroundColor,this._alignment===kE.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._staleCommandRegistrations.dispose(),this._latestCommandRegistration?.dispose(),this._onDispose?.(),this._disposed=!0}},aX=class{constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,`status.extensionMessage`,kE.Left,Number.MIN_VALUE),this._item.name=x(2876,`Extension Status`)}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){let t={message:e};return this._messages.unshift(t),this._update(),new WT(()=>{let e=this._messages.indexOf(t);e>=0&&(this._messages.splice(e,1),this._update())})}_update(){this._messages.length>0?(this._item.text=this._messages[0].message,this._item.show()):this._item.hide()}},oX=class{constructor(e,t){this._entries=new Map,this._existingItems=new Map,this._proxy=e.getProxy(E.MainThreadStatusBar),this._commands=t,this._statusMessage=new aX(this)}$acceptStaticEntries(e){for(let t of e)this._existingItems.set(t.entryId,t)}async $provideTooltip(e,t){let n=this._entries.get(e);if(!n)return;let r=typeof n.tooltip2==`function`?await n.tooltip2(t):n.tooltip2;return t.isCancellationRequested?void 0:Y.fromStrict(r)}createStatusBarEntry(e,t,n,r){let i=new iX(this._proxy,this._commands,this._existingItems,e,t,n,r,()=>this._entries.delete(i.entryId));return this._entries.set(i.entryId,i),i}setStatusBarMessage(e,t){let n=this._statusMessage.setMessage(e),r;return typeof t==`number`?r=setTimeout(()=>n.dispose(),t):t!==void 0&&t.then(()=>n.dispose(),()=>n.dispose()),new WT(()=>{n.dispose(),clearTimeout(r)})}},sX=class extends y{constructor(e,t){super(),this._extHostDocumentsAndEditors=t,this._onDidChangeTextEditorSelection=this._register(new S),this._onDidChangeTextEditorOptions=this._register(new S),this._onDidChangeTextEditorVisibleRanges=this._register(new S),this._onDidChangeTextEditorViewColumn=this._register(new S),this._onDidChangeTextEditorDiffInformation=this._register(new S),this._onDidChangeActiveTextEditor=this._register(new S),this._onDidChangeVisibleTextEditors=this._register(new S),this.onDidChangeTextEditorSelection=this._onDidChangeTextEditorSelection.event,this.onDidChangeTextEditorOptions=this._onDidChangeTextEditorOptions.event,this.onDidChangeTextEditorVisibleRanges=this._onDidChangeTextEditorVisibleRanges.event,this.onDidChangeTextEditorViewColumn=this._onDidChangeTextEditorViewColumn.event,this.onDidChangeTextEditorDiffInformation=this._onDidChangeTextEditorDiffInformation.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this._proxy=e.getProxy(E.MainThreadTextEditors),this._register(this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(e=>this._onDidChangeVisibleTextEditors.fire(e))),this._register(this._extHostDocumentsAndEditors.onDidChangeActiveTextEditor(e=>this._onDidChangeActiveTextEditor.fire(e)))}getActiveTextEditor(){return this._extHostDocumentsAndEditors.activeEditor()}getVisibleTextEditors(e){let t=this._extHostDocumentsAndEditors.allEditors();return e?t:t.map(e=>e.value)}async showTextDocument(e,t,n){let r;r=typeof t==`number`?{position:pj.from(t),preserveFocus:n}:typeof t==`object`?{position:pj.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection==`object`?J.from(t.selection):void 0,pinned:typeof t.preview==`boolean`?!t.preview:void 0}:{preserveFocus:!1};let i=await this._proxy.$tryShowTextDocument(e.uri,r),a=i&&this._extHostDocumentsAndEditors.getEditor(i);if(a)return a.value;throw Error(i?`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`:`Could NOT open editor for "${e.uri.toString()}".`)}createTextEditorDecorationType(e,t){return new Dz(this._proxy,e,t).value}$acceptEditorPropertiesChanged(e,t){let n=this._extHostDocumentsAndEditors.getEditor(e);if(!n)throw Error(`unknown text editor`);if(t.options&&n._acceptOptions(t.options),t.selections){let e=t.selections.selections.map(ij.to);n._acceptSelections(e)}if(t.visibleRanges){let e=pe(t.visibleRanges.map(J.to));n._acceptVisibleRanges(e)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:n.value,options:{...t.options,lineNumbers:nM.to(t.options.lineNumbers)}}),t.selections){let e=PE.fromValue(t.selections.source),r=t.selections.selections.map(ij.to);this._onDidChangeTextEditorSelection.fire({textEditor:n.value,selections:r,kind:e})}if(t.visibleRanges){let e=pe(t.visibleRanges.map(J.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:n.value,visibleRanges:e})}}$acceptEditorPositionData(e){for(let t in e){let n=this._extHostDocumentsAndEditors.getEditor(t);if(!n)throw Error(`Unknown text editor`);let r=pj.to(e[t]);n.value.viewColumn!==r&&(n._acceptViewColumn(r),this._onDidChangeTextEditorViewColumn.fire({textEditor:n.value,viewColumn:r}))}}$acceptEditorDiffInformation(e,t){let n=this._extHostDocumentsAndEditors.getEditor(e);if(!n)throw Error(`unknown text editor`);if(!t){n._acceptDiffInformation(void 0),this._onDidChangeTextEditorDiffInformation.fire({textEditor:n.value,diffInformation:void 0});return}let r=this,i=t.map(e=>{let t=w.revive(e.original),n=w.revive(e.modified),i=e.changes.map(e=>{let[t,n,r,i]=e,a;return a=t===n?FE.Addition:r===i?FE.Deletion:FE.Modification,{original:{startLineNumber:t,endLineNumberExclusive:n},modified:{startLineNumber:r,endLineNumberExclusive:i},kind:a}});return Object.freeze({documentVersion:e.documentVersion,original:t,modified:n,changes:i,get isStale(){return r._extHostDocumentsAndEditors.getDocument(n)?.version!==e.documentVersion}})});n._acceptDiffInformation(i),this._onDidChangeTextEditorDiffInformation.fire({textEditor:n.value,diffInformation:i})}getDiffInformation(e){return Promise.resolve(this._proxy.$getDiffInformation(e))}};let cX=class{constructor(e){this._actual=new wO(TO.Dark),this._onDidChangeActiveColorTheme=new S}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case`light`:t=TO.Light;break;case`hcDark`:t=TO.HighContrast;break;case`hcLight`:t=TO.HighContrastLight;break;default:t=TO.Dark}this._actual=new wO(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};cX=A([j(0,Hs)],cX);var lX=class{constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(E.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(e,t)=>{if(e&&e.$mid===Er.TimelineActionContext)if(this._providers.get(e.source)&&t&&Dw(t)){let t=e.uri===void 0?void 0:w.revive(e.uri);return this._itemsBySourceAndUriMap.get(e.source)?.get(uX(t))?.get(e.handle)}else return;return e}})}async $getTimeline(e,t,n,r){return this._providers.get(e)?.provider.provideTimeline(w.revive(t),n,r)}registerTimelineProvider(e,t,n,r){let i=new v,a=this.convertTimelineItem(t.id,r,i).bind(this),o;t.onDidChange&&(o=t.onDidChange(e=>this._proxy.$emitTimelineChangeEvent({uri:void 0,reset:!0,...e,id:t.id}),this));let s=this._itemsBySourceAndUriMap;return this.registerTimelineProviderCore({...t,scheme:e,onDidChange:void 0,async provideTimeline(e,n,r){n?.resetCache&&(i.clear(),s.get(t.id)?.clear());let o=await t.provideTimeline(e,n,r);if(o==null)return;let c=a(e,n);return{...o,source:t.id,items:o.items.map(c)}},dispose(){for(let e of s.values())e.get(t.id)?.clear();o?.dispose(),i.dispose()}},n)}convertTimelineItem(e,t,n){return(r,i)=>{let a;if(i?.cacheResults){let t=this._itemsBySourceAndUriMap.get(e);t===void 0&&(t=new Map,this._itemsBySourceAndUriMap.set(e,t));let n=uX(r);a=t.get(n),a===void 0&&(a=new Map,t.set(n,a))}return r=>{let{iconPath:i,...o}=r,s=`${e}|${r.id??r.timestamp}`;a?.set(s,r);let c,l,u;r.iconPath&&(i instanceof OD?u={id:i.id,color:i.color}:w.isUri(i)?(c=i,l=i):{light:c,dark:l}=i);let d;return Qw.isMarkdownString(o.tooltip)?d=Y.from(o.tooltip):Ge(o.tooltip)?d=o.tooltip:Qw.isMarkdownString(o.detail)?(console.warn(`Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip`),d=Y.from(o.detail)):Ge(o.detail)&&(console.warn(`Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip`),d=o.detail),{...o,id:o.id??void 0,handle:s,source:e,command:r.command?t.toInternal(r.command,n):void 0,icon:c,iconDark:l,themeIcon:u,tooltip:d,accessibilityInformation:r.accessibilityInformation}}}}registerTimelineProviderCore(e,t){if(this._providers.get(e.id))throw Error(`Timeline Provider ${e.id} already exists.`);return this._proxy.$registerTimelineProvider({id:e.id,label:e.label,scheme:e.scheme}),this._providers.set(e.id,{provider:e,extension:t}),_(()=>{for(let t of this._itemsBySourceAndUriMap.values())t.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}};function uX(e){return e?.toString()}x(4458,`Views`),Wz(`default-view-icon`,P.window,x(4459,`Default view icon.`));var dX;(function(e){e.ViewContainersRegistry=`workbench.registry.view.containers`,e.ViewsRegistry=`workbench.registry.view`})(dX||={});var fX;(function(e){e[e.Sidebar=0]=`Sidebar`,e[e.Panel=1]=`Panel`,e[e.AuxiliaryBar=2]=`AuxiliaryBar`})(fX||={});var pX;(function(e){e[e.Editor=1]=`Editor`,e[e.Sessions=2]=`Sessions`,e[e.Both=3]=`Both`})(pX||={});var mX=class extends y{constructor(){super(...arguments),this._onDidRegister=this._register(new S),this.onDidRegister=this._onDidRegister.event,this._onDidDeregister=this._register(new S),this.onDidDeregister=this._onDidDeregister.event,this.viewContainers=new Map,this.defaultViewContainers=[]}get all(){return[...this.viewContainers.values()].flat()}registerViewContainer(e,t,n){let r=this.get(e.id);if(r)return r;let i=e;return i.openCommandActionDescriptor=n?.doNotRegisterOpenCommand?void 0:i.openCommandActionDescriptor??{id:i.id},Ae(this.viewContainers,t,[]).push(i),n?.isDefault&&this.defaultViewContainers.push(i),this._onDidRegister.fire({viewContainer:i,viewContainerLocation:t}),i}deregisterViewContainer(e){for(let t of this.viewContainers.keys()){let n=this.viewContainers.get(t),r=n?.indexOf(e);if(r!==-1){n?.splice(r,1),n.length===0&&this.viewContainers.delete(t),this._onDidDeregister.fire({viewContainer:e,viewContainerLocation:t});return}}}get(e){return this.all.filter(t=>t.id===e)[0]}getViewContainers(e){return[...this.viewContainers.get(e)||[]]}getViewContainerLocation(e){return[...this.viewContainers.keys()].filter(t=>this.getViewContainers(t).filter(t=>t?.id===e.id).length>0)[0]}getDefaultViewContainers(e){return this.defaultViewContainers.filter(t=>this.getViewContainerLocation(t)===e)}};wm.add(dX.ViewContainersRegistry,new mX);var hX;(function(e){e.Open=`2_open`,e.Debug=`4_debug`,e.SCM=`5_scm`,e.More=`9_more`})(hX||={});function gX(e,t){let n=e.group??hX.More,r=t.group??hX.More;return n===r?(e.order??5)-(t.order??5):n.localeCompare(r)}var _X=class extends y{constructor(){super(...arguments),this._onViewsRegistered=this._register(new S),this.onViewsRegistered=this._onViewsRegistered.event,this._onViewsDeregistered=this._register(new S),this.onViewsDeregistered=this._onViewsDeregistered.event,this._onDidChangeContainer=this._register(new S),this.onDidChangeContainer=this._onDidChangeContainer.event,this._onDidChangeViewWelcomeContent=this._register(new S),this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event,this._viewContainers=[],this._views=new Map,this._viewWelcomeContents=new ze}registerViews(e,t){this.registerViews2([{views:e,viewContainer:t}])}registerViews2(e){e.forEach(({views:e,viewContainer:t})=>this.addViews(e,t)),this._onViewsRegistered.fire(e)}deregisterViews(e,t){let n=this.removeViews(e,t);n.length&&this._onViewsDeregistered.fire({views:n,viewContainer:t})}moveViews(e,t){for(let n of this._views.keys())if(n!==t){let r=this.removeViews(e,n);r.length&&(this.addViews(r,t),this._onDidChangeContainer.fire({views:r,from:n,to:t}))}}getViews(e){return this._views.get(e)||[]}getView(e){for(let t of this._viewContainers){let n=(this._views.get(t)||[]).filter(t=>t.id===e)[0];if(n)return n}return null}getViewContainer(e){for(let t of this._viewContainers)if((this._views.get(t)||[]).filter(t=>t.id===e)[0])return t;return null}registerViewWelcomeContent(e,t){return this._viewWelcomeContents.add(e,t),this._onDidChangeViewWelcomeContent.fire(e),_(()=>{this._viewWelcomeContents.delete(e,t),this._onDidChangeViewWelcomeContent.fire(e)})}registerViewWelcomeContent2(e,t){let n=new Map;for(let[r,i]of t)this._viewWelcomeContents.add(e,i),n.set(r,_(()=>{this._viewWelcomeContents.delete(e,i),this._onDidChangeViewWelcomeContent.fire(e)}));return this._onDidChangeViewWelcomeContent.fire(e),n}getViewWelcomeContent(e){let t=[];return this._viewWelcomeContents.forEach(e,e=>t.push(e)),t.sort(gX)}addViews(e,t){let n=this._views.get(t);n||(n=[],this._views.set(t,n),this._viewContainers.push(t));for(let t of e){if(this.getView(t.id)!==null)throw Error(x(4460,`A view with id '{0}' is already registered`,t.id));n.push(t)}}removeViews(e,t){let n=this._views.get(t);if(!n)return[];let r=[],i=[];for(let t of n)e.includes(t)?r.push(t):i.push(t);return r.length&&(i.length?this._views.set(t,i):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),r}};wm.add(dX.ViewsRegistry,new _X);var vX;(function(e){e[e.Default=0]=`Default`,e[e.Expand=1]=`Expand`})(vX||={});var yX;(function(e){e[e.None=0]=`None`,e[e.Collapsed=1]=`Collapsed`,e[e.Expanded=2]=`Expanded`})(yX||={});var bX=class extends Error{constructor(e){super(x(4461,`No tree view with id '{0}' registered.`,e)),this.name=`NoTreeViewError`}static is(e){return!!e&&e.name===`NoTreeViewError`}},xX=class{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){let t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}addDragOperationTransfer(e,t){this._dragOperations.set(e,t)}};function SX(e,t){if(Ge(e))return{label:e};if(e&&typeof e==`object`&&e.label){let n;if(Array.isArray(e.highlights)&&(n=e.highlights.filter((e=>e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`)),n=n.length?n:void 0),Ge(e.label))return{label:e.label,highlights:n};if(Qw.isMarkdownString(e.label))return K(t,`treeItemMarkdownLabel`),{label:Y.from(e.label),highlights:n}}}var CX=class extends y{constructor(e,t,n){super(),this._proxy=e,this._commands=t,this._logService=n,this._treeViews=new Map,this._treeDragAndDropService=new xX;function r(e){return e&&e.$treeViewId&&(e.$treeItemHandle||e.$selectedTreeItems||e.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:e=>r(e)?this._convertArgument(e):Array.isArray(e)&&e.length>0?e.map(e=>r(e)?this._convertArgument(e):e):e})}registerTreeDataProvider(e,t,n){let r=this.createTreeView(e,{treeDataProvider:t},n);return{dispose:()=>r.dispose()}}createTreeView(e,t,n){if(!t||!t.treeDataProvider)throw Error(`Options with treeDataProvider is mandatory`);let r=t.dragAndDropController?.dropMimeTypes??[],i=t.dragAndDropController?.dragMimeTypes??[],a=!!t.dragAndDropController?.handleDrag,o=!!t.dragAndDropController?.handleDrop,s=this._createExtHostTreeView(e,t,n),c={showCollapseAll:!!t.showCollapseAll,canSelectMany:!!t.canSelectMany,dropMimeTypes:r,dragMimeTypes:i,hasHandleDrag:a,hasHandleDrop:o,manuallyManageCheckboxes:!!t.manageCheckboxStateManually},l=this._proxy.$registerTreeViewDataProvider(e,c),u={get onDidCollapseElement(){return s.onDidCollapseElement},get onDidExpandElement(){return s.onDidExpandElement},get selection(){return s.selectedElements},get onDidChangeSelection(){return s.onDidChangeSelection},get activeItem(){return K(n,`treeViewActiveItem`),s.focusedElement},get onDidChangeActiveItem(){return K(n,`treeViewActiveItem`),s.onDidChangeActiveItem},get visible(){return s.visible},get onDidChangeVisibility(){return s.onDidChangeVisibility},get onDidChangeCheckboxState(){return s.onDidChangeCheckboxState},get message(){return s.message},set message(e){vl(e)&&K(n,`treeViewMarkdownMessage`),s.message=e},get title(){return s.title},set title(e){s.title=e},get description(){return s.description},set description(e){s.description=e},get badge(){return s.badge},set badge(e){e!==void 0&&hD.isViewBadge(e)?s.badge={value:Math.floor(Math.abs(e.value)),tooltip:e.tooltip}:e===void 0&&(s.badge=void 0)},reveal:(e,t)=>s.reveal(e,t),dispose:async()=>{await l,this._treeViews.get(e)===s&&(this._treeViews.delete(e),this._proxy.$disposeTree(e)),s.dispose()}};return this._register(u),u}async $getChildren(e,t){let n=this._treeViews.get(e);if(!n)return Promise.reject(new bX(e));if(!t){let e=await n.getChildren();return e?[[0,...e]]:void 0}let r=[];for(let e=0;e<t.length;e++){let i=t[e],a=await n.getChildren(i);a&&r.push([e,...a])}return r}async $handleDrop(e,t,n,r,i,a,o,s){let c=this._treeViews.get(e);if(!c)return Promise.reject(new bX(e));let l=NM.toDataTransfer(n,async n=>(await this._proxy.$resolveDropFileData(e,t,n)).buffer);return o===e&&s&&await this._addAdditionalTransferItems(l,c,s,i,a),c.onDrop(l,r,i)}async _addAdditionalTransferItems(e,t,n,r,i){let a=this._treeDragAndDropService.removeDragOperationTransfer(i);if(a)(await a)?.forEach((t,n)=>{t&&e.set(n,t)});else if(i&&t.handleDrag){let a=t.handleDrag(n,e,r);this._treeDragAndDropService.addDragOperationTransfer(i,a),await a}return e}async $handleDrag(e,t,n,r){let i=this._treeViews.get(e);if(!i)return Promise.reject(new bX(e));let a=await this._addAdditionalTransferItems(new CD,i,t,r,n);if(!(!a||r.isCancellationRequested))return NM.from(a)}async $hasResolve(e){let t=this._treeViews.get(e);if(!t)throw new bX(e);return t.hasResolve}$resolve(e,t,n){let r=this._treeViews.get(e);if(!r)throw new bX(e);return r.resolveTreeItem(t,n)}$setExpanded(e,t,n){let r=this._treeViews.get(e);if(!r)throw new bX(e);r.setExpanded(t,n)}$setSelectionAndFocus(e,t,n){let r=this._treeViews.get(e);if(!r)throw new bX(e);r.setSelectionAndFocus(t,n)}$setVisible(e,t){let n=this._treeViews.get(e);if(!n){if(!t)return;throw new bX(e)}n.setVisible(t)}$changeCheckboxState(e,t){let n=this._treeViews.get(e);if(!n)throw new bX(e);n.setCheckboxState(t)}_createExtHostTreeView(e,t,n){let r=this._register(new wX(e,t,this._proxy,this._commands.converter,this._logService,n));return this._treeViews.set(e,r),r}_convertArgument(e){let t=this._treeViews.get(e.$treeViewId),n=e;return t&&n.$treeItemHandle?t.getExtensionElement(n.$treeItemHandle):t&&e.$focusedTreeItem?t.focusedElement:null}},wX=class e extends y{static{this.LABEL_HANDLE_PREFIX=`0`}static{this.ID_HANDLE_PREFIX=`1`}static{this.ROOT_FETCH_KEY=Symbol(`extHostTreeViewRoot`)}get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!et(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,n,r,i,a){if(super(),this._viewId=e,this._proxy=n,this._commands=r,this._logService=i,this._extension=a,this._roots=void 0,this._elements=new Map,this._nodes=new Map,this._childrenFetchTokens=new Map,this._globalFetchTokenCounter=0,this._visible=!1,this._selectedHandles=[],this._focusedHandle=void 0,this._onDidExpandElement=this._register(new S),this.onDidExpandElement=this._onDidExpandElement.event,this._onDidCollapseElement=this._register(new S),this.onDidCollapseElement=this._onDidCollapseElement.event,this._onDidChangeSelection=this._register(new S),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeActiveItem=this._register(new S),this.onDidChangeActiveItem=this._onDidChangeActiveItem.event,this._onDidChangeVisibility=this._register(new S),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidChangeCheckboxState=this._register(new S),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidChangeData=this._register(new S),this._refreshPromise=Promise.resolve(),this._refreshQueue=Promise.resolve(),this._nodesToClear=new Set,this._message=``,this._title=``,this._refreshCancellationSource=new Ii,a.contributes&&a.contributes.views)for(let t in a.contributes.views)for(let n of a.contributes.views[t])n.id===e&&(this._title=n.name);this._dataProvider=t.treeDataProvider,this._dndController=t.dragAndDropController,this._dataProvider.onDidChangeTreeData&&this._register(this._dataProvider.onDidChangeTreeData(e=>{Array.isArray(e)&&e.length===0||this._onDidChangeData.fire({message:!1,element:e})}));let o,s,c=Qn.debounce(this._onDidChangeData.event,(e,t)=>(e||={message:!1,elements:[]},t.element!==!1&&(o||(o=new Promise(e=>s=e),this._refreshPromise=this._refreshPromise.then(()=>o)),Array.isArray(t.element)?e.elements.push(...t.element):e.elements.push(t.element)),t.message&&(e.message=!0),e),200,!0);this._register(c(({message:e,elements:t})=>{t.length&&(t=_e(t),this._refreshQueue=this._refreshQueue.then(()=>{let e=s;o=null;let n=Array.from(this._nodesToClear);return this._nodesToClear.clear(),this._debugLogRefresh(`start`,t,n),this._refresh(t).then(()=>(this._debugLogRefresh(`done`,t,n),this._clearNodes(n),e())).catch(r=>{let i=r instanceof Error?r.message:JSON.stringify(r);return this._debugLogRefresh(`error`,t,n),this._clearNodes(n),this._logService.error(`Unable to refresh tree view ${this._viewId}: ${i}`),e()})})),e&&this._proxy.$setMessage(this._viewId,Y.fromStrict(this._message)??``)}))}_debugCollectHandles(e){let t=[];for(let n of e){if(!n){t.push(`<root>`);continue}let e=this._nodes.get(n);e&&t.push(e.item.handle)}return{changed:t,roots:this._roots?.map(e=>e.item.handle)??[]}}_debugLogRefresh(e,t,n){if(this._isDebugLogging())try{let r=this._debugCollectHandles(t);r.clearing=n.map(e=>e.item.handle);let i=r.changed.length,a=n.length;this._logService.debug(`[TreeView:${this._viewId}] refresh ${e} changed=${i} nodesToClear=${a} elements.size=${this._elements.size} nodes.size=${this._nodes.size} handles=${JSON.stringify(r)}`)}catch{this._logService.debug(`[TreeView:${this._viewId}] refresh ${e} (snapshot failed)`)}}_isDebugLogging(){try{let e=this._logService.getLevel();return e===U.Debug||e===U.Trace}catch{return!1}}async getChildren(e){let t=e?this.getExtensionElement(e):void 0;if(e&&!t)return this._logService.error(`No tree item with id \'${e}\' found.`),Promise.resolve([]);let n=this._getChildrenNodes(e);return n||=await this._fetchChildrenNodes(t),n?n.map(e=>e.item):void 0}getExtensionElement(e){return this._elements.get(e)}reveal(e,t){t||={select:!0,focus:!1};let n=et(t.select)?!0:t.select,r=et(t.focus)?!1:t.focus,i=et(t.expand)?!1:t.expand;return typeof this._dataProvider.getParent==`function`?e?this._refreshPromise.then(()=>this._resolveUnknownParentChain(e)).then(t=>this._resolveTreeNode(e,t[t.length-1]).then(e=>this._proxy.$reveal(this._viewId,{item:e.item,parentChain:t.map(e=>e.item)},{select:n,focus:r,expand:i})),e=>this._logService.error(e)):this._proxy.$reveal(this._viewId,void 0,{select:n,focus:r,expand:i}):Promise.reject(Error(`Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method`))}get message(){return this._message}set message(e){this._message=e,this._onDidChangeData.fire({message:!0,element:!1})}get title(){return this._title}set title(e){this._title=e,this._proxy.$setTitle(this._viewId,e,this._description)}get description(){return this._description}set description(e){this._description=e,this._proxy.$setTitle(this._viewId,this._title,e)}get badge(){return this._badge}set badge(e){this._badge?.value===e?.value&&this._badge?.tooltip===e?.tooltip||(this._badge=jM.from(e),this._proxy.$setBadge(this._viewId,e))}setExpanded(e,t){let n=this.getExtensionElement(e);n&&(t?this._onDidExpandElement.fire(Object.freeze({element:n})):this._onDidCollapseElement.fire(Object.freeze({element:n})))}setSelectionAndFocus(e,t){let n=!se(this._selectedHandles,e);this._selectedHandles=e;let r=this._focusedHandle!==t;this._focusedHandle=t,n&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),r&&this._onDidChangeActiveItem.fire(Object.freeze({activeItem:this.focusedElement}))}setVisible(e){e!==this._visible&&(this._visible=e,this._onDidChangeVisibility.fire(Object.freeze({visible:this._visible})))}async setCheckboxState(e){let t=(await Promise.all(e.map(async e=>{let t=this.getExtensionElement(e.treeItemHandle);return t?{extensionItem:t,treeItem:await this._dataProvider.getTreeItem(t),newState:e.newState?vD.Checked:vD.Unchecked}:Promise.resolve(void 0)}))).filter(e=>e!==void 0);t.forEach(e=>{e.treeItem.checkboxState=e.newState?vD.Checked:vD.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(e=>[e.extensionItem,e.newState])})}async handleDrag(e,t,n){let r=[];for(let t of e){let e=this.getExtensionElement(t);e&&r.push(e)}if(!(!this._dndController?.handleDrag||r.length===0))return await this._dndController.handleDrag(r,t,n),t}get hasHandleDrag(){return!!this._dndController?.handleDrag}async onDrop(e,t,n){let r=t?this.getExtensionElement(t):void 0;if(!(!r&&t||!this._dndController?.handleDrop))return go(()=>this._dndController?.handleDrop?this._dndController.handleDrop(r,e,n):void 0)}get hasResolve(){return!!this._dataProvider.resolveTreeItem}async resolveTreeItem(e,t){if(!this._dataProvider.resolveTreeItem)return;let n=this._elements.get(e);if(n){let e=this._nodes.get(n);if(e){let r=await this._dataProvider.resolveTreeItem(e.extensionItem,n,t)??e.extensionItem;return this._validateTreeItem(r),e.item.tooltip=this._getTooltip(r.tooltip),e.item.command=this._getCommand(e.disposableStore,r.command),e.item}}}_resolveUnknownParentChain(e){return this._resolveParent(e).then(e=>e?this._resolveUnknownParentChain(e).then(t=>this._resolveTreeNode(e,t[t.length-1]).then(e=>(t.push(e),t))):Promise.resolve([]))}_resolveParent(e){let t=this._nodes.get(e);return t?Promise.resolve(t.parent?this._elements.get(t.parent.item.handle):void 0):go(()=>this._dataProvider.getParent(e))}async _resolveTreeNode(e,t){let n=this._nodes.get(e);if(n)return n;let r=await go(()=>this._dataProvider.getTreeItem(e)),i=this._createHandle(e,r,t,!0);await this.getChildren(t?t.item.handle:void 0);let a=this.getExtensionElement(i);if(a){let e=this._nodes.get(a);if(e)return e}throw this._logService.error(`[TreeView:${this._viewId}] Failed to resolve tree node for element ${i}`),this._proxy.$logResolveTreeNodeFailure(this._extension.identifier.value),Error(`Cannot resolve tree item for element ${i} from extension ${this._extension.identifier.value}`)}_getChildrenNodes(e){if(e){let t;if(typeof e==`string`){let n=this.getExtensionElement(e);t=n?this._nodes.get(n):void 0}else t=e;return t&&t.children||void 0}return this._roots}_getFetchKey(t){return t??e.ROOT_FETCH_KEY}async _fetchChildrenNodes(e){this._addChildrenToClear(e);let t=this._getFetchKey(e),n=++this._globalFetchTokenCounter;this._childrenFetchTokens.set(t,n);let r=new Ii(this._refreshCancellationSource.token);try{let i=await this._dataProvider.getChildren(e);if(this._childrenFetchTokens.get(t)!==n)return;let a=e?this._nodes.get(e):void 0;if(r.token.isCancellationRequested)return;let o=pe(i||[]),s=await Promise.all(pe(o).map(e=>this._dataProvider.getTreeItem(e)));if(this._childrenFetchTokens.get(t)!==n||r.token.isCancellationRequested)return;let c=s.map((e,t)=>e?this._createAndRegisterTreeNode(o[t],e,a):null);return this._childrenFetchTokens.get(t)===n?pe(c):void 0}finally{r.dispose()}}_refresh(e){if(e.some(e=>!e))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new Ii,this._addChildrenToClear(),this._proxy.$refresh(this._viewId);{let t=this._getHandlesToRefresh(e);if(t.length)return this._refreshHandles(t)}return Promise.resolve(void 0)}_getHandlesToRefresh(e){let t=new Set,n=e.map(e=>this._nodes.get(e));for(let e of n)if(e&&!t.has(e.item.handle)){let r=e;for(;r&&r.parent&&n.findIndex(e=>r&&r.parent&&e&&e.item.handle===r.parent.item.handle)===-1;){let e=this._elements.get(r.parent.item.handle);r=e?this._nodes.get(e):void 0}r&&!r.parent&&t.add(e.item.handle)}let r=[];return t.forEach(e=>{let n=this._elements.get(e);if(n){let i=this._nodes.get(n);i&&(!i.parent||!t.has(i.parent.item.handle))&&r.push(e)}}),r}_refreshHandles(e){let t={};return Promise.all(e.map(e=>this._refreshNode(e).then(n=>{n&&(t[e]=n.item)}))).then(()=>Object.keys(t).length?this._proxy.$refresh(this._viewId,t):void 0)}_refreshNode(e){let t=this.getExtensionElement(e);if(t){let e=this._nodes.get(t);if(e)return this._addChildrenToClear(t),go(()=>this._dataProvider.getTreeItem(t)).then(n=>{if(n){let r=this._createTreeNode(t,n,e.parent);return this._updateNodeCache(t,r,e,e.parent),e.dispose(),r}return null})}return Promise.resolve(null)}_createAndRegisterTreeNode(t,n,r){let i=n.id?`${e.ID_HANDLE_PREFIX}/${n.id}`:void 0;if(i){let e=this._elements.get(i);if(e){let i=this._nodes.get(e);if(e!==t&&this._nodes.delete(e),i){let e=this._createTreeNode(t,n,r);return this._updateNodeCache(t,e,i,r),i.dispose(),e}}}let a=this._createTreeNode(t,n,r);return this._addNodeToCache(t,a),this._addNodeToParentCache(a,r),a}_getTooltip(e){return Qw.isMarkdownString(e)?Y.from(e):e}_getCommand(e,t){return t?{...this._commands.toInternal(t,e),originalId:t.command}:void 0}_getCheckbox(e){if(e.checkboxState===void 0)return;let t,n,r;return typeof e.checkboxState==`number`?t=e.checkboxState:(t=e.checkboxState.state,n=e.checkboxState.tooltip,r=e.checkboxState.accessibilityInformation),{isChecked:t===vD.Checked,tooltip:n,accessibilityInformation:r}}_validateTreeItem(e){if(!gD.isTreeItem(e,this._extension))throw Error(`Extension ${this._extension.identifier.value} has provided an invalid tree item.`)}_createTreeNode(e,t,n){this._validateTreeItem(t);let r=this._register(new v),i=this._createHandle(e,t,n),a=this._getLightIconPath(t);return{item:{handle:i,parentHandle:n?n.item.handle:void 0,label:SX(t.label,this._extension),description:t.description,resourceUri:t.resourceUri,tooltip:this._getTooltip(t.tooltip),command:this._getCommand(r,t.command),contextValue:t.contextValue,icon:a,iconDark:this._getDarkIconPath(t)||a,themeIcon:this._getThemeIcon(t),collapsibleState:et(t.collapsibleState)?_D.None:t.collapsibleState,accessibilityInformation:t.accessibilityInformation,checkbox:this._getCheckbox(t)},extensionItem:t,parent:n,children:void 0,disposableStore:r,dispose(){r.dispose()}}}_getThemeIcon(e){return e.iconPath instanceof OD?e.iconPath:void 0}_createHandle(t,{id:n,label:r,resourceUri:i},a,o){if(n)return`${e.ID_HANDLE_PREFIX}/${n}`;let s=SX(r,this._extension),c=a?a.item.handle:e.LABEL_HANDLE_PREFIX,l=``;s&&(l=vl(s.label)?s.label.value:s.label);let u=l||(i?to(i):``);u=u.indexOf(`/`)===-1?u:u.replace(`/`,`//`);let d=this._nodes.has(t)?this._nodes.get(t).item.handle:void 0,f=this._getChildrenNodes(a)||[],p,m=0;do{if(p=`${c}/${m}:${u}`,o||!this._elements.has(p)||d===p)break;m++}while(m<=f.length);return p}_getLightIconPath(e){if(e.iconPath&&!(e.iconPath instanceof OD))return typeof e.iconPath==`string`||w.isUri(e.iconPath)?this._getIconPath(e.iconPath):this._getIconPath(e.iconPath.light)}_getDarkIconPath(e){if(e.iconPath&&!(e.iconPath instanceof OD)&&e.iconPath.dark)return this._getIconPath(e.iconPath.dark)}_getIconPath(e){return w.isUri(e)?e:w.file(e)}_addNodeToCache(e,t){this._elements.set(t.item.handle,e),this._nodes.set(e,t)}_updateNodeCache(e,t,n,r){this._elements.delete(t.item.handle),this._nodes.delete(e),t.item.handle!==n.item.handle&&this._elements.delete(n.item.handle),this._addNodeToCache(e,t);let i=this._getChildrenNodes(r)||[],a=i.filter(e=>e.item.handle===n.item.handle)[0];a&&i.splice(i.indexOf(a),1,t)}_addNodeToParentCache(e,t){t?(t.children||=[],t.children.push(e)):(this._roots||=[],this._roots.push(e))}_addChildrenToClear(e){if(e){let t=this._nodes.get(e);if(t){if(t.children)for(let e of t.children){this._nodesToClear.add(e);let t=this._elements.get(e.item.handle);t&&(this._addChildrenToClear(t),this._nodes.delete(t),this._elements.delete(e.item.handle))}t.children=void 0}}else this._addAllToClear()}_addAllToClear(){this._roots=void 0,this._nodes.forEach(e=>{this._nodesToClear.add(e)}),this._nodes.clear(),this._elements.clear(),this._childrenFetchTokens.clear()}_clearNodes(e){ht(e)}_clearAll(){this._roots=void 0,this._elements.clear(),ht(this._nodes.values()),this._nodes.clear(),ht(this._nodesToClear),this._nodesToClear.clear(),this._childrenFetchTokens.clear()}dispose(){super.dispose(),this._refreshCancellationSource.dispose(),this._clearAll()}},TX=class e{static{this.supportedSchemes=new Set([O.http,O.https])}constructor(e){this._openers=new Map,this._proxy=e.getProxy(E.MainThreadUriOpeners)}registerExternalUriOpener(t,n,r,i){if(this._openers.has(n))throw Error(`Opener with id '${n}' already registered`);let a=i.schemes.find(t=>!e.supportedSchemes.has(t));if(a)throw Error(`Scheme '${a}' is not supported. Only http and https are currently supported.`);return this._openers.set(n,r),this._proxy.$registerUriOpener(n,i.schemes,t,i.label),_(()=>{this._openers.delete(n),this._proxy.$unregisterUriOpener(n)})}async $canOpenUri(e,t,n){let r=this._openers.get(e);if(!r)throw Error(`Unknown opener with id: ${e}`);let i=w.revive(t);return r.canOpenExternalUri(i,n)}async $openUri(e,t,n){let r=this._openers.get(e);if(!r)throw Error(`Unknown opener id: '${e}'`);return r.openExternalUri(w.revive(t.resolvedUri),{sourceUri:w.revive(t.sourceUri)},n)}},EX=class extends y{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;constructor(e,t,n,r){super(),this.#s=void 0,this.#c=!0,this.#u=!1,this.#d=this._register(new S),this.onDidDispose=this.#d.event,this.#f=this._register(new S),this.onDidChangeViewState=this.#f.event,this.#e=e,this.#t=t,this.#r=n,this.#n=r.viewType,this.#i=r.panelOptions,this.#s=r.viewColumn,this.#a=r.title,this.#l=r.active}dispose(){this.#u||(this.#u=!0,this.#d.fire(),this.#t.$disposeWebview(this.#e),this.#r.dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),this.#r}get viewType(){return this.assertNotDisposed(),this.#n}get title(){return this.assertNotDisposed(),this.#a}set title(e){this.assertNotDisposed(),this.#a!==e&&(this.#a=e,this.#t.$setTitle(this.#e,e))}get iconPath(){return this.assertNotDisposed(),this.#o}set iconPath(e){this.assertNotDisposed(),this.#o!==e&&(this.#o=e,w.isUri(e)?this.#t.$setIconPath(this.#e,{light:e,dark:e}):this.#t.$setIconPath(this.#e,e))}get options(){return this.#i}get viewColumn(){if(this.assertNotDisposed(),!(typeof this.#s==`number`&&this.#s<0))return this.#s}get active(){return this.assertNotDisposed(),this.#l}get visible(){return this.assertNotDisposed(),this.#c}_updateViewState(e){this.#u||(this.active!==e.active||this.visible!==e.visible||this.viewColumn!==e.viewColumn)&&(this.#l=e.active,this.#c=e.visible,this.#s=e.viewColumn,this.#f.fire({webviewPanel:this}))}reveal(e,t){this.assertNotDisposed(),this.#t.$reveal(this.#e,{viewColumn:e===void 0?void 0:pj.from(e),preserveFocus:!!t})}assertNotDisposed(){if(this.#u)throw Error(`Webview is disposed`)}},DX=class e extends y{static newHandle(){return zc()}constructor(e,t,n){super(),this.webviews=t,this.workspace=n,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(E.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(t,n,r,i,a={}){let o=typeof i==`object`?i.viewColumn:i,s={viewColumn:pj.from(o),preserveFocus:typeof i==`object`&&!!i.preserveFocus},c=hW(t),l=e.newHandle();this._proxy.$createWebviewPanel(vW(t),l,n,{title:r,panelOptions:OX(a),webviewOptions:yW(t,this.workspace,a),serializeBuffersForPostMessage:c},s);let u=this.webviews.createNewWebview(l,a,t);return this.createNewWebviewPanel(l,n,r,o,a,u,!0)}$onDidChangeWebviewPanelViewStates(e){let t=Object.keys(e);t.sort((t,n)=>{let r=e[t],i=e[n];return r.active?1:i.active?-1:r.visible-+i.visible});for(let n of t){let t=this.getWebviewPanel(n);if(!t)continue;let r=e[n];t._updateViewState({active:r.active,visible:r.visible,viewColumn:pj.to(r.position)})}}async $onDidDisposeWebviewPanel(e){this.getWebviewPanel(e)?.dispose(),this._webviewPanels.delete(e),this.webviews.deleteWebview(e)}registerWebviewPanelSerializer(e,t,n){if(this._serializers.has(t))throw Error(`Serializer for '${t}' already registered`);return this._serializers.set(t,{serializer:n,extension:e}),this._proxy.$registerSerializer(t,{serializeBuffersForPostMessage:hW(e)}),new WT(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,n,r){let i=this._serializers.get(t);if(!i)throw Error(`No serializer found for '${t}'`);let{serializer:a,extension:o}=i,s=this.webviews.createNewWebview(e,n.webviewOptions,o),c=this.createNewWebviewPanel(e,t,n.title,r,n.panelOptions,s,n.active);await a.deserializeWebviewPanel(c,n.state)}createNewWebviewPanel(e,t,n,r,i,a,o){let s=new EX(e,this._proxy,a,{viewType:t,title:n,viewColumn:r,panelOptions:i,active:o});return this._webviewPanels.set(e,s),s}getWebviewPanel(e){return this._webviewPanels.get(e)}};function OX(e){return{enableFindWidget:e.enableFindWidget,retainContextWhenHidden:e.retainContextWhenHidden}}var kX=class extends y{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e,t,n,r,i,a){super(),this.#i=!1,this.#l=this._register(new S),this.onDidChangeVisibility=this.#l.event,this.#u=this._register(new S),this.onDidDispose=this.#u.event,this.#n=n,this.#o=r,this.#e=e,this.#t=t,this.#r=i,this.#a=a}dispose(){this.#i||(this.#i=!0,this.#u.fire(),this.#r.dispose(),super.dispose())}#l;#u;get title(){return this.assertNotDisposed(),this.#o}set title(e){this.assertNotDisposed(),this.#o!==e&&(this.#o=e,this.#t.$setWebviewViewTitle(this.#e,e))}get description(){return this.assertNotDisposed(),this.#s}set description(e){this.assertNotDisposed(),this.#s!==e&&(this.#s=e,this.#t.$setWebviewViewDescription(this.#e,e))}get visible(){return this.#a}get webview(){return this.#r}get viewType(){return this.#n}_setVisible(e){e===this.#a||this.#i||(this.#a=e,this.#l.fire())}get badge(){return this.assertNotDisposed(),this.#c}set badge(e){this.assertNotDisposed(),!(e?.value===this.#c?.value&&e?.tooltip===this.#c?.tooltip)&&(this.#c=jM.from(e),this.#t.$setWebviewViewBadge(this.#e,e))}show(e){this.assertNotDisposed(),this.#t.$show(this.#e,!!e)}assertNotDisposed(){if(this.#i)throw Error(`Webview is disposed`)}},AX=class{constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(E.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,n,r){if(this._viewProviders.has(t))throw Error(`View provider for '${t}' already registered`);return this._viewProviders.set(t,{provider:n,extension:e}),this._proxy.$registerWebviewViewProvider(vW(e),t,{retainContextWhenHidden:r?.retainContextWhenHidden,serializeBuffersForPostMessage:hW(e)}),new WT(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,n,r,i){let a=this._viewProviders.get(t);if(!a)throw Error(`No view provider found for '${t}'`);let{provider:o,extension:s}=a,c=this._extHostWebview.createNewWebview(e,{},s),l=new kX(e,this._proxy,t,n,c,!0);this._webviewViews.set(e,l),await o.resolveWebviewView(l,{state:r},i)}async $onDidChangeWebviewViewVisibility(e,t){this.getWebviewView(e)._setVisible(t)}async $disposeWebviewView(e){let t=this.getWebviewView(e);this._webviewViews.delete(e),t.dispose(),this._extHostWebview.deleteWebview(e)}getWebviewView(e){let t=this._webviewViews.get(e);if(!t)throw Error(`No webview found`);return t}};let jX=class extends y{constructor(e,t){super(),this._commands=t,this._handlePool=0,this._providers=new Map,this._itemPool=0,this._globalItems=new Map,this._providerItems=new Map,this._proxy=e.getProxy(E.MainThreadChatContext)}async $provideWorkspaceChatContext(e,t){this._clearProviderItems(e);let n=this._providers.get(e);if(!n||n.type!==`workspace`)throw Error(`Workspace context provider not found`);let r=n.provider,i=await r.provideWorkspaceChatContext?.(t)??await r.provideChatContext?.(t)??[];return this._convertItems(e,i)}async $provideExplicitChatContext(e,t){this._clearProviderItems(e);let n=this._providers.get(e);if(!n||n.type!==`explicit`)throw Error(`Explicit context provider not found`);let r=n.provider,i=await r.provideExplicitChatContext?.(t)??await r.provideChatContext?.(t)??[];return this._convertItems(e,i)}async $resolveExplicitChatContext(e,t,n){let r=this._providers.get(e);if(!r||r.type!==`explicit`)throw Error(`Explicit context provider not found`);let i=r.provider,a=this._globalItems.get(t.handle);if(!a)throw Error(`Chat context item not found`);return this._doResolve((i.resolveExplicitChatContext??i.resolveChatContext)?.bind(i),t,a,n)}async $provideResourceChatContext(e,t,n){let r=this._providers.get(e);if(!r||r.type!==`resource`)throw Error(`Resource context provider not found`);let i=r.provider,a=await i.provideResourceChatContext?.({resource:w.revive(t.resource)},n)??await i.provideChatContext?.({resource:w.revive(t.resource)},n);if(!a)return;if(a.label===void 0&&a.resourceUri===void 0)throw Error(`ChatContextItem must have either a label or a resourceUri`);let o={handle:this._addTrackedItem(e,a),icon:a.icon,label:a.label,resourceUri:a.resourceUri,modelDescription:a.modelDescription,tooltip:a.tooltip?Y.from(a.tooltip):void 0,value:t.withValue?a.value:void 0,command:a.command?{id:a.command.command}:void 0};if(t.withValue&&!o.value){let e=await(i.resolveResourceChatContext??i.resolveChatContext)?.bind(i)(a,n);o.value=e?.value,o.tooltip=e?.tooltip?Y.from(e.tooltip):o.tooltip}return o}async $resolveResourceChatContext(e,t,n){let r=this._providers.get(e);if(!r||r.type!==`resource`)throw Error(`Resource context provider not found`);let i=r.provider,a=this._globalItems.get(t.handle);if(!a)throw Error(`Chat context item not found`);return this._doResolve((i.resolveResourceChatContext??i.resolveChatContext)?.bind(i),t,a,n)}async $executeChatContextItemCommand(e){let t=this._globalItems.get(e);if(!t)throw Error(`Chat context item not found`);if(!t.command)throw Error(`Chat context item has no command`);let n=t.command.arguments?[t,...t.command.arguments]:[t];await this._commands.executeCommand(t.command.command,...n)}registerChatWorkspaceContextProvider(e,t){let n=this._handlePool++,r=new v;return this._providers.set(n,{type:`workspace`,provider:t,disposables:r}),this._listenForWorkspaceContextChanges(n,t,r),this._proxy.$registerChatWorkspaceContextProvider(n,e),{dispose:()=>{this._providers.delete(n),this._clearProviderItems(n),this._providerItems.delete(n),this._proxy.$unregisterChatContextProvider(n),r.dispose()}}}registerChatExplicitContextProvider(e,t){let n=this._handlePool++,r=new v;return this._providers.set(n,{type:`explicit`,provider:t,disposables:r}),this._proxy.$registerChatExplicitContextProvider(n,e),{dispose:()=>{this._providers.delete(n),this._clearProviderItems(n),this._providerItems.delete(n),this._proxy.$unregisterChatContextProvider(n),r.dispose()}}}registerChatResourceContextProvider(e,t,n){let r=this._handlePool++,i=new v;return this._providers.set(r,{type:`resource`,provider:n,disposables:i}),this._proxy.$registerChatResourceContextProvider(r,t,cj.from(e)),{dispose:()=>{this._providers.delete(r),this._clearProviderItems(r),this._providerItems.delete(r),this._proxy.$unregisterChatContextProvider(r),i.dispose()}}}registerChatContextProvider(e,t,n){let r=[];if(n.provideWorkspaceChatContext){let e={onDidChangeWorkspaceChatContext:n.onDidChangeWorkspaceChatContext,provideWorkspaceChatContext:e=>n.provideWorkspaceChatContext(e)};r.push(this.registerChatWorkspaceContextProvider(t,e))}if(n.provideChatContextExplicit){let e={provideExplicitChatContext:e=>n.provideChatContextExplicit(e),resolveExplicitChatContext:n.resolveChatContext?(e,t)=>n.resolveChatContext(e,t):e=>e};r.push(this.registerChatExplicitContextProvider(t,e))}if(n.provideChatContextForResource&&e){let i={provideResourceChatContext:(e,t)=>n.provideChatContextForResource(e,t),resolveResourceChatContext:n.resolveChatContext?(e,t)=>n.resolveChatContext(e,t):e=>e};r.push(this.registerChatResourceContextProvider(e,t,i))}return{dispose:()=>{for(let e of r)e.dispose()}}}_clearProviderItems(e){let t=this._providerItems.get(e);if(t){for(let e of t)this._globalItems.delete(e);t.clear()}}_addTrackedItem(e,t){let n=this._itemPool++;return this._globalItems.set(n,t),this._providerItems.has(e)||this._providerItems.set(e,new Set),this._providerItems.get(e).add(n),n}_convertItems(e,t){let n=[];for(let r of t){if(r.label===void 0&&r.resourceUri===void 0)throw Error(`ChatContextItem must have either a label or a resourceUri`);let t=this._addTrackedItem(e,r);n.push({handle:t,icon:r.icon,label:r.label,resourceUri:r.resourceUri,modelDescription:r.modelDescription,tooltip:r.tooltip?Y.from(r.tooltip):void 0,value:r.value,command:r.command?{id:r.command.command}:void 0})}return n}async _doResolve(e,t,n,r){let i=await e(n,r);return i?{handle:t.handle,icon:i.icon,label:i.label,resourceUri:i.resourceUri,modelDescription:i.modelDescription,tooltip:i.tooltip?Y.from(i.tooltip):void 0,value:i.value,command:i.command?{id:i.command.command}:void 0}:t}_listenForWorkspaceContextChanges(e,t,n){if(!t.onDidChangeWorkspaceChatContext)return;let r=async()=>{let n=await t.provideWorkspaceChatContext?.(Pi.None)??await t.provideChatContext?.(Pi.None),r=this._convertItems(e,n??[]);return this._proxy.$updateWorkspaceContextItems(e,r)};n.add(t.onDidChangeWorkspaceChatContext(async()=>r())),r()}dispose(){super.dispose();for(let{disposables:e}of this._providers.values())e.dispose()}};jX=A([j(0,Hs),j(1,RI)],jX);let MX=class extends y{constructor(e){super(),this._nextHandle=0,this._activeProgress=new Map,this._onDidAddCoreEvent=this._register(new S({onWillAddFirstListener:()=>this._proxy.$subscribeToCoreDebugEvents(),onDidRemoveLastListener:()=>this._proxy.$unsubscribeFromCoreDebugEvents()})),this.onDidAddCoreEvent=this._onDidAddCoreEvent.event,this._proxy=e.getProxy(E.MainThreadChatDebug)}_progressKey(e,t){return`${e}:${w.revive(t).toString()}`}_cleanupProgress(e){let t=this._activeProgress.get(e);t&&(t.dispose(),this._activeProgress.delete(e))}registerChatDebugLogProvider(e){if(this._provider)throw Error(`A ChatDebugLogProvider is already registered.`);this._provider=e;let t=this._nextHandle++;return this._proxy.$registerChatDebugLogProvider(t),_(()=>{this._provider=void 0;for(let[e,n]of this._activeProgress)e.startsWith(`${t}:`)&&(n.dispose(),this._activeProgress.delete(e));this._proxy.$unregisterChatDebugLogProvider(t)})}async $provideChatDebugLog(e,t,n){if(!this._provider)return;let r=this._progressKey(e,t);this._cleanupProgress(r);let i=new v;this._activeProgress.set(r,i);let a=i.add(new S);i.add(a.event(n=>{let r=this._serializeEvent(n);r.sessionResource||=t,this._proxy.$acceptChatDebugEvent(e,r)})),i.add(n.onCancellationRequested(()=>{this._cleanupProgress(r)}));try{let e={report:e=>a.fire(e)},r=w.revive(t),i=await this._provider.provideChatDebugLog(r,e,n);return i?i.map(e=>this._serializeEvent(e)):void 0}catch(e){throw this._cleanupProgress(r),e}}_serializeEvent(e){let t={id:e.id,sessionResource:e.sessionResource,created:e.created.getTime(),parentEventId:e.parentEventId};switch(e._kind){case`toolCall`:{let n=e;return{...t,kind:`toolCall`,toolName:n.toolName,toolCallId:n.toolCallId,input:n.input,output:n.output,result:n.result===cA.Success?`success`:n.result===cA.Error?`error`:void 0,durationInMillis:n.durationInMillis}}case`modelTurn`:{let n=e;return{...t,kind:`modelTurn`,model:n.model,requestName:n.requestName,inputTokens:n.inputTokens,outputTokens:n.outputTokens,cachedTokens:n.cachedTokens,totalTokens:n.totalTokens,copilotUsageNanoAiu:n.copilotUsageNanoAiu,durationInMillis:n.durationInMillis}}case`generic`:{let n=e;return{...t,kind:`generic`,name:n.name,details:n.details,level:n.level,category:n.category}}case`subagentInvocation`:{let n=e;return{...t,kind:`subagentInvocation`,agentName:n.agentName,description:n.description,status:n.status===$k.Running?`running`:n.status===$k.Completed?`completed`:n.status===$k.Failed?`failed`:void 0,durationInMillis:n.durationInMillis,toolCallCount:n.toolCallCount,modelTurnCount:n.modelTurnCount}}case`userMessage`:{let n=e;return{...t,kind:`userMessage`,message:n.message,sections:n.sections.map(e=>({name:e.name,content:e.content}))}}case`agentResponse`:{let n=e;return{...t,kind:`agentResponse`,message:n.message,sections:n.sections.map(e=>({name:e.name,content:e.content}))}}default:{let n=e,r=n.name,i=n.details;return{...t,kind:`generic`,name:typeof r==`string`?r:``,details:typeof i==`string`?i:void 0,level:n.level??1,category:n.category}}}}async $resolveChatDebugLogEvent(e,t,n){if(!this._provider?.resolveChatDebugLogEvent)return;let r=await this._provider.resolveChatDebugLogEvent(t,n);if(r)switch(r._kind){case`text`:return{kind:`text`,value:r.value};case`messageContent`:{let e=r;return{kind:`message`,type:e.type===vA.User?`user`:`agent`,message:e.message,sections:e.sections.map(e=>({name:e.name,content:e.content}))}}case`userMessage`:{let e=r;return{kind:`message`,type:`user`,message:e.message,sections:e.sections.map(e=>({name:e.name,content:e.content}))}}case`agentResponse`:{let e=r;return{kind:`message`,type:`agent`,message:e.message,sections:e.sections.map(e=>({name:e.name,content:e.content}))}}case`toolCallContent`:{let e=r;return{kind:`toolCall`,toolName:e.toolName,result:e.result===cA.Success?`success`:e.result===cA.Error?`error`:void 0,durationInMillis:e.durationInMillis,input:e.input,output:e.output}}case`modelTurnContent`:{let e=r;return{kind:`modelTurn`,requestName:e.requestName,model:e.model,status:e.status,durationInMillis:e.durationInMillis,timeToFirstTokenInMillis:e.timeToFirstTokenInMillis,requestId:e.requestId,maxInputTokens:e.maxInputTokens,maxOutputTokens:e.maxOutputTokens,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cachedTokens:e.cachedTokens,totalTokens:e.totalTokens,requestOptions:e.requestOptions,errorMessage:e.errorMessage,sections:e.sections?.map(e=>({name:e.name,content:e.content}))}}case`hookContent`:{let e=r;return{kind:`hook`,hookType:e.hookType,command:e.command,result:e.result===lA.Success?`success`:e.result===lA.Error?`error`:e.result===lA.NonBlockingError?`nonBlockingError`:void 0,durationInMillis:e.durationInMillis,input:e.input,output:e.output,exitCode:e.exitCode,errorMessage:e.errorMessage}}default:return}}_deserializeEvent(e){let t=new Date(e.created),n=e.sessionResource?w.revive(e.sessionResource):void 0;switch(e.kind){case`toolCall`:{let r=new uA(e.toolName,t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.toolCallId=e.toolCallId,r.input=e.input,r.output=e.output,r.result=e.result===`success`?cA.Success:e.result===`error`?cA.Error:void 0,r.durationInMillis=e.durationInMillis,r}case`modelTurn`:{let r=new dA(t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.model=e.model,r.requestName=e.requestName,r.inputTokens=e.inputTokens,r.outputTokens=e.outputTokens,r.cachedTokens=e.cachedTokens,r.totalTokens=e.totalTokens,r.copilotUsageNanoAiu=e.copilotUsageNanoAiu,r.durationInMillis=e.durationInMillis,r}case`generic`:{let r=new fA(e.name,e.level,t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.details=e.details,r.category=e.category,r}case`subagentInvocation`:{let r=new pA(e.agentName,t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.description=e.description,r.status=e.status===`running`?$k.Running:e.status===`completed`?$k.Completed:e.status===`failed`?$k.Failed:void 0,r.durationInMillis=e.durationInMillis,r.toolCallCount=e.toolCallCount,r.modelTurnCount=e.modelTurnCount,r}case`userMessage`:{let r=new hA(e.message,t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.sections=e.sections.map(e=>new mA(e.name,e.content)),r}case`agentResponse`:{let r=new gA(e.message,t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.sections=e.sections.map(e=>new mA(e.name,e.content)),r}default:return}}$onCoreDebugEvent(e){let t=this._deserializeEvent(e);t&&this._onDidAddCoreEvent.fire(t)}async $exportChatDebugLog(e,t,n,r,i){if(!this._provider?.provideChatDebugLogExport)return;let a=w.revive(t),o={coreEvents:n.map(e=>this._deserializeEvent(e)).filter(e=>e!==void 0),sessionTitle:r},s=await this._provider.provideChatDebugLogExport(a,o,i);if(s)return b.wrap(s)}async $importChatDebugLog(e,t,n){if(!this._provider?.resolveChatDebugLogImport)return;let r=await this._provider.resolveChatDebugLogImport(t.buffer,n);if(r)return{uri:r.uri,sessionTitle:r.sessionTitle}}async $getAvailableDebugSessionResources(e,t){return this._provider?.provideAvailableDebugSessionResources?await this._provider.provideAvailableDebugSessionResources(t)??[]:[]}dispose(){for(let e of this._activeProgress.values())e.dispose();this._activeProgress.clear(),super.dispose()}};MX=A([j(0,Hs)],MX);function NX(e){let t=e.get(Fs),n=e.get(Rc),r=e.get(FF),i=e.get(KR),a=e.get(YP),o=e.get(II),c=e.get(mF),l=e.get(Ws),u=e.get(Hs),d=e.get(AF),p=e.get(IF),m=e.get(Os),h=e.get(Ds),ee=e.get(XF),g=e.get(ZR),ne=e.get(OL),re=e.get(QV),ie=e.get(jL),ae=e.get(MR),oe=e.get(WB),se=e.get(IR),ce=e.get(FL),le=e.get(GL),ue=e.get(ZL),de=e.get(SH),fe=e.get(PH),pe=e.get(LH),me=e.get(qH);u.set(D.ExtHostFileSystemInfo,n),u.set(D.ExtHostLogLevelServiceShape,m),u.set(D.ExtHostWorkspace,a),u.set(D.ExtHostConfiguration,c),u.set(D.ExtHostExtensionService,i),u.set(D.ExtHostStorage,d),u.set(D.ExtHostTunnelService,ee),u.set(D.ExtHostWindow,ne),u.set(D.ExtHostPower,re),u.set(D.ExtHostUrls,ie),u.set(D.ExtHostSecretState,ae),u.set(D.ExtHostTelemetry,o),u.set(D.ExtHostEditorTabs,oe),u.set(D.ExtHostManagedSockets,se),u.set(D.ExtHostProgress,ce),u.set(D.ExtHostAuthentication,le),u.set(D.ExtHostChatProvider,ue),u.set(D.ExtHostDataChannels,fe),u.set(D.ExtHostMeteredConnection,pe),u.set(D.ExtHostGitExtension,me);let he=u.set(D.ExtHostDecorations,e.get(_z)),ge=u.set(D.ExtHostDocumentsAndEditors,e.get(Nz)),_e=u.set(D.ExtHostCommands,e.get(RI)),ve=u.set(D.ExtHostTerminalService,e.get(HI)),ye=u.set(D.ExtHostTerminalShellIntegration,e.get($V)),be=u.set(D.ExtHostDebugService,e.get(SV)),xe=u.set(D.ExtHostSearch,e.get(qV)),Se=u.set(D.ExtHostTask,e.get(PB)),Ce=u.set(D.ExtHostOutputService,e.get(mz)),we=u.set(D.ExtHostLocalization,e.get(FR)),Te=u.set(D.ExtHostDocuments,new HW(u,ge)),Ee=u.set(D.ExtHostDocumentContentProviders,new BW(u,ge,h)),De=u.set(D.ExtHostDocumentSaveParticipant,new VW(h,Te,u.getProxy(E.MainThreadBulkEdits))),Oe=u.set(D.ExtHostNotebook,new pY(u,_e,ge,Te,r,xe,h)),ke=u.set(D.ExtHostNotebookDocuments,new gY(Oe)),Ae=u.set(D.ExtHostNotebookEditors,new _Y(h,Oe)),je=u.set(D.ExtHostNotebookKernels,new bY(u,t,Oe,_e,h)),Me=u.set(D.ExtHostNotebookRenderers,new OY(u,Oe)),Ne=u.set(D.ExtHostNotebookDocumentSaveParticipant,new hY(h,Oe,u.getProxy(E.MainThreadBulkEdits))),Pe=u.set(D.ExtHostEditors,new sX(u,ge)),Fe=u.set(D.ExtHostTreeViews,new CX(u.getProxy(E.MainThreadTreeViews),_e,h)),Ie=u.set(D.ExtHostEditorInsets,new $U(u.getProxy(E.MainThreadEditorInsets),Pe,t.remote)),Le=u.set(D.ExtHostDiagnostics,new RW(u,h,n,ge)),Re=u.set(D.ExtHostLanguages,new cJ(u,Te,_e.converter,l)),ze=u.set(D.ExtHostLanguageFeatures,new JG(u,l,Te,_e,Le,h,g,o)),Be=u.set(D.ExtHostCodeMapper,new eW(u)),Ve=u.set(D.ExtHostFileSystem,new tG(u,ze)),He=u.set(D.ExtHostFileSystemEventService,new aG(u,h,ge)),Ue=u.set(D.ExtHostQuickOpen,jY(u,a,_e)),We=u.set(D.ExtHostSCM,new QY(u,_e,Te,h)),Ge=u.set(D.ExtHostQuickDiff,new AY(u,l)),Ke=u.set(D.ExtHostShare,new $Y(u,l)),qe=u.set(D.ExtHostComments,tW(u,_e,Te)),Je=u.set(D.ExtHostLabelService,new sG(u)),Ye=u.set(D.ExtHostTheming,new cX(u)),Xe=u.set(D.ExtHostTimeline,new lX(u,_e)),Ze=u.set(D.ExtHostWebviews,new _W(u,t.remote,a,h,g)),Qe=u.set(D.ExtHostWebviewPanels,new DX(u,Ze,a)),$e=u.set(D.ExtHostCustomEditors,new DW(u,Te,p,Ze,Qe)),et=u.set(D.ExtHostWebviewViews,new AX(u,Ze)),tt=u.set(D.ExtHostTesting,e.get(tV)),nt=u.set(D.ExtHostUriOpeners,new TX(u)),rt=u.set(D.ExtHostProfileContentHandlers,new kY(u)),it=u.set(D.ExtHostChatOutputRenderer,new PU(u,Ze));u.set(D.ExtHostInteractive,new oG(u,Oe,ge,_e,h));let at=u.set(D.ExtHostLanguageModelTools,new sJ(u,ue)),ot=u.set(D.ExtHostChatSessions,new VU(_e,ue,u,h)),st=u.set(D.ExtHostChatAgents2,new OU(u,h,_e,Te,ge,ue,Le,at,ot)),ct=u.set(D.ExtHostChatContext,new jX(u,_e)),lt=u.set(D.ExtHostChatDebug,new MX(u)),ut=u.set(D.ExtHostAiRelatedInformation,new $H(u)),dt=u.set(D.ExtHostAiEmbeddingVector,new WW(u)),ft=u.set(D.ExtHostAiSettingsSearch,new eU(u)),pt=u.set(D.ExtHostStatusBar,new oX(u,_e.converter)),mt=u.set(D.ExtHostSpeech,new eX(u)),ht=u.set(D.ExtHostEmbeddings,new UW(u)),_t=u.set(D.ExtHostBrowsers,new rX(u)),_=u.set(D.ExtHostChatQuota,new WU(u));u.set(D.ExtHostMcp,e.get(SH));let v=Object.values(D);u.assertRegistered(v);let y=new fU(u,ge),vt=new qU(u),yt=new uJ(u,h),bt=new zW(u),xt=new HU(u),St=new GU(u);return lU.register(_e),function(e,c,l){function d(t){return(n,r,i)=>{let a=t(t=>{try{n.call(r,t)}catch(t){s(new Ss(e.identifier,t,`FAILED to handle event`))}});return i?.push(a),a}}let p=(function(){let t=!e.isUnderDevelopment;function n(){t||=(h.info(`Extension '${e.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),!0)}return function t(r){if(Array.isArray(r))r.forEach(t);else if(typeof r==`string`)n();else{let t=r;t.scheme===void 0&&n(),typeof t.exclusive==`boolean`&&K(e,`documentFiltersExclusive`)}return r}})(),m={getSession(t,n,r){return(typeof r?.forceNewSession==`object`&&r.forceNewSession.learnMore||typeof r?.createIfNone==`object`&&r.createIfNone.learnMore)&&K(e,`authLearnMore`),r?.authorizationServer&&K(e,`authIssuers`),le.getSession(e,t,n,r)},getAccounts(e){return le.getAccounts(e)},async hasSession(t,n){return K(e,`authSession`),!!await le.getSession(e,t,n,{silent:!0})},get onDidChangeSessions(){return d(le.getExtensionScopedSessionsEvent(e.identifier.value))},registerAuthenticationProvider(t,n,r,i){return i?.supportedAuthorizationServers&&K(e,`authIssuers`),le.registerAuthenticationProvider(t,n,r,i)}},ae={registerCommand(t,n,r){return _e.registerCommand(!0,t,n,r,void 0,e)},registerTextEditorCommand(t,n,r){return _e.registerCommand(!0,t,(...e)=>{let i=Pe.getActiveTextEditor();if(!i){h.warn(`Cannot execute `+t+` because there is no active text editor.`);return}return i.edit(t=>{n.apply(r,[i,t,...e])}).then(e=>{e||h.warn(`Edits from command `+t+` were not applied.`)},e=>{h.warn(`An error occurred while running command `+t,e)})},void 0,void 0,e)},registerDiffInformationCommand:(t,n,r)=>(K(e,`diffCommand`),_e.registerCommand(!0,t,async(...e)=>{let i=ge.activeEditor(!0);if(!i){h.warn(`Cannot execute `+t+` because there is no active text editor.`);return}let a=await Pe.getDiffInformation(i.id);n.apply(r,[a,...e])},void 0,void 0,e)),executeCommand(e,...t){return _e.executeCommand(e,...t)},getCommands(e=!1){return _e.getCommands(e)}},se={get machineId(){return t.telemetryInfo.machineId},get devDeviceId(){return K(e,`devDeviceId`),t.telemetryInfo.devDeviceId??t.telemetryInfo.machineId},get isAppPortable(){return t.environment.isPortable??!1},get sessionId(){return t.telemetryInfo.sessionId},get language(){return t.environment.appLanguage},get appName(){return t.environment.appName},get appRoot(){return t.environment.appRoot?.fsPath??``},get appHost(){return t.environment.appHost},get uriScheme(){return t.environment.appUriScheme},get clipboard(){return vt.value},get shell(){return ve.getDefaultShell(!1)},get onDidChangeShell(){return d(ve.onDidChangeShell)},get isTelemetryEnabled(){return o.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return d(o.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return K(e,`telemetry`),o.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return K(e,`telemetry`),d(o.onDidChangeTelemetryConfiguration)},get isMeteredConnection(){return K(e,`envIsConnectionMetered`),pe.isConnectionMetered},get onDidChangeMeteredConnection(){return K(e,`envIsConnectionMetered`),d(pe.onDidChangeIsConnectionMetered)},get isNewAppInstall(){return FI(t.telemetryInfo.firstSessionDate)},createTelemetryLogger(t,n){return PI.validateSender(t),o.instantiateLogger(e,t,n)},async openExternal(e,n){return ne.openUri(e,{allowTunneling:t.remote.isRemote??(t.remote.authority?await ee.hasTunnelProvider():!1),allowContributedOpeners:n?.allowContributedOpeners})},async asExternalUri(e){if(e.scheme===t.environment.appUriScheme)return ie.createAppUri(e);try{return await ne.asExternalUri(e,{allowTunneling:!!t.remote.authority})}catch(t){if(Ua(e,O.http)||Ua(e,O.https))return e;throw t}},get remoteName(){return hs(t.remote.authority)},get remoteAuthority(){return K(e,`resolvers`),t.remote.authority},get uiKind(){return t.uiKind},get logLevel(){return h.getLevel()},get onDidChangeLogLevel(){return d(h.onDidChangeLogLevel)},get appQuality(){return K(e,`resolvers`),t.quality},get appCommit(){return K(e,`resolvers`),t.commit},getDataChannel(t){return K(e,`dataChannels`),fe.createDataChannel(e,t)},get power(){return K(e,`environmentPower`),{get onDidSuspend(){return d(re.onDidSuspend)},get onDidResume(){return d(re.onDidResume)},get onDidChangeOnBatteryPower(){return d(re.onDidChangeOnBatteryPower)},get onDidChangeThermalState(){return d(re.onDidChangeThermalState)},get onDidChangeSpeedLimit(){return d(re.onDidChangeSpeedLimit)},get onWillShutdown(){return d(re.onWillShutdown)},get onDidLockScreen(){return d(re.onDidLockScreen)},get onDidUnlockScreen(){return d(re.onDidUnlockScreen)},getSystemIdleState(e){return re.getSystemIdleState(e)},getSystemIdleTime(){return re.getSystemIdleTime()},getCurrentThermalState(){return re.getCurrentThermalState()},isOnBatteryPower(){return re.isOnBatteryPower()},async startPowerSaveBlocker(e){let t=await re.startPowerSaveBlocker(e);return{id:t.id,get isStarted(){return t.isStarted},dispose(){t.dispose()}}}}}},me={createTestController(t,n,r){return tt.createTestController(e,t,n,r)},createTestObserver(){return K(e,`testObserver`),tt.createTestObserver()},runTests(t){return K(e,`testObserver`),tt.runTests(t)},registerTestFollowupProvider(t){return K(e,`testObserver`),tt.registerTestFollowupProvider(t)},get onDidChangeTestResults(){return K(e,`testObserver`),d(tt.onResultsChanged)},get testResults(){return K(e,`testObserver`),tt.results}},Ze=t.remote.isRemote?SO.Workspace:SO.UI,v={getExtension(t,n){Dw(e)||(n=!1);let r=c.mine.getExtensionDescription(t);if(r)return new qR(i,e.identifier,r,Ze,!1);if(n){let n=c.all.getExtensionDescription(t);if(n)return new qR(i,e.identifier,n,Ze,!0)}},get all(){let t=[];for(let n of c.mine.getAllExtensionDescriptions())t.push(new qR(i,e.identifier,n,Ze,!1));return t},get allAcrossExtensionHosts(){K(e,`extensionsAny`);let t=new bs(c.mine.getAllExtensionDescriptions().map(e=>e.identifier)),n=[];for(let r of c.all.getAllExtensionDescriptions()){let a=!t.has(r.identifier);n.push(new qR(i,e.identifier,r,Ze,a))}return n},get onDidChange(){return Dw(e)?d(Qn.any(c.mine.onDidChange,c.all.onDidChange)):d(c.mine.onDidChange)}},Ct={createDiagnosticCollection(t){return Le.createDiagnosticCollection(e.identifier,t)},get onDidChangeDiagnostics(){return d(Le.onDidChangeDiagnostics)},getDiagnostics:e=>Le.getDiagnostics(e),getLanguages(){return Re.getLanguages()},setTextDocumentLanguage(e,t){return Re.changeLanguage(e.uri,t)},match(e,t){let n=lM.from(e),r;return XH(n)&&(r=Oe.notebookDocuments.find(e=>e.apiNotebook.getCells().find(e=>e.document===t))?.apiNotebook),YH(n,t.uri,t.languageId,!0,r?.uri,r?.notebookType)},registerCodeActionsProvider(t,n,r){return ze.registerCodeActionProvider(e,p(t),n,r)},registerDocumentPasteEditProvider(t,n,r){return ze.registerDocumentPasteEditProvider(e,p(t),n,r)},registerCodeLensProvider(t,n){return ze.registerCodeLensProvider(e,p(t),n)},registerDefinitionProvider(t,n){return ze.registerDefinitionProvider(e,p(t),n)},registerDeclarationProvider(t,n){return ze.registerDeclarationProvider(e,p(t),n)},registerImplementationProvider(t,n){return ze.registerImplementationProvider(e,p(t),n)},registerTypeDefinitionProvider(t,n){return ze.registerTypeDefinitionProvider(e,p(t),n)},registerHoverProvider(t,n){return ze.registerHoverProvider(e,p(t),n,e.identifier)},registerEvaluatableExpressionProvider(t,n){return ze.registerEvaluatableExpressionProvider(e,p(t),n,e.identifier)},registerInlineValuesProvider(t,n){return ze.registerInlineValuesProvider(e,p(t),n,e.identifier)},registerDocumentHighlightProvider(t,n){return ze.registerDocumentHighlightProvider(e,p(t),n)},registerMultiDocumentHighlightProvider(t,n){return ze.registerMultiDocumentHighlightProvider(e,p(t),n)},registerLinkedEditingRangeProvider(t,n){return ze.registerLinkedEditingRangeProvider(e,p(t),n)},registerReferenceProvider(t,n){return ze.registerReferenceProvider(e,p(t),n)},registerRenameProvider(t,n){return ze.registerRenameProvider(e,p(t),n)},registerNewSymbolNamesProvider(t,n){return K(e,`newSymbolNamesProvider`),ze.registerNewSymbolNamesProvider(e,p(t),n)},registerDocumentSymbolProvider(t,n,r){return ze.registerDocumentSymbolProvider(e,p(t),n,r)},registerWorkspaceSymbolProvider(t){return ze.registerWorkspaceSymbolProvider(e,t)},registerDocumentFormattingEditProvider(t,n){return ze.registerDocumentFormattingEditProvider(e,p(t),n)},registerDocumentRangeFormattingEditProvider(t,n){return ze.registerDocumentRangeFormattingEditProvider(e,p(t),n)},registerOnTypeFormattingEditProvider(t,n,r,...i){return ze.registerOnTypeFormattingEditProvider(e,p(t),n,[r].concat(i))},registerDocumentSemanticTokensProvider(t,n,r){return ze.registerDocumentSemanticTokensProvider(e,p(t),n,r)},registerDocumentRangeSemanticTokensProvider(t,n,r){return ze.registerDocumentRangeSemanticTokensProvider(e,p(t),n,r)},registerSignatureHelpProvider(t,n,r,...i){return typeof r==`object`?ze.registerSignatureHelpProvider(e,p(t),n,r):ze.registerSignatureHelpProvider(e,p(t),n,r===void 0?[]:[r,...i])},registerCompletionItemProvider(t,n,...r){return ze.registerCompletionItemProvider(e,p(t),n,r)},registerInlineCompletionItemProvider(t,n,r){return n.handleDidShowCompletionItem&&K(e,`inlineCompletionsAdditions`),n.handleDidPartiallyAcceptCompletionItem&&K(e,`inlineCompletionsAdditions`),r&&K(e,`inlineCompletionsAdditions`),ze.registerInlineCompletionsProvider(e,p(t),n,r)},get inlineCompletionsUnificationState(){return K(e,`inlineCompletionsAdditions`),ze.inlineCompletionsUnificationState},onDidChangeCompletionsUnificationState(t,n,r){return K(e,`inlineCompletionsAdditions`),d(ze.onDidChangeInlineCompletionsUnificationState)(t,n,r)},registerDocumentLinkProvider(t,n){return ze.registerDocumentLinkProvider(e,p(t),n)},registerColorProvider(t,n){return ze.registerColorProvider(e,p(t),n)},registerFoldingRangeProvider(t,n){return ze.registerFoldingRangeProvider(e,p(t),n)},registerSelectionRangeProvider(t,n){return ze.registerSelectionRangeProvider(e,t,n)},registerCallHierarchyProvider(t,n){return ze.registerCallHierarchyProvider(e,t,n)},registerTypeHierarchyProvider(t,n){return ze.registerTypeHierarchyProvider(e,t,n)},setLanguageConfiguration:(t,n)=>ze.setLanguageConfiguration(e,t,n),getTokenInformationAtPosition(t,n){return K(e,`tokenInformation`),Re.tokenAtPosition(t,n)},registerInlayHintsProvider(t,n){return ze.registerInlayHintsProvider(e,t,n)},createLanguageStatusItem(t,n){return Re.createLanguageStatusItem(e,t,n)},registerDocumentDropEditProvider(t,n,r){return ze.registerDocumentOnDropEditProvider(e,t,n,r)}},wt={get activeTextEditor(){return Pe.getActiveTextEditor()},get visibleTextEditors(){return Pe.getVisibleTextEditors()},get activeTerminal(){return ve.activeTerminal},get terminals(){return ve.terminals},async showTextDocument(t,n,r){w.isUri(t)&&t.scheme===O.vscodeRemote&&!t.authority&&g.report(`workspace.showTextDocument`,e,`A URI of 'vscode-remote' scheme requires an authority.`);let i=await(w.isUri(t)?Promise.resolve(Tt.openTextDocument(t)):Promise.resolve(t));return Pe.showTextDocument(i,n,r)},createTextEditorDecorationType(t){return Pe.createTextEditorDecorationType(e,t)},onDidChangeActiveTextEditor(e,t,n){return d(Pe.onDidChangeActiveTextEditor)(e,t,n)},onDidChangeVisibleTextEditors(e,t,n){return d(Pe.onDidChangeVisibleTextEditors)(e,t,n)},onDidChangeTextEditorSelection(e,t,n){return d(Pe.onDidChangeTextEditorSelection)(e,t,n)},onDidChangeTextEditorOptions(e,t,n){return d(Pe.onDidChangeTextEditorOptions)(e,t,n)},onDidChangeTextEditorVisibleRanges(e,t,n){return d(Pe.onDidChangeTextEditorVisibleRanges)(e,t,n)},onDidChangeTextEditorViewColumn(e,t,n){return d(Pe.onDidChangeTextEditorViewColumn)(e,t,n)},onDidChangeTextEditorDiffInformation(t,n,r){return K(e,`textEditorDiffInformation`),d(Pe.onDidChangeTextEditorDiffInformation)(t,n,r)},onDidCloseTerminal(e,t,n){return d(ve.onDidCloseTerminal)(e,t,n)},onDidOpenTerminal(e,t,n){return d(ve.onDidOpenTerminal)(e,t,n)},onDidChangeActiveTerminal(e,t,n){return d(ve.onDidChangeActiveTerminal)(e,t,n)},onDidChangeTerminalDimensions(t,n,r){return K(e,`terminalDimensions`),d(ve.onDidChangeTerminalDimensions)(t,n,r)},onDidChangeTerminalState(e,t,n){return d(ve.onDidChangeTerminalState)(e,t,n)},onDidWriteTerminalData(t,n,r){return K(e,`terminalDataWriteEvent`),d(ve.onDidWriteTerminalData)(t,n,r)},onDidExecuteTerminalCommand(t,n,r){return K(e,`terminalExecuteCommandEvent`),d(ve.onDidExecuteTerminalCommand)(t,n,r)},onDidChangeTerminalShellIntegration(e,t,n){return d(ye.onDidChangeTerminalShellIntegration)(e,t,n)},onDidStartTerminalShellExecution(e,t,n){return d(ye.onDidStartTerminalShellExecution)(e,t,n)},onDidEndTerminalShellExecution(e,t,n){return d(ye.onDidEndTerminalShellExecution)(e,t,n)},get state(){return ne.getState()},onDidChangeWindowState(e,t,n){return d(ne.onDidChangeWindowState)(e,t,n)},showInformationMessage(t,...n){return yt.showMessage(e,Dc.Info,t,n[0],n.slice(1))},showWarningMessage(t,...n){return yt.showMessage(e,Dc.Warning,t,n[0],n.slice(1))},showErrorMessage(t,...n){return yt.showMessage(e,Dc.Error,t,n[0],n.slice(1))},showQuickPick(t,n,r){return Ue.showQuickPick(e,t,n,r)},showWorkspaceFolderPick(e){return Ue.showWorkspaceFolderPick(e)},showInputBox(e,t){return Ue.showInput(e,t)},showOpenDialog(e){return bt.showOpenDialog(e)},showSaveDialog(e){return bt.showSaveDialog(e)},createStatusBarItem(t,n,r){let i,a,o;return typeof t==`string`?(i=t,a=n,o=r):(a=t,o=n),pt.createStatusBarEntry(e,i,a,o)},setStatusBarMessage(e,t){return pt.setStatusBarMessage(e,t)},withScmProgress(t){return g.report(`window.withScmProgress`,e,`Use 'withProgress' instead.`),ce.withProgress(e,{location:mD.SourceControl},(e,n)=>t({report(e){}}))},withProgress(t,n){return ce.withProgress(e,t,n)},createOutputChannel(t,n){return Ce.createOutputChannel(t,n,e)},createWebviewPanel(t,n,r,i){return Qe.createWebviewPanel(e,t,n,r,i)},createWebviewTextEditorInset(t,n,r,i){return K(e,`editorInsets`),Ie.createWebviewEditorInset(t,n,r,i,e)},createTerminal(t,n,r){if(typeof t==`object`){let n=t;return!Dw(e)&&`titleTemplate`in t&&t.titleTemplate!==void 0&&(console.error(`[${e.identifier.value}] \`titleTemplate\` was provided to window.createTerminal but is ignored because the \`terminalTitle\` proposed API is not enabled.`),n={...t,titleTemplate:void 0}),`pty`in n?ve.createExtensionTerminal(n):ve.createTerminalFromOptions(n)}return ve.createTerminal(t,n,r)},registerTerminalLinkProvider(e){return ve.registerLinkProvider(e)},registerTerminalProfileProvider(t,n){return ve.registerProfileProvider(e,t,n)},registerTerminalCompletionProvider(t,...n){return K(e,`terminalCompletionProvider`),ve.registerTerminalCompletionProvider(e,t,...n)},registerTerminalQuickFixProvider(t,n){return K(e,`terminalQuickFixProvider`),ve.registerTerminalQuickFixProvider(t,e.identifier.value,n)},registerTreeDataProvider(t,n){return Fe.registerTreeDataProvider(t,n,e)},createTreeView(t,n){return Fe.createTreeView(t,n,e)},registerWebviewPanelSerializer:(t,n)=>Qe.registerWebviewPanelSerializer(e,t,n),registerCustomEditorProvider:(t,n,r={})=>$e.registerCustomEditorProvider(e,t,n,r),registerFileDecorationProvider(t){return he.registerFileDecorationProvider(t,e)},registerUriHandler(t){return ie.registerUriHandler(e,t)},createQuickPick(){return Ue.createQuickPick(e)},createInputBox(){return Ue.createInputBox(e)},get activeColorTheme(){return Ye.activeColorTheme},onDidChangeActiveColorTheme(e,t,n){return d(Ye.onDidChangeActiveColorTheme)(e,t,n)},registerWebviewViewProvider(t,n,r){return et.registerWebviewViewProvider(e,t,n,r?.webviewOptions)},get activeNotebookEditor(){return Oe.activeNotebookEditor},onDidChangeActiveNotebookEditor(e,t,n){return d(Oe.onDidChangeActiveNotebookEditor)(e,t,n)},get visibleNotebookEditors(){return Oe.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return d(Oe.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(e,t,n){return d(Ae.onDidChangeNotebookEditorSelection)(e,t,n)},onDidChangeNotebookEditorVisibleRanges(e,t,n){return d(Ae.onDidChangeNotebookEditorVisibleRanges)(e,t,n)},showNotebookDocument(e,t){return Oe.showNotebookDocument(e,t)},registerExternalUriOpener(t,n,r){return K(e,`externalUriOpener`),nt.registerExternalUriOpener(e.identifier,t,n,r)},registerProfileContentHandler(t,n){return K(e,`profileContentHandlers`),rt.registerProfileContentHandler(e,t,n)},registerQuickDiffProvider(t,n,r,i,a){return K(e,`quickDiffProvider`),Ge.registerQuickDiffProvider(e,p(t),n,r,i,a)},get tabGroups(){return oe.tabGroups},registerShareProvider(t,n){return K(e,`shareProvider`),Ke.registerShareProvider(p(t),n)},get nativeHandle(){return K(e,`nativeWindowHandle`),ne.nativeHandle},createChatStatusItem:t=>(K(e,`chatStatusItem`),xt.createChatStatusItem(e,t)),get activeChatPanelSessionResource(){return K(e,`chatParticipantPrivate`),st.activeChatPanelSessionResource},onDidChangeActiveChatPanelSessionResource:(t,n,r)=>(K(e,`chatParticipantPrivate`),d(st.onDidChangeActiveChatPanelSessionResource)(t,n,r)),get browserTabs(){return K(e,`browser`),_t.browserTabs},onDidOpenBrowserTab(t,n,r){return K(e,`browser`),d(_t.onDidOpenBrowserTab)(t,n,r)},onDidCloseBrowserTab(t,n,r){return K(e,`browser`),d(_t.onDidCloseBrowserTab)(t,n,r)},get activeBrowserTab(){return K(e,`browser`),_t.activeBrowserTab},onDidChangeActiveBrowserTab(t,n,r){return K(e,`browser`),d(_t.onDidChangeActiveBrowserTab)(t,n,r)},onDidChangeBrowserTabState(t,n,r){return K(e,`browser`),d(_t.onDidChangeBrowserTabState)(t,n,r)},openBrowserTab(t,n){return K(e,`browser`),_t.openBrowserTab(t,n)}},Tt={get rootPath(){return g.report(`workspace.rootPath`,e,`Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath`),a.getPath()},set rootPath(e){throw new te(`rootPath`)},getWorkspaceFolder(e){return a.getWorkspaceFolder(e)},get workspaceFolders(){return a.getWorkspaceFolders()},get name(){return a.name},set name(e){throw new te(`name`)},get workspaceFile(){return a.workspaceFile},set workspaceFile(e){throw new te(`workspaceFile`)},get isAgentSessionsWorkspace(){return K(e,`agentSessionsWorkspace`),!!t.environment.isSessionsWindow},updateWorkspaceFolders:(t,n,...r)=>a.updateWorkspaceFolders(e,t,n||0,...r),onDidChangeWorkspaceFolders:function(e,t,n){return d(a.onDidChangeWorkspace)(e,t,n)},asRelativePath:(e,t)=>a.getRelativePath(e,t),findFiles:(t,n,r,i)=>a.findFiles(t,n,r,e.identifier,i),findFiles2:(t,n,r)=>(K(e,`findFiles2`),a.findFiles2(t,n,e.identifier,r)),findTextInFiles:(t,n,r,i)=>{K(e,`findTextInFiles`);let o,s;return typeof n==`object`?(o=n,s=r):(o={},s=n,i=r),a.findTextInFiles(t,o||{},s,e.identifier,i)},findTextInFiles2:(t,n,r)=>(K(e,`findTextInFiles2`),K(e,`textSearchProvider2`),a.findTextInFiles2(t,n,e.identifier,r)),getTextDiff(t,n,r,i){K(e,`documentDiff`);let a=u.getProxy(E.MainThreadDocumentDiff);if(i?.isCancellationRequested){let e=new f;return{changes:Vo.EMPTY,complete:Promise.reject(e)}}let o=a.$computeDocumentDiff(t.uri,n.uri,r?.ignoreTrimWhitespace??!1,r?.maxComputationTimeMs??5e3,r?.computeMoves??!1),s=(i?ho(o,i):o).then(e=>{if(!e)throw Error(`Could not compute diff. Make sure both documents are available.`);return e}),c=e=>({originalRange:J.to(e.originalRange),modifiedRange:J.to(e.modifiedRange),innerChanges:e.innerChanges?.map(e=>({originalRange:J.to(e.originalRange),modifiedRange:J.to(e.modifiedRange)}))});return{changes:new Vo(async e=>{let t=await s;e.emitMany(t.changes.map(c))}),complete:s.then(e=>({identical:e.identical,mayBeIncomplete:e.quitEarly,moves:e.moves.map(e=>({originalRange:J.to(e.originalRange),modifiedRange:J.to(e.modifiedRange),changes:e.changes.map(c)}))}))}},save:e=>a.save(e),saveAs:e=>a.saveAs(e),saveAll:e=>a.saveAll(e),applyEdit(t,n){return y.applyWorkspaceEdit(t,e,n)},createFileSystemWatcher:(t,r,i,o)=>{let s={ignoreCreateEvents:!!r,ignoreChangeEvents:!!i,ignoreDeleteEvents:!!o};return He.createFileSystemWatcher(a,l,n,e,t,s)},get textDocuments(){return Te.getAllDocumentData().map(e=>e.document)},set textDocuments(e){throw new te(`textDocuments`)},openTextDocument(t,n){let r;if(n??=t,typeof t==`string`)r=Promise.resolve(w.file(t));else if(w.isUri(t))r=Promise.resolve(t);else if(!n||typeof n==`object`)r=Te.createDocumentData(n);else throw Error(`illegal argument - uriOrFileNameOrOptions`);return r.then(t=>(h.trace(`openTextDocument from ${e.identifier}`),t.scheme===O.vscodeRemote&&!t.authority&&g.report(`workspace.openTextDocument`,e,`A URI of 'vscode-remote' scheme requires an authority.`),Te.ensureDocumentData(t,n).then(e=>e.document)))},onDidOpenTextDocument:(e,t,n)=>d(Te.onDidAddDocument)(e,t,n),onDidCloseTextDocument:(e,t,n)=>d(Te.onDidRemoveDocument)(e,t,n),onDidChangeTextDocument:(t,n,r)=>Dw(e)?d(Te.onDidChangeDocumentWithReason)(t,n,r):d(Te.onDidChangeDocument)(t,n,r),onDidSaveTextDocument:(e,t,n)=>d(Te.onDidSaveDocument)(e,t,n),onWillSaveTextDocument:(t,n,r)=>d(De.getOnWillSaveTextDocumentEvent(e))(t,n,r),get notebookDocuments(){return Oe.notebookDocuments.map(e=>e.apiNotebook)},async openNotebookDocument(e,t){let n;if(w.isUri(e))n=e,await Oe.openNotebookDocument(e);else if(typeof e==`string`)n=w.revive(await Oe.createNotebookDocument({viewType:e,content:t}));else throw Error(`Invalid arguments`);return Oe.getNotebookDocument(n).apiNotebook},onDidSaveNotebookDocument(e,t,n){return d(ke.onDidSaveNotebookDocument)(e,t,n)},onDidChangeNotebookDocument(e,t,n){return d(ke.onDidChangeNotebookDocument)(e,t,n)},onWillSaveNotebookDocument(t,n,r){return d(Ne.getOnWillSaveNotebookDocumentEvent(e))(t,n,r)},get onDidOpenNotebookDocument(){return d(Oe.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return d(Oe.onDidCloseNotebookDocument)},registerNotebookSerializer(t,n,r,i){return Oe.registerNotebookSerializer(e,t,n,r,Dw(e)?i:void 0)},onDidChangeConfiguration:(e,t,n)=>d(l.onDidChangeConfiguration)(e,t,n),getConfiguration(t,n){return n=arguments.length===1?void 0:n,l.getConfiguration(t,n,e)},registerTextDocumentContentProvider(e,t){return Ee.registerTextDocumentContentProvider(e,t)},registerTaskProvider:(t,n)=>(g.report(`window.registerTaskProvider`,e,`Use the corresponding function on the 'tasks' namespace instead`),Se.registerTaskProvider(e,t,n)),registerFileSystemProvider(t,n,i){return gt(Ve.registerFileSystemProvider(e,t,n,i),r.addFileSystemProvider(t,n,i))},get fs(){return r.value},registerFileSearchProvider:(t,n)=>(K(e,`fileSearchProvider`),xe.registerFileSearchProviderOld(t,n)),registerTextSearchProvider:(t,n)=>(K(e,`textSearchProvider`),xe.registerTextSearchProviderOld(t,n)),registerAITextSearchProvider:(t,n)=>(K(e,`aiTextSearchProvider`),K(e,`textSearchProvider2`),xe.registerAITextSearchProvider(t,n)),registerFileSearchProvider2:(t,n)=>(K(e,`fileSearchProvider2`),xe.registerFileSearchProvider(t,n)),registerTextSearchProvider2:(t,n)=>(K(e,`textSearchProvider2`),xe.registerTextSearchProvider(t,n)),registerRemoteAuthorityResolver:(t,n)=>(K(e,`resolvers`),i.registerRemoteAuthorityResolver(t,n)),registerResourceLabelFormatter:t=>(K(e,`resolvers`),Je.$registerResourceLabelFormatter(t)),getRemoteExecServer:t=>(K(e,`resolvers`),i.getRemoteExecServer(t)),onDidCreateFiles:(e,t,n)=>d(He.onDidCreateFile)(e,t,n),onDidDeleteFiles:(e,t,n)=>d(He.onDidDeleteFile)(e,t,n),onDidRenameFiles:(e,t,n)=>d(He.onDidRenameFile)(e,t,n),onWillCreateFiles:(t,n,r)=>d(He.getOnWillCreateFileEvent(e))(t,n,r),onWillDeleteFiles:(t,n,r)=>d(He.getOnWillDeleteFileEvent(e))(t,n,r),onWillRenameFiles:(t,n,r)=>d(He.getOnWillRenameFileEvent(e))(t,n,r),openTunnel:t=>(K(e,`tunnels`),ee.openTunnel(e,t).then(e=>{if(!e)throw Error(`cannot open tunnel`);return e})),get tunnels(){return K(e,`tunnels`),ee.getTunnels()},onDidChangeTunnels:(t,n,r)=>(K(e,`tunnels`),d(ee.onDidChangeTunnels)(t,n,r)),registerPortAttributesProvider:(t,n)=>(K(e,`portsAttributes`),ee.registerPortsAttributesProvider(t,n)),registerTunnelProvider:(t,n)=>(K(e,`tunnelFactory`),ee.registerTunnelProvider(t,n)),registerTimelineProvider:(t,n)=>(K(e,`timeline`),Xe.registerTimelineProvider(t,n,e.identifier,_e.converter)),get isTrusted(){return a.trusted},requestResourceTrust:t=>(K(e,`workspaceTrust`),a.requestResourceTrust(t)),requestWorkspaceTrust:t=>(K(e,`workspaceTrust`),a.requestWorkspaceTrust(t)),isResourceTrusted:t=>(K(e,`workspaceTrust`),a.isResourceTrusted(t)),onDidChangeWorkspaceTrustedFolders:(t,n,r)=>(K(e,`workspaceTrust`),d(a.onDidChangeWorkspaceTrustedFolders)(t,n,r)),onDidGrantWorkspaceTrust:(e,t,n)=>d(a.onDidGrantWorkspaceTrust)(e,t,n),registerEditSessionIdentityProvider:(t,n)=>(K(e,`editSessionIdentityProvider`),a.registerEditSessionIdentityProvider(t,n)),onWillCreateEditSessionIdentity:(t,n,r)=>(K(e,`editSessionIdentityProvider`),d(a.getOnWillCreateEditSessionIdentityEvent(e))(t,n,r)),registerCanonicalUriProvider:(t,n)=>(K(e,`canonicalUriProvider`),a.registerCanonicalUriProvider(t,n)),getCanonicalUri:(t,n,r)=>(K(e,`canonicalUriProvider`),a.provideCanonicalUri(t,n,r)),decode(e,t){return a.decode(e,t)},encode(e,t){return a.encode(e,t)}};return{version:t.version,ai:{getRelatedInformation(t,n){return K(e,`aiRelatedInformation`),ut.getRelatedInformation(e,t,n)},registerRelatedInformationProvider(t,n){return K(e,`aiRelatedInformation`),ut.registerRelatedInformationProvider(e,t,n)},registerEmbeddingVectorProvider(t,n){return K(e,`aiRelatedInformation`),dt.registerEmbeddingVectorProvider(e,t,n)},registerSettingsSearchProvider(t){return K(e,`aiSettingsSearch`),ft.registerSettingsSearchProvider(e,t)}},authentication:m,commands:ae,comments:{createCommentController(t,n){return qe.createCommentController(e,t,n)}},chat:{registerMappedEditsProvider(t,n){return K(e,`mappedEditsProvider`),{dispose(){}}},registerMappedEditsProvider2(t){return K(e,`mappedEditsProvider`),Be.registerMappedEditsProvider(e,t)},createChatParticipant(t,n){return st.createChatAgent(e,t,n)},createDynamicChatParticipant(t,n,r){return K(e,`chatParticipantPrivate`),st.createDynamicChatAgent(e,t,n,r)},registerChatParticipantDetectionProvider(t){return K(e,`chatParticipantPrivate`),st.registerChatParticipantDetectionProvider(e,t)},onDidDisposeChatSession:(t,n,r)=>(K(e,`chatParticipantPrivate`),d(st.onDidDisposeChatSession)(t,n,r)),updateQuotas:t=>{K(e,`chatParticipantPrivate`),_.updateQuotas(t)},registerChatSessionItemProvider:(t,n)=>(K(e,`chatSessionsProvider`),g.report(`chat.registerChatSessionItemProvider`,e,`Please migrate to the new chat session controller API`,{usageId:t}),ot.registerChatSessionItemProvider(e,t,n)),createChatSessionItemController:(t,n)=>(K(e,`chatSessionsProvider`),ot.createChatSessionItemController(e,t,n)),registerChatSessionContentProvider(t,n,r,i){return K(e,`chatSessionsProvider`),ot.registerChatSessionContentProvider(e,t,r,n,i)},registerChatOutputRenderer:(t,n)=>(K(e,`chatOutputRenderer`),it.registerChatOutputRenderer(e,t,n)),registerChatWorkspaceContextProvider(t,n){return K(e,`chatContextProvider`),ct.registerChatWorkspaceContextProvider(`${e.id}-${t}`,n)},registerChatExplicitContextProvider(t,n){return K(e,`chatContextProvider`),ct.registerChatExplicitContextProvider(`${e.id}-${t}`,n)},registerChatResourceContextProvider(t,n,r){return K(e,`chatContextProvider`),ct.registerChatResourceContextProvider(p(t),`${e.id}-${n}`,r)},registerChatContextProvider(t,n,r){return K(e,`chatContextProvider`),ct.registerChatContextProvider(t?p(t):void 0,`${e.id}-${n}`,r)},registerCustomAgentProvider(t){return K(e,`chatPromptFiles`),st.registerPromptFileProvider(e,hb.agent,t)},registerInstructionsProvider(t){return K(e,`chatPromptFiles`),st.registerPromptFileProvider(e,hb.instructions,t)},registerPromptFileProvider(t){return K(e,`chatPromptFiles`),st.registerPromptFileProvider(e,hb.prompt,t)},registerSkillProvider(t){return K(e,`chatPromptFiles`),st.registerPromptFileProvider(e,hb.skill,t)},registerHookProvider(t){return K(e,`chatPromptFiles`),st.registerPromptFileProvider(e,hb.hook,t)},registerChatDebugLogProvider(t){return K(e,`chatDebug`),lt.registerChatDebugLogProvider(t)},onDidReceiveChatDebugEvent:(t,n,r)=>(K(e,`chatDebug`),lt.onDidAddCoreEvent(t,n,r)),getCustomAgents(t){return K(e,`chatPromptFiles`),st.provideCustomAgents(t)},onDidChangeCustomAgents:(t,n,r)=>(K(e,`chatPromptFiles`),st.onDidChangeCustomAgents(t,n,r)),getInstructions(t){return K(e,`chatPromptFiles`),st.provideInstructions(t)},onDidChangeInstructions:(t,n,r)=>(K(e,`chatPromptFiles`),st.onDidChangeInstructions(t,n,r)),getSkills(t){return K(e,`chatPromptFiles`),st.provideSkills(t)},onDidChangeSkills:(t,n,r)=>(K(e,`chatPromptFiles`),st.onDidChangeSkills(t,n,r)),getSlashCommands(t){return K(e,`chatPromptFiles`),st.provideSlashCommands(t)},onDidChangeSlashCommands:(t,n,r)=>(K(e,`chatPromptFiles`),st.onDidChangeSlashCommands(t,n,r)),getHooks(t){return K(e,`chatPromptFiles`),st.provideHooks(t)},onDidChangeHooks:(t,n,r)=>(K(e,`chatPromptFiles`),st.onDidChangeHooks(t,n,r)),getPlugins(t){return K(e,`chatPromptFiles`),st.providePlugins(t)},onDidChangePlugins:(t,n,r)=>(K(e,`chatPromptFiles`),st.onDidChangePlugins(t,n,r)),registerChatSessionCustomizationProvider(t,n,r){return K(e,`chatSessionCustomizationProvider`),st.registerChatSessionCustomizationProvider(e,t,n,r)},createInputNotification(t){return K(e,`chatInputNotification`),St.createInputNotification(e,t)}},debug:{get activeDebugSession(){return be.activeDebugSession},get activeDebugConsole(){return be.activeDebugConsole},get breakpoints(){return be.breakpoints},get activeStackItem(){return be.activeStackItem},registerDebugVisualizationProvider(t,n){return K(e,`debugVisualization`),be.registerDebugVisualizationProvider(e,t,n)},registerDebugVisualizationTreeProvider(t,n){return K(e,`debugVisualization`),be.registerDebugVisualizationTree(e,t,n)},onDidStartDebugSession(e,t,n){return d(be.onDidStartDebugSession)(e,t,n)},onDidTerminateDebugSession(e,t,n){return d(be.onDidTerminateDebugSession)(e,t,n)},onDidChangeActiveDebugSession(e,t,n){return d(be.onDidChangeActiveDebugSession)(e,t,n)},onDidReceiveDebugSessionCustomEvent(e,t,n){return d(be.onDidReceiveDebugSessionCustomEvent)(e,t,n)},onDidChangeBreakpoints(e,t,n){return d(be.onDidChangeBreakpoints)(e,t,n)},onDidChangeActiveStackItem(e,t,n){return d(be.onDidChangeActiveStackItem)(e,t,n)},registerDebugConfigurationProvider(e,t,n){return be.registerDebugConfigurationProvider(e,t,n||Lx.Initial)},registerDebugAdapterDescriptorFactory(t,n){return be.registerDebugAdapterDescriptorFactory(e,t,n)},registerDebugAdapterTrackerFactory(e,t){return be.registerDebugAdapterTrackerFactory(e,t)},startDebugging(e,t,n){return!n||typeof n==`object`&&`configuration`in n?be.startDebugging(e,t,{parentSession:n}):be.startDebugging(e,t,n||{})},stopDebugging(e){return be.stopDebugging(e)},addBreakpoints(e){return be.addBreakpoints(e)},removeBreakpoints(e){return be.removeBreakpoints(e)},asDebugSourceUri(e,t){return be.asDebugSourceUri(e,t)}},env:se,extensions:v,interactive:{transferActiveChat(t){return K(e,`interactive`),st.transferActiveChat(t)}},l10n:{t(...t){if(typeof t[0]==`string`){let n=t.shift(),r=!t||typeof t[0]!=`object`?t:t[0];return we.getMessage(e.identifier.value,{message:n,args:r})}return we.getMessage(e.identifier.value,t[0])},get bundle(){return we.getBundle(e.identifier.value)},get uri(){return we.getBundleUri(e.identifier.value)}},languages:Ct,lm:{selectChatModels:t=>ue.selectLanguageModels(e,t??{}),onDidChangeChatModels:(e,t,n)=>ue.onDidChangeProviders(e,t,n),registerLanguageModelChatProvider:(t,n)=>ue.registerLanguageModelChatProvider(e,t,n),get isModelProxyAvailable(){return K(e,`languageModelProxy`),ue.isModelProxyAvailable},onDidChangeModelProxyAvailability:(t,n,r)=>(K(e,`languageModelProxy`),ue.onDidChangeModelProxyAvailability(t,n,r)),getModelProxy:()=>(K(e,`languageModelProxy`),ue.getModelProxy(e)),registerLanguageModelProxyProvider:t=>(K(e,`chatParticipantPrivate`),ue.registerLanguageModelProxyProvider(e,t)),get embeddingModels(){return K(e,`embeddings`),ht.embeddingsModels},onDidChangeEmbeddingModels:(t,n,r)=>(K(e,`embeddings`),ht.onDidChange(t,n,r)),registerEmbeddingsProvider(t,n){return K(e,`embeddings`),ht.registerEmbeddingsProvider(e,t,n)},async computeEmbeddings(t,n,r){return K(e,`embeddings`),ht.computeEmbeddings(t,n,r)},registerTool(t,n){return at.registerTool(e,t,n)},registerToolDefinition(t,n){return at.registerToolDefinition(e,t,n)},invokeTool(t,n,r){return typeof t!=`string`&&K(e,`chatParticipantAdditions`),at.invokeTool(e,t,n,r)},get tools(){return at.getTools(e)},fileIsIgnored(t,n){return ue.fileIsIgnored(e,t,n)},registerIgnoredFileProvider(t){return ue.registerIgnoredFileProvider(e,t)},registerMcpServerDefinitionProvider(t,n){return de.registerMcpConfigurationProvider(e,t,n)},onDidChangeMcpServerDefinitions:(...t)=>(K(e,`mcpServerDefinitions`),d(de.onDidChangeMcpServerDefinitions)(...t)),get mcpServerDefinitions(){return K(e,`mcpServerDefinitions`),de.mcpServerDefinitions},startMcpGateway(t){return K(e,`mcpServerDefinitions`),de.startMcpGateway(t)},onDidChangeChatRequestTools(...t){return K(e,`chatParticipantAdditions`),d(st.onDidChangeChatRequestTools)(...t)}},notebooks:{createNotebookController(t,n,r,i,a){return je.createNotebookController(e,t,n,r,i,Dw(e)?a:void 0)},registerNotebookCellStatusBarItemProvider:(t,n)=>Oe.registerNotebookCellStatusBarItemProvider(e,t,n),createRendererMessaging(t){return Me.createRendererMessaging(e,t)},createNotebookControllerDetectionTask(t){return K(e,`notebookKernelSource`),je.createNotebookControllerDetectionTask(e,t)},registerKernelSourceActionProvider(t,n){return K(e,`notebookKernelSource`),je.registerKernelSourceActionProvider(e,t,n)}},scm:{get inputBox(){return g.report(`scm.inputBox`,e,`Use 'SourceControl.inputBox' instead`),We.getLastInputBox(e)},createSourceControl(t,n,r,i,a,o){return(i||a||o)&&K(e,`scmProviderOptions`),We.createSourceControl(e,t,n,r,i,a,o)}},speech:{registerSpeechProvider(t,n){return K(e,`speech`),mt.registerProvider(e.identifier,t,n)}},tasks:{registerTaskProvider:(t,n)=>Se.registerTaskProvider(e,t,n),fetchTasks:e=>Se.fetchTasks(e),executeTask:t=>Se.executeTask(e,t),get taskExecutions(){return Se.taskExecutions},onDidStartTask:(t,n,r)=>d(Se.onDidStartTask)(r=>{Dw(e)||r?.execution?.terminal!==void 0&&(r.execution.terminal=void 0);let i={...r,execution:r.execution};return t.call(n,i)},n,r),onDidEndTask:(e,t,n)=>d(Se.onDidEndTask)(e,t,n),onDidStartTaskProcess:(e,t,n)=>d(Se.onDidStartTaskProcess)(e,t,n),onDidEndTaskProcess:(e,t,n)=>d(Se.onDidEndTaskProcess)(e,t,n),onDidStartTaskProblemMatchers:(t,n,r)=>(K(e,`taskProblemMatcherStatus`),d(Se.onDidStartTaskProblemMatchers)(t,n,r)),onDidEndTaskProblemMatchers:(t,n,r)=>(K(e,`taskProblemMatcherStatus`),d(Se.onDidEndTaskProblemMatchers)(t,n,r))},tests:me,window:wt,workspace:Tt,Breakpoint:PD,TerminalOutputAnchor:HT,ChatResultFeedbackKind:Ck,ChatVariableLevel:vk,ChatCompletionItem:yk,ChatReferenceDiagnostic:kA,CallHierarchyIncomingCall:sE,CallHierarchyItem:oE,CallHierarchyOutgoingCall:cE,CancellationError:f,CancellationTokenSource:Ii,CandidatePortSource:Ti,CodeAction:iE,CodeActionKind:aT,CodeActionTriggerKind:rE,CodeLens:uE,Color:BE,ColorInformation:VE,ColorPresentation:HE,ColorThemeKind:TO,CommentMode:aO,CommentState:oO,CommentThreadCollapsibleState:iO,CommentThreadState:sO,CommentThreadApplicability:cO,CommentThreadFocus:lO,CompletionItem:xE,CompletionItemKind:yE,CompletionItemTag:bE,CompletionList:SE,CompletionTriggerKind:vE,ConfigurationTarget:AD,CustomExecution:fD,DebugAdapterExecutable:RD,DebugAdapterInlineImplementation:VD,DebugAdapterNamedPipeServer:BD,DebugAdapterServer:zD,DebugConfigurationProviderTriggerKind:Lx,DebugConsoleMode:gO,DebugVisualization:_O,DecorationRangeBehavior:LE,Diagnostic:lT,DiagnosticRelatedInformation:cT,DiagnosticSeverity:sT,DiagnosticTag:oT,Disposable:WT,DocumentHighlight:eE,DocumentHighlightKind:$T,MultiDocumentHighlight:tE,DocumentLink:zE,DocumentSymbol:nE,EndOfLine:AT,EnvironmentVariableMutatorType:YT,EvaluatableExpression:WD,InlineValueText:qD,InlineValueVariableLookup:JD,InlineValueEvaluatableExpression:YD,InlineCompletionTriggerKind:GD,InlineCompletionsDisposeReasonKind:KD,EventEmitter:S,ExtensionKind:SO,ExtensionMode:LO,ExternalUriOpenerPriority:tk,FileChangeType:eO,FileDecoration:CO,FileDecoration2:CO,FileSystemError:tO,FileType:dc,FilePermission:fc,FoldingRange:nO,FoldingRangeKind:rO,FunctionBreakpoint:ID,InlineCompletionItem:CE,InlineCompletionList:wE,Hover:XT,VerboseHover:ZT,HoverVerbosityAction:QT,IndentAction:ZH,Location:dT,MarkdownString:Qw,OverviewRulerLane:nm,ParameterInformation:dE,PortAutoForwardAction:rk,Position:eT,ProcessExecution:sD,ProgressLocation:mD,QuickInputButtonLocation:vO,QuickInputButtons:yO,Range:nT,RelativePattern:jD,Selection:xT,SelectionRange:aE,SemanticTokens:pO,SemanticTokensBuilder:fO,SemanticTokensEdit:mO,SemanticTokensEdits:hO,SemanticTokensLegend:uO,ShellExecution:cD,ShellQuoting:lD,SignatureHelp:pE,SignatureHelpTriggerKind:mE,SignatureInformation:fE,SnippetString:wT,SourceBreakpoint:FD,StandardTokenType:zO,StatusBarAlignment:kE,SymbolInformation:OT,SymbolKind:ET,SymbolTag:DT,Task:pD,TaskEventKind:rD,TaskGroup:aD,TaskPanelKind:iD,TaskRevealKind:nD,TaskRunOn:dD,TaskScope:uD,TerminalLink:JE,TerminalQuickFixTerminalCommand:XE,TerminalQuickFixOpener:YE,TerminalLocation:ZE,TerminalProfile:QE,TerminalExitReason:GE,TerminalShellExecutionCommandLineConfidence:KE,TerminalCompletionItem:eD,TerminalCompletionItemKind:$E,TerminalCompletionList:tD,TerminalShellType:qE,TextDocumentSaveReason:ME,TextEdit:jT,SnippetTextEdit:MT,TextEditorCursorStyle:bf,TextEditorChangeKind:FE,TextEditorLineNumbersStyle:jE,TextEditorRevealType:NE,TextEditorSelectionChangeKind:PE,SyntaxTokenType:RE,TextDocumentChangeReason:IE,ThemeColor:kD,ThemeIcon:OD,TreeItem:gD,TreeItemCheckboxState:vD,TreeItemCollapsibleState:_D,TypeHierarchyItem:ik,UIKind:mr,Uri:w,ViewColumn:OE,WorkspaceEdit:PT,DocumentPasteTriggerKind:TD,DocumentDropEdit:wD,DocumentDropOrPasteEditKind:ED,DocumentPasteEdit:DD,InlayHint:_E,InlayHintLabelPart:gE,InlayHintKind:hE,RemoteAuthorityResolverError:JT,ResolvedAuthority:KT,ManagedResolvedAuthority:qT,SourceControlInputBoxValidationType:WE,ExtensionRuntime:RO,TimelineItem:IO,NotebookRange:mT,NotebookCellKind:pT,NotebookCellExecutionState:DO,NotebookCellData:hT,NotebookData:gT,NotebookRendererScript:NO,NotebookCellStatusBarAlignment:OO,NotebookEditorRevealType:kO,NotebookCellOutput:yT,NotebookCellOutputItem:vT,CellErrorStackFrame:EO,NotebookCellStatusBarItem:AO,NotebookControllerAffinity:jO,NotebookControllerAffinity2:MO,NotebookEdit:_T,NotebookKernelSourceAction:PO,NotebookVariablesRequestKind:FO,PortAttributes:VO,LinkedEditingRanges:BO,TestResultState:HO,TestRunRequest:GO,TestMessage:KO,TestMessageStackFrame:JO,TestTag:qO,TestRunProfileKind:UO,TextSearchCompleteMessageType:WN,DataTransfer:CD,DataTransferItem:yD,TestCoverageCount:YO,FileCoverage:ZO,StatementCoverage:QO,BranchCoverage:$O,DeclarationCoverage:ek,WorkspaceTrustState:nk,LanguageStatusSeverity:lE,QuickPickItemKind:bO,InputBoxValidationSeverity:xO,TabInputText:ak,TabInputTextDiff:ok,TabInputTextMerge:sk,TabInputCustom:ck,TabInputNotebook:uk,TabInputNotebookDiff:dk,TabInputWebview:lk,TabInputTerminal:fk,TabInputInteractiveWindow:pk,TabInputChat:mk,TabInputTextMultiDiff:hk,TelemetryTrustedValue:hw,LogLevel:U,EditSessionIdentityMatch:QH,InteractiveSessionVoteDirection:gk,ChatCopyKind:_k,ChatSessionChangedFile:CA,ChatEditingSessionActionOutcome:bk,InteractiveEditorResponseFeedbackKind:Sk,DebugStackFrame:HD,DebugThread:UD,RelatedInformationType:XA,SpeechToTextStatus:QA,TextToSpeechStatus:$A,PartialAcceptTriggerKind:TE,InlineCompletionEndOfLifeReasonKind:EE,InlineCompletionDisplayLocationKind:DE,KeywordRecognitionStatus:ej,ChatImageMimeType:BA,ChatResponseMarkdownPart:wk,ChatResponseFileTreePart:Dk,ChatResponseAnchorPart:Mk,ChatResponseProgressPart:Nk,ChatResponseProgressPart2:Pk,ChatResponseThinkingProgressPart:Fk,ChatResponseHookPart:Ik,ChatResponseReferencePart:Bk,ChatResponseReferencePart2:Bk,ChatResponseCodeCitationPart:Hk,ChatResponseCodeblockUriPart:Vk,ChatResponseWarningPart:Lk,ChatResponseInfoPart:Rk,ChatResponseTextEditPart:Yk,ChatResponseNotebookEditPart:Xk,ChatResponseWorkspaceEditPart:Zk,ChatResponseMarkdownWithVulnerabilitiesPart:Tk,ChatResponseCommandButtonPart:zk,ChatResponseConfirmationPart:Ek,ChatQuestion:qk,ChatQuestionType:Kk,ChatResponseQuestionCarouselPart:Jk,ChatResponseMovePart:Uk,ChatResponseExtensionsPart:Wk,ChatResponseExternalEditPart:jk,ChatResponsePullRequestPart:Gk,ChatResponseMultiDiffPart:Ok,ChatResponseReferencePartStatusKind:wA,ChatResponseClearToPreviousToolInvocationReason:TA,ChatRequestTurn:tA,ChatRequestTurn2:tA,ChatResponseTurn:nA,ChatResponseTurn2:rA,ChatSubagentToolInvocationData:Ak,ChatToolInvocationPart:eA,ChatLocation:iA,ChatSessionStatus:aA,ChatSessionCustomizationType:oA,ChatDebugLogLevel:sA,ChatDebugToolCallResult:cA,ChatDebugHookResult:lA,ChatDebugToolCallEvent:uA,ChatDebugModelTurnEvent:dA,ChatDebugGenericEvent:fA,ChatDebugSubagentInvocationEvent:pA,ChatDebugUserMessageEvent:hA,ChatDebugAgentResponseEvent:gA,ChatDebugMessageSection:mA,ChatDebugEventTextContent:_A,ChatDebugMessageContentType:vA,ChatDebugEventMessageContent:yA,ChatDebugEventToolCallContent:bA,ChatDebugEventModelTurnContent:xA,ChatDebugEventHookContent:SA,ChatRequestEditorData:EA,ChatRequestNotebookData:DA,ChatReferenceBinaryData:OA,ChatRequestEditedFileEventKind:xk,LanguageModelChatMessageRole:AA,LanguageModelChatMessage:PA,LanguageModelChatMessage2:FA,LanguageModelToolResultPart:jA,LanguageModelToolResultPart2:jA,LanguageModelTextPart:RA,LanguageModelTextPart2:RA,LanguageModelPartAudience:LA,ToolResultAudience:LA,LanguageModelToolCallPart:IA,LanguageModelThinkingPart:VA,LanguageModelError:UA,LanguageModelToolResult:WA,LanguageModelToolResult2:GA,LanguageModelDataPart:zA,LanguageModelDataPart2:zA,LanguageModelToolExtensionSource:JA,LanguageModelToolMCPSource:YA,ExtendedLanguageModelToolResult:KA,LanguageModelChatToolMode:qA,LanguageModelPromptTsxPart:HA,NewSymbolName:$D,NewSymbolNameTag:ZD,NewSymbolNameTriggerKind:QD,ExcludeSettingOptions:UN,TextSearchContext2:VN,TextSearchMatch2:BN,AISearchKeyword:HN,TextSearchCompleteMessageTypeNew:WN,ChatErrorLevel:MA,ChatInputNotificationSeverity:NA,McpHttpServerDefinition:rj,McpHttpServerDefinition2:rj,McpStdioServerDefinition:nj,McpStdioServerDefinition2:nj,McpToolAvailability:tj,McpToolInvocationContentData:kk,SettingsSearchResultKind:ZA,ChatTodoStatus:Qk,ChatDebugSubagentStatus:$k}}}var PX;let FX=class{constructor(e,t,n,r,i,a,o){this._apiFactory=e,this._extensionRegistry=t,this._instaService=n,this._extHostConfiguration=r,this._extHostExtensionService=i,this._initData=a,this._logService=o,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),wr(`code/extHost/willWaitForConfig`);let e=await this._extHostConfiguration.getConfigProvider();wr(`code/extHost/didWaitForConfig`);let t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new LX(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(IX)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(RX,t,this._initData.environment.appUriScheme))}register(e){if(`nodeModuleName`in e)if(Array.isArray(e.nodeModuleName))for(let t of e.nodeModuleName)this._factories.set(t,e);else this._factories.set(e.nodeModuleName,e);typeof e.alternativeModuleName==`function`&&this._alternatives.push(t=>e.alternativeModuleName(t))}};FX=A([j(2,ws),j(3,mF),j(4,KR),j(5,Fs),j(6,Ds)],FX);let IX=class{static{PX=this}static{this.aliased=new Map([[`vscode-ripgrep`,`@vscode/ripgrep-universal`],[`@vscode/ripgrep`,`@vscode/ripgrep-universal`],[`vscode-windows-registry`,`@vscode/windows-registry`]])}constructor(e){if(e.environment.appRoot&&PX.aliased.size){let t=qi(this.forceForwardSlashes(e.environment.appRoot.fsPath)),n=`[a-z0-9_.-]`,r=`@${n}+\\/${n}+|${n}+`;this.re=RegExp(`^(${t}/node_modules|node_modules\\.asar(?:\\.unpacked)?\\/)(${r})(.*)$`,`i`)}}alternativeModuleName(e){if(!this.re)return;let t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;let[,n,r,i]=t,a=PX.aliased.get(r);if(a!==void 0)return console.warn(`${r} as been renamed to ${a}, please update your imports`),n+a+i}forceForwardSlashes(e){return e.replace(/\\/g,`/`)}};IX=PX=A([j(0,Fs)],IX);var LX=class{constructor(e,t,n,r,i){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=n,this._configProvider=r,this._logService=i,this.nodeModuleName=`vscode`,this._extApiImpl=new xs}load(e,t){let n=this._extensionPaths.findSubstr(t);if(n){let e=this._extApiImpl.get(n.identifier);return e||(e=this._apiFactory(n,this._extensionRegistry,this._configProvider),this._extApiImpl.set(n.identifier,e)),e}if(!this._defaultApiImpl){let e=``;this._extensionPaths.forEach((t,n)=>e+=`\t${n} -> ${t.identifier.value}\n`),this._logService.warn(`Could not identify extension for 'vscode' require call from ${t}. These are the extension path mappings: \n${e}`),this._defaultApiImpl=this._apiFactory(ww,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}};let RX=class{constructor(e,t,n){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=[`open`,`opn`],this._mainThreadTelemetry=n.getProxy(E.MainThreadTelemetry);let r=n.getProxy(E.MainThreadWindow);this._impl=(e,t)=>{let n=w.parse(e);return t?this.callOriginal(e,t):n.scheme===`http`||n.scheme===`https`?r.$openUri(n,e,{allowTunneling:!0}):n.scheme===`mailto`||n.scheme===this._appUriScheme?r.$openUri(n,e,{}):this.callOriginal(e,t)}}load(e,t,n){let r=this._extensionPaths.findSubstr(t);return r&&(this._extensionId=r.identifier.value,this.sendShimmingTelemetry()),this._original=n(e),this._impl}callOriginal(e,t){return this.sendNoForwardTelemetry(),this._original(e,t)}sendShimmingTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2(`shimming.open`,{extension:this._extensionId})}sendNoForwardTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2(`shimming.open.call.noForward`,{extension:this._extensionId})}};RX=A([j(2,Hs)],RX);let zX=class{constructor(e,t){this._mainThreadConsole=e.getProxy(E.MainThreadConsole),this._includeStack=t.consoleForward.includeStack,this._logNative=t.consoleForward.logNative,this._wrapConsoleMethod(`info`,`log`),this._wrapConsoleMethod(`log`,`log`),this._wrapConsoleMethod(`warn`,`warn`),this._wrapConsoleMethod(`debug`,`debug`),this._wrapConsoleMethod(`error`,`error`)}_wrapConsoleMethod(e,t){let n=this,r=console[e];Object.defineProperty(console,e,{set:()=>{},get:()=>(...i)=>{n._handleConsoleCall(e,t,r,i)}})}_handleConsoleCall(e,t,n,r){this._mainThreadConsole.$logExtensionHostMessage({type:`__$console`,severity:t,arguments:BX(r,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,n,r)}};zX=A([j(0,Hs),j(1,Fs)],zX);function BX(e,t){let n=[];if(e.length)for(let t=0;t<e.length;t++){let r=e[t];if(r===void 0)r=`undefined`;else if(r instanceof Error){let e=r;r=e.stack?e.stack:e.toString()}n.push(r)}if(t){let e=Error().stack;e&&n.push({__$stack:e.split(`
206
- `).slice(3).join(`
207
- `)})}try{let e=cc(n);return e.length>1e5?`Output omitted for a large object that exceeds the limits`:e}catch(e){return`Output omitted for an object that cannot be inspected ('${e.toString()}')`}}let VX=class extends zX{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,n){t.apply(console,n)}};VX=A([j(0,Hs),j(1,Fs)],VX);var HX=class extends FX{_installInterceptor(){}getModule(e,t){for(let t of this._alternatives){let n=t(e);if(n){e=n;break}}if(this._factories.has(e))return this._factories.get(e).load(e,t,()=>{throw Error(`CANNOT LOAD MODULE from here.`)})}},UX=class extends HR{constructor(){super(...arguments),this.extensionRuntime=RO.Webworker}async _beforeAlmostReadyToRunExtensions(){wn&&this._instaService.createInstance(VX),this._apiFactory=this._instaService.invokeFunction(NX),this._fakeModules=this._instaService.createInstance(HX,this._apiFactory,{mine:this._myRegistry,all:this._globalRegistry}),await this._fakeModules.install(),performance.mark(`code/extHost/didInitAPI`),await this._waitForDebuggerAttachment()}_getEntryPoint(e){return e.browser}async _loadCommonJSModule(e,t,n){t=t.with({path:WX(t.path,`.js`)});let r=e?.identifier.value;r&&performance.mark(`code/extHost/willFetchExtensionCode/${r}`);let i=w.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(t)),a=await fetch(i.toString(!0));if(r&&performance.mark(`code/extHost/didFetchExtensionCode/${r}`),a.status!==200)throw Error(a.statusText);let o=`${await a.text()}\n//# sourceURL=${`${t.toString(!0)}#vscode-extension`}`,s;try{s=Function(`module`,`exports`,`require`,o)}catch(e){throw console.error(r?`Loading code for extension ${r} failed: ${e.message}`:`Loading code failed: ${e.message}`),console.error(`${t.toString(!0)}${typeof e.line==`number`?` line ${e.line}`:``}${typeof e.column==`number`?` column ${e.column}`:``}`),console.error(e),e}e&&await this._extHostLocalizationService.initializeLocalizedMessages(e);let c={},l={exports:c},u=e=>{let n=this._fakeModules.getModule(e,t);if(n===void 0)throw Error(`Cannot load module '${e}'`);return n};try{return n.codeLoadingStart(),r&&performance.mark(`code/extHost/willLoadExtensionCode/${r}`),s(l,c,u),l.exports===c?c:l.exports}finally{r&&performance.mark(`code/extHost/didLoadExtensionCode/${r}`),n.codeLoadingStop()}}_loadESMModule(e,t,n){throw Error(`ESM modules are not supported in the web worker extension host`)}async $setRemoteEnvironment(e){}async _waitForDebuggerAttachment(e=5e3){if(!this._initData.environment.isExtensionDevelopmentDebug)return;let t=Date.now()+e;for(;Date.now()<t&&!(`__jsDebugIsReady`in globalThis);)await Eo(10)}};function WX(e,t){return qr(e)?e:e+t}Ms(GL,KL,js.Eager),Ms(KR,UX,js.Eager),Ms(IF,LF,js.Eager),Ms(II,new ks(NI,[!0],!0));const GX=self.close.bind(self);self.close=()=>console.trace(`'close' has been blocked`);const KX=postMessage.bind(self);self.postMessage=()=>console.trace(`'postMessage' has been blocked`);function qX(e){return/^(file|extension-file|vscode-remote):/i.test(e)}const JX=fetch.bind(self);function YX(e){self.fetch=async function(t,n){return t instanceof Request||qX(String(t))&&(t=(await e(w.parse(String(t)))).toString(!0)),JX(t,n)},self.XMLHttpRequest=class extends XMLHttpRequest{open(t,n,r,i,a){(async()=>{qX(n.toString())&&(n=(await e(w.parse(n.toString()))).toString(!0)),super.open(t,n,r??!0,i,a)})()}}}self.importScripts=()=>{throw Error(`'importScripts' has been blocked`)},self.addEventListener=()=>console.trace(`'addEventListener' has been blocked`),self.AMDLoader=void 0,self.NLSLoaderPlugin=void 0,self.define=void 0,self.require=void 0,self.webkitRequestFileSystem=void 0,self.webkitRequestFileSystemSync=void 0,self.webkitResolveLocalFileSystemSyncURL=void 0,self.webkitResolveLocalFileSystemURL=void 0;function XX(e,t){if(self.Worker){let n=self.Worker;Worker=function(r,i){if(/^vscode-remote:/i.test(r.toString()))throw Error(`Creating workers from remote extensions is currently not supported.`);async function a(n){let[r,i]=await Promise.all([e(n).then(e=>e.toString(!0)),t().then(e=>Object.fromEntries(e.map(([e,t])=>[e.toString(!0),t.toString(!0)])))]),a=`(${(function(e,t){function n(e){return typeof e==`string`||e instanceof URL?(e=String(e).replace(/^file:\/\//i,`vscode-file://vscode-app`),t[e]??e):e}let r=fetch.bind(self);self.fetch=function(e,t){return e instanceof Request?r(e,t):r(n(e),t)},self.XMLHttpRequest=class extends XMLHttpRequest{constructor(){super(...arguments),this.notFound=!1}open(e,t,r,i,a){let o=n(t);return this.notFound=o.startsWith(`extension-file:`),super.open(e,o,r??!0,i,a)}send(e){this.notFound||super.send(e)}get status(){return this.notFound?404:super.status}};let i=importScripts.bind(self);self.importScripts=(...e)=>{i(...e.map(n))},self.importExt=e=>Function(`url`,`return import(url)`)(n(e)),i(e)}).toString()}('${r}', ${JSON.stringify(i)}))`,o=new Blob([a],{type:`application/javascript`});return URL.createObjectURL(o)}i||={},i.name=`${name} -> ${i.name||Kr(r.toString())}`;class o{constructor(e,t){this._onmessage=null,this._onmessageerror=null,this._onerror=null,this.workerPromise=a(w.parse(e instanceof URL?e.toString():e)).then(e=>new n(e,t))}set onmessage(e){this._onmessage=e,this.workerPromise.then(t=>{t.onmessage=e},console.error)}get onmessage(){return this._onmessage}set onmessageerror(e){this._onmessageerror=e,this.workerPromise.then(t=>{t.onmessageerror=e},console.error)}get onmessageerror(){return this._onmessageerror}set onerror(e){this._onerror=e,this.workerPromise.then(t=>{t.onerror=e},console.error)}get onerror(){return this._onerror}postMessage(e,t){this.workerPromise.then(n=>{n.postMessage(e,t)},console.error)}terminate(){this.workerPromise.then(e=>{e.terminate()},console.error)}addEventListener(e,t,n){this.workerPromise.then(r=>{r.addEventListener(e,t,n)},console.error)}removeEventListener(e,t,n){this.workerPromise.then(r=>{r.removeEventListener(e,t,n)},console.error)}dispatchEvent(e){return this.workerPromise.then(t=>{t.dispatchEvent(e)},console.error),!1}}return new o(r,i)}}else self.Worker=class extends oz{constructor(e,t){super(KX,e,{name:Kr(e.toString()),...t})}}}const ZX=new class{constructor(){this.pid=void 0}exit(e){GX()}};var QX=class{constructor(){let e=new MessageChannel,t=new S,n=!1;KX(e.port2,[e.port2]),e.port1.onmessage=e=>{let{data:r}=e;if(!(r instanceof ArrayBuffer)){console.warn(`UNKNOWN data received`,r);return}let i=b.wrap(new Uint8Array(r,0,r.byteLength));if(vr(i,gr.Terminate)){n=!0,eZ(`received terminate message from renderer`);return}t.fire(i)},this.protocol={onMessage:t.event,send:t=>{if(!n){let n=t.buffer.buffer.slice(t.buffer.byteOffset,t.buffer.byteOffset+t.buffer.byteLength);e.port1.postMessage(n,[n])}}}}};function $X(e){return new Promise(t=>{let n=e.onMessage(r=>{n.dispose();let i=JSON.parse(r.toString());e.send(_r(gr.Initialized)),t({protocol:e,initData:i})});e.send(_r(gr.Ready))})}let eZ=e=>GX();function tZ(e){return!!e&&typeof e==`object`&&e.type===`vscode.init`&&e.data instanceof Map}function nZ(){wr(`code/extHost/willConnectToRenderer`);let e=new QX;return{onmessage(t){tZ(t)&&$X(e.protocol).then(e=>{wr(`code/extHost/didWaitForInitData`);let n=new iz(e.protocol,e.initData,ZX,null,t.data);YX(e=>n.asBrowserUri(e)),XX(e=>n.asBrowserUri(e),()=>n.getAllStaticBrowserUris()),eZ=e=>n.terminate(e)})}}}const rZ=nZ();self.onmessage=e=>rZ.onmessage(e.data);