build/static/js/29.cf54d06f.chunk.js

2 lines
2.2 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see 29.cf54d06f.chunk.js.LICENSE.txt */
(this.webpackJsonp=this.webpackJsonp||[]).push([[29,31],{"+KnZ":function(e,t,i){},"+iC4":function(e,t,i){},"0Cz8":function(e,t,i){var n=i("Xi7e"),s=i("ebwN"),o=i("e4Nc");e.exports=function(e,t){var i=this.__data__;if(i instanceof n){var r=i.__data__;if(!s||r.length<199)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new o(r)}return i.set(e,t),this.size=i.size,this}},"0qr2":function(e,t,i){},"1AXR":function(e,t,i){},"1wgR":function(e,t,i){},"2VvC":function(e,t,i){},"2WzX":function(e,t,i){},"3FlK":function(e,t,i){},"3slI":function(e,t,i){},"4Ir3":function(e,t,i){},"4bWJ":function(e,t,i){},"4oKn":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==h(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=e[s]}i.default=e,t&&t.set(e,i);return i}(i("CY4F")),s=a(i("17x9")),o=a(i("q1tI")),r=i("JwdM");function a(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?d(Object(i),!0).forEach((function(t){v(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):d(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function u(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=_(e);if(t){var s=_(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return f(this,i)}}function f(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?p(e):t}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(l,e);var t,i,s,a=m(l);function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),v(p(t=a.call(this,e)),"assignRef",(function(e){t.containerElement=e})),t.containerElement=void 0,t}return t=l,(i=[{key:"componentDidMount",value:function(){this.initMonaco()}},{key:"componentDidUpdate",value:function(e){var t=this.props,i=t.language,s=t.theme,o=t.height,r=t.options,a=t.width,l=this.editor.getModel(),h=l.original,d=l.modified;this.props.original!==h.getValue()&&h.setValue(this.props.original),null!=this.props.value&&this.props.value!==d.getValue()&&(this.__prevent_trigger_change_event=!0,this.editor.modifiedEditor.pushUndoStop(),d.pushEditOperations([],[{range:d.getFullModelRange(),text:this.props.value}]),this.editor.modifiedEditor.pushUndoStop(),this.__prevent_trigger_change_event=!1),e.language!==i&&(n.editor.setModelLanguage(h,i),n.editor.setModelLanguage(d,i)),e.theme!==s&&n.editor.setTheme(s),!this.editor||a===e.width&&o===e.height||this.editor.layout(),e.options!==r&&this.editor.updateOptions(r)}},{key:"componentWillUnmount",value:function(){this.destroyMonaco()}},{key:"editorWillMount",value:function(){var e=this.props.editorWillMount;return e(n)||{}}},{key:"editorDidMount",value:function(e){var t=this;this.props.editorDidMount(e,n);var i=e.getModel().modified;this._subscription=i.onDidChangeContent((function(e){t.__prevent_trigger_change_event||t.props.onChange(i.getValue(),e)}))}},{key:"initModels",value:function(e,t){var i=this.props.language,s=n.editor.createModel(t,i),o=n.editor.createModel(e,i);this.editor.setModel({original:s,modified:o})}},{key:"initMonaco",value:function(){var e=null!=this.props.value?this.props.value:this.props.defaultValue,t=this.props,i=t.original,s=t.theme,o=t.options,r=t.overrideServices;this.containerElement&&(this.editorWillMount(),this.editor=n.editor.createDiffEditor(this.containerElement,c(c({},o),s?{theme:s}:{}),r),this.initModels(e,i),this.editorDidMount(this.editor))}},{key:"destroyMonaco",value:function(){if(this.editor){this.editor.dispose();var e=this.editor.getModel(),t=e.original,i=e.modified;t&&t.dispose(),i&&i.dispose()}this._subscription&&this._subscription.dispose()}},{key:"render",value:function(){var e=this.props,t=e.width,i=e.height,n={width:(0,r.processSize)(t),height:(0,r.processSize)(i)};return o.default.createElement("div",{ref:this.assignRef,style:n,className:"react-monaco-editor-container"})}}])&&u(t.prototype,i),s&&u(t,s),l}(o.default.Component);b.propTypes={width:s.default.oneOfType([s.default.string,s.default.number]),height:s.default.oneOfType([s.default.string,s.default.number]),original:s.default.string,value:s.default.string,defaultValue:s.default.string,language:s.default.string,theme:s.default.string,options:s.default.object,overrideServices:s.default.object,editorDidMount:s.default.func,editorWillMount:s.default.func,onChange:s.default.func},b.defaultProps={width:"100%",height:"100%",original:null,value:null,defaultValue:"",language:"javascript",theme:null,options:{},overrideServices:{},editorDidMount:r.noop,editorWillMount:r.noop,onChange:r.noop};var C=b;t.default=C},"4pZI":function(e,t,i){},"5CEZ":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=m(i("kLXV")),s=m(i("W9HT")),o=m(i("5rEg")),r=m(i("Vl3Y")),a=m(i("2fM7")),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},h=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,s=!1,o=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);n=!0);}catch(e){s=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(s)throw o}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};i("k3Gp"),i("04bd"),i("1vPl"),i("tULf"),i("8QGh");var d=i("q1tI"),c=m(d),u=m(i("INjQ")),g=m(i("vDqi"));function m(e){return e&&e.__esModule?e:{default:e}}var f=a.default.Option,p=["Java","C","C++","Python","Go","Ruby","R","PHP","Perl","Node","Docker","Rust","Swift","Erlang","Other"];t.default=r.default.create()((0,d.forwardRef)((function(e,t){var i=e.form,m=e.visible,_=e.onCancel,v=e.onOk,b=(0,d.useState)(void 0),C=h(b,2),w=C[0],y=C[1],S=(0,d.useState)(!1),L=h(S,2),k=L[0],D=L[1],x=(0,d.useState)(!1),E=h(x,2),N=E[0],I=E[1],T=(0,d.useState)(!1),M=h(T,2),A=M[0],O=M[1],R=(0,d.useState)(!1),P=h(R,2),F=P[0],B=P[1],W=i.getFieldDecorator,V=i.validateFields,H=i.setFieldsValue;(0,d.useImperativeHandle)(t,(function(){return{setEditInfo:function(e){e?(H(l({},e)),"build"===e.stage_type?(B(!0),H({category:p[0]})):j(),y(e.content),O(e.id)):(j(),U(),O(void 0))}}}));var z=(0,d.useCallback)((function(e,t,i,n,s,o,a){return c.default.createElement(r.default.Item,{label:e,className:s},W(t,{rules:i,validateFirst:!0,valuePropName:a?"checked":"value"})(n))}),[]);function K(){U(),_()}function U(){H({stage_type:"init",template_name:void 0,category:"Java"}),y(""),I(!1)}function j(){B(!1),H({category:""})}return c.default.createElement(n.default,{visible:m,width:"500px",title:"新建/编辑模板",onCancel:K,onOk:function(){w?V((function(e,t){if(!e){D(!0);g.default.post("/ci/templates.json",l({},t,{id:A,content:w,category:F?t.category:""})).then((function(e){e&&e.data&&(D(!1),K(),v())})).catch((function(e){}))}})):I(!0)},centered:!0},c.default.createElement(s.default,{spinning:k},c.default.createElement(r.default,{layout:"inline"},z("所属阶段","stage_type",[{required:!0,message:"请选择所属阶段"}],c.default.createElement(a.default,{placeholder:"请选择所属阶段",style:{width:"350px"},onChange:function(e){!function(e){"build"===e?(B(!0),H({category:p[0]})):j()}(e)}},c.default.createElement(f,{value:"init"},"初始化"),c.default.createElement(f,{value:"build"},"编译构建"),c.default.createElement(f,{value:"deploy"},"部署"),c.default.createElement(f,{value:"customize"},"其他"))),z("模板名称","template_name",[{required:!0,message:"请输入模板名称"}],c.default.createElement(o.default,{placeholder:"请输入模板名称",style:{width:"350px"}})),z("模板分类","category",[{required:F,message:"请选择模板分类"}],c.default.createElement(a.default,{placeholder:"请选择模板分类",style:{width:"350px"}},p.map((function(e,t){return c.default.createElement(f,{value:e},e)}))),!0===F?"":"hide"),c.default.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},c.default.createElement("span",null,c.default.createElement("span",{className:"color-red"},"* "),"模板内容:"),c.default.createElement("div",null,c.default.createElement("div",{className:"editorPanel"},c.default.createElement(u.default,{Numbers:"off",width:"350px",value:w,height:"200px",theme:"vs-grey",onChange:function(e){e&&(y(e),I(!1))}})),N&&c.default.createElement("span",{className:"color-red"},"请输入模板内容"))))))})))},"6sVZ":function(e,t){var i=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)}},"77Zs":function(e,t,i){var n=i("Xi7e");e.exports=function(){this.__data__=new n,this.size=0}},"7RZT":function(e,t,i){},"7dd9":function(e,t,i){},"91zm":function(e,t,i){},B8du:function(e,t){e.exports=function(){return!1}},BTsX:function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return a})),i.d(t,"e",(function(){return l})),i.d(t,"c",(function(){return h})),i.d(t,"f",(function(){return d})),i.d(t,"d",(function(){return c})),i.d(t,"g",(function(){return u}));var n=i("ZShG");const s=void 0!==e;new n.a(()=>new Uint8Array(256));let o;class r{static wrap(t){return s&&!e.isBuffer(t)&&(t=e.from(t.buffer,t.byteOffset,t.byteLength)),new r(t)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return s?this.buffer.toString():(o||(o=new TextDecoder),o.decode(this.buffer))}}function a(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function l(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function h(e,t){return e[t]*2**24+65536*e[t+1]+256*e[t+2]+e[t+3]}function d(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}function c(e,t){return e[t]}function u(e,t,i){e[i]=t}}).call(this,i("tjlA").Buffer)},BZCw:function(e,t,i){},CY4F:function(e,t,i){var n;self.MonacoEnvironment=(n={editorWorkerService:"editor.worker.js",css:"css.worker.js",html:"html.worker.js",json:"json.worker.js",typescript:"ts.worker.js",javascript:"ts.worker.js",less:"css.worker.js",scss:"css.worker.js",handlebars:"html.worker.js",razor:"html.worker.js"},{getWorkerUrl:function(e,t){var s=i.p,o=(s?s.replace(/\/$/,"")+"/":"")+n[t];if(/^((http:)|(https:)|(file:)|(\/\/))/.test(o)){var r=String(window.location),a=r.substr(0,r.length-window.location.hash.length-window.location.search.length-window.location.pathname.length);if(o.substring(0,a.length)!==a){var l=new Blob(["/*"+t+'*/importScripts("'+o+'");'],{type:"application/javascript"});return URL.createObjectURL(l)}}return o}}),i("1YUG"),i("oQaD"),e.exports=i("eSqM"),i("23p7"),i("OOlL"),i("li8W"),i("ApJL"),i("jrbv"),i("gqHg"),i("p3Ex"),i("E+ie"),i("9B1q"),i("9XAT"),i("SvYn"),i("I/Lx"),i("LexI"),i("+a1H"),i("hFdI"),i("c2dO"),i("zQEy"),i("k7mE"),i("cldp"),i("p5tG"),i("FvUK"),i("ZvGG"),i("QFiB"),i("/cAr"),i("xYNL"),i("sStQ"),i("oKJv"),i("H6Gb"),i("y3CF"),i("JlLP"),i("j2o1"),i("woZy"),i("iLY9"),i("Msxo"),i("ajgA"),i("QiAa"),i("pI2L"),i("ij/i"),i("XQgg"),i("Gb1F"),i("xmOD"),i("c9ML"),i("Mzro"),i("GZrW"),i("w9QG"),i("ufhN"),i("LRks"),i("EOst"),i("z3hU"),i("nrBJ"),i("BEdG"),i("E4kL")},CmAR:function(e,t,i){},DSRE:function(e,t,i){(function(e){var n=i("Kz5y"),s=i("B8du"),o=t&&!t.nodeType&&t,r=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=r&&r.exports===o?n.Buffer:void 0,l=(a?a.isBuffer:void 0)||s;e.exports=l}).call(this,i("YuTi")(e))},"F+T8":function(e,t,i){},FWJU:function(e,t,i){},INjQ:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(i("q1tI")),s=o(i("gL5p"));function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.value,i=e.onChange,o=e.theme,r=e.height,a=e.visible,l=e.width,h=void 0===l?"100%":l,d=e.Numbers,c={lineNumbers:void 0===d?"on":d,wordWrap:!0,selectOnLineNumbers:!0,lineHeight:24,renderLineHighlight:"line",revealHorizontalRightPadding:5,placeholder:"请输入内容",readOnly:a,cursorStyle:a?"underline-thin":"line",folding:!0,foldingStrategy:"indentation",automaticLayout:!0,minimap:{enabled:!1}};return n.default.createElement(s.default,{height:r,width:h,language:"yaml",theme:o,placeholder:"请输入内容",value:t,options:c,onChange:function(e){return i(e)},disabled:!0})}},IboD:function(e,t,i){},JHRd:function(e,t,i){var n=i("Kz5y").Uint8Array;e.exports=n},JnxH:function(e,t,i){},JwdM:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processSize=function(e){return/^\d+$/.test(e)?"".concat(e,"px"):e},t.noop=function(){}},L8xA:function(e,t){e.exports=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}},Ll4U:function(e,t,i){},MMmD:function(e,t,i){var n=i("lSCD"),s=i("shjB");e.exports=function(e){return null!=e&&s(e.length)&&!n(e)}},MXXP:function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return r}));let n="undefined"!=typeof document&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function s(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,(e,i)=>{const n=i[0],s=t[n];let o=e;return"string"==typeof s?o=s:"number"!=typeof s&&"boolean"!=typeof s&&null!=s||(o=String(s)),o}),n&&(i=""+i.replace(/[aouei]/g,"$&$&")+""),i}function o(e,t,...i){return s(t,i)}function r(e){}},NJEC:function(e,t,i){"use strict";i.r(t);var n=i("q1tI"),s=i("VCL8"),o=i("3S7+"),r=i("CtXQ"),a=i("2/Rp"),l=i("YMnH"),h=i("ZvpZ"),d=i("H84U");function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function g(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=v(e);if(t){var s=v(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return p(this,i)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?_(e):t}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]])}return i},C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(c,e);var t,i,s,r=f(c);function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=r.call(this,e)).onConfirm=function(e){t.setVisible(!1,e);var i=t.props.onConfirm;i&&i.call(_(t),e)},t.onCancel=function(e){t.setVisible(!1,e);var i=t.props.onCancel;i&&i.call(_(t),e)},t.onVisibleChange=function(e){t.props.disabled||t.setVisible(e)},t.saveTooltip=function(e){t.tooltip=e},t.renderOverlay=function(e,i){var s=t.props,o=s.okButtonProps,r=s.cancelButtonProps,l=s.title,h=s.cancelText,d=s.okText,c=s.okType,g=s.icon;return n.createElement("div",null,n.createElement("div",{className:"".concat(e,"-inner-content")},n.createElement("div",{className:"".concat(e,"-message")},g,n.createElement("div",{className:"".concat(e,"-message-title")},l)),n.createElement("div",{className:"".concat(e,"-buttons")},n.createElement(a.default,u({onClick:t.onCancel,size:"small"},r),h||i.cancelText),n.createElement(a.default,u({onClick:t.onConfirm,type:c,size:"small"},o),d||i.okText))))},t.renderConfirm=function(e){var i=e.getPrefixCls,s=t.props,r=s.prefixCls,a=s.placement,d=b(s,["prefixCls","placement"]),c=i("popover",r),g=n.createElement(l.a,{componentName:"Popconfirm",defaultLocale:h.a.Popconfirm},(function(e){return t.renderOverlay(c,e)}));return n.createElement(o.default,u({},d,{prefixCls:c,placement:a,onVisibleChange:t.onVisibleChange,visible:t.state.visible,overlay:g,ref:t.saveTooltip}))},t.state={visible:e.visible},t}return t=c,s=[{key:"getDerivedStateFromProps",value:function(e){return"visible"in e?{visible:e.visible}:"defaultVisible"in e?{visible:e.defaultVisible}:null}}],(i=[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"setVisible",value:function(e,t){var i=this.props;"visible"in i||this.setState({visible:e});var n=i.onVisibleChange;n&&n(e,t)}},{key:"render",value:function(){return n.createElement(d.a,null,this.renderConfirm)}}])&&g(t.prototype,i),s&&g(t,s),c}(n.Component);C.defaultProps={transitionName:"zoom-big",placement:"top",trigger:"click",okType:"primary",icon:n.createElement(r.default,{type:"exclamation-circle",theme:"filled"}),disabled:!1},Object(s.polyfill)(C),t.default=C},Nou3:function(e,t,i){},O6c4:function(e,t,i){},Oio9:function(e,t,i){},PDX0:function(e,t){(function(t){e.exports=t}).call(this,{})},PGCd:function(e,t,i){},PNG0:function(e,t,i){},Rcjm:function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return l}));var n=i("g3zJ");let s;const o=globalThis.vscode;if(void 0!==o&&void 0!==o.process){const e=o.process;s={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd:()=>e.cwd()}}else s=void 0!==e?{get platform(){return e.platform},get arch(){return e.arch},get env(){return Object({NODE_ENV:"production",PUBLIC_URL:"/react/build/"})},cwd:()=>Object({NODE_ENV:"production",PUBLIC_URL:"/react/build/"}).VSCODE_CWD||e.cwd()}:{get platform(){return n.n?"win32":n.i?"darwin":"linux"},get arch(){},get env(){return{}},cwd:()=>"/"};const r=s.cwd,a=s.env,l=s.platform}).call(this,i("8oxB"))},RilQ:function(e,t,i){},T02k:function(e,t,i){},Tgpw:function(e,t,i){},"UNi/":function(e,t){e.exports=function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}},UyhG:function(e,t,i){},VaNO:function(e,t){e.exports=function(e){return this.__data__.has(e)}},WFsp:function(e,t,i){},XhMw:function(e,t,i){},YEdH:function(e,t,i){},YqZz:function(e,t,i){},Z668:function(e,t,i){},ZShG:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));class n{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}},ZU3w:function(e,t,i){},ZYHo:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,s,o=b(i("NUBc")),r=b(i("wCAj")),a=b(i("5rEg")),l=b(i("NJEC")),h=b(i("2fM7")),d=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,s=!1,o=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);n=!0);}catch(e){s=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(s)throw o}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},c=(n=["{\n padding:24px 30px;\n min-height:420px;\n}"],s=["{\n padding:24px 30px;\n min-height:420px;\n}"],Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(s)}})));i("YQTV"),i("mbEz"),i("1vPl"),i("k994"),i("8QGh");var u=i("q1tI"),g=b(u),m=i("spEH"),f=i("eO8H"),p=b(i("vOnD")),_=b(i("vDqi")),v=b(i("5CEZ"));function b(e){return e&&e.__esModule?e:{default:e}}var C=h.default.Option,w=p.default.div(c),y=[{stage_name:"所有",stage_type:"all"},{stage_name:"初始化",stage_type:"init"},{stage_name:"编译构建",stage_type:"build"},{stage_name:"部署",stage_type:"deploy"},{stage_name:"其他",stage_type:"customize"}];t.default=function(e){var t=(0,u.useState)(!1),i=d(t,2),n=i[0],s=i[1],c=(0,u.useState)(void 0),p=d(c,2),b=p[0],S=p[1],L=(0,u.useState)(1),k=d(L,2),D=k[0],x=k[1],E=(0,u.useState)(0),N=d(E,2),I=N[0],T=N[1],M=(0,u.useState)("all"),A=d(M,2),O=A[0],R=A[1],P=(0,u.useState)(void 0),F=d(P,2),B=F[0],W=F[1],V=(0,u.useRef)(),H=e.match.params.projectsId,z=e.match.params.owner;function K(e,t,i){_.default.get("/ci/templates/list.json",{params:{page:e,limit:15,stage_type:t,name:i}}).then((function(e){e&&e.data&&(S(e.data.templates),T(e.data.total_count))})).catch((function(e){}))}(0,u.useEffect)((function(){K(D,O)}),[D,O]);var U=[{title:"名称",dataIndex:"template_name",key:1,ellipsis:!0},{title:"所属阶段",dataIndex:"stage_type",key:2,ellipsis:!0,render:function(e,t){var i=y.filter((function(t){return t.stage_type===e}));return i&&i.length>0&&i[0].stage_name}},{title:"模板类型",dataIndex:"category",key:3,ellipsis:!0},{title:"操作",dataIndex:"operation",key:4,ellipsis:!0,render:function(t,i){return g.default.createElement("span",null,g.default.createElement("a",{className:"mr10 color-grey-6",onClick:function(){return function(e){V.current&&V.current.setEditInfo(e);s(!0)}(i)}},g.default.createElement("i",{className:"iconfont icon-zaibianji font-13 mr3"}),"编辑"),g.default.createElement(l.default,{title:"确定要删除此模板?",onConfirm:function(){return t=i.id,n="/ci/templates/"+t+".json",void _.default.delete(n).then((function(t){t&&t.data&&(e.showNotification("模板删除成功!"),K(D,O,B))}));var t,n},okText:"确定",cancelText:"取消"},g.default.createElement("a",{className:"mr10 color-grey-6"},g.default.createElement("i",{className:"iconfont icon-lajitong font-13 mr3"}),"删除")))}}];return g.default.createElement("div",null,g.default.createElement(v.default,{wrappedComponentRef:function(e){return V.current=e},ref:V,visible:n,onCancel:function(){return s(!1)},onOk:function(){K(D,O)}}),g.default.createElement(m.Banner,null,g.default.createElement(m.FlexAJ,null,g.default.createElement("span",null,"引擎 - 模板管理"),g.default.createElement(f.Link,{to:"/"+z+"/"+H+"/devops",className:"font-14 color-grey-9"},"返回"))),g.default.createElement(w,{className:"disposeList"},g.default.createElement(m.FlexAJ,null,g.default.createElement(m.Blueback,{onClick:function(){V.current&&V.current.setEditInfo(void 0),s(!0)}},"新建模板"),g.default.createElement(m.FlexAJ,null,g.default.createElement("span",{className:"mr10"},"阶段:"),g.default.createElement(h.default,{onChange:function(e){return R(e)},value:O,style:{width:"180px"}},y.map((function(e,t){return g.default.createElement(C,{value:e.stage_type},e.stage_name)}))),g.default.createElement(a.default,{placeholder:"请输入模板名称",value:B,onChange:function(e){return W(e.target.value)},allowClear:!0,style:{width:"160px",marginLeft:"15px"}}),g.default.createElement(m.Blueback,{className:"ml15",onClick:function(){K(D,O,B)}},"搜索"))),g.default.createElement(r.default,{className:"mt20",size:"small",columns:U,dataSource:b,rowKey:function(e){return e.id},pagination:!1}),I>15&&g.default.createElement("div",{className:"mt20 pb20",style:{textAlign:"center"}},g.default.createElement(o.default,{simple:!0,current:D,pageSize:15,total:I,onChange:function(e){return x(e)}}))))}},"afy/":function(e,t,i){},b80T:function(e,t,i){var n=i("UNi/"),s=i("03A+"),o=i("Z0cm"),r=i("DSRE"),a=i("wJg7"),l=i("c6wG"),h=Object.prototype.hasOwnProperty;e.exports=function(e,t){var i=o(e),d=!i&&s(e),c=!i&&!d&&r(e),u=!i&&!d&&!c&&l(e),g=i||d||c||u,m=g?n(e.length,String):[],f=m.length;for(var p in e)!t&&!h.call(e,p)||g&&("length"==p||c&&("offset"==p||"parent"==p)||u&&("buffer"==p||"byteLength"==p||"byteOffset"==p)||a(p,f))||m.push(p);return m}},c6wG:function(e,t,i){var n=i("dD9F"),s=i("sEf8"),o=i("mdPL"),r=o&&o.isTypedArray,a=r?s(r):n;e.exports=a},dD9F:function(e,t,i){var n=i("NykK"),s=i("shjB"),o=i("ExA7"),r={};r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&s(e.length)&&!!r[n(e)]}},dX2Y:function(e,t,i){},eSqM:function(e,t,i){"use strict";function n(e,t=0){return e[e.length-(1+t)]}function s(e,t,i=((e,t)=>e===t)){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;n++)if(!i(e[n],t[n]))return!1;return!0}function*o(e,t){let i,n;for(const s of e)void 0!==n&&t(n,s)?i.push(s):(i&&(yield i),i=[s]),n=s;i&&(yield i)}function r(e,t){for(let i=0;i<=e.length;i++)t(0===i?void 0:e[i-1],i===e.length?void 0:e[i])}function a(e){return e.filter(e=>!!e)}function l(e){let t=0;for(let i=0;i<e.length;i++)e[i]&&(e[t]=e[i],t+=1);e.length=t}function h(e){return Array.isArray(e)&&e.length>0}function d(e,t=(e=>e)){const i=new Set;return e.filter(e=>{const n=t(e);return!i.has(n)&&(i.add(n),!0)})}function c(e,t){return e.length>0?e[0]:t}function u(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);const n=[];if(i<=t)for(let e=i;e<t;e++)n.push(e);else for(let e=i;e>t;e--)n.push(e);return n}function g(e,t,i){const n=e.slice(0,t),s=e.slice(t);return n.concat(i,s)}function m(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function f(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function p(e,t){for(const i of t)e.push(i)}function _(e,t,i,n){const s=v(e,t);let o=e.splice(s,i);return void 0===o&&(o=[]),function(e,t,i){const n=v(e,t),s=e.length,o=i.length;e.length=s+o;for(let t=s-1;t>=n;t--)e[t+o]=e[t];for(let t=0;t<o;t++)e[t+n]=i[t]}(e,s,n),o}function v(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}var b;function C(e,t){return(i,n)=>t(e(i),e(n))}i.r(t),i.d(t,"CancellationTokenSource",(function(){return r$})),i.d(t,"Emitter",(function(){return a$})),i.d(t,"KeyCode",(function(){return l$})),i.d(t,"KeyMod",(function(){return h$})),i.d(t,"Position",(function(){return d$})),i.d(t,"Range",(function(){return c$})),i.d(t,"Selection",(function(){return u$})),i.d(t,"SelectionDirection",(function(){return g$})),i.d(t,"MarkerSeverity",(function(){return m$})),i.d(t,"MarkerTag",(function(){return f$})),i.d(t,"Uri",(function(){return p$})),i.d(t,"Token",(function(){return _$})),i.d(t,"editor",(function(){return v$})),i.d(t,"languages",(function(){return b$})),function(e){e.isLessThan=function(e){return e<0},e.isLessThanOrEqual=function(e){return e<=0},e.isGreaterThan=function(e){return e>0},e.isNeitherLessOrGreaterThan=function(e){return 0===e},e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0}(b||(b={}));const w=(e,t)=>e-t,y=(e,t)=>w(e?1:0,t?1:0);class S{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(0!==this.length)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class L{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new L(t=>this.iterate(i=>!e(i)||t(i)))}map(e){return new L(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||b.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}}function k(e){return"string"==typeof e}function D(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function x(e){const t=Object.getPrototypeOf(Uint8Array);return"object"==typeof e&&e instanceof t}function E(e){return"number"==typeof e&&!isNaN(e)}function N(e){return!!e&&"function"==typeof e[Symbol.iterator]}function I(e){return!0===e||!1===e}function T(e){return void 0===e}function M(e){return!A(e)}function A(e){return T(e)||null===e}function O(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function R(e){if(A(e))throw new Error("Assertion Failed: argument is undefined or null");return e}function P(e){return"function"==typeof e}function F(e,t){if(k(t)){if(typeof e!==t)throw new Error("argument does not match constraint: typeof "+t)}else if(P(t)){try{if(e instanceof t)return}catch(e){}if(!A(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function B(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.entries(e).forEach(([e,i])=>{t[e]=i&&"object"==typeof i?B(i):i}),t}L.empty=new L(e=>{});const W=Object.prototype.hasOwnProperty;function V(e,t){return function e(t,i,n){if(A(t))return t;const s=i(t);if(void 0!==s)return s;if(Array.isArray(t)){const s=[];for(const o of t)s.push(e(o,i,n));return s}if(D(t)){if(n.has(t))throw new Error("Cannot clone recursive data-structure");n.add(t);const s={};for(const o in t)W.call(t,o)&&(s[o]=e(t[o],i,n));return n.delete(t),s}return t}(e,t,new Set)}function H(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let i,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(!H(e[i],t[i]))return!1}else{const s=[];for(n in e)s.push(n);s.sort();const o=[];for(n in t)o.push(n);if(o.sort(),!H(s,o))return!1;for(i=0;i<s.length;i++)if(!H(e[s[i]],t[s[i]]))return!1}return!0}function z(e){const t=[];for(const i of function(e){let t=[];for(;Object.prototype!==e;)t=t.concat(Object.getOwnPropertyNames(e)),e=Object.getPrototypeOf(e);return t}(e))"function"==typeof e[i]&&t.push(i);return t}var K=i("g3zJ");const U={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var j;!function(e){function t(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function*n(e){yield e}e.empty=function(){return i},e.single=n,e.wrap=function(e){return t(e)?e:n(e)},e.from=function(e){return e||i},e.reverse=function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const i of e)if(t(i))return!0;return!1},e.find=function(e,t){for(const i of e)if(t(i))return i},e.filter=function*(e,t){for(const i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(const n of e)yield t(n,i++)},e.concat=function*(...e){for(const t of e)yield*t},e.reduce=function(e,t,i){let n=i;for(const i of e)n=t(n,i);return n},e.slice=function*(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t<i;t++)yield e[t]},e.consume=function(t,i=Number.POSITIVE_INFINITY){const n=[];if(0===i)return[n,t];const s=t[Symbol.iterator]();for(let t=0;t<i;t++){const t=s.next();if(t.done)return[n,e.empty()];n.push(t.value)}return[n,{[Symbol.iterator]:()=>s}]},e.asyncToArray=async function(e){const t=[];for await(const i of e)t.push(i);return Promise.resolve(t)}}(j||(j={}));class q{constructor(e){this.element=e,this.next=q.Undefined,this.prev=q.Undefined}}q.Undefined=new q(void 0);class ${constructor(){this._first=q.Undefined,this._last=q.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===q.Undefined}clear(){let e=this._first;for(;e!==q.Undefined;){const t=e.next;e.prev=q.Undefined,e.next=q.Undefined,e=t}this._first=q.Undefined,this._last=q.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new q(e);if(this._first===q.Undefined)this._first=i,this._last=i;else if(t){const e=this._last;this._last=i,i.prev=e,e.next=i}else{const e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==q.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==q.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==q.Undefined&&e.next!==q.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===q.Undefined&&e.next===q.Undefined?(this._first=q.Undefined,this._last=q.Undefined):e.next===q.Undefined?(this._last=this._last.prev,this._last.next=q.Undefined):e.prev===q.Undefined&&(this._first=this._first.next,this._first.prev=q.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==q.Undefined;)yield e.element,e=e.next}}const G=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?")e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}();function Z(e){let t=G;if(e&&e instanceof RegExp)if(e.global)t=e;else{let i="g";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),t=new RegExp(e.source,i)}return t.lastIndex=0,t}const Y=new $;function Q(e,t,i,n,s){if(t=Z(t),s||(s=j.first(Y)),i.length>s.maxLen){let o=e-s.maxLen/2;return o<0?o=0:n+=o,Q(e,t,i=i.substring(o,e+s.maxLen/2),n,s)}const o=Date.now(),r=e-1-n;let a=-1,l=null;for(let e=1;!(Date.now()-o>=s.timeBudget);e++){const n=r-s.windowSize*e;t.lastIndex=Math.max(0,n);const o=X(t,i,r,a);if(!o&&l)break;if(l=o,n<=0)break;a=n}if(l){const e={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function X(e,t,i,n){let s;for(;s=e.exec(t);){const t=s.index||0;if(t<=i&&e.lastIndex>=i)return s;if(n>0&&t>n)return null}return null}Y.unshift({maxLen:1e3,windowSize:15,timeBudget:150});var J=i("MXXP");class ee{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class te{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class ie{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return se(e,t)}compute(e,t,i){return i}}class ne{constructor(e,t){this.newValue=e,this.didChange=t}}function se(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return new ne(t,e!==t);if(Array.isArray(e)||Array.isArray(t)){const i=Array.isArray(e)&&Array.isArray(t)&&s(e,t);return new ne(t,!i)}let i=!1;for(const n in t)if(t.hasOwnProperty(n)){const s=se(e[n],t[n]);s.didChange&&(e[n]=s.newValue,i=!0)}return new ne(e,i)}class oe{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return se(e,t)}validate(e){return this.defaultValue}}class re{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return se(e,t)}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,i){return i}}function ae(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}class le extends re{constructor(e,t,i,n){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return ae(e,this.defaultValue)}}function he(e,t,i,n){if(void 0===e)return t;let s=parseInt(e,10);return isNaN(s)?t:(s=Math.max(i,s),s=Math.min(n,s),0|s)}class de extends re{static clampedInt(e,t,i,n){return he(e,t,i,n)}constructor(e,t,i,n,s,o){void 0!==o&&(o.type="integer",o.default=i,o.minimum=n,o.maximum=s),super(e,t,i,o),this.minimum=n,this.maximum=s}validate(e){return de.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function ce(e,t,i,n){if(void 0===e)return t;const s=ue.float(e,t);return ue.clamp(s,i,n)}class ue extends re{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,s){void 0!==s&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=n}validate(e){return this.validationFn(ue.float(e,this.defaultValue))}}class ge extends re{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return ge.string(e,this.defaultValue)}}function me(e,t,i,n){return"string"!=typeof e?t:n&&e in n?n[e]:-1===i.indexOf(e)?t:e}class fe extends re{constructor(e,t,i,n,s){void 0!==s&&(s.type="string",s.enum=n,s.default=i),super(e,t,i,s),this._allowedValues=n}validate(e){return me(e,this.defaultValue,this._allowedValues)}}class pe extends ie{constructor(e,t,i,n,s,o,r){void 0!==r&&(r.type="string",r.enum=s,r.default=n),super(e,t,i,r),this._allowedValues=s,this._convert=o}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var _e,ve;!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"}(_e||(_e={}));class be extends ie{constructor(){super(51,"fontLigatures",be.OFF,{anyOf:[{type:"boolean",description:J.b("fontLigatures","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:J.b("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:J.b("fontLigaturesGeneral","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(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e||0===e.length?be.OFF:"true"===e?be.ON:e:Boolean(e)?be.ON:be.OFF}}be.OFF='"liga" off, "calt" off',be.ON='"liga" on, "calt" on';class Ce extends ie{constructor(){super(54,"fontVariations",Ce.OFF,{anyOf:[{type:"boolean",description:J.b("fontVariations","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:J.b("fontVariationSettings","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:J.b("fontVariationsGeneral","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(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?Ce.OFF:"true"===e?Ce.TRANSLATE:e:Boolean(e)?Ce.TRANSLATE:Ce.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}Ce.OFF="normal",Ce.TRANSLATE="translate";class we extends ie{constructor(){super(53,"fontWeight",Ae.fontWeight,{anyOf:[{type:"number",minimum:we.MINIMUM_VALUE,maximum:we.MAXIMUM_VALUE,errorMessage:J.b("fontWeightErrorMessage",'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:we.SUGGESTION_VALUES}],default:Ae.fontWeight,description:J.b("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return"normal"===e||"bold"===e?e:String(de.clampedInt(e,Ae.fontWeight,we.MINIMUM_VALUE,we.MAXIMUM_VALUE))}}we.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],we.MINIMUM_VALUE=1,we.MAXIMUM_VALUE=1e3;class ye extends oe{constructor(){super(144)}compute(e,t,i){return ye.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const s=(i+e.viewLineCount+n)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:s,minimapLineCount:Math.floor(e.viewLineCount/s)}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const o=t.stableMinimapLayoutInput,r=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.paddingTop===o.paddingTop&&e.paddingBottom===o.paddingBottom&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,h=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let c=s>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,g=e.minimap.size,m=e.minimap.side,f=e.verticalScrollbarWidth,p=e.viewLineCount,_=e.remainingWidth,v=e.isViewportWrapping,b=d?2:3;let C=Math.floor(s*n);const w=C/s;let y=!1,S=!1,L=b*c,k=c/s,D=1;if("fill"===g||"fit"===g){const{typicalViewportLineCount:i,extraLinesBeforeFirstLine:o,extraLinesBeyondLastLine:l,desiredRatio:d,minimapLineCount:u}=ye.computeContainedMinimapLineCount({viewLineCount:p,scrollBeyondLastLine:h,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:a,pixelRatio:s});if(p/u>1)y=!0,S=!0,c=1,L=1,k=c/s;else{let n=!1,h=c+1;if("fit"===g){const e=Math.ceil((o+p+l)*L);v&&r&&_<=t.stableFitRemainingWidth?(n=!0,h=t.stableFitMaxMinimapScale):n=e>C}if("fill"===g||n){y=!0;const n=c;L=Math.min(a*s,Math.max(1,Math.floor(1/d))),v&&r&&_<=t.stableFitRemainingWidth&&(h=t.stableFitMaxMinimapScale),c=Math.min(h,Math.max(1,Math.floor(L/b))),c>n&&(D=Math.min(2,c/n)),k=c/s/D,C=Math.ceil(Math.max(i,o+p+l)*L),v?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=c):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const x=Math.floor(u*k),E=Math.min(x,Math.max(0,Math.floor((_-f-2)*k/(l+k)))+8);let N=Math.floor(s*E);const I=N/s;N=Math.floor(N*D);return{renderMinimap:d?1:2,minimapLeft:"left"===m?0:i-E-f,minimapWidth:E,minimapHeightIsEditorHeight:y,minimapIsSampling:S,minimapScale:c,minimapLineHeight:L,minimapCanvasInnerWidth:N,minimapCanvasInnerHeight:C,minimapCanvasOuterWidth:I,minimapCanvasOuterHeight:w}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,s=0|t.lineHeight,o=0|t.lineNumbersDigitCount,r=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,h=t.viewLineCount,d=e.get(136),c="inherit"===d?e.get(135):d,u="inherit"===c?e.get(131):c,g=e.get(134),m=t.isDominatedByLongLines,f=e.get(57),p=0!==e.get(68).renderType,_=e.get(69),v=e.get(105),b=e.get(84),C=e.get(73),w=e.get(103),y=w.verticalScrollbarSize,S=w.verticalHasArrows,L=w.arrowSize,k=w.horizontalScrollbarSize,D=e.get(43),x="never"!==e.get(110);let E=e.get(66);D&&x&&(E+=16);let N=0;if(p){const e=Math.max(o,_);N=Math.round(e*a)}let I=0;f&&(I=s*t.glyphMarginDecorationLaneCount);let T=0,M=T+I,A=M+N,O=A+E;const R=i-I-N-E;let P=!1,F=!1,B=-1;"inherit"===c&&m?(P=!0,F=!0):"on"===u||"bounded"===u?F=!0:"wordWrapColumn"===u&&(B=g);const W=ye._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:s,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:v,paddingTop:b.top,paddingBottom:b.bottom,minimap:C,verticalScrollbarWidth:y,viewLineCount:h,remainingWidth:R,isViewportWrapping:F},t.memory||new te);0!==W.renderMinimap&&0===W.minimapLeft&&(T+=W.minimapWidth,M+=W.minimapWidth,A+=W.minimapWidth,O+=W.minimapWidth);const V=R-W.minimapWidth,H=Math.max(1,Math.floor((V-y-2)/r)),z=S?L:0;return F&&(B=Math.max(1,H),"bounded"===u&&(B=Math.min(B,g))),{width:i,height:n,glyphMarginLeft:T,glyphMarginWidth:I,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:M,lineNumbersWidth:N,decorationsLeft:A,decorationsWidth:E,contentLeft:O,contentWidth:V,minimap:W,viewportColumn:H,isWordWrapMinified:P,isViewportWrapping:F,wrappingColumn:B,verticalScrollbarWidth:y,horizontalScrollbarHeight:k,overviewRuler:{top:z,width:y,height:n-2*z,right:0}}}}!function(e){e.Off="off",e.OnCode="onCode",e.On="on"}(ve||(ve={}));function Se(e){const t=e.get(98);return"editable"===t?e.get(91):"on"!==t}function Le(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}const ke="editor.unicodeHighlight.allowedCharacters",De="editor.unicodeHighlight.invisibleCharacters",xe="editor.unicodeHighlight.nonBasicASCII",Ee="editor.unicodeHighlight.ambiguousCharacters",Ne="editor.unicodeHighlight.includeComments",Ie="editor.unicodeHighlight.includeStrings",Te="editor.unicodeHighlight.allowedLocales";function Me(e,t,i){const n=i.indexOf(e);return-1===n?t:i[n]}const Ae={fontFamily:K.i?"Menlo, Monaco, 'Courier New', monospace":K.g?"'Droid Sans Mono', 'monospace', monospace":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:K.i?12:14,lineHeight:0,letterSpacing:0},Oe=[];function Re(e){return Oe[e.id]=e,e}const Pe={acceptSuggestionOnCommitCharacter:Re(new le(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:J.b("acceptSuggestionOnCommitCharacter","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.")})),acceptSuggestionOnEnter:Re(new fe(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",J.b("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:J.b("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Re(new class extends ie{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[J.b("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),J.b("accessibilitySupport.on","Optimize for usage with a Screen Reader."),J.b("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:J.b("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:Re(new de(3,"accessibilityPageSize",10,1,1073741824,{description:J.b("accessibilityPageSize","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"]})),ariaLabel:Re(new ge(4,"ariaLabel",J.b("editorViewAccessibleLabel","Editor content"))),ariaRequired:Re(new le(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Re(new le(8,"screenReaderAnnounceInlineSuggestion",!0,{description:J.b("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Re(new fe(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",J.b("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),J.b("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:J.b("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Re(new fe(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",J.b("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),J.b("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:J.b("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Re(new fe(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",J.b("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:J.b("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Re(new fe(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",J.b("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:J.b("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Re(new fe(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",J.b("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),J.b("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:J.b("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Re(new pe(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[J.b("editor.autoIndent.none","The editor will not insert indentation automatically."),J.b("editor.autoIndent.keep","The editor will keep the current line's indentation."),J.b("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),J.b("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),J.b("editor.autoIndent.full","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:J.b("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Re(new le(13,"automaticLayout",!1)),autoSurround:Re(new fe(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[J.b("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),J.b("editor.autoSurround.quotes","Surround with quotes but not brackets."),J.b("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:J.b("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Re(new class extends ie{constructor(){const e={enabled:U.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:U.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:J.b("bracketPairColorization.enabled","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:J.b("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ae(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:ae(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}),bracketPairGuides:Re(new class extends ie{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[J.b("editor.guides.bracketPairs.true","Enables bracket pair guides."),J.b("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),J.b("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:J.b("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[J.b("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),J.b("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),J.b("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:J.b("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:J.b("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:J.b("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[J.b("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),J.b("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),J.b("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:J.b("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{bracketPairs:Me(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Me(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:ae(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:ae(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Me(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}),stickyTabStops:Re(new le(116,"stickyTabStops",!1,{description:J.b("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Re(new le(17,"codeLens",!0,{description:J.b("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Re(new ge(18,"codeLensFontFamily","",{description:J.b("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Re(new de(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:J.b("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Re(new le(20,"colorDecorators",!0,{description:J.b("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Re(new fe(147,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[J.b("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),J.b("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),J.b("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:J.b("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Re(new de(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:J.b("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Re(new le(22,"columnSelection",!1,{description:J.b("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Re(new class extends ie{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:J.b("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:J.b("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:ae(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:ae(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:Re(new le(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Re(new le(25,"copyWithSyntaxHighlighting",!0,{description:J.b("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Re(new pe(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:J.b("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Re(new fe(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[J.b("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),J.b("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),J.b("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:J.b("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Re(new pe(28,"cursorStyle",_e.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],(function(e){switch(e){case"line":return _e.Line;case"block":return _e.Block;case"underline":return _e.Underline;case"line-thin":return _e.LineThin;case"block-outline":return _e.BlockOutline;case"underline-thin":return _e.UnderlineThin}}),{description:J.b("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Re(new de(29,"cursorSurroundingLines",0,0,1073741824,{description:J.b("cursorSurroundingLines","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.")})),cursorSurroundingLinesStyle:Re(new fe(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[J.b("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),J.b("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:J.b("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:Re(new de(31,"cursorWidth",0,0,1073741824,{markdownDescription:J.b("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Re(new le(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Re(new le(33,"disableMonospaceOptimizations",!1)),domReadOnly:Re(new le(34,"domReadOnly",!1)),dragAndDrop:Re(new le(35,"dragAndDrop",!0,{description:J.b("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Re(new class extends le{constructor(){super(37,"emptySelectionClipboard",!0,{description:J.b("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),dropIntoEditor:Re(new class extends ie{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:J.b("dropIntoEditor.enabled","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:J.b("dropIntoEditor.showDropSelector","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:[J.b("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),J.b("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ae(t.enabled,this.defaultValue.enabled),showDropSelector:me(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}),stickyScroll:Re(new class extends ie{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(115,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:J.b("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:J.b("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:J.b("editor.stickyScroll.defaultModel","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:J.b("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ae(t.enabled,this.defaultValue.enabled),maxLineCount:de.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:me(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:ae(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}),experimentalWhitespaceRendering:Re(new fe(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[J.b("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),J.b("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),J.b("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:J.b("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Re(new ge(39,"extraEditorClassName","")),fastScrollSensitivity:Re(new ue(40,"fastScrollSensitivity",5,e=>e<=0?5:e,{markdownDescription:J.b("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Re(new class extends ie{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:J.b("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[J.b("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),J.b("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),J.b("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:J.b("find.seedSearchStringFromSelection","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:[J.b("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),J.b("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),J.b("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:J.b("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:J.b("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:K.i},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:J.b("find.addExtraSpaceOnTop","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:J.b("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:ae(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:"boolean"==typeof e.seedSearchStringFromSelection?e.seedSearchStringFromSelection?"always":"never":me(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":me(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:ae(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:ae(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:ae(t.loop,this.defaultValue.loop)}}}),fixedOverflowWidgets:Re(new le(42,"fixedOverflowWidgets",!1)),folding:Re(new le(43,"folding",!0,{description:J.b("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Re(new fe(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[J.b("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),J.b("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:J.b("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Re(new le(45,"foldingHighlight",!0,{description:J.b("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Re(new le(46,"foldingImportsByDefault",!1,{description:J.b("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Re(new de(47,"foldingMaximumRegions",5e3,10,65e3,{description:J.b("foldingMaximumRegions","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.")})),unfoldOnClickAfterEndOfLine:Re(new le(48,"unfoldOnClickAfterEndOfLine",!1,{description:J.b("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Re(new ge(49,"fontFamily",Ae.fontFamily,{description:J.b("fontFamily","Controls the font family.")})),fontInfo:Re(new class extends oe{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:Re(new be),fontSize:Re(new class extends re{constructor(){super(52,"fontSize",Ae.fontSize,{type:"number",minimum:6,maximum:100,default:Ae.fontSize,description:J.b("fontSize","Controls the font size in pixels.")})}validate(e){const t=ue.float(e,this.defaultValue);return 0===t?Ae.fontSize:ue.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:Re(new we),fontVariations:Re(new Ce),formatOnPaste:Re(new le(55,"formatOnPaste",!1,{description:J.b("formatOnPaste","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.")})),formatOnType:Re(new le(56,"formatOnType",!1,{description:J.b("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Re(new le(57,"glyphMargin",!0,{description:J.b("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Re(new class extends ie{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[J.b("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),J.b("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),J.b("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","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(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:J.b("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:J.b("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:J.b("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:J.b("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:J.b("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:J.b("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:J.b("alternativeDefinitionCommand","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:i,description:J.b("alternativeTypeDefinitionCommand","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:i,description:J.b("alternativeDeclarationCommand","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:i,description:J.b("alternativeImplementationCommand","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:i,description:J.b("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,s,o;if(!e||"object"!=typeof e)return this.defaultValue;const r=e;return{multiple:me(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:me(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:me(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:me(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(s=r.multipleImplementations)&&void 0!==s?s:me(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(o=r.multipleReferences)&&void 0!==o?o:me(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:ge.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:ge.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:ge.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:ge.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:ge.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}),hideCursorInOverviewRuler:Re(new le(59,"hideCursorInOverviewRuler",!1,{description:J.b("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Re(new class extends ie{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:J.b("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:J.b("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:J.b("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:J.b("hover.hidingDelay","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:J.b("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ae(t.enabled,this.defaultValue.enabled),delay:de.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:ae(t.sticky,this.defaultValue.sticky),hidingDelay:de.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:ae(t.above,this.defaultValue.above)}}}),inDiffEditor:Re(new le(61,"inDiffEditor",!1)),letterSpacing:Re(new ue(64,"letterSpacing",Ae.letterSpacing,e=>ue.clamp(e,-5,20),{description:J.b("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Re(new class extends ie{constructor(){const e={enabled:ve.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[ve.Off,ve.OnCode,ve.On],default:e.enabled,enumDescriptions:[J.b("editor.lightbulb.enabled.off","Disable the code action menu."),J.b("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),J.b("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:J.b("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;return{enabled:me(e.enabled,this.defaultValue.enabled,[ve.Off,ve.OnCode,ve.On])}}}),lineDecorationsWidth:Re(new class extends ie{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){if("string"==typeof e&&/^\d+(\.\d+)?ch$/.test(e)){return-parseFloat(e.substring(0,e.length-2))}return de.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?de.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}),lineHeight:Re(new class extends ue{constructor(){super(67,"lineHeight",Ae.lineHeight,e=>ue.clamp(e,0,150),{markdownDescription:J.b("lineHeight","Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")})}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:Re(new class extends ie{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[J.b("lineNumbers.off","Line numbers are not rendered."),J.b("lineNumbers.on","Line numbers are rendered as absolute number."),J.b("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),J.b("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:J.b("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:Re(new de(69,"lineNumbersMinChars",5,1,300)),linkedEditing:Re(new le(70,"linkedEditing",!1,{description:J.b("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Re(new le(71,"links",!0,{description:J.b("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Re(new fe(72,"matchBrackets","always",["always","near","never"],{description:J.b("matchBrackets","Highlight matching brackets.")})),minimap:Re(new class extends ie{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:J.b("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:J.b("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[J.b("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),J.b("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),J.b("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:J.b("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:J.b("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:J.b("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:J.b("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:J.b("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:J.b("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ae(t.enabled,this.defaultValue.enabled),autohide:ae(t.autohide,this.defaultValue.autohide),size:me(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:me(t.side,this.defaultValue.side,["right","left"]),showSlider:me(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:ae(t.renderCharacters,this.defaultValue.renderCharacters),scale:de.clampedInt(t.scale,1,1,3),maxColumn:de.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}),mouseStyle:Re(new fe(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Re(new ue(75,"mouseWheelScrollSensitivity",1,e=>0===e?1:e,{markdownDescription:J.b("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Re(new le(76,"mouseWheelZoom",!1,{markdownDescription:K.i?J.b("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):J.b("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Re(new le(77,"multiCursorMergeOverlapping",!0,{description:J.b("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Re(new pe(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?K.i?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[J.b("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),J.b("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:J.b({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"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).")})),multiCursorPaste:Re(new fe(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[J.b("multiCursorPaste.spread","Each cursor pastes a single line of the text."),J.b("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:J.b("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Re(new de(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:J.b("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Re(new fe(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[J.b("occurrencesHighlight.off","Does not highlight occurrences."),J.b("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),J.b("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:J.b("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:Re(new le(82,"overviewRulerBorder",!0,{description:J.b("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Re(new de(83,"overviewRulerLanes",3,0,3)),padding:Re(new class extends ie{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:J.b("padding.top","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:J.b("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:de.clampedInt(t.top,0,0,1e3),bottom:de.clampedInt(t.bottom,0,0,1e3)}}}),pasteAs:Re(new class extends ie{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:J.b("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:J.b("pasteAs.showPasteSelector","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:[J.b("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),J.b("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ae(t.enabled,this.defaultValue.enabled),showPasteSelector:me(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}),parameterHints:Re(new class extends ie{constructor(){const e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:J.b("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:J.b("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ae(t.enabled,this.defaultValue.enabled),cycle:ae(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:Re(new fe(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[J.b("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),J.b("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:J.b("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Re(new le(88,"definitionLinkOpensInPeek",!1,{description:J.b("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Re(new class extends ie{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[J.b("on","Quick suggestions show inside the suggest widget"),J.b("inline","Quick suggestions show as ghost text"),J.b("off","Quick suggestions are disabled")]}];super(89,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:J.b("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:J.b("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:J.b("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:J.b("quickSuggestions","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#")}),this.defaultValue=e}validate(e){if("boolean"==typeof e){const t=e?"on":"off";return{comments:t,strings:t,other:t}}if(!e||"object"!=typeof e)return this.defaultValue;const{other:t,comments:i,strings:n}=e,s=["on","inline","off"];let o,r,a;return o="boolean"==typeof t?t?"on":"off":me(t,this.defaultValue.other,s),r="boolean"==typeof i?i?"on":"off":me(i,this.defaultValue.comments,s),a="boolean"==typeof n?n?"on":"off":me(n,this.defaultValue.strings,s),{other:o,comments:r,strings:a}}}),quickSuggestionsDelay:Re(new de(90,"quickSuggestionsDelay",10,0,1073741824,{description:J.b("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Re(new le(91,"readOnly",!1)),readOnlyMessage:Re(new class extends ie{constructor(){super(92,"readOnlyMessage",void 0)}validate(e){return e&&"object"==typeof e?e:this.defaultValue}}),renameOnType:Re(new le(93,"renameOnType",!1,{description:J.b("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:J.b("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Re(new le(94,"renderControlCharacters",!0,{description:J.b("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Re(new fe(95,"renderFinalNewline",K.g?"dimmed":"on",["off","on","dimmed"],{description:J.b("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Re(new fe(96,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",J.b("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:J.b("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Re(new le(97,"renderLineHighlightOnlyWhenFocus",!1,{description:J.b("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Re(new fe(98,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Re(new fe(99,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",J.b("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),J.b("renderWhitespace.selection","Render whitespace characters only on selected text."),J.b("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:J.b("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Re(new de(100,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Re(new le(101,"roundedSelection",!0,{description:J.b("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Re(new class extends ie{constructor(){const e=[],t={type:"number",description:J.b("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(102,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:J.b("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:J.b("rulers","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)){const t=[];for(const i of e)if("number"==typeof i)t.push({column:de.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:de.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}}),scrollbar:Re(new class extends ie{constructor(){const e={vertical:1,horizontal:1,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(103,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[J.b("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),J.b("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),J.b("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:J.b("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[J.b("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),J.b("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),J.b("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:J.b("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:J.b("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:J.b("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:J.b("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:J.b("scrollbar.ignoreHorizontalScrollbarInContentHeight","When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=de.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=de.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:de.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Le(t.vertical,this.defaultValue.vertical),horizontal:Le(t.horizontal,this.defaultValue.horizontal),useShadows:ae(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:ae(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:ae(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:ae(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:ae(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:de.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:de.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:ae(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:ae(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}}),scrollBeyondLastColumn:Re(new de(104,"scrollBeyondLastColumn",4,0,1073741824,{description:J.b("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Re(new le(105,"scrollBeyondLastLine",!0,{description:J.b("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Re(new le(106,"scrollPredominantAxis",!0,{description:J.b("scrollPredominantAxis","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.")})),selectionClipboard:Re(new le(107,"selectionClipboard",!0,{description:J.b("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:K.g})),selectionHighlight:Re(new le(108,"selectionHighlight",!0,{description:J.b("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Re(new le(109,"selectOnLineNumbers",!0)),showFoldingControls:Re(new fe(110,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[J.b("showFoldingControls.always","Always show the folding controls."),J.b("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),J.b("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:J.b("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Re(new le(111,"showUnused",!0,{description:J.b("showUnused","Controls fading out of unused code.")})),showDeprecated:Re(new le(139,"showDeprecated",!0,{description:J.b("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Re(new class extends ie{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(140,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:J.b("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[J.b("editor.inlayHints.on","Inlay hints are enabled"),J.b("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",K.i?"Ctrl+Option":"Ctrl+Alt"),J.b("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",K.i?"Ctrl+Option":"Ctrl+Alt"),J.b("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:J.b("inlayHints.fontSize","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:J.b("inlayHints.fontFamily","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:J.b("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return"boolean"==typeof t.enabled&&(t.enabled=t.enabled?"on":"off"),{enabled:me(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:de.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:ge.string(t.fontFamily,this.defaultValue.fontFamily),padding:ae(t.padding,this.defaultValue.padding)}}}),snippetSuggestions:Re(new fe(112,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[J.b("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),J.b("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),J.b("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),J.b("snippetSuggestions.none","Do not show snippet suggestions.")],description:J.b("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Re(new class extends ie{constructor(){super(113,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:J.b("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:J.b("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:ae(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:ae(e.selectSubwords,this.defaultValue.selectSubwords)}:this.defaultValue}}),smoothScrolling:Re(new le(114,"smoothScrolling",!1,{description:J.b("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Re(new de(117,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Re(new class extends ie{constructor(){const 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(118,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[J.b("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),J.b("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:J.b("suggest.insertMode","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:J.b("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:J.b("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:J.b("suggest.shareSuggestSelections","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:[J.b("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),J.b("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),J.b("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),J.b("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:J.b("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:J.b("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:J.b("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:J.b("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:J.b("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:J.b("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:J.b("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:J.b("deprecated","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:J.b("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.matchOnWordStartOnly","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:J.b("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:J.b("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:me(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:ae(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:ae(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:ae(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:ae(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:me(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:ae(t.showIcons,this.defaultValue.showIcons),showStatusBar:ae(t.showStatusBar,this.defaultValue.showStatusBar),preview:ae(t.preview,this.defaultValue.preview),previewMode:me(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:ae(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:ae(t.showMethods,this.defaultValue.showMethods),showFunctions:ae(t.showFunctions,this.defaultValue.showFunctions),showConstructors:ae(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:ae(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:ae(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:ae(t.showFields,this.defaultValue.showFields),showVariables:ae(t.showVariables,this.defaultValue.showVariables),showClasses:ae(t.showClasses,this.defaultValue.showClasses),showStructs:ae(t.showStructs,this.defaultValue.showStructs),showInterfaces:ae(t.showInterfaces,this.defaultValue.showInterfaces),showModules:ae(t.showModules,this.defaultValue.showModules),showProperties:ae(t.showProperties,this.defaultValue.showProperties),showEvents:ae(t.showEvents,this.defaultValue.showEvents),showOperators:ae(t.showOperators,this.defaultValue.showOperators),showUnits:ae(t.showUnits,this.defaultValue.showUnits),showValues:ae(t.showValues,this.defaultValue.showValues),showConstants:ae(t.showConstants,this.defaultValue.showConstants),showEnums:ae(t.showEnums,this.defaultValue.showEnums),showEnumMembers:ae(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:ae(t.showKeywords,this.defaultValue.showKeywords),showWords:ae(t.showWords,this.defaultValue.showWords),showColors:ae(t.showColors,this.defaultValue.showColors),showFiles:ae(t.showFiles,this.defaultValue.showFiles),showReferences:ae(t.showReferences,this.defaultValue.showReferences),showFolders:ae(t.showFolders,this.defaultValue.showFolders),showTypeParameters:ae(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:ae(t.showSnippets,this.defaultValue.showSnippets),showUsers:ae(t.showUsers,this.defaultValue.showUsers),showIssues:ae(t.showIssues,this.defaultValue.showIssues)}}}),inlineSuggest:Re(new class extends ie{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:J.b("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[J.b("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),J.b("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),J.b("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:J.b("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:J.b("inlineSuggest.suppressSuggestions","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.fontFamily":{type:"string",default:e.fontFamily,description:J.b("inlineSuggest.fontFamily","Controls the font family of the inline suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ae(t.enabled,this.defaultValue.enabled),mode:me(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:me(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:ae(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:ae(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:ge.string(t.fontFamily,this.defaultValue.fontFamily)}}}),inlineEdit:Re(new class extends ie{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1,backgroundColoring:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:J.b("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[J.b("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),J.b("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),J.b("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:J.b("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:J.b("inlineEdit.fontFamily","Controls the font family of the inline edit.")},"editor.experimentalInlineEdit.backgroundColoring":{type:"boolean",default:e.backgroundColoring,description:J.b("inlineEdit.backgroundColoring","Controls whether to color the background of inline edits.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ae(t.enabled,this.defaultValue.enabled),showToolbar:me(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:ge.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:ae(t.keepOnBlur,this.defaultValue.keepOnBlur),backgroundColoring:ae(t.backgroundColoring,this.defaultValue.backgroundColoring)}}}),inlineCompletionsAccessibilityVerbose:Re(new le(148,"inlineCompletionsAccessibilityVerbose",!1,{description:J.b("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Re(new de(119,"suggestFontSize",0,0,1e3,{markdownDescription:J.b("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Re(new de(120,"suggestLineHeight",0,0,1e3,{markdownDescription:J.b("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Re(new le(121,"suggestOnTriggerCharacters",!0,{description:J.b("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Re(new fe(122,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[J.b("suggestSelection.first","Always select the first suggestion."),J.b("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),J.b("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:J.b("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Re(new fe(123,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[J.b("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),J.b("tabCompletion.off","Disable tab completions."),J.b("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:J.b("tabCompletion","Enables tab completions.")})),tabIndex:Re(new de(124,"tabIndex",0,-1,1073741824)),unicodeHighlight:Re(new class extends ie{constructor(){const e={nonBasicASCII:"inUntrustedWorkspace",invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:"inUntrustedWorkspace",includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(125,"unicodeHighlight",e,{[xe]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,"inUntrustedWorkspace"],default:e.nonBasicASCII,description:J.b("unicodeHighlight.nonBasicASCII","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.")},[De]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:J.b("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Ee]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:J.b("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Ne]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,"inUntrustedWorkspace"],default:e.includeComments,description:J.b("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Ie]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,"inUntrustedWorkspace"],default:e.includeStrings,description:J.b("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[ke]:{restricted:!0,type:"object",default:e.allowedCharacters,description:J.b("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Te]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:J.b("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(H(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(H(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new ne(n.newValue,!0):n}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{nonBasicASCII:Me(t.nonBasicASCII,"inUntrustedWorkspace",[!0,!1,"inUntrustedWorkspace"]),invisibleCharacters:ae(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:ae(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Me(t.includeComments,"inUntrustedWorkspace",[!0,!1,"inUntrustedWorkspace"]),includeStrings:Me(t.includeStrings,"inUntrustedWorkspace",[!0,!1,"inUntrustedWorkspace"]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if("object"!=typeof e||!e)return t;const i={};for(const[t,n]of Object.entries(e))!0===n&&(i[t]=!0);return i}}),unusualLineTerminators:Re(new fe(126,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[J.b("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),J.b("unusualLineTerminators.off","Unusual line terminators are ignored."),J.b("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:J.b("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Re(new le(127,"useShadowDOM",!0)),useTabStops:Re(new le(128,"useTabStops",!0,{description:J.b("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:Re(new fe(129,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[J.b("wordBreak.normal","Use the default line break rule."),J.b("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:J.b("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:Re(new ge(130,"wordSeparators","`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",{description:J.b("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Re(new fe(131,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[J.b("wordWrap.off","Lines will never wrap."),J.b("wordWrap.on","Lines will wrap at the viewport width."),J.b({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),J.b({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:J.b({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Re(new ge(132,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Re(new ge(133,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥+")),wordWrapColumn:Re(new de(134,"wordWrapColumn",80,1,1073741824,{markdownDescription:J.b({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Re(new fe(135,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Re(new fe(136,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Re(new class extends oe{constructor(){super(141)}compute(e,t,i){const n=["monaco-editor"];return t.get(39)&&n.push(t.get(39)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(74)?n.push("mouse-default"):"copy"===t.get(74)&&n.push("mouse-copy"),t.get(111)&&n.push("showUnused"),t.get(139)&&n.push("showDeprecated"),n.join(" ")}}),defaultColorDecorators:Re(new le(146,"defaultColorDecorators",!1,{markdownDescription:J.b("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Re(new class extends oe{constructor(){super(142)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:Re(new le(143,"tabFocusMode",!1,{markdownDescription:J.b("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Re(new ye),wrappingInfo:Re(new class extends oe{constructor(){super(145)}compute(e,t,i){const n=t.get(144);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}),wrappingIndent:Re(new class extends ie{constructor(){super(137,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[J.b("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),J.b("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),J.b("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),J.b("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:J.b("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return 2===t.get(2)?0:i}}),wrappingStrategy:Re(new class extends ie{constructor(){super(138,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[J.b("wrappingStrategy.simple","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."),J.b("wrappingStrategy.advanced","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:J.b("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return me(e,"simple",["simple","advanced"])}compute(e,t,i){return 2===t.get(2)?"advanced":i}})};const Fe=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{if(e.stack){if(qe.isErrorNoTelemetry(e))throw new qe(e.message+"\n\n"+e.stack);throw new Error(e.message+"\n\n"+e.stack)}throw e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function Be(e){He(e)||Fe.onUnexpectedError(e)}function We(e){He(e)||Fe.onUnexpectedExternalError(e)}function Ve(e){if(e instanceof Error){const{name:t,message:i}=e;return{$isError:!0,name:t,message:i,stack:e.stacktrace||e.stack,noTelemetry:qe.isErrorNoTelemetry(e)}}return e}function He(e){return e instanceof ze||e instanceof Error&&"Canceled"===e.name&&"Canceled"===e.message}class ze extends Error{constructor(){super("Canceled"),this.name=this.message}}function Ke(e){return e?new Error("Illegal argument: "+e):new Error("Illegal argument")}function Ue(e){return e?new Error("Illegal state: "+e):new Error("Illegal state")}class je extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class qe extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof qe)return e;const t=new qe;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}}class $e extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,$e.prototype)}}function Ge(e,t){const i=this;let n,s=!1;return function(){if(s)return n;if(s=!0,t)try{n=e.apply(i,arguments)}finally{t()}else n=e.apply(i,arguments);return n}}let Ze=null;function Ye(e){return null==Ze||Ze.trackDisposable(e),e}function Qe(e){null==Ze||Ze.markAsDisposed(e)}function Xe(e,t){null==Ze||Ze.setParent(e,t)}function Je(e){return null==Ze||Ze.markAsSingleton(e),e}function et(e){if(j.is(e)){const t=[];for(const i of e)if(i)try{i.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function tt(...e){const t=it(()=>et(e));return function(e,t){if(Ze)for(const i of e)Ze.setParent(i,t)}(e,t),t}function it(e){const t=Ye({dispose:Ge(()=>{Qe(t),e()})});return t}class nt{constructor(){this._toDispose=new Set,this._isDisposed=!1,Ye(this)}dispose(){this._isDisposed||(Qe(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{et(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return Xe(e,this),this._isDisposed?nt.DISABLE_DISPOSED_WARNING||console.warn(new 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(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),Xe(e,null))}}nt.DISABLE_DISPOSED_WARNING=!1;class st{constructor(){this._store=new nt,Ye(this),Xe(this._store,this)}dispose(){Qe(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}st.None=Object.freeze({dispose(){}});class ot{constructor(){this._isDisposed=!1,Ye(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||(null===(t=this._value)||void 0===t||t.dispose(),e&&Xe(e,this),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,Qe(this),null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}}class rt{constructor(e){this.object=e}dispose(){}}class at{constructor(){this._store=new Map,this._isDisposed=!1,Ye(this)}dispose(){Qe(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{et(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var n;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||null===(n=this._store.get(e))||void 0===n||n.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;null===(t=this._store.get(e))||void 0===t||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const lt=globalThis.performance&&"function"==typeof globalThis.performance.now;class ht{static create(e){return new ht(e)}constructor(e){this._now=lt&&!1===e?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}}var dt;!function(e){function t(e){0}function i(e){return(t,i=null,n)=>{let s=!1,o=void 0;return o=e(e=>{if(!s)return o?o.dispose():s=!0,t.call(i,e)},null,n),s&&o.dispose(),o}}function n(e,t,i){return o((i,n=null,s)=>e(e=>i.call(n,t(e)),null,s),i)}function s(e,t,i){return o((i,n=null,s)=>e(e=>t(e)&&i.call(n,e),null,s),i)}function o(e,i){let n;const s={onWillAddFirstListener(){n=e(o.fire,o)},onDidRemoveLastListener(){null==n||n.dispose()}};i||t();const o=new ft(s);return null==i||i.add(o),o.event}function r(e,i,n=100,s=!1,o=!1,r,a){let l,h,d=void 0,c=void 0,u=0;const g={leakWarningThreshold:r,onWillAddFirstListener(){l=e(e=>{u++,d=i(d,e),s&&!c&&(m.fire(d),d=void 0),h=()=>{const e=d;d=void 0,c=void 0,(!s||u>1)&&m.fire(e),u=0},"number"==typeof n?(clearTimeout(c),c=setTimeout(h,n)):void 0===c&&(c=0,queueMicrotask(h))})},onWillRemoveListener(){o&&u>0&&(null==h||h())},onDidRemoveLastListener(){h=void 0,l.dispose()}};a||t();const m=new ft(g);return null==a||a.add(m),m.event}e.None=()=>st.None,e.defer=function(e,t){return r(e,()=>{},0,void 0,!0,void 0,t)},e.once=i,e.map=n,e.forEach=function(e,t,i){return o((i,n=null,s)=>e(e=>{t(e),i.call(n,e)},null,s),i)},e.filter=s,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,n)=>function(e,t){t instanceof Array?t.push(e):t&&t.add(e);return e}(tt(...e.map(e=>e(e=>t.call(i,e)))),n)},e.reduce=function(e,t,i,s){let o=i;return n(e,e=>(o=t(o,e),o),s)},e.debounce=r,e.accumulate=function(t,i=0,n){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],i,void 0,!0,void 0,n)},e.latch=function(e,t=((e,t)=>e===t),i){let n,o=!0;return s(e,e=>{const i=o||!t(e,n);return o=!1,n=e,i},i)},e.split=function(t,i,n){return[e.filter(t,i,n),e.filter(t,e=>!i(e),n)]},e.buffer=function(e,t=!1,i=[],n){let s=i.slice(),o=e(e=>{s?s.push(e):a.fire(e)});n&&n.add(o);const r=()=>{null==s||s.forEach(e=>a.fire(e)),s=null},a=new ft({onWillAddFirstListener(){o||(o=e(e=>a.fire(e)),n&&n.add(o))},onDidAddFirstListener(){s&&(t?setTimeout(r):r())},onDidRemoveLastListener(){o&&o.dispose(),o=null}});return n&&n.add(a),a.event},e.chain=function(e,t){return(i,n,s)=>{const o=t(new l);return e((function(e){const t=o.evaluate(e);t!==a&&i.call(n,t)}),void 0,s)}};const a=Symbol("HaltChainable");class l{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:a),this}reduce(e,t){let i=t;return this.steps.push(t=>(i=e(i,t),i)),this}latch(e=((e,t)=>e===t)){let t,i=!0;return this.steps.push(n=>{const s=i||!e(n,t);return i=!1,t=n,s?n:a}),this}evaluate(e){for(const t of this.steps)if((e=t(e))===a)break;return e}}e.fromNodeEventEmitter=function(e,t,i=(e=>e)){const n=(...e)=>s.fire(i(...e)),s=new ft({onWillAddFirstListener:()=>e.on(t,n),onDidRemoveLastListener:()=>e.removeListener(t,n)});return s.event},e.fromDOMEventEmitter=function(e,t,i=(e=>e)){const n=(...e)=>s.fire(i(...e)),s=new ft({onWillAddFirstListener:()=>e.addEventListener(t,n),onDidRemoveLastListener:()=>e.removeEventListener(t,n)});return s.event},e.toPromise=function(e){return new Promise(t=>i(e)(t))},e.fromPromise=function(e){const t=new ft;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event},e.runAndSubscribe=function(e,t,i){return t(i),e(e=>t(e))};class h{constructor(e,i){this._observable=e,this._counter=0,this._hasChanged=!1;const n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};i||t(),this.emitter=new ft(n),i&&i.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,0===this._counter&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}e.fromObservable=function(e,t){return new h(e,t).emitter.event},e.fromObservableLight=function(e){return(t,i,n)=>{let s=0,o=!1;const r={beginUpdate(){s++},endUpdate(){s--,0===s&&(e.reportChanges(),o&&(o=!1,t.call(i)))},handlePossibleChange(){},handleChange(){o=!0}};e.addObserver(r),e.reportChanges();const a={dispose(){e.removeObserver(r)}};return n instanceof nt?n.add(a):Array.isArray(n)&&n.push(a),a}}}(dt||(dt={}));class ct{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${ct._idPool++}`,ct.all.add(this)}start(e){this._stopWatch=new ht,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}ct.all=new Set,ct._idPool=0;class ut{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;null===(e=this._stacks)||void 0===e||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);const n=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,n+1),this._warnCountdown-=1,this._warnCountdown<=0){let e;this._warnCountdown=.5*i;let n=0;for(const[t,i]of this._stacks)(!e||n<i)&&(e=t,n=i);console.warn(`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${n}):`),console.warn(e)}return()=>{const t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}}class gt{static create(){var e;return new gt(null!==(e=(new Error).stack)&&void 0!==e?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class mt{constructor(e){this.value=e}}class ft{constructor(e){var t,i,n,s,o;this._size=0,this._options=e,this._leakageMon=(null===(t=this._options)||void 0===t?void 0:t.leakWarningThreshold)?new ut(null!==(n=null===(i=this._options)||void 0===i?void 0:i.leakWarningThreshold)&&void 0!==n?n:-1):void 0,this._perfMon=(null===(s=this._options)||void 0===s?void 0:s._profName)?new ct(this._options._profName):void 0,this._deliveryQueue=null===(o=this._options)||void 0===o?void 0:o.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,(null===(e=this._deliveryQueue)||void 0===e?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),null===(i=null===(t=this._options)||void 0===t?void 0:t.onDidRemoveLastListener)||void 0===i||i.call(t),null===(n=this._leakageMon)||void 0===n||n.dispose())}get event(){var e;return null!==(e=this._event)&&void 0!==e||(this._event=(e,t,i)=>{var n,s,o,r,a;if(this._leakageMon&&this._size>3*this._leakageMon.threshold)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),st.None;if(this._disposed)return st.None;t&&(e=e.bind(t));const l=new mt(e);let h;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(l.stack=gt.create(),h=this._leakageMon.check(l.stack,this._size+1)),this._listeners?this._listeners instanceof mt?(null!==(a=this._deliveryQueue)&&void 0!==a||(this._deliveryQueue=new pt),this._listeners=[this._listeners,l]):this._listeners.push(l):(null===(s=null===(n=this._options)||void 0===n?void 0:n.onWillAddFirstListener)||void 0===s||s.call(n,this),this._listeners=l,null===(r=null===(o=this._options)||void 0===o?void 0:o.onDidAddFirstListener)||void 0===r||r.call(o,this)),this._size++;const d=it(()=>{null==h||h(),this._removeListener(l)});return i instanceof nt?i.add(d):Array.isArray(i)&&i.push(d),d}),this._event}_removeListener(e){var t,i,n,s;if(null===(i=null===(t=this._options)||void 0===t?void 0:t.onWillRemoveListener)||void 0===i||i.call(t,this),!this._listeners)return;if(1===this._size)return this._listeners=void 0,null===(s=null===(n=this._options)||void 0===n?void 0:n.onDidRemoveLastListener)||void 0===s||s.call(n,this),void(this._size=0);const o=this._listeners,r=o.indexOf(e);if(-1===r)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,o[r]=void 0;const a=this._deliveryQueue.current===this;if(2*this._size<=o.length){let e=0;for(let t=0;t<o.length;t++)o[t]?o[e++]=o[t]:a&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);o.length=e}}_deliver(e,t){var i;if(!e)return;const n=(null===(i=this._options)||void 0===i?void 0:i.onListenerError)||Be;if(n)try{e.value(t)}catch(e){n(e)}else e.value(t)}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,i,n,s;if((null===(t=this._deliveryQueue)||void 0===t?void 0:t.current)&&(this._deliverQueue(this._deliveryQueue),null===(i=this._perfMon)||void 0===i||i.stop()),null===(n=this._perfMon)||void 0===n||n.start(this._size),this._listeners)if(this._listeners instanceof mt)this._deliver(this._listeners,e);else{const t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}else;null===(s=this._perfMon)||void 0===s||s.stop()}hasListeners(){return this._size>0}}class pt{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class _t extends ft{constructor(e){super(e),this._isPaused=0,this._eventQueue=new $,this._mergeFn=null==e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class vt extends _t{constructor(e){var t;super(e),this._delay=null!==(t=e.delay)&&void 0!==t?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class bt extends ft{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=null==e?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),1===this._queuedEvents.length&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(e=>super.fire(e)),this._queuedEvents=[]}))}}class Ct{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new ft({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};this.events.push(t),this.hasListeners&&this.hook(t);return it(Ge(()=>{this.hasListeners&&this.unhook(t);const e=this.events.indexOf(t);this.events.splice(e,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(e=>this.emitter.fire(e))}unhook(e){var t;null===(t=e.listener)||void 0===t||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)null===(e=t.listener)||void 0===e||e.dispose();this.events=[]}}class wt{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e(e=>{const n=this.buffers[this.buffers.length-1];n?n.push(()=>t.call(i,e)):t.call(i,e)},void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(e=>e()),i}}class yt{constructor(){this.listening=!1,this.inputEvent=dt.None,this.inputEventListener=st.None,this.emitter=new ft({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const St=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var Lt,kt;(kt=Lt||(Lt={})).isCancellationToken=function(e){return e===kt.None||e===kt.Cancelled||e instanceof Dt||!(!e||"object"!=typeof e)&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},kt.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:dt.None}),kt.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:St});class Dt{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?St:(this._emitter||(this._emitter=new ft),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class xt{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Dt),this._token}cancel(){this._token?this._token instanceof Dt&&this._token.cancel():this._token=Lt.Cancelled}dispose(e=!1){var t;e&&this.cancel(),null===(t=this._parentListener)||void 0===t||t.dispose(),this._token?this._token instanceof Dt&&this._token.dispose():this._token=Lt.None}}class Et{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()]||0}}const Nt=new Et,It=new Et,Tt=new Et,Mt=new Array(230),At={},Ot=[],Rt=Object.create(null),Pt=Object.create(null),Ft=[],Bt=[];for(let e=0;e<=193;e++)Ft[e]=-1;for(let e=0;e<=132;e++)Bt[e]=-1;var Wt;!function(){const e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN","",""],[1,1,"Hyper",0,"",0,"","",""],[1,2,"Super",0,"",0,"","",""],[1,3,"Fn",0,"",0,"","",""],[1,4,"FnLock",0,"",0,"","",""],[1,5,"Suspend",0,"",0,"","",""],[1,6,"Resume",0,"",0,"","",""],[1,7,"Turbo",0,"",0,"","",""],[1,8,"Sleep",0,"",0,"VK_SLEEP","",""],[1,9,"WakeUp",0,"",0,"","",""],[0,10,"KeyA",31,"A",65,"VK_A","",""],[0,11,"KeyB",32,"B",66,"VK_B","",""],[0,12,"KeyC",33,"C",67,"VK_C","",""],[0,13,"KeyD",34,"D",68,"VK_D","",""],[0,14,"KeyE",35,"E",69,"VK_E","",""],[0,15,"KeyF",36,"F",70,"VK_F","",""],[0,16,"KeyG",37,"G",71,"VK_G","",""],[0,17,"KeyH",38,"H",72,"VK_H","",""],[0,18,"KeyI",39,"I",73,"VK_I","",""],[0,19,"KeyJ",40,"J",74,"VK_J","",""],[0,20,"KeyK",41,"K",75,"VK_K","",""],[0,21,"KeyL",42,"L",76,"VK_L","",""],[0,22,"KeyM",43,"M",77,"VK_M","",""],[0,23,"KeyN",44,"N",78,"VK_N","",""],[0,24,"KeyO",45,"O",79,"VK_O","",""],[0,25,"KeyP",46,"P",80,"VK_P","",""],[0,26,"KeyQ",47,"Q",81,"VK_Q","",""],[0,27,"KeyR",48,"R",82,"VK_R","",""],[0,28,"KeyS",49,"S",83,"VK_S","",""],[0,29,"KeyT",50,"T",84,"VK_T","",""],[0,30,"KeyU",51,"U",85,"VK_U","",""],[0,31,"KeyV",52,"V",86,"VK_V","",""],[0,32,"KeyW",53,"W",87,"VK_W","",""],[0,33,"KeyX",54,"X",88,"VK_X","",""],[0,34,"KeyY",55,"Y",89,"VK_Y","",""],[0,35,"KeyZ",56,"Z",90,"VK_Z","",""],[0,36,"Digit1",22,"1",49,"VK_1","",""],[0,37,"Digit2",23,"2",50,"VK_2","",""],[0,38,"Digit3",24,"3",51,"VK_3","",""],[0,39,"Digit4",25,"4",52,"VK_4","",""],[0,40,"Digit5",26,"5",53,"VK_5","",""],[0,41,"Digit6",27,"6",54,"VK_6","",""],[0,42,"Digit7",28,"7",55,"VK_7","",""],[0,43,"Digit8",29,"8",56,"VK_8","",""],[0,44,"Digit9",30,"9",57,"VK_9","",""],[0,45,"Digit0",21,"0",48,"VK_0","",""],[1,46,"Enter",3,"Enter",13,"VK_RETURN","",""],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE","",""],[1,48,"Backspace",1,"Backspace",8,"VK_BACK","",""],[1,49,"Tab",2,"Tab",9,"VK_TAB","",""],[1,50,"Space",10,"Space",32,"VK_SPACE","",""],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,"",0,"","",""],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL","",""],[1,64,"F1",59,"F1",112,"VK_F1","",""],[1,65,"F2",60,"F2",113,"VK_F2","",""],[1,66,"F3",61,"F3",114,"VK_F3","",""],[1,67,"F4",62,"F4",115,"VK_F4","",""],[1,68,"F5",63,"F5",116,"VK_F5","",""],[1,69,"F6",64,"F6",117,"VK_F6","",""],[1,70,"F7",65,"F7",118,"VK_F7","",""],[1,71,"F8",66,"F8",119,"VK_F8","",""],[1,72,"F9",67,"F9",120,"VK_F9","",""],[1,73,"F10",68,"F10",121,"VK_F10","",""],[1,74,"F11",69,"F11",122,"VK_F11","",""],[1,75,"F12",70,"F12",123,"VK_F12","",""],[1,76,"PrintScreen",0,"",0,"","",""],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL","",""],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE","",""],[1,79,"Insert",19,"Insert",45,"VK_INSERT","",""],[1,80,"Home",14,"Home",36,"VK_HOME","",""],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR","",""],[1,82,"Delete",20,"Delete",46,"VK_DELETE","",""],[1,83,"End",13,"End",35,"VK_END","",""],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT","",""],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",""],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",""],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",""],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",""],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK","",""],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD","",""],[1,94,"NumpadEnter",3,"",0,"","",""],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1","",""],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2","",""],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3","",""],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4","",""],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5","",""],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6","",""],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7","",""],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8","",""],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9","",""],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0","",""],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102","",""],[1,107,"ContextMenu",58,"ContextMenu",93,"","",""],[1,108,"Power",0,"",0,"","",""],[1,109,"NumpadEqual",0,"",0,"","",""],[1,110,"F13",71,"F13",124,"VK_F13","",""],[1,111,"F14",72,"F14",125,"VK_F14","",""],[1,112,"F15",73,"F15",126,"VK_F15","",""],[1,113,"F16",74,"F16",127,"VK_F16","",""],[1,114,"F17",75,"F17",128,"VK_F17","",""],[1,115,"F18",76,"F18",129,"VK_F18","",""],[1,116,"F19",77,"F19",130,"VK_F19","",""],[1,117,"F20",78,"F20",131,"VK_F20","",""],[1,118,"F21",79,"F21",132,"VK_F21","",""],[1,119,"F22",80,"F22",133,"VK_F22","",""],[1,120,"F23",81,"F23",134,"VK_F23","",""],[1,121,"F24",82,"F24",135,"VK_F24","",""],[1,122,"Open",0,"",0,"","",""],[1,123,"Help",0,"",0,"","",""],[1,124,"Select",0,"",0,"","",""],[1,125,"Again",0,"",0,"","",""],[1,126,"Undo",0,"",0,"","",""],[1,127,"Cut",0,"",0,"","",""],[1,128,"Copy",0,"",0,"","",""],[1,129,"Paste",0,"",0,"","",""],[1,130,"Find",0,"",0,"","",""],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,136,"KanaMode",0,"",0,"","",""],[0,137,"IntlYen",0,"",0,"","",""],[1,138,"Convert",0,"",0,"","",""],[1,139,"NonConvert",0,"",0,"","",""],[1,140,"Lang1",0,"",0,"","",""],[1,141,"Lang2",0,"",0,"","",""],[1,142,"Lang3",0,"",0,"","",""],[1,143,"Lang4",0,"",0,"","",""],[1,144,"Lang5",0,"",0,"","",""],[1,145,"Abort",0,"",0,"","",""],[1,146,"Props",0,"",0,"","",""],[1,147,"NumpadParenLeft",0,"",0,"","",""],[1,148,"NumpadParenRight",0,"",0,"","",""],[1,149,"NumpadBackspace",0,"",0,"","",""],[1,150,"NumpadMemoryStore",0,"",0,"","",""],[1,151,"NumpadMemoryRecall",0,"",0,"","",""],[1,152,"NumpadMemoryClear",0,"",0,"","",""],[1,153,"NumpadMemoryAdd",0,"",0,"","",""],[1,154,"NumpadMemorySubtract",0,"",0,"","",""],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR","",""],[1,156,"NumpadClearEntry",0,"",0,"","",""],[1,0,"",5,"Ctrl",17,"VK_CONTROL","",""],[1,0,"",4,"Shift",16,"VK_SHIFT","",""],[1,0,"",6,"Alt",18,"VK_MENU","",""],[1,0,"",57,"Meta",91,"VK_COMMAND","",""],[1,157,"ControlLeft",5,"",0,"VK_LCONTROL","",""],[1,158,"ShiftLeft",4,"",0,"VK_LSHIFT","",""],[1,159,"AltLeft",6,"",0,"VK_LMENU","",""],[1,160,"MetaLeft",57,"",0,"VK_LWIN","",""],[1,161,"ControlRight",5,"",0,"VK_RCONTROL","",""],[1,162,"ShiftRight",4,"",0,"VK_RSHIFT","",""],[1,163,"AltRight",6,"",0,"VK_RMENU","",""],[1,164,"MetaRight",57,"",0,"VK_RWIN","",""],[1,165,"BrightnessUp",0,"",0,"","",""],[1,166,"BrightnessDown",0,"",0,"","",""],[1,167,"MediaPlay",0,"",0,"","",""],[1,168,"MediaRecord",0,"",0,"","",""],[1,169,"MediaFastForward",0,"",0,"","",""],[1,170,"MediaRewind",0,"",0,"","",""],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,174,"Eject",0,"",0,"","",""],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,179,"LaunchApp1",0,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,180,"SelectTask",0,"",0,"","",""],[1,181,"LaunchScreenSaver",0,"",0,"","",""],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,186,"BrowserStop",0,"",0,"VK_BROWSER_STOP","",""],[1,187,"BrowserRefresh",0,"",0,"VK_BROWSER_REFRESH","",""],[1,188,"BrowserFavorites",0,"",0,"VK_BROWSER_FAVORITES","",""],[1,189,"ZoomToggle",0,"",0,"","",""],[1,190,"MailReply",0,"",0,"","",""],[1,191,"MailForward",0,"",0,"","",""],[1,192,"MailSend",0,"",0,"","",""],[1,0,"",114,"KeyInComposition",229,"","",""],[1,0,"",116,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,0,"",96,"OEM_8",223,"VK_OEM_8","",""],[1,0,"",0,"",0,"VK_KANA","",""],[1,0,"",0,"",0,"VK_HANGUL","",""],[1,0,"",0,"",0,"VK_JUNJA","",""],[1,0,"",0,"",0,"VK_FINAL","",""],[1,0,"",0,"",0,"VK_HANJA","",""],[1,0,"",0,"",0,"VK_KANJI","",""],[1,0,"",0,"",0,"VK_CONVERT","",""],[1,0,"",0,"",0,"VK_NONCONVERT","",""],[1,0,"",0,"",0,"VK_ACCEPT","",""],[1,0,"",0,"",0,"VK_MODECHANGE","",""],[1,0,"",0,"",0,"VK_SELECT","",""],[1,0,"",0,"",0,"VK_PRINT","",""],[1,0,"",0,"",0,"VK_EXECUTE","",""],[1,0,"",0,"",0,"VK_SNAPSHOT","",""],[1,0,"",0,"",0,"VK_HELP","",""],[1,0,"",0,"",0,"VK_APPS","",""],[1,0,"",0,"",0,"VK_PROCESSKEY","",""],[1,0,"",0,"",0,"VK_PACKET","",""],[1,0,"",0,"",0,"VK_DBE_SBCSCHAR","",""],[1,0,"",0,"",0,"VK_DBE_DBCSCHAR","",""],[1,0,"",0,"",0,"VK_ATTN","",""],[1,0,"",0,"",0,"VK_CRSEL","",""],[1,0,"",0,"",0,"VK_EXSEL","",""],[1,0,"",0,"",0,"VK_EREOF","",""],[1,0,"",0,"",0,"VK_PLAY","",""],[1,0,"",0,"",0,"VK_ZOOM","",""],[1,0,"",0,"",0,"VK_NONAME","",""],[1,0,"",0,"",0,"VK_PA1","",""],[1,0,"",0,"",0,"VK_OEM_CLEAR","",""]],t=[],i=[];for(const n of e){const[e,s,o,r,a,l,h,d,c]=n;if(i[s]||(i[s]=!0,Ot[s]=o,Rt[o]=s,Pt[o.toLowerCase()]=s,e&&(Ft[s]=r,0!==r&&3!==r&&5!==r&&4!==r&&6!==r&&57!==r&&(Bt[r]=s))),!t[r]){if(t[r]=!0,!a)throw new Error(`String representation missing for key code ${r} around scan code ${o}`);Nt.define(r,a),It.define(r,d||a),Tt.define(r,c||d||a)}l&&(Mt[l]=r),h&&(At[h]=r)}Bt[3]=46}(),function(e){e.toString=function(e){return Nt.keyCodeToStr(e)},e.fromString=function(e){return Nt.strToKeyCode(e)},e.toUserSettingsUS=function(e){return It.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return Tt.keyCodeToStr(e)},e.fromUserSettings=function(e){return It.strToKeyCode(e)||Tt.strToKeyCode(e)},e.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Nt.keyCodeToStr(e)}}(Wt||(Wt={}));var Vt=i("Rcjm");class Ht extends Error{constructor(e,t,i){let n;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";const s=-1!==e.indexOf(".")?"property":"argument";let o=`The "${e}" ${s} ${n} of type ${t}`;o+=". Received type "+typeof i,super(o),this.code="ERR_INVALID_ARG_TYPE"}}function zt(e,t){if("string"!=typeof e)throw new Ht(t,"string",e)}const Kt="win32"===Vt.c;function Ut(e){return 47===e||92===e}function jt(e){return 47===e}function qt(e){return e>=65&&e<=90||e>=97&&e<=122}function $t(e,t,i,n){let s="",o=0,r=-1,a=0,l=0;for(let h=0;h<=e.length;++h){if(h<e.length)l=e.charCodeAt(h);else{if(n(l))break;l=47}if(n(l)){if(r===h-1||1===a);else if(2===a){if(s.length<2||2!==o||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){const e=s.lastIndexOf(i);-1===e?(s="",o=0):(s=s.slice(0,e),o=s.length-1-s.lastIndexOf(i)),r=h,a=0;continue}if(0!==s.length){s="",o=0,r=h,a=0;continue}}t&&(s+=s.length>0?i+"..":"..",o=2)}else s.length>0?s+=`${i}${e.slice(r+1,h)}`:s=e.slice(r+1,h),o=h-r-1;r=h,a=0}else 46===l&&-1!==a?++a:a=-1}return s}function Gt(e,t){!function(e,t){if(null===e||"object"!=typeof e)throw new Ht(t,"Object",e)}(t,"pathObject");const i=t.dir||t.root,n=t.base||`${t.name||""}${t.ext||""}`;return i?i===t.root?`${i}${n}`:`${i}${e}${n}`:n}const Zt={resolve(...e){let t="",i="",n=!1;for(let s=e.length-1;s>=-1;s--){let o;if(s>=0){if(o=e[s],zt(o,"path"),0===o.length)continue}else 0===t.length?o=Vt.a():(o=Vt.b["="+t]||Vt.a(),(void 0===o||o.slice(0,2).toLowerCase()!==t.toLowerCase()&&92===o.charCodeAt(2))&&(o=t+"\\"));const r=o.length;let a=0,l="",h=!1;const d=o.charCodeAt(0);if(1===r)Ut(d)&&(a=1,h=!0);else if(Ut(d))if(h=!0,Ut(o.charCodeAt(1))){let e=2,t=e;for(;e<r&&!Ut(o.charCodeAt(e));)e++;if(e<r&&e!==t){const i=o.slice(t,e);for(t=e;e<r&&Ut(o.charCodeAt(e));)e++;if(e<r&&e!==t){for(t=e;e<r&&!Ut(o.charCodeAt(e));)e++;e!==r&&e===t||(l=`\\\\${i}\\${o.slice(t,e)}`,a=e)}}}else a=1;else qt(d)&&58===o.charCodeAt(1)&&(l=o.slice(0,2),a=2,r>2&&Ut(o.charCodeAt(2))&&(h=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(i=`${o.slice(a)}\\${i}`,n=h,h&&t.length>0)break}return i=$t(i,!n,"\\",Ut),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){zt(e,"path");const t=e.length;if(0===t)return".";let i,n=0,s=!1;const o=e.charCodeAt(0);if(1===t)return jt(o)?"\\":e;if(Ut(o))if(s=!0,Ut(e.charCodeAt(1))){let s=2,o=s;for(;s<t&&!Ut(e.charCodeAt(s));)s++;if(s<t&&s!==o){const r=e.slice(o,s);for(o=s;s<t&&Ut(e.charCodeAt(s));)s++;if(s<t&&s!==o){for(o=s;s<t&&!Ut(e.charCodeAt(s));)s++;if(s===t)return`\\\\${r}\\${e.slice(o)}\\`;s!==o&&(i=`\\\\${r}\\${e.slice(o,s)}`,n=s)}}}else n=1;else qt(o)&&58===e.charCodeAt(1)&&(i=e.slice(0,2),n=2,t>2&&Ut(e.charCodeAt(2))&&(s=!0,n=3));let r=n<t?$t(e.slice(n),!s,"\\",Ut):"";return 0!==r.length||s||(r="."),r.length>0&&Ut(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?s?"\\"+r:r:s?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){zt(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return Ut(i)||t>2&&qt(i)&&58===e.charCodeAt(1)&&Ut(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let n=0;n<e.length;++n){const s=e[n];zt(s,"path"),s.length>0&&(void 0===t?t=i=s:t+="\\"+s)}if(void 0===t)return".";let n=!0,s=0;if("string"==typeof i&&Ut(i.charCodeAt(0))){++s;const e=i.length;e>1&&Ut(i.charCodeAt(1))&&(++s,e>2&&(Ut(i.charCodeAt(2))?++s:n=!1))}if(n){for(;s<t.length&&Ut(t.charCodeAt(s));)s++;s>=2&&(t="\\"+t.slice(s))}return Zt.normalize(t)},relative(e,t){if(zt(e,"from"),zt(t,"to"),e===t)return"";const i=Zt.resolve(e),n=Zt.resolve(t);if(i===n)return"";if((e=i.toLowerCase())===(t=n.toLowerCase()))return"";let s=0;for(;s<e.length&&92===e.charCodeAt(s);)s++;let o=e.length;for(;o-1>s&&92===e.charCodeAt(o-1);)o--;const r=o-s;let a=0;for(;a<t.length&&92===t.charCodeAt(a);)a++;let l=t.length;for(;l-1>a&&92===t.charCodeAt(l-1);)l--;const h=l-a,d=r<h?r:h;let c=-1,u=0;for(;u<d;u++){const i=e.charCodeAt(s+u);if(i!==t.charCodeAt(a+u))break;92===i&&(c=u)}if(u!==d){if(-1===c)return n}else{if(h>d){if(92===t.charCodeAt(a+u))return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>d&&(92===e.charCodeAt(s+u)?c=u:2===u&&(c=3)),-1===c&&(c=0)}let g="";for(u=s+c+1;u<=o;++u)u!==o&&92!==e.charCodeAt(u)||(g+=0===g.length?"..":"\\..");return a+=c,g.length>0?`${g}${n.slice(a,l)}`:(92===n.charCodeAt(a)&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e||0===e.length)return e;const t=Zt.resolve(e);if(t.length<=2)return e;if(92===t.charCodeAt(0)){if(92===t.charCodeAt(1)){const e=t.charCodeAt(2);if(63!==e&&46!==e)return"\\\\?\\UNC\\"+t.slice(2)}}else if(qt(t.charCodeAt(0))&&58===t.charCodeAt(1)&&92===t.charCodeAt(2))return"\\\\?\\"+t;return e},dirname(e){zt(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const s=e.charCodeAt(0);if(1===t)return Ut(s)?e:".";if(Ut(s)){if(i=n=1,Ut(e.charCodeAt(1))){let s=2,o=s;for(;s<t&&!Ut(e.charCodeAt(s));)s++;if(s<t&&s!==o){for(o=s;s<t&&Ut(e.charCodeAt(s));)s++;if(s<t&&s!==o){for(o=s;s<t&&!Ut(e.charCodeAt(s));)s++;if(s===t)return e;s!==o&&(i=n=s+1)}}}}else qt(s)&&58===e.charCodeAt(1)&&(i=t>2&&Ut(e.charCodeAt(2))?3:2,n=i);let o=-1,r=!0;for(let i=t-1;i>=n;--i)if(Ut(e.charCodeAt(i))){if(!r){o=i;break}}else r=!1;if(-1===o){if(-1===i)return".";o=i}return e.slice(0,o)},basename(e,t){void 0!==t&&zt(t,"ext"),zt(e,"path");let i,n=0,s=-1,o=!0;if(e.length>=2&&qt(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){const l=e.charCodeAt(i);if(Ut(l)){if(!o){n=i+1;break}}else-1===a&&(o=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(s=i):(r=-1,s=a))}return n===s?s=a:-1===s&&(s=e.length),e.slice(n,s)}for(i=e.length-1;i>=n;--i)if(Ut(e.charCodeAt(i))){if(!o){n=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":e.slice(n,s)},extname(e){zt(e,"path");let t=0,i=-1,n=0,s=-1,o=!0,r=0;e.length>=2&&58===e.charCodeAt(1)&&qt(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(Ut(t)){if(!o){n=a+1;break}}else-1===s&&(o=!1,s=a+1),46===t?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===s||0===r||1===r&&i===s-1&&i===n+1?"":e.slice(i,s)},format:Gt.bind(null,"\\"),parse(e){zt(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,s=e.charCodeAt(0);if(1===i)return Ut(s)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(Ut(s)){if(n=1,Ut(e.charCodeAt(1))){let t=2,s=t;for(;t<i&&!Ut(e.charCodeAt(t));)t++;if(t<i&&t!==s){for(s=t;t<i&&Ut(e.charCodeAt(t));)t++;if(t<i&&t!==s){for(s=t;t<i&&!Ut(e.charCodeAt(t));)t++;t===i?n=t:t!==s&&(n=t+1)}}}}else if(qt(s)&&58===e.charCodeAt(1)){if(i<=2)return t.root=t.dir=e,t;if(n=2,Ut(e.charCodeAt(2))){if(3===i)return t.root=t.dir=e,t;n=3}}n>0&&(t.root=e.slice(0,n));let o=-1,r=n,a=-1,l=!0,h=e.length-1,d=0;for(;h>=n;--h)if(s=e.charCodeAt(h),Ut(s)){if(!l){r=h+1;break}}else-1===a&&(l=!1,a=h+1),46===s?-1===o?o=h:1!==d&&(d=1):-1!==o&&(d=-1);return-1!==a&&(-1===o||0===d||1===d&&o===a-1&&o===r+1?t.base=t.name=e.slice(r,a):(t.name=e.slice(r,o),t.base=e.slice(r,a),t.ext=e.slice(o,a))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},Yt=(()=>{if(Kt){const e=/\\/g;return()=>{const t=Vt.a().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>Vt.a()})(),Qt={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=-1&&!i;n--){const s=n>=0?e[n]:Yt();zt(s,"path"),0!==s.length&&(t=`${s}/${t}`,i=47===s.charCodeAt(0))}return t=$t(t,!i,"/",jt),i?"/"+t:t.length>0?t:"."},normalize(e){if(zt(e,"path"),0===e.length)return".";const t=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0===(e=$t(e,!t,"/",jt)).length?t?"/":i?"./":".":(i&&(e+="/"),t?"/"+e:e)},isAbsolute:e=>(zt(e,"path"),e.length>0&&47===e.charCodeAt(0)),join(...e){if(0===e.length)return".";let t;for(let i=0;i<e.length;++i){const n=e[i];zt(n,"path"),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":Qt.normalize(t)},relative(e,t){if(zt(e,"from"),zt(t,"to"),e===t)return"";if((e=Qt.resolve(e))===(t=Qt.resolve(t)))return"";const i=e.length,n=i-1,s=t.length-1,o=n<s?n:s;let r=-1,a=0;for(;a<o;a++){const i=e.charCodeAt(1+a);if(i!==t.charCodeAt(1+a))break;47===i&&(r=a)}if(a===o)if(s>o){if(47===t.charCodeAt(1+a))return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>o&&(47===e.charCodeAt(1+a)?r=a:0===a&&(r=0));let l="";for(a=1+r+1;a<=i;++a)a!==i&&47!==e.charCodeAt(a)||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+r)}`},toNamespacedPath:e=>e,dirname(e){if(zt(e,"path"),0===e.length)return".";const t=47===e.charCodeAt(0);let i=-1,n=!0;for(let t=e.length-1;t>=1;--t)if(47===e.charCodeAt(t)){if(!n){i=t;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&zt(t,"ext"),zt(e,"path");let i,n=0,s=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const l=e.charCodeAt(i);if(47===l){if(!o){n=i+1;break}}else-1===a&&(o=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(s=i):(r=-1,s=a))}return n===s?s=a:-1===s&&(s=e.length),e.slice(n,s)}for(i=e.length-1;i>=0;--i)if(47===e.charCodeAt(i)){if(!o){n=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":e.slice(n,s)},extname(e){zt(e,"path");let t=-1,i=0,n=-1,s=!0,o=0;for(let r=e.length-1;r>=0;--r){const a=e.charCodeAt(r);if(47!==a)-1===n&&(s=!1,n=r+1),46===a?-1===t?t=r:1!==o&&(o=1):-1!==t&&(o=-1);else if(!s){i=r+1;break}}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===i+1?"":e.slice(t,n)},format:Gt.bind(null,"/"),parse(e){zt(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=47===e.charCodeAt(0);let n;i?(t.root="/",n=1):n=0;let s=-1,o=0,r=-1,a=!0,l=e.length-1,h=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(47!==t)-1===r&&(a=!1,r=l+1),46===t?-1===s?s=l:1!==h&&(h=1):-1!==s&&(h=-1);else if(!a){o=l+1;break}}if(-1!==r){const n=0===o&&i?1:o;-1===s||0===h||1===h&&s===r-1&&s===o+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,s),t.base=e.slice(n,r),t.ext=e.slice(s,r))}return o>0?t.dir=e.slice(0,o-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};Qt.win32=Zt.win32=Zt,Qt.posix=Zt.posix=Qt;const Xt=Kt?Zt.normalize:Qt.normalize,Jt=Kt?Zt.resolve:Qt.resolve,ei=Kt?Zt.relative:Qt.relative,ti=Kt?Zt.dirname:Qt.dirname,ii=Kt?Zt.basename:Qt.basename,ni=Kt?Zt.extname:Qt.extname,si=Kt?Zt.sep:Qt.sep,oi=/^\w[\w\d+.-]*$/,ri=/^\//,ai=/^\/\//;const li="/",hi=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class di{static isUri(e){return e instanceof di||!!e&&("string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString)}constructor(e,t,i,n,s,o=!1){"object"==typeof e?(this.scheme=e.scheme||"",this.authority=e.authority||"",this.path=e.path||"",this.query=e.query||"",this.fragment=e.fragment||""):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||"",this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==li&&(t=li+t):t=li}return t}(this.scheme,i||""),this.query=n||"",this.fragment=s||"",function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!oi.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!ri.test(e.path))throw new 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(ai.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,o))}get fsPath(){return pi(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:s,fragment:o}=e;return void 0===t?t=this.scheme:null===t&&(t=""),void 0===i?i=this.authority:null===i&&(i=""),void 0===n?n=this.path:null===n&&(n=""),void 0===s?s=this.query:null===s&&(s=""),void 0===o?o=this.fragment:null===o&&(o=""),t===this.scheme&&i===this.authority&&n===this.path&&s===this.query&&o===this.fragment?this:new ui(t,i,n,s,o)}static parse(e,t=!1){const i=hi.exec(e);return i?new ui(i[2]||"",bi(i[4]||""),bi(i[5]||""),bi(i[7]||""),bi(i[9]||""),t):new ui("","","","","")}static file(e){let t="";if(K.n&&(e=e.replace(/\\/g,li)),e[0]===li&&e[1]===li){const i=e.indexOf(li,2);-1===i?(t=e.substring(2),e=li):(t=e.substring(2,i),e=e.substring(i)||li)}return new ui("file",t,e,"","")}static from(e,t){return new ui(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return i=K.n&&"file"===e.scheme?di.file(Zt.join(pi(e,!0),...t)).path:Qt.join(e.path,...t),e.with({path:i})}toString(e=!1){return _i(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof di)return e;{const n=new ui(e);return n._formatted=null!==(t=e.external)&&void 0!==t?t:null,n._fsPath=e._sep===ci&&null!==(i=e.fsPath)&&void 0!==i?i:null,n}}return e}}const ci=K.n?1:void 0;class ui extends di{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=pi(this,!1)),this._fsPath}toString(e=!1){return e?_i(this,!0):(this._formatted||(this._formatted=_i(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=ci),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 gi={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function mi(e,t,i){let n=void 0,s=-1;for(let o=0;o<e.length;o++){const r=e.charCodeAt(o);if(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r||i&&91===r||i&&93===r||i&&58===r)-1!==s&&(n+=encodeURIComponent(e.substring(s,o)),s=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));const t=gi[r];void 0!==t?(-1!==s&&(n+=encodeURIComponent(e.substring(s,o)),s=-1),n+=t):-1===s&&(s=o)}}return-1!==s&&(n+=encodeURIComponent(e.substring(s))),void 0!==n?n:e}function fi(e){let t=void 0;for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);35===n||63===n?(void 0===t&&(t=e.substr(0,i)),t+=gi[n]):void 0!==t&&(t+=e[i])}return void 0!==t?t:e}function pi(e,t){let i;return i=e.authority&&e.path.length>1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,K.n&&(i=i.replace(/\//g,"\\")),i}function _i(e,t){const i=t?fi:mi;let n="",{scheme:s,authority:o,path:r,query:a,fragment:l}=e;if(s&&(n+=s,n+=":"),(o||"file"===s)&&(n+=li,n+=li),o){let e=o.indexOf("@");if(-1!==e){const t=o.substr(0,e);o=o.substr(e+1),e=t.lastIndexOf(":"),-1===e?n+=i(t,!1,!1):(n+=i(t.substr(0,e),!1,!1),n+=":",n+=i(t.substr(e+1),!1,!0)),n+="@"}o=o.toLowerCase(),e=o.lastIndexOf(":"),-1===e?n+=i(o,!1,!0):(n+=i(o.substr(0,e),!1,!0),n+=o.substr(e))}if(r){if(r.length>=3&&47===r.charCodeAt(0)&&58===r.charCodeAt(2)){const e=r.charCodeAt(1);e>=65&&e<=90&&(r=`/${String.fromCharCode(e+32)}:${r.substr(3)}`)}else if(r.length>=2&&58===r.charCodeAt(1)){const e=r.charCodeAt(0);e>=65&&e<=90&&(r=`${String.fromCharCode(e+32)}:${r.substr(2)}`)}n+=i(r,!0,!1)}return a&&(n+="?",n+=i(a,!1,!1)),l&&(n+="#",n+=t?l:mi(l,!1,!1)),n}const vi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function bi(e){return e.match(vi)?e.replace(vi,e=>function e(t){try{return decodeURIComponent(t)}catch(i){return t.length>3?t.substr(0,3)+e(t.substr(3)):t}}(e)):e}class Ci{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Ci(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Ci.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Ci.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column}isBeforeOrEqual(e){return Ci.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column}static compare(e,t){const i=0|e.lineNumber,n=0|t.lineNumber;if(i===n){return(0|e.column)-(0|t.column)}return i-n}clone(){return new Ci(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new Ci(e.lineNumber,e.column)}static isIPosition(e){return e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}}class wi{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return wi.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return wi.containsPosition(this,e)}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(e){return wi.containsRange(this,e)}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(e){return wi.strictContainsRange(this,e)}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(e){return wi.plusRange(this,e)}static plusRange(e,t){let i,n,s,o;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,n=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,n=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,n=e.startColumn),t.endLineNumber>e.endLineNumber?(s=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(s=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(s=e.endLineNumber,o=e.endColumn),new wi(i,n,s,o)}intersectRanges(e){return wi.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn;const r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,h=t.endColumn;return i<r?(i=r,n=a):i===r&&(n=Math.max(n,a)),s>l?(s=l,o=h):s===l&&(o=Math.min(o,h)),i>s||i===s&&n>o?null:new wi(i,n,s,o)}equalsRange(e){return wi.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return wi.getEndPosition(this)}static getEndPosition(e){return new Ci(e.endLineNumber,e.endColumn)}getStartPosition(){return wi.getStartPosition(this)}static getStartPosition(e){return new Ci(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new wi(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new wi(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return wi.collapseToStart(this)}static collapseToStart(e){return new wi(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return wi.collapseToEnd(this)}static collapseToEnd(e){return new wi(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new wi(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new wi(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new wi(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}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 compareRangesUsingStarts(e,t){if(e&&t){const i=0|e.startLineNumber,n=0|t.startLineNumber;if(i===n){const i=0|e.startColumn,n=0|t.startColumn;if(i===n){const i=0|e.endLineNumber,n=0|t.endLineNumber;if(i===n){return(0|e.endColumn)-(0|t.endColumn)}return i-n}return i-n}return i-n}return(e?1:0)-(t?1:0)}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}}class yi extends wi{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return yi.selectionsEqual(this,e)}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?0:1}setEndPosition(e,t){return 0===this.getDirection()?new yi(this.startLineNumber,this.startColumn,e,t):new yi(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Ci(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Ci(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return 0===this.getDirection()?new yi(e,t,this.endLineNumber,this.endColumn):new yi(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new yi(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return 0===t?new yi(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new yi(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new yi(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.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 i=0,n=e.length;i<n;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&"number"==typeof e.selectionStartLineNumber&&"number"==typeof e.selectionStartColumn&&"number"==typeof e.positionLineNumber&&"number"==typeof e.positionColumn}static createWithDirection(e,t,i,n,s){return 0===s?new yi(e,t,i,n):new yi(i,n,e,t)}}const Si=Object.create(null);function Li(e,t){if(k(t)){const i=Si[t];if(void 0===i)throw new Error(`${e} references an unknown codicon: ${t}`);t=i}return Si[e]=t,{id:e}}function ki(){return Si}const Di={add:Li("add",6e4),plus:Li("plus",6e4),gistNew:Li("gist-new",6e4),repoCreate:Li("repo-create",6e4),lightbulb:Li("lightbulb",60001),lightBulb:Li("light-bulb",60001),repo:Li("repo",60002),repoDelete:Li("repo-delete",60002),gistFork:Li("gist-fork",60003),repoForked:Li("repo-forked",60003),gitPullRequest:Li("git-pull-request",60004),gitPullRequestAbandoned:Li("git-pull-request-abandoned",60004),recordKeys:Li("record-keys",60005),keyboard:Li("keyboard",60005),tag:Li("tag",60006),tagAdd:Li("tag-add",60006),tagRemove:Li("tag-remove",60006),gitPullRequestLabel:Li("git-pull-request-label",60006),person:Li("person",60007),personFollow:Li("person-follow",60007),personOutline:Li("person-outline",60007),personFilled:Li("person-filled",60007),gitBranch:Li("git-branch",60008),gitBranchCreate:Li("git-branch-create",60008),gitBranchDelete:Li("git-branch-delete",60008),sourceControl:Li("source-control",60008),mirror:Li("mirror",60009),mirrorPublic:Li("mirror-public",60009),star:Li("star",60010),starAdd:Li("star-add",60010),starDelete:Li("star-delete",60010),starEmpty:Li("star-empty",60010),comment:Li("comment",60011),commentAdd:Li("comment-add",60011),alert:Li("alert",60012),warning:Li("warning",60012),search:Li("search",60013),searchSave:Li("search-save",60013),logOut:Li("log-out",60014),signOut:Li("sign-out",60014),logIn:Li("log-in",60015),signIn:Li("sign-in",60015),eye:Li("eye",60016),eyeUnwatch:Li("eye-unwatch",60016),eyeWatch:Li("eye-watch",60016),circleFilled:Li("circle-filled",60017),primitiveDot:Li("primitive-dot",60017),closeDirty:Li("close-dirty",60017),debugBreakpoint:Li("debug-breakpoint",60017),debugBreakpointDisabled:Li("debug-breakpoint-disabled",60017),debugBreakpointPending:Li("debug-breakpoint-pending",60377),debugHint:Li("debug-hint",60017),primitiveSquare:Li("primitive-square",60018),edit:Li("edit",60019),pencil:Li("pencil",60019),info:Li("info",60020),issueOpened:Li("issue-opened",60020),gistPrivate:Li("gist-private",60021),gitForkPrivate:Li("git-fork-private",60021),lock:Li("lock",60021),mirrorPrivate:Li("mirror-private",60021),close:Li("close",60022),removeClose:Li("remove-close",60022),x:Li("x",60022),repoSync:Li("repo-sync",60023),sync:Li("sync",60023),clone:Li("clone",60024),desktopDownload:Li("desktop-download",60024),beaker:Li("beaker",60025),microscope:Li("microscope",60025),vm:Li("vm",60026),deviceDesktop:Li("device-desktop",60026),file:Li("file",60027),fileText:Li("file-text",60027),more:Li("more",60028),ellipsis:Li("ellipsis",60028),kebabHorizontal:Li("kebab-horizontal",60028),mailReply:Li("mail-reply",60029),reply:Li("reply",60029),organization:Li("organization",60030),organizationFilled:Li("organization-filled",60030),organizationOutline:Li("organization-outline",60030),newFile:Li("new-file",60031),fileAdd:Li("file-add",60031),newFolder:Li("new-folder",60032),fileDirectoryCreate:Li("file-directory-create",60032),trash:Li("trash",60033),trashcan:Li("trashcan",60033),history:Li("history",60034),clock:Li("clock",60034),folder:Li("folder",60035),fileDirectory:Li("file-directory",60035),symbolFolder:Li("symbol-folder",60035),logoGithub:Li("logo-github",60036),markGithub:Li("mark-github",60036),github:Li("github",60036),terminal:Li("terminal",60037),console:Li("console",60037),repl:Li("repl",60037),zap:Li("zap",60038),symbolEvent:Li("symbol-event",60038),error:Li("error",60039),stop:Li("stop",60039),variable:Li("variable",60040),symbolVariable:Li("symbol-variable",60040),array:Li("array",60042),symbolArray:Li("symbol-array",60042),symbolModule:Li("symbol-module",60043),symbolPackage:Li("symbol-package",60043),symbolNamespace:Li("symbol-namespace",60043),symbolObject:Li("symbol-object",60043),symbolMethod:Li("symbol-method",60044),symbolFunction:Li("symbol-function",60044),symbolConstructor:Li("symbol-constructor",60044),symbolBoolean:Li("symbol-boolean",60047),symbolNull:Li("symbol-null",60047),symbolNumeric:Li("symbol-numeric",60048),symbolNumber:Li("symbol-number",60048),symbolStructure:Li("symbol-structure",60049),symbolStruct:Li("symbol-struct",60049),symbolParameter:Li("symbol-parameter",60050),symbolTypeParameter:Li("symbol-type-parameter",60050),symbolKey:Li("symbol-key",60051),symbolText:Li("symbol-text",60051),symbolReference:Li("symbol-reference",60052),goToFile:Li("go-to-file",60052),symbolEnum:Li("symbol-enum",60053),symbolValue:Li("symbol-value",60053),symbolRuler:Li("symbol-ruler",60054),symbolUnit:Li("symbol-unit",60054),activateBreakpoints:Li("activate-breakpoints",60055),archive:Li("archive",60056),arrowBoth:Li("arrow-both",60057),arrowDown:Li("arrow-down",60058),arrowLeft:Li("arrow-left",60059),arrowRight:Li("arrow-right",60060),arrowSmallDown:Li("arrow-small-down",60061),arrowSmallLeft:Li("arrow-small-left",60062),arrowSmallRight:Li("arrow-small-right",60063),arrowSmallUp:Li("arrow-small-up",60064),arrowUp:Li("arrow-up",60065),bell:Li("bell",60066),bold:Li("bold",60067),book:Li("book",60068),bookmark:Li("bookmark",60069),debugBreakpointConditionalUnverified:Li("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:Li("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:Li("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:Li("debug-breakpoint-data-unverified",60072),debugBreakpointData:Li("debug-breakpoint-data",60073),debugBreakpointDataDisabled:Li("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:Li("debug-breakpoint-log-unverified",60074),debugBreakpointLog:Li("debug-breakpoint-log",60075),debugBreakpointLogDisabled:Li("debug-breakpoint-log-disabled",60075),briefcase:Li("briefcase",60076),broadcast:Li("broadcast",60077),browser:Li("browser",60078),bug:Li("bug",60079),calendar:Li("calendar",60080),caseSensitive:Li("case-sensitive",60081),check:Li("check",60082),checklist:Li("checklist",60083),chevronDown:Li("chevron-down",60084),dropDownButton:Li("drop-down-button",60084),chevronLeft:Li("chevron-left",60085),chevronRight:Li("chevron-right",60086),chevronUp:Li("chevron-up",60087),chromeClose:Li("chrome-close",60088),chromeMaximize:Li("chrome-maximize",60089),chromeMinimize:Li("chrome-minimize",60090),chromeRestore:Li("chrome-restore",60091),circle:Li("circle",60092),circleOutline:Li("circle-outline",60092),debugBreakpointUnverified:Li("debug-breakpoint-unverified",60092),circleSlash:Li("circle-slash",60093),circuitBoard:Li("circuit-board",60094),clearAll:Li("clear-all",60095),clippy:Li("clippy",60096),closeAll:Li("close-all",60097),cloudDownload:Li("cloud-download",60098),cloudUpload:Li("cloud-upload",60099),code:Li("code",60100),collapseAll:Li("collapse-all",60101),colorMode:Li("color-mode",60102),commentDiscussion:Li("comment-discussion",60103),compareChanges:Li("compare-changes",60157),creditCard:Li("credit-card",60105),dash:Li("dash",60108),dashboard:Li("dashboard",60109),database:Li("database",60110),debugContinue:Li("debug-continue",60111),debugDisconnect:Li("debug-disconnect",60112),debugPause:Li("debug-pause",60113),debugRestart:Li("debug-restart",60114),debugStart:Li("debug-start",60115),debugStepInto:Li("debug-step-into",60116),debugStepOut:Li("debug-step-out",60117),debugStepOver:Li("debug-step-over",60118),debugStop:Li("debug-stop",60119),debug:Li("debug",60120),deviceCameraVideo:Li("device-camera-video",60121),deviceCamera:Li("device-camera",60122),deviceMobile:Li("device-mobile",60123),diffAdded:Li("diff-added",60124),diffIgnored:Li("diff-ignored",60125),diffModified:Li("diff-modified",60126),diffRemoved:Li("diff-removed",60127),diffRenamed:Li("diff-renamed",60128),diff:Li("diff",60129),discard:Li("discard",60130),editorLayout:Li("editor-layout",60131),emptyWindow:Li("empty-window",60132),exclude:Li("exclude",60133),extensions:Li("extensions",60134),eyeClosed:Li("eye-closed",60135),fileBinary:Li("file-binary",60136),fileCode:Li("file-code",60137),fileMedia:Li("file-media",60138),filePdf:Li("file-pdf",60139),fileSubmodule:Li("file-submodule",60140),fileSymlinkDirectory:Li("file-symlink-directory",60141),fileSymlinkFile:Li("file-symlink-file",60142),fileZip:Li("file-zip",60143),files:Li("files",60144),filter:Li("filter",60145),flame:Li("flame",60146),foldDown:Li("fold-down",60147),foldUp:Li("fold-up",60148),fold:Li("fold",60149),folderActive:Li("folder-active",60150),folderOpened:Li("folder-opened",60151),gear:Li("gear",60152),gift:Li("gift",60153),gistSecret:Li("gist-secret",60154),gist:Li("gist",60155),gitCommit:Li("git-commit",60156),gitCompare:Li("git-compare",60157),gitMerge:Li("git-merge",60158),githubAction:Li("github-action",60159),githubAlt:Li("github-alt",60160),globe:Li("globe",60161),grabber:Li("grabber",60162),graph:Li("graph",60163),gripper:Li("gripper",60164),heart:Li("heart",60165),home:Li("home",60166),horizontalRule:Li("horizontal-rule",60167),hubot:Li("hubot",60168),inbox:Li("inbox",60169),issueClosed:Li("issue-closed",60324),issueReopened:Li("issue-reopened",60171),issues:Li("issues",60172),italic:Li("italic",60173),jersey:Li("jersey",60174),json:Li("json",60175),bracket:Li("bracket",60175),kebabVertical:Li("kebab-vertical",60176),key:Li("key",60177),law:Li("law",60178),lightbulbAutofix:Li("lightbulb-autofix",60179),linkExternal:Li("link-external",60180),link:Li("link",60181),listOrdered:Li("list-ordered",60182),listUnordered:Li("list-unordered",60183),liveShare:Li("live-share",60184),loading:Li("loading",60185),location:Li("location",60186),mailRead:Li("mail-read",60187),mail:Li("mail",60188),markdown:Li("markdown",60189),megaphone:Li("megaphone",60190),mention:Li("mention",60191),milestone:Li("milestone",60192),gitPullRequestMilestone:Li("git-pull-request-milestone",60192),mortarBoard:Li("mortar-board",60193),move:Li("move",60194),multipleWindows:Li("multiple-windows",60195),mute:Li("mute",60196),noNewline:Li("no-newline",60197),note:Li("note",60198),octoface:Li("octoface",60199),openPreview:Li("open-preview",60200),package:Li("package",60201),paintcan:Li("paintcan",60202),pin:Li("pin",60203),play:Li("play",60204),run:Li("run",60204),plug:Li("plug",60205),preserveCase:Li("preserve-case",60206),preview:Li("preview",60207),project:Li("project",60208),pulse:Li("pulse",60209),question:Li("question",60210),quote:Li("quote",60211),radioTower:Li("radio-tower",60212),reactions:Li("reactions",60213),references:Li("references",60214),refresh:Li("refresh",60215),regex:Li("regex",60216),remoteExplorer:Li("remote-explorer",60217),remote:Li("remote",60218),remove:Li("remove",60219),replaceAll:Li("replace-all",60220),replace:Li("replace",60221),repoClone:Li("repo-clone",60222),repoForcePush:Li("repo-force-push",60223),repoPull:Li("repo-pull",60224),repoPush:Li("repo-push",60225),report:Li("report",60226),requestChanges:Li("request-changes",60227),rocket:Li("rocket",60228),rootFolderOpened:Li("root-folder-opened",60229),rootFolder:Li("root-folder",60230),rss:Li("rss",60231),ruby:Li("ruby",60232),saveAll:Li("save-all",60233),saveAs:Li("save-as",60234),save:Li("save",60235),screenFull:Li("screen-full",60236),screenNormal:Li("screen-normal",60237),searchStop:Li("search-stop",60238),server:Li("server",60240),settingsGear:Li("settings-gear",60241),settings:Li("settings",60242),shield:Li("shield",60243),smiley:Li("smiley",60244),sortPrecedence:Li("sort-precedence",60245),splitHorizontal:Li("split-horizontal",60246),splitVertical:Li("split-vertical",60247),squirrel:Li("squirrel",60248),starFull:Li("star-full",60249),starHalf:Li("star-half",60250),symbolClass:Li("symbol-class",60251),symbolColor:Li("symbol-color",60252),symbolCustomColor:Li("symbol-customcolor",60252),symbolConstant:Li("symbol-constant",60253),symbolEnumMember:Li("symbol-enum-member",60254),symbolField:Li("symbol-field",60255),symbolFile:Li("symbol-file",60256),symbolInterface:Li("symbol-interface",60257),symbolKeyword:Li("symbol-keyword",60258),symbolMisc:Li("symbol-misc",60259),symbolOperator:Li("symbol-operator",60260),symbolProperty:Li("symbol-property",60261),wrench:Li("wrench",60261),wrenchSubaction:Li("wrench-subaction",60261),symbolSnippet:Li("symbol-snippet",60262),tasklist:Li("tasklist",60263),telescope:Li("telescope",60264),textSize:Li("text-size",60265),threeBars:Li("three-bars",60266),thumbsdown:Li("thumbsdown",60267),thumbsup:Li("thumbsup",60268),tools:Li("tools",60269),triangleDown:Li("triangle-down",60270),triangleLeft:Li("triangle-left",60271),triangleRight:Li("triangle-right",60272),triangleUp:Li("triangle-up",60273),twitter:Li("twitter",60274),unfold:Li("unfold",60275),unlock:Li("unlock",60276),unmute:Li("unmute",60277),unverified:Li("unverified",60278),verified:Li("verified",60279),versions:Li("versions",60280),vmActive:Li("vm-active",60281),vmOutline:Li("vm-outline",60282),vmRunning:Li("vm-running",60283),watch:Li("watch",60284),whitespace:Li("whitespace",60285),wholeWord:Li("whole-word",60286),window:Li("window",60287),wordWrap:Li("word-wrap",60288),zoomIn:Li("zoom-in",60289),zoomOut:Li("zoom-out",60290),listFilter:Li("list-filter",60291),listFlat:Li("list-flat",60292),listSelection:Li("list-selection",60293),selection:Li("selection",60293),listTree:Li("list-tree",60294),debugBreakpointFunctionUnverified:Li("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:Li("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:Li("debug-breakpoint-function-disabled",60296),debugStackframeActive:Li("debug-stackframe-active",60297),circleSmallFilled:Li("circle-small-filled",60298),debugStackframeDot:Li("debug-stackframe-dot",60298),debugStackframe:Li("debug-stackframe",60299),debugStackframeFocused:Li("debug-stackframe-focused",60299),debugBreakpointUnsupported:Li("debug-breakpoint-unsupported",60300),symbolString:Li("symbol-string",60301),debugReverseContinue:Li("debug-reverse-continue",60302),debugStepBack:Li("debug-step-back",60303),debugRestartFrame:Li("debug-restart-frame",60304),callIncoming:Li("call-incoming",60306),callOutgoing:Li("call-outgoing",60307),menu:Li("menu",60308),expandAll:Li("expand-all",60309),feedback:Li("feedback",60310),gitPullRequestReviewer:Li("git-pull-request-reviewer",60310),groupByRefType:Li("group-by-ref-type",60311),ungroupByRefType:Li("ungroup-by-ref-type",60312),account:Li("account",60313),gitPullRequestAssignee:Li("git-pull-request-assignee",60313),bellDot:Li("bell-dot",60314),debugConsole:Li("debug-console",60315),library:Li("library",60316),output:Li("output",60317),runAll:Li("run-all",60318),syncIgnored:Li("sync-ignored",60319),pinned:Li("pinned",60320),githubInverted:Li("github-inverted",60321),debugAlt:Li("debug-alt",60305),serverProcess:Li("server-process",60322),serverEnvironment:Li("server-environment",60323),pass:Li("pass",60324),stopCircle:Li("stop-circle",60325),playCircle:Li("play-circle",60326),record:Li("record",60327),debugAltSmall:Li("debug-alt-small",60328),vmConnect:Li("vm-connect",60329),cloud:Li("cloud",60330),merge:Li("merge",60331),exportIcon:Li("export",60332),graphLeft:Li("graph-left",60333),magnet:Li("magnet",60334),notebook:Li("notebook",60335),redo:Li("redo",60336),checkAll:Li("check-all",60337),pinnedDirty:Li("pinned-dirty",60338),passFilled:Li("pass-filled",60339),circleLargeFilled:Li("circle-large-filled",60340),circleLarge:Li("circle-large",60341),circleLargeOutline:Li("circle-large-outline",60341),combine:Li("combine",60342),gather:Li("gather",60342),table:Li("table",60343),variableGroup:Li("variable-group",60344),typeHierarchy:Li("type-hierarchy",60345),typeHierarchySub:Li("type-hierarchy-sub",60346),typeHierarchySuper:Li("type-hierarchy-super",60347),gitPullRequestCreate:Li("git-pull-request-create",60348),runAbove:Li("run-above",60349),runBelow:Li("run-below",60350),notebookTemplate:Li("notebook-template",60351),debugRerun:Li("debug-rerun",60352),workspaceTrusted:Li("workspace-trusted",60353),workspaceUntrusted:Li("workspace-untrusted",60354),workspaceUnspecified:Li("workspace-unspecified",60355),terminalCmd:Li("terminal-cmd",60356),terminalDebian:Li("terminal-debian",60357),terminalLinux:Li("terminal-linux",60358),terminalPowershell:Li("terminal-powershell",60359),terminalTmux:Li("terminal-tmux",60360),terminalUbuntu:Li("terminal-ubuntu",60361),terminalBash:Li("terminal-bash",60362),arrowSwap:Li("arrow-swap",60363),copy:Li("copy",60364),personAdd:Li("person-add",60365),filterFilled:Li("filter-filled",60366),wand:Li("wand",60367),debugLineByLine:Li("debug-line-by-line",60368),inspect:Li("inspect",60369),layers:Li("layers",60370),layersDot:Li("layers-dot",60371),layersActive:Li("layers-active",60372),compass:Li("compass",60373),compassDot:Li("compass-dot",60374),compassActive:Li("compass-active",60375),azure:Li("azure",60376),issueDraft:Li("issue-draft",60377),gitPullRequestClosed:Li("git-pull-request-closed",60378),gitPullRequestDraft:Li("git-pull-request-draft",60379),debugAll:Li("debug-all",60380),debugCoverage:Li("debug-coverage",60381),runErrors:Li("run-errors",60382),folderLibrary:Li("folder-library",60383),debugContinueSmall:Li("debug-continue-small",60384),beakerStop:Li("beaker-stop",60385),graphLine:Li("graph-line",60386),graphScatter:Li("graph-scatter",60387),pieChart:Li("pie-chart",60388),bracketDot:Li("bracket-dot",60389),bracketError:Li("bracket-error",60390),lockSmall:Li("lock-small",60391),azureDevops:Li("azure-devops",60392),verifiedFilled:Li("verified-filled",60393),newLine:Li("newline",60394),layout:Li("layout",60395),layoutActivitybarLeft:Li("layout-activitybar-left",60396),layoutActivitybarRight:Li("layout-activitybar-right",60397),layoutPanelLeft:Li("layout-panel-left",60398),layoutPanelCenter:Li("layout-panel-center",60399),layoutPanelJustify:Li("layout-panel-justify",60400),layoutPanelRight:Li("layout-panel-right",60401),layoutPanel:Li("layout-panel",60402),layoutSidebarLeft:Li("layout-sidebar-left",60403),layoutSidebarRight:Li("layout-sidebar-right",60404),layoutStatusbar:Li("layout-statusbar",60405),layoutMenubar:Li("layout-menubar",60406),layoutCentered:Li("layout-centered",60407),layoutSidebarRightOff:Li("layout-sidebar-right-off",60416),layoutPanelOff:Li("layout-panel-off",60417),layoutSidebarLeftOff:Li("layout-sidebar-left-off",60418),target:Li("target",60408),indent:Li("indent",60409),recordSmall:Li("record-small",60410),errorSmall:Li("error-small",60411),arrowCircleDown:Li("arrow-circle-down",60412),arrowCircleLeft:Li("arrow-circle-left",60413),arrowCircleRight:Li("arrow-circle-right",60414),arrowCircleUp:Li("arrow-circle-up",60415),heartFilled:Li("heart-filled",60420),map:Li("map",60421),mapFilled:Li("map-filled",60422),circleSmall:Li("circle-small",60423),bellSlash:Li("bell-slash",60424),bellSlashDot:Li("bell-slash-dot",60425),commentUnresolved:Li("comment-unresolved",60426),gitPullRequestGoToChanges:Li("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:Li("git-pull-request-new-changes",60428),searchFuzzy:Li("search-fuzzy",60429),commentDraft:Li("comment-draft",60430),send:Li("send",60431),sparkle:Li("sparkle",60432),insert:Li("insert",60433),mic:Li("mic",60434),thumbsDownFilled:Li("thumbsdown-filled",60435),thumbsUpFilled:Li("thumbsup-filled",60436),coffee:Li("coffee",60437),snake:Li("snake",60438),game:Li("game",60439),vr:Li("vr",60440),chip:Li("chip",60441),piano:Li("piano",60442),music:Li("music",60443),micFilled:Li("mic-filled",60444),gitFetch:Li("git-fetch",60445),copilot:Li("copilot",60446),lightbulbSparkle:Li("lightbulb-sparkle",60447),lightbulbSparkleAutofix:Li("lightbulb-sparkle-autofix",60447),robot:Li("robot",60448),sparkleFilled:Li("sparkle-filled",60449),diffSingle:Li("diff-single",60450),diffMultiple:Li("diff-multiple",60451),surroundWith:Li("surround-with",60452),gitStash:Li("git-stash",60454),gitStashApply:Li("git-stash-apply",60455),gitStashPop:Li("git-stash-pop",60456),runAllCoverage:Li("run-all-coverage",60461),runCoverage:Li("run-all-coverage",60460),coverage:Li("coverage",60462),githubProject:Li("github-project",60463),dialogError:Li("dialog-error","error"),dialogWarning:Li("dialog-warning","warning"),dialogInfo:Li("dialog-info","info"),dialogClose:Li("dialog-close","close"),treeItemExpanded:Li("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:Li("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:Li("tree-filter-on-type-off","list-selection"),treeFilterClear:Li("tree-filter-clear","close"),treeItemLoading:Li("tree-item-loading","loading"),menuSelection:Li("menu-selection","check"),menuSubmenu:Li("menu-submenu","chevron-right"),menuBarMore:Li("menubar-more","more"),scrollbarButtonLeft:Li("scrollbar-button-left","triangle-left"),scrollbarButtonRight:Li("scrollbar-button-right","triangle-right"),scrollbarButtonUp:Li("scrollbar-button-up","triangle-up"),scrollbarButtonDown:Li("scrollbar-button-down","triangle-down"),toolBarMore:Li("toolbar-more","more"),quickInputBack:Li("quick-input-back","arrow-left")};class xi extends st{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}class Ei{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}class Ni{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class Ii{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var Ti,Mi,Ai,Oi;!function(e){const t=new Map;t.set(0,Di.symbolMethod),t.set(1,Di.symbolFunction),t.set(2,Di.symbolConstructor),t.set(3,Di.symbolField),t.set(4,Di.symbolVariable),t.set(5,Di.symbolClass),t.set(6,Di.symbolStruct),t.set(7,Di.symbolInterface),t.set(8,Di.symbolModule),t.set(9,Di.symbolProperty),t.set(10,Di.symbolEvent),t.set(11,Di.symbolOperator),t.set(12,Di.symbolUnit),t.set(13,Di.symbolValue),t.set(15,Di.symbolEnum),t.set(14,Di.symbolConstant),t.set(15,Di.symbolEnum),t.set(16,Di.symbolEnumMember),t.set(17,Di.symbolKeyword),t.set(27,Di.symbolSnippet),t.set(18,Di.symbolText),t.set(19,Di.symbolColor),t.set(20,Di.symbolFile),t.set(21,Di.symbolReference),t.set(22,Di.symbolCustomColor),t.set(23,Di.symbolFolder),t.set(24,Di.symbolTypeParameter),t.set(25,Di.account),t.set(26,Di.issues),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for CompletionItemKind "+e),i=Di.symbolProperty),i};const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),e.fromString=function(e,t){let n=i.get(e);return void 0!==n||t||(n=9),n}}(Ti||(Ti={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(Mi||(Mi={}));class Ri{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return wi.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}!function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(Ai||(Ai={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(Oi||(Oi={}));Object(J.b)("Array","array"),Object(J.b)("Boolean","boolean"),Object(J.b)("Class","class"),Object(J.b)("Constant","constant"),Object(J.b)("Constructor","constructor"),Object(J.b)("Enum","enumeration"),Object(J.b)("EnumMember","enumeration member"),Object(J.b)("Event","event"),Object(J.b)("Field","field"),Object(J.b)("File","file"),Object(J.b)("Function","function"),Object(J.b)("Interface","interface"),Object(J.b)("Key","key"),Object(J.b)("Method","method"),Object(J.b)("Module","module"),Object(J.b)("Namespace","namespace"),Object(J.b)("Null","null"),Object(J.b)("Number","number"),Object(J.b)("Object","object"),Object(J.b)("Operator","operator"),Object(J.b)("Package","package"),Object(J.b)("Property","property"),Object(J.b)("String","string"),Object(J.b)("Struct","struct"),Object(J.b)("TypeParameter","type parameter"),Object(J.b)("Variable","variable");var Pi,Fi,Bi,Wi;!function(e){const t=new Map;t.set(0,Di.symbolFile),t.set(1,Di.symbolModule),t.set(2,Di.symbolNamespace),t.set(3,Di.symbolPackage),t.set(4,Di.symbolClass),t.set(5,Di.symbolMethod),t.set(6,Di.symbolProperty),t.set(7,Di.symbolField),t.set(8,Di.symbolConstructor),t.set(9,Di.symbolEnum),t.set(10,Di.symbolInterface),t.set(11,Di.symbolFunction),t.set(12,Di.symbolVariable),t.set(13,Di.symbolConstant),t.set(14,Di.symbolString),t.set(15,Di.symbolNumber),t.set(16,Di.symbolBoolean),t.set(17,Di.symbolArray),t.set(18,Di.symbolObject),t.set(19,Di.symbolKey),t.set(20,Di.symbolNull),t.set(21,Di.symbolEnumMember),t.set(22,Di.symbolStruct),t.set(23,Di.symbolEvent),t.set(24,Di.symbolOperator),t.set(25,Di.symbolTypeParameter),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for SymbolKind "+e),i=Di.symbolProperty),i}}(Pi||(Pi={}));class Vi{static fromValue(e){switch(e){case"comment":return Vi.Comment;case"imports":return Vi.Imports;case"region":return Vi.Region}return new Vi(e)}constructor(e){this.value=e}}Vi.Comment=new Vi("comment"),Vi.Imports=new Vi("imports"),Vi.Region=new Vi("region"),function(e){e[e.AIGenerated=1]="AIGenerated"}(Fi||(Fi={})),(Bi||(Bi={})).is=function(e){return!(!e||"object"!=typeof e)&&"string"==typeof e.id&&"string"==typeof e.title},function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(Wi||(Wi={}));class Hi{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const zi=new class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new ft,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]),it(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;null===(i=this._factories.get(e))||void 0===i||i.dispose();const n=new xi(this,e,t);return this._factories.set(e,n),it(()=>{const t=this._factories.get(e);t&&t===n&&(this._factories.delete(e),t.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const 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>2?this._colorMap[2]:null}};var Ki,Ui,ji,qi,$i,Gi,Zi,Yi,Qi,Xi,Ji,en,tn,nn,sn,on,rn,an,ln,hn,dn,cn,un,gn,mn,fn,pn,_n,vn,bn,Cn,wn,yn,Sn,Ln,kn,Dn,xn,En,Nn,In,Tn,Mn,An;!function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"}(Ki||(Ki={})),function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(Ui||(Ui={})),function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"}(ji||(ji={})),function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(qi||(qi={})),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.Snippet=27]="Snippet"}($i||($i={})),function(e){e[e.Deprecated=1]="Deprecated"}(Gi||(Gi={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(Zi||(Zi={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(Yi||(Yi={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(Qi||(Qi={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(Xi||(Xi={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(Ji||(Ji={})),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"}(en||(en={})),function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.ariaLabel=4]="ariaLabel",e[e.ariaRequired=5]="ariaRequired",e[e.autoClosingBrackets=6]="autoClosingBrackets",e[e.autoClosingComments=7]="autoClosingComments",e[e.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",e[e.autoClosingDelete=9]="autoClosingDelete",e[e.autoClosingOvertype=10]="autoClosingOvertype",e[e.autoClosingQuotes=11]="autoClosingQuotes",e[e.autoIndent=12]="autoIndent",e[e.automaticLayout=13]="automaticLayout",e[e.autoSurround=14]="autoSurround",e[e.bracketPairColorization=15]="bracketPairColorization",e[e.guides=16]="guides",e[e.codeLens=17]="codeLens",e[e.codeLensFontFamily=18]="codeLensFontFamily",e[e.codeLensFontSize=19]="codeLensFontSize",e[e.colorDecorators=20]="colorDecorators",e[e.colorDecoratorsLimit=21]="colorDecoratorsLimit",e[e.columnSelection=22]="columnSelection",e[e.comments=23]="comments",e[e.contextmenu=24]="contextmenu",e[e.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",e[e.cursorBlinking=26]="cursorBlinking",e[e.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",e[e.cursorStyle=28]="cursorStyle",e[e.cursorSurroundingLines=29]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",e[e.cursorWidth=31]="cursorWidth",e[e.disableLayerHinting=32]="disableLayerHinting",e[e.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",e[e.domReadOnly=34]="domReadOnly",e[e.dragAndDrop=35]="dragAndDrop",e[e.dropIntoEditor=36]="dropIntoEditor",e[e.emptySelectionClipboard=37]="emptySelectionClipboard",e[e.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",e[e.extraEditorClassName=39]="extraEditorClassName",e[e.fastScrollSensitivity=40]="fastScrollSensitivity",e[e.find=41]="find",e[e.fixedOverflowWidgets=42]="fixedOverflowWidgets",e[e.folding=43]="folding",e[e.foldingStrategy=44]="foldingStrategy",e[e.foldingHighlight=45]="foldingHighlight",e[e.foldingImportsByDefault=46]="foldingImportsByDefault",e[e.foldingMaximumRegions=47]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=49]="fontFamily",e[e.fontInfo=50]="fontInfo",e[e.fontLigatures=51]="fontLigatures",e[e.fontSize=52]="fontSize",e[e.fontWeight=53]="fontWeight",e[e.fontVariations=54]="fontVariations",e[e.formatOnPaste=55]="formatOnPaste",e[e.formatOnType=56]="formatOnType",e[e.glyphMargin=57]="glyphMargin",e[e.gotoLocation=58]="gotoLocation",e[e.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",e[e.hover=60]="hover",e[e.inDiffEditor=61]="inDiffEditor",e[e.inlineSuggest=62]="inlineSuggest",e[e.inlineEdit=63]="inlineEdit",e[e.letterSpacing=64]="letterSpacing",e[e.lightbulb=65]="lightbulb",e[e.lineDecorationsWidth=66]="lineDecorationsWidth",e[e.lineHeight=67]="lineHeight",e[e.lineNumbers=68]="lineNumbers",e[e.lineNumbersMinChars=69]="lineNumbersMinChars",e[e.linkedEditing=70]="linkedEditing",e[e.links=71]="links",e[e.matchBrackets=72]="matchBrackets",e[e.minimap=73]="minimap",e[e.mouseStyle=74]="mouseStyle",e[e.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=76]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",e[e.multiCursorModifier=78]="multiCursorModifier",e[e.multiCursorPaste=79]="multiCursorPaste",e[e.multiCursorLimit=80]="multiCursorLimit",e[e.occurrencesHighlight=81]="occurrencesHighlight",e[e.overviewRulerBorder=82]="overviewRulerBorder",e[e.overviewRulerLanes=83]="overviewRulerLanes",e[e.padding=84]="padding",e[e.pasteAs=85]="pasteAs",e[e.parameterHints=86]="parameterHints",e[e.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",e[e.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",e[e.quickSuggestions=89]="quickSuggestions",e[e.quickSuggestionsDelay=90]="quickSuggestionsDelay",e[e.readOnly=91]="readOnly",e[e.readOnlyMessage=92]="readOnlyMessage",e[e.renameOnType=93]="renameOnType",e[e.renderControlCharacters=94]="renderControlCharacters",e[e.renderFinalNewline=95]="renderFinalNewline",e[e.renderLineHighlight=96]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=98]="renderValidationDecorations",e[e.renderWhitespace=99]="renderWhitespace",e[e.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",e[e.roundedSelection=101]="roundedSelection",e[e.rulers=102]="rulers",e[e.scrollbar=103]="scrollbar",e[e.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=105]="scrollBeyondLastLine",e[e.scrollPredominantAxis=106]="scrollPredominantAxis",e[e.selectionClipboard=107]="selectionClipboard",e[e.selectionHighlight=108]="selectionHighlight",e[e.selectOnLineNumbers=109]="selectOnLineNumbers",e[e.showFoldingControls=110]="showFoldingControls",e[e.showUnused=111]="showUnused",e[e.snippetSuggestions=112]="snippetSuggestions",e[e.smartSelect=113]="smartSelect",e[e.smoothScrolling=114]="smoothScrolling",e[e.stickyScroll=115]="stickyScroll",e[e.stickyTabStops=116]="stickyTabStops",e[e.stopRenderingLineAfter=117]="stopRenderingLineAfter",e[e.suggest=118]="suggest",e[e.suggestFontSize=119]="suggestFontSize",e[e.suggestLineHeight=120]="suggestLineHeight",e[e.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",e[e.suggestSelection=122]="suggestSelection",e[e.tabCompletion=123]="tabCompletion",e[e.tabIndex=124]="tabIndex",e[e.unicodeHighlighting=125]="unicodeHighlighting",e[e.unusualLineTerminators=126]="unusualLineTerminators",e[e.useShadowDOM=127]="useShadowDOM",e[e.useTabStops=128]="useTabStops",e[e.wordBreak=129]="wordBreak",e[e.wordSeparators=130]="wordSeparators",e[e.wordWrap=131]="wordWrap",e[e.wordWrapBreakAfterCharacters=132]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=133]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=134]="wordWrapColumn",e[e.wordWrapOverride1=135]="wordWrapOverride1",e[e.wordWrapOverride2=136]="wordWrapOverride2",e[e.wrappingIndent=137]="wrappingIndent",e[e.wrappingStrategy=138]="wrappingStrategy",e[e.showDeprecated=139]="showDeprecated",e[e.inlayHints=140]="inlayHints",e[e.editorClassName=141]="editorClassName",e[e.pixelRatio=142]="pixelRatio",e[e.tabFocusMode=143]="tabFocusMode",e[e.layoutInfo=144]="layoutInfo",e[e.wrappingInfo=145]="wrappingInfo",e[e.defaultColorDecorators=146]="defaultColorDecorators",e[e.colorDecoratorsActivatedOn=147]="colorDecoratorsActivatedOn",e[e.inlineCompletionsAccessibilityVerbose=148]="inlineCompletionsAccessibilityVerbose"}(tn||(tn={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(nn||(nn={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(sn||(sn={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"}(on||(on={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(rn||(rn={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(an||(an={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(ln||(ln={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(hn||(hn={})),function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"}(dn||(dn={})),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"}(cn||(cn={})),(gn=un||(un={}))[gn.Hint=1]="Hint",gn[gn.Info=2]="Info",gn[gn.Warning=4]="Warning",gn[gn.Error=8]="Error",function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(mn||(mn={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(fn||(fn={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}(pn||(pn={})),function(e){e[e.AIGenerated=1]="AIGenerated"}(_n||(_n={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(vn||(vn={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(bn||(bn={})),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"}(Cn||(Cn={})),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"}(wn||(wn={})),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"}(yn||(yn={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(Sn||(Sn={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(Ln||(Ln={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(kn||(kn={})),function(e){e.Off="off",e.OnCode="onCode",e.On="on"}(Dn||(Dn={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(xn||(xn={})),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"}(En||(En={})),function(e){e[e.Deprecated=1]="Deprecated"}(Nn||(Nn={})),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"}(In||(In={})),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"}(Tn||(Tn={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(Mn||(Mn={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(An||(An={}));class On{static chord(e,t){return function(e,t){return(e|(65535&t)<<16>>>0)>>>0}(e,t)}}function Rn(){return{editor:void 0,languages:void 0,CancellationTokenSource:xt,Emitter:ft,KeyCode:cn,KeyMod:On,Position:Ci,Range:wi,Selection:yi,SelectionDirection:kn,MarkerSeverity:un,MarkerTag:mn,Uri:di,Token:Ei}}On.CtrlCmd=2048,On.Shift=1024,On.Alt=512,On.WinCtrl=256;const Pn=window,Fn=Pn;class Bn{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}var Wn,Vn=i("ZShG");const Hn=/{(\d+)}/g;function zn(e,...t){return 0===t.length?e:e.replace(Hn,(function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]}))}function Kn(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}}))}function Un(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function jn(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let n=0;for(;e.indexOf(t,n)===n;)n+=i;return e.substring(n)}function qn(e,t){if(!e||!t)return e;const i=t.length,n=e.length;if(0===i||0===n)return e;let s=n,o=-1;for(;o=e.lastIndexOf(t,s-1),-1!==o&&o+i===s;){if(0===o)return"";s=o}return e.substring(0,s)}function $n(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=Un(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let n="";return i.global&&(n+="g"),i.matchCase||(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),new RegExp(e,n)}function Gn(e){return e.split(/\r\n|\r|\n/)}function Zn(e){for(let t=0,i=e.length;t<i;t++){const i=e.charCodeAt(t);if(32!==i&&9!==i)return t}return-1}function Yn(e,t=0,i=e.length){for(let n=t;n<i;n++){const i=e.charCodeAt(n);if(32!==i&&9!==i)return e.substring(t,n)}return e.substring(t,i)}function Qn(e,t=e.length-1){for(let i=t;i>=0;i--){const t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return-1}function Xn(e,t){return e<t?-1:e>t?1:0}function Jn(e,t,i=0,n=e.length,s=0,o=t.length){for(;i<n&&s<o;i++,s++){const n=e.charCodeAt(i),o=t.charCodeAt(s);if(n<o)return-1;if(n>o)return 1}const r=n-i,a=o-s;return r<a?-1:r>a?1:0}function es(e,t){return ts(e,t,0,e.length,0,t.length)}function ts(e,t,i=0,n=e.length,s=0,o=t.length){for(;i<n&&s<o;i++,s++){let r=e.charCodeAt(i),a=t.charCodeAt(s);if(r===a)continue;if(r>=128||a>=128)return Jn(e.toLowerCase(),t.toLowerCase(),i,n,s,o);ns(r)&&(r-=32),ns(a)&&(a-=32);const l=r-a;if(0!==l)return l}const r=n-i,a=o-s;return r<a?-1:r>a?1:0}function is(e){return e>=48&&e<=57}function ns(e){return e>=97&&e<=122}function ss(e){return e>=65&&e<=90}function os(e,t){return e.length===t.length&&0===ts(e,t)}function rs(e,t){const i=t.length;return!(t.length>e.length)&&0===ts(e,t,0,i)}function as(e,t){const i=Math.min(e.length,t.length);let n;for(n=0;n<i;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return n;return i}function ls(e,t){const i=Math.min(e.length,t.length);let n;const s=e.length-1,o=t.length-1;for(n=0;n<i;n++)if(e.charCodeAt(s-n)!==t.charCodeAt(o-n))return n;return i}function hs(e){return 55296<=e&&e<=56319}function ds(e){return 56320<=e&&e<=57343}function cs(e,t){return t-56320+(e-55296<<10)+65536}function us(e,t,i){const n=e.charCodeAt(i);if(hs(n)&&i+1<t){const t=e.charCodeAt(i+1);if(ds(t))return cs(n,t)}return n}class gs{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(){const e=function(e,t){const i=e.charCodeAt(t-1);if(ds(i)&&t>1){const n=e.charCodeAt(t-2);if(hs(n))return cs(n,i)}return i}(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=us(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class ms{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new gs(e,t)}nextGraphemeLength(){const e=Ns.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const i=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(Es(n,s)){t.setOffset(i);break}n=s}return t.offset-i}prevGraphemeLength(){const e=Ns.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const i=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(Es(s,n)){t.setOffset(i);break}n=s}return i-t.offset}eol(){return this._iterator.eol()}}function fs(e,t){return new ms(e,t).nextGraphemeLength()}function ps(e,t){return new ms(e,t).prevGraphemeLength()}let _s=void 0;function vs(e){return _s||(_s=/(?:[\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])/),_s.test(e)}const bs=/^[\t\n\r\x20-\x7E]*$/;function Cs(e){return bs.test(e)}const ws=/[\u2028\u2029]/;function ys(e){return ws.test(e)}function Ss(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function Ls(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}const ks=String.fromCharCode(65279);function Ds(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function xs(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function Es(e,t){return 0===e?5!==t&&7!==t:(2!==e||3!==t)&&(4===e||2===e||3===e||(4===t||2===t||3===t||(8!==e||8!==t&&9!==t&&11!==t&&12!==t)&&((11!==e&&9!==e||9!==t&&10!==t)&&((12!==e&&10!==e||10!==t)&&(5!==t&&13!==t&&(7!==t&&(1!==e&&((13!==e||14!==t)&&(6!==e||6!==t)))))))))}class Ns{static getInstance(){return Ns._INSTANCE||(Ns._INSTANCE=new Ns),Ns._INSTANCE}constructor(){this._data=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]")}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(e<t[3*n])n*=2;else{if(!(e>t[3*n+1]))return t[3*n+2];n=2*n+1}return 0}}function Is(e,t){if(0===e)return 0;const i=function(e,t){const i=new gs(t,e);let n=i.prevCodePoint();for(;Ts(n)||65039===n||8419===n;){if(0===i.offset)return;n=i.prevCodePoint()}if(!Ls(n))return;let s=i.offset;if(s>0){8205===i.prevCodePoint()&&(s=i.offset)}return s}(e,t);if(void 0!==i)return i;const n=new gs(t,e);return n.prevCodePoint(),n.offset}function Ts(e){return 127995<=e&&e<=127999}Ns._INSTANCE=null;class Ms{static getInstance(e){return Wn.cache.get(Array.from(e))}static getLocales(){return Wn._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}Wn=Ms,Ms.ambiguousCharacterData=new Vn.a(()=>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,8218,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,8242,96,1370,96,1523,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,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,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,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,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,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,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,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,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,71922,67,71913,67,65315,67,8557,67,8450,67,8493,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,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,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,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,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,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,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,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,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,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,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,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,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,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,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,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,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,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,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,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,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,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,71919,87,71910,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,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,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,66293,90,71909,90,65338,90,8484,90,8488,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,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,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,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,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,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,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,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,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,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,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,65283,35,65292,44,65307,59],"ko":[8211,45,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,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,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,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,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,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[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,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,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,65283,35,65307,59]}')),Ms.cache=new class{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}(e=>{function t(e){const t=new Map;for(let i=0;i<e.length;i+=2)t.set(e[i],e[i+1]);return t}function i(e,t){if(!e)return t;const i=new Map;for(const[n,s]of e)t.has(n)&&i.set(n,s);return i}const n=Wn.ambiguousCharacterData.value;let s=e.filter(e=>!e.startsWith("_")&&e in n);0===s.length&&(s=["_default"]);let o=void 0;for(const e of s){o=i(o,t(n[e]))}const r=function(e,t){const i=new Map(e);for(const[e,n]of t)i.set(e,n);return i}(t(n._common),o);return new Wn(r)}),Ms._locales=new Vn.a(()=>Object.keys(Wn.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")));class As{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,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,12288,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]")}static getData(){return this._data||(this._data=new Set(As.getRawData())),this._data}static isInvisibleCharacter(e){return As.getData().has(e)}static get codePoints(){return As.getData()}}As._data=void 0;i("FWJU");class Os{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){var t;return null!==(t=this.mapWindowIdToZoomFactor.get(this.getWindowId(e)))&&void 0!==t?t:1}getWindowId(e){return e.vscodeWindowId}}function Rs(e,t,i){"string"==typeof t&&(t=e.matchMedia(t)),t.addEventListener("change",i)}Os.INSTANCE=new Os;const Ps=navigator.userAgent,Fs=Ps.indexOf("Firefox")>=0,Bs=Ps.indexOf("AppleWebKit")>=0,Ws=Ps.indexOf("Chrome")>=0,Vs=!Ws&&Ps.indexOf("Safari")>=0,Hs=!Ws&&!Vs&&Bs,zs=(Ps.indexOf("Electron/"),Ps.indexOf("Android")>=0);let Ks=!1;if("function"==typeof Pn.matchMedia){const e=Pn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Pn.matchMedia("(display-mode: fullscreen)");Ks=e.matches,Rs(Pn,e,({matches:e})=>{Ks&&t.matches||(Ks=e)})}K.k||document.queryCommandSupported&&document.queryCommandSupported("copy")||navigator&&navigator.clipboard&&navigator.clipboard.writeText,K.k||navigator&&navigator.clipboard&&navigator.clipboard.readText,K.k||Ks||navigator.keyboard,"ontouchstart"in Pn||navigator.maxTouchPoints;const Us=Pn.PointerEvent&&("ontouchstart"in Pn||navigator.maxTouchPoints>0);function js(e,t){if("number"==typeof e){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new Gs(0!==n?[qs(i,t),qs(n,t)]:[qs(i,t)])}{const i=[];for(let n=0;n<e.length;n++)i.push(qs(e[n],t));return new Gs(i)}}function qs(e,t){const i=!!(2048&e),n=!!(256&e);return new $s(2===t?n:i,!!(1024&e),!!(512&e),2===t?i:n,255&e)}class $s{constructor(e,t,i,n,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=s}equals(e){return e instanceof $s&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class Gs{constructor(e){if(0===e.length)throw Ke("chords");this.chords=e}}class Zs{constructor(e,t,i,n,s,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=s,this.keyAriaLabel=o}}const Ys=K.i?256:2048,Qs=K.i?2048:256;class Xs{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=function(e){if(e.charCode){const t=String.fromCharCode(e.charCode).toUpperCase();return Wt.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(Fs)switch(t){case 59:return 85;case 60:if(K.g)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(K.i)return 57}else if(Bs){if(K.i&&93===t)return 57;if(!K.i&&92===t)return 57}return Mt[t]||0}(t),this.code=t.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Ys),this.altKey&&(t|=512),this.shiftKey&&(t|=1024),this.metaKey&&(t|=Qs),t|=e,t}_computeKeyCodeChord(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new $s(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}const Js=new WeakMap;function eo(e){if(!e.parent||e.parent===e)return null;try{const t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return null}catch(e){return null}return e.parent}class to{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=0===t.button,this.middleButton=1===t.button,this.rightButton=2===t.button,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,"dblclick"===t.type&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,"number"==typeof t.pageX?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const i=class{static getSameOriginWindowChain(e){let t=Js.get(e);if(!t){t=[],Js.set(e,t);let i,n=e;do{i=eo(n),i?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=i}while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){var i,n;if(!t||e===t)return{top:0,left:0};let s=0,o=0;const r=this.getSameOriginWindowChain(e);for(const e of r){const r=e.window.deref();if(s+=null!==(i=null==r?void 0:r.scrollY)&&void 0!==i?i:0,o+=null!==(n=null==r?void 0:r.scrollX)&&void 0!==n?n:0,r===t)break;if(!e.iframeElement)break;const a=e.iframeElement.getBoundingClientRect();s+=a.top,o+=a.left}return{top:s,left:o}}}.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class io{constructor(e,t=0,i=0){var n;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let s=!1;if(Ws){const e=navigator.userAgent.match(/Chrome\/(\d+)/);s=(e?parseInt(e[1]):123)<=122}if(e){const t=e,i=e,o=(null===(n=e.view)||void 0===n?void 0:n.devicePixelRatio)||1;if(void 0!==t.wheelDeltaY)this.deltaY=s?t.wheelDeltaY/(120*o):t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?Fs&&!K.i?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)Vs&&K.n?this.deltaX=-t.wheelDeltaX/120:this.deltaX=s?t.wheelDeltaX/(120*o):t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?Fs&&!K.i?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=s?e.wheelDelta/(120*o):e.wheelDelta/120)}}preventDefault(){var e;null===(e=this.browserEvent)||void 0===e||e.preventDefault()}stopPropagation(){var e;null===(e=this.browserEvent)||void 0===e||e.stopPropagation()}}const no=Symbol("MicrotaskDelay");function so(e){return!!e&&"function"==typeof e.then}function oo(e){const t=new xt,i=e(t.token),n=new Promise((e,n)=>{const s=t.token.onCancellationRequested(()=>{s.dispose(),n(new ze)});Promise.resolve(i).then(i=>{s.dispose(),t.dispose(),e(i)},e=>{s.dispose(),t.dispose(),n(e)})});return new class{cancel(){t.cancel(),t.dispose()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}class ro{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{if(this.queuedPromise=null,this.isDisposed)return;const 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(),new Promise((e,t)=>{this.activePromise.then(t=>{this.activePromise=null,e(t)},e=>{this.activePromise=null,t(e)})})}dispose(){this.isDisposed=!0}}class ao{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||(this.completionPromise=new Promise((e,t)=>{this.doResolve=e,this.doReject=t}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}}));const i=()=>{var e;this.deferred=null,null===(e=this.doResolve)||void 0===e||e.call(this,null)};return this.deferred=t===no?(e=>{let t=!0;return queueMicrotask(()=>{t&&(t=!1,e())}),{isTriggered:()=>t,dispose:()=>{t=!1}}})(i):((e,t)=>{let i=!0;const n=setTimeout(()=>{i=!1,t()},e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(n),i=!1}}})(t,i),this.completionPromise}isTriggered(){var e;return!!(null===(e=this.deferred)||void 0===e?void 0:e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&(null===(e=this.doReject)||void 0===e||e.call(this,new ze),this.completionPromise=null)}cancelTimeout(){var e;null===(e=this.deferred)||void 0===e||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class lo{constructor(e){this.delayer=new ao(e),this.throttler=new ro}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function ho(e,t){return t?new Promise((i,n)=>{const s=setTimeout(()=>{o.dispose(),i()},e),o=t.onCancellationRequested(()=>{clearTimeout(s),o.dispose(),n(new ze)})}):oo(t=>ho(e,t))}function co(e,t=0,i){const n=setTimeout(()=>{e(),i&&s.dispose()},t),s=it(()=>{clearTimeout(n),null==i||i.deleteAndLeak(s)});return null==i||i.add(s),s}class uo{constructor(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){-1===this._token&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class go{constructor(){this.disposable=void 0}cancel(){var e;null===(e=this.disposable)||void 0===e||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){this.cancel();const n=i.setInterval(()=>{e()},t);this.disposable=it(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel()}}class mo{constructor(e,t){this.timeoutToken=-1,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=-1)}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-1!==this.timeoutToken}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;null===(e=this.runner)||void 0===e||e.call(this)}}let fo,po;po="function"!=typeof globalThis.requestIdleCallback||"function"!=typeof globalThis.cancelIdleCallback?(e,t)=>{Object(K.o)(()=>{if(i)return;const e=Date.now()+15,n={didTimeout:!0,timeRemaining:()=>Math.max(0,e-Date.now())};t(Object.freeze(n))});let i=!1;return{dispose(){i||(i=!0)}}}:(e,t,i)=>{const n=e.requestIdleCallback(t,"number"==typeof i?{timeout:i}:void 0);let s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(n))}}},fo=e=>po(globalThis,e);class _o{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}}class vo extends _o{constructor(e){super(globalThis,e)}}class bo{get isRejected(){var e;return 1===(null===(e=this.outcome)||void 0===e?void 0:e.outcome)}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new ze)}}var Co;!function(e){e.settled=async function(e){let t=void 0;const i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if(void 0!==t)throw t;return i},e.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})}}(Co||(Co={}));class wo{static fromArray(e){return new wo(t=>{t.emitMany(e)})}static fromPromise(e){return new wo(async t=>{t.emitMany(await e)})}static fromPromises(e){return new wo(async t=>{await Promise.all(e.map(async e=>t.emitOne(await e)))})}static merge(e){return new wo(async t=>{await Promise.all(e.map(async e=>{for await(const i of e)t.emitOne(i)}))})}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new ft,queueMicrotask(async()=>{const 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()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await dt.toPromise(this._onStateChanged.event)}}}}static map(e,t){return new wo(async i=>{for await(const n of e)i.emitOne(t(n))})}map(e){return wo.map(this,e)}static filter(e,t){return new wo(async i=>{for await(const n of e)t(n)&&i.emitOne(n)})}filter(e){return wo.filter(this,e)}static coalesce(e){return wo.filter(e,e=>!!e)}coalesce(){return wo.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return wo.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}}wo.EMPTY=wo.fromArray([]);const{entries:yo,setPrototypeOf:So,isFrozen:Lo,getPrototypeOf:ko,getOwnPropertyDescriptor:Do}=Object;let{freeze:xo,seal:Eo,create:No}=Object,{apply:Io,construct:To}="undefined"!=typeof Reflect&&Reflect;Io||(Io=function(e,t,i){return e.apply(t,i)}),xo||(xo=function(e){return e}),Eo||(Eo=function(e){return e}),To||(To=function(e,t){return new e(...t)});const Mo=Uo(Array.prototype.forEach),Ao=Uo(Array.prototype.pop),Oo=Uo(Array.prototype.push),Ro=Uo(String.prototype.toLowerCase),Po=Uo(String.prototype.toString),Fo=Uo(String.prototype.match),Bo=Uo(String.prototype.replace),Wo=Uo(String.prototype.indexOf),Vo=Uo(String.prototype.trim),Ho=Uo(RegExp.prototype.test),zo=(Ko=TypeError,function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return To(Ko,t)});var Ko;function Uo(e){return function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];return Io(e,t,n)}}function jo(e,t,i){var n;i=null!==(n=i)&&void 0!==n?n:Ro,So&&So(e,null);let s=t.length;for(;s--;){let n=t[s];if("string"==typeof n){const e=i(n);e!==n&&(Lo(t)||(t[s]=e),n=e)}e[n]=!0}return e}function qo(e){const t=No(null);for(const[i,n]of yo(e))t[i]=n;return t}function $o(e,t){for(;null!==e;){const i=Do(e,t);if(i){if(i.get)return Uo(i.get);if("function"==typeof i.value)return Uo(i.value)}e=ko(e)}return function(e){return console.warn("fallback value for",e),null}}const Go=xo(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Zo=xo(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Yo=xo(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Qo=xo(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Xo=xo(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Jo=xo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),er=xo(["#text"]),tr=xo(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),ir=xo(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),nr=xo(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),sr=xo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),or=Eo(/\{\{[\w\W]*|[\w\W]*\}\}/gm),rr=Eo(/<%[\w\W]*|[\w\W]*%>/gm),ar=Eo(/\${[\w\W]*}/gm),lr=Eo(/^data-[\-\w.\u00B7-\uFFFF]/),hr=Eo(/^aria-[\-\w]+$/),dr=Eo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cr=Eo(/^(?:\w+script|data):/i),ur=Eo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gr=Eo(/^html$/i);var mr=Object.freeze({__proto__:null,MUSTACHE_EXPR:or,ERB_EXPR:rr,TMPLIT_EXPR:ar,DATA_ATTR:lr,ARIA_ATTR:hr,IS_ALLOWED_URI:dr,IS_SCRIPT_OR_DATA:cr,ATTR_WHITESPACE:ur,DOCTYPE_NAME:gr});const fr=()=>"undefined"==typeof window?null:window,pr=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null;t&&t.hasAttribute("data-tt-policy-suffix")&&(i=t.getAttribute("data-tt-policy-suffix"));const n="dompurify"+(i?"#"+i:"");try{return e.createPolicy(n,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+n+" could not be created."),null}};var _r=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fr();const i=t=>e(t);if(i.version="3.0.5",i.removed=[],!t||!t.document||9!==t.document.nodeType)return i.isSupported=!1,i;const n=t.document,s=n.currentScript;let{document:o}=t;const{DocumentFragment:r,HTMLTemplateElement:a,Node:l,Element:h,NodeFilter:d,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:m}=t,f=h.prototype,p=$o(f,"cloneNode"),_=$o(f,"nextSibling"),v=$o(f,"childNodes"),b=$o(f,"parentNode");if("function"==typeof a){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let C,w="";const{implementation:y,createNodeIterator:S,createDocumentFragment:L,getElementsByTagName:k}=o,{importNode:D}=n;let x={};i.isSupported="function"==typeof yo&&"function"==typeof b&&y&&void 0!==y.createHTMLDocument;const{MUSTACHE_EXPR:E,ERB_EXPR:N,TMPLIT_EXPR:I,DATA_ATTR:T,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:A,ATTR_WHITESPACE:O}=mr;let{IS_ALLOWED_URI:R}=mr,P=null;const F=jo({},[...Go,...Zo,...Yo,...Xo,...er]);let B=null;const W=jo({},[...tr,...ir,...nr,...sr]);let V=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),H=null,z=null,K=!0,U=!0,j=!1,q=!0,$=!1,G=!1,Z=!1,Y=!1,Q=!1,X=!1,J=!1,ee=!0,te=!1;const ie="user-content-";let ne=!0,se=!1,oe={},re=null;const ae=jo({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let le=null;const he=jo({},["audio","video","img","source","image","track"]);let de=null;const ce=jo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let fe=me,pe=!1,_e=null;const ve=jo({},[ue,ge,me],Po);let be;const Ce=["application/xhtml+xml","text/html"],we="text/html";let ye,Se=null;const Le=o.createElement("form"),ke=function(e){return e instanceof RegExp||e instanceof Function},De=function(e){if(!Se||Se!==e){if(e&&"object"==typeof e||(e={}),e=qo(e),be=be=-1===Ce.indexOf(e.PARSER_MEDIA_TYPE)?we:e.PARSER_MEDIA_TYPE,ye="application/xhtml+xml"===be?Po:Ro,P="ALLOWED_TAGS"in e?jo({},e.ALLOWED_TAGS,ye):F,B="ALLOWED_ATTR"in e?jo({},e.ALLOWED_ATTR,ye):W,_e="ALLOWED_NAMESPACES"in e?jo({},e.ALLOWED_NAMESPACES,Po):ve,de="ADD_URI_SAFE_ATTR"in e?jo(qo(ce),e.ADD_URI_SAFE_ATTR,ye):ce,le="ADD_DATA_URI_TAGS"in e?jo(qo(he),e.ADD_DATA_URI_TAGS,ye):he,re="FORBID_CONTENTS"in e?jo({},e.FORBID_CONTENTS,ye):ae,H="FORBID_TAGS"in e?jo({},e.FORBID_TAGS,ye):{},z="FORBID_ATTR"in e?jo({},e.FORBID_ATTR,ye):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,K=!1!==e.ALLOW_ARIA_ATTR,U=!1!==e.ALLOW_DATA_ATTR,j=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,$=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,Q=e.RETURN_DOM||!1,X=e.RETURN_DOM_FRAGMENT||!1,J=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,ne=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||dr,fe=e.NAMESPACE||me,V=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ke(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ke(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(V.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$&&(U=!1),X&&(Q=!0),oe&&(P=jo({},[...er]),B=[],!0===oe.html&&(jo(P,Go),jo(B,tr)),!0===oe.svg&&(jo(P,Zo),jo(B,ir),jo(B,sr)),!0===oe.svgFilters&&(jo(P,Yo),jo(B,ir),jo(B,sr)),!0===oe.mathMl&&(jo(P,Xo),jo(B,nr),jo(B,sr))),e.ADD_TAGS&&(P===F&&(P=qo(P)),jo(P,e.ADD_TAGS,ye)),e.ADD_ATTR&&(B===W&&(B=qo(B)),jo(B,e.ADD_ATTR,ye)),e.ADD_URI_SAFE_ATTR&&jo(de,e.ADD_URI_SAFE_ATTR,ye),e.FORBID_CONTENTS&&(re===ae&&(re=qo(re)),jo(re,e.FORBID_CONTENTS,ye)),ne&&(P["#text"]=!0),G&&jo(P,["html","head","body"]),P.table&&(jo(P,["tbody"]),delete H.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw zo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw zo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=e.TRUSTED_TYPES_POLICY,w=C.createHTML("")}else void 0===C&&(C=pr(m,s)),null!==C&&"string"==typeof w&&(w=C.createHTML(""));xo&&xo(e),Se=e}},xe=jo({},["mi","mo","mn","ms","mtext"]),Ee=jo({},["foreignobject","desc","title","annotation-xml"]),Ne=jo({},["title","style","font","a","script"]),Ie=jo({},Zo);jo(Ie,Yo),jo(Ie,Qo);const Te=jo({},Xo);jo(Te,Jo);const Me=function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:fe,tagName:"template"});const i=Ro(e.tagName),n=Ro(t.tagName);return!!_e[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===me?"svg"===i:t.namespaceURI===ue?"svg"===i&&("annotation-xml"===n||xe[n]):Boolean(Ie[i]):e.namespaceURI===ue?t.namespaceURI===me?"math"===i:t.namespaceURI===ge?"math"===i&&Ee[n]:Boolean(Te[i]):e.namespaceURI===me?!(t.namespaceURI===ge&&!Ee[n])&&(!(t.namespaceURI===ue&&!xe[n])&&(!Te[i]&&(Ne[i]||!Ie[i]))):!("application/xhtml+xml"!==be||!_e[e.namespaceURI]))},Ae=function(e){Oo(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Oe=function(e,t){try{Oo(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Oo(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!B[e])if(Q||X)try{Ae(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Re=function(e){let t,i;if(Y)e="<remove></remove>"+e;else{const t=Fo(e,/^[\r\n\t ]+/);i=t&&t[0]}"application/xhtml+xml"===be&&fe===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const n=C?C.createHTML(e):e;if(fe===me)try{t=(new g).parseFromString(n,be)}catch(e){}if(!t||!t.documentElement){t=y.createDocument(fe,"template",null);try{t.documentElement.innerHTML=pe?w:n}catch(e){}}const s=t.body||t.documentElement;return e&&i&&s.insertBefore(o.createTextNode(i),s.childNodes[0]||null),fe===me?k.call(t,G?"html":"body")[0]:G?t.documentElement:s},Pe=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Fe=function(e){return e instanceof u&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof c)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Be=function(e){return"object"==typeof l?e instanceof l:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},We=function(e,t,n){x[e]&&Mo(x[e],e=>{e.call(i,t,n,Se)})},Ve=function(e){let t;if(We("beforeSanitizeElements",e,null),Fe(e))return Ae(e),!0;const n=ye(e.nodeName);if(We("uponSanitizeElement",e,{tagName:n,allowedTags:P}),e.hasChildNodes()&&!Be(e.firstElementChild)&&(!Be(e.content)||!Be(e.content.firstElementChild))&&Ho(/<[/\w]/g,e.innerHTML)&&Ho(/<[/\w]/g,e.textContent))return Ae(e),!0;if(!P[n]||H[n]){if(!H[n]&&ze(n)){if(V.tagNameCheck instanceof RegExp&&Ho(V.tagNameCheck,n))return!1;if(V.tagNameCheck instanceof Function&&V.tagNameCheck(n))return!1}if(ne&&!re[n]){const t=b(e)||e.parentNode,i=v(e)||e.childNodes;if(i&&t){for(let n=i.length-1;n>=0;--n)t.insertBefore(p(i[n],!0),_(e))}}return Ae(e),!0}return e instanceof h&&!Me(e)?(Ae(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!Ho(/<\/no(script|embed|frames)/i,e.innerHTML)?($&&3===e.nodeType&&(t=e.textContent,t=Bo(t,E," "),t=Bo(t,N," "),t=Bo(t,I," "),e.textContent!==t&&(Oo(i.removed,{element:e.cloneNode()}),e.textContent=t)),We("afterSanitizeElements",e,null),!1):(Ae(e),!0)},He=function(e,t,i){if(ee&&("id"===t||"name"===t)&&(i in o||i in Le))return!1;if(U&&!z[t]&&Ho(T,t));else if(K&&Ho(M,t));else if(!B[t]||z[t]){if(!(ze(e)&&(V.tagNameCheck instanceof RegExp&&Ho(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&Ho(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t))||"is"===t&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&Ho(V.tagNameCheck,i)||V.tagNameCheck instanceof Function&&V.tagNameCheck(i))))return!1}else if(de[t]);else if(Ho(R,Bo(i,O,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Wo(i,"data:")||!le[e]){if(j&&!Ho(A,Bo(i,O,"")));else if(i)return!1}else;return!0},ze=function(e){return e.indexOf("-")>0},Ke=function(e){let t,n,s,o;We("beforeSanitizeAttributes",e,null);const{attributes:r}=e;if(!r)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B};for(o=r.length;o--;){t=r[o];const{name:l,namespaceURI:h}=t;if(n="value"===l?t.value:Vo(t.value),s=ye(l),a.attrName=s,a.attrValue=n,a.keepAttr=!0,a.forceKeepAttr=void 0,We("uponSanitizeAttribute",e,a),n=a.attrValue,a.forceKeepAttr)continue;if(Oe(l,e),!a.keepAttr)continue;if(!q&&Ho(/\/>/i,n)){Oe(l,e);continue}$&&(n=Bo(n,E," "),n=Bo(n,N," "),n=Bo(n,I," "));const d=ye(e.nodeName);if(He(d,s,n)){if(!te||"id"!==s&&"name"!==s||(Oe(l,e),n=ie+n),C&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(h);else switch(m.getAttributeType(d,s)){case"TrustedHTML":n=C.createHTML(n);break;case"TrustedScriptURL":n=C.createScriptURL(n)}try{h?e.setAttributeNS(h,l,n):e.setAttribute(l,n),Ao(i.removed)}catch(e){}}}We("afterSanitizeAttributes",e,null)},Ue=function e(t){let i;const n=Pe(t);for(We("beforeSanitizeShadowDOM",t,null);i=n.nextNode();)We("uponSanitizeShadowNode",i,null),Ve(i)||(i.content instanceof r&&e(i.content),Ke(i));We("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(e){let t,s,o,a,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(pe=!e,pe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Be(e)){if("function"!=typeof e.toString)throw zo("toString is not a function");if("string"!=typeof(e=e.toString()))throw zo("dirty is not a string, aborting")}if(!i.isSupported)return e;if(Z||De(h),i.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=ye(e.nodeName);if(!P[t]||H[t])throw zo("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)t=Re("\x3c!----\x3e"),s=t.ownerDocument.importNode(e,!0),1===s.nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?t=s:t.appendChild(s);else{if(!Q&&!$&&!G&&-1===e.indexOf("<"))return C&&J?C.createHTML(e):e;if(t=Re(e),!t)return Q?null:J?w:""}t&&Y&&Ae(t.firstChild);const d=Pe(se?e:t);for(;o=d.nextNode();)Ve(o)||(o.content instanceof r&&Ue(o.content),Ke(o));if(se)return e;if(Q){if(X)for(a=L.call(t.ownerDocument);t.firstChild;)a.appendChild(t.firstChild);else a=t;return(B.shadowroot||B.shadowrootmode)&&(a=D.call(n,a,!0)),a}let c=G?t.outerHTML:t.innerHTML;return G&&P["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&Ho(gr,t.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+t.ownerDocument.doctype.name+">\n"+c),$&&(c=Bo(c,E," "),c=Bo(c,N," "),c=Bo(c,I," ")),C&&J?C.createHTML(c):c},i.setConfig=function(e){De(e),Z=!0},i.clearConfig=function(){Se=null,Z=!1},i.isValidAttribute=function(e,t,i){Se||De({});const n=ye(e),s=ye(t);return He(n,s,i)},i.addHook=function(e,t){"function"==typeof t&&(x[e]=x[e]||[],Oo(x[e],t))},i.removeHook=function(e){if(x[e])return Ao(x[e])},i.removeHooks=function(e){x[e]&&(x[e]=[])},i.removeAllHooks=function(){x={}},i}();_r.version,_r.isSupported;const vr=_r.sanitize,br=(_r.setConfig,_r.clearConfig,_r.isValidAttribute,_r.addHook),Cr=_r.removeHook;_r.removeHooks,_r.removeAllHooks;var wr;function yr(e,t){return di.isUri(e)?os(e.scheme,t):rs(e,t+":")}function Sr(e,...t){return t.some(t=>yr(e,t))}!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.vscodeNotebookCellOutput="vscode-notebook-cell-output",e.vscodeInteractiveInput="vscode-interactive-input",e.vscodeSettings="vscode-settings",e.vscodeWorkspaceTrust="vscode-workspace-trust",e.vscodeTerminal="vscode-terminal",e.vscodeChatCodeBlock="vscode-chat-code-block",e.vscodeChatSesssion="vscode-chat-editor",e.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.extension="extension",e.vscodeFileResource="vscode-file",e.tmp="tmp",e.vsls="vsls",e.vscodeSourceControl="vscode-scm",e.codeSetting="code-setting",e.codeFeature="code-feature"}(wr||(wr={}));const Lr=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._remoteResourcesPath="/"+wr.vscodeRemoteResource}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(t){return Be(t),e}const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&-1===i.indexOf("[")&&(i=`[${i}]`);const n=this._ports[t],s=this._connectionTokens[t];let o="path="+encodeURIComponent(e.path);return"string"==typeof s&&(o+="&tkn="+encodeURIComponent(s)),di.from({scheme:K.m?this._preferredWebSchema:wr.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:o})}};class kr{uriToBrowserUri(e){return e.scheme===wr.vscodeRemote?Lr.rewrite(e):e.scheme!==wr.file||!K.k&&K.p!==`${wr.vscodeFileResource}://${kr.FALLBACK_AUTHORITY}`?e:e.with({scheme:wr.vscodeFileResource,authority:e.authority||kr.FALLBACK_AUTHORITY,query:null,fragment:null})}}kr.FALLBACK_AUTHORITY="vscode-app";const Dr=new kr;var xr;function Er(e){return Nr(e,0)}function Nr(e,t){switch(typeof e){case"object":return null===e?Ir(349,t):Array.isArray(e)?(i=e,n=Ir(104579,n=t),i.reduce((e,t)=>Nr(t,e),n)):function(e,t){return t=Ir(181387,t),Object.keys(e).sort().reduce((t,i)=>(t=Tr(i,t),Nr(e[i],t)),t)}(e,t);case"string":return Tr(e,t);case"boolean":return function(e,t){return Ir(e?433:863,t)}(e,t);case"number":return Ir(e,t);case"undefined":return Ir(937,t);default:return Ir(617,t)}var i,n}function Ir(e,t){return(t<<5)-t+e|0}function Tr(e,t){t=Ir(149417,t);for(let i=0,n=e.length;i<n;i++)t=Ir(e.charCodeAt(i),t);return t}function Mr(e,t,i=32){const n=i-t;return(e<<t|(~((1<<n)-1)&e)>>>n)>>>0}function Ar(e,t=0,i=e.byteLength,n=0){for(let s=0;s<i;s++)e[t+s]=n}function Or(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join(""):function(e,t,i="0"){for(;e.length<t;)e=i+e;return e}((e>>>0).toString(16),t/4)}!function(e){const 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"));e.getHeadersFromQuery=function(e){let i;"string"==typeof e?i=new URL(e).searchParams:e instanceof URL?i=e.searchParams:di.isUri(e)&&(i=new URL(e.toString(!0)).searchParams);const n=null==i?void 0:i.get("vscode-coi");if(n)return t.get(n)},e.addSearchParam=function(e,t,i){if(!globalThis.crossOriginIsolated)return;const n=t&&i?"3":i?"2":"1";e instanceof URLSearchParams?e.set("vscode-coi",n):e["vscode-coi"]=n}}(xr||(xr={}));class Rr{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const i=this._buff;let n,s,o=this._buffLen,r=this._leftoverHighSurrogate;for(0!==r?(n=r,s=-1,r=0):(n=e.charCodeAt(0),s=0);;){let a=n;if(hs(n)){if(!(s+1<t)){r=n;break}{const t=e.charCodeAt(s+1);ds(t)?(s++,a=cs(n,t)):a=65533}}else ds(n)&&(a=65533);if(o=this._push(i,o,a),s++,!(s<t))break;n=e.charCodeAt(s)}this._buffLen=o,this._leftoverHighSurrogate=r}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(1984&i)>>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Or(this._h0)+Or(this._h1)+Or(this._h2)+Or(this._h3)+Or(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Ar(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Ar(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=Rr._bigBlock32,t=this._buffDV;for(let i=0;i<64;i+=4)e.setUint32(i,t.getUint32(i,!1),!1);for(let t=64;t<320;t+=4)e.setUint32(t,Mr(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let i,n,s,o=this._h0,r=this._h1,a=this._h2,l=this._h3,h=this._h4;for(let t=0;t<80;t++)t<20?(i=r&a|~r&l,n=1518500249):t<40?(i=r^a^l,n=1859775393):t<60?(i=r&a|r&l|a&l,n=2400959708):(i=r^a^l,n=3395469782),s=Mr(o,5)+i+h+n+e.getUint32(4*t,!1)&4294967295,h=l,l=a,a=Mr(r,30),r=o,o=s;this._h0=this._h0+o&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+h&4294967295}}Rr._bigBlock32=new DataView(new ArrayBuffer(320));const{registerWindow:Pr,getWindow:Fr,getDocument:Br,getWindows:Wr,getWindowsCount:Vr,getWindowId:Hr,getWindowById:zr,hasWindow:Kr,onDidRegisterWindow:Ur,onWillUnregisterWindow:jr,onDidUnregisterWindow:qr}=function(){const e=new Map;!function(e,t){const i=e;"number"!=typeof i.vscodeWindowId&&Object.defineProperty(i,"vscodeWindowId",{get:()=>t})}(Pn,1);const t={window:Pn,disposables:new nt};e.set(Pn.vscodeWindowId,t);const i=new ft,n=new ft,s=new ft;return{onDidRegisterWindow:i.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:n.event,registerWindow(t){if(e.has(t.vscodeWindowId))return st.None;const o=new nt,r={window:t,disposables:o.add(new nt)};return e.set(t.vscodeWindowId,r),o.add(it(()=>{e.delete(t.vscodeWindowId),n.fire(t)})),o.add(Zr(t,Ma.BEFORE_UNLOAD,()=>{s.fire(t)})),i.fire(r),o},getWindows:()=>e.values(),getWindowsCount:()=>e.size,getWindowId:e=>e.vscodeWindowId,hasWindow:t=>e.has(t),getWindowById:function(i,n){const s="number"==typeof i?e.get(i):void 0;return null!=s?s:n?t:void 0},getWindow(e){var t;const i=e;if(null===(t=null==i?void 0:i.ownerDocument)||void 0===t?void 0:t.defaultView)return i.ownerDocument.defaultView.window;const n=e;return(null==n?void 0:n.view)?n.view.window:Pn},getDocument:e=>Fr(e).document}}();function $r(e){for(;e.firstChild;)e.firstChild.remove()}class Gr{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function Zr(e,t,i,n){return new Gr(e,t,i,n)}function Yr(e,t){return function(i){return t(new to(e,i))}}const Qr=function(e,t,i,n){let s=i;return"click"===t||"mousedown"===t?s=Yr(Fr(e),i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(s=function(e){return function(t){return e(new Xs(t))}}(i)),Zr(e,t,s,n)};function Xr(e,t,i){return po(e,t,i)}let Jr,ea;class ta extends go{constructor(e){super(),this.defaultTarget=e&&Fr(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,null!=i?i:this.defaultTarget)}}class ia{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Be(e)}}static sort(e,t){return t.priority-e.priority}}function na(e){return Fr(e).getComputedStyle(e,null)}function sa(e,t){const i=Fr(e),n=i.document;if(e!==n.body)return new ra(e.clientWidth,e.clientHeight);if(K.f&&(null==i?void 0:i.visualViewport))return new ra(i.visualViewport.width,i.visualViewport.height);if((null==i?void 0:i.innerWidth)&&i.innerHeight)return new ra(i.innerWidth,i.innerHeight);if(n.body&&n.body.clientWidth&&n.body.clientHeight)return new ra(n.body.clientWidth,n.body.clientHeight);if(n.documentElement&&n.documentElement.clientWidth&&n.documentElement.clientHeight)return new ra(n.documentElement.clientWidth,n.documentElement.clientHeight);if(t)return sa(t);throw new Error("Unable to figure out browser width and height")}!function(){const e=new Map,t=new Map,i=new Map,n=new Map;ea=(s,o,r=0)=>{const a=Hr(s),l=new ia(o,r);let h=e.get(a);return h||(h=[],e.set(a,h)),h.push(l),i.get(a)||(i.set(a,!0),s.requestAnimationFrame(()=>(s=>{var o;i.set(s,!1);const r=null!==(o=e.get(s))&&void 0!==o?o:[];for(t.set(s,r),e.set(s,[]),n.set(s,!0);r.length>0;){r.sort(ia.sort);r.shift().execute()}n.set(s,!1)})(a))),l},Jr=(e,i,s)=>{const o=Hr(e);if(n.get(o)){const e=new ia(i,s);let n=t.get(o);return n||(n=[],t.set(o,n)),n.push(e),e}return ea(e,i,s)}}();class oa{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=na(e),s=n?n.getPropertyValue(t):"0";return oa.convertToPixels(e,s)}static getBorderLeftWidth(e){return oa.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return oa.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return oa.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return oa.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return oa.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return oa.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return oa.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return oa.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return oa.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return oa.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return oa.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return oa.getDimension(e,"margin-bottom","marginBottom")}}class ra{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new ra(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof ra?e:new ra(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&(e.width===t.width&&e.height===t.height)}}function aa(e){const t=e.getBoundingClientRect(),i=Fr(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}function la(e){let t=e,i=1;do{const e=na(t).zoom;null!=e&&"1"!==e&&(i*=e),t=t.parentElement}while(null!==t&&t!==t.ownerDocument.documentElement);return i}function ha(e){const t=oa.getMarginLeft(e)+oa.getMarginRight(e);return e.offsetWidth+t}function da(e){const t=oa.getBorderLeftWidth(e)+oa.getBorderRightWidth(e),i=oa.getPaddingLeft(e)+oa.getPaddingRight(e);return e.offsetWidth-t-i}function ca(e){const t=oa.getBorderTopWidth(e)+oa.getBorderBottomWidth(e),i=oa.getPaddingTop(e)+oa.getPaddingBottom(e);return e.offsetHeight-t-i}function ua(e){const t=oa.getMarginTop(e)+oa.getMarginBottom(e);return e.offsetHeight+t}function ga(e,t){return Boolean(null==t?void 0:t.contains(e))}function ma(e,t,i){return!!function(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}(e,t,i)}function fa(e){return e&&!!e.host&&!!e.mode}function pa(e){return!!_a(e)}function _a(e){for(var t;e.parentNode;){if(e===(null===(t=e.ownerDocument)||void 0===t?void 0:t.body))return null;e=e.parentNode}return fa(e)?e:null}function va(){let e=wa().activeElement;for(;null==e?void 0:e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ba(e){return va()===e}function Ca(e){return ga(va(),e)}function wa(){var e;if(Vr()<=1)return Pn.document;return null!==(e=Array.from(Wr()).map(({window:e})=>e.document).find(e=>e.hasFocus()))&&void 0!==e?e:Pn.document}ra.None=new ra(0,0);const ya=new Map;function Sa(e=Pn.document.head,t,i){const n=document.createElement("style");if(n.type="text/css",n.media="screen",null==t||t(n),e.appendChild(n),i&&i.add(it(()=>e.removeChild(n))),e===Pn.document.head){const e=new Set;ya.set(n,e);for(const{window:t,disposables:s}of Wr()){if(t===Pn)continue;const o=s.add(La(n,e,t));null==i||i.add(o)}}return n}function La(e,t,i){var n,s;const o=new nt,r=e.cloneNode(!0);i.document.head.appendChild(r),o.add(it(()=>i.document.head.removeChild(r)));for(const t of Ea(e))null===(n=r.sheet)||void 0===n||n.insertRule(t.cssText,null===(s=r.sheet)||void 0===s?void 0:s.cssRules.length);return o.add(ka.observe(e,o,{childList:!0})(()=>{r.textContent=e.textContent})),t.add(r),o.add(it(()=>t.delete(r))),o}const ka=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let n=this.mutationObservers.get(e);n||(n=new Map,this.mutationObservers.set(e,n));const s=Er(i);let o=n.get(s);if(o)o.users+=1;else{const r=new ft,a=new MutationObserver(e=>r.fire(e));a.observe(e,i);const l=o={users:1,observer:a,onDidMutate:r.event};t.add(it(()=>{l.users-=1,0===l.users&&(r.dispose(),a.disconnect(),null==n||n.delete(s),0===(null==n?void 0:n.size)&&this.mutationObservers.delete(e))})),n.set(s,o)}return o.onDidMutate}};let Da=null;function xa(){return Da||(Da=Sa()),Da}function Ea(e){var t,i;return(null===(t=null==e?void 0:e.sheet)||void 0===t?void 0:t.rules)?e.sheet.rules:(null===(i=null==e?void 0:e.sheet)||void 0===i?void 0:i.cssRules)?e.sheet.cssRules:[]}function Na(e,t,i=xa()){var n,s;if(i&&t){null===(n=i.sheet)||void 0===n||n.insertRule(`${e} {${t}}`,0);for(const n of null!==(s=ya.get(i))&&void 0!==s?s:[])Na(e,t,n)}}function Ia(e){return e instanceof MouseEvent||e instanceof Fr(e).MouseEvent}function Ta(e){return e instanceof KeyboardEvent||e instanceof Fr(e).KeyboardEvent}const Ma={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:Bs?"webkitAnimationStart":"animationstart",ANIMATION_END:Bs?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Bs?"webkitAnimationIteration":"animationiteration"};function Aa(e){const t=e;return!(!t||"function"!=typeof t.preventDefault||"function"!=typeof t.stopPropagation)}const Oa=(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e);class Ra extends st{static hasFocusWithin(e){if(e instanceof HTMLElement){const t=_a(e);return ga(t?t.activeElement:e.ownerDocument.activeElement,e)}{const t=e;return ga(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new ft),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new ft),this.onDidBlur=this._onDidBlur.event;let t=Ra.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},s=()=>{t&&(i=!0,(e instanceof HTMLElement?Fr(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{Ra.hasFocusWithin(e)!==t&&(t?s():n())},this._register(Zr(e,Ma.FOCUS,n,!0)),this._register(Zr(e,Ma.BLUR,s,!0)),e instanceof HTMLElement&&(this._register(Zr(e,Ma.FOCUS_IN,()=>this._refreshStateHandler())),this._register(Zr(e,Ma.FOCUS_OUT,()=>this._refreshStateHandler())))}}function Pa(e){return new Ra(e)}function Fa(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function Ba(e,t){return e.insertBefore(t,e.firstChild),t}function Wa(e,...t){e.innerText="",Fa(e,...t)}const Va=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Ha;function za(e,t,i,...n){const s=Va.exec(t);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return r=e!==Ha.HTML?document.createElementNS(e,o):document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([e,t])=>{void 0!==t&&(/^on\w+$/.test(e)?r[e]=t:"selected"===e?t&&r.setAttribute(e,"true"):r.setAttribute(e,t))}),r.append(...n),r}function Ka(e,t,...i){return za(Ha.HTML,e,t,...i)}function Ua(...e){for(const t of e)t.style.display="",t.removeAttribute("aria-hidden")}function ja(...e){for(const t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function qa(e,t){const i=e.devicePixelRatio*t;return Math.max(1,Math.floor(i))/e.devicePixelRatio}function $a(e){Pn.open(e,"_blank","noopener")}function Ga(e){return e?`url('${Dr.uriToBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Za(e){return`'${e.replace(/'/g,"%27")}'`}function Ya(e,t){if(void 0!==e){const i=e.match(/^\s*var\((.+)\)$/);if(i){const e=i[1].split(",",2);return 2===e.length&&(t=Ya(e[1].trim(),t)),`var(${e[0]}, ${t})`}return e}return t}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(Ha||(Ha={})),Ka.SVG=function(e,t,...i){return za(Ha.SVG,e,t,...i)},Lr.setPreferredWebSchema(/^https:/.test(Pn.location.href)?"https":"http");const Qa=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type","start"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});class Xa extends ft{constructor(){super(),this._subscriptions=new nt,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(dt.runAndSubscribe(Ur,({window:e,disposables:t})=>this.registerListeners(e,t),{window:Pn,disposables:this._subscriptions}))}registerListeners(e,t){t.add(Zr(e,"keydown",e=>{if(e.defaultPrevented)return;const t=new Xs(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),t.add(Zr(e,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),t.add(Zr(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(Zr(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(Zr(e.document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(Zr(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Xa.instance||(Xa.instance=new Xa),Xa.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Ja extends st{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(Zr(this.element,Ma.DRAG_START,e=>{var t,i;null===(i=(t=this.callbacks).onDragStart)||void 0===i||i.call(t,e)})),this.callbacks.onDrag&&this._register(Zr(this.element,Ma.DRAG,e=>{var t,i;null===(i=(t=this.callbacks).onDrag)||void 0===i||i.call(t,e)})),this._register(Zr(this.element,Ma.DRAG_ENTER,e=>{var t,i;this.counter++,this.dragStartTime=e.timeStamp,null===(i=(t=this.callbacks).onDragEnter)||void 0===i||i.call(t,e)})),this._register(Zr(this.element,Ma.DRAG_OVER,e=>{var t,i;e.preventDefault(),null===(i=(t=this.callbacks).onDragOver)||void 0===i||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(Zr(this.element,Ma.DRAG_LEAVE,e=>{var t,i;this.counter--,0===this.counter&&(this.dragStartTime=0,null===(i=(t=this.callbacks).onDragLeave)||void 0===i||i.call(t,e))})),this._register(Zr(this.element,Ma.DRAG_END,e=>{var t,i;this.counter=0,this.dragStartTime=0,null===(i=(t=this.callbacks).onDragEnd)||void 0===i||i.call(t,e)})),this._register(Zr(this.element,Ma.DROP,e=>{var t,i;this.counter=0,this.dragStartTime=0,null===(i=(t=this.callbacks).onDrop)||void 0===i||i.call(t,e)}))}}const el=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function tl(e,...t){let i,n;Array.isArray(t[0])?(i={},n=t[0]):(i=t[0]||{},n=t[1]);const s=el.exec(e);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",r=document.createElement(o);s.groups.id&&(r.id=s.groups.id);const a=[];if(s.groups.class)for(const e of s.groups.class.split("."))""!==e&&a.push(e);if(void 0!==i.className)for(const e of i.className.split("."))""!==e&&a.push(e);a.length>0&&(r.className=a.join(" "));const l={};if(s.groups.name&&(l[s.groups.name]=r),n)for(const e of n)e instanceof HTMLElement?r.appendChild(e):"string"==typeof e?r.append(e):"root"in e&&(Object.assign(l,e),r.appendChild(e.root));for(const[e,t]of Object.entries(i))if("className"!==e)if("style"===e)for(const[e,i]of Object.entries(t))r.style.setProperty(il(e),"number"==typeof i?i+"px":""+i);else"tabIndex"===e?r.tabIndex=t:r.setAttribute(il(e),t.toString());return l.root=r,l}function il(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class nl extends st{constructor(e){super(),this._onDidChange=this._register(new ft),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var i;null===(i=this._mediaQueryList)||void 0===i||i.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class sl extends st{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new ft),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new nl(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d");return(e.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}}const ol=new class{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=Hr(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=Je(new sl(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),Je(dt.once(qr)(({vscodeWindowId:e})=>{e===t&&(null==i||i.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}};class rl{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=al(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=al(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=al(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=al(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=al(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=al(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=al(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=al(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=al(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=al(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=al(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function al(e){return"number"==typeof e?e+"px":e}function ll(e){return new rl(e)}function hl(e,t){e instanceof rl?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setFontVariationSettings(t.fontVariationSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.fontVariationSettings=t.fontVariationSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}class dl{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class cl{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");hl(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");hl(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");hl(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const s=[];for(const e of this._requests){let o;0===e.type&&(o=t),2===e.type&&(o=i),1===e.type&&(o=n),o.appendChild(document.createElement("br"));const r=document.createElement("span");cl._render(r,e),o.appendChild(r),s.push(r)}this._container=e,this._testElements=s}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const t=this._requests[e],i=this._testElements[e];t.fulfill(i.offsetWidth/256)}}}const ul=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new ft,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))}},gl=K.i?1.5:1.35;class ml{static createFromValidatedSettings(e,t,i){const n=e.get(49),s=e.get(53),o=e.get(52),r=e.get(51),a=e.get(54),l=e.get(67),h=e.get(64);return ml._create(n,s,o,r,a,l,h,t,i)}static _create(e,t,i,n,s,o,r,a,l){0===o?o=gl*i:o<8&&(o*=i),(o=Math.round(o))<8&&(o=8);const h=1+(l?0:.1*ul.getZoomLevel());if(i*=h,o*=h,s===Ce.TRANSLATE)if("normal"===t||"bold"===t)s=Ce.OFF;else{s="'wght' "+parseInt(t,10),t="normal"}return new ml({pixelRatio:a,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:n,fontVariationSettings:s,lineHeight:o,letterSpacing:r})}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=0|e.lineHeight,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const e=Ae.fontFamily,t=ml._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}class fl extends ml{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}}class pl{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const _l=new class extends st{constructor(){super(...arguments),this._cache=new Map,this._evictUntrustedReadingsTimeout=-1,this._onDidChange=this._register(new ft),this.onDidChange=this._onDidChange.event}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache.clear(),this._onDidChange.fire()}_ensureCache(e){const t=Hr(e);let i=this._cache.get(t);return i||(i=new pl,this._cache.set(t,i)),i}_writeToCache(e,t,i){this._ensureCache(e).put(t,i),i.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=e.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let n=!1;for(const e of i)e.isTrusted||(n=!0,t.remove(e));n&&this._onDidChange.fire()}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let i=this._actualReadFontInfo(e,t);(i.typicalHalfwidthCharacterWidth<=2||i.typicalFullwidthCharacterWidth<=2||i.spaceWidth<=2||i.maxDigitWidth<=2)&&(i=new fl({pixelRatio:ol.getInstance(e).value,fontFamily:i.fontFamily,fontWeight:i.fontWeight,fontSize:i.fontSize,fontFeatureSettings:i.fontFeatureSettings,fontVariationSettings:i.fontVariationSettings,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,isMonospace:i.isMonospace,typicalHalfwidthCharacterWidth:Math.max(i.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(i.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:i.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(i.spaceWidth,5),middotWidth:Math.max(i.middotWidth,5),wsmiddotWidth:Math.max(i.wsmiddotWidth,5),maxDigitWidth:Math.max(i.maxDigitWidth,5)},!1)),this._writeToCache(e,t,i)}return i.get(t)}_createRequest(e,t,i,n){const s=new dl(e,t);return i.push(s),null==n||n.push(s),s}_actualReadFontInfo(e,t){const i=[],n=[],s=this._createRequest("n",0,i,n),o=this._createRequest("",0,i,null),r=this._createRequest(" ",0,i,n),a=this._createRequest("0",0,i,n),l=this._createRequest("1",0,i,n),h=this._createRequest("2",0,i,n),d=this._createRequest("3",0,i,n),c=this._createRequest("4",0,i,n),u=this._createRequest("5",0,i,n),g=this._createRequest("6",0,i,n),m=this._createRequest("7",0,i,n),f=this._createRequest("8",0,i,n),p=this._createRequest("9",0,i,n),_=this._createRequest("→",0,i,n),v=this._createRequest("→",0,i,null),b=this._createRequest("·",0,i,n),C=this._createRequest(String.fromCharCode(11825),0,i,null);for(let e=0,t="|/-_ilm%".length;e<t;e++)this._createRequest("|/-_ilm%".charAt(e),0,i,n),this._createRequest("|/-_ilm%".charAt(e),1,i,n),this._createRequest("|/-_ilm%".charAt(e),2,i,n);!function(e,t,i){new cl(t,i).read(e)}(e,t,i);const w=Math.max(a.width,l.width,h.width,d.width,c.width,u.width,g.width,m.width,f.width,p.width);let y=t.fontFeatureSettings===be.OFF;const S=n[0].width;for(let e=1,t=n.length;y&&e<t;e++){const t=S-n[e].width;if(t<-.001||t>.001){y=!1;break}}let L=!0;return y&&v.width!==S&&(L=!1),v.width>_.width&&(L=!1),new fl({pixelRatio:ol.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:y,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:L,spaceWidth:r.width,middotWidth:b.width,wsmiddotWidth:C.width,maxDigitWidth:w},!0)}};var vl;!function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(vl||(vl={}));const bl=wl("instantiationService");function Cl(e,t,i){t[vl.DI_TARGET]===t?t[vl.DI_DEPENDENCIES].push({id:e,index:i}):(t[vl.DI_DEPENDENCIES]=[{id:e,index:i}],t[vl.DI_TARGET]=t)}function wl(e){if(vl.serviceIds.has(e))return vl.serviceIds.get(e);const t=function(e,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Cl(t,e,n)};return t.toString=()=>e,vl.serviceIds.set(e,t),t}const yl=wl("codeEditorService"),Sl=wl("modelService"),Ll=wl("textModelService");class kl extends st{constructor(e,t="",i="",n=!0,s){super(),this._onDidChange=this._register(new ft),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=s}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 Dl extends st{constructor(){super(...arguments),this._onWillRun=this._register(new ft),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new ft),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let i=void 0;try{await this.runAction(e,t)}catch(e){i=e}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}class xl{constructor(){this.id=xl.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t=t.length?[...t,new xl,...i]:i);return t}async run(){}}xl.ID="vs.actions.separator";class El{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}async run(){}}class Nl extends kl{constructor(){super(Nl.ID,J.b("submenu.empty","(empty)"),void 0,!1)}}function Il(e){var t;return{id:e.id,label:e.label,class:e.class,enabled:null===(t=e.enabled)||void 0===t||t,checked:e.checked,run:async(...t)=>e.run(...t),tooltip:e.label}}var Tl,Ml;Nl.ID="vs.actions.empty",function(e){e.isThemeColor=function(e){return e&&"object"==typeof e&&"string"==typeof e.id}}(Tl||(Tl={})),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~-]";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){const n=t.exec(e.id);if(!n)return i(Di.error);const[,s,o]=n,r=["codicon","codicon-"+s];return o&&r.push("codicon-modifier-"+o.substring(1)),r}e.asClassNameArray=i,e.asClassName=function(e){return i(e).join(" ")},e.asCSSSelector=function(e){return"."+i(e).join(".")},e.isThemeIcon=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||Tl.isThemeColor(e.color))};const n=new RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);e.fromString=function(e){const t=n.exec(e);if(!t)return;const[,i]=t;return{id:i}},e.fromId=function(e){return{id:e}},e.modify=function(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}},e.getModifier=function(e){const t=e.id.lastIndexOf("~");if(-1!==t)return e.id.substring(t+1)},e.isEqual=function(e,t){var i,n;return e.id===t.id&&(null===(i=e.color)||void 0===i?void 0:i.id)===(null===(n=t.color)||void 0===n?void 0:n.id)}}(Ml||(Ml={}));const Al=wl("commandService"),Ol=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ft,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.metadata&&Array.isArray(e.metadata.args)){const t=[];for(const i of e.metadata.args)t.push(i.constraint);const i=e.handler;e.handler=function(e,...n){return function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)F(e[n],t[n])}(n,t),i(e,...n)}}const{id:i}=e;let n=this._commands.get(i);n||(n=new $,this._commands.set(i,n));const s=n.unshift(e),o=it(()=>{s();const e=this._commands.get(i);(null==e?void 0:e.isEmpty())&&this._commands.delete(i)});return this._onDidRegisterCommand.fire(i),o}registerCommandAlias(e,t){return Ol.registerCommand(e,(e,...i)=>e.get(Al).executeCommand(t,...i))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return j.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t);i&&e.set(t,i)}return e}};function Rl(...e){switch(e.length){case 1:return Object(J.b)("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",e[0]);case 2:return Object(J.b)("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",e[0],e[1]);case 3:return Object(J.b)("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",e[0],e[1],e[2]);default:return}}Ol.registerCommand("noop",()=>{});const Pl=Object(J.b)("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Fl=Object(J.b)("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class Bl{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 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:case 18:case 19:return e.lexeme;case 20:return"EOF";default:throw Ue(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();){this._start=this._current;switch(this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const e=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:e})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const e=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:e})}else this._match(126)?this._addToken(9):this._error(Rl("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(Rl("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(Rl("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return!this._isAtEnd()&&(this._input.charCodeAt(this._current)===e&&(this._current++,!0))}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),n={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(n)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=Bl._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;39!==this._peek()&&!this._isAtEnd();)this._advance();this._isAtEnd()?this._error(Pl):(this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1}))}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length)return this._current=e,void this._error(Fl);const n=this._input.charCodeAt(e);if(t)t=!1;else{if(47===n&&!i){e++;break}91===n?i=!0:92===n?t=!0:93===n&&(i=!1)}e++}for(;e<this._input.length&&Bl._regexFlags.has(this._input.charCodeAt(e));)e++;this._current=e;const n=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:n,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}}Bl._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0))),Bl._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Wl=new Map;Wl.set("false",!1),Wl.set("true",!0),Wl.set("isMac",K.i),Wl.set("isLinux",K.g),Wl.set("isWindows",K.n),Wl.set("isWeb",K.m),Wl.set("isMacNative",K.i&&!K.m),Wl.set("isEdge",K.d),Wl.set("isFirefox",K.e),Wl.set("isChrome",K.c),Wl.set("isSafari",K.l);const Vl=Object.prototype.hasOwnProperty,Hl={regexParsingWithErrorRecovery:!0},zl=Object(J.b)("contextkey.parser.error.emptyString","Empty context key expression"),Kl=Object(J.b)("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),Ul=Object(J.b)("contextkey.parser.error.noInAfterNot","'in' after 'not'."),jl=Object(J.b)("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),ql=Object(J.b)("contextkey.parser.error.unexpectedToken","Unexpected token"),$l=Object(J.b)("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),Gl=Object(J.b)("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),Zl=Object(J.b)("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");class Yl{constructor(e=Hl){this._config=e,this._scanner=new Bl,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(""!==e){this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const e=this._expr();if(!this._isAtEnd()){const e=this._peek(),t=17===e.type?$l:void 0;throw this._parsingErrors.push({message:ql,offset:e.offset,lexeme:Bl.getLexeme(e),additionalInfo:t}),Yl._parseError}return e}catch(e){if(e!==Yl._parseError)throw e;return}}else this._parsingErrors.push({message:zl,offset:0,lexeme:"",additionalInfo:Kl})}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return 1===e.length?e[0]:Ql.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return 1===e.length?e[0]:Ql.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Jl.INSTANCE;case 12:return this._advance(),eh.INSTANCE;case 0:{this._advance();const e=this._expr();return this._consume(1,jl),null==e?void 0:e.negate()}case 17:return this._advance(),rh.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),Ql.true();case 12:return this._advance(),Ql.false();case 0:{this._advance();const e=this._expr();return this._consume(1,jl),e}case 17:{const i=e.lexeme;if(this._advance(),this._matchOne(9)){const e=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),10!==e.type)throw this._errExpectedButGot("REGEX",e);const t=e.lexeme,n=t.lastIndexOf("/"),s=n===t.length-1?void 0:this._removeFlagsGY(t.substring(n+1));let o;try{o=new RegExp(t.substring(1,n),s)}catch(t){throw this._errExpectedButGot("REGEX",e)}return uh.create(i,o)}switch(e.type){case 10:case 19:{const t=[e.lexeme];this._advance();let n=this._peek(),s=0;for(let t=0;t<e.lexeme.length;t++)40===e.lexeme.charCodeAt(t)?s++:41===e.lexeme.charCodeAt(t)&&s--;for(;!this._isAtEnd()&&15!==n.type&&16!==n.type;){switch(n.type){case 0:s++;break;case 1:s--;break;case 10:case 18:for(let t=0;t<n.lexeme.length;t++)40===n.lexeme.charCodeAt(t)?s++:41===e.lexeme.charCodeAt(t)&&s--}if(s<0)break;t.push(Bl.getLexeme(n)),this._advance(),n=this._peek()}const o=t.join(""),r=o.lastIndexOf("/"),a=r===o.length-1?void 0:this._removeFlagsGY(o.substring(r+1));let l;try{l=new RegExp(o.substring(1,r),a)}catch(t){throw this._errExpectedButGot("REGEX",e)}return Ql.regex(i,l)}case 18:{const n=e.lexeme;this._advance();let s=null;if((t=n)&&"string"==typeof t&&0!==t.trim().length){const t=n.indexOf("/"),i=n.lastIndexOf("/");if(t!==i&&t>=0){const o=n.slice(t+1,i),r="i"===n[i+1]?"i":"";try{s=new RegExp(o,r)}catch(t){throw this._errExpectedButGot("REGEX",e)}}}if(null===s)throw this._errExpectedButGot("REGEX",e);return uh.create(i,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Ul);const e=this._value();return Ql.notIn(i,e)}switch(this._peek().type){case 3:{this._advance();const e=this._value();if(18===this._previous().type)return Ql.equals(i,e);switch(e){case"true":return Ql.has(i);case"false":return Ql.not(i);default:return Ql.equals(i,e)}}case 4:{this._advance();const e=this._value();if(18===this._previous().type)return Ql.notEquals(i,e);switch(e){case"true":return Ql.not(i);case"false":return Ql.has(i);default:return Ql.notEquals(i,e)}}case 5:return this._advance(),dh.create(i,this._value());case 6:return this._advance(),ch.create(i,this._value());case 7:return this._advance(),lh.create(i,this._value());case 8:return this._advance(),hh.create(i,this._value());case 13:return this._advance(),Ql.in(i,this._value());default:return Ql.has(i)}}case 20:throw this._parsingErrors.push({message:Gl,offset:e.offset,lexeme:"",additionalInfo:Zl}),Yl._parseError;default:throw this._errExpectedButGot("true | false | KEY \n\t| KEY '=~' REGEX \n\t| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value",this._peek())}var t}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13: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)}_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(e,t,i){const n=Object(J.b)("contextkey.parser.error.expectedButGot","Expected: {0}\nReceived: '{1}'.",e,Bl.getLexeme(t)),s=t.offset,o=Bl.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:o,additionalInfo:i}),Yl._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return 20===this._peek().type}}Yl._parseError=new Error;class Ql{static false(){return Jl.INSTANCE}static true(){return eh.INSTANCE}static has(e){return th.create(e)}static equals(e,t){return ih.create(e,t)}static notEquals(e,t){return oh.create(e,t)}static regex(e,t){return uh.create(e,t)}static in(e,t){return nh.create(e,t)}static notIn(e,t){return sh.create(e,t)}static not(e){return rh.create(e)}static and(...e){return fh.create(e,null,!0)}static or(...e){return ph.create(e,null,!0)}static deserialize(e){if(null==e)return;return this._parser.parse(e)}}function Xl(e,t){return e.cmp(t)}Ql._parser=new Yl({regexParsingWithErrorRecovery:!1});class Jl{constructor(){this.type=0}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[]}negate(){return eh.INSTANCE}}Jl.INSTANCE=new Jl;class eh{constructor(){this.type=1}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[]}negate(){return Jl.INSTANCE}}eh.INSTANCE=new eh;class th{static create(e,t=null){const i=Wl.get(e);return"boolean"==typeof i?i?eh.INSTANCE:Jl.INSTANCE:new th(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:bh(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=Wl.get(this.key);return"boolean"==typeof e?e?eh.INSTANCE:Jl.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=rh.create(this.key,this)),this.negated}}class ih{static create(e,t,i=null){if("boolean"==typeof t)return t?th.create(e,i):rh.create(e,i);const n=Wl.get(e);if("boolean"==typeof n){return t===(n?"true":"false")?eh.INSTANCE:Jl.INSTANCE}return new ih(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Ch(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=Wl.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?eh.INSTANCE:Jl.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=oh.create(this.key,this.value,this)),this.negated}}class nh{static create(e,t){return new nh(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Ch(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&(this.key===e.key&&this.valueKey===e.valueKey)}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):"string"==typeof i&&"object"==typeof t&&null!==t&&Vl.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=sh.create(this.key,this.valueKey)),this.negated}}class sh{static create(e,t){return new sh(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=nh.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type&&this._negated.equals(e._negated)}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class oh{static create(e,t,i=null){if("boolean"==typeof t)return t?rh.create(e,i):th.create(e,i);const n=Wl.get(e);if("boolean"==typeof n){return t===(n?"true":"false")?Jl.INSTANCE:eh.INSTANCE}return new oh(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Ch(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=Wl.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?Jl.INSTANCE:eh.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ih.create(this.key,this.value,this)),this.negated}}class rh{static create(e,t=null){const i=Wl.get(e);return"boolean"==typeof i?i?Jl.INSTANCE:eh.INSTANCE:new rh(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:bh(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=Wl.get(this.key);return"boolean"==typeof e?e?Jl.INSTANCE:eh.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return"!"+this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=th.create(this.key,this)),this.negated}}function ah(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):Jl.INSTANCE}class lh{static create(e,t,i=null){return ah(t,t=>new lh(e,t,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Ch(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ch.create(this.key,this.value,this)),this.negated}}class hh{static create(e,t,i=null){return ah(t,t=>new hh(e,t,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Ch(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=dh.create(this.key,this.value,this)),this.negated}}class dh{static create(e,t,i=null){return ah(t,t=>new dh(e,t,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Ch(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hh.create(this.key,this.value,this)),this.negated}}class ch{static create(e,t,i=null){return ah(t,t=>new ch(e,t,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Ch(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=lh.create(this.key,this.value,this)),this.negated}}class uh{static create(e,t){return new uh(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,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;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=gh.create(this)),this.negated}}class gh{static create(e){return new gh(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function mh(e){let t=null;for(let i=0,n=e.length;i<n;i++){const n=e[i].substituteConstants();if(e[i]!==n&&null===t){t=[];for(let n=0;n<i;n++)t[n]=e[n]}null!==t&&(t[i]=n)}return null===t?e:t}class fh{static create(e,t,i){return fh._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}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,i=this.expr.length;t<i;t++){const i=Xl(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=mh(this.expr);return e===this.expr?this:fh.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t,i){const n=[];let s=!1;for(const t of e)if(t)if(1!==t.type){if(0===t.type)return Jl.INSTANCE;6!==t.type?n.push(t):n.push(...t.expr)}else s=!0;if(0===n.length&&s)return eh.INSTANCE;if(0!==n.length){if(1===n.length)return n[0];n.sort(Xl);for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];for(;n.length>1;){const e=n[n.length-1];if(9!==e.type)break;n.pop();const t=n.pop(),s=0===n.length,o=ph.create(e.expr.map(e=>fh.create([e,t],null,i)),null,s);o&&(n.push(o),n.sort(Xl))}if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return Jl.INSTANCE;if(1===n.length)return n[0]}return new fh(n,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=ph.create(e,this,!0)}return this.negated}}class ph{static create(e,t,i){return ph._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}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,i=this.expr.length;t<i;t++){const i=Xl(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=mh(this.expr);return e===this.expr?this:ph.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,i){let n=[],s=!1;if(e){for(let t=0,i=e.length;t<i;t++){const i=e[t];if(i)if(0!==i.type){if(1===i.type)return eh.INSTANCE;9!==i.type?n.push(i):n=n.concat(i.expr)}else s=!0}if(0===n.length&&s)return Jl.INSTANCE;n.sort(Xl)}if(0!==n.length){if(1===n.length)return n[0];for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return eh.INSTANCE;if(1===n.length)return n[0]}return new ph(n,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const e of yh(t))for(const t of yh(i))n.push(fh.create([e,t],null,!1));e.unshift(ph.create(n,null,!1))}this.negated=ph.create(e,this,!0)}return this.negated}}class _h extends th{static all(){return _h._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,"object"==typeof i?_h._info.push({...i,key:e}):!0!==i&&_h._info.push({key:e,description:i,type:null!=t?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return ih.create(this.key,e)}}_h._info=[];const vh=wl("contextKeyService");function bh(e,t){return e<t?-1:e>t?1:0}function Ch(e,t,i,n){return e<i?-1:e>i?1:t<n?-1:t>n?1:0}function wh(e,t){let i=0,n=0;for(;i<e.length&&n<t.length;){const s=e[i].cmp(t[n]);if(s<0)return!1;0===s?(i++,n++):n++}return i===e.length}function yh(e){return 9===e.type?e.expr:[e]}function Sh(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function Lh(e,t="Unreachable"){throw new Error(t)}function kh(e){e||Be(new $e("Soft Assertion Failed"))}function Dh(e){e()||(e(),Be(new $e("Assertion Failed")))}function xh(e,t){let i=0;for(;i<e.length-1;){if(!t(e[i],e[i+1]))return!1;i++}return!0}const Eh=new class{constructor(){this.data=new Map}add(e,t){Sh(k(e)),Sh(D(t)),Sh(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}};class Nh{constructor(){this._coreKeybindings=new $,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===K.a){if(e&&e.win)return e.win}else if(2===K.a){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=Nh.bindToCurrentPlatform(e),i=new nt;if(t&&t.primary){const n=js(t.primary,K.a);n&&i.add(this._registerDefaultKeybinding(n,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let n=0,s=t.secondary.length;n<s;n++){const s=js(t.secondary[n],K.a);s&&i.add(this._registerDefaultKeybinding(s,e.id,e.args,e.weight,-n-1,e.when))}return i}registerCommandAndKeybindingRule(e){return tt(this.registerKeybindingRule(e),Ol.registerCommand(e))}_registerDefaultKeybinding(e,t,i,n,s,o){const r=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:o,weight1:n,weight2:s,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,it(()=>{r(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Th)),this._cachedMergedKeybindings.slice(0)}}const Ih=new Nh;function Th(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}Eh.add("platform.keybindingsRegistry",Ih);var Mh,Ah=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Oh=function(e,t){return function(i,n){t(i,n,e)}};function Rh(e){return void 0!==e.command}class Ph{constructor(e){if(Ph._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);Ph._instances.set(e,this),this.id=e}}Ph._instances=new Map,Ph.CommandPalette=new Ph("CommandPalette"),Ph.DebugBreakpointsContext=new Ph("DebugBreakpointsContext"),Ph.DebugCallStackContext=new Ph("DebugCallStackContext"),Ph.DebugConsoleContext=new Ph("DebugConsoleContext"),Ph.DebugVariablesContext=new Ph("DebugVariablesContext"),Ph.NotebookVariablesContext=new Ph("NotebookVariablesContext"),Ph.DebugHoverContext=new Ph("DebugHoverContext"),Ph.DebugWatchContext=new Ph("DebugWatchContext"),Ph.DebugToolBar=new Ph("DebugToolBar"),Ph.DebugToolBarStop=new Ph("DebugToolBarStop"),Ph.EditorContext=new Ph("EditorContext"),Ph.SimpleEditorContext=new Ph("SimpleEditorContext"),Ph.EditorContent=new Ph("EditorContent"),Ph.EditorLineNumberContext=new Ph("EditorLineNumberContext"),Ph.EditorContextCopy=new Ph("EditorContextCopy"),Ph.EditorContextPeek=new Ph("EditorContextPeek"),Ph.EditorContextShare=new Ph("EditorContextShare"),Ph.EditorTitle=new Ph("EditorTitle"),Ph.EditorTitleRun=new Ph("EditorTitleRun"),Ph.EditorTitleContext=new Ph("EditorTitleContext"),Ph.EditorTitleContextShare=new Ph("EditorTitleContextShare"),Ph.EmptyEditorGroup=new Ph("EmptyEditorGroup"),Ph.EmptyEditorGroupContext=new Ph("EmptyEditorGroupContext"),Ph.EditorTabsBarContext=new Ph("EditorTabsBarContext"),Ph.EditorTabsBarShowTabsSubmenu=new Ph("EditorTabsBarShowTabsSubmenu"),Ph.EditorTabsBarShowTabsZenModeSubmenu=new Ph("EditorTabsBarShowTabsZenModeSubmenu"),Ph.EditorActionsPositionSubmenu=new Ph("EditorActionsPositionSubmenu"),Ph.ExplorerContext=new Ph("ExplorerContext"),Ph.ExplorerContextShare=new Ph("ExplorerContextShare"),Ph.ExtensionContext=new Ph("ExtensionContext"),Ph.GlobalActivity=new Ph("GlobalActivity"),Ph.CommandCenter=new Ph("CommandCenter"),Ph.CommandCenterCenter=new Ph("CommandCenterCenter"),Ph.LayoutControlMenuSubmenu=new Ph("LayoutControlMenuSubmenu"),Ph.LayoutControlMenu=new Ph("LayoutControlMenu"),Ph.MenubarMainMenu=new Ph("MenubarMainMenu"),Ph.MenubarAppearanceMenu=new Ph("MenubarAppearanceMenu"),Ph.MenubarDebugMenu=new Ph("MenubarDebugMenu"),Ph.MenubarEditMenu=new Ph("MenubarEditMenu"),Ph.MenubarCopy=new Ph("MenubarCopy"),Ph.MenubarFileMenu=new Ph("MenubarFileMenu"),Ph.MenubarGoMenu=new Ph("MenubarGoMenu"),Ph.MenubarHelpMenu=new Ph("MenubarHelpMenu"),Ph.MenubarLayoutMenu=new Ph("MenubarLayoutMenu"),Ph.MenubarNewBreakpointMenu=new Ph("MenubarNewBreakpointMenu"),Ph.PanelAlignmentMenu=new Ph("PanelAlignmentMenu"),Ph.PanelPositionMenu=new Ph("PanelPositionMenu"),Ph.ActivityBarPositionMenu=new Ph("ActivityBarPositionMenu"),Ph.MenubarPreferencesMenu=new Ph("MenubarPreferencesMenu"),Ph.MenubarRecentMenu=new Ph("MenubarRecentMenu"),Ph.MenubarSelectionMenu=new Ph("MenubarSelectionMenu"),Ph.MenubarShare=new Ph("MenubarShare"),Ph.MenubarSwitchEditorMenu=new Ph("MenubarSwitchEditorMenu"),Ph.MenubarSwitchGroupMenu=new Ph("MenubarSwitchGroupMenu"),Ph.MenubarTerminalMenu=new Ph("MenubarTerminalMenu"),Ph.MenubarViewMenu=new Ph("MenubarViewMenu"),Ph.MenubarHomeMenu=new Ph("MenubarHomeMenu"),Ph.OpenEditorsContext=new Ph("OpenEditorsContext"),Ph.OpenEditorsContextShare=new Ph("OpenEditorsContextShare"),Ph.ProblemsPanelContext=new Ph("ProblemsPanelContext"),Ph.SCMInputBox=new Ph("SCMInputBox"),Ph.SCMChangesSeparator=new Ph("SCMChangesSeparator"),Ph.SCMIncomingChanges=new Ph("SCMIncomingChanges"),Ph.SCMIncomingChangesContext=new Ph("SCMIncomingChangesContext"),Ph.SCMIncomingChangesSetting=new Ph("SCMIncomingChangesSetting"),Ph.SCMOutgoingChanges=new Ph("SCMOutgoingChanges"),Ph.SCMOutgoingChangesContext=new Ph("SCMOutgoingChangesContext"),Ph.SCMOutgoingChangesSetting=new Ph("SCMOutgoingChangesSetting"),Ph.SCMIncomingChangesAllChangesContext=new Ph("SCMIncomingChangesAllChangesContext"),Ph.SCMIncomingChangesHistoryItemContext=new Ph("SCMIncomingChangesHistoryItemContext"),Ph.SCMOutgoingChangesAllChangesContext=new Ph("SCMOutgoingChangesAllChangesContext"),Ph.SCMOutgoingChangesHistoryItemContext=new Ph("SCMOutgoingChangesHistoryItemContext"),Ph.SCMChangeContext=new Ph("SCMChangeContext"),Ph.SCMResourceContext=new Ph("SCMResourceContext"),Ph.SCMResourceContextShare=new Ph("SCMResourceContextShare"),Ph.SCMResourceFolderContext=new Ph("SCMResourceFolderContext"),Ph.SCMResourceGroupContext=new Ph("SCMResourceGroupContext"),Ph.SCMSourceControl=new Ph("SCMSourceControl"),Ph.SCMSourceControlInline=new Ph("SCMSourceControlInline"),Ph.SCMSourceControlTitle=new Ph("SCMSourceControlTitle"),Ph.SCMTitle=new Ph("SCMTitle"),Ph.SearchContext=new Ph("SearchContext"),Ph.SearchActionMenu=new Ph("SearchActionContext"),Ph.StatusBarWindowIndicatorMenu=new Ph("StatusBarWindowIndicatorMenu"),Ph.StatusBarRemoteIndicatorMenu=new Ph("StatusBarRemoteIndicatorMenu"),Ph.StickyScrollContext=new Ph("StickyScrollContext"),Ph.TestItem=new Ph("TestItem"),Ph.TestItemGutter=new Ph("TestItemGutter"),Ph.TestMessageContext=new Ph("TestMessageContext"),Ph.TestMessageContent=new Ph("TestMessageContent"),Ph.TestPeekElement=new Ph("TestPeekElement"),Ph.TestPeekTitle=new Ph("TestPeekTitle"),Ph.TouchBarContext=new Ph("TouchBarContext"),Ph.TitleBarContext=new Ph("TitleBarContext"),Ph.TitleBarTitleContext=new Ph("TitleBarTitleContext"),Ph.TunnelContext=new Ph("TunnelContext"),Ph.TunnelPrivacy=new Ph("TunnelPrivacy"),Ph.TunnelProtocol=new Ph("TunnelProtocol"),Ph.TunnelPortInline=new Ph("TunnelInline"),Ph.TunnelTitle=new Ph("TunnelTitle"),Ph.TunnelLocalAddressInline=new Ph("TunnelLocalAddressInline"),Ph.TunnelOriginInline=new Ph("TunnelOriginInline"),Ph.ViewItemContext=new Ph("ViewItemContext"),Ph.ViewContainerTitle=new Ph("ViewContainerTitle"),Ph.ViewContainerTitleContext=new Ph("ViewContainerTitleContext"),Ph.ViewTitle=new Ph("ViewTitle"),Ph.ViewTitleContext=new Ph("ViewTitleContext"),Ph.CommentEditorActions=new Ph("CommentEditorActions"),Ph.CommentThreadTitle=new Ph("CommentThreadTitle"),Ph.CommentThreadActions=new Ph("CommentThreadActions"),Ph.CommentThreadAdditionalActions=new Ph("CommentThreadAdditionalActions"),Ph.CommentThreadTitleContext=new Ph("CommentThreadTitleContext"),Ph.CommentThreadCommentContext=new Ph("CommentThreadCommentContext"),Ph.CommentTitle=new Ph("CommentTitle"),Ph.CommentActions=new Ph("CommentActions"),Ph.InteractiveToolbar=new Ph("InteractiveToolbar"),Ph.InteractiveCellTitle=new Ph("InteractiveCellTitle"),Ph.InteractiveCellDelete=new Ph("InteractiveCellDelete"),Ph.InteractiveCellExecute=new Ph("InteractiveCellExecute"),Ph.InteractiveInputExecute=new Ph("InteractiveInputExecute"),Ph.IssueReporter=new Ph("IssueReporter"),Ph.NotebookToolbar=new Ph("NotebookToolbar"),Ph.NotebookStickyScrollContext=new Ph("NotebookStickyScrollContext"),Ph.NotebookCellTitle=new Ph("NotebookCellTitle"),Ph.NotebookCellDelete=new Ph("NotebookCellDelete"),Ph.NotebookCellInsert=new Ph("NotebookCellInsert"),Ph.NotebookCellBetween=new Ph("NotebookCellBetween"),Ph.NotebookCellListTop=new Ph("NotebookCellTop"),Ph.NotebookCellExecute=new Ph("NotebookCellExecute"),Ph.NotebookCellExecuteGoTo=new Ph("NotebookCellExecuteGoTo"),Ph.NotebookCellExecutePrimary=new Ph("NotebookCellExecutePrimary"),Ph.NotebookDiffCellInputTitle=new Ph("NotebookDiffCellInputTitle"),Ph.NotebookDiffCellMetadataTitle=new Ph("NotebookDiffCellMetadataTitle"),Ph.NotebookDiffCellOutputsTitle=new Ph("NotebookDiffCellOutputsTitle"),Ph.NotebookOutputToolbar=new Ph("NotebookOutputToolbar"),Ph.NotebookEditorLayoutConfigure=new Ph("NotebookEditorLayoutConfigure"),Ph.NotebookKernelSource=new Ph("NotebookKernelSource"),Ph.BulkEditTitle=new Ph("BulkEditTitle"),Ph.BulkEditContext=new Ph("BulkEditContext"),Ph.TimelineItemContext=new Ph("TimelineItemContext"),Ph.TimelineTitle=new Ph("TimelineTitle"),Ph.TimelineTitleContext=new Ph("TimelineTitleContext"),Ph.TimelineFilterSubMenu=new Ph("TimelineFilterSubMenu"),Ph.AccountsContext=new Ph("AccountsContext"),Ph.SidebarTitle=new Ph("SidebarTitle"),Ph.PanelTitle=new Ph("PanelTitle"),Ph.AuxiliaryBarTitle=new Ph("AuxiliaryBarTitle"),Ph.TerminalInstanceContext=new Ph("TerminalInstanceContext"),Ph.TerminalEditorInstanceContext=new Ph("TerminalEditorInstanceContext"),Ph.TerminalNewDropdownContext=new Ph("TerminalNewDropdownContext"),Ph.TerminalTabContext=new Ph("TerminalTabContext"),Ph.TerminalTabEmptyAreaContext=new Ph("TerminalTabEmptyAreaContext"),Ph.TerminalStickyScrollContext=new Ph("TerminalStickyScrollContext"),Ph.WebviewContext=new Ph("WebviewContext"),Ph.InlineCompletionsActions=new Ph("InlineCompletionsActions"),Ph.InlineEditActions=new Ph("InlineEditActions"),Ph.NewFile=new Ph("NewFile"),Ph.MergeInput1Toolbar=new Ph("MergeToolbar1Toolbar"),Ph.MergeInput2Toolbar=new Ph("MergeToolbar2Toolbar"),Ph.MergeBaseToolbar=new Ph("MergeBaseToolbar"),Ph.MergeInputResultToolbar=new Ph("MergeToolbarResultToolbar"),Ph.InlineSuggestionToolbar=new Ph("InlineSuggestionToolbar"),Ph.InlineEditToolbar=new Ph("InlineEditToolbar"),Ph.ChatContext=new Ph("ChatContext"),Ph.ChatCodeBlock=new Ph("ChatCodeblock"),Ph.ChatMessageTitle=new Ph("ChatMessageTitle"),Ph.ChatExecute=new Ph("ChatExecute"),Ph.ChatInputSide=new Ph("ChatInputSide"),Ph.AccessibleView=new Ph("AccessibleView"),Ph.MultiDiffEditorFileToolbar=new Ph("MultiDiffEditorFileToolbar");const Fh=wl("menuService");class Bh{static for(e){let t=this._all.get(e);return t||(t=new Bh(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Bh&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}Bh._all=new Map;const Wh=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new bt({merge:Bh.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(Bh.for(Ph.CommandPalette)),it(()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(Bh.for(Ph.CommandPalette))})}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach((t,i)=>e.set(i,t)),e}appendMenuItem(e,t){let i=this._menuItems.get(e);i||(i=new $,this._menuItems.set(e,i));const n=i.push(t);return this._onDidChangeMenu.fire(Bh.for(e)),it(()=>{n(),this._onDidChangeMenu.fire(Bh.for(e))})}appendMenuItems(e){const t=new nt;for(const{id:i,item:n}of e)t.add(this.appendMenuItem(i,n));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===Ph.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)Rh(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach((i,n)=>{t.has(n)||e.push({command:i})})}};class Vh extends El{constructor(e,t,i){super("submenuitem."+e.submenu.id,"string"==typeof e.title?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let Hh=Mh=class{static label(e,t){return(null==t?void 0:t.renderShortTitle)&&e.shortTitle?"string"==typeof e.shortTitle?e.shortTitle:e.shortTitle.value:"string"==typeof e.title?e.title:e.title.value}constructor(e,t,i,n,s,o){var r,a;let l;if(this.hideActions=n,this._commandService=o,this.id=e.id,this.label=Mh.label(e,i),this.tooltip=null!==(a="string"==typeof e.tooltip?e.tooltip:null===(r=e.tooltip)||void 0===r?void 0:r.value)&&void 0!==a?a:"",this.enabled=!e.precondition||s.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){const t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=s.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip="string"==typeof t.tooltip?t.tooltip:t.tooltip.value),this.checked&&Ml.isThemeIcon(t.icon)&&(l=t.icon),this.checked&&t.title&&(this.label="string"==typeof t.title?t.title:t.title.value)}l||(l=Ml.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new Mh(t,void 0,i,n,s,o):void 0,this._options=i,this.class=l&&Ml.asClassName(l)}run(...e){var t,i;let n=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(n=[...n,this._options.arg]),(null===(i=this._options)||void 0===i?void 0:i.shouldForwardArgs)&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};Hh=Mh=Ah([Oh(4,vh),Oh(5,Al)],Hh);const zh=wl("telemetryService"),Kh=wl("logService");var Uh;!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"}(Uh||(Uh={}));const jh=Uh.Info;class qh extends st{constructor(){super(...arguments),this.level=jh,this._onDidChangeLogLevel=this._register(new ft),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==Uh.Off&&this.level<=e}}class $h extends qh{constructor(e=jh,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Uh.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Uh.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Uh.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Uh.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Uh.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class Gh extends qh{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}new _h("logLevel",function(e){switch(e){case Uh.Trace:return"trace";case Uh.Debug:return"debug";case Uh.Info:return"info";case Uh.Warning:return"warn";case Uh.Error:return"error";case Uh.Off:return"off"}}(Uh.Info));class Zh{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let e=t.kbExpr;this.precondition&&(e=e?Ql.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Ih.registerKeybindingRule(i)}}Ol.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){Wh.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class Yh extends Zh{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort((e,t)=>t.priority-e.priority),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===i)return void this._implementations.splice(e,1)}}}runCommand(e,t){const i=e.get(Kh),n=e.get(vh);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const s of this._implementations){if(s.when){const e=n.getContext(va());if(!s.when.evaluate(e))continue}const o=s.implementation(e,t);if(o){if(i.trace(`Command '${this.id}' was handled by '${s.name}'.`),"boolean"==typeof o)return;return o}}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class Qh extends Zh{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class Xh extends Zh{static bindToContribution(e){return class extends Xh{constructor(e){super(e),this._callback=e.handler}runEditorCommand(t,i,n){const s=e(i);s&&this._callback(s,n)}}}static runEditorCommand(e,t,i,n){const s=e.get(yl),o=s.getFocusedCodeEditor()||s.getActiveCodeEditor();if(o)return o.invokeWithinContext(e=>{if(e.get(vh).contextMatchesRules(null!=i?i:void 0))return n(e,o,t)})}runCommand(e,t){return Xh.runEditorCommand(e,t,this.precondition,(e,t,i)=>this.runEditorCommand(e,t,i))}}function Jh(e){return id.INSTANCE.registerEditorCommand(e),e}function ed(e,t,i){id.INSTANCE.registerEditorContribution(e,t,i)}var td;!function(e){e.getEditorCommand=function(e){return id.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return id.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return id.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return id.INSTANCE.getEditorContributions().filter(t=>e.indexOf(t.id)>=0)},e.getDiffEditorContributions=function(){return id.INSTANCE.getDiffEditorContributions()}}(td||(td={}));class id{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function nd(e){return e.register(),e}id.INSTANCE=new id,Eh.add("editor.contributions",id.INSTANCE);const sd=nd(new Yh({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:Ph.MenubarEditMenu,group:"1_do",title:J.b({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:Ph.CommandPalette,group:"",title:J.b("undo","Undo"),order:1}]}));nd(new Qh(sd,{id:"default:undo",precondition:void 0}));const od=nd(new Yh({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:Ph.MenubarEditMenu,group:"1_do",title:J.b({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:Ph.CommandPalette,group:"",title:J.b("redo","Redo"),order:1}]}));nd(new Qh(od,{id:"default:redo",precondition:void 0}));const rd=nd(new Yh({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:Ph.MenubarSelectionMenu,group:"1_basic",title:J.b({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:Ph.CommandPalette,group:"",title:J.b("selectAll","Select All"),order:1}]}));let ad=!1;function ld(e){K.m&&(ad||(ad=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(e.message))}class hd{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=0}}class dd{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class cd{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=2}}class ud{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class gd{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class md{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((n,s)=>{this._pendingReplies[i]={resolve:n,reject:s},this._send(new hd(this._workerId,i,e,t))})}listen(e,t){let i=null;const n=new ft({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new cd(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new gd(this._workerId,i)),i=null}});return n.event}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq])return void console.warn("Got reply to unknown seq");const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;return e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),void t.reject(i)}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(e=>{this._send(new dd(this._workerId,t,e,void 0))},e=>{e.detail instanceof Error&&(e.detail=Ve(e.detail)),this._send(new dd(this._workerId,t,void 0,Ve(e)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(e=>{this._send(new ud(this._workerId,t,e))});this._pendingEvents.set(t,i)}_handleEventMessage(e){this._pendingEmitters.has(e.req)?this._pendingEmitters.get(e.req).fire(e.event):console.warn("Got event for unknown req")}_handleUnsubscribeEventMessage(e){this._pendingEvents.has(e.req)?(this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)):console.warn("Got unsubscribe for unknown req")}_send(e){const t=[];if(0===e.type)for(let i=0;i<e.args.length;i++)e.args[i]instanceof ArrayBuffer&&t.push(e.args[i]);else 1===e.type&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class fd extends st{constructor(e,t,i){super();let n=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",e=>{this._protocol.handleMessage(e)},e=>{null==n||n(e)})),this._protocol=new md({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t)=>{if("function"!=typeof i[e])return Promise.reject(new Error("Missing method "+e+" on main thread host."));try{return Promise.resolve(i[e].apply(i,t))}catch(e){return Promise.reject(e)}},handleEvent:(e,t)=>{if(_d(e)){const n=i[e].call(i,t);if("function"!=typeof n)throw new Error(`Missing dynamic event ${e} on main thread host.`);return n}if(pd(e)){const t=i[e];if("function"!=typeof t)throw new Error(`Missing event ${e} on main thread host.`);return t}throw new Error("Malformed event name "+e)}}),this._protocol.setWorkerId(this._worker.getId());let s=null;const o=globalThis.require;void 0!==o&&"function"==typeof o.getConfig?s=o.getConfig():void 0!==globalThis.requirejs&&(s=globalThis.requirejs.s.contexts._.config);const r=z(i);this._onModuleLoaded=this._protocol.sendMessage("$initialize",[this._worker.getId(),JSON.parse(JSON.stringify(s)),t,r]);const a=(e,t)=>this._request(e,t),l=(e,t)=>this._protocol.listen(e,t);this._lazyProxy=new Promise((e,i)=>{n=i,this._onModuleLoaded.then(t=>{e(vd(t,a,l))},e=>{i(e),this._onError("Worker failed to load "+t,e)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,n)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,n)},n)})}_onError(e,t){console.error(e),console.info(t)}}function pd(e){return"o"===e[0]&&"n"===e[1]&&ss(e.charCodeAt(2))}function _d(e){return/^onDynamic/.test(e)&&ss(e.charCodeAt(9))}function vd(e,t,i){const n=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},s=e=>function(t){return i(e,t)},o={};for(const t of e)_d(t)?o[t]=s(t):pd(t)?o[t]=i(t,void 0):o[t]=n(t);return o}function bd(e,t){var i;const n=globalThis.MonacoEnvironment;if(null==n?void 0:n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(e){return void Be(e)}try{return null===(i=Pn.trustedTypes)||void 0===i?void 0:i.createPolicy(e,t)}catch(e){return void Be(e)}}const Cd=bd("defaultWorkerFactory",{createScriptURL:e=>e});class wd extends st{constructor(e,t,i,n,s){super(),this.id=t,this.label=i;const o=function(e){const t=globalThis.MonacoEnvironment;if(t){if("function"==typeof t.getWorker)return t.getWorker("workerMain.js",e);if("function"==typeof t.getWorkerUrl){const i=t.getWorkerUrl("workerMain.js",e);return new Worker(Cd?Cd.createScriptURL(i):i,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}(i);"function"==typeof o.then?this.worker=o:this.worker=Promise.resolve(o),this.postMessage(e,[]),this.worker.then(e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=s,"function"==typeof e.addEventListener&&e.addEventListener("error",s)}),this._register(it(()=>{var e;null===(e=this.worker)||void 0===e||e.then(e=>{e.onmessage=null,e.onmessageerror=null,e.removeEventListener("error",s),e.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){var i;null===(i=this.worker)||void 0===i||i.then(i=>{try{i.postMessage(e,t)}catch(e){Be(e),Be(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:e}))}})}}class yd{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++yd.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new wd(e,n,this._label||"anonymous"+n,t,e=>{ld(e),this._webWorkerFailedBeforeError=e,i(e)})}}var Sd;yd.LAST_WORKER_ID=0,function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(Sd||(Sd={}));class Ld{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++){switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1}}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(0===e.getTokenCount())return!0;const i=e.findTokenIndexAtOffset(t-2),n=e.getStandardTokenType(i);return this.isOK(n)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const e=String.fromCharCode(i);if(!this.open.includes(e)&&!this.close.includes(e))return e}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class kd{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)Dd(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),Dd(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),Dd(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),Dd(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),1===t.close.length&&1===t.open.length&&Dd(this.autoClosingPairsCloseSingleChar,t.close,t)}}function Dd(e,t,i){e.has(t)?e.get(t).push(i):e.set(t,[i])}function xd(e,t){const i=e.getCount(),n=e.findTokenIndexAtOffset(t),s=e.getLanguageId(n);let o=n;for(;o+1<i&&e.getLanguageId(o+1)===s;)o++;let r=n;for(;r>0&&e.getLanguageId(r-1)===s;)r--;return new Ed(e,s,r,o+1,e.getStartOffset(r),e.getEndOffset(o))}class Ed{constructor(e,t,i,n,s,o){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=s,this._lastCharOffset=o}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function Nd(e){return 0!=(3&e)}class Id{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(e=>new Ld(e)):e.brackets?this._autoClosingPairs=e.brackets.map(e=>new Ld({open:e[0],close:e[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Ld({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Id.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Id.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}Id.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n\t",Id.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n\t";var Td=i("BTsX");let Md,Ad,Od;function Rd(){return Md||(Md=new TextDecoder("UTF-16LE")),Md}function Pd(){return Od||(Od=K.h()?Rd():(Ad||(Ad=new TextDecoder("UTF-16BE")),Ad)),Od}function Fd(e,t,i){const n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?function(e,t,i){const n=[];let s=0;for(let o=0;o<i;o++){const i=Td.b(e,t);t+=2,n[s++]=String.fromCharCode(i)}return n.join("")}(e,t,i):Rd().decode(n)}class Bd{constructor(e){this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(0===this._bufferLength)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return Pd().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(0===t||hs(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class Wd{constructor(e,t,i,n,s,o){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=s,this.reversedRegex=o,this._openSet=Wd._toSet(this.open),this._closeSet=Wd._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}class Vd{constructor(e,t){this._richEditBracketsBrand=void 0;const i=function(e){const t=e.length;e=e.map(e=>[e[0].toLowerCase(),e[1].toLowerCase()]);const i=[];for(let e=0;e<t;e++)i[e]=e;const n=(e,t)=>{const[i,n]=e,[s,o]=t;return i===s||i===o||n===s||n===o},s=(e,n)=>{const s=Math.min(e,n),o=Math.max(e,n);for(let e=0;e<t;e++)i[e]===o&&(i[e]=s)};for(let o=0;o<t;o++){const r=e[o];for(let a=o+1;a<t;a++){n(r,e[a])&&s(i[o],i[a])}}const o=[];for(let n=0;n<t;n++){const s=[],r=[];for(let o=0;o<t;o++)if(i[o]===n){const[t,i]=e[o];s.push(t),r.push(i)}s.length>0&&o.push({open:s,close:r})}return o}(t);this.brackets=i.map((t,n)=>new Wd(e,n,t.open,t.close,function(e,t,i,n){let s=[];s=s.concat(e),s=s.concat(t);for(let e=0,t=s.length;e<t;e++)Hd(s[e],i,n,s);return s=Kd(s),s.sort(zd),s.reverse(),jd(s)}(t.open,t.close,i,n),function(e,t,i,n){let s=[];s=s.concat(e),s=s.concat(t);for(let e=0,t=s.length;e<t;e++)Hd(s[e],i,n,s);return s=Kd(s),s.sort(zd),s.reverse(),jd(s.map(qd))}(t.open,t.close,i,n))),this.forwardRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=Kd(t),jd(t)}(this.brackets),this.reversedRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=Kd(t),jd(t.map(qd))}(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const e of this.brackets){for(const t of e.open)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,t.length);for(const t of e.close)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,t.length)}}}function Hd(e,t,i,n){for(let s=0,o=t.length;s<o;s++){if(s===i)continue;const o=t[s];for(const t of o.open)t.indexOf(e)>=0&&n.push(t);for(const t of o.close)t.indexOf(e)>=0&&n.push(t)}}function zd(e,t){return e.length-t.length}function Kd(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function Ud(e){const t=/^[\w ]+$/.test(e);return e=Un(e),t?`\\b${e}\\b`:e}function jd(e){return $n(`(${e.map(Ud).join(")|(")})`,!0)}const qd=function(){let e=null,t=null;return function(i){return e!==i&&(e=i,t=function(e){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return Pd().decode(t)}(e)),t}}();class $d{static _findPrevBracketInText(e,t,i,n){const s=i.match(e);if(!s)return null;const o=i.length-(s.index||0),r=s[0].length,a=n+o;return new wi(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,s){const o=qd(i).substring(i.length-s,i.length-n);return this._findPrevBracketInText(e,t,o,n)}static findNextBracketInText(e,t,i,n){const s=i.match(e);if(!s)return null;const o=s.index||0,r=s[0].length;if(0===r)return null;const a=n+o;return new wi(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,s){const o=i.substring(n,s);return this.findNextBracketInText(e,t,o,n)}}class Gd{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const t=i.charAt(i.length-1);e.push(t)}return d(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if(Nd(t.getStandardTokenType(n)))return null;const s=this._richEditBrackets.reversedRegex,o=t.getLineContent().substring(0,i-1)+e,r=$d.findPrevBracketInRange(s,1,o,0,o.length);if(!r)return null;const a=o.substring(r.startColumn-1,r.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const l=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function Zd(e){return e.global&&(e.lastIndex=0),!0}class Yd{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&Zd(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&Zd(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&Zd(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&Zd(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class Qd{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(e=>{const t=Qd._createOpenBracketRegExp(e[0]),i=Qd._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let e=0,s=this._regExpRules.length;e<s;e++){const s=this._regExpRules[e];if([{reg:s.beforeText,text:i},{reg:s.afterText,text:n},{reg:s.previousLineText,text:t}].every(e=>!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text))))return s.action}if(e>=2&&i.length>0&&n.length>0)for(let e=0,t=this._brackets.length;e<t;e++){const t=this._brackets[e];if(t.openRegExp.test(i)&&t.closeRegExp.test(n))return{indentAction:Sd.IndentOutdent}}if(e>=2&&i.length>0)for(let e=0,t=this._brackets.length;e<t;e++){if(this._brackets[e].openRegExp.test(i))return{indentAction:Sd.Indent}}return null}static _createOpenBracketRegExp(e){let t=Un(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",Qd._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=Un(e);return/\B/.test(t.charAt(t.length-1))||(t+="\\b"),t="^\\s*"+t,Qd._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(e){return Be(e),null}}}const Xd=wl("configurationService");function Jd(e,t){const i=Object.create(null);for(const n in e)ec(i,n,e[n],t);return i}function ec(e,t,i,n){const s=t.split("."),o=s.pop();let r=e;for(let e=0;e<s.length;e++){const i=s[e];let o=r[i];switch(typeof o){case"undefined":o=r[i]=Object.create(null);break;case"object":break;default:return void n(`Ignoring ${t} as ${s.slice(0,e+1).join(".")} is ${JSON.stringify(o)}`)}r=o}if("object"==typeof r&&null!==r)try{r[o]=i}catch(e){n(`Ignoring ${t} as ${s.join(".")} is ${JSON.stringify(r)}`)}else n(`Ignoring ${t} as ${s.join(".")} is ${JSON.stringify(r)}`)}function tc(e,t){!function e(t,i){const n=i.shift();if(0===i.length)return void delete t[n];if(-1!==Object.keys(t).indexOf(n)){const s=t[n];"object"!=typeof s||Array.isArray(s)||(e(s,i),0===Object.keys(s).length&&delete t[n])}}(e,t.split("."))}function ic(e,t,i){const n=function(e,t){let i=e;for(const e of t){if("object"!=typeof i||null===i)return;i=i[e]}return i}(e,t.split("."));return void 0===n?i:n}const nc=wl("languageService");class sc{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const oc=[];function rc(e,t,i){t instanceof sc||(t=new sc(t,[],Boolean(i))),oc.push([e,t])}function ac(){return oc}const lc=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),hc="base.contributions.json";const dc=new class{constructor(){this._onDidChangeSchema=new ft,this.schemasById={}}registerSchema(e,t){var i;this.schemasById[(i=e,i.length>0&&"#"===i.charAt(i.length-1)?i.substring(0,i.length-1):i)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};Eh.add(hc,dc);const cc="base.contributions.configuration",uc={properties:{},patternProperties:{}},gc={properties:{},patternProperties:{}},mc={properties:{},patternProperties:{}},fc={properties:{},patternProperties:{}},pc={properties:{},patternProperties:{}},_c={properties:{},patternProperties:{}},vc=Eh.as(hc);const bc=new RegExp("\\[([^\\]]+)\\]","g"),Cc="^(\\[([^\\]]+)\\])+$",wc=new RegExp(Cc);function yc(e){const t=[];if(wc.test(e)){let i=bc.exec(e);for(;null==i?void 0:i.length;){const n=i[1].trim();n&&t.push(n),i=bc.exec(e)}}return d(t)}const Sc=new class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new ft,this._onDidUpdateConfiguration=new ft,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:J.b("defaultLanguageConfigurationOverrides.title","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={},vc.registerSchema("vscode://schemas/settings/resourceLanguage",this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),vc.registerSchema("vscode://schemas/settings/resourceLanguage",this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const n=[];for(const{overrides:s,source:o}of e)for(const e in s)if(t.add(e),wc.test(e)){const t=this.configurationDefaultsOverrides.get(e),r=null!==(i=null==t?void 0:t.valuesSources)&&void 0!==i?i:new Map;if(o)for(const t of Object.keys(s[e]))r.set(t,o);const a={...(null==t?void 0:t.value)||{},...s[e]};this.configurationDefaultsOverrides.set(e,{source:o,value:a,valuesSources:r});const l=e.replace(/[\[\]]/g,""),h={type:"object",default:a,description:J.b("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",l),$ref:"vscode://schemas/settings/resourceLanguage",defaultDefaultValue:a,source:k(o)?void 0:o,defaultValueSource:o};n.push(...yc(e)),this.configurationProperties[e]=h,this.defaultLanguageConfigurationOverridesNode.properties[e]=h}else{this.configurationDefaultsOverrides.set(e,{value:s[e],source:o});const t=this.configurationProperties[e];t&&(this.updatePropertyDefaultValue(e,t),this.updateSchema(e,t))}this.doRegisterOverrideIdentifiers(n)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,i),this.configurationContributors.push(e),this.registerJSONConfiguration(e)})}validateAndRegisterProperties(e,t=!0,i,n,s=3,o){var r;s=A(e.scope)?s:e.scope;const a=e.properties;if(a)for(const e in a){const l=a[e];t&&Lc(e,l)?delete a[e]:(l.source=i,l.defaultDefaultValue=a[e].default,this.updatePropertyDefaultValue(e,l),wc.test(e)?l.scope=void 0:(l.scope=A(l.scope)?s:l.scope,l.restricted=A(l.restricted)?!!(null==n?void 0:n.includes(e)):l.restricted),!a[e].hasOwnProperty("included")||a[e].included?(this.configurationProperties[e]=a[e],(null===(r=a[e].policy)||void 0===r?void 0:r.name)&&this.policyConfigurations.set(a[e].policy.name,e),!a[e].deprecationMessage&&a[e].markdownDeprecationMessage&&(a[e].deprecationMessage=a[e].markdownDeprecationMessage),o.add(e)):(this.excludedConfigurationProperties[e]=a[e],delete a[e]))}const l=e.allOf;if(l)for(const e of l)this.validateAndRegisterProperties(e,t,i,n,s,o)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=e=>{const i=e.properties;if(i)for(const e in i)this.updateSchema(e,i[e]);const n=e.allOf;null==n||n.forEach(t)};t(e)}updateSchema(e,t){switch(uc.properties[e]=t,t.scope){case 1:gc.properties[e]=t;break;case 2:mc.properties[e]=t;break;case 6:fc.properties[e]=t;break;case 3:pc.properties[e]=t;break;case 4:_c.properties[e]=t;break;case 5:_c.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:J.b("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:J.b("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:"vscode://schemas/settings/resourceLanguage"};this.updatePropertyDefaultValue(t,i),uc.properties[t]=i,gc.properties[t]=i,mc.properties[t]=i,fc.properties[t]=i,pc.properties[t]=i,_c.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:J.b("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:J.b("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:"vscode://schemas/settings/resourceLanguage"};uc.patternProperties[Cc]=e,gc.patternProperties[Cc]=e,mc.patternProperties[Cc]=e,fc.patternProperties[Cc]=e,pc.patternProperties[Cc]=e,_c.patternProperties[Cc]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let n=null==i?void 0:i.value,s=null==i?void 0:i.source;T(n)&&(n=t.defaultDefaultValue,s=void 0),T(n)&&(n=function(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}}(t.type)),t.default=n,t.defaultValueSource=s}};function Lc(e,t){var i,n,s,o;return e.trim()?wc.test(e)?J.b("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==Sc.getConfigurationProperties()[e]?J.b("config.property.duplicate","Cannot register '{0}'. This property is already registered.",e):(null===(i=t.policy)||void 0===i?void 0:i.name)&&void 0!==Sc.getPolicyConfigurations().get(null===(n=t.policy)||void 0===n?void 0:n.name)?J.b("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",e,null===(s=t.policy)||void 0===s?void 0:s.name,Sc.getPolicyConfigurations().get(null===(o=t.policy)||void 0===o?void 0:o.name)):null:J.b("config.property.empty","Cannot register an empty property")}Eh.add(cc,Sc);const kc=new class{constructor(){this._onDidChangeLanguages=new ft,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e)return void this._languages.splice(t,1)}}}getLanguages(){return this._languages}};Eh.add("editor.modesRegistry",kc);kc.registerLanguage({id:"plaintext",extensions:[".txt"],aliases:[J.b("plainText.alias","Plain Text"),"text"],mimetypes:[lc.text]}),Eh.as(cc).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);class Dc{constructor(e,t){this.languageId=e;const i=t.brackets?xc(t.brackets):[],n=new Bn(e=>{const t=new Set;return{info:new Nc(this,e,t),closing:t}}),s=new Bn(e=>{const t=new Set,i=new Set;return{info:new Ic(this,e,t,i),opening:t,openingColorized:i}});for(const[e,t]of i){const i=n.get(e),o=s.get(t);i.closing.add(o.info),o.opening.add(i.info)}const o=t.colorizedBracketPairs?xc(t.colorizedBracketPairs):i.filter(e=>!("<"===e[0]&&">"===e[1]));for(const[e,t]of o){const i=n.get(e),o=s.get(t);i.closing.add(o.info),o.openingColorized.add(i.info),o.opening.add(i.info)}this._openingBrackets=new Map([...n.cachedValues].map(([e,t])=>[e,t.info])),this._closingBrackets=new Map([...s.cachedValues].map(([e,t])=>[e,t.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function xc(e){return e.filter(([e,t])=>""!==e&&""!==t)}class Ec{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Nc extends Ec{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Ic extends Ec{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config===this.config&&this.openingBrackets.has(e)}closesColorized(e){return e.config===this.config&&this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var Tc=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Mc=function(e,t){return function(i,n){t(i,n,e)}};class Ac{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}const Oc=wl("languageConfigurationService");let Rc=class extends st{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new Uc),this.onDidChangeEmitter=this._register(new ft),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Pc));this._register(this.configurationService.onDidChangeConfiguration(e=>{const t=e.change.keys.some(e=>i.has(e)),n=e.change.overrides.filter(([e,t])=>t.some(e=>i.has(e))).map(([e])=>e);if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new Ac(void 0));else for(const e of n)this.languageService.isRegisteredLanguageId(e)&&(this.configurations.delete(e),this.onDidChangeEmitter.fire(new Ac(e)))})),this._register(this._registry.onDidChange(e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new Ac(e.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=function(e,t,i,n){let s=t.getLanguageConfiguration(e);if(!s){if(!n.isRegisteredLanguageId(e))return new jc(e,{});s=new jc(e,{})}const o=function(e,t){const i=t.getValue(Pc.brackets,{overrideIdentifier:e}),n=t.getValue(Pc.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:Fc(i),colorizedBracketPairs:Fc(n)}}(s.languageId,i),r=Hc([s.underlyingConfig,o]);return new jc(s.languageId,r)}(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};Rc=Tc([Mc(0,Xd),Mc(1,nc)],Rc);const Pc={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Fc(e){if(Array.isArray(e))return e.map(e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]}).filter(e=>!!e)}function Bc(e,t,i){let n=Yn(e.getLineContent(t));return n.length>i-1&&(n=n.substring(0,i-1)),n}function Wc(e,t,i){e.tokenization.forceTokenization(t);return xd(e.tokenization.getLineTokens(t),void 0===i?e.getLineMaxColumn(t)-1:i-1)}class Vc{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new zc(e,t,++this._order);return this._entries.push(i),this._resolved=null,it(()=>{for(let e=0;e<this._entries.length;e++)if(this._entries[e]===i){this._entries.splice(e,1),this._resolved=null;break}})}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new jc(this.languageId,e))}return this._resolved}_resolve(){return 0===this._entries.length?null:(this._entries.sort(zc.cmp),Hc(this._entries.map(e=>e.configuration)))}}function Hc(e){let t={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}class zc{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class Kc{constructor(e){this.languageId=e}}class Uc extends st{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new ft),this.onDidChange=this._onDidChange.event,this._register(this.register("plaintext",{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new Vc(e),this._entries.set(e,n));const s=n.register(t,i);return this._onDidChange.fire(new Kc(e)),it(()=>{s.dispose(),this._onDidChange.fire(new Kc(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(null==t?void 0:t.getResolvedConfiguration())||null}}class jc{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new Qd(this.underlyingConfig):null,this.comments=jc._handleComments(this.underlyingConfig),this.characterPair=new Id(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||G,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Yd(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Dc(e,this.underlyingConfig)}getWordDefinition(){return Z(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Vd(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Gd(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new kd(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}rc(Oc,Rc,1);class qc{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class $c{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i<n;i++)t[i]=e.charCodeAt(i);return t}}function Gc(e,t,i){return new Xc(new $c(e),new $c(t)).ComputeDiff(i).changes}class Zc{static Assert(e,t){if(!e)throw new Error(t)}}class Yc{static Copy(e,t,i,n,s){for(let o=0;o<s;o++)i[n+o]=e[t+o]}static Copy2(e,t,i,n,s){for(let o=0;o<s;o++)i[n+o]=e[t+o]}}class Qc{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new qc(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Xc{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,s,o]=Xc._getElements(e),[r,a,l]=Xc._getElements(t);this._hasStrings=o&&l,this._originalStringElements=n,this._originalElementsOrHash=s,this._modifiedStringElements=r,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(Xc._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i<n;i++)e[i]=Tr(t[i],0);return[t,e,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._modifiedStringElements[t])}ElementsAreStrictEqual(e,t){if(!this.ElementsAreEqual(e,t))return!1;return Xc._getStrictElement(this._originalSequence,e)===Xc._getStrictElement(this._modifiedSequence,t)}static _getStrictElement(e,t){return"function"==typeof e.getStrictElement?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._originalElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._originalStringElements[t])}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._modifiedStringElements[e]===this._modifiedStringElements[t])}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,n,s){const o=[!1];let r=this.ComputeDiffRecursive(e,t,i,n,o);return s&&(r=this.PrettifyChanges(r)),{quitEarly:o[0],changes:r}}ComputeDiffRecursive(e,t,i,n,s){for(s[0]=!1;e<=t&&i<=n&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let s;return i<=n?(Zc.Assert(e===t+1,"originalStart should only be one more than originalEnd"),s=[new qc(e,0,i,n-i+1)]):e<=t?(Zc.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),s=[new qc(e,t-e+1,i,0)]):(Zc.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Zc.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),s=[]),s}const o=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,o,r,s),l=o[0],h=r[0];if(null!==a)return a;if(!s[0]){const o=this.ComputeDiffRecursive(e,l,i,h,s);let r=[];return r=s[0]?[new qc(l+1,t-(l+1)+1,h+1,n-(h+1)+1)]:this.ComputeDiffRecursive(l+1,t,h+1,n,s),this.ConcatenateChanges(o,r)}return[new qc(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,s,o,r,a,l,h,d,c,u,g,m,f,p,_){let v=null,b=null,C=new Qc,w=t,y=i,S=u[0]-f[0]-n,L=-1073741824,k=this.m_forwardHistory.length-1;do{const t=S+e;t===w||t<y&&l[t-1]<l[t+1]?(g=(d=l[t+1])-S-n,d<L&&C.MarkNextChange(),L=d,C.AddModifiedElement(d+1,g),S=t+1-e):(g=(d=l[t-1]+1)-S-n,d<L&&C.MarkNextChange(),L=d-1,C.AddOriginalElement(d,g+1),S=t-1-e),k>=0&&(e=(l=this.m_forwardHistory[k])[0],w=1,y=l.length-1)}while(--k>=-1);if(v=C.getReverseChanges(),_[0]){let e=u[0]+1,t=f[0]+1;if(null!==v&&v.length>0){const i=v[v.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}b=[new qc(e,c-e+1,t,m-t+1)]}else{C=new Qc,w=o,y=r,S=u[0]-f[0]-a,L=1073741824,k=p?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+s;e===w||e<y&&h[e-1]>=h[e+1]?(g=(d=h[e+1]-1)-S-a,d>L&&C.MarkNextChange(),L=d+1,C.AddOriginalElement(d+1,g+1),S=e+1-s):(g=(d=h[e-1])-S-a,d>L&&C.MarkNextChange(),L=d,C.AddModifiedElement(d+1,g+1),S=e-1-s),k>=0&&(s=(h=this.m_reverseHistory[k])[0],w=1,y=h.length-1)}while(--k>=-1);b=C.getChanges()}return this.ConcatenateChanges(v,b)}ComputeRecursionPoint(e,t,i,n,s,o,r){let a=0,l=0,h=0,d=0,c=0,u=0;e--,i--,s[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),m=g+1,f=new Int32Array(m),p=new Int32Array(m),_=n-i,v=t-e,b=e-i,C=t-n,w=(v-_)%2==0;f[_]=e,p[v]=t,r[0]=!1;for(let y=1;y<=g/2+1;y++){let g=0,S=0;h=this.ClipDiagonalBound(_-y,y,_,m),d=this.ClipDiagonalBound(_+y,y,_,m);for(let e=h;e<=d;e+=2){a=e===h||e<d&&f[e-1]<f[e+1]?f[e+1]:f[e-1]+1,l=a-(e-_)-b;const i=a;for(;a<t&&l<n&&this.ElementsAreEqual(a+1,l+1);)a++,l++;if(f[e]=a,a+l>g+S&&(g=a,S=l),!w&&Math.abs(e-v)<=y-1&&a>=p[e])return s[0]=a,o[0]=l,i<=p[e]&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,C,f,p,a,t,s,l,n,o,w,r):null}const L=(g-e+(S-i)-y)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,L))return r[0]=!0,s[0]=g,o[0]=S,L>0&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,C,f,p,a,t,s,l,n,o,w,r):(e++,i++,[new qc(e,t-e+1,i,n-i+1)]);c=this.ClipDiagonalBound(v-y,y,v,m),u=this.ClipDiagonalBound(v+y,y,v,m);for(let g=c;g<=u;g+=2){a=g===c||g<u&&p[g-1]>=p[g+1]?p[g+1]-1:p[g-1],l=a-(g-v)-C;const m=a;for(;a>e&&l>i&&this.ElementsAreEqual(a,l);)a--,l--;if(p[g]=a,w&&Math.abs(g-_)<=y&&a<=f[g])return s[0]=a,o[0]=l,m>=f[g]&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,C,f,p,a,t,s,l,n,o,w,r):null}if(y<=1447){let e=new Int32Array(d-h+2);e[0]=_-h+1,Yc.Copy2(f,h,e,1,d-h+1),this.m_forwardHistory.push(e),e=new Int32Array(u-c+2),e[0]=v-c+1,Yc.Copy2(p,c,e,1,u-c+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,h,d,b,v,c,u,C,f,p,a,t,s,l,n,o,w,r)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],n=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,s=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,o=i.originalLength>0,r=i.modifiedLength>0;for(;i.originalStart+i.originalLength<n&&i.modifiedStart+i.modifiedLength<s&&(!o||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!r||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){const e=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!e)break;i.originalStart++,i.modifiedStart++}const a=[null];t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],a)&&(e[t]=a[0],e.splice(t+1,1),t--)}for(let t=e.length-1;t>=0;t--){const i=e[t];let n=0,s=0;if(t>0){const i=e[t-1];n=i.originalStart+i.originalLength,s=i.modifiedStart+i.modifiedLength}const o=i.originalLength>0,r=i.modifiedLength>0;let a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){const t=i.originalStart-e,h=i.modifiedStart-e;if(t<n||h<s)break;if(o&&!this.OriginalElementsAreEqual(t,t+i.originalLength))break;if(r&&!this.ModifiedElementsAreEqual(h,h+i.modifiedLength))break;const d=(t===n&&h===s?5:0)+this._boundaryScore(t,i.originalLength,h,i.modifiedLength);d>l&&(l=d,a=e)}i.originalStart-=a,i.modifiedStart-=a;const h=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],h)&&(e[t-1]=h[0],e.splice(t,1),t++)}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){const i=e[t-1],n=e[t],s=n.originalStart-i.originalStart-i.originalLength,o=i.originalStart,r=n.originalStart+n.originalLength,a=r-o,l=i.modifiedStart,h=n.modifiedStart+n.modifiedLength,d=h-l;if(s<5&&a<20&&d<20){const e=this._findBetterContiguousSequence(o,a,l,d,s);if(e){const[t,o]=e;t===i.originalStart+i.originalLength&&o===i.modifiedStart+i.modifiedLength||(i.originalLength=t-i.originalStart,i.modifiedLength=o-i.modifiedStart,n.originalStart=t+s,n.modifiedStart=o+s,n.originalLength=r-n.originalStart,n.modifiedLength=h-n.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,n,s){if(t<s||n<s)return null;const o=e+t-s+1,r=i+n-s+1;let a=0,l=0,h=0;for(let t=e;t<o;t++)for(let e=i;e<r;e++){const i=this._contiguousSequenceScore(t,e,s);i>0&&i>a&&(a=i,l=t,h=e)}return a>0?[l,h]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let s=0;s<i;s++){if(!this.ElementsAreEqual(e+s,t+s))return 0;n+=this._originalStringElements[e+s].length}return n}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){const i=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return Yc.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],Yc.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return Yc.Copy(e,0,i,0,e.length),Yc.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(Zc.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Zc.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const n=e.originalStart;let s=e.originalLength;const o=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(s=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new qc(n,s,o,r),!0}return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e<n)return e;const s=t%2==0;if(e<0){return s===(i%2==0)?0:1}return s===((n-i-1)%2==0)?n-1:n-2}}function Jc(e){return e<0?0:e>255?255:0|e}function eu(e){return e<0?0:e>4294967295?4294967295:0|e}class tu{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=eu(e);const i=this.values,n=this.prefixSum,s=t.length;return 0!==s&&(this.values=new Uint32Array(i.length+s),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+s),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(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=eu(e),t=eu(t),this.values[e]!==t&&(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=eu(e),t=eu(t);const i=this.values,n=this.prefixSum;if(e>=i.length)return!1;const s=i.length-e;return t>=s&&(t=s),0!==t&&(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.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(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=eu(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,s=0,o=0;for(;t<=i;)if(n=t+(i-t)/2|0,s=this.prefixSum[n],o=s-this.values[n],e<o)i=n-1;else{if(!(e>=s))break;t=n+1}return new nu(n,e-o)}}class iu{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),0===e?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new nu(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=g(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){const t=this._values[e],i=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=i+t;for(let n=0;n<t;n++)this._indexBySum[i+n]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}}class nu{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class su{constructor(e){const t=Jc(e);this._defaultValue=t,this._asciiMap=su._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=Jc(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}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()}}class ou{constructor(e,t,i){const n=new Uint8Array(e*t);for(let s=0,o=e*t;s<o;s++)n[s]=i;this._data=n,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class ru{constructor(e){let t=0,i=0;for(let n=0,s=e.length;n<s;n++){const[s,o,r]=e[n];o>t&&(t=o),s>i&&(i=s),r>i&&(i=r)}t++,i++;const n=new ou(i,t,0);for(let t=0,i=e.length;t<i;t++){const[i,s,o]=e[t];n.set(i,s,o)}this._states=n,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let au=null;let lu=null;class hu{static _createLink(e,t,i,n,s){let o=s-1;do{const i=t.charCodeAt(o);if(2!==e.get(i))break;o--}while(o>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(o);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&o--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:o+2},url:t.substring(n,o+1)}}static computeLinks(e,t=function(){return null===au&&(au=new ru([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),au}()){const i=function(){if(null===lu){lu=new su(0);const e=" \t<>'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…";for(let t=0;t<e.length;t++)lu.set(e.charCodeAt(t),1);const t=".,;:";for(let e=0;e<t.length;e++)lu.set(t.charCodeAt(e),2)}return lu}(),n=[];for(let s=1,o=e.getLineCount();s<=o;s++){const o=e.getLineContent(s),r=o.length;let a=0,l=0,h=0,d=1,c=!1,u=!1,g=!1,m=!1;for(;a<r;){let e=!1;const r=o.charCodeAt(a);if(13===d){let t;switch(r){case 40:c=!0,t=0;break;case 41:t=c?0:1;break;case 91:g=!0,u=!0,t=0;break;case 93:g=!1,t=u?0:1;break;case 123:m=!0,t=0;break;case 125:t=m?0:1;break;case 39:case 34:case 96:t=h===r?1:39===h||34===h||96===h?0:1;break;case 42:t=42===h?1:0;break;case 124:t=124===h?1:0;break;case 32:t=g?0:1;break;default:t=i.get(r)}1===t&&(n.push(hu._createLink(i,o,s,l,a)),e=!0)}else if(12===d){let t;91===r?(u=!0,t=0):t=i.get(r),1===t?e=!0:d=13}else d=t.nextState(d,r),0===d&&(e=!0);e&&(d=1,c=!1,u=!1,m=!1,l=a+1,h=r),a++}13===d&&n.push(hu._createLink(i,o,s,l,r))}return n}}class du{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,n,s){if(e&&t){const i=this.doNavigateValueSet(t,s);if(i)return{range:e,value:i}}if(i&&n){const e=this.doNavigateValueSet(n,s);if(e)return{range:i,value:e}}return null}doNavigateValueSet(e,t){const i=this.numberReplace(e,t);return null!==i?i:this.textReplace(e,t)}numberReplace(e,t){const i=Math.pow(10,e.length-(e.lastIndexOf(".")+1));let n=Number(e);const s=parseFloat(e);return isNaN(n)||isNaN(s)||n!==s?null:0!==n||t?(n=Math.floor(n*i),n+=t?i:-i,String(n/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let n=null;for(let s=0,o=e.length;null===n&&s<o;s++)n=this.valueSetReplace(e[s],t,i);return n}valueSetReplace(e,t,i){let n=e.indexOf(t);return n>=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}du.INSTANCE=new du;class cu extends su{constructor(e){super(0);for(let t=0,i=e.length;t<i;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}}const uu=function(e){const t={};return i=>(t.hasOwnProperty(i)||(t[i]=e(i)),t[i])}(e=>new cu(e));var gu,mu,fu,pu;!function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(gu||(gu={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"}(mu||(mu={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(fu||(fu={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(pu||(pu={}));class _u{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,0|e.tabSize),"tabSize"===e.indentSize?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,0|e.indentSize),this._indentSizeIsTabSize=!1),this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace),this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&H(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class vu{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}class bu{constructor(e,t,i,n,s,o){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=n,this.isAutoWhitespaceEdit=s,this._isTracked=o}}class Cu{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class wu{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function yu(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}class Su{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?function(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t<i;t++){const n=e.charCodeAt(t);if(10===n)return!0;if(92===n){if(t++,t>=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n)return!0}}return!1}(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=$n(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(e){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Cu(t,this.wordSeparators?uu(this.wordSeparators):null,i?this.searchString:null)}}function Lu(e,t,i){if(!i)return new vu(e,null);const n=[];for(let e=0,i=t.length;e<i;e++)n[e]=t[e];return new vu(e,n)}class ku{constructor(e){const t=[];let i=0;for(let n=0,s=e.length;n<s;n++)10===e.charCodeAt(n)&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(-1===n)return 0;if(e<=t[0])return 0;for(;i<n;){const s=i+((n-i)/2>>0);t[s]>=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class Du{static findMatches(e,t,i,n,s){const o=t.parseSearchRequest();return o?o.regex.multiline?this._doFindMatchesMultiline(e,i,new Eu(o.wordSeparators,o.regex),n,s):this._doFindMatchesLineByLine(e,i,o,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,o){let r,a,l=0;if(n?(l=n.findLineFeedCountBeforeOffset(s),r=t+s+l):r=t+s,n){const e=n.findLineFeedCountBeforeOffset(s+o.length)-l;a=r+o.length+e}else a=r+o.length;const h=e.getPositionAt(r),d=e.getPositionAt(a);return new wi(h.lineNumber,h.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,n,s){const o=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new ku(r):null,l=[];let h,d=0;for(i.reset(0);h=i.next(r);)if(l[d++]=Lu(this._getMultilineMatchRange(e,o,r,a,h.index,h[0]),h,n),d>=s)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,s){const o=[];let r=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,o,n,s),o}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,o,n,s);for(let a=t.startLineNumber+1;a<t.endLineNumber&&r<s;a++)r=this._findMatchesInLine(i,e.getLineContent(a),a,0,r,o,n,s);if(r<s){const a=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);r=this._findMatchesInLine(i,a,t.endLineNumber,0,r,o,n,s)}return o}static _findMatchesInLine(e,t,i,n,s,o,r,a){const l=e.wordSeparators;if(!r&&e.simpleSearch){const r=e.simpleSearch,h=r.length,d=t.length;let c=-h;for(;-1!==(c=t.indexOf(r,c+h));)if((!l||xu(l,t,d,c,h))&&(o[s++]=new vu(new wi(i,c+1+n,i,c+1+h+n),null),s>=a))return s;return s}const h=new Eu(e.wordSeparators,e.regex);let d;h.reset(0);do{if(d=h.next(t),d&&(o[s++]=Lu(new wi(i,d.index+1+n,i,d.index+1+d[0].length+n),d,r),s>=a))return s}while(d);return s}static findNextMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const o=new Eu(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,o,n):this._doFindNextMatchLineByLine(e,i,o,n)}static _doFindNextMatchMultiline(e,t,i,n){const s=new Ci(t.lineNumber,1),o=e.getOffsetAt(s),r=e.getLineCount(),a=e.getValueInRange(new wi(s.lineNumber,s.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new ku(a):null;i.reset(t.column-1);const h=i.next(a);return h?Lu(this._getMultilineMatchRange(e,o,a,l,h.index,h[0]),h,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new Ci(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const s=e.getLineCount(),o=t.lineNumber,r=e.getLineContent(o),a=this._findFirstMatchInLine(i,r,o,t.column,n);if(a)return a;for(let t=1;t<=s;t++){const r=(o+t-1)%s,a=e.getLineContent(r+1),l=this._findFirstMatchInLine(i,a,r+1,1,n);if(l)return l}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);const o=e.next(t);return o?Lu(new wi(i,o.index+1,i,o.index+1+o[0].length),o,s):null}static findPreviousMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const o=new Eu(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,o,n):this._doFindPreviousMatchLineByLine(e,i,o,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const s=this._doFindMatchesMultiline(e,new wi(1,1,t.lineNumber,t.column),i,n,9990);if(s.length>0)return s[s.length-1];const o=e.getLineCount();return t.lineNumber!==o||t.column!==e.getLineMaxColumn(o)?this._doFindPreviousMatchMultiline(e,new Ci(o,e.getLineMaxColumn(o)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const s=e.getLineCount(),o=t.lineNumber,r=e.getLineContent(o).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,o,n);if(a)return a;for(let t=1;t<=s;t++){const r=(s+o-t-1)%s,a=e.getLineContent(r+1),l=this._findLastMatchInLine(i,a,r+1,n);if(l)return l}return null}static _findLastMatchInLine(e,t,i,n){let s,o=null;for(e.reset(0);s=e.next(t);)o=Lu(new wi(i,s.index+1,i,s.index+1+s[0].length),s,n);return o}}function xu(e,t,i,n,s){return function(e,t,i,n,s){if(0===n)return!0;const o=t.charCodeAt(n-1);if(0!==e.get(o))return!0;if(13===o||10===o)return!0;if(s>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,s)&&function(e,t,i,n,s){if(n+s===i)return!0;const o=t.charCodeAt(n+s);if(0!==e.get(o))return!0;if(13===o||10===o)return!0;if(s>0){const i=t.charCodeAt(n+s-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,s)}class Eu{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){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t)return null;if(i=this._searchRegex.exec(e),!i)return null;const n=i.index,s=i[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(0===s){us(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||xu(this._wordSeparators,e,t,n,s))return i}while(i);return null}}class Nu{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Ms.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of As.codePoints)Iu(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let n=!1,s=!1;if(t)for(const e of t){const t=e.codePointAt(0),i=Cs(e);n=n||i,i||this.ambiguousCharacters.isAmbiguous(t)||As.isInvisibleCharacter(t)||(s=!0)}return!n&&s?0:this.options.invisibleCharacters&&!Iu(e)&&As.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function Iu(e){return" "===e||"\n"===e||"\t"===e}class Tu{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class Mu{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Au{static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let n=i;for(;n<t.length&&t[n].start<=e.endExclusive;)n++;if(i===n)t.splice(i,0,e);else{const s=Math.min(e.start,t[i].start),o=Math.max(e.endExclusive,t[n-1].endExclusive);t.splice(i,n-i,new Au(s,o))}}static ofLength(e){return new Au(0,e)}static ofStartAndLength(e,t){return new Au(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new $e("Invalid range: "+this.toString())}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Au(this.start+e,this.endExclusive+e)}deltaStart(e){return new Au(this.start+e,this.endExclusive)}deltaEnd(e){return new Au(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new Au(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new Au(t,i)}intersects(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)}clip(e){if(this.isEmpty)throw new $e("Invalid clipping range: "+this.toString());return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new $e("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}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}}class Ou{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{const n=Math.min(e.start,this._sortedRanges[t].start),s=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new Au(n,s))}}toString(){return this._sortedRanges.map(e=>e.toString()).join(", ")}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(e){const t=new Ou;for(const i of this._sortedRanges){const n=i.intersect(e);n&&t.addRange(n)}return t}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce((e,t)=>e+t.length,0)}}function Ru(e,t,i){const n=function(e,t,i=e.length-1){for(let n=i;n>=0;n--){const i=e[n];if(t(i))return n}return-1}(e,t);if(-1!==n)return e[n]}function Pu(e,t){const i=Fu(e,t);return-1===i?void 0:e[i]}function Fu(e,t,i=0,n=e.length){let s=i,o=n;for(;s<o;){const i=Math.floor((s+o)/2);t(e[i])?s=i+1:o=i}return s-1}function Bu(e,t,i=0,n=e.length){let s=i,o=n;for(;s<o;){const i=Math.floor((s+o)/2);t(e[i])?o=i:s=i+1}return s}class Wu{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(Wu.assertInvariants){if(this._prevFindLastPredicate)for(const t of this._array)if(this._prevFindLastPredicate(t)&&!e(t))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");this._prevFindLastPredicate=e}const t=Fu(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,-1===t?void 0:this._array[t]}}function Vu(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const s=e[n];t(s,i)>0&&(i=s)}return i}function Hu(e,t){if(0===e.length)return-1;let i=0;for(let n=1;n<e.length;n++){t(e[n],e[i])>0&&(i=n)}return i}Wu.assertInvariants=!1;class zu{static fromRangeInclusive(e){return new zu(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(0===e.length)return[];let t=new Ku(e[0].slice());for(let i=1;i<e.length;i++)t=t.getUnion(new Ku(e[i].slice()));return t.ranges}static ofLength(e,t){return new zu(e,e+t)}static deserialize(e){return new zu(e[0],e[1])}constructor(e,t){if(e>t)throw new $e(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(e){return new zu(this.startLineNumber+e,this.endLineNumberExclusive+e)}deltaLength(e){return new zu(this.startLineNumber,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new zu(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}intersect(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumberExclusive,e.endLineNumberExclusive);if(t<=i)return new zu(t,i)}intersectsStrict(e){return this.startLineNumber<e.endLineNumberExclusive&&e.startLineNumber<this.endLineNumberExclusive}overlapOrTouch(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive}equals(e){return this.startLineNumber===e.startLineNumber&&this.endLineNumberExclusive===e.endLineNumberExclusive}toInclusiveRange(){return this.isEmpty?null:new wi(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)}toExclusiveRange(){return new wi(this.startLineNumber,1,this.endLineNumberExclusive,1)}mapToLineArray(e){const t=[];for(let i=this.startLineNumber;i<this.endLineNumberExclusive;i++)t.push(e(i));return t}forEach(e){for(let t=this.startLineNumber;t<this.endLineNumberExclusive;t++)e(t)}serialize(){return[this.startLineNumber,this.endLineNumberExclusive]}includes(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}toOffsetRange(){return new Au(this.startLineNumber-1,this.endLineNumberExclusive-1)}}class Ku{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(0===e.length)return;const t=Bu(this._normalizedRanges,t=>t.endLineNumberExclusive>=e.startLineNumber),i=Fu(this._normalizedRanges,t=>t.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const i=this._normalizedRanges[t];this._normalizedRanges[t]=i.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){const t=Pu(this._normalizedRanges,t=>t.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=Pu(this._normalizedRanges,t=>t.startLineNumber<e.endLineNumberExclusive);return!!t&&t.endLineNumberExclusive>e.startLineNumber}getUnion(e){if(0===this._normalizedRanges.length)return e;if(0===e._normalizedRanges.length)return this;const t=[];let i=0,n=0,s=null;for(;i<this._normalizedRanges.length||n<e._normalizedRanges.length;){let o=null;if(i<this._normalizedRanges.length&&n<e._normalizedRanges.length){const t=this._normalizedRanges[i],s=e._normalizedRanges[n];t.startLineNumber<s.startLineNumber?(o=t,i++):(o=s,n++)}else i<this._normalizedRanges.length?(o=this._normalizedRanges[i],i++):(o=e._normalizedRanges[n],n++);null===s?s=o:s.endLineNumberExclusive>=o.startLineNumber?s=new zu(s.startLineNumber,Math.max(s.endLineNumberExclusive,o.endLineNumberExclusive)):(t.push(s),s=o)}return null!==s&&t.push(s),new Ku(t)}subtractFrom(e){const t=Bu(this._normalizedRanges,t=>t.endLineNumberExclusive>=e.startLineNumber),i=Fu(this._normalizedRanges,t=>t.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new Ku([e]);const n=[];let s=e.startLineNumber;for(let e=t;e<i;e++){const t=this._normalizedRanges[e];t.startLineNumber>s&&n.push(new zu(s,t.startLineNumber)),s=t.endLineNumberExclusive}return s<e.endLineNumberExclusive&&n.push(new zu(s,e.endLineNumberExclusive)),new Ku(n)}toString(){return this._normalizedRanges.map(e=>e.toString()).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;i<this._normalizedRanges.length&&n<e._normalizedRanges.length;){const s=this._normalizedRanges[i],o=e._normalizedRanges[n],r=s.intersect(o);r&&!r.isEmpty&&t.push(r),s.endLineNumberExclusive<o.endLineNumberExclusive?i++:n++}return new Ku(t)}getWithDelta(e){return new Ku(this._normalizedRanges.map(t=>t.delta(e)))}}class Uu{static inverse(e,t,i){const n=[];let s=1,o=1;for(const t of e){const e=new Uu(new zu(s,t.original.startLineNumber),new zu(o,t.modified.startLineNumber));e.modified.isEmpty||n.push(e),s=t.original.endLineNumberExclusive,o=t.modified.endLineNumberExclusive}const r=new Uu(new zu(s,t+1),new zu(o,i+1));return r.modified.isEmpty||n.push(r),n}static clip(e,t,i){const n=[];for(const s of e){const e=s.original.intersect(t),o=s.modified.intersect(i);e&&!e.isEmpty&&o&&!o.isEmpty&&n.push(new Uu(e,o))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Uu(this.modified,this.original)}join(e){return new Uu(this.original.join(e.original),this.modified.join(e.modified))}}class ju extends Uu{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new ju(this.modified,this.original,null===(e=this.innerChanges)||void 0===e?void 0:e.map(e=>e.flip()))}}class qu{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new qu(this.modifiedRange,this.originalRange)}}class $u{computeDiff(e,t,i){var n;const s=new Ju(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),o=[];let r=null;for(const e of s.changes){let t,i;t=0===e.originalEndLineNumber?new zu(e.originalStartLineNumber+1,e.originalStartLineNumber+1):new zu(e.originalStartLineNumber,e.originalEndLineNumber+1),i=0===e.modifiedEndLineNumber?new zu(e.modifiedStartLineNumber+1,e.modifiedStartLineNumber+1):new zu(e.modifiedStartLineNumber,e.modifiedEndLineNumber+1);let s=new ju(t,i,null===(n=e.charChanges)||void 0===n?void 0:n.map(e=>new qu(new wi(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),new wi(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn))));r&&(r.modified.endLineNumberExclusive!==s.modified.startLineNumber&&r.original.endLineNumberExclusive!==s.original.startLineNumber||(s=new ju(r.original.join(s.original),r.modified.join(s.modified),r.innerChanges&&s.innerChanges?r.innerChanges.concat(s.innerChanges):void 0),o.pop())),o.push(s),r=s}return Dh(()=>xh(o,(e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber)),new Tu(o,[],s.quitEarly)}}function Gu(e,t,i,n){return new Xc(e,t,i).ComputeDiff(n)}class Zu{constructor(e){const t=[],i=[];for(let n=0,s=e.length;n<s;n++)t[n]=eg(e[n],1),i[n]=tg(e[n],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){const e=[];for(let t=0,i=this.lines.length;t<i;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,i){const n=[],s=[],o=[];let r=0;for(let a=t;a<=i;a++){const t=this.lines[a],l=e?this._startColumns[a]:1,h=e?this._endColumns[a]:t.length+1;for(let e=l;e<h;e++)n[r]=t.charCodeAt(e-1),s[r]=a+1,o[r]=e,r++;!e&&a<i&&(n[r]=10,s[r]=a+1,o[r]=t.length+1,r++)}return new Yu(n,s,o)}}class Yu{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}toString(){return"["+this._charCodes.map((e,t)=>(10===e?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return-1===e?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),10===this._charCodes[e]?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return-1===e?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),10===this._charCodes[e]?1:this._columns[e]+1)}}class Qu{constructor(e,t,i,n,s,o,r,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=s,this.modifiedStartColumn=o,this.modifiedEndLineNumber=r,this.modifiedEndColumn=a}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),s=t.getStartColumn(e.originalStart),o=t.getEndLineNumber(e.originalStart+e.originalLength-1),r=t.getEndColumn(e.originalStart+e.originalLength-1),a=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),h=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new Qu(n,s,o,r,a,l,h,d)}}class Xu{constructor(e,t,i,n,s){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=s}static createFromDiffResult(e,t,i,n,s,o,r){let a,l,h,d,c=void 0;if(0===t.originalLength?(a=i.getStartLineNumber(t.originalStart)-1,l=0):(a=i.getStartLineNumber(t.originalStart),l=i.getEndLineNumber(t.originalStart+t.originalLength-1)),0===t.modifiedLength?(h=n.getStartLineNumber(t.modifiedStart)-1,d=0):(h=n.getStartLineNumber(t.modifiedStart),d=n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),o&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&s()){const o=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(o.getElements().length>0&&a.getElements().length>0){let e=Gu(o,a,s,!0).changes;r&&(e=function(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,s=e.length;n<s;n++){const s=e[n],o=s.originalStart-(i.originalStart+i.originalLength),r=s.modifiedStart-(i.modifiedStart+i.modifiedLength);Math.min(o,r)<3?(i.originalLength=s.originalStart+s.originalLength-i.originalStart,i.modifiedLength=s.modifiedStart+s.modifiedLength-i.modifiedStart):(t.push(s),i=s)}return t}(e)),c=[];for(let t=0,i=e.length;t<i;t++)c.push(Qu.createFromDiffChange(e[t],o,a))}}return new Xu(a,l,h,d,c)}}class Ju{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new Zu(e),this.modified=new Zu(t),this.continueLineDiff=ig(i.maxComputationTime),this.continueCharDiff=ig(0===i.maxComputationTime?0:Math.min(i.maxComputationTime,5e3))}computeDiff(){if(1===this.original.lines.length&&0===this.original.lines[0].length)return 1===this.modified.lines.length&&0===this.modified.lines[0].length?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:void 0}]};if(1===this.modified.lines.length&&0===this.modified.lines[0].length)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:void 0}]};const e=Gu(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const e=[];for(let i=0,n=t.length;i<n;i++)e.push(Xu.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[i],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:e}}const n=[];let s=0,o=0;for(let e=-1,i=t.length;e<i;e++){const r=e+1<i?t[e+1]:null,a=r?r.originalStart:this.originalLines.length,l=r?r.modifiedStart:this.modifiedLines.length;for(;s<a&&o<l;){const e=this.originalLines[s],t=this.modifiedLines[o];if(e!==t){{let i=eg(e,1),r=eg(t,1);for(;i>1&&r>1;){if(e.charCodeAt(i-2)!==t.charCodeAt(r-2))break;i--,r--}(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,s+1,1,i,o+1,1,r)}{let i=tg(e,1),r=tg(t,1);const a=e.length+1,l=t.length+1;for(;i<a&&r<l;){if(e.charCodeAt(i-1)!==e.charCodeAt(r-1))break;i++,r++}(i<a||r<l)&&this._pushTrimWhitespaceCharChange(n,s+1,i,a,o+1,r,l)}}s++,o++}r&&(n.push(Xu.createFromDiffResult(this.shouldIgnoreTrimWhitespace,r,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),s+=r.originalLength,o+=r.modifiedLength)}return{quitEarly:i,changes:n}}_pushTrimWhitespaceCharChange(e,t,i,n,s,o,r){if(this._mergeTrimWhitespaceCharChange(e,t,i,n,s,o,r))return;let a=void 0;this.shouldComputeCharChanges&&(a=[new Qu(t,i,t,n,s,o,s,r)]),e.push(new Xu(t,t,s,s,a))}_mergeTrimWhitespaceCharChange(e,t,i,n,s,o,r){const a=e.length;if(0===a)return!1;const l=e[a-1];return 0!==l.originalEndLineNumber&&0!==l.modifiedEndLineNumber&&(l.originalEndLineNumber===t&&l.modifiedEndLineNumber===s?(this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new Qu(t,i,t,n,s,o,s,r)),!0):l.originalEndLineNumber+1===t&&l.modifiedEndLineNumber+1===s&&(l.originalEndLineNumber=t,l.modifiedEndLineNumber=s,this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new Qu(t,i,t,n,s,o,s,r)),!0))}}function eg(e,t){const i=Zn(e);return-1===i?t:i+1}function tg(e,t){const i=Qn(e);return-1===i?t:i+2}function ig(e){if(0===e)return()=>!0;const t=Date.now();return()=>Date.now()-t<e}class ng{static trivial(e,t){return new ng([new sg(Au.ofLength(e.length),Au.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new ng([new sg(Au.ofLength(e.length),Au.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class sg{static invert(e,t){const i=[];return r(e,(e,n)=>{i.push(sg.fromOffsetPairs(e?e.getEndExclusives():og.zero,n?n.getStarts():new og(t,(e?e.seq2Range.endExclusive-e.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new sg(new Au(e.offset1,t.offset1),new Au(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new sg(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new sg(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return 0===e?this:new sg(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return 0===e?this:new sg(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return 0===e?this:new sg(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(t&&i)return new sg(t,i)}getStarts(){return new og(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new og(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class og{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return 0===e?this:new og(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}og.zero=new og(0,0),og.max=new og(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class rg{isValid(){return!0}}rg.instance=new rg;class ag{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new $e("timeout must be positive")}isValid(){return!(Date.now()-this.startTime<this.timeout)&&this.valid&&(this.valid=!1),this.valid}}class lg{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}function hg(e){return 32===e||9===e}class dg{static getKey(e){let t=this.chrKeys.get(e);return void 0===t&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let n=0;for(let i=e.startLineNumber-1;i<e.endLineNumberExclusive-1;i++){const e=t[i];for(let t=0;t<e.length;t++){n++;const i=e[t],s=dg.getKey(i);this.histogram[s]=(this.histogram[s]||0)+1}n++;const s=dg.getKey("\n");this.histogram[s]=(this.histogram[s]||0)+1}this.totalCount=n}computeSimilarity(e){var t,i;let n=0;const s=Math.max(this.histogram.length,e.histogram.length);for(let o=0;o<s;o++)n+=Math.abs((null!==(t=this.histogram[o])&&void 0!==t?t:0)-(null!==(i=e.histogram[o])&&void 0!==i?i:0));return 1-n/(this.totalCount+e.totalCount)}}dg.chrKeys=new Map;class cg{compute(e,t,i=rg.instance,n){if(0===e.length||0===t.length)return ng.trivial(e,t);const s=new lg(e.length,t.length),o=new lg(e.length,t.length),r=new lg(e.length,t.length);for(let a=0;a<e.length;a++)for(let l=0;l<t.length;l++){if(!i.isValid())return ng.trivialTimedOut(e,t);const h=0===a?0:s.get(a-1,l),d=0===l?0:s.get(a,l-1);let c;e.getElement(a)===t.getElement(l)?(c=0===a||0===l?0:s.get(a-1,l-1),a>0&&l>0&&3===o.get(a-1,l-1)&&(c+=r.get(a-1,l-1)),c+=n?n(a,l):1):c=-1;const u=Math.max(h,d,c);if(u===c){const e=a>0&&l>0?r.get(a-1,l-1):0;r.set(a,l,e+1),o.set(a,l,3)}else u===h?(r.set(a,l,0),o.set(a,l,1)):u===d&&(r.set(a,l,0),o.set(a,l,2));s.set(a,l,u)}const a=[];let l=e.length,h=t.length;function d(e,t){e+1===l&&t+1===h||a.push(new sg(new Au(e+1,l),new Au(t+1,h))),l=e,h=t}let c=e.length-1,u=t.length-1;for(;c>=0&&u>=0;)3===o.get(c,u)?(d(c,u),c--,u--):1===o.get(c,u)?c--:u--;return d(-1,-1),a.reverse(),new ng(a,!1)}}class ug{compute(e,t,i=rg.instance){if(0===e.length||0===t.length)return ng.trivial(e,t);const n=e,s=t;function o(e,t){for(;e<n.length&&t<s.length&&n.getElement(e)===s.getElement(t);)e++,t++;return e}let r=0;const a=new mg;a.set(0,o(0,0));const l=new fg;l.set(0,0===a.get(0)?null:new gg(null,0,0,a.get(0)));let h=0;e:for(;;){if(r++,!i.isValid())return ng.trivialTimedOut(n,s);const e=-Math.min(r,s.length+r%2),t=Math.min(r,n.length+r%2);for(h=e;h<=t;h+=2){let i=0;const r=h===t?-1:a.get(h+1),d=h===e?-1:a.get(h-1)+1;i++;const c=Math.min(Math.max(r,d),n.length),u=c-h;if(i++,c>n.length||u>s.length)continue;const g=o(c,u);a.set(h,g);const m=c===r?l.get(h+1):l.get(h-1);if(l.set(h,g!==c?new gg(m,c,u,g-c):m),a.get(h)===n.length&&a.get(h)-h===s.length)break e}}let d=l.get(h);const c=[];let u=n.length,g=s.length;for(;;){const e=d?d.x+d.length:0,t=d?d.y+d.length:0;if(e===u&&t===g||c.push(new sg(new Au(e,u),new Au(t,g))),!d)break;u=d.x,g=d.y,d=d.prev}return c.reverse(),new ng(c,!1)}}class gg{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class mg{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if((e=-e-1)>=this.negativeArr.length){const e=this.negativeArr;this.negativeArr=new Int32Array(2*e.length),this.negativeArr.set(e)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const e=this.positiveArr;this.positiveArr=new Int32Array(2*e.length),this.positiveArr.set(e)}this.positiveArr[e]=t}}}class fg{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}var pg,_g;class vg{constructor(e,t){this.uri=e,this.value=t}}class bg{constructor(e,t){if(this[pg]="ResourceMap",e instanceof bg)this.map=new Map(e.map),this.toKey=null!=t?t:bg.defaultToKey;else if(function(e){return Array.isArray(e)}(e)){this.map=new Map,this.toKey=null!=t?t:bg.defaultToKey;for(const[t,i]of e)this.set(t,i)}else this.map=new Map,this.toKey=null!=e?e:bg.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new vg(e,t)),this}get(e){var t;return null===(t=this.map.get(this.toKey(e)))||void 0===t?void 0:t.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){void 0!==t&&(e=e.bind(t));for(const[t,i]of this.map)e(i.value,i.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(pg=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}bg.defaultToKey=e=>e.toString();class Cg{constructor(){this[_g]="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(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(n);break;case 1:this.addItemFirst(n);break;case 2:default:this.addItemLast(n)}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const 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 new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[(_g=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;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 new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class wg extends Cg{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(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class yg{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return void 0!==t&&(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class Sg{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class Lg{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let n=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Au(t.start-1,t.endExclusive),n=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let t=this.lineRange.start;t<this.lineRange.endExclusive;t++){let s=e[t],o=0;if(n)o=s.length,s="",n=!1;else if(!i){const e=s.trimStart();o=s.length-e.length,s=e.trimEnd()}this.additionalOffsetByLine.push(o);for(let e=0;e<s.length;e++)this.elements.push(s.charCodeAt(e));t<e.length-1&&(this.elements.push("\n".charCodeAt(0)),this.firstCharOffsetByLine[t-this.lineRange.start+1]=this.elements.length)}this.additionalOffsetByLine.push(0)}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new Au(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(e=>String.fromCharCode(e)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=Eg(e>0?this.elements[e-1]:-1),i=Eg(e<this.elements.length?this.elements[e]:-1);if(7===t&&8===i)return 0;if(8===t)return 150;let n=0;return t!==i&&(n+=10,0===t&&1===i&&(n+=1)),n+=xg(t),n+=xg(i),n}translateOffset(e){if(this.lineRange.isEmpty)return new Ci(this.lineRange.start+1,1);const t=Fu(this.firstCharOffsetByLine,t=>t<=e);return new Ci(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return wi.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length)return;if(!kg(this.elements[e]))return;let t=e;for(;t>0&&kg(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&kg(this.elements[i]);)i++;return new Au(t,i)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,t){return this.elements[e]===this.elements[t]}extendToFullLines(e){var t,i;const n=null!==(t=Pu(this.firstCharOffsetByLine,t=>t<=e.start))&&void 0!==t?t:0,s=null!==(i=function(e,t){const i=Bu(e,t);return i===e.length?void 0:e[i]}(this.firstCharOffsetByLine,t=>e.endExclusive<=t))&&void 0!==i?i:this.elements.length;return new Au(n,s)}}function kg(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}const Dg={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function xg(e){return Dg[e]}function Eg(e){return 10===e?8:13===e?7:hg(e)?6:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:-1===e?3:44===e||59===e?5:4}function Ng(e,t,i,n,s,o){let{moves:r,excludedChanges:a}=function(e,t,i,n){const s=[],o=e.filter(e=>e.modified.isEmpty&&e.original.length>=3).map(e=>new dg(e.original,t,e)),r=new Set(e.filter(e=>e.original.isEmpty&&e.modified.length>=3).map(e=>new dg(e.modified,i,e))),a=new Set;for(const e of o){let t,i=-1;for(const n of r){const s=e.computeSimilarity(n);s>i&&(i=s,t=n)}if(i>.9&&t&&(r.delete(t),s.push(new Uu(e.range,t.range)),a.add(e.source),a.add(t.source)),!n.isValid())return{moves:s,excludedChanges:a}}return{moves:s,excludedChanges:a}}(e,t,i,o);if(!o.isValid())return[];const l=function(e,t,i,n,s,o){const r=[],a=new Sg;for(const i of e)for(let e=i.original.startLineNumber;e<i.original.endLineNumberExclusive-2;e++){const i=`${t[e-1]}:${t[e+1-1]}:${t[e+2-1]}`;a.add(i,{range:new zu(e,e+3)})}const l=[];e.sort(C(e=>e.modified.startLineNumber,w));for(const t of e){let e=[];for(let n=t.modified.startLineNumber;n<t.modified.endLineNumberExclusive-2;n++){const t=`${i[n-1]}:${i[n+1-1]}:${i[n+2-1]}`,s=new zu(n,n+3),o=[];a.forEach(t,({range:t})=>{for(const i of e)if(i.originalLineRange.endLineNumberExclusive+1===t.endLineNumberExclusive&&i.modifiedLineRange.endLineNumberExclusive+1===s.endLineNumberExclusive)return i.originalLineRange=new zu(i.originalLineRange.startLineNumber,t.endLineNumberExclusive),i.modifiedLineRange=new zu(i.modifiedLineRange.startLineNumber,s.endLineNumberExclusive),void o.push(i);const i={modifiedLineRange:s,originalLineRange:t};l.push(i),o.push(i)}),e=o}if(!o.isValid())return[]}l.sort((h=C(e=>e.modifiedLineRange.length,w),(e,t)=>-h(e,t)));var h;const d=new Ku,c=new Ku;for(const e of l){const t=e.modifiedLineRange.startLineNumber-e.originalLineRange.startLineNumber,i=d.subtractFrom(e.modifiedLineRange),n=c.subtractFrom(e.originalLineRange).getWithDelta(t),s=i.getIntersection(n);for(const e of s.ranges){if(e.length<3)continue;const i=e,n=e.delta(-t);r.push(new Uu(n,i)),d.addRange(i),c.addRange(n)}}r.sort(C(e=>e.original.startLineNumber,w));const u=new Wu(e);for(let t=0;t<r.length;t++){const i=r[t],a=u.findLastMonotonous(e=>e.original.startLineNumber<=i.original.startLineNumber),l=Pu(e,e=>e.modified.startLineNumber<=i.modified.startLineNumber),h=Math.max(i.original.startLineNumber-a.original.startLineNumber,i.modified.startLineNumber-l.modified.startLineNumber),g=u.findLastMonotonous(e=>e.original.startLineNumber<i.original.endLineNumberExclusive),m=Pu(e,e=>e.modified.startLineNumber<i.modified.endLineNumberExclusive),f=Math.max(g.original.endLineNumberExclusive-i.original.endLineNumberExclusive,m.modified.endLineNumberExclusive-i.modified.endLineNumberExclusive);let p,_;for(p=0;p<h;p++){const e=i.original.startLineNumber-p-1,t=i.modified.startLineNumber-p-1;if(e>n.length||t>s.length)break;if(d.contains(t)||c.contains(e))break;if(!Ig(n[e-1],s[t-1],o))break}for(p>0&&(c.addRange(new zu(i.original.startLineNumber-p,i.original.startLineNumber)),d.addRange(new zu(i.modified.startLineNumber-p,i.modified.startLineNumber))),_=0;_<f;_++){const e=i.original.endLineNumberExclusive+_,t=i.modified.endLineNumberExclusive+_;if(e>n.length||t>s.length)break;if(d.contains(t)||c.contains(e))break;if(!Ig(n[e-1],s[t-1],o))break}_>0&&(c.addRange(new zu(i.original.endLineNumberExclusive,i.original.endLineNumberExclusive+_)),d.addRange(new zu(i.modified.endLineNumberExclusive,i.modified.endLineNumberExclusive+_))),(p>0||_>0)&&(r[t]=new Uu(new zu(i.original.startLineNumber-p,i.original.endLineNumberExclusive+_),new zu(i.modified.startLineNumber-p,i.modified.endLineNumberExclusive+_)))}return r}(e.filter(e=>!a.has(e)),n,s,t,i,o);return p(r,l),r=function(e){if(0===e.length)return e;e.sort(C(e=>e.original.startLineNumber,w));const t=[e[0]];for(let i=1;i<e.length;i++){const n=t[t.length-1],s=e[i],o=s.original.startLineNumber-n.original.endLineNumberExclusive,r=s.modified.startLineNumber-n.modified.endLineNumberExclusive;o>=0&&r>=0&&o+r<=2?t[t.length-1]=n.join(s):t.push(s)}return t}(r),r=r.filter(e=>{const i=e.original.toOffsetRange().slice(t).map(e=>e.trim());return i.join("\n").length>=15&&function(e,t){let i=0;for(const n of e)t(n)&&i++;return i}(i,e=>e.length>=2)>=2}),r=function(e,t){const i=new Wu(e);return t=t.filter(t=>(i.findLastMonotonous(e=>e.original.startLineNumber<t.original.endLineNumberExclusive)||new Uu(new zu(1,1),new zu(1,1)))!==Pu(e,e=>e.modified.startLineNumber<t.modified.endLineNumberExclusive))}(e,r),r}function Ig(e,t,i){if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;const n=(new ug).compute(new Lg([e],new Au(0,1),!1),new Lg([t],new Au(0,1),!1),i);let s=0;const o=sg.invert(n.diffs,e.length);for(const t of o)t.seq1Range.forEach(t=>{hg(e.charCodeAt(t))||s++});const r=function(t){let i=0;for(let n=0;n<e.length;n++)hg(t.charCodeAt(n))||i++;return i}(e.length>t.length?e:t);return s/r>.6&&r>10}function Tg(e,t,i){let n=i;return n=Mg(e,t,n),n=Mg(e,t,n),n=function(e,t,i){if(!e.getBoundaryScore||!t.getBoundaryScore)return i;for(let n=0;n<i.length;n++){const s=n>0?i[n-1]:void 0,o=i[n],r=n+1<i.length?i[n+1]:void 0,a=new Au(s?s.seq1Range.endExclusive+1:0,r?r.seq1Range.start-1:e.length),l=new Au(s?s.seq2Range.endExclusive+1:0,r?r.seq2Range.start-1:t.length);o.seq1Range.isEmpty?i[n]=Ag(o,e,t,a,l):o.seq2Range.isEmpty&&(i[n]=Ag(o.swap(),t,e,l,a).swap())}return i}(e,t,n),n}function Mg(e,t,i){if(0===i.length)return i;const n=[];n.push(i[0]);for(let s=1;s<i.length;s++){const o=n[n.length-1];let r=i[s];if(r.seq1Range.isEmpty||r.seq2Range.isEmpty){const i=r.seq1Range.start-o.seq1Range.endExclusive;let s;for(s=1;s<=i&&(e.getElement(r.seq1Range.start-s)===e.getElement(r.seq1Range.endExclusive-s)&&t.getElement(r.seq2Range.start-s)===t.getElement(r.seq2Range.endExclusive-s));s++);if(s--,s===i){n[n.length-1]=new sg(new Au(o.seq1Range.start,r.seq1Range.endExclusive-i),new Au(o.seq2Range.start,r.seq2Range.endExclusive-i));continue}r=r.delta(-s)}n.push(r)}const s=[];for(let i=0;i<n.length-1;i++){const o=n[i+1];let r=n[i];if(r.seq1Range.isEmpty||r.seq2Range.isEmpty){const s=o.seq1Range.start-r.seq1Range.endExclusive;let a;for(a=0;a<s&&(e.isStronglyEqual(r.seq1Range.start+a,r.seq1Range.endExclusive+a)&&t.isStronglyEqual(r.seq2Range.start+a,r.seq2Range.endExclusive+a));a++);if(a===s){n[i+1]=new sg(new Au(r.seq1Range.start+s,o.seq1Range.endExclusive),new Au(r.seq2Range.start+s,o.seq2Range.endExclusive));continue}a>0&&(r=r.delta(a))}s.push(r)}return n.length>0&&s.push(n[n.length-1]),s}function Ag(e,t,i,n,s){let o=1;for(;e.seq1Range.start-o>=n.start&&e.seq2Range.start-o>=s.start&&i.isStronglyEqual(e.seq2Range.start-o,e.seq2Range.endExclusive-o)&&o<100;)o++;o--;let r=0;for(;e.seq1Range.start+r<n.endExclusive&&e.seq2Range.endExclusive+r<s.endExclusive&&i.isStronglyEqual(e.seq2Range.start+r,e.seq2Range.endExclusive+r)&&r<100;)r++;if(0===o&&0===r)return e;let a=0,l=-1;for(let n=-o;n<=r;n++){const s=e.seq2Range.start+n,o=e.seq2Range.endExclusive+n,r=e.seq1Range.start+n,h=t.getBoundaryScore(r)+i.getBoundaryScore(s)+i.getBoundaryScore(o);h>l&&(l=h,a=n)}return e.delta(a)}class Og{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){return 1e3-((0===e?0:Rg(this.lines[e-1]))+(e===this.lines.length?0:Rg(this.lines[e])))}getText(e){return this.lines.slice(e.start,e.endExclusive).join("\n")}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function Rg(e){let t=0;for(;t<e.length&&(32===e.charCodeAt(t)||9===e.charCodeAt(t));)t++;return t}class Pg{constructor(){this.dynamicProgrammingDiffing=new cg,this.myersDiffingAlgorithm=new ug}computeDiff(e,t,i){if(e.length<=1&&s(e,t,(e,t)=>e===t))return new Tu([],[],!1);if(1===e.length&&0===e[0].length||1===t.length&&0===t[0].length)return new Tu([new ju(new zu(1,e.length+1),new zu(1,t.length+1),[new qu(new wi(1,1,e.length,e[0].length+1),new wi(1,1,t.length,t[0].length+1))])],[],!1);const n=0===i.maxComputationTimeMs?rg.instance:new ag(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(e){let t=r.get(e);return void 0===t&&(t=r.size,r.set(e,t)),t}const l=e.map(e=>a(e.trim())),h=t.map(e=>a(e.trim())),d=new Og(l,e),c=new Og(h,t),u=(()=>d.length+c.length<1700?this.dynamicProgrammingDiffing.compute(d,c,n,(i,n)=>e[i]===t[n]?0===t[n].length?.1:1+Math.log(1+t[n].length):.99):this.myersDiffingAlgorithm.compute(d,c))();let g=u.diffs,m=u.hitTimeout;g=Tg(d,c,g),g=function(e,t,i){let n=i;if(0===n.length)return n;let s,o=0;do{s=!1;const t=[n[0]];for(let i=1;i<n.length;i++){const o=n[i],a=t[t.length-1];function r(t,i){const n=new Au(a.seq1Range.endExclusive,o.seq1Range.start);return e.getText(n).replace(/\s/g,"").length<=4&&(t.seq1Range.length+t.seq2Range.length>5||i.seq1Range.length+i.seq2Range.length>5)}r(a,o)?(s=!0,t[t.length-1]=t[t.length-1].join(o)):t.push(o)}n=t}while(o++<10&&s);return n}(d,0,g);const f=[],p=i=>{if(o)for(let s=0;s<i;s++){const i=_+s,r=v+s;if(e[i]!==t[r]){const s=this.refineDiff(e,t,new sg(new Au(i,i+1),new Au(r,r+1)),n,o);for(const e of s.mappings)f.push(e);s.hitTimeout&&(m=!0)}}};let _=0,v=0;for(const i of g){Dh(()=>i.seq1Range.start-_==i.seq2Range.start-v);p(i.seq1Range.start-_),_=i.seq1Range.endExclusive,v=i.seq2Range.endExclusive;const s=this.refineDiff(e,t,i,n,o);s.hitTimeout&&(m=!0);for(const e of s.mappings)f.push(e)}p(e.length-_);const b=Fg(f,e,t);let C=[];return i.computeMoves&&(C=this.computeMoves(b,e,t,l,h,n,o)),Dh(()=>{function i(e,t){if(e.lineNumber<1||e.lineNumber>t.length)return!1;const i=t[e.lineNumber-1];return!(e.column<1||e.column>i.length+1)}function n(e,t){return!(e.startLineNumber<1||e.startLineNumber>t.length+1)&&!(e.endLineNumberExclusive<1||e.endLineNumberExclusive>t.length+1)}for(const s of b){if(!s.innerChanges)return!1;for(const n of s.innerChanges){if(!(i(n.modifiedRange.getStartPosition(),t)&&i(n.modifiedRange.getEndPosition(),t)&&i(n.originalRange.getStartPosition(),e)&&i(n.originalRange.getEndPosition(),e)))return!1}if(!n(s.modified,t)||!n(s.original,e))return!1}return!0}),new Tu(b,C,m)}computeMoves(e,t,i,n,s,o,r){return Ng(e,t,i,n,s,o).map(e=>{const n=Fg(this.refineDiff(t,i,new sg(e.original.toOffsetRange(),e.modified.toOffsetRange()),o,r).mappings,t,i,!0);return new Mu(e,n)})}refineDiff(e,t,i,n,s){const o=new Lg(e,i.seq1Range,s),r=new Lg(t,i.seq2Range,s),a=o.length+r.length<500?this.dynamicProgrammingDiffing.compute(o,r,n):this.myersDiffingAlgorithm.compute(o,r,n);let l=a.diffs;l=Tg(o,r,l),l=function(e,t,i){const n=sg.invert(i,e.length),s=[];let o=new og(0,0);function r(i,r){if(i.offset1<o.offset1||i.offset2<o.offset2)return;const a=e.findWordContaining(i.offset1),l=t.findWordContaining(i.offset2);if(!a||!l)return;let h=new sg(a,l);const d=h.intersect(r);let c=d.seq1Range.length,u=d.seq2Range.length;for(;n.length>0;){const i=n[0];if(!(i.seq1Range.intersects(a)||i.seq2Range.intersects(l)))break;const s=e.findWordContaining(i.seq1Range.start),o=t.findWordContaining(i.seq2Range.start),r=new sg(s,o),d=r.intersect(i);if(c+=d.seq1Range.length,u+=d.seq2Range.length,h=h.join(r),!(h.seq1Range.endExclusive>=i.seq1Range.endExclusive))break;n.shift()}c+u<2*(h.seq1Range.length+h.seq2Range.length)/3&&s.push(h),o=h.getEndExclusives()}for(;n.length>0;){const e=n.shift();e.seq1Range.isEmpty||(r(e.getStarts(),e),r(e.getEndExclusives().delta(-1),e))}return function(e,t){const i=[];for(;e.length>0||t.length>0;){const n=e[0],s=t[0];let o;o=n&&(!s||n.seq1Range.start<s.seq1Range.start)?e.shift():t.shift(),i.length>0&&i[i.length-1].seq1Range.endExclusive>=o.seq1Range.start?i[i.length-1]=i[i.length-1].join(o):i.push(o)}return i}(i,s)}(o,r,l),l=function(e,t,i){const n=[];for(const e of i){const t=n[n.length-1];t?e.seq1Range.start-t.seq1Range.endExclusive<=2||e.seq2Range.start-t.seq2Range.endExclusive<=2?n[n.length-1]=new sg(t.seq1Range.join(e.seq1Range),t.seq2Range.join(e.seq2Range)):n.push(e):n.push(e)}return n}(0,0,l),l=function(e,t,i){let n=i;if(0===n.length)return n;let s,o=0;do{s=!1;const i=[n[0]];for(let o=1;o<n.length;o++){const a=n[o],l=i[i.length-1];function r(i,n){const s=new Au(l.seq1Range.endExclusive,a.seq1Range.start);if(e.countLinesIn(s)>5||s.length>500)return!1;const o=e.getText(s).trim();if(o.length>20||o.split(/\r\n|\r|\n/).length>1)return!1;const r=e.countLinesIn(i.seq1Range),h=i.seq1Range.length,d=t.countLinesIn(i.seq2Range),c=i.seq2Range.length,u=e.countLinesIn(n.seq1Range),g=n.seq1Range.length,m=t.countLinesIn(n.seq2Range),f=n.seq2Range.length;function p(e){return Math.min(e,130)}return Math.pow(Math.pow(p(40*r+h),1.5)+Math.pow(p(40*d+c),1.5),1.5)+Math.pow(Math.pow(p(40*u+g),1.5)+Math.pow(p(40*m+f),1.5),1.5)>74184.96480721243}r(l,a)?(s=!0,i[i.length-1]=i[i.length-1].join(a)):i.push(a)}n=i}while(o++<10&&s);const a=[];return function(e,t){for(let i=0;i<e.length;i++)t(0===i?void 0:e[i-1],e[i],i+1===e.length?void 0:e[i+1])}(n,(t,i,n)=>{let s=i;function o(e){return e.length>0&&e.trim().length<=3&&i.seq1Range.length+i.seq2Range.length>100}const r=e.extendToFullLines(i.seq1Range),l=e.getText(new Au(r.start,i.seq1Range.start));o(l)&&(s=s.deltaStart(-l.length));const h=e.getText(new Au(i.seq1Range.endExclusive,r.endExclusive));o(h)&&(s=s.deltaEnd(h.length));const d=sg.fromOffsetPairs(t?t.getEndExclusives():og.zero,n?n.getStarts():og.max),c=s.intersect(d);a.length>0&&c.getStarts().equals(a[a.length-1].getEndExclusives())?a[a.length-1]=a[a.length-1].join(c):a.push(c)}),a}(o,r,l);return{mappings:l.map(e=>new qu(o.translateRange(e.seq1Range),r.translateRange(e.seq2Range))),hitTimeout:a.hitTimeout}}}function Fg(e,t,i,n=!1){const s=[];for(const n of o(e.map(e=>function(e,t,i){let n=0,s=0;1===e.modifiedRange.endColumn&&1===e.originalRange.endColumn&&e.originalRange.startLineNumber+n<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+n<=e.modifiedRange.endLineNumber&&(s=-1);e.modifiedRange.startColumn-1>=i[e.modifiedRange.startLineNumber-1].length&&e.originalRange.startColumn-1>=t[e.originalRange.startLineNumber-1].length&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+s&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+s&&(n=1);const o=new zu(e.originalRange.startLineNumber+n,e.originalRange.endLineNumber+1+s),r=new zu(e.modifiedRange.startLineNumber+n,e.modifiedRange.endLineNumber+1+s);return new ju(o,r,[e])}(e,t,i)),(e,t)=>e.original.overlapOrTouch(t.original)||e.modified.overlapOrTouch(t.modified))){const e=n[0],t=n[n.length-1];s.push(new ju(e.original.join(t.original),e.modified.join(t.modified),n.map(e=>e.innerChanges[0])))}return Dh(()=>!(!n&&s.length>0&&s[0].original.startLineNumber!==s[0].modified.startLineNumber)&&xh(s,(e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber)),s}const Bg=()=>new $u,Wg=()=>new Pg;function Vg(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}class Hg{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=Vg(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class zg{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=Vg(Math.max(Math.min(1,t),0),3),this.l=Vg(Math.max(Math.min(1,i),0),3),this.a=Vg(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,s=e.a,o=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const h=(r+o)/2,d=o-r;if(d>0){switch(l=Math.min(h<=.5?d/(2*h):d/(2-2*h),1),o){case t:a=(i-n)/d+(i<n?6:0);break;case i:a=(n-t)/d+2;break;case n:a=(t-i)/d+4}a*=60,a=Math.round(a)}return new zg(a,l,h,s)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:n,a:s}=e;let o,r,a;if(0===i)o=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,s=2*n-e;o=zg._hue2rgb(s,e,t+1/3),r=zg._hue2rgb(s,e,t),a=zg._hue2rgb(s,e,t-1/3)}return new Hg(Math.round(255*o),Math.round(255*r),Math.round(255*a),s)}}class Kg{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=Vg(Math.max(Math.min(1,t),0),3),this.v=Vg(Math.max(Math.min(1,i),0),3),this.a=Vg(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,s=Math.max(t,i,n),o=s-Math.min(t,i,n),r=0===s?0:o/s;let a;return a=0===o?0:s===t?((i-n)/o%6+6)%6:s===i?(n-t)/o+2:(t-i)/o+4,new Kg(Math.round(60*a),r,s,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:s}=e,o=n*i,r=o*(1-Math.abs(t/60%2-1)),a=n-o;let[l,h,d]=[0,0,0];return t<60?(l=o,h=r):t<120?(l=r,h=o):t<180?(h=o,d=r):t<240?(h=r,d=o):t<300?(l=r,d=o):t<=360&&(l=o,d=r),l=Math.round(255*(l+a)),h=Math.round(255*(h+a)),d=Math.round(255*(d+a)),new Hg(l,h,d,s)}}class Ug{static fromHex(e){return Ug.Format.CSS.parseHex(e)||Ug.red}static equals(e,t){return!e&&!t||!(!e||!t)&&e.equals(t)}get hsla(){return this._hsla?this._hsla:zg.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Kg.fromRGBA(this.rgba)}constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof Hg)this.rgba=e;else if(e instanceof zg)this._hsla=e,this.rgba=zg.toRGBA(e);else{if(!(e instanceof Kg))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=Kg.toRGBA(e)}}equals(e){return!!e&&Hg.equals(this.rgba,e.rgba)&&zg.equals(this.hsla,e.hsla)&&Kg.equals(this.hsva,e.hsva)}getRelativeLuminance(){return Vg(.2126*Ug._relativeLuminanceForComponent(this.rgba.r)+.7152*Ug._relativeLuminanceForComponent(this.rgba.g)+.0722*Ug._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()<e.getRelativeLuminance()}lighten(e){return new Ug(new zg(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new Ug(new zg(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:i,b:n,a:s}=this.rgba;return new Ug(new Hg(t,i,n,s*e))}isTransparent(){return 0===this.rgba.a}isOpaque(){return 1===this.rgba.a}opposite(){return new Ug(new Hg(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}makeOpaque(e){if(this.isOpaque()||1!==e.rgba.a)return this;const{r:t,g:i,b:n,a:s}=this.rgba;return new Ug(new Hg(e.rgba.r-s*(e.rgba.r-t),e.rgba.g-s*(e.rgba.g-i),e.rgba.b-s*(e.rgba.b-n),1))}toString(){return this._toString||(this._toString=Ug.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),s=t.getRelativeLuminance();return i=i*(s-n)/s,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance();return i=i*(n-t.getRelativeLuminance())/n,e.darken(i)}}function jg(e){const t=[];for(const i of e){const e=Number(i);(e||0===e&&""!==i.replace(/\s/g,""))&&t.push(e)}return t}function qg(e,t,i,n){return{red:e/255,blue:i/255,green:t/255,alpha:n}}function $g(e,t){const i=t.index,n=t[0].length;if(!i)return;const s=e.positionAt(i);return{startLineNumber:s.lineNumber,startColumn:s.column,endLineNumber:s.lineNumber,endColumn:s.column+n}}function Gg(e,t){if(!e)return;const i=Ug.Format.CSS.parseHex(t);return i?{range:e,color:qg(i.rgba.r,i.rgba.g,i.rgba.b,i.rgba.a)}:void 0}function Zg(e,t,i){if(!e||1!==t.length)return;const n=jg(t[0].values());return{range:e,color:qg(n[0],n[1],n[2],i?n[3]:1)}}function Yg(e,t,i){if(!e||1!==t.length)return;const n=jg(t[0].values()),s=new Ug(new zg(n[0],n[1]/100,n[2]/100,i?n[3]:1));return{range:e,color:qg(s.rgba.r,s.rgba.g,s.rgba.b,s.rgba.a)}}function Qg(e,t){return"string"==typeof e?[...e.matchAll(t)]:e.findMatches(t)}function Xg(e){return e&&"function"==typeof e.getValue&&"function"==typeof e.positionAt?function(e){const t=[],i=Qg(e,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const n of i){const i=n.filter(e=>void 0!==e),s=i[1],o=i[2];if(!o)continue;let r;if("rgb"===s){const t=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;r=Zg($g(e,n),Qg(o,t),!1)}else if("rgba"===s){const t=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;r=Zg($g(e,n),Qg(o,t),!0)}else if("hsl"===s){const t=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;r=Yg($g(e,n),Qg(o,t),!1)}else if("hsla"===s){const t=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;r=Yg($g(e,n),Qg(o,t),!0)}else"#"===s&&(r=Gg($g(e,n),s+o));r&&t.push(r)}return t}(e):[]}Ug.white=new Ug(new Hg(255,255,255,1)),Ug.black=new Ug(new Hg(0,0,0,1)),Ug.red=new Ug(new Hg(255,0,0,1)),Ug.blue=new Ug(new Hg(0,0,255,1)),Ug.green=new Ug(new Hg(0,255,0,1)),Ug.cyan=new Ug(new Hg(0,255,255,1)),Ug.lightgrey=new Ug(new Hg(211,211,211,1)),Ug.transparent=new Ug(new Hg(0,0,0,0)),function(e){let t;!function(t){let i;!function(t){function i(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}function n(e){switch(e){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:case 65:return 10;case 98:case 66:return 11;case 99:case 67:return 12;case 100:case 68:return 13;case 101:case 69:return 14;case 102:case 70:return 15}return 0}t.formatRGB=function(t){return 1===t.rgba.a?`rgb(${t.rgba.r}, ${t.rgba.g}, ${t.rgba.b})`:e.Format.CSS.formatRGBA(t)},t.formatRGBA=function(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`},t.formatHSL=function(t){return 1===t.hsla.a?`hsl(${t.hsla.h}, ${(100*t.hsla.s).toFixed(2)}%, ${(100*t.hsla.l).toFixed(2)}%)`:e.Format.CSS.formatHSLA(t)},t.formatHSLA=function(e){return`hsla(${e.hsla.h}, ${(100*e.hsla.s).toFixed(2)}%, ${(100*e.hsla.l).toFixed(2)}%, ${e.hsla.a.toFixed(2)})`},t.formatHex=function(e){return`#${i(e.rgba.r)}${i(e.rgba.g)}${i(e.rgba.b)}`},t.formatHexA=function(t,n=!1){return n&&1===t.rgba.a?e.Format.CSS.formatHex(t):`#${i(t.rgba.r)}${i(t.rgba.g)}${i(t.rgba.b)}${i(Math.round(255*t.rgba.a))}`},t.format=function(t){return t.isOpaque()?e.Format.CSS.formatHex(t):e.Format.CSS.formatRGBA(t)},t.parseHex=function(t){const i=t.length;if(0===i)return null;if(35!==t.charCodeAt(0))return null;if(7===i){const i=16*n(t.charCodeAt(1))+n(t.charCodeAt(2)),s=16*n(t.charCodeAt(3))+n(t.charCodeAt(4)),o=16*n(t.charCodeAt(5))+n(t.charCodeAt(6));return new e(new Hg(i,s,o,1))}if(9===i){const i=16*n(t.charCodeAt(1))+n(t.charCodeAt(2)),s=16*n(t.charCodeAt(3))+n(t.charCodeAt(4)),o=16*n(t.charCodeAt(5))+n(t.charCodeAt(6)),r=16*n(t.charCodeAt(7))+n(t.charCodeAt(8));return new e(new Hg(i,s,o,r/255))}if(4===i){const i=n(t.charCodeAt(1)),s=n(t.charCodeAt(2)),o=n(t.charCodeAt(3));return new e(new Hg(16*i+i,16*s+s,16*o+o))}if(5===i){const i=n(t.charCodeAt(1)),s=n(t.charCodeAt(2)),o=n(t.charCodeAt(3)),r=n(t.charCodeAt(4));return new e(new Hg(16*i+i,16*s+s,16*o+o,(16*r+r)/255))}return null}}(i=t.CSS||(t.CSS={}))}(t=e.Format||(e.Format={}))}(Ug||(Ug={}));class Jg extends class{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const e of t)this._acceptDeleteRange(e.range),this._acceptInsertText(new Ci(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;n<t;n++)i[n]=this._lines[n].length+e;this._lineStarts=new tu(i)}}_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)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);else{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))}}_acceptInsertText(e,t){if(0===t.length)return;const i=Gn(t);if(1===i.length)return void this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));i[i.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)+i[0]);const n=new Uint32Array(i.length-1);for(let t=1;t<i.length;t++)this._lines.splice(e.lineNumber+t-1,0,i[t]),n[t-1]=i[t].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,n)}}{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;i<this._lines.length;i++){const n=this._lines[i],s=this.offsetAt(new Ci(i+1,1)),o=n.matchAll(e);for(const e of o)(e.index||0===e.index)&&(e.index=e.index+s),t.push(e)}return t}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){const i=Q(e.column,Z(t),this._lines[e.lineNumber-1],0);return i?new wi(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let n=0,s="",o=0,r=[];return{*[Symbol.iterator](){for(;;)if(o<r.length){const e=s.substring(r[o].start,r[o].end);o+=1,yield e}else{if(!(n<t.length))break;s=t[n],r=i(s,e),o=0,n+=1}}}}getLineWords(e,t){const i=this._lines[e-1],n=this._wordenize(i,t),s=[];for(const e of n)s.push({word:i.substring(e.start,e.end),startColumn:e.start+1,endColumn:e.end+1});return s}_wordenize(e,t){const i=[];let n;for(t.lastIndex=0;(n=t.exec(e))&&0!==n[0].length;)i.push({start:n.index,end:n.index+n[0].length});return i}getValueInRange(e){if((e=this._validateRange(e)).startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const t=this._eol,i=e.startLineNumber-1,n=e.endLineNumber-1,s=[];s.push(this._lines[i].substring(e.startColumn-1));for(let e=i+1;e<n;e++)s.push(this._lines[e]);return s.push(this._lines[n].substring(0,e.endColumn-1)),s.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!Ci.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:i}=e,n=!1;if(t<1)t=1,i=1,n=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{const e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}}class em{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new Jg(di.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}async computeUnicodeHighlights(e,t,i){const n=this._getModel(e);return n?class{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,s=i?i.endLineNumber:e.getLineCount(),o=new Nu(t),r=o.getCandidateCodePoints();let a;a="allNonBasicAscii"===r?new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):new RegExp(""+`[${Un(Array.from(r).map(e=>String.fromCodePoint(e)).join(""))}]`,"g");const l=new Eu(null,a),h=[];let d,c=!1,u=0,g=0,m=0;e:for(let t=n,i=s;t<=i;t++){const i=e.getLineContent(t),n=i.length;l.reset(0);do{if(d=l.next(i),d){let e=d.index,s=d.index+d[0].length;if(e>0){hs(i.charCodeAt(e-1))&&e--}if(s+1<n){hs(i.charCodeAt(s-1))&&s++}const r=i.substring(e,s);let a=Q(e+1,G,i,0);a&&a.endColumn<=e+1&&(a=null);const l=o.shouldHighlightNonBasicASCII(r,a?a.word:null);if(0!==l){3===l?u++:2===l?g++:1===l?m++:Lh();const i=1e3;if(h.length>=i){c=!0;break e}h.push(new wi(t,e+1,t,s+1))}}}while(d)}return{ranges:h,hasMore:c,ambiguousCharacterCount:u,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new Nu(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const n=e.codePointAt(0),s=i.ambiguousCharacters.getPrimaryConfusable(n),o=Ms.getLocales().filter(e=>!Ms.getInstance(new Set([...t.allowedLocales,e])).isAmbiguous(n));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:o}}case 1:return{kind:2}}}}.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async computeDiff(e,t,i,n){const s=this._getModel(e),o=this._getModel(t);if(!s||!o)return null;return em.computeDiff(s,o,i,n)}static computeDiff(e,t,i,n){const s="advanced"===n?Wg():Bg(),o=e.getLinesContent(),r=t.getLinesContent(),a=s.computeDiff(o,r,i);function l(e){return e.map(e=>{var t;return[e.original.startLineNumber,e.original.endLineNumberExclusive,e.modified.startLineNumber,e.modified.endLineNumberExclusive,null===(t=e.innerChanges)||void 0===t?void 0:t.map(e=>[e.originalRange.startLineNumber,e.originalRange.startColumn,e.originalRange.endLineNumber,e.originalRange.endColumn,e.modifiedRange.startLineNumber,e.modifiedRange.startColumn,e.modifiedRange.endLineNumber,e.modifiedRange.endColumn])]})}return{identical:!(a.changes.length>0)&&this._modelsAreIdentical(e,t),quitEarly:a.hitTimeout,changes:l(a.changes),moves:a.moves.map(e=>[e.lineRangeMapping.original.startLineNumber,e.lineRangeMapping.original.endLineNumberExclusive,e.lineRangeMapping.modified.startLineNumber,e.lineRangeMapping.modified.endLineNumberExclusive,l(e.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++){if(e.getLineContent(n)!==t.getLineContent(n))return!1}return!0}async computeMoreMinimalEdits(e,t,i){const n=this._getModel(e);if(!n)return t;const s=[];let o=void 0;t=t.slice(0).sort((e,t)=>{if(e.range&&t.range)return wi.compareRangesUsingStarts(e.range,t.range);return(e.range?0:1)-(t.range?0:1)});let r=0;for(let e=1;e<t.length;e++)wi.getEndPosition(t[r].range).equals(wi.getStartPosition(t[e].range))?(t[r].range=wi.fromPositions(wi.getStartPosition(t[r].range),wi.getEndPosition(t[e].range)),t[r].text+=t[e].text):(r++,t[r]=t[e]);t.length=r+1;for(let{range:e,text:r,eol:a}of t){if("number"==typeof a&&(o=a),wi.isEmpty(e)&&!r)continue;const t=n.getValueInRange(e);if(r=r.replace(/\r\n|\n|\r/g,n.eol),t===r)continue;if(Math.max(r.length,t.length)>em._diffLimit){s.push({range:e,text:r});continue}const l=Gc(t,r,i),h=n.offsetAt(wi.lift(e).getStartPosition());for(const e of l){const t=n.positionAt(h+e.originalStart),i=n.positionAt(h+e.originalStart+e.originalLength),o={text:r.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}};n.getValueInRange(o.range)!==o.text&&s.push(o)}}return"number"==typeof o&&s.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}async computeLinks(e){const t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?hu.computeLinks(e):[]}(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?Xg(t):null}async textualSuggest(e,t,i,n){const s=new ht,o=new RegExp(i,n),r=new Set;e:for(const i of e){const e=this._getModel(i);if(e)for(const i of e.words(o))if(i!==t&&isNaN(Number(i))&&(r.add(i),r.size>em._suggestionsLimit))break e}return{words:Array.from(r),duration:s.elapsed()}}async computeWordRanges(e,t,i,n){const s=this._getModel(e);if(!s)return Object.create(null);const o=new RegExp(i,n),r=Object.create(null);for(let e=t.startLineNumber;e<t.endLineNumber;e++){const t=s.getLineWords(e,o);for(const i of t){if(!isNaN(Number(i.word)))continue;let t=r[i.word];t||(t=[],r[i.word]=t),t.push({startLineNumber:e,startColumn:i.startColumn,endLineNumber:e,endColumn:i.endColumn})}}return r}async navigateValueSet(e,t,i,n,s){const o=this._getModel(e);if(!o)return null;const r=new RegExp(n,s);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});const a=o.getValueInRange(t),l=o.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},r);if(!l)return null;const h=o.getValueInRange(l);return du.INSTANCE.navigateValueSet(t,a,l,h,i)}loadForeignModule(e,t,i){const n={host:function(e,t){const i=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},n={};for(const t of e)n[t]=i(t);return n}(i,(e,t)=>this._host.fhr(e,t)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(n,t),Promise.resolve(z(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}em._diffLimit=1e5,em._suggestionsLimit=1e4,"function"==typeof importScripts&&(globalThis.monaco=Rn());const tm=wl("textResourceConfigurationService"),im=wl("textResourcePropertiesService"),nm=wl("ILanguageFeaturesService");var sm=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},om=function(e,t){return function(i,n){t(i,n,e)}};function rm(e,t){const i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let am=class extends st{constructor(e,t,i,n,s){super(),this._modelService=e,this._workerManager=this._register(new hm(this._modelService,n)),this._logService=i,this._register(s.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(e,t)=>rm(this._modelService,e.uri)?this._workerManager.withWorker().then(t=>t.computeLinks(e.uri)).then(e=>e&&{links:e}):Promise.resolve({links:[]})})),this._register(s.completionProvider.register("*",new lm(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return rm(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(n=>n.computedUnicodeHighlights(e,t,i))}async computeDiff(e,t,i,n){const s=await this._workerManager.withWorker().then(s=>s.computeDiff(e,t,i,n));if(!s)return null;return{identical:s.identical,quitEarly:s.quitEarly,changes:o(s.changes),moves:s.moves.map(e=>new Mu(new Uu(new zu(e[0],e[1]),new zu(e[2],e[3])),o(e[4])))};function o(e){return e.map(e=>{var t;return new ju(new zu(e[0],e[1]),new zu(e[2],e[3]),null===(t=e[4])||void 0===t?void 0:t.map(e=>new qu(new wi(e[0],e[1],e[2],e[3]),new wi(e[4],e[5],e[6],e[7]))))})}}computeMoreMinimalEdits(e,t,i=!1){if(h(t)){if(!rm(this._modelService,e))return Promise.resolve(t);const n=ht.create(),s=this._workerManager.withWorker().then(n=>n.computeMoreMinimalEdits(e,t,i));return s.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([s,ho(1e3).then(()=>t)])}return Promise.resolve(void 0)}canNavigateValueSet(e){return rm(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return rm(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};am=sm([om(0,Sl),om(1,tm),om(2,Kh),om(3,Oc),om(4,nm)],am);class lm{constructor(e,t,i,n){this.languageConfigurationService=n,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if("off"===i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestions)rm(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())rm(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):"allDocuments"!==i.wordBasedSuggestions&&t.getLanguageId()!==e.getLanguageId()||n.push(t.uri));if(0===n.length)return;const s=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),o=e.getWordAtPosition(t),r=o?new wi(t.lineNumber,o.startColumn,t.lineNumber,o.endColumn):wi.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=await this._workerManager.withWorker(),h=await l.textualSuggest(n,null==o?void 0:o.word,s);return h?{duration:h.duration,suggestions:h.words.map(e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}}))}:void 0}}class hm extends st{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime();this._register(new ta).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(15e4),Fn),this._register(this._modelService.onModelRemoved(e=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;(new Date).getTime()-this._lastWorkerUsedTime>3e5&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new gm(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class dm extends st{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const e=new go;e.cancelAndSet(()=>this._checkStopModelSync(),Math.round(3e4)),this._register(e)}}dispose(){for(const e in this._syncedModels)et(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){const e=(new Date).getTime(),t=[];for(const i in this._syncedModelsLastUsedTime){e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i)}for(const e of t)this._stopModelSync(e)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i)return;if(!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const s=new nt;s.add(i.onDidChangeContent(e=>{this._proxy.acceptModelChanged(n.toString(),e)})),s.add(i.onWillDispose(()=>{this._stopModelSync(n)})),s.add(it(()=>{this._proxy.acceptRemovedModel(n)})),this._syncedModels[n]=s}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],et(t)}}class cm{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class um{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class gm extends st{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new yd(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new fd(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new um(this)))}catch(e){ld(e),this._worker=new cm(new em(new um(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(ld(e),this._worker=new cm(new em(new um(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new dm(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(function(){const e=new Error("Canceled");return e.name=e.message,e}()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).then(s=>s.computeDiff(e.toString(),t.toString(),i,n))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeMoreMinimalEdits(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,i){const n=await this._withSyncedResources(e),s=i.source,o=i.flags;return n.textualSuggest(e.map(e=>e.toString()),t,s,o)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const s=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),o=s.source,r=s.flags;return i.computeWordRanges(e.toString(),t,o,r)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(n=>{const s=this._modelService.getModel(e);if(!s)return null;const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return n.navigateValueSet(e.toString(),t,i,r,a)})}dispose(){super.dispose(),this._disposed=!0}}class mm extends gm{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||"function"!=typeof this._foreignModuleHost[e])return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(e){return Promise.reject(e)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?z(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(t=>{this._foreignModuleCreateData=null;const i=(t,i)=>e.fmr(t,i),n=(e,t)=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},s={};for(const e of t)s[e]=n(e,i);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(e=>this.getProxy())}}const fm={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},pm=new class{clone(){return this}equals(e){return this===e}};function _m(e,t){return new Ni([new Ei(0,"",e)],t)}function vm(e,t){const i=new Uint32Array(2);return i[0]=0,i[1]=(32768|e<<0|2<<24)>>>0,new Ii(i,null===t?pm:t)}class bm{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return 0!=(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e);const i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),8&i&&(t+=" mtks"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let s=`color: ${t[i]};`;1&n&&(s+="font-style: italic;"),2&n&&(s+="font-weight: bold;");let o="";return 4&n&&(o+=" underline"),8&n&&(o+=" line-through"),o&&(s+=`text-decoration:${o};`),s}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:Boolean(1&i),bold:Boolean(2&i),underline:Boolean(4&i),strikethrough:Boolean(8&i)}}}class Cm{static createEmpty(e,t){const i=Cm.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new Cm(n,e,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}equals(e){return e instanceof Cm&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,s=n+(i<<1);for(let t=n;t<s;t++)if(this._tokens[t]!==e._tokens[t])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=bm.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return bm.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return bm.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return bm.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return bm.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return bm.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Cm.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new wm(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let t=0;t<i;t++)e[t<<1]=e[t+1<<1];e[i<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,n=(e.length>>>1)-1;for(;i<n;){const s=i+Math.floor((n-i)/2),o=e[s<<1];if(o===t)return s+1;o<t?i=s+1:o>t&&(n=s)}return i}withInserted(e){if(0===e.length)return this;let t=0,i=0,n="";const s=new Array;let o=0;for(;;){const r=t<this._tokensCount?this._tokens[t<<1]:-1,a=i<e.length?e[i]:null;if(-1!==r&&(null===a||r<=a.offset)){n+=this._text.substring(o,r);const e=this._tokens[1+(t<<1)];s.push(n.length,e),t++,o=r}else{if(!a)break;if(a.offset>o){n+=this._text.substring(o,a.offset);const e=this._tokens[1+(t<<1)];s.push(n.length,e),o=a.offset}n+=a.text,s.push(n.length,a.tokenMetadata),i++}}return new Cm(new Uint32Array(s),n,this._languageIdCodec)}}Cm.defaultTokenMetadata=33587200;class wm{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let t=this._firstTokenIndex,n=e.getCount();t<n;t++){if(e.getStartOffset(t)>=i)break;this._tokensCount++}}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof wm&&(this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount))}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class ym{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!ym._equals(e[n],t[n]))return!1;return!0}static extractWrapped(e,t,i){if(0===e.length)return e;const n=t+1,s=i+1,o=i-t,r=[];let a=0;for(const t of e)t.endColumn<=n||t.startColumn>=s||(r[a++]=new ym(Math.max(1,t.startColumn-n+1),Math.min(o+1,t.endColumn-n+1),t.className,t.type));return r}static filter(e,t,i,n){if(0===e.length)return[];const s=[];let o=0;for(let r=0,a=e.length;r<a;r++){const a=e[r],l=a.range;if(l.endLineNumber<t||l.startLineNumber>t)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const h=l.startLineNumber===t?l.startColumn:i,d=l.endLineNumber===t?l.endColumn:n;s[o++]=new ym(h,d,a.inlineClassName,a.type)}return s}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=ym._typeCompare(e.type,t.type);return 0!==i?i:e.className!==t.className?e.className<t.className?-1:1:0}}class Sm{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class Lm{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i<n;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let e=0;for(;e+1<this.count&&this.stopOffsets[e]===this.stopOffsets[e+1];)e++;i.push(new Sm(t,this.stopOffsets[e],this.classNames.join(" "),Lm._metadata(this.metadata))),t=this.stopOffsets[e]+1,this.stopOffsets.splice(0,e+1),this.classNames.splice(0,e+1),this.metadata.splice(0,e+1),this.count-=e+1}return this.count>0&&t<e&&(i.push(new Sm(t,e-1,this.classNames.join(" "),Lm._metadata(this.metadata))),t=e),t}insert(e,t,i){if(0===this.count||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let n=0;n<this.count;n++)if(this.stopOffsets[n]>=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class km{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class Dm{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class xm{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u,g,m,f,p,_,v){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=s,this.containsRTL=o,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(ym.compare),this.tabSize=h,this.startVisibleColumn=d,this.spaceWidth=c,this.stopRenderingLineAfter=m,this.renderWhitespace="all"===f?4:"boundary"===f?1:"selection"===f?2:"trailing"===f?3:0,this.renderControlCharacters=p,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort((e,t)=>e.startOffset<t.startOffset?-1:1);Math.abs(g-c)<Math.abs(u-c)?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=u,this.renderSpaceCharCode=183)}sameSelection(e){if(null===this.selectionsOnLine)return null===e;if(null===e)return!1;if(e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&ym.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class Em{constructor(e,t){this.partIndex=e,this.charIndex=t}}class Nm{static getPartIndex(e){return(4294901760&e)>>>16}static getCharIndex(e){return(65535&e)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const s=(t<<16|i<<0)>>>0;this._data[e-1]=s,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return 0===this._horizontalOffset.length?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=Nm.getPartIndex(t),n=Nm.getCharIndex(t);return new Em(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(0===this.length)return 0;const n=(e<<16|i<<0)>>>0;let s=0,o=this.length-1;for(;s+1<o;){const e=s+o>>>1,t=this._data[e];if(t===n)return e;t>n?o=e:s=e}if(s===o)return s;const r=this._data[s],a=this._data[o];if(r===n)return s;if(a===n)return o;const l=Nm.getPartIndex(r),h=Nm.getCharIndex(r);let d;d=l!==Nm.getPartIndex(a)?t:Nm.getCharIndex(a);return i-h<=d-i?s:o}}class Im{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function Tm(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendString("<span>");let i=0,n=0,s=0;for(const o of e.lineDecorations)1!==o.type&&2!==o.type||(t.appendString('<span class="'),t.appendString(o.className),t.appendString('"></span>'),1===o.type&&(s|=1,i++),2===o.type&&(s|=2,n++));t.appendString("</span>");const o=new Nm(1,i+n);return o.setColumnInfo(1,i,0,0),new Im(o,!1,s)}return t.appendString("<span><span></span></span>"),new Im(new Nm(0,0),!1,0)}return function(e,t){const i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,s=e.containsForeignElements,o=e.lineContent,r=e.len,a=e.isOverflowing,l=e.overflowingCharCount,h=e.parts,d=e.fauxIndentLength,c=e.tabSize,u=e.startVisibleColumn,g=e.containsRTL,m=e.spaceWidth,f=e.renderSpaceCharCode,p=e.renderWhitespace,_=e.renderControlCharacters,v=new Nm(r+1,h.length);let b=!1,C=0,w=u,y=0,S=0,L=0;g?t.appendString('<span dir="ltr">'):t.appendString("<span>");for(let e=0,a=h.length;e<a;e++){const a=h[e],l=a.endIndex,u=a.type,g=a.containsRTL,k=0!==p&&a.isWhitespace(),D=k&&!i&&("mtkw"===u||!s),x=C===l&&a.isPseudoAfter();if(y=0,t.appendString("<span "),g&&t.appendString('style="unicode-bidi:isolate" '),t.appendString('class="'),t.appendString(D?"mtkz":u),t.appendASCIICharCode(34),k){let i=0;{let e=C,t=w;for(;e<l;e++){const n=0|(9===o.charCodeAt(e)?c-t%c:1);i+=n,e>=d&&(t+=n)}}for(D&&(t.appendString(' style="width:'),t.appendString(String(m*i)),t.appendString('px"')),t.appendASCIICharCode(62);C<l;C++){v.setColumnInfo(C+1,e-L,y,S),L=0;let i,s;if(9===o.charCodeAt(C)){i=c-w%c|0,s=i,!n||s>1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=s;e++)t.appendCharCode(160)}else i=2,s=1,t.appendCharCode(f),t.appendCharCode(8204);y+=i,S+=s,C>=d&&(w+=s)}}else for(t.appendASCIICharCode(62);C<l;C++){v.setColumnInfo(C+1,e-L,y,S),L=0;const i=o.charCodeAt(C);let n=1,s=1;switch(i){case 9:n=c-w%c,s=n;for(let e=1;e<=n;e++)t.appendCharCode(160);break;case 32:t.appendCharCode(160);break;case 60:t.appendString("&lt;");break;case 62:t.appendString("&gt;");break;case 38:t.appendString("&amp;");break;case 0:_?t.appendCharCode(9216):t.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:t.appendCharCode(65533);break;default:Ss(i)&&s++,_&&i<32?t.appendCharCode(9216+i):_&&127===i?t.appendCharCode(9249):_&&Rm(i)?(t.appendString("[U+"),t.appendString(i.toString(16).toUpperCase().padStart(4,"0")),t.appendString("]"),n=8,s=n):t.appendCharCode(i)}y+=n,S+=s,C>=d&&(w+=s)}x?L++:L=0,C>=r&&!b&&a.isPseudoAfter()&&(b=!0,v.setColumnInfo(C+1,e,y,S)),t.appendString("</span>")}b||v.setColumnInfo(r+1,h.length-1,y,S);a&&(t.appendString('<span class="mtkoverflow">'),t.appendString(J.b("showMore","Show more ({0})",function(e){if(e<1024)return J.b("overflow.chars","{0} chars",e);if(e<1048576)return(e/1024).toFixed(1)+" KB";return(e/1024/1024).toFixed(1)+" MB"}(l))),t.appendString("</span>"));return t.appendString("</span>"),new Im(v,g,s)}(function(e){const t=e.lineContent;let i,n,s;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter<t.length?(i=!0,n=t.length-e.stopRenderingLineAfter,s=e.stopRenderingLineAfter):(i=!1,n=0,s=t.length);let o=function(e,t,i,n,s){const o=[];let r=0;n>0&&(o[r++]=new km(n,"",0,!1));let a=n;for(let l=0,h=i.getCount();l<h;l++){const h=i.getEndOffset(l);if(h<=n)continue;const d=i.getClassName(l);if(h>=s){const i=!!t&&vs(e.substring(a,s));o[r++]=new km(s,d,0,i);break}const c=!!t&&vs(e.substring(a,h));o[r++]=new km(h,d,0,c),a=h}return o}(t,e.containsRTL,e.lineTokens,e.fauxIndentLength,s);e.renderControlCharacters&&!e.isBasicASCII&&(o=function(e,t){const i=[];let n=new km(0,"",0,!1),s=0;for(const o of t){const t=o.endIndex;for(;s<t;s++){Rm(e.charCodeAt(s))&&(s>n.endIndex&&(n=new km(s,o.type,o.metadata,o.containsRTL),i.push(n)),n=new km(s+1,"mtkcontrol",o.metadata,!1),i.push(n))}s>n.endIndex&&(n=new km(t,o.type,o.metadata,o.containsRTL),i.push(n))}return i}(t,o));(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace&&!e.continuesWithWrappedLine)&&(o=function(e,t,i,n){const s=e.continuesWithWrappedLine,o=e.fauxIndentLength,r=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,h=e.selectionsOnLine,d=1===e.renderWhitespace,c=3===e.renderWhitespace,u=e.renderSpaceWidth!==e.spaceWidth,g=[];let m=0,f=0,p=n[f].type,_=n[f].containsRTL,v=n[f].endIndex;const b=n.length;let C,w=!1,y=Zn(t);-1===y?(w=!0,y=i,C=i):C=Qn(t);let S=!1,L=0,k=h&&h[L],D=a%r;for(let e=o;e<i;e++){const s=t.charCodeAt(e);let a;if(k&&e>=k.endOffset&&(L++,k=h&&h[L]),e<y||e>C)a=!0;else if(9===s)a=!0;else if(32===s)if(d)if(S)a=!0;else{const n=e+1<i?t.charCodeAt(e+1):0;a=32===n||9===n}else a=!0;else a=!1;if(a&&h&&(a=!!k&&k.startOffset<=e&&k.endOffset>e),a&&c&&(a=w||e>C),a&&_&&e>=y&&e<=C&&(a=!1),S){if(!a||!l&&D>=r){if(u){for(let t=(m>0?g[m-1].endIndex:o)+1;t<=e;t++)g[m++]=new km(t,"mtkw",1,!1)}else g[m++]=new km(e,"mtkw",1,!1);D%=r}}else(e===v||a&&e>o)&&(g[m++]=new km(e,p,0,_),D%=r);for(9===s?D=r:Ss(s)?D+=2:D++,S=a;e===v&&(f++,f<b);)p=n[f].type,_=n[f].containsRTL,v=n[f].endIndex}let x=!1;if(S)if(s&&d){const e=i>0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(x=!0)}else x=!0;if(x)if(u){for(let e=(m>0?g[m-1].endIndex:o)+1;e<=i;e++)g[m++]=new km(e,"mtkw",1,!1)}else g[m++]=new km(i,"mtkw",1,!1);else g[m++]=new km(i,p,0,_);return g}(e,t,s,o));let r=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;t<i;t++){const i=e.lineDecorations[t];3===i.type||1===i.type?r|=1:2===i.type&&(r|=2)}o=function(e,t,i,n){n.sort(ym.compare);const s=class{static normalize(e,t){if(0===t.length)return[];const i=[],n=new Lm;let s=0;for(let o=0,r=t.length;o<r;o++){const r=t[o];let a=r.startColumn,l=r.endColumn;const h=r.className,d=1===r.type?2:2===r.type?4:0;if(a>1){hs(e.charCodeAt(a-2))&&a--}if(l>1){hs(e.charCodeAt(l-2))&&l--}const c=a-1,u=l-2;s=n.consumeLowerThan(c,s,i),0===n.count&&(s=c),n.insert(u,h,d)}return n.consumeLowerThan(1073741824,s,i),i}}.normalize(e,n),o=s.length;let r=0;const a=[];let l=0,h=0;for(let e=0,t=i.length;e<t;e++){const t=i[e],n=t.endIndex,d=t.type,c=t.metadata,u=t.containsRTL;for(;r<o&&s[r].startOffset<n;){const e=s[r];if(e.startOffset>h&&(h=e.startOffset,a[l++]=new km(h,d,c,u)),!(e.endOffset+1<=n)){h=n,a[l++]=new km(h,d+" "+e.className,c|e.metadata,u);break}h=e.endOffset+1,a[l++]=new km(h,d+" "+e.className,c|e.metadata,u),r++}n>h&&(h=n,a[l++]=new km(h,d,c,u))}const d=i[i.length-1].endIndex;if(r<o&&s[r].startOffset===d)for(;r<o&&s[r].startOffset===d;){const e=s[r];a[l++]=new km(h,e.className,e.metadata,!1),r++}return a}(t,0,o,e.lineDecorations)}e.containsRTL||(o=function(e,t,i){let n=0;const s=[];let o=0;if(i)for(let i=0,r=t.length;i<r;i++){const r=t[i],a=r.endIndex;if(n+50<a){const t=r.type,i=r.metadata,l=r.containsRTL;let h=-1,d=n;for(let r=n;r<a;r++)32===e.charCodeAt(r)&&(h=r),-1!==h&&r-d>=50&&(s[o++]=new km(h+1,t,i,l),d=h+1,h=-1);d!==a&&(s[o++]=new km(a,t,i,l))}else s[o++]=r;n=a}else for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i.endIndex,a=r-n;if(a>50){const e=i.type,t=i.metadata,l=i.containsRTL,h=Math.ceil(a/50);for(let i=1;i<h;i++){const r=n+50*i;s[o++]=new km(r,e,t,l)}s[o++]=new km(r,e,t,l)}else s[o++]=i;n=r}return s}(t,o,!e.isBasicASCII||e.fontLigatures));return new Om(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,t,s,i,n,o,r,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.containsRTL,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}(e),t)}class Mm{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function Am(e){const t=new Bd(1e4),i=Tm(e,t);return new Mm(i.characterMapping,t.build(),i.containsRTL,i.containsForeignElements)}class Om{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u,g,m,f){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=s,this.overflowingCharCount=o,this.parts=r,this.containsForeignElements=a,this.fauxIndentLength=l,this.tabSize=h,this.startVisibleColumn=d,this.containsRTL=c,this.spaceWidth=u,this.renderSpaceCharCode=g,this.renderWhitespace=m,this.renderControlCharacters=f}}function Rm(e){return e<32?9!==e:127===e||(e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e)}class Pm{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class Fm{constructor(e,t){this.tabSize=e,this.data=t}}class Bm{constructor(e,t,i,n,s,o,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=s,this.tokens=o,this.inlineDecorations=r}}class Wm{constructor(e,t,i,n,s,o,r,a,l,h){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=Wm.isBasicASCII(i,o),this.containsRTL=Wm.containsRTL(i,this.isBasicASCII,s),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=h}static isBasicASCII(e,t){return!t||Cs(e)}static containsRTL(e,t,i){return!(t||!i)&&vs(e)}}class Vm{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class Hm{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new Vm(new wi(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class zm{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class Km{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&s(e.data,t.data)}static equalsArr(e,t){return s(e,t,Km.equals)}}function Um(e){return!function(e){return Array.isArray(e)}(e)}function jm(e){return"string"==typeof e}function qm(e){return!jm(e)}function $m(e){return!e}function Gm(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function Zm(e){return e.replace(/[&<>'"_]/g,"-")}function Ym(e,t){return new Error(`${e.languageId}: ${t}`)}function Qm(e,t,i,n,s){let o=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,r,a,l,h,d,c,u,g){return $m(a)?$m(l)?!$m(h)&&h<n.length?Gm(e,n[h]):!$m(c)&&e&&"string"==typeof e[c]?e[c]:(null===o&&(o=s.split("."),o.unshift(s)),!$m(d)&&d<o.length?Gm(e,o[d]):""):Gm(e,i):"$"}))}function Xm(e,t){let i=t;for(;i&&i.length>0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}var Jm,ef=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},tf=function(e,t){return function(i,n){t(i,n,e)}};class nf{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new sf(e,t);let i=sf.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new sf(e,t),this._entries[i]=n,n)}}nf._INSTANCE=new nf(5);class sf{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return sf._equals(this,e)}push(e){return nf.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return nf.create(this.parent,e)}}class of{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new of(this.languageId,this.state)}}class rf{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==t)return new af(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new af(e,t);const i=sf.getStackElementId(e);let n=this._entries[i];return n||(n=new af(e,null),this._entries[i]=n,n)}}rf._INSTANCE=new rf(5);class af{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:rf.create(this.stack,this.embeddedLanguageData)}equals(e){return e instanceof af&&(!!this.stack.equals(e.stack)&&(null===this.embeddedLanguageData&&null===e.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==e.embeddedLanguageData&&this.embeddedLanguageData.equals(e.embeddedLanguageData)))}}class lf{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new Ei(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const s=i.languageId,o=i.state,r=zi.get(s);if(!r)return this.enterLanguage(s),this.emit(n,""),o;const a=r.tokenize(e,t,o);if(0!==n)for(const e of a.tokens)this._tokens.push(new Ei(e.offset+n,e.type,e.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new Ni(this._tokens,e)}}class hf{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=1024|this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=null!==e?e.length:0,s=t.length,o=null!==i?i.length:0;if(0===n&&0===s&&0===o)return new Uint32Array(0);if(0===n&&0===s)return i;if(0===s&&0===o)return e;const r=new Uint32Array(n+s+o);null!==e&&r.set(e);for(let e=0;e<s;e++)r[n+e]=t[e];return null!==i&&r.set(i,n+s),r}nestedLanguageTokenize(e,t,i,n){const s=i.languageId,o=i.state,r=zi.get(s);if(!r)return this.enterLanguage(s),this.emit(n,""),o;const a=r.tokenizeEncoded(e,t,o);if(0!==n)for(let e=0,t=a.tokens.length;e<t;e+=2)a.tokens[e]+=n;return this._prependTokens=hf._merge(this._prependTokens,this._tokens,a.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,a.endState}finalize(e){return new Ii(hf._merge(this._prependTokens,this._tokens,null),e)}}let df=Jm=class extends st{constructor(e,t,i,n,s){super(),this._configurationService=s,this._languageService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=n,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let o=!1;this._register(zi.onDidChange(e=>{if(o)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i<n;i++){const n=e.changedLanguages[i];if(this._embeddedLanguages[n]){t=!0;break}}t&&(o=!0,zi.handleChange([this._languageId]),o=!1)})),this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}),this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=zi.get(t);if(i){if(i instanceof Jm){const t=i.getLoadStatus();!1===t.loaded&&e.push(t.promise)}}else zi.isResolved(t)||e.push(zi.getOrCreate(t))}return 0===e.length?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(e=>{})}}getInitialState(){const e=nf.create(null,this._lexer.start);return rf.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return _m(this._languageId,i);const n=new lf,s=this._tokenize(e,t,i,n);return n.finalize(s)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return vm(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new hf(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(e,t,i,n);return n.finalize(s)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=Xm(this._lexer,t.stack.state),!i))throw Ym(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,s=!1;for(const t of i){if(!qm(t.action)||"@pop"!==t.action.nextEmbedded)continue;s=!0;let i=t.regex;const o=t.regex.source;if("^(?:"===o.substr(0,4)&&")"===o.substr(o.length-1,1)){const e=(i.ignoreCase?"i":"")+(i.unicode?"u":"");i=new RegExp(o.substr(4,o.length-5),e)}const r=e.search(i);-1===r||0!==r&&t.matchOnlyAtLineStart||(-1===n||r<n)&&(n=r)}if(!s)throw Ym(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return n}_nestedTokenize(e,t,i,n,s){const o=this._findLeavingNestedLanguageOffset(e,i);if(-1===o){const o=s.nestedLanguageTokenize(e,t,i.embeddedLanguageData,n);return rf.create(i.stack,new of(i.embeddedLanguageData.languageId,o))}const r=e.substring(0,o);r.length>0&&s.nestedLanguageTokenize(r,!1,i.embeddedLanguageData,n);const a=e.substring(o);return this._myTokenize(a,t,i,n+o,s)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,s){s.enterLanguage(this._languageId);const o=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedLanguageData,h=i.stack,d=0,c=null,u=!0;for(;u||d<a;){const i=d,f=h.depth,p=c?c.groups.length:0,_=h.state;let v=null,b=null,C=null,w=null,y=null;if(c){v=c.matches;const e=c.groups.shift();b=e.matched,C=e.action,w=c.rule,0===c.groups.length&&(c=null)}else{if(!u&&d>=a)break;u=!1;let e=this._lexer.tokenizer[_];if(!e&&(e=Xm(this._lexer,_),!e))throw Ym(this._lexer,"tokenizer state is not defined: "+_);const t=r.substr(d);for(const i of e)if((0===d||!i.matchOnlyAtLineStart)&&(v=t.match(i.regex),v)){b=v[0],C=i.action;break}}if(v||(v=[""],b=""),C||(d<a&&(v=[r.charAt(d)],b=v[0]),C=this._lexer.defaultToken),null===b)break;for(d+=b.length;Um(C)&&qm(C)&&C.test;)C=C.test(b,v,_,d===a);let S=null;if("string"==typeof C||Array.isArray(C))S=C;else if(C.group)S=C.group;else if(null!==C.token&&void 0!==C.token){if(S=C.tokenSubst?Qm(this._lexer,C.token,b,v,_):C.token,C.nextEmbedded)if("@pop"===C.nextEmbedded){if(!l)throw Ym(this._lexer,"cannot pop embedded language if not inside one");l=null}else{if(l)throw Ym(this._lexer,"cannot enter embedded language from within an embedded language");y=Qm(this._lexer,C.nextEmbedded,b,v,_)}if(C.goBack&&(d=Math.max(0,d-C.goBack)),C.switchTo&&"string"==typeof C.switchTo){let e=Qm(this._lexer,C.switchTo,b,v,_);if("@"===e[0]&&(e=e.substr(1)),!Xm(this._lexer,e))throw Ym(this._lexer,"trying to switch to a state '"+e+"' that is undefined in rule: "+this._safeRuleName(w));h=h.switchTo(e)}else{if(C.transform&&"function"==typeof C.transform)throw Ym(this._lexer,"action.transform not supported");if(C.next)if("@push"===C.next){if(h.depth>=this._lexer.maxStack)throw Ym(this._lexer,"maximum tokenizer stack size reached: ["+h.state+","+h.parent.state+",...]");h=h.push(_)}else if("@pop"===C.next){if(h.depth<=1)throw Ym(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(w));h=h.pop()}else if("@popall"===C.next)h=h.popall();else{let e=Qm(this._lexer,C.next,b,v,_);if("@"===e[0]&&(e=e.substr(1)),!Xm(this._lexer,e))throw Ym(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(w));h=h.push(e)}}C.log&&"string"==typeof C.log&&(g=this._lexer,m=this._lexer.languageId+": "+Qm(this._lexer,C.log,b,v,_),console.log(`${g.languageId}: ${m}`))}if(null===S)throw Ym(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(w));const L=i=>{const o=this._languageService.getLanguageIdByLanguageName(i)||this._languageService.getLanguageIdByMimeType(i)||i,r=this._getNestedEmbeddedLanguageData(o);if(d<a){const i=e.substr(d);return this._nestedTokenize(i,t,rf.create(h,r),n+d,s)}return rf.create(h,r)};if(Array.isArray(S)){if(c&&c.groups.length>0)throw Ym(this._lexer,"groups cannot be nested: "+this._safeRuleName(w));if(v.length!==S.length+1)throw Ym(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(w));let e=0;for(let t=1;t<v.length;t++)e+=v[t].length;if(e!==b.length)throw Ym(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(w));c={rule:w,matches:v,groups:[]};for(let e=0;e<S.length;e++)c.groups[e]={action:S[e],matched:v[e+1]};d-=b.length}else{{if("@rematch"===S&&(d-=b.length,b="",v=null,S="",null!==y))return L(y);if(0===b.length){if(0===a||f!==h.depth||_!==h.state||(c?c.groups.length:0)!==p)continue;throw Ym(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(w))}let e=null;if(jm(S)&&0===S.indexOf("@brackets")){const t=S.substr("@brackets".length),i=cf(this._lexer,b);if(!i)throw Ym(this._lexer,"@brackets token returned but no bracket defined as: "+b);e=Zm(i.token+t)}else{e=Zm(""===S?"":S+this._lexer.tokenPostfix)}i<o&&s.emit(i+n,e)}if(null!==y)return L(y)}}var g,m;return rf.create(h,l)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new of(e,pm);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),zi.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=zi.get(e);return new of(e,t?t.getInitialState():pm)}};function cf(e,t){if(!t)return null;t=Gm(e,t);const i=e.brackets;for(const e of i){if(e.open===t)return{token:e.token,bracketType:1};if(e.close===t)return{token:e.token,bracketType:-1}}return null}df=Jm=ef([tf(4,Xd)],df);const uf=bd("standaloneColorizer",{createHTML:e=>e});class gf{static colorizeElement(e,t,i,n){const s=(n=n||{}).theme||"vs",o=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!o)return console.error("Mode not detected"),Promise.resolve();const r=t.getLanguageIdByMimeType(o)||o;e.setTheme(s);const a=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+s;return this.colorize(t,a||"",r,n).then(e=>{var t;const n=null!==(t=null==uf?void 0:uf.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n},e=>console.error(e))}static async colorize(e,t,i,n){const s=e.languageIdCodec;let o=4;n&&"number"==typeof n.tabSize&&(o=n.tabSize),Ds(t)&&(t=t.substr(1));const r=Gn(t);if(!e.isRegisteredLanguageId(i))return mf(r,o,s);const a=await zi.getOrCreate(i);return a?function(e,t,i,n){return new Promise((s,o)=>{const r=()=>{const a=function(e,t,i,n){let s=[],o=i.getInitialState();for(let r=0,a=e.length;r<a;r++){const a=e[r],l=i.tokenizeEncoded(a,!0,o);Cm.convertToEndOffset(l.tokens,a.length);const h=new Cm(l.tokens,a,n),d=Wm.isBasicASCII(a,!0),c=Wm.containsRTL(a,d,!0),u=Am(new xm(!1,!0,a,!1,d,c,0,h.inflate(),[],t,0,0,0,0,-1,"none",!1,!1,null));s=s.concat(u.html),s.push("<br/>"),o=l.endState}return s.join("")}(e,t,i,n);if(i instanceof df){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(r,o)}s(a)};r()})}(r,o,a,s):mf(r,o,s)}static colorizeLine(e,t,i,n,s=4){const o=Wm.isBasicASCII(e,t),r=Wm.containsRTL(e,o,i);return Am(new xm(!1,!0,e,!1,o,r,0,n,[],s,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,i)}}function mf(e,t,i){let n=[];const s=new Uint32Array(2);s[0]=0,s[1]=33587200;for(let o=0,r=e.length;o<r;o++){const r=e[o];s[0]=r.length;const a=new Cm(s,r,i),l=Wm.isBasicASCII(r,!0),h=Wm.containsRTL(r,l,!0),d=Am(new xm(!1,!0,r,!1,l,h,0,a,[],t,0,0,0,0,-1,"none",!1,!1,null));n=n.concat(d.html),n.push("<br/>")}return n.join("")}i("JnxH");let ff,pf,_f,vf,bf;function Cf(e){ff&&(pf.textContent!==e?($r(_f),yf(pf,e)):($r(pf),yf(_f,e)))}function wf(e){ff&&(vf.textContent!==e?($r(bf),yf(vf,e)):($r(vf),yf(bf,e)))}function yf(e,t){$r(e),t.length>2e4&&(t=t.substr(0,2e4)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}const Sf=wl("markerDecorationsService");var Lf=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},kf=function(e,t){return function(i,n){t(i,n,e)}};let Df=class{constructor(e,t){}dispose(){}};Df.ID="editor.contrib.markerDecorations",Df=Lf([kf(1,Sf)],Df),ed(Df.ID,Df,0);i("3FlK");class xf extends st{constructor(e,t){super(),this._onDidChange=this._register(new ft),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,n=!1;const s=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{ea(Fr(this._referenceDomElement),()=>{n=!1,s()})}};this._resizeObserver=new ResizeObserver(t=>{e=t&&t[0]&&t[0].contentRect?{width:t[0].contentRect.width,height:t[0].contentRect.height}:null,i=!0,s()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),this._width===i&&this._height===n||(this._width=i,this._height=n,e&&this._onDidChange.fire())}}class Ef{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=Ef._read(e,this.key);this.migrate(t,t=>Ef._read(e,t),(t,i)=>Ef._write(e,t,i))}static _read(e,t){if(void 0===e)return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const s=t.substring(0,n);return e[s]=e[s]||{},void this._write(e[s],t.substring(n+1),i)}e[t]=i}}function Nf(e,t){Ef.items.push(new Ef(e,t))}function If(e,t){Nf(e,(i,n,s)=>{if(void 0!==i)for(const[n,o]of t)if(i===n)return void s(e,o)})}Ef.items=[],If("wordWrap",[[!0,"on"],[!1,"off"]]),If("lineNumbers",[[!0,"on"],[!1,"off"]]),If("cursorBlinking",[["visible","solid"]]),If("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),If("renderLineHighlight",[[!0,"line"],[!1,"none"]]),If("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),If("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),If("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),If("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),If("autoIndent",[[!1,"advanced"],[!0,"full"]]),If("matchBrackets",[[!0,"always"],[!1,"never"]]),If("renderFinalNewline",[[!0,"on"],[!1,"off"]]),If("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]),If("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]),If("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]),Nf("autoClosingBrackets",(e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),void 0===t("autoClosingQuotes")&&i("autoClosingQuotes","never"),void 0===t("autoSurround")&&i("autoSurround","never"))}),Nf("renderIndentGuides",(e,t,i)=>{void 0!==e&&(i("renderIndentGuides",void 0),void 0===t("guides.indentation")&&i("guides.indentation",!!e))}),Nf("highlightActiveIndentGuide",(e,t,i)=>{void 0!==e&&(i("highlightActiveIndentGuide",void 0),void 0===t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))});const Tf={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};Nf("suggest.filteredTypes",(e,t,i)=>{if(e&&"object"==typeof e){for(const n of Object.entries(Tf)){!1===e[n[0]]&&void 0===t("suggest."+n[1])&&i("suggest."+n[1],!1)}i("suggest.filteredTypes",void 0)}}),Nf("quickSuggestions",(e,t,i)=>{if("boolean"==typeof e){const t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}}),Nf("experimental.stickyScroll.enabled",(e,t,i)=>{"boolean"==typeof e&&(i("experimental.stickyScroll.enabled",void 0),void 0===t("stickyScroll.enabled")&&i("stickyScroll.enabled",e))}),Nf("experimental.stickyScroll.maxLineCount",(e,t,i)=>{"number"==typeof e&&(i("experimental.stickyScroll.maxLineCount",void 0),void 0===t("stickyScroll.maxLineCount")&&i("stickyScroll.maxLineCount",e))}),Nf("codeActionsOnSave",(e,t,i)=>{if(e&&"object"==typeof e){let t=!1;const n={};for(const i of Object.entries(e))"boolean"==typeof i[1]?(t=!0,n[i[0]]=i[1]?"explicit":"never"):n[i[0]]=i[1];t&&i("codeActionsOnSave",n)}}),Nf("codeActionWidget.includeNearbyQuickfixes",(e,t,i)=>{"boolean"==typeof e&&(i("codeActionWidget.includeNearbyQuickfixes",void 0),void 0===t("codeActionWidget.includeNearbyQuickFixes")&&i("codeActionWidget.includeNearbyQuickFixes",e))}),Nf("lightbulb.enabled",(e,t,i)=>{"boolean"==typeof e&&i("lightbulb.enabled",e?void 0:"off")});const Mf=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new ft,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}},Af=wl("accessibilityService"),Of=new _h("accessibilityModeEnabled",!1);var Rf=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Pf=function(e,t){return function(i,n){t(i,n,e)}};let Ff=class extends st{constructor(e,t,i,n){super(),this._accessibilityService=n,this._onDidChange=this._register(new ft),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new ft),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new te,this.isSimpleWidget=e,this._containerObserver=this._register(new xf(i,t.dimension)),this._targetWindowId=Fr(i).vscodeWindowId,this._rawOptions=zf(t),this._validatedOptions=Hf.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(ul.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Mf.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(_l.onDidChange(()=>this._recomputeOptions())),this._register(ol.getInstance(Fr(i)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Hf.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=ml.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Mf.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Hf.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:Bf(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:Bs||Fs,pixelRatio:ol.getInstance(zr(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return _l.readFontInfo(zr(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=zf(e);Hf.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Hf.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};function Bf(){let e="";return Vs||Hs||(e+="no-user-select "),Vs&&(e+="no-minimap-shadow ",e+="enable-user-select "),K.i&&(e+="mac "),e}Ff=Rf([Pf(3,Af)],Ff);class Wf{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Vf{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class Hf{static validateOptions(e){const t=new Wf;for(const i of Oe){const n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new Vf;for(const n of Oe)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&s(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!Hf._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const s of Oe){const o=!Hf._deepEquals(e._read(s.id),t._read(s.id));i[s.id]=o,o&&(n=!0)}return n?new ee(i):null}static applyUpdate(e,t){let i=!1;for(const n of Oe)if(t.hasOwnProperty(n.name)){const s=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=s.newValue,i=i||s.didChange}return i}}function zf(e){const t=B(e);return function(e){Ef.items.forEach(t=>t.apply(e))}(t),t}var Kf;!function(e){const t={total:0,min:Number.MAX_VALUE,max:0},i={...t},n={...t},s={...t};let o=0;const r={keydown:0,input:0,render:0};function a(){1===r.keydown&&(performance.mark("keydown/end"),r.keydown=2)}function l(){performance.mark("input/start"),r.input=1,c()}function h(){1===r.input&&(performance.mark("input/end"),r.input=2)}function d(){1===r.render&&(performance.mark("render/end"),r.render=2)}function c(){setTimeout(u)}function u(){2===r.keydown&&2===r.input&&2===r.render&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),g("keydown",t),g("input",i),g("render",n),g("inputlatency",s),o++,performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0)}function g(e,t){const i=performance.getEntriesByName(e)[0].duration;t.total+=i,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}function m(e){return{average:e.total/o,max:e.max,min:e.min}}function f(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}e.onKeyDown=function(){u(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(a)},e.onBeforeInput=l,e.onInput=function(){0===r.input&&l(),queueMicrotask(h)},e.onKeyUp=function(){u()},e.onSelectionChange=function(){u()},e.onRenderStart=function(){2===r.keydown&&2===r.input&&0===r.render&&(performance.mark("render/start"),r.render=1,queueMicrotask(d),c())},e.getAndClearMeasurements=function(){if(0===o)return;const e={keydown:m(t),input:m(i),render:m(n),total:m(s),sampleCount:o};return f(t),f(i),f(n),f(s),o=0,e}}(Kf||(Kf={}));class Uf{constructor(){this._hooks=new nt,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=s;let o=e;try{e.setPointerCapture(t),this._hooks.add(it(()=>{try{e.releasePointerCapture(t)}catch(e){}}))}catch(t){o=Fr(e)}this._hooks.add(Zr(o,Ma.POINTER_MOVE,e=>{e.buttons===i?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)})),this._hooks.add(Zr(o,Ma.POINTER_UP,e=>this.stopMonitoring(!0)))}}function jf(e){return"--vscode-"+e.replace(/\./g,"-")}function qf(e){return`var(${jf(e)})`}const $f="base.contributions.colors";const Gf=new class{constructor(){this._onDidChangeSchema=new ft,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,s){const o={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:s};this.colorsById[e]=o;const r={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return s&&(r.deprecationMessage=s),n&&(r.pattern="^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",r.patternErrorMessage="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=r,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){return Fv(i.defaults[t.type],t)}}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort((e,t)=>{const i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)}).map(e=>`- \`${e}\`: ${this.colorsById[e].description}`).join("\n")}};function Zf(e,t,i,n,s){return Gf.registerColor(e,t,i,n,s)}Eh.add($f,Gf);const Yf=Zf("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},J.b("foreground","Overall foreground color. This color is only used if not overridden by a component.")),Qf=(Zf("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},J.b("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component.")),Zf("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},J.b("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),Zf("descriptionForeground",{light:"#717171",dark:Ov(Yf,.7),hcDark:Ov(Yf,.7),hcLight:Ov(Yf,.7)},J.b("descriptionForeground","Foreground color for description text providing additional information, for example for a label.")),Zf("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},J.b("iconForeground","The default color for icons in the workbench."))),Xf=Zf("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},J.b("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Jf=Zf("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},J.b("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),ep=Zf("contrastActiveBorder",{light:null,dark:null,hcDark:Xf,hcLight:Xf},J.b("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),tp=(Zf("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},J.b("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")),Zf("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:Ug.black,hcLight:"#292929"},J.b("textSeparatorForeground","Color for text separators.")),Zf("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},J.b("textLinkForeground","Foreground color for links in text."))),ip=(Zf("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},J.b("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover.")),Zf("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},J.b("textPreformatForeground","Foreground color for preformatted text segments.")),Zf("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},J.b("textPreformatBackground","Background color for preformatted text segments.")),Zf("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},J.b("textBlockQuoteBackground","Background color for block quotes in text.")),Zf("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:Ug.white,hcLight:"#292929"},J.b("textBlockQuoteBorder","Border color for block quotes in text.")),Zf("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:Ug.black,hcLight:"#F2F2F2"},J.b("textCodeBlockBackground","Background color for code blocks in text.")),Zf("widget.shadow",{dark:Ov(Ug.black,.36),light:Ov(Ug.black,.16),hcDark:null,hcLight:null},J.b("widgetShadow","Shadow color of widgets such as find/replace inside the editor."))),np=Zf("widget.border",{dark:null,light:null,hcDark:Jf,hcLight:Jf},J.b("widgetBorder","Border color of widgets such as find/replace inside the editor.")),sp=Zf("input.background",{dark:"#3C3C3C",light:Ug.white,hcDark:Ug.black,hcLight:Ug.white},J.b("inputBoxBackground","Input box background.")),op=Zf("input.foreground",{dark:Yf,light:Yf,hcDark:Yf,hcLight:Yf},J.b("inputBoxForeground","Input box foreground.")),rp=Zf("input.border",{dark:null,light:null,hcDark:Jf,hcLight:Jf},J.b("inputBoxBorder","Input box border.")),ap=Zf("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Jf,hcLight:Jf},J.b("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),lp=(Zf("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},J.b("inputOption.hoverBackground","Background color of activated options in input fields.")),Zf("inputOption.activeBackground",{dark:Ov(Xf,.4),light:Ov(Xf,.2),hcDark:Ug.transparent,hcLight:Ug.transparent},J.b("inputOption.activeBackground","Background hover color of options in input fields."))),hp=Zf("inputOption.activeForeground",{dark:Ug.white,light:Ug.black,hcDark:Yf,hcLight:Yf},J.b("inputOption.activeForeground","Foreground color of activated options in input fields.")),dp=(Zf("input.placeholderForeground",{light:Ov(Yf,.5),dark:Ov(Yf,.5),hcDark:Ov(Yf,.7),hcLight:Ov(Yf,.7)},J.b("inputPlaceholderForeground","Input box foreground color for placeholder text.")),Zf("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:Ug.black,hcLight:Ug.white},J.b("inputValidationInfoBackground","Input validation background color for information severity."))),cp=Zf("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Yf},J.b("inputValidationInfoForeground","Input validation foreground color for information severity.")),up=Zf("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Jf,hcLight:Jf},J.b("inputValidationInfoBorder","Input validation border color for information severity.")),gp=Zf("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:Ug.black,hcLight:Ug.white},J.b("inputValidationWarningBackground","Input validation background color for warning severity.")),mp=Zf("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Yf},J.b("inputValidationWarningForeground","Input validation foreground color for warning severity.")),fp=Zf("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Jf,hcLight:Jf},J.b("inputValidationWarningBorder","Input validation border color for warning severity.")),pp=Zf("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:Ug.black,hcLight:Ug.white},J.b("inputValidationErrorBackground","Input validation background color for error severity.")),_p=Zf("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Yf},J.b("inputValidationErrorForeground","Input validation foreground color for error severity.")),vp=Zf("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Jf,hcLight:Jf},J.b("inputValidationErrorBorder","Input validation border color for error severity.")),bp=Zf("dropdown.background",{dark:"#3C3C3C",light:Ug.white,hcDark:Ug.black,hcLight:Ug.white},J.b("dropdownBackground","Dropdown background.")),Cp=Zf("dropdown.listBackground",{dark:null,light:null,hcDark:Ug.black,hcLight:Ug.white},J.b("dropdownListBackground","Dropdown list background.")),wp=Zf("dropdown.foreground",{dark:"#F0F0F0",light:Yf,hcDark:Ug.white,hcLight:Yf},J.b("dropdownForeground","Dropdown foreground.")),yp=Zf("dropdown.border",{dark:bp,light:"#CECECE",hcDark:Jf,hcLight:Jf},J.b("dropdownBorder","Dropdown border.")),Sp=Zf("button.foreground",{dark:Ug.white,light:Ug.white,hcDark:Ug.white,hcLight:Ug.white},J.b("buttonForeground","Button foreground color.")),Lp=Zf("button.separator",{dark:Ov(Sp,.4),light:Ov(Sp,.4),hcDark:Ov(Sp,.4),hcLight:Ov(Sp,.4)},J.b("buttonSeparator","Button separator color.")),kp=Zf("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},J.b("buttonBackground","Button background color.")),Dp=Zf("button.hoverBackground",{dark:Av(kp,.2),light:Mv(kp,.2),hcDark:kp,hcLight:kp},J.b("buttonHoverBackground","Button background color when hovering.")),xp=Zf("button.border",{dark:Jf,light:Jf,hcDark:Jf,hcLight:Jf},J.b("buttonBorder","Button border color.")),Ep=Zf("button.secondaryForeground",{dark:Ug.white,light:Ug.white,hcDark:Ug.white,hcLight:Yf},J.b("buttonSecondaryForeground","Secondary button foreground color.")),Np=Zf("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:Ug.white},J.b("buttonSecondaryBackground","Secondary button background color.")),Ip=Zf("button.secondaryHoverBackground",{dark:Av(Np,.2),light:Mv(Np,.2),hcDark:null,hcLight:null},J.b("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),Tp=Zf("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:Ug.black,hcLight:"#0F4A85"},J.b("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Mp=Zf("badge.foreground",{dark:Ug.white,light:"#333",hcDark:Ug.white,hcLight:Ug.white},J.b("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Ap=Zf("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},J.b("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),Op=Zf("scrollbarSlider.background",{dark:Ug.fromHex("#797979").transparent(.4),light:Ug.fromHex("#646464").transparent(.4),hcDark:Ov(Jf,.6),hcLight:Ov(Jf,.4)},J.b("scrollbarSliderBackground","Scrollbar slider background color.")),Rp=Zf("scrollbarSlider.hoverBackground",{dark:Ug.fromHex("#646464").transparent(.7),light:Ug.fromHex("#646464").transparent(.7),hcDark:Ov(Jf,.8),hcLight:Ov(Jf,.8)},J.b("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),Pp=Zf("scrollbarSlider.activeBackground",{dark:Ug.fromHex("#BFBFBF").transparent(.4),light:Ug.fromHex("#000000").transparent(.6),hcDark:Jf,hcLight:Jf},J.b("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),Fp=Zf("progressBar.background",{dark:Ug.fromHex("#0E70C0"),light:Ug.fromHex("#0E70C0"),hcDark:Jf,hcLight:Jf},J.b("progressBarBackground","Background color of the progress bar that can show for long running operations.")),Bp=(Zf("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},J.b("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},J.b("editorError.foreground","Foreground color of error squigglies in the editor."))),Wp=(Zf("editorError.border",{dark:null,light:null,hcDark:Ug.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},J.b("errorBorder","If set, color of double underlines for errors in the editor.")),Zf("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},J.b("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0)),Vp=Zf("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},J.b("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Hp=Zf("editorWarning.border",{dark:null,light:null,hcDark:Ug.fromHex("#FFCC00").transparent(.8),hcLight:Ug.fromHex("#FFCC00").transparent(.8)},J.b("warningBorder","If set, color of double underlines for warnings in the editor.")),zp=(Zf("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},J.b("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},J.b("editorInfo.foreground","Foreground color of info squigglies in the editor."))),Kp=Zf("editorInfo.border",{dark:null,light:null,hcDark:Ug.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},J.b("infoBorder","If set, color of double underlines for infos in the editor.")),Up=Zf("editorHint.foreground",{dark:Ug.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},J.b("editorHint.foreground","Foreground color of hint squigglies in the editor.")),jp=(Zf("editorHint.border",{dark:null,light:null,hcDark:Ug.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},J.b("hintBorder","If set, color of double underlines for hints in the editor.")),Zf("sash.hoverBorder",{dark:Xf,light:Xf,hcDark:Xf,hcLight:Xf},J.b("sashActiveBorder","Border color of active sashes.")),Zf("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:Ug.black,hcLight:Ug.white},J.b("editorBackground","Editor background color."))),qp=Zf("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:Ug.white,hcLight:Yf},J.b("editorForeground","Editor default foreground color.")),$p=(Zf("editorStickyScroll.background",{light:jp,dark:jp,hcDark:jp,hcLight:jp},J.b("editorStickyScrollBackground","Background color of sticky scroll in the editor")),Zf("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:Ug.fromHex("#0F4A85").transparent(.1)},J.b("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor")),Zf("editorStickyScroll.border",{dark:null,light:null,hcDark:Jf,hcLight:Jf},J.b("editorStickyScrollBorder","Border color of sticky scroll in the editor")),Zf("editorStickyScroll.shadow",{dark:Ap,light:Ap,hcDark:Ap,hcLight:Ap},J.b("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor")),Zf("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:Ug.white},J.b("editorWidgetBackground","Background color of editor widgets, such as find/replace."))),Gp=Zf("editorWidget.foreground",{dark:Yf,light:Yf,hcDark:Yf,hcLight:Yf},J.b("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Zp=Zf("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Jf,hcLight:Jf},J.b("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),Yp=(Zf("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},J.b("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),Zf("quickInput.background",{dark:$p,light:$p,hcDark:$p,hcLight:$p},J.b("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette."))),Qp=Zf("quickInput.foreground",{dark:Gp,light:Gp,hcDark:Gp,hcLight:Gp},J.b("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Xp=Zf("quickInputTitle.background",{dark:new Ug(new Hg(255,255,255,.105)),light:new Ug(new Hg(0,0,0,.06)),hcDark:"#000000",hcLight:Ug.white},J.b("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),Jp=Zf("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:Ug.white,hcLight:"#0F4A85"},J.b("pickerGroupForeground","Quick picker color for grouping labels.")),e_=Zf("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:Ug.white,hcLight:"#0F4A85"},J.b("pickerGroupBorder","Quick picker color for grouping borders.")),t_=Zf("keybindingLabel.background",{dark:new Ug(new Hg(128,128,128,.17)),light:new Ug(new Hg(221,221,221,.4)),hcDark:Ug.transparent,hcLight:Ug.transparent},J.b("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),i_=Zf("keybindingLabel.foreground",{dark:Ug.fromHex("#CCCCCC"),light:Ug.fromHex("#555555"),hcDark:Ug.white,hcLight:Yf},J.b("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),n_=Zf("keybindingLabel.border",{dark:new Ug(new Hg(51,51,51,.6)),light:new Ug(new Hg(204,204,204,.4)),hcDark:new Ug(new Hg(111,195,223)),hcLight:Jf},J.b("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),s_=Zf("keybindingLabel.bottomBorder",{dark:new Ug(new Hg(68,68,68,.6)),light:new Ug(new Hg(187,187,187,.4)),hcDark:new Ug(new Hg(111,195,223)),hcLight:Yf},J.b("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),o_=Zf("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},J.b("editorSelectionBackground","Color of the editor selection.")),r_=Zf("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:Ug.white},J.b("editorSelectionForeground","Color of the selected text for high contrast.")),a_=Zf("editor.inactiveSelectionBackground",{light:Ov(o_,.5),dark:Ov(o_,.5),hcDark:Ov(o_,.7),hcLight:Ov(o_,.5)},J.b("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),l_=Zf("editor.selectionHighlightBackground",{light:Pv(o_,jp,.3,.6),dark:Pv(o_,jp,.3,.6),hcDark:null,hcLight:null},J.b("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),h_=(Zf("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:ep,hcLight:ep},J.b("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),Zf("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},J.b("editorFindMatch","Color of the current search match.")),Zf("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},J.b("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0)),d_=(Zf("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},J.b("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("editor.findMatchBorder",{light:null,dark:null,hcDark:ep,hcLight:ep},J.b("editorFindMatchBorder","Border color of the current search match.")),Zf("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:ep,hcLight:ep},J.b("findMatchHighlightBorder","Border color of the other search matches."))),c_=(Zf("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Ov(ep,.4),hcLight:Ov(ep,.4)},J.b("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("searchEditor.findMatchBackground",{light:Ov(h_,.66),dark:Ov(h_,.66),hcDark:h_,hcLight:h_},J.b("searchEditor.queryMatch","Color of the Search Editor query matches.")),Zf("searchEditor.findMatchBorder",{light:Ov(d_,.66),dark:Ov(d_,.66),hcDark:d_,hcLight:d_},J.b("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches.")),Zf("search.resultsInfoForeground",{light:Yf,dark:Ov(Yf,.65),hcDark:Yf,hcLight:Yf},J.b("search.resultsInfoForeground","Color of the text in the search viewlet's completion message.")),Zf("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},J.b("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("editorHoverWidget.background",{light:$p,dark:$p,hcDark:$p,hcLight:$p},J.b("hoverBackground","Background color of the editor hover."))),u_=(Zf("editorHoverWidget.foreground",{light:Gp,dark:Gp,hcDark:Gp,hcLight:Gp},J.b("hoverForeground","Foreground color of the editor hover.")),Zf("editorHoverWidget.border",{light:Zp,dark:Zp,hcDark:Zp,hcLight:Zp},J.b("hoverBorder","Border color of the editor hover."))),g_=(Zf("editorHoverWidget.statusBarBackground",{dark:Av(c_,.2),light:Mv(c_,.05),hcDark:$p,hcLight:$p},J.b("statusBarBackground","Background color of the editor hover status bar.")),Zf("editorLink.activeForeground",{dark:"#4E94CE",light:Ug.blue,hcDark:Ug.cyan,hcLight:"#292929"},J.b("activeLinkForeground","Color of active links.")),Zf("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:Ug.white,hcLight:Ug.black},J.b("editorInlayHintForeground","Foreground color of inline hints"))),m_=Zf("editorInlayHint.background",{dark:Ov(Tp,.1),light:Ov(Tp,.1),hcDark:Ov(Ug.white,.1),hcLight:Ov(Tp,.1)},J.b("editorInlayHintBackground","Background color of inline hints")),f_=(Zf("editorInlayHint.typeForeground",{dark:g_,light:g_,hcDark:g_,hcLight:g_},J.b("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Zf("editorInlayHint.typeBackground",{dark:m_,light:m_,hcDark:m_,hcLight:m_},J.b("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Zf("editorInlayHint.parameterForeground",{dark:g_,light:g_,hcDark:g_,hcLight:g_},J.b("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Zf("editorInlayHint.parameterBackground",{dark:m_,light:m_,hcDark:m_,hcLight:m_},J.b("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),Zf("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},J.b("editorLightBulbForeground","The color used for the lightbulb actions icon."))),p_=(Zf("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},J.b("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),Zf("editorLightBulbAi.foreground",{dark:f_,light:f_,hcDark:f_,hcLight:f_},J.b("editorLightBulbAiForeground","The color used for the lightbulb AI icon.")),new Ug(new Hg(155,185,85,.2))),__=new Ug(new Hg(255,0,0,.2)),v_=Zf("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},J.b("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),b_=Zf("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},J.b("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),C_=(Zf("diffEditor.insertedLineBackground",{dark:p_,light:p_,hcDark:null,hcLight:null},J.b("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("diffEditor.removedLineBackground",{dark:__,light:__,hcDark:null,hcLight:null},J.b("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted.")),Zf("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("diffEditorRemovedLineGutter","Background color for the margin where lines got removed.")),Zf("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content."))),w_=Zf("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content.")),y_=(Zf("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},J.b("diffEditorInsertedOutline","Outline color for the text that got inserted.")),Zf("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},J.b("diffEditorRemovedOutline","Outline color for text that got removed.")),Zf("diffEditor.border",{dark:null,light:null,hcDark:Jf,hcLight:Jf},J.b("diffEditorBorder","Border color between the two text editors.")),Zf("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},J.b("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),Zf("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},J.b("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor.")),Zf("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},J.b("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor.")),Zf("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},J.b("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor.")),Zf("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not."))),S_=Zf("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),L_=Zf("list.focusOutline",{dark:Xf,light:Xf,hcDark:ep,hcLight:ep},J.b("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),k_=Zf("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},J.b("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),D_=Zf("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:Ug.fromHex("#0F4A85").transparent(.1)},J.b("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),x_=Zf("list.activeSelectionForeground",{dark:Ug.white,light:Ug.white,hcDark:null,hcLight:null},J.b("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),E_=Zf("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),N_=Zf("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:Ug.fromHex("#0F4A85").transparent(.1)},J.b("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),I_=Zf("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),T_=Zf("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),M_=Zf("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),A_=Zf("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},J.b("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),O_=Zf("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:Ug.white.transparent(.1),hcLight:Ug.fromHex("#0F4A85").transparent(.1)},J.b("listHoverBackground","List/Tree background when hovering over items using the mouse.")),R_=Zf("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),P_=Zf("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},J.b("listDropBackground","List/Tree drag and drop background when moving items over other items when using the mouse.")),F_=Zf("list.dropBetweenBackground",{dark:Qf,light:Qf,hcDark:null,hcLight:null},J.b("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),B_=Zf("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Xf,hcLight:Xf},J.b("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree."));Zf("list.focusHighlightForeground",{dark:B_,light:(W_=D_,V_=B_,H_="#BBE7FF",{op:6,if:W_,then:V_,else:H_}),hcDark:B_,hcLight:B_},J.b("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));var W_,V_,H_;Zf("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},J.b("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),Zf("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},J.b("listErrorForeground","Foreground color of list items containing errors.")),Zf("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},J.b("listWarningForeground","Foreground color of list items containing warnings."));const z_=Zf("listFilterWidget.background",{light:Mv($p,0),dark:Av($p,0),hcDark:$p,hcLight:$p},J.b("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),K_=Zf("listFilterWidget.outline",{dark:Ug.transparent,light:Ug.transparent,hcDark:"#f38518",hcLight:"#007ACC"},J.b("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),U_=Zf("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Jf,hcLight:Jf},J.b("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),j_=Zf("listFilterWidget.shadow",{dark:ip,light:ip,hcDark:ip,hcLight:ip},J.b("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees.")),q_=(Zf("list.filterMatchBackground",{dark:h_,light:h_,hcDark:null,hcLight:null},J.b("listFilterMatchHighlight","Background color of the filtered match.")),Zf("list.filterMatchBorder",{dark:d_,light:d_,hcDark:Jf,hcLight:ep},J.b("listFilterMatchHighlightBorder","Border color of the filtered match.")),Zf("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},J.b("treeIndentGuidesStroke","Tree stroke color for the indentation guides."))),$_=Zf("tree.inactiveIndentGuidesStroke",{dark:Ov(q_,.4),light:Ov(q_,.4),hcDark:Ov(q_,.4),hcLight:Ov(q_,.4)},J.b("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),G_=Zf("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},J.b("tableColumnsBorder","Table border color between columns.")),Z_=Zf("tree.tableOddRowsBackground",{dark:Ov(Yf,.04),light:Ov(Yf,.04),hcDark:null,hcLight:null},J.b("tableOddRowsBackgroundColor","Background color for odd table rows.")),Y_=(Zf("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},J.b("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. ")),Zf("checkbox.background",{dark:bp,light:bp,hcDark:bp,hcLight:bp},J.b("checkbox.background","Background color of checkbox widget."))),Q_=(Zf("checkbox.selectBackground",{dark:$p,light:$p,hcDark:$p,hcLight:$p},J.b("checkbox.select.background","Background color of checkbox widget when the element it's in is selected.")),Zf("checkbox.foreground",{dark:wp,light:wp,hcDark:wp,hcLight:wp},J.b("checkbox.foreground","Foreground color of checkbox widget."))),X_=Zf("checkbox.border",{dark:yp,light:yp,hcDark:yp,hcLight:yp},J.b("checkbox.border","Border color of checkbox widget.")),J_=(Zf("checkbox.selectBorder",{dark:Qf,light:Qf,hcDark:Qf,hcLight:Qf},J.b("checkbox.select.border","Border color of checkbox widget when the element it's in is selected.")),Zf("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,J.b("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead"))),ev=Zf("quickInputList.focusForeground",{dark:x_,light:x_,hcDark:x_,hcLight:x_},J.b("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),tv=Zf("quickInputList.focusIconForeground",{dark:E_,light:E_,hcDark:E_,hcLight:E_},J.b("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),iv=Zf("quickInputList.focusBackground",{dark:Rv(J_,D_),light:Rv(J_,D_),hcDark:null,hcLight:null},J.b("quickInput.listFocusBackground","Quick picker background color for the focused item.")),nv=Zf("menu.border",{dark:null,light:null,hcDark:Jf,hcLight:Jf},J.b("menuBorder","Border color of menus.")),sv=Zf("menu.foreground",{dark:wp,light:wp,hcDark:wp,hcLight:wp},J.b("menuForeground","Foreground color of menu items.")),ov=Zf("menu.background",{dark:bp,light:bp,hcDark:bp,hcLight:bp},J.b("menuBackground","Background color of menu items.")),rv=Zf("menu.selectionForeground",{dark:x_,light:x_,hcDark:x_,hcLight:x_},J.b("menuSelectionForeground","Foreground color of the selected menu item in menus.")),av=Zf("menu.selectionBackground",{dark:D_,light:D_,hcDark:D_,hcLight:D_},J.b("menuSelectionBackground","Background color of the selected menu item in menus.")),lv=Zf("menu.selectionBorder",{dark:null,light:null,hcDark:ep,hcLight:ep},J.b("menuSelectionBorder","Border color of the selected menu item in menus.")),hv=Zf("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Jf,hcLight:Jf},J.b("menuSeparatorBackground","Color of a separator menu item in menus.")),dv=Zf("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},J.b("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse")),cv=(Zf("toolbar.hoverOutline",{dark:null,light:null,hcDark:ep,hcLight:ep},J.b("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse")),Zf("toolbar.activeBackground",{dark:Av(dv,.1),light:Mv(dv,.1),hcDark:null,hcLight:null},J.b("toolbarActiveBackground","Toolbar background when holding the mouse over actions")),Zf("editor.snippetTabstopHighlightBackground",{dark:new Ug(new Hg(124,124,124,.3)),light:new Ug(new Hg(10,50,100,.2)),hcDark:new Ug(new Hg(124,124,124,.3)),hcLight:new Ug(new Hg(10,50,100,.2))},J.b("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),Zf("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},J.b("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),Zf("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),Zf("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new Ug(new Hg(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},J.b("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),Zf("breadcrumb.foreground",{light:Ov(Yf,.8),dark:Ov(Yf,.8),hcDark:Ov(Yf,.8),hcLight:Ov(Yf,.8)},J.b("breadcrumbsFocusForeground","Color of focused breadcrumb items."))),uv=Zf("breadcrumb.background",{light:jp,dark:jp,hcDark:jp,hcLight:jp},J.b("breadcrumbsBackground","Background color of breadcrumb items.")),gv=Zf("breadcrumb.focusForeground",{light:Mv(Yf,.2),dark:Av(Yf,.1),hcDark:Av(Yf,.1),hcLight:Av(Yf,.1)},J.b("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),mv=Zf("breadcrumb.activeSelectionForeground",{light:Mv(Yf,.2),dark:Av(Yf,.1),hcDark:Av(Yf,.1),hcLight:Av(Yf,.1)},J.b("breadcrumbsSelectedForeground","Color of selected breadcrumb items.")),fv=(Zf("breadcrumbPicker.background",{light:$p,dark:$p,hcDark:$p,hcLight:$p},J.b("breadcrumbsSelectedBackground","Background color of breadcrumb item picker.")),Ug.fromHex("#40C8AE").transparent(.5)),pv=Ug.fromHex("#40A6FF").transparent(.5),_v=Ug.fromHex("#606060").transparent(.4),vv=Zf("merge.currentHeaderBackground",{dark:fv,light:fv,hcDark:null,hcLight:null},J.b("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),bv=(Zf("merge.currentContentBackground",{dark:Ov(vv,.4),light:Ov(vv,.4),hcDark:Ov(vv,.4),hcLight:Ov(vv,.4)},J.b("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("merge.incomingHeaderBackground",{dark:pv,light:pv,hcDark:null,hcLight:null},J.b("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),Cv=(Zf("merge.incomingContentBackground",{dark:Ov(bv,.4),light:Ov(bv,.4),hcDark:Ov(bv,.4),hcLight:Ov(bv,.4)},J.b("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("merge.commonHeaderBackground",{dark:_v,light:_v,hcDark:null,hcLight:null},J.b("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),wv=(Zf("merge.commonContentBackground",{dark:Ov(Cv,.4),light:Ov(Cv,.4),hcDark:Ov(Cv,.4),hcLight:Ov(Cv,.4)},J.b("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},J.b("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."))),yv=(Zf("editorOverviewRuler.currentContentForeground",{dark:Ov(vv,1),light:Ov(vv,1),hcDark:wv,hcLight:wv},J.b("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts.")),Zf("editorOverviewRuler.incomingContentForeground",{dark:Ov(bv,1),light:Ov(bv,1),hcDark:wv,hcLight:wv},J.b("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts.")),Zf("editorOverviewRuler.commonContentForeground",{dark:Ov(Cv,1),light:Ov(Cv,1),hcDark:wv,hcLight:wv},J.b("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts.")),Zf("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},J.b("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},J.b("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},J.b("minimapFindMatchHighlight","Minimap marker color for find matches."),!0)),Sv=(Zf("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},J.b("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),Zf("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},J.b("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0)),Lv=Zf("minimap.infoHighlight",{dark:zp,light:zp,hcDark:Kp,hcLight:Kp},J.b("minimapInfo","Minimap marker color for infos.")),kv=Zf("minimap.warningHighlight",{dark:Vp,light:Vp,hcDark:Hp,hcLight:Hp},J.b("overviewRuleWarning","Minimap marker color for warnings.")),Dv=Zf("minimap.errorHighlight",{dark:new Ug(new Hg(255,18,18,.7)),light:new Ug(new Hg(255,18,18,.7)),hcDark:new Ug(new Hg(255,50,50,1)),hcLight:"#B5200D"},J.b("minimapError","Minimap marker color for errors.")),xv=Zf("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},J.b("minimapBackground","Minimap background color.")),Ev=Zf("minimap.foregroundOpacity",{dark:Ug.fromHex("#000f"),light:Ug.fromHex("#000f"),hcDark:Ug.fromHex("#000f"),hcLight:Ug.fromHex("#000f")},J.b("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),Nv=(Zf("minimapSlider.background",{light:Ov(Op,.5),dark:Ov(Op,.5),hcDark:Ov(Op,.5),hcLight:Ov(Op,.5)},J.b("minimapSliderBackground","Minimap slider background color.")),Zf("minimapSlider.hoverBackground",{light:Ov(Rp,.5),dark:Ov(Rp,.5),hcDark:Ov(Rp,.5),hcLight:Ov(Rp,.5)},J.b("minimapSliderHoverBackground","Minimap slider background color when hovering.")),Zf("minimapSlider.activeBackground",{light:Ov(Pp,.5),dark:Ov(Pp,.5),hcDark:Ov(Pp,.5),hcLight:Ov(Pp,.5)},J.b("minimapSliderActiveBackground","Minimap slider background color when clicked on.")),Zf("problemsErrorIcon.foreground",{dark:Bp,light:Bp,hcDark:Bp,hcLight:Bp},J.b("problemsErrorIconForeground","The color used for the problems error icon."))),Iv=Zf("problemsWarningIcon.foreground",{dark:Vp,light:Vp,hcDark:Vp,hcLight:Vp},J.b("problemsWarningIconForeground","The color used for the problems warning icon.")),Tv=Zf("problemsInfoIcon.foreground",{dark:zp,light:zp,hcDark:zp,hcLight:zp},J.b("problemsInfoIconForeground","The color used for the problems info icon."));Zf("charts.foreground",{dark:Yf,light:Yf,hcDark:Yf,hcLight:Yf},J.b("chartsForeground","The foreground color used in charts.")),Zf("charts.lines",{dark:Ov(Yf,.5),light:Ov(Yf,.5),hcDark:Ov(Yf,.5),hcLight:Ov(Yf,.5)},J.b("chartsLines","The color used for horizontal lines in charts.")),Zf("charts.red",{dark:Bp,light:Bp,hcDark:Bp,hcLight:Bp},J.b("chartsRed","The red color used in chart visualizations.")),Zf("charts.blue",{dark:zp,light:zp,hcDark:zp,hcLight:zp},J.b("chartsBlue","The blue color used in chart visualizations.")),Zf("charts.yellow",{dark:Vp,light:Vp,hcDark:Vp,hcLight:Vp},J.b("chartsYellow","The yellow color used in chart visualizations.")),Zf("charts.orange",{dark:yv,light:yv,hcDark:yv,hcLight:yv},J.b("chartsOrange","The orange color used in chart visualizations.")),Zf("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},J.b("chartsGreen","The green color used in chart visualizations.")),Zf("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},J.b("chartsPurple","The purple color used in chart visualizations."));function Mv(e,t){return{op:0,value:e,factor:t}}function Av(e,t){return{op:1,value:e,factor:t}}function Ov(e,t){return{op:2,value:e,factor:t}}function Rv(...e){return{op:4,values:e}}function Pv(e,t,i,n){return{op:5,value:e,background:t,factor:i,transparency:n}}function Fv(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?Ug.fromHex(e):t.getColor(e):e instanceof Ug?e:"object"==typeof e?function(e,t){var i,n,s,o;switch(e.op){case 0:return null===(i=Fv(e.value,t))||void 0===i?void 0:i.darken(e.factor);case 1:return null===(n=Fv(e.value,t))||void 0===n?void 0:n.lighten(e.factor);case 2:return null===(s=Fv(e.value,t))||void 0===s?void 0:s.transparent(e.factor);case 3:{const i=Fv(e.background,t);return i?null===(o=Fv(e.value,t))||void 0===o?void 0:o.makeOpaque(i):Fv(e.value,t)}case 4:for(const i of e.values){const e=Fv(i,t);if(e)return e}return;case 6:return Fv(t.defines(e.if)?e.then:e.else,t);case 5:{const i=Fv(e.value,t);if(!i)return;const n=Fv(e.background,t);return n?i.isDarkerThan(n)?Ug.getLighterColor(i,n,e.factor).transparent(e.transparency):Ug.getDarkerColor(i,n,e.factor).transparent(e.transparency):i.transparent(e.factor*e.transparency)}default:throw Lh()}}(e,t):void 0}const Bv=Eh.as(hc);Bv.registerSchema("vscode://schemas/workbench-colors",Gf.getColorSchema());const Wv=new mo(()=>Bv.notifySchemaChanged("vscode://schemas/workbench-colors"),200);Gf.onDidChangeSchema(()=>{Wv.isScheduled()||Wv.schedule()});class Vv{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new Hv(this.x-e.scrollX,this.y-e.scrollY)}}class Hv{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new Vv(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class zv{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class Kv{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function Uv(e){const t=aa(e);return new zv(t.left,t.top,t.width,t.height)}function jv(e,t,i){const n=t.width/e.offsetWidth,s=t.height/e.offsetHeight,o=(i.x-t.x)/n,r=(i.y-t.y)/s;return new Kv(o,r)}class qv extends to{constructor(e,t,i){super(Fr(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new Vv(this.posx,this.posy),this.editorPos=Uv(i),this.relativePos=jv(i,this.editorPos,this.pos)}}class $v{constructor(e){this._editorViewDomNode=e}_create(e){return new qv(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return Zr(e,"contextmenu",e=>{t(this._create(e))})}onMouseUp(e,t){return Zr(e,"mouseup",e=>{t(this._create(e))})}onMouseDown(e,t){return Zr(e,Ma.MOUSE_DOWN,e=>{t(this._create(e))})}onPointerDown(e,t){return Zr(e,Ma.POINTER_DOWN,e=>{t(this._create(e),e.pointerId)})}onMouseLeave(e,t){return Zr(e,Ma.MOUSE_LEAVE,e=>{t(this._create(e))})}onMouseMove(e,t){return Zr(e,"mousemove",e=>t(this._create(e)))}}class Gv{constructor(e){this._editorViewDomNode=e}_create(e){return new qv(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return Zr(e,"pointerup",e=>{t(this._create(e))})}onPointerDown(e,t){return Zr(e,Ma.POINTER_DOWN,e=>{t(this._create(e),e.pointerId)})}onPointerLeave(e,t){return Zr(e,Ma.POINTER_LEAVE,e=>{t(this._create(e))})}onPointerMove(e,t){return Zr(e,"pointermove",e=>t(this._create(e)))}}class Zv extends st{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new Uf),this._keydownListener=null}startMonitoring(e,t,i,n,s){this._keydownListener=Qr(e.ownerDocument,"keydown",e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,e=>{n(new qv(e,!0,this._editorViewDomNode))},e=>{this._keydownListener.dispose(),s(e)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class Yv{constructor(e){this._editor=e,this._instanceId=++Yv._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new mo(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const n=this._counter++;i=new Qv(t,`dyn-rule-${this._instanceId}-${n}`,pa(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}Yv._idPool=0;class Qv{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new nt,this._styleElement=Sa(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const e in t){const n=t[e];let s;s="object"==typeof n?qf(n.id):n;i+=`\n\t${Xv(e)}: ${s};`}return i+="\n}",i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Xv(e){return e.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>"-"+e.toLowerCase())}class Jv extends st{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const n=e[i];switch(n.type){case 0:this.onCompositionStart(n)&&(t=!0);break;case 1:this.onCompositionEnd(n)&&(t=!0);break;case 2:this.onConfigurationChanged(n)&&(t=!0);break;case 3:this.onCursorStateChanged(n)&&(t=!0);break;case 4:this.onDecorationsChanged(n)&&(t=!0);break;case 5:this.onFlushed(n)&&(t=!0);break;case 6:this.onFocusChanged(n)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(n)&&(t=!0);break;case 8:this.onLineMappingChanged(n)&&(t=!0);break;case 9:this.onLinesChanged(n)&&(t=!0);break;case 10:this.onLinesDeleted(n)&&(t=!0);break;case 11:this.onLinesInserted(n)&&(t=!0);break;case 12:this.onRevealRangeRequest(n)&&(t=!0);break;case 13:this.onScrollChanged(n)&&(t=!0);break;case 15:this.onTokensChanged(n)&&(t=!0);break;case 14:this.onThemeChanged(n)&&(t=!0);break;case 16:this.onTokensColorsChanged(n)&&(t=!0);break;case 17:this.onZonesChanged(n)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(n)}}t&&(this._shouldRender=!0)}}class eb extends Jv{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class tb{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return null===t?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const s=new Uint8Array(n);for(let e=0;e<n;e++)s[e]=i[n-e-1];return s}}class ib extends class{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class nb{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class sb{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const n=e[i];t[i]=new sb(n.left,n.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class ob{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}class rb{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class ab{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class lb{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,s){const o=this._createRange();try{return o.setStart(e,t),o.setEnd(i,n),o.getClientRects()}catch(e){return null}finally{this._detachRange(o,s)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(ob.compare);const t=[];let i=0,n=e[0];for(let s=1,o=e.length;s<o;s++){const o=e[s];n.left+n.width+.9>=o.left?n.width=Math.max(n.width,o.left+o.width-n.left):(t[i++]=n,n=o)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;const n=[];for(let s=0,o=e.length;s<o;s++){const o=e[s];n[s]=new ob(Math.max(0,(o.left-t)/i),o.width/i)}return this._mergeAdjacentRanges(n)}static readHorizontalRanges(e,t,i,n,s,o){const r=e.children.length-1;if(0>r)return null;if((t=Math.min(r,Math.max(0,t)))===(n=Math.min(r,Math.max(0,n)))&&i===s&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(i,o.clientRectDeltaLeft,o.clientRectScale)}t!==n&&n>0&&0===s&&(n--,s=1073741824);let a=e.children[t].firstChild,l=e.children[n].firstChild;if(a&&l||(!a&&0===i&&t>0&&(a=e.children[t-1].firstChild,i=1073741824),!l&&0===s&&n>0&&(l=e.children[n-1].firstChild,s=1073741824)),!a||!l)return null;i=Math.min(a.textContent.length,Math.max(0,i)),s=Math.min(l.textContent.length,Math.max(0,s));const h=this._readClientRects(a,i,l,s,o.endNode);return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,o.clientRectDeltaLeft,o.clientRectScale)}}var hb;function db(e){return e===hb.HIGH_CONTRAST_DARK||e===hb.HIGH_CONTRAST_LIGHT}function cb(e){return e===hb.DARK||e===hb.HIGH_CONTRAST_DARK}!function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST_DARK="hcDark",e.HIGH_CONTRAST_LIGHT="hcLight"}(hb||(hb={}));const ub=!!K.k||!(K.g||Fs||Vs);let gb=!0;class mb{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(50),s=i.get(38);this.renderWhitespace="off"===s?i.get(99):"none",this.renderControlCharacters=i.get(94),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(67),this.stopRenderingLineAfter=i.get(117),this.fontLigatures=i.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class fb{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=ll(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!db(this._options.themeType)&&"selection"!==this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const s=i.getViewLineRenderingData(e),o=this._options,r=ym.filter(s.inlineDecorations,e,s.minColumn,s.maxColumn);let a=null;if(db(o.themeType)||"selection"===this._options.renderWhitespace){const t=i.selections;for(const i of t){if(i.endLineNumber<e||i.startLineNumber>e)continue;const t=i.startLineNumber===e?i.startColumn:s.minColumn,n=i.endLineNumber===e?i.endColumn:s.maxColumn;t<n&&(db(o.themeType)&&r.push(new ym(t,n,"inline-selected-text",0)),"selection"===this._options.renderWhitespace&&(a||(a=[]),a.push(new Dm(t-1,n-1))))}}const l=new xm(o.useMonospaceOptimizations,o.canUseHalfwidthRightwardsArrow,s.content,s.continuesWithWrappedLine,s.isBasicASCII,s.containsRTL,s.minColumn-1,s.tokens,r,s.tabSize,s.startVisibleColumn,o.spaceWidth,o.middotWidth,o.wsmiddotWidth,o.stopRenderingLineAfter,o.renderWhitespace,o.renderControlCharacters,o.fontLigatures!==be.OFF,a);if(this._renderedViewLine&&this._renderedViewLine.input.equals(l))return!1;n.appendString('<div style="top:'),n.appendString(String(t)),n.appendString("px;height:"),n.appendString(String(this._options.lineHeight)),n.appendString('px;" class="'),n.appendString(fb.CLASS_NAME),n.appendString('">');const h=Tm(l,n);n.appendString("</div>");let d=null;return gb&&ub&&s.isBasicASCII&&o.useMonospaceOptimizations&&0===h.containsForeignElements&&(d=new pb(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping)),d||(d=bb(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof pb}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof pb?this._renderedViewLine.monospaceAssumptionsAreValid():gb}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof pb&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const s=this._renderedViewLine.input.stopRenderingLineAfter;if(-1!==s&&t>s+1&&i>s+1)return new ab(!0,[new ob(this.getWidth(n),0)]);-1!==s&&t>s+1&&(t=s+1),-1!==s&&i>s+1&&(i=s+1);const o=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return o&&o.length>0?new ab(!1,o):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}fb.CLASS_NAME="view-line";class pb{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let e=0;e<n;e++)this._keyColumnPixelOffsetCache[e]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<300){const e=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*e)}return-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,null==e||e.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||-1!==this._cachedWidth}monospaceAssumptionsAreValid(){if(!this.domNode)return gb;if(this.input.lineContent.length<300){const e=this.getWidth(null),t=this.domNode.domNode.firstChild.offsetWidth;Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),gb=!1)}return gb}toSlowRenderedLine(){return bb(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const s=this._getColumnPixelOffset(e,t,n),o=this._getColumnPixelOffset(e,i,n);return[new ob(s,o-s)]}_getColumnPixelOffset(e,t,i){if(t<=300){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const n=Math.floor((t-1)/300)-1,s=300*(n+1)+1;let o=-1;if(this._keyColumnPixelOffsetCache&&(o=this._keyColumnPixelOffsetCache[n],-1===o&&(o=this._actualReadPixelOffset(e,s,i),this._keyColumnPixelOffsetCache[n]=o)),-1===o){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const r=this._characterMapping.getHorizontalOffset(s),a=this._characterMapping.getHorizontalOffset(t);return o+this._charWidth*(a-r)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),s=lb.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return s&&0!==s.length?s[0].left:-1}getColumnOfNodeOffset(e,t){return yb(this._characterMapping,e,t)}}class _b{constructor(e,t,i,n,s){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=s,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||0===this._characterMapping.length){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,null==e||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const s=this._readPixelOffset(this.domNode,e,t,n);if(-1===s)return null;const o=this._readPixelOffset(this.domNode,e,i,n);return-1===o?null:[new ob(s,o-s)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,s){if(i===n){const n=this._readPixelOffset(e,t,i,s);return-1===n?null:[new ob(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,s)}_readPixelOffset(e,t,i,n){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth(n);const t=this._getReadingTarget(e);return t.firstChild?(n.markDidDomLayout(),t.firstChild.offsetWidth):0}if(null!==this._pixelOffsetCache){const s=this._pixelOffsetCache[i];if(-1!==s)return s;const o=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=o,o}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=lb.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return t&&0!==t.length?t[0].left:-1}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth(n);const s=this._characterMapping.getDomPosition(i),o=lb.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,s.partIndex,s.charIndex,n);if(!o||0===o.length)return-1;const r=o[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-r)<=1)return t}return r}_readRawVisibleRangesForRange(e,t,i,n){if(1===t&&i===this._characterMapping.length)return[new ob(0,this.getWidth(n))];const s=this._characterMapping.getDomPosition(t),o=this._characterMapping.getDomPosition(i);return lb.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,o.partIndex,o.charIndex,n)}getColumnOfNodeOffset(e,t){return yb(this._characterMapping,e,t)}}class vb extends _b{_readVisibleRangesForRange(e,t,i,n,s){const o=super._readVisibleRangesForRange(e,t,i,n,s);if(!o||0===o.length||i===n||1===i&&n===this._characterMapping.length)return o;if(!this.input.containsRTL){const i=this._readPixelOffset(e,t,n,s);if(-1!==i){const e=o[o.length-1];e.left<i&&(e.width=i-e.left)}}return o}}const bb=Bs?Cb:wb;function Cb(e,t,i,n,s){return new vb(e,t,i,n,s)}function wb(e,t,i,n,s){return new _b(e,t,i,n,s)}function yb(e,t,i){const n=t.textContent.length;let s=-1;for(;t;)t=t.previousSibling,s++;return e.getColumn(new Em(s,i),n)}class Sb{static _nextVisibleColumn(e,t,i){return 9===e?Sb.nextRenderTabStop(t,i):Ss(e)||Ls(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),s=e.substring(0,n),o=new ms(s);let r=0;for(;!o.eol();){const e=us(s,n,o.offset);o.nextGraphemeLength(),r=this._nextVisibleColumn(e,r,i)}return r}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length,s=new ms(e);let o=0,r=1;for(;!s.eol();){const a=us(e,n,s.offset);s.nextGraphemeLength();const l=this._nextVisibleColumn(a,o,i),h=s.offset+1;if(l>=t){return l-t<t-o?h:r}o=l,r=h}return n+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}class Lb{static whitespaceVisibleColumn(e,t,i){const n=e.length;let s=0,o=-1,r=-1;for(let a=0;a<n;a++){if(a===t)return[o,r,s];s%i==0&&(o=a,r=s);switch(e.charCodeAt(a)){case 32:s+=1;break;case 9:s=Sb.nextRenderTabStop(s,i);break;default:return[-1,-1,-1]}}return t===n?[o,r,s]:[-1,-1,-1]}static atomicPosition(e,t,i,n){const s=e.length,[o,r,a]=Lb.whitespaceVisibleColumn(e,t,i);if(-1===a)return-1;let l;switch(n){case 0:l=!0;break;case 1:l=!1;break;case 2:if(a%i==0)return t;l=a%i<=i/2}if(l){if(-1===o)return-1;let t=r;for(let n=o;n<s;++n){if(t===r+i)return o;switch(e.charCodeAt(n)){case 32:t+=1;break;case 9:t=Sb.nextRenderTabStop(t,i);break;default:return-1}}return t===r+i?o:-1}const h=Sb.nextRenderTabStop(a,i);let d=a;for(let n=t;n<s;n++){if(d===h)return n;switch(e.charCodeAt(n)){case 32:d+=1;break;case 9:d=Sb.nextRenderTabStop(d,i);break;default:return-1}}return d===h?s:-1}}class kb{constructor(e=null){this.hitTarget=e,this.type=0}}class Db{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var xb;!function(e){e.createFromDOMInfo=function(e,t,i){const n=e.getPositionFromDOMInfo(t,i);return n?new Db(n,t,null):new kb(t)}}(xb||(xb={}));class Eb{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class Nb{static _deduceRage(e,t=null){return!t&&e?new wi(e.lineNumber,e.column,e.lineNumber,e.column):null!=t?t:null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,n,s,o){return{type:e,element:t,mouseColumn:i,position:n,range:s,detail:o}}static createViewZone(e,t,i,n,s){return{type:e,element:t,mouseColumn:i,position:n,range:this._deduceRage(n),detail:s}}static createContentText(e,t,i,n,s){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,n),detail:s}}static createContentEmpty(e,t,i,n){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:n}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,n){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:n}}static _typeToString(e){return 1===e?"TEXTAREA":2===e?"GUTTER_GLYPH_MARGIN":3===e?"GUTTER_LINE_NUMBERS":4===e?"GUTTER_LINE_DECORATIONS":5===e?"GUTTER_VIEW_ZONE":6===e?"CONTENT_TEXT":7===e?"CONTENT_EMPTY":8===e?"CONTENT_VIEW_ZONE":9===e?"CONTENT_WIDGET":10===e?"OVERVIEW_RULER":11===e?"SCROLLBAR":12===e?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class Ib{static isTextArea(e){return 2===e.length&&3===e[0]&&7===e[1]}static isChildOfViewLines(e){return e.length>=4&&3===e[0]&&8===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&8===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&6===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&9===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowGuard(e){return e.length>=1&&3===e[0]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&5===e[0]}}class Tb{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(144),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(67),this.stickyTabStops=n.get(116),this.typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Tb.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,s=e.viewModel.getLineCount();let o,r=null,a=null;return i.afterLineNumber!==s&&(a=new Ci(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new Ci(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),o=null===a?r:null===r?a:t<n?r:a,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:r,positionAfter:a,position:o}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new wi(e,t,e,t),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new wi(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return Tb._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==e.ownerDocument.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class Mb extends class{constructor(e,t,i,n){this.editorPos=t,this.pos=i,this.relativePos=n,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Rb._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}{constructor(e,t,i,n,s){super(e,t,i,n),this._ctx=e,s?(this.target=s,this.targetPath=tb.collect(s,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?Sb.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return Nb.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return Nb.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return Nb.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return Nb.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return Nb.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return Nb.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return Nb.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return Nb.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return Nb.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new Mb(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const Ab={isAfterLines:!0};function Ob(e){return{isAfterLines:!1,horizontalDistanceToText:e}}class Rb{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=tb.collect(t,this._viewHelper.viewDomNode);return!(!Ib.isChildOfContentWidgets(i)&&!Ib.isChildOfOverflowingContentWidgets(i))||!(!Ib.isChildOfOverlayWidgets(i)&&!Ib.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(e,t,i,n,s){const o=new Tb(this._context,this._viewHelper,e),r=new Mb(o,t,i,n,s);try{const e=Rb._createMouseTarget(o,r,!1);if(6===e.type&&o.stickyTabStops&&null!==e.position){const t=Rb._snapToSoftTabBoundary(e.position,o.viewModel),i=wi.fromPositions(t,t).plusRange(e.range);return r.fulfillContentText(t,i,e.detail)}return e}catch(e){return r.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(null===t.target){if(i)return t.fulfillUnknown();const n=Rb._doHitTest(e,t);return 1===n.type?Rb.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}const n=t;let s=null;return Ib.isChildOfOverflowGuard(t.targetPath)||Ib.isChildOfOverflowingContentWidgets(t.targetPath)||Ib.isChildOfOverflowingOverlayWidgets(t.targetPath)||(s=s||t.fulfillUnknown()),s=s||Rb._hitTestContentWidget(e,n),s=s||Rb._hitTestOverlayWidget(e,n),s=s||Rb._hitTestMinimap(e,n),s=s||Rb._hitTestScrollbarSlider(e,n),s=s||Rb._hitTestViewZone(e,n),s=s||Rb._hitTestMargin(e,n),s=s||Rb._hitTestViewCursor(e,n),s=s||Rb._hitTestTextArea(e,n),s=s||Rb._hitTestViewLines(e,n,i),s=s||Rb._hitTestScrollbar(e,n),s||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(Ib.isChildOfContentWidgets(t.targetPath)||Ib.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(Ib.isChildOfOverlayWidgets(t.targetPath)||Ib.isChildOfOverflowingOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const e of i)if(t.target===e.domNode)return t.fulfillContentText(e.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,s=t.mouseVerticalOffset;for(const o of i){if(n<o.contentLeft)continue;if(n>o.contentLeft+o.width)continue;const i=e.getVerticalOffsetForLineNumber(o.position.lineNumber);if(i<=s&&s<=i+o.height)return t.fulfillContentText(o.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return Ib.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let s=Math.abs(t.relativePos.x);const o={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:s};if(s-=e.layoutInfo.glyphMarginLeft,s<=e.layoutInfo.glyphMarginWidth){const r=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),a=e.viewModel.glyphLanes.getLanesAtLine(r.lineNumber);return o.glyphMarginLane=a[Math.floor(s/e.lineHeight)],t.fulfillMargin(2,n,i.range,o)}return s-=e.layoutInfo.glyphMarginWidth,s<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,o):(s-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,o))}return null}static _hitTestViewLines(e,t,i){if(!Ib.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new Ci(1,1),Ab);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new Ci(i,n),Ab)}if(i){if(Ib.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){const n=e.getLineWidth(i),s=Ob(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new Ci(i,1),s)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const s=Ob(t.mouseContentHorizontalOffset-n),o=new Ci(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(o,s)}}return t.fulfillUnknown()}const n=Rb._doHitTest(e,t);return 1===n.type?Rb.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(Ib.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Ci(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Ib.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Ci(i,n))}}return null}static _hitTestScrollbar(e,t){if(Ib.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Ci(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(144),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return Rb._getMouseColumn(n,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){if(e<0)return 1;return Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,s){const o=n.lineNumber,r=n.column,a=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>a){const e=Ob(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}const l=e.visibleRangeForPosition(o,r);if(!l)return t.fulfillUnknown(n);const h=l.left;if(Math.abs(t.mouseContentHorizontalOffset-h)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!s,injectedText:s});const d=[];if(d.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(o,r-1);t&&d.push({offset:t.left,column:r-1})}if(r<e.viewModel.getLineMaxColumn(o)){const t=e.visibleRangeForPosition(o,r+1);t&&d.push({offset:t.left,column:r+1})}d.sort((e,t)=>e.offset-t.offset);const c=t.pos.toClientCoordinates(Fr(e.viewDomNode)),u=i.getBoundingClientRect(),g=u.left<=c.clientX&&c.clientX<=u.right;let m=null;for(let e=1;e<d.length;e++){const i=d[e-1],s=d[e];if(i.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=s.offset){m=new wi(o,i.column,o,s.column);const e=Math.abs(i.offset-t.mouseContentHorizontalOffset),r=Math.abs(s.offset-t.mouseContentHorizontalOffset);n=new Ci(o,e<r?i.column:s.column);break}}return t.fulfillContentText(n,m,{mightBeForeignElement:!g||!!s,injectedText:s})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.getVerticalOffsetForLineNumber(i),s=n+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>s)){const i=Math.floor((n+s)/2);let o=t.pos.y+(i-t.mouseVerticalOffset);o<=t.editorPos.y&&(o=t.editorPos.y+1),o>=t.editorPos.y+t.editorPos.height&&(o=t.editorPos.y+t.editorPos.height-1);const r=new Vv(t.pos.x,o),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates(Fr(e.viewDomNode)));if(1===a.type)return a}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(Fr(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=_a(e.viewDomNode);let n;if(n=i?void 0===i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let s=e.elementFromPoint(t,i);if(null!==s){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const e=s.getBoundingClientRect(),i=Fr(s),o=i.getComputedStyle(s,null).getPropertyValue("font-style"),r=i.getComputedStyle(s,null).getPropertyValue("font-variant"),a=i.getComputedStyle(s,null).getPropertyValue("font-weight"),l=i.getComputedStyle(s,null).getPropertyValue("font-size"),h=i.getComputedStyle(s,null).getPropertyValue("line-height"),d=i.getComputedStyle(s,null).getPropertyValue("font-family"),c=`${o} ${r} ${a} ${l}/${h} ${d}`,u=s.innerText;let g,m=e.left,f=0;if(t>e.left+e.width)f=u.length;else{const e=Pb.getInstance();for(let i=0;i<u.length+1;i++){if(g=e.getCharWidth(u.charAt(i),c)/2,m+=g,t<m){f=i;break}m+=g}}n.setStart(s.firstChild,f),n.setEnd(s.firstChild,f)}return n}(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new kb;const s=n.startContainer;if(s.nodeType===s.TEXT_NODE){const t=s.parentNode,i=t?t.parentNode:null,o=i?i.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===fb.CLASS_NAME?xb.createFromDOMInfo(e,t,n.startOffset):new kb(s.parentNode)}if(s.nodeType===s.ELEMENT_NODE){const t=s.parentNode,i=t?t.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===fb.CLASS_NAME?xb.createFromDOMInfo(e,s,s.textContent.length):new kb(s)}return new kb}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,s=n?n.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===fb.CLASS_NAME?xb.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new kb(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,s=t?t.parentNode:null,o=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(n===fb.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t)return xb.createFromDOMInfo(e,t,0)}else if(o===fb.CLASS_NAME)return xb.createFromDOMInfo(e,i.offsetNode,0)}return new kb(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),s=Lb.atomicPosition(i,e.column-1,n,2);return-1!==s?new Ci(e.lineNumber,s+1):e}static _doHitTest(e,t){let i=new kb;if("function"==typeof e.viewDomNode.ownerDocument.caretRangeFromPoint?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(Fr(e.viewDomNode)))),1===i.type){const t=e.viewModel.getInjectedTextAt(i.position),n=e.viewModel.normalizePosition(i.position,2);!t&&n.equals(i.position)||(i=new Db(n,i.spanNode,t))}return i}}class Pb{static getInstance(){return Pb._INSTANCE||(Pb._INSTANCE=new Pb),Pb._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const n=this._canvas.getContext("2d");n.font=t;const s=n.measureText(e).width;return this._cache[i]=s,s}}function Fb(e,t,i){let n=null,s=null;if("function"==typeof i.value?(n="value",s=i.value,0!==s.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof i.get&&(n="get",s=i.get),!s)throw new Error("not supported");const o="$memoize$"+t;i[n]=function(...e){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,e)}),this[o]}}Pb._INSTANCE=null;var Bb,Wb=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};!function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}(Bb||(Bb={}));class Vb extends st{constructor(){super(),this.dispatched=!1,this.targets=new $,this.ignoreTargets=new $,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(dt.runAndSubscribe(Ur,({window:e,disposables:t})=>{t.add(Zr(e.document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),t.add(Zr(e.document,"touchend",t=>this.onTouchEnd(e,t))),t.add(Zr(e.document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))},{window:Pn,disposables:this._store}))}static addTarget(e){if(!Vb.isTouchDevice())return st.None;Vb.INSTANCE||(Vb.INSTANCE=Je(new Vb));return it(Vb.INSTANCE.targets.push(e))}static ignoreTarget(e){if(!Vb.isTouchDevice())return st.None;Vb.INSTANCE||(Vb.INSTANCE=Je(new Vb));return it(Vb.INSTANCE.ignoreTargets.push(e))}static isTouchDevice(){return"ontouchstart"in Pn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){const n=e.targetTouches.item(i);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:t,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[t],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};const s=this.newGestureEvent(Bb.Start,n.target);s.pageX=n.pageX,s.pageY=n.pageY,this.dispatchEvent(s)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,t){const i=Date.now(),s=Object.keys(this.activeTouches).length;for(let o=0,r=t.changedTouches.length;o<r;o++){const r=t.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn("move of an UNKNOWN touch",r);continue}const a=this.activeTouches[r.identifier],l=Date.now()-a.initialTimeStamp;if(l<Vb.HOLD_DELAY&&Math.abs(a.initialPageX-n(a.rollingPageX))<30&&Math.abs(a.initialPageY-n(a.rollingPageY))<30){const e=this.newGestureEvent(Bb.Tap,a.initialTarget);e.pageX=n(a.rollingPageX),e.pageY=n(a.rollingPageY),this.dispatchEvent(e)}else if(l>=Vb.HOLD_DELAY&&Math.abs(a.initialPageX-n(a.rollingPageX))<30&&Math.abs(a.initialPageY-n(a.rollingPageY))<30){const e=this.newGestureEvent(Bb.Contextmenu,a.initialTarget);e.pageX=n(a.rollingPageX),e.pageY=n(a.rollingPageY),this.dispatchEvent(e)}else if(1===s){const t=n(a.rollingPageX),s=n(a.rollingPageY),o=n(a.rollingTimestamps)-a.rollingTimestamps[0],r=t-a.rollingPageX[0],l=s-a.rollingPageY[0],h=[...this.targets].filter(e=>a.initialTarget instanceof Node&&e.contains(a.initialTarget));this.inertia(e,h,i,Math.abs(r)/o,r>0?1:-1,t,Math.abs(l)/o,l>0?1:-1,s)}this.dispatchEvent(this.newGestureEvent(Bb.End,a.initialTarget)),delete this.activeTouches[r.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Bb.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>Vb.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==Bb.Change&&e.type!==Bb.Contextmenu||(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,n,s,o,r,a,l){this.handle=ea(e,()=>{const h=Date.now(),d=h-i;let c=0,u=0,g=!0;n+=Vb.SCROLL_FRICTION*d,r+=Vb.SCROLL_FRICTION*d,n>0&&(g=!1,c=s*n*d),r>0&&(g=!1,u=a*r*d);const m=this.newGestureEvent(Bb.Change);m.translationX=c,m.translationY=u,t.forEach(e=>e.dispatchEvent(m)),g||this.inertia(e,t,h,n,s,o+c,r,a,l+u)})}onTouchMove(e){const t=Date.now();for(let i=0,s=e.changedTouches.length;i<s;i++){const s=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}const o=this.activeTouches[s.identifier],r=this.newGestureEvent(Bb.Change,o.initialTarget);r.translationX=s.pageX-n(o.rollingPageX),r.translationY=s.pageY-n(o.rollingPageY),r.pageX=s.pageX,r.pageY=s.pageY,this.dispatchEvent(r),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(s.pageX),o.rollingPageY.push(s.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Vb.SCROLL_FRICTION=-.005,Vb.HOLD_DELAY=700,Vb.CLEAR_TAP_COUNT_TIME=400,Wb([Fb],Vb,"isTouchDevice",null);class Hb extends st{onclick(e,t){this._register(Zr(e,Ma.CLICK,i=>t(new to(Fr(e),i))))}onmousedown(e,t){this._register(Zr(e,Ma.MOUSE_DOWN,i=>t(new to(Fr(e),i))))}onmouseover(e,t){this._register(Zr(e,Ma.MOUSE_OVER,i=>t(new to(Fr(e),i))))}onmouseleave(e,t){this._register(Zr(e,Ma.MOUSE_LEAVE,i=>t(new to(Fr(e),i))))}onkeydown(e,t){this._register(Zr(e,Ma.KEY_DOWN,e=>t(new Xs(e))))}onkeyup(e,t){this._register(Zr(e,Ma.KEY_UP,e=>t(new Xs(e))))}oninput(e,t){this._register(Zr(e,Ma.INPUT,t))}onblur(e,t){this._register(Zr(e,Ma.BLUR,t))}onfocus(e,t){this._register(Zr(e,Ma.FOCUS,t))}ignoreGesture(e){return Vb.ignoreTarget(e)}}class zb extends Hb{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Ml.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Uf),this._register(Qr(this.bgDomNode,Ma.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(Qr(this.domNode,Ma.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new ta),this._pointerdownScheduleRepeatTimer=this._register(new uo)}_arrowPointerDown(e){if(!(e.target&&e.target instanceof Element))return;this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Fr(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Kb extends st{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new uo)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||this._rawShouldBeVisible)}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;null===(e=this._domNode)||void 0===e||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,null===(t=this._domNode)||void 0===t||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}class Ub extends Hb{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Kb(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Uf),this._shouldRender=!0,this.domNode=ll(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Zr(this.domNode.domNode,Ma.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){const t=this._register(new zb(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=ll(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Zr(this.slider.domNode,Ma.POINTER_DOWN,e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);i<=s&&s<=n?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)t=e.offsetX,i=e.offsetY;else{const n=aa(this.domNode.domNode);t=e.pageX-n.left,i=e.pageY-n.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!(e.target&&e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{const s=this._sliderOrthogonalPointerPosition(e),o=Math.abs(s-i);if(K.n&&o>140)return void this._setDesiredScrollPositionNow(n.getScrollPosition());const r=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(r))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}class jb{constructor(e,t,i,n,s,o){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new jb(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,s){const o=Math.max(0,i-e),r=Math.max(0,o-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*r/n))),h=(r-l)/(n-i),d=s*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:h,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=jb._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}class qb extends Ub{constructor(e,t,i){const n=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new jb(t.horizontalHasArrows?t.arrowSize:0,2===t.horizontal?0:t.horizontalScrollbarSize,2===t.vertical?0:t.verticalScrollbarSize,n.width,n.scrollWidth,s.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const e=(t.arrowSize-11)/2,i=(t.horizontalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:Di.scrollbarButtonLeft,top:i,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new io(null,1,0))}),this._createArrow({className:"scra",icon:Di.scrollbarButtonRight,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new io(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class $b extends Ub{constructor(e,t,i){const n=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new jb(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-11)/2,i=(t.verticalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:Di.scrollbarButtonUp,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new io(null,0,1))}),this._createArrow({className:"scra",icon:Di.scrollbarButtonDown,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new io(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class Gb{constructor(e,t,i,n,s,o,r){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,n|=0,s|=0,o|=0,r|=0),this.rawScrollLeft=n,this.rawScrollTop=r,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),s<0&&(s=0),r+s>o&&(r=o-s),r<0&&(r=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=s,this.scrollHeight=o,this.scrollTop=r}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new Gb(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new Gb(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,s=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:s,heightChanged:o,scrollHeightChanged:r,scrollTopChanged:a}}}class Zb extends st{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ft),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Gb(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const n=this._state.withScrollDimensions(e,t);this._setState(n,Boolean(this._smoothScrolling)),null===(i=this._smoothScrolling)||void 0===i||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;n=t?new Xb(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=Xb.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return Boolean(this._smoothScrolling)}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class Yb{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function Qb(e,t){const i=t-e;return function(t){return e+i*(1-function(e){return Math.pow(e,3)}(1-t))}}class Xb{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,a;return e<t?(r=e+.75*i,a=t-.75*i):(r=e-.75*i,a=t+.75*i),n=Qb(e,r),s=Qb(a,t),o=.33,function(e){return e<o?n(e/o):s((e-o)/(1-o))}}var n,s,o;return Qb(e,t)}dispose(){null!==this.animationFrameDisposable&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const e=this.scrollLeft(t),i=this.scrollTop(t);return new Yb(e,i,!1)}return new Yb(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return Xb.start(e,t,i)}static start(e,t,i){i+=10;const n=Date.now()-10;return new Xb(e,t,n,i)}}i("YqZz");class Jb{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class eC{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,i=1,n=this._rear;for(;;){const s=n===this._front?e:Math.pow(2,-i);if(e-=s,t+=this._memory[n].score*s,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}return t<=.5}acceptStandardWheelEvent(e){if(Ws){const t=function(e){return Os.INSTANCE.getZoomFactor(e)}(Fr(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){const n=new Jb(e,t,i);n.score=this._computeScore(n),-1===this._front&&-1===this._rear?(this._memory[0]=n,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5;-1===this._front&&-1===this._rear||this._memory[this._rear];return this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}eC.INSTANCE=new eC;class tC extends Hb{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new ft),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ft),e.style.overflow="hidden",this._options=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,K.i&&(t.className+=" mac");return t}(t),this._scrollable=i,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));const n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new $b(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new qb(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ll(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ll(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ll(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new uo),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=et(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,K.i&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new io(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=et(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new io(e))};this._mouseWheelToDispose.push(Zr(this._listenOnDomNode,Ma.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){var t;if(null===(t=e.browserEvent)||void 0===t?void 0:t.defaultPrevented)return;const i=eC.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let t=e.deltaY*this._options.mouseWheelScrollSensitivity,s=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&s+t===0?s=t=0:Math.abs(t)>=Math.abs(s)?s=0:t=0),this._options.flipAxes&&([t,s]=[s,t]);const o=!K.i&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!o||s||(s=t,t=0),e.browserEvent&&e.browserEvent.altKey&&(s*=this._options.fastScrollSensitivity,t*=this._options.fastScrollSensitivity);const r=this._scrollable.getFutureScrollPosition();let a={};if(t){const e=50*t,i=r.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,i)}if(s){const e=50*s,t=r.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}if(a=this._scrollable.validateScrollPosition(a),r.scrollLeft!==a.scrollLeft||r.scrollTop!==a.scrollTop){this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),n=!0}}let s=n;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",s=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName("shadow"+n),this._topShadowDomNode.setClassName("shadow"+s),this._topLeftShadowDomNode.setClassName(`shadow${o}${s}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet(()=>this._hide(),500)}}class iC extends tC{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new Zb({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>ea(Fr(e),t)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class nC extends tC{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class sC extends tC{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new Zb({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>ea(Fr(e),t)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}class oC extends Jv{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Rb(this._context,i),this._mouseDownOperation=this._register(new rC(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(e,t)=>this._createMouseTarget(e,t),e=>this._getMouseColumn(e))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(144).height;const n=new $v(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,e=>this._onContextMenu(e,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=Zr(this.viewHelper.viewDomNode.ownerDocument,"mousemove",e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new qv(e,!1,this.viewHelper.viewDomNode))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e)));let s=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>{s=t})),this._register(Zr(this.viewHelper.viewDomNode,Ma.POINTER_UP,e=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,e=>this._onMouseDown(e,s))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=eC.INSTANCE;let t=0,i=ul.getZoomLevel(),n=!1,s=0;function o(e){return K.i?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}this._register(Zr(this.viewHelper.viewDomNode,Ma.MOUSE_WHEEL,r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(76))return;const a=new io(r);if(e.acceptStandardWheelEvent(a),e.isPhysicalMouseWheel()){if(o(r)){const e=ul.getZoomLevel(),t=a.deltaY>0?1:-1;ul.setZoomLevel(e+t),a.preventDefault(),a.stopPropagation()}}else Date.now()-t>50&&(i=ul.getZoomLevel(),n=o(r),s=0),t=Date.now(),s+=a.deltaY,n&&(ul.setZoomLevel(i+s/5),a.preventDefault(),a.stopPropagation())},{capture:!0,passive:!1}))}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(144)){const e=this._context.configuration.options.get(144).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const i=new Hv(e,t).toPageCoordinates(Fr(this.viewHelper.viewDomNode)),n=Uv(this.viewHelper.viewDomNode);if(i.y<n.y||i.y>n.y+n.height||i.x<n.x||i.x>n.x+n.width)return null;const s=jv(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,s,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=_a(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find(e=>this.viewHelper.viewDomNode.contains(e)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){if(this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive())return;e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=(new Date).getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){const i=this._createMouseTarget(e,!0),n=6===i.type||7===i.type,s=2===i.type||3===i.type||4===i.type,o=3===i.type,r=this._context.configuration.options.get(109),a=8===i.type||5===i.type,l=9===i.type;let h=e.leftButton||e.middleButton;K.i&&e.leftButton&&e.ctrlKey&&(h=!1);const d=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(h&&(n||o&&r))d(),this._mouseDownOperation.start(i.type,e,t);else if(s)e.preventDefault();else if(a){const n=i.detail;h&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(d(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class rC extends st{constructor(e,t,i,n,s,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=s,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new Zv(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new aC(this._context,this._viewHelper,this._mouseTargetFactory,(e,t,i)=>this._dispatchMouse(e,t,i))),this._mouseState=new hC,this._currentSelection=new yi(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):13!==t.type||"above"!==t.outsidePosition&&"below"!==t.outsidePosition?(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)):this._topBottomDragScrolling.start(t,e))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const s=this._context.configuration.options;if(!s.get(91)&&s.get(35)&&!s.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,e=>this._onMouseDownThenMove(e),e=>{const t=this._findMousePosition(this._lastMouseEvent,!1);Ta(e)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,s=this._getMouseColumn(e);if(e.posy<t.y){const i=t.y-e.posy,o=Math.max(n.getCurrentScrollTop()-i,0),r=Tb.getZoneAtCoord(this._context,o);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return Nb.createOutsideEditor(s,e,"above",i)}const a=n.getLineNumberAtVerticalOffset(o);return Nb.createOutsideEditor(s,new Ci(a,1),"above",i)}if(e.posy>t.y+t.height){const o=e.posy-t.y-t.height,r=n.getCurrentScrollTop()+e.relativePos.y,a=Tb.getZoneAtCoord(this._context,r);if(a){const e=this._helpPositionJumpOverViewZone(a);if(e)return Nb.createOutsideEditor(s,e,"below",o)}const l=n.getLineNumberAtVerticalOffset(r);return Nb.createOutsideEditor(s,new Ci(l,i.getLineMaxColumn(l)),"below",o)}const o=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posx<t.x){const i=t.x-e.posx;return Nb.createOutsideEditor(s,new Ci(o,1),"left",i)}if(e.posx>t.x+t.width){const n=e.posx-t.x-t.width;return Nb.createOutsideEditor(s,new Ci(o,i.getLineMaxColumn(o)),"right",n)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return Nb.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new Ci(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:6===e.type&&null!==e.detail.injectedText})}}class aC extends st{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new lC(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class lC extends st{constructor(e,t,i,n,s,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=s,this._mouseEvent=o,this._lastTime=Date.now(),this._animationFrameDisposable=ea(Fr(o.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(67),t=this._context.configuration.options.get(144).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(67),t=this._getScrollSpeed()*(this._tick()/1e3)*e,i="above"===this._position.outsidePosition?-t:t;this._context.viewModel.viewLayout.deltaScrollNow(0,i),this._viewHelper.renderNow();const n=this._context.viewLayout.getLinesViewportData(),s="above"===this._position.outsidePosition?n.startLineNumber:n.endLineNumber;let o;{const e=Uv(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(144).horizontalScrollbarHeight,i=new Vv(this._mouseEvent.pos.x,e.y+e.height-t-.1),n=jv(this._viewHelper.viewDomNode,e,i);o=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,i,n,null)}o.position&&o.position.lineNumber===s||(o="above"===this._position.outsidePosition?Nb.createOutsideEditor(this._position.mouseColumn,new Ci(s,1),"above",this._position.outsideDistance):Nb.createOutsideEditor(this._position.mouseColumn,new Ci(s,this._context.viewModel.getLineMaxColumn(s)),"below",this._position.outsideDistance)),this._dispatchMouse(o,!0,2),this._animationFrameDisposable=ea(Fr(o.element),()=>this._execute())}}class hC{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=(new Date).getTime();i-this._lastSetMouseDownCountTime>hC.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}hC.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class dC{get event(){return this.emitter.event}constructor(e,t,i){const n=e=>this.emitter.fire(e);this.emitter=new ft({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}class cC{constructor(e,t,i,n,s){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=s}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),s=e.getSelectionEnd();let o=void 0;if(t){i.substring(0,n)===t.value.substring(0,t.selectionStart)&&(o=t.newlineCountBeforeSelection)}return new cC(i,n,s,null,o)}collapseSelection(){return this.selectionStart===this.value.length?this:new cC(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,n,s,o,r,a,l;if(e<=this.selectionStart){const n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(null!==(i=null===(t=this.selection)||void 0===t?void 0:t.getStartPosition())&&void 0!==i?i:null,n,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(null!==(s=null===(n=this.selection)||void 0===n?void 0:n.getEndPosition())&&void 0!==s?s:null,t,1)}const h=this.value.substring(this.selectionStart,e);if(-1===h.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(null!==(r=null===(o=this.selection)||void 0===o?void 0:o.getStartPosition())&&void 0!==r?r:null,h,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(null!==(l=null===(a=this.selection)||void 0===a?void 0:a.getEndPosition())&&void 0!==l?l:null,d,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,s=-1;for(;-1!==(s=t.indexOf("\n",s+1));)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(as(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(ls(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd),o=(e.value.substring(n,e.value.length-s),t.value.substring(n,t.value.length-s)),r=e.selectionStart-n,a=e.selectionEnd-n,l=t.selectionStart-n,h=t.selectionEnd-n;if(l===h){const t=e.selectionStart-n;return{text:o,replacePrevCharCnt:t,replaceNextCharCnt:0,positionDelta:0}}return{text:o,replacePrevCharCnt:a-r,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(as(e.value,t.value),e.selectionEnd),n=Math.min(ls(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),o=t.value.substring(i,t.value.length-n),r=(e.selectionStart,e.selectionEnd-i),a=(t.selectionStart,t.selectionEnd-i);return{text:o,replacePrevCharCnt:r,replaceNextCharCnt:s.length-r,positionDelta:a-o.length}}}cC.EMPTY=new cC("",0,0,null,void 0);class uC{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t;return new wi(i+1,1,i+t+1,1)}static fromEditorSelection(e,t,i,n){const s=uC._getPageOfLine(t.startLineNumber,i),o=uC._getRangeForPage(s,i),r=uC._getPageOfLine(t.endLineNumber,i),a=uC._getRangeForPage(r,i);let l=o.intersectRanges(new wi(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(l,1)>500){const t=e.modifyPosition(l.getEndPosition(),-500);l=wi.fromPositions(t,l.getEndPosition())}const h=e.getValueInRange(l,1),d=e.getLineCount(),c=e.getLineMaxColumn(d);let u=a.intersectRanges(new wi(t.endLineNumber,t.endColumn,d,c));if(n&&e.getValueLengthInRange(u,1)>500){const t=e.modifyPosition(u.getStartPosition(),500);u=wi.fromPositions(u.getStartPosition(),t)}const g=e.getValueInRange(u,1);let m;if(s===r||s+1===r)m=e.getValueInRange(t,1);else{const i=o.intersectRanges(t),n=a.intersectRanges(t);m=e.getValueInRange(i,1)+String.fromCharCode(8230)+e.getValueInRange(n,1)}return n&&m.length>1e3&&(m=m.substring(0,500)+String.fromCharCode(8230)+m.substring(m.length-500,m.length)),new cC(h+m+g,h.length,h.length+m.length,t,l.endLineNumber-l.startLineNumber)}}var gC,mC=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},fC=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.Tap="-monaco-textarea-synthetic-tap"}(gC||(gC={}));const pC=!1;class _C{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}_C.INSTANCE=new _C;class vC{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let bC=class extends st{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,s,o){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=s,this._logService=o,this._onFocus=this._register(new ft),this.onFocus=this._onFocus.event,this._onBlur=this._register(new ft),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new ft),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new ft),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new ft),this.onCut=this._onCut.event,this._onPaste=this._register(new ft),this.onPaste=this._onPaste.event,this._onType=this._register(new ft),this.onType=this._onType.event,this._onCompositionStart=this._register(new ft),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new ft),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new ft),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new ft),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new ot),this._asyncTriggerCut=this._register(new mo(()=>this._onCut.fire(),0)),this._textAreaState=cC.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(dt.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new mo(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let r=null;this._register(this._textArea.onKeyDown(e=>{const t=new Xs(e);(114===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),r=t,this._onKeyDown.fire(t)})),this._register(this._textArea.onKeyUp(e=>{const t=new Xs(e);this._onKeyUp.fire(t)})),this._register(this._textArea.onCompositionStart(e=>{const t=new vC;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&r&&r.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===r.code||"ArrowLeft"===r.code))return t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}})),this._register(this._textArea.onCompositionUpdate(e=>{const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=cC.readFromTextArea(this._textArea,this._textAreaState),i=cC.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const i=t.handleCompositionUpdate(e.data);this._textAreaState=cC.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionUpdate.fire(e)})),this._register(this._textArea.onCompositionEnd(e=>{const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=cC.readFromTextArea(this._textArea,this._textAreaState),t=cC.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const i=t.handleCompositionUpdate(e.data);this._textAreaState=cC.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=cC.readFromTextArea(this._textArea,this._textAreaState),i=cC.deduceInput(this._textAreaState,t,2===this._OS);(0!==i.replacePrevCharCnt||1!==i.text.length||!hs(i.text.charCodeAt(0))&&127!==i.text.charCodeAt(0))&&(this._textAreaState=t,""===i.text&&0===i.replacePrevCharCnt&&0===i.replaceNextCharCnt&&0===i.positionDelta||this._onType.fire(i))})),this._register(this._textArea.onCut(e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(e=>{this._ensureClipboardGetsEditorSelection(e)})),this._register(this._textArea.onPaste(e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=CC.getTextData(e.clipboardData);t&&(i=i||_C.INSTANCE.get(t),this._onPaste.fire({text:t,metadata:i}))})),this._register(this._textArea.onFocus(()=>{const e=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!e&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new mo(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return Zr(this._textArea.ownerDocument,"selectionchange",t=>{if(Kf.onSelectionChange(),!this._hasFocus)return;if(this._currentComposition)return;if(!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const s=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),s<100)return;if(!this._textAreaState.selection)return;const o=this._textArea.getValue();if(this._textAreaState.value!==o)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),h=this._host.deduceModelPosition(l[0],l[1],l[2]),d=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(d[0],d[1],d[2]),u=new yi(h.lineNumber,h.column,c.lineNumber,c.column);this._onSelectionChangeRequest.fire(u)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&"render"===e||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};_C.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,i),e.preventDefault(),e.clipboardData&&CC.setTextData(e.clipboardData,t.text,t.html,i)}};bC=mC([fC(4,Af),fC(5,Kh)],bC);const CC={getTextData(e){const t=e.getData(lc.text);let i=null;const n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(e){}if(0===t.length&&null===i&&e.files.length>0){return[Array.prototype.slice.call(e.files,0).map(e=>e.name).join("\n"),null]}return[t,i]},setTextData(e,t,i,n){e.setData(lc.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}};class wC extends st{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new dC(this._actual,"keydown")).event,this.onKeyUp=this._register(new dC(this._actual,"keyup")).event,this.onCompositionStart=this._register(new dC(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new dC(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new dC(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new dC(this._actual,"beforeinput")).event,this.onInput=this._register(new dC(this._actual,"input")).event,this.onCut=this._register(new dC(this._actual,"cut")).event,this.onCopy=this._register(new dC(this._actual,"copy")).event,this.onPaste=this._register(new dC(this._actual,"paste")).event,this.onFocus=this._register(new dC(this._actual,"focus")).event,this.onBlur=this._register(new dC(this._actual,"blur")).event,this._onSyntheticTap=this._register(new ft),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Kf.onKeyDown())),this._register(this.onBeforeInput(()=>Kf.onBeforeInput())),this._register(this.onInput(()=>Kf.onInput())),this._register(this.onKeyUp(()=>Kf.onKeyUp())),this._register(Zr(this._actual,gC.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=_a(this._actual);return e?e.activeElement===this._actual:!!this._actual.isConnected&&va()===this._actual}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let s=null;const o=_a(n);s=o?o.activeElement:va();const r=Fr(s),a=s===n,l=n.selectionStart,h=n.selectionEnd;if(a&&l===t&&h===i)Fs&&r.parent!==r&&n.focus();else{if(a)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(Fs&&r.parent!==r&&n.focus());try{const e=function(e){const t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}(n,e)}catch(e){}}}}class yC extends oC{constructor(e,t,i){super(e,t,i),this._register(Vb.addTarget(this.viewHelper.linesContentDomNode)),this._register(Zr(this.viewHelper.linesContentDomNode,Bb.Tap,e=>this.onTap(e))),this._register(Zr(this.viewHelper.linesContentDomNode,Bb.Change,e=>this.onChange(e))),this._register(Zr(this.viewHelper.linesContentDomNode,Bb.Contextmenu,e=>this._onContextMenu(new qv(e,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(Zr(this.viewHelper.linesContentDomNode,"pointerdown",e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"}));const n=new Gv(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,e=>this._onMouseMove(e))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>this._onMouseDown(e,t)))}onTap(e){e.initialTarget&&this.viewHelper.linesContentDomNode.contains(e.initialTarget)&&(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),"pen"===this._lastPointerType&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new qv(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===i.type&&null!==i.detail.injectedText})}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}}class SC extends oC{constructor(e,t,i){super(e,t,i),this._register(Vb.addTarget(this.viewHelper.linesContentDomNode)),this._register(Zr(this.viewHelper.linesContentDomNode,Bb.Tap,e=>this.onTap(e))),this._register(Zr(this.viewHelper.linesContentDomNode,Bb.Change,e=>this.onChange(e))),this._register(Zr(this.viewHelper.linesContentDomNode,Bb.Contextmenu,e=>this._onContextMenu(new qv(e,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new qv(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(gC.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class LC extends st{constructor(e,t,i){super();(K.f||K.b&&K.j)&&Us?this.handler=this._register(new yC(e,t,i)):Pn.TouchEvent?this.handler=this._register(new SC(e,t,i)):this.handler=this._register(new oC(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}i("1AXR"),i("WFsp");class kC extends Jv{}const DC=wl("themeService");function xC(e){return{id:e}}function EC(e){switch(e){case hb.DARK:return"vs-dark";case hb.HIGH_CONTRAST_DARK:return"hc-black";case hb.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const NC="base.contributions.theming";const IC=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new ft}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),it(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}};function TC(e){return IC.onColorThemeChange(e)}Eh.add(NC,IC);class MC extends st{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(e=>this.onThemeChange(e)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const AC=Zf("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("lineHighlight","Background color for the highlight of line at the cursor position.")),OC=Zf("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Jf},J.b("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),RC=(Zf("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},J.b("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:ep,hcLight:ep},J.b("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),Zf("editor.symbolHighlightBackground",{dark:h_,light:h_,hcDark:null,hcLight:null},J.b("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:ep,hcLight:ep},J.b("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0),Zf("editorCursor.foreground",{dark:"#AEAFAD",light:Ug.black,hcDark:Ug.white,hcLight:"#0F4A85"},J.b("caret","Color of the editor cursor."))),PC=Zf("editorCursor.background",null,J.b("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),FC=Zf("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},J.b("editorWhitespaces","Color of whitespace characters in the editor.")),BC=Zf("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:Ug.white,hcLight:"#292929"},J.b("editorLineNumbers","Color of editor line numbers.")),WC=Zf("editorIndentGuide.background",{dark:FC,light:FC,hcDark:FC,hcLight:FC},J.b("editorIndentGuides","Color of the editor indentation guides."),!1,J.b("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),VC=Zf("editorIndentGuide.activeBackground",{dark:FC,light:FC,hcDark:FC,hcLight:FC},J.b("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,J.b("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),HC=Zf("editorIndentGuide.background1",{dark:WC,light:WC,hcDark:WC,hcLight:WC},J.b("editorIndentGuides1","Color of the editor indentation guides (1).")),zC=Zf("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorIndentGuides2","Color of the editor indentation guides (2).")),KC=Zf("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorIndentGuides3","Color of the editor indentation guides (3).")),UC=Zf("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorIndentGuides4","Color of the editor indentation guides (4).")),jC=Zf("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorIndentGuides5","Color of the editor indentation guides (5).")),qC=Zf("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorIndentGuides6","Color of the editor indentation guides (6).")),$C=Zf("editorIndentGuide.activeBackground1",{dark:VC,light:VC,hcDark:VC,hcLight:VC},J.b("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),GC=Zf("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),ZC=Zf("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),YC=Zf("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),QC=Zf("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),XC=Zf("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),JC=Zf("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:ep,hcLight:ep},J.b("editorActiveLineNumber","Color of editor active line number"),!1,J.b("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),ew=(Zf("editorLineNumber.activeForeground",{dark:JC,light:JC,hcDark:JC,hcLight:JC},J.b("editorActiveLineNumber","Color of editor active line number")),Zf("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},J.b("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."))),tw=(Zf("editorRuler.foreground",{dark:"#5A5A5A",light:Ug.lightgrey,hcDark:Ug.white,hcLight:"#292929"},J.b("editorRuler","Color of the editor rulers.")),Zf("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},J.b("editorCodeLensForeground","Foreground color of editor CodeLens")),Zf("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},J.b("editorBracketMatchBackground","Background color behind matching brackets")),Zf("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Jf,hcLight:Jf},J.b("editorBracketMatchBorder","Color for matching brackets boxes")),Zf("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},J.b("editorOverviewRulerBorder","Color of the overview ruler border."))),iw=Zf("editorOverviewRuler.background",null,J.b("editorOverviewRulerBackground","Background color of the editor overview ruler.")),nw=(Zf("editorGutter.background",{dark:jp,light:jp,hcDark:jp,hcLight:jp},J.b("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),Zf("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:Ug.fromHex("#fff").transparent(.8),hcLight:Jf},J.b("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),Zf("editorUnnecessaryCode.opacity",{dark:Ug.fromHex("#000a"),light:Ug.fromHex("#0007"),hcDark:null,hcLight:null},J.b("unnecessaryCodeOpacity","Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out."))),sw=(Zf("editorGhostText.border",{dark:null,light:null,hcDark:Ug.fromHex("#fff").transparent(.8),hcLight:Ug.fromHex("#292929").transparent(.8)},J.b("editorGhostTextBorder","Border color of ghost text in the editor.")),Zf("editorGhostText.foreground",{dark:Ug.fromHex("#ffffff56"),light:Ug.fromHex("#0007"),hcDark:null,hcLight:null},J.b("editorGhostTextForeground","Foreground color of the ghost text in the editor.")),Zf("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},J.b("editorGhostTextBackground","Background color of the ghost text in the editor.")),new Ug(new Hg(0,122,204,.6))),ow=(Zf("editorOverviewRuler.rangeHighlightForeground",{dark:sw,light:sw,hcDark:sw,hcLight:sw},J.b("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Zf("editorOverviewRuler.errorForeground",{dark:new Ug(new Hg(255,18,18,.7)),light:new Ug(new Hg(255,18,18,.7)),hcDark:new Ug(new Hg(255,50,50,1)),hcLight:"#B5200D"},J.b("overviewRuleError","Overview ruler marker color for errors."))),rw=Zf("editorOverviewRuler.warningForeground",{dark:Vp,light:Vp,hcDark:Hp,hcLight:Hp},J.b("overviewRuleWarning","Overview ruler marker color for warnings.")),aw=Zf("editorOverviewRuler.infoForeground",{dark:zp,light:zp,hcDark:Kp,hcLight:Kp},J.b("overviewRuleInfo","Overview ruler marker color for infos.")),lw=Zf("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},J.b("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),hw=Zf("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},J.b("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),dw=Zf("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},J.b("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),cw=Zf("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),uw=Zf("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),gw=Zf("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),mw=Zf("editorBracketHighlight.unexpectedBracket.foreground",{dark:new Ug(new Hg(255,18,18,.8)),light:new Ug(new Hg(255,18,18,.8)),hcDark:new Ug(new Hg(255,50,50,1)),hcLight:""},J.b("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),fw=Zf("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),pw=Zf("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),_w=Zf("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),vw=Zf("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),bw=Zf("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Cw=Zf("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),ww=Zf("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),yw=Zf("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Sw=Zf("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Lw=Zf("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),kw=Zf("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Dw=Zf("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},J.b("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));Zf("editorUnicodeHighlight.border",{dark:Vp,light:Vp,hcDark:Vp,hcLight:Vp},J.b("editorUnicodeHighlight.border","Border color used to highlight unicode characters.")),Zf("editorUnicodeHighlight.background",{dark:Wp,light:Wp,hcDark:Wp,hcLight:Wp},J.b("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));TC((e,t)=>{const i=e.getColor(jp),n=e.getColor(AC),s=n&&!n.isTransparent()?n:i;s&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});class xw extends kC{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new Ci(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(67);const t=e.get(68);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(95);const i=e.get(144);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Ci(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?'<span class="relative-current-line-number">'+i+"</span>":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=K.g?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,s=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(e=>!!e.options.lineNumberClassName);s.sort((e,t)=>wi.compareRangesUsingEnds(e.range,t.range));let o=0;const r=this._context.viewModel.getLineCount(),a=[];for(let e=i;e<=n;e++){const n=e-i;let l=this._getLineRenderLineNumber(e),h="";for(;o<s.length&&s[o].range.endLineNumber<e;)o++;for(let t=o;t<s.length;t++){const{range:i,options:n}=s[t];i.startLineNumber<=e&&(h+=" "+n.lineNumberClassName)}l||h?(e===r&&0===this._context.viewModel.getLineLength(e)&&("off"===this._renderFinalNewline&&(l=""),"dimmed"===this._renderFinalNewline&&(h+=" dimmed-line-number")),e===this._activeLineNumber&&(h+=" active-line-number"),a[n]=`<div class="${xw.CLASS_NAME}${t}${h}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${l}</div>`):a[n]=""}this._renderResult=a}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}xw.CLASS_NAME="line-numbers",TC((e,t)=>{const i=e.getColor(BC),n=e.getColor(ew);n?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):i&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i.transparent(.4)}; }`)});i("91zm");class Ew extends eb{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(144);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=ll(document.createElement("div")),this._domNode.setClassName(Ew.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ll(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Ew.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(144);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}Ew.CLASS_NAME="glyph-margin",Ew.OUTER_CLASS_NAME="margin";i("iFQ5");const Nw=new class{constructor(){this._onDidChange=new ft,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}},Iw=wl("keybindingService");var Tw=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Mw=function(e,t){return function(i,n){t(i,n,e)}};class Aw{constructor(e,t,i,n,s){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=s,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new Ci(this.modelLineNumber,this.distanceToModelLineStart+1),i=new Ci(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const Ow=Fs;let Rw=class extends eb{constructor(e,t,i,n,s){super(e),this._keybindingService=n,this._instantiationService=s,this._primaryCursorPosition=new Ci(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,r=o.get(144);this._setAccessibilityOptions(o),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=o.get(50),this._lineHeight=o.get(67),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new yi(1,1,1,1)],this._modelSelections=[new yi(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ll(document.createElement("textarea")),tb.write(this.textArea,7),this.textArea.setClassName("inputarea monaco-mouse-cursor-text"),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=a*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(o)),this.textArea.setAttribute("aria-required",o.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.get(124))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",J.b("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(91)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ll(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:e=>this._context.viewModel.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.viewModel.getValueInRange(e,t),getValueLengthInRange:(e,t)=>this._context.viewModel.getValueLengthInRange(e,t),modifyPosition:(e,t)=>this._context.viewModel.modifyPosition(e,t)},h={getDataToCopy:()=>{const e=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,K.n),t=this._context.viewModel.model.getEOL(),i=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),n=Array.isArray(e)?e:null,s=Array.isArray(e)?e.join(t):e;let o=void 0,r=null;if(pC||this._copyWithSyntaxHighlighting&&s.length<65536){const e=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(o=e.html,r=e.mode)}return{isFromEmptySelection:i,multicursorText:n,text:s,html:o,mode:r}},getScreenReaderContent:()=>{if(1===this._accessibilitySupport){const e=this._selections[0];if(K.i&&e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new cC(i,i.length,i.length,wi.fromPositions(t),0)}const t=500;if(K.i&&!e.isEmpty()&&l.getValueLengthInRange(e,0)<t){const t=l.getValueInRange(e,0);return new cC(t,0,t.length,e,0)}if(Vs&&!e.isEmpty()){const e="vscode-placeholder";return new cC(e,0,e.length,null,void 0)}return cC.EMPTY}if(zs){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new cC(i,n,n,wi.fromPositions(t),0)}return cC.EMPTY}return uC.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},d=this._register(new wC(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(bC,h,d,K.a,{isAndroid:zs,isChrome:Ws,isFirefox:Fs,isSafari:Vs})),this._register(this._textAreaInput.onKeyDown(e=>{this._viewController.emitKeyDown(e)})),this._register(this._textAreaInput.onKeyUp(e=>{this._viewController.emitKeyUp(e)})),this._register(this._textAreaInput.onPaste(e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(e=>{this._viewController.setSelection(e)})),this._register(this._textAreaInput.onCompositionStart(e=>{const t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:s}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),s=e.substring(n+1),o=s.lastIndexOf("\t"),r=s.length-o-1,a=i.getStartPosition(),l=Math.min(a.column-1,r),h=a.column-1-l,d=s.substring(0,s.length-l),{tabSize:c}=this._context.viewModel.model.getOptions();return{distanceToModelLineStart:h,widthOfHiddenTextBefore:function(e,t,i,n){if(0===t.length)return 0;const s=e.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const o=e.createElement("span");hl(o,i),o.style.whiteSpace="pre",o.style.tabSize=n*i.spaceWidth+"px",o.append(t),s.appendChild(o),e.body.appendChild(s);const r=o.offsetWidth;return e.body.removeChild(s),r}(this.textArea.domNode.ownerDocument,d,this._fontInfo,c)}})(),{distanceToModelLineEnd:o}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),s=-1===n?e:e.substring(0,n),o=s.indexOf("\t"),r=-1===o?s.length:s.length-o-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,r);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,wi.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Aw(this._context,i.startLineNumber,n,s,o),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName("inputarea monaco-mouse-cursor-text ime-input"),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName("inputarea monaco-mouse-cursor-text"),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(Nw.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=uu('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?');let n=!0,s=e.column,o=!0,r=e.column,a=0;for(;a<50&&(n||o);){if(n&&s<=1&&(n=!1),n){const e=t.charCodeAt(s-2);0!==i.get(e)?n=!1:s--}if(o&&r>t.length&&(o=!1),o){const e=t.charCodeAt(r-1);0!==i.get(e)?o=!1:r++}a++}return[t.substring(s-1,r-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=uu(this._context.configuration.options.get(130));let n=e.column,s=0;for(;n>1;){const o=t.charCodeAt(n-2);if(0!==i.get(o)||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!hs(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){var t,i,n;if(1===e.get(2)){const e=null===(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))||void 0===t?void 0:t.getAriaLabel(),s=null===(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))||void 0===i?void 0:i.getAriaLabel(),o=null===(n=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))||void 0===n?void 0:n.getAriaLabel(),r=J.b("accessibilityModeOff","The editor is not accessible at this time.");return e?J.b("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",r,e):s?J.b("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,s):o?J.b("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",r,o):r}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===Pe.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const i=e.get(144).wrappingColumn;if(-1!==i&&1!==this._accessibilitySupport){const t=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(i*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=Ow?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(144);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(67),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=n*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(124))),(e.hasChanged(34)||e.hasChanged(91))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!Nw.enabled||e.get(34)&&e.get(91)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new Ci(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),null===(t=this._visibleTextArea)||void 0===t||t.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const s=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,o=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let r=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(a<this._contentLeft){const e=this._contentLeft-a;a+=e,r+=e,l-=e}l>this._contentWidth&&(l=this._contentWidth);const h=this._context.viewModel.getViewLineData(i.lineNumber),d=h.tokens.findTokenIndexAtOffset(i.column-1),c=d===h.tokens.findTokenIndexAtOffset(n.column-1),u=this._visibleTextArea.definePresentation(c?h.tokens.getPresentation(d):null);this.textArea.domNode.scrollTop=o*this._lineHeight,this.textArea.domNode.scrollLeft=r,this._doRender({lastRenderPosition:null,top:s,left:a,width:l,height:this._lineHeight,useCover:!1,color:(zi.getColorMap()||[])[u.foreground],italic:u.italic,bold:u.bold,underline:u.underline,strikethrough:u.strikethrough})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(t<this._contentLeft||t>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight)this._renderAtTopLeft();else if(K.i||2===this._accessibilitySupport){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const n=null!==(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)&&void 0!==e?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=n*this._lineHeight}else this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:Ow?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;for(;;){if(i=e.indexOf("\n",i+1),-1===i)break;t++}return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:Ow?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;hl(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?Ug.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(57)?i.setClassName("monaco-editor-background textAreaCover "+Ew.OUTER_CLASS_NAME):0!==n.get(68).renderType?i.setClassName("monaco-editor-background textAreaCover "+xw.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};function Pw(e,t,i){let n=Zn(e);return-1===n&&(n=e.length),function(e,t,i){let n=0;for(let i=0;i<e.length;i++)"\t"===e.charAt(i)?n=Sb.nextIndentTabStop(n,t):n++;let s="";if(!i){const e=Math.floor(n/t);n%=t;for(let t=0;t<e;t++)s+="\t"}for(let e=0;e<n;e++)s+=" ";return s}(e.substring(0,n),t,i)+e.substring(n)}Rw=Tw([Mw(3,Iw),Mw(4,bl)],Rw);const Fw=()=>!0,Bw=()=>!1,Ww=e=>" "===e||"\t"===e;class Vw{static shouldRecreate(e){return e.hasChanged(144)||e.hasChanged(130)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(128)||e.hasChanged(50)||e.hasChanged(91)}constructor(e,t,i,n){var s;this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,r=o.get(144),a=o.get(50);this.readOnly=o.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(116),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=o.get(128),this.wordSeparators=o.get(130),this.emptySelectionClipboard=o.get(37),this.copyWithSyntaxHighlighting=o.get(25),this.multiCursorMergeOverlapping=o.get(77),this.multiCursorPaste=o.get(79),this.multiCursorLimit=o.get(80),this.autoClosingBrackets=o.get(6),this.autoClosingComments=o.get(7),this.autoClosingQuotes=o.get(11),this.autoClosingDelete=o.get(9),this.autoClosingOvertype=o.get(10),this.autoSurround=o.get(14),this.autoIndent=o.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const l=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(l)for(const e of l)this.surroundingPairs[e.open]=e.close;const h=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=null!==(s=null==h?void 0:h.blockCommentStartToken)&&void 0!==s?s:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=null===(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)||void 0===e?void 0:e.getElectricCharacters();if(t)for(const e of t)this._electricChars[e]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=xd(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return s?s.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return Pw(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return Ww;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return Fw;case"never":return Bw}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>-1!==i.indexOf(e)}visibleColumnFromColumn(e,t){return Sb.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=Sb.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),s=e.getLineMinColumn(t);if(n<s)return s;const o=e.getLineMaxColumn(t);return n>o?o:n}}class Hw{static fromModelState(e){return new zw(e)}static fromViewState(e){return new Kw(e)}static fromModelSelection(e){const t=yi.liftSelection(e),i=new Uw(wi.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Hw.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}}class zw{constructor(e){this.modelState=e,this.viewState=null}}class Kw{constructor(e){this.modelState=null,this.viewState=e}}class Uw{constructor(e,t,i,n,s){this.selectionStart=e,this.selectionStartKind=t,this.selectionStartLeftoverVisibleColumns=i,this.position=n,this.leftoverVisibleColumns=s,this._singleCursorStateBrand=void 0,this.selection=Uw._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new Uw(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new Ci(t,i),n):new Uw(new wi(t,i,t,i),0,n,new Ci(t,i),n)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?yi.fromPositions(e.getStartPosition(),t):yi.fromPositions(e.getEndPosition(),t)}}class jw{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function qw(e){return"'"===e||'"'===e||"`"===e}class $w{static columnSelect(e,t,i,n,s,o){const r=Math.abs(s-i)+1,a=i>s,l=n>o,h=n<o,d=[];for(let s=0;s<r;s++){const r=i+(a?-s:s),c=e.columnFromVisibleColumn(t,r,n),u=e.columnFromVisibleColumn(t,r,o),g=e.visibleColumnFromColumn(t,new Ci(r,c)),m=e.visibleColumnFromColumn(t,new Ci(r,u));if(h){if(g>o)continue;if(m<n)continue}if(l){if(m>n)continue;if(g<o)continue}d.push(new Uw(new wi(r,c,r,c),0,0,new Ci(r,u),0))}if(0===d.length)for(let e=0;e<r;e++){const n=i+(a?-e:e),s=t.getLineMaxColumn(n);d.push(new Uw(new wi(n,s,n,s),0,0,new Ci(n,s),0))}return{viewStates:d,reversed:a,fromLineNumber:i,fromVisualColumn:n,toLineNumber:s,toVisualColumn:o}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,$w.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const s=Math.min(i.fromViewLineNumber,i.toViewLineNumber),o=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let i=s;i<=o;i++){const s=t.getLineMaxColumn(i),o=e.visibleColumnFromColumn(t,new Ci(i,s));n=Math.max(n,o)}let r=i.toViewVisualColumn;return r<n&&r++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,r)}static columnSelectUp(e,t,i,n){const s=n?e.pageSize:1,o=Math.max(1,i.toViewLineNumber-s);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,o,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){const s=n?e.pageSize:1,o=Math.min(t.getLineCount(),i.toViewLineNumber+s);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,o,i.toViewVisualColumn)}}class Gw{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return yi.fromPositions(i.getEndPosition())}}class Zw{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return yi.fromPositions(i.getStartPosition())}}class Yw{constructor(e,t,i,n,s=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=s}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return yi.fromPositions(i.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class Qw{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class Xw{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class Jw{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-ps(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new Ci(i,e.getLineMaxColumn(i))}return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),s=e.getLineContent(t.lineNumber),o=Lb.atomicPosition(s,t.column-1,i,0);if(-1!==o&&o+1>=n)return new Ci(t.lineNumber,o+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?Jw.leftPositionAtomicSoftTabs(t,i,e.tabSize):Jw.leftPosition(t,i);return new Xw(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,s){let o,r;if(i.hasSelection()&&!n)o=i.selection.startLineNumber,r=i.selection.startColumn;else{const n=i.position.delta(void 0,-(s-1)),a=t.normalizePosition(Jw.clipPositionColumn(n,t),0),l=Jw.left(e,t,a);o=l.lineNumber,r=l.column}return i.move(n,o,r,0)}static clipPositionColumn(e,t){return new Ci(e.lineNumber,Jw.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i+=fs(e.getLineContent(t),i-1):t<e.getLineCount()&&(t+=1,i=e.getLineMinColumn(t)),new Ci(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,s){if(i<e.getLineIndentColumn(t)){const s=e.getLineContent(t),o=Lb.atomicPosition(s,i-1,n,1);if(-1!==o)return new Ci(t,o+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const n=e.stickyTabStops?Jw.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):Jw.rightPosition(t,i.lineNumber,i.column);return new Xw(n.lineNumber,n.column,0)}static moveRight(e,t,i,n,s){let o,r;if(i.hasSelection()&&!n)o=i.selection.endLineNumber,r=i.selection.endColumn;else{const n=i.position.delta(void 0,s-1),a=t.normalizePosition(Jw.clipPositionColumn(n,t),1),l=Jw.right(e,t,a);o=l.lineNumber,r=l.column}return i.move(n,o,r,0)}static vertical(e,t,i,n,s,o,r,a){const l=Sb.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+s,h=t.getLineCount(),d=1===i&&1===n,c=i===h&&n===t.getLineMaxColumn(i),u=o<i?d:c;if((i=o)<1?(i=1,n=r?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):i>h?(i=h,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),s=u?0:l-Sb.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){const e=new Ci(i,n),o=t.normalizePosition(e,a);s+=n-o.column,i=o.lineNumber,n=o.column}return new Xw(i,n,s)}static down(e,t,i,n,s,o,r){return this.vertical(e,t,i,n,s,i+o,r,4)}static moveDown(e,t,i,n,s){let o,r;i.hasSelection()&&!n?(o=i.selection.endLineNumber,r=i.selection.endColumn):(o=i.position.lineNumber,r=i.position.column);let a,l=0;do{a=Jw.down(e,t,o+l,r,i.leftoverVisibleColumns,s,!0);if(t.normalizePosition(new Ci(a.lineNumber,a.column),2).lineNumber>o)break}while(l++<10&&o+l<t.getLineCount());return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){const n=i.selection,s=Jw.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),o=Jw.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new Uw(new wi(s.lineNumber,s.column,s.lineNumber,s.column),0,s.leftoverVisibleColumns,new Ci(o.lineNumber,o.column),o.leftoverVisibleColumns)}static up(e,t,i,n,s,o,r){return this.vertical(e,t,i,n,s,i-o,r,3)}static moveUp(e,t,i,n,s){let o,r;i.hasSelection()&&!n?(o=i.selection.startLineNumber,r=i.selection.startColumn):(o=i.position.lineNumber,r=i.position.column);const a=Jw.up(e,t,o,r,i.leftoverVisibleColumns,s,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){const n=i.selection,s=Jw.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),o=Jw.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new Uw(new wi(s.lineNumber,s.column,s.lineNumber,s.column),0,s.leftoverVisibleColumns,new Ci(o.lineNumber,o.column),o.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let s=i.position.lineNumber;for(;s>1&&this._isBlankLine(t,s);)s--;for(;s>1&&!this._isBlankLine(t,s);)s--;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToNextBlankLine(e,t,i,n){const s=t.getLineCount();let o=i.position.lineNumber;for(;o<s&&this._isBlankLine(t,o);)o++;for(;o<s&&!this._isBlankLine(t,o);)o++;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToBeginningOfLine(e,t,i,n){const s=i.position.lineNumber,o=t.getLineMinColumn(s),r=t.getLineFirstNonWhitespaceColumn(s)||o;let a;return a=i.position.column===r?o:r,i.move(n,s,a,0)}static moveToEndOfLine(e,t,i,n,s){const o=i.position.lineNumber,r=t.getLineMaxColumn(o);return i.move(n,o,r,s?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){const s=t.getLineCount(),o=t.getLineMaxColumn(s);return i.move(n,s,o,0)}}class ey{static deleteRight(e,t,i,n){const s=[];let o=3!==e;for(let e=0,r=n.length;e<r;e++){const r=n[e];let a=r;if(a.isEmpty()){const e=r.getPosition(),n=Jw.right(t,i,e);a=new wi(n.lineNumber,n.column,e.lineNumber,e.column)}a.isEmpty()?s[e]=null:(a.startLineNumber!==a.endLineNumber&&(o=!0),s[e]=new Gw(a,""))}return[o,s]}static isAutoClosingPairDelete(e,t,i,n,s,o,r){if("never"===t&&"never"===i)return!1;if("never"===e)return!1;for(let a=0,l=o.length;a<l;a++){const l=o[a],h=l.getPosition();if(!l.isEmpty())return!1;const d=s.getLineContent(h.lineNumber);if(h.column<2||h.column>=d.length+1)return!1;const c=d.charAt(h.column-2),u=n.get(c);if(!u)return!1;if(qw(c)){if("never"===i)return!1}else if("never"===t)return!1;const g=d.charAt(h.column-1);let m=!1;for(const e of u)e.open===c&&e.close===g&&(m=!0);if(!m)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t<i;t++){const i=r[t];if(h.lineNumber===i.startLineNumber&&h.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){const n=[];for(let e=0,t=i.length;e<t;e++){const t=i[e].getPosition(),s=new wi(t.lineNumber,t.column-1,t.lineNumber,t.column+1);n[e]=new Gw(s,"")}return[!0,n]}static deleteLeft(e,t,i,n,s){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,n,s))return this._runAutoClosingPairDelete(t,i,n);const o=[];let r=2!==e;for(let e=0,s=n.length;e<s;e++){const s=ey.getDeleteRange(n[e],i,t);s.isEmpty()?o[e]=null:(s.startLineNumber!==s.endLineNumber&&(r=!0),o[e]=new Gw(s,""))}return[r,o]}static getDeleteRange(e,t,i){if(!e.isEmpty())return e;const n=e.getPosition();if(i.useTabStops&&n.column>1){const e=t.getLineContent(n.lineNumber),s=Zn(e),o=-1===s?e.length+1:s+1;if(n.column<=o){const e=i.visibleColumnFromColumn(t,n),s=Sb.prevIndentTabStop(e,i.indentSize),o=i.columnFromVisibleColumn(t,n.lineNumber,s);return new wi(n.lineNumber,o,n.lineNumber,n.column)}}return wi.fromPositions(ey.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=Is(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new Ci(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let s=null;i.sort((e,t)=>Ci.compare(e.getStartPosition(),t.getEndPosition()));for(let o=0,r=i.length;o<r;o++){const r=i[o];if(r.isEmpty())if(e.emptySelectionClipboard){const e=r.getPosition();let i,a,l,h;e.lineNumber<t.getLineCount()?(i=e.lineNumber,a=1,l=e.lineNumber+1,h=1):e.lineNumber>1&&(null==s?void 0:s.endLineNumber)!==e.lineNumber?(i=e.lineNumber-1,a=t.getLineMaxColumn(e.lineNumber-1),l=e.lineNumber,h=t.getLineMaxColumn(e.lineNumber)):(i=e.lineNumber,a=1,l=e.lineNumber,h=t.getLineMaxColumn(e.lineNumber));const d=new wi(i,a,l,h);s=d,d.isEmpty()?n[o]=null:n[o]=new Gw(d,"")}else n[o]=null;else n[o]=new Gw(r,"")}return new jw(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class ty{static _createWord(e,t,i,n,s){return{start:n,end:s,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;for(let s=i.column-2;s>=0;s--){const i=e.charCodeAt(s),o=t.get(i);if(0===o){if(2===n)return this._createWord(e,n,o,s+1,this._findEndOfWord(e,t,n,s+1));n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,s+1,this._findEndOfWord(e,t,n,s+1));n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,s+1,this._findEndOfWord(e,t,n,s+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const s=e.length;for(let o=n;o<s;o++){const n=e.charCodeAt(o),s=t.get(n);if(1===s)return o;if(1===i&&2===s)return o;if(2===i&&0===s)return o}return s}static _findNextWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=0;const s=e.length;for(let o=i.column-1;o<s;o++){const i=e.charCodeAt(o),s=t.get(i);if(0===s){if(2===n)return this._createWord(e,n,s,this._findStartOfWord(e,t,n,o-1),o);n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,this._findStartOfWord(e,t,n,o-1),o);n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,this._findStartOfWord(e,t,n,o-1),o)}return 0!==n?this._createWord(e,n,1,this._findStartOfWord(e,t,n,s-1),s):null}static _findStartOfWord(e,t,i,n){for(let s=n;s>=0;s--){const n=e.charCodeAt(s),o=t.get(n);if(1===o)return s+1;if(1===i&&2===o)return s+1;if(2===i&&0===o)return s+1}return 0}static moveWordLeft(e,t,i,n){let s=i.lineNumber,o=i.column;1===o&&s>1&&(s-=1,o=t.getLineMaxColumn(s));let r=ty._findPreviousWordOnLine(e,t,new Ci(s,o));if(0===n)return new Ci(s,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start==1&&0===r.nextCharClass&&(r=ty._findPreviousWordOnLine(e,t,new Ci(s,r.start+1))),new Ci(s,r?r.start+1:1);if(3===n){for(;r&&2===r.wordType;)r=ty._findPreviousWordOnLine(e,t,new Ci(s,r.start+1));return new Ci(s,r?r.start+1:1)}return r&&o<=r.end+1&&(r=ty._findPreviousWordOnLine(e,t,new Ci(s,r.start+1))),new Ci(s,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new Ci(i-1,e.getLineMaxColumn(i-1)):t;const s=e.getLineContent(i);for(let e=t.column-1;e>1;e--){const t=s.charCodeAt(e-2),o=s.charCodeAt(e-1);if(95===t&&95!==o)return new Ci(i,e);if(45===t&&45!==o)return new Ci(i,e);if((ns(t)||is(t))&&ss(o))return new Ci(i,e);if(ss(t)&&ss(o)&&e+1<n){const t=s.charCodeAt(e);if(ns(t)||is(t))return new Ci(i,e)}}return new Ci(i,1)}static moveWordRight(e,t,i,n){let s=i.lineNumber,o=i.column,r=!1;o===t.getLineMaxColumn(s)&&s<t.getLineCount()&&(r=!0,s+=1,o=1);let a=ty._findNextWordOnLine(e,t,new Ci(s,o));if(2===n)a&&2===a.wordType&&a.end-a.start==1&&0===a.nextCharClass&&(a=ty._findNextWordOnLine(e,t,new Ci(s,a.end+1))),o=a?a.end+1:t.getLineMaxColumn(s);else if(3===n){for(r&&(o=0);a&&(2===a.wordType||a.start+1<=o);)a=ty._findNextWordOnLine(e,t,new Ci(s,a.end+1));o=a?a.start+1:t.getLineMaxColumn(s)}else a&&!r&&o>=a.start+1&&(a=ty._findNextWordOnLine(e,t,new Ci(s,a.end+1))),o=a?a.start+1:t.getLineMaxColumn(s);return new Ci(s,o)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new Ci(i+1,1):t;const s=e.getLineContent(i);for(let e=t.column+1;e<n;e++){const t=s.charCodeAt(e-2),o=s.charCodeAt(e-1);if(95!==t&&95===o)return new Ci(i,e);if(45!==t&&45===o)return new Ci(i,e);if((ns(t)||is(t))&&ss(o))return new Ci(i,e);if(ss(t)&&ss(o)&&e+1<n){const t=s.charCodeAt(e);if(ns(t)||is(t))return new Ci(i,e)}}return new Ci(i,n)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-2,s=Qn(i,n);return s+1<n?new wi(t.lineNumber,s+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,n=e.model,s=e.selection,o=e.whitespaceHeuristics;if(!s.isEmpty())return s;if(ey.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const t=e.selection.getPosition();return new wi(t.lineNumber,t.column-1,t.lineNumber,t.column+1)}const r=new Ci(s.positionLineNumber,s.positionColumn);let a=r.lineNumber,l=r.column;if(1===a&&1===l)return null;if(o){const e=this._deleteWordLeftWhitespace(n,r);if(e)return e}let h=ty._findPreviousWordOnLine(i,n,r);return 0===t?h?l=h.start+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a)):(h&&l<=h.end+1&&(h=ty._findPreviousWordOnLine(i,n,new Ci(a,h.start+1))),h?l=h.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new wi(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new Ci(i.positionLineNumber,i.positionColumn),s=this._deleteInsideWordWhitespace(t,n);return s||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let s=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,s))return null;let o=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,o))return null;for(;s>0&&this._charAtIsWhitespace(i,s-1);)s--;for(;o+1<n&&this._charAtIsWhitespace(i,o+1);)o++;return new wi(t.lineNumber,s+1,t.lineNumber,o+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const n=t.getLineContent(i.lineNumber),s=n.length;if(0===s)return i.lineNumber>1?new wi(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new wi(i.lineNumber,1,i.lineNumber+1,1):new wi(i.lineNumber,1,i.lineNumber,1);const o=e=>e.start+1<=i.column&&i.column<=e.end+1,r=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new wi(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,o=!1;for(;i-1<s&&this._charAtIsWhitespace(n,i-1);)o=!0,i++;if(!o)for(;t>1&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},l=ty._findPreviousWordOnLine(e,t,i);if(l&&o(l))return a(l);const h=ty._findNextWordOnLine(e,t,i);return h&&o(h)?a(h):l&&h?r(l.end+1,h.start+1):l?r(l.start+1,l.end+1):h?r(h.start+1,h.end+1):r(1,s+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=ty._moveWordPartLeft(e,i);return new wi(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n<i;n++){const t=e.charAt(n);if(" "!==t&&"\t"!==t)return n}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-1,s=this._findFirstNonWhitespaceChar(i,n);return n+1<s?new wi(t.lineNumber,t.column,t.lineNumber,s+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,n=e.model,s=e.selection,o=e.whitespaceHeuristics;if(!s.isEmpty())return s;const r=new Ci(s.positionLineNumber,s.positionColumn);let a=r.lineNumber,l=r.column;const h=n.getLineCount(),d=n.getLineMaxColumn(a);if(a===h&&l===d)return null;if(o){const e=this._deleteWordRightWhitespace(n,r);if(e)return e}let c=ty._findNextWordOnLine(i,n,r);return 2===t?c?l=c.end+1:l<d||a===h?l=d:(a++,c=ty._findNextWordOnLine(i,n,new Ci(a,1)),l=c?c.start+1:n.getLineMaxColumn(a)):(c&&l>=c.start+1&&(c=ty._findNextWordOnLine(i,n,new Ci(a,c.end+1))),c?l=c.start+1:l<d||a===h?l=d:(a++,c=ty._findNextWordOnLine(i,n,new Ci(a,1)),l=c?c.start+1:n.getLineMaxColumn(a))),new wi(a,l,r.lineNumber,r.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=ty._moveWordPartRight(e,i);return new wi(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){const n=new wi(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(n),startColumn:n.startColumn,endColumn:n.endColumn}}static getWordAtPosition(e,t,i){const n=uu(t),s=ty._findPreviousWordOnLine(n,e,i);if(s&&1===s.wordType&&s.start<=i.column-1&&i.column-1<=s.end)return ty._createWordAtPosition(e,i.lineNumber,s);const o=ty._findNextWordOnLine(n,e,i);return o&&1===o.wordType&&o.start<=i.column-1&&i.column-1<=o.end?ty._createWordAtPosition(e,i.lineNumber,o):null}static word(e,t,i,n,s){const o=uu(e.wordSeparators),r=ty._findPreviousWordOnLine(o,t,s),a=ty._findNextWordOnLine(o,t,s);if(!n){let e,i;return r&&1===r.wordType&&r.start<=s.column-1&&s.column-1<=r.end?(e=r.start+1,i=r.end+1):a&&1===a.wordType&&a.start<=s.column-1&&s.column-1<=a.end?(e=a.start+1,i=a.end+1):(e=r?r.end+1:1,i=a?a.start+1:t.getLineMaxColumn(s.lineNumber)),new Uw(new wi(s.lineNumber,e,s.lineNumber,i),1,0,new Ci(s.lineNumber,i),0)}let l,h;r&&1===r.wordType&&r.start<s.column-1&&s.column-1<r.end?(l=r.start+1,h=r.end+1):a&&1===a.wordType&&a.start<s.column-1&&s.column-1<a.end?(l=a.start+1,h=a.end+1):(l=s.column,h=s.column);const d=s.lineNumber;let c;if(i.selectionStart.containsPosition(s))c=i.selectionStart.endColumn;else if(s.isBeforeOrEqual(i.selectionStart.getStartPosition())){c=l;const e=new Ci(d,c);i.selectionStart.containsPosition(e)&&(c=i.selectionStart.endColumn)}else{c=h;const e=new Ci(d,c);i.selectionStart.containsPosition(e)&&(c=i.selectionStart.startColumn)}return i.move(!0,d,c,0)}}class iy{static addCursorDown(e,t,i){const n=[];let s=0;for(let o=0,r=t.length;o<r;o++){const r=t[o];n[s++]=new Hw(r.modelState,r.viewState),n[s++]=i?Hw.fromModelState(Jw.translateDown(e.cursorConfig,e.model,r.modelState)):Hw.fromViewState(Jw.translateDown(e.cursorConfig,e,r.viewState))}return n}static addCursorUp(e,t,i){const n=[];let s=0;for(let o=0,r=t.length;o<r;o++){const r=t[o];n[s++]=new Hw(r.modelState,r.viewState),n[s++]=i?Hw.fromModelState(Jw.translateUp(e.cursorConfig,e.model,r.modelState)):Hw.fromViewState(Jw.translateUp(e.cursorConfig,e,r.viewState))}return n}static moveToBeginningOfLine(e,t,i){const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s];n[s]=this._moveToLineStart(e,o,i)}return n}static _moveToLineStart(e,t,i){const n=t.viewState.position.column,s=n===t.modelState.position.column,o=t.viewState.position.lineNumber,r=e.getLineFirstNonWhitespaceColumn(o);return s||n===r?this._moveToLineStartByModel(e,t,i):this._moveToLineStartByView(e,t,i)}static _moveToLineStartByView(e,t,i){return Hw.fromViewState(Jw.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return Hw.fromModelState(Jw.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){const s=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];s[o]=this._moveToLineEnd(e,r,i,n)}return s}static _moveToLineEnd(e,t,i,n){const s=t.viewState.position,o=e.getLineMaxColumn(s.lineNumber),r=s.column===o,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),h=o-s.column==l-a.column;return r||h?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return Hw.fromViewState(Jw.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return Hw.fromModelState(Jw.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){const i=[];for(let n=0,s=t.length;n<s;n++){const s=t[n],o=s.modelState.selection.startLineNumber,r=e.model.getLineCount();let a,l=s.modelState.selection.endLineNumber;l===r?a=e.model.getLineMaxColumn(r):(l++,a=1),i[n]=Hw.fromModelState(new Uw(new wi(o,1,o,1),0,0,new Ci(l,a),0))}return i}static moveToBeginningOfBuffer(e,t,i){const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s];n[s]=Hw.fromModelState(Jw.moveToBeginningOfBuffer(e.cursorConfig,e.model,o.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s];n[s]=Hw.fromModelState(Jw.moveToEndOfBuffer(e.cursorConfig,e.model,o.modelState,i))}return n}static selectAll(e,t){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return Hw.fromModelState(new Uw(new wi(1,1,1,1),0,0,new Ci(i,n),0))}static line(e,t,i,n,s){const o=e.model.validatePosition(n),r=s?e.coordinatesConverter.validateViewPosition(new Ci(s.lineNumber,s.column),o):e.coordinatesConverter.convertModelPositionToViewPosition(o);if(!i){const t=e.model.getLineCount();let i=o.lineNumber+1,n=1;return i>t&&(i=t,n=e.model.getLineMaxColumn(i)),Hw.fromModelState(new Uw(new wi(o.lineNumber,1,i,n),2,0,new Ci(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(o.lineNumber<a)return Hw.fromViewState(t.viewState.move(!0,r.lineNumber,1,0));if(o.lineNumber>a){const i=e.getLineCount();let n=r.lineNumber+1,s=1;return n>i&&(n=i,s=e.getLineMaxColumn(n)),Hw.fromViewState(t.viewState.move(!0,n,s,0))}{const e=t.modelState.selectionStart.getEndPosition();return Hw.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,i,n){const s=e.model.validatePosition(n);return Hw.fromModelState(ty.word(e.cursorConfig,e.model,t.modelState,i,s))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Hw(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Hw.fromViewState(new Uw(new wi(i,n,i,n),0,0,new Ci(i,n),0))}static moveTo(e,t,i,n,s){if(i){if(1===t.modelState.selectionStartKind)return this.word(e,t,i,n);if(2===t.modelState.selectionStartKind)return this.line(e,t,i,n,s)}const o=e.model.validatePosition(n),r=s?e.coordinatesConverter.validateViewPosition(new Ci(s.lineNumber,s.column),o):e.coordinatesConverter.convertModelPositionToViewPosition(o);return Hw.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,s,o){switch(i){case 0:return 4===o?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,s);case 1:return 4===o?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,s);case 2:return 2===o?this._moveUpByViewLines(e,t,n,s):this._moveUpByModelLines(e,t,n,s);case 3:return 2===o?this._moveDownByViewLines(e,t,n,s):this._moveDownByModelLines(e,t,n,s);case 4:return 2===o?t.map(t=>Hw.fromViewState(Jw.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n))):t.map(t=>Hw.fromModelState(Jw.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n)));case 5:return 2===o?t.map(t=>Hw.fromViewState(Jw.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n))):t.map(t=>Hw.fromModelState(Jw.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n)));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,s){const o=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(o);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,s),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,s),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 14:{const i=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];i[s]=this.findPositionInViewportIfOutside(e,r,o,n)}return i}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){const s=t.viewState.position.lineNumber;if(i.startLineNumber<=s&&s<=i.endLineNumber-1)return new Hw(t.modelState,t.viewState);{let o;o=s>i.endLineNumber-1?i.endLineNumber-1:s<i.startLineNumber?i.startLineNumber:s;const r=Jw.vertical(e.cursorConfig,e,s,t.viewState.position.column,t.viewState.leftoverVisibleColumns,o,!1);return Hw.fromViewState(t.viewState.move(n,r.lineNumber,r.column,r.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.min(t.endLineNumber,n+i-1)}static _lastLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.max(n,t.endLineNumber-i+1)}static _moveLeft(e,t,i,n){return t.map(t=>Hw.fromViewState(Jw.moveLeft(e.cursorConfig,e,t.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s],r=o.viewState.position.lineNumber,a=Math.round(e.getLineLength(r)/2);n[s]=Hw.fromViewState(Jw.moveLeft(e.cursorConfig,e,o.viewState,i,a))}return n}static _moveRight(e,t,i,n){return t.map(t=>Hw.fromViewState(Jw.moveRight(e.cursorConfig,e,t.viewState,i,n)))}static _moveHalfLineRight(e,t,i){const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s],r=o.viewState.position.lineNumber,a=Math.round(e.getLineLength(r)/2);n[s]=Hw.fromViewState(Jw.moveRight(e.cursorConfig,e,o.viewState,i,a))}return n}static _moveDownByViewLines(e,t,i,n){const s=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];s[o]=Hw.fromViewState(Jw.moveDown(e.cursorConfig,e,r.viewState,i,n))}return s}static _moveDownByModelLines(e,t,i,n){const s=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];s[o]=Hw.fromModelState(Jw.moveDown(e.cursorConfig,e.model,r.modelState,i,n))}return s}static _moveUpByViewLines(e,t,i,n){const s=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];s[o]=Hw.fromViewState(Jw.moveUp(e.cursorConfig,e,r.viewState,i,n))}return s}static _moveUpByModelLines(e,t,i,n){const s=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];s[o]=Hw.fromModelState(Jw.moveUp(e.cursorConfig,e.model,r.modelState,i,n))}return s}static _moveToViewPosition(e,t,i,n,s){return Hw.fromViewState(t.viewState.move(i,n,s,0))}static _moveToModelPosition(e,t,i,n,s){return Hw.fromModelState(t.modelState.move(i,n,s,0))}static _moveToViewMinColumn(e,t,i){const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s],r=o.viewState.position.lineNumber,a=e.getLineMinColumn(r);n[s]=this._moveToViewPosition(e,o,i,r,a)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s],r=o.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(r);n[s]=this._moveToViewPosition(e,o,i,r,a)}return n}static _moveToViewCenterColumn(e,t,i){const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s],r=o.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(r)+e.getLineMinColumn(r))/2);n[s]=this._moveToViewPosition(e,o,i,r,a)}return n}static _moveToViewMaxColumn(e,t,i){const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s],r=o.viewState.position.lineNumber,a=e.getLineMaxColumn(r);n[s]=this._moveToViewPosition(e,o,i,r,a)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s],r=o.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(r);n[s]=this._moveToViewPosition(e,o,i,r,a)}return n}}var ny,sy;function oy(e,t,i,n){const s=Wc(t,i.startLineNumber,i.startColumn),o=n.getLanguageConfiguration(s.languageId);if(!o)return null;const r=s.getLineContent(),a=r.substr(0,i.startColumn-1-s.firstCharOffset);let l;if(i.isEmpty())l=r.substr(i.startColumn-1-s.firstCharOffset);else{l=Wc(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-s.firstCharOffset)}let h="";if(i.startLineNumber>1&&0===s.firstCharOffset){const e=Wc(t,i.startLineNumber-1);e.languageId===s.languageId&&(h=e.getLineContent())}const d=o.onEnter(e,h,a,l);if(!d)return null;const c=d.indentAction;let u=d.appendText;const g=d.removeText||0;u?c===Sd.Indent&&(u="\t"+u):u=c===Sd.Indent||c===Sd.IndentOutdent?"\t":"";let m=Bc(t,i.startLineNumber,i.startColumn);return g&&(m=m.substring(0,m.length-g)),{indentAction:c,appendText:u,removeText:g,indentation:m}}(sy=ny||(ny={})).metadata={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t",constraint:function(e){if(!D(e))return!1;const t=e;return!(!k(t.to)||!T(t.select)&&!I(t.select)||!T(t.by)&&!k(t.by)||!T(t.value)&&!E(t.value))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},sy.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},sy.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},sy.parse=function(e){if(!e.to)return null;let t;switch(e.to){case sy.RawDirection.Left:t=0;break;case sy.RawDirection.Right:t=1;break;case sy.RawDirection.Up:t=2;break;case sy.RawDirection.Down:t=3;break;case sy.RawDirection.PrevBlankLine:t=4;break;case sy.RawDirection.NextBlankLine:t=5;break;case sy.RawDirection.WrappedLineStart:t=6;break;case sy.RawDirection.WrappedLineFirstNonWhitespaceCharacter:t=7;break;case sy.RawDirection.WrappedLineColumnCenter:t=8;break;case sy.RawDirection.WrappedLineEnd:t=9;break;case sy.RawDirection.WrappedLineLastNonWhitespaceCharacter:t=10;break;case sy.RawDirection.ViewPortTop:t=11;break;case sy.RawDirection.ViewPortBottom:t=13;break;case sy.RawDirection.ViewPortCenter:t=12;break;case sy.RawDirection.ViewPortIfOutside:t=14;break;default:return null}let i=0;switch(e.by){case sy.RawUnit.Line:i=1;break;case sy.RawUnit.WrappedLine:i=2;break;case sy.RawUnit.Character:i=3;break;case sy.RawUnit.HalfLine:i=4}return{direction:t,unit:i,select:!!e.select,value:e.value||1}};var ry,ay=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ly=function(e,t){return function(i,n){t(i,n,e)}};const hy=Object.create(null);function dy(e,t){if(t<=0)return"";hy[e]||(hy[e]=["",e]);const i=hy[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}let cy=ry=class{static unshiftIndent(e,t,i,n,s){const o=Sb.visibleColumnFromColumn(e,t,i);if(s){const e=dy(" ",n);return dy(e,Sb.prevIndentTabStop(o,n)/n)}return dy("\t",Sb.prevRenderTabStop(o,i)/i)}static shiftIndent(e,t,i,n,s){const o=Sb.visibleColumnFromColumn(e,t,i);if(s){const e=dy(" ",n);return dy(e,Sb.nextIndentTabStop(o,n)/n)}return dy("\t",Sb.nextRenderTabStop(o,i)/i)}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let n=this._selection.endLineNumber;1===this._selection.endColumn&&i!==n&&(n-=1);const{tabSize:s,indentSize:o,insertSpaces:r}=this._opts,a=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,h=0;for(let d=i;d<=n;d++,l=h){h=0;const n=e.getLineContent(d);let c,u=Zn(n);if((!this._opts.isUnshift||0!==n.length&&0!==u)&&(a||this._opts.isUnshift||0!==n.length)){if(-1===u&&(u=n.length),d>1){if(Sb.visibleColumnFromColumn(n,u+1,s)%o!=0&&e.tokenization.isCheapToTokenize(d-1)){const t=oy(this._opts.autoIndent,e,new wi(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(t){if(h=l,t.appendText)for(let e=0,i=t.appendText.length;e<i&&h<o&&32===t.appendText.charCodeAt(e);e++)h++;t.removeText&&(h=Math.max(0,h-t.removeText));for(let e=0;e<h&&(0!==u&&32===n.charCodeAt(u-1));e++)u--}}}this._opts.isUnshift&&0===u||(c=this._opts.isUnshift?ry.unshiftIndent(n,u+1,s,o,r):ry.shiftIndent(n,u+1,s,o,r),this._addEditOperation(t,new wi(d,1,d,u+1),c),d!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=this._selection.startColumn<=u+1))}}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&0===e.getLineLength(i)&&(this._useLastEditRangeForCursorEndPosition=!0);const s=r?dy(" ",o):"\t";for(let r=i;r<=n;r++){const n=e.getLineContent(r);let l=Zn(n);if((!this._opts.isUnshift||0!==n.length&&0!==l)&&((a||this._opts.isUnshift||0!==n.length)&&(-1===l&&(l=n.length),!this._opts.isUnshift||0!==l)))if(this._opts.isUnshift){l=Math.min(l,o);for(let e=0;e<l;e++){if(9===n.charCodeAt(e)){l=e+1;break}}this._addEditOperation(t,new wi(r,1,r,l+1),"")}else this._addEditOperation(t,new wi(r,1,r,1),s),r!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){const e=t.getInverseEditOperations()[0];return new yi(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const e=this._selection.startColumn;return i.startColumn<=e?i:0===i.getDirection()?new yi(i.startLineNumber,e,i.endLineNumber,i.endColumn):new yi(i.endLineNumber,i.endColumn,i.startLineNumber,e)}return i}};cy=ry=ay([ly(2,Oc)],cy);class uy{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new wi(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new wi(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){const i=t.getInverseEditOperations(),n=i[0].range,s=i[1].range;return new yi(n.endLineNumber,n.endColumn,s.endLineNumber,s.endColumn-this._charAfterSelection.length)}}class gy{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new wi(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return new yi(i.endLineNumber,i.startColumn,i.endLineNumber,i.endColumn-this._charAfter.length)}}function my(e,t,i,n=!0,s){if(e<4)return null;const o=s.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(i<=1)return{indentation:"",action:null};for(let e=i-1;e>0&&""===t.getLineContent(e);e--)if(1===e)return{indentation:"",action:null};const r=function(e,t,i){const n=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let s,o=-1;for(s=t-1;s>=1;s--){if(e.tokenization.getLanguageIdAtPosition(s,0)!==n)return o;const t=e.getLineContent(s);if(!i.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return s;o=s}}return-1}(t,i,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=t.getLineContent(r);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:Yn(a),action:Sd.Indent,line:r};if(o.shouldDecrease(a))return{indentation:Yn(a),action:null,line:r};{if(1===r)return{indentation:Yn(t.getLineContent(r)),action:null,line:r};const e=r-1,i=o.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let n=e-1;n>0;n--)if(!o.shouldIndentNextLine(t.getLineContent(n))){i=n;break}return{indentation:Yn(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:Yn(t.getLineContent(r)),action:null,line:r};for(let e=r;e>0;e--){const i=t.getLineContent(e);if(o.shouldIncrease(i))return{indentation:Yn(i),action:Sd.Indent,line:e};if(o.shouldIndentNextLine(i)){let i=0;for(let n=e-1;n>0;n--)if(!o.shouldIndentNextLine(t.getLineContent(e))){i=n;break}return{indentation:Yn(t.getLineContent(i+1)),action:null,line:i+1}}if(o.shouldDecrease(i))return{indentation:Yn(i),action:null,line:e}}return{indentation:Yn(t.getLineContent(1)),action:null,line:1}}}class fy{static indent(e,t,i){if(null===t||null===i)return[];const n=[];for(let t=0,s=i.length;t<s;t++)n[t]=new cy(i[t],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static outdent(e,t,i){const n=[];for(let t=0,s=i.length;t<s;t++)n[t]=new cy(i[t],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static shiftIndent(e,t,i){return i=i||1,cy.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,cy.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,i,n){const s=[];for(let e=0,t=i.length;e<t;e++)s[e]=new Gw(i[e],n[e]);return new jw(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,s){const o=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],r=t.getPosition();if(s&&!t.isEmpty()&&(s=!1),s&&n.indexOf("\n")!==n.length-1&&(s=!1),s){const i=new wi(r.lineNumber,1,r.lineNumber,1);o[e]=new Qw(i,n,t,!0)}else o[e]=new Gw(t,n)}return new jw(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,s){if(n)return null;if(1===t.length)return null;if(s&&s.length===t.length)return s;if("spread"===e.multiCursorPaste){10===i.charCodeAt(i.length-1)&&(i=i.substr(0,i.length-1)),13===i.charCodeAt(i.length-1)&&(i=i.substr(0,i.length-1));const e=Gn(i);if(e.length===t.length)return e}return null}static paste(e,t,i,n,s,o){const r=this._distributePasteToCursors(e,i,n,s,o);return r?(i=i.sort(wi.compareRangesUsingStarts),this._distributedPaste(e,t,i,r)):this._simplePaste(e,t,i,n,s)}static _goodIndentForLine(e,t,i){let n=null,s="";const o=my(e.autoIndent,t,i,!1,e.languageConfigurationService);if(o)n=o.action,s=o.indentation;else if(i>1){let n;for(n=i-1;n>=1;n--){if(Qn(t.getLineContent(n))>=0)break}if(n<1)return null;const o=t.getLineMaxColumn(n),r=oy(e.autoIndent,t,new wi(n,o,n,o),e.languageConfigurationService);r&&(s=r.indentation+r.appendText)}return n&&(n===Sd.Indent&&(s=fy.shiftIndent(e,s)),n===Sd.Outdent&&(s=fy.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const o=i.getStartPosition();if(e.insertSpaces){const i=e.visibleColumnFromColumn(t,o),n=e.indentSize,r=n-i%n;for(let e=0;e<r;e++)s+=" "}else s="\t";return new Gw(i,s,n)}static tab(e,t,i){const n=[];for(let s=0,o=i.length;s<o;s++){const o=i[s];if(o.isEmpty()){const i=t.getLineContent(o.startLineNumber);if(/^\s*$/.test(i)&&t.tokenization.isCheapToTokenize(o.startLineNumber)){let r=this._goodIndentForLine(e,t,o.startLineNumber);r=r||"\t";const a=e.normalizeIndentation(r);if(!i.startsWith(a)){n[s]=new Gw(new wi(o.startLineNumber,1,o.startLineNumber,i.length+1),a,!0);continue}}n[s]=this._replaceJumpToNextIndent(e,t,o,!0)}else{if(o.startLineNumber===o.endLineNumber){const i=t.getLineMaxColumn(o.startLineNumber);if(1!==o.startColumn||o.endColumn!==i){n[s]=this._replaceJumpToNextIndent(e,t,o,!1);continue}}n[s]=new cy(o,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static compositionType(e,t,i,n,s,o,r,a){const l=n.map(e=>this._compositionType(i,e,s,o,r,a));return new jw(4,l,{shouldPushStackElementBefore:by(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,o){if(!t.isEmpty())return null;const r=t.getPosition(),a=Math.max(1,r.column-n),l=Math.min(e.getLineMaxColumn(r.lineNumber),r.column+s),h=new wi(r.lineNumber,a,r.lineNumber,l);return e.getValueInRange(h)===i&&0===o?null:new Yw(h,i,0,o)}static _typeCommand(e,t,i){return i?new Zw(e,t,!0):new Gw(e,t,!0)}static _enter(e,t,i,n){if(0===e.autoIndent)return fy._typeCommand(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){const s=Yn(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);return fy._typeCommand(n,"\n"+e.normalizeIndentation(s),i)}const s=oy(e.autoIndent,t,n,e.languageConfigurationService);if(s){if(s.indentAction===Sd.None)return fy._typeCommand(n,"\n"+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Sd.Indent)return fy._typeCommand(n,"\n"+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Sd.IndentOutdent){const t=e.normalizeIndentation(s.indentation),o=e.normalizeIndentation(s.indentation+s.appendText),r="\n"+o+"\n"+t;return i?new Zw(n,r,!0):new Yw(n,r,-1,o.length-t.length,!0)}if(s.indentAction===Sd.Outdent){const t=fy.unshiftIndent(e,s.indentation);return fy._typeCommand(n,"\n"+e.normalizeIndentation(t+s.appendText),i)}}const o=Yn(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);if(e.autoIndent>=4){const s=function(e,t,i,n,s){if(e<4)return null;t.tokenization.forceTokenization(i.startLineNumber);const o=t.tokenization.getLineTokens(i.startLineNumber),r=xd(o,i.startColumn-1),a=r.getLineContent();let l,h,d=!1;if(r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(d=!0,l=a.substr(0,i.startColumn-1-r.firstCharOffset)):l=o.getLineContent().substring(0,i.startColumn-1),i.isEmpty())h=a.substr(i.startColumn-1-r.firstCharOffset);else{h=Wc(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset)}const c=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!c)return null;const u=l,g=Yn(l),m={tokenization:{getLineTokens:e=>t.tokenization.getLineTokens(e),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i)},getLineContent:e=>e===i.startLineNumber?u:t.getLineContent(e)},f=Yn(o.getLineContent()),p=my(e,m,i.startLineNumber+1,void 0,s);if(!p){const e=d?f:g;return{beforeEnter:e,afterEnter:e}}let _=d?f:p.indentation;return p.action===Sd.Indent&&(_=n.shiftIndent(_)),c.shouldDecrease(h)&&(_=n.unshiftIndent(_)),{beforeEnter:d?f:g,afterEnter:_}}(e.autoIndent,t,n,{unshiftIndent:t=>fy.unshiftIndent(e,t),shiftIndent:t=>fy.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(s){let o=e.visibleColumnFromColumn(t,n.getEndPosition());const r=n.endColumn,a=Zn(t.getLineContent(n.endLineNumber));if(n=a>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,a+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Zw(n,"\n"+e.normalizeIndentation(s.afterEnter),!0);{let t=0;return r<=a+1&&(e.insertSpaces||(o=Math.ceil(o/e.indentSize)),t=Math.min(o+1-e.normalizeIndentation(s.afterEnter).length-1,0)),new Yw(n,"\n"+e.normalizeIndentation(s.afterEnter),0,t,!0)}}}return fy._typeCommand(n,"\n"+e.normalizeIndentation(o),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let e=0,n=i.length;e<n;e++)if(!t.tokenization.isCheapToTokenize(i[e].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const s=Bc(t,i.startLineNumber,i.startColumn),o=function(e,t,i,n,s,o){if(e<4)return null;const r=Wc(t,i.startLineNumber,i.startColumn);if(r.firstCharOffset)return null;const a=o.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!a)return null;const l=r.getLineContent(),h=l.substr(0,i.startColumn-1-r.firstCharOffset);let d;if(i.isEmpty())d=l.substr(i.startColumn-1-r.firstCharOffset);else{d=Wc(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset)}if(!a.shouldDecrease(h+d)&&a.shouldDecrease(h+n+d)){const n=my(e,t,i.startLineNumber,!1,o);if(!n)return null;let r=n.indentation;return n.action!==Sd.Indent&&(r=s.unshiftIndent(r)),r}return null}(e.autoIndent,t,i,n,{shiftIndent:t=>fy.shiftIndent(e,t),unshiftIndent:t=>fy.unshiftIndent(e,t)},e.languageConfigurationService);if(null===o)return null;if(o!==e.normalizeIndentation(s)){const s=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===s?fy._typeCommand(new wi(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+n,!1):fy._typeCommand(new wi(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+t.getLineContent(i.startLineNumber).substring(s-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,s){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(s))return!1;for(let o=0,r=i.length;o<r;o++){const r=i[o];if(!r.isEmpty())return!1;const a=r.getPosition(),l=t.getLineContent(a.lineNumber);if(l.charAt(a.column-1)!==s)return!1;const h=qw(s);if(92===(a.column>2?l.charCodeAt(a.column-2):0)&&h)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;t<i;t++){const i=n[t];if(a.lineNumber===i.startLineNumber&&a.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,s){const o=[];for(let e=0,t=n.length;e<t;e++){const t=n[e].getPosition(),i=new wi(t.lineNumber,t.column,t.lineNumber,t.column+1);o[e]=new Gw(i,s)}return new jw(4,o,{shouldPushStackElementBefore:by(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],s=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],o=n.some(e=>t.startsWith(e.open)),r=s.some(e=>t.startsWith(e.close));return!o&&r}static _findAutoClosingPairOpen(e,t,i,n){const s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!s)return null;let o=null;for(const e of s)if(null===o||e.open.length>o.open.length){let s=!0;for(const o of i){if(t.getValueInRange(new wi(o.lineNumber,o.column-e.open.length+1,o.lineNumber,o.column))+n!==e.open){s=!1;break}}s&&(o=e)}return o}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let s=null;for(const e of n)e.open!==t.open&&t.open.includes(e.open)&&t.close.endsWith(e.close)&&(!s||e.open.length>s.open.length)&&(s=e);return s}static _getAutoClosingPairClose(e,t,i,n,s){for(const e of i)if(!e.isEmpty())return null;const o=i.map(e=>{const t=e.getPosition();return s?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}}),r=this._findAutoClosingPairOpen(e,t,o.map(e=>new Ci(e.lineNumber,e.beforeColumn)),n);if(!r)return null;let a,l;if(qw(n))a=e.autoClosingQuotes,l=e.shouldAutoCloseBefore.quote;else{!!e.blockCommentStartToken&&r.open.includes(e.blockCommentStartToken)?(a=e.autoClosingComments,l=e.shouldAutoCloseBefore.comment):(a=e.autoClosingBrackets,l=e.shouldAutoCloseBefore.bracket)}if("never"===a)return null;const h=this._findContainedAutoClosingPair(e,r),d=h?h.close:"";let c=!0;for(const i of o){const{lineNumber:s,beforeColumn:o,afterColumn:h}=i,u=t.getLineContent(s),g=u.substring(0,o-1),m=u.substring(h-1);if(m.startsWith(d)||(c=!1),m.length>0){const t=m.charAt(0);if(!fy._isBeforeClosingBrace(e,m)&&!l(t))return null}if(1===r.open.length&&("'"===n||'"'===n)&&"always"!==a){const t=uu(e.wordSeparators);if(g.length>0){const e=g.charCodeAt(g.length-1);if(0===t.get(e))return null}}if(!t.tokenization.isCheapToTokenize(s))return null;t.tokenization.forceTokenization(s);const f=xd(t.tokenization.getLineTokens(s),o-1);if(!r.shouldAutoClose(f,o-f.firstCharOffset))return null;const p=r.findNeutralCharacter();if(p){const e=t.tokenization.getTokenTypeIfInsertingCharacter(s,o,p);if(!r.isOK(e))return null}}return c?r.close.substring(0,r.close.length-d.length):r.close}static _runAutoClosingOpenCharType(e,t,i,n,s,o,r){const a=[];for(let e=0,t=n.length;e<t;e++){const t=n[e];a[e]=new py(t,s,!o,r)}return new jw(4,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return qw(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}static _isSurroundSelectionType(e,t,i,n){if(!fy._shouldSurroundChar(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;const s=qw(n);for(const e of i){if(e.isEmpty())return!1;let i=!0;for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const s=t.getLineContent(n),o=n===e.startLineNumber?e.startColumn-1:0,r=n===e.endLineNumber?e.endColumn-1:s.length,a=s.substring(o,r);if(/[^ \t]/.test(a)){i=!1;break}}if(i)return!1;if(s&&e.startLineNumber===e.endLineNumber&&e.startColumn+1===e.endColumn){if(qw(t.getValueInRange(e)))return!1}}return!0}static _runSurroundSelectionType(e,t,i,n,s){const o=[];for(let e=0,i=n.length;e<i;e++){const i=n[e],r=t.surroundingPairs[s];o[e]=new uy(i,s,r)}return new jw(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,i){return!(1!==i.length||!t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,n,s){if(!t.electricChars.hasOwnProperty(s)||!n.isEmpty())return null;const o=n.getPosition();i.tokenization.forceTokenization(o.lineNumber);const r=i.tokenization.getLineTokens(o.lineNumber);let a;try{a=t.onElectricCharacter(s,r,o.column)}catch(e){return Be(e),null}if(!a)return null;if(a.matchOpenBracket){const n=(r.getLineContent()+s).lastIndexOf(a.matchOpenBracket)+1,l=i.bracketPairs.findMatchingBracketUp(a.matchOpenBracket,{lineNumber:o.lineNumber,column:n},500);if(l){if(l.startLineNumber===o.lineNumber)return null;const n=Yn(i.getLineContent(l.startLineNumber)),r=t.normalizeIndentation(n),a=i.getLineContent(o.lineNumber),h=i.getLineFirstNonWhitespaceColumn(o.lineNumber)||o.column,d=r+a.substring(h-1,o.column-1)+s,c=new wi(o.lineNumber,1,o.lineNumber,o.column),u=new Gw(c,d);return new jw(vy(d,e),[u],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,n,s,o){if(!n)return null;let r=null;for(const e of n)if(null===r)r=e.insertedText;else if(r!==e.insertedText)return null;if(!r||1!==r.length)return null;const a=r;let l=!1;for(const e of n)if(0!==e.deletedText.length){l=!0;break}if(l){if(!fy._shouldSurroundChar(t,a)||!t.surroundingPairs.hasOwnProperty(a))return null;const e=qw(a);for(const t of n){if(0!==t.deletedSelectionStart||t.deletedSelectionEnd!==t.deletedText.length)return null;if(/^[ \t]+$/.test(t.deletedText))return null;if(e&&qw(t.deletedText))return null}const i=[];for(const e of s){if(!e.isEmpty())return null;i.push(e.getPosition())}if(i.length!==n.length)return null;const o=[];for(let e=0,s=i.length;e<s;e++)o.push(new gy(i[e],n[e].deletedText,t.surroundingPairs[a]));return new jw(4,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(t,i,s,o,a)){const e=s.map(e=>new Gw(new wi(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1));return new jw(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const h=this._getAutoClosingPairClose(t,i,s,a,!0);return null!==h?this._runAutoClosingOpenCharType(e,t,i,s,a,!0,h):null}static typeWithInterceptors(e,t,i,n,s,o,r){if(!e&&"\n"===r){const e=[];for(let t=0,o=s.length;t<o;t++)e[t]=fy._enter(i,n,!1,s[t]);return new jw(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,s)){const e=[];let t=!1;for(let o=0,a=s.length;o<a;o++)if(e[o]=this._runAutoIndentType(i,n,s[o],r),!e[o]){t=!0;break}if(!t)return new jw(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,n,s,o,r))return this._runAutoClosingOvertype(t,i,n,s,r);if(!e){const e=this._getAutoClosingPairClose(i,n,s,r,!1);if(e)return this._runAutoClosingOpenCharType(t,i,n,s,r,!1,e)}if(!e&&this._isSurroundSelectionType(i,n,s,r))return this._runSurroundSelectionType(t,i,n,s,r);if(!e&&this._isTypeInterceptorElectricChar(i,n,s)){const e=this._typeInterceptorElectricChar(t,i,n,s[0],r);if(e)return e}const a=[];for(let e=0,t=s.length;e<t;e++)a[e]=new Gw(s[e],r);const l=vy(r,t);return new jw(l,a,{shouldPushStackElementBefore:by(t,l),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,s){const o=[];for(let e=0,t=n.length;e<t;e++)o[e]=new Gw(n[e],s);const r=vy(s,e);return new jw(r,o,{shouldPushStackElementBefore:by(e,r),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(null===t||null===i)return[];const n=[];for(let s=0,o=i.length;s<o;s++){let o=i[s].positionLineNumber;if(1===o)n[s]=new Zw(new wi(1,1,1,1),"\n");else{o--;const i=t.getLineMaxColumn(o);n[s]=this._enter(e,t,!1,new wi(o,i,o,i))}}return n}static lineInsertAfter(e,t,i){if(null===t||null===i)return[];const n=[];for(let s=0,o=i.length;s<o;s++){const o=i[s].positionLineNumber,r=t.getLineMaxColumn(o);n[s]=this._enter(e,t,!1,new wi(o,r,o,r))}return n}static lineBreakInsert(e,t,i){const n=[];for(let s=0,o=i.length;s<o;s++)n[s]=this._enter(e,t,!0,i[s]);return n}}class py extends Yw{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length),this._openCharacter=t,this._closeCharacter=n,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new wi(i.startLineNumber,i.endColumn-this._closeCharacter.length,i.endLineNumber,i.endColumn),this.enclosingRange=new wi(i.startLineNumber,i.endColumn-this._openCharacter.length-this._closeCharacter.length,i.endLineNumber,i.endColumn),super.computeCursorState(e,t)}}class _y{constructor(e,t,i,n,s,o){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=s,this.insertedSelectionEnd=o}}function vy(e,t){return" "===e?5===t||6===t?6:5:4}function by(e,t){return!(!wy(e)||wy(t))||5!==e&&Cy(e)!==Cy(t)}function Cy(e){return 6===e||5===e?"space":e}function wy(e){return 4===e||5===e||6===e}var yy,Sy;(Sy=yy||(yy={})).editorSimpleInput=new _h("editorSimpleInput",!1,!0),Sy.editorTextFocus=new _h("editorTextFocus",!1,J.b("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),Sy.focus=new _h("editorFocus",!1,J.b("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),Sy.textInputFocus=new _h("textInputFocus",!1,J.b("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),Sy.readOnly=new _h("editorReadonly",!1,J.b("editorReadonly","Whether the editor is read-only")),Sy.inDiffEditor=new _h("inDiffEditor",!1,J.b("inDiffEditor","Whether the context is a diff editor")),Sy.isEmbeddedDiffEditor=new _h("isEmbeddedDiffEditor",!1,J.b("isEmbeddedDiffEditor","Whether the context is an embedded diff editor")),Sy.inMultiDiffEditor=new _h("inMultiDiffEditor",!1,J.b("inMultiDiffEditor","Whether the context is a multi diff editor")),Sy.multiDiffEditorAllCollapsed=new _h("multiDiffEditorAllCollapsed",void 0,J.b("multiDiffEditorAllCollapsed","Whether all files in multi diff editor are collapsed")),Sy.hasChanges=new _h("diffEditorHasChanges",!1,J.b("diffEditorHasChanges","Whether the diff editor has changes")),Sy.comparingMovedCode=new _h("comparingMovedCode",!1,J.b("comparingMovedCode","Whether a moved code block is selected for comparison")),Sy.accessibleDiffViewerVisible=new _h("accessibleDiffViewerVisible",!1,J.b("accessibleDiffViewerVisible","Whether the accessible diff viewer is visible")),Sy.diffEditorRenderSideBySideInlineBreakpointReached=new _h("diffEditorRenderSideBySideInlineBreakpointReached",!1,J.b("diffEditorRenderSideBySideInlineBreakpointReached","Whether the diff editor render side by side inline breakpoint is reached")),Sy.columnSelection=new _h("editorColumnSelection",!1,J.b("editorColumnSelection","Whether `editor.columnSelection` is enabled")),Sy.writable=Sy.readOnly.toNegated(),Sy.hasNonEmptySelection=new _h("editorHasSelection",!1,J.b("editorHasSelection","Whether the editor has text selected")),Sy.hasOnlyEmptySelection=Sy.hasNonEmptySelection.toNegated(),Sy.hasMultipleSelections=new _h("editorHasMultipleSelections",!1,J.b("editorHasMultipleSelections","Whether the editor has multiple selections")),Sy.hasSingleSelection=Sy.hasMultipleSelections.toNegated(),Sy.tabMovesFocus=new _h("editorTabMovesFocus",!1,J.b("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),Sy.tabDoesNotMoveFocus=Sy.tabMovesFocus.toNegated(),Sy.isInEmbeddedEditor=new _h("isInEmbeddedEditor",!1,!0),Sy.canUndo=new _h("canUndo",!1,!0),Sy.canRedo=new _h("canRedo",!1,!0),Sy.hoverVisible=new _h("editorHoverVisible",!1,J.b("editorHoverVisible","Whether the editor hover is visible")),Sy.hoverFocused=new _h("editorHoverFocused",!1,J.b("editorHoverFocused","Whether the editor hover is focused")),Sy.stickyScrollFocused=new _h("stickyScrollFocused",!1,J.b("stickyScrollFocused","Whether the sticky scroll is focused")),Sy.stickyScrollVisible=new _h("stickyScrollVisible",!1,J.b("stickyScrollVisible","Whether the sticky scroll is visible")),Sy.standaloneColorPickerVisible=new _h("standaloneColorPickerVisible",!1,J.b("standaloneColorPickerVisible","Whether the standalone color picker is visible")),Sy.standaloneColorPickerFocused=new _h("standaloneColorPickerFocused",!1,J.b("standaloneColorPickerFocused","Whether the standalone color picker is focused")),Sy.inCompositeEditor=new _h("inCompositeEditor",void 0,J.b("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),Sy.notInCompositeEditor=Sy.inCompositeEditor.toNegated(),Sy.languageId=new _h("editorLangId","",J.b("editorLangId","The language identifier of the editor")),Sy.hasCompletionItemProvider=new _h("editorHasCompletionItemProvider",!1,J.b("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),Sy.hasCodeActionsProvider=new _h("editorHasCodeActionsProvider",!1,J.b("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),Sy.hasCodeLensProvider=new _h("editorHasCodeLensProvider",!1,J.b("editorHasCodeLensProvider","Whether the editor has a code lens provider")),Sy.hasDefinitionProvider=new _h("editorHasDefinitionProvider",!1,J.b("editorHasDefinitionProvider","Whether the editor has a definition provider")),Sy.hasDeclarationProvider=new _h("editorHasDeclarationProvider",!1,J.b("editorHasDeclarationProvider","Whether the editor has a declaration provider")),Sy.hasImplementationProvider=new _h("editorHasImplementationProvider",!1,J.b("editorHasImplementationProvider","Whether the editor has an implementation provider")),Sy.hasTypeDefinitionProvider=new _h("editorHasTypeDefinitionProvider",!1,J.b("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),Sy.hasHoverProvider=new _h("editorHasHoverProvider",!1,J.b("editorHasHoverProvider","Whether the editor has a hover provider")),Sy.hasDocumentHighlightProvider=new _h("editorHasDocumentHighlightProvider",!1,J.b("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),Sy.hasDocumentSymbolProvider=new _h("editorHasDocumentSymbolProvider",!1,J.b("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),Sy.hasReferenceProvider=new _h("editorHasReferenceProvider",!1,J.b("editorHasReferenceProvider","Whether the editor has a reference provider")),Sy.hasRenameProvider=new _h("editorHasRenameProvider",!1,J.b("editorHasRenameProvider","Whether the editor has a rename provider")),Sy.hasSignatureHelpProvider=new _h("editorHasSignatureHelpProvider",!1,J.b("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),Sy.hasInlayHintsProvider=new _h("editorHasInlayHintsProvider",!1,J.b("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),Sy.hasDocumentFormattingProvider=new _h("editorHasDocumentFormattingProvider",!1,J.b("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),Sy.hasDocumentSelectionFormattingProvider=new _h("editorHasDocumentSelectionFormattingProvider",!1,J.b("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),Sy.hasMultipleDocumentFormattingProvider=new _h("editorHasMultipleDocumentFormattingProvider",!1,J.b("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),Sy.hasMultipleDocumentSelectionFormattingProvider=new _h("editorHasMultipleDocumentSelectionFormattingProvider",!1,J.b("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"));class Ly extends Xh{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}var ky,Dy,xy,Ey,Ny;(Dy=ky||(ky={})).metadata={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t",constraint:function(e){if(!D(e))return!1;const t=e;return!(!k(t.to)||!T(t.by)&&!k(t.by)||!T(t.value)&&!E(t.value)||!T(t.revealCursor)&&!I(t.revealCursor))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},Dy.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},Dy.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"},Dy.parse=function(e){let t,i;switch(e.to){case Dy.RawDirection.Up:t=1;break;case Dy.RawDirection.Right:t=2;break;case Dy.RawDirection.Down:t=3;break;case Dy.RawDirection.Left:t=4;break;default:return null}switch(e.by){case Dy.RawUnit.Line:i=1;break;case Dy.RawUnit.WrappedLine:i=2;break;case Dy.RawUnit.Page:i=3;break;case Dy.RawUnit.HalfPage:i=4;break;case Dy.RawUnit.Editor:i=5;break;case Dy.RawUnit.Column:i=6;break;default:i=2}return{direction:t,unit:i,value:Math.floor(e.value||1),revealCursor:!!e.revealCursor,select:!!e.select}},(Ey=xy||(xy={})).metadata={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t```\n\t\t\t\t",constraint:function(e){if(!D(e))return!1;const t=e;return!(!E(t.lineNumber)&&!k(t.lineNumber)||!T(t.at)&&!k(t.at))},schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},Ey.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"};class Iy{constructor(e){e.addImplementation(1e4,"code-editor",(e,t)=>{const i=e.get(yl).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)}),e.addImplementation(1e3,"generic-dom-input-textarea",(e,t)=>{const i=va();return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(i),!0)}),e.addImplementation(0,"generic-dom",(e,t)=>{const i=e.get(yl).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}!function(e){class t extends Ly{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;e.model.pushStackElement();e.setCursorStates(t.source,3,[iy.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&2!==t.revealType&&e.revealPrimaryCursor(t.source,!0,!0)}}e.MoveTo=Jh(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=Jh(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends Ly{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);null!==i&&(e.setCursorStates(t.source,3,i.viewStates.map(e=>Hw.fromViewState(e))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=Jh(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){if(void 0===n.position||void 0===n.viewPosition||void 0===n.mouseColumn)return null;const s=e.model.validatePosition(n.position),o=e.coordinatesConverter.validateViewPosition(new Ci(n.viewPosition.lineNumber,n.viewPosition.column),s),r=n.doColumnSelect?i.fromViewLineNumber:o.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return $w.columnSelect(e.cursorConfig,e,r,a,o.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=Jh(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return $w.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=Jh(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return $w.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return $w.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=Jh(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=Jh(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return $w.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=Jh(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=Jh(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends Ly{constructor(){super({id:"cursorMove",precondition:void 0,metadata:ny.metadata})}runCoreEditorCommand(e,t){const i=ny.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,o._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,s=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return iy.simpleMove(e,t,i.direction,n,s,i.unit);case 11:case 13:case 12:case 14:return iy.viewportMove(e,t,i.direction,n,s);default:return null}}}e.CursorMoveImpl=o,e.CursorMove=Jh(new o);class r extends Ly{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,iy.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=Jh(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=Jh(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:1039}})),e.CursorRight=Jh(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=Jh(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:1041}})),e.CursorUp=Jh(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=Jh(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=Jh(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:11}})),e.CursorPageUpSelect=Jh(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:1035}})),e.CursorDown=Jh(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=Jh(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=Jh(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:12}})),e.CursorPageDownSelect=Jh(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:1036}})),e.CreateCursor=Jh(new class extends Ly{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i;i=t.wholeLine?iy.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):iy.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const s=i.modelState?i.modelState.position:null,o=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;i<r;i++){const r=n[i];if((!s||r.modelState.selection.containsPosition(s))&&(!o||r.viewState.selection.containsPosition(o)))return n.splice(i,1),e.model.pushStackElement(),void e.setCursorStates(t.source,3,n)}}n.push(i),e.model.pushStackElement(),e.setCursorStates(t.source,3,n)}}),e.LastCursorMoveToSelect=Jh(new class extends Ly{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),s=n.slice(0);s[i]=iy.moveTo(e,n[i],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,s)}});class a extends Ly{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iy.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorHome=Jh(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=Jh(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends Ly{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],s=n.modelState.position.lineNumber;t[i]=Hw.fromModelState(n.modelState.move(this._inSelectionMode,s,1,0))}return t}}e.CursorLineStart=Jh(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=Jh(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:0,mac:{primary:1311}}}));class h extends Ly{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iy.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealPrimaryCursor(t.source,!0)}}e.CursorEnd=Jh(new h({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:yy.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},metadata:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:J.b("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=Jh(new h({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:yy.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},metadata:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:J.b("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class d extends Ly{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e,e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e,t){const i=[];for(let n=0,s=t.length;n<s;n++){const s=t[n],o=s.modelState.position.lineNumber,r=e.model.getLineMaxColumn(o);i[n]=Hw.fromModelState(s.modelState.move(this._inSelectionMode,o,r,0))}return i}}e.CursorLineEnd=Jh(new d({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=Jh(new d({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:0,mac:{primary:1315}}}));class c extends Ly{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iy.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorTop=Jh(new c({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=Jh(new c({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:3086,mac:{primary:3088}}}));class u extends Ly{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iy.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorBottom=Jh(new u({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=Jh(new u({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:3085,mac:{primary:3090}}}));class g extends Ly{constructor(){super({id:"editorScroll",precondition:void 0,metadata:ky.metadata})}determineScrollMethod(e){return[6].includes(e.unit)&&[4,2].includes(e.direction)?this._runHorizontalEditorScroll.bind(this):[1,2,3,4,5,6].includes(e.unit)&&[1,3].includes(e.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(e,t){const i=ky.parse(t);if(!i)return;const n=this.determineScrollMethod(i);n&&n(e,t.source,i)}_runVerticalEditorScroll(e,t,i){const n=this._computeDesiredScrollTop(e,i);if(i.revealCursor){const s=e.getCompletelyVisibleViewRangeAtScrollTop(n);e.setCursorStates(t,3,[iy.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),s,i.select)])}e.viewLayout.setScrollPosition({scrollTop:n},0)}_computeDesiredScrollTop(e,t){if(1===t.unit){const i=e.viewLayout.getFutureViewport(),n=e.getCompletelyVisibleViewRangeAtScrollTop(i.top),s=e.coordinatesConverter.convertViewRangeToModelRange(n);let o;o=1===t.direction?Math.max(1,s.startLineNumber-t.value):Math.min(e.model.getLineCount(),s.startLineNumber+t.value);const r=e.coordinatesConverter.convertModelPositionToViewPosition(new Ci(o,1));return e.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber)}if(5===t.unit){let i=0;return 3===t.direction&&(i=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(i)}let i;i=3===t.unit?e.cursorConfig.pageSize*t.value:4===t.unit?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;const n=(1===t.direction?-1:1)*i;return e.viewLayout.getCurrentScrollTop()+n*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,i){const n=this._computeDesiredScrollLeft(e,i);e.viewLayout.setScrollPosition({scrollLeft:n},0)}_computeDesiredScrollLeft(e,t){const i=(4===t.direction?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+i*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=g,e.EditorScroll=Jh(new g),e.ScrollLineUp=Jh(new class extends Ly{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ky.RawDirection.Up,by:ky.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageUp=Jh(new class extends Ly{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ky.RawDirection.Up,by:ky.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorTop=Jh(new class extends Ly{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ky.RawDirection.Up,by:ky.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLineDown=Jh(new class extends Ly{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ky.RawDirection.Down,by:ky.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageDown=Jh(new class extends Ly{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ky.RawDirection.Down,by:ky.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorBottom=Jh(new class extends Ly{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ky.RawDirection.Down,by:ky.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLeft=Jh(new class extends Ly{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ky.RawDirection.Left,by:ky.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollRight=Jh(new class extends Ly{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ky.RawDirection.Right,by:ky.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}});class m extends Ly{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[iy.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),2!==t.revealType&&e.revealPrimaryCursor(t.source,!0,!0))}}e.WordSelect=Jh(new m({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=Jh(new m({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=Jh(new class extends Ly{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),s=n.slice(0),o=n[i];s[i]=iy.word(e,o,o.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,s)}});class f extends Ly{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[iy.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),2!==t.revealType&&e.revealPrimaryCursor(t.source,!1,!0))}}e.LineSelect=Jh(new f({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=Jh(new f({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class p extends Ly{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),s=n.slice(0);s[i]=iy.line(e,n[i],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,s)}}e.LastCursorLineSelect=Jh(new p({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=Jh(new p({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.CancelSelection=Jh(new class extends Ly{constructor(){super({id:"cancelSelection",precondition:yy.hasNonEmptySelection,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[iy.cancelSelection(e,e.getPrimaryCursorState())]),e.revealPrimaryCursor(t.source,!0)}}),e.RemoveSecondaryCursors=Jh(new class extends Ly{constructor(){super({id:"removeSecondaryCursors",precondition:yy.hasMultipleSelections,kbOpts:{weight:1,kbExpr:yy.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealPrimaryCursor(t.source,!0),wf(J.b("removedCursor","Removed secondary cursors"))}}),e.RevealLine=Jh(new class extends Ly{constructor(){super({id:"revealLine",precondition:void 0,metadata:xy.metadata})}runCoreEditorCommand(e,t){const i=t,n=i.lineNumber||0;let s="number"==typeof n?n+1:parseInt(n)+1;s<1&&(s=1);const o=e.model.getLineCount();s>o&&(s=o);const r=new wi(s,1,s,e.model.getLineMaxColumn(s));let a=0;if(i.at)switch(i.at){case xy.RawAtArgument.Top:a=3;break;case xy.RawAtArgument.Center:a=1;break;case xy.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends Iy{constructor(){super(rd)}runDOMCommand(e){Fs&&(e.focus(),e.select()),e.ownerDocument.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[iy.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=Jh(new class extends Ly{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[Hw.fromModelSelection(t.selection)]))}})}(Ny||(Ny={}));const Ty=Ql.and(yy.textInputFocus,yy.columnSelection);function My(e,t){Ih.registerKeybindingRule({id:e,primary:t,when:Ty,weight:1})}function Ay(e){return e.register(),e}var Oy;My(Ny.CursorColumnSelectLeft.id,1039),My(Ny.CursorColumnSelectRight.id,1041),My(Ny.CursorColumnSelectUp.id,1040),My(Ny.CursorColumnSelectPageUp.id,1035),My(Ny.CursorColumnSelectDown.id,1042),My(Ny.CursorColumnSelectPageDown.id,1036),function(e){class t extends Xh{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=Jh(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:yy.writable,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,fy.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=Jh(new class extends t{constructor(){super({id:"outdent",precondition:yy.writable,kbOpts:{weight:0,kbExpr:Ql.and(yy.editorTextFocus,yy.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,fy.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=Jh(new class extends t{constructor(){super({id:"tab",precondition:yy.writable,kbOpts:{weight:0,kbExpr:Ql.and(yy.editorTextFocus,yy.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,fy.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=Jh(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,s]=ey.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,s),t.setPrevEditOperationType(2)}}),e.DeleteRight=Jh(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:0,kbExpr:yy.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,s]=ey.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));n&&e.pushUndoStop(),e.executeCommands(this.id,s),t.setPrevEditOperationType(3)}}),e.Undo=new class extends Iy{constructor(){super(sd)}runDOMCommand(e){e.ownerDocument.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(91))return t.getModel().undo()}},e.Redo=new class extends Iy{constructor(){super(od)}runDOMCommand(e){e.ownerDocument.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(91))return t.getModel().redo()}}}(Oy||(Oy={}));class Ry extends Zh{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(yl).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Py(e,t){Ay(new Ry("default:"+e,e)),Ay(new Ry(e,e,t))}Py("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),Py("replacePreviousChar"),Py("compositionType"),Py("compositionStart"),Py("compositionEnd"),Py("paste"),Py("cut");class Fy{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Ny.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new Ci(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(78)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(78)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=K.g&&t.get(107),n=t.get(22);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Ny.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Ny.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Ny.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Ny.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Ny.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Ny.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Ny.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Ny.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Ny.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Ny.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Ny.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Ny.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Ny.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class By{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new $e("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(t<i){const i=t-e+1;return this._rendLineNumberStart-=i,null}if(e>n)return null;let s=0,o=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===o?(s=i,o=1):o++)}if(e<i){let n=0;n=t<i?t-e+1:i-e,this._rendLineNumberStart-=n}return this._lines.splice(s,o)}onLinesChanged(e,t){const i=e+t-1;if(0===this.getCount())return!1;const n=this.getStartLineNumber(),s=this.getEndLineNumber();let o=!1;for(let t=e;t<=i;t++)t>=n&&t<=s&&(this._lines[t-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),s=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>s)return null;if(i+e>s){return this._lines.splice(e-this._rendLineNumberStart,s-e+1)}const o=[];for(let e=0;e<i;e++)o[e]=this._createLine();const r=e-this._rendLineNumberStart,a=this._lines.slice(0,r),l=this._lines.slice(r,this._lines.length-i),h=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=a.concat(o).concat(l),h}onTokensChanged(e){if(0===this.getCount())return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let n=!1;for(let s=0,o=e.length;s<o;s++){const o=e[s];if(o.toLineNumber<t||o.fromLineNumber>i)continue;const r=Math.max(t,o.fromLineNumber),a=Math.min(i,o.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class Wy{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new By(()=>this._host.createVisibleLine())}_createDomNode(){const e=ll(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(144)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e].getDomNode();i&&this.domNode.domNode.removeChild(i)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e].getDomNode();i&&this.domNode.domNode.removeChild(i)}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const t=this._linesCollection._get(),i=new Vy(this.domNode.domNode,this._host,e),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},s=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(s.rendLineNumberStart,s.lines)}}class Vy{constructor(e,t,i){this.domNode=e,this.host=t,this.viewportData=i}render(e,t,i,n){const s={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(s.rendLineNumberStart+s.linesLength-1<t||i<s.rendLineNumberStart){s.rendLineNumberStart=t,s.linesLength=i-t+1,s.lines=[];for(let e=t;e<=i;e++)s.lines[e-t]=this.host.createVisibleLine();return this._finishRendering(s,!0,n),s}if(this._renderUntouchedLines(s,Math.max(t-s.rendLineNumberStart,0),Math.min(i-s.rendLineNumberStart,s.linesLength-1),n,t),s.rendLineNumberStart>t){const e=t,o=Math.min(i,s.rendLineNumberStart-1);e<=o&&(this._insertLinesBefore(s,e,o,n,t),s.linesLength+=o-e+1)}else if(s.rendLineNumberStart<t){const e=Math.min(s.linesLength,t-s.rendLineNumberStart);e>0&&(this._removeLinesBefore(s,e),s.linesLength-=e)}if(s.rendLineNumberStart=t,s.rendLineNumberStart+s.linesLength-1<i){const e=s.rendLineNumberStart+s.linesLength,o=i;e<=o&&(this._insertLinesAfter(s,e,o,n,t),s.linesLength+=o-e+1)}else if(s.rendLineNumberStart+s.linesLength-1>i){const e=Math.max(0,i-s.rendLineNumberStart+1),t=s.linesLength-1-e+1;t>0&&(this._removeLinesAfter(s,t),s.linesLength-=t)}return this._finishRendering(s,!1,n),s}_renderUntouchedLines(e,t,i,n,s){const o=e.rendLineNumberStart,r=e.lines;for(let e=t;e<=i;e++){const t=o+e;r[e].layoutLine(t,n[t-s])}}_insertLinesBefore(e,t,i,n,s){const o=[];let r=0;for(let e=t;e<=i;e++)o[r++]=this.host.createVisibleLine();e.lines=o.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const t=e.lines[i].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,n,s){const o=[];let r=0;for(let e=t;e<=i;e++)o[r++]=this.host.createVisibleLine();e.lines=e.lines.concat(o)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let n=0;n<t;n++){const t=e.lines[i+n].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,n){Vy._ttPolicy&&(i=Vy._ttPolicy.createHTML(i));const s=this.domNode.lastChild;t||!s?this.domNode.innerHTML=i:s.insertAdjacentHTML("afterend",i);let o=this.domNode.lastChild;for(let t=e.linesLength-1;t>=0;t--){const i=e.lines[t];n[t]&&(i.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");Vy._ttPolicy&&(t=Vy._ttPolicy.createHTML(t)),n.innerHTML=t;for(let t=0;t<e.linesLength;t++){const s=e.lines[t];if(i[t]){const e=n.firstChild,t=s.getDomNode();t.parentNode.replaceChild(e,t),s.setDomNode(e)}}}_finishRendering(e,t,i){const n=Vy._sb,s=e.linesLength,o=e.lines,r=e.rendLineNumberStart,a=[];{n.reset();let l=!1;for(let e=0;e<s;e++){const t=o[e];a[e]=!1;if(t.getDomNode())continue;t.renderLine(e+r,i[e],this.viewportData,n)&&(a[e]=!0,l=!0)}l&&this._finishRenderingNewLines(e,t,n.build(),a)}{n.reset();let t=!1;const l=[];for(let e=0;e<s;e++){const s=o[e];if(l[e]=!1,a[e])continue;s.renderLine(e+r,i[e],this.viewportData,n)&&(l[e]=!0,t=!0)}t&&this._finishRenderingInvalidLines(e,n.build(),l)}}}Vy._ttPolicy=bd("editorViewLayer",{createHTML:e=>e}),Vy._sb=new Bd(1e5);class Hy extends eb{constructor(e){super(e),this._visibleLines=new Wy(this),this.domNode=this._visibleLines.domNode;const t=this._context.configuration.options.get(50);hl(this.domNode,t),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++){if(this._dynamicOverlays[e].shouldRender())return!0}return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++){this._dynamicOverlays[e].dispose()}this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new zy(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++){this._visibleLines.getVisibleLine(n).onConfigurationChanged(e)}const n=this._context.configuration.options.get(50);return hl(this.domNode,n),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const t=this._dynamicOverlays.filter(e=>e.shouldRender());for(let i=0,n=t.length;i<n;i++){const n=t[i];n.prepareRender(e),n.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class zy{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(67),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=ll(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(67)}renderLine(e,t,i,n){let s="";for(let t=0,n=this._dynamicOverlays.length;t<n;t++){s+=this._dynamicOverlays[t].render(i.startLineNumber,e)}return this._renderedContent!==s&&(this._renderedContent=s,n.appendString('<div style="position:absolute;top:'),n.appendString(String(t)),n.appendString("px;width:100%;height:"),n.appendString(String(this._lineHeight)),n.appendString('px;">'),n.appendString(s),n.appendString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class Ky extends Hy{constructor(e){super(e);const t=this._context.configuration.options.get(144);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(144);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class Uy extends Hy{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(144);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),hl(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;hl(this.domNode,t.get(50));const i=t.get(144);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class jy{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;null===(t=this.onKeyDown)||void 0===t||t.call(this,e)}emitKeyUp(e){var t;null===(t=this.onKeyUp)||void 0===t||t.call(this,e)}emitContextMenu(e){var t;null===(t=this.onContextMenu)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;null===(t=this.onMouseMove)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;null===(t=this.onMouseLeave)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;null===(t=this.onMouseDown)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;null===(t=this.onMouseUp)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;null===(t=this.onMouseDrag)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;null===(t=this.onMouseDrop)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;null===(e=this.onMouseDropCanceled)||void 0===e||e.call(this)}emitMouseWheel(e){var t;null===(t=this.onMouseWheel)||void 0===t||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return jy.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),5!==i.type&&8!==i.type||(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new Ci(e.afterLineNumber,1)).lineNumber}}}i("ZU3w");class qy extends eb{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ll(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const t=this._context.configuration.options.get(144),i=t.contentWidth-t.verticalScrollbarWidth;this.contentWidth!==i&&(this.contentWidth=i,e=!0);const n=t.contentLeft;return this.contentLeft!==n&&(this.contentLeft=n,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var t;let i=0;const n=e.getDecorationsInViewport();for(const s of n){if(!s.options.blockClassName)continue;let n,o,r=this.blocks[i];r||(r=this.blocks[i]=ll(document.createElement("div")),this.domNode.appendChild(r)),s.options.blockIsAfterEnd?(n=e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!1),o=e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!0)):(n=e.getVerticalOffsetForLineNumber(s.range.startLineNumber,!0),o=s.range.isEmpty()&&!s.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(s.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!0));const[a,l,h,d]=null!==(t=s.options.blockPadding)&&void 0!==t?t:[0,0,0,0];r.setClassName("blockDecorations-block "+s.options.blockClassName),r.setLeft(this.contentLeft-d),r.setWidth(this.contentWidth+d+l),r.setTop(n-e.scrollTop-a),r.setHeight(o-n+a+h),i++}for(let e=i;e<this.blocks.length;e++)this.blocks[e].domNode.remove();this.blocks.length=i}}class $y extends eb{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=ll(document.createElement("div")),tb.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=ll(document.createElement("div")),tb.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new Gy(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n,s){this._widgets[e.getId()].setPosition(t,i,n,s),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.parentNode.removeChild(i),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class Gy{constructor(e,t,i){this._primaryAnchor=new Zy(null,null),this._secondaryAnchor=new Zy(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=ll(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const n=this._context.configuration.options,s=n.get(144);this._fixedOverflowWidgets=n.get(42),this._contentWidth=s.contentWidth,this._contentLeft=s.contentLeft,this._lineHeight=n.get(67),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(67),e.hasChanged(144)){const e=t.get(144);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){function n(e,t,i){if(!e)return new Zy(null,null);const n=t.model.validatePosition(e);if(t.coordinatesConverter.modelPositionIsVisible(n)){const s=t.coordinatesConverter.convertModelPositionToViewPosition(n,null!=i?i:void 0);return new Zy(e,s)}return new Zy(e,null)}this._affinity=e,this._primaryAnchor=n(t,this._context.viewModel,this._affinity),this._secondaryAnchor=n(i,this._context.viewModel,this._affinity)}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(null==t?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,n){this._setPosition(n,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const s=e.top,o=s,r=e.top+e.height,a=s-i,l=o>=i,h=r,d=n.viewportHeight-r>=i;let c=e.left;return c+t>n.scrollLeft+n.viewportWidth&&(c=n.scrollLeft+n.viewportWidth-t),c<n.scrollLeft&&(c=n.scrollLeft),{fitsAbove:l,aboveTop:a,fitsBelow:d,belowTop:h,left:c}}_layoutHorizontalSegmentInPage(e,t,i,n){var s;const o=Math.max(15,t.left-n),r=Math.min(t.left+t.width+n,e.width-15),a=this._viewDomNode.domNode.ownerDocument.defaultView;let l=t.left+i-(null!==(s=null==a?void 0:a.scrollX)&&void 0!==s?s:0);if(l+n>r){const e=l-(r-n);l-=e,i-=e}if(l<o){const e=l-o;l-=e,i-=e}return[i,l]}_layoutBoxInPage(e,t,i,n){var s,o;const r=e.top-i,a=e.top+e.height,l=aa(this._viewDomNode.domNode),h=this._viewDomNode.domNode.ownerDocument,d=h.defaultView,c=l.top+r-(null!==(s=null==d?void 0:d.scrollY)&&void 0!==s?s:0),u=l.top+a-(null!==(o=null==d?void 0:d.scrollY)&&void 0!==o?o:0),g=sa(h.body),[m,f]=this._layoutHorizontalSegmentInPage(g,l,e.left-n.scrollLeft+this._contentLeft,t),p=c>=22,_=u+i<=g.height-22;return this._fixedOverflowWidgets?{fitsAbove:p,aboveTop:Math.max(c,22),fitsBelow:_,belowTop:u,left:f}:{fitsAbove:p,aboveTop:r,fitsBelow:_,belowTop:a,left:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Yy(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;return{primary:n(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),secondary:n((null===(t=this._secondaryAnchor.viewPosition)||void 0===t?void 0:t.lineNumber)===(null===(i=this._primaryAnchor.viewPosition)||void 0===i?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,this._affinity,this._lineHeight)};function n(t,i,n){if(!t)return null;const s=e.visibleRangeForPosition(t);if(!s)return null;const o=1===t.column&&3===i?0:s.left,r=e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop;return new Qy(r,o,n)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(50);let s=t.left;return s=s<e.left?Math.max(s,e.left-i+n.typicalFullwidthCharacterWidth):Math.min(s,e.left+i-n.typicalFullwidthCharacterWidth),new Qy(e.top,s,e.height)}_prepareRenderWidget(e){if(!this._preference||0===this._preference.length)return null;const{primary:t,secondary:i}=this._getAnchorsCoordinates(e);if(!t)return null;if(-1===this._cachedDomNodeOffsetWidth||-1===this._cachedDomNodeOffsetHeight){let e=null;if("function"==typeof this._actual.beforeRender&&(e=Xy(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{const e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}const n=this._reduceAnchorCoordinates(t,i,this._cachedDomNodeOffsetWidth);let s;s=this.allowEditorOverflow?this._layoutBoxInPage(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let e=1;e<=2;e++)for(const t of this._preference)if(1===t){if(!s)return null;if(2===e||s.fitsAbove)return{coordinate:new Yy(s.aboveTop,s.left),position:1}}else{if(2!==t)return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new Yy(n.top,n.left)),position:0}:{coordinate:new Yy(n.top,n.left),position:0};if(!s)return null;if(2===e||s.fitsBelow)return{coordinate:new Yy(s.belowTop,s.left),position:2}}return null}onBeforeRender(e){this._primaryAnchor.viewPosition&&this._preference&&(this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&Xy(this._actual.afterRender,this._actual,null));this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),"function"==typeof this._actual.afterRender&&Xy(this._actual.afterRender,this._actual,this._renderData.position)}}class Zy{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class Yy{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class Qy{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function Xy(e,t,...i){try{return e.call(t,...i)}catch(e){return null}}i("yczy");class Jy extends kC{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(144);this._lineHeight=t.get(67),this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new yi(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const e of this._selections)t.add(e.positionLineNumber);const i=Array.from(t);i.sort((e,t)=>e-t),s(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(e=>e.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(144);return this._lineHeight=t.get(67),this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=[];for(let e=t;e<=i;e++){n[e-t]=""}if(this._wordWrap){const s=this._renderOne(e,!1);for(const e of this._cursorLineNumbers){const o=this._context.viewModel.coordinatesConverter,r=o.convertViewPositionToModelPosition(new Ci(e,1)).lineNumber,a=o.convertModelPositionToViewPosition(new Ci(r,1)).lineNumber,l=o.convertModelPositionToViewPosition(new Ci(r,this._context.viewModel.model.getLineMaxColumn(r))).lineNumber,h=Math.max(a,t),d=Math.min(l,i);for(let e=h;e<=d;e++){n[e-t]=s}}}const s=this._renderOne(e,!0);for(const e of this._cursorLineNumbers){if(e<t||e>i)continue;n[e-t]=s}this._renderData=n}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class eS extends Jy{_renderOne(e,t){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-both":"")+(t?" current-line-exact":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class tS extends Jy{_renderOne(e,t){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")+(this._shouldRenderInMargin()&&t?" current-line-exact-margin":"")}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}TC((e,t)=>{const i=e.getColor(AC);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(OC)){const i=e.getColor(OC);i&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),db(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});i("+iC4");class iS extends kC{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.options.className&&(i[n++]=s)}i=i.sort((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return i<n?-1:i>n?1:wi.compareRangesUsingStarts(e.range,t.range)});const s=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=[];for(let e=s;e<=o;e++){r[e-s]=""}this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),s=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(!r.options.isWholeLine)continue;const a='<div class="cdr '+r.options.className+'" style="left:0;width:100%;height:'+n+'px;"></div>',l=Math.max(r.range.startLineNumber,s),h=Math.min(r.range.endLineNumber,o);for(let e=l;e<=h;e++){i[e-s]+=a}}}_renderNormalDecorations(e,t,i){var n;const s=String(this._lineHeight),o=e.visibleRange.startLineNumber;let r=null,a=!1,l=null,h=!1;for(let d=0,c=t.length;d<c;d++){const c=t[d];if(c.options.isWholeLine)continue;const u=c.options.className,g=Boolean(c.options.showIfCollapsed);let m=c.range;g&&1===m.endColumn&&m.endLineNumber!==m.startLineNumber&&(m=new wi(m.startLineNumber,m.startColumn,m.endLineNumber-1,this._context.viewModel.getLineMaxColumn(m.endLineNumber-1))),r===u&&a===g&&wi.areIntersectingOrTouching(l,m)?l=wi.plusRange(l,m):(null!==r&&this._renderNormalDecoration(e,l,r,h,a,s,o,i),r=u,a=g,l=m,h=null!==(n=c.options.shouldFillLineOnLineBreak)&&void 0!==n&&n)}null!==r&&this._renderNormalDecoration(e,l,r,h,a,s,o,i)}_renderNormalDecoration(e,t,i,n,s,o,r,a){const l=e.linesVisibleRangesForRange(t,"findMatch"===i);if(l)for(let e=0,t=l.length;e<t;e++){const t=l[e];if(t.outsideRenderedLine)continue;const h=t.lineNumber-r;if(s&&1===t.ranges.length){const e=t.ranges[0];if(e.width<this._typicalHalfwidthCharacterWidth){const i=Math.round(e.left+e.width/2),n=Math.max(0,Math.round(i-this._typicalHalfwidthCharacterWidth/2));t.ranges[0]=new sb(n,this._typicalHalfwidthCharacterWidth)}}for(let e=0,s=t.ranges.length;e<s;e++){const r=n&&t.continuesOnNextLine&&1===s,l=t.ranges[e],d='<div class="cdr '+i+'" style="left:'+String(l.left)+(r?"px;width:100%;height:":"px;width:"+String(l.width)+"px;height:")+o+'px;"></div>';a[h]+=d}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class nS extends eb{constructor(e,t,i,n){super(e);const s=this._context.configuration.options,o=s.get(103),r=s.get(75),a=s.get(40),l=s.get(106),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+EC(e.theme.type),useShadows:!1,lazyRender:!0,vertical:o.vertical,horizontal:o.horizontal,verticalHasArrows:o.verticalHasArrows,horizontalHasArrows:o.horizontalHasArrows,verticalScrollbarSize:o.verticalScrollbarSize,verticalSliderSize:o.verticalSliderSize,horizontalScrollbarSize:o.horizontalScrollbarSize,horizontalSliderSize:o.horizontalSliderSize,handleMouseWheel:o.handleMouseWheel,alwaysConsumeMouseWheel:o.alwaysConsumeMouseWheel,arrowSize:o.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:o.scrollByPage};this.scrollbar=this._register(new nC(t.domNode,h,this._context.viewLayout.getScrollable())),tb.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=ll(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(Zr(i.domNode,"scroll",e=>d(i.domNode,!0,!0))),this._register(Zr(t.domNode,"scroll",e=>d(t.domNode,!0,!1))),this._register(Zr(n.domNode,"scroll",e=>d(n.domNode,!0,!1))),this._register(Zr(this.scrollbarDomNode.domNode,"scroll",e=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(144);this.scrollbarDomNode.setLeft(t.contentLeft);"right"===e.get(73).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(103)||e.hasChanged(75)||e.hasChanged(40)){const e=this._context.configuration.options,t=e.get(103),i=e.get(75),n=e.get(40),s=e.get(106),o={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:s};this.scrollbar.updateOptions(o)}return e.hasChanged(144)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+EC(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}i("Ll4U");class sS{constructor(e,t,i,n,s){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=null!=s?s:0}}class oS{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class rS{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class aS extends kC{_render(e,t,i){const n=[];for(let i=e;i<=t;i++){n[i-e]=new rS}if(0===i.length)return n;i.sort((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1);let s=null,o=0;for(let r=0,a=i.length;r<a;r++){const a=i[r],l=a.className,h=a.zIndex;let d=Math.max(a.startLineNumber,e)-e;const c=Math.min(a.endLineNumber,t)-e;s===l?(d=Math.max(o+1,d),o=Math.max(o,c)):(s=l,o=c);for(let e=d;e<=o;e++)n[e].add(new oS(l,h,a.tooltip))}return n}}class lS extends eb{constructor(e){super(e),this._widgets={},this._context=e;const t=this._context.configuration.options,i=t.get(144);this.domNode=ll(document.createElement("div")),this.domNode.setClassName("glyph-margin-widgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this._lineHeight=t.get(67),this._glyphMargin=t.get(57),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(144);return this._lineHeight=t.get(67),this._glyphMargin=t.get(57),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}addWidget(e){const t=ll(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:e.getPosition(),domNode:t,renderInfo:null},t.setPosition("absolute"),t.setDisplay("none"),t.setAttribute("widgetId",e.getId()),this.domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return(i.preference.lane!==t.lane||i.preference.zIndex!==t.zIndex||!wi.equalsRange(i.preference.range,t.range))&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){var t;const i=e.getId();if(this._widgets[i]){const e=this._widgets[i].domNode.domNode;delete this._widgets[i],null===(t=e.parentNode)||void 0===t||t.removeChild(e),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){var i,n,s;const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=e.getDecorationsInViewport();for(const e of a){const a=e.options.glyphMarginClassName;if(!a)continue;const l=Math.max(e.range.startLineNumber,o),h=Math.min(e.range.endLineNumber,r),d=null!==(n=null===(i=e.options.glyphMargin)||void 0===i?void 0:i.position)&&void 0!==n?n:mu.Center,c=null!==(s=e.options.zIndex)&&void 0!==s?s:0;for(let e=l;e<=h;e++){const i=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Ci(e,0)),n=this._context.viewModel.glyphLanes.getLanesAtLine(i.lineNumber).indexOf(d);t.push(new hS(e,n,c,a))}}}_collectWidgetBasedGlyphRenderRequest(e,t){const i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(const e of Object.values(this._widgets)){const s=e.preference.range,{startLineNumber:o,endLineNumber:r}=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(wi.lift(s));if(!o||!r||r<i||o>n)continue;const a=Math.max(o,i),l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Ci(a,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(l.lineNumber).indexOf(e.preference.lane);t.push(new dS(a,h,e.preference.zIndex,e))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((e,t)=>e.lineNumber===t.lineNumber?e.laneIndex===t.laneIndex?e.zIndex===t.zIndex?t.type===e.type?0===e.type&&0===t.type?e.className<t.className?-1:1:0:t.type-e.type:t.zIndex-e.zIndex:e.laneIndex-t.laneIndex:e.lineNumber-t.lineNumber),t}prepareRender(e){if(!this._glyphMargin)return void(this._decorationGlyphsToRender=[]);for(const e of Object.values(this._widgets))e.renderInfo=null;const t=new S(this._collectSortedGlyphRenderRequests(e)),i=[];for(;t.length>0;){const e=t.peek();if(!e)break;const n=t.takeWhile(t=>t.lineNumber===e.lineNumber&&t.laneIndex===e.laneIndex);if(!n||0===n.length)break;const s=n[0];if(0===s.type){const e=[];for(const t of n){if(t.zIndex!==s.zIndex||t.type!==s.type)break;0!==e.length&&e[e.length-1]===t.className||e.push(t.className)}i.push(s.accept(e.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,laneIndex:s.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const e of Object.values(this._widgets))e.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const e=this._managedDomNodes.pop();null==e||e.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(i.renderInfo){const n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],s=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(s),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}else i.domNode.setDisplay("none");for(let i=0;i<this._decorationGlyphsToRender.length;i++){const n=this._decorationGlyphsToRender[i],s=e.viewportData.relativeVerticalOffset[n.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+n.laneIndex*this._lineHeight;let r;i<this._managedDomNodes.length?r=this._managedDomNodes[i]:(r=ll(document.createElement("div")),this._managedDomNodes.push(r),this.domNode.appendChild(r)),r.setClassName("cgmr codicon "+n.combinedClassName),r.setPosition("absolute"),r.setTop(s),r.setLeft(o),r.setWidth(t),r.setHeight(this._lineHeight)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;){const e=this._managedDomNodes.pop();null==e||e.domNode.remove()}}}class hS{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new cS(this.lineNumber,this.laneIndex,e)}}class dS{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=1}}class cS{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}var uS;i("4Ir3");class gS extends st{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}!function(e){e[e.Disabled=0]="Disabled",e[e.EnabledForActive=1]="EnabledForActive",e[e.Enabled=2]="Enabled"}(uS||(uS={}));class mS{constructor(e,t,i,n,s,o){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=s,this.forWrappedLinesBeforeOrAtColumn=o,-1!==e==(-1!==t))throw new Error}}class fS{constructor(e,t){this.top=e,this.endColumn=t}}class pS extends gS{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return function(e,t){let i=0,n=0;const s=e.length;for(;n<s;){const s=e.charCodeAt(n);if(32===s)i++;else{if(9!==s)break;i=i-i%t+t}n++}return n===s?-1:i}(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new $e("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=Boolean(s&&s.offSide);let r=-2,a=-1,l=-2,h=-1;const d=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,h=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){l=t,h=e;break}}}};let c=-2,u=-1,g=-2,m=-1;const f=e=>{if(-2===c){c=-1,u=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){c=t,u=e;break}}}if(-1!==g&&(-2===g||g<e-1)){g=-1,m=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){g=t,m=e;break}}}};let p=0,_=!0,v=0,b=!0,C=0,w=0;for(let s=0;_||b;s++){const r=e-s,g=e+s;s>1&&(r<1||r<t)&&(_=!1),s>1&&(g>n||g>i)&&(b=!1),s>5e4&&(_=!1,b=!1);let y=-1;if(_&&r>=1){const e=this._computeIndentLevel(r-1);e>=0?(l=r-1,h=e,y=Math.ceil(e/this.textModel.getOptions().indentSize)):(d(r),y=this._getIndentLevelForWhitespaceLine(o,a,h))}let S=-1;if(b&&g<=n){const e=this._computeIndentLevel(g-1);e>=0?(c=g-1,u=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(f(g),S=this._getIndentLevelForWhitespaceLine(o,u,m))}if(0!==s){if(1===s){if(g<=n&&S>=0&&w+1===S){_=!1,p=g,v=g,C=S;continue}if(r>=1&&y>=0&&y-1===w){b=!1,p=r,v=r,C=y;continue}if(p=e,v=e,C=w,0===C)return{startLineNumber:p,endLineNumber:v,indent:C}}_&&(y>=C?p=r:_=!1),b&&(S>=C?v=g:b=!1)}else w=y}return{startLineNumber:p,endLineNumber:v,indent:C}}getLinesBracketGuides(e,t,i,n){var s;const o=[];for(let i=e;i<=t;i++)o.push([]);const r=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new wi(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let a=void 0;if(i&&r.length>0){a=null===(s=Ru((e<=i.lineNumber&&i.lineNumber<=t?r:this.textModel.bracketPairs.getBracketPairsInRange(wi.fromPositions(i)).toArray()).filter(e=>wi.strictContainsPosition(e.range,i)),e=>!0))||void 0===s?void 0:s.range}const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,h=new _S;for(const i of r){if(!i.closingBracketRange)continue;const s=a&&i.range.equalsRange(a);if(!s&&!n.includeInactive)continue;const r=h.getInlineClassName(i.nestingLevel,i.nestingLevelOfEqualBracketType,l)+(n.highlightActive&&s?" "+h.activeClassName:""),d=i.openingBracketRange.getStartPosition(),c=i.closingBracketRange.getStartPosition(),u=n.horizontalGuides===uS.Enabled||n.horizontalGuides===uS.EnabledForActive&&s;if(i.range.startLineNumber===i.range.endLineNumber){u&&o[i.range.startLineNumber-e].push(new mS(-1,i.openingBracketRange.getEndPosition().column,r,new fS(!1,c.column),-1,-1));continue}const g=this.getVisibleColumnFromPosition(c),m=this.getVisibleColumnFromPosition(i.openingBracketRange.getStartPosition()),f=Math.min(m,g,i.minVisibleColumnIndentation+1);let p=!1;Zn(this.textModel.getLineContent(i.closingBracketRange.startLineNumber))<i.closingBracketRange.startColumn-1&&(p=!0);const _=Math.max(d.lineNumber,e),v=Math.min(c.lineNumber,t),b=p?1:0;for(let t=_;t<v+b;t++)o[t-e].push(new mS(f,-1,r,null,t===d.lineNumber?d.column:-1,t===c.lineNumber?c.column:-1));u&&(d.lineNumber>=e&&m>f&&o[d.lineNumber-e].push(new mS(f,-1,r,new fS(!1,d.column),-1,-1)),c.lineNumber<=t&&g>f&&o[c.lineNumber-e].push(new mS(f,-1,r,new fS(!p,c.column),-1,-1)))}for(const e of o)e.sort((e,t)=>e.visibleColumn-t.visibleColumn);return o}getVisibleColumnFromPosition(e){return Sb.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=this.textModel.getOptions(),s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=Boolean(s&&s.offSide),r=new Array(t-e+1);let a=-2,l=-1,h=-2,d=-1;for(let s=e;s<=t;s++){const t=s-e,c=this._computeIndentLevel(s-1);if(c>=0)a=s-1,l=c,r[t]=Math.ceil(c/n.indentSize);else{if(-2===a){a=-1,l=-1;for(let e=s-2;e>=0;e--){const t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==h&&(-2===h||h<s-1)){h=-1,d=-1;for(let e=s;e<i;e++){const t=this._computeIndentLevel(e);if(t>=0){h=e,d=t;break}}}r[t]=this._getIndentLevelForWhitespaceLine(o,l,d)}}return r}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return-1===t||-1===i?0:t<i?1+Math.floor(t/n.indentSize):t===i||e?Math.ceil(i/n.indentSize):1+Math.floor(i/n.indentSize)}}class _S{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,t,i){return this.getInlineClassNameOfLevel(i?t:e)}getInlineClassNameOfLevel(e){return"bracket-indent-guide lvl-"+e%30}}class vS extends kC{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(145),n=t.get(50);this._lineHeight=t.get(67),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(145),n=t.get(50);return this._lineHeight=t.get(67),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),!0}onCursorStateChanged(e){var t;const i=e.selections[0].getPosition();return!(null===(t=this._primaryPosition)||void 0===t?void 0:t.equals(i))&&(this._primaryPosition=i,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,n,s;if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=e.scrollWidth,l=this._lineHeight,h=this._primaryPosition,d=this.getGuidesByLine(o,Math.min(r+1,this._context.viewModel.getLineCount()),h),c=[];for(let h=o;h<=r;h++){const r=h-o,u=d[r];let g="";const m=null!==(i=null===(t=e.visibleRangeForPosition(new Ci(h,1)))||void 0===t?void 0:t.left)&&void 0!==i?i:0;for(const t of u){const i=-1===t.column?m+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new Ci(h,t.column)).left;if(i>a||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const o=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",r=t.horizontalLine?(null!==(s=null===(n=e.visibleRangeForPosition(new Ci(h,t.horizontalLine.endColumn)))||void 0===n?void 0:n.left)&&void 0!==s?s:i+this._spaceWidth)-i:this._spaceWidth;g+=`<div class="core-guide ${t.className} ${o}" style="left:${i}px;height:${l}px;width:${r}px"></div>`}c[r]=g}this._renderResult=c}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?uS.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?uS.EnabledForActive:uS.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,s=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let o=0,r=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);o=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),h=[];for(let i=e;i<=t;i++){const t=new Array;h.push(t);const d=n?n[i-e]:[],c=new S(d),u=s?s[i-e]:0;for(let e=1;e<=u;e++){const n=(e-1)*l+1,s=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===d.length)&&o<=i&&i<=r&&e===a;t.push(...c.takeWhile(e=>e.visibleColumn<n)||[]);const h=c.peek();h&&h.visibleColumn===n&&!h.horizontalLine||t.push(new mS(n,-1,"core-guide-indent lvl-"+(e-1)%30+(s?" indent-active":""),null,-1,-1))}t.push(...c.takeWhile(e=>!0)||[])}return h}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function bS(e){if(!e||!e.isTransparent())return e}TC((e,t)=>{const i=[{bracketColor:lw,guideColor:fw,guideColorActive:ww},{bracketColor:hw,guideColor:pw,guideColorActive:yw},{bracketColor:dw,guideColor:_w,guideColorActive:Sw},{bracketColor:cw,guideColor:vw,guideColorActive:Lw},{bracketColor:uw,guideColor:bw,guideColorActive:kw},{bracketColor:gw,guideColor:Cw,guideColorActive:Dw}],n=new _S,s=[{indentColor:HC,indentColorActive:$C},{indentColor:zC,indentColorActive:GC},{indentColor:KC,indentColorActive:ZC},{indentColor:UC,indentColorActive:YC},{indentColor:jC,indentColorActive:QC},{indentColor:qC,indentColorActive:XC}],o=i.map(t=>{var i,n;const s=e.getColor(t.bracketColor),o=e.getColor(t.guideColor),r=e.getColor(t.guideColorActive),a=bS(null!==(i=bS(o))&&void 0!==i?i:null==s?void 0:s.transparent(.3)),l=bS(null!==(n=bS(r))&&void 0!==n?n:s);if(a&&l)return{guideColor:a,guideColorActive:l}}).filter(M),r=s.map(t=>{const i=e.getColor(t.indentColor),n=e.getColor(t.indentColorActive),s=bS(i),o=bS(n);if(s&&o)return{indentColor:s,indentColorActive:o}}).filter(M);if(o.length>0){for(let e=0;e<30;e++){const i=o[e%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let e=0;e<30;e++){const i=r[e%r.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${i.indentColor}; --indent-color-active: ${i.indentColorActive}; }`)}t.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),t.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});i("fewy");class CS{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class wS{constructor(){this._currentVisibleRange=new wi(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class yS{constructor(e,t,i,n,s,o,r){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=s,this.stopScrollTop=o,this.scrollType=r,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class SS{constructor(e,t,i,n,s){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=s,this.type="selections";let o=t[0].startLineNumber,r=t[0].endLineNumber;for(let e=1,i=t.length;e<i;e++){const i=t[e];o=Math.min(o,i.startLineNumber),r=Math.max(r,i.endLineNumber)}this.minLineNumber=o,this.maxLineNumber=r}}class LS extends eb{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new Wy(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,n=this._context.configuration.options,s=n.get(50),o=n.get(145);this._lineHeight=n.get(67),this._typicalHalfwidthCharacterWidth=s.typicalHalfwidthCharacterWidth,this._isViewportWrapping=o.isViewportWrapping,this._revealHorizontalRightPadding=n.get(100),this._cursorSurroundingLines=n.get(29),this._cursorSurroundingLinesStyle=n.get(30),this._canUseLayerHinting=!n.get(32),this._viewLineOptions=new mb(i,this._context.theme.type),tb.write(this.domNode,8),this.domNode.setClassName("view-lines monaco-mouse-cursor-text"),hl(this.domNode,s),this._maxLineWidth=0,this._asyncUpdateLineWidths=new mo(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new mo(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new wS,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(115).enabled,this._maxNumberStickyLines=n.get(115).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new fb(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(145)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),n=t.get(145);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(100),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(115).enabled,this._maxNumberStickyLines=t.get(115).maxLineCount,hl(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(144)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new mb(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++){this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions)}return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let e=t;e<=i;e++)n=this._visibleLines.getVisibleLine(e).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new yS(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new SS(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new Ci(n,1);const s=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();if(n<s||n>o)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const a=this._context.viewModel.getLineMinColumn(n);return r<a&&(r=a),new Ci(n,r)}_getViewLineDomNode(e){for(;e&&1===e.nodeType;){if(e.className===fb.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++){if(e===this._visibleLines.getVisibleLine(n).getDomNode())return n}return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();if(e<t||e>i)return-1;const n=new CS(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=wi.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const s=[];let o=0;const r=new CS(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Ci(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),h=this._visibleLines.getEndLineNumber();for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(e<l||e>h)continue;const d=e===n.startLineNumber?n.startColumn:1,c=e!==n.endLineNumber,u=c?this._context.viewModel.getLineMaxColumn(e):n.endColumn,g=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,d,u,r);if(g){if(t&&e<i){const t=a;a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Ci(e+1,1)).lineNumber,t!==a&&(g.ranges[g.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}s[o++]=new nb(g.outsideRenderedLine,e,sb.from(g.ranges),c)}}return this._updateLineWidthsSlowIfDomDidLayout(r),0===o?null:s}_visibleRangesForLineRange(e,t,i){if(this.shouldRender())return null;if(e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;const n=new CS(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new rb(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,s=!0;for(let o=t;o<=i;o++){const t=this._visibleLines.getVisibleLine(o);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth(null)):s=!1}return s&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),s}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let s=i;s<=n;s++){const i=this._visibleLines.getVisibleLine(s);if(i.needsMonospaceFontCheck()){const n=i.getWidth(null);n>t&&(t=n,e=s)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=i;e<=n;e++){this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),K.g&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++){if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,s,o){const r=e.top,a=e.height,l=r+a;let h,d,c;if(s&&s.length>0){let e=s[0].startLineNumber,t=s[0].endLineNumber;for(let i=1,n=s.length;i<n;i++){const n=s[i];e=Math.min(e,n.startLineNumber),t=Math.max(t,n.endLineNumber)}h=!1,d=this._context.viewLayout.getVerticalOffsetForLineNumber(e),c=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!n)return-1;h=!0,d=this._context.viewLayout.getVerticalOffsetForLineNumber(n.startLineNumber),c=this._context.viewLayout.getVerticalOffsetForLineNumber(n.endLineNumber)+this._lineHeight}let u,g=0,m=0;if(("mouse"===t||i)&&"default"===this._cursorSurroundingLinesStyle)i||(g=this._lineHeight);else{const e=Math.min(a/this._lineHeight/2,this._cursorSurroundingLines);g=this._stickyScrollEnabled?Math.max(e,this._maxNumberStickyLines)*this._lineHeight:e*this._lineHeight,m=Math.max(0,e-1)*this._lineHeight}if(i||0!==o&&4!==o||(m+=this._lineHeight),d-=g,c+=m,c-d>a){if(!h)return-1;u=d}else if(5===o||6===o)if(6===o&&r<=d&&c<=l)u=r;else{const e=d-Math.max(5*this._lineHeight,.2*a),t=c-a;u=Math.max(t,e)}else if(1===o||2===o)if(2===o&&r<=d&&c<=l)u=r;else{const e=(d+c)/2;u=Math.max(0,e-a/2)}else u=this._computeMinimumScrolling(r,l,d,c,3===o,4===o);return u}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(144),n=t.left,s=n+t.width-i.verticalScrollbarWidth;let o=1073741824,r=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)o=Math.min(o,Math.round(e.left)),r=Math.max(r,Math.round(e.left+e.width))}else for(const t of e.selections){if(t.startLineNumber!==t.endLineNumber)return null;const e=this._visibleRangesForLineRange(t.startLineNumber,t.startColumn,t.endColumn);if(!e)return null;for(const t of e.ranges)o=Math.min(o,Math.round(t.left)),r=Math.max(r,Math.round(t.left+t.width))}if(e.minimalReveal||(o=Math.max(0,o-LS.HORIZONTAL_EXTRA_PX),r+=this._revealHorizontalRightPadding),"selections"===e.type&&r-o>t.width)return null;return{scrollLeft:this._computeMinimumScrolling(n,s,o,r),maxHorizontalOffset:r}}_computeMinimumScrolling(e,t,i,n,s,o){s=!!s,o=!!o;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)<r?s?i:o?Math.max(0,n-r):i<e?i:n>t?Math.max(0,n-r):e:i}}LS.HORIZONTAL_EXTRA_PX=30;i("afy/");class kS extends aS{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(144);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options.get(144);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){var t,i;const n=e.getDecorationsInViewport(),s=[];let o=0;for(let e=0,r=n.length;e<r;e++){const r=n[e],a=r.options.linesDecorationsClassName,l=r.options.zIndex;a&&(s[o++]=new sS(r.range.startLineNumber,r.range.endLineNumber,a,null!==(t=r.options.linesDecorationsTooltip)&&void 0!==t?t:null,l));const h=r.options.firstLineDecorationClassName;h&&(s[o++]=new sS(r.range.startLineNumber,r.range.startLineNumber,h,null!==(i=r.options.linesDecorationsTooltip)&&void 0!==i?i:null,l))}return s}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),s='" style="left:'+this._decorationsLeft.toString()+"px;width:"+this._decorationsWidth.toString()+'px;"></div>',o=[];for(let e=t;e<=i;e++){const i=e-t,r=n[i].getDecorations();let a="";for(const e of r){let t='<div class="cldr '+e.className;null!==e.tooltip&&(t+='" title="'+e.tooltip),t+=s,a+=t}o[i]=a}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}i("kLJU");class DS extends aS{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,s=t.length;e<s;e++){const s=t[e],o=s.options.marginClassName,r=s.options.zIndex;o&&(i[n++]=new sS(s.range.startLineNumber,s.range.endLineNumber,o,null,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),s=[];for(let e=t;e<=i;e++){const i=e-t,o=n[i].getDecorations();let r="";for(const e of o)r+='<div class="cmdr '+e.className+'" style=""></div>';s[i]=r}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}i("Z668");class xS{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=xS._clamp(e),this.g=xS._clamp(t),this.b=xS._clamp(i),this.a=xS._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}xS.Empty=new xS(0,0,0,0);class ES extends st{static getInstance(){return this._INSTANCE||(this._INSTANCE=Je(new ES)),this._INSTANCE}constructor(){super(),this._onDidChange=new ft,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(zi.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=zi.getColorMap();if(!e)return this._colors=[xS.Empty],void(this._backgroundIsLight=!0);this._colors=[xS.Empty];for(let t=1;t<e.length;t++){const i=e[t].rgba;this._colors[t]=new xS(i.r,i.g,i.b,Math.round(255*i.a))}const t=e[2].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}ES._INSTANCE=null;const NS=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();class IS{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=IS.soften(e,.8),this.charDataLight=IS.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,s=e.length;n<s;n++)i[n]=Jc(e[n]*t);return i}renderChar(e,t,i,n,s,o,r,a,l,h,d){const c=1*this.scale,u=2*this.scale,g=d?1:u;if(t+c>e.width||i+g>e.height)return void console.warn("bad render request outside image data");const m=h?this.charDataLight:this.charDataNormal,f=((e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e)(n,l),p=4*e.width,_=r.r,v=r.g,b=r.b,C=s.r-_,w=s.g-v,y=s.b-b,S=Math.max(o,a),L=e.data;let k=f*c*u,D=i*p+4*t;for(let e=0;e<g;e++){let e=D;for(let t=0;t<c;t++){const t=m[k++]/255*(o/255);L[e++]=_+C*t,L[e++]=v+w*t,L[e++]=b+y*t,L[e++]=S}D+=p}}blockRenderChar(e,t,i,n,s,o,r,a){const l=1*this.scale,h=2*this.scale,d=a?1:h;if(t+l>e.width||i+d>e.height)return void console.warn("bad render request outside image data");const c=4*e.width,u=s/255*.5,g=o.r,m=o.g,f=o.b,p=g+(n.r-g)*u,_=m+(n.g-m)*u,v=f+(n.b-f)*u,b=Math.max(s,r),C=e.data;let w=i*c+4*t;for(let e=0;e<d;e++){let e=w;for(let t=0;t<l;t++)C[e++]=p,C[e++]=_,C[e++]=v,C[e++]=b;w+=c}}}const TS={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},MS=e=>{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=TS[e[i]]<<4|15&TS[e[i+1]];return t},AS={1:Ge(()=>MS("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:Ge(()=>MS("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class OS{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=AS[e]?new IS(AS[e](),e):OS.createFromSampleData(OS.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font="bold 16px "+e,i.textBaseline="middle";let n=0;for(const e of NS)i.fillText(String.fromCharCode(e),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");const i=OS._downsample(e,t);return new IS(i,t)}static _downsampleChar(e,t,i,n,s){const o=1*s,r=2*s;let a=n,l=0;for(let n=0;n<r;n++){const s=n/r*16,h=(n+1)/r*16;for(let n=0;n<o;n++){const r=n/o*10,d=(n+1)/o*10;let c=0,u=0;for(let i=s;i<h;i++){const n=t+3840*Math.floor(i),s=1-(i-Math.floor(i));for(let t=r;t<d;t++){const i=1-(t-Math.floor(t)),o=n+4*Math.floor(t),r=i*s;u+=r,c+=e[o]*e[o+3]/255*r}}const g=c/u;l=Math.max(l,g),i[a++]=Jc(g)}}return l}static _downsample(e,t){const i=2*t*1*t,n=96*i,s=new Uint8ClampedArray(n);let o=0,r=0,a=0;for(let n=0;n<96;n++)a=Math.max(a,this._downsampleChar(e,r,s,o,t)),o+=i,r+=40;if(a>0){const e=255/a;for(let t=0;t<n;t++)s[t]*=e}return s}}class RS{constructor(e,t,i){const n=e.options,s=n.get(142),o=n.get(144),r=o.minimap,a=n.get(50),l=n.get(73);this.renderMinimap=r.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=r.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(105),this.paddingTop=n.get(84).top,this.paddingBottom=n.get(84).bottom,this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=s,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(67),this.minimapLeft=r.minimapLeft,this.minimapWidth=r.minimapWidth,this.minimapHeight=o.height,this.canvasInnerWidth=r.minimapCanvasInnerWidth,this.canvasInnerHeight=r.minimapCanvasInnerHeight,this.canvasOuterWidth=r.minimapCanvasOuterWidth,this.canvasOuterHeight=r.minimapCanvasOuterHeight,this.isSampling=r.minimapIsSampling,this.editorHeight=o.height,this.fontScale=r.minimapScale,this.minimapLineHeight=r.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=Ge(()=>OS.create(this.fontScale,a.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=RS._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=RS._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(xv);return i?new xS(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Ev);return t?xS._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class PS{constructor(e,t,i,n,s,o,r,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=s,this.sliderHeight=o,this.topPaddingLineCount=r,this.startLineNumber=a,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,s,o,r,a,l,h,d){const c=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let t=a*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(t+=Math.max(0,s-e.lineHeight-e.paddingBottom));const i=Math.max(1,Math.floor(s*s/t)),n=Math.max(0,e.minimapHeight-i),o=n/(h-s),d=l*o,c=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),g=Math.floor(e.paddingTop/e.lineHeight);return new PS(l,h,c,o,d,i,g,1,Math.min(r,u))}let f;if(o&&i!==r){const e=i-t+1;f=Math.floor(e*u/c)}else{const e=s/m;f=Math.floor(e*u/c)}const p=Math.floor(e.paddingTop/m);let _,v=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const e=s/m;v=Math.max(v,e-1)}if(v>0){_=(p+r+v-s/m-1)*u/c}else _=Math.max(0,(p+r)*u/c-f);_=Math.min(e.minimapHeight-f,_);const b=_/(h-s),C=l*b;if(g>=p+r+v){return new PS(l,h,_>0,b,C,f,p,1,r)}{let i,s;i=t>1?t+p:Math.max(1,l/m);let o=Math.max(1,Math.floor(i-C*c/u));o<p?(s=p-o+1,o=1):(s=0,o=Math.max(1,o-p)),d&&d.scrollHeight===h&&(d.scrollTop>l&&(o=Math.min(o,d.startLineNumber),s=Math.max(s,d.topPaddingLineCount)),d.scrollTop<l&&(o=Math.max(o,d.startLineNumber),s=Math.min(s,d.topPaddingLineCount)));const a=Math.min(r,o-s+g-1),_=(l-n)/m;let v;return v=l>=e.paddingTop?(t-o+s+_)*u/c:l/e.paddingTop*(s+_)*u/c,new PS(l,h,!0,b,v,f,s,o,a)}}}class FS{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}FS.INVALID=new FS(-1);class BS{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new By(()=>FS.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let e=0,i=t.length;e<i;e++)if(-1===t[e].dy)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class WS{constructor(e,t,i,n){this._backgroundFillData=WS._createBackgroundFillData(t,i,n),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){const n=i.r,s=i.g,o=i.b,r=i.a,a=new Uint8ClampedArray(e*t*4);let l=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++)a[l]=n,a[l+1]=s,a[l+2]=o,a[l+3]=r,l+=4;return a}}class VS{static compute(e,t,i){if(0===e.renderMinimap||!e.isSampling)return[null,[]];const{minimapLineCount:n}=ye.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),s=t/n,o=s/2;if(!i||0===i.minimapLines.length){const e=[];if(e[0]=1,n>1){for(let t=0,i=n-1;t<i;t++)e[t]=Math.round(t*s+o);e[n-1]=t}return[new VS(s,e),[]]}const r=i.minimapLines,a=r.length,l=[];let h=0,d=0,c=1;let u=[],g=null;for(let e=0;e<n;e++){const i=Math.max(c,Math.round(e*s)),m=Math.max(i,Math.round((e+1)*s));for(;h<a&&r[h]<i;){if(u.length<10){const e=h+1+d;g&&"deleted"===g.type&&g._oldIndex===h-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:h,deleteFromLineNumber:e,deleteToLineNumber:e},u.push(g)),d--}h++}let f;if(h<a&&r[h]<=m)f=r[h],h++;else if(f=0===e?1:e+1===n?t:Math.round(e*s+o),u.length<10){const t=h+1+d;g&&"inserted"===g.type&&g._i===e-1?g.insertToLineNumber++:(g={type:"inserted",_i:e,insertFromLineNumber:t,insertToLineNumber:t},u.push(g)),d++}l[e]=f,c=f}if(u.length<10)for(;h<a;){const e=h+1+d;g&&"deleted"===g.type&&g._oldIndex===h-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:h,deleteFromLineNumber:e,deleteToLineNumber:e},u.push(g)),d--,h++}else u=[{type:"flush"}];return[new VS(s,l),u]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1<this.minimapLines.length&&this.minimapLines[n+1]<=t;)n++;if(i===n){const n=this.minimapLines[i];if(n<e||n>t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let s=this.minimapLines.length-1;s>=0&&!(this.minimapLines[s]<e.fromLineNumber);s--)this.minimapLines[s]<=e.toLineNumber?(this.minimapLines[s]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,s),n=Math.max(n,s)):this.minimapLines[s]-=t;return[i,n]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class HS extends eb{constructor(e){super(e),this.tokensColorTracker=ES.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new RS(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=VS.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new zS(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new RS(this._context.configuration,this._context.theme,this.tokensColorTracker);return!this.options.equals(e)&&(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return!!e.affectsMinimap&&this._actual.onDecorationsChanged()}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return!!t&&this._actual.onLinesChanged(t[0],t[1]-t[0]+1)}return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged()}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){const t=[];for(const i of e.ranges){const e=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return!!t.length&&this._actual.onTokensChanged(t)}return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const n={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,i]=VS.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const e of i)switch(e.type){case"deleted":this._actual.onLinesDeleted(e.deleteFromLineNumber,e.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(e.insertFromLineNumber,e.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let s=0,o=t-e+1;s<o;s++)i[s]?n[s]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+s-1]):n[s]=null;return n}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(null===this._minimapSelections)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new yi(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],s=this._samplingState.minimapLines[t-1];i=new wi(n,1,s,this._context.viewModel.getLineMaxColumn(s))}else i=new wi(e,1,t,this._context.viewModel.getLineMaxColumn(t));const n=this._context.viewModel.getMinimapDecorationsInRange(i);if(this._samplingState){const e=[];for(const t of n){if(!t.options.minimap)continue;const i=t.range,n=this._samplingState.modelLineToMinimapLine(i.startLineNumber),s=this._samplingState.modelLineToMinimapLine(i.endLineNumber);e.push(new zm(new wi(n,i.startColumn,s,i.endColumn),t.options))}return e}return n}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new wi(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class zS extends st{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(Sv),this._domNode=ll(document.createElement("div")),tb.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ll(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ll(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ll(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ll(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=ll(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Qr(this._domNode.domNode,Ma.POINTER_DOWN,e=>{e.preventDefault();if(0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(0===e.button&&this._lastRenderData){const t=aa(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)}),this._sliderPointerMoveMonitor=new Uf,this._sliderPointerDownListener=Qr(this._slider.domNode,Ma.POINTER_DOWN,e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Vb.addTarget(this._domNode.domNode),this._sliderTouchStartListener=Zr(this._domNode.domNode,Bb.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=Zr(this._domNode.domNode,Bb.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=Qr(this._domNode.domNode,Bb.End,e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!(e.target&&e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const s=(e,s)=>{const o=aa(this._domNode.domNode),r=Math.min(Math.abs(s-n),Math.abs(s-o.left),Math.abs(s-o.left-o.width));if(K.n&&r>140)return void this._model.setScrollTop(i.scrollTop);const a=e-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(a))};e.pageY!==t&&s(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>s(e.pageY,e.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return"always"===this._model.options.showSlider?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new WS(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Sv),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=PS.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(wi.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0));const{canvasInnerWidth:n,canvasInnerHeight:s}=this._model.options,o=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,s);const h=new KS(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,h,e,o),this._renderDecorationsLineHighlights(l,i,h,e,o);const d=new KS(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,d,e,o,a,r,n),this._renderDecorationsHighlights(l,i,d,e,o,a,r,n)}}_renderSelectionLineHighlights(e,t,i,n,s){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let o=0,r=0;for(const a of t){const t=n.intersectWithViewport(a);if(!t)continue;const[l,h]=t;for(let e=l;e<=h;e++)i.set(e,!0);const d=n.getYForLineNumber(l,s),c=n.getYForLineNumber(h,s);r>=d||(r>o&&e.fillRect(8,o,e.canvas.width,r-o),o=d),r=c}r>o&&e.fillRect(8,o,e.canvas.width,r-o)}_renderDecorationsLineHighlights(e,t,i,n,s){const o=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||l.position!==fu.Inline)continue;const h=n.intersectWithViewport(a.range);if(!h)continue;const[d,c]=h,u=l.getColor(this._theme.value);if(!u||u.isTransparent())continue;let g=o.get(u.toString());g||(g=u.transparent(.5).toString(),o.set(u.toString(),g)),e.fillStyle=g;for(let t=d;t<=c;t++){if(i.has(t))continue;i.set(t,!0);const o=n.getYForLineNumber(d,s);e.fillRect(8,o,e.canvas.width,s)}}}_renderSelectionsHighlights(e,t,i,n,s,o,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=n.intersectWithViewport(l);if(!t)continue;const[h,d]=t;for(let t=h;t<=d;t++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,t,s,s,o,r,a)}}_renderDecorationsHighlights(e,t,i,n,s,o,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const h=n.intersectWithViewport(l.range);if(!h)continue;const[d,c]=h,u=t.getColor(this._theme.value);if(u&&!u.isTransparent())for(let h=d;h<=c;h++)switch(t.position){case fu.Inline:this.renderDecorationOnLine(e,i,l.range,u,n,h,s,s,o,r,a);continue;case fu.Gutter:{const t=n.getYForLineNumber(h,s),i=2;this.renderDecoration(e,u,i,t,2,s);continue}}}}renderDecorationOnLine(e,t,i,n,s,o,r,a,l,h,d){const c=s.getYForLineNumber(o,a);if(c+r<0||c>this._model.options.canvasInnerHeight)return;const{startLineNumber:u,endLineNumber:g}=i,m=u===o?i.startColumn:1,f=g===o?i.endColumn:this._model.getLineMaxColumn(o),p=this.getXOffsetForPosition(t,o,m,l,h,d),_=this.getXOffsetForPosition(t,o,f,l,h,d);this.renderDecoration(e,n,p,c,_-p,r)}getXOffsetForPosition(e,t,i,n,s,o){if(1===i)return 8;if((i-1)*s>=o)return o;let r=e.get(t);if(!r){const i=this._model.getLineContent(t);r=[8];let a=8;for(let e=1;e<i.length+1;e++){const t=i.charCodeAt(e-1),l=a+(9===t?n*s:Ss(t)?2*s:s);if(l>=o){r[e]=o;break}r[e]=l,a=l}e.set(t,r)}return i-1<r.length?r[i-1]:o}renderDecoration(e,t,i,n,s,o){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,s,o)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const t=this._lastRenderData._get();return new BS(e,t.imageData,t.lines)}const s=this._getBuffer();if(!s)return null;const[o,r,a]=zS._renderUntouchedLines(s,e.topPaddingLineCount,t,i,n,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,a),h=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,c=this._model.options.backgroundColor,u=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,m=g.backgroundIsLight(),f=this._model.options.renderMinimap,p=this._model.options.charRenderer(),_=this._model.options.fontScale,v=this._model.options.minimapCharWidth,b=(1===f?2:3)*_,C=n>b?Math.floor((n-b)/2):0,w=c.a/255,y=new xS(Math.round((c.r-d.r)*w+d.r),Math.round((c.g-d.g)*w+d.g),Math.round((c.b-d.b)*w+d.b),255);let S=e.topPaddingLineCount*n;const L=[];for(let e=0,o=i-t+1;e<o;e++)a[e]&&zS._renderLine(s,y,c.a,m,f,v,g,u,p,S,C,h,l[e],_,n),L[e]=new FS(S),S+=n;const k=-1===o?0:o,D=(-1===r?s.height:r)-k;return this._canvas.domNode.getContext("2d").putImageData(s,0,0,0,k,s.width,D),new BS(e,s,L)}static _renderUntouchedLines(e,t,i,n,s,o){const r=[];if(!o){for(let e=0,t=n-i+1;e<t;e++)r[e]=!0;return[-1,-1,r]}const a=o._get(),l=a.imageData.data,h=a.rendLineNumberStart,d=a.lines,c=d.length,u=e.width,g=e.data,m=(n-i+1)*s*u*4;let f=-1,p=-1,_=-1,v=-1,b=-1,C=-1,w=t*s;for(let e=i;e<=n;e++){const t=e-i,n=e-h,o=n>=0&&n<c?d[n].dy:-1;if(-1===o){r[t]=!0,w+=s;continue}const a=o*u*4,y=(o+s)*u*4,S=w*u*4,L=(w+s)*u*4;v===a&&C===S?(v=y,C=L):(-1!==_&&(g.set(l.subarray(_,v),b),-1===f&&0===_&&_===b&&(f=v),-1===p&&v===m&&_===b&&(p=_)),_=a,v=y,b=S,C=L),r[t]=!1,w+=s}-1!==_&&(g.set(l.subarray(_,v),b),-1===f&&0===_&&_===b&&(f=v),-1===p&&v===m&&_===b&&(p=_));return[-1===f?-1:f/(4*u),-1===p?-1:p/(4*u),r]}static _renderLine(e,t,i,n,s,o,r,a,l,h,d,c,u,g,m){const f=u.content,p=u.tokens,_=e.width-o,v=1===m;let b=8,C=0,w=0;for(let u=0,m=p.getCount();u<m;u++){const m=p.getEndOffset(u),y=p.getForeground(u),S=r.getColor(y);for(;C<m;C++){if(b>_)return;const r=f.charCodeAt(C);if(9===r){const e=c-(C+w)%c;w+=e-1,b+=e*o}else if(32===r)b+=o;else{const c=Ss(r)?2:1;for(let u=0;u<c;u++)if(2===s?l.blockRenderChar(e,b,h+d,S,a,t,i,v):l.renderChar(e,b,h+d,r,S,a,t,i,g,n,v),b+=o,b>_)return}}}}}class KS{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let e=0,t=this._endLineNumber-this._startLineNumber+1;e<t;e++)this._values[e]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}i("T02k");class US extends eb{constructor(e,t){super(e),this._viewDomNode=t;const i=this._context.configuration.options.get(144);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=ll(document.createElement("div")),tb.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=ll(document.createElement("div")),tb.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(144);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=ll(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const n=Object.keys(this._widgets);for(let s=0,o=n.length;s<o;s++){const o=n[s],r=null===(t=(e=this._widgets[o].widget).getMinContentWidthInPx)||void 0===t?void 0:t.call(e);void 0!==r&&(i=Math.max(i,r))}this._context.viewLayout.setOverlayWidgetsMinWidth(i)}_renderWidget(e){const t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){const e=t.domNode.clientHeight;t.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else if(2===e.preference)t.setTop(0),t.domNode.style.right="50%";else{const{top:i,left:n}=e.preference;if(this._context.configuration.options.get(42)&&e.widget.allowEditorOverflow){const e=this._viewDomNodeRect;t.setTop(i+e.top),t.setLeft(n+e.left),t.setPosition("fixed")}else t.setTop(i),t.setLeft(n),t.setPosition("absolute")}else t.setTop("")}prepareRender(e){this._viewDomNodeRect=aa(this._viewDomNode.domNode)}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];this._renderWidget(this._widgets[i])}}}class jS{constructor(e,t){const i=e.options;this.lineHeight=i.get(67),this.pixelRatio=i.get(142),this.overviewRulerLanes=i.get(83),this.renderBorder=i.get(82);const n=t.getColor(tw);this.borderColor=n?n.toString():null,this.hideCursor=i.get(59);const s=t.getColor(RC);this.cursorColor=s?s.transparent(.7).toString():null,this.themeType=t.type;const o=i.get(73),r=o.enabled,a=o.side,l=t.getColor(iw),h=zi.getDefaultBackground();this.backgroundColor=l||(r&&"right"===a?h:null);const d=i.get(144).overviewRuler;this.top=d.top,this.right=d.right,this.domWidth=d.width,this.domHeight=d.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[c,u]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=c,this.w=u}_initLanes(e,t,i){const n=t-e;if(i>=3){const t=Math.floor(n/3),i=Math.floor(n/3),s=n-t-i,o=e+t;return[[0,e,o,e,e+t+s,e,o,e],[0,t,s,t+s,i,t+s+i,s+i,t+s+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&Ug.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class qS extends eb{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ll(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=zi.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[new Ci(1,1)]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new jS(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++)this._cursorPositions[t]=e.selections[t].getPosition();return this._cursorPositions.sort(Ci.compare),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return!!e.affectsOverviewRuler&&this._markRenderingIsMaybeNeeded()}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return!!e.scrollHeightChanged&&this._markRenderingIsNeeded()}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(0===this._settings.overviewRulerLanes)return this._domNode.setBackgroundColor(e?Ug.Format.CSS.formatHexA(e):""),void this._domNode.setDisplay("none");const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(Km.compareByRenderingProps),1!==this._actualShouldRender||Km.equalsArr(this._renderedDecorations,t)||(this._actualShouldRender=2),1!==this._actualShouldRender||s(this._renderedCursorPositions,this._cursorPositions,(e,t)=>e.lineNumber===t.lineNumber)||(this._actualShouldRender=2),1===this._actualShouldRender)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=n/this._context.viewLayout.getScrollHeight(),l=6*this._settings.pixelRatio|0,h=l/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=Ug.Format.CSS.formatHexA(e),d.fillRect(0,0,i,n)):(d.clearRect(0,0,i,n),d.fillStyle=Ug.Format.CSS.formatHexA(e),d.fillRect(0,0,i,n)):d.clearRect(0,0,i,n);const c=this._settings.x,u=this._settings.w;for(const e of t){const t=e.color,i=e.data;d.fillStyle=t;let s=0,g=0,m=0;for(let e=0,t=i.length/3;e<t;e++){const t=i[3*e],f=i[3*e+1],p=i[3*e+2];let _=r.getVerticalOffsetForLineNumber(f)*a|0,v=(r.getVerticalOffsetForLineNumber(p)+o)*a|0;if(v-_<l){let e=(_+v)/2|0;e<h?e=h:e+h>n&&(e=n-h),_=e-h,v=e+h}_>m+1||t!==s?(0!==e&&d.fillRect(c[s],g,u[s],m-g),s=t,g=_,m=v):v>m&&(m=v)}d.fillRect(c[s],g,u[s],m-g)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,t=e/2|0,i=this._settings.x[7],s=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let o=-100,l=-100;for(let h=0,c=this._cursorPositions.length;h<c;h++){const c=this._cursorPositions[h];let u=r.getVerticalOffsetForLineNumber(c.lineNumber)*a|0;u<t?u=t:u+t>n&&(u=n-t);const g=u-t,m=g+e;g>l+1?(0!==h&&d.fillRect(i,o,s,l-o),o=g,l=m):m>l&&(l=m)}d.fillRect(i,o,s,l-o)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,n),d.stroke(),d.moveTo(0,0),d.lineTo(i,0),d.stroke())}}class $S{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class GS{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class ZS{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(GS.compare)}setLineHeight(e){return this._lineHeight!==e&&(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth!==e&&(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight!==e&&(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight!==e&&(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),n=i/Math.floor(this._outerHeight),s=Math.floor(4*this._pixelRatio/2),o=[];for(let r=0,a=this._zones.length;r<a;r++){const a=this._zones[r];if(!e){const e=a.getColorZones();if(e){o.push(e);continue}}const l=this._getVerticalOffsetForLine(a.startLineNumber),h=0===a.heightInLines?this._getVerticalOffsetForLine(a.endLineNumber)+t:l+a.heightInLines*t,d=Math.floor(n*l),c=Math.floor(n*h);let u=Math.floor((d+c)/2),g=c-u;g<s&&(g=s),u-g<0&&(u=g),u+g>i&&(u=i-g);const m=a.color;let f=this._color2Id[m];f||(f=++this._lastAssignedId,this._color2Id[m]=f,this._id2Color[f]=m);const p=new $S(u-g,u+g,f);a.setColorZone(p),o.push(p)}return this._colorZonesInvalid=!1,o.sort($S.compare),o}}class YS extends Jv{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ll(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new ZS(e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(67)),this._zoneManager.setPixelRatio(i.get(142)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(67)&&(this._zoneManager.setLineHeight(t.get(67)),this._render()),e.hasChanged(142)&&(this._zoneManager.setPixelRatio(t.get(142)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),s=this._domNode.domNode.getContext("2d");return s.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(s,i,n,e),!0}_renderOneLane(e,t,i,n){let s=0,o=0,r=0;for(const a of t){const t=a.colorId,l=a.from,h=a.to;t!==s?(e.fillRect(0,o,n,r-o),s=t,e.fillStyle=i[s],o=l,r=h):r>=l?r=Math.max(r,h):(e.fillRect(0,o,n,r-o),o=l,r=h)}e.fillRect(0,o,n,r-o)}}i("ya7L");class QS extends eb{constructor(e){super(e),this.domNode=ll(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:i}=this._context.viewModel.model.getOptions(),n=i;let s=t-e;for(;s>0;){const e=ll(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),s--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const i=this._renderedRulers[t],n=this._rulers[t];i.setBoxShadow(n.color?`1px 0 0 0 ${n.color} inset`:""),i.setHeight(Math.min(e.scrollHeight,1e6)),i.setLeft(n.column*this._typicalHalfwidthCharacterWidth)}}}i("2WzX");class XS extends eb{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(103);this._useShadows=t.useShadows,this._domNode=ll(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(144);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(103);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}i("nRg7");class JS{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class eL{constructor(e,t){this.lineNumber=e,this.ranges=t}}function tL(e){return new JS(e)}function iL(e){return new eL(e.lineNumber,e.ranges.map(tL))}class nL extends kC{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(67),this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(67),this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++){if(e[t].ranges.length>1)return!0}return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let s=null,o=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!s&&e<i.length;e++)i[e].lineNumber===n&&(s=i[e].ranges[0]);const r=t[t.length-1].lineNumber;if(r===e.endLineNumber)for(let e=i.length-1;!o&&e>=0;e--)i[e].lineNumber===r&&(o=i[e].ranges[0]);s&&!s.startStyle&&(s=null),o&&!o.startStyle&&(o=null)}for(let e=0,i=t.length;e<i;e++){const r=t[e].ranges[0],a=r.left,l=r.left+r.width,h={top:0,bottom:0},d={top:0,bottom:0};if(e>0){const i=t[e-1].ranges[0].left,s=t[e-1].ranges[0].left+t[e-1].ranges[0].width;sL(a-i)<n?h.top=2:a>i&&(h.top=1),sL(l-s)<n?d.top=2:i<l&&l<s&&(d.top=1)}else s&&(h.top=s.startStyle.top,d.top=s.endStyle.top);if(e+1<i){const i=t[e+1].ranges[0].left,s=t[e+1].ranges[0].left+t[e+1].ranges[0].width;sL(a-i)<n?h.bottom=2:i<a&&a<s&&(h.bottom=1),sL(l-s)<n?d.bottom=2:l<s&&(d.bottom=1)}else o&&(h.bottom=o.startStyle.bottom,d.bottom=o.endStyle.bottom);r.startStyle=h,r.endStyle=d}}_getVisibleRangesWithStyle(e,t,i){const n=(t.linesVisibleRangesForRange(e,!0)||[]).map(iL);return!this._visibleRangesHaveGaps(n)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,n,i),n}_createSelectionPiece(e,t,i,n,s){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;left:"+n.toString()+"px;width:"+s.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const s=!!n[0].ranges[0].startStyle,o=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let h=0,d=n.length;h<d;h++){const d=n[h],c=d.lineNumber,u=c-t,g=i&&(c===l||c===a)?r:o,m=i&&c===a?1:0;let f="",p="";for(let e=0,t=d.ranges.length;e<t;e++){const t=d.ranges[e];if(s){const e=t.startStyle,i=t.endStyle;if(1===e.top||1===e.bottom){f+=this._createSelectionPiece(m,g,nL.SELECTION_CLASS_NAME,t.left-nL.ROUNDED_PIECE_WIDTH,nL.ROUNDED_PIECE_WIDTH);let i=nL.EDITOR_BACKGROUND_CLASS_NAME;1===e.top&&(i+=" "+nL.SELECTION_TOP_RIGHT),1===e.bottom&&(i+=" "+nL.SELECTION_BOTTOM_RIGHT),f+=this._createSelectionPiece(m,g,i,t.left-nL.ROUNDED_PIECE_WIDTH,nL.ROUNDED_PIECE_WIDTH)}if(1===i.top||1===i.bottom){f+=this._createSelectionPiece(m,g,nL.SELECTION_CLASS_NAME,t.left+t.width,nL.ROUNDED_PIECE_WIDTH);let e=nL.EDITOR_BACKGROUND_CLASS_NAME;1===i.top&&(e+=" "+nL.SELECTION_TOP_LEFT),1===i.bottom&&(e+=" "+nL.SELECTION_BOTTOM_LEFT),f+=this._createSelectionPiece(m,g,e,t.left+t.width,nL.ROUNDED_PIECE_WIDTH)}}let i=nL.SELECTION_CLASS_NAME;if(s){const e=t.startStyle,n=t.endStyle;0===e.top&&(i+=" "+nL.SELECTION_TOP_LEFT),0===e.bottom&&(i+=" "+nL.SELECTION_BOTTOM_LEFT),0===n.top&&(i+=" "+nL.SELECTION_TOP_RIGHT),0===n.bottom&&(i+=" "+nL.SELECTION_BOTTOM_RIGHT)}p+=this._createSelectionPiece(m,g,i,t.left,t.width)}e[u][0]+=f,e[u][1]+=p}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let e=i;e<=n;e++){t[e-i]=["",""]}const s=[];for(let n=0,o=this._selections.length;n<o;n++){const o=this._selections[n];if(o.isEmpty()){s[n]=null;continue}const r=this._getVisibleRangesWithStyle(o,e,this._previousFrameVisibleRangesWithStyle[n]);s[n]=r,this._actualRenderOneSelection(t,i,this._selections.length>1,r)}this._previousFrameVisibleRangesWithStyle=s,this._renderResult=t.map(([e,t])=>e+t)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function sL(e){return e<0?-e:e}nL.SELECTION_CLASS_NAME="selected-text",nL.SELECTION_TOP_LEFT="top-left-radius",nL.SELECTION_BOTTOM_LEFT="bottom-left-radius",nL.SELECTION_TOP_RIGHT="top-right-radius",nL.SELECTION_BOTTOM_RIGHT="bottom-right-radius",nL.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",nL.ROUNDED_PIECE_WIDTH=10,TC((e,t)=>{const i=e.getColor(r_);i&&!i.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${i}; }`)});i("UyhG");class oL{constructor(e,t,i,n,s,o,r){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=s,this.textContent=o,this.textContentClassName=r}}class rL{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ll(document.createElement("div")),this._domNode.setClassName("cursor monaco-mouse-cursor-text"),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),hl(this._domNode,i),this._domNode.setDisplay("none"),this._position=new Ci(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),hl(this._domNode,i),!0}onCursorPositionChanged(e,t){return this._domNode.domNode.style.transitionProperty=t?"none":"",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,s]=function(e,t){t>0&&ds(e.charCodeAt(t))&&t--;const i=t+fs(e,t);return[i-ps(e,i),i]}(i,t-1);return[new Ci(e,n+1),i.substring(n,s)]}_prepareRender(e){let t="",i="";const[n,s]=this._getGraphemeAwarePosition();if(this._cursorStyle===_e.Line||this._cursorStyle===_e.LineThin){const o=e.visibleRangeForPosition(n);if(!o||o.outsideRenderedLine)return null;const r=Fr(this._domNode.domNode);let a;this._cursorStyle===_e.Line?(a=qa(r,this._lineCursorWidth>0?this._lineCursorWidth:2),a>2&&(t=s,i=this._getTokenClassName(n))):a=qa(r,1);let l=o.left,h=0;a>=2&&l>=1&&(h=1,l-=h);const d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new oL(d,l,h,a,this._lineHeight,t,i)}const o=e.linesVisibleRangesForRange(new wi(n.lineNumber,n.column,n.lineNumber,n.column+s.length),!1);if(!o||0===o.length)return null;const r=o[0];if(r.outsideRenderedLine||0===r.ranges.length)return null;const a=r.ranges[0],l="\t"===s||a.width<1?this._typicalHalfwidthCharacterWidth:a.width;this._cursorStyle===_e.Block&&(t=s,i=this._getTokenClassName(n));let h=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return this._cursorStyle!==_e.Underline&&this._cursorStyle!==_e.UnderlineThin||(h+=this._lineHeight-2,d=2),new oL(h,a.left,0,l,d,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName("cursor monaco-mouse-cursor-text "+this._renderData.textContentClassName),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class aL extends eb{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new rL(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=ll(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new uo,this._cursorFlatBlinkInterval=new ta,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,i){const n=this._secondaryCursors.length!==t.length||"explicit"===this._cursorSmoothCaretAnimation&&3!==i;if(this._primaryCursor.onCursorPositionChanged(e,n),this._updateBlinking(),this._secondaryCursors.length<t.length){const e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){const e=new rL(this._context);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t<e;t++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let e=0;e<t.length;e++)this._secondaryCursors[e].onCursorPositionChanged(t[e],n)}onCursorStateChanged(e){const t=[];for(let i=0,n=e.selections.length;i<n;i++)t[i]=e.selections[i].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=t=>{for(let i=0,n=e.ranges.length;i<n;i++)if(e.ranges[i].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[i].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const e of this._secondaryCursors)if(t(e.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput?0:this._editorHasFocus?this._readOnly?5:this._cursorBlinking:0}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=0===e,i=5===e;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),t||i||(1===e?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},aL.BLINK_INTERVAL,Fr(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},aL.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case _e.Line:e+=" cursor-line-style";break;case _e.Block:e+=" cursor-block-style";break;case _e.Underline:e+=" cursor-underline-style";break;case _e.LineThin:e+=" cursor-line-thin-style";break;case _e.BlockOutline:e+=" cursor-block-outline-style";break;case _e.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return"on"!==this._cursorSmoothCaretAnimation&&"explicit"!==this._cursorSmoothCaretAnimation||(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){const t=[];let i=0;const n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let n=0,s=this._secondaryCursors.length;n<s;n++){const s=this._secondaryCursors[n].render(e);s&&(t[i++]=s)}this._renderData=t}getLastRenderData(){return this._renderData}}aL.BLINK_INTERVAL=500,TC((e,t)=>{const i=e.getColor(RC);if(i){let n=e.getColor(PC);n||(n=i.opposite()),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),db(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const lL=()=>{throw new Error("Invalid change accessor")};class hL extends eb{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(144);this._lineHeight=t.get(67),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=ll(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=ll(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const i of e)t.set(i.id,i);let i=!1;return this._context.viewModel.changeWhitespace(e=>{const n=Object.keys(this._zones);for(let s=0,o=n.length;s<o;s++){const o=n[s],r=this._zones[o],a=this._computeWhitespaceProps(r.delegate);r.isInHiddenArea=a.isInHiddenArea;const l=t.get(o);!l||l.afterLineNumber===a.afterViewLineNumber&&l.height===a.heightInPx||(e.changeOneWhitespace(o,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(r.delegate,a.heightInPx),i=!0)}}),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(144);return this._lineHeight=t.get(67),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(67)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){var t,i;return null!==(i=null!==(t=e.ordinal)&&void 0!==t?t:e.afterColumn)&&void 0!==i?i:1e4}_computeWhitespaceProps(e){if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t,i;if(void 0!==e.afterColumn)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const i=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new Ci(i,this._context.viewModel.model.getLineMaxColumn(i))}i=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});const n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),s=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!s,afterViewLineNumber:n.lineNumber,heightInPx:s?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(i=>{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{e(t)}catch(e){Be(e)}}(e,n),n.addZone=lL,n.removeZone=lL,n.layoutZone=lL}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:ll(t.domNode),marginDomNode:t.marginDomNode?ll(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e){Be(e)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e){Be(e)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const e of t)this._zones[e.id].isInHiddenArea||(i[e.id]=e,n=!0);const s=Object.keys(this._zones);for(let t=0,n=s.length;t<n;t++){const n=s[t],o=this._zones[n];let r=0,a=0,l="none";i.hasOwnProperty(n)?(r=i[n].verticalOffset-e.bigNumbersDelta,a=i[n].height,l="block",o.isVisible||(o.domNode.setAttribute("monaco-visible-view-zone","true"),o.isVisible=!0),this._safeCallOnDomNodeTop(o.delegate,e.getScrolledTopFromAbsoluteTop(i[n].verticalOffset))):(o.isVisible&&(o.domNode.removeAttribute("monaco-visible-view-zone"),o.isVisible=!1),this._safeCallOnDomNodeTop(o.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),o.domNode.setTop(r),o.domNode.setHeight(a),o.domNode.setDisplay(l),o.marginDomNode&&(o.marginDomNode.setTop(r),o.marginDomNode.setHeight(a),o.marginDomNode.setDisplay(l))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}i("RilQ");class dL extends kC{constructor(e){super(),this._context=e,this._options=new cL(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=new cL(this._context.configuration);return this._options.equals(t)?e.hasChanged(144):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,"selection"===this._options.renderWhitespace}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if("none"===this._options.renderWhitespace)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber-t+1,n=new Array(i);for(let e=0;e<i;e++)n[e]=!0;const s=this._context.viewModel.getMinimapLinesRenderingData(e.viewportData.startLineNumber,e.viewportData.endLineNumber,n);this._renderResult=[];for(let t=e.viewportData.startLineNumber;t<=e.viewportData.endLineNumber;t++){const i=t-e.viewportData.startLineNumber,n=s.data[i];let o=null;if("selection"===this._options.renderWhitespace){const e=this._selection;for(const i of e){if(i.endLineNumber<t||i.startLineNumber>t)continue;const e=i.startLineNumber===t?i.startColumn:n.minColumn,s=i.endLineNumber===t?i.endColumn:n.maxColumn;e<s&&(o||(o=[]),o.push(new Dm(e-1,s-1)))}}this._renderResult[i]=this._applyRenderWhitespace(e,t,o,n)}}_applyRenderWhitespace(e,t,i,n){if("selection"===this._options.renderWhitespace&&!i)return"";if("trailing"===this._options.renderWhitespace&&n.continuesWithWrappedLine)return"";const s=this._context.theme.getColor(FC),o=this._options.renderWithSVG,r=n.content,a=-1===this._options.stopRenderingLineAfter?r.length:Math.min(this._options.stopRenderingLineAfter,r.length),l=n.continuesWithWrappedLine,h=n.minColumn-1,d="boundary"===this._options.renderWhitespace,c="trailing"===this._options.renderWhitespace,u=this._options.lineHeight,g=this._options.middotWidth,m=this._options.wsmiddotWidth,f=this._options.spaceWidth,p=Math.abs(m-f)<Math.abs(g-f)?11825:183,_=this._options.canUseHalfwidthRightwardsArrow;let v,b="",C=!1,w=Zn(r);-1===w?(C=!0,w=a,v=a):v=Qn(r);let y=0,S=i&&i[y],L=0;for(let n=h;n<a;n++){const s=r.charCodeAt(n);if(S&&n>=S.endOffset&&(y++,S=i&&i[y]),9!==s&&32!==s)continue;if(c&&!C&&n<=v)continue;if(d&&n>=w&&n<=v&&32===s){const e=n-1>=0?r.charCodeAt(n-1):0,t=n+1<a?r.charCodeAt(n+1):0;if(32!==e&&32!==t)continue}if(d&&l&&n===a-1){const e=n-1>=0?r.charCodeAt(n-1):0;if(32===s&&32!==e&&9!==e)continue}if(i&&(!S||S.startOffset>n||S.endOffset<=n))continue;const h=e.visibleRangeForPosition(new Ci(t,n+1));h&&(o?(L=Math.max(L,h.left),b+=9===s?this._renderArrow(u,f,h.left):`<circle cx="${(h.left+f/2).toFixed(2)}" cy="${(u/2).toFixed(2)}" r="${(f/7).toFixed(2)}" />`):b+=9===s?`<div class="mwh" style="left:${h.left}px;height:${u}px;">${_?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:`<div class="mwh" style="left:${h.left}px;height:${u}px;">${String.fromCharCode(p)}</div>`)}return o?(L=Math.round(L+f),`<svg style="position:absolute;width:${L}px;height:${u}px" viewBox="0 0 ${L} ${u}" xmlns="http://www.w3.org/2000/svg" fill="${s}">`+b+"</svg>"):b}_renderArrow(e,t,i){const n=e/2,s=i,o={x:0,y:t/7/2},r={x:.8*t,y:o.y},a={x:r.x-.2*r.x,y:r.y+.2*r.x},l={x:a.x+.1*r.x,y:a.y+.1*r.x},h={x:l.x+.35*r.x,y:l.y-.35*r.x};return`<path d="M ${[o,r,a,l,h,{x:h.x,y:-h.y},{x:l.x,y:-l.y},{x:a.x,y:-a.y},{x:r.x,y:-r.y},{x:o.x,y:-o.y}].map(e=>`${(s+e.x).toFixed(2)} ${(n+e.y).toFixed(2)}`).join(" L ")}" />`}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class cL{constructor(e){const t=e.options,i=t.get(50),n=t.get(38);"off"===n?(this.renderWhitespace="none",this.renderWithSVG=!1):"svg"===n?(this.renderWhitespace=t.get(99),this.renderWithSVG=!0):(this.renderWhitespace=t.get(99),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(117)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class uL{constructor(e,t,i,n){this.selections=e,this.startLineNumber=0|t.startLineNumber,this.endLineNumber=0|t.endLineNumber,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=0|t.bigNumbersDelta,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new wi(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class gL{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class mL{constructor(e,t,i){this.configuration=e,this.theme=new gL(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}var fL=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},pL=function(e,t){return function(i,n){t(i,n,e)}};let _L=class extends Jv{constructor(e,t,i,n,s,o,r){super(),this._instantiationService=r,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new yi(1,1,1,1)],this._renderAnimationFrame=null;const a=new Fy(t,n,s,e);this._context=new mL(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(Rw,this._context,a,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ll(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ll(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ll(document.createElement("div")),tb.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new nS(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new LS(this._context,this._linesContent),this._viewZones=new hL(this._context),this._viewParts.push(this._viewZones);const l=new qS(this._context);this._viewParts.push(l);const h=new XS(this._context);this._viewParts.push(h);const d=new Ky(this._context);this._viewParts.push(d),d.addDynamicOverlay(new eS(this._context)),d.addDynamicOverlay(new nL(this._context)),d.addDynamicOverlay(new vS(this._context)),d.addDynamicOverlay(new iS(this._context)),d.addDynamicOverlay(new dL(this._context));const c=new Uy(this._context);this._viewParts.push(c),c.addDynamicOverlay(new tS(this._context)),c.addDynamicOverlay(new DS(this._context)),c.addDynamicOverlay(new kS(this._context)),c.addDynamicOverlay(new xw(this._context)),this._glyphMarginWidgets=new lS(this._context),this._viewParts.push(this._glyphMarginWidgets);const u=new Ew(this._context);u.getDomNode().appendChild(this._viewZones.marginDomNode),u.getDomNode().appendChild(c.getDomNode()),u.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(u),this._contentWidgets=new $y(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new aL(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new US(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const g=new QS(this._context);this._viewParts.push(g);const m=new qy(this._context);this._viewParts.push(m);const f=new HS(this._context);if(this._viewParts.push(f),l){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(l.getDomNode(),e.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),o?(o.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),o.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new LC(this._context,a,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],n=0;i=i.concat(e.getAllMarginDecorations().map(e=>{var t,i,s;const o=null!==(i=null===(t=e.options.glyphMargin)||void 0===t?void 0:t.position)&&void 0!==i?i:mu.Center;return n=Math.max(n,e.range.endLineNumber),{range:e.range,lane:o,persist:null===(s=e.options.glyphMargin)||void 0===s?void 0:s.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(t=>{const i=e.validateRange(t.preference.range);return n=Math.max(n,i.endLineNumber),{range:i,lane:t.preference.lane}})),i.sort((e,t)=>wi.compareRangesUsingStarts(e.range,t.range)),t.reset(n);for(const e of i)t.push(e.lane,e.range,e.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new Eb(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new Ci(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const e=this._context.configuration.options.get(144);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(141)+" "+EC(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new $e;if(null===this._renderAnimationFrame){const e=this._createCoordinatedRendering();this._renderAnimationFrame=bL.INSTANCE.scheduleCoordinatedRendering({window:Fr(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new $e;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new $e;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new $e;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new $e;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();vL(()=>e.prepareRenderText());const t=vL(()=>e.renderText());if(t){const[i,n]=t;vL(()=>e.prepareRender(i,n)),vL(()=>e.render(i,n))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}Kf.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new uL(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new ib(this._context.viewLayout,i,this._viewLines)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const s=this._viewLines.visibleRangeForPosition(new Ci(n.lineNumber,n.column));return s?s.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?jy.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new YS(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,n,s,o,r,a,l;this._contentWidgets.setWidgetPosition(e.widget,null!==(i=null===(t=e.position)||void 0===t?void 0:t.position)&&void 0!==i?i:null,null!==(s=null===(n=e.position)||void 0===n?void 0:n.secondaryPosition)&&void 0!==s?s:null,null!==(r=null===(o=e.position)||void 0===o?void 0:o.preference)&&void 0!==r?r:null,null!==(l=null===(a=e.position)||void 0===a?void 0:a.positionAffinity)&&void 0!==l?l:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};function vL(e){try{return e()}catch(e){return Be(e),null}}_L=fL([pL(6,bl)],_L);class bL{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(-1!==t&&(this._coordinatedRenderings.splice(t,1),0===this._coordinatedRenderings.length)){for(const[e,t]of this._animationFrameRunners)t.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,Jr(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const t of e)vL(()=>t.prepareRenderText());const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];t[i]=vL(()=>n.renderText())}for(let i=0,n=e.length;i<n;i++){const n=e[i],s=t[i];if(!s)continue;const[o,r]=s;vL(()=>n.prepareRender(o,r))}for(let i=0,n=e.length;i<n;i++){const n=e[i],s=t[i];if(!s)continue;const[o,r]=s;vL(()=>n.render(o,r))}}}bL.INSTANCE=new bL;class CL{constructor(e,t,i,n,s){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=s}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let e=0;e<this.injectionOffsets.length&&i>this.injectionOffsets[e];e++)i<this.injectionOffsets[e]+this.injectionOptions[e].content.length?i=this.injectionOffsets[e]:i-=this.injectionOptions[e].content.length;return i}translateToOutputPosition(e,t=2){let i=e;if(null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length&&!(e<this.injectionOffsets[n])&&(1===t||e!==this.injectionOffsets[n]);n++)i+=this.injectionOptions[n].content.length;return this.offsetInInputWithInjectionsToOutputPosition(i,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let i=0,n=this.breakOffsets.length-1,s=0,o=0;for(;i<=n;){s=i+(n-i)/2|0;const r=this.breakOffsets[s];if(o=s>0?this.breakOffsets[s-1]:0,0===t)if(e<=o)n=s-1;else{if(!(e>r))break;i=s+1}else if(e<o)n=s-1;else{if(!(e>=r))break;i=s+1}}let r=e-o;return s>0&&(r+=this.wrappedTextIndentLength),new SL(s,r)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){const n=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(s!==n)return this.offsetInInputWithInjectionsToOutputPosition(s,i)}if(0===i){if(e>0&&t===this.getMinOutputOffset(e))return new SL(e-1,this.getMaxOutputOffset(e-1))}else if(1===i){if(e<this.getOutputLineCount()-1&&t===this.getMaxOutputOffset(e))return new SL(e+1,this.getMinOutputOffset(e+1))}return new SL(e,t)}outputPositionToOffsetInInputWithInjections(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));return(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t){if(e===i.offsetInInputWithInjections+i.length&&wL(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let e=i.offsetInInputWithInjections;if(yL(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!wL(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!yL(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t||4===t){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t];)e+=this.injectionOptions[t+1].content.length,t++;return e}if(0===t||3===t){let e=i.offsetInInputWithInjections,t=i.injectedTextIndex;for(;t-1>=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}Lh()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(null!==t){let n=0;for(let s=0;s<t.length;s++){const o=i[s].content.length,r=t[s]+n,a=t[s]+n+o;if(r>e)break;if(e<=a)return{injectedTextIndex:s,offsetInInputWithInjections:r,length:o};n+=o}}}}function wL(e){return null==e||(e===pu.Right||e===pu.Both)}function yL(e){return null==e||(e===pu.Left||e===pu.Both)}class SL{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new Ci(e+this.outputLineIndex,this.outputOffset+1)}}class LL{constructor(){this.changeType=1}}class kL{static applyInjectedText(e,t){if(!t||0===t.length)return e;let i="",n=0;for(const s of t)i+=e.substring(n,s.column-1),n=s.column-1,i+=s.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new kL(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new kL(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber),t}constructor(e,t,i,n,s){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=s}}class DL{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class xL{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class EL{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class NL{constructor(){this.changeType=5}}class IL{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++){if(this.changes[t].changeType===e)return!0}return!1}static merge(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.versionId,s=e.isUndoing||t.isUndoing,o=e.isRedoing||t.isRedoing;return new IL(i,n,s,o)}}class TL{constructor(e){this.changes=e}}class ML{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=IL.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=ML._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new ML(t,i)}static _mergeChangeEvents(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.eol,s=t.versionId,o=e.isUndoing||t.isUndoing,r=e.isRedoing||t.isRedoing,a=e.isFlush||t.isFlush;return{changes:i,eol:n,isEolChange:e.isEolChange&&t.isEolChange,versionId:s,isUndoing:o,isRedoing:r,isFlush:a}}}const AL=bd("domLineBreaksComputer",{createHTML:e=>e});class OL{static create(e){return new OL(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,s){const o=[],r=[];return{addRequest:(e,t,i)=>{o.push(e),r.push(t)},finalize:()=>function(e,t,i,n,s,o,r,a){var l;function h(e){const i=a[e];if(i){const n=kL.applyInjectedText(t[e],i),s=i.map(e=>e.options),o=i.map(e=>e.column-1);return new CL(o,s,[n.length],[],0)}return null}if(-1===s){const e=[];for(let i=0,n=t.length;i<n;i++)e[i]=h(i);return e}const d=Math.round(s*i.typicalHalfwidthCharacterWidth),c=3===o?2:2===o?1:0,u=Math.round(n*c),g=Math.ceil(i.spaceWidth*u),m=document.createElement("div");hl(m,i);const f=new Bd(1e4),p=[],_=[],v=[],b=[],C=[];for(let e=0;e<t.length;e++){const s=kL.applyInjectedText(t[e],a[e]);let r=0,l=0,h=d;if(0!==o)if(r=Zn(s),-1===r)r=0;else{for(let e=0;e<r;e++){const t=9===s.charCodeAt(e)?n-l%n:1;l+=t}const e=Math.ceil(i.spaceWidth*l);e+i.typicalFullwidthCharacterWidth>d?(r=0,l=0):h=d-e}const c=s.substr(r),u=RL(c,l,n,h,f,g);p[e]=r,_[e]=l,v[e]=c,b[e]=u[0],C[e]=u[1]}const w=f.build(),y=null!==(l=null==AL?void 0:AL.createHTML(w))&&void 0!==l?l:w;m.innerHTML=y,m.style.position="absolute",m.style.top="10000","keepAll"===r?(m.style.wordBreak="keep-all",m.style.overflowWrap="anywhere"):(m.style.wordBreak="inherit",m.style.overflowWrap="break-word");e.document.body.appendChild(m);const S=document.createRange(),L=Array.prototype.slice.call(m.children,0),k=[];for(let e=0;e<t.length;e++){const t=L[e],i=PL(S,t,v[e],b[e]);if(null===i){k[e]=h(e);continue}const n=p[e],s=_[e]+u,o=C[e],r=[];for(let e=0,t=i.length;e<t;e++)r[e]=o[i[e]];if(0!==n)for(let e=0,t=i.length;e<t;e++)i[e]+=n;let l,d;const c=a[e];c?(l=c.map(e=>e.options),d=c.map(e=>e.column-1)):(l=null,d=null),k[e]=new CL(d,l,i,r,s)}return e.document.body.removeChild(m),k}(R(this.targetWindow.deref()),o,e,t,i,n,s,r)}}}function RL(e,t,i,n,s,o){if(0!==o){const e=String(o);s.appendString('<div style="text-indent: -'),s.appendString(e),s.appendString("px; padding-left: "),s.appendString(e),s.appendString("px; box-sizing: border-box; width:")}else s.appendString('<div style="width:');s.appendString(String(n)),s.appendString('px;">');const r=e.length;let a=t,l=0;const h=[],d=[];let c=0<r?e.charCodeAt(0):0;s.appendString("<span>");for(let t=0;t<r;t++){0!==t&&t%16384==0&&s.appendString("</span><span>"),h[t]=l,d[t]=a;const n=c;c=t+1<r?e.charCodeAt(t+1):0;let o=1,u=1;switch(n){case 9:o=i-a%i,u=o;for(let e=1;e<=o;e++)e<o?s.appendCharCode(160):s.appendASCIICharCode(32);break;case 32:32===c?s.appendCharCode(160):s.appendASCIICharCode(32);break;case 60:s.appendString("&lt;");break;case 62:s.appendString("&gt;");break;case 38:s.appendString("&amp;");break;case 0:s.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:s.appendCharCode(65533);break;default:Ss(n)&&u++,n<32?s.appendCharCode(9216+n):s.appendCharCode(n)}l+=o,a+=u}return s.appendString("</span>"),h[e.length]=l,d[e.length]=a,s.appendString("</div>"),[h,d]}function PL(e,t,i,n){if(i.length<=1)return null;const s=Array.prototype.slice.call(t.children,0),o=[];try{!function e(t,i,n,s,o,r,a,l){if(s===r)return;if(o=o||FL(t,i,n[s],n[s+1]),a=a||FL(t,i,n[r],n[r+1]),Math.abs(o[0].top-a[0].top)<=.1)return;if(s+1===r)return void l.push(r);const h=s+(r-s)/2|0,d=FL(t,i,n[h],n[h+1]);e(t,i,n,s,o,h,d,l),e(t,i,n,h,d,r,a,l)}(e,s,n,0,null,i.length-1,null,o)}catch(e){return console.log(e),null}return 0===o.length?null:(o.push(i.length),o)}function FL(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}class BL extends st{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new at),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const e of t)this._pending.has(e.id)?Be(new Error("Cannot have two contributions with the same id "+e.id)):this._pending.set(e.id,e);this._instantiateSome(0),this._register(Xr(Fr(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(Xr(Fr(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(Xr(Fr(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)"function"==typeof i.saveViewState&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)"function"==typeof i.restoreViewState&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){var e;return Xr(Fr(null===(e=this._editor)||void 0===e?void 0:e.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const e of t)this._instantiateById(e.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),"function"==typeof e.restoreViewState&&0!==t.instantiation&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(e){Be(e)}}}}class WL{constructor(e,t,i,n,s,o,r){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=s,this._run=o,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function VL(e){let t=0,i=0,n=0,s=0;for(let o=0,r=e.length;o<r;o++){const a=e.charCodeAt(o);13===a?(0===t&&(i=o),t++,o+1<r&&10===e.charCodeAt(o+1)?(s|=2,o++):s|=3,n=o+1):10===a&&(s|=1,0===t&&(i=o),t++,n=o+1)}return 0===t&&(i=e.length),[t,i,e.length-n,s]}class HL{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class zL extends class{constructor(e,t,i,n,s,o){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=s,this.bracketPairNode=o}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}{constructor(e,t,i,n,s,o,r){super(e,t,i,n,s,o),this.minVisibleColumnIndentation=r}}class KL{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}KL.zero=new KL(0,0);function UL(e){return 0===e}function jL(e,t){return e*2**26+t}function qL(e){const t=e,i=Math.floor(t/2**26);return new KL(i,t-i*2**26)}function $L(e,t){let i=e+t;return t>=2**26&&(i-=e%2**26),i}function GL(e,t){return e.reduce((e,i)=>$L(e,t(i)),0)}function ZL(e,t){return e===t}function YL(e,t){const i=e,n=t;if(n-i<=0)return 0;const s=Math.floor(i/2**26),o=Math.floor(n/2**26),r=n-o*2**26;if(s===o){return jL(0,r-(i-s*2**26))}return jL(o-s,r)}function QL(e,t){return e<t}function XL(e,t){return e<=t}function JL(e,t){return e>=t}function ek(e){return jL(e.lineNumber-1,e.column-1)}function tk(e,t){const i=e,n=Math.floor(i/2**26),s=i-n*2**26,o=t,r=Math.floor(o/2**26);return new wi(n+1,s+1,r+1,o-r*2**26+1)}class ik{static fromModelContentChanges(e){return e.map(e=>{const t=wi.lift(e.range);return new ik(ek(t.getStartPosition()),ek(t.getEndPosition()),function(e){const t=Gn(e);return jL(t.length-1,t[t.length-1].length)}(e.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${qL(this.startOffset)}...${qL(this.endOffset)}) -> ${qL(this.newLength)}`}}class nk{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(e=>sk.from(e))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return null===i?null:YL(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?jL(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):jL(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=qL(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?jL(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):jL(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(!XL(i,e))break;{this.nextEditIdx++;const e=qL(i),n=qL(this.translateOldToCur(t.endOffsetBeforeObj)),s=e.lineCount-n.lineCount;this.deltaOldToNewLineCount+=s;const o=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,r=e.columnCount-n.columnCount;this.deltaOldToNewColumnCount=o+r,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}}}}class sk{static from(e){return new sk(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=qL(t),this.endOffsetAfterObj=qL($L(e,i)),this.offsetObj=qL(e)}}const ok=[];class rk{static create(e,t){if(e<=128&&0===t.length){let i=rk.cache[e];return i||(i=new rk(e,t),rk.cache[e]=i),i}return new rk(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let n=i>>5;if(0===n){const e=1<<i|this.items;return e===this.items?this:rk.create(e,this.additionalItems)}n--;const s=this.additionalItems.slice(0);for(;s.length<n;)s.push(0);return s[n]|=1<<(31&i),rk.create(this.items,s)}merge(e){const t=this.items|e.items;if(this.additionalItems===ok&&e.additionalItems===ok)return t===this.items?this:t===e.items?e:rk.create(t,ok);const i=[];for(let t=0;t<Math.max(this.additionalItems.length,e.additionalItems.length);t++){const n=this.additionalItems[t]||0,s=e.additionalItems[t]||0;i.push(n|s)}return rk.create(t,i)}intersects(e){if(0!=(this.items&e.items))return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(0!=(this.additionalItems[t]&e.additionalItems[t]))return!0;return!1}}rk.cache=new Array(129),rk.empty=rk.create(0,ok);const ak={getKey:e=>e};class lk{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}}class hk{get length(){return this._length}constructor(e){this._length=e}}class dk extends hk{static create(e,t,i){let n=e.length;return t&&(n=$L(n,t.length)),i&&(n=$L(n,i.length)),new dk(n,e,t,i,t?t.missingOpeningBracketIds:rk.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,n,s){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=s}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new dk(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation($L(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class ck extends hk{static create23(e,t,i,n=!1){let s=e.length,o=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(s=$L(s,t.length),o=o.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");s=$L(s,i.length),o=o.merge(i.missingOpeningBracketIds)}return n?new gk(s,e.listHeight+1,e,t,i,o):new uk(s,e.listHeight+1,e,t,i,o)}static getEmpty(){return new fk(0,0,[],rk.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(0===e)return;const t=this.getChild(e-1),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){this.throwIfImmutable();if(0===this.childrenLength)return;const e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;if(0===this.childrenLength)return!1;let t=this;for(;4===t.kind;){const e=t.childrenLength;if(0===e)throw new $e;t=t.getChild(e-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n<e;n++){const e=this.getChild(n);t=$L(t,e.length),i=i.merge(e.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(-1!==this.cachedMinIndentation)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,n=e;for(let e=0;e<this.childrenLength;e++){const s=this.getChild(e);s&&(i=Math.min(i,s.computeMinIndentation(n,t)),n=$L(n,s.length))}return this.cachedMinIndentation=i,i}}class uk extends ck{get childrenLength(){return null!==this._item3?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:return void(this._item1=t);case 1:return void(this._item2=t);case 2:return void(this._item3=t)}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,i,n,s,o){super(e,t,o),this._item1=i,this._item2=n,this._item3=s}deepClone(){return new uk(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class gk extends uk{toMutable(){return new uk(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class mk extends ck{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,n){super(e,t,n),this._children=i}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new mk(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class fk extends mk{toMutable(){return new mk(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const pk=[];class _k extends hk{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return pk}deepClone(){return this}}class vk extends _k{get kind(){return 0}get missingOpeningBracketIds(){return rk.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=qL(e),n=(0===i.columnCount?i.lineCount:i.lineCount+1)+1,s=(o=$L(e,this.length),Math.floor(o/2**26)+1);var o;let r=Number.MAX_SAFE_INTEGER;for(let e=n;e<=s;e++){const i=t.getLineFirstNonWhitespaceColumn(e),n=t.getLineContent(e);if(0===i)continue;const s=Sb.visibleColumnFromColumn(n,i,t.getOptions().tabSize);r=Math.min(r,s)}return r}}class bk extends _k{static create(e,t,i){return new bk(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return rk.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class Ck extends _k{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class wk{constructor(e,t,i,n,s){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=s}}class yk{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new Sk(this.textModel,this.bracketTokens),this._offset=0,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return jL(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=$L(this._offset,e);const t=qL(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=$L(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class Sk{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,null!==this.line&&(this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=e.length,e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const n=this.lineTokens,s=n.getCount();let o=null;if(this.lineTokenOffset<s){const r=n.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<s&&r===n.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const a=0===bm.getTokenType(r),l=bm.containsBalancedBrackets(r),h=n.getEndOffset(this.lineTokenOffset);if(l&&a&&this.lineCharOffset<h){const e=n.getLanguageId(this.lineTokenOffset),t=this.line.substring(this.lineCharOffset,h),i=this.bracketTokens.getSingleLanguageBracketTokens(e),s=i.regExpGlobal;if(s){s.lastIndex=0;const e=s.exec(t);e&&(o=i.getToken(e[0]),o&&(this.lineCharOffset+=e.index))}}if(i+=h-this.lineCharOffset,o){if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=o;break}return this.lineCharOffset+=o.length,o}this.lineTokenOffset++,this.lineCharOffset=h}else{if(this.lineIdx===this.textBufferLineCount-1)break;if(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3)break}if(i>1500)break}const n=(s=e,o=t,r=this.lineIdx,a=this.lineCharOffset,s!==r?jL(r-s,a):jL(0,a-o));var s,o,r,a;return new wk(n,0,-1,rk.getEmpty(),new vk(n))}}class Lk{constructor(e,t){this.text=e,this._offset=0,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+"|\n","gi"):null,s=[];let o,r=0,a=0,l=0,h=0;const d=[];for(let e=0;e<60;e++)d.push(new wk(jL(0,e),0,-1,rk.getEmpty(),new vk(jL(0,e))));const c=[];for(let e=0;e<60;e++)c.push(new wk(jL(1,e),0,-1,rk.getEmpty(),new vk(jL(1,e))));if(n)for(n.lastIndex=0;null!==(o=n.exec(e));){const e=o.index,i=o[0];if("\n"===i)r++,a=e+1;else{if(l!==e){let t;if(h===r){const i=e-l;if(i<d.length)t=d[i];else{const e=jL(0,i);t=new wk(e,0,-1,rk.getEmpty(),new vk(e))}}else{const i=r-h,n=e-a;if(1===i&&n<c.length)t=c[n];else{const e=jL(i,n);t=new wk(e,0,-1,rk.getEmpty(),new vk(e))}}s.push(t)}s.push(t.getToken(i)),l=e+i.length,h=r}}const u=e.length;if(l!==u){const e=h===r?jL(0,u-l):jL(r-h,u-a);s.push(new wk(e,0,-1,rk.getEmpty(),new vk(e)))}this.length=jL(r,u-a),this.tokens=s}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new je}}class kk{static createFromLanguage(e,t){function i(e){return t.getKey(`${e.languageId}:::${e.bracketText}`)}const n=new Map;for(const t of e.bracketsNew.openingBrackets){const e=jL(0,t.bracketText.length),s=i(t),o=rk.getEmpty().add(s,ak);n.set(t.bracketText,new wk(e,1,s,o,bk.create(e,t,o)))}for(const t of e.bracketsNew.closingBrackets){const e=jL(0,t.bracketText.length);let s=rk.getEmpty();const o=t.getOpeningBrackets();for(const e of o)s=s.add(i(e),ak);n.set(t.bracketText,new wk(e,2,i(o[0]),s,bk.create(e,t,s)))}return new kk(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(e=>function(e){let t=Un(e);/^[\w ]+/.test(e)&&(t="\\b"+t);/[\w ]+$/.test(e)&&(t+="\\b");return t}(e)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(2===i.kind&&i.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}}class Dk{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=kk.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function xk(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;for(;i>3;){const n=i>>1;for(let s=0;s<n;s++){const n=s<<1;e[s]=ck.create23(e[n],e[n+1],n+3===i?e[n+2]:null,t)}i=n}return ck.create23(e[0],e[1],i>=3?e[2]:null,t)}function Ek(e,t){return Math.abs(e.listHeight-t.listHeight)}function Nk(e,t){return e.listHeight===t.listHeight?ck.create23(e,t,null,!1):e.listHeight>t.listHeight?function(e,t){let i=e=e.toMutable();const n=[];let s;for(;;){if(t.listHeight===i.listHeight){s=t;break}if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeLastElementMutable()}for(let e=n.length-1;e>=0;e--){const t=n[e];s?t.childrenLength>=3?s=ck.create23(t.unappendChild(),s,null,!1):(t.appendChildOfSameHeight(s),s=void 0):t.handleChildrenChanged()}return s?ck.create23(e,s,null,!1):e}(e,t):function(e,t){let i=e=e.toMutable();const n=[];for(;t.listHeight!==i.listHeight;){if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let s=t;for(let e=n.length-1;e>=0;e--){const t=n[e];s?t.childrenLength>=3?s=ck.create23(s,t.unprependChild(),null,!1):(t.prependChildOfSameHeight(s),s=void 0):t.handleChildrenChanged()}return s?ck.create23(s,e,null,!1):e}(t,e)}class Ik{constructor(e){this.lastOffset=0,this.nextNodes=[e],this.offsets=[0],this.idxs=[]}readLongestNodeAt(e,t){if(QL(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=Mk(this.nextNodes);if(!i)return;const n=Mk(this.offsets);if(QL(e,n))return;if(QL(n,e))if($L(n,i.length)<=e)this.nextNodeAfterCurrent();else{const e=Tk(i);-1!==e?(this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const e=Tk(i);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){const e=Mk(this.offsets),t=Mk(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const i=Mk(this.nextNodes),n=Tk(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push($L(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}}function Tk(e,t=-1){for(;;){if(++t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function Mk(e){return e.length>0?e[e.length-1]:void 0}function Ak(e,t,i,n){return new Ok(e,t,i,n).parseDocument()}class Ok{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new Ik(i):void 0,this.positionMapper=new nk(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(rk.getEmpty(),0);return e||(e=ck.getEmpty()),e}parseList(e,t){const i=[];for(;;){let n=this.tryReadChildFromCache(e);if(!n){const i=this.tokenizer.peek();if(!i||2===i.kind&&i.bracketIds.intersects(e))break;n=this.parseChild(e,t+1)}4===n.kind&&0===n.childrenLength||i.push(n)}return this.oldNodeReader?function(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function i(){if(t>=e.length)return null;const i=t,n=e[i].listHeight;for(t++;t<e.length&&e[t].listHeight===n;)t++;return t-i>=2?xk(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),s=i();if(!s)return n;for(let e=i();e;e=i())Ek(n,s)<=Ek(s,e)?(n=Nk(n,s),s=e):s=Nk(s,e);return Nk(n,s)}(i):xk(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(null===t||!UL(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),i=>{if(null!==t&&!QL(i.length,t))return!1;return i.canBeReused(e)});if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new Ck(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new vk(i.length);const n=e.merge(i.bracketIds),s=this.parseList(n,t+1),o=this.tokenizer.peek();return o&&2===o.kind&&(o.bracketId===i.bracketId||o.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),dk.create(i.astNode,s,o.astNode)):dk.create(i.astNode,s,null)}default:throw new Error("unexpected")}}}function Rk(e,t){if(0===e.length)return t;if(0===t.length)return e;const i=new S(Fk(e)),n=Fk(t);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=i.dequeue();function o(e){if(void 0===e){const e=i.takeWhile(e=>!0)||[];return s&&e.unshift(s),e}const t=[];for(;s&&!UL(e);){const[n,o]=s.splitAt(e);t.push(n),e=YL(n.lengthAfter,e),s=null!=o?o:i.dequeue()}return UL(e)||t.push(new Pk(!1,e,e)),t}const r=[];function a(e,t,i){if(r.length>0&&ZL(r[r.length-1].endOffset,e)){const e=r[r.length-1];r[r.length-1]=new ik(e.startOffset,t,$L(e.newLength,i))}else r.push({startOffset:e,endOffset:t,newLength:i})}let l=0;for(const e of n){const t=o(e.lengthBefore);if(e.modified){const i=$L(l,GL(t,e=>e.lengthBefore));a(l,i,e.lengthAfter),l=i}else for(const e of t){const t=l;l=$L(l,e.lengthBefore),e.modified&&a(t,l,e.lengthAfter)}}return r}class Pk{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=YL(e,this.lengthAfter);return ZL(t,0)?[this,void 0]:this.modified?[new Pk(this.modified,this.lengthBefore,e),new Pk(this.modified,0,t)]:[new Pk(this.modified,e,e),new Pk(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${qL(this.lengthBefore)} -> ${qL(this.lengthAfter)}`}}function Fk(e){const t=[];let i=0;for(const n of e){const e=YL(i,n.startOffset);UL(e)||t.push(new Pk(!1,e,e));const s=YL(n.startOffset,n.endOffset);t.push(new Pk(!0,s,n.newLength)),i=n.endOffset}return t}class Bk extends st{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new ft,this.denseKeyProvider=new lk,this.brackets=new Dk(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)2===e.tokenization.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new Lk(this.textModel.getValue(),e);this.initialAstWithoutTokens=Ak(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.tokenization.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(e=>new ik(jL(e.fromLineNumber-1,0),jL(e.toLineNumber,0),jL(e.toLineNumber-e.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=ik.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=Rk(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=Rk(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t;return Ak(new yk(this.textModel,this.brackets),e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=jL(e.startLineNumber-1,e.startColumn-1),n=jL(e.endLineNumber-1,e.endColumn-1);return new L(e=>{const s=this.initialAstWithoutTokens||this.astWithTokens;!function e(t,i,n,s,o,r,a,l,h,d,c=!1){if(a>200)return!0;e:for(;;)switch(t.kind){case 4:{const l=t.childrenLength;for(let c=0;c<l;c++){const l=t.getChild(c);if(l){if(n=$L(i,l.length),XL(i,o)&&JL(n,s)){if(JL(n,o)){t=l;continue e}if(!e(l,i,n,s,o,r,a,0,h,d))return!1}i=n}}return!0}case 2:{const c=!d||!t.closingBracket||t.closingBracket.bracketInfo.closesColorized(t.openingBracket.bracketInfo);let u=0;if(h){let e=h.get(t.openingBracket.text);void 0===e&&(e=0),u=e,c&&(e++,h.set(t.openingBracket.text,e))}const g=t.childrenLength;for(let m=0;m<g;m++){const g=t.getChild(m);if(g){if(n=$L(i,g.length),XL(i,o)&&JL(n,s)){if(JL(n,o)&&1!==g.kind){t=g,c?(a++,l=u+1):l=u;continue e}if(c||1!==g.kind||!t.closingBracket){if(!e(g,i,n,s,o,r,c?a+1:a,c?u+1:u,h,d,!t.closingBracket))return!1}}i=n}}return null==h||h.set(t.openingBracket.text,u),!0}case 3:{const e=tk(i,n);return r(new HL(e,a-1,0,!0))}case 1:{const e=tk(i,n);return r(new HL(e,a-1,l-1,c))}case 0:return!0}}(s,0,s.length,i,n,e,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=ek(e.getStartPosition()),n=ek(e.getEndPosition());return new L(e=>{const s=this.initialAstWithoutTokens||this.astWithTokens,o=new Wk(e,t,this.textModel);!function e(t,i,n,s,o,r,a,l){var h;if(a>200)return!0;let d=!0;if(2===t.kind){let c=0;if(l){let e=l.get(t.openingBracket.text);void 0===e&&(e=0),c=e,e++,l.set(t.openingBracket.text,e)}const u=$L(i,t.openingBracket.length);let g=-1;if(r.includeMinIndentation&&(g=t.computeMinIndentation(i,r.textModel)),d=r.push(new zL(tk(i,n),tk(i,u),t.closingBracket?tk($L(u,(null===(h=t.child)||void 0===h?void 0:h.length)||0),n):void 0,a,c,t,g)),i=u,d&&t.child){const h=t.child;if(n=$L(i,h.length),XL(i,o)&&JL(n,s)&&(d=e(h,i,n,s,o,r,a+1,l),!d))return!1}null==l||l.set(t.openingBracket.text,c)}else{let n=i;for(const i of t.children){const t=n;if(n=$L(n,i.length),XL(t,o)&&XL(s,n)&&(d=e(i,t,n,s,o,r,a,l),!d))return!1}}return d}(s,0,s.length,i,n,o,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return function e(t,i,n,s){if(4===t.kind||2===t.kind){for(const o of t.children){if(n=$L(i,o.length),QL(s,n)){const t=e(o,i,n,s);if(t)return t}i=n}return null}if(3===t.kind)return null;if(1===t.kind){const e=tk(i,n);return{bracketInfo:t.bracketInfo,range:e}}return null}(t,0,t.length,ek(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return function e(t,i,n,s){if(4===t.kind||2===t.kind){const o=[];for(const e of t.children)n=$L(i,e.length),o.push({nodeOffsetStart:i,nodeOffsetEnd:n}),i=n;for(let i=o.length-1;i>=0;i--){const{nodeOffsetStart:n,nodeOffsetEnd:r}=o[i];if(QL(n,s)){const o=e(t.children[i],n,r,s);if(o)return o}}return null}if(3===t.kind)return null;if(1===t.kind){const e=tk(i,n);return{bracketInfo:t.bracketInfo,range:e}}return null}(t,0,t.length,ek(e))}}class Wk{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}class Vk extends st{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new ot),this.onDidChangeEmitter=new ft,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(e=>{var t;e.languageId&&!(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.didLanguageChange(e.languageId))||(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;null===(e=this.bracketPairsTree.value)||void 0===e||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const i=new nt;this.bracketPairsTree.value=(e=i.add(new Bk(this.textModel,e=>this.languageConfigurationService.getLanguageConfiguration(e))),t=i,{object:e,dispose:()=>null==t?void 0:t.dispose()}),i.add(this.bracketPairsTree.value.object.onDidChange(e=>this.onDidChangeEmitter.fire(e))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire());var e,t}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!1))||L.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!0))||L.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(i=this.bracketPairsTree.value)||void 0===i?void 0:i.object.getBracketsInRange(e,t))||L.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),s=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const i=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew.getClosingBracketInfo(e);if(!i)return null;const n=this.getBracketPairsInRange(wi.fromPositions(t,t)).findLast(e=>i.closes(e.openingBracketInfo));return n?n.openingBracketRange:null}{const t=e.toLowerCase(),o=this.languageConfigurationService.getLanguageConfiguration(s).brackets;if(!o)return null;const r=o.textIsBracket[t];return r?Kk(this._findMatchingBracketUp(r,n,Hk(i))):null}}matchBracket(e,t){if(this.canBuildAST){const t=this.getBracketPairsInRange(wi.fromPositions(e,e)).filter(t=>void 0!==t.closingBracketRange&&(t.openingBracketRange.containsPosition(e)||t.closingBracketRange.containsPosition(e))).findLastMaxBy(C(t=>t.openingBracketRange.containsPosition(e)?t.openingBracketRange:t.closingBracketRange,wi.compareRangesUsingStarts));return t?[t.openingBracketRange,t.closingBracketRange]:null}{const i=Hk(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const s=t.getCount(),o=t.getLanguageId(n);let r=Math.max(0,e.column-1-i.maxBracketLength);for(let e=n-1;e>=0;e--){const i=t.getEndOffset(e);if(i<=r)break;if(Nd(t.getStandardTokenType(e))||t.getLanguageId(e)!==o){r=i;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let e=n+1;e<s;e++){const i=t.getStartOffset(e);if(i>=a)break;if(Nd(t.getStandardTokenType(e))||t.getLanguageId(e)!==o){a=i;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),s=this.textModel.getLineContent(i),o=n.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(o)).brackets;if(r&&!Nd(n.getStandardTokenType(o))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,r,o),h=null;for(;;){const n=$d.findNextBracketInRange(r.forwardRegex,i,s,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){const e=s.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,r.textIsBracket[e],r.textIsOpenBracket[e],t);if(i){if(i instanceof zk)return null;h=i}}a=n.endColumn-1}if(h)return h}if(o>0&&n.getStartOffset(o)===e.column-1){const r=o-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Nd(n.getStandardTokenType(r))){const{searchStartOffset:o,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),h=$d.findPrevBracketInRange(a.reversedRegex,i,s,o,l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const e=s.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),i=this._matchFoundBracket(h,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof zk?null:i}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const s=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return s?s instanceof zk?s:[e,s]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,s=e.reversedRegex;let o=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return zk.INSTANCE;const h=$d.findPrevBracketInRange(s,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?o++:e.isClose(d)&&o--,0===o)return h;l=h.startColumn-1}return null};for(let e=t.lineNumber;e>=1;e--){const i=this.textModel.tokenization.getLineTokens(e),s=i.getCount(),o=this.textModel.getLineContent(e);let r=s-1,l=o.length,h=o.length;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1);let d=!0;for(;r>=0;r--){const t=i.getLanguageId(r)===n&&!Nd(i.getStandardTokenType(r));if(t)d?l=i.getStartOffset(r):(l=i.getStartOffset(r),h=i.getEndOffset(r));else if(d&&l!==h){const t=a(e,o,l,h);if(t)return t}d=t}if(d&&l!==h){const t=a(e,o,l,h);if(t)return t}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,s=e.forwardRegex;let o=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return zk.INSTANCE;const h=$d.findNextBracketInRange(s,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?o++:e.isClose(d)&&o--,0===o)return h;a=h.endColumn-1}return null},l=this.textModel.getLineCount();for(let e=t.lineNumber;e<=l;e++){const i=this.textModel.tokenization.getLineTokens(e),s=i.getCount(),o=this.textModel.getLineContent(e);let r=0,l=0,h=0;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1);let d=!0;for(;r<s;r++){const t=i.getLanguageId(r)===n&&!Nd(i.getStandardTokenType(r));if(t)d||(l=i.getStartOffset(r)),h=i.getEndOffset(r);else if(d&&l!==h){const t=a(e,o,l,h);if(t)return t}d=t}if(d&&l!==h){const t=a(e,o,l,h);if(t)return t}}return null}findPrevBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketBefore(i))||null;let n=null,s=null,o=null;for(let e=i.lineNumber;e>=1;e--){const t=this.textModel.tokenization.getLineTokens(e),r=t.getCount(),a=this.textModel.getLineContent(e);let l=r-1,h=a.length,d=a.length;if(e===i.lineNumber){l=t.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const e=t.getLanguageId(l);n!==e&&(n=e,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,o=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let c=!0;for(;l>=0;l--){const i=t.getLanguageId(l);if(n!==i){if(s&&o&&c&&h!==d){const t=$d.findPrevBracketInRange(s.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(o,t);c=!1}n=i,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,o=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const r=!!s&&!Nd(t.getStandardTokenType(l));if(r)c?h=t.getStartOffset(l):(h=t.getStartOffset(l),d=t.getEndOffset(l));else if(o&&s&&c&&h!==d){const t=$d.findPrevBracketInRange(s.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(o,t)}c=r}if(o&&s&&c&&h!==d){const t=$d.findPrevBracketInRange(s.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(o,t)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketAfter(i))||null;const n=this.textModel.getLineCount();let s=null,o=null,r=null;for(let e=i.lineNumber;e<=n;e++){const t=this.textModel.tokenization.getLineTokens(e),n=t.getCount(),a=this.textModel.getLineContent(e);let l=0,h=0,d=0;if(e===i.lineNumber){l=t.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const e=t.getLanguageId(l);s!==e&&(s=e,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let c=!0;for(;l<n;l++){const i=t.getLanguageId(l);if(s!==i){if(r&&o&&c&&h!==d){const t=$d.findNextBracketInRange(o.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t);c=!1}s=i,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew}const n=!!o&&!Nd(t.getStandardTokenType(l));if(n)c||(h=t.getStartOffset(l)),d=t.getEndOffset(l);else if(r&&o&&c&&h!==d){const t=$d.findNextBracketInRange(o.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t)}c=n}if(r&&o&&c&&h!==d){const t=$d.findNextBracketInRange(o.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const e=wi.fromPositions(i),t=this.getBracketPairsInRange(wi.fromPositions(i,i)).findLast(t=>void 0!==t.closingBracketRange&&t.range.strictContainsRange(e));return t?[t.openingBracketRange,t.closingBracketRange]:null}const n=Hk(t),s=this.textModel.getLineCount(),o=new Map;let r=[];const a=(e,t)=>{if(!o.has(e)){const i=[];for(let e=0,n=t?t.brackets.length:0;e<n;e++)i[e]=0;o.set(e,i)}r=o.get(e)};let l=0;const h=(e,t,i,s,o)=>{for(;;){if(n&&++l%100==0&&!n())return zk.INSTANCE;const a=$d.findNextBracketInRange(e.forwardRegex,t,i,s,o);if(!a)break;const h=i.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),d=e.textIsBracket[h];if(d&&(d.isOpen(h)?r[d.index]++:d.isClose(h)&&r[d.index]--,-1===r[d.index]))return this._matchFoundBracket(a,d,!1,n);s=a.endColumn-1}return null};let d=null,c=null;for(let e=i.lineNumber;e<=s;e++){const t=this.textModel.tokenization.getLineTokens(e),n=t.getCount(),s=this.textModel.getLineContent(e);let o=0,r=0,l=0;if(e===i.lineNumber){o=t.findTokenIndexAtOffset(i.column-1),r=i.column-1,l=i.column-1;const e=t.getLanguageId(o);d!==e&&(d=e,c=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,c))}let u=!0;for(;o<n;o++){const i=t.getLanguageId(o);if(d!==i){if(c&&u&&r!==l){const t=h(c,e,s,r,l);if(t)return Kk(t);u=!1}d=i,c=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,c)}const n=!!c&&!Nd(t.getStandardTokenType(o));if(n)u||(r=t.getStartOffset(o)),l=t.getEndOffset(o);else if(c&&u&&r!==l){const t=h(c,e,s,r,l);if(t)return Kk(t)}u=n}if(c&&u&&r!==l){const t=h(c,e,s,r,l);if(t)return Kk(t)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();const n=e.getBracketInfo(i);return n?{range:t,bracketInfo:n}:null}}function Hk(e){if(void 0===e)return()=>!0;{const t=Date.now();return()=>Date.now()-t<=e}}class zk{constructor(){this._searchCanceledBrand=void 0}}function Kk(e){return e instanceof zk?null:e}zk.INSTANCE=new zk;class Uk extends st{constructor(e){super(),this.textModel=e,this.colorProvider=new jk,this.onDidChangeEmitter=new ft,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(e=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){if(n)return[];if(void 0===t)return[];if(!this.colorizationOptions.enabled)return[];return this.textModel.bracketPairs.getBracketsInRange(e,!0).map(e=>({id:`bracket${e.range.toString()}-${e.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(e,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:e.range})).toArray()}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new wi(1,1,this.textModel.getLineCount(),1),e,t):[]}}class jk{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return"bracket-highlighting-"+e%30}}function qk(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}TC((e,t)=>{const i=[lw,hw,dw,cw,uw,gw],n=new jk;t.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${e.getColor(mw)}; }`);const s=i.map(t=>e.getColor(t)).filter(e=>!!e).filter(e=>!e.isTransparent());for(let e=0;e<30;e++){const i=s[e%s.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e)} { color: ${i}; }`)}});class $k{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,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${qk(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${qk(this.oldText)}")`:`(replace@${this.oldPosition} "${qk(this.oldText)}" with "${qk(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Td.f(e,n,i),i+=4;for(let s=0;s<n;s++)Td.e(e,t.charCodeAt(s),i),i+=2;return i}static _readString(e,t){const i=Td.c(e,t);return Fd(e,t+=4,i)}writeSize(){return 8+$k._writeStringSize(this.oldText)+$k._writeStringSize(this.newText)}write(e,t){return Td.f(e,this.oldPosition,t),t+=4,Td.f(e,this.newPosition,t),t+=4,t=$k._writeString(e,this.oldText,t),t=$k._writeString(e,this.newText,t)}static read(e,t,i){const n=Td.c(e,t);t+=4;const s=Td.c(e,t);t+=4;const o=$k._readString(e,t);t+=$k._writeStringSize(o);const r=$k._readString(e,t);return t+=$k._writeStringSize(r),i.push(new $k(n,o,s,r)),t}}class Gk{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,i=this._getPrev(e),n=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(null===i){this._acceptCurr(n),n=this._getCurr(++t);continue}if(null===n){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldEnd<=i.newPosition){this._acceptCurr(n),n=this._getCurr(++t);continue}if(i.newEnd<=n.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldPosition<i.newPosition){const[e,t]=Gk._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(e),n=t;continue}if(i.newPosition<n.oldPosition){const[e,t]=Gk._splitPrev(i,n.oldPosition-i.newPosition);this._acceptPrev(e),i=t;continue}let s,o;if(n.oldEnd===i.newEnd)s=i,o=n,i=this._getPrev(++e),n=this._getCurr(++t);else if(n.oldEnd<i.newEnd){const[e,r]=Gk._splitPrev(i,n.oldLength);s=e,o=n,i=r,n=this._getCurr(++t)}else{const[t,r]=Gk._splitCurr(n,i.newLength);s=i,o=t,i=this._getPrev(++e),n=r}this._result[this._resultLen++]=new $k(s.oldPosition,s.oldText,o.newPosition,o.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=o.newLength-o.oldLength}const s=Gk._merge(this._result);return Gk._removeNoOps(s)}_acceptCurr(e){this._result[this._resultLen++]=Gk._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=Gk._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new $k(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new $k(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),n=e.newText.substr(t);return[new $k(e.oldPosition,e.oldText,e.newPosition,i),new $k(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new $k(e.oldPosition,i,e.newPosition,e.newText),new $k(e.oldPosition+t,n,e.newEnd,"")]}static _merge(e){if(0===e.length)return e;const t=[];let i=0,n=e[0];for(let s=1;s<e.length;s++){const o=e[s];n.oldEnd===o.oldPosition?n=new $k(n.oldPosition,n.oldText+o.oldText,n.newPosition,n.newText+o.newText):(t[i++]=n,n=o)}return t[i++]=n,t}static _removeNoOps(e){if(0===e.length)return e;const t=[];let i=0;for(let n=0;n<e.length;n++){const s=e[n];s.oldText!==s.newText&&(t[i++]=s)}return t}}function Zk(e){return 47===e||92===e}function Yk(e){return e.replace(/[\\/]/g,Qt.sep)}function Qk(e,t=Qt.sep){if(!e)return"";const i=e.length,n=e.charCodeAt(0);if(Zk(n)){if(Zk(e.charCodeAt(1))&&!Zk(e.charCodeAt(2))){let n=3;const s=n;for(;n<i&&!Zk(e.charCodeAt(n));n++);if(s!==n&&!Zk(e.charCodeAt(n+1)))for(n+=1;n<i;n++)if(Zk(e.charCodeAt(n)))return e.slice(0,n+1).replace(/[\\/]/g,t)}return t}if(Jk(n)&&58===e.charCodeAt(1))return Zk(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);let s=e.indexOf("://");if(-1!==s)for(s+=3;s<i;s++)if(Zk(e.charCodeAt(s)))return e.slice(0,s+1);return""}function Xk(e,t,i,n=si){if(e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(i){if(!rs(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function Jk(e){return e>=65&&e<=90||e>=97&&e<=122}function eD(e){return pi(e,!0)}class tD{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Xn(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===wr.file)return Xk(eD(e),eD(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(lD(e.authority,t.authority))return Xk(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return di.joinPath(e,...t)}basenameOrAuthority(e){return sD(e)||e.authority}basename(e){return Qt.basename(e.path)}extname(e){return Qt.extname(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===wr.file?t=di.file(ti(eD(e))).path:(t=Qt.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(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===wr.file?di.file(Xt(eD(e))).path:Qt.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!lD(e.authority,t.authority))return;if(e.scheme===wr.file){const i=ei(eD(e),eD(t));return K.n?Yk(i):i}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(i.length,n.length);e<t&&(i.charCodeAt(e)===n.charCodeAt(e)||i.charAt(e).toLowerCase()===n.charAt(e).toLowerCase());e++);i=n.substr(0,e)+i.substr(e)}return Qt.relative(i,n)}resolvePath(e,t){if(e.scheme===wr.file){const i=di.file(Jt(eD(e),t));return e.with({authority:i.authority,path:i.path})}var i;return-1===(i=t).indexOf("/")&&(i=Yk(i)),/^[a-zA-Z]:(\/|$)/.test(i)&&(i="/"+i),t=i,e.with({path:Qt.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&"/"===e.path[0]}isEqualAuthority(e,t){return e===t||void 0!==e&&void 0!==t&&os(e,t)}hasTrailingPathSeparator(e,t=si){if(e.scheme===wr.file){const i=eD(e);return i.length>Qk(i).length&&i[i.length-1]===t}{const t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=si){return hD(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=si){let i=!1;if(e.scheme===wr.file){const n=eD(e);i=void 0!==n&&n.length===Qk(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=1===n.length&&47===n.charCodeAt(n.length-1)}return i||hD(e,t)?e:e.with({path:e.path+"/"})}}const iD=new tD(()=>!1),nD=(new tD(e=>e.scheme!==wr.file||!K.g),new tD(e=>!0),iD.isEqual.bind(iD)),sD=(iD.isEqualOrParent.bind(iD),iD.getComparisonKey.bind(iD),iD.basenameOrAuthority.bind(iD),iD.basename.bind(iD)),oD=(iD.extname.bind(iD),iD.dirname.bind(iD)),rD=(iD.joinPath.bind(iD),iD.normalizePath.bind(iD)),aD=(iD.relativePath.bind(iD),iD.resolvePath.bind(iD)),lD=(iD.isAbsolutePath.bind(iD),iD.isEqualAuthority.bind(iD)),hD=iD.hasTrailingPathSeparator.bind(iD);iD.removeTrailingPathSeparator.bind(iD),iD.addTrailingPathSeparator.bind(iD);var dD;function cD(e){return e.toString()}!function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)});const n=t.path.substring(0,t.path.indexOf(";"));return n&&i.set(e.META_DATA_MIME,n),i}}(dD||(dD={}));class uD{static create(e,t){const i=e.getAlternativeVersionId(),n=mD(e);return new uD(i,i,n,n,t,t,[])}constructor(e,t,i,n,s,o,r){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=s,this.afterCursorState=o,this.changes=r}append(e,t,i,n,s){var o,r;t.length>0&&(this.changes=(o=this.changes,r=t,null===o||0===o.length?r:new Gk(o,r).compress())),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=s}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(Td.f(e,t?t.length:0,i),i+=4,t)for(const n of t)Td.f(e,n.selectionStartLineNumber,i),i+=4,Td.f(e,n.selectionStartColumn,i),i+=4,Td.f(e,n.positionLineNumber,i),i+=4,Td.f(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Td.c(e,t);t+=4;for(let s=0;s<n;s++){const n=Td.c(e,t);t+=4;const s=Td.c(e,t);t+=4;const o=Td.c(e,t);t+=4;const r=Td.c(e,t);t+=4,i.push(new yi(n,s,o,r))}return t}serialize(){let e=10+uD._writeSelectionsSize(this.beforeCursorState)+uD._writeSelectionsSize(this.afterCursorState)+4;for(const t of this.changes)e+=t.writeSize();const t=new Uint8Array(e);let i=0;Td.f(t,this.beforeVersionId,i),i+=4,Td.f(t,this.afterVersionId,i),i+=4,Td.g(t,this.beforeEOL,i),i+=1,Td.g(t,this.afterEOL,i),i+=1,i=uD._writeSelections(t,this.beforeCursorState,i),i=uD._writeSelections(t,this.afterCursorState,i),Td.f(t,this.changes.length,i),i+=4;for(const e of this.changes)i=e.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const n=Td.c(t,i);i+=4;const s=Td.c(t,i);i+=4;const o=Td.d(t,i);i+=1;const r=Td.d(t,i);i+=1;const a=[];i=uD._readSelections(t,i,a);const l=[];i=uD._readSelections(t,i,l);const h=Td.c(t,i);i+=4;const d=[];for(let e=0;e<h;e++)i=$k.read(t,i,d);return new uD(n,s,o,r,a,l,d)}}class gD{get type(){return 0}get resource(){return di.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,n){this.label=e,this.code=t,this.model=i,this._data=uD.create(i,n)}toString(){return(this._data instanceof uD?this._data:uD.deserialize(this._data)).changes.map(e=>e.toString()).join(", ")}matchesResource(e){return(di.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof uD}append(e,t,i,n,s){this._data instanceof uD&&this._data.append(e,t,i,n,s)}close(){this._data instanceof uD&&(this._data=this._data.serialize())}open(){this._data instanceof uD||(this._data=uD.deserialize(this._data))}undo(){if(di.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof uD&&(this._data=this._data.serialize());const e=uD.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(di.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof uD&&(this._data=this._data.serialize());const e=uD.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof uD&&(this._data=this._data.serialize()),this._data.byteLength+168}}function mD(e){return"\n"===e.getEOL()?0:1}function fD(e){return!!e&&(e instanceof gD||e instanceof class{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const e of this._editStackElementsArr){const t=cD(e.resource);this._editStackElementsMap.set(t,e)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=cD(e);return this._editStackElementsMap.has(t)}setModel(e){const t=cD(di.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=cD(e.uri);if(this._editStackElementsMap.has(t)){return this._editStackElementsMap.get(t).canAppend(e)}return!1}append(e,t,i,n,s){const o=cD(e.uri);this._editStackElementsMap.get(o).append(e,t,i,n,s)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=cD(e);if(this._editStackElementsMap.has(t)){return this._editStackElementsMap.get(t).heapSize()}return 0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${sD(t.resource)}: ${t}`);return`{${e.join(", ")}}`}})}class pD{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);fD(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);fD(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(fD(i)&&i.canAppend(this._model))return i;const n=new gD(J.b("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],mD(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const s=this._getOrCreateEditStackElement(e,n),o=this._model.applyEdits(t,!0),r=pD._computeCursorState(i,o),a=o.map((e,t)=>({index:t,textChange:e.textChange}));return a.sort((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition),s.append(this._model,a.map(e=>e.textChange),mD(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(e){return Be(e),null}}}class _D{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function vD(e,t,i,n,s){let o;for(s.spacesDiff=0,s.looksLikeAlignment=!1,o=0;o<t&&o<n;o++){if(e.charCodeAt(o)!==i.charCodeAt(o))break}let r=0,a=0;for(let i=o;i<t;i++){32===e.charCodeAt(i)?r++:a++}let l=0,h=0;for(let e=o;e<n;e++){32===i.charCodeAt(e)?l++:h++}if(r>0&&a>0)return;if(l>0&&h>0)return;const d=Math.abs(a-h),c=Math.abs(r-l);if(0===d)return s.spacesDiff=c,void(c>0&&0<=l-1&&l-1<e.length&&l<i.length&&32!==i.charCodeAt(l)&&32===e.charCodeAt(l-1)&&44===e.charCodeAt(e.length-1)&&(s.looksLikeAlignment=!0));c%d!=0||(s.spacesDiff=c/d)}function bD(e,t,i){const n=Math.min(e.getLineCount(),1e4);let s=0,o=0,r="",a=0;const l=[2,4,6,8,3,5,7],h=[0,0,0,0,0,0,0,0,0],d=new _D;for(let l=1;l<=n;l++){const n=e.getLineLength(l),c=e.getLineContent(l),u=n<=65536;let g=!1,m=0,f=0,p=0;for(let t=0,i=n;t<i;t++){const i=u?c.charCodeAt(t):e.getLineCharCode(l,t);if(9===i)p++;else{if(32!==i){g=!0,m=t;break}f++}}if(!g)continue;if(p>0?s++:f>1&&o++,vD(r,a,c,m,d),d.looksLikeAlignment&&(!i||t!==d.spacesDiff))continue;const _=d.spacesDiff;_<=8&&h[_]++,r=c,a=m}let c=i;s!==o&&(c=s<o);let u=t;if(c){let e=c?0:.1*n;l.forEach(t=>{const i=h[t];i>e&&(e=i,u=t)}),4===u&&h[4]>0&&h[2]>0&&h[2]>=h[4]/2&&(u=2)}return{insertSpaces:c,tabSize:u}}function CD(e){return(1&e.metadata)>>>0}function wD(e,t){e.metadata=254&e.metadata|t<<0}function yD(e){return(2&e.metadata)>>>1==1}function SD(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function LD(e){return(4&e.metadata)>>>2==1}function kD(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function DD(e){return(64&e.metadata)>>>6==1}function xD(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}function ED(e,t){e.metadata=231&e.metadata|t<<3}function ND(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class ID{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,wD(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,kD(this,!1),xD(this,!1),ED(this,1),ND(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,SD(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;kD(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),xD(this,null!==this.options.glyphMarginClassName),ED(this,this.options.stickiness),ND(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const TD=new ID(null,0,0);TD.parent=TD,TD.left=TD,TD.right=TD,wD(TD,0);class MD{constructor(){this.root=TD,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,s,o){return this.root===TD?[]:function(e,t,i,n,s,o,r){let a=e.root,l=0,h=0,d=0,c=0;const u=[];let g=0;for(;a!==TD;)if(yD(a))SD(a.left,!1),SD(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;else{if(!yD(a.left)){if(h=l+a.maxEnd,h<t){SD(a,!0);continue}if(a.left!==TD){a=a.left;continue}}if(d=l+a.start,d>i)SD(a,!0);else{if(c=l+a.end,c>=t){a.setCachedOffsets(d,c,o);let e=!0;n&&a.ownerId&&a.ownerId!==n&&(e=!1),s&&LD(a)&&(e=!1),r&&!DD(a)&&(e=!1),e&&(u[g++]=a)}SD(a,!0),a.right===TD||yD(a.right)||(l+=a.delta,a=a.right)}}return SD(e.root,!1),u}(this,e,t,i,n,s,o)}search(e,t,i,n){return this.root===TD?[]:function(e,t,i,n,s){let o=e.root,r=0,a=0,l=0;const h=[];let d=0;for(;o!==TD;){if(yD(o)){SD(o.left,!1),SD(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==TD&&!yD(o.left)){o=o.left;continue}a=r+o.start,l=r+o.end,o.setCachedOffsets(a,l,n);let e=!0;t&&o.ownerId&&o.ownerId!==t&&(e=!1),i&&LD(o)&&(e=!1),s&&!DD(o)&&(e=!1),e&&(h[d++]=o),SD(o,!0),o.right===TD||yD(o.right)||(r+=o.delta,o=o.right)}return SD(e.root,!1),h}(this,e,t,i,n)}collectNodesFromOwner(e){return function(e,t){let i=e.root;const n=[];let s=0;for(;i!==TD;)yD(i)?(SD(i.left,!1),SD(i.right,!1),i=i.parent):i.left===TD||yD(i.left)?(i.ownerId===t&&(n[s++]=i),SD(i,!0),i.right===TD||yD(i.right)||(i=i.right)):i=i.left;return SD(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root;const i=[];let n=0;for(;t!==TD;)yD(t)?(SD(t.left,!1),SD(t.right,!1),t=t.parent):t.left===TD||yD(t.left)?t.right===TD||yD(t.right)?(i[n++]=t,SD(t,!0)):t=t.right:t=t.left;return SD(e.root,!1),i}(this)}insert(e){RD(this,e),this._normalizeDeltaIfNecessary()}delete(e){PD(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const s=i.start+n,o=i.end+n;i.setCachedOffsets(s,o,t)}acceptReplace(e,t,i,n){const s=function(e,t,i){let n=e.root,s=0,o=0,r=0,a=0;const l=[];let h=0;for(;n!==TD;)if(yD(n))SD(n.left,!1),SD(n.right,!1),n===n.parent.right&&(s-=n.parent.delta),n=n.parent;else{if(!yD(n.left)){if(o=s+n.maxEnd,o<t){SD(n,!0);continue}if(n.left!==TD){n=n.left;continue}}r=s+n.start,r>i?SD(n,!0):(a=s+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[h++]=n),SD(n,!0),n.right===TD||yD(n.right)||(s+=n.delta,n=n.right))}return SD(e.root,!1),l}(this,e,e+t);for(let e=0,t=s.length;e<t;e++){PD(this,s[e])}this._normalizeDeltaIfNecessary(),function(e,t,i,n){let s=e.root,o=0,r=0,a=0;const l=n-(i-t);for(;s!==TD;)if(yD(s))SD(s.left,!1),SD(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),HD(s),s=s.parent;else{if(!yD(s.left)){if(r=o+s.maxEnd,r<t){SD(s,!0);continue}if(s.left!==TD){s=s.left;continue}}a=o+s.start,a>i?(s.start+=l,s.end+=l,s.delta+=l,(s.delta<-1073741824||s.delta>1073741824)&&(e.requestNormalizeDelta=!0),SD(s,!0)):(SD(s,!0),s.right===TD||yD(s.right)||(o+=s.delta,s=s.right))}SD(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let o=0,r=s.length;o<r;o++){const r=s[o];r.start=r.cachedAbsoluteStart,r.end=r.cachedAbsoluteEnd,OD(r,e,e+t,i,n),r.maxEnd=r.end,RD(this,r)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,function(e){let t=e.root,i=0;for(;t!==TD;)t.left===TD||yD(t.left)?t.right===TD||yD(t.right)?(t.start=i+t.start,t.end=i+t.end,t.delta=0,HD(t),SD(t,!0),SD(t.left,!1),SD(t.right,!1),t===t.parent.right&&(i-=t.parent.delta),t=t.parent):(i+=t.delta,t=t.right):t=t.left;SD(e.root,!1)}(this))}}function AD(e,t,i,n){return e<i||!(e>i)&&(1!==n&&(2===n||t))}function OD(e,t,i,n,s){const o=function(e){return(24&e.metadata)>>>3}(e),r=0===o||2===o,a=1===o||2===o,l=i-t,h=n,d=Math.min(l,h),c=e.start;let u=!1;const g=e.end;let m=!1;t<=c&&g<=i&&function(e){return(32&e.metadata)>>>5==1}(e)&&(e.start=t,u=!0,e.end=t,m=!0);{const e=s?1:l>0?2:0;!u&&AD(c,r,t,e)&&(u=!0),!m&&AD(g,a,t,e)&&(m=!0)}if(d>0&&!s){const e=l>h?2:0;!u&&AD(c,r,t+d,e)&&(u=!0),!m&&AD(g,a,t+d,e)&&(m=!0)}{const n=s?1:0;!u&&AD(c,r,i,n)&&(e.start=t+h,u=!0),!m&&AD(g,a,i,n)&&(e.end=t+h,m=!0)}const f=h-l;u||(e.start=Math.max(0,c+f)),m||(e.end=Math.max(0,g+f)),e.start>e.end&&(e.end=e.start)}function RD(e,t){if(e.root===TD)return t.parent=TD,t.left=TD,t.right=TD,wD(t,0),e.root=t,e.root;!function(e,t){let i=0,n=e.root;const s=t.start,o=t.end;for(;;){if(KD(s,o,n.start+i,n.end+i)<0){if(n.left===TD){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===TD){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}}t.parent=n,t.left=TD,t.right=TD,wD(t,1)}(e,t),zD(t.parent);let i=t;for(;i!==e.root&&1===CD(i.parent);)if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===CD(t)?(wD(i.parent,0),wD(t,0),wD(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,BD(e,i)),wD(i.parent,0),wD(i.parent.parent,1),WD(e,i.parent.parent))}else{const t=i.parent.parent.left;1===CD(t)?(wD(i.parent,0),wD(t,0),wD(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,WD(e,i)),wD(i.parent,0),wD(i.parent.parent,1),BD(e,i.parent.parent))}return wD(e.root,0),t}function PD(e,t){let i,n;if(t.left===TD?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===TD?(i=t.left,n=t):(n=function(e){for(;e.left!==TD;)e=e.left;return e}(t.right),i=n.right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root)return e.root=i,wD(i,0),t.detach(),FD(),HD(i),void(e.root.parent=TD);const s=1===CD(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,wD(n,CD(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==TD&&(n.left.parent=n),n.right!==TD&&(n.right.parent=n)),t.detach(),s)return zD(i.parent),n!==t&&(zD(n),zD(n.parent)),void FD();let o;for(zD(i),zD(i.parent),n!==t&&(zD(n),zD(n.parent));i!==e.root&&0===CD(i);)i===i.parent.left?(o=i.parent.right,1===CD(o)&&(wD(o,0),wD(i.parent,1),BD(e,i.parent),o=i.parent.right),0===CD(o.left)&&0===CD(o.right)?(wD(o,1),i=i.parent):(0===CD(o.right)&&(wD(o.left,0),wD(o,1),WD(e,o),o=i.parent.right),wD(o,CD(i.parent)),wD(i.parent,0),wD(o.right,0),BD(e,i.parent),i=e.root)):(o=i.parent.left,1===CD(o)&&(wD(o,0),wD(i.parent,1),WD(e,i.parent),o=i.parent.left),0===CD(o.left)&&0===CD(o.right)?(wD(o,1),i=i.parent):(0===CD(o.left)&&(wD(o.right,0),wD(o,1),BD(e,o),o=i.parent.left),wD(o,CD(i.parent)),wD(i.parent,0),wD(o.left,0),WD(e,i.parent),i=e.root));wD(i,0),FD()}function FD(){TD.parent=TD,TD.delta=0,TD.start=0,TD.end=0}function BD(e,t){const i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==TD&&(i.left.parent=t),i.parent=t.parent,t.parent===TD?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,HD(t),HD(i)}function WD(e,t){const i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==TD&&(i.right.parent=t),i.parent=t.parent,t.parent===TD?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,HD(t),HD(i)}function VD(e){let t=e.end;if(e.left!==TD){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==TD){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function HD(e){e.maxEnd=VD(e)}function zD(e){for(;e!==TD;){const t=VD(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function KD(e,t,i,n){return e===i?t-n:e-i}class UD{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!==jD)return qD(this.right);let e=this;for(;e.parent!==jD&&e.parent.left!==e;)e=e.parent;return e.parent===jD?jD:e.parent}prev(){if(this.left!==jD)return $D(this.left);let e=this;for(;e.parent!==jD&&e.parent.right!==e;)e=e.parent;return e.parent===jD?jD:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const jD=new UD(null,0);function qD(e){for(;e.left!==jD;)e=e.left;return e}function $D(e){for(;e.right!==jD;)e=e.right;return e}function GD(e){return e===jD?0:e.size_left+e.piece.length+GD(e.right)}function ZD(e){return e===jD?0:e.lf_left+e.piece.lineFeedCnt+ZD(e.right)}function YD(){jD.parent=jD}function QD(e,t){const i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==jD&&(i.left.parent=t),i.parent=t.parent,t.parent===jD?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function XD(e,t){const i=t.left;t.left=i.right,i.right!==jD&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===jD?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function JD(e,t){let i,n;if(t.left===jD?(n=t,i=n.right):t.right===jD?(n=t,i=n.left):(n=qD(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),YD(),void(e.root.parent=jD);const s=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,ix(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,ix(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==jD&&(n.left.parent=n),n.right!==jD&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,ix(e,n)),t.detach(),i.parent.left===i){const t=GD(i),n=ZD(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){const s=t-i.parent.size_left,o=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,tx(e,i.parent,s,o)}}if(ix(e,i.parent),s)return void YD();let o;for(;i!==e.root&&0===i.color;)i===i.parent.left?(o=i.parent.right,1===o.color&&(o.color=0,i.parent.color=1,QD(e,i.parent),o=i.parent.right),0===o.left.color&&0===o.right.color?(o.color=1,i=i.parent):(0===o.right.color&&(o.left.color=0,o.color=1,XD(e,o),o=i.parent.right),o.color=i.parent.color,i.parent.color=0,o.right.color=0,QD(e,i.parent),i=e.root)):(o=i.parent.left,1===o.color&&(o.color=0,i.parent.color=1,XD(e,i.parent),o=i.parent.left),0===o.left.color&&0===o.right.color?(o.color=1,i=i.parent):(0===o.left.color&&(o.right.color=0,o.color=1,QD(e,o),o=i.parent.left),o.color=i.parent.color,i.parent.color=0,o.left.color=0,XD(e,i.parent),i=e.root));i.color=0,YD()}function ex(e,t){for(ix(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&QD(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,XD(e,t.parent.parent))}else{const i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&XD(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,QD(e,t.parent.parent))}e.root.color=0}function tx(e,t,i,n){for(;t!==e.root&&t!==jD;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function ix(e,t){let i=0,n=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(i=GD((t=t.parent).left)-t.size_left,n=ZD(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}jD.parent=jD,jD.left=jD,jD.right=jD,jD.color=0;function nx(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class sx{constructor(e,t,i,n,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=s}}function ox(e,t=!0){const i=[0];let n=1;for(let t=0,s=e.length;t<s;t++){const o=e.charCodeAt(t);13===o?t+1<s&&10===e.charCodeAt(t+1)?(i[n++]=t+2,t++):i[n++]=t+1:10===o&&(i[n++]=t+1)}return t?nx(i):i}class rx{constructor(e,t,i,n,s){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=s}}class ax{constructor(e,t){this.buffer=e,this.lineStarts=t}}class lx{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==jD&&e.iterate(e.root,e=>(e!==jD&&this._pieces.push(e.piece),!0))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class hx{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let n=0;n<i.length;n++){const s=i[n];(null===s.node.parent||s.nodeStartOffset>=e)&&(i[n]=null,t=!0)}if(t){const e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}class dx{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new ax("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=jD,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let t=0,i=e.length;t<i;t++)if(e[t].buffer.length>0){e[t].lineStarts||(e[t].lineStarts=ox(e[t].buffer));const i=new rx(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]),n=this.rbInsertRight(n,i)}this._searchCache=new hx(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=65535-Math.floor(21845),i=2*t;let n="",s=0;const o=[];if(this.iterate(this.root,r=>{const a=this.getNodeContent(r),l=a.length;if(s<=t||s+l<i)return n+=a,s+=l,!0;const h=n.replace(/\r\n|\r|\n/g,e);return o.push(new ax(h,ox(h))),n=a,s=l,!0}),s>0){const t=n.replace(/\r\n|\r|\n/g,e);o.push(new ax(t,ox(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 lx(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==jD;)if(n.left!==jD&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;return i+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1)}e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==jD;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){const s=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+s.index,0===s.index){const e=this.getOffsetAt(i+1,1);return new Ci(i+1,n-e+1)}return new Ci(i+1,s.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===jD){const t=this.getOffsetAt(i+1,1);return new Ci(i+1,n-e-t+1)}t=t.right}return new Ci(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),s=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?s:s.replace(/\r\n|\r|\n/g,t):s}getValueInRange2(e,t){if(e.node===t.node){const i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(s+e.remainder,s+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let o=n.substring(s+e.remainder,s+i.piece.length);for(i=i.next();i!==jD;){const e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){o+=e.substring(n,n+t.remainder);break}o+=e.substr(n,i.piece.length),i=i.next()}return o}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,s=>{if(s===jD)return!0;const o=s.piece;let r=o.length;if(0===r)return!0;const a=this._buffers[o.bufferIndex].buffer,l=this._buffers[o.bufferIndex].lineStarts,h=o.start.line,d=o.end.line;let c=l[h]+o.start.column;if(n&&(10===a.charCodeAt(c)&&(c++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(h===d)return this._EOLNormalized||13!==a.charCodeAt(c+r-1)?i+=a.substr(c,r):(n=!0,i+=a.substr(c,r-1)),!0;i+=this._EOLNormalized?a.substring(c,Math.max(c,l[h+1]-this._EOLLength)):a.substring(c,l[h+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=h+1;n<d;n++)i=this._EOLNormalized?a.substring(l[n],l[n+1]-this._EOLLength):a.substring(l[n],l[n+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return this._EOLNormalized||13!==a.charCodeAt(l[d]+o.end.column-1)?i=a.substr(l[d],o.end.column):(n=!0,0===o.end.column?t--:i=a.substr(l[d],o.end.column-1)),!0}),n&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e||(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){const t=e.node.next();if(!t)return 0;const i=this._buffers[t.piece.bufferIndex],n=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(n)}{const t=this._buffers[e.node.piece.bufferIndex],i=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(i)}}getLineCharCode(e,t){const i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,i,n,s,o,r,a,l,h,d){const c=this._buffers[e.piece.bufferIndex],u=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,s),m=this.offsetInBuffer(e.piece.bufferIndex,o);let f;const p={line:0,column:0};let _,v;t._wordSeparators?(_=c.buffer.substring(g,m),v=e=>e+g,t.reset(0)):(_=c.buffer,v=e=>e,t.reset(g));do{if(f=t.next(_),f){if(v(f.index)>=m)return h;this.positionInBuffer(e,v(f.index)-u,p);const t=this.getLineFeedCnt(e.piece.bufferIndex,s,p),o=p.line===s.line?p.column-s.column+n:p.column+1,r=o+f[0].length;if(d[h++]=Lu(new wi(i+t,o,i+t,r),f,a),v(f.index)+f[0].length>=m)return h;if(h>=l)return h}}while(f);return h}findMatchesLineByLine(e,t,i,n){const s=[];let o=0;const r=new Eu(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let h=this.positionInBuffer(a.node,a.remainder);const d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,h,d,t,i,n,o,s),s;let c=e.startLineNumber,u=a.node;for(;u!==l.node;){const l=this.getLineFeedCnt(u.piece.bufferIndex,h,u.piece.end);if(l>=1){const a=this._buffers[u.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[h.line+l],m=c===e.startLineNumber?e.startColumn:1;if(o=this.findMatchesInNode(u,r,c,m,h,this.positionInBuffer(u,g-d),t,i,n,o,s),o>=n)return s;c+=l}const d=c===e.startLineNumber?e.startColumn-1:0;if(c===e.endLineNumber){const a=this.getLineContent(c).substring(d,e.endColumn-1);return o=this._findMatchesInLine(t,r,a,e.endLineNumber,d,o,s,i,n),s}if(o=this._findMatchesInLine(t,r,this.getLineContent(c).substr(d),c,d,o,s,i,n),o>=n)return s;c++,a=this.nodeAt2(c,1),u=a.node,h=this.positionInBuffer(a.node,a.remainder)}if(c===e.endLineNumber){const a=c===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(c).substring(a,e.endColumn-1);return o=this._findMatchesInLine(t,r,l,e.endLineNumber,a,o,s,i,n),s}const g=c===e.startLineNumber?e.startColumn:1;return o=this.findMatchesInNode(l.node,r,c,g,h,d,t,i,n,o,s),s}_findMatchesInLine(e,t,i,n,s,o,r,a,l){const h=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=i.length;let c=-a;for(;-1!==(c=i.indexOf(t,c+a));)if((!h||xu(h,i,d,c,a))&&(r[o++]=new vu(new wi(n,c+1+s,n,c+1+a+s),null),o>=l))return o;return o}let d;t.reset(0);do{if(d=t.next(i),d&&(r[o++]=Lu(new wi(n,d.index+1+s,n,d.index+1+d[0].length+s),d,a),o>=l))return o}while(d);return o}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==jD){const{node:i,remainder:n,nodeStartOffset:s}=this.nodeAt(e),o=i.piece,r=o.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&o.end.line===this._lastChangeBufferPos.line&&o.end.column===this._lastChangeBufferPos.column&&s+o.length===e&&t.length<65535)return this.appendToNode(i,t),void this.computeBufferMetadata();if(s===e)this.insertContentToNodeLeft(t,i),this._searchCache.validate(e);else if(s+i.piece.length>e){const e=[];let s=new rx(o.bufferIndex,a,o.end,this.getLineFeedCnt(o.bufferIndex,a,o.end),this.offsetInBuffer(r,o.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)){if(10===this.nodeCharCodeAt(i,n)){const e={line:s.start.line+1,column:0};s=new rx(s.bufferIndex,e,s.end,this.getLineFeedCnt(s.bufferIndex,e,s.end),s.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){if(13===this.nodeCharCodeAt(i,n-1)){const s=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,s),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a)}else this.deleteNodeTail(i,a);const l=this.createNewPieces(t);s.length>0&&this.rbInsertRight(i,s);let h=i;for(let e=0;e<l.length;e++)h=this.rbInsertRight(h,l[e]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,i)}else{const e=this.createNewPieces(t);let i=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)i=this.rbInsertRight(i,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===jD)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),s=i.node,o=n.node;if(s===o){const o=this.positionInBuffer(s,i.remainder),r=this.positionInBuffer(s,n.remainder);if(i.nodeStartOffset===e){if(t===s.piece.length){const e=s.next();return JD(this,s),this.validateCRLFWithPrevNode(e),void this.computeBufferMetadata()}return this.deleteNodeHead(s,r),this._searchCache.validate(e),this.validateCRLFWithPrevNode(s),void this.computeBufferMetadata()}return i.nodeStartOffset+s.piece.length===e+t?(this.deleteNodeTail(s,o),this.validateCRLFWithNextNode(s),void this.computeBufferMetadata()):(this.shrinkNode(s,o,r),void this.computeBufferMetadata())}const r=[],a=this.positionInBuffer(s,i.remainder);this.deleteNodeTail(s,a),this._searchCache.validate(e),0===s.piece.length&&r.push(s);const l=this.positionInBuffer(o,n.remainder);this.deleteNodeHead(o,l),0===o.piece.length&&r.push(o);for(let e=s.next();e!==jD&&e!==o;e=e.next())r.push(e);const h=0===s.piece.length?s.prev():s;this.deleteNodes(r),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const n=t.piece,s={line:n.start.line+1,column:0},o=new rx(n.bufferIndex,s,n.end,this.getLineFeedCnt(n.bufferIndex,s,n.end),n.length-1);t.piece=o,e+="\n",tx(this,t,-1,-1),0===t.piece.length&&i.push(t)}const n=this.createNewPieces(e);let s=this.rbInsertLeft(t,n[n.length-1]);for(let e=n.length-2;e>=0;e--)s=this.rbInsertLeft(s,n[e]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let e=1;e<i.length;e++)s=this.rbInsertRight(s,i[e]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,s=e.piece.bufferIndex,o=this._buffers[s].lineStarts,r=o[n.start.line]+n.start.column+t;let a=n.start.line,l=n.end.line,h=0,d=0,c=0;for(;a<=l&&(h=a+(l-a)/2|0,c=o[h],h!==l);)if(d=o[h+1],r<c)l=h-1;else{if(!(r>=d))break;a=h+1}return i?(i.line=h,i.column=r-c,null):{line:h,column:r-c}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const s=n[i.line+1],o=n[i.line]+i.column;if(s>o+1)return i.line-t.line;const r=o-1;return 13===this._buffers[e].buffer.charCodeAt(r)?i.line-t.line+1:i.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++)JD(this,e[t])}createNewPieces(e){if(e.length>65535){const t=[];for(;e.length>65535;){const i=e.charCodeAt(65534);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,65534),e=e.substring(65534)):(n=e.substring(0,65535),e=e.substring(65535));const s=ox(n);t.push(new rx(this._buffers.length,{line:0,column:0},{line:s.length-1,column:n.length-s[s.length-1]},s.length-1,n.length)),this._buffers.push(new ax(n,s))}const i=ox(e);return t.push(new rx(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new ax(e,i)),t}let t=this._buffers[0].buffer.length;const i=ox(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let e=0;e<i.length;e++)i[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(0!==t)for(let e=0;e<i.length;e++)i[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const s=this._buffers[0].buffer.length,o=this._buffers[0].lineStarts.length-1,r={line:o,column:s-this._buffers[0].lineStarts[o]},a=new rx(0,n,r,this.getLineFeedCnt(0,n,r),s-t);return this._lastChangeBufferPos=r,[a]}getLineRawContent(e,t=0){let i=this.root,n="";const s=this._searchCache.get2(e);if(s){i=s.node;const o=this.getAccumulatedValue(i,e-s.nodeStartLineNumber-1),r=this._buffers[i.piece.bufferIndex].buffer,a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(s.nodeStartLineNumber+i.piece.lineFeedCnt!==e){const n=this.getAccumulatedValue(i,e-s.nodeStartLineNumber);return r.substring(a+o,a+n-t)}n=r.substring(a+o,a+i.piece.length)}else{let s=0;const o=e;for(;i!==jD;)if(i.left!==jD&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const n=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:s,nodeStartLineNumber:o-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(i,e-i.lf_left-2),s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=s.substring(o+t,o+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==jD;){const e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(o,o+s-t),n}{const t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==jD;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,n=this.positionInBuffer(e,t),s=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==s)return{index:t,remainder:0}}return{index:s,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,s=i.start.line+t+1;return s>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[s]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.end),o=t,r=this.offsetInBuffer(i.bufferIndex,o),a=this.getLineFeedCnt(i.bufferIndex,i.start,o),l=a-n,h=r-s,d=i.length+h;e.piece=new rx(i.bufferIndex,i.start,o,a,d),tx(this,e,h,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.start),o=t,r=this.getLineFeedCnt(i.bufferIndex,o,i.end),a=r-n,l=s-this.offsetInBuffer(i.bufferIndex,o),h=i.length+l;e.piece=new rx(i.bufferIndex,o,i.end,r,h),tx(this,e,l,a)}shrinkNode(e,t,i){const n=e.piece,s=n.start,o=n.end,r=n.length,a=n.lineFeedCnt,l=t,h=this.getLineFeedCnt(n.bufferIndex,n.start,l),d=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,s);e.piece=new rx(n.bufferIndex,n.start,l,h,d),tx(this,e,d-r,h-a);const c=new rx(n.bufferIndex,i,o,this.getLineFeedCnt(n.bufferIndex,i,o),this.offsetInBuffer(n.bufferIndex,o)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,c);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const s=ox(t,!1);for(let e=0;e<s.length;e++)s[e]+=n;if(i){const e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(s.slice(1));const o=this._buffers[0].lineStarts.length-1,r={line:o,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[o]},a=e.piece.length+t.length,l=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,r),d=h-l;e.piece=new rx(e.piece.bufferIndex,e.piece.start,r,h,a),this._lastChangeBufferPos=r,tx(this,e,t.length,d)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==jD;)if(t.size_left>e)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;const i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right}return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==jD;)if(i.left!==jD&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),o=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,o),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==jD;){if(i.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1){return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)}}t-=i.piece.length,i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}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&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===jD||0===e.piece.lineFeedCnt)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;if(n===i.length-1)return!1;return!(i[n+1]>s+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(s)}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==jD&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let s;s=0===e.piece.end.column?{line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const o=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new rx(e.piece.bufferIndex,e.piece.start,s,r,o),tx(this,e,-1,-1),0===e.piece.length&&i.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,h=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new rx(t.piece.bufferIndex,a,t.piece.end,h,l),tx(this,t,-1,-1),0===t.piece.length&&i.push(t);const d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let e=0;e<i.length;e++)JD(this,i[e])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+="\n",1===i.piece.length)JD(this,i);else{const e=i.piece,t={line:e.start.line+1,column:0},n=e.length-1,s=this.getLineFeedCnt(e.bufferIndex,t,e.end);i.piece=new rx(e.bufferIndex,t,e.end,s,n),tx(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===jD)return t(jD);const i=this.iterate(e.left,t);return i?t(e)&&this.iterate(e.right,t):i}getNodeContent(e){if(e===jD)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),s=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,s)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new UD(t,1);i.left=jD,i.right=jD,i.parent=jD,i.size_left=0,i.lf_left=0;if(this.root===jD)this.root=i,i.color=0;else if(e.right===jD)e.right=i,i.parent=e;else{const t=qD(e.right);t.left=i,i.parent=t}return ex(this,i),i}rbInsertLeft(e,t){const i=new UD(t,1);if(i.left=jD,i.right=jD,i.parent=jD,i.size_left=0,i.lf_left=0,this.root===jD)this.root=i,i.color=0;else if(e.left===jD)e.left=i,i.parent=e;else{const t=$D(e.left);t.right=i,i.parent=t}return ex(this,i),i}}class cx extends st{constructor(e,t,i,n,s,o,r){super(),this._onDidChangeContent=this._register(new ft),this._BOM=t,this._mightContainNonBasicASCII=!o,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._pieceTree=new dx(e,i,r)}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){const i=e+t,n=this.getPositionAt(e),s=this.getPositionAt(i);return new wi(n.lineNumber,n.column,s.lineNumber,s.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let s=0;const o=this._getEndOfLine(t),r=this.getEOL();if(o.length!==r.length){s=(o.length-r.length)*(e.endLineNumber-e.startLineNumber)}return n-i+s}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,s=e.endLineNumber;for(let t=n;t<=s;t++){const o=this.getLineContent(t),r=t===n?e.startColumn-1:0,a=t===s?e.endColumn-1:o.length;for(let e=r;e<a;e++)hs(o.charCodeAt(e))?(i+=1,e+=1):i+=1}return i+=this._getEndOfLine(t).length*(s-n),i}return this.getValueLengthInRange(e,t)}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)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=Zn(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Qn(this.getLineContent(e));return-1===t?0:t+2}_getEndOfLine(e){switch(e){case 1:return"\n";case 2:return"\r\n";case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,s=this._mightContainUnusualLineTerminators,o=this._mightContainNonBasicASCII,r=!0,a=[];for(let t=0;t<e.length;t++){const i=e[t];r&&i._isTracked&&(r=!1);const l=i.range;if(i.text){let e=!0;o||(e=!Cs(i.text),o=e),!n&&e&&(n=vs(i.text)),!s&&e&&(s=ys(i.text))}let h="",d=0,c=0,u=0;if(i.text){let e;[d,c,u,e]=VL(i.text);const t=this.getEOL(),n="\r\n"===t?2:1;h=0===e||e===n?i.text:i.text.replace(/\r\n|\r|\n/g,t)}a[t]={sortIndex:t,identifier:i.identifier||null,range:l,rangeOffset:this.getOffsetAt(l.startLineNumber,l.startColumn),rangeLength:this.getValueLengthInRange(l),text:h,eolCount:d,firstLineLength:c,lastLineLength:u,forceMoveMarkers:Boolean(i.forceMoveMarkers),isAutoWhitespaceEdit:i.isAutoWhitespaceEdit||!1}}a.sort(cx._sortOpsAscending);let l=!1;for(let e=0,t=a.length-1;e<t;e++){const t=a[e].range.getEndPosition(),i=a[e+1].range.getStartPosition();if(i.isBeforeOrEqual(t)){if(i.isBefore(t))throw new Error("Overlapping ranges are not allowed!");l=!0}}r&&(a=this._reduceOperations(a));const h=i||t?cx._getInverseEditRanges(a):[],d=[];if(t)for(let e=0;e<a.length;e++){const t=a[e],i=h[e];if(t.isAutoWhitespaceEdit&&t.range.isEmpty())for(let e=i.startLineNumber;e<=i.endLineNumber;e++){let n="";e===i.startLineNumber&&(n=this.getLineContent(t.range.startLineNumber),-1!==Zn(n))||d.push({lineNumber:e,oldContent:n})}}let c=null;if(i){let e=0;c=[];for(let t=0;t<a.length;t++){const i=a[t],n=h[t],s=this.getValueInRange(i.range),o=i.rangeOffset+e;e+=i.text.length-s.length,c[t]={sortIndex:i.sortIndex,identifier:i.identifier,range:n,text:s,textChange:new $k(i.rangeOffset,s,o,i.text)}}l||c.sort((e,t)=>e.sortIndex-t.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=o;const u=this._doApplyEdits(a);let g=null;if(t&&d.length>0){d.sort((e,t)=>t.lineNumber-e.lineNumber),g=[];for(let e=0,t=d.length;e<t;e++){const t=d[e].lineNumber;if(e>0&&d[e-1].lineNumber===t)continue;const i=d[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===Zn(n)&&g.push(t)}}return this._onDidChangeContent.fire(),new wu(c,u,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,s=new wi(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let o=i.startLineNumber,r=i.startColumn;const a=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],s=n.range;t=t||n.forceMoveMarkers,a.push(this.getValueInRange(new wi(o,r,s.startLineNumber,s.startColumn))),n.text.length>0&&a.push(n.text),o=s.endLineNumber,r=s.endColumn}const l=a.join(""),[h,d,c]=VL(l);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:l,eolCount:h,firstLineLength:d,lastLineLength:c,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(cx._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],s=n.range.startLineNumber,o=n.range.startColumn,r=n.range.endLineNumber,a=n.range.endColumn;if(s===r&&o===a&&0===n.text.length)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const l=new wi(s,o,r,a);t.push({range:l,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,s=null;for(let o=0,r=e.length;o<r;o++){const r=e[o];let a,l,h;if(s?s.range.endLineNumber===r.range.startLineNumber?(a=i,l=n+(r.range.startColumn-s.range.endColumn)):(a=i+(r.range.startLineNumber-s.range.endLineNumber),l=r.range.startColumn):(a=r.range.startLineNumber,l=r.range.startColumn),r.text.length>0){const e=r.eolCount+1;h=1===e?new wi(a,l,a,l+r.firstLineLength):new wi(a,l,a+e-1,r.lastLineLength+1)}else h=new wi(a,l,a,l);i=h.endLineNumber,n=h.endColumn,t.push(h),s=r}return t}static _sortOpsAscending(e,t){const i=wi.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=wi.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class ux{constructor(e,t,i,n,s,o,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=o,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let e=0,n=i.length;e<n;e++){const n=i[e].buffer.replace(/\r\n|\r|\n/g,t),s=ox(n);i[e]=new ax(n,s)}const n=new cx(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class gx{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(0===e.length)return;0===this.chunks.length&&Ds(e)&&(this.BOM=ks,e=e.substr(1));const t=e.charCodeAt(e.length-1);13===t||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||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,s=0,o=0,r=!0;for(let a=0,l=t.length;a<l;a++){const h=t.charCodeAt(a);13===h?a+1<l&&10===t.charCodeAt(a+1)?(o++,e[i++]=a+2,a++):(n++,e[i++]=a+1):10===h?(s++,e[i++]=a+1):r&&9!==h&&(h<32||h>126)&&(r=!1)}const a=new sx(nx(e),n,s,o,r);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new ax(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=vs(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=ys(e)))}finish(e=!0){return this._finish(),new ux(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=ox(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class mx{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(0===t)return void this.insert(e,i);if(0===i)return void this.delete(e,t);const n=this._store.slice(0,e),s=this._store.slice(e+t),o=function(e,t){const i=[];for(let n=0;n<e;n++)i[n]=t;return i}(i,this._default);this._store=n.concat(o,s)}delete(e,t){0===t||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;const i=[];for(let e=0;e<t;e++)i[e]=this._default;this._store=g(this._store,e,i)}}class fx{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class px{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e)return void i.appendLineTokens(t)}this._tokens.push(new fx(e,[t]))}finalize(){return this._tokens}}class _x extends class{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new vx(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const s=this._textModel.getLineContent(n.lineNumber),o=wx(this._languageIdCodec,i,this.tokenizationSupport,s,!0,n.startState);e.add(n.lineNumber,o.tokens),this.store.setEndState(n.lineNumber,o.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),o=s.substring(0,e.column-1)+t+s.substring(e.column-1),r=wx(this._languageIdCodec,n,this.tokenizationSupport,o,!0,i),a=new Cm(r.tokens,o,this._languageIdCodec);if(0===a.getCount())return 0;const l=a.findTokenIndexAtOffset(e.column-1);return a.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,s=e.column,o=this.getStartState(n);if(!o)return null;const r=this._textModel.getLineContent(n),a=r.substring(0,s-1)+i+r.substring(s-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),h=wx(this._languageIdCodec,l,this.tokenizationSupport,a,!0,o);return new Cm(h.tokens,a,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e<t||e===t&&this._textModel.getLineLength(e)<2048}tokenizeHeuristically(e,t,i){if(i<=this.store.getFirstInvalidEndStateLineNumberOrMax())return{heuristicTokens:!1};if(t<=this.store.getFirstInvalidEndStateLineNumberOrMax())return this.updateTokensUntilLine(e,i),{heuristicTokens:!1};let n=this.guessStartState(t);const s=this._textModel.getLanguageId();for(let o=t;o<=i;o++){const t=this._textModel.getLineContent(o),i=wx(this._languageIdCodec,s,this.tokenizationSupport,t,!0,n);e.add(o,i.tokens),n=i.endState}return{heuristicTokens:!0}}guessStartState(e){let t=this._textModel.getLineFirstNonWhitespaceColumn(e);const i=[];let n=null;for(let s=e-1;t>1&&s>=1;s--){const e=this._textModel.getLineFirstNonWhitespaceColumn(s);if(0!==e&&(e<t&&(i.push(this._textModel.getLineContent(s)),t=e,n=this.getStartState(s),n)))break}n||(n=this.tokenizationSupport.getInitialState()),i.reverse();const s=this._textModel.getLanguageId();let o=n;for(const e of i){o=wx(this._languageIdCodec,s,this.tokenizationSupport,e,!1,o).endState}return o}}class vx{constructor(e){this.lineCount=e,this._tokenizationStateStore=new bx,this._invalidEndStatesLineNumbers=new Cx,this._invalidEndStatesLineNumbers.addRange(new Au(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,t){if(!t)throw new $e("Cannot set null/undefined state");this._invalidEndStatesLineNumbers.delete(e);const i=this._tokenizationStateStore.setEndState(e,t);return i&&e<this.lineCount&&this._invalidEndStatesLineNumbers.addRange(new Au(e+1,e+2)),i}acceptChange(e,t){this.lineCount+=t-e.length,this._tokenizationStateStore.acceptChange(e,t),this._invalidEndStatesLineNumbers.addRangeAndResize(new Au(e.startLineNumber,e.endLineNumberExclusive),t)}acceptChanges(e){for(const t of e){const[e]=VL(t.text);this.acceptChange(new zu(t.range.startLineNumber,t.range.endLineNumber+1),e+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new Au(e.startLineNumber,e.endLineNumberExclusive))}getFirstInvalidEndStateLineNumber(){return this._invalidEndStatesLineNumbers.min}getFirstInvalidEndStateLineNumberOrMax(){return this.getFirstInvalidEndStateLineNumber()||Number.MAX_SAFE_INTEGER}allStatesValid(){return null===this._invalidEndStatesLineNumbers.min}getStartState(e,t){return 1===e?t:this.getEndState(e-1)}getFirstInvalidLine(e){const t=this.getFirstInvalidEndStateLineNumber();if(null===t)return null;const i=this.getStartState(t,e);if(!i)throw new $e("Start state must be defined");return{lineNumber:t,startState:i}}}class bx{constructor(){this._lineEndStates=new mx(null)}getEndState(e){return this._lineEndStates.get(e)}setEndState(e,t){const i=this._lineEndStates.get(e);return(!i||!i.equals(t))&&(this._lineEndStates.set(e,t),!0)}acceptChange(e,t){let i=e.length;t>0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class Cx{constructor(){this._ranges=[]}get min(){return 0===this._ranges.length?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(t=>t.contains(e));if(-1!==t){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Au(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new Au(i.start,e):this._ranges.splice(t,1,new Au(i.start,e),new Au(e+1,i.endExclusive))}}addRange(e){Au.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusive<this._ranges[n].start);)n++;const s=t-e.length;for(let e=n;e<this._ranges.length;e++)this._ranges[e]=this._ranges[e].delta(s);if(i===n){const n=new Au(e.start,e.start+t);n.isEmpty||this._ranges.splice(i,0,n)}else{const t=Math.min(e.start,this._ranges[i].start),o=Math.max(e.endExclusive,this._ranges[n-1].endExclusive),r=new Au(t,o+s);r.isEmpty?this._ranges.splice(i,n-i):this._ranges.splice(i,n-i,r)}}toString(){return this._ranges.map(e=>e.toString()).join(" + ")}}function wx(e,t,i,n,s,o){let r=null;if(i)try{r=i.tokenizeEncoded(n,s,o.clone())}catch(e){Be(e)}return r||(r=vm(e.encodeLanguageId(t),o)),Cm.convertToEndOffset(r.tokens,n.length),r}class yx{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){!this._isScheduled&&this._tokenizerWithStateStore._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._isScheduled=!0,fo(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{!this._isDisposed&&this._tokenizerWithStateStore._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?Object(K.o)(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){const e=this._tokenizerWithStateStore._textModel.getLineCount(),t=new px,i=ht.create(!1);do{if(i.elapsed()>1)break;if(this._tokenizeOneInvalidLine(t)>=e)break}while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return!!this._tokenizerWithStateStore&&!this._tokenizerWithStateStore.store.allStatesValid()}_tokenizeOneInvalidLine(e){var t;const i=null===(t=this._tokenizerWithStateStore)||void 0===t?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new zu(e,t))}}const Sx=new Uint32Array(0).buffer;class Lx{static deleteBeginning(e,t){return null===e||e===Sx?e:Lx.delete(e,0,t)}static deleteEnding(e,t){if(null===e||e===Sx)return e;const i=kx(e),n=i[i.length-2];return Lx.delete(e,t,n)}static delete(e,t,i){if(null===e||e===Sx||t===i)return e;const n=kx(e),s=n.length>>>1;if(0===t&&n[n.length-2]===i)return Sx;const o=Cm.findIndexInTokensArray(n,t),r=o>0?n[o-1<<1]:0;if(i<n[o<<1]){const r=i-t;for(let e=o;e<s;e++)n[e<<1]-=r;return e}let a,l;r!==t?(n[o<<1]=t,a=o+1<<1,l=t):(a=o<<1,l=r);const h=i-t;for(let e=o+1;e<s;e++){const t=n[e<<1]-h;t>l&&(n[a++]=t,n[a++]=n[1+(e<<1)],l=t)}if(a===n.length)return e;const d=new Uint32Array(a);return d.set(n.subarray(0,a),0),d.buffer}static append(e,t){if(t===Sx)return e;if(e===Sx)return t;if(null===e)return e;if(null===t)return null;const i=kx(e),n=kx(t),s=n.length>>>1,o=new Uint32Array(i.length+n.length);o.set(i,0);let r=i.length;const a=i[i.length-2];for(let e=0;e<s;e++)o[r++]=n[e<<1]+a,o[r++]=n[1+(e<<1)];return o.buffer}static insert(e,t,i){if(null===e||e===Sx)return e;const n=kx(e),s=n.length>>>1;let o=Cm.findIndexInTokensArray(n,t);if(o>0){n[o-1<<1]===t&&o--}for(let e=o;e<s;e++)n[e<<1]+=i;return e}}function kx(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class Dx{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let n=null;if(t<this._len&&(n=this._lineTokens[t]),null!==n&&n!==Sx)return new Cm(kx(n),i,this._languageIdCodec);const s=new Uint32Array(2);return s[0]=i.length,s[1]=xx(this._languageIdCodec.encodeLanguageId(e)),new Cm(s,i,this._languageIdCodec)}static _massageTokens(e,t,i){const n=i?kx(i):null;if(0===t){let t=!1;if(n&&n.length>1&&(t=bm.getLanguageId(n[1])!==e),!t)return Sx}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=xx(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const i=[];for(let e=0;e<t;e++)i[e]=null;this._lineTokens=g(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,n,s){const o=Dx._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,n);this._ensureLine(t);const r=this._lineTokens[t];return this._lineTokens[t]=o,!!s&&!Dx._equals(r,o)}static _equals(e,t){if(!e||!t)return!e&&!t;const i=kx(e),n=kx(t);if(i.length!==n.length)return!1;for(let e=0,t=i.length;e<t;e++)if(i[e]!==n[e])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new Ci(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=Lx.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=Lx.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i<this._len&&(n=Lx.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=Lx.append(this._lineTokens[t],n),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(0===t&&0===i)return;const n=e.lineNumber-1;n>=this._len||(0!==t?(this._lineTokens[n]=Lx.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=Lx.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=Lx.insert(this._lineTokens[n],e.column-1,i))}setMultilineTokens(e,t){if(0===e.length)return{changes:[]};const i=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];let o=0,r=0,a=!1;for(let e=s.startLineNumber;e<=s.endLineNumber;e++)if(a)this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),s.getLineTokens(e),!1),r=e;else{this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),s.getLineTokens(e),!0)&&(a=!0,o=e,r=e)}a&&i.push({fromLineNumber:o,toLineNumber:r})}return{changes:i}}}function xx(e){return(32768|e<<0|2<<24|1024)>>>0}class Ex{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),s=t[t.length-1].getRange();if(!n||!s)return e;i=e.plusRange(n).plusRange(s)}let n=null;for(let e=0,t=this._pieces.length;e<t;e++){const s=this._pieces[e];if(s.endLineNumber<i.startLineNumber)continue;if(s.startLineNumber>i.endLineNumber){n=n||{index:e};break}if(s.removeTokens(i),s.isEmpty()){this._pieces.splice(e,1),e--,t--;continue}if(s.endLineNumber<i.startLineNumber)continue;if(s.startLineNumber>i.endLineNumber){n=n||{index:e};continue}const[o,r]=s.split(i);o.isEmpty()?n=n||{index:e}:r.isEmpty()||(this._pieces.splice(e,1,o,r),e++,t++,n=n||{index:e})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=g(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(0===t.getLineContent().length)return t;const i=this._pieces;if(0===i.length)return t;const n=i[Ex._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!n)return t;const s=t.getCount(),o=n.getCount();let r=0;const a=[];let l=0,h=0;const d=(e,t)=>{e!==h&&(h=e,a[l++]=e,a[l++]=t)};for(let e=0;e<o;e++){const i=n.getStartCharacter(e),o=n.getEndCharacter(e),a=n.getMetadata(e),l=((1&a?2048:0)|(2&a?4096:0)|(4&a?8192:0)|(8&a?16384:0)|(16&a?16744448:0)|(32&a?4278190080:0))>>>0,h=~l>>>0;for(;r<s&&t.getEndOffset(r)<=i;)d(t.getEndOffset(r),t.getMetadata(r)),r++;for(r<s&&t.getStartOffset(r)<i&&d(i,t.getMetadata(r));r<s&&t.getEndOffset(r)<o;)d(t.getEndOffset(r),t.getMetadata(r)&h|a&l),r++;if(r<s)d(o,t.getMetadata(r)&h|a&l),t.getEndOffset(r)===o&&r++;else{const e=Math.min(Math.max(0,r-1),s-1);d(o,t.getMetadata(e)&h|a&l)}}for(;r<s;)d(t.getEndOffset(r),t.getMetadata(r)),r++;return new Cm(new Uint32Array(a),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,n=e.length-1;for(;i<n;){let s=i+Math.floor((n-i)/2);if(e[s].endLineNumber<t)i=s+1;else{if(!(e[s].startLineNumber>t)){for(;s>i&&e[s-1].startLineNumber<=t&&t<=e[s-1].endLineNumber;)s--;return s}n=s-1}}return i}acceptEdit(e,t,i,n,s){for(const o of this._pieces)o.acceptEdit(e,t,i,n,s)}}class Nx extends gS{constructor(e,t,i,n,s,o){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=s,this._attachedViews=o,this._semanticTokens=new Ex(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new ft),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new ft),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new ft),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new Ix(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(e=>{this._emitModelTokensChangedEvent(e)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(e=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[e,i,n]=VL(t.text);this._semanticTokens.acceptEdit(t.range,e,i,n,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new $e("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this.getLineTokens(t.lineNumber),s=n.findTokenIndexAtOffset(t.column-1),[o,r]=Nx._findLanguageBoundaries(n,s),a=Q(t.column,this.getLanguageConfiguration(n.getLanguageId(s)).getWordDefinition(),i.substring(o,r),o);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(s>0&&o===t.column-1){const[o,r]=Nx._findLanguageBoundaries(n,s-1),a=Q(t.column,this.getLanguageConfiguration(n.getLanguageId(s-1)).getWordDefinition(),i.substring(o,r),o);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let s=t;s>=0&&e.getLanguageId(s)===i;s--)n=e.getStartOffset(s);let s=e.getLineContent().length;for(let n=t,o=e.getCount();n<o&&e.getLanguageId(n)===i;n++)s=e.getEndOffset(n);return[n,s]}getWordUntilPosition(e){const t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,t){const i=this._textModel.validatePosition(new Ci(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}setLanguageId(e,t="api"){if(this._languageId===e)return;const i={oldLanguage:this._languageId,newLanguage:e,source:t};this._languageId=e,this._bracketPairsTextModelPart.handleDidChangeLanguage(i),this.grammarTokens.resetTokenization(),this._onDidChangeLanguage.fire(i),this._onDidChangeLanguageConfiguration.fire({})}}class Ix extends st{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t,i,n){super(),this._languageIdCodec=e,this._textModel=t,this.getLanguageId=i,this._tokenizer=null,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new ot),this._tokens=new Dx(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new ot),this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new ft),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._onDidChangeTokens=this._register(new ft),this.onDidChangeTokens=this._onDidChangeTokens.event,this._attachedViewStates=this._register(new at),this._register(zi.onDidChange(e=>{const t=this.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&this.resetTokenization()})),this.resetTokenization(),this._register(n.onDidChangeVisibleRanges(({view:e,state:t})=>{if(t){let i=this._attachedViewStates.get(e);i||(i=new Tx(()=>this.refreshRanges(i.lineRanges)),this._attachedViewStates.set(e,i)),i.handleStateChange(t)}else this._attachedViewStates.deleteAndDispose(e)}))}resetTokenization(e=!0){var t;this._tokens.flush(),null===(t=this._debugBackgroundTokens)||void 0===t||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new vx(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const[i,n]=(()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const e=zi.get(this.getLanguageId());if(!e)return[null,null];let t;try{t=e.getInitialState()}catch(e){return Be(e),[null,null]}return[e,t]})();if(this._tokenizer=i&&n?new _x(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const e={setTokens:e=>{this.setTokens(e)},backgroundTokenizationFinished:()=>{if(2===this._backgroundTokenizationState)return;this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(e,t)=>{var i;if(!this._tokenizer)return;const n=this._tokenizer.store.getFirstInvalidEndStateLineNumber();null!==n&&e>=n&&(null===(i=this._tokenizer)||void 0===i||i.store.setEndState(e,t))}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,e)),this._backgroundTokenizer.value||this._textModel.isTooLargeForTokenization()||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new yx(this._tokenizer,e),this._defaultBackgroundTokenizer.handleChanges()),(null==i?void 0:i.backgroundTokenizerShouldOnlyVerifyTokens)&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new Dx(this._languageIdCodec),this._debugBackgroundStates=new vx(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:e=>{var t;null===(t=this._debugBackgroundTokens)||void 0===t||t.setMultilineTokens(e,this._textModel)},backgroundTokenizationFinished(){},setEndState:(e,t)=>{var i;null===(i=this._debugBackgroundStates)||void 0===i||i.setEndState(e,t)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;null===(e=this._defaultBackgroundTokenizer)||void 0===e||e.handleChanges()}handleDidChangeContent(e){var t,i,n;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const i of e.changes){const[e,n]=VL(i.text);this._tokens.acceptEdit(i.range,e,n),null===(t=this._debugBackgroundTokens)||void 0===t||t.acceptEdit(i.range,e,n)}null===(i=this._debugBackgroundStates)||void 0===i||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),null===(n=this._defaultBackgroundTokenizer)||void 0===n||n.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=zu.joinMany([...this._attachedViewStates].map(([e,t])=>t.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,n;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const s=new px,{heuristicTokens:o}=this._tokenizer.tokenizeHeuristically(s,e,t),r=this.setTokens(s.finalize());if(o)for(const e of r.changes)null===(i=this._backgroundTokenizer.value)||void 0===i||i.requestTokens(e.fromLineNumber,e.toLineNumber+1);null===(n=this._defaultBackgroundTokenizer)||void 0===n||n.checkFinished()}forceTokenization(e){var t,i;const n=new px;null===(t=this._tokenizer)||void 0===t||t.updateTokensUntilLine(n,e),this.setTokens(n.finalize()),null===(i=this._defaultBackgroundTokenizer)||void 0===i||i.checkFinished()}isCheapToTokenize(e){return!this._tokenizer||this._tokenizer.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),n=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const s=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!n.equals(s)&&(null===(t=this._debugBackgroundTokenizer.value)||void 0===t?void 0:t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return n}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const n=this._textModel.validatePosition(new Ci(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const n=this._textModel.validatePosition(e);return this.forceTokenization(n.lineNumber),this._tokenizer.tokenizeLineWithEdit(n,t,i)}get hasTokens(){return this._tokens.hasTokens}}class Tx extends st{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new mo(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){s(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}const Mx=wl("undoRedoService");class Ax{constructor(e,t){this.resource=e,this.elements=t}}class Ox{constructor(){this.id=Ox._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}Ox._ID=0,Ox.None=new Ox;class Rx{constructor(){this.id=Rx._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}Rx._ID=0,Rx.None=new Rx;var Px,Fx=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Bx=function(e,t){return function(i,n){t(i,n,e)}};function Wx(e,t){let i;var n;return"string"==typeof e?i=function(e){const t=new gx;return t.acceptChunk(e),t.finish()}(e):i=(n=e)&&"function"==typeof n.read?function(e){const t=new gx;let i;for(;"string"==typeof(i=e.read());)t.acceptChunk(i);return t.finish()}(e):e,i.create(t)}let Vx=0;class Hx{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;for(;;){const n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const zx=()=>{throw new Error("Invalid change accessor")};let Kx=Px=class extends st{static resolveOptions(e,t){if(t.detectIndentation){const i=bD(e,t.tabSize,t.insertSpaces);return new _u({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new _u(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return tt(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,n=null,s,o,r){super(),this._undoRedoService=s,this._languageService=o,this._languageConfigurationService=r,this._onWillDispose=this._register(new ft),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new iE(e=>this.handleBeforeFireDecorationsChangedEvent(e))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new ft),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new ft),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new ft),this._eventEmitter=this._register(new nE),this._languageSelectionListener=this._register(new ot),this._deltaDecorationCallCnt=0,this._attachedViews=new sE,Vx++,this.id="$model"+Vx,this.isForSimpleWidget=i.isForSimpleWidget,this._associatedResource=null==n?di.parse("inmemory://model/"+Vx):n,this._attachedEditorCount=0;const{textBuffer:a,disposable:l}=Wx(e,i.defaultEOL);this._buffer=a,this._bufferDisposable=l,this._options=Px.resolveOptions(this._buffer,i);const h="string"==typeof t?t:t.languageId;"string"!=typeof t&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Vk(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new pS(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Uk(this)),this._tokenizationTextModelPart=new Nx(this._languageService,this._languageConfigurationService,this,this._bracketPairs,h,this._attachedViews);const d=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new wi(1,1,d,this._buffer.getLineLength(d)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=c>Px.LARGE_FILE_SIZE_THRESHOLD||d>Px.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=c>Px.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=c>Px._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=xs(Vx),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new qx,this._commandManager=new pD(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(h)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new cx([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=st.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new ML(e,t)))}setValue(e){if(this._assertNotDisposed(),null==e)throw Ke();const{textBuffer:t,disposable:i}=Wx(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,s,o,r,a){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:a,versionId:this.getVersionId(),isUndoing:s,isRedoing:o,isFlush:r}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new qx,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new IL([new LL],this._versionId,!1,!1),this._createContentChanged2(new wi(1,1,s,o),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new IL([new NL],this._versionId,!1,!1),this._createContentChanged2(new wi(1,1,s,o),0,n,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const n=t[i],s=n.range,o=n.cachedAbsoluteStart-n.start,r=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),a=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);n.cachedAbsoluteStart=r,n.cachedAbsoluteEnd=a,n.cachedVersionId=e,n.start=r-o,n.end=a-o,HD(n)}}onBeforeAttached(){return this._attachedEditorCount++,1===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,0===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.originalIndentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,s=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,r=new _u({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:o});if(this._options.equals(r))return;const a=this._options.createChangeEvent(r);this._options=r,this._bracketPairs.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();const i=bD(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),Pw(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(ws.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(e=>({range:e.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new $e("Operation would exceed heap memory limits");const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new Hx(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $e("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $e("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new $e("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $e("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $e("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $e("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor("number"!=typeof i||isNaN(i)?1:i),o=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(s<1)s=1,o=1;else if(s>t)s=t,o=this.getLineMaxColumn(s);else if(o<=1)o=1;else{const e=this.getLineMaxColumn(s);o>=e&&(o=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof r||isNaN(r)?1:r),h=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,h=1;else if(l>t)l=t,h=this.getLineMaxColumn(l);else if(h<=1)h=1;else{const e=this.getLineMaxColumn(l);h>=e&&(h=e)}return i===s&&n===o&&r===l&&a===h&&e instanceof wi&&!(e instanceof yi)?e:new wi(s,o,l,h)}_isValidPosition(e,t,i){if("number"!=typeof e||"number"!=typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;if(e>this._buffer.getLineCount())return!1;if(1===t)return!0;if(t>this.getLineMaxColumn(e))return!1;if(1===i){if(hs(this._buffer.getLineCharCode(e,t-2)))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),s=Math.floor("number"!=typeof t||isNaN(t)?1:t),o=this._buffer.getLineCount();if(n<1)return new Ci(1,1);if(n>o)return new Ci(o,this.getLineMaxColumn(o));if(s<=1)return new Ci(n,1);const r=this.getLineMaxColumn(n);if(s>=r)return new Ci(n,r);if(1===i){if(hs(this._buffer.getLineCharCode(n,s-2)))return new Ci(n,s-1)}return new Ci(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof Ci&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(s,o,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=o>1&&o<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,o-2):0,r=hs(e),a=hs(t);return!r&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof wi&&!(e instanceof yi)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,s=t.column,o=i.lineNumber,r=i.column;{const e=s>1?this._buffer.getLineCharCode(n,s-2):0,t=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,i=hs(e),a=hs(t);return i||a?n===o&&s===r?new wi(n,s-1,o,r-1):i&&a?new wi(n,s-1,o,r+1):i?new wi(n,s-1,o,r):new wi(n,s,o,r+1):new wi(n,s,o,r)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new wi(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,o,r=999){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every(e=>wi.isIRange(e))&&(a=t.map(e=>this.validateRange(e)))),null===a&&(a=[this.getFullModelRange()]),a=a.sort((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn);const l=[];let h;if(l.push(a.reduce((e,t)=>wi.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t))),!i&&e.indexOf("\n")<0){const t=new Su(e,i,n,s).parseSearchRequest();if(!t)return[];h=e=>this.findMatchesLineByLine(e,t,o,r)}else h=t=>Du.findMatches(this,new Su(e,i,n,s),t,o,r);return l.map(h).reduce((e,t)=>e.concat(t),[])}findNextMatch(e,t,i,n,s,o){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new Su(e,i,n,s).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new wi(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),h=this.findMatchesLineByLine(l,t,o,1);return Du.findNextMatch(this,new Su(e,i,n,s),r,o),h.length>0?h[0]:(l=new wi(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),h=this.findMatchesLineByLine(l,t,o,1),h.length>0?h[0]:null)}return Du.findNextMatch(this,new Su(e,i,n,s),r,o)}findPreviousMatch(e,t,i,n,s,o){this._assertNotDisposed();const r=this.validatePosition(t);return Du.findPreviousMatch(this,new Su(e,i,n,s),r,o)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof bu?e:new bu(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const i=t.map(e=>({range:this.validateRange(e.range),text:e.text}));let n=!0;if(e)for(let t=0,s=e.length;t<s;t++){const s=e[t];let o=!1;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,n=t.startLineNumber>s.endLineNumber,r=s.startLineNumber>t.endLineNumber;if(!n&&!r){o=!0;break}}if(!o){n=!1;break}}if(n)for(let e=0,n=this._trimAutoWhitespaceLines.length;e<n;e++){const n=this._trimAutoWhitespaceLines[e],s=this.getLineMaxColumn(n);let o=!0;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,r=i[e].text;if(!(n<t.startLineNumber||n>t.endLineNumber)&&!(n===t.startLineNumber&&t.startColumn===s&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){o=!1;break}}if(o){const e=new wi(n,1,n,s);t.push(new bu(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const s=e.map(e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new wi(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map(e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new wi(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,o){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(o),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),s=this._buffer.getLineCount(),o=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==o.length){for(let e=0,t=o.length;e<t;e++){const t=o[e];this._decorationsTree.acceptReplace(t.rangeOffset,t.rangeLength,t.text.length,t.forceMoveMarkers)}const e=[];this._increaseVersionId();let t=i;for(let i=0,n=o.length;i<n;i++){const n=o[i],[r]=VL(n.text);this._onDidChangeDecorations.fire();const a=n.range.startLineNumber,l=n.range.endLineNumber,h=l-a,d=r,c=Math.min(h,d),u=d-h,g=s-t-u+a,m=g,f=g+d,p=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new Ci(m,1)),this.getOffsetAt(new Ci(f,this.getLineMaxColumn(f))),0),_=kL.fromDecorations(p),v=new S(_);for(let t=c;t>=0;t--){const i=a+t,n=g+t;v.takeFromEndWhile(e=>e.lineNumber>n);const s=v.takeFromEndWhile(e=>e.lineNumber===n);e.push(new DL(i,this.getLineContent(n),s))}if(c<h){const t=a+c;e.push(new xL(t+1,l))}if(c<d){const i=new S(_),n=a+c,o=d-c,r=s-t-o+n+1,l=[],h=[];for(let e=0;e<o;e++){const t=r+e;h[e]=this.getLineContent(t),i.takeWhile(e=>e.lineNumber<t),l[e]=i.takeWhile(e=>e.lineNumber===t)}e.push(new EL(n+1,a+d,h,l))}t+=u}this._emitContentChangedEvent(new IL(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return null===n.reverseEdits?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(null===e||0===e.size)return;const t=Array.from(e).map(e=>new DL(e,this.getLineContent(e),this._getInjectedTextInLine(e)));this._onDidChangeInjectedText.fire(new TL(t))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(t,i)=>this._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,tE(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)};let n=null;try{n=t(i)}catch(e){Be(e)}return i.addDecoration=zx,i.changeDecoration=zx,i.changeDecorationOptions=zx,i.removeDecoration=zx,i.deltaDecorations=zx,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),Be(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:eE[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),o,r,s),n.setOptions(eE[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let e=0,i=t.length;e<i;e++){const i=t[e];this._decorationsTree.delete(i),delete this._decorations[i.id]}}getDecorationOptions(e){const t=this._decorations[e];return t?t.options:null}getDecorationRange(e){const t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,i=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!1,s=!1){const o=this.getLineCount(),r=Math.min(o,Math.max(1,e)),a=Math.min(o,Math.max(1,t)),l=this.getLineMaxColumn(a),h=new wi(r,1,a,l),d=this._getDecorationsInRange(h,i,n,s);return p(d,this._decorationProvider.getDecorationsInRange(h,i,n)),d}getDecorationsInRange(e,t=0,i=!1,n=!1,s=!1){const o=this.validateRange(e),r=this._getDecorationsInRange(o,t,i,s);return p(r,this._decorationProvider.getDecorationsInRange(o,t,i,n)),r}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return kL.fromDecorations(n).filter(t=>t.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,n){const s=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,s,o,t,i,n)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.endLineNumber)}if(i.options.before){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.startLineNumber)}const n=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),o=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),s,o,n),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const n=!(!i.options.overviewRuler||!i.options.overviewRuler.color),s=!(!t.overviewRuler||!t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(i.options.before||t.before){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}const o=n!==s,r=function(e){return!!e.after||!!e.before}(t)!==jx(i);o||r?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!1){const s=this.getVersionId(),o=t.length;let r=0;const a=i.length;let l=0;this._onDidChangeDecorations.beginDeferredEmit();try{const h=new Array(a);for(;r<o||l<a;){let d=null;if(r<o){do{d=this._decorations[t[r++]]}while(!d&&r<o);if(d){if(d.options.after){const e=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(d.options.before){const e=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}this._decorationsTree.delete(d),n||this._onDidChangeDecorations.checkAffectedAndFire(d.options)}}if(l<a){if(!d){const e=++this._lastDecorationId,t=`${this._instanceId};${e}`;d=new ID(t,0,0),this._decorations[t]=d}const t=i[l],o=this._validateRangeRelaxedNoAllocations(t.range),r=tE(t.options),a=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),c=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);d.ownerId=e,d.reset(s,a,c,o),d.setOptions(r),d.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),d.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber),n||this._onDidChangeDecorations.checkAffectedAndFire(r),this._decorationsTree.insert(d),h[l]=d.id,l++}else d&&delete this._decorations[d.id]}return h}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setLanguage(e,t){"string"==typeof e?(this._languageSelectionListener.clear(),this._setLanguage(e,t)):(this._languageSelectionListener.value=e.onDidChange(()=>this._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return function(e){let t=0;for(const i of e){if(" "!==i&&"\t"!==i)break;t++}return t}(this.getLineContent(e))+1}};function Ux(e){return!(!e.options.overviewRuler||!e.options.overviewRuler.color)}function jx(e){return!!e.options.after||!!e.options.before}Kx._MODEL_SYNC_LIMIT=52428800,Kx.LARGE_FILE_SIZE_THRESHOLD=20971520,Kx.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5,Kx.LARGE_FILE_HEAP_OPERATION_THRESHOLD=268435456,Kx.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:U.tabSize,indentSize:U.indentSize,insertSpaces:U.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:U.trimAutoWhitespace,largeFileOptimizations:U.largeFileOptimizations,bracketPairColorizationOptions:U.bracketPairColorizationOptions},Kx=Px=Fx([Bx(4,Mx),Bx(5,nc),Bx(6,Oc)],Kx);class qx{constructor(){this._decorationsTree0=new MD,this._decorationsTree1=new MD,this._injectedTextDecorationsTree=new MD}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)null===i.range&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,s,o){const r=e.getVersionId(),a=this._intervalSearch(t,i,n,s,r,o);return this._ensureNodesHaveRanges(e,a)}_intervalSearch(e,t,i,n,s,o){const r=this._decorationsTree0.intervalSearch(e,t,i,n,s,o),a=this._decorationsTree1.intervalSearch(e,t,i,n,s,o),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,s,o);return r.concat(a).concat(l)}getInjectedTextInInterval(e,t,i,n){const s=e.getVersionId(),o=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,s,!1);return this._ensureNodesHaveRanges(e,o).filter(e=>e.options.showIfCollapsed||!e.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(e=>e.options.showIfCollapsed||!e.range.isEmpty())}getAll(e,t,i,n,s){const o=e.getVersionId(),r=this._search(t,i,n,o,s);return this._ensureNodesHaveRanges(e,r)}_search(e,t,i,n,s){if(i)return this._decorationsTree1.search(e,t,n,s);{const i=this._decorationsTree0.search(e,t,n,s),o=this._decorationsTree1.search(e,t,n,s),r=this._injectedTextDecorationsTree.search(e,t,n,s);return i.concat(o).concat(r)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){jx(e)?this._injectedTextDecorationsTree.insert(e):Ux(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){jx(e)?this._injectedTextDecorationsTree.delete(e):Ux(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){jx(e)?this._injectedTextDecorationsTree.resolveNode(e,t):Ux(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function $x(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class Gx{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Zx extends Gx{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:gu.Center}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if("string"==typeof e)return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class Yx{constructor(e){var t;this.position=null!==(t=null==e?void 0:e.position)&&void 0!==t?t:mu.Center,this.persistLane=null==e?void 0:e.persistLane}}class Qx extends Gx{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return"string"==typeof e?Ug.fromHex(e):t.getColor(e.id)}}class Xx{static from(e){return e instanceof Xx?e:new Xx(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Jx{static register(e){return new Jx(e)}static createDynamic(e){return new Jx(e)}constructor(e){var t,i,n,s,o,r;this.description=e.description,this.blockClassName=e.blockClassName?$x(e.blockClassName):null,this.blockDoesNotCollapse=null!==(t=e.blockDoesNotCollapse)&&void 0!==t?t:null,this.blockIsAfterEnd=null!==(i=e.blockIsAfterEnd)&&void 0!==i?i:null,this.blockPadding=null!==(n=e.blockPadding)&&void 0!==n?n:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?$x(e.className):null,this.shouldFillLineOnLineBreak=null!==(s=e.shouldFillLineOnLineBreak)&&void 0!==s?s:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Zx(e.overviewRuler):null,this.minimap=e.minimap?new Qx(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Yx(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?$x(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?$x(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?$x(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?e.linesDecorationsTooltip.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&apos;";case"&":return"&amp;"}return e}):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?$x(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?$x(e.marginClassName):null,this.inlineClassName=e.inlineClassName?$x(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?$x(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?$x(e.afterContentClassName):null,this.after=e.after?Xx.from(e.after):null,this.before=e.before?Xx.from(e.before):null,this.hideInCommentTokens=null!==(o=e.hideInCommentTokens)&&void 0!==o&&o,this.hideInStringTokens=null!==(r=e.hideInStringTokens)&&void 0!==r&&r}}Jx.EMPTY=Jx.register({description:"empty"});const eE=[Jx.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Jx.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Jx.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Jx.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function tE(e){return e instanceof Jx?e:Jx.createDynamic(e)}class iE extends st{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new ft),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,0===this._deferredCnt&&(this._shouldFireDeferred&&this.doFire(),null===(e=this._affectedInjectedTextLines)||void 0===e||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){var t,i;this._affectsMinimap||(this._affectsMinimap=!!(null===(t=e.minimap)||void 0===t?void 0:t.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(null===(i=e.overviewRuler)||void 0===i?void 0:i.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this._affectsLineNumber||(this._affectsLineNumber=!!e.lineNumberClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){0===this._deferredCnt?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class nE extends st{constructor(){super(),this._fastEmitter=this._register(new ft),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new ft),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){this._deferredCnt>0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}class sE{constructor(){this._onDidChangeVisibleRanges=new ft,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new oE(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class oE{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(e=>new zu(e.startLineNumber,e.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class rE{static create(e){return new rE(e.get(133),e.get(132))}constructor(e,t){this.classifier=new aE(e,t)}createLineBreaksComputer(e,t,i,n,s){const o=[],r=[],a=[];return{addRequest:(e,t,i)=>{o.push(e),r.push(t),a.push(i)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,h=[];for(let e=0,d=o.length;e<d;e++){const d=r[e],c=a[e];!c||c.injectionOptions||d?h[e]=cE(this.classifier,o[e],d,t,i,l,n,s):h[e]=dE(this.classifier,c,o[e],t,i,l,n,s)}return lE.length=0,hE.length=0,h}}}}class aE extends su{constructor(e,t){super(0);for(let t=0;t<e.length;t++)this.set(e.charCodeAt(t),1);for(let e=0;e<t.length;e++)this.set(t.charCodeAt(e),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let lE=[],hE=[];function dE(e,t,i,n,s,o,r,a){if(-1===s)return null;const l=i.length;if(l<=1)return null;const h="keepAll"===a,d=t.breakOffsets,c=t.breakOffsetsVisibleColumn,u=fE(i,n,s,o,r),g=s-u,m=lE,f=hE;let p=0,_=0,v=0,b=s;const C=d.length;let w=0;if(w>=0){let e=Math.abs(c[w]-b);for(;w+1<C;){const t=Math.abs(c[w+1]-b);if(t>=e)break;e=t,w++}}for(;w<C;){let t=w<0?0:d[w],s=w<0?0:c[w];_>t&&(t=_,s=v);let r=0,a=0,u=0,y=0;if(s<=b){let v=s,C=0===t?0:i.charCodeAt(t-1),w=0===t?0:e.get(C),S=!0;for(let s=t;s<l;s++){const t=s,l=i.charCodeAt(s);let d,c;if(hs(l)?(s++,d=0,c=2):(d=e.get(l),c=uE(l,v,n,o)),t>_&&mE(C,w,l,d,h)&&(r=t,a=v),v+=c,v>b){t>_?(u=t,y=v-c):(u=s+1,y=v),v-a>g&&(r=0),S=!1;break}C=l,w=d}if(S){p>0&&(m[p]=d[d.length-1],f[p]=c[d.length-1],p++);break}}if(0===r){let l=s,d=i.charCodeAt(t),c=e.get(d),m=!1;for(let n=t-1;n>=_;n--){const t=n+1,s=i.charCodeAt(n);if(9===s){m=!0;break}let f,p;if(ds(s)?(n--,f=0,p=2):(f=e.get(s),p=Ss(s)?o:1),l<=b){if(0===u&&(u=t,y=l),l<=b-g)break;if(mE(s,f,d,c,h)){r=t,a=l;break}}l-=p,d=s,c=f}if(0!==r){const e=g-(y-a);if(e<=n){const t=i.charCodeAt(u);let s;s=hs(t)?2:uE(t,y,n,o),e-s<0&&(r=0)}}if(m){w--;continue}}if(0===r&&(r=u,a=y),r<=_){const e=i.charCodeAt(_);hs(e)?(r=_+2,a=v+2):(r=_+1,a=v+uE(e,v,n,o))}for(_=r,m[p]=r,v=a,f[p]=a,p++,b=a+g;w<0||w<C&&c[w]<a;)w++;let S=Math.abs(c[w]-b);for(;w+1<C;){const e=Math.abs(c[w+1]-b);if(e>=S)break;S=e,w++}}return 0===p?null:(m.length=p,f.length=p,lE=t.breakOffsets,hE=t.breakOffsetsVisibleColumn,t.breakOffsets=m,t.breakOffsetsVisibleColumn=f,t.wrappedTextIndentLength=u,t)}function cE(e,t,i,n,s,o,r,a){const l=kL.applyInjectedText(t,i);let h,d;if(i&&i.length>0?(h=i.map(e=>e.options),d=i.map(e=>e.column-1)):(h=null,d=null),-1===s)return h?new CL(d,h,[l.length],[],0):null;const c=l.length;if(c<=1)return h?new CL(d,h,[l.length],[],0):null;const u="keepAll"===a,g=fE(l,n,s,o,r),m=s-g,f=[],p=[];let _=0,v=0,b=0,C=s,w=l.charCodeAt(0),y=e.get(w),S=uE(w,0,n,o),L=1;hs(w)&&(S+=1,w=l.charCodeAt(1),y=e.get(w),L++);for(let t=L;t<c;t++){const i=t,s=l.charCodeAt(t);let r,a;hs(s)?(t++,r=0,a=2):(r=e.get(s),a=uE(s,S,n,o)),mE(w,y,s,r,u)&&(v=i,b=S),S+=a,S>C&&((0===v||S-b>m)&&(v=i,b=S-a),f[_]=v,p[_]=b,_++,C=b+m,v=0),w=s,y=r}return 0!==_||i&&0!==i.length?(f[_]=c,p[_]=S,new CL(d,h,f,p,g)):null}function uE(e,t,i,n){return 9===e?i-t%i:Ss(e)||e<32?n:1}function gE(e,t){return t-e%t}function mE(e,t,i,n,s){return 32!==i&&(2===t&&2!==n||1!==t&&1===n||!s&&3===t&&2!==n||!s&&3===n&&1!==t)}function fE(e,t,i,n,s){let o=0;if(0!==s){const r=Zn(e);if(-1!==r){for(let i=0;i<r;i++){o+=9===e.charCodeAt(i)?gE(o,t):1}const a=3===s?2:2===s?1:0;for(let e=0;e<a;e++){o+=gE(o,t)}o+n>i&&(o=0)}}return o}class pE{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Uw(new wi(1,1,1,1),0,0,new Ci(1,1),0),new Uw(new wi(1,1,1,1),0,0,new Ci(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new Hw(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?yi.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):yi.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),s=t.selectionStart.getEndPosition(),o=e.normalizePosition(i,2),r=this._validatePositionWithCache(e,n,i,o),a=this._validatePositionWithCache(e,s,n,r);return i.equals(o)&&n.equals(r)&&s.equals(a)?t:new Uw(wi.fromPositions(r,a),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-r.column,o,t.leftoverVisibleColumns+i.column-o.column)}_setState(e,t,i){if(i&&(i=pE._validateViewState(e.viewModel,i)),t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),o=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new Uw(i,t.selectionStartKind,n,s,o)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),s=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new Uw(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,s,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),s=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new Uw(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,s,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new Ci(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),s=e.coordinatesConverter.convertModelPositionToViewPosition(new Ci(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),o=new wi(n.lineNumber,n.column,s.lineNumber,s.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Uw(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class _E{constructor(e){this.context=e,this.cursors=[new pE(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return(e=this.cursors,t=C(e=>e.viewState.position,Ci.compare),Vu(e,(e,i)=>-t(e,i))).viewState.position;var e,t}getBottomMostViewPosition(){return function(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const s=e[n];t(s,i)>=0&&(i=s)}return i}(this.cursors,C(e=>e.viewState.position,Ci.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(Hw.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(t<i){const e=i-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>i){const e=t-i;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let t=0;t<i;t++)this.cursors[t+1].setState(this.context,e[t].modelState,e[t].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new pE(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return 1===this.cursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort(C(e=>e.selection,wi.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){const n=t[i],s=t[i+1],o=n.selection,r=s.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let a;if(a=r.isEmpty()||o.isEmpty()?r.getStartPosition().isBeforeOrEqual(o.getEndPosition()):r.getStartPosition().isBefore(o.getEndPosition()),a){const o=n.index<s.index?i:i+1,r=n.index<s.index?i+1:i,a=t[r].index,l=t[o].index,h=t[r].selection,d=t[o].selection;if(!h.equalsSelection(d)){const i=h.plusRange(d),n=h.selectionStartLineNumber===h.startLineNumber&&h.selectionStartColumn===h.startColumn,s=d.selectionStartLineNumber===d.startLineNumber&&d.selectionStartColumn===d.startColumn;let r,c;a===this.lastAddedCursorIndex?(r=n,this.lastAddedCursorIndex=l):r=s,c=r?new yi(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new yi(i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn),t[o].selection=c;const u=Hw.fromModelSelection(c);e[l].setState(this.context,u.modelState,u.viewState)}for(const e of t)e.index>a&&e.index--;e.splice(a,1),t.splice(r,1),this._removeSecondaryCursor(a-1),i--}}}}class vE{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class bE{constructor(){this.type=0}}class CE{constructor(){this.type=1}}class wE{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class yE{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class SE{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class LE{constructor(){this.type=5}}class kE{constructor(e){this.type=6,this.isFocused=e}}class DE{constructor(){this.type=7}}class xE{constructor(){this.type=8}}class EE{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class NE{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class IE{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class TE{constructor(e,t,i,n,s,o,r){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=s,this.revealHorizontal=o,this.scrollType=r,this.type=12}}class ME{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class AE{constructor(e){this.theme=e,this.type=14}}class OE{constructor(e){this.type=15,this.ranges=e}}class RE{constructor(){this.type=16}}class PE{constructor(){this.type=17}}class FE extends st{constructor(){super(),this._onEvent=this._register(new ft),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++){const i=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(i)return void(this._outgoingEvents[t]=i)}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new BE),this._collector}endEmitViewEvents(){if(this._collectorCnt--,0===this._collectorCnt){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const t of e)this._addOutgoingEvent(t);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class BE{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class WE{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new WE(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class VE{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new VE(this.oldHasFocus,e.hasFocus)}}class HE{constructor(e,t,i,n,s,o,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=s,this.scrollLeft=o,this.scrollHeight=r,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}attemptToMerge(e){return e.kind!==this.kind?null:new HE(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class zE{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class KE{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class UE{constructor(e,t,i,n,s,o,r){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=s,this.reason=o,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!e[n].equalsSelection(t[n]))return!1;return!0}isNoOp(){return UE._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new UE(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class jE{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class qE{constructor(e){this.event=e,this.kind=7}isNoOp(){return!1}attemptToMerge(e){return null}}class $E{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class GE{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class ZE{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class YE{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class QE{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class XE extends st{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new vE(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new _E(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=et(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new vE(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){const e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const i=this._autoClosedActions[t];i.isValid(e)||(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,n){let s=!1;const o=this.context.cursorConfig.multiCursorLimit;null!==n&&n.length>o&&(n=n.slice(0,o),s=!0);const r=JE.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,r,s)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n,s,o){const r=this._cursors.getViewPositions();let a=null,l=null;r.length>1?l=this._cursors.getViewSelections():a=wi.fromPositions(r[0],r[0]),e.emitViewEvent(new TE(t,i,a,l,n,s,o))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push({inSelectionMode:!n.isEmpty(),selectionStart:{lineNumber:n.selectionStartLineNumber,column:n.selectionStartColumn},position:{lineNumber:n.positionLineNumber,column:n.positionColumn}})}return e}restoreState(e,t){const i=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];let s=1,o=1;n.position&&n.position.lineNumber&&(s=n.position.lineNumber),n.position&&n.position.column&&(o=n.position.column);let r=s,a=o;n.selectionStart&&n.selectionStart.lineNumber&&(r=n.selectionStart.lineNumber),n.selectionStart&&n.selectionStart.column&&(a=n.selectionStart.column),i.push({selectionStartLineNumber:r,selectionStartColumn:a,positionLineNumber:s,positionColumn:o})}this.setStates(e,"restoreState",0,Hw.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof TL){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{const i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;const n=i.containsEvent(1);if(this._prevEditOperationType=0,n)this._cursors.dispose(),this._cursors=new _E(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const t=Hw.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,t)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Hw.fromModelSelections(t))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,Hw.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let s=0,o=e.length;s<o;s++)i.push({range:e[s],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),n.push({range:t[s],options:{description:"auto-closed-enclosing",stickiness:1}});const s=this._model.deltaDecorations([],i),o=this._model.deltaDecorations([],n);this._autoClosedActions.push(new eN(this._model,s,o))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=class{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},s=this._innerExecuteCommands(n,i);for(let e=0,t=n.trackedRanges.length;e<t;e++)n.model._setTrackedRange(n.trackedRanges[e],null,0);return s}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;const i=this._getEditOperations(e,t);if(0===i.operations.length)return null;const n=i.operations,s=this._getLoserCursorMap(n);if(s.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;const o=[];for(let e=0,t=n.length;e<t;e++)s.hasOwnProperty(n[e].identifier.major.toString())||o.push(n[e]);i.hadTrackedEditOperation&&o.length>0&&(o[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,o,i=>{const n=[];for(let t=0;t<e.selectionsBefore.length;t++)n[t]=[];for(const e of i)e.identifier&&n[e.identifier.major].push(e);const s=(e,t)=>e.identifier.minor-t.identifier.minor,o=[];for(let i=0;i<e.selectionsBefore.length;i++)n[i].length>0?(n[i].sort(s),o[i]=t[i].computeCursorState(e.model,{getInverseEditOperations:()=>n[i],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new yi(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new yi(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):o[i]=e.selectionsBefore[i];return o});r||(r=e.selectionsBefore);const a=[];for(const e in s)s.hasOwnProperty(e)&&a.push(parseInt(e,10));a.sort((e,t)=>t-e);for(const e of a)r.splice(e,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],n=!1;for(let s=0,o=t.length;s<o;s++){const o=t[s];if(o){const t=this._getEditOperationsFromCommand(e,s,o);i=i.concat(t.operations),n=n||t.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){const n=[];let s=0;const o=(e,o,r=!1)=>{wi.isEmpty(e)&&""===o||n.push({identifier:{major:t,minor:s++},range:e,text:o,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a={addEditOperation:o,addTrackedEditOperation:(e,t,i)=>{r=!0,o(e,t,i)},trackSelection:(t,i)=>{const n=yi.liftSelection(t);let s;if(n.isEmpty())if("boolean"==typeof i)s=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);s=n.startColumn===t?2:3}else s=1;const o=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,s);return e.trackedRanges[o]=r,e.trackedRangesDirection[o]=n.getDirection(),o.toString()}};try{i.getEditOperations(e.model,a)}catch(e){return Be(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){(e=e.slice(0)).sort((e,t)=>-wi.compareRangesUsingEnds(e.range,t.range));const t={};for(let i=1;i<e.length;i++){const n=e[i-1],s=e[i];if(wi.getStartPosition(n.range).isBefore(wi.getEndPosition(s.range))){let o;o=n.identifier.major>s.identifier.major?n.identifier.major:s.identifier.major,t[o.toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===o&&(e.splice(t,1),t<i&&i--,t--);i>0&&i--}}return t}}.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);const i=[],n=[];for(let t=0;t<e.commands.length;t++){const s=e.commands[t];s instanceof py&&s.enclosingRange&&s.closeCharacterRange&&(i.push(s.closeCharacterRange),n.push(s.enclosingRange))}i.length>0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,s){const o=JE.from(this._model,this);if(o.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new yE(a,r,i)),!n||n.cursorState.length!==o.cursorState.length||o.cursorState.some((e,t)=>!e.modelState.equals(n.cursorState[t].modelState))){const a=n?n.cursorState.map(e=>e.modelState.selection):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new UE(a,r,l,o.modelVersionId,t||"keyboard",i,s))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.text||n.text.indexOf("\n")>=0)return null;const s=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const o=s[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(o);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-s[2].length-1,h=n.text.lastIndexOf(a,l-1);if(-1===h)return null;t.push([h,l])}return t}executeEdits(e,t,i,n){let s=null;"snippet"===t&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const o=[],r=[],a=this._model.pushEditOperations(this.getSelections(),i,e=>{if(s)for(let t=0,i=s.length;t<i;t++){const[i,n]=s[t],a=e[t],l=a.range.startLineNumber,h=a.range.startColumn-1+i,d=a.range.startColumn-1+n;o.push(new wi(l,d+1,l,d+2)),r.push(new wi(l,h+1,l,d+2))}const t=n(e);return t&&(this._isHandling=!0),t});a&&(this._isHandling=!1,this.setSelections(e,t,a,0)),o.length>0&&this._pushAutoClosedAction(o,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const s=JE.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){Be(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return eN.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new iN(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{"keyboard"===t&&this._executeEditOperation(fy.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i<e;){const e=fs(t,i),n=t.substr(i,e);this._executeEditOperation(fy.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),n)),i+=e}}else this._executeEditOperation(fy.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,s,o){if(0!==t.length||0!==i||0!==n)this._executeEdit(()=>{this._executeEditOperation(fy.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s))},e,o);else if(0!==s){const t=this.getSelections().map(e=>{const t=e.getPosition();return new yi(t.lineNumber,t.column+s,t.lineNumber,t.column+s)});this.setSelections(e,o,t,0)}}paste(e,t,i,n,s){this._executeEdit(()=>{this._executeEditOperation(fy.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,s,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(ey.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new jw(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new jw(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class JE{static from(e,t){return new JE(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class eN{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){const e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){const t=[];for(let e=0;e<this._autoClosedEnclosingDecorations.length;e++){const i=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[e]);if(i&&(t.push(i),i.startLineNumber!==i.endLineNumber))return!1}t.sort(wi.compareRangesUsingStarts),e.sort(wi.compareRangesUsingStarts);for(let i=0;i<e.length;i++){if(i>=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class tN{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class iN{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new tN(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=iN._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=iN._capture(e,t);if(!i)return null;if(this._original.length!==i.length)return null;const n=[];for(let e=0,t=this._original.length;e<t;e++)n.push(iN._deduceOutcome(this._original[e],i[e]));return n}static _deduceOutcome(e,t){const i=Math.min(e.startSelection,t.startSelection,as(e.text,t.text)),n=Math.min(e.text.length-e.endSelection,t.text.length-t.endSelection,ls(e.text,t.text)),s=e.text.substring(i,e.text.length-n),o=t.text.substring(i,t.text.length-n);return new _y(s,e.startSelection-i,e.endSelection-i,o,t.startSelection-i,t.endSelection-i)}}const nN={getInitialState:()=>pm,tokenizeEncoded:(e,t,i)=>vm(0,i)};function sN(e,t,i,n,s,o,r){let a="<div>",l=n,h=0,d=!0;for(let c=0,u=t.getCount();c<u;c++){const u=t.getEndOffset(c);if(u<=n)continue;let g="";for(;l<u&&l<s;l++){const t=e.charCodeAt(l);switch(t){case 9:{let e=o-(l+h)%o;for(h+=e-1;e>0;)r&&d?(g+="&#160;",d=!1):(g+=" ",d=!0),e--;break}case 60:g+="&lt;",d=!1;break;case 62:g+="&gt;",d=!1;break;case 38:g+="&amp;",d=!1;break;case 0:g+="&#00;",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="<22>",d=!1;break;case 13:g+="&#8203",d=!1;break;case 32:r&&d?(g+="&#160;",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(t),d=!1}}if(a+=`<span style="${t.getInlineStyle(c,i)}">${g}</span>`,u>s||l>=s)break}return a+="</div>",a}function oN(e,t,i){let n='<div class="monaco-tokenized-source">';const s=Gn(e);let o=i.getInitialState();for(let e=0,r=s.length;e<r;e++){const r=s[e];e>0&&(n+="<br/>");const a=i.tokenizeEncoded(r,!0,o);Cm.convertToEndOffset(a.tokens,r.length);const l=new Cm(a.tokens,r,t).inflate();let h=0;for(let e=0,t=l.getCount();e<t;e++){const t=l.getClassName(e),i=l.getEndOffset(e);n+=`<span class="${t}">${Kn(r.substring(h,i))}</span>`,h=i}o=a.endState}return n+="</div>",n}class rN{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class aN{constructor(e,t,i,n,s){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=s,this.prefixSum=0}}class lN{constructor(e,t,i,n){this._instanceId=xs(++lN.INSTANCE_COUNT),this._pendingChanges=new rN,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,s=e.length;for(;n<s;){const o=n+s>>>1;t===e[o].afterLineNumber?i<e[o].ordinal?s=o:n=o+1:t<e[o].afterLineNumber?s=o:n=o+1}return n}setLineHeight(e){this._checkPendingChanges(),this._lineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e){this._checkPendingChanges(),this._lineCount=e}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(e,i,n,s)=>{t=!0,e|=0,i|=0,n|=0,s|=0;const o=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new aN(o,e,i,n,s)),o},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const e of i)n.add(e.id);const s=new Map;for(const e of t)s.set(e.id,e);const o=e=>{const t=[];for(const i of e)if(!n.has(i.id)){if(s.has(i.id)){const e=s.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=o(this._arr).concat(o(e));r.sort((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber),this._arr=r,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=lN.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;i<n;i++)if(t[i].id===e)return i;return-1}_changeOneWhitespace(e,t,i){const n=this._findWhitespaceIndex(e);if(-1!==n&&(this._arr[n].height!==i&&(this._arr[n].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)),this._arr[n].afterLineNumber!==t)){const e=this._arr[n];this._removeWhitespace(n),e.afterLineNumber=t,this._insertWhitespace(e)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount-=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){const n=this._arr[i].afterLineNumber;e<=n&&n<=t?this._arr[i].afterLineNumber=e-1:n>t&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){e<=this._arr[i].afterLineNumber&&(this._arr[i].afterLineNumber+=t-e+1)}}getWhitespacesTotalHeight(){return this._checkPendingChanges(),0===this._arr.length?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e|=0;let t=Math.max(0,this._prefixSumValidIndex+1);0===t&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){this._checkPendingChanges();return this._lineHeight*this._lineCount+this.getWhitespacesTotalHeight()+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e);return-1===t?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e|=0;const t=this._arr;let i=0,n=t.length-1;for(;i<=n;){const s=i+((n-i|0)/2|0)|0;if(t[s].afterLineNumber<e){if(s+1>=t.length||t[s+1].afterLineNumber>=e)return s;i=s+1|0}else n=s-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t<this._arr.length?t:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){let i;this._checkPendingChanges(),i=(e|=0)>1?this._lineHeight*(e-1):0;return i+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0))+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e|=0;return this._lineHeight*e+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0))+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){this._checkPendingChanges();return e>this.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){if(0===this._paddingBottom)return!1;this._checkPendingChanges();return e>=this.getLinesTotalHeight()-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),(e|=0)<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,s=t;for(;n<s;){const t=(n+s)/2|0,o=0|this.getVerticalOffsetForLineNumber(t);if(e>=o+i)n=t+1;else{if(e>=o)return t;s=t}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this._lineHeight,n=0|this.getLineNumberAtOrAfterVerticalOffset(e),s=0|this.getVerticalOffsetForLineNumber(n);let o=0|this._lineCount,r=0|this.getFirstWhitespaceIndexAfterLineNumber(n);const a=0|this.getWhitespacesCount();let l,h;-1===r?(r=a,h=o+1,l=0):(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let d=s,c=d;let u=0;s>=5e5&&(u=5e5*Math.floor(s/5e5),u=Math.floor(u/i)*i,c-=u);const g=[],m=e+(t-e)/2;let f=-1;for(let e=n;e<=o;e++){if(-1===f){const t=d,n=d+i;(t<=m&&m<n||t>m)&&(f=e)}for(d+=i,g[e-n]=c,c+=i;h===e;)c+=l,d+=l,r++,r>=a?h=o+1:(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(d>=t){o=e;break}}-1===f&&(f=o);const p=0|this.getVerticalOffsetForLineNumber(o);let _=n,v=o;return _<v&&s<e&&_++,_<v&&p+i>t&&v--,{bigNumbersDelta:u,startLineNumber:n,endLineNumber:o,relativeVerticalOffset:g,centeredLineNumber:f,completelyVisibleStartLineNumber:_,completelyVisibleEndLineNumber:v}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return i=t>=1?this._lineHeight*t:0,n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t<i;){const n=Math.floor((t+i)/2),s=this.getVerticalOffsetForWhitespaceIndex(n);if(e>=s+this.getHeightForWhitespaceIndex(n))t=n+1;else{if(e>=s)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const s=[];for(let e=i;e<=n;e++){const i=this.getVerticalOffsetForWhitespaceIndex(e),n=this.getHeightForWhitespaceIndex(e);if(i>=t)break;s.push({id:this.getIdForWhitespaceIndex(e),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(e),verticalOffset:i,height:n})}return s}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}}lN.INSTANCE_COUNT=0;class hN{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class dN extends st{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new ft),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new hN(0,0,0,0),this._scrollable=this._register(new Zb({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new WE(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class cN extends st{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,s=n.get(144),o=n.get(84);this._linesLayout=new lN(t,n.get(67),o.top,o.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new dN(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new hN(s.contentWidth,0,s.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(114)?125:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){const e=t.get(84);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(144)){const e=t.get(144),i=e.contentWidth,n=e.height,s=this._scrollable.getScrollDimensions(),o=s.contentWidth;this._scrollable.setScrollDimensions(new hN(i,s.contentWidth,n,this._getContentHeight(i,n,o)))}else this._updateHeight();e.hasChanged(114)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const i=this._configuration.options.get(103);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let s=this._linesLayout.getLinesTotalHeight();return n.get(105)?s+=Math.max(0,t-n.get(67)-n.get(84).bottom):n.get(103).ignoreHorizontalScrollbarInContentHeight||(s+=this._getHorizontalScrollbarHeight(e,i)),s}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new hN(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Pm(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Pm(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(145),n=e.get(50),s=e.get(144);if(i.isViewportWrapping){const i=e.get(73);return t>s.contentWidth+n.typicalHalfwidthCharacterWidth&&i.enabled&&"right"===i.side?t+s.verticalScrollbarWidth:t}{const i=e.get(104)*n.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+i+s.verticalScrollbarWidth,o,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new hN(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class uN{constructor(e,t,i,n,s){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=s,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,s=e.options;let o;if(s.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new Ci(n.startLineNumber,1),0,!1,!0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new Ci(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);o=new wi(e.lineNumber,e.column,t.lineNumber,t.column)}else o=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new zm(o,s),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const n=new wi(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,Se(this.configuration.options),t,i),s=e.startLineNumber,o=e.endLineNumber,r=[];let a=0;const l=[];for(let e=s;e<=o;e++)l[e-s]=[];for(let e=0,t=n.length;e<t;e++){const t=n[e],i=t.options;if(!gN(this.model,t))continue;const h=this._getOrCreateViewModelDecoration(t),d=h.range;if(r[a++]=h,i.inlineClassName){const e=new Vm(d,i.inlineClassName,i.inlineClassNameAffectsLetterSpacing?3:0),t=Math.max(s,d.startLineNumber),n=Math.min(o,d.endLineNumber);for(let i=t;i<=n;i++)l[i-s].push(e)}if(i.beforeContentClassName&&s<=d.startLineNumber&&d.startLineNumber<=o){const e=new Vm(new wi(d.startLineNumber,d.startColumn,d.startLineNumber,d.startColumn),i.beforeContentClassName,1);l[d.startLineNumber-s].push(e)}if(i.afterContentClassName&&s<=d.endLineNumber&&d.endLineNumber<=o){const e=new Vm(new wi(d.endLineNumber,d.endColumn,d.endLineNumber,d.endColumn),i.afterContentClassName,2);l[d.endLineNumber-s].push(e)}}return{decorations:r,inlineDecorations:l}}}function gN(e,t){return(!t.options.hideInCommentTokens||!function(e,t){return mN(e,t.range,e=>1===e)}(e,t))&&(!t.options.hideInStringTokens||!function(e,t){return mN(e,t.range,e=>2===e)}(e,t))}function mN(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){const s=e.tokenization.getLineTokens(n),o=n===t.startLineNumber,r=n===t.endLineNumber;let a=o?s.findTokenIndexAtOffset(t.startColumn-1):0;for(;a<s.getCount();){if(r){if(s.getStartOffset(a)>t.endColumn-1)break}if(!i(s.getStandardTokenType(a)))return!1;a++}}return!0}function fN(e,t){return null===e?t?_N.INSTANCE:vN.INSTANCE:new pN(e,t)}class pN{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const n=i>0?this._projectionData.breakOffsets[i-1]:0,s=this._projectionData.breakOffsets[i];let o;if(null!==this._projectionData.injectionOffsets){const i=this._projectionData.injectionOffsets.map((e,t)=>new kL(0,0,e+1,this._projectionData.injectionOptions[t],0));o=kL.applyInjectedText(e.getLineContent(t),i).substring(n,s)}else o=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:s+1});return i>0&&(o=CN(this._projectionData.wrappedTextIndentLength)+o),o}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,s,o,r){this._assertVisible();const a=this._projectionData,l=a.injectionOffsets,h=a.injectionOptions;let d,c=null;if(l){c=[];let e=0,t=0;for(let i=0;i<a.getOutputLineCount();i++){const n=new Array;c[i]=n;const s=i>0?a.breakOffsets[i-1]:0,o=a.breakOffsets[i];for(;t<l.length;){const r=h[t].content.length,d=l[t]+e,c=d+r;if(d>o)break;if(s<c){const e=h[t];if(e.inlineClassName){const t=i>0?a.wrappedTextIndentLength:0,r=t+Math.max(d-s,0),l=t+Math.min(c-s,o-s);r!==l&&n.push(new Hm(r,l,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(!(c<=o))break;e+=r,t++}}}d=l?e.tokenization.getLineTokens(t).withInserted(l.map((e,t)=>({offset:e,text:h[t].content,tokenMetadata:Cm.defaultTokenMetadata}))):e.tokenization.getLineTokens(t);for(let e=i;e<i+n;e++){const t=s+e-i;o[t]?r[t]=this._getViewLineData(d,c?c[e]:null,e):r[t]=null}}_getViewLineData(e,t,i){this._assertVisible();const n=this._projectionData,s=i>0?n.wrappedTextIndentLength:0,o=i>0?n.breakOffsets[i-1]:0,r=n.breakOffsets[i],a=e.sliceAndInflate(o,r,s);let l=a.getLineContent();i>0&&(l=CN(n.wrappedTextIndentLength)+l);const h=this._projectionData.getMinOutputOffset(i)+1,d=l.length+1,c=i+1<this.getViewLineCount(),u=0===i?0:n.breakOffsetsVisibleColumn[i-1];return new Bm(l,c,h,d,u,a,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,i=2){this._assertVisible();return this._projectionData.translateToOutputPosition(t-1,i).toPosition(e)}getViewLineNumberOfModelPosition(e,t){this._assertVisible();return e+this._projectionData.translateToOutputPosition(t-1).outputLineIndex}normalizePosition(e,t,i){const n=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,i).toPosition(n)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw new Error("Not supported")}}class _N{constructor(){}isVisible(){return!0}setVisible(e){return e?this:vN.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){const n=e.tokenization.getLineTokens(t),s=n.getLineContent();return new Bm(s,!1,1,s.length+1,0,n.inflate(),null)}getViewLinesData(e,t,i,n,s,o,r){o[s]?r[s]=this.getViewLineData(e,t,0):r[s]=null}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new Ci(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}_N.INSTANCE=new _N;class vN{constructor(){}isVisible(){return!1}setVisible(e){return e?_N.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,n,s,o,r){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,i){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}vN.INSTANCE=new vN;const bN=[""];function CN(e){if(e>=bN.length)for(let t=1;t<=e;t++)bN[t]=wN(t);return bN[e]}function wN(e){return new Array(e+1).join(" ")}class yN{constructor(e,t,i,n,s,o,r,a,l,h){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=s,this.tabSize=o,this.wrappingStrategy=r,this.wrappingColumn=a,this.wrappingIndent=l,this.wordBreak=h,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new kN(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),s=i.length,o=this.createLineBreaksComputer(),r=new S(kL.fromDecorations(n));for(let e=0;e<s;e++){const n=r.takeWhile(t=>t.lineNumber===e+1);o.addRequest(i[e],n,t?t[e]:null)}const a=o.finalize(),l=[],h=this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e)).sort(wi.compareRangesUsingStarts);let d=1,c=0,u=-1,g=u+1<h.length?c+1:s+2;for(let e=0;e<s;e++){const t=e+1;t===g&&(u++,d=h[u].startLineNumber,c=h[u].endLineNumber,g=u+1<h.length?c+1:s+2);const i=t>=d&&t<=c,n=fN(a[e],!i);l[e]=n.getViewLineCount(),this.modelLineProjections[e]=n}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new iu(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=function(e){if(0===e.length)return[];const t=e.slice();t.sort(wi.compareRangesUsingStarts);const i=[];let n=t[0].startLineNumber,s=t[0].endLineNumber;for(let e=1,o=t.length;e<o;e++){const o=t[e];o.startLineNumber>s+1?(i.push(new wi(n,1,s,1)),n=o.startLineNumber,s=o.endLineNumber):o.endLineNumber>s&&(s=o.endLineNumber)}return i.push(new wi(n,1,s,1)),i}(e.map(e=>this.model.validateRange(e))),i=this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e)).sort(wi.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n<t.length;n++)if(!t[n].equalsRange(i[n])){e=!0;break}if(!e)return!1}const n=t.map(e=>({range:e,options:Jx.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,n);const s=t;let o=1,r=0,a=-1,l=a+1<s.length?r+1:this.modelLineProjections.length+2,h=!1;for(let e=0;e<this.modelLineProjections.length;e++){const t=e+1;t===l&&(a++,o=s[a].startLineNumber,r=s[a].endLineNumber,l=a+1<s.length?r+1:this.modelLineProjections.length+2);let i=!1;if(t>=o&&t<=r?this.modelLineProjections[e].isVisible()&&(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!1),i=!0):(h=!0,this.modelLineProjections[e].isVisible()||(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!0),i=!0)),i){const t=this.modelLineProjections[e].getViewLineCount();this.projectedModelLineLineCounts.setValue(e,t)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.modelLineProjections.length)&&this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,s){const o=this.fontInfo.equals(e),r=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n,h=this.wordBreak===s;if(o&&r&&a&&l&&h)return!1;const d=o&&r&&!a&&l&&h;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=s;let c=null;if(d){c=[];for(let e=0,t=this.modelLineProjections.length;e<t;e++)c[e]=this.modelLineProjections[e].getProjectionData()}return this._constructLines(!1,c),!0}createLineBreaksComputer(){return("advanced"===this.wrappingStrategy?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;const n=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,s=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new NE(n,s)}onModelLinesInserted(e,t,i,n){if(!e||e<=this._validModelVersionId)return null;const s=t>2&&!this.modelLineProjections[t-2].isVisible(),o=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let r=0;const a=[],l=[];for(let e=0,t=n.length;e<t;e++){const t=fN(n[e],!s);a.push(t);const i=t.getViewLineCount();r+=i,l[e]=i}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(a).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,l),new IE(o,o+r-1)}onModelLineChanged(e,t,i){if(null!==e&&e<=this._validModelVersionId)return[!1,null,null,null];const n=t-1,s=this.modelLineProjections[n].getViewLineCount(),o=fN(i,this.modelLineProjections[n].isVisible());this.modelLineProjections[n]=o;const r=this.modelLineProjections[n].getViewLineCount();let a=!1,l=0,h=-1,d=0,c=-1,u=0,g=-1;s>r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+r-1,u=h+1,g=u+(s-r)-1,a=!0):s<r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+s-1,d=h+1,c=d+(r-s)-1,a=!0):(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+r-1),this.projectedModelLineLineCounts.setValue(n,r);return[a,l<=h?new EE(l,h-l+1):null,d<=c?new IE(d,c):null,u<=g?new NE(u,g):null]}acceptVersionId(e){this._validModelVersionId=e,1!==this.modelLineProjections.length||this.modelLineProjections[0].isVisible()||this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;const t=this.getViewLineCount();return e>t?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),o=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.guides.getActiveIndentGuide(n.lineNumber,s.lineNumber,o.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new SN(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new Ci(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new Ci(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),s=new Array;let o=this.getModelStartPositionOfViewLine(i),r=new Array;for(let e=i.modelLineNumber;e<=n.modelLineNumber;e++){const t=this.modelLineProjections[e-1];if(t.isVisible()){const s=e===i.modelLineNumber?i.modelLineWrappedLineIdx:0,o=e===n.modelLineNumber?n.modelLineWrappedLineIdx+1:t.getViewLineCount();for(let t=s;t<o;t++)r.push(new SN(e,t))}if(!t.isVisible()&&o){const t=new Ci(e-1,this.model.getLineMaxColumn(e-1)+1),i=wi.fromPositions(o,t);s.push(new LN(i,r)),r=[],o=null}else t.isVisible()&&!o&&(o=new Ci(e,1))}if(o){const e=wi.fromPositions(o,this.getModelEndPositionOfViewLine(n));s.push(new LN(e,r))}return s}getViewLinesBracketGuides(e,t,i,n){const s=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,o=[];for(const i of this.getViewLineInfosGroupedByModelRanges(e,t)){const e=i.modelRange.startLineNumber,t=this.model.guides.getLinesBracketGuides(e,i.modelRange.endLineNumber,s,n);for(const n of i.viewLines){const i=t[n.modelLineNumber-e].map(e=>{if(-1!==e.forWrappedLinesAfterColumn){if(this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=n.modelLineWrappedLineIdx)return}if(-1!==e.forWrappedLinesBeforeOrAtColumn){if(this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumber<n.modelLineWrappedLineIdx)return}if(!e.horizontalLine)return e;let t=-1;if(-1!==e.column){const i=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.column);if(i.lineNumber===n.modelLineWrappedLineIdx)t=i.column;else if(i.lineNumber<n.modelLineWrappedLineIdx)t=this.getMinColumnOfViewLine(n);else if(i.lineNumber>n.modelLineWrappedLineIdx)return}const i=this.convertModelPositionToViewPosition(n.modelLineNumber,e.horizontalLine.endColumn),s=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return s.lineNumber===n.modelLineWrappedLineIdx?new mS(e.visibleColumn,t,e.className,new fS(e.horizontalLine.top,i.column),-1,-1):s.lineNumber<n.modelLineWrappedLineIdx||-1!==e.visibleColumn?void 0:new mS(e.visibleColumn,t,e.className,new fS(e.horizontalLine.top,this.getMaxColumnOfViewLine(n)),-1,-1)});o.push(i.filter(e=>!!e))}}return o}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let s=[];const o=[],r=[],a=i.lineNumber-1,l=n.lineNumber-1;let h=null;for(let e=a;e<=l;e++){const t=this.modelLineProjections[e];if(t.isVisible()){const n=t.getViewLineNumberOfModelPosition(0,e===a?i.column:1),s=t.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(e+1)),l=s-n+1;let d=0;l>1&&1===t.getViewLineMinColumn(this.model,e+1,s)&&(d=0===n?1:2),o.push(l),r.push(d),null===h&&(h=new Ci(e+1,0))}else null!==h&&(s=s.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,e)),h=null)}null!==h&&(s=s.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,n.lineNumber)),h=null);const d=t-e+1,c=new Array(d);let u=0;for(let e=0,t=s.length;e<t;e++){let t=s[e];const i=Math.min(d-u,o[e]),n=r[e];let a;a=2===n?0:1===n?1:i;for(let e=0;e<i;e++)e===a&&(t=0),c[u++]=t}return c}getViewLineContent(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.projectedModelLineLineCounts.getIndexOf(e-1);let s=e;const o=n.index,r=n.remainder,a=[];for(let n=o,l=this.model.getLineCount();n<l;n++){const l=this.modelLineProjections[n];if(!l.isVisible())continue;const h=n===o?r:0;let d=l.getViewLineCount()-h,c=!1;if(s+d>t&&(c=!0,d=t-s+1),l.getViewLinesData(this.model,n+1,h,d,s-e,i,a),s+=d,c)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),s=n.index,o=n.remainder,r=this.modelLineProjections[s],a=r.getViewLineMinColumn(this.model,s+1,o),l=r.getViewLineMaxColumn(this.model,s+1,o);t<a&&(t=a),t>l&&(t=l);const h=r.getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new Ci(s+1,h)).equals(i)?new Ci(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new wi(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new Ci(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new wi(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,n=!1,s=!1){const o=this.model.validatePosition(new Ci(e,t)),r=o.lineNumber,a=o.column;let l=r-1,h=!1;if(s)for(;l<this.modelLineProjections.length&&!this.modelLineProjections[l].isVisible();)l++,h=!0;else for(;l>0&&!this.modelLineProjections[l].isVisible();)l--,h=!0;if(0===l&&!this.modelLineProjections[l].isVisible())return new Ci(n?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(l);let c;return c=h?s?this.modelLineProjections[l].getViewPositionOfModelPosition(d,1,i):this.modelLineProjections[l].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(l+1),i):this.modelLineProjections[r-1].getViewPositionOfModelPosition(d,a,i),c}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return wi.fromPositions(i)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new wi(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!this.modelLineProjections[i].isVisible())return 1;const n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,s){const o=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),r=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(r.lineNumber-o.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new wi(o.lineNumber,1,r.lineNumber,r.column),t,i,n,s);let a=[];const l=o.lineNumber-1,h=r.lineNumber-1;let d=null;for(let e=l;e<=h;e++){if(this.modelLineProjections[e].isVisible())null===d&&(d=new Ci(e+1,e===l?o.column:1));else if(null!==d){const s=this.model.getLineMaxColumn(e);a=a.concat(this.model.getDecorationsInRange(new wi(d.lineNumber,d.column,e,s),t,i,n)),d=null}}null!==d&&(a=a.concat(this.model.getDecorationsInRange(new wi(d.lineNumber,d.column,r.lineNumber,r.column),t,i,n)),d=null),a.sort((e,t)=>{const i=wi.compareRangesUsingStarts(e.range,t.range);return 0===i?e.id<t.id?-1:e.id>t.id?1:0:i});const c=[];let u=0,g=null;for(const e of a){const t=e.id;g!==t&&(g=t,c[u++]=e)}return c}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}class SN{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class LN{constructor(e,t){this.modelRange=e,this.viewLines=t}}class kN{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class DN{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new xN(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new NE(t,i)}onModelLinesInserted(e,t,i,n){return new IE(t,i)}onModelLineChanged(e,t,i){return[!1,new EE(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,n=new Array(i);for(let e=0;e<i;e++)n[e]=0;return n}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){const t=this.model.tokenization.getLineTokens(e),i=t.getLineContent();return new Bm(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){const n=this.model.getLineCount();e=Math.min(Math.max(1,e),n),t=Math.min(Math.max(1,t),n);const s=[];for(let n=e;n<=t;n++){const t=n-e;s[t]=i[t]?this.getViewLineData(n):null}return s}getDecorationsInRange(e,t,i,n,s){return this.model.getDecorationsInRange(e,t,i,n,s)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class xN{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const EN=mu.Right;class NN{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*EN/8))}reset(e){const t=Math.ceil((e+1)*EN/8);this.lanes.length<t?this.lanes=new Uint8Array(t):this.lanes.fill(0),this._requiredLanes=1}get requiredLanes(){return this._requiredLanes}push(e,t,i){i&&(this.persist|=1<<e-1);for(let i=t.startLineNumber;i<=t.endLineNumber;i++){const t=EN*i+(e-1);this.lanes[t>>>3]|=1<<t%8,this._requiredLanes=Math.max(this._requiredLanes,this.countAtLine(i))}}getLanesAtLine(e){const t=[];let i=EN*e;for(let e=0;e<EN;e++)(this.persist&1<<e||this.lanes[i>>>3]&1<<i%8)&&t.push(e+1),i++;return t.length?t:[mu.Center]}countAtLine(e){let t=EN*e,i=0;for(let e=0;e<EN;e++)(this.persist&1<<e||this.lanes[t>>>3]&1<<t%8)&&i++,t++;return i}}class IN extends st{constructor(e,t,i,n,s,o,r,a,l){if(super(),this.languageConfigurationService=r,this._themeService=a,this._attachedView=l,this.hiddenAreasModel=new AN,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new FE,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new Vw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new mo(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=TN.create(this.model),this.glyphLanes=new NN(0),this.model.isTooLargeForTokenization())this._lines=new DN(this.model);else{const e=this._configuration.options,t=e.get(50),i=e.get(138),o=e.get(145),r=e.get(137),a=e.get(129);this._lines=new yN(this._editorId,this.model,n,s,t,this.model.getOptions().tabSize,i,o.wrappingColumn,r,a)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new XE(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new cN(this._configuration,this.getLineCount(),o)),this._register(this.viewLayout.onDidScroll(e=>{e.scrollTopChanged&&this._handleVisibleLinesChanged(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new ME(e)),this._eventDispatcher.emitOutgoingEvent(new HE(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(e=>{this._eventDispatcher.emitOutgoingEvent(e)})),this._decorations=new uN(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(ES.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new RE)})),this._register(this._themeService.onDidColorThemeChange(e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new AE(e))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new wi(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new kE(e)),this._eventDispatcher.emitOutgoingEvent(new VE(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new bE)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new CE)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new Ci(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new RN(t,this._viewportStart.startLineDelta)}return new RN(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,s=n.get(50),o=n.get(138),r=n.get(145),a=n.get(137),l=n.get(129);this._lines.setWrappingSettings(s,o,r.wrappingColumn,a,l)&&(e.emitViewEvent(new LE),e.emitViewEvent(new xE),e.emitViewEvent(new SE(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(91)&&(this._decorations.reset(),e.emitViewEvent(new SE(null))),t.hasChanged(98)&&(this._decorations.reset(),e.emitViewEvent(new SE(null))),e.emitViewEvent(new wE(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),Vw.shouldRecreate(t)&&(this.cursorConfig=new Vw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const s=e instanceof ML?e.rawContentChangedEvent.changes:e.changes,o=e instanceof ML?e.rawContentChangedEvent.versionId:null,r=this._lines.createLineBreaksComputer();for(const e of s)switch(e.changeType){case 4:for(let t=0;t<e.detail.length;t++){const i=e.detail[t];let n=e.injectedTexts[t];n&&(n=n.filter(e=>!e.ownerId||e.ownerId===this._editorId)),r.addRequest(i,n,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter(e=>!e.ownerId||e.ownerId===this._editorId)),r.addRequest(e.detail,t,null);break}}const a=r.finalize(),l=new S(a);for(const e of s)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new LE),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(o,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=l.takeCount(e.detail.length),s=this._lines.onModelLinesInserted(o,e.fromLineNumber,e.toLineNumber,n);null!==s&&(t.emitViewEvent(s),this.viewLayout.onLinesInserted(s.fromLineNumber,s.toLineNumber)),i=!0;break}case 2:{const i=l.dequeue(),[s,r,a,h]=this._lines.onModelLineChanged(o,e.lineNumber,i);n=s,r&&t.emitViewEvent(r),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),h&&(t.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber));break}}null!==o&&this._lines.acceptVersionId(o),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new xE),t.emitViewEvent(new SE(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStart.startLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();e instanceof ML&&t.emitOutgoingEvent(new ZE(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,n=e.ranges.length;i<n;i++){const n=e.ranges[i],s=this.coordinatesConverter.convertModelPositionToViewPosition(new Ci(n.fromLineNumber,1)).lineNumber,o=this.coordinatesConverter.convertModelPositionToViewPosition(new Ci(n.toLineNumber,this.model.getLineMaxColumn(n.toLineNumber))).lineNumber;t[i]={fromLineNumber:s,toLineNumber:o}}this._eventDispatcher.emitSingleViewEvent(new OE(t)),this._eventDispatcher.emitOutgoingEvent(new QE(e))})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new DE),this.cursorConfig=new Vw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new GE(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new Vw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new $E(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new LE),e.emitViewEvent(new xE),e.emitViewEvent(new SE(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Vw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new YE(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new SE(e)),this._eventDispatcher.emitOutgoingEvent(new qE(e))}))}setHiddenAreas(e,t){var i;this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas)return;this.previousHiddenAreas=n;const s=this._captureStableViewport();let o=!1;try{const e=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(n),o&&(e.emitViewEvent(new LE),e.emitViewEvent(new xE),e.emitViewEvent(new SE(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const t=null===(i=s.viewportStartModelPosition)||void 0===i?void 0:i.lineNumber;t&&n.some(e=>e.startLineNumber<=t&&t<=e.endLineNumber)||s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new KE)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(144),t=this._configuration.options.get(67),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),s=Math.max(1,n.completelyVisibleStartLineNumber-i),o=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new wi(s,this.getLineMinColumn(s),o,this.getLineMaxColumn(o)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];const n=[];let s=0,o=t.startLineNumber,r=t.startColumn;const a=t.endLineNumber,l=t.endColumn;for(let e=0,t=i.length;e<t;e++){const t=i[e].startLineNumber,l=i[e].endLineNumber;l<o||(t>a||(o<t&&(n[s++]=new wi(o,r,t-1,this.model.getLineMaxColumn(t-1))),o=l+1,r=1))}return(o<a||o===a&&r<l)&&(n[s++]=new wi(o,r,a,l)),n}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new wi(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new wi(i,this.getLineMinColumn(i),n,this.getLineMaxColumn(n))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),n=this.coordinatesConverter.convertViewPositionToModelPosition(new Ci(i,this.getLineMinColumn(i))),s=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:n,firstPositionDeltaTop:s}}reduceRestoreState(e){if(void 0===e.firstPosition)return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Zn(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Qn(this.getLineContent(e));return-1===t?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const i=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,i)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),s=this.getTabSize(),o=this._lines.getViewLineData(e);return o.inlineDecorations&&(t=[...t,...o.inlineDecorations.map(t=>t.toInlineDecoration(e))]),new Wm(o.minColumn,o.maxColumn,o.content,o.continuesWithWrappedLine,i,n,o.tokens,t,s,o.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new Fm(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,Se(this._configuration.options)),i=new MN;for(const n of t){const t=n.options,s=t.overviewRuler;if(!s)continue;const o=s.position;if(0===o)continue;const r=s.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(r,t.zIndex,a,l,o)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const e=t.options.overviewRuler;null==e||e.invalidateCachedColor();const i=t.options.minimap;null==i||i.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);const s=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,i){const n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(wi.compareRangesUsingStarts);let s=!1,o=!1;for(const t of e)t.isEmpty()?s=!0:o=!0;if(!o){if(!t)return"";const i=e.map(e=>e.startLineNumber);let s="";for(let e=0;e<i.length;e++)e>0&&i[e-1]===i[e]||(s+=this.model.getLineContent(i[e])+n);return s}if(s&&t){const t=[];let n=0;for(const s of e){const e=s.startLineNumber;s.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(s,i?2:0)),n=e}return 1===t.length?t[0]:t}const r=[];for(const t of e)t.isEmpty()||r.push(this.model.getValueInRange(t,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if("plaintext"===i)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new wi(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const s=this._configuration.options.get(50),o=this._getColorMap();let r;if(/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===Ae.fontFamily)r=Ae.fontFamily;else{r=s.fontFamily,r=r.replace(/"/g,"'");if(!/[,']/.test(r)){/[+ ]/.test(r)&&(r=`'${r}'`)}r=`${r}, ${Ae.fontFamily}`}return{mode:i,html:`<div style="color: ${o[1]};background-color: ${o[2]};font-family: ${r};font-weight: ${s.fontWeight};font-size: ${s.fontSize}px;line-height: ${s.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,o)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn,r=this.getTabSize();let a="";for(let e=i;e<=s;e++){const l=this.model.tokenization.getLineTokens(e),h=l.getLineContent(),d=e===i?n-1:0,c=e===s?o-1:h.length;a+=""===h?"<br>":sN(h,l.inflate(),t,d,c,r,K.n)}return a}_getColorMap(){const e=zi.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=Ug.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(n=>this._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new jE):this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,s){this._executeCursorEdit(o=>this._cursor.compositionType(o,e,t,i,n,s))}paste(e,t,i,n){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new wi(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new TE(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new wi(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new TE(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,n,s){this._withViewEventsCollector(o=>o.emitViewEvent(new TE(e,!1,i,null,n,t,s)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new PE),this._eventDispatcher.emitOutgoingEvent(new zE))}_withViewEventsCollector(e){try{return e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class TN{static create(e){const t=e._setTrackedRange(null,new wi(1,1,1,1),1);return new TN(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,s){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=s}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new Ci(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new wi(i.lineNumber,i.column,i.lineNumber,i.column),1),s=e.viewLayout.getVerticalOffsetForLineNumber(t),o=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=o-s}invalidate(){this._isValid=!1}}class MN{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,s){const o=this._asMap[e];if(o){const e=o.data,t=e[e.length-3],r=e[e.length-1];if(t===s&&r+1>=i)return void(n>r&&(e[e.length-1]=n));e.push(s,i,n)}else{const o=new Km(e,t,[s,i,n]);this._asMap[e]=o,this.asArray.push(o)}}}class AN{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&ON(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((e,t)=>function(e,t){const i=[];let n=0,s=0;for(;n<e.length&&s<t.length;){const o=e[n],r=t[s];if(o.endLineNumber<r.startLineNumber-1)i.push(e[n++]);else if(r.endLineNumber<o.startLineNumber-1)i.push(t[s++]);else{const e=Math.min(o.startLineNumber,r.startLineNumber),t=Math.max(o.endLineNumber,r.endLineNumber);i.push(new wi(e,1,t,1)),n++,s++}}for(;n<e.length;)i.push(e[n++]);for(;s<t.length;)i.push(t[s++]);return i}(e,t),[]);return ON(this.ranges,e)||(this.ranges=e),this.ranges}}function ON(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].equalsRange(t[i]))return!1;return!0}class RN{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;const i=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),n=t.getVerticalOffsetForLineNumber(i.lineNumber);t.setScrollPosition({scrollTop:n+this.startLineDelta},1)}}class PN{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}var FN,BN;(BN=FN||(FN={}))[BN.Ignore=0]="Ignore",BN[BN.Info=1]="Info",BN[BN.Warning=2]="Warning",BN[BN.Error=3]="Error",function(e){e.fromValue=function(t){return t?os("error",t)?e.Error:os("warning",t)||os("warn",t)?e.Warning:os("info",t)?e.Info:e.Ignore:e.Ignore},e.toString=function(t){switch(t){case e.Error:return"error";case e.Warning:return"warning";case e.Info:return"info";default:return"ignore"}}}(FN||(FN={}));var WN=FN,VN=WN;const HN=wl("notificationService");var zN,KN=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},UN=function(e,t){return function(i,n){t(i,n,e)}};let jN=0;class qN{constructor(e,t,i,n,s,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=s,this.attachedView=o}dispose(){et(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let $N=zN=class extends st{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,n,s,o,r,a,l,h,d,c){var u;super(),this.languageConfigurationService=d,this._deliveryQueue=new pt,this._contributions=this._register(new BL),this._onDidDispose=this._register(new ft),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new GN({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new GN({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new ZN(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new ft({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),s.willCreateCodeEditor();const g={...t};let m;this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++jN,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,g,h)),this._register(this._configuration.onDidChange(e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(144)){const e=t.get(144);this._onDidLayoutChange.fire(e)}})),this._contextKeyService=this._register(r.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=s,this._commandService=o,this._themeService=a,this._register(new YN(this,this._contextKeyService)),this._register(new QN(this,this._contextKeyService,c)),this._instantiationService=n.createChild(new PN([vh,this._contextKeyService])),this._modelData=null,this._focusTracker=new XN(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={},m=Array.isArray(i.contributions)?i.contributions:td.getEditorContributions(),this._contributions.initialize(this,m,this._instantiationService);for(const e of td.getEditorActions()){if(this._actions.has(e.id)){Be(new Error("Cannot have two actions with the same id "+e.id));continue}const t=new WL(e.id,e.label,e.alias,e.metadata,null!==(u=e.precondition)&&void 0!==u?u:void 0,t=>this._instantiationService.invokeFunction(i=>Promise.resolve(e.runEditorCommand(i,this,t))),this._contextKeyService);this._actions.set(t.id,t)}const f=()=>!this._configuration.options.get(91)&&this._configuration.options.get(36).enabled;this._register(new Ja(this._domElement,{onDragOver:e=>{if(!f())return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this.showDropIndicatorAt(t.position)},onDrop:async e=>{if(!f())return;if(this.removeDropIndicator(),!e.dataTransfer)return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this._onDropIntoEditor.fire({position:t.position,event:e})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;null===(t=this._modelData)||void 0===t||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new Ff(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return fm.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?ty.getWordAtPosition(this._modelData.model,this._configuration.options.get(130),e):null}getValue(e=null){if(!this._modelData)return"";const t=!(!e||!e.preserveBOM);let i=0;return e&&e.lineEnding&&"\n"===e.lineEnding?i=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;const i=e;if(null===this._modelData&&null===i)return;if(this._modelData&&this._modelData.model===i)return;const n={oldModelUrl:(null===(t=this._modelData)||void 0===t?void 0:t.model.uri)||null,newModelUrl:(null==i?void 0:i.uri)||null};this._onWillChangeModel.fire(n);const s=this.hasTextFocus(),o=this._detachModel();this._attachModel(i),s&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(n),this._postDetachModelCleanup(o),this._contributionsDisposable=this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(o.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?zN._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?zN._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?zN._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;null===(i=this._modelData)||void 0===i||i.viewModel.setHiddenAreas(e.map(e=>wi.lift(e)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Sb.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!Ci.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!wi.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),o=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,o,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new wi(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!Ci.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new wi(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=yi.isISelection(e),n=wi.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new yi(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new wi(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!wi.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(wi.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;t<i;t++)if(!yi.isISelection(e[t]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}hasPendingScrollAnimation(){return!!this._modelData&&this._modelData.viewModel.viewLayout.hasPendingScrollAnimation()}saveViewState(){if(!this._modelData)return null;const e=this._contributions.saveViewState();return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const e=t.cursorState;Array.isArray(e)?e.length>0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]),this._contributions.restoreViewState(t.contributionsState||{});const i=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(i)}}handleInitialized(){var e;null===(e=this._getViewModel())||void 0===e||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(e=>e.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const n=this.getAction(t);n?Promise.resolve(n.run(i)).then(void 0,Be):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,s){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,s,e)}_paste(e,t,i,n,s){if(!this._modelData||0===t.length)return;const o=this._modelData.viewModel,r=o.getSelection().getStartPosition();o.paste(t,i,n,e);const a=o.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new wi(r.lineNumber,r.column,a.lineNumber,a.column),languageId:s})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=td.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction(e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,Be)}),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&(!this._configuration.options.get(91)&&(this._modelData.model.pushStackElement(),!0))}popUndoStop(){return!!this._modelData&&(!this._configuration.options.get(91)&&(this._modelData.model.popStackElement(),!0))}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(91))return!1;let n;return n=i?Array.isArray(i)?()=>i:i:()=>null,this._modelData.viewModel.executeEdits(e,t,n),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new JN(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,Se(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,Se(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(e=>e.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(144)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarPointerDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const e=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,n=i.get(144);return{top:zN._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft(),height:i.get(67)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){hl(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e)return void(this._modelData=null);const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),n=new IN(this._id,this._configuration,e,OL.create(Fr(this._domElement)),rE.create(this._configuration.options),e=>ea(Fr(this._domElement),e),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(n.onEvent(t=>{switch(t.kind){case 0:this._onDidContentSizeChange.fire(t);break;case 1:this._editorTextFocus.setValue(t.hasFocus);break;case 2:this._onDidScrollChange.fire(t);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(t.reachedMaxCursorCount){const e=this.getOption(80),t=J.b("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",e);this._notificationService.prompt(VN.Warning,t,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:J.b("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const e=[];for(let i=0,n=t.selections.length;i<n;i++)e[i]=t.selections[i].getPosition();const i={position:e[0],secondaryPositions:e.slice(1),reason:t.reason,source:t.source};this._onDidChangeCursorPosition.fire(i);const n={selection:t.selections[0],secondarySelections:t.selections.slice(1),modelVersionId:t.modelVersionId,oldSelections:t.oldSelections,oldModelVersionId:t.oldModelVersionId,source:t.source,reason:t.reason};this._onDidChangeCursorSelection.fire(n);break}case 7:this._onDidChangeModelDecorations.fire(t.event);break;case 8:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t.event);break;case 9:this._onDidChangeModelLanguageConfiguration.fire(t.event);break;case 10:this._onDidChangeModelContent.fire(t.event);break;case 11:this._onDidChangeModelOptions.fire(t.event);break;case 12:this._onDidChangeModelTokens.fire(t.event)}}));const[s,o]=this._createView(n);if(o){this._domElement.appendChild(s.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];s.addContentWidget(this._contentWidgets[i])}t=Object.keys(this._overlayWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];s.addOverlayWidget(this._overlayWidgets[i])}t=Object.keys(this._glyphMarginWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];s.addGlyphMarginWidget(this._glyphMarginWidgets[i])}s.render(!1,!0),s.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new qN(e,n,s,o,t,i)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,i,n)=>{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const s={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",s)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const s={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",s)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new jy(e.coordinatesConverter);i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e);return[new _L(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){null==e||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var e;if(null===(e=this._contributionsDisposable)||void 0===e||e.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const t=this._modelData.model,i=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),i&&this._domElement.contains(i)&&this._domElement.removeChild(i),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),t}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}showDropIndicatorAt(e){const t=[{range:new wi(e.lineNumber,e.column,e.lineNumber,e.column),options:zN.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};$N.dropIntoEditorDecorationOptions=Jx.register({description:"workbench-dnd-target",className:"dnd-target"}),$N=zN=KN([UN(3,bl),UN(4,yl),UN(5,Al),UN(6,vh),UN(7,DC),UN(8,HN),UN(9,Af),UN(10,Oc),UN(11,nm)],$N);class GN extends st{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new ft(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new ft(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class ZN extends ft{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class YN extends st{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=yy.editorSimpleInput.bindTo(t),this._editorFocus=yy.focus.bindTo(t),this._textInputFocus=yy.textInputFocus.bindTo(t),this._editorTextFocus=yy.editorTextFocus.bindTo(t),this._tabMovesFocus=yy.tabMovesFocus.bindTo(t),this._editorReadonly=yy.readOnly.bindTo(t),this._inDiffEditor=yy.inDiffEditor.bindTo(t),this._editorColumnSelection=yy.columnSelection.bindTo(t),this._hasMultipleSelections=yy.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=yy.hasNonEmptySelection.bindTo(t),this._canUndo=yy.canUndo.bindTo(t),this._canRedo=yy.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(Mf.onDidChangeTabFocus(e=>this._tabMovesFocus.set(e))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(Mf.getTabFocusMode()),this._editorReadonly.set(e.get(91)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(e=>!e.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class QN extends st{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=yy.languageId.bindTo(t),this._hasCompletionItemProvider=yy.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=yy.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=yy.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=yy.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=yy.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=yy.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=yy.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=yy.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=yy.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=yy.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=yy.hasReferenceProvider.bindTo(t),this._hasRenameProvider=yy.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=yy.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=yy.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=yy.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=yy.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=yy.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=yy.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=yy.isInEmbeddedEditor.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===wr.walkThroughSnippet||e.uri.scheme===wr.vscodeChatCodeBlock)}):this.reset()}}class XN extends st{constructor(e,t){super(),this._onChange=this._register(new ft),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Pa(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Pa(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){var e;return null!==(e=this._hadFocus)&&void 0!==e&&e}}class JN{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(i=>{this._isChangingDecorations||e.call(t,i)},i)}getRange(e){return this._editor.hasModel()?e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e]):null}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){0!==this._decorationIds.length&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const eI=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),tI=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function iI(e){return eI+encodeURIComponent(e.toString())+tI}const nI=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),sI=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');TC((e,t)=>{const i=e.getColor(Bp);i&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${iI(i)}") repeat-x bottom left; }`);const n=e.getColor(Vp);n&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${iI(n)}") repeat-x bottom left; }`);const s=e.getColor(zp);s&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${iI(s)}") repeat-x bottom left; }`);const o=e.getColor(Up);var r;o&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${r=o,nI+encodeURIComponent(r.toString())+sI}") no-repeat bottom left; }`);const a=e.getColor(nw);a&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${a.rgba.a}; }`)});var oI=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},rI=function(e,t){return function(i,n){t(i,n,e)}};let aI=class extends st{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new ft),this._onCodeEditorAdd=this._register(new ft),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new ft),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new ft),this._onDiffEditorAdd=this._register(new ft),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new ft),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new $,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(t=>t.removeDecorationsByType(e))))}setModelProperty(e,t,i){const n=e.toString();let s;this._modelProperties.has(n)?s=this._modelProperties.get(n):(s=new Map,this._modelProperties.set(n,s)),s.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i)){return this._modelProperties.get(i).get(t)}}async openCodeEditor(e,t,i){for(const n of this._codeEditorOpenHandlers){const s=await n(e,t,i);if(null!==s)return s}return null}registerCodeEditorOpenHandler(e){return it(this._codeEditorOpenHandlers.unshift(e))}};aI=oI([rI(0,DC)],aI);var lI=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},hI=function(e,t){return function(i,n){t(i,n,e)}};let dI=class extends aI{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(e,t,i)=>t?this.doOpenEditor(t,e):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const i=t.resource.scheme;if(i===wr.http||i===wr.https)return $a(t.resource.toString()),e}return null}const i=t.options?t.options.selection:null;if(i)if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{const t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};dI=lI([hI(0,vh),hI(1,DC)],dI),rc(yl,dI,0);const cI=wl("layoutService");var uI=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},gI=function(e,t){return function(i,n){t(i,n,e)}};let mI=class{get mainContainer(){var e,t;return null!==(t=null===(e=c(this._codeEditorService.listCodeEditors()))||void 0===e?void 0:e.getContainerDomNode())&&void 0!==t?t:Pn.document.body}get activeContainer(){var e,t;const i=null!==(e=this._codeEditorService.getFocusedCodeEditor())&&void 0!==e?e:this._codeEditorService.getActiveCodeEditor();return null!==(t=null==i?void 0:i.getContainerDomNode())&&void 0!==t?t:this.mainContainer}get mainContainerDimension(){return sa(this.mainContainer)}get activeContainerDimension(){return sa(this.activeContainer)}get containers(){return a(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=dt.None,this.onDidLayoutActiveContainer=dt.None,this.onDidLayoutContainer=dt.None,this.onDidChangeActiveContainer=dt.None,this.onDidAddContainer=dt.None,this.whenActiveContainerStylesLoaded=Promise.resolve(),this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};mI=uI([gI(0,yl)],mI);let fI=class extends mI{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};fI=uI([gI(1,yl)],fI),rc(cI,mI,1);const pI=wl("dialogService");var _I=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},vI=function(e,t){return function(i,n){t(i,n,e)}};function bI(e){return e.scheme===wr.file?e.fsPath:e.path}let CI=0;class wI{constructor(e,t,i,n,s,o,r){this.id=++CI,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=s,this.sourceId=o,this.sourceOrder=r,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class yI{constructor(e,t){this.resourceLabel=e,this.reason=t}}class SI{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,i]of this.elements){(0===i.reason?e:t).push(i.resourceLabel)}const i=[];return e.length>0&&i.push(J.b({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(J.b({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class LI{constructor(e,t,i,n,s,o,r){this.id=++CI,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=o,this.sourceOrder=r,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new SI),this.removedResources.has(t)||this.removedResources.set(t,new yI(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new SI),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new yI(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class kI{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(" * [UNDO] "+this._past[t]);for(let t=this._future.length-1;t>=0;t--)e.push(" * [REDO] "+this._future[t]);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let e=0,i=this._past.length;e<i;e++)t.push(this._past[e].id);for(let e=this._future.length-1;e>=0;e--)t.push(this._future[e].id);return new Ax(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let o=0,r=this._past.length;o<r;o++,n++){const r=this._past[o];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,s=0),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}let o=-1;for(let s=this._future.length-1;s>=0;s--,n++){const r=this._future[s];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,o=s),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}-1!==s&&(this._past=this._past.slice(0,s)),-1!==o&&(this._future=this._future.slice(o+1)),this.versionId++}getElements(){const e=[],t=[];for(const t of this._past)e.push(t.actual);for(const e of this._future)t.push(e.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class DI{constructor(e){this.editStacks=e,this._versionIds=[];for(let e=0,t=this.editStacks.length;e<t;e++)this._versionIds[e]=this.editStacks[e].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const xI=new kI("","");xI.locked=!0;let EI=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const e of this._editStacks)t.push(e[1].toString());console.log(t.join("\n"))}pushElement(e,t=Ox.None,i=Rx.None){if(0===e.type){const n=bI(e.resource),s=this.getUriComparisonKey(e.resource);this._pushElement(new wI(e,n,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,s=[],o=[];for(const t of e.resources){const e=bI(t),i=this.getUriComparisonKey(t);n.has(i)||(n.add(i),s.push(e),o.push(i))}1===s.length?this._pushElement(new wI(e,s[0],o[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new LI(e,s,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const i=e.resourceLabels[t],n=e.strResources[t];let s;this._editStacks.has(n)?s=this._editStacks.get(n):(s=new kI(i,n),this._editStacks.set(n,s)),s.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);if(e.hasFutureElements())return null;const i=e.getClosestPastElement();return i?i.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const e of i){const t=bI(e.resource),i=this.getUriComparisonKey(e.resource),s=new wI(e,t,i,0,0,0,0);n.set(s.strResource,s)}for(const i of e.strResources){if(t&&t.has(i))continue;this._editStacks.get(i).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const e of i){const t=bI(e.resource),i=this.getUriComparisonKey(e.resource),s=new wI(e,t,i,0,0,0,0);n.set(s.strResource,s)}for(const i of e.strResources){if(t&&t.has(i))continue;this._editStacks.get(i).splitFutureWorkspaceElement(e,n)}}removeElements(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);if(this._editStacks.has(t)){this._editStacks.get(t).dispose(),this._editStacks.delete(t)}}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);if(this._editStacks.has(n)){this._editStacks.get(n).setElementsValidFlag(t,i)}}createSnapshot(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).createSnapshot(e)}return new Ax(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),i.hasPastElements()||i.hasFutureElements()||(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).getElements()}return{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestPastElement();o&&(o.sourceId===e&&(!t||o.sourceOrder>t.sourceOrder)&&(t=o,i=n))}return[t,i]}canUndo(e){if(e instanceof Rx){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).hasPastElements()}return!1}_onError(e,t){Be(e);for(const e of t.strResources)this.removeElements(e);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,s){const o=this._acquireLocks(i);let r;try{r=t()}catch(t){return o(),n.dispose(),this._onError(t,e)}return r?r.then(()=>(o(),n.dispose(),s()),t=>(o(),n.dispose(),this._onError(t,e))):(o(),n.dispose(),s())}async _invokeWorkspacePrepare(e){if(void 0===e.actual.prepareUndoRedo)return st.None;const t=e.actual.prepareUndoRedo();return void 0===t?st.None:t}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(st.None);const i=e.actual.prepareUndoRedo();return i?"function"==typeof(n=i).dispose&&0===n.dispose.length?t(i):i.then(e=>t(e)):t(st.None);var n}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||xI);return new DI(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new NI(this._undo(e,0,!0));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new NI}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,J.b({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,J.b({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const s=[];for(const e of i.editStacks)e.getClosestPastElement()!==t&&s.push(e.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,J.b({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));const o=[];for(const e of i.editStacks)e.locked&&o.push(e.resourceLabel);return o.length>0?this._tryToSplitAndUndo(e,t,null,J.b({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,o.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,J.b({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),s=this._checkWorkspaceUndo(e,t,n,!1);return s?s.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let s;!function(e){e[e.All=0]="All",e[e.This=1]="This",e[e.Cancel=2]="Cancel"}(s||(s={}));const{result:o}=await this._dialogService.prompt({type:WN.Info,message:J.b("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:J.b({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>s.All},{label:J.b({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>s.This}],cancelButton:{run:()=>s.Cancel}});if(o===s.Cancel)return;if(o===s.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const r=this._checkWorkspaceUndo(e,t,i,!1);if(r)return r.returnValue;n=!0}let s;try{s=await this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const o=this._checkWorkspaceUndo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,s,()=>this._continueUndoInGroup(t.groupId,n))}_resourceUndo(e,t,i){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new DI([e]),n,()=>this._continueUndoInGroup(t.groupId,i))));{const e=J.b({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestPastElement();o&&(o.groupId===e&&(!t||o.groupOrder>t.groupOrder)&&(t=o,i=n))}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);return i?this._undo(i,0,t):void 0}undo(e){if(e instanceof Rx){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),s=n.getClosestPastElement();if(!s)return;if(s.groupId){const[e,n]=this._findClosestUndoElementInGroup(s.groupId);if(s!==e&&n)return this._undo(n,t,i)}if((s.sourceId!==t||s.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,s);try{return 1===s.type?this._workspaceUndo(e,s,i):this._resourceUndo(n,s,i)}finally{0}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:J.b("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:J.b({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:J.b("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestFutureElement();o&&(o.sourceId===e&&(!t||o.sourceOrder<t.sourceOrder)&&(t=o,i=n))}return[t,i]}canRedo(e){if(e instanceof Rx){const[,t]=this._findClosestRedoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).hasFutureElements()}return!1}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(n),new NI(this._redo(e));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new NI}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,J.b({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,J.b({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const s=[];for(const e of i.editStacks)e.getClosestFutureElement()!==t&&s.push(e.resourceLabel);if(s.length>0)return this._tryToSplitAndRedo(e,t,null,J.b({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));const o=[];for(const e of i.editStacks)e.locked&&o.push(e.resourceLabel);return o.length>0?this._tryToSplitAndRedo(e,t,null,J.b({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,o.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,J.b({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const s=this._checkWorkspaceRedo(e,t,i,!0);if(s)return n.dispose(),s.returnValue;for(const e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new DI([e]),i,()=>this._continueRedoInGroup(t.groupId))));{const e=J.b({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestFutureElement();o&&(o.groupId===e&&(!t||o.groupOrder<t.groupOrder)&&(t=o,i=n))}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);return t?this._redo(t):void 0}redo(e){if(e instanceof Rx){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return"string"==typeof e?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[e,t]=this._findClosestRedoElementInGroup(i.groupId);if(i!==e&&t)return this._redo(t)}try{return 1===i.type?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{0}}}};EI=_I([vI(0,pI),vI(1,HN)],EI);class NI{constructor(e){this.returnValue=e}}function II(e,t,i){return Math.min(Math.max(e,t),i)}rc(Mx,EI,1);class TI{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class MI{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}const AI=wl("environmentService");var OI=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},RI=function(e,t){return function(i,n){t(i,n,e)}};const PI=wl("ILanguageFeatureDebounceService");var FI;!function(e){const t=new WeakMap;let i=0;e.of=function(e){let n=t.get(e);return void 0===n&&(n=++i,t.set(e,n)),n}}(FI||(FI={}));class BI{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class WI{constructor(e,t,i,n,s,o){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=s,this._max=o,this._cache=new wg(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((e,t)=>Nr(FI.of(t),e),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?II(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new MI(6),this._cache.set(i,n));const s=II(n.update(t),this._min,this._max);return yr(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${s}ms`),s}_overall(){const e=new TI;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){return II(0|this._overall()||this._default,this._min,this._max)}}let VI=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var n,s,o;const r=null!==(n=null==i?void 0:i.min)&&void 0!==n?n:50,a=null!==(s=null==i?void 0:i.max)&&void 0!==s?s:r**2,l=null!==(o=null==i?void 0:i.key)&&void 0!==o?o:void 0,h=`${FI.of(e)},${r}${l?","+l:""}`;let d=this._data.get(h);return d||(this._isDev?d=new WI(this._logService,t,e,0|this._overallAverage()||1.5*r,r,a):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new BI(1.5*r)),this._data.set(h,d)),d}_overallAverage(){const e=new TI;for(const t of this._data.values())e.update(t.default());return e.value}};VI=OI([RI(0,Kh),RI(1,AI)],VI),rc(PI,VI,1);var HI=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},zI=function(e,t){return function(i,n){t(i,n,e)}};let KI=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new jI}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),s=this._hashTable.get(e,t,n);let o;if(s)o=s.metadata,this._logService.getLevel()===Uh.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${bm.getForeground(o)}, fontStyle ${bm.getFontStyle(o).toString(2)}`);else{let s=this._legend.tokenTypes[e];const r=[];if(s){let e=t;for(let t=0;e>0&&t<this._legend.tokenModifiers.length;t++)1&e&&r.push(this._legend.tokenModifiers[t]),e>>=1;e>0&&this._logService.getLevel()===Uh.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),r.push("not-in-legend"));const n=this._themeService.getColorTheme().getTokenStyleMetadata(s,r,i);if(void 0===n)o=2147483647;else{if(o=0,void 0!==n.italic){o|=1|(n.italic?1:0)<<11}if(void 0!==n.bold){o|=2|(n.bold?2:0)<<11}if(void 0!==n.underline){o|=4|(n.underline?4:0)<<11}if(void 0!==n.strikethrough){o|=8|(n.strikethrough?8:0)<<11}if(n.foreground){o|=16|n.foreground<<15}0===o&&(o=2147483647)}}else this._logService.getLevel()===Uh.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),o=2147483647,s="not-in-legend";this._hashTable.add(e,t,n,o),this._logService.getLevel()===Uh.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${s}) / ${t} (${r.join(" ")}): foreground ${bm.getForeground(o)}, fontStyle ${bm.getFontStyle(o).toString(2)}`)}return o}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,s){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${s}).`))}};KI=HI([zI(1,DC),zI(2,nc),zI(3,Kh)],KI);class UI{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class jI{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=jI._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<jI._SIZES.length?2/3*this._currentLength:0),this._elements=[],jI._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const n=this._hashFunc(e,t,i);let s=this._elements[n];for(;s;){if(s.tokenTypeIndex===e&&s.tokenModifierSet===t&&s.languageId===i)return s;s=s.next}return null}add(e,t,i,n){if(this._elementsCount++,0!==this._growCount&&this._elementsCount>=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=jI._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<jI._SIZES.length?2/3*this._currentLength:0),this._elements=[],jI._nullOutEntries(this._elements,this._currentLength);for(const t of e){let e=t;for(;e;){const t=e.next;e.next=null,this._add(e),e=t}}}this._add(new UI(e,t,i,n))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}jI._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];const qI=wl("semanticTokensStylingService");var $I=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},GI=function(e,t){return function(i,n){t(i,n,e)}};let ZI=class extends st{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new KI(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};ZI=$I([GI(0,DC),GI(1,Kh),GI(2,nc)],ZI),rc(qI,ZI,1);const YI=/\//g;function QI(e,t){switch(e){case 0:return"";case 1:return"[^/\\\\]*?";default:return`(?:[/\\\\]|[^/\\\\]+[/\\\\]${t?"|[/\\\\][^/\\\\]+":""})*?`}}function XI(e,t){if(!e)return[];const i=[];let n=!1,s=!1,o="";for(const r of e){switch(r){case t:if(!n&&!s){i.push(o),o="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":s=!0;break;case"]":s=!1}o+=r}return o&&i.push(o),i}const JI=/^\*\*\/\*\.[\w\.-]+$/,eT=/^\*\*\/([\w\.-]+)\/?$/,tT=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,iT=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,nT=/^\*\*((\/[\w\.-]+)+)\/?$/,sT=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,oT=new wg(1e4),rT=function(){return!1},aT=function(){return null};function lT(e,t){if(!e)return aT;let i;i="string"!=typeof e?e.pattern:e,i=i.trim();const n=`${i}_${!!t.trimForExclusions}`;let s,o=oT.get(n);return o||(o=JI.test(i)?function(e,t){return function(i,n){return"string"==typeof i&&i.endsWith(e)?t:null}}(i.substr(4),i):(s=eT.exec(dT(i,t)))?function(e,t){const i="/"+e,n="\\"+e,s=function(s,o){return"string"!=typeof s?null:o?o===e?t:null:s===e||s.endsWith(i)||s.endsWith(n)?t:null},o=[e];return s.basenames=o,s.patterns=[t],s.allBasenames=o,s}(s[1],i):(t.trimForExclusions?iT:tT).test(i)?function(e,t){const i=gT(e.slice(1,-1).split(",").map(e=>lT(e,t)).filter(e=>e!==aT),e),n=i.length;if(!n)return aT;if(1===n)return i[0];const s=function(t,n){for(let s=0,o=i.length;s<o;s++)if(i[s](t,n))return e;return null},o=i.find(e=>!!e.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);r.length&&(s.allPaths=r);return s}(i,t):(s=nT.exec(dT(i,t)))?cT(s[1].substr(1),i,!0):(s=sT.exec(dT(i,t)))?cT(s[1],i,!1):function(e){try{const t=new RegExp(`^${function e(t){if(!t)return"";let i="";const n=XI(t,"/");if(n.every(e=>"**"===e))i=".*";else{let t=!1;n.forEach((s,o)=>{if("**"===s){if(t)return;i+=QI(2,o===n.length-1)}else{let t=!1,r="",a=!1,l="";for(const n of s)if("}"!==n&&t)r+=n;else if(!a||"]"===n&&l)switch(n){case"{":t=!0;continue;case"[":a=!0;continue;case"}":{const n=`(?:${XI(r,",").map(t=>e(t)).join("|")})`;i+=n,t=!1,r="";break}case"]":i+="["+l+"]",a=!1,l="";break;case"?":i+="[^/\\\\]";continue;case"*":i+=QI(1);continue;default:i+=Un(n)}else{let e;e="-"===n?n:"^"!==n&&"!"!==n||l?"/"===n?"":Un(n):"^",l+=e}o<n.length-1&&("**"!==n[o+1]||o+2<n.length)&&(i+="[/\\\\]")}t="**"===s})}return i}(e)}$`);return function(i){return t.lastIndex=0,"string"==typeof i&&t.test(i)?e:null}}catch(e){return aT}}(i),oT.set(n,o)),hT(o,e)}function hT(e,t){if("string"==typeof t)return e;const i=function(i,n){return Xk(i,t.base,!K.g)?e(jn(i.substr(t.base.length),si),n):null};return i.allBasenames=e.allBasenames,i.allPaths=e.allPaths,i.basenames=e.basenames,i.patterns=e.patterns,i}function dT(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function cT(e,t,i){const n=si===Qt.sep,s=n?e:e.replace(YI,si),o=si+s,r=Qt.sep+e;let a;return a=i?function(i,a){return"string"!=typeof i||i!==s&&!i.endsWith(o)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,o){return"string"!=typeof i||i!==s&&(n||i!==e)?null:t},a.allPaths=[(i?"*/":"./")+e],a}function uT(e,t={}){if(!e)return rT;if("string"==typeof e||function(e){const t=e;if(!t)return!1;return"string"==typeof t.base&&"string"==typeof t.pattern}(e)){const i=lT(e,t);if(i===aT)return rT;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){const i=gT(Object.getOwnPropertyNames(e).map(i=>function(e,t,i){if(!1===t)return aT;const n=lT(e,i);if(n===aT)return aT;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,s,o,r)=>{if(!r||!n(t,s))return null;const a=r(i.replace("$(basename)",()=>o));return so(a)?a.then(t=>t?e:null):a?e:null};return t.requiresSiblings=!0,t}}return n}(i,e[i],t)).filter(e=>e!==aT)),n=i.length;if(!n)return aT;if(!i.some(e=>!!e.requiresSiblings)){if(1===n)return i[0];const e=function(e,t){let n=void 0;for(let s=0,o=i.length;s<o;s++){const o=i[s](e,t);if("string"==typeof o)return o;so(o)&&(n||(n=[]),n.push(o))}return n?(async()=>{for(const e of n){const t=await e;if("string"==typeof t)return t}return null})():null},t=i.find(e=>!!e.allBasenames);t&&(e.allBasenames=t.allBasenames);const s=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return s.length&&(e.allPaths=s),e}const s=function(e,t,n){let s=void 0,o=void 0;for(let r=0,a=i.length;r<a;r++){const a=i[r];a.requiresSiblings&&n&&(t||(t=ii(e)),s||(s=t.substr(0,t.length-ni(e).length)));const l=a(e,t,s,n);if("string"==typeof l)return l;so(l)&&(o||(o=[]),o.push(l))}return o?(async()=>{for(const e of o){const t=await e;if("string"==typeof t)return t}return null})():null},o=i.find(e=>!!e.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);r.length&&(s.allPaths=r);return s}(e,t)}function gT(e,t){const i=e.filter(e=>!!e.basenames);if(i.length<2)return e;const n=i.reduce((e,t)=>{const i=t.basenames;return i?e.concat(i):e},[]);let s;if(t){s=[];for(let e=0,i=n.length;e<i;e++)s.push(t)}else s=i.reduce((e,t)=>{const i=t.patterns;return i?e.concat(i):e},[]);const o=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substr(i)}const i=n.indexOf(t);return-1!==i?s[i]:null};o.basenames=n,o.patterns=s,o.allBasenames=n;const r=e.filter(e=>!e.basenames);return r.push(o),r}function mT(e,t,i,n,s,o){if(Array.isArray(e)){let r=0;for(const a of e){const e=mT(a,t,i,n,s,o);if(10===e)return e;e>r&&(r=e)}return r}if("string"==typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:h,pattern:d,scheme:c,hasAccessToAllModels:u,notebookType:g}=e;if(!n&&!u)return 0;g&&s&&(t=s);let m=0;if(c)if(c===t.scheme)m=10;else{if("*"!==c)return 0;m=5}if(h)if(h===i)m=10;else{if("*"!==h)return 0;m=Math.max(m,5)}if(g)if(g===o)m=10;else{if("*"!==g||void 0===o)return 0;m=Math.max(m,5)}if(d){let e;if(e="string"==typeof d?d:{...d,base:Xt(d.base)},e!==t.fsPath&&(r=e,a=t.fsPath,!r||"string"!=typeof a||!uT(r)(a,void 0,l)))return 0;m=10}return m}return 0;var r,a,l}function fT(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(fT):!!e.exclusive)}class pT{constructor(e,t,i,n){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&(null===(t=this.notebookUri)||void 0===t?void 0:t.toString())===(null===(i=e.notebookUri)||void 0===i?void 0:i.toString())}}class _T{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new ft,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),it(()=>{if(i){const e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const e of this._entries)e._score>0&&t.push(e.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,e=>t.push(e.provider)),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const e of this._entries)e._score>0&&t(e)}_updateScores(e){var t,i;const n=null===(t=this._notebookInfoResolver)||void 0===t?void 0:t.call(this,e.uri),s=n?new pT(e.uri,e.getLanguageId(),n.uri,n.type):new pT(e.uri,e.getLanguageId(),void 0,void 0);if(!(null===(i=this._lastCandidate)||void 0===i?void 0:i.equals(s))){this._lastCandidate=s;for(const t of this._entries)if(t._score=mT(t.selector,s.uri,s.languageId,yu(e),s.notebookUri,s.notebookType),fT(t.selector)&&t._score>0){for(const e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(_T._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:vT(e.selector)&&!vT(t.selector)?1:!vT(e.selector)&&vT(t.selector)?-1:e._time<t._time?1:e._time>t._time?-1:0}}function vT(e){return"string"!=typeof e&&(Array.isArray(e)?e.some(vT):Boolean(e.isBuiltin))}rc(nm,class{constructor(){this.referenceProvider=new _T(this._score.bind(this)),this.renameProvider=new _T(this._score.bind(this)),this.newSymbolNamesProvider=new _T(this._score.bind(this)),this.codeActionProvider=new _T(this._score.bind(this)),this.definitionProvider=new _T(this._score.bind(this)),this.typeDefinitionProvider=new _T(this._score.bind(this)),this.declarationProvider=new _T(this._score.bind(this)),this.implementationProvider=new _T(this._score.bind(this)),this.documentSymbolProvider=new _T(this._score.bind(this)),this.inlayHintsProvider=new _T(this._score.bind(this)),this.colorProvider=new _T(this._score.bind(this)),this.codeLensProvider=new _T(this._score.bind(this)),this.documentFormattingEditProvider=new _T(this._score.bind(this)),this.documentRangeFormattingEditProvider=new _T(this._score.bind(this)),this.onTypeFormattingEditProvider=new _T(this._score.bind(this)),this.signatureHelpProvider=new _T(this._score.bind(this)),this.hoverProvider=new _T(this._score.bind(this)),this.documentHighlightProvider=new _T(this._score.bind(this)),this.multiDocumentHighlightProvider=new _T(this._score.bind(this)),this.selectionRangeProvider=new _T(this._score.bind(this)),this.foldingRangeProvider=new _T(this._score.bind(this)),this.linkProvider=new _T(this._score.bind(this)),this.inlineCompletionsProvider=new _T(this._score.bind(this)),this.inlineEditProvider=new _T(this._score.bind(this)),this.completionProvider=new _T(this._score.bind(this)),this.linkedEditingRangeProvider=new _T(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new _T(this._score.bind(this)),this.documentSemanticTokensProvider=new _T(this._score.bind(this)),this.documentOnDropEditProvider=new _T(this._score.bind(this)),this.documentPasteEditProvider=new _T(this._score.bind(this))}_score(e){var t;return null===(t=this._notebookTypeResolver)||void 0===t?void 0:t.call(this,e)}},1);var bT=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},CT=function(e,t){return function(i,n){t(i,n,e)}};const wT=wl("hoverService");let yT=class extends st{get delay(){return this.instantHover&&Date.now()-this.lastHoverHideTime<this.timeLimit?0:this._delay}constructor(e,t,i={},n,s){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=s,this.lastHoverHideTime=Number.MAX_VALUE,this.timeLimit=200,this.hoverDisposables=this._register(new nt),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i="function"==typeof this.overrideOptions?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const n=e.target instanceof HTMLElement?[e.target]:e.target.targetElements;for(const e of n)this.hoverDisposables.add(Qr(e,"keydown",e=>{e.equals(9)&&this.hoverService.hideHover()}));return this.hoverService.showHover({...e,persistence:{hideOnHover:!0},...i},t)}onDidHideHover(){this.hoverDisposables.clear(),this.instantHover&&(this.lastHoverHideTime=Date.now())}};yT=bT([CT(3,Xd),CT(4,wT)],yT);const ST=wl("contextViewService"),LT=wl("contextMenuService");i("XhMw"),i("2VvC");const kT=Ka;class DT extends st{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new sC(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class xT extends st{static render(e,t,i){return new xT(e,t,i)}constructor(e,t,i){super(),this.actionContainer=Fa(e,kT("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Fa(this.actionContainer,kT("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Fa(this.action,kT("span.icon."+t.iconClass));Fa(this.action,kT("span")).textContent=i?`${t.label} (${i})`:t.label,this._register(Zr(this.actionContainer,Ma.CLICK,e=>{e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer)})),this._register(Zr(this.actionContainer,Ma.KEY_DOWN,e=>{const i=new Xs(e);(i.equals(3)||i.equals(10))&&(e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}const ET=wl("openerService");function NT(e,t={}){const i=IT(t);return function e(t,i,n,s){let o;if(2===i.type)o=document.createTextNode(i.content||"");else if(3===i.type)o=document.createElement("b");else if(4===i.type)o=document.createElement("i");else if(7===i.type&&s)o=document.createElement("code");else if(5===i.type&&n){const e=document.createElement("a");n.disposables.add(Qr(e,"click",e=>{n.callback(String(i.index),e)})),o=e}else 8===i.type?o=document.createElement("br"):1===i.type&&(o=t);o&&t!==o&&t.appendChild(o);o&&Array.isArray(i.children)&&i.children.forEach(t=>{e(o,t,n,s)})}(i,function(e,t){const i={type:1,children:[]};let n=0,s=i;const o=[],r=new TT(e);for(;!r.eos();){let e=r.next();const i="\\"===e&&0!==MT(r.peek(),t);if(i&&(e=r.next()),i||0===MT(e,t)||e!==r.peek())if("\n"===e)2===s.type&&(s=o.pop()),s.children.push({type:8});else if(2!==s.type){const t={type:2,content:e};s.children.push(t),o.push(s),s=t}else s.content+=e;else{r.advance(),2===s.type&&(s=o.pop());const i=MT(e,t);if(s.type===i||5===s.type&&6===i)s=o.pop();else{const e={type:i,children:[]};5===i&&(e.index=n,n++),s.children.push(e),o.push(s),s=e}}}2===s.type&&(s=o.pop());o.length;return i}(e,!!t.renderCodeSegments),t.actionHandler,t.renderCodeSegments),i}function IT(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}class TT{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function MT(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}const AT=new RegExp(`(\\\\)?\\$\\((${Ml.iconNameExpression}(?:${Ml.iconModifierExpression})?)\\)`,"g");function OT(e){const t=new Array;let i,n=0,s=0;for(;null!==(i=AT.exec(e));){s=i.index||0,n<s&&t.push(e.substring(n,s)),n=(i.index||0)+i[0].length;const[,o,r]=i;t.push(o?`$(${r})`:RT({id:r}))}return n<e.length&&t.push(e.substring(n)),t}function RT(e){const t=Ka("span");return t.classList.add(...Ml.asClassNameArray(e)),t}new Uint32Array(10);new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function PT(...e){return function(t,i){for(let n=0,s=e.length;n<s;n++){const s=e[n](t,i);if(s)return s}return null}}BT.bind(void 0,!1);const FT=BT.bind(void 0,!0);function BT(e,t,i){if(!i||i.length<t.length)return null;let n;return n=e?rs(i,t):0===i.indexOf(t),n?t.length>0?[{start:0,end:t.length}]:[]:null}function WT(e){return 97<=e&&e<=122}function VT(e){return 65<=e&&e<=90}function HT(e){return 48<=e&&e<=57}function zT(e){return 32===e||9===e||10===e||13===e}const KT=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(e=>KT.add(e.charCodeAt(0)));new Map;function UT(e){return WT(e)||VT(e)||HT(e)}function jT(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function qT(e,t){for(let i=t;i<e.length;i++){const t=e.charCodeAt(i);if(VT(t)||HT(t)||i>0&&!UT(e.charCodeAt(i-1)))return i}return e.length}function $T(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let s=null,o=n+1;for(s=$T(e,t,i+1,n+1);!s&&(o=qT(t,o))<t.length;)s=$T(e,t,i+1,o),o++;return null===s?null:jT({start:n,end:n+1},s)}}function GT(e,t){if(!t)return null;if(0===(t=t.trim()).length)return null;if(!function(e){let t=0,i=0,n=0,s=0;for(let o=0;o<e.length;o++)n=e.charCodeAt(o),VT(n)&&t++,WT(n)&&i++,zT(n)&&s++;return 0!==t&&0!==i||0!==s?t<=5:e.length<=30}(e))return null;t.length>60&&(t=t.substring(0,60));const i=function(e){let t=0,i=0,n=0,s=0,o=0;for(let r=0;r<e.length;r++)o=e.charCodeAt(r),VT(o)&&t++,WT(o)&&i++,UT(o)&&n++,HT(o)&&s++;return{upperPercent:t/e.length,lowerPercent:i/e.length,alphaPercent:n/e.length,numericPercent:s/e.length}}(t);if(!function(e){const{upperPercent:t,lowerPercent:i,alphaPercent:n,numericPercent:s}=e;return i>.2&&t<.8&&n>.6&&s<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,s=0;for(e=e.toLowerCase();s<t.length&&null===(n=$T(e,t,0,s));)s=qT(t,s+1);return n}const ZT=PT(FT,GT,(function(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]})),YT=PT(FT,GT,(function(e,t){return function e(t,i,n,s){if(n===t.length)return[];if(s===i.length)return null;if(t[n]===i[s]){let o=null;return(o=e(t,i,n+1,s+1))?jT({start:s,end:s+1},o):null}return e(t,i,n,s+1)}(e.toLowerCase(),t.toLowerCase(),0,0)})),QT=new wg(1e4);function XT(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=QT.get(e);n||(n=new RegExp(e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*"),"i"),QT.set(e,n));const s=n.exec(t);return s?[{start:s.index,end:s.index+s[0].length}]:i?YT(e,t):ZT(e,t)}function JT(e,t){const i=uM(e,e.toLowerCase(),0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return i?function(e){if(void 0===e)return[];const t=[],i=e[1];for(let n=e.length-1;n>1;n--){const s=e[n]+i,o=t[t.length-1];o&&o.end===s?o.end=s+1:t.push({start:s,end:s+1})}return t}(i):null}function eM(){const e=[],t=[];for(let e=0;e<=128;e++)t[e]=0;for(let i=0;i<=128;i++)e.push(t.slice(0));return e}function tM(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const iM=tM(256),nM=tM(256),sM=eM(),oM=eM(),rM=eM();function aM(e,t){if(t<0||t>=e.length)return!1;const i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Ls(i)}}function lM(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function hM(e,t,i){return t[e]!==i[e]}var dM;!function(e){e.Default=[-100,0],e.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]}}(dM||(dM={}));class cM{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}function uM(e,t,i,n,s,o,r=cM.default){const a=e.length>128?128:e.length,l=n.length>128?128:n.length;if(i>=a||o>=l||a-i>l-o)return;if(!function(e,t,i,n,s,o,r=!1){for(;t<i&&s<o;)e[t]===n[s]&&(r&&(iM[t]=s),t+=1),s+=1;return t===i}(t,i,a,s,o,l,!0))return;!function(e,t,i,n,s,o){let r=e-1,a=t-1;for(;r>=i&&a>=n;)s[r]===o[a]&&(nM[r]=a,r--),a--}(a,l,i,o,t,s);let h=1,d=1,c=i,u=o;const g=[!1];for(h=1,c=i;c<a;h++,c++){const r=iM[c],m=nM[c],f=c+1<a?nM[c+1]:l;for(d=r-o+1,u=r;u<f;d++,u++){let a=Number.MIN_SAFE_INTEGER,f=!1;u<=m&&(a=gM(e,t,c,i,n,s,u,l,o,0===sM[h-1][d-1],g));let p=0;a!==Number.MAX_SAFE_INTEGER&&(f=!0,p=a+oM[h-1][d-1]);const _=u>r,v=_?oM[h][d-1]+(sM[h][d-1]>0?-5:0):0,b=u>r+1&&sM[h][d-1]>0,C=b?oM[h][d-2]+(sM[h][d-2]>0?-5:0):0;if(b&&(!_||C>=v)&&(!f||C>=p))oM[h][d]=C,rM[h][d]=3,sM[h][d]=0;else if(_&&(!f||v>=p))oM[h][d]=v,rM[h][d]=2,sM[h][d]=0;else{if(!f)throw new Error("not possible");oM[h][d]=p,rM[h][d]=1,sM[h][d]=sM[h-1][d-1]+1}}}if(!g[0]&&!r.firstMatchCanBeWeak)return;h--,d--;const m=[oM[h][d],o];let f=0,p=0;for(;h>=1;){let e=d;do{const t=rM[h][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);f>1&&t[i+h-1]===s[o+d-1]&&!hM(e+o-1,n,s)&&f+1>sM[h][e]&&(e=d),e===d?f++:f=1,p||(p=e),h--,d=e-1,m.push(d)}l===a&&r.boostFullMatch&&(m[0]+=2);const _=p-a;return m[0]-=_,m}function gM(e,t,i,n,s,o,r,a,l,h,d){if(t[i]!==o[r])return Number.MIN_SAFE_INTEGER;let c=1,u=!1;return r===i-n?c=e[i]===s[r]?7:5:!hM(r,s,o)||0!==r&&hM(r-1,s,o)?!aM(o,r)||0!==r&&aM(o,r-1)?(aM(o,r-1)||lM(o,r-1))&&(c=5,u=!0):c=5:(c=e[i]===s[r]?7:5,u=!0),c>1&&i===n&&(d[0]=!0),u||(u=hM(r,s,o)||aM(o,r-1)||lM(o,r-1)),i===n?r>l&&(c-=u?3:5):c+=h?u?2:0:u?0:1,r+1===a&&(c-=u?3:5),c}cM.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};const mM=new RegExp(`\\$\\(${Ml.iconNameExpression}(?:${Ml.iconModifierExpression})?\\)`,"g"),fM=new RegExp("(\\\\)?"+mM.source,"g");const pM=new RegExp("\\\\"+mM.source,"g");const _M=new RegExp(`(\\s)?(\\\\)?${mM.source}(\\s)?`,"g");function vM(e){return-1===e.indexOf("$(")?e:e.replace(_M,(e,t,i,n)=>i?e:t||n||"")}const bM=new RegExp(`\\$\\(${Ml.iconNameCharacter}+\\)`,"g");function CM(e){bM.lastIndex=0;let t="";const i=[];let n=0;for(;;){const s=bM.lastIndex,o=bM.exec(e),r=e.substring(s,null==o?void 0:o.index);if(r.length>0){t+=r;for(let e=0;e<r.length;e++)i.push(n)}if(!o)break;n+=o[0].length}return{text:t,iconOffsets:i}}function wM(e,t,i=!1){const{text:n,iconOffsets:s}=t;if(!s||0===s.length)return XT(e,n,i);const o=jn(n," "),r=n.length-o.length,a=XT(e,o,i);if(a)for(const e of a){const t=s[e.start+r]+r;e.start+=t,e.end+=t}return a}class yM{constructor(e="",t=!1){var i,n,s;if(this.value=e,"string"!=typeof this.value)throw Ke("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=null!==(i=t.isTrusted)&&void 0!==i?i:void 0,this.supportThemeIcons=null!==(n=t.supportThemeIcons)&&void 0!==n&&n,this.supportHtml=null!==(s=t.supportHtml)&&void 0!==s&&s)}appendText(e,t=0){var i;return this.value+=function(e){return e.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}(this.supportThemeIcons?(i=e,i.replace(fM,(e,t)=>t?e:"\\"+e)):e).replace(/([ \t]+)/g,(e,t)=>"&nbsp;".repeat(t.length)).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`\n${function(e,t){var i,n;const s=null!==(n=null===(i=e.match(/^`+/gm))||void 0===i?void 0:i.reduce((e,t)=>e.length>t.length?e:t).length)&&void 0!==n?n:0,o=s>=3?s+1:3;return[`${"`".repeat(o)}${t}`,e,""+"`".repeat(o)].join("\n")}(t,e)}\n`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Un(t),"g");return e.replace(i,(t,i)=>"\\"!==e.charAt(i-1)?"\\"+t:t)}}function SM(e){return e instanceof yM||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&"object"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons)}function LM(e){return e.replace(/"/g,"&quot;")}function kM(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1"):e}class DM{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const xM=new DM("id#");let EM={};!function(){function t(e,t){t(EM)}var i,n;t.amd=!0,i=this,n=function(e){function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var s=0;return function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};var o=/[&<>"']/,r=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},d=function(e){return h[e]};function c(e,t){if(t){if(o.test(e))return e.replace(r,d)}else if(a.test(e))return e.replace(l,d);return e}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var m=/(^|[^\[])\^/g;function f(e,t){e="string"==typeof e?e:e.source,t=t||"";var i={replace:function(t,n){return n=(n=n.source||n).replace(m,"$1"),e=e.replace(t,n),i},getRegex:function(){return new RegExp(e,t)}};return i}var p=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(e,t,i){if(e){var n;try{n=decodeURIComponent(g(i)).replace(p,"").toLowerCase()}catch(e){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}t&&!_.test(i)&&(i=function(e,t){b[" "+e]||(C.test(e)?b[" "+e]=e+"/":b[" "+e]=D(e,"/",!0));var i=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(w,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(y,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}var b={},C=/^[^:]+:\/*[^/]*$/,w=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/,S={exec:function(){}};function L(e){for(var t,i,n=1;n<arguments.length;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}function k(e,t){var i=e.replace(/\|/g,(function(e,t,i){for(var n=!1,s=t;--s>=0&&"\\"===i[s];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function D(e,t,i){var n=e.length;if(0===n)return"";for(var s=0;s<n;){var o=e.charAt(n-s-1);if(o!==t||i){if(o===t||!i)break;s++}else s++}return e.slice(0,n-s)}function x(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function E(e,t){if(t<1)return"";for(var i="";t>1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function N(e,t,i,n){var s=t.href,o=t.title?c(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;var a={type:"link",raw:i,href:s,title:o,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,a}return{type:"image",raw:i,href:s,title:o,text:c(r)}}var I=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.space=function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}},i.code=function(e){var t=this.rules.block.code.exec(e);if(t){var i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:D(i,"\n")}}},i.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var i=t[0],n=function(e,t){var i=e.match(/^(\s+)(?:```)/);if(null===i)return t;var n=i[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=n.length?e.slice(n.length):e})).join("\n")}(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}},i.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var i=t[2].trim();if(/#$/.test(i)){var n=D(i,"#");this.options.pedantic?i=n.trim():n&&!/ $/.test(n)||(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}},i.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},i.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var i=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}},i.list=function(e){var t=this.rules.block.list.exec(e);if(t){var i,s,o,r,a,l,h,d,c,u,g,m,f=t[1].trim(),p=f.length>1,_={type:"list",raw:"",ordered:p,start:p?+f.slice(0,-1):"",loose:!1,items:[]};f=p?"\\d{1,9}\\"+f.slice(-1):"\\"+f,this.options.pedantic&&(f=p?f:"[*+-]");for(var v=new RegExp("^( {0,3}"+f+")((?:[\t ][^\\n]*)?(?:\\n|$))");e&&(m=!1,t=v.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),d=t[2].split("\n",1)[0],c=e.split("\n",1)[0],this.options.pedantic?(r=2,g=d.trimLeft()):(r=(r=t[2].search(/[^ ]/))>4?1:r,g=d.slice(r),r+=t[1].length),l=!1,!d&&/^ *$/.test(c)&&(i+=c+"\n",e=e.substring(c.length+1),m=!0),!m)for(var b=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),C=new RegExp("^ {0,"+Math.min(3,r-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),w=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:```|~~~)"),y=new RegExp("^ {0,"+Math.min(3,r-1)+"}#");e&&(d=u=e.split("\n",1)[0],this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!w.test(d))&&!y.test(d)&&!b.test(d)&&!C.test(e);){if(d.search(/[^ ]/)>=r||!d.trim())g+="\n"+d.slice(r);else{if(l)break;g+="\n"+d}l||d.trim()||(l=!0),i+=u+"\n",e=e.substring(u.length+1)}_.loose||(h?_.loose=!0:/\n *\n *$/.test(i)&&(h=!0)),this.options.gfm&&(s=/^\[[ xX]\] /.exec(g))&&(o="[ ] "!==s[0],g=g.replace(/^\[[ xX]\] +/,"")),_.items.push({type:"list_item",raw:i,task:!!s,checked:o,loose:!1,text:g}),_.raw+=i}_.items[_.items.length-1].raw=i.trimRight(),_.items[_.items.length-1].text=g.trimRight(),_.raw=_.raw.trimRight();var S=_.items.length;for(a=0;a<S;a++){this.lexer.state.top=!1,_.items[a].tokens=this.lexer.blockTokens(_.items[a].text,[]);var L=_.items[a].tokens.filter((function(e){return"space"===e.type})),k=L.every((function(e){for(var t,i=0,s=n(e.raw.split(""));!(t=s()).done;)if("\n"===t.value&&(i+=1),i>1)return!0;return!1}));!_.loose&&L.length&&k&&(_.loose=!0,_.items[a].loose=!0)}return _}},i.html=function(e){var t=this.rules.block.html.exec(e);if(t){var i={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){var n=this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]);i.type="paragraph",i.text=n,i.tokens=this.lexer.inline(n)}return i}},i.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},i.table=function(e){var t=this.rules.block.table.exec(e);if(t){var i={type:"table",header:k(t[1]).map((function(e){return{text:e}})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=t[0];var n,s,o,r,a=i.align.length;for(n=0;n<a;n++)/^ *-+: *$/.test(i.align[n])?i.align[n]="right":/^ *:-+: *$/.test(i.align[n])?i.align[n]="center":/^ *:-+ *$/.test(i.align[n])?i.align[n]="left":i.align[n]=null;for(a=i.rows.length,n=0;n<a;n++)i.rows[n]=k(i.rows[n],i.header.length).map((function(e){return{text:e}}));for(a=i.header.length,s=0;s<a;s++)i.header[s].tokens=this.lexer.inline(i.header[s].text);for(a=i.rows.length,s=0;s<a;s++)for(r=i.rows[s],o=0;o<r.length;o++)r[o].tokens=this.lexer.inline(r[o].text);return i}}},i.lheading=function(e){var 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])}},i.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t){var i="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}},i.text=function(e){var t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}},i.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:c(t[1])}},i.tag=function(e){var 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:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]):t[0]}},i.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var i=t[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;var n=D(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var s=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var i=e.length,n=0,s=0;s<i;s++)if("\\"===e[s])s++;else if(e[s]===t[0])n++;else if(e[s]===t[1]&&--n<0)return s;return-1}(t[2],"()");if(s>-1){var o=(0===t[0].indexOf("!")?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}var r=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(i)?r.slice(1):r.slice(1,-1)),N(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}},i.reflink=function(e,t){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return N(i,n,i[0],this.lexer)}},i.emStrong=function(e,t,i){void 0===i&&(i="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!i.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var s=n[1]||n[2]||"";if(!s||s&&(""===i||this.rules.inline.punctuation.exec(i))){var o,r,a=n[0].length-1,l=a,h=0,d="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+a);null!=(n=d.exec(t));)if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])if(r=o.length,n[3]||n[4])l+=r;else if(!((n[5]||n[6])&&a%3)||(a+r)%3){if(!((l-=r)>0)){if(r=Math.min(r,r+l+h),Math.min(a,r)%2){var c=e.slice(1,a+n.index+r);return{type:"em",raw:e.slice(0,a+n.index+r+1),text:c,tokens:this.lexer.inlineTokens(c)}}var u=e.slice(2,a+n.index+r-1);return{type:"strong",raw:e.slice(0,a+n.index+r+1),text:u,tokens:this.lexer.inlineTokens(u)}}}else h+=r}}},i.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return n&&s&&(i=i.substring(1,i.length-1)),i=c(i,!0),{type:"codespan",raw:t[0],text:i}}},i.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},i.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}},i.autolink=function(e,t){var i,n,s=this.rules.inline.autolink.exec(e);if(s)return n="@"===s[2]?"mailto:"+(i=c(this.options.mangle?t(s[1]):s[1])):i=c(s[1]),{type:"link",raw:s[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},i.url=function(e,t){var i;if(i=this.rules.inline.url.exec(e)){var n,s;if("@"===i[2])s="mailto:"+(n=c(this.options.mangle?t(i[0]):i[0]));else{var o;do{o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(o!==i[0]);n=c(i[0]),s="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}},i.inlineText=function(e,t){var i,n=this.rules.inline.text.exec(e);if(n)return i=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):c(n[0]):n[0]:c(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:i}},t}(),T={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {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|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:S,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};T.def=f(T.def).replace("label",T._label).replace("title",T._title).getRegex(),T.bullet=/(?:[*+-]|\d{1,9}[.)])/,T.listItemStart=f(/^( *)(bull) */).replace("bull",T.bullet).getRegex(),T.list=f(T.list).replace(/bull/g,T.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+T.def.source+")").getRegex(),T._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",T._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,T.html=f(T.html,"i").replace("comment",T._comment).replace("tag",T._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),T.paragraph=f(T._paragraph).replace("hr",T.hr).replace("heading"," {0,3}#{1,6} ").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",T._tag).getRegex(),T.blockquote=f(T.blockquote).replace("paragraph",T.paragraph).getRegex(),T.normal=L({},T),T.gfm=L({},T.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),T.gfm.table=f(T.gfm.table).replace("hr",T.hr).replace("heading"," {0,3}#{1,6} ").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",T._tag).getRegex(),T.gfm.paragraph=f(T._paragraph).replace("hr",T.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",T.gfm.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",T._tag).getRegex(),T.pedantic=L({},T.normal,{html:f("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",T._comment).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:S,paragraph:f(T.normal._paragraph).replace("hr",T.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",T.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var M={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:S,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:S,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function A(e){return e.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function O(e){var t,i,n="",s=e.length;for(t=0;t<s;t++)i=e.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}M._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",M.punctuation=f(M.punctuation).replace(/punctuation/g,M._punctuation).getRegex(),M.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,M.escapedEmSt=/\\\*|\\_/g,M._comment=f(T._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),M.emStrong.lDelim=f(M.emStrong.lDelim).replace(/punct/g,M._punctuation).getRegex(),M.emStrong.rDelimAst=f(M.emStrong.rDelimAst,"g").replace(/punct/g,M._punctuation).getRegex(),M.emStrong.rDelimUnd=f(M.emStrong.rDelimUnd,"g").replace(/punct/g,M._punctuation).getRegex(),M._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,M._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,M._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])?)+(?![-_])/,M.autolink=f(M.autolink).replace("scheme",M._scheme).replace("email",M._email).getRegex(),M._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,M.tag=f(M.tag).replace("comment",M._comment).replace("attribute",M._attribute).getRegex(),M._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,M._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,M._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,M.link=f(M.link).replace("label",M._label).replace("href",M._href).replace("title",M._title).getRegex(),M.reflink=f(M.reflink).replace("label",M._label).replace("ref",T._label).getRegex(),M.nolink=f(M.nolink).replace("ref",T._label).getRegex(),M.reflinkSearch=f(M.reflinkSearch,"g").replace("reflink",M.reflink).replace("nolink",M.nolink).getRegex(),M.normal=L({},M),M.pedantic=L({},M.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",M._label).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",M._label).getRegex()}),M.gfm=L({},M.normal,{escape:f(M.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),M.gfm.url=f(M.gfm.url,"i").replace("email",M.gfm._extended_email).getRegex(),M.breaks=L({},M.gfm,{br:f(M.br).replace("{2,}","*").getRegex(),text:f(M.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var R=function(){function i(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new I,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var i={block:T.normal,inline:M.normal};this.options.pedantic?(i.block=T.pedantic,i.inline=M.pedantic):this.options.gfm&&(i.block=T.gfm,this.options.breaks?i.inline=M.breaks:i.inline=M.gfm),this.tokenizer.rules=i}i.lex=function(e,t){return new i(t).lex(e)},i.lexInline=function(e,t){return new i(t).inlineTokens(e)};var n,s,o,r=i.prototype;return r.lex=function(e){var t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens},r.blockTokens=function(e,t){var i,n,s,o,r=this;for(void 0===t&&(t=[]),e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,(function(e,t,i){return t+" ".repeat(i.length)}));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(n){return!!(i=n.call({lexer:r},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?t.push(i):(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(s=e,this.options.extensions&&this.options.extensions.startBlock&&function(){var t=1/0,i=e.slice(1),n=void 0;r.options.extensions.startBlock.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),this.state.top&&(i=this.tokenizer.paragraph(s)))n=t[t.length-1],o&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),o=s.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);else if(e){var a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return this.state.top=!0,t},r.inline=function(e,t){return void 0===t&&(t=[]),this.inlineQueue.push({src:e,tokens:t}),t},r.inlineTokens=function(e,t){var i,n,s,o=this;void 0===t&&(t=[]);var r,a,l,h=e;if(this.tokens.links){var d=Object.keys(this.tokens.links);if(d.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,r.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(l=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(i=n.call({lexer:o},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,h,l))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,O))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,O))){if(s=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,i=e.slice(1),n=void 0;o.options.extensions.startInline.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),i=this.tokenizer.inlineText(s,A))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(l=i.raw.slice(-1)),a=!0,(n=t[t.length-1])&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(i.raw.length),t.push(i);return t},n=i,o=[{key:"rules",get:function(){return{block:T,inline:M}}}],(s=null)&&t(n.prototype,s),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),i}(),P=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.code=function(e,t,i){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var s=this.options.highlight(e,n);null!=s&&s!==e&&(i=!0,e=s)}return e=e.replace(/\n$/,"")+"\n",n?'<pre><code class="'+this.options.langPrefix+c(n,!0)+'">'+(i?e:c(e,!0))+"</code></pre>\n":"<pre><code>"+(i?e:c(e,!0))+"</code></pre>\n"},i.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.html=function(e){return e},i.heading=function(e,t,i,n){return this.options.headerIds?"<h"+t+' id="'+(this.options.headerPrefix+n.slug(i))+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.list=function(e,t,i){var n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"</"+n+">\n"},i.listitem=function(e){return"<li>"+e+"</li>\n"},i.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},i.paragraph=function(e){return"<p>"+e+"</p>\n"},i.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},i.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"</"+i+">\n"},i.strong=function(e){return"<strong>"+e+"</strong>"},i.em=function(e){return"<em>"+e+"</em>"},i.codespan=function(e){return"<code>"+e+"</code>"},i.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.del=function(e){return"<del>"+e+"</del>"},i.link=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='<a href="'+c(e)+'"';return t&&(n+=' title="'+t+'"'),n+=">"+i+"</a>"},i.image=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='<img src="'+e+'" alt="'+i+'"';return t&&(n+=' title="'+t+'"'),n+=this.options.xhtml?"/>":">"},i.text=function(e){return e},t}(),F=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),B=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{i=e+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i},t.slug=function(e,t){void 0===t&&(t={});var i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)},e}(),W=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new F,this.slugger=new B}t.parse=function(e,i){return new t(i).parse(e)},t.parseInline=function(e,i){return new t(i).parseInline(e)};var i=t.prototype;return i.parse=function(e,t){void 0===t&&(t=!0);var i,n,s,o,r,a,l,h,d,c,u,m,f,p,_,v,b,C,w,y="",S=e.length;for(i=0;i<S;i++)if(c=e[i],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[c.type])||!1===(w=this.options.extensions.renderers[c.type].call({parser:this},c))&&["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type))switch(c.type){case"space":continue;case"hr":y+=this.renderer.hr();continue;case"heading":y+=this.renderer.heading(this.parseInline(c.tokens),c.depth,g(this.parseInline(c.tokens,this.textRenderer)),this.slugger);continue;case"code":y+=this.renderer.code(c.text,c.lang,c.escaped);continue;case"table":for(h="",l="",o=c.header.length,n=0;n<o;n++)l+=this.renderer.tablecell(this.parseInline(c.header[n].tokens),{header:!0,align:c.align[n]});for(h+=this.renderer.tablerow(l),d="",o=c.rows.length,n=0;n<o;n++){for(l="",r=(a=c.rows[n]).length,s=0;s<r;s++)l+=this.renderer.tablecell(this.parseInline(a[s].tokens),{header:!1,align:c.align[s]});d+=this.renderer.tablerow(l)}y+=this.renderer.table(h,d);continue;case"blockquote":d=this.parse(c.tokens),y+=this.renderer.blockquote(d);continue;case"list":for(u=c.ordered,m=c.start,f=c.loose,o=c.items.length,d="",n=0;n<o;n++)v=(_=c.items[n]).checked,b=_.task,p="",_.task&&(C=this.renderer.checkbox(v),f?_.tokens.length>0&&"paragraph"===_.tokens[0].type?(_.tokens[0].text=C+" "+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&"text"===_.tokens[0].tokens[0].type&&(_.tokens[0].tokens[0].text=C+" "+_.tokens[0].tokens[0].text)):_.tokens.unshift({type:"text",text:C}):p+=C),p+=this.parse(_.tokens,f),d+=this.renderer.listitem(p,b,v);y+=this.renderer.list(d,u,m);continue;case"html":y+=this.renderer.html(c.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(c.tokens));continue;case"text":for(d=c.tokens?this.parseInline(c.tokens):c.text;i+1<S&&"text"===e[i+1].type;)d+="\n"+((c=e[++i]).tokens?this.parseInline(c.tokens):c.text);y+=t?this.renderer.paragraph(d):d;continue;default:var L='Token with "'+c.type+'" type was not found.';if(this.options.silent)return void console.error(L);throw new Error(L)}else y+=w||"";return y},i.parseInline=function(e,t){t=t||this.renderer;var i,n,s,o="",r=e.length;for(i=0;i<r;i++)if(n=e[i],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type])||!1===(s=this.options.extensions.renderers[n.type].call({parser:this},n))&&["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type))switch(n.type){case"escape":o+=t.text(n.text);break;case"html":o+=t.html(n.text);break;case"link":o+=t.link(n.href,n.title,this.parseInline(n.tokens,t));break;case"image":o+=t.image(n.href,n.title,n.text);break;case"strong":o+=t.strong(this.parseInline(n.tokens,t));break;case"em":o+=t.em(this.parseInline(n.tokens,t));break;case"codespan":o+=t.codespan(n.text);break;case"br":o+=t.br();break;case"del":o+=t.del(this.parseInline(n.tokens,t));break;case"text":o+=t.text(n.text);break;default:var a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}else o+=s||"";return o},t}();function V(e,t,i){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(i=t,t=null),x(t=L({},V.defaults,t||{})),i){var n,s=t.highlight;try{n=R.lex(e,t)}catch(e){return i(e)}var o=function(e){var o;if(!e)try{t.walkTokens&&V.walkTokens(n,t.walkTokens),o=W.parse(n,t)}catch(t){e=t}return t.highlight=s,e?i(e):i(null,o)};if(!s||s.length<3)return o();if(delete t.highlight,!n.length)return o();var r=0;return V.walkTokens(n,(function(e){"code"===e.type&&(r++,setTimeout((function(){s(e.text,e.lang,(function(t,i){if(t)return o(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),0==--r&&o()}))}),0))})),void(0===r&&o())}function a(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+c(e.message+"",!0)+"</pre>";throw e}try{var l=R.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(V.walkTokens(l,t.walkTokens)).then((function(){return W.parse(l,t)})).catch(a);V.walkTokens(l,t.walkTokens)}return W.parse(l,t)}catch(e){a(e)}}V.options=V.setOptions=function(t){var i;return L(V.defaults,t),i=V.defaults,e.defaults=i,V},V.getDefaults=s,V.defaults=e.defaults,V.use=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var n,s=L.apply(void 0,[{}].concat(t)),o=V.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((function(e){if(e.extensions&&(n=!0,e.extensions.forEach((function(e){if(!e.name)throw new Error("extension name required");if(e.renderer){var t=o.renderers?o.renderers[e.name]:null;o.renderers[e.name]=t?function(){for(var i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];var o=e.renderer.apply(this,n);return!1===o&&(o=t.apply(this,n)),o}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");o[e.level]?o[e.level].unshift(e.tokenizer):o[e.level]=[e.tokenizer],e.start&&("block"===e.level?o.startBlock?o.startBlock.push(e.start):o.startBlock=[e.start]:"inline"===e.level&&(o.startInline?o.startInline.push(e.start):o.startInline=[e.start]))}e.childTokens&&(o.childTokens[e.name]=e.childTokens)}))),e.renderer&&function(){var t=V.defaults.renderer||new P,i=function(i){var n=t[i];t[i]=function(){for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];var a=e.renderer[i].apply(t,o);return!1===a&&(a=n.apply(t,o)),a}};for(var n in e.renderer)i(n);s.renderer=t}(),e.tokenizer&&function(){var t=V.defaults.tokenizer||new I,i=function(i){var n=t[i];t[i]=function(){for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];var a=e.tokenizer[i].apply(t,o);return!1===a&&(a=n.apply(t,o)),a}};for(var n in e.tokenizer)i(n);s.tokenizer=t}(),e.walkTokens){var t=V.defaults.walkTokens;s.walkTokens=function(i){var n=[];return n.push(e.walkTokens.call(this,i)),t&&(n=n.concat(t.call(this,i))),n}}n&&(s.extensions=o),V.setOptions(s)}))},V.walkTokens=function(e,t){for(var i,s=[],o=function(){var e=i.value;switch(s=s.concat(t.call(V,e)),e.type){case"table":for(var o,r=n(e.header);!(o=r()).done;){var a=o.value;s=s.concat(V.walkTokens(a.tokens,t))}for(var l,h=n(e.rows);!(l=h()).done;)for(var d,c=n(l.value);!(d=c()).done;){var u=d.value;s=s.concat(V.walkTokens(u.tokens,t))}break;case"list":s=s.concat(V.walkTokens(e.items,t));break;default:V.defaults.extensions&&V.defaults.extensions.childTokens&&V.defaults.extensions.childTokens[e.type]?V.defaults.extensions.childTokens[e.type].forEach((function(i){s=s.concat(V.walkTokens(e[i],t))})):e.tokens&&(s=s.concat(V.walkTokens(e.tokens,t)))}},r=n(e);!(i=r()).done;)o();return s},V.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");x(t=L({},V.defaults,t||{}));try{var i=R.lexInline(e,t);return t.walkTokens&&V.walkTokens(i,t.walkTokens),W.parseInline(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+c(e.message+"",!0)+"</pre>";throw e}},V.Parser=W,V.parser=W.parse,V.Renderer=P,V.TextRenderer=F,V.Lexer=R,V.lexer=R.lex,V.Tokenizer=I,V.Slugger=B,V.parse=V;var H=V.options,z=V.setOptions,K=V.use,U=V.walkTokens,j=V.parseInline,q=V,$=W.parse,G=R.lex;e.Lexer=R,e.Parser=W,e.Renderer=P,e.Slugger=B,e.TextRenderer=F,e.Tokenizer=I,e.getDefaults=s,e.lexer=G,e.marked=V,e.options=H,e.parse=q,e.parseInline=j,e.parser=$,e.setOptions=z,e.use=K,e.walkTokens=U,Object.defineProperty(e,"__esModule",{value:!0})},t.amd?t(0,n):"object"==typeof exports&&void 0!==e?n(exports):n((i="undefined"!=typeof globalThis?globalThis:i||self).marked={})}();EM.Lexer||exports.Lexer,EM.Parser||exports.Parser,EM.Renderer||exports.Renderer,EM.Slugger||exports.Slugger,EM.TextRenderer||exports.TextRenderer,EM.Tokenizer||exports.Tokenizer,EM.getDefaults||exports.getDefaults,EM.lexer||exports.lexer;var NM=EM.marked||exports.marked;EM.options||exports.options,EM.parse||exports.parse,EM.parseInline||exports.parseInline,EM.parser||exports.parser,EM.setOptions||exports.setOptions,EM.use||exports.use,EM.walkTokens||exports.walkTokens;function IM(e){let t=JSON.parse(e);return t=function e(t,i=0){if(!t||i>200)return t;if("object"==typeof t){switch(t.$mid){case 1:return di.revive(t);case 2:return new RegExp(t.source,t.flags);case 17:return new Date(t.source)}if(t instanceof Td.a||t instanceof Uint8Array)return t;if(Array.isArray(t))for(let n=0;n<t.length;++n)t[n]=e(t[n],i+1);else for(const n in t)Object.hasOwnProperty.call(t,n)&&(t[n]=e(t[n],i+1))}return t}(t),t}function TM(e,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}const MM=Object.freeze({image:(e,t,i)=>{let n=[],s=[];return e&&(({href:e,dimensions:n}=function(e){const t=[],i=e.split("|").map(e=>e.trim());e=i[0];const n=i[1];if(n){const e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),s=e?e[1]:"",o=i?i[1]:"",r=isFinite(parseInt(o)),a=isFinite(parseInt(s));r&&t.push(`width="${o}"`),a&&t.push(`height="${s}"`)}return{href:e,dimensions:t}}(e)),s.push(`src="${LM(e)}"`)),i&&s.push(`alt="${LM(i)}"`),t&&s.push(`title="${LM(t)}"`),n.length&&(s=s.concat(n)),"<img "+s.join(" ")+">"},paragraph:e=>`<p>${e}</p>`,link:(e,t,i)=>"string"!=typeof e?"":(e===i&&(i=kM(i)),t="string"==typeof t?LM(kM(t)):"",`<a href="${e=(e=kM(e)).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}" title="${t||e}" draggable="false">${i}</a>`)});function AM(e,t={},i={}){var n,s;const o=new nt;let r=!1;const a=IT(t),l=function(t){let i;try{i=IM(decodeURIComponent(t))}catch(e){}return i?(i=V(i,t=>e.uris&&e.uris[t]?di.revive(e.uris[t]):void 0),encodeURIComponent(JSON.stringify(i))):t},h=function(t,i){const n=e.uris&&e.uris[t];let s=di.revive(n);return i?t.startsWith(wr.data+":")?t:(s||(s=di.parse(t)),Dr.uriToBrowserUri(s).toString(!0)):s?di.parse(t).toString()===s.toString()?t:(s.query&&(s=s.with({query:l(s.query)})),s.toString()):t},d=new NM.Renderer;d.image=MM.image,d.link=MM.link,d.paragraph=MM.paragraph;const c=[],u=[];if(t.codeBlockRendererSync?d.code=(e,i)=>{const n=xM.nextId(),s=t.codeBlockRendererSync(OM(i),e);return u.push([n,s]),`<div class="code" data-code="${n}">${Kn(e)}</div>`}:t.codeBlockRenderer&&(d.code=(e,i)=>{const n=xM.nextId(),s=t.codeBlockRenderer(OM(i),e);return c.push(s.then(e=>[n,e])),`<div class="code" data-code="${n}">${Kn(e)}</div>`}),t.actionHandler){const i=function(i){let n=i.target;if("A"===n.tagName||(n=n.parentElement,n&&"A"===n.tagName))try{let s=n.dataset.href;s&&(e.baseUri&&(s=RM(di.from(e.baseUri),s)),t.actionHandler.callback(s,i))}catch(e){Be(e)}finally{i.preventDefault()}},n=t.actionHandler.disposables.add(new dC(a,"click")),s=t.actionHandler.disposables.add(new dC(a,"auxclick"));t.actionHandler.disposables.add(dt.any(n.event,s.event)(e=>{const t=new to(Fr(a),e);(t.leftButton||t.middleButton)&&i(t)})),t.actionHandler.disposables.add(Zr(a,"keydown",e=>{const t=new Xs(e);(t.equals(10)||t.equals(3))&&i(t)}))}e.supportHtml||(i.sanitizer=t=>(e.isTrusted?t.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?t:"",i.sanitize=!0,i.silent=!0),i.renderer=d;let g=null!==(n=e.value)&&void 0!==n?n:"";let m;if(g.length>1e5&&(g=g.substr(0,1e5)+"…"),e.supportThemeIcons&&(g=g.replace(pM,e=>"\\"+e)),t.fillInIncompleteTokens){const e={...NM.defaults,...i},t=function(e){let t,i;for(t=0;t<e.length;t++){const n=e[t];let s;if("paragraph"===n.type&&(s=n.raw.match(/(\n|^)(````*)/))){const n=s[2];i=UM(e.slice(t),n);break}if("paragraph"===n.type&&n.raw.match(/(\n|^)\|/)){i=JM(e.slice(t));break}if(t===e.length-1&&"paragraph"===n.type){const e=zM(n);if(e){i=[e];break}}}if(i){const n=[...e.slice(0,t),...i];return n.links=e.links,n}return e}(NM.lexer(g,e));m=NM.parser(t,e)}else m=NM.parse(g,i);if(e.supportThemeIcons){m=OT(m).map(e=>"string"==typeof e?e:e.outerHTML).join("")}const f=(new DOMParser).parseFromString(PM(e,m),"text/html");if(f.body.querySelectorAll("img").forEach(t=>{const i=t.getAttribute("src");if(i){let n=i;try{e.baseUri&&(n=RM(di.from(e.baseUri),n))}catch(e){}t.src=h(n,!0)}}),f.body.querySelectorAll("a").forEach(t=>{const i=t.getAttribute("href");if(t.setAttribute("href",""),!i||/^data:|javascript:/i.test(i)||/^command:/i.test(i)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(i))t.replaceWith(...t.childNodes);else{let n=h(i,!1);e.baseUri&&(n=RM(di.from(e.baseUri),i)),t.dataset.href=n}}),a.innerHTML=PM(e,f.body.innerHTML),c.length>0)Promise.all(c).then(e=>{var i,n;if(r)return;const s=new Map(e),o=a.querySelectorAll("div[data-code]");for(const e of o){const t=s.get(null!==(i=e.dataset.code)&&void 0!==i?i:"");t&&Wa(e,t)}null===(n=t.asyncRenderCallback)||void 0===n||n.call(t)});else if(u.length>0){const e=new Map(u),t=a.querySelectorAll("div[data-code]");for(const i of t){const t=e.get(null!==(s=i.dataset.code)&&void 0!==s?s:"");t&&Wa(i,t)}}if(t.asyncRenderCallback)for(const e of a.getElementsByTagName("img")){const i=o.add(Zr(e,"load",()=>{i.dispose(),t.asyncRenderCallback()}))}return{element:a,dispose:()=>{r=!0,o.dispose()}}}function OM(e){if(!e)return"";const t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}function RM(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?aD(e,t).toString():aD(oD(e),t).toString()}function PM(e,t){const{config:i,allowedSchemes:n}=function(e){const t=[wr.http,wr.https,wr.mailto,wr.data,wr.file,wr.vscodeFileResource,wr.vscodeRemote,wr.vscodeRemoteResource];e.isTrusted&&t.push(wr.command);return{config:{ALLOWED_TAGS:[...Qa],ALLOWED_ATTR:FM,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:t}}(e);br("uponSanitizeAttribute",(e,t)=>{var i;if("style"!==t.attrName&&"class"!==t.attrName){if("INPUT"===e.tagName&&"checkbox"===(null===(i=e.attributes.getNamedItem("type"))||void 0===i?void 0:i.value)){if("type"===t.attrName&&"checkbox"===t.attrValue||"disabled"===t.attrName||"checked"===t.attrName)return void(t.keepAttr=!0);t.keepAttr=!1}}else{if("SPAN"===e.tagName){if("style"===t.attrName)return void(t.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(t.attrValue));if("class"===t.attrName)return void(t.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue))}t.keepAttr=!1}}),br("uponSanitizeElement",(e,t)=>{var i,n;"input"===t.tagName&&("checkbox"===(null===(i=e.attributes.getNamedItem("type"))||void 0===i?void 0:i.value)?e.setAttribute("disabled",""):null===(n=e.parentElement)||void 0===n||n.removeChild(e))});const s=function(e,t=!1){const i=document.createElement("a");return br("afterSanitizeAttributes",n=>{for(const s of["href","src"])if(n.hasAttribute(s)){const o=n.getAttribute(s);if("href"===s&&o.startsWith("#"))continue;if(i.href=o,!e.includes(i.protocol.replace(/:$/,""))){if(t&&"src"===s&&i.href.startsWith("data:"))continue;n.removeAttribute(s)}}}),it(()=>{Cr("afterSanitizeAttributes")})}(n);try{return vr(t,{...i,RETURN_TRUSTED_TYPE:!0})}finally{Cr("uponSanitizeAttribute"),s.dispose()}}const FM=["align","autoplay","alt","checked","class","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","src","style","target","title","type","width","start"];function BM(e){return"string"==typeof e?e:function(e){var t;let i=null!==(t=e.value)&&void 0!==t?t:"";i.length>1e5&&(i=i.substr(0,1e5)+"…");return PM({isTrusted:!1},NM.parse(i,{renderer:VM.value}).replace(/&(#\d+|[a-zA-Z]+);/g,e=>{var t;return null!==(t=WM.get(e))&&void 0!==t?t:e})).toString()}(e)}const WM=new Map([["&quot;",'"'],["&nbsp;"," "],["&amp;","&"],["&#39;","'"],["&lt;","<"],["&gt;",">"]]),VM=new Vn.a(()=>{const e=new NM.Renderer;return e.code=e=>e,e.blockquote=e=>e,e.html=e=>"",e.heading=(e,t,i)=>e+"\n",e.hr=()=>"",e.list=(e,t)=>e,e.listitem=e=>e+"\n",e.paragraph=e=>e+"\n",e.table=(e,t)=>e+t+"\n",e.tablerow=e=>e,e.tablecell=(e,t)=>e+" ",e.strong=e=>e,e.em=e=>e,e.codespan=e=>e,e.br=()=>"\n",e.del=e=>e,e.image=(e,t,i)=>"",e.text=e=>e,e.link=(e,t,i)=>i,e});function HM(e){let t="";return e.forEach(e=>{t+=e.raw}),t}function zM(e){var t,i;for(let n=0;n<e.tokens.length;n++){const s=e.tokens[n];if("text"===s.type){const o=s.raw.split("\n"),r=o[o.length-1];if(r.includes("`"))return jM(e);if(r.includes("**"))return XM(e,"**");if(r.match(/\*\w/))return qM(e);if(r.match(/(^|\s)__\w/))return QM(e);if(r.match(/(^|\s)_\w/))return $M(e);if(r.match(/(^|\s)\[.*\]\(\w*/)){const s=e.tokens.slice(n+1);return"link"===(null===(t=s[0])||void 0===t?void 0:t.type)&&"text"===(null===(i=s[1])||void 0===i?void 0:i.type)&&s[1].raw.match(/^ *"[^"]*$/)?ZM(e):GM(e)}if(KM(r))return GM(e);if(r.match(/(^|\s)\[\w/)&&!e.tokens.slice(n+1).some(e=>KM(e.raw)))return YM(e)}}}function KM(e){return!!e.match(/^[^\[]*\]\([^\)]*$/)}function UM(e,t){const i=HM(e);return NM.lexer(i+"\n"+t)}function jM(e){return XM(e,"`")}function qM(e){return XM(e,"*")}function $M(e){return XM(e,"_")}function GM(e){return XM(e,")")}function ZM(e){return XM(e,'")')}function YM(e){return XM(e,"](about:blank)")}function QM(e){return XM(e,"__")}function XM(e,t){const i=HM(Array.isArray(e)?e:[e]);return NM.lexer(i+t)[0]}function JM(e){const t=HM(e),i=t.split("\n");let n,s=!1;for(let e=0;e<i.length;e++){const t=i[e].trim();if(void 0===n&&t.match(/^\s*\|/)){const e=t.match(/(\|[^\|]+)(?=\||$)/g);e&&(n=e.length)}else if("number"==typeof n){if(!t.match(/^\s*\|/))return;if(e!==i.length-1)return;s=!0}}if("number"==typeof n&&n>0){const e=s?i.slice(0,-1).join("\n"):t,o=!!e.match(/\|\s*$/),r=e+(o?"":"|")+"\n|"+" --- |".repeat(n);return NM.lexer(r)}}i("YEdH");var eA,tA=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},iA=function(e,t){return function(i,n){t(i,n,e)}};let nA=eA=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new ft,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e){return{element:document.createElement("span"),dispose:()=>{}}}const n=new nt,s=n.add(AM(e,{...this._getRenderOptions(e,n),...t},i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(e,t)=>{var i,n,s;let o;e?o=this._languageService.getLanguageIdByLanguageName(e):this._options.editor&&(o=null===(i=this._options.editor.getModel())||void 0===i?void 0:i.getLanguageId()),o||(o="plaintext");const r=await async function(e,t,i){if(!i)return oN(t,e.languageIdCodec,nN);const n=await zi.getOrCreate(i);return oN(t,e.languageIdCodec,n||nN)}(this._languageService,t,o),a=document.createElement("span");if(a.innerHTML=null!==(s=null===(n=eA._ttpTokenizer)||void 0===n?void 0:n.createHTML(r))&&void 0!==s?s:r,this._options.editor){hl(a,this._options.editor.getOption(50))}else this._options.codeBlockFontFamily&&(a.style.fontFamily=this._options.codeBlockFontFamily);return void 0!==this._options.codeBlockFontSize&&(a.style.fontSize=this._options.codeBlockFontSize),a},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:t=>sA(this._openerService,t,e.isTrusted),disposables:t}}}};async function sA(e,t,i){try{return await e.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:oA(i)})}catch(e){return Be(e),!1}}function oA(e){return!0===e||!(!e||!Array.isArray(e.enabledCommands))&&e.enabledCommands}nA._ttpTokenizer=bd("tokenizeToString",{createHTML:e=>e}),nA=eA=tA([iA(1,nc),iA(2,ET)],nA);var rA=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},aA=function(e,t){return function(i,n){t(i,n,e)}};const lA=Ka;let hA=class extends Hb{get _targetWindow(){return Fr(this._target.targetElements[0])}get _targetDocumentElement(){return Fr(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return 2===this._hoverPosition?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,n,s,o){var r,a,l,h,d,c,u,g;super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,this._instantiationService=s,this._accessibilityService=o,this._messageListeners=new nt,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new ft),this._onRequestLayout=this._register(new ft),this._linkHandler=e.linkHandler||(t=>sA(this._openerService,t,SM(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new cA(e.target),this._hoverPointer=(null===(r=e.appearance)||void 0===r?void 0:r.showPointer)?lA("div.workbench-hover-pointer"):void 0,this._hover=this._register(new DT),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),(null===(a=e.appearance)||void 0===a?void 0:a.compact)&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),(null===(l=e.appearance)||void 0===l?void 0:l.skipFadeInAnimation)&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),(null===(h=e.position)||void 0===h?void 0:h.forcePosition)&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=null!==(c=null===(d=e.position)||void 0===d?void 0:d.hoverPosition)&&void 0!==c?c:3,this.onmousedown(this._hover.containerDomNode,e=>e.stopPropagation()),this.onkeydown(this._hover.containerDomNode,e=>{e.equals(9)&&this.dispose()}),this._register(Zr(this._targetWindow,"blur",()=>this.dispose()));const m=lA("div.hover-row.markdown-hover"),f=lA("div.hover-contents");if("string"==typeof e.content)f.textContent=e.content,f.style.whiteSpace="pre-wrap";else if(e.content instanceof HTMLElement)f.appendChild(e.content),f.classList.add("html-hover-contents");else{const t=e.content,i=this._instantiationService.createInstance(nA,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||Ae.fontFamily}),{element:n}=i.render(t,{actionHandler:{callback:e=>this._linkHandler(e),disposables:this._messageListeners},asyncRenderCallback:()=>{f.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});f.appendChild(n)}if(m.appendChild(f),this._hover.contentsDomNode.appendChild(m),e.actions&&e.actions.length>0){const t=lA("div.hover-row.status-bar"),i=lA("div.actions");e.actions.forEach(e=>{const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;xT.render(i,{label:e.label,commandId:e.commandId,run:t=>{e.run(t),this.dispose()},iconClass:e.iconClass},n)}),t.appendChild(i),this._hover.containerDomNode.appendChild(t)}let p;if(this._hoverContainer=lA("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode),p=!(e.actions&&e.actions.length>0)&&(void 0===(null===(u=e.persistence)||void 0===u?void 0:u.hideOnHover)?"string"==typeof e.content||SM(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes("</a>"):e.persistence.hideOnHover),p&&(null===(g=e.appearance)||void 0===g?void 0:g.showHoverHint)){const e=lA("div.hover-row.status-bar"),t=lA("div.info");t.textContent=Object(J.b)("hoverhint","Hold {0} key to mouse over",K.i?"Option":"Alt"),e.appendChild(t),this._hover.containerDomNode.appendChild(e)}const _=[...this._target.targetElements];p||_.push(this._hoverContainer);const v=this._register(new dA(_));if(this._register(v.onMouseOut(()=>{this._isLocked||this.dispose()})),p){const e=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new dA(e)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=v}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=Ba(this._hoverContainer,lA("div")),n=Fa(this._hoverContainer,lA("div"));i.tabIndex=0,n.tabIndex=0,this._register(Zr(n,"focus",t=>{e.focus(),t.preventDefault()})),this._register(Zr(i,"focus",e=>{t.focus(),e.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t<e.childNodes.length;t++){const i=e.childNodes.item(e.childNodes.length-t-1);if(i.nodeType===i.ELEMENT_NODE){const e=i;if("number"==typeof e.tabIndex&&e.tabIndex>=0)return e}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){var t;e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&(n=!0===this._configurationService.getValue("accessibility.verbosity.hover")&&this._accessibilityService.isScreenReaderOptimized(),s=null===(t=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))||void 0===t?void 0:t.getAriaLabel(),n&&s?Object(J.b)("acessibleViewHint","Inspect this in the accessible view with {0}.",s):n?Object(J.b)("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):"");var n,s;i&&wf(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=this._target.targetElements.map(e=>(e=>{const t=la(e),i=e.getBoundingClientRect();return{top:i.top*t,bottom:i.bottom*t,right:i.right*t,left:i.left*t}})(e)),t=Math.min(...e.map(e=>e.top)),i=Math.max(...e.map(e=>e.right)),n=Math.max(...e.map(e=>e.bottom)),s=Math.min(...e.map(e=>e.left)),o=i-s,r=n-t,a={top:t,right:i,bottom:n,left:s,width:o,height:r,center:{x:s+o/2,y:t+r/2}};if(this.adjustHorizontalHoverPosition(a),this.adjustVerticalHoverPosition(a),this.adjustHoverMaxHeight(a),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:a.left+=3,a.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:a.left-=3,a.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:a.top+=3,a.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:a.top-=3,a.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px"}a.center.x=a.left+o/2,a.center.y=a.top+r/2}this.computeXCordinate(a),this.computeYCordinate(a),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(a)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;void 0!==this._target.x?this._x=this._target.x:1===this._hoverPosition?this._x=e.right:0===this._hoverPosition?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._x<this._targetDocumentElement.clientLeft&&(this._x=e.left+2)}computeYCordinate(e){void 0!==this._target.y?this._y=this._target.y:3===this._hoverPosition?this._y=e.top:2===this._hoverPosition?this._y=e.bottom-2:this._hoverPointer?this._y=e.center.y+this._hover.containerDomNode.clientHeight/2:this._y=e.bottom,this._y>this._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(void 0===this._target.x)if(this._forcePosition){const t=2+(this._hoverPointer?3:0);1===this._hoverPosition?this._hover.containerDomNode.style.maxWidth=this._targetDocumentElement.clientWidth-e.right-t+"px":0===this._hoverPosition&&(this._hover.containerDomNode.style.maxWidth=e.left-t+"px")}else if(1===this._hoverPosition){if(this._targetDocumentElement.clientWidth-e.right<this._hover.containerDomNode.clientWidth){e.left>=this._hover.containerDomNode.clientWidth?this._hoverPosition=0:this._hoverPosition=2}}else if(0===this._hoverPosition){if(e.left<this._hover.containerDomNode.clientWidth){this._targetDocumentElement.clientWidth-e.right>=this._hover.containerDomNode.clientWidth?this._hoverPosition=1:this._hoverPosition=2}e.left-this._hover.containerDomNode.clientWidth<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1)}}adjustVerticalHoverPosition(e){void 0!==this._target.y||this._forcePosition||(3===this._hoverPosition?e.top-this._hover.containerDomNode.clientHeight<0&&(this._hoverPosition=2):2===this._hoverPosition&&e.bottom+this._hover.containerDomNode.clientHeight>this._targetWindow.innerHeight&&(this._hoverPosition=3))}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=2+(this._hoverPointer?3:0);3===this._hoverPosition?t=Math.min(t,e.top-i):2===this._hoverPosition&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=t+"px",this._hover.contentsDomNode.clientHeight<this._hover.contentsDomNode.scrollHeight){const e=this._hover.scrollbar.options.verticalScrollbarSize+"px";this._hover.contentsDomNode.style.paddingRight!==e&&(this._hover.contentsDomNode.style.paddingRight=e)}}setHoverPointerPosition(e){if(this._hoverPointer)switch(this._hoverPosition){case 0:case 1:{this._hoverPointer.classList.add(0===this._hoverPosition?"right":"left");const t=this._hover.containerDomNode.clientHeight;t>e.height?this._hoverPointer.style.top=e.center.y-(this._y-t)-3+"px":this._hoverPointer.style.top=Math.round(t/2)-3+"px";break}case 3:case 2:{this._hoverPointer.classList.add(3===this._hoverPosition?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-3;const n=this._x+i;(n<e.left||n>e.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=i+"px";break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};hA=rA([aA(1,Iw),aA(2,Xd),aA(3,ET),aA(4,bl),aA(5,Af)],hA);class dA extends Hb{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new ft),this._elements.forEach(e=>this.onmouseover(e,()=>this._onTargetMouseOver(e))),this._elements.forEach(e=>this.onmouseleave(e,()=>this._onTargetMouseLeave(e)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=Fr(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(Fr(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class cA{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var uA=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},gA=function(e,t){return function(i,n){t(i,n,e)}};let mA=class{constructor(e,t,i,n,s,o){this._instantiationService=e,this._contextViewService=t,this._keybindingService=n,this._layoutService=s,this._accessibilityService=o,i.onDidShowContextMenu(()=>this.hideHover())}showHover(e,t,i){var n,s,o,r;if(fA(this._currentHoverOptions)===fA(e))return;if(this._currentHover&&(null===(s=null===(n=this._currentHoverOptions)||void 0===n?void 0:n.persistence)||void 0===s?void 0:s.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const a=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),l=va();i||(this._lastFocusedElementBeforeOpen=a&&l?l:void 0);const h=new nt,d=this._instantiationService.createInstance(hA,e);if((null===(o=e.persistence)||void 0===o?void 0:o.sticky)&&(d.isLocked=!0),d.onDispose(()=>{var t,i;(null===(t=this._currentHover)||void 0===t?void 0:t.domNode)&&Ca(this._currentHover.domNode)&&(null===(i=this._lastFocusedElementBeforeOpen)||void 0===i||i.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),h.dispose()}),!e.container){const t=e.target instanceof HTMLElement?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(Fr(t))}const c=this._contextViewService;if(c.showContextView(new pA(d,t),e.container),d.onRequestLayout(()=>c.layout()),null===(r=e.persistence)||void 0===r?void 0:r.sticky)h.add(Zr(Fr(e.container).document,Ma.MOUSE_DOWN,e=>{ga(e.target,d.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const t of e.target.targetElements)h.add(Zr(t,Ma.CLICK,()=>this.hideHover()));else h.add(Zr(e.target,Ma.CLICK,()=>this.hideHover()));const t=va();if(t){const i=Fr(t).document;h.add(Zr(t,Ma.KEY_DOWN,t=>{var i;return this._keyDown(t,d,!!(null===(i=e.persistence)||void 0===i?void 0:i.hideOnKeyDown))})),h.add(Zr(i,Ma.KEY_DOWN,t=>{var i;return this._keyDown(t,d,!!(null===(i=e.persistence)||void 0===i?void 0:i.hideOnKeyDown))})),h.add(Zr(t,Ma.KEY_UP,e=>this._keyUp(e,d))),h.add(Zr(i,Ma.KEY_UP,e=>this._keyUp(e,d)))}}if("IntersectionObserver"in Pn){const t=new IntersectionObserver(e=>this._intersectionChange(e,d),{threshold:0}),i="targetElements"in e.target?e.target.targetElements[0]:e.target;t.observe(i),h.add(it(()=>t.disconnect()))}return this._currentHover=d,d}hideHover(){var e;!(null===(e=this._currentHover)||void 0===e?void 0:e.isLocked)&&this._currentHoverOptions&&this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewService.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}_keyDown(e,t,i){var n,s;if("Alt"===e.key)return void(t.isLocked=!0);const o=new Xs(e);this._keybindingService.resolveKeyboardEvent(o).getSingleModifierDispatchChords().some(e=>!!e)||0!==this._keybindingService.softDispatch(o,o.target).kind||!i||(null===(n=this._currentHoverOptions)||void 0===n?void 0:n.trapFocus)&&"Tab"===e.key||(this.hideHover(),null===(s=this._lastFocusedElementBeforeOpen)||void 0===s||s.focus())}_keyUp(e,t){var i;"Alt"===e.key&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),null===(i=this._lastFocusedElementBeforeOpen)||void 0===i||i.focus()))}};function fA(e){var t;if(void 0!==e)return null!==(t=null==e?void 0:e.id)&&void 0!==t?t:e}mA=uA([gA(0,bl),gA(1,ST),gA(2,LT),gA(3,Iw),gA(4,cI),gA(5,Af)],mA);class pA{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}rc(wT,mA,1),TC((e,t)=>{const i=e.getColor(u_);i&&(t.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${i.transparent(.5)}; }`))});const _A=wl("IWorkspaceEditService");class vA{constructor(e){this.metadata=e}static convert(e){return e.edits.map(e=>{if(bA.is(e))return bA.lift(e);if(CA.is(e))return CA.lift(e);throw new Error("Unsupported edit")})}}class bA extends vA{static is(e){return e instanceof bA||D(e)&&di.isUri(e.resource)&&D(e.textEdit)}static lift(e){return e instanceof bA?e:new bA(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class CA extends vA{static is(e){return e instanceof CA||D(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof CA?e:new CA(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const wA={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},yA={...Object.freeze({id:"editor",order:5,type:"object",title:J.b("editorConfigurationTitle","Editor"),scope:5}),properties:{"editor.tabSize":{type:"number",default:U.tabSize,minimum:1,markdownDescription:J.b("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:J.b("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:U.insertSpaces,markdownDescription:J.b("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:U.detectIndentation,markdownDescription:J.b("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:U.trimAutoWhitespace,description:J.b("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:U.largeFileOptimizations,description:J.b("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[J.b("wordBasedSuggestions.off","Turn off Word Based Suggestions."),J.b("wordBasedSuggestions.currentDocument","Only suggest words from the active document."),J.b("wordBasedSuggestions.matchingDocuments","Suggest words from all open documents of the same language."),J.b("wordBasedSuggestions.allDocuments","Suggest words from all open documents.")],description:J.b("wordBasedSuggestions","Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[J.b("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),J.b("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),J.b("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:J.b("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:J.b("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:J.b("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:J.b("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:J.b("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:J.b("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:J.b("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:J.b("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:J.b("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:J.b("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:J.b("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:J.b("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:wA.maxComputationTime,description:J.b("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:wA.maxFileSize,description:J.b("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:wA.renderSideBySide,description:J.b("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:wA.renderSideBySideInlineBreakpoint,description:J.b("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:wA.useInlineViewWhenSpaceIsLimited,description:J.b("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:wA.renderMarginRevertIcon,description:J.b("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:wA.ignoreTrimWhitespace,description:J.b("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:wA.renderIndicators,description:J.b("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:wA.diffCodeLens,description:J.b("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:wA.diffWordWrap,markdownEnumDescriptions:[J.b("wordWrap.off","Lines will never wrap."),J.b("wordWrap.on","Lines will wrap at the viewport width."),J.b("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:wA.diffAlgorithm,markdownEnumDescriptions:[J.b("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),J.b("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:wA.hideUnchangedRegions.enabled,markdownDescription:J.b("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:wA.hideUnchangedRegions.revealLineCount,markdownDescription:J.b("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:wA.hideUnchangedRegions.minimumLineCount,markdownDescription:J.b("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:wA.hideUnchangedRegions.contextLineCount,markdownDescription:J.b("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:wA.experimental.showMoves,markdownDescription:J.b("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:wA.experimental.showEmptyDecorations,description:J.b("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};for(const e of Oe){const t=e.schema;if(void 0!==t)if(void 0!==(SA=t).type||void 0!==SA.anyOf)yA.properties["editor."+e.name]=t;else for(const e in t)Object.hasOwnProperty.call(t,e)&&(yA.properties[e]=t[e])}var SA;let LA=null;function kA(){return null===LA&&(LA=Object.create(null),Object.keys(yA.properties).forEach(e=>{LA[e]=!0})),LA}Eh.as(cc).registerConfiguration(yA);class DA{static insert(e,t){return{range:new wi(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function xA(e){return Object.isFrozen(e)?e:function(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const i in e)if(W.call(e,i)){const n=e[i];"object"!=typeof n||Object.isFrozen(n)||x(n)||t.push(n)}}return e}(e)}class EA{constructor(e={},t=[],i=[],n){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(null===(e=this.raw)||void 0===e?void 0:e.length){const e=this.raw.map(e=>{if(e instanceof EA)return e;const t=new NA("");return t.parseRaw(e),t.configurationModel});this._rawConfiguration=e.reduce((e,t)=>t===e?t:e.merge(t),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?ic(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return xA(i.rawConfiguration.getValue(e))},get override(){return t?xA(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return xA(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const t=[];for(const{contents:n,identifiers:s,keys:o}of i.rawConfiguration.overrides){const i=new EA(n,o).getValue(e);void 0!==i&&t.push({identifiers:s,value:i})}return t.length?xA(t):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?ic(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const n=B(this.contents),o=B(this.overrides),r=[...this.keys],a=(null===(t=this.raw)||void 0===t?void 0:t.length)?[...this.raw]:[this];for(const t of e)if(a.push(...(null===(i=t.raw)||void 0===i?void 0:i.length)?t.raw:[t]),!t.isEmpty()){this.mergeContents(n,t.contents);for(const e of t.overrides){const[t]=o.filter(t=>s(t.identifiers,e.identifiers));t?(this.mergeContents(t.contents,e.contents),t.keys.push(...e.keys),t.keys=d(t.keys)):o.push(B(e))}for(const e of t.keys)-1===r.indexOf(e)&&r.push(e)}return new EA(n,r,o,a.every(e=>e instanceof EA)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;const i={};for(const e of d([...Object.keys(this.contents),...Object.keys(t)])){let n=this.contents[e];const s=t[e];s&&("object"==typeof n&&"object"==typeof s?(n=B(n),this.mergeContents(n,s)):n=s),i[e]=n}return new EA(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t))i in e&&D(e[i])&&D(t[i])?this.mergeContents(e[i],t[i]):e[i]=B(t[i])}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=e=>{e&&(i?this.mergeContents(i,e):i=B(e))};for(const i of this.overrides)1===i.identifiers.length&&i.identifiers[0]===e?t=i.contents:i.identifiers.includes(e)&&n(i.contents);return n(t),i}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){const t=this.keys.indexOf(e);-1!==t&&(this.keys.splice(t,1),tc(this.contents,e),wc.test(e)&&this.overrides.splice(this.overrides.findIndex(t=>s(t.identifiers,yc(e))),1))}updateValue(e,t,i){ec(this.contents,e,t,e=>console.error(e)),(i=i||-1===this.keys.indexOf(e))&&this.keys.push(e),wc.test(e)&&this.overrides.push({identifiers:yc(e),keys:Object.keys(this.contents[e]),contents:Jd(this.contents[e],e=>console.error(e))})}}class NA{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new EA}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:s,restricted:o,hasExcludedProperties:r}=this.doParseRaw(e,t);this._configurationModel=new EA(i,n,s,r?[e]:void 0),this._restrictedConfigurations=o||[]}doParseRaw(e,t){const i=Eh.as(cc).getConfigurationProperties(),n=this.filter(e,i,!0,t);return{contents:Jd(e=n.raw,e=>console.error(`Conflict in settings file ${this._name}: ${e}`)),keys:Object.keys(e),overrides:this.toOverrides(e,e=>console.error(`Conflict in settings file ${this._name}: ${e}`)),restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){var s,o,r;let a=!1;if(!(null==n?void 0:n.scopes)&&!(null==n?void 0:n.skipRestricted)&&!(null===(s=null==n?void 0:n.exclude)||void 0===s?void 0:s.length))return{raw:e,restricted:[],hasExcludedProperties:a};const l={},h=[];for(const s in e)if(wc.test(s)&&i){const i=this.filter(e[s],t,!1,n);l[s]=i.raw,a=a||i.hasExcludedProperties,h.push(...i.restricted)}else{const i=t[s],d=i?void 0!==i.scope?i.scope:3:void 0;(null==i?void 0:i.restricted)&&h.push(s),(null===(o=n.exclude)||void 0===o?void 0:o.includes(s))||!(null===(r=n.include)||void 0===r?void 0:r.includes(s))&&(void 0!==d&&void 0!==n.scopes&&!n.scopes.includes(d)||n.skipRestricted&&(null==i?void 0:i.restricted))?a=!0:l[s]=e[s]}return{raw:l,restricted:h,hasExcludedProperties:a}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(wc.test(n)){const s={};for(const t in e[n])s[t]=e[n][t];i.push({identifiers:yc(n),keys:Object.keys(s),contents:Jd(s,t)})}return i}}class IA{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=s,this.policyConfiguration=o,this.applicationConfiguration=r,this.userConfiguration=a,this.localUserConfiguration=l,this.remoteUserConfiguration=h,this.workspaceConfiguration=d,this.folderConfigurationModel=c,this.memoryConfigurationModel=u}toInspectValue(e){return void 0!==(null==e?void 0:e.value)||void 0!==(null==e?void 0:e.override)||void 0!==(null==e?void 0:e.overrides)?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class TA{constructor(e,t,i,n,s=new EA,o=new EA,r=new bg,a=new EA,l=new bg){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=s,this._workspaceConfiguration=o,this._folderConfigurations=r,this._memoryConfiguration=a,this._memoryConfigurationByResource=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new bg,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=new EA,this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),s=this.getFolderConfigurationModelForResource(t.resource,i),o=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,r=new Set;for(const t of n.overrides)for(const i of t.identifiers)void 0!==n.getOverrideValue(e,i)&&r.add(i);return new IA(e,t,n.getValue(e),r.size?[...r]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,s||void 0,o)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),this._policyConfiguration.isEmpty()||void 0===this._policyConfiguration.getValue(e)||(n=n.merge(this._policyConfiguration)),n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const s=this._memoryConfigurationByResource.get(e);s&&(i=i.merge(s))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(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){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.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},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:n,keys:s}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:s}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),n=this.parseConfigurationModel(e.application),s=this.parseConfigurationModel(e.user),o=this.parseConfigurationModel(e.workspace),r=e.folders.reduce((e,t)=>(e.set(di.revive(t[0]),this.parseConfigurationModel(t[1])),e),new bg);return new TA(t,i,n,s,new EA,o,r,new EA,new bg)}static parseConfigurationModel(e){return new EA(e.contents,e.keys,e.overrides)}}class MA{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._marker="\n",this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const t of e.keys)this.affectedKeys.add(t);for(const[,t]of e.overrides)for(const e of t)this.affectedKeys.add(e);this._affectsConfigStr=this._marker;for(const e of this.affectedKeys)this._affectsConfigStr+=e+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=TA.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,s=this._affectsConfigStr.indexOf(n);if(s<0)return!1;const o=s+n.length;if(o>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(o);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){return!H(this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(i=this.previous)||void 0===i?void 0:i.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace))}return!0}}const AA={kind:0},OA={kind:1};class RA{constructor(e,t,i){var n;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const t of e){const e=t.command;e&&"-"!==e.charAt(0)&&this._defaultBoundCommands.set(e,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=RA.handleRemovals([].concat(e).concat(t));for(let e=0,t=this._keybindings.length;e<t;e++){const t=this._keybindings[e];if(0===t.chords.length)continue;const i=null===(n=t.when)||void 0===n?void 0:n.substituteConstants();i&&0===i.type||this._addKeyPress(t.chords[0],t)}}static _isTargetedForRemoval(e,t,i){if(t)for(let i=0;i<t.length;i++)if(t[i]!==e.chords[i])return!1;if(i&&1!==i.type){if(!e.when)return!1;if(!function(e,t){const i=e?e.substituteConstants():void 0,n=t?t.substituteConstants():void 0;return!i&&!n||!(!i||!n)&&i.equals(n)}(i,e.when))return!1}return!0}static handleRemovals(e){const t=new Map;for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.command&&"-"===n.command.charAt(0)){const e=n.command.substring(1);t.has(e)?t.get(e).push(n):t.set(e,[n])}}if(0===t.size)return e;const i=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];if(!s.command||0===s.command.length){i.push(s);continue}if("-"===s.command.charAt(0))continue;const o=t.get(s.command);if(!o||!s.isDefault){i.push(s);continue}let r=!1;for(const e of o){const t=e.when;if(this._isTargetedForRemoval(s,e.chords,t)){r=!0;break}}r||i.push(s)}return i}_addKeyPress(e,t){const i=this._map.get(e);if(void 0===i)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let e=i.length-1;e>=0;e--){const n=i[e];if(n.command===t.command)continue;let s=!0;for(let e=1;e<n.chords.length&&e<t.chords.length;e++)if(n.chords[e]!==t.chords[e]){s=!1;break}s&&(RA.whenIsEntirelyIncluded(n.when,t.when)&&this._removeFromLookupMap(n))}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(void 0!==t)for(let i=0,n=t.length;i<n;i++)if(t[i]===e)return void t.splice(i,1)}static whenIsEntirelyIncluded(e,t){return!t||1===t.type||!(!e||1===e.type)&&function e(t,i){if(0===t.type||1===i.type)return!0;if(9===t.type)return 9===i.type&&wh(t.expr,i.expr);if(9===i.type){for(const n of i.expr)if(e(t,n))return!0;return!1}if(6===t.type){if(6===i.type)return wh(i.expr,t.expr);for(const n of t.expr)if(e(n,i))return!0;return!1}return t.equals(i)}(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(void 0===i||0===i.length)return null;if(1===i.length)return i[0];for(let e=i.length-1;e>=0;e--){const n=i[e];if(t.contextMatchesRules(n.when))return n}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log("| Resolving "+n);const s=this._map.get(n[0]);if(void 0===s)return this._log("\\ No keybinding entries."),AA;let o=null;if(n.length<2)o=s;else{o=[];for(let e=0,t=s.length;e<t;e++){const t=s[e];if(n.length>t.chords.length)continue;let i=!0;for(let e=1;e<n.length;e++)if(t.chords[e]!==n[e]){i=!1;break}i&&o.push(t)}}const r=this._findCommand(e,o);return r?n.length<r.chords.length?(this._log(`\\ From ${o.length} keybinding entries, awaiting ${r.chords.length-n.length} more chord(s), when: ${PA(r.when)}, source: ${FA(r)}.`),OA):(this._log(`\\ From ${o.length} keybinding entries, matched ${r.command}, when: ${PA(r.when)}, source: ${FA(r)}.`),a=r.command,l=r.commandArgs,h=r.bubble,{kind:2,commandId:a,commandArgs:l,isBubble:h}):(this._log(`\\ From ${o.length} keybinding entries, no when clauses matched the context.`),AA);var a,l,h}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){const n=t[i];if(RA._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}}function PA(e){return e?""+e.serialize():"no when condition"}function FA(e){return e.extensionId?e.isBuiltinExtension?"built-in extension "+e.extensionId:"user extension "+e.extensionId:e.isDefault?"built-in":"user"}const BA=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class WA extends st{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:dt.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,s){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=s,this._onDidUpdateKeybindings=this._register(new ft),this._currentChords=[],this._currentChordChecker=new go,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=VA.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new uo,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info("[KeybindingService]: "+e)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),AA;const[n]=i.getDispatchChords();if(null===n)return this._log("\\ Keyboard event cannot be dispatched"),AA;const s=this._contextKeyService.getContext(t),o=this._currentChords.map(({keypress:e})=>e);return this._getResolver().resolve(s,o,n)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{this._documentHasFocus()?Date.now()-e>5e3&&this._leaveChordMode():this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw Ue("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(J.b("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const e=this._currentChords.map(({label:e})=>e).join(", ");this._currentChordStatusMessage=this._notificationService.status(J.b("next.chord","({0}) was pressed. Waiting for next key of chord...",e))}}this._scheduleLeaveChordMode(),Nw.enabled&&Nw.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],Nw.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=VA.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=VA.EMPTY,null===this._currentSingleModifier?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[s]=i.getChords();return this._ignoreSingleModifiers=new VA(s),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var n;let s=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,r=null;if(i){const[t]=e.getSingleModifierDispatchChords();o=t,r=t?[t]:[]}else[o]=e.getDispatchChords(),r=this._currentChords.map(({keypress:e})=>e);if(null===o)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;const a=this._contextKeyService.getContext(t),l=e.getLabel(),h=this._getResolver().resolve(a,r,o);switch(h.kind){case 0:if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const e=this._currentChords.map(({label:e})=>e).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${e}, ${l}".`),this._notificationService.status(J.b("missing.chord","The key combination ({0}, {1}) is not a command.",e,l),{hideAfter:1e4}),this._leaveChordMode(),s=!0}return s;case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),s=!0,this._expectAnotherChord(o,l),this._log(1===this._currentChords.length?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),s;case 2:if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${h.commandId} ]`),null===h.commandId||""===h.commandId){if(this.inChordMode){const e=this._currentChords.map(({label:e})=>e).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${e}, ${l}".`),this._notificationService.status(J.b("missing.chord","The key combination ({0}, {1}) is not a command.",e,l),{hideAfter:1e4}),this._leaveChordMode(),s=!0}}else{this.inChordMode&&this._leaveChordMode(),h.isBubble||(s=!0),this._log(`+ Invoking command ${h.commandId}.`),this._currentlyDispatchingCommandId=h.commandId;try{void 0===h.commandArgs?this._commandService.executeCommand(h.commandId).then(void 0,e=>this._notificationService.warn(e)):this._commandService.executeCommand(h.commandId,h.commandArgs).then(void 0,e=>this._notificationService.warn(e))}finally{this._currentlyDispatchingCommandId=null}BA.test(h.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:h.commandId,from:"keybinding",detail:null!==(n=e.getUserSettingsLabel())&&void 0!==n?n:void 0})}return s}}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class VA{constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}VA.EMPTY=new VA(null);class HA{constructor(e,t,i,n,s,o,r){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?zA(e.getDispatchChords()):[],e&&0===this.chords.length&&(this.chords=zA(e.getSingleModifierDispatchChords())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=s,this.extensionId=o,this.isBuiltinExtension=r}}function zA(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n)return[];t.push(n)}return t}class KA{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s],r=i(o);if(null===r)return null;n[s]=GA(o,r,this.modifierLabels[e])}return n.join(" ")}}const UA=new KA({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:J.b({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:J.b({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:J.b({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:J.b({key:"windowsKey",comment:["This is the short form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:J.b({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:J.b({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:J.b({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:J.b({key:"superKey",comment:["This is the short form for the Super key on the keyboard"]},"Super"),separator:"+"}),jA=new KA({ctrlKey:J.b({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:J.b({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:J.b({key:"optKey.long",comment:["This is the long form for the Alt/Option key on the keyboard"]},"Option"),metaKey:J.b({key:"cmdKey.long",comment:["This is the long form for the Command key on the keyboard"]},"Command"),separator:"+"},{ctrlKey:J.b({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:J.b({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:J.b({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:J.b({key:"windowsKey.long",comment:["This is the long form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:J.b({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:J.b({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:J.b({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:J.b({key:"superKey.long",comment:["This is the long form for the Super key on the keyboard"]},"Super"),separator:"+"}),qA=new KA({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),$A=new KA({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});function GA(e,t,i){if(null===t)return"";const n=[];return e.ctrlKey&&n.push(i.ctrlKey),e.shiftKey&&n.push(i.shiftKey),e.altKey&&n.push(i.altKey),e.metaKey&&n.push(i.metaKey),""!==t&&n.push(t),n.join(i.separator)}class ZA extends class extends class{}{constructor(e,t){if(super(),0===t.length)throw Ke("chords");this._os=e,this._chords=t}getLabel(){return UA.toLabel(this._os,this._chords,e=>this._getLabel(e))}getAriaLabel(){return jA.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:qA.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return $A.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new Zs(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Wt.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Wt.toString(e.keyCode)}_getElectronAccelerator(e){return Wt.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Wt.toUserSettingsUS(e.keyCode);return t?t.toLowerCase():t}_getChordDispatch(e){return ZA.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Wt.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){const t=Ft[e];if(-1!==t)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof $s)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new $s(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=zA(e.chords.map(e=>this._toKeyCodeChord(e)));return i.length>0?[new ZA(i,t)]:[]}}const YA=wl("labelService"),QA=wl("progressService");Object.freeze({total(){},worked(){},done(){}});Object.freeze({report(){}});const XA=wl("editorProgressService");class JA{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]}}class eO{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(46===this._value.charCodeAt(this._to)){if(!e)break;this._from++}else e=!1}return this}cmp(e){return this._caseSensitive?Jn(e,this._value,0,e.length,this._from,this._to):ts(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class tO{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--){const e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))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++){const t=this._value.charCodeAt(this._to);if(47===t||this._splitOnBackslash&&92===t){if(!e)break;this._from++}else e=!1}return this}cmp(e){return this._caseSensitive?Jn(e,this._value,0,e.length,this._from,this._to):ts(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class iO{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(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new tO(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(1===this._states[this._stateIdx])return es(e,this._value.scheme);if(2===this._states[this._stateIdx])return es(e,this._value.authority);if(3===this._states[this._stateIdx])return this._pathIterator.cmp(e);if(4===this._states[this._stateIdx])return Xn(e,this._value.query);if(5===this._states[this._stateIdx])return Xn(e,this._value.fragment);throw new Error}value(){if(1===this._states[this._stateIdx])return this._value.scheme;if(2===this._states[this._stateIdx])return this._value.authority;if(3===this._states[this._stateIdx])return this._pathIterator.value();if(4===this._states[this._stateIdx])return this._value.query;if(5===this._states[this._stateIdx])return this._value.fragment;throw new Error}}class nO{constructor(){this.height=1}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const 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(){var e,t;return null!==(t=null===(e=this.left)||void 0===e?void 0:e.height)&&void 0!==t?t:0}get heightRight(){var e,t;return null!==(t=null===(e=this.right)||void 0===e?void 0:e.height)&&void 0!==t?t:0}}class sO{static forUris(e=(()=>!1),t=(()=>!1)){return new sO(new iO(e,t))}static forStrings(){return new sO(new JA)}static forConfigKeys(){return new sO(new eO)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new nO,this._root.segment=i.value());const s=[];for(n=this._root;;){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new nO,n.left.segment=i.value()),s.push([-1,n]),n=n.left;else if(e<0)n.right||(n.right=new nO,n.right.segment=i.value()),s.push([1,n]),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new nO,n.mid.segment=i.value()),s.push([0,n]),n=n.mid}}const o=n.value;n.value=t,n.key=e;for(let e=s.length-1;e>=0;e--){const t=s[e][1];t.updateHeight();const i=t.balanceFactor();if(i<-1||i>1){const i=s[e][0],n=s[e+1][0];if(1===i&&1===n)s[e][1]=t.rotateLeft();else if(-1===i&&-1===n)s[e][1]=t.rotateRight();else if(1===i&&-1===n)t.right=s[e+1][1]=s[e+1][1].rotateRight(),s[e][1]=t.rotateLeft();else{if(-1!==i||1!==n)throw new Error;t.left=s[e+1][1]=s[e+1][1].rotateLeft(),s[e][1]=t.rotateRight()}if(e>0)switch(s[e-1][0]){case-1:s[e-1][1].left=s[e][1];break;case 1:s[e-1][1].right=s[e][1];break;case 0:s[e-1][1].mid=s[e][1]}else this._root=s[0][1]}}return o}get(e){var t;return null===(t=this._getNode(e))||void 0===t?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i}has(e){const t=this._getNode(e);return!(void 0===(null==t?void 0:t.value)&&void 0===(null==t?void 0:t.mid))}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const n=this._iter.reset(e),s=[];let o=this._root;for(;o;){const e=n.cmp(o.segment);if(e>0)s.push([-1,o]),o=o.left;else if(e<0)s.push([1,o]),o=o.right;else{if(!n.hasNext())break;n.next(),s.push([0,o]),o=o.mid}}if(o){if(t?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){const e=this._min(o.right);if(e.key){const{key:t,value:i,segment:n}=e;this._delete(e.key,!1),o.key=t,o.value=i,o.segment=n}}else{const e=null!==(i=o.left)&&void 0!==i?i:o.right;if(s.length>0){const[t,i]=s[s.length-1];switch(t){case-1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e}}else this._root=e}for(let e=s.length-1;e>=0;e--){const t=s[e][1];t.updateHeight();const i=t.balanceFactor();if(i>1?(t.right.balanceFactor()>=0||(t.right=t.right.rotateRight()),s[e][1]=t.rotateLeft()):i<-1&&(t.left.balanceFactor()<=0||(t.left=t.left.rotateLeft()),s[e][1]=t.rotateRight()),e>0)switch(s[e-1][0]){case-1:s[e-1][1].left=s[e][1];break;case 1:s[e-1][1].right=s[e][1];break;case 0:s[e-1][1].mid=s[e][1]}else this._root=s[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n=void 0;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),n=i.value||n,i=i.mid}}return i&&i.value||n}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const e=i.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!i.hasNext())return n.mid?this._entries(n.mid):t?n.value:void 0;i.next(),n=n.mid}}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const oO=wl("contextService");class rO{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}Object(J.b)("codeWorkspace","Code Workspace");var aO,lO,hO,dO,cO,uO,gO,mO,fO,pO,_O;(aO||(aO={})).inspectTokensAction=J.b("inspectTokens","Developer: Inspect Tokens"),(lO||(lO={})).gotoLineActionLabel=J.b("gotoLineActionLabel","Go to Line/Column..."),(hO||(hO={})).helpQuickAccessActionLabel=J.b("helpQuickAccess","Show all Quick Access Providers"),(cO=dO||(dO={})).quickCommandActionLabel=J.b("quickCommandActionLabel","Command Palette"),cO.quickCommandHelp=J.b("quickCommandActionHelp","Show And Run Commands"),(gO=uO||(uO={})).quickOutlineActionLabel=J.b("quickOutlineActionLabel","Go to Symbol..."),gO.quickOutlineByCategoryActionLabel=J.b("quickOutlineByCategoryActionLabel","Go to Symbol by Category..."),(fO=mO||(mO={})).editorViewAccessibleLabel=J.b("editorViewAccessibleLabel","Editor content"),fO.accessibilityHelpMessage=J.b("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options."),(pO||(pO={})).toggleHighContrast=J.b("toggleHighContrast","Toggle High Contrast Theme"),(_O||(_O={})).bulkEditServiceSummary=J.b("bulkEditServiceSummary","Made {0} edits in {1} files");const vO=wl("workspaceTrustManagementService");var bO;!function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],s={start:e.start,end:Math.min(t.start,e.end)},o={start:Math.max(t.end,e.start),end:e.end};return i(s)||n.push(s),i(o)||n.push(o),n}}(bO||(bO={}));var CO;i("IboD");function wO(e,t,i){const n=i.mode===CO.ALIGN?i.offset:i.offset+i.size,s=i.mode===CO.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=s?s-t:Math.max(e-t,0):t<=s?s-t:t<=e-n?n:0}!function(e){e[e.AVOID=0]="AVOID",e[e.ALIGN=1]="ALIGN"}(CO||(CO={}));class yO extends st{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=st.None,this.toDisposeOnSetContainer=st.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Ka(".context-view"),ja(this.view),this.setContainer(e,t),this._register(it(()=>this.setContainer(null,1)))}setContainer(e,t){var i;this.useFixedPosition=1!==t;const n=this.useShadowDOM;if(this.useShadowDOM=3===t,(e!==this.container||n!==this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,null===(i=this.shadowRootHostElement)||void 0===i||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=Ka(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=SO,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Ka("slot"))}else this.container.appendChild(this.view);const t=new nt;yO.BUBBLE_UP_EVENTS.forEach(e=>{t.add(Qr(this.container,e,e=>{this.onDOMEvent(e,!1)}))}),yO.BUBBLE_DOWN_EVENTS.forEach(e=>{t.add(Qr(this.container,e,e=>{this.onDOMEvent(e,!0)},!0))}),this.toDisposeOnSetContainer=t}}show(e){var t,i;this.isVisible()&&this.hide(),$r(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Ua(this.view),this.toDisposeOnClean=e.render(this.view)||st.None,this.delegate=e,this.doLayout(),null===(i=(t=this.delegate).focus)||void 0===i||i.call(t)}getViewElement(){return this.view}layout(){var e,t;this.isVisible()&&(!1!==this.delegate.canRelayout||K.f&&Us?(null===(t=null===(e=this.delegate)||void 0===e?void 0:e.layout)||void 0===t||t.call(e),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(e instanceof HTMLElement){const i=aa(e),n=la(e);t={top:i.top*n,left:i.left*n,width:i.width*n,height:i.height*n}}else t=function(e){const t=e;return!!t&&"number"==typeof t.x&&"number"==typeof t.y}(e)?{top:e.y,left:e.x,width:e.width||1,height:e.height||2}:{top:e.posy,left:e.posx,width:2,height:2};const i=ha(this.view),n=ua(this.view),s=this.delegate.anchorPosition||0,o=this.delegate.anchorAlignment||0,r=this.delegate.anchorAxisAlignment||0;let a,l;const h=null!==(c=null===(d=wa().defaultView)||void 0===d?void 0:d.window)&&void 0!==c?c:Pn;var d,c;if(0===r){const e={offset:t.top-h.pageYOffset,size:t.height,position:0===s?0:1},r={offset:t.left,size:t.width,position:0===o?0:1,mode:CO.ALIGN};a=wO(h.innerHeight,n,e)+h.pageYOffset,bO.intersects({start:a,end:a+n},{start:e.offset,end:e.offset+e.size})&&(r.mode=CO.AVOID),l=wO(h.innerWidth,i,r)}else{const e={offset:t.left,size:t.width,position:0===o?0:1},r={offset:t.top,size:t.height,position:0===s?0:1,mode:CO.ALIGN};l=wO(h.innerWidth,i,e),bO.intersects({start:l,end:l+i},{start:e.offset,end:e.offset+e.size})&&(r.mode=CO.AVOID),a=wO(h.innerHeight,n,r)+h.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===s?"bottom":"top"),this.view.classList.add(0===o?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const u=aa(this.container);this.view.style.top=a-(this.useFixedPosition?aa(this.view).top:u.top)+"px",this.view.style.left=l-(this.useFixedPosition?aa(this.view).left:u.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),ja(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,Fr(e).document.activeElement):t&&!ga(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}yO.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],yO.BUBBLE_DOWN_EVENTS=["click"];const SO='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }\n';var LO=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},kO=function(e,t){return function(i,n){t(i,n,e)}};let DO=class extends st{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=st.None,this.contextView=this._register(new yO(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;n=t?t===this.layoutService.getContainer(Fr(t))?1:i?3:2:1,this.contextView.setContainer(null!=t?t:this.layoutService.activeContainer,n),this.contextView.show(e);const s=it(()=>{this.currentViewDisposable===s&&this.hideContextView()});return this.currentViewDisposable=s,s}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}dispose(){super.dispose(),this.currentViewDisposable.dispose(),this.currentViewDisposable=st.None}};DO=LO([kO(0,cI)],DO);let xO=[],EO=[],NO=[];function IO(e,t=!1){!function(e,t,i){const n=function(e,t){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:t,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?uT(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(Qt.sep)>=0}}(e,t);xO.push(n),n.userConfigured?NO.push(n):EO.push(n);i&&!n.userConfigured&&xO.forEach(e=>{e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&e.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&e.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&e.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}(e,!1,t)}function TO(e,t){return function(e,t){let i;if(e)switch(e.scheme){case wr.file:i=e.fsPath;break;case wr.data:{const t=dD.parseMetaData(e);i=t.get(dD.META_DATA_LABEL);break}case wr.vscodeNotebookCell:i=void 0;break;default:i=e.path}if(!i)return[{id:"unknown",mime:lc.unknown}];i=i.toLowerCase();const n=ii(i),s=MO(i,n,NO);if(s)return[s,{id:"plaintext",mime:lc.text}];const o=MO(i,n,EO);if(o)return[o,{id:"plaintext",mime:lc.text}];if(t){const e=function(e){Ds(e)&&(e=e.substr(1));if(e.length>0)for(let t=xO.length-1;t>=0;t--){const i=xO[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i}return}(t);if(e)return[e,{id:"plaintext",mime:lc.text}]}return[{id:"unknown",mime:lc.unknown}]}(e,t).map(e=>e.id)}function MO(e,t,i){var n;let s=void 0,o=void 0,r=void 0;for(let a=i.length-1;a>=0;a--){const l=i[a];if(t===l.filenameLowercase){s=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const i=l.filepatternOnPath?e:t;(null===(n=l.filepatternLowercase)||void 0===n?void 0:n.call(l,i))&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&t.endsWith(l.extensionLowercase)&&(r=l)}return s||(o||(r||void 0))}const AO=Object.prototype.hasOwnProperty;class OO{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register("vs.editor.nullLanguage",0),this._register("plaintext",1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||"vs.editor.nullLanguage"}}class RO extends st{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new ft),this.onDidChange=this._onDidChange.event,RO.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new OO,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(kc.onDidChangeLanguages(e=>{this._initializeFromRegistry()})))}dispose(){RO.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},xO=xO.filter(e=>e.userConfigured),EO=[];const e=[].concat(kc.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(e=>{const t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach(e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier}),t.mimetypes.forEach(e=>{this._mimeTypesMap[e]=t.identifier})}),Eh.as(cc).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;AO.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n="text/x-"+i,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const e of t.extensions)IO({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const s of t.filenames)IO({id:i,mime:n,filename:s},this._warnOnOverwrite),e.filenames.push(s);if(Array.isArray(t.filenamePatterns))for(const e of t.filenamePatterns)IO({id:i,mime:n,filepattern:e},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{const t=new RegExp(e);"^"!==(s=t).source&&"^$"!==s.source&&"$"!==s.source&&"^\\s*$"!==s.source&&s.exec("")&&0===s.lastIndex||IO({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(i){console.warn(`[${t.id}]: Invalid regular expression \`${e}\`: `,i)}}var s;e.aliases.push(i);let o=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const t of o)t&&0!==t.length&&e.aliases.push(t);const r=null!==o&&o.length>0;if(r&&null===o[0]);else{const t=(r?o[0]:null)||i;!r&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&AO.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return AO.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&AO.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return e||t?TO(e,t):[]}}RO.instanceCount=0;class PO extends st{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new ft),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new ft),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new ft({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,PO.instanceCount++,this._registry=this._register(new RO(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){PO.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return c(this._registry.guessLanguageIdByFilepathOrFirstLine(e,t),null)}createById(e){return new FO(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new FO(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e="plaintext"),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),zi.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}PO.instanceCount=0;class FO{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new ft({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,null===(e=this._emitter)||void 0===e||e.fire(this.languageId))}}const BO={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:lc.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};let WO=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});const VO=new Vn.a(()=>WO("mouse",!1)),HO=new Vn.a(()=>WO("element",!1));function zO(e,t){return t?WO(e,!0):"element"===e?HO.value:VO.value}class KO{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){var n;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(void 0===e||k(e)||e instanceof HTMLElement)s=e;else if(P(e.markdown)){this._hoverWidget||this.show(Object(J.b)("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new xt;const i=this._cancellationTokenSource.token;if(s=await e.markdown(i),void 0===s&&(s=e.markdownNotSupportedFallback),this.isDisposed||i.isCancellationRequested)return}else s=null!==(n=e.markdown)&&void 0!==n?n:e.markdownNotSupportedFallback;this.show(s,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const s={content:e,target:this.target,appearance:{showPointer:"element"===this.hoverDelegate.placement,skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:2},...i};this._hoverWidget=this.hoverDelegate.showHover(s,t)}null==n||n.dispose()}hasContent(e){return!!e&&(!SM(e)||!!e.value)}get isDisposed(){var e;return null===(e=this._hoverWidget)||void 0===e?void 0:e.isDisposed}dispose(){var e,t;null===(e=this._hoverWidget)||void 0===e||e.dispose(),null===(t=this._cancellationTokenSource)||void 0===t||t.dispose(!0),this._cancellationTokenSource=void 0}}function UO(e,t,i,n){let s,o;const r=(t,i)=>{var n;const r=void 0!==o;t&&(null==o||o.dispose(),o=void 0),i&&(null==s||s.dispose(),s=void 0),r&&(null===(n=e.onDidHideHover)||void 0===n||n.call(e),o=void 0)},a=(s,r,a)=>new uo(async()=>{o&&!o.isDisposed||(o=new KO(e,a||t,s>0),await o.update("function"==typeof i?i():i,r,n))},s);let l=!1;const h=Zr(t,Ma.MOUSE_DOWN,()=>{l=!0,r(!0,!0)},!0),d=Zr(t,Ma.MOUSE_UP,()=>{l=!1},!0),c=Zr(t,Ma.MOUSE_LEAVE,e=>{l=!1,r(!1,e.fromElement===t)},!0),u=Zr(t,Ma.MOUSE_OVER,()=>{if(s)return;const i=new nt,n={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>{n.x=e.x+10,e.target instanceof HTMLElement&&e.target.classList.contains("action-label")&&r(!0,!0)};i.add(Zr(t,Ma.MOUSE_MOVE,e,!0))}i.add(a(e.delay,!1,n)),s=i},!0),g=Zr(t,Ma.FOCUS,()=>{if(l||s)return;const i={targetElements:[t],dispose:()=>{}},n=new nt;n.add(Zr(t,Ma.BLUR,()=>r(!0,!0),!0)),n.add(a(e.delay,!1,i)),s=n},!0);return{show:e=>{r(!1,!0),a(0,e)},hide:()=>{r(!0,!0)},update:async(e,t)=>{i=e,await(null==o?void 0:o.update(i,void 0,t))},dispose:()=>{u.dispose(),c.dispose(),h.dispose(),d.dispose(),g.dispose(),r(!0,!0)}}}class jO{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}i("sJnT");class qO extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function $O(e,t){const i=[];for(const n of t){if(e.start>=n.range.end)continue;if(e.end<n.range.start)break;const t=bO.intersect(e,n.range);bO.isEmpty(t)||i.push({range:t,size:n.size})}return i}function GO({start:e,end:t},i){return{start:e+i,end:t+i}}class ZO{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=null!=e?e:0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,s=$O({start:0,end:e},this.groups),o=$O({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(e=>({range:GO(e.range,n),size:e.size})),r=i.map((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size}));this.groups=function(...e){return function(e){const t=[];let i=null;for(const n of e){const e=n.range.start,s=n.range.end,o=n.size;i&&o===i.size?i.range.end=s:(i={range:{start:e,end:s},size:o},t.push(i))}return t}(e.reduce((e,t)=>e.concat(t),[]))}(s,r,o),this._size=this._paddingTop+this.groups.reduce((e,t)=>e+t.size*(t.range.end-t.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e<this._paddingTop)return 0;let t=0,i=this._paddingTop;for(const n of this.groups){const s=n.range.end-n.range.start,o=i+s*n.size;if(e<o)return t+Math.floor((e-i)/n.size);t+=s,i=o}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const s=n.range.end-n.range.start,o=i+s;if(e<o)return this._paddingTop+t+(e-i)*n.size;t+=s*n.size,i=o}return-1}}class YO{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const i=Ka(".monaco-list-row");t={domNode:i,templateId:e,templateData:this.getRenderer(e).renderTemplate(i)}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const e of this.transactionNodesPendingRemoval)this.doRemoveNode(e);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t));this.getTemplateCache(i).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),function(e){var t;try{null===(t=e.parentElement)||void 0===t||t.removeChild(e)}catch(e){}}(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(const i of e){this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error("No renderer found for "+e);return t}}var QO=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};const XO={CurrentDragAndDropData:void 0},JO={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class eR{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class tR{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class iR{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}class nR{constructor(e){(null==e?void 0:e.getSetSize)?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(e,t,i)=>i,(null==e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null==e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null==e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class sR{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:da(this.domNode)}),this.rowsContainer.style.width=Math.max(this.scrollWidth||0,this.renderWidth)+"px"}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,n=JO){var s,o,r,a,l,h,d,c,u,g,m,f,p;if(this.virtualDelegate=t,this.domId="list_id_"+ ++sR.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new ao(50),this.splicing=!1,this.dragOverAnimationStopDisposable=st.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=st.None,this.onDragLeaveTimeout=st.None,this.disposables=new nt,this._onDidChangeContentHeight=new ft,this._onDidChangeContentWidth=new ft,this.onDidChangeContentHeight=dt.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(null!==(s=n.paddingTop)&&void 0!==s?s:0);for(const e of i)this.renderers.set(e.templateId,e);this.cache=this.disposables.add(new YO(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support","boolean"!=typeof n.mouseSupport||n.mouseSupport),this._horizontalScrolling=null!==(o=n.horizontalScrolling)&&void 0!==o?o:JO.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=void 0===n.paddingBottom?0:n.paddingBottom,this.accessibilityProvider=new nR(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows";(null!==(r=n.transformOptimization)&&void 0!==r?r:JO.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Vb.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new Zb({forceIntegerValues:!0,smoothScrollDuration:null!==(a=n.smoothScrolling)&&void 0!==a&&a?125:0,scheduleAtNextAnimationFrame:e=>ea(Fr(this.domNode),e)})),this.scrollableElement=this.disposables.add(new nC(this.rowsContainer,{alwaysConsumeMouseWheel:null!==(l=n.alwaysConsumeMouseWheel)&&void 0!==l?l:JO.alwaysConsumeMouseWheel,horizontal:1,vertical:null!==(h=n.verticalScrollMode)&&void 0!==h?h:JO.verticalScrollMode,useShadows:null!==(d=n.useShadows)&&void 0!==d?d:JO.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(Zr(this.rowsContainer,Bb.Change,e=>this.onTouchChange(e))),this.disposables.add(Zr(this.scrollableElement.getDomNode(),"scroll",e=>e.target.scrollTop=0)),this.disposables.add(Zr(this.domNode,"dragover",e=>this.onDragOver(this.toDragEvent(e)))),this.disposables.add(Zr(this.domNode,"drop",e=>this.onDrop(this.toDragEvent(e)))),this.disposables.add(Zr(this.domNode,"dragleave",e=>this.onDragLeave(this.toDragEvent(e)))),this.disposables.add(Zr(this.domNode,"dragend",e=>this.onDragEnd(e))),this.setRowLineHeight=null!==(c=n.setRowLineHeight)&&void 0!==c?c:JO.setRowLineHeight,this.setRowHeight=null!==(u=n.setRowHeight)&&void 0!==u?u:JO.setRowHeight,this.supportDynamicHeights=null!==(g=n.supportDynamicHeights)&&void 0!==g?g:JO.supportDynamicHeights,this.dnd=null!==(m=n.dnd)&&void 0!==m?m:this.disposables.add(JO.dnd),this.layout(null===(f=n.initialSize)||void 0===f?void 0:f.height,null===(p=n.initialSize)||void 0===p?void 0:p.width)}updateOptions(e){let t;if(void 0!==e.paddingBottom&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.scrollByPage&&(t={...null!=t?t:{},scrollByPage:e.scrollByPage}),void 0!==e.mouseWheelScrollSensitivity&&(t={...null!=t?t:{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),void 0!==e.fastScrollSensitivity&&(t={...null!=t?t:{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),void 0!==e.paddingTop&&e.paddingTop!==this.rangeMap.paddingTop){const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),i=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(t,Math.max(0,this.lastRenderTop+i),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new ZO(e)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s={start:e,end:e+t},o=bO.intersect(n,s),r=new Map;for(let e=o.end-1;e>=o.start;e--){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){let i=r.get(t.templateId);i||(i=[],r.set(t.templateId,i));const n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,t.size),i.push(t.row)}t.row=null,t.stale=!0}const a={start:e+t,end:this.items.length},l=bO.intersect(a,n),h=bO.relativeComplement(a,n),d=i.map(e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:st.None,checkedDisposable:st.None,stale:!1}));let c;0===e&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),c=this.items,this.items=d):(this.rangeMap.splice(e,t,d),c=this.items.splice(e,t,...d));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=GO(l,u),f=bO.intersect(g,m);for(let e=f.start;e<f.end;e++)this.updateItemInDOM(this.items[e],e);const p=bO.relativeComplement(m,g);for(const e of p)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);const _=h.map(e=>GO(e,u)),v=[{start:e,end:e+i.length},..._].map(e=>bO.intersect(g,e)).reverse();for(const e of v)for(let t=e.end-1;t>=e.start;t--){const e=this.items[t],i=r.get(e.templateId),n=null==i?void 0:i.pop();this.insertItemInDOM(t,n)}for(const e of r.values())for(const t of e)this.cache.release(t);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),c.map(e=>e.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=this._scrollHeight+"px",this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=ea(Fr(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth()):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:"number"==typeof e?e:ca(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),void 0!==t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:da(this.domNode)})}render(e,t,i,n,s,o=!1){const r=this.getRenderRange(t,i),a=bO.relativeComplement(r,e).reverse(),l=bO.relativeComplement(e,r);if(o){const t=bO.intersect(e,r);for(let e=t.start;e<t.end;e++)this.updateItemInDOM(this.items[e],e)}this.cache.transact(()=>{for(const e of l)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);for(const e of a)for(let t=e.end-1;t>=e.start;t--)this.insertItemInDOM(t)}),void 0!==n&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&void 0!==s&&(this.rowsContainer.style.width=Math.max(s,this.renderWidth)+"px"),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){var i,n,s;const o=this.items[e];if(!o.row)if(t)o.row=t,o.stale=!0;else{const e=this.cache.alloc(o.templateId);o.row=e.row,o.stale||(o.stale=e.isReusingConnectedDomNode)}const r=this.accessibilityProvider.getRole(o.element)||"listitem";o.row.domNode.setAttribute("role",r);const a=this.accessibilityProvider.isChecked(o.element);if("boolean"==typeof a)o.row.domNode.setAttribute("aria-checked",String(!!a));else if(a){const e=e=>o.row.domNode.setAttribute("aria-checked",String(!!e));e(a.value),o.checkedDisposable=a.onDidChange(e)}if(o.stale||!o.row.domNode.parentElement){const t=null!==(s=null===(n=null===(i=this.items.at(e+1))||void 0===i?void 0:i.row)||void 0===n?void 0:n.domNode)&&void 0!==s?s:null;this.rowsContainer.insertBefore(o.row.domNode,t),o.stale=!1}this.updateItemInDOM(o,e);const l=this.renderers.get(o.templateId);if(!l)throw new Error("No renderer found for template id "+o.templateId);null==l||l.renderElement(o.element,e,o.row.templateData,o.size);const h=this.dnd.getDragURI(o.element);o.dragStartDisposable.dispose(),o.row.domNode.draggable=!!h,h&&(o.dragStartDisposable=Zr(o.row.domNode,"dragstart",e=>this.onDragStart(o.element,h,e))),this.horizontalScrolling&&(this.measureItemWidth(o),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=da(e.row.domNode);const t=Fr(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=this.elementTop(t)+"px",this.setRowHeight&&(e.row.domNode.style.height=e.size+"px"),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=e.size+"px"),e.row.domNode.setAttribute("data-index",""+t),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2==0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return dt.map(this.disposables.add(new dC(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return dt.map(this.disposables.add(new dC(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return dt.filter(dt.map(this.disposables.add(new dC(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>1===e.browserEvent.button,this.disposables)}get onMouseDown(){return dt.map(this.disposables.add(new dC(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return dt.map(this.disposables.add(new dC(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return dt.map(this.disposables.add(new dC(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return dt.any(dt.map(this.disposables.add(new dC(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),dt.map(this.disposables.add(new dC(this.domNode,Bb.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return dt.map(this.disposables.add(new dC(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return dt.map(this.disposables.add(new dC(this.rowsContainer,Bb.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element,sector:this.getTargetSector(e,t)}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var n,s;if(!i.dataTransfer)return;const o=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(BO.TEXT,t),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(o,i)),void 0===e&&(e=String(o.length));const t=Ka(".monaco-drag-image");t.textContent=e;const n=(e=>{for(;e&&!e.classList.contains("monaco-workbench");)e=e.parentElement;return e||this.domNode.ownerDocument})(this.domNode);n.appendChild(t),i.dataTransfer.setDragImage(t,-10,-10),setTimeout(()=>n.removeChild(t),0)}this.domNode.classList.add("dragging"),this.currentDragData=new eR(o),XO.CurrentDragAndDropData=new tR(o),null===(s=(n=this.dnd).onDragStart)||void 0===s||s.call(n,this.currentDragData,i)}onDragOver(e){var t,i;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),XO.CurrentDragAndDropData&&"vscode-ui"===XO.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(XO.CurrentDragAndDropData)this.currentDragData=XO.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new iR}const n=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop="boolean"==typeof n?n:n.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let o;e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof n&&0===(null===(t=n.effect)||void 0===t?void 0:t.type)?"copy":"move",o="boolean"!=typeof n&&n.feedback?n.feedback:void 0===e.index?[-1]:[e.index],o=d(o).filter(e=>e>=-1&&e<this.length).sort((e,t)=>e-t),o=-1===o[0]?[-1]:o;let r="boolean"!=typeof n&&n.effect&&n.effect.position?n.effect.position:"drop-target";if(a=this.currentDragFeedback,l=o,(Array.isArray(a)&&Array.isArray(l)?s(a,l):a===l)&&this.currentDragFeedbackPosition===r)return!0;var a,l;if(this.currentDragFeedback=o,this.currentDragFeedbackPosition=r,this.currentDragFeedbackDisposable.dispose(),-1===o[0])this.domNode.classList.add(r),this.rowsContainer.classList.add(r),this.currentDragFeedbackDisposable=it(()=>{this.domNode.classList.remove(r),this.rowsContainer.classList.remove(r)});else{if(o.length>1&&"drop-target"!==r)throw new Error("Can't use multiple feedbacks with position different than 'over'");"drop-target-after"===r&&o[0]<this.length-1&&(o[0]+=1,r="drop-target-before");for(const e of o){const t=this.items[e];t.dropTarget=!0,null===(i=t.row)||void 0===i||i.domNode.classList.add(r)}this.currentDragFeedbackDisposable=it(()=>{var e;for(const t of o){const i=this.items[t];i.dropTarget=!1,null===(e=i.row)||void 0===e||e.domNode.classList.remove(r)}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=co(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&(null===(i=(t=this.dnd).onDragLeave)||void 0===i||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,XO.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,XO.CurrentDragAndDropData=void 0,null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=st.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=function(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==e.ownerDocument.body&&e!==e.ownerDocument.documentElement;){i-=e.scrollTop;const s=fa(e)?null:na(e);s&&(n-="rtl"!==s.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=oa.getBorderLeftWidth(e),i+=oa.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}(this.domNode).top;this.dragOverAnimationDisposable=function(e,t){const i=()=>{t(),n=ea(e,i)};let n=ea(e,i);return it(()=>n.dispose())}(Fr(this.domNode),this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=co(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(void 0===t)return;const i=e.offsetY/this.items[t].size;return II(Math.floor(i/.25),0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const n=this.getRenderRange(e,t);let s,o;e===this.elementTop(n.start)?(s=n.start,o=0):n.end-n.start>1&&(s=n.start+1,o=this.elementTop(s)-e);let r=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e<a.end;e++){const t=this.probeDynamicHeight(e);0!==t&&this.rangeMap.splice(e,1,[this.items[e]]),r+=t,l=l||0!==t}if(!l){0!==r&&this.eventuallyUpdateScrollDimensions();const t=bO.relativeComplement(n,a);for(const e of t)for(let t=e.start;t<e.end;t++)this.items[t].row&&this.removeItemFromDOM(t);const l=bO.relativeComplement(a,n).reverse();for(const e of l)for(let t=e.end-1;t>=e.start;t--)this.insertItemInDOM(t);for(let e=a.start;e<a.end;e++)this.items[e].row&&this.updateItemInDOM(this.items[e],e);if("number"==typeof s){const t=this.scrollable.getFutureScrollPosition().scrollTop-e,n=this.elementTop(s)-o+t;this.setScrollTop(n,i)}return void this._onDidChangeContentHeight.fire(this.contentHeight)}}}probeDynamicHeight(e){var t,i,n;const s=this.items[e];if(this.virtualDelegate.getDynamicHeight){const e=this.virtualDelegate.getDynamicHeight(s.element);if(null!==e){const t=s.size;return s.size=e,s.lastDynamicHeightWidth=this.renderWidth,e-t}}if(!s.hasDynamicHeight||s.lastDynamicHeightWidth===this.renderWidth)return 0;if(this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(s.element))return 0;const o=s.size;if(s.row)return s.row.domNode.style.height="",s.size=s.row.domNode.offsetHeight,s.lastDynamicHeightWidth=this.renderWidth,s.size-o;const{row:r}=this.cache.alloc(s.templateId);r.domNode.style.height="",this.rowsContainer.appendChild(r.domNode);const a=this.renderers.get(s.templateId);if(!a)throw new $e("Missing renderer for templateId: "+s.templateId);return a.renderElement(s.element,e,r.templateData,void 0),s.size=r.domNode.offsetHeight,null===(t=a.disposeElement)||void 0===t||t.call(a,s.element,e,r.templateData,void 0),null===(n=(i=this.virtualDelegate).setDynamicHeight)||void 0===n||n.call(i,s.element,s.size),s.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(r.domNode),this.cache.release(r),s.size-o}getElementDomId(e){return`${this.domId}_${e}`}dispose(){var e,t;for(const t of this.items)if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.row.templateId);i&&(null===(e=i.disposeElement)||void 0===e||e.call(i,t.element,-1,t.row.templateData,void 0),i.disposeTemplate(t.row.templateData))}this.items=[],this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),null===(t=this.dragOverAnimationDisposable)||void 0===t||t.dispose(),this.disposables.dispose()}}sR.InstanceCount=0,QO([Fb],sR.prototype,"onMouseClick",null),QO([Fb],sR.prototype,"onMouseDblClick",null),QO([Fb],sR.prototype,"onMouseMiddleClick",null),QO([Fb],sR.prototype,"onMouseDown",null),QO([Fb],sR.prototype,"onMouseOver",null),QO([Fb],sR.prototype,"onMouseOut",null),QO([Fb],sR.prototype,"onContextMenu",null),QO([Fb],sR.prototype,"onTouchStart",null),QO([Fb],sR.prototype,"onTap",null);var oR,rR,aR=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};class lR{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return"template:"+this.trait.name}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex(e=>e.templateData===i);if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const s of this.renderedElements)s.index<e?n.push(s):s.index>=e+t&&n.push({index:s.index+i-t,templateData:s.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(t=>t.templateData===e);t<0||this.renderedElements.splice(t,1)}}class hR{get name(){return this._trait}get renderer(){return new lR(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new ft,this.onChange=this._onChange.event}splice(e,t,i){const n=i.length-t,s=e+t,o=[];let r=0;for(;r<this.sortedIndexes.length&&this.sortedIndexes[r]<e;)o.push(this.sortedIndexes[r++]);for(let t=0;t<i.length;t++)i[t]&&o.push(t+e);for(;r<this.sortedIndexes.length&&this.sortedIndexes[r]>=s;)o.push(this.sortedIndexes[r++]+n);this.renderer.splice(e,t,i.length),this._set(o,o)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(NR),t)}_set(e,t,i){const n=this.indexes,s=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const o=ER(s,e);return this.renderer.renderIndexes(o),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return t=this.sortedIndexes,i=e,n=NR,function(e,t){let i=0,n=e-1;for(;i<=n;){const e=(i+n)/2|0,s=t(e);if(s<0)i=e+1;else{if(!(s>0))return e;n=e-1}}return-(i+1)}(t.length,e=>n(t[e],i))>=0;var t,i,n}dispose(){et(this._onChange)}}aR([Fb],hR.prototype,"renderer",null);class dR extends hR{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class cR{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const n=this.trait.get().map(e=>this.identityProvider.getId(this.view.element(e)).toString());if(0===n.length)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=new Set(n),o=i.map(e=>s.has(this.identityProvider.getId(e).toString()));this.trait.splice(e,t,o)}}function uR(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function gR(e,t){return!!e.classList.contains(t)||!e.classList.contains("monaco-list")&&(!!e.parentElement&&gR(e.parentElement,t))}function mR(e){return gR(e,"monaco-editor")}function fR(e){return gR(e,"monaco-tree-sticky-row")}function pR(e){return e.classList.contains("monaco-tree-sticky-container")}class _R{get onKeyDown(){return dt.chain(this.disposables.add(new dC(this.view.domNode,"keydown")).event,e=>e.filter(e=>!uR(e.target)).map(e=>new Xs(e)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new nt,this.multipleSelectionDisposables=new nt,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(e=>{switch(e.keyCode){case 3:return this.onEnter(e);case 16:return this.onUpArrow(e);case 18:return this.onDownArrow(e);case 11:return this.onPageUpArrow(e);case 12:return this.onPageDownArrow(e);case 9:return this.onEscape(e);case 31:this.multipleSelectionSupport&&(K.i?e.metaKey:e.ctrlKey)&&this.onCtrlA(e)}}))}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(u(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}aR([Fb],_R.prototype,"onKeyDown",null),function(e){e[e.Automatic=0]="Automatic",e[e.Trigger=1]="Trigger"}(oR||(oR={})),function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"}(rR||(rR={}));const vR=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=98&&e.keyCode<=107||e.keyCode>=85&&e.keyCode<=95)}};class bR{constructor(e,t,i,n,s){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=s,this.enabled=!1,this.state=rR.Idle,this.mode=oR.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new nt,this.disposables=new nt,this.updateOptions(e.options)}updateOptions(e){var t,i;null===(t=e.typeNavigationEnabled)||void 0===t||t?this.enable():this.disable(),this.mode=null!==(i=e.typeNavigationMode)&&void 0!==i?i:oR.Automatic}enable(){if(this.enabled)return;let e=!1;const t=dt.chain(this.enabledDisposables.add(new dC(this.view.domNode,"keydown")).event,t=>t.filter(e=>!uR(e.target)).filter(()=>this.mode===oR.Automatic||this.triggered).map(e=>new Xs(e)).filter(t=>e||this.keyboardNavigationEventFilter(t)).filter(e=>this.delegate.mightProducePrintableCharacter(e)).forEach(e=>Oa(e,!0)).map(e=>e.browserEvent.key)),i=dt.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);dt.reduce(dt.any(t,i),(e,t)=>null===t?null:(e||"")+t,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=null===(e=this.list.options.accessibilityProvider)||void 0===e?void 0:e.getAriaLabel(this.list.element(t[0]));i&&Cf(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=rR.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===rR.Idle?1:0;this.state=rR.Typing;for(let t=0;t<this.list.length;t++){const s=(i+t+n)%this.list.length,o=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(s)),r=o&&o.toString();if(this.list.options.typeNavigationEnabled){if(void 0!==r){if(FT(e,r))return this.previouslyFocused=i,this.list.setFocus([s]),void this.list.reveal(s);const t=JT(e,r);if(t){if(t[0].end-t[0].start>1&&1===t.length)return this.previouslyFocused=i,this.list.setFocus([s]),void this.list.reveal(s)}}}else if(void 0===r||FT(e,r))return this.previouslyFocused=i,this.list.setFocus([s]),void this.list.reveal(s)}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class CR{constructor(e,t){this.list=e,this.view=t,this.disposables=new nt;const i=dt.chain(this.disposables.add(new dC(t.domNode,"keydown")).event,e=>e.filter(e=>!uR(e.target)).map(e=>new Xs(e)));dt.chain(i,e=>e.filter(e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!(n&&n instanceof HTMLElement&&-1!==n.tabIndex))return;const s=Fr(n).getComputedStyle(n);"hidden"!==s.visibility&&"none"!==s.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function wR(e){return K.i?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function yR(e){return e.browserEvent.shiftKey}const SR={isSelectionSingleChangeEvent:wR,isSelectionRangeChangeEvent:yR};class LR{constructor(e){this.list=e,this.disposables=new nt,this._onPointer=new ft,this.onPointer=this._onPointer.event,!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||SR),this.mouseSupport=void 0===e.options.mouseSupport||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Vb.addTarget(e.getHTMLElement()))),dt.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||SR))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){mR(e.browserEvent.target)||va()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(uR(e.browserEvent.target)||mR(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(uR(e.browserEvent.target)||mR(e.browserEvent.target))return;if(e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),Ia(i=e.browserEvent)&&2===i.button||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e));var i}onDoubleClick(e){if(uR(e.browserEvent.target)||mR(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;if(e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(void 0===i){const e=this.list.getFocus()[0];i=null!=e?e:t,this.list.setAnchor(i)}const n=u(Math.min(i,t),Math.max(i,t)+1),s=this.list.getSelection(),o=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let s=i-1;for(;s>=0&&e[s]===t-(i-s);)n.push(e[s--]);n.reverse(),s=i;for(;s<e.length&&e[s]===t+(s-i);)n.push(e[s++]);return n}(ER(s,[i]),i);if(0===o.length)return;const r=ER(n,function(e,t){const i=[];let n=0,s=0;for(;n<e.length||s<t.length;)if(n>=e.length)i.push(t[s++]);else if(s>=t.length)i.push(e[n++]);else{if(e[n]===t[s]){n++,s++;continue}e[n]<t[s]?i.push(e[n++]):s++}return i}(s,o));this.list.setSelection(r,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const i=this.list.getSelection(),n=i.filter(e=>e!==t);this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class kR{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const n=this.selectorSuffix&&"."+this.selectorSuffix,s=[];e.listBackground&&s.push(`.monaco-list${n} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(s.push(`.monaco-list${n}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),s.push(`.monaco-list${n}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&s.push(`.monaco-list${n}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(s.push(`.monaco-list${n}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),s.push(`.monaco-list${n}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&s.push(`.monaco-list${n}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&s.push(`.monaco-list${n}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&s.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&s.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(s.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),s.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&s.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(s.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),s.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(s.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),s.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&s.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&s.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&s.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const o=Ya(e.listFocusAndSelectionOutline,Ya(e.listSelectionOutline,null!==(t=e.listFocusOutline)&&void 0!==t?t:""));o&&s.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),e.listFocusOutline&&s.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t\t.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`);const r=Ya(e.listSelectionOutline,null!==(i=e.listInactiveFocusOutline)&&void 0!==i?i:"");r&&s.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${r}; outline-offset: -1px; }`),e.listSelectionOutline&&s.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&s.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&s.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&s.push(`\n\t\t\t\t.monaco-list${n}.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; }\n\t\t\t`),e.listDropBetweenBackground&&(s.push(`\n\t\t\t.monaco-list${n} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,\n\t\t\t.monaco-list${n} .monaco-list-row.drop-target-before::before {\n\t\t\t\tcontent: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;\n\t\t\t\tbackground-color: ${e.listDropBetweenBackground};\n\t\t\t}`),s.push(`\n\t\t\t.monaco-list${n} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,\n\t\t\t.monaco-list${n} .monaco-list-row.drop-target-after::after {\n\t\t\t\tcontent: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;\n\t\t\t\tbackground-color: ${e.listDropBetweenBackground};\n\t\t\t}`)),e.tableColumnsBorder&&s.push(`\n\t\t\t\t.monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t\t}\n\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: transparent;\n\t\t\t\t}\n\t\t\t`),e.tableOddRowsBackgroundColor&&s.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`),this.styleElement.textContent=s.join("\n")}}const DR={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:Ug.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:Ug.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:Ug.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},xR={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}}};function ER(e,t){const i=[];let n=0,s=0;for(;n<e.length||s<t.length;)if(n>=e.length)i.push(t[s++]);else if(s>=t.length)i.push(e[n++]);else{if(e[n]===t[s]){i.push(e[n]),n++,s++;continue}e[n]<t[s]?i.push(e[n++]):i.push(t[s++])}return i}const NR=(e,t)=>e-t;class IR{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let s=0;for(const o of this.renderers)o.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){var s;let o=0;for(const r of this.renderers)null===(s=r.disposeElement)||void 0===s||s.call(r,e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class TR{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const s=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof s?i.setAttribute("aria-level",""+s):i.removeAttribute("aria-level")}disposeTemplate(e){}}class MR{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,e,t)}onDragOver(e,t,i,n,s){return this.dnd.onDragOver(e,t,i,n,s)}onDragLeave(e,t,i,n){var s,o;null===(o=(s=this.dnd).onDragLeave)||void 0===o||o.call(s,e,t,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}drop(e,t,i,n,s){this.dnd.drop(e,t,i,n,s)}dispose(){this.dnd.dispose()}}class AR{get onDidChangeFocus(){return dt.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return dt.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=dt.chain(this.disposables.add(new dC(this.view.domNode,"keydown")).event,t=>t.map(e=>new Xs(e)).filter(t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode).map(e=>Oa(e,!0)).filter(()=>!1)),i=dt.chain(this.disposables.add(new dC(this.view.domNode,"keyup")).event,t=>t.forEach(()=>e=!1).map(e=>new Xs(e)).filter(e=>58===e.keyCode||e.shiftKey&&68===e.keyCode).map(e=>Oa(e,!0)).map(({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0;return{index:i,element:void 0!==i?this.view.element(i):void 0,anchor:void 0!==i?this.view.domElement(i):this.view.domNode,browserEvent:e}})),n=dt.chain(this.view.onContextMenu,t=>t.filter(t=>!e).map(({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:new to(Fr(this.view.domNode),i),browserEvent:i})));return dt.any(t,i,n)}get onKeyDown(){return this.disposables.add(new dC(this.view.domNode,"keydown")).event}get onDidFocus(){return dt.signal(this.disposables.add(new dC(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return dt.signal(this.disposables.add(new dC(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,s=xR){var o,r,a,l;this.user=e,this._options=s,this.focus=new hR("focused"),this.anchor=new hR("anchor"),this.eventBufferer=new wt,this._ariaLabel="",this.disposables=new nt,this._onDidDispose=new ft,this.onDidDispose=this._onDidDispose.event;const h=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(o=this._options.accessibilityProvider)||void 0===o?void 0:o.getWidgetRole():"list";this.selection=new dR("listbox"!==h);const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(d.push(new TR(this.accessibilityProvider)),null===(a=(r=this.accessibilityProvider).onDidChangeActiveDescendant)||void 0===a||a.call(r,this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(e=>new IR(e.templateId,[...d,e]));const c={...s,dnd:s.dnd&&new MR(this,s.dnd)};if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",h),s.styleController)this.styleController=s.styleController(this.view.domId);else{const e=Sa(this.view.domNode);this.styleController=new kR(e,this.view.domId)}if(this.spliceable=new jO([new cR(this.focus,this.view,s.identityProvider),new cR(this.selection,this.view,s.identityProvider),new cR(this.anchor,this.view,s.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new CR(this,this.view)),("boolean"!=typeof s.keyboardSupport||s.keyboardSupport)&&(this.keyboardController=new _R(this,this.view,s),this.disposables.add(this.keyboardController)),s.keyboardNavigationLabelProvider){const e=s.keyboardNavigationDelegate||vR;this.typeNavigationController=new bR(this,this.view,s.keyboardNavigationLabelProvider,null!==(l=s.keyboardNavigationEventFilter)&&void 0!==l?l:()=>!0,e),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(s),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new sR(e,t,i,n)}createMouseController(e){return new LR(this)}updateOptions(e={}){var t,i;this._options={...this._options,...e},null===(t=this.typeNavigationController)||void 0===t||t.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),null===(i=this.keyboardController)||void 0===i||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new qO(this.user,"Invalid start index: "+e);if(t<0)throw new qO(this.user,"Invalid delete count: "+t);0===t&&0===i.length||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const t of e)if(t<0||t>=this.length)throw new qO(this.user,"Invalid index "+t);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(void 0!==e){if(e<0||e>=this.length)throw new qO(this.user,"Invalid index "+e);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return c(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(const t of e)if(t<0||t>=this.length)throw new qO(this.user,"Invalid index "+t);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const s=this.focus.get(),o=this.findNextIndex(s.length>0?s[0]+e:0,t,n);o>-1&&this.setFocus([o],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const s=this.focus.get(),o=this.findPreviousIndex(s.length>0?s[0]-e:0,t,n);o>-1&&this.setFocus([o],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.getFocus()[0];if(n!==i&&(void 0===n||i>n)){const s=this.findPreviousIndex(i,!1,t);s>-1&&n!==s?this.setFocus([s],e):this.setFocus([i],e)}else{const s=this.view.getScrollTop();let o=s+this.view.renderHeight;i>n&&(o-=this.view.elementHeight(i)),this.view.setScrollTop(o),this.view.getScrollTop()!==s&&(this.setFocus([]),await ho(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=(()=>0)){let n;const s=i(),o=this.view.getScrollTop()+s;n=0===o?this.view.indexAt(o):this.view.indexAfter(o-1);const r=this.getFocus()[0];if(r!==n&&(void 0===r||r>=n)){const i=this.findNextIndex(n,!1,t);i>-1&&r!==i?this.setFocus([i],e):this.setFocus([n],e)}else{const n=o;this.view.setScrollTop(o-this.view.renderHeight-s),this.view.getScrollTop()+i()!==n&&(this.setFocus([]),await ho(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(0===this.length)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(0===this.length)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e>=this.length&&!t)return-1;if(e%=this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!i||i(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map(e=>this.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new qO(this.user,"Invalid index "+e);const n=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(E(t)){const e=o-this.view.renderHeight+i;this.view.setScrollTop(e*II(t,0,1)+s-i)}else{const e=s+o,t=n+this.view.renderHeight;s<n+i&&e>=t||(s<n+i||e>=t&&o>=this.view.renderHeight?this.view.setScrollTop(s-i):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new qO(this.user,"Invalid index "+e);const i=this.view.getScrollTop(),n=this.view.elementTop(e),s=this.view.elementHeight(e);if(n<i+t||n+s>i+this.view.renderHeight)return null;const o=s-this.view.renderHeight+t;return Math.abs((i+t-n)/o)}isDOMFocused(){return ba(this.view.domNode)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(e=>this.view.element(e)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;(null===(e=this.accessibilityProvider)||void 0===e?void 0:e.getActiveDescendantId)&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}aR([Fb],AR.prototype,"onDidChangeFocus",null),aR([Fb],AR.prototype,"onDidChangeSelection",null),aR([Fb],AR.prototype,"onContextMenu",null),aR([Fb],AR.prototype,"onKeyDown",null),aR([Fb],AR.prototype,"onDidFocus",null),aR([Fb],AR.prototype,"onDidBlur",null);i("PGCd");const OR=Ka;class RR{get templateId(){return"selectOption.entry.template"}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Fa(e,OR(".option-text")),t.detail=Fa(e,OR(".option-detail")),t.decoratorRight=Fa(e,OR(".option-decorator-right")),t}renderElement(e,t,i){const n=i,s=e.text,o=e.detail,r=e.decoratorRight,a=e.isDisabled;n.text.textContent=s,n.detail.textContent=o||"",n.decoratorRight.innerText=r||"",a?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class PR extends st{constructor(e,t,i,n,s){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=s||Object.create(null),"number"!=typeof this.selectBoxOptions.minBottomMargin?this.selectBoxOptions.minBottomMargin=PR.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._hover=this._register(UO(zO("mouse"),this.selectElement,"")),this._onDidSelect=new ft,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return"selectOption.entry.template"}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=Ka(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Fa(this.selectDropDownContainer,OR(".select-box-details-pane"));const t=Fa(this.selectDropDownContainer,OR(".select-box-dropdown-container-width-control")),i=Fa(t,OR(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Fa(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Sa(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(Zr(this.selectDropDownContainer,Ma.DRAG_START,e=>{Oa(e,!0)}))}registerListeners(){let e;this._register(Qr(this.selectElement,"change",e=>{this.selected=e.target.selectedIndex,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this._hover.update(this.options[this.selected].text)})),this._register(Zr(this.selectElement,Ma.CLICK,e=>{Oa(e),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(Zr(this.selectElement,Ma.MOUSE_DOWN,e=>{Oa(e)})),this._register(Zr(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(Zr(this.selectElement,"touchend",t=>{Oa(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(Zr(this.selectElement,Ma.KEY_DOWN,e=>{const t=new Xs(e);let i=!1;K.i?18!==t.keyCode&&16!==t.keyCode&&10!==t.keyCode&&3!==t.keyCode||(i=!0):(18===t.keyCode&&t.altKey||16===t.keyCode&&t.altKey||10===t.keyCode||3===t.keyCode)&&(i=!0),i&&(this.showSelectDropDown(),Oa(e,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){s(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled)),"string"==typeof e.description&&(this._hasDetails=!0)})),void 0!==t&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;null===(e=this.selectList)||void 0===e||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this._hover.update(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join("\n")}styleSelectElement(){var e,t,i;const n=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",s=null!==(t=this.styles.selectForeground)&&void 0!==t?t:"",o=null!==(i=this.styles.selectBorder)&&void 0!==i?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=s,this.selectElement.style.borderColor=o}styleList(){var e,t;const i=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",n=Ya(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const s=null!==(t=this.styles.focusBorder)&&void 0!==t?t:"";this.selectDropDownContainer.style.outlineColor=s,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",this.contextViewProvider&&!this._isVisible&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){this.contextViewProvider&&this._isVisible&&(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch(e){}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Fr(this.selectElement),i=aa(this.selectElement),n=Fr(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),o=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),r=i.top-PR.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),h=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=h,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&void 0===this._cachedMaxDetailsHeight&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const c=this._hasDetails?this._cachedMaxDetailsHeight:0,u=d+s+c,g=Math.floor((o-s-c)/this.getHeight()),m=Math.floor((r-s-c)/this.getHeight());if(e)return!(i.top+i.height>t.innerHeight-22||i.top<PR.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||g<1&&m<1)&&(g<PR.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&m>g&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.top<PR.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||0===this._dropDownPosition&&g<1||1===this._dropDownPosition&&m<1)return this.hideSelectDropDown(!0),!1;if(0===this._dropDownPosition){if(this._isVisible&&g+m<1)return this.hideSelectDropDown(!0),!1;u>o&&(d=g*this.getHeight())}else u>r&&(d=m*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=h,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach((e,t)=>{const s=e.detail?e.detail.length:0,o=e.decoratorRight?e.decoratorRight.length:0,r=e.text.length+s+o;r>n&&(i=t,n=r)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=ha(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Fa(e,OR(".select-box-dropdown-list-container")),this.listRenderer=new RR,this.selectList=new AR("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:e=>{let t=e.text;return e.detail&&(t+=". "+e.detail),e.decoratorRight&&(t+=". "+e.decoratorRight),e.description&&(t+=". "+e.description),t},getWidgetAriaLabel:()=>Object(J.b)({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>K.i?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new dC(this.selectDropDownListContainer,"keydown")),i=dt.chain(t.event,e=>e.filter(()=>this.selectList.length>0).map(e=>new Xs(e)));this._register(dt.chain(i,e=>e.filter(e=>3===e.keyCode))(this.onEnter,this)),this._register(dt.chain(i,e=>e.filter(e=>2===e.keyCode))(this.onEnter,this)),this._register(dt.chain(i,e=>e.filter(e=>9===e.keyCode))(this.onEscape,this)),this._register(dt.chain(i,e=>e.filter(e=>16===e.keyCode))(this.onUpArrow,this)),this._register(dt.chain(i,e=>e.filter(e=>18===e.keyCode))(this.onDownArrow,this)),this._register(dt.chain(i,e=>e.filter(e=>12===e.keyCode))(this.onPageDown,this)),this._register(dt.chain(i,e=>e.filter(e=>11===e.keyCode))(this.onPageUp,this)),this._register(dt.chain(i,e=>e.filter(e=>14===e.keyCode))(this.onHome,this)),this._register(dt.chain(i,e=>e.filter(e=>13===e.keyCode))(this.onEnd,this)),this._register(dt.chain(i,e=>e.filter(e=>e.keyCode>=21&&e.keyCode<=56||e.keyCode>=85&&e.keyCode<=113))(this.onCharacter,this)),this._register(Zr(this.selectList.getHTMLElement(),Ma.POINTER_UP,e=>this.onPointerUp(e))),this._register(this.selectList.onMouseOver(e=>void 0!==e.index&&this.selectList.setFocus([e.index]))),this._register(this.selectList.onDidChangeFocus(e=>this.onListFocus(e))),this._register(Zr(this.selectDropDownContainer,Ma.FOCUS_OUT,e=>{this._isVisible&&!ga(e.relatedTarget,this.selectDropDownContainer)&&this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;Oa(e);const t=e.target;if(!t)return;if(t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),s=i.classList.contains("option-disabled");n>=0&&n<this.options.length&&!s&&(this.selected=n,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&this._hover.update(this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,t){const i=e=>{for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes.item(t);"img"===(n.tagName&&n.tagName.toLowerCase())?e.removeChild(n):i(n)}},n=AM({value:e,supportThemeIcons:!0},{actionHandler:t});return n.element.classList.add("select-box-description-markdown"),i(n.element),n.element}onListFocus(e){this._isVisible&&this._hasDetails&&this.updateDetail(e.indexes[0])}updateDetail(e){var t,i;this.selectionDetailsPane.innerText="";const n=this.options[e],s=null!==(t=null==n?void 0:n.description)&&void 0!==t?t:"",o=null!==(i=null==n?void 0:n.descriptionIsMarkdown)&&void 0!==i&&i;if(s){if(o){const e=n.descriptionMarkdownActionHandler;this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(s,e))}else this.selectionDetailsPane.innerText=s;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){Oa(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){Oa(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&this._hover.update(this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){Oa(e,!0);const t=this.options[this.selected+1].isDisabled;if(t&&this.options.length>this.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){if(this.selected>0){Oa(e,!0);this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onPageUp(e){Oa(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onPageDown(e){Oa(e),this.selectList.focusNextPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){Oa(e),this.options.length<2||(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){Oa(e),this.options.length<2||(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Wt.toString(e.keyCode);let i=-1;for(let n=0;n<this.options.length-1;n++)if(i=(n+this.selected+1)%this.options.length,this.options[i].text.charAt(0).toUpperCase()===t&&!this.options[i].isDisabled){this.select(i),this.selectList.setFocus([i]),this.selectList.reveal(this.selectList.getFocus()[0]),Oa(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}}PR.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32,PR.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2,PR.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3;class FR extends st{constructor(e,t,i,n){super(),this.selected=0,this.selectBoxOptions=n||Object.create(null),this.options=[],this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new ft),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(Vb.addTarget(this.selectElement)),[Bb.Tap].forEach(e=>{this._register(Zr(this.selectElement,e,e=>{this.selectElement.focus()}))}),this._register(Qr(this.selectElement,"click",e=>{Oa(e,!0)})),this._register(Qr(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Qr(this.selectElement,"keydown",e=>{let t=!1;K.i?18!==e.keyCode&&16!==e.keyCode&&10!==e.keyCode||(t=!0):(18===e.keyCode&&e.altKey||10===e.keyCode||3===e.keyCode)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){this.options&&s(this.options,e)||(this.options=e,this.selectElement.options.length=0,this.options.forEach((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled))})),void 0!==t&&this.select(t)}select(e){0===this.options.length?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&"string"==typeof this.options[this.selected].text?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=""}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add("select-container"),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){var e,t,i;this.selectElement&&(this.selectElement.style.backgroundColor=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",this.selectElement.style.color=null!==(t=this.styles.selectForeground)&&void 0!==t?t:"",this.selectElement.style.borderColor=null!==(i=this.styles.selectBorder)&&void 0!==i?i:"")}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}}i("mBeV");class BR extends Hb{constructor(e,t,i,n,s){super(),K.i&&!(null==s?void 0:s.useCustomDrawn)?this.selectBoxDelegate=new FR(e,t,n,s):this.selectBoxDelegate=new PR(e,t,i,n,s),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,t){this.selectBoxDelegate.setOptions(e,t)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}}i("eZvg");class WR extends st{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof kl&&this._register(t.onDidChange(e=>{this.element&&this.handleActionChangeEvent(e)}))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new Dl)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Vb.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,Fs&&this._register(Zr(e,Ma.DRAG_START,e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(BO.TEXT,this._action.label)}))),this._register(Zr(t,Bb.Tap,e=>this.onClick(e,!0))),this._register(Zr(t,Ma.MOUSE_DOWN,e=>{i||Oa(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")})),K.i&&this._register(Zr(t,Ma.CONTEXT_MENU,e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)})),this._register(Zr(t,Ma.CLICK,e=>{Oa(e,!0),this.options&&this.options.isMenu||this.onClick(e)})),this._register(Zr(t,Ma.DBLCLICK,e=>{Oa(e,!0)})),[Ma.MOUSE_UP,Ma.MOUSE_OUT].forEach(e=>{this._register(Zr(t,e,e=>{Oa(e),t.classList.remove("active")}))})}onClick(e,t=!1){var i;Oa(e,!0);const n=A(this._context)?(null===(i=this.options)||void 0===i?void 0:i.useEventAsContext)?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,n)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){var e,t,i;if(!this.element)return;const n=null!==(e=this.getTooltip())&&void 0!==e?e:"";if(this.updateAriaLabel(),null===(t=this.options.hoverDelegate)||void 0===t?void 0:t.showNativeHover)this.element.title=n;else if(this.customHover)this.customHover.update(n);else{const e=null!==(i=this.options.hoverDelegate)&&void 0!==i?i:zO("element");this.customHover=UO(e,this.element,n),this._store.add(this.customHover)}}updateAriaLabel(){var e;if(this.element){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class VR extends WR{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass=""}render(e){super.render(e),O(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const e=document.createElement("span");e.classList.add("keybinding"),e.textContent=this.options.keybinding,this.element.appendChild(e)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===xl.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=J.b({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),null!=e?e:void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):null===(e=this.label)||void 0===e||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),null===(e=this.element)||void 0===e||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),null===(t=this.element)||void 0===t||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(void 0!==this.action.checked?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class HR extends WR{constructor(e,t,i,n,s,o,r){super(e,t),this.selectBox=new BR(i,n,s,o,r),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;null===(e=this.selectBox)||void 0===e||e.focus()}blur(){var e;null===(e=this.selectBox)||void 0===e||e.blur()}render(e){this.selectBox.render(e)}}i("4pZI");class zR extends Dl{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new ft),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Fa(e,Ka(".monaco-dropdown")),this._label=Fa(this._element,Ka(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const e of[Ma.CLICK,Ma.MOUSE_DOWN,Bb.Tap])this._register(Zr(this.element,e,e=>Oa(e,!0)));for(const e of[Ma.MOUSE_DOWN,Bb.Tap])this._register(Zr(this._label,e,e=>{Ia(e)&&(e.detail>1||0!==e.button)||(this.visible?this.hide():this.show())}));this._register(Zr(this._label,Ma.KEY_UP,e=>{const t=new Xs(e);(t.equals(3)||t.equals(10))&&(Oa(e,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(Vb.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class KR extends zR{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class UR extends WR{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new ft),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>{this.element=Fa(e,Ka("a.action-label"));let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter(e=>!!e):this.options.classNames&&(t=this.options.classNames),t.find(e=>"icon"===e)||t.push("codicon"),this.element.classList.add(...t),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(UO(zO("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new KR(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility(e=>{var t;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",""+e),this._onDidChangeVisibility.fire(e)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return e.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),null!=e?e:void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;null===(e=this.dropdownMenu)||void 0===e||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;null===(e=this.actionItem)||void 0===e||e.classList.toggle("disabled",i),null===(t=this.element)||void 0===t||t.classList.toggle("disabled",i)}}var jR,qR;i("CmAR");!function(e){e[e.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",e[e.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"}(jR||(jR={})),function(e){e[e.None=0]="None",e[e.Initialized=1]="Initialized",e[e.Closed=2]="Closed"}(qR||(qR={}));class $R extends st{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new _t),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=qR.None,this.cache=new Map,this.flushDelayer=this._register(new lo($R.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{null===(t=e.changed)||void 0===t||t.forEach((e,t)=>this.acceptExternal(t,e)),null===(i=e.deleted)||void 0===i||i.forEach(e=>this.acceptExternal(e,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===qR.Closed)return;let i=!1;if(A(t))i=this.cache.delete(e);else{this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0)}i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return A(i)?t:i}getBoolean(e,t){const i=this.get(e);return A(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return A(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===qR.Closed)return;if(A(t))return this.delete(e,i);const n=D(t)||Array.isArray(t)?(s=t,JSON.stringify(s,TM)):String(t);var s;return this.cache.get(e)!==n?(this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()):void 0}async delete(e,t=!1){if(this.state===qR.Closed)return;return this.cache.delete(e)?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()):void 0}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var e;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)null===(e=this.whenFlushedCallbacks.pop())||void 0===e||e()})}async doFlush(e){return this.options.hint===jR.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}}$R.DEFAULT_FLUSH_DELAY=100;class GR{constructor(){this.onDidChangeItemsExternal=dt.None,this.items=new Map}async updateItems(e){var t,i;null===(t=e.insert)||void 0===t||t.forEach((e,t)=>this.items.set(t,e)),null===(i=e.delete)||void 0===i||i.forEach(e=>this.items.delete(e))}}const ZR="__$__targetStorageMarker",YR=wl("storageService");var QR;!function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(QR||(QR={}));class XR extends st{constructor(e={flushInterval:XR.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new _t),this._onDidChangeTarget=this._register(new _t),this._onWillSaveState=this._register(new ft),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return dt.filter(this._onDidChangeValue.event,i=>i.scope===e&&(void 0===t||i.key===t),i)}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===ZR){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}get(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getNumber(e,i)}store(e,t,i,n,s=!1){A(t)?this.remove(e,i,s):this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,i,n),null===(o=this.getStorage(i))||void 0===o||o.set(e,t,s)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var n;this.updateKeyTarget(e,t,void 0),null===(n=this.getStorage(t))||void 0===n||n.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,n=!1){var s,o;const r=this.getKeyTargets(t);"number"==typeof i?r[e]!==i&&(r[e]=i,null===(s=this.getStorage(t))||void 0===s||s.set(ZR,JSON.stringify(r),n)):"number"==typeof r[e]&&(delete r[e],null===(o=this.getStorage(t))||void 0===o||o.set(ZR,JSON.stringify(r),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?function(e){const t=e.get(ZR);if(t)try{return JSON.parse(t)}catch(e){}return Object.create(null)}(t):Object.create(null)}}XR.DEFAULT_FLUSH_INTERVAL=6e4;const JR={keybindingLabelBackground:qf(t_),keybindingLabelForeground:qf(i_),keybindingLabelBorder:qf(n_),keybindingLabelBottomBorder:qf(s_),keybindingLabelShadow:qf(ip)},eP={buttonForeground:qf(Sp),buttonSeparator:qf(Lp),buttonBackground:qf(kp),buttonHoverBackground:qf(Dp),buttonSecondaryForeground:qf(Ep),buttonSecondaryBackground:qf(Np),buttonSecondaryHoverBackground:qf(Ip),buttonBorder:qf(xp)},tP={progressBarBackground:qf(Fp)},iP={inputActiveOptionBorder:qf(ap),inputActiveOptionForeground:qf(hp),inputActiveOptionBackground:qf(lp)},nP=(qf(Y_),qf(X_),qf(Q_),qf($p),qf(Gp),qf(ip),qf(Jf),qf(Nv),qf(Iv),qf(Tv),qf(tp),{inputBackground:qf(sp),inputForeground:qf(op),inputBorder:qf(rp),inputValidationInfoBorder:qf(up),inputValidationInfoBackground:qf(dp),inputValidationInfoForeground:qf(cp),inputValidationWarningBorder:qf(fp),inputValidationWarningBackground:qf(gp),inputValidationWarningForeground:qf(mp),inputValidationErrorBorder:qf(vp),inputValidationErrorBackground:qf(pp),inputValidationErrorForeground:qf(_p)}),sP={listFilterWidgetBackground:qf(z_),listFilterWidgetOutline:qf(K_),listFilterWidgetNoMatchesOutline:qf(U_),listFilterWidgetShadow:qf(j_),inputBoxStyles:nP,toggleStyles:iP},oP={badgeBackground:qf(Tp),badgeForeground:qf(Mp),badgeBorder:qf(Jf)},rP=(qf(uv),qf(cv),qf(gv),qf(gv),qf(mv),{listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:qf(y_),listFocusForeground:qf(S_),listFocusOutline:qf(L_),listActiveSelectionBackground:qf(D_),listActiveSelectionForeground:qf(x_),listActiveSelectionIconForeground:qf(E_),listFocusAndSelectionOutline:qf(k_),listFocusAndSelectionBackground:qf(D_),listFocusAndSelectionForeground:qf(x_),listInactiveSelectionBackground:qf(N_),listInactiveSelectionIconForeground:qf(T_),listInactiveSelectionForeground:qf(I_),listInactiveFocusBackground:qf(M_),listInactiveFocusOutline:qf(A_),listHoverBackground:qf(O_),listHoverForeground:qf(R_),listDropOverBackground:qf(P_),listDropBetweenBackground:qf(F_),listSelectionOutline:qf(ep),listHoverOutline:qf(ep),treeIndentGuidesStroke:qf(q_),treeInactiveIndentGuidesStroke:qf($_),tableColumnsBorder:qf(G_),tableOddRowsBackgroundColor:qf(Z_)});function aP(e){return function(e,t){const i={...t};for(const t in e){const n=e[t];i[t]=void 0!==n?qf(n):void 0}return i}(e,rP)}const lP={selectBackground:qf(bp),selectListBackground:qf(Cp),selectForeground:qf(wp),decoratorRightForeground:qf(Jp),selectBorder:qf(yp),focusBorder:qf(Xf),listFocusBackground:qf(iv),listInactiveSelectionIconForeground:qf(tv),listFocusForeground:qf(ev),listFocusOutline:(hP=ep,dP=Ug.transparent.toString(),`var(${jf(hP)}, ${dP})`),listHoverBackground:qf(O_),listHoverForeground:qf(R_),listHoverOutline:qf(ep),selectListBorder:qf(Zp),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0};var hP,dP;const cP={shadowColor:qf(ip),borderColor:qf(nv),foregroundColor:qf(sv),backgroundColor:qf(ov),selectionForegroundColor:qf(rv),selectionBackgroundColor:qf(av),selectionBorderColor:qf(lv),separatorColor:qf(hv),scrollbarShadow:qf(Ap),scrollbarSliderBackground:qf(Op),scrollbarSliderHoverBackground:qf(Rp),scrollbarSliderActiveBackground:qf(Pp)};var uP=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},gP=function(e,t){return function(i,n){t(i,n,e)}};function mP(e,t,i,n=(e=>"navigation"===e),s=(()=>!1),o=!1){let r,a;Array.isArray(t)?(r=t,a=t):(r=t.primary,a=t.secondary);const l=new Set;for(const[t,s]of e){let e;n(t)?(e=r,e.length>0&&o&&e.push(new xl)):(e=a,e.length>0&&e.push(new xl));for(let n of s){i&&(n=n instanceof Hh&&n.alt?n.alt:n);const s=e.push(n);n instanceof El&&l.add({group:t,action:n,index:s-1})}}for(const{group:e,action:t,index:i}of l){const o=n(e)?r:a,l=t.actions;s(t,e,o.length)&&o.splice(i,1,...l)}}let fP=class extends VR{constructor(e,t,i,n,s,o,r,a){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon,draggable:null==t?void 0:t.draggable,keybinding:null==t?void 0:t.keybinding,hoverDelegate:null==t?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=s,this._themeService=o,this._contextMenuService=r,this._accessibilityService=a,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new ot),this._altKey=Xa.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(e){this._notificationService.error(e)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var e;const i=!!(null===(e=this._menuItemAction.alt)||void 0===e?void 0:e.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);i!==this._wantsAltCommand&&(this._wantsAltCommand=i,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(Zr(e,"mouseleave",e=>{t=!1,i()})),this._register(Zr(e,"mouseenter",e=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),n=this._commandAction.tooltip||this._commandAction.label;let s=i?Object(J.b)("titleAndKb","{0} ({1})",n,i):n;if(!this._wantsAltCommand&&(null===(e=this._menuItemAction.alt)||void 0===e?void 0:e.enabled)){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),i=t&&t.getLabel(),n=i?Object(J.b)("titleAndKb","{0} ({1})",e,i):e;s=Object(J.b)("titleAndKbAndAlt","{0}\n[{1}] {2}",s,UA.modifierLabels[K.a].altKey,n)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&((s=e.toggled)&&void 0!==s.condition)&&e.toggled.icon?e.toggled.icon:e.icon;var s;if(n)if(Ml.isThemeIcon(n)){const e=Ml.asClassNameArray(n);i.classList.add(...e),this._itemClassDispose.value=it(()=>{i.classList.remove(...e)})}else i.style.backgroundImage=cb(this._themeService.getColorTheme().type)?Ga(n.dark):Ga(n.light),i.classList.add("icon"),this._itemClassDispose.value=tt(it(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};fP=uP([gP(2,Iw),gP(3,HN),gP(4,vh),gP(5,DC),gP(6,LT),gP(7,Af)],fP);let pP=class extends UR{constructor(e,t,i,n,s){var o,r,a;const l={...t,menuAsChild:null!==(o=null==t?void 0:t.menuAsChild)&&void 0!==o&&o,classNames:null!==(r=null==t?void 0:t.classNames)&&void 0!==r?r:Ml.isThemeIcon(e.item.icon)?Ml.asClassName(e.item.icon):void 0,keybindingProvider:null!==(a=null==t?void 0:t.keybindingProvider)&&void 0!==a?a:e=>i.lookupKeybinding(e.id)};super(e,{getActions:()=>e.actions},n,l),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),O(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Ml.isThemeIcon(i)){this.element.classList.add("icon");const e=()=>{this.element&&(this.element.style.backgroundImage=cb(this._themeService.getColorTheme().type)?Ga(i.dark):Ga(i.light))};e(),this._register(this._themeService.onDidColorThemeChange(()=>{e()}))}}};pP=uP([gP(2,Iw),gP(3,LT),gP(4,DC)],pP);let _P=class extends WR{constructor(e,t,i,n,s,o,r,a){var l,h,d;let c;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=o,this._instaService=r,this._storageService=a,this._container=null,this._options=t,this._storageKey=e.item.submenu.id+"_lastActionId";const u=(null==t?void 0:t.persistLastActionId)?a.get(this._storageKey,1):void 0;u&&(c=e.actions.find(e=>u===e.id)),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(fP,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});const g={keybindingProvider:e=>this._keybindingService.lookupKeybinding(e.id),...t,menuAsChild:null===(l=null==t?void 0:t.menuAsChild)||void 0===l||l,classNames:null!==(h=null==t?void 0:t.classNames)&&void 0!==h?h:["codicon","codicon-chevron-down"],actionRunner:null!==(d=null==t?void 0:t.actionRunner)&&void 0!==d?d:new Dl};this._dropdown=new UR(e,e.actions,this._contextMenuService,g),this._register(this._dropdown.actionRunner.onDidRun(e=>{e.action instanceof Hh&&this.update(e.action)}))}update(e){var t;(null===(t=this._options)||void 0===t?void 0:t.persistLastActionId)&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(fP,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Dl{async runAction(e,t){await e.run(void 0)}},this._container&&this._defaultAction.render(Ba(this._container,Ka(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(null===(t=this._options)||void 0===t?void 0:t.renderKeybindingWithDefaultActionLabel){const t=this._keybindingService.lookupKeybinding(e.id);t&&(i=`(${t.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=Ka(".action-container");this._defaultAction.render(Fa(this._container,t)),this._register(Zr(t,Ma.KEY_DOWN,e=>{const t=new Xs(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())}));const i=Ka(".dropdown-action-container");this._dropdown.render(Fa(this._container,i)),this._register(Zr(i,Ma.KEY_DOWN,e=>{var t;const i=new Xs(e);i.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),null===(t=this._defaultAction.element)||void 0===t||t.focus(),i.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};_P=uP([gP(2,Iw),gP(3,HN),gP(4,LT),gP(5,Fh),gP(6,bl),gP(7,YR)],_P);let vP=class extends HR{constructor(e,t){super(null,e,e.actions.map(e=>({text:e.id===xl.ID?"─────────":e.label,isDisabled:!e.enabled})),0,t,lP,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(e=>e.checked)))}render(e){super.render(e),e.style.borderColor=qf(yp)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};vP=uP([gP(1,ST)],vP);class bP extends st{constructor(e,t={}){var i,n,s,o,r,a,l;let h,d;switch(super(),this._actionRunnerDisposables=this._register(new nt),this.viewItemDisposables=this._register(new at),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new ft),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new ft({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new ft),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new ft),this.onWillRun=this._onWillRun.event,this.options=t,this._context=null!==(i=t.context)&&void 0!==i?i:null,this._orientation=null!==(n=this.options.orientation)&&void 0!==n?n:0,this._triggerKeys={keyDown:null!==(o=null===(s=this.options.triggerKeys)||void 0===s?void 0:s.keyDown)&&void 0!==o&&o,keys:null!==(a=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keys)&&void 0!==a?a:[3,10]},this._hoverDelegate=null!==(l=t.hoverDelegate)&&void 0!==l?l:this._register(zO("element",!0)),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Dl,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(e=>this._onWillRun.fire(e))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",this._orientation){case 0:h=[15],d=[17];break;case 1:h=[16],d=[18],this.domNode.className+=" vertical"}this._register(Zr(this.domNode,Ma.KEY_DOWN,e=>{const t=new Xs(e);let i=!0;const n="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;h&&(t.equals(h[0])||t.equals(h[1]))?i=this.focusPrevious():d&&(t.equals(d[0])||t.equals(d[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?i=this.focusFirst():t.equals(13)?i=this.focusLast():t.equals(2)&&n instanceof WR&&n.trapsArrowNavigation?i=this.focusNext():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())})),this._register(Zr(this.domNode,Ma.KEY_UP,e=>{const t=new Xs(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026)||t.equals(16)||t.equals(18)||t.equals(15)||t.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(Pa(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{va()!==this.domNode&&ga(va(),this.domNode)||(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const e=this.viewItems.find(e=>e instanceof WR&&e.isEnabled());e instanceof WR&&e.setFocusable(!0)}else this.viewItems.forEach(e=>{e instanceof WR&&e.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){var e,t;for(let i=0;i<this.actionsList.children.length;i++){const n=this.actionsList.children[i];if(ga(va(),n)){this.focusedItem=i,null===(t=null===(e=this.viewItems[this.focusedItem])||void 0===e?void 0:e.showHover)||void 0===t||t.call(e);break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach(t=>t.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(e=>this._onWillRun.fire(e))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if("number"==typeof e)return null===(t=this.viewItems[e])||void 0===t?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t<this.actionsList.childNodes.length;t++)if(this.actionsList.childNodes[t]===e)return this.viewItems[t].action}}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=E(t.index)?t.index:null;i.forEach(e=>{const i=document.createElement("li");let s;i.className="action-item",i.setAttribute("role","presentation");const o={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(s=this.options.actionViewItemProvider(e,o)),s||(s=new VR(this.context,e,o)),this.options.allowContextMenu||this.viewItemDisposables.set(s,Zr(i,Ma.CONTEXT_MENU,e=>{Oa(e,!0)})),s.actionRunner=this._actionRunner,s.setActionContext(this.context),s.render(i),this.focusable&&s instanceof WR&&0===this.viewItems.length&&s.setFocusable(!0),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(s)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,s),n++)}),"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=et(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),$r(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return 0===this.viewItems.length}focus(e){let t=!1,i=void 0;if(void 0===e?t=!0:"number"==typeof e?i=e:"boolean"==typeof e&&(t=e),t&&void 0===this.focusedItem){const e=this.viewItems.findIndex(e=>e.isEnabled());this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==i&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(void 0===this.focusedItem)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===xl.ID));return this.updateFocus(),!0}focusPrevious(e){if(void 0===this.focusedItem)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===xl.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var n,s;void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&(null===(n=this.viewItems[this.previouslyFocusedItem])||void 0===n||n.blur());const o=void 0!==this.focusedItem?this.viewItems[this.focusedItem]:void 0;if(o){let n=!0;P(o.focus)||(n=!1),this.options.focusOnlyEnabledItems&&P(o.isEnabled)&&!o.isEnabled()&&(n=!1),o.action.id===xl.ID&&(n=!1),n?(i||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),n&&(null===(s=o.showHover)||void 0===s||s.call(o))}}doTrigger(e){if(void 0===this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof WR){const i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=et(this.viewItems),this.getContainer().remove(),super.dispose()}}const CP=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,wP=/(&amp;)?(&amp;)([^\s&])/g;var yP;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(yP||(yP={}));class SP extends bP{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const s=document.createElement("div");s.classList.add("monaco-menu"),s.setAttribute("role","presentation"),super(s,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...K.i||K.g?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=s,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(Vb.addTarget(s)),this._register(Zr(s,Ma.KEY_DOWN,e=>{new Xs(e).equals(2)&&e.preventDefault()})),i.enableMnemonics&&this._register(Zr(s,Ma.KEY_DOWN,e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){Oa(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof kP&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}})),K.g&&this._register(Zr(s,Ma.KEY_DOWN,e=>{const t=new Xs(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Oa(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Oa(e,!0))})),this._register(Zr(this.domNode,Ma.MOUSE_OUT,e=>{ga(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())})),this._register(Zr(this.actionsList,Ma.MOUSE_OVER,e=>{let t=e.target;if(t&&ga(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})),this._register(Vb.addTarget(this.actionsList)),this._register(Zr(this.actionsList,Bb.Tap,e=>{let t=e.initialTarget;if(t&&ga(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}));const o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new sC(s,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this.styleScrollElement(r,n),this._register(Zr(s,Bb.Change,e=>{Oa(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})})),this._register(Zr(r,Ma.MOUSE_UP,e=>{e.preventDefault()}));const a=Fr(e);s.style.maxHeight=Math.max(10,a.innerHeight-e.getBoundingClientRect().top-35)+"px",t=t.filter((e,n)=>{var s;if(null===(s=i.submenuIds)||void 0===s?void 0:s.has(e.id))return console.warn("Found submenu cycle: "+e.id),!1;if(e instanceof xl){if(n===t.length-1||0===n)return!1;if(t[n-1]instanceof xl)return!1}return!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(e=>!(e instanceof DP)).forEach((e,t,i)=>{e.updatePositionInSet(t+1,i.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(pa(e)?this.styleSheet=Sa(e):(SP.globalStyleSheet||(SP.globalStyleSheet=Sa()),this.styleSheet=SP.globalStyleSheet)),this.styleSheet.textContent=function(e,t){let i=`\n.monaco-menu {\n\tfont-size: 13px;\n\tborder-radius: 5px;\n\tmin-width: 160px;\n}\n\n${xP(Di.menuSelection)}\n${xP(Di.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid var(--vscode-menu-separatorBackground);\n\tpadding-top: 1px;\n\tpadding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n\tmargin: 0 4px;\n\tborder-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n\topacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\twidth: 100%;\n\theight: 0px !important;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tmargin: 5px 0 !important;\n\tpadding: 0;\n\tborder-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;if(t){i+="\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t";const t=e.scrollbarShadow;t&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);const n=e.scrollbarSliderBackground;n&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${n};\n\t\t\t\t}\n\t\t\t`);const s=e.scrollbarSliderHoverBackground;s&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${s};\n\t\t\t\t}\n\t\t\t`);const o=e.scrollbarSliderActiveBackground;o&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`)}return i}(t,pa(e))}styleScrollElement(e,t){var i,n;const s=null!==(i=t.foregroundColor)&&void 0!==i?i:"",o=null!==(n=t.backgroundColor)&&void 0!==n?n:"",r=t.borderColor?"1px solid "+t.borderColor:"",a=t.shadowColor?"0 2px 8px "+t.shadowColor:"";e.style.outline=r,e.style.borderRadius="5px",e.style.color=s,e.style.backgroundColor=o,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++){if(e===this.actionsList.children[t]){this.focusedItem=t;break}}}updateFocus(e){super.updateFocus(e,!0,!0),void 0!==this.focusedItem&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof xl)return new DP(t.context,e,{icon:!0},this.menuStyles);if(e instanceof El){const n=new kP(e,e.actions,i,{...t,submenuIds:new Set([...t.submenuIds||[],e.id])},this.menuStyles);if(t.enableMnemonics){const e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}{const i={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext};if(t.getKeyBinding){const n=t.getKeyBinding(e);if(n){const e=n.getLabel();e&&(i.keybinding=e)}}const n=new LP(t.context,e,i,this.menuStyles);if(t.enableMnemonics){const e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}}}class LP extends WR{constructor(e,t,i,n){if(i.isMenu=!0,super(t,t,i),this.menuStyle=n,this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass="",this.options.label&&i.enableMnemonics){const e=this.action.label;if(e){const t=CP.exec(e);t&&(this.mnemonic=(t[1]?t[1]:t[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new mo(()=>{this.element&&(this._register(Zr(this.element,Ma.MOUSE_UP,e=>{if(Oa(e,!0),Fs){if(new to(Fr(this.element),e).rightButton)return;this.onClick(e)}else setTimeout(()=>{this.onClick(e)},0)})),this._register(Zr(this.element,Ma.CONTEXT_MENU,e=>{Oa(e,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Fa(this.element,Ka("a.action-menu-item")),this._action.id===xl.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",""+this.mnemonic)),this.check=Fa(this.item,Ka("span.menu-item-check"+Ml.asCSSSelector(Di.menuSelection))),this.check.setAttribute("role","none"),this.label=Fa(this.item,Ka("span.action-label")),this.options.label&&this.options.keybinding&&(Fa(this.item,Ka("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),null===(e=this.item)||void 0===e||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",""+e),this.item.setAttribute("aria-setsize",""+t))}updateLabel(){var e;if(this.label&&this.options.label){$r(this.label);let t=vM(this.action.label);if(t){const i=function(e){const t=CP,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const n=CP.exec(t);if(n){t=Kn(t),wP.lastIndex=0;let i=wP.exec(t);for(;i&&i[1];)i=wP.exec(t);const s=e=>e.replace(/&amp;&amp;/g,"&amp;");i?this.label.append(jn(s(t.substr(0,i.index))," "),Ka("u",{"aria-hidden":"true"},i[3]),qn(s(t.substr(i.index+i[0].length))," ")):this.label.innerText=s(t).trim(),null===(e=this.item)||void 0===e||e.setAttribute("aria-keyshortcuts",(n[1]?n[1]:n[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),void 0!==e?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?"1px solid "+this.menuStyle.selectionBorderColor:"",s=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=null!=t?t:"",this.item.style.backgroundColor=null!=i?i:"",this.item.style.outline=n,this.item.style.outlineOffset=s),this.check&&(this.check.style.color=null!=t?t:"")}}class kP extends LP{constructor(e,t,i,n,s){super(e,e,n,s),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new nt),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:yP.Right,this.showScheduler=new mo(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new mo(()=>{this.element&&!ga(va(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=Fa(this.item,Ka("span.submenu-indicator"+Ml.asCSSSelector(Di.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(Zr(this.element,Ma.KEY_UP,e=>{const t=new Xs(e);(t.equals(17)||t.equals(3))&&(Oa(e,!0),this.createSubmenu(!0))})),this._register(Zr(this.element,Ma.KEY_DOWN,e=>{const t=new Xs(e);va()===this.item&&(t.equals(17)||t.equals(3))&&Oa(e,!0)})),this._register(Zr(this.element,Ma.MOUSE_OVER,e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(Zr(this.element,Ma.MOUSE_LEAVE,e=>{this.mouseOver=!1})),this._register(Zr(this.element,Ma.FOCUS_OUT,e=>{this.element&&!ga(va(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){Oa(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch(e){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const s={top:0,left:0};return s.left=wO(e.width,t.width,{position:n===yP.Right?0:1,offset:i.left,size:i.width}),s.left>=i.left&&s.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(s.left=i.left+10),i.top+=10,i.height=0),s.top=wO(e.height,t.height,{position:0,offset:i.top,size:0}),s.top+t.height===i.top&&s.top+i.height+t.height<=e.height&&(s.top+=i.height),s}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=Fa(this.element,Ka("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=Fr(this.parentData.parent.domNode).getComputedStyle(this.parentData.parent.domNode),i=parseFloat(t.paddingTop||"0")||0;this.submenuContainer.style.zIndex="1",this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.parentData.submenu=new SP(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new Nl],this.submenuOptions,this.menuStyle);const n=this.element.getBoundingClientRect(),s={top:n.top-i,left:n.left,height:n.height+2*i,width:n.width},o=this.submenuContainer.getBoundingClientRect(),r=Fr(this.element),{top:a,left:l}=this.calculateSubmenuMenuLayout(new ra(r.innerWidth,r.innerHeight),ra.lift(o),s,this.expandDirection);this.submenuContainer.style.left=l-o.left+"px",this.submenuContainer.style.top=a-o.top+"px",this.submenuDisposables.add(Zr(this.submenuContainer,Ma.KEY_UP,e=>{new Xs(e).equals(15)&&(Oa(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(Zr(this.submenuContainer,Ma.KEY_DOWN,e=>{new Xs(e).equals(15)&&Oa(e,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=null!=e?e:"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class DP extends VR{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?""+this.menuStyles.separatorColor:"")}}function xP(e){const t=ki()[e.id];return`.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`}class EP{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let i;this.focusToReturn=va();const n=e.domForShadowRoot instanceof HTMLElement?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:n=>{var s;this.lastContainer=n;const o=e.getMenuClassName?e.getMenuClassName():"";o&&(n.className+=" "+o),this.options.blockMouse&&(this.block=n.appendChild(Ka(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",null===(s=this.blockDisposable)||void 0===s||s.dispose(),this.blockDisposable=Zr(this.block,Ma.MOUSE_DOWN,e=>e.stopPropagation()));const r=new nt,a=e.actionRunner||new Dl;a.onWillRun(t=>this.onActionRun(t,!e.skipTelemetry),this,r),a.onDidRun(this.onDidActionRun,this,r),i=new SP(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:a,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)},cP),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,r),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,r);const l=Fr(n);return r.add(Zr(l,Ma.BLUR,()=>this.contextViewService.hideContextView(!0))),r.add(Zr(l,Ma.MOUSE_DOWN,e=>{if(e.defaultPrevented)return;const t=new to(l,e);let i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}})),tt(r,i)},focus:()=>{null==i||i.focus(!!e.autoSelectFirstItem)},onHide:t=>{var i,n,s;null===(i=e.onHide)||void 0===i||i.call(e,!!t),this.block&&(this.block.remove(),this.block=null),null===(n=this.blockDisposable)||void 0===n||n.dispose(),this.blockDisposable=null,this.lastContainer&&(va()===this.lastContainer||ga(va(),this.lastContainer))&&(null===(s=this.focusToReturn)||void 0===s||s.focus()),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!He(e.error)&&this.notificationService.error(e.error)}}var NP=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},IP=function(e,t){return function(i,n){t(i,n,e)}};let TP=class extends st{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new EP(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,o){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=o,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new ft),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new ft)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=MP.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;null===(i=e.onHide)||void 0===i||i.call(e,t),this._onDidHideContextMenu.fire()}}),Xa.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};var MP,AP;TP=NP([IP(0,zh),IP(1,HN),IP(2,ST),IP(3,Iw),IP(4,Fh),IP(5,vh)],TP),(MP||(MP={})).transform=function(e,t,i){if(!((n=e)&&n.menuId instanceof Ph))return e;var n;const{menuId:s,menuActionOptions:o,contextKeyService:r}=e;return{...e,getActions:()=>{const n=[];if(s){const e=t.createMenu(s,null!=r?r:i);!function(e,t,i,n){const s=e.getActions(t),o=Xa.getInstance();mP(s,i,o.keyStatus.altKey||(K.n||K.g)&&o.keyStatus.shiftKey,n?e=>e===n:e=>"navigation"===e)}(e,o,n),e.dispose()}return e.getActions?xl.join(e.getActions(),n):n}}},function(e){e[e.API=0]="API",e[e.USER=1]="USER"}(AP||(AP={}));var OP=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},RP=function(e,t){return function(i,n){t(i,n,e)}};let PP=class{constructor(e){this._commandService=e}async open(e,t){if(!yr(e,wr.command))return!1;if(!(null==t?void 0:t.allowCommands))return!0;if("string"==typeof e&&(e=di.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path))return!0;let i=[];try{i=IM(decodeURIComponent(e.query))}catch(t){try{i=IM(e.query)}catch(e){}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};PP=OP([RP(0,Al)],PP);let FP=class{constructor(e){this._editorService=e}async open(e,t){"string"==typeof e&&(e=di.parse(e));const{selection:i,uri:n}=function(e){let t=void 0;const i=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return i&&(t={startLineNumber:parseInt(i[1]),startColumn:i[2]?parseInt(i[2]):1,endLineNumber:i[4]?parseInt(i[4]):void 0,endColumn:i[4]?i[5]?parseInt(i[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}(e);return(e=n).scheme===wr.file&&(e=rD(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:(null==t?void 0:t.fromUserGesture)?AP.USER:AP.API,...null==t?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),null==t?void 0:t.openToSide),!0}};FP=OP([RP(0,yl)],FP);let BP=class{constructor(e,t){this._openers=new $,this._validators=new $,this._resolvers=new $,this._resolvedUriTargets=new bg(e=>e.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new $,this._defaultExternalOpener={openExternal:async e=>(Sr(e,wr.http,wr.https)?$a(e):Pn.location.href=e,!0)},this._openers.push({open:async(e,t)=>!(!(null==t?void 0:t.openExternal)&&!Sr(e,wr.mailto,wr.http,wr.https,wr.vsls))&&(await this._doOpenExternal(e,t),!0)}),this._openers.push(new PP(t)),this._openers.push(new FP(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var i;const n="string"==typeof e?di.parse(e):e,s=null!==(i=this._resolvedUriTargets.get(n))&&void 0!==i?i:e;for(const e of this._validators)if(!await e.shouldOpen(s,t))return!1;for(const i of this._openers){if(await i.open(e,t))return!0}return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch(e){}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i="string"==typeof e?di.parse(e):e;let n,s;try{n=(await this.resolveExternalUri(i,t)).resolved}catch(e){n=i}if(s="string"==typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),null==t?void 0:t.allowContributedOpeners){const e="string"==typeof(null==t?void 0:t.allowContributedOpeners)?null==t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners){if(await t.openExternal(s,{sourceUri:i,preferredOpenerId:e},Lt.None))return!0}}return this._defaultExternalOpener.openExternal(s,{sourceUri:i},Lt.None)}dispose(){this._validators.clear()}};BP=OP([RP(0,yl),RP(1,Al)],BP);const WP=wl("editorWorkerService");var VP,HP;!function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(VP||(VP={})),function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=Object(J.b)("sev.error","Error"),t[e.Warning]=Object(J.b)("sev.warning","Warning"),t[e.Info]=Object(J.b)("sev.info","Info"),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case WN.Error:return e.Error;case WN.Warning:return e.Warning;case WN.Info:return e.Info;case WN.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return WN.Error;case e.Warning:return WN.Warning;case e.Info:return WN.Info;case e.Hint:return WN.Ignore}}}(VP||(VP={})),function(e){function t(e,t){const i=[""];return e.source?i.push(e.source.replace("¦","\\¦")):i.push(""),e.code?"string"==typeof e.code?i.push(e.code.replace("¦","\\¦")):i.push(e.code.value.replace("¦","\\¦")):i.push(""),void 0!==e.severity&&null!==e.severity?i.push(VP.toString(e.severity)):i.push(""),e.message&&t?i.push(e.message.replace("¦","\\¦")):i.push(""),void 0!==e.startLineNumber&&null!==e.startLineNumber?i.push(e.startLineNumber.toString()):i.push(""),void 0!==e.startColumn&&null!==e.startColumn?i.push(e.startColumn.toString()):i.push(""),void 0!==e.endLineNumber&&null!==e.endLineNumber?i.push(e.endLineNumber.toString()):i.push(""),void 0!==e.endColumn&&null!==e.endColumn?i.push(e.endColumn.toString()):i.push(""),i.push(""),i.join("¦")}e.makeKey=function(e){return t(e,!0)},e.makeKeyOptionalMessage=t}(HP||(HP={}));const zP=wl("markerService");var KP=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},UP=function(e,t){return function(i,n){t(i,n,e)}};let jP=class extends st{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new ft),this._markerDecorations=new bg,e.getModels().forEach(e=>this._onModelAdded(e)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(e=>{const t=this._markerDecorations.get(e);t&&this._updateDecorations(t)})}_onModelAdded(e){const t=new qP(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==wr.inMemory&&e.uri.scheme!==wr.internal&&e.uri.scheme!==wr.vscode||null===(t=this._markerService)||void 0===t||t.read({resource:e.uri}).map(e=>e.owner).forEach(t=>this._markerService.remove(t,[e.uri]))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};jP=KP([UP(0,Sl),UP(1,zP)],jP);class qP extends st{constructor(e){super(),this.model=e,this._map=new yg,this._register(it(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=function(e,t){const i=[],n=[];for(const n of e)t.has(n)||i.push(n);for(const i of t)e.has(i)||n.push(i);return{removed:i,added:n}}(new Set(this._map.keys()),new Set(e));if(0===t.length&&0===i.length)return!1;const n=i.map(e=>this._map.get(e)),s=t.map(e=>({range:this._createDecorationRange(this.model,e),options:this._createDecorationOption(e)})),o=this.model.deltaDecorations(n,s);for(const e of i)this._map.delete(e);for(let e=0;e<o.length;e++)this._map.set(t[e],o[e]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,t){let i=wi.lift(t);if(t.severity!==VP.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const t=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(1===t||i.endColumn>=t)return i;const n=e.getWordAtPosition(i.getStartPosition());n&&(i=new wi(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n<i.endColumn&&(i=new wi(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,s=void 0,o=void 0;switch(e.severity){case VP.Hint:t=this._hasMarkerTag(e,2)?void 0:this._hasMarkerTag(e,1)?"squiggly-unnecessary":"squiggly-hint",i=0;break;case VP.Info:t="squiggly-info",s=xC(aw),i=10,n={color:xC(Lv),position:fu.Inline};break;case VP.Warning:t="squiggly-warning",s=xC(rw),i=20,n={color:xC(kv),position:fu.Inline};break;case VP.Error:default:t="squiggly-error",s=xC(ow),i=30,n={color:xC(Dv),position:fu.Inline}}return e.tags&&(-1!==e.tags.indexOf(1)&&(o="squiggly-inline-unnecessary"),-1!==e.tags.indexOf(2)&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:s,position:gu.Right},minimap:n,zIndex:i,inlineClassName:o}}_hasMarkerTag(e,t){return!!e.tags&&e.tags.indexOf(t)>=0}}var $P,GP=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ZP=function(e,t){return function(i,n){t(i,n,e)}};function YP(e){return e.toString()}class QP{constructor(e,t,i){this.model=e,this._modelEventListeners=new nt,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(t=>i(e,t)))}dispose(){this._modelEventListeners.dispose()}}const XP=K.g||K.i?1:2;class JP{constructor(e,t,i,n,s,o,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=s,this.sha1=o,this.versionId=r,this.alternativeVersionId=a}}let eF=$P=class extends st{constructor(e,t,i,n,s){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,this._languageConfigurationService=s,this._onModelAdded=this._register(new ft),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new ft),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new ft),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(e=>this._updateModelOptions(e))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let n=U.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let s="tabSize";if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(s=Math.max(t,1))}let o=U.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(o="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let r=XP;const a=e.eol;"\r\n"===a?r=2:"\n"===a&&(r=1);let l=U.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let h=U.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(h="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let d=U.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let c=U.bracketPairColorizationOptions;return(null===(i=e.editor)||void 0===i?void 0:i.bracketPairColorization)&&"object"==typeof e.editor.bracketPairColorization&&(c={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:s,insertSpaces:o,detectIndentation:h,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:c}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"string"==typeof i&&"auto"!==i?i:3===K.a||2===K.a?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(e,t,i){const n="string"==typeof e?e:e.languageId;let s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){const e=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),o=this._getEOL(t,n);s=$P._readModelOptions({editor:e,eol:o},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,s=i.length;n<s;n++){const s=i[n],o=this._models[s],r=o.model.getLanguageId(),a=o.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:r,resource:a})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:r,resource:a}))continue;const l=t[r+a],h=this.getCreationOptions(r,a,o.model.isForSimpleWidget);$P._setModelOptionsForModel(o.model,h,l)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&1===e.getLineCount()&&e.setEOL(1===t.defaultEOL?0:1),i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&H(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions)||(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(YP(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(YP(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(YP(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(e=>{e.sharesUndoRedoStack||t.push(e)}),t.sort((e,t)=>e.time-t.time);t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const s=this.getCreationOptions(t,i,n),o=new Kx(e,t,s,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(YP(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=this._getSHA1Computer(),s=!!n.canComputeSHA1(o)&&n.computeSHA1(o)===e.sha1;if(s||e.sharesUndoRedoStack){for(const e of t.past)fD(e)&&e.matchesResource(i)&&e.setModel(o);for(const e of t.future)fD(e)&&e.matchesResource(i)&&e.setModel(o);this._undoRedoService.setElementsValidFlag(i,!0,e=>fD(e)&&e.matchesResource(i)),s&&(o._overwriteVersionId(e.versionId),o._overwriteAlternativeVersionId(e.alternativeVersionId),o._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=YP(o.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new QP(o,e=>this._onWillDispose(e),(e,t)=>this._onDidChangeLanguage(e,t));return this._models[r]=a,a}createModel(e,t,i,n=!1){let s;return s=t?this._createModelData(e,t,i,n):this._createModelData(e,"plaintext",i,n),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(this._models[n].model)}return e}getModel(e){const t=YP(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===wr.file||e.scheme===wr.vscodeRemote||e.scheme===wr.vscodeUserData||e.scheme===wr.vscodeNotebookCell||"fake-fs"===e.scheme}_onWillDispose(e){const t=YP(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let s=!1,o=0;if(n||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){const t=this._undoRedoService.getElements(e.uri);if(t.past.length>0||t.future.length>0){for(const i of t.past)fD(i)&&i.matchesResource(e.uri)&&(s=!0,o+=i.heapSize(e.uri),i.setModel(e.uri));for(const i of t.future)fD(i)&&i.matchesResource(e.uri)&&(s=!0,o+=i.heapSize(e.uri),i.setModel(e.uri))}}const r=$P.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,a=this._getSHA1Computer();if(s)if(n||!(o>r)&&a.canComputeSHA1(e))this._ensureDisposedModelsHeapSize(r-o),this._undoRedoService.setElementsValidFlag(e.uri,!1,t=>fD(t)&&t.matchesResource(e.uri)),this._insertDisposedModel(new JP(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,o,a.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else{const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else if(!n){const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,n=e.getLanguageId(),s=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),o=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);$P._setModelOptionsForModel(e,o,s),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new tF}};eF.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,eF=$P=GP([ZP(0,Xd),ZP(1,im),ZP(2,Mx),ZP(3,nc),ZP(4,Oc)],eF);class tF{canComputeSHA1(e){return e.getValueLength()<=tF.MAX_MODEL_SIZE}computeSHA1(e){const t=new Rr,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}}tF.MAX_MODEL_SIZE=10485760;i("PNG0");class iF{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:st.None}}renderElement(e,t,i,n){var s;if(null===(s=i.disposable)||void 0===s||s.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,n);const r=new xt,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(t=>this.renderer.renderElement(t,e,i.data,n))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class nF{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}i("prlp");var sF=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};var oF;!function(e){e.North="north",e.South="south",e.East="east",e.West="west"}(oF||(oF={}));const rF=new ft;const aF=new ft;class lF{constructor(e){this.el=e,this.disposables=new nt}get onPointerMove(){return this.disposables.add(new dC(Fr(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new dC(Fr(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}sF([Fb],lF.prototype,"onPointerMove",null),sF([Fb],lF.prototype,"onPointerUp",null);class hF{get onPointerMove(){return this.disposables.add(new dC(this.el,Bb.Change)).event}get onPointerUp(){return this.disposables.add(new dC(this.el,Bb.End)).event}constructor(e){this.el=e,this.disposables=new nt}dispose(){this.disposables.dispose()}}sF([Fb],hF.prototype,"onPointerMove",null),sF([Fb],hF.prototype,"onPointerUp",null);class dF{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}sF([Fb],dF.prototype,"onPointerMove",null),sF([Fb],dF.prototype,"onPointerUp",null);class cF extends st{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=Fa(this.el,Ka(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(it(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new dC(this._orthogonalStartDragHandle,"mouseenter")).event(()=>cF.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new dC(this._orthogonalStartDragHandle,"mouseleave")).event(()=>cF.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=Fa(this.el,Ka(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(it(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new dC(this._orthogonalEndDragHandle,"mouseenter")).event(()=>cF.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new dC(this._orthogonalEndDragHandle,"mouseleave")).event(()=>cF.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=300,this.hoverDelayer=this._register(new ao(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new ft),this._onDidStart=this._register(new ft),this._onDidChange=this._register(new ft),this._onDidReset=this._register(new ft),this._onDidEnd=this._register(new ft),this.orthogonalStartSashDisposables=this._register(new nt),this.orthogonalStartDragHandleDisposables=this._register(new nt),this.orthogonalEndSashDisposables=this._register(new nt),this.orthogonalEndDragHandleDisposables=this._register(new nt),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=Fa(e,Ka(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add("orthogonal-edge-"+i.orthogonalEdge),K.i&&this.el.classList.add("mac");const n=this._register(new dC(this.el,"mousedown")).event;this._register(n(t=>this.onPointerStart(t,new lF(e)),this));const s=this._register(new dC(this.el,"dblclick")).event;this._register(s(this.onPointerDoublePress,this));const o=this._register(new dC(this.el,"mouseenter")).event;this._register(o(()=>cF.onMouseEnter(this)));const r=this._register(new dC(this.el,"mouseleave")).event;this._register(r(()=>cF.onMouseLeave(this))),this._register(Vb.addTarget(this.el));const a=this._register(new dC(this.el,Bb.Start)).event;this._register(a(e=>this.onPointerStart(e,new hF(this.el)),this));const l=this._register(new dC(this.el,Bb.Tap)).event;let h=void 0;this._register(l(e=>{if(h)return clearTimeout(h),h=void 0,void this.onPointerDoublePress(e);clearTimeout(h),h=setTimeout(()=>h=void 0,250)},this)),"number"==typeof i.size?(this.size=i.size,0===i.orientation?this.el.style.width=this.size+"px":this.el.style.height=this.size+"px"):(this.size=4,this._register(rF.event(e=>{this.size=e,this.layout()}))),this._register(aF.event(e=>this.hoverDelay=e)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,1===this.orientation?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",!1),this.layout()}onPointerStart(e,t){Oa(e);let i=!1;if(!e.__orthogonalSashEvent){const n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new dF(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new dF(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const e of n)e.classList.add("pointer-events-disabled");const s=e.pageX,o=e.pageY,r=e.altKey,a={startX:s,currentX:s,startY:o,currentY:o,altKey:r};this.el.classList.add("active"),this._onDidStart.fire(a);const l=Sa(this.el),h=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":K.i?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":K.i?"col-resize":"ew-resize",l.textContent=`* { cursor: ${e} !important; }`},d=new nt;h(),i||this.onDidEnablementChange.event(h,null,d);t.onPointerMove(e=>{Oa(e,!1);const t={startX:s,currentX:e.pageX,startY:o,currentY:e.pageY,altKey:r};this._onDidChange.fire(t)},null,d),t.onPointerUp(e=>{Oa(e,!1),this.el.removeChild(l),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const e of n)e.classList.remove("pointer-events-disabled")},null,d),d.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&cF.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&cF.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){cF.onMouseLeave(this)}layout(){if(0===this.orientation){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const i=null!==(t=e.initialTarget)&&void 0!==t?t:e.target;if(i&&i instanceof HTMLElement)return i.classList.contains("orthogonal-drag-handle")?i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}i("xq//");const uF={separatorBorder:Ug.transparent};class gF{set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){var i,n;if(e!==this.visible){e?(this.size=II(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{null===(n=(i=this.view).setVisible)||void 0===n||n.call(i,e)}catch(e){console.error("Splitview: Failed to set visible view"),console.error(e)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return null===(e=this.view.proportionalLayout)||void 0===e||e}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(e){console.error("Splitview: Failed to layout view"),console.error(e)}}dispose(){this.disposable.dispose()}}class mF extends gF{layoutContainer(e){this.container.style.top=e+"px",this.container.style.height=this.size+"px"}}class fF extends gF{layoutContainer(e){this.container.style.left=e+"px",this.container.style.width=this.size+"px"}}var pF,_F;!function(e){e[e.Idle=0]="Idle",e[e.Busy=1]="Busy"}(pF||(pF={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Auto=function(e){return{type:"auto",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(_F||(_F={}));class vF extends st{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,n,s,o,r;super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=pF.Idle,this._onDidSashChange=this._register(new ft),this._onDidSashReset=this._register(new ft),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=null!==(i=t.orientation)&&void 0!==i?i:0,this.inverseAltBehavior=null!==(n=t.inverseAltBehavior)&&void 0!==n&&n,this.proportionalLayout=null===(s=t.proportionalLayout)||void 0===s||s,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Fa(this.el,Ka(".sash-container")),this.viewContainer=Ka(".split-view-container"),this.scrollable=this._register(new Zb({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:e=>ea(Fr(this.el),e)})),this.scrollableElement=this._register(new nC(this.viewContainer,{vertical:0===this.orientation?null!==(o=t.scrollbarVisibility)&&void 0!==o?o:1:2,horizontal:1===this.orientation?null!==(r=t.scrollbarVisibility)&&void 0!==r?r:1:2},this.scrollable));const a=this._register(new dC(this.viewContainer,"scroll")).event;this._register(a(e=>{const t=this.scrollableElement.getScrollPosition(),i=Math.abs(this.viewContainer.scrollLeft-t.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,n=Math.abs(this.viewContainer.scrollTop-t.scrollTop)<=1?void 0:this.viewContainer.scrollTop;void 0===i&&void 0===n||this.scrollableElement.setScrollPosition({scrollLeft:i,scrollTop:n})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(e=>{e.scrollTopChanged&&(this.viewContainer.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this.viewContainer.scrollLeft=e.scrollLeft)})),Fa(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||uF),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((e,t)=>{const i=T(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)}),this._contentSize=this.viewItems.reduce((e,t)=>e+t.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let t=0;for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],s=this.proportions[i];"number"==typeof s?t+=s:e-=n.size}for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],s=this.proportions[i];"number"==typeof s&&t>0&&(n.size=II(Math.round(s*e/t),n.minimumSize,n.maximumSize))}}else{const t=u(this.viewItems.length),n=t.filter(e=>1===this.viewItems[e].priority),s=t.filter(e=>2===this.viewItems[e].priority);this.resize(this.viewItems.length-1,e-i,void 0,n,s)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const e of this.viewItems)e.enabled=!1;const n=this.sashItems.findIndex(t=>t.sash===e),s=tt(Zr(this.el.ownerDocument.body,"keydown",e=>o(this.sashDragState.current,e.altKey)),Zr(this.el.ownerDocument.body,"keyup",()=>o(this.sashDragState.current,!1))),o=(e,t)=>{const i=this.viewItems.map(e=>e.size);let o,r,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t){if(n===this.sashItems.length-1){const e=this.viewItems[n];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{const e=this.viewItems[n+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}}if(!t){const e=u(n,-1),t=u(n+1,this.viewItems.length),s=e.reduce((e,t)=>e+(this.viewItems[t].minimumSize-i[t]),0),a=e.reduce((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t]),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce((e,t)=>e+(i[t]-this.viewItems[t].minimumSize),0),h=0===t.length?Number.NEGATIVE_INFINITY:t.reduce((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize),0),d=Math.max(s,h),c=Math.min(l,a),g=this.findFirstSnapIndex(e),m=this.findFirstSnapIndex(t);if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);o={index:g,limitDelta:e.visible?d-t:d+t,size:e.size}}if("number"==typeof m){const e=this.viewItems[m],t=Math.floor(e.viewMinimumSize/2);r={index:m,limitDelta:e.visible?c+t:c-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:i,minDelta:a,maxDelta:l,alt:t,snapBefore:o,snapAfter:r,disposable:s}};o(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:s,minDelta:o,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const h=e-i,d=this.resize(t,h,n,void 0,void 0,o,r,a,l);if(s){const e=t===this.sashItems.length-1,i=this.viewItems.map(e=>e.size),n=e?t:t+1,s=this.viewItems[n],o=s.size-s.maximumSize,r=s.size-s.minimumSize,a=e?t-1:t+1;this.resize(a,-d,i,void 0,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const e of this.viewItems)e.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=II(t="number"==typeof t?t:e.size,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==pF.Idle)throw new Error("Cant modify splitview");this.state=pF.Busy;try{const i=u(this.viewItems.length).filter(t=>t!==e),n=[...i.filter(e=>1===this.viewItems[e].priority),e],s=i.filter(e=>2===this.viewItems[e].priority),o=this.viewItems[e];t=II(t=Math.round(t),o.minimumSize,Math.min(o.maximumSize,this.size)),o.size=t,this.relayout(n,s)}finally{this.state=pF.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);const i=Math.floor(t/e.length);for(const t of e)t.size=II(i,t.minimumSize,t.maximumSize);const n=u(this.viewItems.length),s=n.filter(e=>1===this.viewItems[e].priority),o=n.filter(e=>2===this.viewItems[e].priority);this.relayout(s,o)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==pF.Idle)throw new Error("Cant modify splitview");this.state=pF.Busy;try{const s=Ka(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(i));const o=e.onDidChange(e=>this.onViewChange(l,e)),r=tt(o,it(()=>this.viewContainer.removeChild(s)));let a;"number"==typeof t?a=t:("auto"===t.type&&(t=this.areViewsDistributed()?{type:"distribute"}:{type:"split",index:t.index}),a="split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize);const l=0===this.orientation?new mF(s,e,a,r):new fF(s,e,a,r);if(this.viewItems.splice(i,0,l),this.viewItems.length>1){const e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},t=0===this.orientation?new cF(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},{...e,orientation:1}):new cF(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},{...e,orientation:0}),n=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),s=dt.map(t.onDidStart,n)(this.onSashStart,this),o=dt.map(t.onDidChange,n)(this.onSashChange,this),r=dt.map(t.onDidEnd,()=>this.sashItems.findIndex(e=>e.sash===t))(this.onSashEnd,this),a=tt(s,o,r,t.onDidReset(()=>{const e=this.sashItems.findIndex(e=>e.sash===t),i=u(e,-1),n=u(e+1,this.viewItems.length),s=this.findFirstSnapIndex(i),o=this.findFirstSnapIndex(n);("number"!=typeof s||this.viewItems[s].visible)&&("number"!=typeof o||this.viewItems[o].visible)&&this._onDidSashReset.fire(e)}),t),l={sash:t,disposable:a};this.sashItems.splice(i-1,0,l)}let h;s.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(h=[t.index]),n||this.relayout([i],h),n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}finally{this.state=pF.Idle}}relayout(e,t){const i=this.viewItems.reduce((e,t)=>e+t.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(e=>e.size),n,s,o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const h=u(e,-1),d=u(e+1,this.viewItems.length);if(s)for(const e of s)m(h,e),m(d,e);if(n)for(const e of n)f(h,e),f(d,e);const c=h.map(e=>this.viewItems[e]),g=h.map(e=>i[e]),p=d.map(e=>this.viewItems[e]),_=d.map(e=>i[e]),v=h.reduce((e,t)=>e+(this.viewItems[t].minimumSize-i[t]),0),b=h.reduce((e,t)=>e+(this.viewItems[t].maximumSize-i[t]),0),C=0===d.length?Number.POSITIVE_INFINITY:d.reduce((e,t)=>e+(i[t]-this.viewItems[t].minimumSize),0),w=0===d.length?Number.NEGATIVE_INFINITY:d.reduce((e,t)=>e+(i[t]-this.viewItems[t].maximumSize),0),y=Math.max(v,w,o),S=Math.min(C,b,r);let L=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;L=i!==e.visible,e.setVisible(i,a.size)}if(!L&&l){const e=this.viewItems[l.index],i=t<l.limitDelta;L=i!==e.visible,e.setVisible(i,l.size)}if(L)return this.resize(e,t,i,n,s,o,r);for(let e=0,i=t=II(t,y,S);e<c.length;e++){const t=c[e],n=II(g[e]+i,t.minimumSize,t.maximumSize);i-=n-g[e],t.size=n}for(let e=0,i=t;e<p.length;e++){const t=p[e],n=II(_[e]-i,t.minimumSize,t.maximumSize);i+=n-_[e],t.size=n}return t}distributeEmptySpace(e){const t=this.viewItems.reduce((e,t)=>e+t.size,0);let i=this.size-t;const n=u(this.viewItems.length-1,-1),s=n.filter(e=>1===this.viewItems[e].priority),o=n.filter(e=>2===this.viewItems[e].priority);for(const e of o)m(n,e);for(const e of s)f(n,e);"number"==typeof e&&f(n,e);for(let e=0;0!==i&&e<n.length;e++){const t=this.viewItems[n[e]],s=II(t.size+i,t.minimumSize,t.maximumSize);i-=s-t.size,t.size=s}}layoutViews(){this._contentSize=this.viewItems.reduce((e,t)=>e+t.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(e=>e.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(t=>e=t.size-t.minimumSize>0||e);e=!1;const i=this.viewItems.map(t=>e=t.maximumSize-t.size>0||e),n=[...this.viewItems].reverse();e=!1;const s=n.map(t=>e=t.size-t.minimumSize>0||e).reverse();e=!1;const o=n.map(t=>e=t.maximumSize-t.size>0||e).reverse();let r=0;for(let e=0;e<this.sashItems.length;e++){const{sash:n}=this.sashItems[e];r+=this.viewItems[e].size;const a=!(t[e]&&o[e+1]),l=!(i[e]&&s[e+1]);if(a&&l){const i=u(e,-1),o=u(e+1,this.viewItems.length),a=this.findFirstSnapIndex(i),l=this.findFirstSnapIndex(o),h="number"==typeof a&&!this.viewItems[a].visible,d="number"==typeof l&&!this.viewItems[l].visible;h&&s[e]&&(r>0||this.startSnappingEnabled)?n.state=1:d&&t[e]&&(r<this._contentSize||this.endSnappingEnabled)?n.state=2:n.state=0}else n.state=a&&!l?1:!a&&l?2:3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const e=this.viewItems[t];if(e.visible&&e.snap)return t}for(const t of e){const e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return t}}areViewsDistributed(){let e=void 0,t=void 0;for(const i of this.viewItems)if(e=void 0===e?i.size:Math.min(e,i.size),t=void 0===t?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;null===(e=this.sashDragState)||void 0===e||e.disposable.dispose(),et(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}i("BZCw");class bF{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=bF.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(e=>[e.templateId,e]));this.renderers=[];for(const t of e){const e=n.get(t.templateId);if(!e)throw new Error(`Table cell renderer for template id ${t.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=Fa(e,Ka(".monaco-table-tr")),i=[],n=[];for(let e=0;e<this.columns.length;e++){const s=this.renderers[e],o=Fa(t,Ka(".monaco-table-td",{"data-col-index":e}));o.style.width=this.getColumnSize(e)+"px",i.push(o),n.push(s.renderTemplate(o))}const s={container:e,cellContainers:i,cellTemplateData:n};return this.renderedTemplates.add(s),s}renderElement(e,t,i,n){for(let s=0;s<this.columns.length;s++){const o=this.columns[s].project(e);this.renderers[s].renderElement(o,t,i.cellTemplateData[s],n)}}disposeElement(e,t,i,n){for(let s=0;s<this.columns.length;s++){const o=this.renderers[s];if(o.disposeElement){const r=this.columns[s].project(e);o.disposeElement(r,t,i.cellTemplateData[s],n)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++){this.renderers[t].disposeTemplate(e.cellTemplateData[t])}$r(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=t+"px"}}bF.TemplateId="row";class CF extends st{get minimumSize(){var e;return null!==(e=this.column.minimumWidth)&&void 0!==e?e:120}get maximumSize(){var e;return null!==(e=this.column.maximumWidth)&&void 0!==e?e:Number.POSITIVE_INFINITY}get onDidChange(){var e;return null!==(e=this.column.onDidChangeWidthConstraints)&&void 0!==e?e:dt.None}constructor(e,t){super(),this.column=e,this.index=t,this._onDidLayout=new ft,this.onDidLayout=this._onDidLayout.event,this.element=Ka(".monaco-table-th",{"data-col-index":t},e.label),this._register(UO(zO("mouse"),this.element,e.tooltip))}layout(e){this._onDidLayout.fire([this.index,e])}}class wF{get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onDidScroll(){return this.list.onDidScroll}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollHeight(){return this.list.scrollHeight}get renderHeight(){return this.list.renderHeight}get onDidDispose(){return this.list.onDidDispose}constructor(e,t,i,n,s,o){this.virtualDelegate=i,this.domId="table_id_"+ ++wF.InstanceCount,this.disposables=new nt,this.cachedWidth=0,this.cachedHeight=0,this.domNode=Fa(t,Ka(".monaco-table."+this.domId));const r=n.map((e,t)=>this.disposables.add(new CF(e,t))),a={size:r.reduce((e,t)=>e+t.column.weight,0),views:r.map(e=>({size:e.column.weight,view:e}))};this.splitview=this.disposables.add(new vF(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:a})),this.splitview.el.style.height=i.headerRowHeight+"px",this.splitview.el.style.lineHeight=i.headerRowHeight+"px";const l=new bF(n,s,e=>this.splitview.getViewSize(e));var h;this.list=this.disposables.add(new AR(e,this.domNode,(h=i,{getHeight:e=>h.getHeight(e),getTemplateId:()=>bF.TemplateId}),[l],o)),dt.any(...r.map(e=>e.onDidLayout))(([e,t])=>l.layoutColumn(e,t),null,this.disposables),this.splitview.onDidSashReset(e=>{const t=n.reduce((e,t)=>e+t.weight,0),i=n[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,i)},null,this.disposables),this.styleElement=Sa(this.domNode),this.style(DR)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}wF.InstanceCount=0;i("7dd9");class yF extends Hb{constructor(e){super(),this._onChange=this._register(new ft),this.onChange=this._onChange.event,this._onKeyDown=this._register(new ft),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Ml.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(UO(zO("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,e=>{if(10===e.keyCode||3===e.keyCode)return this.checked=!this._checked,this._onChange.fire(!0),e.preventDefault(),void e.stopPropagation();this._onKeyDown.fire(e)})}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const SF=J.b("caseDescription","Match Case"),LF=J.b("wordsDescription","Match Whole Word"),kF=J.b("regexDescription","Use Regular Expression");class DF extends yF{constructor(e){super({icon:Di.caseSensitive,title:SF+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class xF extends yF{constructor(e){super({icon:Di.wholeWord,title:LF+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class EF extends yF{constructor(e){super({icon:Di.regex,title:kF+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class NF{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class IF{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return null===this._navigator.current()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new NF(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}i("1wgR");const TF=Ka;class MF extends Hb{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new ft),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new ft),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=null!==(n=this.options.tooltip)&&void 0!==n?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Fa(e,TF(".monaco-inputbox.idle"));const s=this.options.flexibleHeight?"textarea":"input",o=Fa(this.element,TF(".ibwrapper"));if(this.input=Fa(o,TF(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Fa(o,TF("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new iC(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Fa(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(e=>this.input.scrollTop=e.scrollTop));const t=this._register(new dC(e.ownerDocument,"selectionchange")),i=dt.filter(t.event,()=>{const t=e.ownerDocument.getSelection();return(null==t?void 0:t.anchorNode)===o});this._register(i(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new bP(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:ua(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return ba(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if("open"===this.state&&H(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border="1px solid "+Ya(i.border,"transparent"),this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),null==e?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=ha(this.element)+"px";let i;this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:i=>{var n,s;if(!this.message)return null;e=Fa(i,TF(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?NT(this.message.content,o):function(e,t={}){const i=IT(t);return i.textContent=e,i}(this.message.content,o);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=null!==(n=a.background)&&void 0!==n?n:"",r.style.color=null!==(s=a.foreground)&&void 0!==s?s:"",r.style.border=a.border?"1px solid "+a.border:"",Fa(e,r),null},onHide:()=>{this.state="closed"},layout:t}),i=3===this.message.type?J.b("alertErrorMessage","Error: {0}",this.message.content):2===this.message.type?J.b("alertWarningMessage","Warning: {0}",this.message.content):J.b("alertInfoMessage","Info: {0}",this.message.content),Cf(i),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,i;const n=this.options.inputBoxStyles,s=null!==(e=n.inputBackground)&&void 0!==e?e:"",o=null!==(t=n.inputForeground)&&void 0!==t?t:"",r=null!==(i=n.inputBorder)&&void 0!==i?i:"";this.element.style.backgroundColor=s,this.element.style.color=o,this.input.style.backgroundColor="inherit",this.input.style.color=o,this.element.style.border="1px solid "+Ya(r,"transparent")}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=ua(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,s=t.value;null!==i&&null!==n&&(this.value=s.substr(0,i)+e+s.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,null===(e=this.actionbar)||void 0===e||e.dispose(),super.dispose()}}class AF extends MF{constructor(e,t,i){const n=J.b({key:"history.inputbox.hint.suffix.noparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field ends in a closing parenthesis ")", for example "Filter (e.g. text, !exclude)". The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," or {0} for history","⇅"),s=J.b({key:"history.inputbox.hint.suffix.inparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field does NOT end in a closing parenthesis (eg. "Find"). The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new ft),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new ft),this.onDidBlur=this._onDidBlur.event,this.history=new IF(i.history,100);const o=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const e=this.placeholder.endsWith(")")?n:s,t=this.placeholder+e;i.showPlaceholderOnFocus&&!ba(this.input)?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver((e,t)=>{e.forEach(e=>{e.target.textContent||o()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>o()),this.onblur(this.input,()=>{const e=e=>{if(this.placeholder.endsWith(e)){const t=this.placeholder.slice(0,this.placeholder.length-e.length);return i.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}return!1};e(s)||e(n)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=null!=e?e:"",wf(this.value?this.value:J.b("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,wf(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}i("F+T8");const OF=J.b("defaultLabel","input");class RF extends Hb{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new ot),this.additionalToggles=[],this._onDidOptionChange=this._register(new ft),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new ft),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new ft),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new ft),this._onKeyUp=this._register(new ft),this._onCaseSensitiveKeyDown=this._register(new ft),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new ft),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||OF,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",s=i.appendWholeWordsLabel||"",o=i.appendRegexLabel||"",r=i.history||[],a=!!i.flexibleHeight,l=!!i.flexibleWidth,h=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new AF(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:i.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:h,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new EF({appendTitle:o,isChecked:!1,...i.toggleStyles})),this._register(this.regex.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(e=>{this._onRegexKeyDown.fire(e)})),this.wholeWords=this._register(new xF({appendTitle:s,isChecked:!1,...i.toggleStyles})),this._register(this.wholeWords.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new DF({appendTitle:n,isChecked:!1,...i.toggleStyles})),this._register(this.caseSensitive.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(e=>{this._onCaseSensitiveKeyDown.fire(e)}));const e=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,t=>{if(t.equals(15)||t.equals(17)||t.equals(9)){const i=e.indexOf(this.domNode.ownerDocument.activeElement);if(i>=0){let n=-1;t.equals(17)?n=(i+1)%e.length:t.equals(15)&&(n=0===i?e.length-1:i-1),t.equals(9)?(e[i].blur(),this.inputBox.focus()):n>=0&&e[n].focus(),Oa(t,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(null==i?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),null==e||e.appendChild(this.domNode),this._register(Zr(this.inputBox.inputElement,"compositionstart",e=>{this.imeSessionInProgress=!0})),this._register(Zr(this.inputBox.inputElement,"compositionend",e=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,e=>this._onKeyDown.fire(e)),this.onkeyup(this.inputBox.inputElement,e=>this._onKeyUp.fire(e)),this.oninput(this.inputBox.inputElement,e=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,e=>this._onMouseDown.fire(e))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),null===(e=this.regex)||void 0===e||e.enable(),null===(t=this.wholeWords)||void 0===t||t.enable(),null===(i=this.caseSensitive)||void 0===i||i.enable();for(const e of this.additionalToggles)e.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),null===(e=this.regex)||void 0===e||e.disable(),null===(t=this.wholeWords)||void 0===t||t.disable(),null===(i=this.caseSensitive)||void 0===i||i.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const e of this.additionalToggles)e.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new nt;for(const t of null!=e?e:[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,n,s,o,r;this.inputBox.paddingRight=e?0:(null!==(i=null===(t=this.caseSensitive)||void 0===t?void 0:t.width())&&void 0!==i?i:0)+(null!==(s=null===(n=this.wholeWords)||void 0===n?void 0:n.width())&&void 0!==s?s:0)+(null!==(r=null===(o=this.regex)||void 0===o?void 0:o.width())&&void 0!==r?r:0)+this.additionalToggles.reduce((e,t)=>e+t.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return null!==(t=null===(e=this.caseSensitive)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return null!==(t=null===(e=this.wholeWords)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return null!==(t=null===(e=this.regex)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;null===(e=this.caseSensitive)||void 0===e||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var PF,FF;!function(e){e[e.Expanded=0]="Expanded",e[e.Collapsed=1]="Collapsed",e[e.PreserveOrExpanded=2]="PreserveOrExpanded",e[e.PreserveOrCollapsed=3]="PreserveOrCollapsed"}(PF||(PF={})),function(e){e[e.Unknown=0]="Unknown",e[e.Twistie=1]="Twistie",e[e.Element=2]="Element",e[e.Filter=3]="Filter"}(FF||(FF={}));class BF extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class WF{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function VF(e){return"object"==typeof e&&"visibility"in e&&"data"in e}function HF(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function zF(e){return"boolean"==typeof e.collapsible}class KF{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new wt,this._onDidChangeCollapseState=new ft,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new ft,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new ft,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new ao(no),this.collapseByDefault=void 0!==n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=void 0!==n.autoExpandSingleChildren&&n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=j.empty(),n={}){if(0===e.length)throw new BF(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n,s,o){var r;void 0===n&&(n=j.empty()),void 0===o&&(o=null!==(r=s.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,s);const l=[...n],h=t[t.length-1],d=new Xc({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,h),...l,...a.children.slice(h+i)].map(t=>e.getId(t.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,s);const c=t.slice(0,-1),u=(t,i,n)=>{if(o>0)for(let r=0;r<n;r++)t--,i--,this.spliceSmart(e,[...c,t,0],Number.MAX_SAFE_INTEGER,l[i].children,s,o-1)};let g=Math.min(a.children.length,h+i),m=l.length;for(const e of d.changes.sort((e,t)=>t.originalStart-e.originalStart))u(g,m,g-(e.originalStart+e.originalLength)),g=e.originalStart,m=e.modifiedStart-h,this.spliceSimple([...c,g],e.originalLength,j.slice(l,m,m+e.modifiedLength),s);u(g,m,g)}spliceSimple(e,t,i=j.empty(),{onDidCreateNode:n,onDidDeleteNode:s,diffIdentityProvider:o}){const{parentNode:r,listIndex:a,revealed:l,visible:h}=this.getParentNodeWithListIndex(e),d=[],c=j.map(i,e=>this.createTreeNode(e,r,r.visible?1:0,l,d,n)),u=e[e.length-1];let g=0;for(let e=u;e>=0&&e<r.children.length;e--){const t=r.children[e];if(t.visible){g=t.visibleChildIndex;break}}const m=[];let f=0,p=0;for(const e of c)m.push(e),p+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=g+f++);const v=_(r.children,u,t,m);o?r.lastDiffIds?_(r.lastDiffIds,u,t,m.map(e=>o.getId(e.element).toString())):r.lastDiffIds=r.children.map(e=>o.getId(e.element).toString()):r.lastDiffIds=void 0;let b=0;for(const e of v)e.visible&&b++;if(0!==b)for(let e=u+m.length;e<r.children.length;e++){const t=r.children[e];t.visible&&(t.visibleChildIndex-=b)}if(r.visibleChildrenCount+=f-b,l&&h){const e=v.reduce((e,t)=>e+(t.visible?t.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(r,p-e),this.list.splice(a,e,d)}if(v.length>0&&s){const e=t=>{s(t),t.children.forEach(e)};v.forEach(e)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:v});let C=r;for(;C;){if(2===C.visibility){this.refilterDelayer.trigger(()=>this.refilter());break}C=C.parent}}rerender(e){if(0===e.length)throw new BF(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);void 0===t&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,n))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);void 0===t&&(t=!n.collapsed);const s={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:s}=this.getTreeNodeWithListIndex(e),o=this._setListNodeCollapseState(i,n,s,t);if(i!==this.root&&this.autoExpandSingleChildren&&o&&!zF(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e<i.children.length;e++){if(i.children[e].visible){if(n>-1){n=-1;break}n=e}}n>-1&&this._setCollapseState([...e,n],t)}return o}_setListNodeCollapseState(e,t,i,n){const s=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!s)return s;const o=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=o-(-1===t?0:1);return this.list.splice(t+1,a,r.slice(1)),s}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(zF(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!zF(t)&&t.recursive)for(const i of e.children)n=this._setNodeCollapseState(i,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,s,o){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&s.push(r);const l=e.children||j.empty(),h=n&&0!==a&&!r.collapsed;let d=0,c=1;for(const e of l){const t=this.createTreeNode(e,r,a,h,s,o);r.children.push(t),c+=t.renderNodeCount,t.visible&&(t.visibleChildIndex=d++)}return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=d,r.visible=2===a?d>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=c):(r.renderNodeCount=0,n&&s.pop()),null==o||o(r),r}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let s;if(e!==this.root){if(s=this._filterNode(e,t),0===s)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const o=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===s)e.visibleChildrenCount=0;else{let t=0;for(const o of e.children)r=this._updateNodeAfterFilterChange(o,s,i,n&&!e.collapsed)||r,o.visible&&(o.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===s?r:1===s,e.visibility=s),e.visible?e.collapsed||(e.renderNodeCount+=i.length-o):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return"boolean"==typeof i?(e.filterData=void 0,i?1:0):VF(i)?(e.filterData=i.data,HF(i.visibility)):(e.filterData=void 0,HF(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[i,...n]=e;return!(i<0||i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new BF(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:s}=this.getParentNodeWithListIndex(e),o=e[e.length-1];if(o<0||o>t.children.length)throw new BF(this.user,"Invalid tree location");const r=t.children[o];return{node:r,listIndex:i,revealed:n,visible:s&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,s=!0){const[o,...r]=e;if(o<0||o>t.children.length)throw new BF(this.user,"Invalid tree location");for(let e=0;e<o;e++)i+=t.children[e].renderNodeCount;return n=n&&!t.collapsed,s=s&&t.visible,0===r.length?{parentNode:t,listIndex:i,revealed:n,visible:s}:this.getParentNodeWithListIndex(r,t.children[o],i+1,n,s)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){return 0===e.length?void 0:1===e.length?[]:function(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(0!==t.children.length)return t.children[0].element}}var UF;i("O6c4");class jF extends eR{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function qF(e){return e instanceof eR?new jF(e):e}class $F{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=st.None,this.disposables=new nt}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,qF(e),t)}onDragOver(e,t,i,n,s,o=!0){const r=this.dnd.onDragOver(qF(e),t&&t.element,i,n,s),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return r;if(a&&"boolean"!=typeof r&&r.autoExpand&&(this.autoExpandDisposable=co(()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0},500,this.disposables)),"boolean"==typeof r||!r.accept||void 0===r.bubble||r.feedback){if(!o){return{accept:"boolean"==typeof r?r:r.accept,effect:"boolean"==typeof r?void 0:r.effect,feedback:[i]}}return r}if(1===r.bubble){const i=this.modelProvider(),o=i.getNodeLocation(t),r=i.getParentNodeLocation(o),a=i.getNode(r),l=r&&i.getListIndex(r);return this.onDragOver(e,a,l,n,s,!1)}const l=this.modelProvider(),h=l.getNodeLocation(t),d=l.getListIndex(h),c=l.getListRenderCount(h);return{...r,feedback:u(d,d+c)}}drop(e,t,i,n,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(qF(e),t&&t.element,i,n,s)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}class GF{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,n;null===(n=(i=this.delegate).setDynamicHeight)||void 0===n||n.call(i,e.element,t)}}!function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(UF||(UF={}));class ZF{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new nt,this.onDidChange=dt.forEach(e,e=>this._elements=e,this.disposables)}dispose(){this.disposables.dispose()}}class YF{constructor(e,t,i,n,s,o={}){var r;this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=YF.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=st.None,this.disposables=new nt,this.templateId=e.templateId,this.updateOptions(o),dt.map(i,e=>e.node)(this.onDidChangeNodeTwistieState,this,this.disposables),null===(r=e.onDidChangeTwistieState)||void 0===r||r.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent){const t=II(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[e,t]of this.renderedNodes)this.renderTreeElement(e,t)}}if(void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==UF.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[e,t]of this.renderedNodes)this._renderIndentGuides(e,t);if(this.indentGuidesDisposable.dispose(),t){const e=new nt;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Fa(e,Ka(".monaco-tl-row")),i=Fa(t,Ka(".monaco-tl-indent")),n=Fa(t,Ka(".monaco-tl-twistie")),s=Fa(t,Ka(".monaco-tl-contents")),o=this.renderer.renderTemplate(s);return{container:e,indent:i,twistie:n,indentGuidesDisposable:st.None,templateData:o}}renderElement(e,t,i,n){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){var s,o;i.indentGuidesDisposable.dispose(),null===(o=(s=this.renderer).disposeElement)||void 0===o||o.call(s,e,t,i.templateData,n),"number"==typeof n&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=YF.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=i+"px",t.indent.style.width=i+this.indent-16+"px",e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Ml.asClassNameArray(Di.treeItemExpanded));let n=!1;this.renderer.renderTwistie&&(n=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(n||t.twistie.classList.add(...Ml.asClassNameArray(Di.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if($r(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new nt,n=this.modelProvider();for(;;){const s=n.getNodeLocation(e),o=n.getParentNodeLocation(s);if(!o)break;const r=n.getNode(o),a=Ka(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(it(()=>this.renderedIndentGuides.delete(r,a))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(e=>{const n=i.getNodeLocation(e);try{const s=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):s&&t.add(i.getNode(s))}catch(e){}}),this.activeIndentNodes.forEach(e=>{t.has(e)||this.renderedIndentGuides.forEach(e,e=>e.classList.remove("active"))}),t.forEach(e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,e=>e.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),et(this.disposables)}}YF.DefaultIndent=8;class QF{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new nt,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const n=this._filter.filter(e,t);if(i="boolean"==typeof n?n?1:0:VF(n)?HF(n.visibility):n,0===i)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:dM.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),s=Array.isArray(n)?n:[n];for(const e of s){const t=e&&e.toString();if(void 0===t)return{data:dM.Default,visibility:i};let n;if(this.tree.findMatchType===JF.Contiguous){const e=t.toLowerCase().indexOf(this._lowercasePattern);if(e>-1){n=[Number.MAX_SAFE_INTEGER,0];for(let t=this._lowercasePattern.length;t>0;t--)n.push(e+t-1)}}else n=uM(this._pattern,this._lowercasePattern,0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(n)return this._matchCount++,1===s.length?{data:n,visibility:i}:{data:{label:t,score:n},visibility:i}}return this.tree.findMode===XF.Filter?"number"==typeof this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:dM.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){et(this.disposables)}}var XF,JF;!function(e){e[e.Highlight=0]="Highlight",e[e.Filter=1]="Filter"}(XF||(XF={})),function(e){e[e.Fuzzy=0]="Fuzzy",e[e.Contiguous=1]="Contiguous"}(JF||(JF={}));class eB{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n,s,o={}){var r,a;this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=s,this.options=o,this._pattern="",this.width=0,this._onDidChangeMode=new ft,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new ft,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new ft,this._onDidChangeOpenState=new ft,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new nt,this.disposables=new nt,this._mode=null!==(r=e.options.defaultFindMode)&&void 0!==r?r:XF.Highlight,this._matchType=null!==(a=e.options.defaultFindMatchType)&&void 0!==a?a:JF.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){void 0!==e.defaultFindMode&&(this.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){this.widget&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}render(){var e,t,i,n;const s=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&s?null===(e=this.tree.options.showNotFoundMessage)||void 0===e||e?null===(t=this.widget)||void 0===t||t.showMessage({type:2,content:Object(J.b)("not found","No elements found.")}):null===(i=this.widget)||void 0===i||i.showMessage({type:2}):null===(n=this.widget)||void 0===n||n.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||(this.filter.totalCount>0&&this.filter.matchCount<=1||!dM.isDefault(e.filterData))}layout(e){var t;this.width=e,null===(t=this.widget)||void 0===t||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}function tB(e,t){return e.position===t.position&&iB(e,t)}function iB(e,t){return e.node.element===t.node.element&&e.startIndex===t.startIndex&&e.height===t.height&&e.endIndex===t.endIndex}class nB{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return s(this.stickyNodes,e.stickyNodes,tB)}lastNodePartiallyVisible(){if(0===this.count)return!1;const e=this.stickyNodes[this.count-1];if(1===this.count)return 0!==e.position;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!s(this.stickyNodes,e.stickyNodes,iB))return!1;if(0===this.count)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class sB{constrainStickyScrollNodes(e,t,i){for(let n=0;n<e.length;n++){const s=e[n];if(s.position+s.height>i||n>=t)return e.slice(0,n)}return e}}class oB extends st{constructor(e,t,i,n,s,o={}){var r;super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=s,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(o);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=null!==(r=o.stickyScrollDelegate)&&void 0!==r?r:new sB,this._widget=this._register(new rB(i.getScrollableElement(),i,e,n,s,o.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}getNodeAtHeight(e){let t;if(t=0===e?this.view.firstVisibleIndex:this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||0===this.tree.scrollTop)return void this._widget.setState(void 0);const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,n=0,s=this.getNextStickyNode(i,void 0,n);for(;s&&(t.push(s),n+=s.height,!(t.length<=this.stickyScrollMaxItemCount)||(i=this.getNextVisibleNode(s),i));)s=this.getNextStickyNode(i,s.node,n);const o=this.constrainStickyNodes(t);return o.length?new nB(o):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const n=this.getAncestorUnderPrevious(e,t);if(n){if(n===e){if(!this.nodeIsUncollapsedParent(e))return;if(this.nodeTopAlignsWithStickyNodesBottom(e,i))return}return this.createStickyScrollNode(n,i)}}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),n=this.view.getElementTop(i),s=t;return this.view.scrollTop===n-s}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:s}=this.getNodeRange(e);return{node:e,position:this.calculateStickyNodePosition(s,t,i),height:i,startIndex:n,endIndex:s}}getAncestorUnderPrevious(e,t){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(void 0===t)return i}calculateStickyNodePosition(e,t,i){let n=this.view.getRelativeTop(e);if(null===n&&this.view.firstVisibleIndex===e&&e+1<this.view.length){const t=this.treeDelegate.getHeight(this.view.element(e)),i=this.view.getRelativeTop(e+1);n=i?i-t/this.view.renderHeight:null}if(null===n)return t;const s=this.view.element(e),o=this.treeDelegate.getHeight(s),r=n*this.view.renderHeight+o;return t+i>r&&t<=r?r-i:t}constrainStickyNodes(e){if(0===e.length)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const n=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!n.length)return[];const s=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||s.position+s.height>t)throw new Error("stickyScrollDelegate violates constraints");return n}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");return{startIndex:i,endIndex:i+this.model.getListRenderCount(t)-1}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let e=0;e<t.length&&e<this.stickyScrollMaxItemCount;e++)n+=this.treeDelegate.getHeight(t[e]);return n}domFocus(){this._widget.domFocus()}focusedLast(){return this._widget.focusedLast()}updateOptions(e={}){if(!e.stickyScrollMaxItemCount)return;const t=this.validateStickySettings(e);this.stickyScrollMaxItemCount!==t.stickyScrollMaxItemCount&&(this.stickyScrollMaxItemCount=t.stickyScrollMaxItemCount,this.update())}validateStickySettings(e){let t=7;return"number"==typeof e.stickyScrollMaxItemCount&&(t=Math.max(e.stickyScrollMaxItemCount,1)),{stickyScrollMaxItemCount:t}}}class rB{constructor(e,t,i,n,s,o){this.view=t,this.tree=i,this.treeRenderers=n,this.treeDelegate=s,this.accessibilityProvider=o,this._previousElements=[],this._previousStateDisposables=new nt,this._rootDomNode=Ka(".monaco-tree-sticky-container.empty"),e.appendChild(this._rootDomNode);const r=Ka(".monaco-tree-sticky-container-shadow");this._rootDomNode.appendChild(r),this.stickyScrollFocus=new aB(this._rootDomNode,t),this.onDidChangeHasFocus=this.stickyScrollFocus.onDidChangeHasFocus,this.onContextMenu=this.stickyScrollFocus.onContextMenu}setState(e){const t=!!this._previousState&&this._previousState.count>0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i)return this._previousState=void 0,this._previousElements=[],void this._previousStateDisposables.clear();const n=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=n.position+"px";else{this._previousStateDisposables.clear();const t=Array(e.count);for(let i=e.count-1;i>=0;i--){const n=e.stickyNodes[i],{element:s,disposable:o}=this.createElement(n,i,e.count);t[i]=s,this._rootDomNode.appendChild(s),this._previousStateDisposables.add(o)}this.stickyScrollFocus.updateElements(t,e),this._previousElements=t}this._previousState=e,this._rootDomNode.style.height=n.position+n.height+"px"}createElement(e,t,i){const n=e.startIndex,s=document.createElement("div");s.style.top=e.position+"px",s.style.height=e.height+"px",s.style.lineHeight=e.height+"px",s.classList.add("monaco-tree-sticky-row"),s.classList.add("monaco-list-row"),s.setAttribute("data-index",""+n),s.setAttribute("data-parity",n%2==0?"even":"odd"),s.setAttribute("id",this.view.getElementID(n)),this.setAccessibilityAttributes(s,e.node.element,t,i);const o=this.treeDelegate.getTemplateId(e.node),r=this.treeRenderers.find(e=>e.templateId===o);if(!r)throw new Error("No renderer found for template id "+o);let a=e.node;a===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(a=new Proxy(e.node,{}));const l=r.renderTemplate(s);r.renderElement(a,e.startIndex,l,e.height);const h=it(()=>{r.disposeElement(a,e.startIndex,l,e.height),r.disposeTemplate(l),s.remove()});return{element:s,disposable:h}}setAccessibilityAttributes(e,t,i,n){var s;if(!this.accessibilityProvider)return;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,n))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",null!==(s=this.accessibilityProvider.getRole(t))&&void 0!==s?s:"treeitem");const o=this.accessibilityProvider.getAriaLabel(t);o&&e.setAttribute("aria-label",o);const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);"number"==typeof r&&e.setAttribute("aria-level",""+r),e.setAttribute("aria-selected",String(!1))}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}}class aB extends st{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new ft,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new ft,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("blur",()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(e=>this.onKeyDown(e))),this._register(this.view.onMouseDown(e=>this.onMouseDown(e))),this._register(this.view.onContextMenu(e=>this.handleContextMenu(e)))}handleContextMenu(e){const t=e.browserEvent.target;if(!pR(t)&&!fR(t))return void(this.focusedLast()&&this.view.domFocus());if(!Ta(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const t=this.state.stickyNodes.findIndex(t=>{var i;return t.node.element===(null===(i=e.element)||void 0===i?void 0:i.element)});if(-1===t)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");return this.container.focus(),void this.setFocus(t)}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const i=this.state.stickyNodes[this.focusedIndex].node.element,n=this.elements[this.focusedIndex];this._onContextMenu.fire({element:i,anchor:n,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state)if("ArrowUp"===e.key)this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if("ArrowDown"===e.key||"ArrowRight"===e.key){if(this.focusedIndex>=this.state.count-1){const e=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([e]),this.scrollNodeUnderWidget(e,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}onMouseDown(e){const t=e.browserEvent.target;(pR(t)||fR(t))&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&0===t.count)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const e=II(i,0,t.count-1);this.setFocus(e)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e<t.count-1)&&t.lastNodePartiallyVisible()){const i=t.stickyNodes[e];this.scrollNodeUnderWidget(i.endIndex+1,t)}}scrollNodeUnderWidget(e,t){const i=t.stickyNodes[t.count-1],n=t.count>1?t.stickyNodes[t.count-2]:void 0,s=this.view.getElementTop(e),o=n?n.position+n.height+i.height:i.height;this.view.scrollTop=s-o}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return!!this.state&&this.view.getHTMLElement().classList.contains("sticky-scroll-focused")}removeFocus(){-1!==this.focusedIndex&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){e.classList.toggle("focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||0===this.elements.length)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),-1===this.focusedIndex&&this.setFocus(0)}onBlur(){this.domHasFocus=!1}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function lB(e){let t=FF.Unknown;return ma(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=FF.Twistie:ma(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?t=FF.Element:ma(e.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(t=FF.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function hB(e,t){t(e),e.children.forEach(e=>hB(e,t))}class dB{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new ft,this.onDidChange=this._onDidChange.event}set(e,t){!(null==t?void 0:t.__forceEvent)&&s(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach(e=>hB(e,i)),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach(e=>hB(e,n));const s=new Map,o=e=>s.set(this.identityProvider.getId(e.element).toString(),e);e.forEach(e=>hB(e,o));const r=[];for(const e of this.nodes){const t=this.identityProvider.getId(e.element).toString();if(i.has(t)){const e=s.get(t);e&&e.visible&&r.push(e)}else r.push(e)}if(this.nodes.length>0&&0===r.length){const e=this.getFirstViewElementWithTrait();e&&r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class cB extends LR{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(function e(t){return!!("A"===t.tagName&&t.classList.contains("monaco-button")||"DIV"===t.tagName&&t.classList.contains("monaco-button-dropdown"))||!t.classList.contains("monaco-list")&&(!!t.parentElement&&e(t.parentElement))}(e.browserEvent.target)||uR(e.browserEvent.target)||mR(e.browserEvent.target))return;if(e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,s=fR(e.browserEvent.target);let o=!1;if(o=!!s||("function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick),s)this.handleStickyScrollMouseEvent(e,t);else{if(o&&!n&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e)}if(t.collapsible&&(!s||n)){const i=this.tree.getNodeLocation(t),s=e.browserEvent.altKey;if(this.tree.setFocus([i]),this.tree.toggleCollapsed(i,s),o&&n)return void(e.browserEvent.isHandledByList=!0)}s||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(function(e){return gR(e,"monaco-custom-toggle")}(e.browserEvent.target)||function(e){return gR(e,"action-item")}(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),s=this.list.getElementTop(n),o=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=s-o,this.list.domFocus(),this.list.setFocus([n]),this.list.setSelection([n])}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&(e.browserEvent.isHandledByList||super.onDoubleClick(e))}onMouseDown(e){const t=e.browserEvent.target;pR(t)||fR(t)||super.onMouseDown(e)}onContextMenu(e){const t=e.browserEvent.target;pR(t)||fR(t)||super.onContextMenu(e)}}class uB extends AR{constructor(e,t,i,n,s,o,r,a){super(e,t,i,n,a),this.focusTrait=s,this.selectionTrait=o,this.anchorTrait=r}createMouseController(e){return new cB(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],s=[];let o;i.forEach((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&s.push(e+i),this.anchorTrait.has(t)&&(o=e+i)}),n.length>0&&super.setFocus(d([...super.getFocus(),...n])),s.length>0&&super.setSelection(d([...super.getSelection(),...s])),"number"==typeof o&&super.setAnchor(o)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(e=>this.element(e)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(e=>this.element(e)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class gB{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return dt.filter(dt.map(this.view.onMouseDblClick,lB),e=>e.target!==FF.Filter)}get onPointer(){return dt.map(this.view.onPointer,lB)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return dt.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.mode)&&void 0!==t?t:XF.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.matchType)&&void 0!==t?t:JF.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,s={}){var o;this._user=e,this._options=s,this.eventBufferer=new wt,this.onDidChangeFindOpenState=dt.None,this.onDidChangeStickyScrollFocused=dt.None,this.disposables=new nt,this._onWillRefilter=new ft,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new ft,this.treeDelegate=new GF(i);const r=new yt,a=new yt,l=this.disposables.add(new ZF(a.event)),h=new Sg;this.renderers=n.map(e=>new YF(e,()=>this.model,r.event,l,h,s));for(const e of this.renderers)this.disposables.add(e);let d;var c,u;s.keyboardNavigationLabelProvider&&(d=new QF(this,s.keyboardNavigationLabelProvider,s.filter),s={...s,filter:d},this.disposables.add(d)),this.focus=new dB(()=>this.view.getFocusedElements()[0],s.identityProvider),this.selection=new dB(()=>this.view.getSelectedElements()[0],s.identityProvider),this.anchor=new dB(()=>this.view.getAnchorElement(),s.identityProvider),this.view=new uB(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...(c=()=>this.model,u=s,u&&{...u,identityProvider:u.identityProvider&&{getId:e=>u.identityProvider.getId(e.element)},dnd:u.dnd&&new $F(c,u.dnd),multipleSelectionController:u.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>u.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element}),isSelectionRangeChangeEvent:e=>u.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})},accessibilityProvider:u.accessibilityProvider&&{...u.accessibilityProvider,getSetSize(e){const t=c(),i=t.getNodeLocation(e),n=t.getParentNodeLocation(i);return t.getNode(n).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:u.accessibilityProvider&&u.accessibilityProvider.isChecked?e=>u.accessibilityProvider.isChecked(e.element):void 0,getRole:u.accessibilityProvider&&u.accessibilityProvider.getRole?e=>u.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>u.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>u.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:u.accessibilityProvider&&u.accessibilityProvider.getWidgetRole?()=>u.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:u.accessibilityProvider&&u.accessibilityProvider.getAriaLevel?e=>u.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:u.accessibilityProvider.getActiveDescendantId&&(e=>u.accessibilityProvider.getActiveDescendantId(e.element))},keyboardNavigationLabelProvider:u.keyboardNavigationLabelProvider&&{...u.keyboardNavigationLabelProvider,getKeyboardNavigationLabel:e=>u.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,s),r.input=this.model.onDidChangeCollapseState;const g=dt.forEach(this.model.onDidSplice,e=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)})},this.disposables);g(()=>null,null,this.disposables);const m=this.disposables.add(new ft),f=this.disposables.add(new ao(0));if(this.disposables.add(dt.any(g,this.focus.onDidChange,this.selection.onDidChange)(()=>{f.trigger(()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);m.fire([...e.values()])})})),a.input=m.event,!1!==s.keyboardSupport){const e=dt.chain(this.view.onKeyDown,e=>e.filter(e=>!uR(e.target)).map(e=>new Xs(e)));dt.chain(e,e=>e.filter(e=>15===e.keyCode))(this.onLeftArrow,this,this.disposables),dt.chain(e,e=>e.filter(e=>17===e.keyCode))(this.onRightArrow,this,this.disposables),dt.chain(e,e=>e.filter(e=>10===e.keyCode))(this.onSpace,this,this.disposables)}if((null===(o=s.findWidgetEnabled)||void 0===o||o)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider){const e=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new eB(this,this.model,this.view,d,s.contextViewProvider,e),this.focusNavigationFilter=e=>this.findController.shouldAllowFocus(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=dt.None,this.onDidChangeFindMatchType=dt.None;s.enableStickyScroll&&(this.stickyScrollController=new oB(this,this.model,this.view,this.renderers,this.treeDelegate,s),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=Sa(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===UF.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),null===(t=this.findController)||void 0===t||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===UF.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new oB(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=dt.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),null===(t=this.stickyScrollController)||void 0===t||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){var e;(null===(e=this.stickyScrollController)||void 0===e?void 0:e.focusedLast())?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),E(t)&&(null===(i=this.findController)||void 0===i||i.layout(t))}style(e){var t;const i="."+this.view.domId,n=[];e.treeIndentGuidesStroke&&(n.push(`.monaco-list${i}:hover .monaco-tl-indent > .indent-guide, .monaco-list${i}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),n.push(`.monaco-list${i} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),e.listBackground&&(n.push(`.monaco-list${i} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${e.listBackground}; }`),n.push(`.monaco-list${i} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${e.listBackground}; }`)),e.listFocusForeground&&(n.push(`.monaco-list${i}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),n.push(`.monaco-list${i}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const s=Ya(e.listFocusAndSelectionOutline,Ya(e.listSelectionOutline,null!==(t=e.listFocusOutline)&&void 0!==t?t:""));s&&(n.push(`.monaco-list${i}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),n.push(`.monaco-list${i}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(n.push(`.monaco-list${i}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),n.push(`.monaco-list${i}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),n.push(`.monaco-workbench.context-menu-visible .monaco-list${i}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),n.push(`.monaco-workbench.context-menu-visible .monaco-list${i}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=n.join("\n"),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(e=>this.model.getNode(e));this.selection.set(i,t);const n=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(e=>this.model.getNode(e));this.focus.set(i,t);const n=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setFocus(n,t,!0)})}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(-1!==i)if(this.stickyScrollController){const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}else this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(e=>e.visible))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}dispose(){var e;et(this.disposables),null===(e=this.stickyScrollController)||void 0===e||e.dispose(),this.view.dispose()}}class mB{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new KF(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare:(e,t)=>i.sorter.compare(e.element,t.element)}),this.identityProvider=i.identityProvider}setChildren(e,t=j.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=j.empty(),i){const n=new Set,s=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:e=>{var t;if(null===e.element)return;const o=e;if(n.add(o.element),this.nodes.set(o.element,o),this.identityProvider){const e=this.identityProvider.getId(o.element).toString();s.add(e),this.nodesByIdentity.set(e,o)}null===(t=i.onDidCreateNode)||void 0===t||t.call(i,o)},onDidDeleteNode:e=>{var t;if(null===e.element)return;const o=e;if(n.has(o.element)||this.nodes.delete(o.element),this.identityProvider){const e=this.identityProvider.getId(o.element).toString();s.has(e)||this.nodesByIdentity.delete(e)}null===(t=i.onDidDeleteNode)||void 0===t||t.call(i,o)}})}preserveCollapseState(e=j.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),j.map(e,e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const i=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(i)}if(!t){let t;return t=void 0===e.collapsed?void 0:e.collapsed===PF.Collapsed||e.collapsed===PF.PreserveOrCollapsed||e.collapsed!==PF.Expanded&&e.collapsed!==PF.PreserveOrExpanded&&Boolean(e.collapsed),{...e,children:this.preserveCollapseState(e.children),collapsed:t}}const i="boolean"==typeof e.collapsible?e.collapsible:t.collapsible;let n;return n=void 0===e.collapsed||e.collapsed===PF.PreserveOrCollapsed||e.collapsed===PF.PreserveOrExpanded?t.collapsed:e.collapsed===PF.Collapsed||e.collapsed!==PF.Expanded&&Boolean(e.collapsed),{...e,collapsible:i,collapsed:n,children:this.preserveCollapseState(e.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new BF(this.user,"Tree element not found: "+e);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new BF(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new BF(this.user,"Tree element not found: "+e);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(null===e)return[];const t=this.nodes.get(e);if(!t)throw new BF(this.user,"Tree element not found: "+e);return this.model.getNodeLocation(t)}}function fB(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:j.map(j.from(e.children),fB),collapsible:e.collapsible,collapsed:e.collapsed}}function pB(e){const t=[e.element],i=e.incompressible||!1;let n,s;for(;[s,n]=j.consume(j.from(e.children),2),1===s.length&&!s[0].incompressible;)e=s[0],t.push(e.element);return{element:{elements:t,incompressible:i},children:j.map(j.concat(s,n),pB),collapsible:e.collapsible,collapsed:e.collapsed}}function _B(e){return function e(t,i=0){let n;return n=i<t.element.elements.length-1?[e(t,i+1)]:j.map(j.from(t.children),t=>e(t,0)),0===i&&t.element.incompressible?{element:t.element.elements[i],children:n,incompressible:!0,collapsible:t.collapsible,collapsed:t.collapsed}:{element:t.element.elements[i],children:n,collapsible:t.collapsible,collapsed:t.collapsed}}(e,0)}class vB{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new mB(e,t,i),this.enabled=void 0===i.compressionEnabled||i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=j.empty(),i){const n=i.diffIdentityProvider&&(o=i.diffIdentityProvider,{getId:e=>e.elements.map(e=>o.getId(e).toString()).join("\0")});var o;if(null===e){const e=j.map(t,this.enabled?pB:fB);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const r=this.nodes.get(e);if(!r)throw new BF(this.user,"Unknown compressed tree node");const a=this.model.getNode(r),l=this.model.getParentNodeLocation(r),h=this.model.getNode(l),d=function e(t,i,n){return t.element===i?{...t,children:n}:{...t,children:j.map(j.from(t.children),t=>e(t,i,n))}}(_B(a),e,t),c=(this.enabled?pB:fB)(d),u=i.diffIdentityProvider?(e,t)=>i.diffIdentityProvider.getId(e)===i.diffIdentityProvider.getId(t):void 0;if(s(c.element.elements,a.element.elements,u))return void this._setChildren(r,c.children||j.empty(),{diffIdentityProvider:n,diffDepth:1});const g=h.children.map(e=>e===a?c:e);this._setChildren(h.element,g,{diffIdentityProvider:n,diffDepth:a.depth-h.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,i=j.map(t,_B),n=j.map(i,e?pB:fB);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set;this.model.setChildren(e,t,{...i,onDidCreateNode:e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)}})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(null===e)return null;const t=this.nodes.get(e);if(!t)throw new BF(this.user,"Tree element not found: "+e);return t}}const bB=e=>e[e.length-1];class CB{get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new CB(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}class wB{get onDidSplice(){return dt.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(e=>this.nodeMapper.map(e)),deletedNodes:t.map(e=>this.nodeMapper.map(e))}))}get onDidChangeCollapseState(){return dt.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return dt.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||bB;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new WF(e=>new CB(n,e)),this.model=new vB(e,function(e,t){return{splice(i,n,s){t.splice(i,n,s.map(t=>e.map(t)))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}(this.nodeMapper,t),function(e,t){return{...t,identityProvider:t.identityProvider&&{getId:i=>t.identityProvider.getId(e(i))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter:(i,n)=>t.filter.filter(e(i),n)}}}(n,i))}setChildren(e,t=j.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return null==t?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var yB=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};class SB extends gB{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,s={}){super(e,t,i,n,s),this.user=e}setChildren(e,t=j.empty(),i){this.model.setChildren(e,t,i)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new mB(e,t,i)}}class LB{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){let s=this.stickyScrollDelegate.getCompressedNode(e);s||(s=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),1===s.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=s,this.renderer.renderCompressedElements(s,t,i.data,n))}disposeElement(e,t,i,n){var s,o,r,a;i.compressedTreeNode?null===(o=(s=this.renderer).disposeCompressedElements)||void 0===o||o.call(s,i.compressedTreeNode,t,i.data,n):null===(a=(r=this.renderer).disposeElement)||void 0===a||a.call(r,e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return!!this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}yB([Fb],LB.prototype,"compressedTreeNodeProvider",null);class kB{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),0===e.length)return[];for(let n=0;n<e.length;n++){const s=e[n],o=s.position+s.height;if(n+1<e.length&&o+e[n+1].height>i||n>=t-1&&t<e.length){const t=e.slice(0,n),i=e.slice(n);return[...t,this.compressStickyNodes(i)]}}return e}compressStickyNodes(e){if(0===e.length)throw new Error("Can't compress empty sticky nodes");if(!this.modelProvider().isCompressionEnabled())return e[0];const t=[];for(const i of e){const e=this.modelProvider().getCompressedTreeNode(i.node.element);if(e.element){if(e.element.incompressible)break;t.push(...e.element.elements)}}if(t.length<2)return e[0];const i=e[e.length-1],n={elements:t,incompressible:!1},s={...i.node,children:[],element:n},o=new Proxy(e[0].node,{}),r={node:o,startIndex:e[0].startIndex,endIndex:i.endIndex,position:e[0].position,height:e[0].height};return this.compressedStickyNodes.set(o,s),r}}function DB(e,t){return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}}}class xB extends SB{constructor(e,t,i,n,s={}){const o=()=>this,r=new kB(()=>this.model);super(e,t,i,n.map(e=>new LB(o,r,e)),{...DB(o,s),stickyScrollDelegate:r})}setChildren(e,t=j.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new wB(e,t,i)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function EB(e){return{...e,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function NB(e,t){return!!t.parent&&(t.parent===e||NB(e,t.parent))}class IB{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new IB(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class TB{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ml.asClassNameArray(Di.treeItemLoading)),!0):(t.classList.remove(...Ml.asClassNameArray(Di.treeItemLoading)),!1)}disposeElement(e,t,i,n){var s,o;null===(o=(s=this.renderer).disposeElement)||void 0===o||o.call(s,this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function MB(e){return{browserEvent:e.browserEvent,elements:e.elements.map(e=>e.element)}}function AB(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class OB extends eR{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function RB(e){return e instanceof eR?new OB(e):e}class PB{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,RB(e),t)}onDragOver(e,t,i,n,s,o=!0){return this.dnd.onDragOver(RB(e),t&&t.element,i,n,s)}drop(e,t,i,n,s){this.dnd.drop(RB(e),t&&t.element,i,n,s)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}dispose(){this.dnd.dispose()}}function FB(e){return e&&{...e,collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new PB(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element}),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var i;return!!(null===(i=e.accessibilityProvider)||void 0===i?void 0:i.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)},sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),defaultFindVisibility:t=>t.hasChildren&&t.stale?1:"number"==typeof e.defaultFindVisibility?e.defaultFindVisibility:void 0===e.defaultFindVisibility?2:e.defaultFindVisibility(t.element)}}function BB(e,t){t(e),e.children.forEach(e=>BB(e,t))}class WB{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return dt.map(this.tree.onDidChangeFocus,MB)}get onDidChangeSelection(){return dt.map(this.tree.onDidChangeSelection,MB)}get onMouseDblClick(){return dt.map(this.tree.onMouseDblClick,AB)}get onPointer(){return dt.map(this.tree.onPointer,AB)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,s,o={}){this.user=e,this.dataSource=s,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new ft,this._onDidChangeNodeSlowState=new ft,this.nodeMapper=new WF(e=>new IB(e)),this.disposables=new nt,this.identityProvider=o.identityProvider,this.autoExpandSingleChildren=void 0!==o.autoExpandSingleChildren&&o.autoExpandSingleChildren,this.sorter=o.sorter,this.getDefaultCollapseState=e=>o.collapseByDefault?o.collapseByDefault(e)?PF.PreserveOrCollapsed:PF.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,n,o),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=EB({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,n,s){const o=new GF(i),r=n.map(e=>new TB(e,this.nodeMapper,this._onDidChangeNodeSlowState.event)),a=FB(s)||{};return new SB(e,t,o,r,a)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(e=>e.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}async _updateChildren(e=this.root.element,t=!0,i=!1,n,s){if(void 0===this.root.element)throw new BF(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await dt.toPromise(this._onDidRender.event));const o=this.getDataNode(e);if(await this.refreshAndRenderNode(o,t,n,s),i)try{this.tree.rerender(o)}catch(e){}}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(void 0===this.root.element)throw new BF(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await dt.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(await this.root.refreshPromise,await dt.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await this.root.refreshPromise,await dt.toPromise(this._onDidRender.event)),n}setSelection(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(e=>e.element)}setFocus(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(e=>e.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new BF(this.user,"Data tree node not found: "+e);return t}async refreshAndRenderNode(e,t,i,n){await this.refreshNode(e,t,i),this.disposables.isDisposed||this.render(e,i,n)}async refreshNode(e,t,i){let n;if(this.subTreeRefreshPromises.forEach((s,o)=>{!n&&function(e,t){return e===t||NB(e,t)||NB(t,e)}(o,e)&&(n=s.then(()=>this.refreshNode(e,t,i)))}),n)return n;if(e!==this.root){if(this.tree.getNode(e).collapsed)return e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,void this.setChildren(e,[],t,i)}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){let n;e.refreshPromise=new Promise(e=>n=e),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const s=await this.doRefreshNode(e,t,i);e.stale=!1,await Co.settled(s.map(e=>this.doRefreshSubTree(e,t,i)))}finally{n()}}async doRefreshNode(e,t,i){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=this.doGetChildren(e);if(N(t))n=Promise.resolve(t);else{const i=ho(800);i.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},e=>null),n=t.finally(()=>i.cancel())}}else n=Promise.resolve(j.empty());try{const s=await n;return this.setChildren(e,s,t,i)}catch(t){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),He(t))return[];throw t}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return N(i)?this.processChildren(i):(t=oo(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Be))}setChildren(e,t,i,n){const s=[...t];if(0===e.children.length&&0===s.length)return[];const o=new Map,r=new Map;for(const t of e.children)o.set(t.element,t),this.identityProvider&&r.set(t.id,{node:t,collapsed:this.tree.hasElement(t)&&this.tree.isCollapsed(t)});const a=[],l=s.map(t=>{const s=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=EB({element:t,parent:e,hasChildren:s,defaultCollapseState:this.getDefaultCollapseState(t)});return s&&i.defaultCollapseState===PF.PreserveOrExpanded&&a.push(i),i}const l=this.identityProvider.getId(t).toString(),h=r.get(l);if(h){const e=h.node;return o.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=s,i?h.collapsed?(e.children.forEach(e=>BB(e,e=>this.nodes.delete(e.element))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):s&&!h.collapsed&&a.push(e),e}const d=EB({element:t,parent:e,id:l,hasChildren:s,defaultCollapseState:this.getDefaultCollapseState(t)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(d),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(d),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1||s&&d.defaultCollapseState===PF.PreserveOrExpanded)&&a.push(d),d});for(const e of o.values())BB(e,e=>this.nodes.delete(e.element));for(const e of l)this.nodes.set(e.element,e);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].forceExpanded=!0,a.push(l[0])),a}render(e,t,i){const n=e.children.map(e=>this.asTreeElement(e,t)),s=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.element)}};this.tree.setChildren(e===this.root?null:e,n,s),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?j.map(e.children,e=>this.asTreeElement(e,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class VB{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new VB(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class HB{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ml.asClassNameArray(Di.treeItemLoading)),!0):(t.classList.remove(...Ml.asClassNameArray(Di.treeItemLoading)),!1)}disposeElement(e,t,i,n){var s,o;null===(o=(s=this.renderer).disposeElement)||void 0===o||o.call(s,this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){var s,o;null===(o=(s=this.renderer).disposeCompressedElements)||void 0===o||o.call(s,this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=et(this.disposables)}}class zB extends WB{constructor(e,t,i,n,s,o,r={}){super(e,t,i,s,o,r),this.compressionDelegate=n,this.compressibleNodeMapper=new WF(e=>new VB(e)),this.filter=r.filter}createTree(e,t,i,n,s){const o=new GF(i),r=n.map(e=>new HB(e,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),a=function(e){const t=e&&FB(e);return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(e=>e.element))}}}(s)||{};return new xB(e,t,o,r,a)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const n=e=>this.identityProvider.getId(e).toString(),s=e=>{const t=new Set;for(const i of e){const e=this.tree.getCompressedTreeNode(i===this.root?null:i);if(e.element)for(const i of e.element.elements)t.add(n(i.element))}return t},o=s(this.tree.getSelection()),r=s(this.tree.getFocus());super.render(e,t,i);const a=this.getSelection();let l=!1;const h=this.getFocus();let d=!1;const c=e=>{const t=e.element;if(t)for(let e=0;e<t.elements.length;e++){const i=n(t.elements[e].element),s=t.elements[t.elements.length-1].element;o.has(i)&&-1===a.indexOf(s)&&(a.push(s),l=!0),r.has(i)&&-1===h.indexOf(s)&&(h.push(s),d=!0)}e.children.forEach(c)};c(this.tree.getCompressedTreeNode(e===this.root?null:e)),l&&this.setSelection(a),d&&this.setFocus(h)}processChildren(e){return this.filter&&(e=j.filter(e,e=>{const t=this.filter.filter(e,1),i="boolean"==typeof(n=t)?n?1:0:VF(n)?HF(n.visibility):HF(n);var n;if(2===i)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===i})),super.processChildren(e)}}class KB extends gB{constructor(e,t,i,n,s,o={}){super(e,t,i,n,o),this.user=e,this.dataSource=s,this.identityProvider=o.identityProvider}createModel(e,t,i){return new mB(e,t,i)}}new _h("isMac",K.i,Object(J.b)("isMac","Whether the operating system is macOS")),new _h("isLinux",K.g,Object(J.b)("isLinux","Whether the operating system is Linux")),new _h("isWindows",K.n,Object(J.b)("isWindows","Whether the operating system is Windows")),new _h("isWeb",K.m,Object(J.b)("isWeb","Whether the platform is a web browser")),new _h("isMacNative",K.i&&!K.m,Object(J.b)("isMacNative","Whether the operating system is macOS on a non-browser platform")),new _h("isIOS",K.f,Object(J.b)("isIOS","Whether the operating system is iOS")),new _h("isMobile",K.j,Object(J.b)("isMobile","Whether the platform is a mobile web browser")),new _h("isDevelopment",!1,!0),new _h("productQualityType","",Object(J.b)("productQualityType","Quality type of VS Code")),new _h("inputFocus",!1,Object(J.b)("inputFocus","Whether keyboard focus is inside an input box"));var UB=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},jB=function(e,t){return function(i,n){t(i,n,e)}};const qB=wl("listService");const $B=new _h("listScrollAtBoundary","none"),GB=(Ql.or($B.isEqualTo("top"),$B.isEqualTo("both")),Ql.or($B.isEqualTo("bottom"),$B.isEqualTo("both")),new _h("listFocus",!0)),ZB=new _h("treestickyScrollFocused",!1),YB=new _h("listSupportsMultiselect",!0),QB=(Ql.and(GB,Ql.not("inputFocus"),ZB.negate()),new _h("listHasSelectionOrFocus",!1)),XB=new _h("listDoubleSelection",!1),JB=new _h("listMultiSelection",!1),eW=new _h("listSelectionNavigation",!1),tW=new _h("listSupportsFind",!0),iW=new _h("treeElementCanCollapse",!1),nW=new _h("treeElementHasParent",!1),sW=new _h("treeElementCanExpand",!1),oW=new _h("treeElementHasChild",!1),rW=new _h("treeFindOpen",!1);function aW(e,t){const i=e.createScoped(t.getHTMLElement());return GB.bindTo(i),i}function lW(e,t){const i=$B.bindTo(e),n=()=>{const e=0===t.scrollTop,n=t.scrollHeight-t.renderHeight-t.scrollTop<1;e&&n?i.set("both"):e?i.set("top"):n?i.set("bottom"):i.set("none")};return n(),t.onDidScroll(n)}const hW="workbench.list.horizontalScrolling",dW="workbench.list.scrollByPage",cW="workbench.tree.indent",uW="workbench.list.smoothScrolling",gW="workbench.list.mouseWheelScrollSensitivity",mW="workbench.list.fastScrollSensitivity",fW="workbench.tree.expandMode",pW="workbench.tree.enableStickyScroll";function _W(e){return"alt"===e.getValue("workbench.list.multiSelectModifier")}class vW extends st{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=_W(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.list.multiSelectModifier")&&(this.useAltAsMultipleSelectionModifier=_W(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:wR(e)}isSelectionRangeChangeEvent(e){return yR(e)}}function bW(e,t){var i;const n=e.get(Xd),s=e.get(Iw),o=new nt;return[{...t,keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>s.mightProducePrintableCharacter(e)},smoothScrolling:Boolean(n.getValue(uW)),mouseWheelScrollSensitivity:n.getValue(gW),fastScrollSensitivity:n.getValue(mW),multipleSelectionController:null!==(i=t.multipleSelectionController)&&void 0!==i?i:o.add(new vW(n)),keyboardNavigationEventFilter:xW(s),scrollByPage:Boolean(n.getValue(dW))},o]}let CW=class extends AR{constructor(e,t,i,n,s,o,r,a,l){const h=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(a.getValue(hW)),[d,c]=l.invokeFunction(bW,s);super(e,t,i,n,{keyboardSupport:!1,...d,horizontalScrolling:h}),this.disposables.add(c),this.contextKeyService=aW(o,this),this.disposables.add(lW(this.contextKeyService,this)),this.listSupportsMultiSelect=YB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport);eW.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=QB.bindTo(this.contextKeyService),this.listDoubleSelection=XB.bindTo(this.contextKeyService),this.listMultiSelection=JB.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=_W(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)})})),this.disposables.add(this.onDidChangeFocus(()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)})),this.disposables.add(a.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.list.multiSelectModifier")&&(this._useAltAsMultipleSelectionModifier=_W(a));let t={};if(e.affectsConfiguration(hW)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(hW));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(dW)){const e=Boolean(a.getValue(dW));t={...t,scrollByPage:e}}if(e.affectsConfiguration(uW)){const e=Boolean(a.getValue(uW));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(gW)){const e=a.getValue(gW);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(mW)){const e=a.getValue(mW);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new LW(this,{configurationService:a,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?aP(e):rP)}};CW=UB([jB(5,vh),jB(6,qB),jB(7,Xd),jB(8,bl)],CW);let wW=class extends class{constructor(e,t,i,n,s={}){const o=()=>this.model,r=n.map(e=>new iF(e,o));this.list=new AR(e,t,i,r,function(e,t){return{...t,accessibilityProvider:t.accessibilityProvider&&new nF(e,t.accessibilityProvider)}}(o,s))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return dt.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return dt.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return dt.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(e=>this._model.get(e)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,u(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}{constructor(e,t,i,n,s,o,r,a,l){const h=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(a.getValue(hW)),[d,c]=l.invokeFunction(bW,s);super(e,t,i,n,{keyboardSupport:!1,...d,horizontalScrolling:h}),this.disposables=new nt,this.disposables.add(c),this.contextKeyService=aW(o,this),this.disposables.add(lW(this.contextKeyService,this.widget)),this.horizontalScrolling=s.horizontalScrolling,this.listSupportsMultiSelect=YB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport);eW.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this._useAltAsMultipleSelectionModifier=_W(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(a.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.list.multiSelectModifier")&&(this._useAltAsMultipleSelectionModifier=_W(a));let t={};if(e.affectsConfiguration(hW)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(hW));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(dW)){const e=Boolean(a.getValue(dW));t={...t,scrollByPage:e}}if(e.affectsConfiguration(uW)){const e=Boolean(a.getValue(uW));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(gW)){const e=a.getValue(gW);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(mW)){const e=a.getValue(mW);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new LW(this,{configurationService:a,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?aP(e):rP)}dispose(){this.disposables.dispose(),super.dispose()}};wW=UB([jB(5,vh),jB(6,qB),jB(7,Xd),jB(8,bl)],wW);let yW=class extends wF{constructor(e,t,i,n,s,o,r,a,l,h){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(l.getValue(hW)),[c,u]=h.invokeFunction(bW,o);super(e,t,i,n,s,{keyboardSupport:!1,...c,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=aW(r,this),this.disposables.add(lW(this.contextKeyService,this)),this.listSupportsMultiSelect=YB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport);eW.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=QB.bindTo(this.contextKeyService),this.listDoubleSelection=XB.bindTo(this.contextKeyService),this.listMultiSelection=JB.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=_W(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)})})),this.disposables.add(this.onDidChangeFocus(()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)})),this.disposables.add(l.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.list.multiSelectModifier")&&(this._useAltAsMultipleSelectionModifier=_W(l));let t={};if(e.affectsConfiguration(hW)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(hW));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(dW)){const e=Boolean(l.getValue(dW));t={...t,scrollByPage:e}}if(e.affectsConfiguration(uW)){const e=Boolean(l.getValue(uW));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(gW)){const e=l.getValue(gW);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(mW)){const e=l.getValue(mW);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new kW(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?aP(e):rP)}dispose(){this.disposables.dispose(),super.dispose()}};yW=UB([jB(6,vh),jB(7,qB),jB(8,Xd),jB(9,bl)],yW);class SW extends st{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new ft),this.onDidOpen=this._onDidOpen.event,this._register(dt.filter(this.widget.onDidChangeSelection,e=>Ta(e.browserEvent))(e=>this.onSelectionFromKeyboard(e))),this._register(this.widget.onPointer(e=>this.onPointer(e.element,e.browserEvent))),this._register(this.widget.onMouseDblClick(e=>this.onMouseDblClick(e.element,e.browserEvent))),"boolean"!=typeof(null==t?void 0:t.openOnSingleClick)&&(null==t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue("workbench.list.openMode")),this._register(null==t?void 0:t.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.list.openMode")&&(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue("workbench.list.openMode")))}))):this.openOnSingleClick=null===(i=null==t?void 0:t.openOnSingleClick)||void 0===i||i}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,t)}_open(e,t,i,n,s){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:s})}}class LW extends SW{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class kW extends SW{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class DW extends SW{constructor(e,t){super(e,t)}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function xW(e){let t=!1;return i=>{if(i.toKeyCodeChord().isModifierKey())return!1;if(t)return t=!1,!1;const n=e.softDispatch(i,i.target);return 1===n.kind?(t=!0,!1):(t=!1,0===n.kind)}}let EW=class extends SB{constructor(e,t,i,n,s,o,r,a,l){const{options:h,getTypeNavigationMode:d,disposable:c}=o.invokeFunction(RW,s);super(e,t,i,n,h),this.disposables.add(c),this.internals=new PW(this,s,d,s.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};EW=UB([jB(5,bl),jB(6,vh),jB(7,qB),jB(8,Xd)],EW);let NW=class extends xB{constructor(e,t,i,n,s,o,r,a,l){const{options:h,getTypeNavigationMode:d,disposable:c}=o.invokeFunction(RW,s);super(e,t,i,n,h),this.disposables.add(c),this.internals=new PW(this,s,d,s.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};NW=UB([jB(5,bl),jB(6,vh),jB(7,qB),jB(8,Xd)],NW);let IW=class extends KB{constructor(e,t,i,n,s,o,r,a,l,h){const{options:d,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(RW,o);super(e,t,i,n,s,d),this.disposables.add(u),this.internals=new PW(this,o,c,o.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),void 0!==e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};IW=UB([jB(6,bl),jB(7,vh),jB(8,qB),jB(9,Xd)],IW);let TW=class extends WB{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,s,o,r,a,l,h){const{options:d,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(RW,o);super(e,t,i,n,s,d),this.disposables.add(u),this.internals=new PW(this,o,c,o.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};TW=UB([jB(6,bl),jB(7,vh),jB(8,qB),jB(9,Xd)],TW);let MW=class extends zB{constructor(e,t,i,n,s,o,r,a,l,h,d){const{options:c,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(RW,r);super(e,t,i,n,s,o,c),this.disposables.add(g),this.internals=new PW(this,r,u,r.overrideStyles,l,h,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function AW(e){const t=e.getValue("workbench.list.defaultFindMode");if("highlight"===t)return XF.Highlight;if("filter"===t)return XF.Filter;const i=e.getValue("workbench.list.keyboardNavigation");return"simple"===i||"highlight"===i?XF.Highlight:"filter"===i?XF.Filter:void 0}function OW(e){const t=e.getValue("workbench.list.defaultFindMatchType");return"fuzzy"===t?JF.Fuzzy:"contiguous"===t?JF.Contiguous:void 0}function RW(e,t){var i;const n=e.get(Xd),s=e.get(ST),o=e.get(vh),r=e.get(bl),a=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(n.getValue(hW)),[l,h]=r.invokeFunction(bW,t),d=t.paddingBottom,c=void 0!==t.renderIndentGuides?t.renderIndentGuides:n.getValue("workbench.tree.renderIndentGuides");return{getTypeNavigationMode:()=>{const e=o.getContextKeyValue("listTypeNavigationMode");if("automatic"===e)return oR.Automatic;if("trigger"===e)return oR.Trigger;if(!1===o.getContextKeyValue("listAutomaticKeyboardNavigation"))return oR.Trigger;const t=n.getValue("workbench.list.typeNavigationMode");return"automatic"===t?oR.Automatic:"trigger"===t?oR.Trigger:void 0},disposable:h,options:{keyboardSupport:!1,...l,indent:"number"==typeof n.getValue(cW)?n.getValue(cW):void 0,renderIndentGuides:c,smoothScrolling:Boolean(n.getValue(uW)),defaultFindMode:AW(n),defaultFindMatchType:OW(n),horizontalScrolling:a,scrollByPage:Boolean(n.getValue(dW)),paddingBottom:d,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:null!==(i=t.expandOnlyOnTwistieClick)&&void 0!==i?i:"doubleClick"===n.getValue(fW),contextViewProvider:s,findWidgetStyles:sP,enableStickyScroll:Boolean(n.getValue(pW)),stickyScrollMaxItemCount:Number(n.getValue("workbench.tree.stickyScrollMaxItemCount"))}}}MW=UB([jB(7,bl),jB(8,vh),jB(9,qB),jB(10,Xd)],MW);let PW=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,s,o,r){var a;this.tree=e,this.disposables=[],this.contextKeyService=aW(s,e),this.disposables.push(lW(this.contextKeyService,e)),this.listSupportsMultiSelect=YB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport);eW.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=tW.bindTo(this.contextKeyService),this.listSupportFindWidget.set(null===(a=t.findWidgetEnabled)||void 0===a||a),this.hasSelectionOrFocus=QB.bindTo(this.contextKeyService),this.hasDoubleSelection=XB.bindTo(this.contextKeyService),this.hasMultiSelection=JB.bindTo(this.contextKeyService),this.treeElementCanCollapse=iW.bindTo(this.contextKeyService),this.treeElementHasParent=nW.bindTo(this.contextKeyService),this.treeElementCanExpand=sW.bindTo(this.contextKeyService),this.treeElementHasChild=oW.bindTo(this.contextKeyService),this.treeFindOpen=rW.bindTo(this.contextKeyService),this.treeStickyScrollFocused=ZB.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=_W(r),this.updateStyleOverrides(n);const l=()=>{const t=e.getFocus()[0];if(!t)return;const i=e.getNode(t);this.treeElementCanCollapse.set(i.collapsible&&!i.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(i.collapsible&&i.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))},h=new Set;h.add("listTypeNavigationMode"),h.add("listAutomaticKeyboardNavigation"),this.disposables.push(this.contextKeyService,o.register(e),e.onDidChangeSelection(()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)})}),e.onDidChangeFocus(()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0),l()}),e.onDidChangeCollapseState(l),e.onDidChangeModel(l),e.onDidChangeFindOpenState(e=>this.treeFindOpen.set(e)),e.onDidChangeStickyScrollFocused(e=>this.treeStickyScrollFocused.set(e)),r.onDidChangeConfiguration(n=>{let s={};if(n.affectsConfiguration("workbench.list.multiSelectModifier")&&(this._useAltAsMultipleSelectionModifier=_W(r)),n.affectsConfiguration(cW)){const e=r.getValue(cW);s={...s,indent:e}}if(n.affectsConfiguration("workbench.tree.renderIndentGuides")&&void 0===t.renderIndentGuides){const e=r.getValue("workbench.tree.renderIndentGuides");s={...s,renderIndentGuides:e}}if(n.affectsConfiguration(uW)){const e=Boolean(r.getValue(uW));s={...s,smoothScrolling:e}}if(n.affectsConfiguration("workbench.list.defaultFindMode")||n.affectsConfiguration("workbench.list.keyboardNavigation")){const e=AW(r);s={...s,defaultFindMode:e}}if(n.affectsConfiguration("workbench.list.typeNavigationMode")||n.affectsConfiguration("workbench.list.keyboardNavigation")){const e=i();s={...s,typeNavigationMode:e}}if(n.affectsConfiguration("workbench.list.defaultFindMatchType")){const e=OW(r);s={...s,defaultFindMatchType:e}}if(n.affectsConfiguration(hW)&&void 0===t.horizontalScrolling){const e=Boolean(r.getValue(hW));s={...s,horizontalScrolling:e}}if(n.affectsConfiguration(dW)){const e=Boolean(r.getValue(dW));s={...s,scrollByPage:e}}if(n.affectsConfiguration(fW)&&void 0===t.expandOnlyOnTwistieClick&&(s={...s,expandOnlyOnTwistieClick:"doubleClick"===r.getValue(fW)}),n.affectsConfiguration(pW)){const e=r.getValue(pW);s={...s,enableStickyScroll:e}}if(n.affectsConfiguration("workbench.tree.stickyScrollMaxItemCount")){const e=Math.max(1,r.getValue("workbench.tree.stickyScrollMaxItemCount"));s={...s,stickyScrollMaxItemCount:e}}if(n.affectsConfiguration(gW)){const e=r.getValue(gW);s={...s,mouseWheelScrollSensitivity:e}}if(n.affectsConfiguration(mW)){const e=r.getValue(mW);s={...s,fastScrollSensitivity:e}}Object.keys(s).length>0&&e.updateOptions(s)}),this.contextKeyService.onDidChangeContext(t=>{t.affectsSome(h)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new DW(e,{configurationService:r,...t}),this.disposables.push(this.navigator)}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?aP(e):rP)}dispose(){this.disposables=et(this.disposables)}};PW=UB([jB(4,vh),jB(5,qB),jB(6,Xd)],PW);var FW;Eh.as(cc).registerConfiguration({id:"workbench",order:7,title:Object(J.b)("workbenchConfigurationTitle","Workbench"),type:"object",properties:{"workbench.list.multiSelectModifier":{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[Object(J.b)("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),Object(J.b)("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:Object(J.b)({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},"workbench.list.openMode":{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:Object(J.b)({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[hW]:{type:"boolean",default:!1,description:Object(J.b)("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[dW]:{type:"boolean",default:!1,description:Object(J.b)("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[cW]:{type:"number",default:8,minimum:4,maximum:40,description:Object(J.b)("tree indent setting","Controls tree indentation in pixels.")},"workbench.tree.renderIndentGuides":{type:"string",enum:["none","onHover","always"],default:"onHover",description:Object(J.b)("render tree indent guides","Controls whether the tree should render indent guides.")},[uW]:{type:"boolean",default:!1,description:Object(J.b)("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[gW]:{type:"number",default:1,markdownDescription:Object(J.b)("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[mW]:{type:"number",default:5,markdownDescription:Object(J.b)("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},"workbench.list.defaultFindMode":{type:"string",enum:["highlight","filter"],enumDescriptions:[Object(J.b)("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),Object(J.b)("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:Object(J.b)("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},"workbench.list.keyboardNavigation":{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[Object(J.b)("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),Object(J.b)("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),Object(J.b)("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:Object(J.b)("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:Object(J.b)("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and\t'workbench.list.typeNavigationMode' instead.")},"workbench.list.defaultFindMatchType":{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[Object(J.b)("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),Object(J.b)("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:Object(J.b)("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[fW]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:Object(J.b)("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[pW]:{type:"boolean",default:!0,description:Object(J.b)("sticky scroll","Controls whether sticky scrolling is enabled in trees.")},"workbench.tree.stickyScrollMaxItemCount":{type:"number",minimum:1,default:7,markdownDescription:Object(J.b)("sticky scroll maximum items","Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},"workbench.list.typeNavigationMode":{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:Object(J.b)("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}}),function(e){e[e.PRESERVE=0]="PRESERVE",e[e.LAST=1]="LAST"}(FW||(FW={}));const BW="workbench.contributions.quickaccess";Eh.add(BW,new class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort((e,t)=>t.prefix.length-e.prefix.length),it(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return a([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(t=>e.startsWith(t.prefix))||void 0||this.defaultProvider}});const WW={ctrlCmd:!1,alt:!1};var VW,HW;!function(e){e[e.Blur=1]="Blur",e[e.Gesture=2]="Gesture",e[e.Other=3]="Other"}(VW||(VW={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.SECOND=2]="SECOND",e[e.LAST=3]="LAST"}(HW||(HW={}));new class{constructor(e){this.options=e}};const zW=wl("quickInputService");var KW=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},UW=function(e,t){return function(i,n){t(i,n,e)}};let jW=class extends st{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Eh.as(BW),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var n;const[s,o]=this.getOrInstantiateProvider(e),r=this.visibleQuickAccess,a=null==r?void 0:r.descriptor;if(r&&o&&a===o)return e===o.prefix||(null==i?void 0:i.preserveValue)||(r.picker.value=e),void this.adjustValueSelection(r.picker,o,i);if(o&&!(null==i?void 0:i.preserveValue)){let t=void 0;if(r&&a&&a!==o){const e=r.value.substr(a.prefix.length);e&&(t=`${o.prefix}${e}`)}if(!t){const e=null==s?void 0:s.defaultFilterValue;e===FW.LAST?t=this.lastAcceptedPickerValues.get(o):"string"==typeof e&&(t=`${o.prefix}${e}`)}"string"==typeof t&&(e=t)}const l=new nt,h=l.add(this.quickInputService.createQuickPick());h.value=e,this.adjustValueSelection(h,o,i),h.placeholder=null==o?void 0:o.placeholder,h.quickNavigate=null==i?void 0:i.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,("number"==typeof(null==i?void 0:i.itemActivation)||(null==i?void 0:i.quickNavigateConfiguration))&&(h.itemActivation=null!==(n=null==i?void 0:i.itemActivation)&&void 0!==n?n:HW.SECOND),h.contextKey=null==o?void 0:o.contextKey,h.filterValue=e=>e.substring(o?o.prefix.length:0);let d=void 0;t&&(d=new bo,l.add(dt.once(h.onWillAccept)(e=>{e.veto(),h.hide()}))),l.add(this.registerPickerListeners(h,s,o,e,null==i?void 0:i.providerOptions));const c=l.add(new xt);return s&&l.add(s.provide(h,c.token,null==i?void 0:i.providerOptions)),dt.once(h.onDidHide)(()=>{0===h.selectedItems.length&&c.cancel(),l.dispose(),null==d||d.complete(h.selectedItems.slice(0))}),h.show(),t?null==d?void 0:d.p:void 0}adjustValueSelection(e,t,i){var n;let s;s=(null==i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null==t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,n,s){const o=new nt,r=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return o.add(it(()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),o.add(e.onDidChangeValue(e=>{const[i]=this.getOrInstantiateProvider(e);i!==t?this.show(e,{preserveValue:!0,providerOptions:s}):r.value=e})),i&&o.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),o}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};jW=KW([UW(0,zW),UW(1,bl)],jW);i("0qr2"),i("+KnZ");class qW{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=null!==(i=null==t?void 0:t.supportIcons)&&void 0!==i&&i,this.domNode=Fa(e,Ka("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=qW.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&H(this.highlights,t)||(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t<i.start){const n=this.text.substring(t,i.start);this.supportIcons?e.push(...OT(n)):e.push(n),t=i.start}const n=this.text.substring(t,i.end),s=Ka("span.highlight",void 0,...this.supportIcons?OT(n):[n]);i.extraClasses&&s.classList.add(...i.extraClasses),e.push(s),t=i.end}if(t<this.text.length){const i=this.text.substring(t);this.supportIcons?e.push(...OT(i)):e.push(i)}Wa(this.domNode,...e),this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,t){let i=0,n=0;return e.replace(/\r\n|\r|\n/g,(e,s)=>{n="\r\n"===e?-1:0,s+=i;for(const e of t)e.end<=s||(e.start>=s&&(e.start+=n),e.end>=s&&(e.end+=n));return i+=n,"⏎"})}}class $W{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class GW extends st{constructor(e,t){var i;super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new $W(Fa(e,Ka(".monaco-icon-label")))),this.labelContainer=Fa(this.domNode.element,Ka(".monaco-icon-label-container")),this.nameContainer=Fa(this.labelContainer,Ka("span.monaco-icon-name-container")),(null==t?void 0:t.supportHighlights)||(null==t?void 0:t.supportIcons)?this.nameNode=new YW(this.nameContainer,!!t.supportIcons):this.nameNode=new ZW(this.nameContainer),this.hoverDelegate=null!==(i=null==t?void 0:t.hoverDelegate)&&void 0!==i?i:zO("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){var n;const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";if(i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&("string"==typeof i.title?r+=i.title:r+=e)),this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=o.join(" "),this.setupHover((null==i?void 0:i.descriptionTitle)?this.labelContainer:this.element,null==i?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const e=this.getOrCreateDescriptionNode();e instanceof qW?(e.set(t||"",i?i.descriptionMatches:void 0,void 0,null==i?void 0:i.labelEscapeNewLines),this.setupHover(e.element,null==i?void 0:i.descriptionTitle)):(e.textContent=t&&(null==i?void 0:i.labelEscapeNewLines)?qW.escapeNewLines(t,[]):t||"",this.setupHover(e.element,(null==i?void 0:i.descriptionTitle)||""),e.empty=!t)}if((null==i?void 0:i.suffix)||this.suffixNode){this.getOrCreateSuffixNode().textContent=null!==(n=null==i?void 0:i.suffix)&&void 0!==n?n:""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),t)if(this.hoverDelegate.showNativeHover)!function(e,t){k(t)?e.title=vM(t):(null==t?void 0:t.markdownNotSupportedFallback)?e.title=t.markdownNotSupportedFallback:e.removeAttribute("title")}(e,t);else{const i=UO(this.hoverDelegate,e,t);i&&this.customHovers.set(e,i)}else e.removeAttribute("title")}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const i=this._register(new $W((e=this.nameContainer,t=Ka("span.monaco-icon-suffix-container"),e.after(t),t)));this.suffixNode=this._register(new $W(Fa(i.element,Ka("span.label-suffix"))))}var e,t;return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new $W(Fa(this.labelContainer,Ka("span.monaco-icon-description-container"))));(null===(e=this.creationOptions)||void 0===e?void 0:e.supportDescriptionHighlights)?this.descriptionNode=new qW(Fa(t.element,Ka("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new $W(Fa(t.element,Ka("span.label-description"))))}return this.descriptionNode}}class ZW{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!H(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=Fa(this.container,Ka("a.label-name",{id:null==t?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const n=e[i],s=(null==t?void 0:t.domId)&&`${null==t?void 0:t.domId}_${i}`;Fa(this.container,Ka("a.label-name",{id:s,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&Fa(this.container,Ka("span.label-separator",void 0,(null==t?void 0:t.separator)||"/"))}}}}class YW{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!H(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new qW(Fa(this.container,Ka("a.label-name",{id:null==t?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,null==t?void 0:t.matches,void 0,null==t?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(null==t?void 0:t.separator)||"/",n=function(e,t,i){if(!i)return;let n=0;return e.map(e=>{const s={start:n,end:n+e.length},o=i.map(e=>bO.intersect(s,e)).filter(e=>!bO.isEmpty(e)).map(({start:e,end:t})=>({start:e-n,end:t-n}));return n=s.end+t.length,o})}(e,i,null==t?void 0:t.matches);for(let s=0;s<e.length;s++){const o=e[s],r=n?n[s]:void 0,a=Ka("a.label-name",{id:(null==t?void 0:t.domId)&&`${null==t?void 0:t.domId}_${s}`,"data-icon-label-count":e.length,"data-icon-label-index":s,role:"treeitem"});new qW(Fa(this.container,a),{supportIcons:this.supportIcons}).set(o,r,void 0,null==t?void 0:t.labelEscapeNewLines),s<e.length-1&&Fa(a,Ka("span.label-separator",void 0,i))}}}}i("Nou3");const QW=Ka;class XW{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const n=this.options.keybindingLabelForeground;this.domNode=Fa(e,QW(".monaco-keybinding")),n&&(this.domNode.style.color=n),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&XW.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){var e;if(this.clear(),this.keybinding){const t=this.keybinding.getChords();t[0]&&this.renderChord(this.domNode,t[0],this.matches?this.matches.firstPart:null);for(let e=1;e<t.length;e++)Fa(this.domNode,QW("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,t[e],this.matches?this.matches.chordPart:null);const i=null!==(e=this.options.disableTitle)&&void 0!==e&&e?void 0:this.keybinding.getAriaLabel()||void 0;void 0!==i?this.domNode.title=i:this.domNode.removeAttribute("title")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){$r(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const n=UA.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,Boolean(null==i?void 0:i.ctrlKey),n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,Boolean(null==i?void 0:i.shiftKey),n.separator),t.altKey&&this.renderKey(e,n.altKey,Boolean(null==i?void 0:i.altKey),n.separator),t.metaKey&&this.renderKey(e,n.metaKey,Boolean(null==i?void 0:i.metaKey),n.separator);const s=t.keyLabel;s&&this.renderKey(e,s,Boolean(null==i?void 0:i.keyCode),"")}renderKey(e,t,i,n){Fa(e,this.createKeyElement(t,i?".highlight":"")),n&&Fa(e,QW("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){Fa(e,this.createKeyElement(Object(J.b)("unbound","Unbound")))}createKeyElement(e,t=""){const i=QW("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),this.options.keybindingLabelBackground&&(i.style.backgroundColor=this.options.keybindingLabelBackground),this.options.keybindingLabelBorder&&(i.style.borderColor=this.options.keybindingLabelBorder),this.options.keybindingLabelBottomBorder&&(i.style.borderBottomColor=this.options.keybindingLabelBottomBorder),this.options.keybindingLabelShadow&&(i.style.boxShadow="inset 0 -1px 0 "+this.options.keybindingLabelShadow),i}static areSame(e,t){return e===t||!e&&!t||!!e&&!!t&&H(e.firstPart,t.firstPart)&&H(e.chordPart,t.chordPart)}}const JW=new Vn.a(()=>{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}});new Vn.a(()=>({collator:new Intl.Collator(void 0,{numeric:!0})})),new Vn.a(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function eV(e,t,i){const n=e.toLowerCase(),s=t.toLowerCase(),o=function(e,t,i){const n=e.toLowerCase(),s=t.toLowerCase(),o=n.startsWith(i),r=s.startsWith(i);if(o!==r)return o?-1:1;if(o&&r){if(n.length<s.length)return-1;if(n.length>s.length)return 1}return 0}(e,t,i);if(o)return o;const r=n.endsWith(i);if(r!==s.endsWith(i))return r?-1:1;const a=function(e,t,i=!1){const n=e||"",s=t||"",o=JW.value.collator.compare(n,s);return JW.value.collatorIsNumeric&&0===o&&n!==s?n<s?-1:1:o}(n,s);return 0!==a?a:n.localeCompare(s)}var tV=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};class iV{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>"string"==typeof e?e:e.label).join("")}}tV([Fb],iV.prototype,"toString",null);const nV=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;const sV={},oV=new DM("quick-input-button-icon-");function rV(e,t,i){let n=e.iconClass||function(e){if(!e)return;let t;const i=e.dark.toString();return sV[i]?t=sV[i]:(t=oV.nextId(),Na(`.${t}, .hc-light .${t}`,"background-image: "+Ga(e.light||e.dark)),Na(`.vs-dark .${t}, .hc-black .${t}`,"background-image: "+Ga(e.dark)),sV[i]=t),t}(e.iconPath);return e.alwaysVisible&&(n=n?n+" always-visible":"always-visible"),{id:t,label:"",tooltip:e.tooltip||"",class:n,enabled:!0,run:i}}function aV(e,t,i){Wa(t);const n=function(e){const t=[];let i,n=0;for(;i=nV.exec(e);){i.index-n>0&&t.push(e.substring(n,i.index));const[,s,o,,r]=i;r?t.push({label:s,href:o,title:r}):t.push({label:s,href:o}),n=i.index+i[0].length}return n<e.length&&t.push(e.substring(n)),new iV(t)}(e);let s=0;for(const e of n.nodes)if("string"==typeof e)t.append(...OT(e));else{let n=e.title;!n&&e.href.startsWith("command:")?n=Object(J.b)("executeCommand","Click to execute command '{0}'",e.href.substring("command:".length)):n||(n=e.href);const o=Ka("a",{href:e.href,title:n,tabIndex:s++},e.label);o.style.textDecoration="underline";const r=t=>{Aa(t)&&Oa(t,!0),i.callback(e.href)},a=i.disposables.add(new dC(o,Ma.CLICK)).event,l=i.disposables.add(new dC(o,Ma.KEY_DOWN)).event,h=dt.chain(l,e=>e.filter(e=>{const t=new Xs(e);return t.equals(10)||t.equals(3)}));i.disposables.add(Vb.addTarget(o));const d=i.disposables.add(new dC(o,Bb.Tap)).event;dt.any(a,d,h)(r,null,i.disposables),t.appendChild(o)}}var lV=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};const hV=Ka;class dV{constructor(e,t,i,n,s,o,r){var a,l,h;this._checked=!1,this._hidden=!1,this.hasCheckbox=n,this.index=i,this.fireButtonTriggered=s,this.fireSeparatorButtonTriggered=o,this._onChecked=r,this.onChecked=n?dt.map(dt.filter(this._onChecked.event,e=>e.listElement===this),e=>e.checked):dt.None,"separator"===e.type?this._separator=e:(this.item=e,t&&"separator"===t.type&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=null===(a=this.item.highlights)||void 0===a?void 0:a.label,this._descriptionHighlights=null===(l=this.item.highlights)||void 0===l?void 0:l.description,this._detailHighlights=null===(h=this.item.highlights)||void 0===h?void 0:h.detail,this.saneTooltip=this.item.tooltip),this._init=new Vn.a(()=>{var t;const i=null!==(t=e.label)&&void 0!==t?t:"",n=CM(i).text.trim(),s=e.ariaLabel||[i,this.saneDescription,this.saneDetail].map(e=>{return(t=e)?t.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():"";var t}).filter(e=>!!e).join(", ");return{saneLabel:i,saneSortLabel:n,saneAriaLabel:s}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class cV{constructor(e,t){this.themeService=e,this.hoverDelegate=t}get templateId(){return cV.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Fa(e,hV(".quick-input-list-entry"));const i=Fa(t.entry,hV("label.quick-input-list-label"));t.toDisposeTemplate.push(Qr(i,Ma.CLICK,e=>{t.checkbox.offsetParent||e.preventDefault()})),t.checkbox=Fa(i,hV("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Qr(t.checkbox,Ma.CHANGE,e=>{t.element.checked=t.checkbox.checked}));const n=Fa(i,hV(".quick-input-list-rows")),s=Fa(n,hV(".quick-input-list-row")),o=Fa(n,hV(".quick-input-list-row"));t.label=new GW(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.push(t.label),t.icon=Ba(t.label.element,hV(".quick-input-list-icon"));const r=Fa(s,hV(".quick-input-list-entry-keybinding"));t.keybinding=new XW(r,K.a);const a=Fa(o,hV(".quick-input-list-label-meta"));return t.detail=new GW(a,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.push(t.detail),t.separator=Fa(t.entry,hV(".quick-input-list-separator")),t.actionBar=new bP(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){var n,s,o,r;i.element=e,e.element=null!==(n=i.entry)&&void 0!==n?n:void 0;const a=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked(e=>i.checkbox.checked=e));const{labelHighlights:l,descriptionHighlights:h,detailHighlights:d}=e;if(null===(s=e.item)||void 0===s?void 0:s.iconPath){const t=cb(this.themeService.getColorTheme().type)?e.item.iconPath.dark:null!==(o=e.item.iconPath.light)&&void 0!==o?o:e.item.iconPath.dark,n=di.revive(t);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Ga(n)}else i.icon.style.backgroundImage="",i.icon.className=(null===(r=e.item)||void 0===r?void 0:r.iconClass)?"quick-input-list-icon "+e.item.iconClass:"";let c;!e.saneTooltip&&e.saneDescription&&(c={markdown:{value:e.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:e.saneDescription});const u={matches:l||[],descriptionTitle:c,descriptionMatches:h||[],labelEscapeNewLines:!0};if("separator"!==a.type?(u.extraClasses=a.iconClasses,u.italic=a.italic,u.strikethrough=a.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,u),i.keybinding.set("separator"===a.type?void 0:a.keybinding),e.saneDetail){let t;e.saneTooltip||(t={markdown:{value:e.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:e.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(e.saneDetail,void 0,{matches:d,title:t,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const g=a.buttons;g&&g.length?(i.actionBar.push(g.map((t,i)=>rV(t,"id-"+i,()=>"separator"!==a.type?e.fireButtonTriggered({button:t,item:a}):e.fireSeparatorButtonTriggered({button:t,separator:a}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=et(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=et(e.toDisposeElement),e.toDisposeTemplate=et(e.toDisposeTemplate)}}cV.ID="listelement";class uV{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return cV.ID}}var gV;!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"}(gV||(gV={}));class mV{constructor(e,t,i,n){this.parent=e,this.options=i,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new ft,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new ft,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new ft,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new ft,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new ft,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new ft,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new ft,this.onKeyDown=this._onKeyDown.event,this._onLeave=new ft,this.onLeave=this._onLeave.event,this._listElementChecked=new ft,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Fa(this.parent,hV(".quick-input-list"));const s=new uV,o=new pV;this.list=i.createList("QuickInput",this.container,s,[new cV(n,i.hoverDelegate)],{identityProvider:{getId:e=>{var t,i,n,s,o,r,a,l;return null!==(l=null!==(r=null!==(s=null!==(i=null===(t=e.item)||void 0===t?void 0:t.id)&&void 0!==i?i:null===(n=e.item)||void 0===n?void 0:n.label)&&void 0!==s?s:null===(o=e.separator)||void 0===o?void 0:o.id)&&void 0!==r?r:null===(a=e.separator)||void 0===a?void 0:a.label)&&void 0!==l?l:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:o}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(e=>{const t=new Xs(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(K.i?e.metaKey:e.ctrlKey)&&this.list.setFocus(u(this.list.length));break;case 16:{const e=this.list.getFocus();1===e.length&&0===e[0]&&this._onLeave.fire();break}case 18:{const e=this.list.getFocus();1===e.length&&e[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(t)})),this.disposables.push(this.list.onMouseDown(e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()})),this.disposables.push(Zr(this.container,Ma.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(e=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(e=>{"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))}));const r=new lo(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(async e=>{var t;if(e.browserEvent.target instanceof HTMLAnchorElement)r.cancel();else if(e.browserEvent.relatedTarget instanceof HTMLAnchorElement||!ga(e.browserEvent.relatedTarget,null===(t=e.element)||void 0===t?void 0:t.element))try{await r.trigger(async()=>{e.element&&this.showHover(e.element)})}catch(e){if(!He(e))throw e}})),this.disposables.push(this.list.onMouseOut(e=>{var t;ga(e.browserEvent.relatedTarget,null===(t=e.element)||void 0===t?void 0:t.element)||r.cancel()})),this.disposables.push(r),this.disposables.push(this._listElementChecked.event(e=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return dt.map(this.list.onDidChangeFocus,e=>e.elements.map(e=>e.item))}get onDidChangeSelection(){return dt.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(e=>e.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.hidden){if(!n.checked)return!1;t=!0}}return t}getCheckedCount(){let e=0;const t=this.elements;for(let i=0,n=t.length;i<n;i++)t[i].checked&&e++;return e}getVisibleCount(){let e=0;const t=this.elements;for(let i=0,n=t.length;i<n;i++)t[i].hidden||e++;return e}setAllVisibleChecked(e){try{this._fireCheckedEvents=!1,this.elements.forEach(t=>{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=et(this.elementDisposables);const t=e=>this.fireButtonTriggered(e),i=e=>this.fireSeparatorButtonTriggered(e);this.inputElements=e;const n=new Map,s=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((o,r,a)=>{var l;const h=a>0?e[a-1]:void 0;if("separator"===r.type&&!r.buttons)return o;const d=new dV(r,h,a,s,t,i,this._listElementChecked),c=o.length;return o.push(d),n.set(null!==(l=d.item)&&void 0!==l?l:d.separator,c),o},[]),this.elementsToIndexes=n,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(e=>this.elementsToIndexes.has(e)).map(e=>this.elementsToIndexes.get(e))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(e=>this.elementsToIndexes.has(e)).map(e=>this.elementsToIndexes.get(e)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===gV.Second&&this.list.length<2&&(e=gV.First),e){case gV.First:this.list.scrollTop=0,this.list.focusFirst(void 0,e=>!!e.item);break;case gV.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,e=>!!e.item);break;case gV.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,e=>!!e.item);break;case gV.Next:{this.list.focusNext(void 0,!0,void 0,e=>!!e.item);const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case gV.Previous:{this.list.focusPrevious(void 0,!0,void 0,e=>!!e.item);const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case gV.NextPage:this.list.focusNextPage(void 0,e=>!!e.item);break;case gV.PreviousPage:this.list.focusPreviousPage(void 0,e=>!!e.item)}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,i,n;this._lastHover&&!this._lastHover.isDisposed&&(null===(i=(t=this.options.hoverDelegate).onDidHideHover)||void 0===i||i.call(t),null===(n=this._lastHover)||void 0===n||n.dispose()),e.element&&e.saneTooltip&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:e=>{this.options.linkOpenerDelegate(e)},appearance:{showPointer:!0},container:this.container,position:{hoverPosition:1}},!1))}layout(e){this.list.getHTMLElement().style.maxHeight=e?44*Math.floor(e/44)+6+"px":"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let i;this.elements.forEach(n=>{var s,o,r,a;let l;l="fuzzy"===this.matchOnLabelMode?this.matchOnLabel&&null!==(s=wM(e,CM(n.saneLabel)))&&void 0!==s?s:void 0:this.matchOnLabel&&null!==(o=function(e,t){const{text:i,iconOffsets:n}=t;if(!n||0===n.length)return fV(e,i);const s=jn(i," "),o=i.length-s.length,r=fV(e,s);if(r)for(const e of r){const t=n[e.start+o]+o;e.start+=t,e.end+=t}return r}(t,CM(n.saneLabel)))&&void 0!==o?o:void 0;const h=this.matchOnDescription&&null!==(r=wM(e,CM(n.saneDescription||"")))&&void 0!==r?r:void 0,d=this.matchOnDetail&&null!==(a=wM(e,CM(n.saneDetail||"")))&&void 0!==a?a:void 0;if(l||h||d?(n.labelHighlights=l,n.descriptionHighlights=h,n.detailHighlights=d,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item||!n.item.alwaysShow),n.item?n.separator=void 0:n.separator&&(n.hidden=!0),!this.sortByLabel){const e=n.index&&this.inputElements[n.index-1];i=e&&"separator"===e.type?e:i,i&&!n.hidden&&(n.separator=i,i=void 0)}})}else this.elements.forEach(e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.item&&(e.separator=t&&"separator"===t.type&&!t.buttons?t:void 0)});const i=this.elements.filter(e=>!e.hidden);if(this.sortByLabel&&e){const t=e.toLowerCase();i.sort((e,i)=>function(e,t,i){const n=e.labelHighlights||[],s=t.labelHighlights||[];if(n.length&&!s.length)return-1;if(!n.length&&s.length)return 1;if(0===n.length&&0===s.length)return 0;return eV(e.saneSortLabel,t.saneSortLabel,i)}(e,i,t))}return this.elementsToIndexes=i.reduce((e,t,i)=>{var n;return e.set(null!==(n=t.item)&&void 0!==n?n:t.separator,i),e},new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=et(this.elementDisposables),this.disposables=et(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(null==e?void 0:e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed)return void this._lastHover.dispose();const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const i=new nt;i.add(this.list.onDidChangeFocus(e=>{e.indexes.length&&this.showHover(e.elements[0])})),this._lastHover&&i.add(this._lastHover),this._toggleHover=i,this.elementDisposables.push(this._toggleHover)}}function fV(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1!==i?[{start:i,end:i+e.length}]:null}lV([Fb],mV.prototype,"onDidChangeFocus",null),lV([Fb],mV.prototype,"onDidChangeSelection",null);class pV{getWidgetAriaLabel(){return Object(J.b)("quickInput","Quick Input")}getAriaLabel(e){var t;return(null===(t=e.separator)||void 0===t?void 0:t.label)?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var _V=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},vV=function(e,t){return function(i,n){t(i,n,e)}};const bV={iconClass:Ml.asClassName(Di.quickInputBack),tooltip:Object(J.b)("quickInput.back","Back"),handle:-1};class CV extends st{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=CV.noPromptMessage,this._severity=WN.Ignore,this.onDidTriggerButtonEmitter=this._register(new ft),this.onDidHideEmitter=this._register(new ft),this.onDisposeEmitter=this._register(new ft),this.visibleDisposables=this._register(new nt),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!K.f;this._ignoreFocusOut=e&&!K.f,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=null!=e?e:[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=VW.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:i||"&nbsp;"===this.ui.title.innerHTML||(this.ui.title.innerText=" ");const n=this.getDescription();if(this.ui.description1.textContent!==n&&(this.ui.description1.textContent=n),this.ui.description2.textContent!==n&&(this.ui.description2.textContent=n),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?Wa(this.ui.widget,this._widget):Wa(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new uo,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this.buttons.filter(e=>e===bV).map((e,t)=>rV(e,"id-"+t,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.leftActionBar.push(e,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter(e=>e!==bV).map((e,t)=>rV(e,"id-"+t,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.rightActionBar.push(t,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const i=null!==(t=null===(e=this.toggles)||void 0===e?void 0:e.filter(e=>e instanceof yF))&&void 0!==t?t:[];this.ui.inputBox.toggles=i}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const s=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==s&&(this._lastValidationMessage=s,Wa(this.ui.message),aV(s,this.ui.message,{callback:e=>{this.ui.linkOpenerDelegate(e)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?Object(J.b)("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==WN.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?""+t.foreground:"",this.ui.message.style.backgroundColor=t.background?""+t.background:"",this.ui.message.style.border=t.border?"1px solid "+t.border:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}CV.noPromptMessage=Object(J.b)("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class wV extends CV{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new ft),this.onWillAcceptEmitter=this._register(new ft),this.onDidAcceptEmitter=this._register(new ft),this.onDidCustomEmitter=this._register(new ft),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=HW.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new ft),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new ft),this.onDidTriggerItemButtonEmitter=this._register(new ft),this.onDidTriggerSeparatorButtonEmitter=this._register(new ft),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){if(this._value!==e){if(this._value=e,t||this.update(),this.visible){this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst()}this.onDidChangeValueEmitter.fire(this._value)}}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?WW:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(gV.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(gV.Next),this.canSelectMany&&this.ui.list.domFocus(),Oa(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(gV.Previous):this.ui.list.focus(gV.Last),this.canSelectMany&&this.ui.list.domFocus(),Oa(e,!0);break;case 12:this.ui.list.focus(gV.NextPage),this.canSelectMany&&this.ui.list.domFocus(),Oa(e,!0);break;case 11:this.ui.list.focus(gV.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),Oa(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(gV.First),Oa(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(gV.Last),Oa(e,!0))}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&s(e,this._activeItems,(e,t)=>e===t)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&s(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(Ia(t)&&1===t.button))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&s(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return Zr(this.ui.container,Ma.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Xs(e),i=t.keyCode;this._quickNavigate.keybindings.some(e=>{const n=e.getChords();return!(n.length>1)&&(n[0].shiftKey&&4===i?!(t.ctrlKey||t.altKey||t.metaKey):!(!n[0].altKey||6!==i)||(!(!n[0].ctrlKey||5!==i)||!(!n[0].metaKey||57!==i)))})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let n=this.ariaLabel;if(!n&&i.inputBox&&(n=this.placeholder||wV.DEFAULT_ARIA_LABEL,this.title&&(n+=" - "+this.title)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=null!=n?n:null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case HW.NONE:this._itemActivation=HW.FIRST;break;case HW.SECOND:this.ui.list.focus(gV.Second),this._itemActivation=HW.FIRST;break;case HW.LAST:this.ui.list.focus(gV.Last),this._itemActivation=HW.FIRST;break;default:this.trySelectFirst()}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(gV.First)),this.keepScrollPosition&&(this.scrollTop=e)}}wV.DEFAULT_ARIA_LABEL=Object(J.b)("quickInputBox.ariaLabel","Type to narrow down results.");class yV extends CV{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new ft),this.onDidAcceptEmitter=this._register(new ft),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}let SV=class extends yT{constructor(e,t){super("element",!1,e=>this.getOverrideOptions(e),e,t)}getOverrideOptions(e){var t;return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:(e.content instanceof HTMLElement?null!==(t=e.content.textContent)&&void 0!==t?t:"":"string"==typeof e.content?e.content:e.content.value).includes("\n"),skipFadeInAnimation:!0}}}};SV=_V([vV(0,Xd),vV(1,wT)],SV);i("dX2Y");Ug.white.toString(),Ug.white.toString();class LV extends st{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new ft),this._onDidEscape=this._register(new ft),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),"string"==typeof t.ariaLabel&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(Vb.addTarget(this._element)),[Ma.CLICK,Bb.Tap].forEach(e=>{this._register(Zr(this._element,e,e=>{this.enabled?this._onDidClick.fire(e):Oa(e)}))}),this._register(Zr(this._element,Ma.KEY_DOWN,e=>{const t=new Xs(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._onDidEscape.fire(e),this._element.blur(),i=!0),i&&Oa(t,!0)})),this._register(Zr(this._element,Ma.MOUSE_OVER,e=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(Zr(this._element,Ma.MOUSE_OUT,e=>{this.updateBackground(!1)})),this.focusTracker=this._register(Pa(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of OT(e))if("string"==typeof i){if(i=i.trim(),""===i)continue;const e=document.createElement("span");e.textContent=i,t.push(e)}else t.push(i);return t}updateBackground(e){let t;t=this.options.secondary?e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t,i,n;if(this._label===e)return;if(SM(this._label)&&SM(e)&&((i=this._label)===(n=e)||i&&n&&i.value===n.value&&i.isTrusted===n.isTrusted&&i.supportThemeIcons===n.supportThemeIcons&&i.supportHtml===n.supportHtml&&(i.baseUri===n.baseUri||i.baseUri&&n.baseUri&&nD(di.from(i.baseUri),di.from(n.baseUri)))))return;this._element.classList.add("monaco-text-button");const s=this.options.supportShortLabel?this._labelElement:this._element;if(SM(e)){const i=AM(e,{inline:!0});i.dispose();const n=null===(t=i.element.querySelector("p"))||void 0===t?void 0:t.innerHTML;if(n){const e=vr(n,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});s.innerHTML=e}else Wa(s)}else this.options.supportIcons?Wa(s,...this.getContentElements(e)):s.textContent=e;let o="";"string"==typeof this.options.title?o=this.options.title:this.options.title&&(o=BM(e)),this._hover?this._hover.update(o):this._hover=this._register(UO(zO("mouse"),this._element,o)),"string"==typeof this.options.ariaLabel?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",this._element.title),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...Ml.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}i("Oio9");class kV{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=Fa(e,Ka(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=zn(this.countFormat,this.count),this.element.title=zn(this.titleFormat,this.count),this.element.style.backgroundColor=null!==(e=this.styles.badgeBackground)&&void 0!==e?e:"",this.element.style.color=null!==(t=this.styles.badgeForeground)&&void 0!==t?t:"",this.styles.badgeBorder&&(this.element.style.border="1px solid "+this.styles.badgeBorder)}}i("wtJs");class DV extends st{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new mo(()=>Ua(this.element),0)),this.longRunningScheduler=this._register(new mo(()=>this.infiniteLongRunning(),DV.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(null==t?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove("active","infinite","infinite-long-running","discrete"),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add("done"),this.element.classList.contains("infinite")?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove("discrete","done","infinite-long-running"),this.element.classList.add("active","infinite"),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add("infinite-long-running")}getContainer(){return this.element}}DV.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const xV=Ka;class EV extends st{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=e=>Qr(this.findInput.inputBox.inputElement,Ma.KEY_DOWN,e),this.onDidChange=e=>this.findInput.onDidChange(e),this.container=Fa(this.parent,xV(".quick-input-box")),this.findInput=this._register(new RF(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="combobox",n.ariaHasPopup="menu",n.ariaAutoComplete="list",n.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return"password"===this.findInput.inputBox.inputElement.type}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===WN.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===WN.Info?1:e===WN.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===WN.Info?1:e===WN.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const NV=Ka;class IV extends st{get container(){return this._container}constructor(e,t,i){super(),this.options=e,this.themeService=t,this.layoutService=i,this.enabled=!0,this.onDidAcceptEmitter=this._register(new ft),this.onDidCustomEmitter=this._register(new ft),this.onDidTriggerButtonEmitter=this._register(new ft),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new ft),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new ft),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(dt.runAndSubscribe(Ur,({window:e,disposables:t})=>this.registerKeyModsListeners(e,t),{window:Pn,disposables:this._store})),this._register(jr(e=>{this.ui&&Fr(this.ui.container)===e&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const i=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};for(const n of[Ma.KEY_DOWN,Ma.KEY_UP,Ma.MOUSE_DOWN])t.add(Zr(e,n,i,!0))}getUI(e){if(this.ui)return e&&Fr(this._container)!==Fr(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=Fa(this._container,NV(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=Sa(t),n=Fa(t,NV(".quick-input-titlebar")),s=this._register(new bP(n,{hoverDelegate:this.options.hoverDelegate}));s.domNode.classList.add("quick-input-left-action-bar");const o=Fa(n,NV(".quick-input-title")),r=this._register(new bP(n,{hoverDelegate:this.options.hoverDelegate}));r.domNode.classList.add("quick-input-right-action-bar");const a=Fa(t,NV(".quick-input-header")),l=Fa(a,NV("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",Object(J.b)("quickInput.checkAll","Toggle all checkboxes")),this._register(Qr(l,Ma.CHANGE,e=>{const t=l.checked;D.setAllVisibleChecked(t)})),this._register(Zr(l,Ma.CLICK,e=>{(e.x||e.y)&&u.setFocus()}));const h=Fa(a,NV(".quick-input-description")),d=Fa(a,NV(".quick-input-and-message")),c=Fa(d,NV(".quick-input-filter")),u=this._register(new EV(c,this.styles.inputBox,this.styles.toggle));u.setAttribute("aria-describedby",this.idPrefix+"message");const g=Fa(c,NV(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const m=new kV(g,{countFormat:Object(J.b)({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),f=Fa(c,NV(".quick-input-count"));f.setAttribute("aria-live","polite");const p=new kV(f,{countFormat:Object(J.b)({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),_=Fa(a,NV(".quick-input-action")),v=this._register(new LV(_,this.styles.button));v.label=Object(J.b)("ok","OK"),this._register(v.onDidClick(e=>{this.onDidAcceptEmitter.fire()}));const b=Fa(a,NV(".quick-input-action")),C=this._register(new LV(b,{...this.styles.button,supportIcons:!0}));C.label=Object(J.b)("custom","Custom"),this._register(C.onDidClick(e=>{this.onDidCustomEmitter.fire()}));const w=Fa(d,NV(`#${this.idPrefix}message.quick-input-message`)),y=this._register(new DV(t,this.styles.progressBar));y.getContainer().classList.add("quick-input-progress");const S=Fa(t,NV(".quick-input-html-widget"));S.tabIndex=-1;const L=Fa(t,NV(".quick-input-description")),k=this.idPrefix+"list",D=this._register(new mV(t,k,this.options,this.themeService));u.setAttribute("aria-controls",k),this._register(D.onDidChangeFocus(()=>{var e;u.setAttribute("aria-activedescendant",null!==(e=D.getActiveDescendant())&&void 0!==e?e:"")})),this._register(D.onChangedAllVisibleChecked(e=>{l.checked=e})),this._register(D.onChangedVisibleCount(e=>{m.setCount(e)})),this._register(D.onChangedCheckedCount(e=>{p.setCount(e)})),this._register(D.onLeave(()=>{setTimeout(()=>{this.controller&&(u.setFocus(),this.controller instanceof wV&&this.controller.canSelectMany&&D.clearFocus())},0)}));const x=Pa(t);return this._register(x),this._register(Zr(t,Ma.FOCUS,e=>{ga(e.relatedTarget,t)||(this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0)},!0)),this._register(x.onDidBlur(()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(VW.Blur),this.previousFocusElement=void 0})),this._register(Zr(t,Ma.FOCUS,e=>{u.setFocus()})),this._register(Qr(t,Ma.KEY_DOWN,e=>{if(!ga(e.target,S))switch(e.keyCode){case 3:Oa(e,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:Oa(e,!0),this.hide(VW.Gesture);break;case 2:if(!e.altKey&&!e.ctrlKey&&!e.metaKey){const i=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?i.push("input"):i.push("input[type=text]"),this.getUI().list.isDisplayed()&&i.push(".monaco-list"),this.getUI().message&&i.push(".quick-input-message a"),this.getUI().widget){if(ga(e.target,this.getUI().widget))break;i.push(".quick-input-html-widget")}const n=t.querySelectorAll(i.join(", "));e.shiftKey&&e.target===n[0]?(Oa(e,!0),D.clearFocus()):!e.shiftKey&&ga(e.target,n[n.length-1])&&(Oa(e,!0),n[0].focus())}break;case 10:e.ctrlKey&&(Oa(e,!0),this.getUI().list.toggleHover())}})),this.ui={container:t,styleSheet:i,leftActionBar:s,titleBar:n,title:o,description1:L,description2:h,widget:S,rightActionBar:r,checkAll:l,inputContainer:d,filterContainer:c,inputBox:u,visibleCountContainer:g,visibleCount:m,countContainer:f,count:p,okContainer:_,ok:v,message:w,customButtonContainer:b,customButton:C,list:D,progressBar:y,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e),linkOpenerDelegate:e=>this.options.linkOpenerDelegate(e)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,Fa(this._container,this.ui.container))}pick(e,t={},i=Lt.None){return new Promise((n,s)=>{let o=e=>{var i;o=n,null===(i=t.onKeyMods)||void 0===i||i.call(t,r.keyMods),n(e)};if(i.isCancellationRequested)return void o(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept(()=>{if(r.canSelectMany)o(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(o(e),r.hide())}}),r.onDidChangeActive(e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)}),r.onDidChangeSelection(e=>{if(!r.canSelectMany){const t=e[0];t&&(o(t),r.hide())}}),r.onDidTriggerItemButton(e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...e,removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice(),i=e.splice(t,1),n=r.activeItems.filter(e=>e!==i[0]),s=r.keepScrollPosition;r.keepScrollPosition=!0,r.items=e,n&&(r.activeItems=n),r.keepScrollPosition=s}}})),r.onDidTriggerSeparatorButton(e=>{var i;return null===(i=t.onDidTriggerSeparatorButton)||void 0===i?void 0:i.call(t,e)}),r.onDidChangeValue(e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])}),i.onCancellationRequested(()=>{r.hide()}),r.onDidHide(()=>{et(l),o(void 0)})];r.title=t.title,r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.quickNavigate=t.quickNavigate,r.hideInput=!!t.hideInput,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then(([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter(e=>"separator"!==e.type&&e.picked)),a&&(r.activeItems=[a])}),r.show(),Promise.resolve(e).then(void 0,e=>{s(e),r.hide()})})}createQuickPick(){const e=this.getUI(!0);return new wV(e)}createInputBox(){const e=this.getUI(!0);return new yV(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,null==i||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",Wa(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(WN.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Wa(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();bV.tooltip=n?Object(J.b)("quickInput.backWithKeybinding","Back ({0})",n):Object(J.b)("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}isVisible(){return!!this.ui&&"none"!==this.ui.container.style.display}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=!e.description||e.inputBox||e.checkAll?"none":"",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i;const n=this.controller;if(!n)return;const s=null===(t=this.ui)||void 0===t?void 0:t.container,o=s&&!Ca(s);if(this.controller=null,this.onHideEmitter.fire(),s&&(s.style.display="none"),!o){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=null!==(i=e.parentElement)&&void 0!==i?i:void 0;(null==e?void 0:e.offsetParent)?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}n.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=this.titleBarOffset+"px";const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,IV.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:s}=this.styles.widget;this.ui.titleBar.style.backgroundColor=null!=e?e:"",this.ui.container.style.backgroundColor=null!=t?t:"",this.ui.container.style.color=null!=i?i:"",this.ui.container.style.border=n?"1px solid "+n:"",this.ui.container.style.boxShadow=s?"0 0 8px 2px "+s:"",this.ui.list.style(this.styles.list);const o=[];this.styles.pickerGroup.pickerGroupBorder&&o.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(o.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&o.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&o.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&o.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&o.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&o.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),o.push("}"));const r=o.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}}IV.MAX_WIDTH=600;var TV=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},MV=function(e,t){return function(i,n){t(i,n,e)}};let AV=class extends MC{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(jW))),this._quickAccess}constructor(e,t,i,n,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=s,this._onShow=this._register(new ft),this._onHide=this._register(new ft),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),linkOpenerDelegate:e=>{this.instantiationService.invokeFunction(t=>{t.get(ET).open(e,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(e,t,i,n,s)=>this.instantiationService.createInstance(CW,e,t,i,n,s),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(SV))},n=this._register(new IV({...i,...t},this.themeService,this.layoutService));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(t=>{Fr(e.activeContainer)===Fr(n.container)&&n.layout(t,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new _h(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),null==t||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=Lt.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:qf(Yp),quickInputForeground:qf(Qp),quickInputTitleBackground:qf(Xp),widgetBorder:qf(np),widgetShadow:qf(ip)},inputBox:nP,toggle:iP,countBadge:oP,button:eP,progressBar:tP,keybindingLabel:JR,list:aP({listBackground:Yp,listFocusBackground:iv,listFocusForeground:ev,listInactiveFocusForeground:ev,listInactiveSelectionIconForeground:tv,listInactiveFocusBackground:iv,listFocusOutline:ep,listInactiveFocusOutline:ep}),pickerGroup:{pickerGroupBorder:qf(e_),pickerGroupForeground:qf(Jp)}}}};AV=TV([MV(0,bl),MV(1,vh),MV(2,DC),MV(3,cI),MV(4,Xd)],AV);var OV=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},RV=function(e,t){return function(i,n){t(i,n,e)}};let PV=class extends AV{constructor(e,t,i,n,s,o){super(t,i,n,new fI(e.getContainerDomNode(),s),o),this.host=void 0;const r=BV.get(e);if(r){const t=r.widget;this.host={_serviceBrand:void 0,get mainContainer(){return t.getDomNode()},getContainer:()=>t.getDomNode(),get containers(){return[t.getDomNode()]},get activeContainer(){return t.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return dt.map(e.onDidLayoutChange,e=>({container:t.getDomNode(),dimension:e}))},get onDidChangeActiveContainer(){return dt.None},get onDidAddContainer(){return dt.None},get whenActiveContainerStylesLoaded(){return Promise.resolve()},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};PV=OV([RV(1,bl),RV(2,vh),RV(3,DC),RV(4,yl),RV(5,Xd)],PV);let FV=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(PV,e);this.mapEditorToService.set(e,t),Ge(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=Lt.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};FV=OV([RV(0,bl),RV(1,yl)],FV);class BV{static get(e){return e.getContribution(BV.ID)}constructor(e){this.editor=e,this.widget=new WV(this.editor)}dispose(){this.widget.dispose()}}BV.ID="editor.controller.quickInput";class WV{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return WV.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}WV.ID="editor.contrib.quickInputWidget",ed(BV.ID,BV,4);class VV{constructor(e,t,i,n,s){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=s}}const HV=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class zV{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(HV);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=Ug.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class KV{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];const t=[];let i=0;for(let n=0,s=e.length;n<s;n++){const s=e[n];let o=-1;if("string"==typeof s.fontStyle){o=0;const e=s.fontStyle.split(" ");for(let t=0,i=e.length;t<i;t++){switch(e[t]){case"italic":o|=1;break;case"bold":o|=2;break;case"underline":o|=4;break;case"strikethrough":o|=8}}}let r=null;"string"==typeof s.foreground&&(r=s.foreground);let a=null;"string"==typeof s.background&&(a=s.background),t[i++]=new VV(s.token||"",n,o,r,a)}return t}(e),t)}static createFromParsedTokenTheme(e,t){return function(e,t){e.sort((e,t)=>{const i=function(e,t){if(e<t)return-1;if(e>t)return 1;return 0}(e.token,t.token);return 0!==i?i:e.index-t.index});let i=0,n="000000",s="ffffff";for(;e.length>=1&&""===e[0].token;){const t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(s=t.background)}const o=new zV;for(const e of t)o.getId(e);const r=o.getId(n),a=o.getId(s),l=new jV(i,r,a),h=new qV(l);for(let t=0,i=e.length;t<i;t++){const i=e[t];h.insert(i.token,i.fontStyle,o.getId(i.foreground),o.getId(i.background))}return new KV(o,h)}(e,t)}constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(void 0===i){const e=this._match(t),n=function(e){const t=e.match(UV);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}(t);i=(e.metadata|n<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const UV=/\b(comment|string|regex|regexp)\b/;class jV{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new jV(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class qV{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;const t=e.indexOf(".");let i,n;-1===t?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const s=this._children.get(i);return void 0!==s?s.match(n):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);const s=e.indexOf(".");let o,r;-1===s?(o=e,r=""):(o=e.substring(0,s),r=e.substring(s+1));let a=this._children.get(o);void 0===a&&(a=new qV(this._mainRule.clone()),this._children.set(o,a)),a.insert(r,t,i,n)}}const $V={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[jp]:"#FFFFFE",[qp]:"#000000",[a_]:"#E5EBF1",[HC]:"#D3D3D3",[$C]:"#939393",[l_]:"#ADD6FF4D"}},GV={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[jp]:"#1E1E1E",[qp]:"#D4D4D4",[a_]:"#3A3D41",[HC]:"#404040",[$C]:"#707070",[l_]:"#ADD6FF26"}},ZV={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[jp]:"#000000",[qp]:"#FFFFFF",[HC]:"#FFFFFF",[$C]:"#FFFFFF"}},YV={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[jp]:"#FFFFFF",[qp]:"#292929",[HC]:"#292929",[$C]:"#292929"}};var QV,XV,JV;(QV||(QV={})).getDefinition=function(e,t){let i=e.defaults;for(;Ml.isThemeIcon(i);){const e=eH.getIcon(i.id);if(!e)return;i=e.defaults}return i},(JV=XV||(XV={})).toJSONObject=function(e){return{weight:e.weight,style:e.style,src:e.src.map(e=>({format:e.format,location:e.location.toString()}))}},JV.fromJSONObject=function(e){const t=e=>k(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every(e=>k(e.format)&&k(e.location)))return{weight:t(e.weight),style:t(e.style),src:e.src.map(e=>({format:e.format,location:di.parse(e.location)}))}};const eH=new class{constructor(){this._onDidChange=new ft,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:Object(J.b)("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:Object(J.b)("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Ml.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const s=this.iconsById[e];if(s){if(i&&!s.description){s.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return s}const o={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=o;const r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;Ml.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return"codicon codicon-"+(e?e.id:"")},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(e=>this.iconsById[e]);for(const s of n.filter(e=>!!e.description).sort(e))i.push(`|<i class="${t(s)}"></i>|${s.id}|${Ml.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const s of n.filter(e=>!Ml.isThemeIcon(e.defaults)).sort(e))i.push(`|<i class="${t(s)}"></i>|${s.id}|`);return i.join("\n")}};function tH(e,t,i,n){return eH.registerIcon(e,t,i,n)}function iH(){return eH}Eh.add("base.contributions.icons",eH),function(){const e=ki();for(const t in e){const i="\\"+e[t].toString(16);eH.registerIcon(t,{fontCharacter:i})}}();const nH=Eh.as(hc);nH.registerSchema("vscode://schemas/icons",eH.getIconSchema());const sH=new mo(()=>nH.notifySchemaChanged("vscode://schemas/icons"),200);eH.onDidChange(()=>{sH.isScheduled()||sH.schedule()});tH("widget-close",Di.close,Object(J.b)("widgetClose","Icon for the close action in widgets.")),tH("goto-previous-location",Di.arrowUp,Object(J.b)("previousChangeIcon","Icon for goto previous editor location.")),tH("goto-next-location",Di.arrowDown,Object(J.b)("nextChangeIcon","Icon for goto next editor location.")),Ml.modify(Di.sync,"spin"),Ml.modify(Di.loading,"spin");class oH{getIcon(e){const t=iH();let i=e.defaults;for(;Ml.isThemeIcon(i);){const e=t.getIcon(i.id);if(!e)return;i=e.defaults}return i}}const rH=Eh.as($f),aH=Eh.as(NC);class lH{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(hH(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,Ug.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=dH(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,Ug.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);return i||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=rH.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case"vs":return hb.LIGHT;case"hc-black":return hb.HIGH_CONTRAST_DARK;case"hc-light":return hb.HIGH_CONTRAST_LIGHT;default:return hb.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const i=dH(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const t={token:""};i&&(t.foreground=i),n&&(t.background=n),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=KV.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=bm.getForeground(n),o=bm.getFontStyle(n);return{foreground:s,italic:Boolean(1&o),bold:Boolean(2&o),underline:Boolean(4&o),strikethrough:Boolean(8&o)}}}function hH(e){return"vs"===e||"vs-dark"===e||"hc-black"===e||"hc-light"===e}function dH(e){switch(e){case"vs":return $V;case"vs-dark":return GV;case"hc-black":return ZV;case"hc-light":return YV}}function cH(e){const t=dH(e);return new lH(e,t)}const uH=wl("themeService");var gH=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},mH=function(e,t){return function(i,n){t(i,n,e)}};let fH=class extends st{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new ft,this._onDidChangeReducedMotion=new ft,this._accessibilityModeEnabledContext=Of.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),e.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const s=Pn.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(s)}initReducedMotionListeners(e){this._register(Zr(e,"change",()=>{this._systemMotionReduced=e.matches,"auto"===this._configMotionReduced&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const e=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",e),this._layoutService.mainContainer.classList.toggle("enable-motion",!e)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return"on"===e||"auto"===e&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};fH=gH([mH(0,vh),mH(1,cI),mH(2,Xd)],fH);var pH,_H,vH=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bH=function(e,t){return function(i,n){t(i,n,e)}};let CH=class{constructor(e,t){this._commandService=e,this._hiddenStates=new wH(t)}createMenu(e,t,i){return new SH(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};CH=vH([bH(0,Al),bH(1,YR)],CH);let wH=pH=class{constructor(e){this._storageService=e,this._disposables=new nt,this._onDidChange=new ft,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(pH._key,0,"{}");this._data=JSON.parse(t)}catch(e){this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,pH._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(pH._key,0,"{}");this._data=JSON.parse(t)}catch(e){console.log("FAILED to read storage after UPDATE",e)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return null!==(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))&&void 0!==i&&i}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,n;const s=this._isHiddenByDefault(e,t),o=null!==(n=null===(i=this._data[e.id])||void 0===i?void 0:i.includes(t))&&void 0!==n&&n;return s?!o:o}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const n=this._data[e.id];if(i)if(n){n.indexOf(t)<0&&n.push(t)}else this._data[e.id]=[t];else if(n){const i=n.indexOf(t);i>=0&&function(e,t){const i=e.length-1;t<i&&(e[t]=e[i]),e.pop()}(n,i),0===n.length&&delete this._data[e.id]}this._persist()}reset(e){if(void 0===e)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(pH._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};wH._key="menu.hiddenCommands",wH=pH=vH([bH(0,YR)],wH);let yH=_H=class{constructor(e,t,i,n,s){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=n,this._contextKeyService=s,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=Wh.getMenuItems(this._id);let t;e.sort(_H._compareMenuItems);for(const i of e){const e=i.group||"";t&&t[0]===e||(t=[e,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(_H._fillInKbExprKeys(e.when,this._structureContextKeys),Rh(e)){if(e.command.precondition&&_H._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;_H._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Wh.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,s]=i,o=[];for(const t of s)if(this._contextKeyService.contextMatchesRules(t.when)){const i=Rh(t);i&&this._hiddenStates.setDefaultState(this._id,t.command.id,!!t.isHiddenByDefault);const n=LH(this._id,i?t.command:t,this._hiddenStates);if(i)o.push(new Hh(t.command,t.alt,e,n,this._contextKeyService,this._commandService));else{const i=new _H(t.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),s=xl.join(...i.map(e=>e[1]));s.length>0&&o.push(new Vh(t,n,s))}}o.length>0&&t.push([n,o])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(!i)return 1;if(!n)return-1;if("navigation"===i)return-1;if("navigation"===n)return 1;const e=i.localeCompare(n);if(0!==e)return e}const s=e.order||0,o=t.order||0;return s<o?-1:s>o?1:_H._compareTitles(Rh(e)?e.command.title:e.title,Rh(t)?t.command.title:t.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}};yH=_H=vH([bH(3,Al),bH(4,vh)],yH);let SH=class{constructor(e,t,i,n,s){this._disposables=new nt,this._menuInfo=new yH(e,t,i.emitEventsForSubmenuChanges,n,s);const o=new mo(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(o),this._disposables.add(Wh.onDidChangeMenu(t=>{t.has(e)&&o.schedule()}));const r=this._disposables.add(new nt);this._onDidChange=new vt({onWillAddFirstListener:()=>{r.add(s.onDidChangeContext(e=>{const t=e.affectsSome(this._menuInfo.structureContextKeys),i=e.affectsSome(this._menuInfo.preconditionContextKeys),n=e.affectsSome(this._menuInfo.toggledContextKeys);(t||i||n)&&this._onDidChange.fire({menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n})})),r.add(t.onDidChange(e=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))},onDidRemoveLastListener:r.clear.bind(r),delay:i.eventDebounceDelay,merge:e=>{let t=!1,i=!1,n=!1;for(const s of e)if(t=t||s.isStructuralChange,i=i||s.isEnablementChange,n=n||s.isToggleChange,t&&i&&n)break;return{menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n}}}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};function LH(e,t,i){const n=void 0!==t.submenu?t.submenu.id:t.id;const s="string"==typeof t.title?t.title:t.title.value,o=Il({id:`hide/${e.id}/${n}`,label:Object(J.b)("hide.label","Hide '{0}'",s),run(){i.updateHidden(e,n,!0)}}),r=Il({id:`toggle/${e.id}/${n}`,label:s,get checked(){return!i.isHidden(e,n)},run(){i.updateHidden(e,n,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}SH=vH([bH(3,Al),bH(4,vh)],SH);var kH,DH=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},xH=function(e,t){return function(i,n){t(i,n,e)}};let EH=kH=class extends st{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(Vs||Hs)&&this.installWebKitWriteTextWorkaround(),this._register(dt.runAndSubscribe(Ur,({window:e,disposables:t})=>{t.add(Zr(e.document,"copy",()=>this.clearResources()))},{window:Pn,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const e=new bo;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch(async t=>{t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)})};this._register(dt.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(Zr(t,"click",e)),i.add(Zr(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t)this.mapTextToType.set(t,e);else{if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await navigator.clipboard.writeText(e)}catch(e){console.error(e)}this.fallbackWriteText(e)}}fallbackWriteText(e){const t=wa(),i=t.activeElement,n=t.body.appendChild(Ka("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),t.execCommand("copy"),i instanceof HTMLElement&&i.focus(),t.body.removeChild(n)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await navigator.clipboard.readText()}catch(e){console.error(e)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){0===e.length?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(0===this.resources.length)return;return Er((await this.readText()).substring(0,kH.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearResources(){this.resources=[],this.resourcesStateHash=void 0}};EH.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,EH=kH=DH([xH(0,cI),xH(1,Kh)],EH);const NH=wl("clipboardService");var IH=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},TH=function(e,t){return function(i,n){t(i,n,e)}};class MH{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class AH extends MH{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}AH.INSTANCE=new AH;class OH extends MH{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=sO.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(e=>{if(7===e.source){const e=Array.from(this._values,([e])=>e);this._values.clear(),i.fire(new FH(e))}else{const t=[];for(const i of e.affectedKeys){const e="config."+i,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...j.map(n,([e])=>e)),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new FH(t))}})}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(OH._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(OH._keyPrefix.length),i=this._configurationService.getValue(t);let n=void 0;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:n=Array.isArray(i)?JSON.stringify(i):i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}OH._keyPrefix="config.";class RH{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class PH{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class FH{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class BH{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}class WH extends st{constructor(e){super(),this._onDidChangeContext=this._register(new _t({merge:e=>new BH(e)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new RH(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new HH(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return!e||e.evaluate(t)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new PH(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new PH(e))}getContext(e){return this._isDisposed?AH.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute("data-keybinding-context")){const t=e.getAttribute("data-keybinding-context");return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}dispose(){super.dispose(),this._isDisposed=!0}}let VH=class extends WH{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new OH(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?AH.INSTANCE:this._contexts.get(e)||AH.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new MH(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};VH=IH([TH(0,Xd)],VH);class HH extends WH{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new ot),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute("data-keybinding-context")){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute"+(e?": "+e:""))}this._domNode.setAttribute("data-keybinding-context",String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const t=this._parent.getContextValuesContainer(this._myContextId).value;var i;i=t,e.allKeysContainedIn(new Set(Object.keys(i)))||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute("data-keybinding-context"),super.dispose())}getContextValuesContainer(e){return this._isDisposed?AH.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}Ol.registerCommand("_setContext",(function(e,t,i){e.get(vh).createKey(String(t),function(e){return V(e,e=>"object"==typeof e&&1===e.$mid?di.revive(e).toString():e instanceof di?e.toString():void 0)}(i))})),Ol.registerCommand({id:"getContextKeyInfo",handler:()=>[..._h.all()].sort((e,t)=>e.key.localeCompare(t.key)),metadata:{description:Object(J.b)("getContextKeyInfo","A command that returns information about context keys"),args:[]}}),Ol.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(const i of _h.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort((e,t)=>e.key.localeCompare(t.key)),console.log(JSON.stringify(e,void 0,2))}));class zH{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class KH{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new zH(t,e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...i.incoming.keys()].join(", ")}]\n\t(outgoing ->)[${[...i.outgoing.keys()].join(",")}]\n`);return e.join("\n")}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const e=this._findCycle(n,t);if(e)return e;t.delete(i)}}}class UH extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=null!==(t=e.findCycleSlow())&&void 0!==t?t:"UNABLE to detect cycle, dumping graph: \n"+e.toString()}}class jH{constructor(e=new PN,t=!1,i,n=!1){var s;this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._activeInstantiations=new Set,this._services.set(bl,this),this._globalGraph=n?null!==(s=null==i?void 0:i._globalGraph)&&void 0!==s?s:new KH(e=>e):void 0}createChild(e){return new jH(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=qH.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:e=>{if(n)throw Ue("service accessor is only valid during the invocation of its target method");const t=this._getOrCreateServiceInstance(e,i);if(!t)throw new Error(`[invokeFunction] unknown service '${e}'`);return t}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof sc?(i=qH.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=qH.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=vl.getServiceDependencies(e).sort((e,t)=>e.index-t.index),s=[];for(const t of n){const n=this._getOrCreateServiceInstance(t.id,i);n||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`,!1),s.push(n)}const o=n.length>0?n[0].index:t.length;if(t.length!==o){console.trace(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);const i=o-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,o)}return Reflect.construct(e,t.concat(s))}_setServiceInstance(e,t){if(this._services.get(e)instanceof sc)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){const 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));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof sc?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var n;const s=new KH(e=>e.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const t=r.pop();if(s.lookupOrInsertNode(t),o++>1e3)throw new UH(s);for(const i of vl.getServiceDependencies(t.desc.ctor)){const o=this._getServiceInstanceOrDescriptor(i.id);if(o||this._throwIfStrict(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`,!0),null===(n=this._globalGraph)||void 0===n||n.insertEdge(String(t.id),String(i.id)),o instanceof sc){const e={id:i.id,desc:o,_trace:t._trace.branch(i.id,!0)};s.insertEdge(t,e),r.push(e)}}}for(;;){const e=s.roots();if(0===e.length){if(!s.isEmpty())throw new UH(s);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof sc){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e)}s.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e)instanceof sc)return this._createServiceInstance(e,t,i,n,s);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,s);throw new Error("illegalState - creating UNKNOWN service instance "+t.name)}_createServiceInstance(e,t,i=[],n,s){if(n){const n=new jH(void 0,this._strict,this,this._enableTracing);n._globalGraphImplicitDependency=String(e);const o=new Map,r=new vo(()=>{const e=n._createInstance(t,i,s);for(const[t,i]of o){const n=e[t];if("function"==typeof n)for(const t of i)t.disposable=n.apply(e,t.listener)}return o.clear(),e});return new Proxy(Object.create(null),{get(e,t){if(!r.isInitialized&&"string"==typeof t&&(t.startsWith("onDid")||t.startsWith("onWill"))){let e=o.get(t);e||(e=new $,o.set(t,e));return(i,n,s)=>{if(r.isInitialized)return r.value[t](i,n,s);{const t={listener:[i,n,s],disposable:void 0},o=e.push(t);return it(()=>{var e;o(),null===(e=t.disposable)||void 0===e||e.dispose()})}}}if(t in e)return e[t];const i=r.value;let n=i[t];return"function"!=typeof n||(n=n.bind(i),e[t]=n),n},set:(e,t,i)=>(r.value[t]=i,!0),getPrototypeOf:e=>t.prototype})}return this._createInstance(t,i,s)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class qH{static traceInvocation(e,t){return e?new qH(2,t.name||(new Error).stack.split("\n").slice(3,4).join("\n")):qH._None}static traceCreation(e,t){return e?new qH(1,t.name):qH._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new qH(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;qH._totals+=e;let t=!1;const i=[`${1===this.type?"CREATE":"CALL"} ${this.name}`,""+function e(i,n){const s=[],o=new Array(i+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,s.push(`${o}CREATES -> ${r}`);const n=e(i+1,l);n&&s.push(n)}else s.push(`${o}uses -> ${r}`);return s.join("\n")}(1,this),`DONE, took ${e.toFixed(2)}ms (grand total ${qH._totals.toFixed(2)}ms)`];(e>2||t)&&qH.all.add(i.join("\n"))}}qH.all=new Set,qH._None=new class extends qH{constructor(){super(0,null)}stop(){}branch(){return this}},qH._totals=0;const $H=new Set([wr.inMemory,wr.vscodeSourceControl,wr.walkThrough,wr.walkThroughSnippet]);class GH{constructor(){this._byResource=new bg,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let s=this._byOwner.get(t);s||(s=new bg,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){const i=this._byResource.get(e);return null==i?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.delete(t));const o=this._byOwner.get(t);if(o&&(n=o.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,s;return"string"==typeof e?null!==(i=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==i?i:j.empty():di.isUri(e)?null!==(s=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==s?s:j.empty():j.map(j.concat(...this._byOwner.values()),e=>e[1])}}class ZH{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new bg,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if($H.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===VP.Error?t.errors+=1:i===VP.Warning?t.warnings+=1:i===VP.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class YH{constructor(){this._onMarkerChanged=new vt({delay:0,merge:YH._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new GH,this._stats=new ZH(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(n=i,Array.isArray(n)&&0!==n.length){const n=[];for(const s of i){const i=YH._toMarker(e,t,s);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}else{this._data.delete(t,e)&&this._onMarkerChanged.fire([t])}var n}static _toMarker(e,t,i){let{code:n,severity:s,message:o,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:c,tags:u}=i;if(o)return a=a>0?a:1,l=l>0?l:1,h=h>=a?h:a,d=d>0?d:l,{resource:t,owner:e,code:n,severity:s,message:o,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:c,tags:u}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const t of n){const n=j.first(t);n&&(i.push(n.resource),this._data.delete(n.resource,e))}if(h(t)){const n=new bg;for(const{resource:s,marker:o}of t){const t=YH._toMarker(e,s,o);if(!t)continue;const r=n.get(s);r?r.push(t):(n.set(s,[t]),i.push(s))}for(const[t,i]of n)this._data.set(t,e,i)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const e=this._data.get(i,t);if(e){const t=[];for(const i of e)if(YH._accept(i,n)){const e=t.push(i);if(s>0&&e===s)break}return t}return[]}if(t||i){const e=this._data.values(null!=i?i:t),o=[];for(const t of e)for(const e of t)if(YH._accept(e,n)){const t=o.push(e);if(s>0&&t===s)return o}return o}{const e=[];for(const t of this._data.values())for(const i of t)if(YH._accept(i,n)){const t=e.push(i);if(s>0&&t===s)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new bg;for(const i of e)for(const e of i)t.set(e,!0);return Array.from(t.keys())}}class QH extends st{constructor(){super(...arguments),this._configurationModel=new EA}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new EA;const e=Eh.as(cc).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const e=i[n],s=t[n];void 0!==e?this._configurationModel.addValue(n,e):s?this._configurationModel.addValue(n,s.default):this._configurationModel.removeValue(n)}}}const XH=wl("accessibilitySignalService");class JH{static register(e){return new JH(e.fileName)}constructor(e){this.fileName=e}}JH.error=JH.register({fileName:"error.mp3"}),JH.warning=JH.register({fileName:"warning.mp3"}),JH.foldedArea=JH.register({fileName:"foldedAreas.mp3"}),JH.break=JH.register({fileName:"break.mp3"}),JH.quickFixes=JH.register({fileName:"quickFixes.mp3"}),JH.taskCompleted=JH.register({fileName:"taskCompleted.mp3"}),JH.taskFailed=JH.register({fileName:"taskFailed.mp3"}),JH.terminalBell=JH.register({fileName:"terminalBell.mp3"}),JH.diffLineInserted=JH.register({fileName:"diffLineInserted.mp3"}),JH.diffLineDeleted=JH.register({fileName:"diffLineDeleted.mp3"}),JH.diffLineModified=JH.register({fileName:"diffLineModified.mp3"}),JH.chatRequestSent=JH.register({fileName:"chatRequestSent.mp3"}),JH.chatResponsePending=JH.register({fileName:"chatResponsePending.mp3"}),JH.chatResponseReceived1=JH.register({fileName:"chatResponseReceived1.mp3"}),JH.chatResponseReceived2=JH.register({fileName:"chatResponseReceived2.mp3"}),JH.chatResponseReceived3=JH.register({fileName:"chatResponseReceived3.mp3"}),JH.chatResponseReceived4=JH.register({fileName:"chatResponseReceived4.mp3"}),JH.clear=JH.register({fileName:"clear.mp3"}),JH.save=JH.register({fileName:"save.mp3"}),JH.format=JH.register({fileName:"format.mp3"});class ez{constructor(e){this.randomOneOf=e}}class tz{static register(e){const t=new ez("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new tz(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return tz._signals.add(i),i}constructor(e,t,i,n,s,o){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=s,this.announcementMessage=o}}tz._signals=new Set,tz.error=tz.register({name:Object(J.b)("accessibilitySignals.lineHasError.name","Error on Line"),sound:JH.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:Object(J.b)("accessibility.signals.lineHasError","Error"),settingsKey:"accessibility.signals.lineHasError"}),tz.warning=tz.register({name:Object(J.b)("accessibilitySignals.lineHasWarning.name","Warning on Line"),sound:JH.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:Object(J.b)("accessibility.signals.lineHasWarning","Warning"),settingsKey:"accessibility.signals.lineHasWarning"}),tz.foldedArea=tz.register({name:Object(J.b)("accessibilitySignals.lineHasFoldedArea.name","Folded Area on Line"),sound:JH.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:Object(J.b)("accessibility.signals.lineHasFoldedArea","Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),tz.break=tz.register({name:Object(J.b)("accessibilitySignals.lineHasBreakpoint.name","Breakpoint on Line"),sound:JH.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:Object(J.b)("accessibility.signals.lineHasBreakpoint","Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),tz.inlineSuggestion=tz.register({name:Object(J.b)("accessibilitySignals.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:JH.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),tz.terminalQuickFix=tz.register({name:Object(J.b)("accessibilitySignals.terminalQuickFix.name","Terminal Quick Fix"),sound:JH.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:Object(J.b)("accessibility.signals.terminalQuickFix","Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),tz.onDebugBreak=tz.register({name:Object(J.b)("accessibilitySignals.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:JH.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:Object(J.b)("accessibility.signals.onDebugBreak","Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),tz.noInlayHints=tz.register({name:Object(J.b)("accessibilitySignals.noInlayHints","No Inlay Hints on Line"),sound:JH.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:Object(J.b)("accessibility.signals.noInlayHints","No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),tz.taskCompleted=tz.register({name:Object(J.b)("accessibilitySignals.taskCompleted","Task Completed"),sound:JH.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:Object(J.b)("accessibility.signals.taskCompleted","Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),tz.taskFailed=tz.register({name:Object(J.b)("accessibilitySignals.taskFailed","Task Failed"),sound:JH.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:Object(J.b)("accessibility.signals.taskFailed","Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),tz.terminalCommandFailed=tz.register({name:Object(J.b)("accessibilitySignals.terminalCommandFailed","Terminal Command Failed"),sound:JH.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:Object(J.b)("accessibility.signals.terminalCommandFailed","Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),tz.terminalBell=tz.register({name:Object(J.b)("accessibilitySignals.terminalBell","Terminal Bell"),sound:JH.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:Object(J.b)("accessibility.signals.terminalBell","Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),tz.notebookCellCompleted=tz.register({name:Object(J.b)("accessibilitySignals.notebookCellCompleted","Notebook Cell Completed"),sound:JH.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:Object(J.b)("accessibility.signals.notebookCellCompleted","Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),tz.notebookCellFailed=tz.register({name:Object(J.b)("accessibilitySignals.notebookCellFailed","Notebook Cell Failed"),sound:JH.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:Object(J.b)("accessibility.signals.notebookCellFailed","Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),tz.diffLineInserted=tz.register({name:Object(J.b)("accessibilitySignals.diffLineInserted","Diff Line Inserted"),sound:JH.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),tz.diffLineDeleted=tz.register({name:Object(J.b)("accessibilitySignals.diffLineDeleted","Diff Line Deleted"),sound:JH.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),tz.diffLineModified=tz.register({name:Object(J.b)("accessibilitySignals.diffLineModified","Diff Line Modified"),sound:JH.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),tz.chatRequestSent=tz.register({name:Object(J.b)("accessibilitySignals.chatRequestSent","Chat Request Sent"),sound:JH.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:Object(J.b)("accessibility.signals.chatRequestSent","Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),tz.chatResponseReceived=tz.register({name:Object(J.b)("accessibilitySignals.chatResponseReceived","Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[JH.chatResponseReceived1,JH.chatResponseReceived2,JH.chatResponseReceived3,JH.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),tz.chatResponsePending=tz.register({name:Object(J.b)("accessibilitySignals.chatResponsePending","Chat Response Pending"),sound:JH.chatResponsePending,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.chatResponsePending",announcementMessage:Object(J.b)("accessibility.signals.chatResponsePending","Chat Response Pending"),settingsKey:"accessibility.signals.chatResponsePending"}),tz.clear=tz.register({name:Object(J.b)("accessibilitySignals.clear","Clear"),sound:JH.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:Object(J.b)("accessibility.signals.clear","Clear"),settingsKey:"accessibility.signals.clear"}),tz.save=tz.register({name:Object(J.b)("accessibilitySignals.save","Save"),sound:JH.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:Object(J.b)("accessibility.signals.save","Save"),settingsKey:"accessibility.signals.save"}),tz.format=tz.register({name:Object(J.b)("accessibilitySignals.format","Format"),sound:JH.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:Object(J.b)("accessibility.signals.format","Format"),settingsKey:"accessibility.signals.format"});class iz extends st{constructor(e,t=[]){super(),this.logger=new Gh([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)}}const nz=[];var sz=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},oz=function(e,t){return function(i,n){t(i,n,e)}};class rz{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new ft}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let az=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new rt(new rz(t))):Promise.reject(new Error("Model not found"))}};az=sz([oz(0,Sl)],az);class lz{show(){return lz.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}lz.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class hz{info(e){return this.notify({severity:WN.Info,message:e})}warn(e){return this.notify({severity:WN.Warning,message:e})}error(e){return this.notify({severity:WN.Error,message:e})}notify(e){switch(e.severity){case WN.Error:console.error(e.message);break;case WN.Warning:console.warn(e.message);break;default:console.log(e.message)}return hz.NO_OP}prompt(e,t,i,n){return hz.NO_OP}status(e,t){return st.None}}hz.NO_OP=new class{};let dz=class{constructor(e){this._onWillExecuteCommand=new ft,this._onDidExecuteCommand=new ft,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Ol.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(e){return Promise.reject(e)}}};dz=sz([oz(0,bl)],dz);let cz=class extends WA{constructor(e,t,i,n,s,o){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const r=e=>{const t=new nt;t.add(Zr(e,Ma.KEY_DOWN,e=>{const t=new Xs(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())})),t.add(Zr(e,Ma.KEY_UP,e=>{const t=new Xs(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()})),this._domNodeListeners.push(new uz(e,t))},a=e=>{for(let t=0;t<this._domNodeListeners.length;t++){const i=this._domNodeListeners[t];i.domNode===e&&(this._domNodeListeners.splice(t,1),i.dispose())}},l=e=>{e.getOption(61)||r(e.getContainerDomNode())};this._register(o.onCodeEditorAdd(l)),this._register(o.onCodeEditorRemove(e=>{e.getOption(61)||a(e.getContainerDomNode())})),o.listCodeEditors().forEach(l);const h=e=>{r(e.getContainerDomNode())};this._register(o.onDiffEditorAdd(h)),this._register(o.onDiffEditorRemove(e=>{a(e.getContainerDomNode())})),o.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return tt(Ol.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(e=>{var t;return{keybinding:js(e.keybinding,K.a),command:null!==(t=e.command)&&void 0!==t?t:null,commandArgs:e.commandArgs,when:e.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),it(()=>{for(let e=0;e<this._dynamicKeybindings.length;e++)if(this._dynamicKeybindings[e]===t[0])return this._dynamicKeybindings.splice(e,t.length),void this.updateResolver()})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(Ih.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new RA(e,t,e=>this._log(e))}return this._cachedResolver}_documentHasFocus(){return Pn.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const e=s.when||void 0,o=s.keybinding;if(o){const r=ZA.resolveKeybinding(o,K.a);for(const o of r)i[n++]=new HA(o,s.command,s.commandArgs,e,t,null,!1)}else i[n++]=new HA(void 0,s.command,s.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){const t=new $s(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new ZA([t],K.a)}};cz=sz([oz(0,vh),oz(1,Al),oz(2,zh),oz(3,HN),oz(4,Kh),oz(5,yl)],cz);class uz extends st{constructor(e,t){super(),this.domNode=e,this._register(t)}}function gz(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof di)}class mz{constructor(){this._onDidChangeConfiguration=new ft,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new QH;this._configuration=new TA(e.reload(),new EA,new EA,new EA),e.dispose()}getValue(e,t){const i="string"==typeof e?e:void 0,n=gz(e)?e:gz(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const t of e){const[e,n]=t;this.getValue(e)!==n&&(this._configuration.updateValue(e,n),i.push(e))}if(i.length>0){const e=new MA({keys:i,overrides:[]},t,this._configuration);e.source=8,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let fz=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new ft,this.configurationService.onDidChangeConfiguration(e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})})}getValue(e,t,i){const n=Ci.isIPosition(t)?t:null,s=n?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0,o=e?this.getLanguage(e,n):void 0;return void 0===s?this.configurationService.getValue({resource:e,overrideIdentifier:o}):this.configurationService.getValue(s,{resource:e,overrideIdentifier:o})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};fz=sz([oz(0,Xd),oz(1,Sl),oz(2,nc)],fz);let pz=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"string"==typeof i&&"auto"!==i?i:K.g||K.i?"\n":"\r\n"}};pz=sz([oz(0,Xd)],pz);class _z{constructor(){const e=di.from({scheme:_z.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new rO({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===_z.SCHEME?this.workspace.folders[0]:null}}function vz(e,t,i){if(!t)return;if(!(e instanceof mz))return;const n=[];Object.keys(t).forEach(e=>{(function(e){return kA()["editor."+e]||!1})(e)&&n.push(["editor."+e,t[e]]),i&&function(e){return kA()["diffEditor."+e]||!1}(e)&&n.push(["diffEditor."+e,t[e]])}),n.length>0&&e.updateValues(n)}_z.SCHEME="inmemory";let bz=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:vA.convert(e),n=new Map;for(const e of i){if(!(e instanceof bA))throw new Error("bad edit - only text edits are supported");const t=this._modelService.getModel(e.resource);if(!t)throw new Error("bad edit - model not found");if("number"==typeof e.versionId&&t.getVersionId()!==e.versionId)throw new Error("bad state - model changed in the meantime");let i=n.get(t);i||(i=[],n.set(t,i)),i.push(DA.replaceMove(wi.lift(e.textEdit.range),e.textEdit.text))}let s=0,o=0;for(const[e,t]of n)e.pushStackElement(),e.pushEditOperations([],t,()=>[]),e.pushStackElement(),o+=1,s+=t.length;return{ariaSummary:zn(_O.bulkEditServiceSummary,s,o),isApplied:s>0}}};bz=sz([oz(0,Sl)],bz);let Cz=class extends DO{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,i)}};Cz=sz([oz(0,cI),oz(1,yl)],Cz);let wz=class extends TP{constructor(e,t,i,n,s,o){super(e,t,i,n,s,o),this.configure({blockMouse:!1})}};wz=sz([oz(0,zh),oz(1,HN),oz(2,ST),oz(3,Iw),oz(4,Fh),oz(5,vh)],wz);var yz;rc(Xd,mz,0),rc(tm,fz,0),rc(im,pz,0),rc(oO,_z,0),rc(YA,class{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}getUriBasenameLabel(e){return sD(e)}},0),rc(zh,class{publicLog2(){}},0),rc(pI,class{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+"\n\n"+t),Pn.confirm(i)}async prompt(e){var t,i;let n=void 0;if(this.doConfirm(e.message,e.detail)){const s=[...null!==(t=e.buttons)&&void 0!==t?t:[]];e.cancelButton&&"string"!=typeof e.cancelButton&&"boolean"!=typeof e.cancelButton&&s.push(e.cancelButton),n=await(null===(i=s[0])||void 0===i?void 0:i.run({checkboxChecked:!1}))}return{result:n}}async error(e,t){await this.prompt({type:WN.Error,message:e,detail:t})}},0),rc(AI,class{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}},0),rc(HN,hz,0),rc(zP,YH,0),rc(nc,class extends PO{constructor(){super()}},0),rc(uH,class extends st{constructor(){super(),this._onColorThemeChange=this._register(new ft),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new ft),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new oH,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set("vs",cH("vs")),this._knownThemes.set("vs-dark",cH("vs-dark")),this._knownThemes.set("hc-black",cH("hc-black")),this._knownThemes.set("hc-light",cH("hc-light"));const e=this._register(function(e){const t=new nt,i=t.add(new ft),n=iH();return t.add(n.onDidChange(()=>i.fire())),e&&t.add(e.onDidProductIconThemeChange(()=>i.fire())),{dispose:()=>t.dispose(),onDidChange:i.event,getCSS(){const t=e?e.getProductIconTheme():new oH,i={},s=e=>{const n=t.getIcon(e);if(!n)return;const s=n.font;return s?(i[s.id]=s.definition,`.codicon-${e.id}:before { content: '${n.fontCharacter}'; font-family: ${Za(s.id)}; }`):`.codicon-${e.id}:before { content: '${n.fontCharacter}'; }`},o=[];for(const e of n.getIcons()){const t=s(e);t&&o.push(t)}for(const e in i){const t=i[e],n=t.weight?`font-weight: ${t.weight};`:"",s=t.style?`font-style: ${t.style};`:"",r=t.src.map(e=>`${Ga(e.location)} format('${e.format}')`).join(", ");o.push(`@font-face { src: ${r}; font-family: ${Za(e)};${n}${s} font-display: block; }`)}return o.join("\n")}}}(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme("vs"),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Rs(Pn,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return pa(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Sa(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),st.None}_registerShadowDomContainer(e){const t=Sa(e,e=>{e.className="monaco-colors",e.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let e=0;e<this._styleElements.length;e++)if(this._styleElements[e]===t)return void this._styleElements.splice(e,1)}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!hH(t.base)&&!hH(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new lH(e,t)),hH(e)&&this._knownThemes.forEach(t=>{t.base===e&&t.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get("vs"),this._updateActualTheme(t)}_updateActualTheme(e){e&&this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=Pn.matchMedia("(forced-colors: active)").matches;if(e!==db(this._theme.type)){let t;t=cb(this._theme.type)?e?"hc-black":"vs-dark":e?"hc-light":"vs",this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};aH.getThemingParticipants().forEach(e=>e(this._theme,i,this._environment));const n=[];for(const e of rH.getColors()){const t=this._theme.getColor(e.id,!0);t&&n.push(`${jf(e.id)}: ${t.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join("\n")} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){const t=[];for(let i=1,n=e.length;i<n;i++){const n=e[i];t[i]=`.mtk${i} { color: ${n}; }`}return t.push(".mtki { font-style: italic; }"),t.push(".mtkb { font-weight: bold; }"),t.push(".mtku { text-decoration: underline; text-underline-position: under; }"),t.push(".mtks { text-decoration: line-through; }"),t.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),t.join("\n")}(s)),this._themeCSS=e.join("\n"),this._updateCSS(),zi.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}},0),rc(Kh,class extends iz{constructor(){super(new $h)}},0),rc(Sl,eF,0),rc(Sf,jP,0),rc(vh,VH,0),rc(QA,class{withProgress(e,t,i){return t({report:()=>{}})}},0),rc(XA,lz,0),rc(YR,class extends XR{constructor(){super(),this.applicationStorage=this._register(new $R(new GR,{hint:jR.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new $R(new GR,{hint:jR.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new $R(new GR,{hint:jR.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}},0),rc(WP,am,0),rc(_A,bz,0),rc(vO,class{constructor(){this._neverEmitter=new ft,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}},0),rc(Ll,az,0),rc(Af,fH,0),rc(qB,class{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new nt,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&(null===(t=this._lastFocusedWidget)||void 0===t||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,null===(i=this._lastFocusedWidget)||void 0===i||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;new kR(Sa(),"").style(rP)}if(this.lists.some(t=>t.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),ba(e.getHTMLElement())&&this.setLastFocusedList(e),tt(e.onDidFocus(()=>this.setLastFocusedList(e)),it(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(e=>e!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}},0),rc(Al,dz,0),rc(Iw,cz,0),rc(zW,FV,0),rc(ST,Cz,0),rc(ET,BP,0),rc(NH,EH,0),rc(LT,wz,0),rc(Fh,CH,0),rc(XH,class{async playSignal(e,t){}},0),function(e){const t=new PN;for(const[e,i]of ac())t.set(e,i);const i=new jH(t,!0);t.set(bl,i),e.get=function(e){n||o({});const s=t.get(e);if(!s)throw new Error("Missing service "+e);return s instanceof sc?i.invokeFunction(t=>t.get(e)):s};let n=!1;const s=new ft;function o(e){if(n)return i;n=!0;for(const[e,i]of ac())t.get(e)||t.set(e,i);for(const i in e)if(e.hasOwnProperty(i)){const n=wl(i);t.get(n)instanceof sc&&t.set(n,e[i])}const o=nz.slice(0);for(const e of o)try{i.createInstance(e)}catch(e){Be(e)}return s.fire(),i}e.initialize=o,e.withServices=function(e){if(n)return e();const t=new nt,i=t.add(s.event(()=>{i.dispose(),t.add(e())}));return t}}(yz||(yz={}));class Sz{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return function(e,t){var i;const n=kz.get(e);if(n)return n;const s=function(e,t){const i=kz.get(e);if(i)return i;const n=t.owner?function(e){var t;const i=xz.get(e);if(i)return i;const n=function(e){const t=e.constructor;if(t)return t.name;return"Object"}(e);let s=null!==(t=Dz.get(n))&&void 0!==t?t:0;s++,Dz.set(n,s);const o=1===s?n:`${n}#${s}`;return xz.set(e,o),o}(t.owner)+".":"";let s;const o=t.debugNameSource;if(void 0!==o){if("function"!=typeof o)return n+o;if(s=o(),void 0!==s)return n+s}const r=t.referenceFn;if(void 0!==r&&(s=Ez(r),void 0!==s))return n+s;if(void 0!==t.owner){const i=function(e,t){for(const i in e)if(e[i]===t)return i;return}(t.owner,e);if(void 0!==i)return n+i}return}(e,t);if(s){let t=null!==(i=Lz.get(s))&&void 0!==i?i:0;t++,Lz.set(s,t);const n=1===t?s:`${s}#${t}`;return kz.set(e,n),n}return}(e,this)}}const Lz=new Map,kz=new WeakMap;const Dz=new Map,xz=new WeakMap;function Ez(e){const t=e.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t),n=i?i[1]:void 0;return null==n?void 0:n.trim()}let Nz,Iz,Tz,Mz;function Az(){return Nz}class Oz{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=void 0===t?void 0:e,n=void 0===t?e:t;return Mz({owner:i,debugName:()=>{const e=Ez(n);if(void 0!==e)return e;const 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(n.toString());return t?`${this.debugName}.${t[2]}`:i?void 0:this.debugName+" (mapped)"}},e=>n(this.read(e),e))}recomputeInitiallyAndOnChange(e,t){return e.add(Iz(this,t)),this}}class Rz extends Oz{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),0===t&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&0===this.observers.size&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Pz(e,t){const i=new Vz(e,t);try{e(i)}finally{i.finish()}}let Fz=void 0;function Bz(e){if(Fz)e(Fz);else{const t=new Vz(e,void 0);Fz=t;try{e(t)}finally{t.finish(),Fz=void 0}}}function Wz(e,t,i){e?t(e):Pz(t,i)}class Vz{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],null===(i=Az())||void 0===i||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Ez(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;for(let e=0;e<t.length;e++){const{observer:i,observable:n}=t[e];i.endUpdate(n)}this.updatingObservers=null,null===(e=Az())||void 0===e||e.handleEndTransaction()}}function Hz(e,t){return"string"==typeof e?new zz(void 0,e,t):new zz(e,void 0,t)}class zz extends Rz{get debugName(){var e;return null!==(e=new Sz(this._owner,this._debugName,void 0).getDebugName(this))&&void 0!==e?e:"ObservableValue"}constructor(e,t,i){super(),this._owner=e,this._debugName=t,this._value=i}get(){return this._value}set(e,t,i){var n;if(this._value===e)return;let s;t||(t=s=new Vz(()=>{},()=>"Setting "+this.debugName));try{const o=this._value;this._setValue(e),null===(n=Az())||void 0===n||n.handleObservableChanged(this,{oldValue:o,newValue:e,change:i,didChange:!0,hadValue:!0});for(const e of this.observers)t.updateObserver(e,this),e.handleChange(this,i)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}class Kz extends zz{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;null===(e=this._value)||void 0===e||e.dispose()}}const Uz=(e,t)=>e===t;function jz(e,t){return void 0!==t?new Zz(new Sz(e,void 0,t),t,void 0,void 0,void 0,Uz):new Zz(new Sz(void 0,void 0,e),e,void 0,void 0,void 0,Uz)}function qz(e,t){var i;return new Zz(new Sz(e.owner,e.debugName,e.debugReferenceFn),t,void 0,void 0,e.onLastObserverRemoved,null!==(i=e.equalityComparer)&&void 0!==i?i:Uz)}function $z(e,t){let i,n;void 0===t?(i=e,n=void 0):(n=e,i=t);const s=new nt;return new Zz(new Sz(n,void 0,i),e=>(s.clear(),i(e,s)),void 0,void 0,()=>s.dispose(),Uz)}function Gz(e,t){let i,n;void 0===t?(i=e,n=void 0):(n=e,i=t);const s=new nt;return new Zz(new Sz(n,void 0,i),e=>{s.clear();const t=i(e);return t&&s.add(t),t},void 0,void 0,()=>s.dispose(),Uz)}!function(e){Mz=e}(qz);class Zz extends Rz{get debugName(){var e;return null!==(e=this._debugNameData.getDebugName(this))&&void 0!==e?e:"(anonymous)"}constructor(e,t,i,n,s,o){var r,a;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=n,this._handleLastObserverRemoved=s,this._equalityComparator=o,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=null===(r=this.createChangeSummary)||void 0===r?void 0:r.call(this),null===(a=Az())||void 0===a||a.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),null===(e=this._handleLastObserverRemoved)||void 0===e||e.call(this)}get(){var e;if(0===this.observers.size){const t=this._computeFn(this,null===(e=this.createChangeSummary)||void 0===e?void 0:e.call(this));return this.onLastObserverRemoved(),t}do{if(1===this.state)for(const e of this.dependencies)if(e.reportChanges(),2===this.state)break;1===this.state&&(this.state=3),this._recomputeIfNeeded()}while(3!==this.state);return this.value}_recomputeIfNeeded(){var e,t;if(3===this.state)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const n=0!==this.state,s=this.value;this.state=3;const o=this.changeSummary;this.changeSummary=null===(e=this.createChangeSummary)||void 0===e?void 0:e.call(this);try{this.value=this._computeFn(this,o)}finally{for(const e of this.dependenciesToBeRemoved)e.removeObserver(this);this.dependenciesToBeRemoved.clear()}const r=n&&!this._equalityComparator(s,this.value);if(null===(t=Az())||void 0===t||t.handleDerivedRecomputed(this,{oldValue:s,newValue:this.value,change:void 0,didChange:r,hadValue:n}),r)for(const e of this.observers)e.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=1===this.updateCount;if(3===this.state&&(this.state=1,!t))for(const e of this.observers)e.handlePossibleChange(this);if(t)for(const e of this.observers)e.beginUpdate(this)}endUpdate(e){if(this.updateCount--,0===this.updateCount){const e=[...this.observers];for(const t of e)t.endUpdate(this)}Dh(()=>this.updateCount>=0)}handlePossibleChange(e){if(3===this.state&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const e of this.observers)e.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:t=>t===e},this.changeSummary),n=3===this.state;if(i&&(1===this.state||n)&&(this.state=2,n))for(const e of this.observers)e.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function Yz(e){return new eK(new Sz(void 0,void 0,e),e,void 0,void 0)}function Qz(e,t){var i;return new eK(new Sz(e.owner,e.debugName,null!==(i=e.debugReferenceFn)&&void 0!==i?i:t),t,void 0,void 0)}function Xz(e,t){var i;return new eK(new Sz(e.owner,e.debugName,null!==(i=e.debugReferenceFn)&&void 0!==i?i:t),t,e.createEmptyChangeSummary,e.handleChange)}function Jz(e){const t=new nt,i=Qz({owner:void 0,debugName:void 0,debugReferenceFn:e},i=>{t.clear(),e(i,t)});return it(()=>{i.dispose(),t.dispose()})}class eK{get debugName(){var e;return null!==(e=this._debugNameData.getDebugName(this))&&void 0!==e?e:"(anonymous)"}constructor(e,t,i,n){var s,o;this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=n,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=null===(s=this.createChangeSummary)||void 0===s?void 0:s.call(this),null===(o=Az())||void 0===o||o.handleAutorunCreated(this),this._runIfNeeded(),Ye(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),Qe(this)}_runIfNeeded(){var e,t,i;if(3===this.state)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n,this.state=3;const s=this.disposed;try{if(!s){null===(e=Az())||void 0===e||e.handleAutorunTriggered(this);const i=this.changeSummary;this.changeSummary=null===(t=this.createChangeSummary)||void 0===t?void 0:t.call(this),this._runFn(this,i)}}finally{s||null===(i=Az())||void 0===i||i.handleAutorunFinished(this);for(const e of this.dependenciesToBeRemoved)e.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){3===this.state&&(this.state=1),this.updateCount++}endUpdate(){if(1===this.updateCount)do{if(1===this.state){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),2===this.state)break}this._runIfNeeded()}while(3!==this.state);this.updateCount--,Dh(()=>this.updateCount>=0)}handlePossibleChange(e){3===this.state&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:t=>t===e},this.changeSummary))&&(this.state=2)}}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}function tK(e){return new iK(e)}!function(e){e.Observer=eK}(Yz||(Yz={}));class iK extends Oz{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return"Const: "+this.value}}function nK(e,t){return new sK(e,t)}class sK extends Rz{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=e=>{var t;const i=this._getValue(e),n=this.value,s=!this.hasValue||n!==i;let o=!1;s&&(this.value=i,this.hasValue&&(o=!0,Wz(sK.globalTransaction,e=>{var t;null===(t=Az())||void 0===t||t.handleFromEventObservableTriggered(this,{oldValue:n,newValue:i,change:void 0,didChange:s,hadValue:this.hasValue});for(const t of this.observers)e.updateObserver(t,this),t.handleChange(this,void 0)},()=>{const e=this.getDebugName();return"Event fired"+(e?": "+e:"")})),this.hasValue=!0),o||null===(t=Az())||void 0===t||t.handleFromEventObservableTriggered(this,{oldValue:n,newValue:i,change:void 0,didChange:s,hadValue:this.hasValue})}}getDebugName(){return Ez(this._getValue)}get debugName(){const 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)}}function oK(e,t){return new rK(e,t)}!function(e){e.Observer=sK,e.batchEventsGlobally=function(e,t){let i=!1;void 0===sK.globalTransaction&&(sK.globalTransaction=e,i=!0);try{t()}finally{i&&(sK.globalTransaction=void 0)}}}(nK||(nK={}));class rK extends Rz{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Pz(e=>{for(const t of this.observers)e.updateObserver(t,this),t.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}class aK extends Rz{get debugName(){var e;return null!==(e=new Sz(this._owner,this._debugName,void 0).getDebugName(this))&&void 0!==e?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(e)for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t);else Pz(e=>{this.trigger(e,t)},()=>"Trigger signal "+this.debugName)}get(){}}function lK(e,t){const i=new hK(!0,t);return e.addObserver(i),t?t(e.get()):e.reportChanges(),it(()=>{e.removeObserver(i)})}!function(e){Tz=e}((function(e){const t=new hK(!1,void 0);return e.addObserver(t),it(()=>{e.removeObserver(t)})})),function(e){Iz=e}(lK);class hK{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,0===this._counter&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}i("3slI");class dK{static capture(e){if(0===e.getScrollTop()||e.hasPendingScrollAnimation())return new dK(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const s=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-s}return new dK(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=s}restore(e){if((this._initialContentHeight!==e.getContentHeight()||this._initialScrollTop!==e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}function cK(){return Vt.b&&!!Vt.b.VSCODE_DEV}function uK(e){if(cK()){const t=function(){gK||(gK=new Set);const e=globalThis;e.$hotReload_applyNewExports||(e.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e};for(const e of gK){const i=e(t);if(i)return i}});return gK}();return t.add(e),{dispose(){t.delete(e)}}}return{dispose(){}}}let gK=void 0;function mK(e,t){const i=new nt,n=e.createDecorationsCollection();return i.add(Qz({debugName:()=>"Apply decorations from "+t.debugName},e=>{const i=t.read(e);n.set(i)})),i.add({dispose:()=>{n.clear()}}),i}function fK(e,t){return e.appendChild(t),it(()=>{e.removeChild(t)})}cK()&&uK(({oldExports:e,newSrc:t,config:i})=>{if("patch-prototype"===i.mode)return t=>{var i,n;for(const s in t){const o=t[s];if(console.log(`[hot-reload] Patching prototype methods of '${s}'`,{exportedItem:o}),"function"==typeof o&&o.prototype){const r=e[s];if(r){for(const e of Object.getOwnPropertyNames(o.prototype)){const t=Object.getOwnPropertyDescriptor(o.prototype,e),a=Object.getOwnPropertyDescriptor(r.prototype,e);(null===(i=null==t?void 0:t.value)||void 0===i?void 0:i.toString())!==(null===(n=null==a?void 0:a.value)||void 0===n?void 0:n.toString())&&console.log(`[hot-reload] Patching prototype method '${s}.${e}'`),Object.defineProperty(r.prototype,e,t)}t[s]=r}}}return!0}});class pK extends st{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new xf(e,t)),this._width=Hz(this,this.elementSizeObserver.getWidth()),this._height=Hz(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(e=>Pz(e=>{this._width.set(this.elementSizeObserver.getWidth(),e),this._height.set(this.elementSizeObserver.getHeight(),e)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function _K(e,t,i){let n=t.get(),s=n,o=n;const r=Hz("animatedValue",n);let a=-1;let l=void 0;function h(){const t=Date.now()-a;var i,d,c,u;o=Math.floor((d=s,c=n-s,(i=t)===(u=300)?d+c:c*(1-Math.pow(2,-10*i/u))+d)),t<300?l=e.requestAnimationFrame(h):o=n,r.set(o,void 0)}return i.add(Xz({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(e,i)=>(e.didChange(t)&&(i.animate=i.animate||e.change),!0)},(i,r)=>{void 0!==l&&(e.cancelAnimationFrame(l),l=void 0),s=o,n=t.read(i),a=Date.now()-(r.animate?0:300),h()})),r}class vK extends st{constructor(e,t,i){super(),this._register(new CK(e,i)),this._register(wK(i,{height:t.actualHeight,top:t.actualTop}))}}class bK{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=Hz(this,void 0),this._actualHeight=Hz(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=e=>{this._actualTop.set(e,void 0)},this.onComputedHeight=e=>{this._actualHeight.set(e,void 0)}}}class CK{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId="managedOverlayWidget-"+CK._counter++,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}function wK(e,t){return Yz(i=>{for(let[n,s]of Object.entries(t))s&&"object"==typeof s&&"read"in s&&(s=s.read(i)),"number"==typeof s&&(s+="px"),n=n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),e.style[n]=s})}function yK(e,t){return function(e,t){if(cK()){oK("reload",t=>uK(({oldExports:i})=>{if([...Object.values(i)].some(t=>e.includes(t)))return e=>(t(void 0),!0)})).read(t)}}([e],t),e}function SK(e,t,i,n){const s=new nt,o=[];return s.add(Jz((s,r)=>{const a=t.read(s),l=new Map,h=new Map;i&&i(!0),e.changeViewZones(e=>{for(const t of o)e.removeZone(t),null==n||n.delete(t);o.length=0;for(const t of a){const i=e.addZone(t);t.setZoneId&&t.setZoneId(i),o.push(i),null==n||n.add(i),l.set(t,i)}}),i&&i(!1),r.add(Xz({createEmptyChangeSummary:()=>({zoneIds:[]}),handleChange(e,t){const i=h.get(e.changedObservable);return void 0!==i&&t.zoneIds.push(i),!0}},(t,n)=>{for(const e of a)e.onChange&&(h.set(e.onChange,l.get(e)),e.onChange.read(t));i&&i(!0),e.changeViewZones(e=>{for(const t of n.zoneIds)e.layoutZone(t)}),i&&i(!1)}))})),s.add({dispose(){i&&i(!0),e.changeViewZones(e=>{for(const t of o)e.removeZone(t)}),null==n||n.clear(),i&&i(!1)}}),s}CK._counter=0;function LK(e,t){const i=Ru(t,t=>t.original.startLineNumber<=e.lineNumber);if(!i)return wi.fromPositions(e);if(i.original.endLineNumberExclusive<=e.lineNumber){const t=e.lineNumber-i.original.endLineNumberExclusive+i.modified.endLineNumberExclusive;return wi.fromPositions(new Ci(t,e.column))}if(!i.innerChanges)return wi.fromPositions(new Ci(i.modified.startLineNumber,1));const n=Ru(i.innerChanges,t=>t.originalRange.getStartPosition().isBeforeOrEqual(e));if(!n){const t=e.lineNumber-i.original.startLineNumber+i.modified.startLineNumber;return wi.fromPositions(new Ci(t,e.column))}if(n.originalRange.containsPosition(e))return n.modifiedRange;{const t=(r=n.originalRange.getEndPosition(),a=e,r.lineNumber===a.lineNumber?new KL(0,a.column-r.column):new KL(a.lineNumber-r.lineNumber,a.column-1));return wi.fromPositions((s=n.modifiedRange.getEndPosition(),0===(o=t).lineCount?new Ci(s.lineNumber,s.column+o.columnCount):new Ci(s.lineNumber+o.lineCount,o.columnCount+1)))}var s,o,r,a}function kK(e,t,i){const n=e.bindTo(t);return Qz({debugName:()=>`Set Context Key "${e.key}"`},e=>{n.set(i(e))})}i("Tgpw");var DK=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},xK=function(e,t){return function(i,n){t(i,n,e)}};const EK=tH("diff-review-insert",Di.add,Object(J.b)("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),NK=tH("diff-review-remove",Di.remove,Object(J.b)("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),IK=tH("diff-review-close",Di.close,Object(J.b)("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let TK=class extends st{constructor(e,t,i,n,s,o,r,a,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=s,this._height=o,this._diffs=r,this._models=a,this._instantiationService=l,this._state=$z(this,(e,t)=>{const i=this._visible.read(e);if(this._parentNode.style.visibility=i?"visible":"hidden",!i)return null;const n=t.add(this._instantiationService.createInstance(MK,this._diffs,this._models,this._setVisible,this._canClose));return{model:n,view:t.add(this._instantiationService.createInstance(WK,this._parentNode,n,this._width,this._height,this._models))}}).recomputeInitiallyAndOnChange(this._store)}next(){Pz(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){Pz(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){Pz(e=>{this._setVisible(!1,e)})}};TK._ttPolicy=bd("diffReview",{createHTML:e=>e}),TK=DK([xK(8,bl)],TK);let MK=class extends st{constructor(e,t,i,n,s){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=s,this._groups=Hz(this,[]),this._currentGroupIdx=Hz(this,0),this._currentElementIdx=Hz(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((e,t)=>this._groups.read(t)[e]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((e,t)=>{var i;return null===(i=this.currentGroup.read(t))||void 0===i?void 0:i.lines[e]}),this._register(Yz(e=>{const t=this._diffs.read(e);if(!t)return void this._groups.set([],void 0);const i=function(e,t,i){const n=[];for(const s of o(e,(e,t)=>t.modified.startLineNumber-e.modified.endLineNumberExclusive<6)){const e=[];e.push(new RK);const o=new zu(Math.max(1,s[0].original.startLineNumber-3),Math.min(s[s.length-1].original.endLineNumberExclusive+3,t+1)),a=new zu(Math.max(1,s[0].modified.startLineNumber-3),Math.min(s[s.length-1].modified.endLineNumberExclusive+3,i+1));r(s,(t,i)=>{const n=new zu(t?t.original.endLineNumberExclusive:o.startLineNumber,i?i.original.startLineNumber:o.endLineNumberExclusive),s=new zu(t?t.modified.endLineNumberExclusive:a.startLineNumber,i?i.modified.startLineNumber:a.endLineNumberExclusive);n.forEach(t=>{e.push(new BK(t,s.startLineNumber+(t-n.startLineNumber)))}),i&&(i.original.forEach(t=>{e.push(new PK(i,t))}),i.modified.forEach(t=>{e.push(new FK(i,t))}))});const l=s[0].modified.join(s[s.length-1].modified),h=s[0].original.join(s[s.length-1].original);n.push(new OK(new Uu(l,h),e))}return n}(t,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());Pz(e=>{const t=this._models.getModifiedPosition();if(t){const n=i.findIndex(e=>(null==t?void 0:t.lineNumber)<e.range.modified.endLineNumberExclusive);-1!==n&&this._currentGroupIdx.set(n,e)}this._groups.set(i,e)})})),this._register(Yz(e=>{const t=this.currentElement.read(e);(null==t?void 0:t.type)===AK.Deleted?this._accessibilitySignalService.playSignal(tz.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(null==t?void 0:t.type)===AK.Added&&this._accessibilitySignalService.playSignal(tz.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Yz(e=>{var t;const i=this.currentElement.read(e);if(i&&i.type!==AK.Header){const e=null!==(t=i.modifiedLineNumber)&&void 0!==t?t:i.diff.modified.startLineNumber;this._models.modifiedSetSelection(wi.fromPositions(new Ci(e,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||Wz(t,t=>{this._currentGroupIdx.set(Au.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),t),this._currentElementIdx.set(0,t)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Pz(i=>{this._currentElementIdx.set(Au.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);-1!==i&&Pz(e=>{this._currentElementIdx.set(i,e)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===AK.Deleted?this._models.originalReveal(wi.fromPositions(new Ci(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==AK.Header?wi.fromPositions(new Ci(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};MK=DK([xK(4,XH)],MK);var AK;!function(e){e[e.Header=0]="Header",e[e.Unchanged=1]="Unchanged",e[e.Deleted=2]="Deleted",e[e.Added=3]="Added"}(AK||(AK={}));class OK{constructor(e,t){this.range=e,this.lines=t}}class RK{constructor(){this.type=AK.Header}}class PK{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=AK.Deleted,this.modifiedLineNumber=void 0}}class FK{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=AK.Added,this.originalLineNumber=void 0}}class BK{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=AK.Unchanged}}let WK=class extends st{constructor(e,t,i,n,s,o){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=s,this._languageService=o,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const r=document.createElement("div");r.className="diff-review-actions",this._actionBar=this._register(new bP(r)),this._register(Yz(e=>{this._actionBar.clear(),this._model.canClose.read(e)&&this._actionBar.push(new kl("diffreview.close",Object(J.b)("label.close","Close"),"close-diff-review "+Ml.asClassName(IK),!0,async()=>t.close()),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new sC(this._content,{})),Wa(this.domNode,this._scrollbar.getDomNode(),r),this._register(Yz(e=>{this._height.read(e),this._width.read(e),this._scrollbar.scanDomNode()})),this._register(it(()=>{Wa(this.domNode)})),this._register(wK(this.domNode,{width:this._width,height:this._height})),this._register(wK(this._content,{width:this._width,height:this._height})),this._register(Jz((e,t)=>{this._model.currentGroup.read(e),this._render(t)})),this._register(Qr(this.domNode,"keydown",e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._model.goToNextLine()),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._model.goToPreviousLine()),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this._model.close()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",Object(J.b)("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),hl(n,i.get(50)),Wa(this._content,n);const s=this._models.getOriginalModel(),o=this._models.getModifiedModel();if(!s||!o)return;const r=s.getOptions(),a=o.getOptions(),l=i.get(67),h=this._model.currentGroup.get();for(const d of(null==h?void 0:h.lines)||[]){if(!h)break;let c;if(d.type===AK.Header){const e=document.createElement("div");e.className="diff-review-row",e.setAttribute("role","listitem");const t=h.range,i=this._model.currentGroupIndex.get(),n=this._model.groups.get().length,s=e=>0===e?Object(J.b)("no_lines_changed","no lines changed"):1===e?Object(J.b)("one_line_changed","1 line changed"):Object(J.b)("more_lines_changed","{0} lines changed",e),o=s(t.original.length),r=s(t.modified.length);e.setAttribute("aria-label",Object(J.b)({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",i+1,n,t.original.startLineNumber,o,t.modified.startLineNumber,r));const a=document.createElement("div");a.className="diff-review-cell diff-review-summary",a.appendChild(document.createTextNode(`${i+1}/${n}: @@ -${t.original.startLineNumber},${t.original.length} +${t.modified.startLineNumber},${t.modified.length} @@`)),e.appendChild(a),c=e}else c=this._createRow(d,l,this._width.get(),t,s,r,i,o,a);n.appendChild(c);const u=jz(e=>this._model.currentElement.read(e)===d);e.add(Yz(e=>{const t=u.read(e);c.tabIndex=t?0:-1,t&&c.focus()})),e.add(Zr(c,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,s,o,r,a,l){const h=n.get(144),d=h.glyphMarginWidth+h.lineNumbersWidth,c=r.get(144),u=10+c.glyphMarginWidth+c.lineNumbersWidth;let g="diff-review-row",m="";let f=null;switch(e.type){case AK.Added:g="diff-review-row line-insert",m=" char-insert",f=EK;break;case AK.Deleted:g="diff-review-row line-delete",m=" char-delete",f=NK}const p=document.createElement("div");p.style.minWidth=i+"px",p.className=g,p.setAttribute("role","listitem"),p.ariaLevel="";const _=document.createElement("div");_.className="diff-review-cell",_.style.height=t+"px",p.appendChild(_);const v=document.createElement("span");v.style.width=d+"px",v.style.minWidth=d+"px",v.className="diff-review-line-number"+m,void 0!==e.originalLineNumber?v.appendChild(document.createTextNode(String(e.originalLineNumber))):v.innerText=" ",_.appendChild(v);const b=document.createElement("span");b.style.width=u+"px",b.style.minWidth=u+"px",b.style.paddingRight="10px",b.className="diff-review-line-number"+m,void 0!==e.modifiedLineNumber?b.appendChild(document.createTextNode(String(e.modifiedLineNumber))):b.innerText=" ",_.appendChild(b);const C=document.createElement("span");if(C.className="diff-review-spacer",f){const e=document.createElement("span");e.className=Ml.asClassName(f),e.innerText="  ",C.appendChild(e)}else C.innerText="  ";let w;if(_.appendChild(C),void 0!==e.modifiedLineNumber){let t=this._getLineHtml(a,r,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);TK._ttPolicy&&(t=TK._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),w=a.getLineContent(e.modifiedLineNumber)}else{let t=this._getLineHtml(s,n,o.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);TK._ttPolicy&&(t=TK._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),w=s.getLineContent(e.originalLineNumber)}0===w.length&&(w=Object(J.b)("blankLine","blank"));let y="";switch(e.type){case AK.Unchanged:y=e.originalLineNumber===e.modifiedLineNumber?Object(J.b)({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",w,e.originalLineNumber):Object(J.b)("equalLine","{0} original line {1} modified line {2}",w,e.originalLineNumber,e.modifiedLineNumber);break;case AK.Added:y=Object(J.b)("insertLine","+ {0} modified line {1}",w,e.modifiedLineNumber);break;case AK.Deleted:y=Object(J.b)("deleteLine","- {0} original line {1}",w,e.originalLineNumber)}return p.setAttribute("aria-label",y),p}_getLineHtml(e,t,i,n,s){const o=e.getLineContent(n),r=t.get(50),a=Cm.createEmpty(o,s),l=Wm.isBasicASCII(o,e.mightContainNonBasicASCII()),h=Wm.containsRTL(o,l,e.mightContainRTL());return Am(new xm(r.isMonospace&&!t.get(33),r.canUseHalfwidthRightwardsArrow,o,!1,l,h,0,a,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(117),t.get(99),t.get(94),t.get(51)!==be.OFF,null)).html}};WK=DK([xK(5,nc)],WK);class VK{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){var e;return null!==(e=this.editors.modified.getPosition())&&void 0!==e?e:void 0}}class HK extends st{constructor(e,t,i,n,s){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=s,this._originalScrollTop=nK(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=nK(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=oK("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Hz(this,0),this._modifiedViewZonesChangedSignal=oK("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=oK("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=$z(this,(e,t)=>{var i;this._element.replaceChildren();const n=this._diffModel.read(e),s=null===(i=null==n?void 0:n.diff.read(e))||void 0===i?void 0:i.movedTexts;if(!s||0===s.length)return void this.width.set(0,void 0);this._viewZonesChanged.read(e);const o=this._originalEditorLayoutInfo.read(e),r=this._modifiedEditorLayoutInfo.read(e);if(!o||!r)return void this.width.set(0,void 0);this._modifiedViewZonesChangedSignal.read(e),this._originalViewZonesChangedSignal.read(e);const a=s.map(t=>{function i(e,t){return(t.getTopForLineNumber(e.startLineNumber,!0)+t.getTopForLineNumber(e.endLineNumberExclusive,!0))/2}const n=i(t.lineRangeMapping.original,this._editors.original),s=this._originalScrollTop.read(e),o=i(t.lineRangeMapping.modified,this._editors.modified),r=n-s,a=o-this._modifiedScrollTop.read(e),l=Math.min(n,o),h=Math.max(n,o);return{range:new Au(l,h),from:r,to:a,fromWithoutScroll:n,toWithoutScroll:o,move:t}});a.sort(function(...e){return(t,i)=>{for(const n of e){const e=n(t,i);if(!b.isNeitherLessOrGreaterThan(e))return e}return b.neitherLessOrGreaterThan}}(C(e=>e.fromWithoutScroll>e.toWithoutScroll,y),C(e=>e.fromWithoutScroll>e.toWithoutScroll?e.fromWithoutScroll:-e.toWithoutScroll,w)));const l=zK.compute(a.map(e=>e.range)),h=o.verticalScrollbarWidth,d=10*(l.getTrackCount()-1)+20,c=h+d+(r.contentLeft-HK.movedCodeBlockPadding);let u=0;for(const e of a){const i=h+10+10*l.getTrack(u),s=15,o=15,a=c,d=r.glyphMarginWidth+r.lineNumbersWidth,g=18,m=document.createElementNS("http://www.w3.org/2000/svg","rect");m.classList.add("arrow-rectangle"),m.setAttribute("x",""+(a-d)),m.setAttribute("y",""+(e.to-g/2)),m.setAttribute("width",""+d),m.setAttribute("height",""+g),this._element.appendChild(m);const f=document.createElementNS("http://www.w3.org/2000/svg","g"),p=document.createElementNS("http://www.w3.org/2000/svg","path");p.setAttribute("d",`M 0 ${e.from} L ${i} ${e.from} L ${i} ${e.to} L ${a-o} ${e.to}`),p.setAttribute("fill","none"),f.appendChild(p);const _=document.createElementNS("http://www.w3.org/2000/svg","polygon");_.classList.add("arrow"),t.add(Yz(t=>{p.classList.toggle("currentMove",e.move===n.activeMovedText.read(t)),_.classList.toggle("currentMove",e.move===n.activeMovedText.read(t))})),_.setAttribute("points",`${a-o},${e.to-s/2} ${a},${e.to} ${a-o},${e.to+s/2}`),f.appendChild(_),this._element.appendChild(f),u++}this.width.set(d,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(it(()=>this._element.remove())),this._register(Yz(e=>{const t=this._originalEditorLayoutInfo.read(e),i=this._modifiedEditorLayoutInfo.read(e);t&&i&&(this._element.style.left=t.width-t.verticalScrollbarWidth+"px",this._element.style.height=t.height+"px",this._element.style.width=t.verticalScrollbarWidth+t.contentLeft-HK.movedCodeBlockPadding+this.width.read(e)+"px")})),this._register(lK(this._state));const o=jz(e=>{const t=this._diffModel.read(e),i=null==t?void 0:t.diff.read(e);return i?i.movedTexts.map(e=>({move:e,original:new bK(tK(e.lineRangeMapping.original.startLineNumber-1),18),modified:new bK(tK(e.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(SK(this._editors.original,o.map(e=>e.map(e=>e.original)))),this._register(SK(this._editors.modified,o.map(e=>e.map(e=>e.modified)))),this._register(Jz((e,t)=>{const i=o.read(e);for(const e of i)t.add(new KK(this._editors.original,e.original,e.move,"original",this._diffModel.get())),t.add(new KK(this._editors.modified,e.modified,e.move,"modified",this._diffModel.get()))}));const r=oK("original.onDidFocusEditorWidget",e=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>e(void 0),0))),a=oK("modified.onDidFocusEditorWidget",e=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>e(void 0),0)));let l="modified";this._register(Xz({createEmptyChangeSummary:()=>{},handleChange:(e,t)=>(e.didChange(r)&&(l="original"),e.didChange(a)&&(l="modified"),!0)},e=>{r.read(e),a.read(e);const t=this._diffModel.read(e);if(!t)return;const i=t.diff.read(e);let n=void 0;if(i&&"original"===l){const t=this._editors.originalCursor.read(e);t&&(n=i.movedTexts.find(e=>e.lineRangeMapping.original.contains(t.lineNumber)))}if(i&&"modified"===l){const t=this._editors.modifiedCursor.read(e);t&&(n=i.movedTexts.find(e=>e.lineRangeMapping.modified.contains(t.lineNumber)))}n!==t.movedTextToCompare.get()&&t.movedTextToCompare.set(void 0,void 0),t.setActiveMovedText(n)}))}}HK.movedCodeBlockPadding=4;class zK{static compute(e){const t=[],i=[];for(const n of e){let e=t.findIndex(e=>!e.intersectsStrict(n));if(-1===e){const i=6;t.length>=i?e=Hu(t,C(e=>e.intersectWithRangeLength(n),w)):(e=t.length,t.push(new Ou))}t[e].addRange(n),i.push(e)}return new zK(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class KK extends vK{constructor(e,t,i,n,s){const o=tl("div.diff-hidden-lines-widget");super(e,t,o.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=s,this._nodes=tl("div.diff-moved-code-block",{style:{marginRight:"4px"}},[tl("div.text-content@textContent"),tl("div.action-bar@actionBar")]),o.root.appendChild(this._nodes.root);const r=nK(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());let a;this._register(wK(this._nodes.root,{paddingRight:r.map(e=>e.verticalScrollbarWidth)})),a=i.changes.length>0?"original"===this._kind?Object(J.b)("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):Object(J.b)("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):"original"===this._kind?Object(J.b)("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):Object(J.b)("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new bP(this._nodes.actionBar,{highlightToggledItems:!0})),h=new kl("",a,"",!1);l.push(h,{icon:!1,label:!0});const d=new kl("","Compare",Ml.asClassName(Di.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(Yz(e=>{const t=this._diffModel.movedTextToCompare.read(e)===i;d.checked=t})),l.push(d,{icon:!1,label:!0})}}Zf("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},Object(J.b)("diffEditor.move.border","The border color for text that got moved in the diff editor.")),Zf("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},Object(J.b)("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor.")),Zf("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},Object(J.b)("diffEditor.unchangedRegionShadow","The color of the shadow around unchanged region widgets."));const UK=tH("diff-insert",Di.add,Object(J.b)("diffInsertIcon","Line decoration for inserts in the diff editor.")),jK=tH("diff-remove",Di.remove,Object(J.b)("diffRemoveIcon","Line decoration for removals in the diff editor.")),qK=Jx.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Ml.asClassName(UK),marginClassName:"gutter-insert"}),$K=Jx.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Ml.asClassName(jK),marginClassName:"gutter-delete"}),GK=Jx.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),ZK=Jx.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),YK=Jx.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),QK=Jx.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),XK=Jx.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),JK=Jx.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),eU=Jx.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),tU=Jx.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class iU extends st{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=jz(this,e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.diff.read(e);if(!i)return null;const n=this._diffModel.read(e).movedTextToCompare.read(e),s=this._options.renderIndicators.read(e),o=this._options.showEmptyDecorations.read(e),r=[],a=[];if(!n)for(const e of i.mappings)if(e.lineRangeMapping.original.isEmpty||r.push({range:e.lineRangeMapping.original.toInclusiveRange(),options:s?$K:ZK}),e.lineRangeMapping.modified.isEmpty||a.push({range:e.lineRangeMapping.modified.toInclusiveRange(),options:s?qK:GK}),e.lineRangeMapping.modified.isEmpty||e.lineRangeMapping.original.isEmpty)e.lineRangeMapping.original.isEmpty||r.push({range:e.lineRangeMapping.original.toInclusiveRange(),options:eU}),e.lineRangeMapping.modified.isEmpty||a.push({range:e.lineRangeMapping.modified.toInclusiveRange(),options:QK});else for(const t of e.lineRangeMapping.innerChanges||[])e.lineRangeMapping.original.contains(t.originalRange.startLineNumber)&&r.push({range:t.originalRange,options:t.originalRange.isEmpty()&&o?tU:JK}),e.lineRangeMapping.modified.contains(t.modifiedRange.startLineNumber)&&a.push({range:t.modifiedRange,options:t.modifiedRange.isEmpty()&&o?XK:YK});if(n)for(const e of n.changes){const t=e.original.toInclusiveRange();t&&r.push({range:t,options:s?$K:ZK});const i=e.modified.toInclusiveRange();i&&a.push({range:i,options:s?qK:GK});for(const t of e.innerChanges||[])r.push({range:t.originalRange,options:JK}),a.push({range:t.modifiedRange,options:YK})}const l=this._diffModel.read(e).activeMovedText.read(e);for(const e of i.movedTexts)r.push({range:e.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(e===l?" currentMove":""),blockPadding:[HK.movedCodeBlockPadding,0,HK.movedCodeBlockPadding,HK.movedCodeBlockPadding]}}),a.push({range:e.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(e===l?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:r,modifiedDecorations:a}}),this._register(mK(this._editors.original,this._decorations.map(e=>(null==e?void 0:e.originalDecorations)||[]))),this._register(mK(this._editors.modified,this._decorations.map(e=>(null==e?void 0:e.modifiedDecorations)||[])))}}class nU extends st{constructor(e,t,i,n){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashes=n,this._sashRatio=Hz(this,void 0),this.sashLeft=jz(this,e=>{var t;const i=null!==(t=this._sashRatio.read(e))&&void 0!==t?t:this._options.splitViewDefaultRatio.read(e);return this._computeSashLeft(i,e)}),this._sash=this._register(new cF(this._domNode,{getVerticalSashTop:e=>0,getVerticalSashLeft:e=>this.sashLeft.get(),getVerticalSashHeight:e=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(e=>{const t=this._dimensions.width.get(),i=this._computeSashLeft((this._startSashPosition+(e.currentX-e.startX))/t,void 0);this._sashRatio.set(i/t,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(Yz(e=>{const t=this._sashes.read(e);t&&(this._sash.orthogonalEndSash=t.bottom)})),this._register(Yz(e=>{const t=this._options.enableSplitViewResizing.read(e);this._sash.state=t?3:0,this.sashLeft.read(e),this._dimensions.height.read(e),this._sash.layout()}))}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),s=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n;return i<=200?n:s<100?100:s>i-100?i-100:s}}var sU,oU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},rU=function(e,t){return function(i,n){t(i,n,e)}};let aU=sU=class extends st{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=Gz(this,e=>{const t=this._editors.modifiedModel.read(e),i=sU._breadcrumbsSourceFactory.read(e);return t&&i?i(t,this._instantiationService):void 0}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(e=>{if(3===e.reason){const e=this._diffModel.get();Pz(t=>{for(const i of this._editors.original.getSelections()||[])null==e||e.ensureOriginalLineIsVisible(i.getStartPosition().lineNumber,0,t),null==e||e.ensureOriginalLineIsVisible(i.getEndPosition().lineNumber,0,t)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(e=>{if(3===e.reason){const e=this._diffModel.get();Pz(t=>{for(const i of this._editors.modified.getSelections()||[])null==e||e.ensureModifiedLineIsVisible(i.getStartPosition().lineNumber,0,t),null==e||e.ensureModifiedLineIsVisible(i.getEndPosition().lineNumber,0,t)})}}));const s=this._diffModel.map((e,t)=>{var i,n;const s=null!==(i=null==e?void 0:e.unchangedRegions.read(t))&&void 0!==i?i:[];return 1===s.length&&1===s[0].modifiedLineNumber&&s[0].lineCount===(null===(n=this._editors.modifiedModel.read(t))||void 0===n?void 0:n.getLineCount())?[]:s});this.viewZones=$z(this,(e,t)=>{const i=this._modifiedOutlineSource.read(e);if(!i)return{origViewZones:[],modViewZones:[]};const n=[],o=[],r=this._options.renderSideBySide.read(e),a=s.read(e);for(const s of a)if(!s.shouldHideControls(e)){{const e=jz(this,e=>s.getHiddenOriginalRange(e).startLineNumber-1),o=new bK(e,24);n.push(o),t.add(new lU(this._editors.original,o,s,s.originalUnchangedRange,!r,i,e=>this._diffModel.get().ensureModifiedLineIsVisible(e,2,void 0),this._options))}{const e=jz(this,e=>s.getHiddenModifiedRange(e).startLineNumber-1),n=new bK(e,24);o.push(n),t.add(new lU(this._editors.modified,n,s,s.modifiedUnchangedRange,!1,i,e=>this._diffModel.get().ensureModifiedLineIsVisible(e,2,void 0),this._options))}}return{origViewZones:n,modViewZones:o}});const o={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},r={description:"Fold Unchanged",glyphMarginHoverMessage:new yM(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(Object(J.b)("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Ml.asClassName(Di.fold),zIndex:10001};this._register(mK(this._editors.original,jz(this,e=>{const t=s.read(e),i=t.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:o}));for(const n of t)n.shouldHideControls(e)&&i.push({range:wi.fromPositions(new Ci(n.originalLineNumber,1)),options:r});return i}))),this._register(mK(this._editors.modified,jz(this,e=>{const t=s.read(e),i=t.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:o}));for(const n of t)n.shouldHideControls(e)&&i.push({range:zu.ofLength(n.modifiedLineNumber,1).toInclusiveRange(),options:r});return i}))),this._register(Yz(e=>{const t=s.read(e);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(t.map(t=>t.getHiddenOriginalRange(e).toInclusiveRange()).filter(M)),this._editors.modified.setHiddenAreas(t.map(t=>t.getHiddenModifiedRange(e).toInclusiveRange()).filter(M))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(e=>{var t;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("fold-unchanged"))){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find(e=>e.modifiedUnchangedRange.includes(t));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(e=>{var t;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("fold-unchanged"))){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find(e=>e.originalUnchangedRange.includes(t));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}}))}};aU._breadcrumbsSourceFactory=Hz("breadcrumbsSourceFactory",void 0),aU=sU=oU([rU(3,bl)],aU);class lU extends vK{constructor(e,t,i,n,s,o,r,a){const l=tl("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=s,this._modifiedOutlineSource=o,this._revealModifiedHiddenLine=r,this._options=a,this._nodes=tl("div.diff-hidden-lines",[tl("div.top@top",{title:Object(J.b)("diff.hiddenLines.top","Click or drag to show more above")}),tl("div.center@content",{style:{display:"flex"}},[tl("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[Ka("a",{title:Object(J.b)("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...OT("$(unfold)"))]),tl("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),tl("div.bottom@bottom",{title:Object(J.b)("diff.bottom","Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root);const h=nK(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?Wa(this._nodes.first):this._register(wK(this._nodes.first,{width:h.map(e=>e.contentLeft)})),this._register(Yz(e=>{const t=this._unchangedRegion.visibleLineCountTop.read(e)+this._unchangedRegion.visibleLineCountBottom.read(e)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!t),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),this._nodes.top.classList.toggle("canMoveBottom",!t);const i=this._unchangedRegion.isDragged.read(e),n=this._editor.getDomNode();n&&(n.classList.toggle("draggingUnchangedRegion",!!i),"top"===i?(n.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),n.classList.toggle("canMoveBottom",!t)):"bottom"===i?(n.classList.toggle("canMoveTop",!t),n.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0)):(n.classList.toggle("canMoveTop",!1),n.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(Zr(this._nodes.top,"mousedown",e=>{if(0!==e.button)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const s=Fr(this._nodes.top),o=Zr(s,"mousemove",e=>{const s=e.clientY-t;i=i||Math.abs(s)>2;const o=Math.round(s/d.getOption(67)),r=Math.max(0,Math.min(n+o,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(r,void 0)}),r=Zr(s,"mouseup",e=>{i||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),o.dispose(),r.dispose()})})),this._register(Zr(this._nodes.bottom,"mousedown",e=>{if(0!==e.button)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const s=Fr(this._nodes.bottom),o=Zr(s,"mousemove",e=>{const s=e.clientY-t;i=i||Math.abs(s)>2;const o=Math.round(s/d.getOption(67)),r=Math.max(0,Math.min(n-o,this._unchangedRegion.getMaxVisibleLineCountBottom())),a=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(r,void 0);const l=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(l-a))}),r=Zr(s,"mouseup",e=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!i){const e=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const t=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(t-e))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),o.dispose(),r.dispose()})})),this._register(Yz(e=>{const t=[];if(!this._hide){const n=i.getHiddenModifiedRange(e).length,s=Object(J.b)("hiddenLines","{0} hidden lines",n),o=Ka("span",{title:Object(J.b)("diff.hiddenLines.expandAll","Double click to unfold")},s);o.addEventListener("dblclick",e=>{0===e.button&&(e.preventDefault(),this._unchangedRegion.showAll(void 0))}),t.push(o);const r=this._unchangedRegion.getHiddenModifiedRange(e),a=this._modifiedOutlineSource.getBreadcrumbItems(r,e);if(a.length>0){t.push(Ka("span",void 0,"  |  "));for(let e=0;e<a.length;e++){const i=a[e],n=tl("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[RT(Pi.toIcon(i.kind))," ",i.name,...e===a.length-1?[]:[RT(Di.chevronRight)]]).root;t.push(n),n.onclick=()=>{this._revealModifiedHiddenLine(i.startLineNumber)}}}}Wa(this._nodes.others,...t)}))}}var hU,dU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cU=function(e,t){return function(i,n){t(i,n,e)}};const uU=wl("diffProviderFactoryService");let gU=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(mU,e)}};gU=dU([cU(0,bl)],gU),rc(uU,gU,1);let mU=hU=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new ft,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;null===(e=this.diffAlgorithmOnDidChangeSubscription)||void 0===e||e.dispose()}async computeDiff(e,t,i,n){var s,o;if("string"!=typeof this.diffAlgorithm)return this.diffAlgorithm.computeDiff(e,t,i,n);if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return 1===t.getLineCount()&&1===t.getLineMaxColumn(1)?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new ju(new zu(1,2),new zu(1,t.getLineCount()+1),[new qu(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const r=JSON.stringify([e.uri.toString(),t.uri.toString()]),a=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),l=hU.diffCache.get(r);if(l&&l.context===a)return l.result;const h=ht.create(),d=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),c=h.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:c,timedOut:null===(s=null==d?void 0:d.quitEarly)||void 0===s||s,detectedMoves:i.computeMoves?null!==(o=null==d?void 0:d.moves.length)&&void 0!==o?o:0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return hU.diffCache.size>10&&hU.diffCache.delete(hU.diffCache.keys().next().value),hU.diffCache.set(r,{result:d,context:a}),d}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(null===(t=this.diffAlgorithmOnDidChangeSubscription)||void 0===t||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,"string"!=typeof e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),i=!0),i&&this.onDidChangeEventEmitter.fire()}};mU.diffCache=new Map,mU=hU=dU([cU(1,WP),cU(2,zh)],mU);var fU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},pU=function(e,t){return function(i,n){t(i,n,e)}};let _U=class extends st{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=Hz(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Hz(this,void 0),this.diff=this._diff,this._unchangedRegions=Hz(this,void 0),this.unchangedRegions=jz(this,e=>{var t,i;return this._options.hideUnchangedRegions.read(e)?null!==(i=null===(t=this._unchangedRegions.read(e))||void 0===t?void 0:t.regions)&&void 0!==i?i:[]:(Pz(e=>{var t;for(const i of(null===(t=this._unchangedRegions.get())||void 0===t?void 0:t.regions)||[])i.collapseAll(e)}),[])}),this.movedTextToCompare=Hz(this,void 0),this._activeMovedText=Hz(this,void 0),this._hoveredMovedText=Hz(this,void 0),this.activeMovedText=jz(this,e=>{var t,i;return null!==(i=null!==(t=this.movedTextToCompare.read(e))&&void 0!==t?t:this._hoveredMovedText.read(e))&&void 0!==i?i:this._activeMovedText.read(e)}),this._cancellationTokenSource=new xt,this._diffProvider=jz(this,e=>{const t=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(e)});return{diffProvider:t,onChangeSignal:oK("onDidChange",t.onDidChange)}}),this._register(it(()=>this._cancellationTokenSource.cancel()));const n="string"==typeof(s="contentChangedSignal")?new aK(s):new aK(void 0,s);var s;const r=this._register(new mo(()=>n.trigger(void 0),200));this._register(Yz(t=>{const i=this._unchangedRegions.read(t);if(!i||i.regions.some(e=>e.isDragged.read(t)))return;const n=i.originalDecorationIds.map(t=>e.original.getDecorationRange(t)).map(e=>e?zu.fromRangeInclusive(e):void 0),s=i.modifiedDecorationIds.map(t=>e.modified.getDecorationRange(t)).map(e=>e?zu.fromRangeInclusive(e):void 0),r=i.regions.map((e,i)=>n[i]&&s[i]?new CU(n[i].startLineNumber,s[i].startLineNumber,n[i].length,e.visibleLineCountTop.read(t),e.visibleLineCountBottom.read(t)):void 0).filter(M),a=[];let l=!1;for(const e of o(r,(e,i)=>e.getHiddenModifiedRange(t).endLineNumberExclusive===i.getHiddenModifiedRange(t).startLineNumber))if(e.length>1){l=!0;const t=e.reduce((e,t)=>e+t.lineCount,0),i=new CU(e[0].originalLineNumber,e[0].modifiedLineNumber,t,e[0].visibleLineCountTop.get(),e[e.length-1].visibleLineCountBottom.get());a.push(i)}else a.push(e[0]);if(l){const t=e.original.deltaDecorations(i.originalDecorationIds,a.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),n=e.modified.deltaDecorations(i.modifiedDecorationIds,a.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));Pz(e=>{this._unchangedRegions.set({regions:a,originalDecorationIds:t,modifiedDecorationIds:n},e)})}}));const a=(t,i,n)=>{const s=CU.fromDiffs(t.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(n),this._options.hideUnchangedRegionsContextLineCount.read(n));let o=void 0;const r=this._unchangedRegions.get();if(r){const t=r.originalDecorationIds.map(t=>e.original.getDecorationRange(t)).map(e=>e?zu.fromRangeInclusive(e):void 0),i=r.modifiedDecorationIds.map(t=>e.modified.getDecorationRange(t)).map(e=>e?zu.fromRangeInclusive(e):void 0);let s=function(e,t){let i;return e.filter(e=>{const n=t(e,i);return i=e,n})}(r.regions.map((e,n)=>{if(!t[n]||!i[n])return;const s=t[n].length;return new CU(t[n].startLineNumber,i[n].startLineNumber,s,Math.min(e.visibleLineCountTop.get(),s),Math.min(e.visibleLineCountBottom.get(),s-e.visibleLineCountTop.get()))}).filter(M),(e,t)=>!t||e.modifiedLineNumber>=t.modifiedLineNumber+t.lineCount&&e.originalLineNumber>=t.originalLineNumber+t.lineCount).map(e=>new Uu(e.getHiddenOriginalRange(n),e.getHiddenModifiedRange(n)));s=Uu.clip(s,zu.ofLength(1,e.original.getLineCount()),zu.ofLength(1,e.modified.getLineCount())),o=Uu.inverse(s,e.original.getLineCount(),e.modified.getLineCount())}const a=[];if(o)for(const e of s){const t=o.filter(t=>t.original.intersectsStrict(e.originalUnchangedRange)&&t.modified.intersectsStrict(e.modifiedUnchangedRange));a.push(...e.setVisibleRanges(t,i))}else a.push(...s);const l=e.original.deltaDecorations((null==r?void 0:r.originalDecorationIds)||[],a.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),h=e.modified.deltaDecorations((null==r?void 0:r.modifiedDecorationIds)||[],a.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:a,originalDecorationIds:l,modifiedDecorationIds:h},i)};this._register(e.modified.onDidChangeContent(t=>{if(this._diff.get()){const i=ik.fromModelContentChanges(t.changes),n=yU(this._lastDiff,i,e.original,e.modified);n&&(this._lastDiff=n,Pz(e=>{this._diff.set(vU.fromDiffResult(this._lastDiff),e),a(n,e);const t=this.movedTextToCompare.get();this.movedTextToCompare.set(t?this._lastDiff.moves.find(e=>e.lineRangeMapping.modified.intersect(t.lineRangeMapping.modified)):void 0,e)}))}this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(e.original.onDidChangeContent(t=>{if(this._diff.get()){const i=ik.fromModelContentChanges(t.changes),n=wU(this._lastDiff,i,e.original,e.modified);n&&(this._lastDiff=n,Pz(e=>{this._diff.set(vU.fromDiffResult(this._lastDiff),e),a(n,e);const t=this.movedTextToCompare.get();this.movedTextToCompare.set(t?this._lastDiff.moves.find(e=>e.lineRangeMapping.modified.intersect(t.lineRangeMapping.modified)):void 0,e)}))}this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(Jz(async(t,i)=>{var s,o;this._options.hideUnchangedRegionsMinimumLineCount.read(t),this._options.hideUnchangedRegionsContextLineCount.read(t),r.cancel(),n.read(t);const l=this._diffProvider.read(t);l.onChangeSignal.read(t),yK(Pg,t),yK(Tg,t),this._isDiffUpToDate.set(!1,void 0);let h=[];i.add(e.original.onDidChangeContent(e=>{const t=ik.fromModelContentChanges(e.changes);h=Rk(h,t)}));let d=[];i.add(e.modified.onDidChangeContent(e=>{const t=ik.fromModelContentChanges(e.changes);d=Rk(d,t)}));let c=await l.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(t),maxComputationTimeMs:this._options.maxComputationTimeMs.read(t),computeMoves:this._options.showMoves.read(t)},this._cancellationTokenSource.token);var u,g,m;this._cancellationTokenSource.token.isCancellationRequested||(u=c,g=e.original,m=e.modified,c={changes:u.changes.map(e=>new ju(e.original,e.modified,e.innerChanges?e.innerChanges.map(e=>function(e,t,i){let n=e.originalRange,s=e.modifiedRange;return(1!==n.endColumn||1!==s.endColumn)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&s.endColumn===i.getLineMaxColumn(s.endLineNumber)&&n.endLineNumber<t.getLineCount()&&s.endLineNumber<i.getLineCount()&&(n=n.setEndPosition(n.endLineNumber+1,1),s=s.setEndPosition(s.endLineNumber+1,1)),new qu(n,s)}(e,g,m)):void 0)),moves:u.moves,identical:u.identical,quitEarly:u.quitEarly},c=null!==(s=wU(c,h,e.original,e.modified))&&void 0!==s?s:c,c=null!==(o=yU(c,d,e.original,e.modified))&&void 0!==o?o:c,Pz(e=>{a(c,e),this._lastDiff=c;const t=vU.fromDiffResult(c);this._diff.set(t,e),this._isDiffUpToDate.set(!0,e);const i=this.movedTextToCompare.get();this.movedTextToCompare.set(i?this._lastDiff.moves.find(e=>e.lineRangeMapping.modified.intersect(i.lineRangeMapping.modified)):void 0,e)}))}))}ensureModifiedLineIsVisible(e,t,i){var n,s;if(0===(null===(n=this.diff.get())||void 0===n?void 0:n.mappings.length))return;const o=(null===(s=this._unchangedRegions.get())||void 0===s?void 0:s.regions)||[];for(const n of o)if(n.getHiddenModifiedRange(void 0).contains(e))return void n.showModifiedLine(e,t,i)}ensureOriginalLineIsVisible(e,t,i){var n,s;if(0===(null===(n=this.diff.get())||void 0===n?void 0:n.mappings.length))return;const o=(null===(s=this._unchangedRegions.get())||void 0===s?void 0:s.regions)||[];for(const n of o)if(n.getHiddenOriginalRange(void 0).contains(e))return void n.showOriginalLine(e,t,i)}async waitForDiff(){var e,t,i;await(e=this.isDiffUpToDate,t=e=>e,new Promise((n,s)=>{let o=!0,r=!1;const a=e.map(e=>({isFinished:t(e),error:!!i&&i(e),state:e})),l=Yz(e=>{const{isFinished:t,error:i,state:h}=a.read(e);(t||i)&&(o?r=!0:l.dispose(),i?s(!0===i?h:i):n(h))});o=!1,r&&l.dispose()}))}serializeState(){const e=this._unchangedRegions.get();return{collapsedRegions:null==e?void 0:e.regions.map(e=>({range:e.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){var t;const i=null===(t=e.collapsedRegions)||void 0===t?void 0:t.map(e=>zu.deserialize(e.range)),n=this._unchangedRegions.get();n&&i&&Pz(e=>{for(const t of n.regions)for(const n of i)if(t.modifiedUnchangedRange.intersect(n)){t.setHiddenModifiedRange(n,e);break}})}};_U=fU([pU(2,uU)],_U);class vU{static fromDiffResult(e){return new vU(e.changes.map(e=>new bU(e)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class bU{constructor(e){this.lineRangeMapping=e}}class CU{static fromDiffs(e,t,i,n,s){const o=ju.inverse(e,t,i),r=[];for(const e of o){let o=e.original.startLineNumber,a=e.modified.startLineNumber,l=e.original.length;const h=1===o&&1===a,d=o+l===t+1&&a+l===i+1;(h||d)&&l>=s+n?(h&&!d&&(l-=s),d&&!h&&(o+=s,a+=s,l-=s),r.push(new CU(o,a,l,0,0))):l>=2*s+n&&(o+=s,a+=s,l-=2*s,r.push(new CU(o,a,l,0,0)))}return r}get originalUnchangedRange(){return zu.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return zu.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,s){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Hz(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Hz(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=jz(this,e=>this.visibleLineCountTop.read(e)+this.visibleLineCountBottom.read(e)===this.lineCount&&!this.isDragged.read(e)),this.isDragged=Hz(this,void 0);const o=Math.max(Math.min(n,this.lineCount),0),r=Math.max(Math.min(s,this.lineCount-n),0);kh(n===o),kh(s===r),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(r,void 0)}setVisibleRanges(e,t){const i=[],n=new Ku(e.map(e=>e.modified)).subtractFrom(this.modifiedUnchangedRange);let s=this.originalLineNumber,o=this.modifiedLineNumber;const r=this.modifiedLineNumber+this.lineCount;if(0===n.ranges.length)this.showAll(t),i.push(this);else{let e=0;for(const a of n.ranges){const l=e===n.ranges.length-1;e++;const h=(l?r:a.endLineNumberExclusive)-o,d=new CU(s,o,h,0,0);d.setHiddenModifiedRange(a,t),i.push(d),s=d.originalUnchangedRange.endLineNumberExclusive,o=d.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return zu.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return zu.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;0===t&&n<s||1===t?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+n,i):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+s,i)}showOriginalLine(e,t,i){const n=e-this.originalLineNumber,s=this.originalLineNumber+this.lineCount-e;0===t&&n<s||1===t?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+s-n,this.getMaxVisibleLineCountTop()),i):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+n-s,this.getMaxVisibleLineCountBottom()),i)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,t,i){e=Math.max(Math.min(e,this.lineCount),0),t=Math.max(Math.min(t,this.lineCount-e),0),this._visibleLineCountTop.set(e,i),this._visibleLineCountBottom.set(t,i)}}function wU(e,t,i,n){}function yU(e,t,i,n){}class SU extends st{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,n,s,o,r,a,l){super(),this._getViewZoneId=e,this._marginDomNode=t,this._modifiedEditor=i,this._diff=n,this._editor=s,this._viewLineCounts=o,this._originalTextModel=r,this._contextMenuService=a,this._clipboardService=l,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=Ml.asClassName(Di.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const h=this._modifiedEditor.getOption(67);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=h+"px",this._diffActions.style.lineHeight=h+"px",this._marginDomNode.appendChild(this._diffActions);let d=0;const c=i.getOption(127)&&!K.f,u=(e,t)=>{var s;this._contextMenuService.showContextMenu({domForShadowRoot:c&&null!==(s=i.getDomNode())&&void 0!==s?s:void 0,getAnchor:()=>({x:e,y:t}),getActions:()=>{const e=[],t=n.modified.isEmpty;e.push(new kl("diff.clipboard.copyDeletedContent",t?n.original.length>1?Object(J.b)("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):Object(J.b)("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):n.original.length>1?Object(J.b)("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):Object(J.b)("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,async()=>{const e=this._originalTextModel.getValueInRange(n.original.toExclusiveRange());await this._clipboardService.writeText(e)})),n.original.length>1&&e.push(new kl("diff.clipboard.copyDeletedLineContent",t?Object(J.b)("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.original.startLineNumber+d):Object(J.b)("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.original.startLineNumber+d),void 0,!0,async()=>{let e=this._originalTextModel.getLineContent(n.original.startLineNumber+d);if(""===e){e=0===this._originalTextModel.getEndOfLineSequence()?"\n":"\r\n"}await this._clipboardService.writeText(e)}));return i.getOption(91)||e.push(new kl("diff.inline.revertChange",Object(J.b)("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),e},autoSelectFirstItem:!0})};this._register(Qr(this._diffActions,"mousedown",e=>{if(!e.leftButton)return;const{top:t,height:i}=aa(this._diffActions),n=Math.floor(h/3);e.preventDefault(),u(e.posx,t+i+n)})),this._register(i.onMouseMove(e=>{8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId!==this._getViewZoneId()?this.visibility=!1:(d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,h),this.visibility=!0)})),this._register(i.onMouseDown(e=>{if(e.event.leftButton&&(8===e.target.type||5===e.target.type)){e.target.detail.viewZoneId===this._getViewZoneId()&&(e.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,h),u(e.event.posx,e.event.posy+h))}}))}_updateLightBulbPosition(e,t,i){const{top:n}=aa(e),s=t-n,o=Math.floor(s/i),r=o*i;if(this._diffActions.style.top=r+"px",this._viewLineCounts){let e=0;for(let t=0;t<this._viewLineCounts.length;t++)if(e+=this._viewLineCounts[t],o<e)return t}return o}}const LU=bd("diffEditorWidget",{createHTML:e=>e});function kU(e,t,i,n){hl(n,t.fontInfo);const s=i.length>0,o=new Bd(1e4);let r=0,a=0;const l=[];for(let n=0;n<e.lineTokens.length;n++){const h=n+1,d=e.lineTokens[n],c=e.lineBreakData[n],u=ym.filter(i,h,1,Number.MAX_SAFE_INTEGER);if(c){let i=0;for(const n of c.breakOffsets){const l=d.sliceAndInflate(i,n,0);r=Math.max(r,EU(a,l,ym.extractWrapped(u,i,n),s,e.mightContainNonBasicASCII,e.mightContainRTL,t,o)),a++,i=n}l.push(c.breakOffsets.length)}else l.push(1),r=Math.max(r,EU(a,d,u,s,e.mightContainNonBasicASCII,e.mightContainRTL,t,o)),a++}r+=t.scrollBeyondLastColumn;const h=o.build(),d=LU?LU.createHTML(h):h;n.innerHTML=d;return{heightInLines:a,minWidthInPx:r*t.typicalHalfwidthCharacterWidth,viewLineCounts:l}}class DU{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class xU{static fromEditor(e){var t;const i=e.getOptions(),n=i.get(50),s=i.get(144);return new xU((null===(t=e.getModel())||void 0===t?void 0:t.getOptions().tabSize)||0,n,i.get(33),n.typicalHalfwidthCharacterWidth,i.get(104),i.get(67),s.decorationsWidth,i.get(117),i.get(99),i.get(94),i.get(51))}constructor(e,t,i,n,s,o,r,a,l,h,d){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=s,this.lineHeight=o,this.lineDecorationsWidth=r,this.stopRenderingLineAfter=a,this.renderWhitespace=l,this.renderControlCharacters=h,this.fontLigatures=d}}function EU(e,t,i,n,s,o,r,a){a.appendString('<div class="view-line'),n||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(e*r.lineHeight)),a.appendString('px;width:1000000px;">');const l=t.getLineContent(),h=Wm.isBasicASCII(l,s),d=Wm.containsRTL(l,h,o),c=Tm(new xm(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,h,d,0,t,i,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==be.OFF,null),a);return a.appendString("</div>"),c.characterMapping.getHorizontalOffset(c.characterMapping.length)}var NU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},IU=function(e,t){return function(i,n){t(i,n,e)}};let TU=class extends st{constructor(e,t,i,n,s,o,r,a,l,h){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=o,this._origViewZonesToIgnore=r,this._modViewZonesToIgnore=a,this._clipboardService=l,this._contextMenuService=h,this._originalTopPadding=Hz(this,0),this._originalScrollOffset=Hz(this,0),this._originalScrollOffsetAnimated=_K(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Hz(this,0),this._modifiedScrollOffset=Hz(this,0),this._modifiedScrollOffsetAnimated=_K(this._targetWindow,this._modifiedScrollOffset,this._store);const d=Hz("invalidateAlignmentsState",0),c=this._register(new mo(()=>{d.set(d.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(e=>{this._canIgnoreViewZoneUpdateEvent()||c.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(e=>{this._canIgnoreViewZoneUpdateEvent()||c.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(e=>{(e.hasChanged(145)||e.hasChanged(67))&&c.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(e=>{(e.hasChanged(145)||e.hasChanged(67))&&c.schedule()}));const u=this._diffModel.map(e=>e?nK(e.model.original.onDidChangeTokens,()=>2===e.model.original.tokenization.backgroundTokenizationState):void 0).map((e,t)=>null==e?void 0:e.read(t)),g=jz(e=>{const t=this._diffModel.read(e),i=null==t?void 0:t.diff.read(e);if(!t||!i)return null;d.read(e);const n=this._options.renderSideBySide.read(e);return MU(this._editors.original,this._editors.modified,i.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,n)}),m=jz(e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e);if(!i)return null;d.read(e);const n=i.changes.map(e=>new bU(e));return MU(this._editors.original,this._editors.modified,n,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function f(){const e=document.createElement("div");return e.className="diagonal-fill",e}const p=this._register(new nt);this.viewZones=$z(this,(e,t)=>{var i,n,o,r,a,l,h,d;p.clear();const c=g.read(e)||[],_=[],v=[],b=this._modifiedTopPadding.read(e);b>0&&v.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:b,showInHiddenAreas:!0,suppressMouseDown:!0});const C=this._originalTopPadding.read(e);C>0&&_.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:C,showInHiddenAreas:!0,suppressMouseDown:!0});const w=this._options.renderSideBySide.read(e),y=w||null===(i=this._editors.modified._getViewModel())||void 0===i?void 0:i.createLineBreaksComputer();if(y){const e=this._editors.original.getModel();for(const t of c)if(t.diff)for(let i=t.originalRange.startLineNumber;i<t.originalRange.endLineNumberExclusive;i++){if(i>e.getLineCount())return{orig:_,mod:v};null==y||y.addRequest(e.getLineContent(i),null,null)}}const S=null!==(n=null==y?void 0:y.finalize())&&void 0!==n?n:[];let L=0;const k=this._editors.modified.getOption(67),D=null===(o=this._diffModel.read(e))||void 0===o?void 0:o.movedTextToCompare.read(e),x=null!==(a=null===(r=this._editors.original.getModel())||void 0===r?void 0:r.mightContainNonBasicASCII())&&void 0!==a&&a,E=null!==(h=null===(l=this._editors.original.getModel())||void 0===l?void 0:l.mightContainRTL())&&void 0!==h&&h,N=xU.fromEditor(this._editors.modified);for(const i of c)if(i.diff&&!w){if(!i.originalRange.isEmpty){u.read(e);const t=document.createElement("div");t.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const n=this._editors.original.getModel();if(i.originalRange.endLineNumberExclusive-1>n.getLineCount())return{orig:_,mod:v};const s=new DU(i.originalRange.mapToLineArray(e=>n.tokenization.getLineTokens(e)),i.originalRange.mapToLineArray(e=>S[L++]),x,E),o=[];for(const e of i.diff.innerChanges||[])o.push(new Vm(e.originalRange.delta(-(i.diff.original.startLineNumber-1)),JK.className,0));const r=kU(s,N,o,t),a=document.createElement("div");if(a.className="inline-deleted-margin-view-zone",hl(a,N.fontInfo),this._options.renderIndicators.read(e))for(let e=0;e<r.heightInLines;e++){const t=document.createElement("div");t.className="delete-sign "+Ml.asClassName(jK),t.setAttribute("style",`position:absolute;top:${e*k}px;width:${N.lineDecorationsWidth}px;height:${k}px;right:0;`),a.appendChild(t)}let l=void 0;p.add(new SU(()=>R(l),a,this._editors.modified,i.diff,this._diffEditorWidget,r.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let e=0;e<r.viewLineCounts.length;e++){const t=r.viewLineCounts[e];t>1&&_.push({afterLineNumber:i.originalRange.startLineNumber+e,domNode:f(),heightInPx:(t-1)*k,showInHiddenAreas:!0,suppressMouseDown:!0})}v.push({afterLineNumber:i.modifiedRange.startLineNumber-1,domNode:t,heightInPx:r.heightInLines*k,minWidthInPx:r.minWidthInPx,marginDomNode:a,setZoneId(e){l=e},showInHiddenAreas:!0,suppressMouseDown:!0})}const t=document.createElement("div");t.className="gutter-delete",_.push({afterLineNumber:i.originalRange.endLineNumberExclusive-1,domNode:f(),heightInPx:i.modifiedHeightInPx,marginDomNode:t,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const n=i.modifiedHeightInPx-i.originalHeightInPx;if(n>0){if(null==D?void 0:D.lineRangeMapping.original.delta(-1).deltaLength(2).contains(i.originalRange.endLineNumberExclusive-1))continue;_.push({afterLineNumber:i.originalRange.endLineNumberExclusive-1,domNode:f(),heightInPx:n,showInHiddenAreas:!0,suppressMouseDown:!0})}else{if(null==D?void 0:D.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(i.modifiedRange.endLineNumberExclusive-1))continue;function I(){const e=document.createElement("div");return e.className="arrow-revert-change "+Ml.asClassName(Di.arrowRight),t.add(Zr(e,"mousedown",e=>e.stopPropagation())),t.add(Zr(e,"click",e=>{e.stopPropagation(),s.revert(i.diff)})),Ka("div",{},e)}let o=void 0;i.diff&&i.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(e)&&(o=I()),v.push({afterLineNumber:i.modifiedRange.endLineNumberExclusive-1,domNode:f(),heightInPx:-n,marginDomNode:o,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const t of null!==(d=m.read(e))&&void 0!==d?d:[]){if(!(null==D?void 0:D.lineRangeMapping.original.intersect(t.originalRange))||!(null==D?void 0:D.lineRangeMapping.modified.intersect(t.modifiedRange)))continue;const e=t.modifiedHeightInPx-t.originalHeightInPx;e>0?_.push({afterLineNumber:t.originalRange.endLineNumberExclusive-1,domNode:f(),heightInPx:e,showInHiddenAreas:!0,suppressMouseDown:!0}):v.push({afterLineNumber:t.modifiedRange.endLineNumberExclusive-1,domNode:f(),heightInPx:-e,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:_,mod:v}});let _=!1;this._register(this._editors.original.onDidScrollChange(e=>{e.scrollLeftChanged&&!_&&(_=!0,this._editors.modified.setScrollLeft(e.scrollLeft),_=!1)})),this._register(this._editors.modified.onDidScrollChange(e=>{e.scrollLeftChanged&&!_&&(_=!0,this._editors.original.setScrollLeft(e.scrollLeft),_=!1)})),this._originalScrollTop=nK(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=nK(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Yz(e=>{const t=this._originalScrollTop.read(e)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(e))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(e));t!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(t,1)})),this._register(Yz(e=>{const t=this._modifiedScrollTop.read(e)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(e))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(e));t!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(t,1)})),this._register(Yz(e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e);let n=0;if(i){const e=this._editors.original.getTopForLineNumber(i.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();n=this._editors.modified.getTopForLineNumber(i.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-e}n>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(n,void 0)):n<0?(this._modifiedTopPadding.set(-n,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-n,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+n,void 0,!0)}))}};function MU(e,t,i,n,s,o){const r=new S(AU(e,n)),a=new S(AU(t,s)),l=e.getOption(67),h=t.getOption(67),d=[];let c=0,u=0;function g(e,t){for(;;){let i=r.peek(),n=a.peek();if(i&&i.lineNumber>=e&&(i=void 0),n&&n.lineNumber>=t&&(n=void 0),!i&&!n)break;const s=i?i.lineNumber-c:Number.MAX_VALUE,o=n?n.lineNumber-u:Number.MAX_VALUE;s<o?(r.dequeue(),n={lineNumber:i.lineNumber-c+u,heightInPx:0}):s>o?(a.dequeue(),i={lineNumber:n.lineNumber-u+c,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:zu.ofLength(i.lineNumber,1),modifiedRange:zu.ofLength(n.lineNumber,1),originalHeightInPx:l+i.heightInPx,modifiedHeightInPx:h+n.heightInPx,diff:void 0})}}for(const t of i){const i=t.lineRangeMapping;g(i.original.startLineNumber,i.modified.startLineNumber);let n=!0,s=i.modified.startLineNumber,f=i.original.startLineNumber;function m(e,i){var o,c,u,g;if(e<f||i<s)return;if(n)n=!1;else if(e===f||i===s)return;const m=new zu(f,e),p=new zu(s,i);if(m.isEmpty&&p.isEmpty)return;const _=null!==(c=null===(o=r.takeWhile(t=>t.lineNumber<e))||void 0===o?void 0:o.reduce((e,t)=>e+t.heightInPx,0))&&void 0!==c?c:0,v=null!==(g=null===(u=a.takeWhile(e=>e.lineNumber<i))||void 0===u?void 0:u.reduce((e,t)=>e+t.heightInPx,0))&&void 0!==g?g:0;d.push({originalRange:m,modifiedRange:p,originalHeightInPx:m.length*l+_,modifiedHeightInPx:p.length*h+v,diff:t.lineRangeMapping}),f=e,s=i}if(o)for(const t of i.innerChanges||[]){t.originalRange.startColumn>1&&t.modifiedRange.startColumn>1&&m(t.originalRange.startLineNumber,t.modifiedRange.startLineNumber);const i=e.getModel(),n=t.originalRange.endLineNumber<=i.getLineCount()?i.getLineMaxColumn(t.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;t.originalRange.endColumn<n&&m(t.originalRange.endLineNumber,t.modifiedRange.endLineNumber)}m(i.original.endLineNumberExclusive,i.modified.endLineNumberExclusive),c=i.original.endLineNumberExclusive,u=i.modified.endLineNumberExclusive}return g(Number.MAX_VALUE,Number.MAX_VALUE),d}function AU(e,t){const i=[],n=[],s=-1!==e.getOption(145).wrappingColumn,o=e._getViewModel().coordinatesConverter,r=e.getOption(67);if(s)for(let t=1;t<=e.getModel().getLineCount();t++){const e=o.getModelLineViewLineCount(t);e>1&&n.push({lineNumber:t,heightInPx:r*(e-1)})}for(const n of e.getWhitespaces()){if(t.has(n.id))continue;const e=0===n.afterLineNumber?0:o.convertViewPositionToModelPosition(new Ci(n.afterLineNumber,1)).lineNumber;i.push({lineNumber:e,heightInPx:n.height})}return function(e,t,i,n){if(0===e.length)return t;if(0===t.length)return e;const s=[];let o=0,r=0;for(;o<e.length&&r<t.length;){const a=e[o],l=t[r],h=i(a),d=i(l);h<d?(s.push(a),o++):h>d?(s.push(l),r++):(s.push(n(a,l)),o++,r++)}for(;o<e.length;)s.push(e[o]),o++;for(;r<t.length;)s.push(t[r]),r++;return s}(i,n,e=>e.lineNumber,(e,t)=>({lineNumber:e.lineNumber,heightInPx:e.heightInPx+t.heightInPx}))}TU=NU([IU(8,NH),IU(9,LT)],TU);var OU,RU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},PU=function(e,t){return function(i,n){t(i,n,e)}};let FU=OU=class extends st{constructor(e,t,i,n,s,o,r){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=s,this._modifiedEditorLayoutInfo=o,this._themeService=r,this.width=OU.ENTIRE_DIFF_OVERVIEW_WIDTH;const a=nK(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),l=jz(e=>{const t=a.read(e);return{insertColor:t.getColor(C_)||(t.getColor(v_)||p_).transparent(2),removeColor:t.getColor(w_)||(t.getColor(b_)||__).transparent(2)}}),h=ll(document.createElement("div"));h.setClassName("diffViewport"),h.setPosition("absolute");const d=tl("div.diffOverview",{style:{position:"absolute",top:"0px",width:OU.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(fK(d,h.domNode)),this._register(Qr(d,Ma.POINTER_DOWN,e=>{this._editors.modified.delegateVerticalScrollbarPointerDown(e)})),this._register(Zr(d,Ma.MOUSE_WHEEL,e=>{this._editors.modified.delegateScrollFromMouseWheelEvent(e)},{passive:!1})),this._register(fK(this._rootElement,d)),this._register(Jz((e,t)=>{const i=this._diffModel.read(e),n=this._editors.original.createOverviewRuler("original diffOverviewRuler");n&&(t.add(n),t.add(fK(d,n.getDomNode())));const s=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(s&&(t.add(s),t.add(fK(d,s.getDomNode()))),!n||!s)return;const o=oK("viewZoneChanged",this._editors.original.onDidChangeViewZones),r=oK("viewZoneChanged",this._editors.modified.onDidChangeViewZones),a=oK("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),c=oK("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);t.add(Yz(e=>{var t;o.read(e),r.read(e),a.read(e),c.read(e);const h=l.read(e),d=null===(t=null==i?void 0:i.diff.read(e))||void 0===t?void 0:t.mappings;function u(e,t,i){const n=i._getViewModel();return n?e.filter(e=>e.length>0).map(e=>{const i=n.coordinatesConverter.convertModelPositionToViewPosition(new Ci(e.startLineNumber,1)),s=n.coordinatesConverter.convertModelPositionToViewPosition(new Ci(e.endLineNumberExclusive,1)),o=s.lineNumber-i.lineNumber;return new GS(i.lineNumber,s.lineNumber,o,t.toString())}):[]}const g=u((d||[]).map(e=>e.lineRangeMapping.original),h.removeColor,this._editors.original),m=u((d||[]).map(e=>e.lineRangeMapping.modified),h.insertColor,this._editors.modified);null==n||n.setZones(g),null==s||s.setZones(m)})),t.add(Yz(e=>{const t=this._rootHeight.read(e),i=this._rootWidth.read(e),o=this._modifiedEditorLayoutInfo.read(e);if(o){const i=OU.ENTIRE_DIFF_OVERVIEW_WIDTH-2*OU.ONE_OVERVIEW_WIDTH;n.setLayout({top:0,height:t,right:i+OU.ONE_OVERVIEW_WIDTH,width:OU.ONE_OVERVIEW_WIDTH}),s.setLayout({top:0,height:t,right:0,width:OU.ONE_OVERVIEW_WIDTH});const r=this._editors.modifiedScrollTop.read(e),a=this._editors.modifiedScrollHeight.read(e),l=this._editors.modified.getOption(103),d=new jb(l.verticalHasArrows?l.arrowSize:0,l.verticalScrollbarSize,0,o.height,a,r);h.setTop(d.getSliderPosition()),h.setHeight(d.getSliderSize())}else h.setTop(0),h.setHeight(0);d.style.height=t+"px",d.style.left=i-OU.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",h.setWidth(OU.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};FU.ONE_OVERVIEW_WIDTH=15,FU.ENTIRE_DIFF_OVERVIEW_WIDTH=2*OU.ONE_OVERVIEW_WIDTH,FU=OU=RU([PU(6,DC)],FU);class BU extends st{constructor(){super(...arguments),this._id=++BU.idCounter,this._onDidDispose=this._register(new ft),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}BU.idCounter=0;var WU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},VU=function(e,t){return function(i,n){t(i,n,e)}};let HU=class extends st{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,s,o,r){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._createInnerEditor=s,this._instantiationService=o,this._keybindingService=r,this._onDidContentSizeChange=this._register(new ft),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),n.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),n.modifiedEditor||{})),this.modifiedModel=nK(this.modified.onDidChangeModel,()=>this.modified.getModel()),this.modifiedScrollTop=nK(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=nK(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedSelections=nK(this.modified.onDidChangeCursorSelection,()=>{var e;return null!==(e=this.modified.getSelections())&&void 0!==e?e:[]}),this.modifiedCursor=qz({owner:this,equalityComparer:Ci.equals},e=>{var t,i;return null!==(i=null===(t=this.modifiedSelections.read(e)[0])||void 0===t?void 0:t.getPosition())&&void 0!==i?i:new Ci(1,1)}),this.originalCursor=nK(this.original.onDidChangeCursorPosition,()=>{var e;return null!==(e=this.original.getPosition())&&void 0!==e?e:new Ci(1,1)}),this._register(Xz({createEmptyChangeSummary:()=>({}),handleChange:(e,t)=>(e.didChange(i.editorOptions)&&Object.assign(t,e.change.changedOptions),!0)},(e,t)=>{i.editorOptions.read(e),this._options.renderSideBySide.read(e),this.modified.updateOptions(this._adjustOptionsForRightHandSide(e,t)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(e,t))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return n.setContextValue("isInDiffLeftEditor",!0),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return n.setContextValue("isInDiffRightEditor",!0),n}_constructInnerEditor(e,t,i,n){const s=this._createInnerEditor(e,t,i,n);return this._register(s.onDidContentSizeChange(e=>{const t=this.original.getContentWidth()+this.modified.getContentWidth()+FU.ENTIRE_DIFF_OVERVIEW_WIDTH,i=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:i,contentWidth:t,contentHeightChanged:e.contentHeightChanged,contentWidthChanged:e.contentWidthChanged})})),s}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=Pe.revealHorizontalRightPadding.defaultValue+FU.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=Object(J.b)("diff-aria-navigation-tip"," use {0} to open the accessibility help.",null===(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))||void 0===t?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};HU=WU([VU(5,bl),VU(6,Iw)],HU);class zU{get editorOptions(){return this._options}constructor(e){this._diffEditorWidth=Hz(this,0),this.couldShowInlineViewBecauseOfSize=jz(this,e=>this._options.read(e).renderSideBySide&&this._diffEditorWidth.read(e)<=this._options.read(e).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=jz(this,e=>this._options.read(e).renderOverviewRuler),this.renderSideBySide=jz(this,e=>this._options.read(e).renderSideBySide&&!(this._options.read(e).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(e))),this.readOnly=jz(this,e=>this._options.read(e).readOnly),this.shouldRenderRevertArrows=jz(this,e=>!!this._options.read(e).renderMarginRevertIcon&&(!!this.renderSideBySide.read(e)&&!this.readOnly.read(e))),this.renderIndicators=jz(this,e=>this._options.read(e).renderIndicators),this.enableSplitViewResizing=jz(this,e=>this._options.read(e).enableSplitViewResizing),this.splitViewDefaultRatio=jz(this,e=>this._options.read(e).splitViewDefaultRatio),this.ignoreTrimWhitespace=jz(this,e=>this._options.read(e).ignoreTrimWhitespace),this.maxComputationTimeMs=jz(this,e=>this._options.read(e).maxComputationTime),this.showMoves=jz(this,e=>this._options.read(e).experimental.showMoves&&this.renderSideBySide.read(e)),this.isInEmbeddedEditor=jz(this,e=>this._options.read(e).isInEmbeddedEditor),this.diffWordWrap=jz(this,e=>this._options.read(e).diffWordWrap),this.originalEditable=jz(this,e=>this._options.read(e).originalEditable),this.diffCodeLens=jz(this,e=>this._options.read(e).diffCodeLens),this.accessibilityVerbose=jz(this,e=>this._options.read(e).accessibilityVerbose),this.diffAlgorithm=jz(this,e=>this._options.read(e).diffAlgorithm),this.showEmptyDecorations=jz(this,e=>this._options.read(e).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=jz(this,e=>this._options.read(e).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=jz(this,e=>this._options.read(e).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=jz(this,e=>this._options.read(e).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=jz(this,e=>this._options.read(e).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=jz(this,e=>this._options.read(e).hideUnchangedRegions.minimumLineCount);const t={...e,...KU(e,wA)};this._options=Hz(this,t)}updateOptions(e){const t=KU(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}}function KU(e,t){var i,n,s,o,r,a,l,h;return{enableSplitViewResizing:ae(e.enableSplitViewResizing,t.enableSplitViewResizing),splitViewDefaultRatio:ce(e.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:ae(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:ae(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:he(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:he(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:ae(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:ae(e.renderIndicators,t.renderIndicators),originalEditable:ae(e.originalEditable,t.originalEditable),diffCodeLens:ae(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:ae(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:me(e.diffWordWrap,t.diffWordWrap,["off","on","inherit"]),diffAlgorithm:me(e.diffAlgorithm,t.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:ae(e.accessibilityVerbose,t.accessibilityVerbose),experimental:{showMoves:ae(null===(i=e.experimental)||void 0===i?void 0:i.showMoves,t.experimental.showMoves),showEmptyDecorations:ae(null===(n=e.experimental)||void 0===n?void 0:n.showEmptyDecorations,t.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:ae(null!==(o=null===(s=e.hideUnchangedRegions)||void 0===s?void 0:s.enabled)&&void 0!==o?o:null===(r=e.experimental)||void 0===r?void 0:r.collapseUnchangedRegions,t.hideUnchangedRegions.enabled),contextLineCount:he(null===(a=e.hideUnchangedRegions)||void 0===a?void 0:a.contextLineCount,t.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:he(null===(l=e.hideUnchangedRegions)||void 0===l?void 0:l.minimumLineCount,t.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:he(null===(h=e.hideUnchangedRegions)||void 0===h?void 0:h.revealLineCount,t.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:ae(e.isInEmbeddedEditor,t.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:ae(e.onlyShowAccessibleDiffViewer,t.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:he(e.renderSideBySideInlineBreakpoint,t.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:ae(e.useInlineViewWhenSpaceIsLimited,t.useInlineViewWhenSpaceIsLimited)}}const UU=[];class jU extends st{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=jz(this,e=>{const t=this._diffModel.read(e),i=null==t?void 0:t.diff.read(e);if(!i)return UU;const n=this._editors.modifiedSelections.read(e);if(n.every(e=>e.isEmpty()))return UU;const s=new Ku(n.map(e=>zu.fromRangeInclusive(e))),o=i.mappings.filter(e=>e.lineRangeMapping.innerChanges&&s.intersects(e.lineRangeMapping.modified)).map(e=>({mapping:e,rangeMappings:e.lineRangeMapping.innerChanges.filter(e=>n.some(t=>wi.areIntersecting(e.modifiedRange,t)))}));return 0===o.length||o.every(e=>0===e.rangeMappings.length)?UU:o}),this._register(Jz((e,t)=>{if(!this._options.shouldRenderRevertArrows.read(e))return;const i=this._diffModel.read(e),n=null==i?void 0:i.diff.read(e);if(!i||!n)return;if(i.movedTextToCompare.read(e))return;const s=[],o=this._selectedDiffs.read(e),r=new Set(o.map(e=>e.mapping));if(o.length>0){const i=this._editors.modifiedSelections.read(e),n=t.add(new qU(i[i.length-1].positionLineNumber,this._widget,o.flatMap(e=>e.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(n),s.push(n)}for(const e of n.mappings)if(!r.has(e)&&!e.lineRangeMapping.modified.isEmpty&&e.lineRangeMapping.innerChanges){const i=t.add(new qU(e.lineRangeMapping.modified.startLineNumber,this._widget,e.lineRangeMapping.innerChanges,!1));this._editors.modified.addGlyphMarginWidget(i),s.push(i)}t.add(it(()=>{for(const e of s)this._editors.modified.removeGlyphMarginWidget(e)}))}))}}class qU extends st{getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id="revertButton"+qU.counter++,this._domNode=tl("div.revertButton",{title:this._revertSelection?Object(J.b)("revertSelectedChanges","Revert Selected Changes"):Object(J.b)("revertChange","Revert Change")},[RT(Di.arrowRight)]).root,this._register(Zr(this._domNode,Ma.MOUSE_DOWN,e=>{2!==e.button&&(e.stopPropagation(),e.preventDefault())})),this._register(Zr(this._domNode,Ma.MOUSE_UP,e=>{e.stopPropagation(),e.preventDefault()})),this._register(Zr(this._domNode,Ma.CLICK,e=>{this._widget.revertRangeMappings(this._diffs),e.stopPropagation(),e.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:mu.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}qU.counter=0;var $U=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},GU=function(e,t){return function(i,n){t(i,n,e)}};let ZU=class extends BU{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,s,o,r,a){var l;super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=s,this._accessibilitySignalService=r,this._editorProgressService=a,this.elements=tl("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[tl("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[Ka("span",{},"No Changes")]),tl("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),tl("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),tl("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=Hz(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=dt.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new PN([vh,this._contextKeyService])),this._boundarySashes=Hz(this,void 0),this._accessibleDiffViewerShouldBeVisible=Hz(this,!1),this._accessibleDiffViewerVisible=jz(this,e=>!!this._options.onlyShowAccessibleDiffViewer.read(e)||this._accessibleDiffViewerShouldBeVisible.read(e)),this._movedBlocksLinesPart=Hz(this,void 0),this._layoutInfo=jz(this,e=>{var t,i,n,s,o;const r=this._rootSizeObserver.width.read(e),a=this._rootSizeObserver.height.read(e),l=null===(t=this._sash.read(e))||void 0===t?void 0:t.sashLeft.read(e),h=null!=l?l:Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),d=r-h-(null!==(n=null===(i=this._overviewRulerPart.read(e))||void 0===i?void 0:i.width)&&void 0!==n?n:0),c=h-(null!==(o=null===(s=this._movedBlocksLinesPart.read(e))||void 0===s?void 0:s.width.read(e))&&void 0!==o?o:0);return this.elements.original.style.width=c+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=d+"px",this.elements.modified.style.left=h+"px",this._editors.original.layout({width:c,height:a},!0),this._editors.modified.layout({width:d,height:a},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((e,t)=>null==e?void 0:e.diff.read(t)),this.onDidUpdateDiff=dt.fromObservableLight(this._diffValue),o.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(it(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new pK(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(null!==(l=t.automaticLayout)&&void 0!==l&&l),this._options=new zU(t),this._register(Yz(e=>{this._options.setWidth(this._rootSizeObserver.width.read(e))})),this._contextKeyService.createKey(yy.isEmbeddedDiffEditor.key,!1),this._register(kK(yy.isEmbeddedDiffEditor,this._contextKeyService,e=>this._options.isInEmbeddedEditor.read(e))),this._register(kK(yy.comparingMovedCode,this._contextKeyService,e=>{var t;return!!(null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e))})),this._register(kK(yy.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,e=>this._options.couldShowInlineViewBecauseOfSize.read(e))),this._register(kK(yy.hasChanges,this._contextKeyService,e=>{var t,i,n;return(null!==(n=null===(i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.diff.read(e))||void 0===i?void 0:i.mappings.length)&&void 0!==n?n:0)>0})),this._editors=this._register(this._instantiationService.createInstance(HU,this.elements.original,this.elements.modified,this._options,i,(e,t,i,n)=>this._createInnerEditor(e,t,i,n))),this._overviewRulerPart=Gz(this,e=>this._options.renderOverviewRuler.read(e)?this._instantiationService.createInstance(yK(FU,e),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(e=>e.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store),this._sash=Gz(this,e=>{const t=this._options.renderSideBySide.read(e);return this.elements.root.classList.toggle("side-by-side",t),t?new nU(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((e,t)=>{var i,n;return e-(null!==(n=null===(i=this._overviewRulerPart.read(t))||void 0===i?void 0:i.width)&&void 0!==n?n:0)})},this._boundarySashes):void 0}).recomputeInitiallyAndOnChange(this._store);const h=Gz(this,e=>this._instantiationService.createInstance(yK(aU,e),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);Gz(this,e=>this._instantiationService.createInstance(yK(iU,e),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const d=new Set,c=new Set;let u=!1;const g=Gz(this,e=>this._instantiationService.createInstance(yK(TU,e),Fr(this._domElement),this._editors,this._diffModel,this._options,this,()=>u||h.get().isUpdatingHiddenAreas,d,c)).recomputeInitiallyAndOnChange(this._store),m=jz(this,e=>{const t=g.read(e).viewZones.read(e).orig,i=h.read(e).viewZones.read(e).origViewZones;return t.concat(i)}),f=jz(this,e=>{const t=g.read(e).viewZones.read(e).mod,i=h.read(e).viewZones.read(e).modViewZones;return t.concat(i)});let p;this._register(SK(this._editors.original,m,e=>{u=e},d)),this._register(SK(this._editors.modified,f,e=>{u=e,u?p=dK.capture(this._editors.modified):(null==p||p.restore(this._editors.modified),p=void 0)},c)),this._accessibleDiffViewer=Gz(this,e=>this._instantiationService.createInstance(yK(TK,e),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(e,t)=>this._accessibleDiffViewerShouldBeVisible.set(e,t),this._options.onlyShowAccessibleDiffViewer.map(e=>!e),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((e,t)=>{var i;return null===(i=null==e?void 0:e.diff.read(t))||void 0===i?void 0:i.mappings.map(e=>e.lineRangeMapping)}),new VK(this._editors))).recomputeInitiallyAndOnChange(this._store);const _=this._accessibleDiffViewerVisible.map(e=>e?"hidden":"visible");this._register(wK(this.elements.modified,{visibility:_})),this._register(wK(this.elements.original,{visibility:_})),this._createDiffEditorContributions(),o.addDiffEditor(this),this._register(lK(this._layoutInfo)),Gz(this,e=>new(yK(HK,e))(this.elements.root,this._diffModel,this._layoutInfo.map(e=>e.originalEditor),this._layoutInfo.map(e=>e.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,e=>{this._movedBlocksLinesPart.set(e,void 0)}),this._register(wK(this.elements.overlay,{width:this._layoutInfo.map((e,t)=>e.originalEditor.width+(this._options.renderSideBySide.read(t)?0:e.modifiedEditor.width)),visibility:jz(e=>{var t,i;return this._options.hideUnchangedRegions.read(e)&&0===(null===(i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.diff.read(e))||void 0===i?void 0:i.mappings.length)?"visible":"hidden"})})),this._register(dt.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,e=>{var t,i;if(3===(null==e?void 0:e.reason)){const n=null===(i=null===(t=this._diffModel.get())||void 0===t?void 0:t.diff.get())||void 0===i?void 0:i.mappings.find(t=>t.lineRangeMapping.modified.contains(e.position.lineNumber));(null==n?void 0:n.lineRangeMapping.modified.isEmpty)?this._accessibilitySignalService.playSignal(tz.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):(null==n?void 0:n.lineRangeMapping.original.isEmpty)?this._accessibilitySignalService.playSignal(tz.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):n&&this._accessibilitySignalService.playSignal(tz.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const v=this._diffModel.map(this,(e,t)=>{if(e)return void 0===e.diff.read(t)&&!e.isDiffUpToDate.read(t)});this._register(Jz((e,t)=>{if(!0===v.read(e)){const e=this._editorProgressService.show(!0,1e3);t.add(it(()=>e.done()))}})),this._register(it(()=>{var e;this._shouldDisposeDiffModel&&(null===(e=this._diffModel.get())||void 0===e||e.dispose())})),this._register(new jU(this._editors,this._diffModel,this._options,this))}_createInnerEditor(e,t,i,n){return e.createInstance($N,t,i,n)}_createDiffEditorContributions(){const e=td.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(e){Be(e)}}get _targetEditor(){return this._editors.modified}getEditorType(){return fm.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;return{original:this._editors.original.saveViewState(),modified:this._editors.modified.saveViewState(),modelState:null===(e=this._diffModel.get())||void 0===e?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&(null===(t=this._diffModel.get())||void 0===t||t.restoreSerializedState(i.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(_U,e,this._options)}getModel(){var e,t;return null!==(t=null===(e=this._diffModel.get())||void 0===e?void 0:e.model)&&void 0!==t?t:null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const i=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==(null==i?void 0:i.model)&&Wz(t,e=>{var t;nK.batchEventsGlobally(e,()=>{this._editors.original.setModel(i?i.model.model.original:null),this._editors.modified.setModel(i?i.model.model.modified:null)});const n=this._diffModel.get(),s=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=null!==(t=null==i?void 0:i.shouldDispose)&&void 0!==t&&t,this._diffModel.set(null==i?void 0:i.model,e),s&&(null==n||n.dispose())})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.diff.get();return t?t.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,s,o,r=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,r=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(s=t.modified.startLineNumber-1,o=0,r=void 0):(s=t.modified.startLineNumber,o=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:s,modifiedEndLineNumber:o,charChanges:null==r?void 0:r.map(e=>({originalStartLineNumber:e.originalRange.startLineNumber,originalStartColumn:e.originalRange.startColumn,originalEndLineNumber:e.originalRange.endLineNumber,originalEndColumn:e.originalRange.endColumn,modifiedStartLineNumber:e.modifiedRange.startLineNumber,modifiedStartColumn:e.modifiedRange.startColumn,modifiedEndLineNumber:e.modifiedRange.endLineNumber,modifiedEndColumn:e.modifiedRange.endColumn}))}}):null}revert(e){if(e.innerChanges)return void this.revertRangeMappings(e.innerChanges);const t=this._diffModel.get();t&&t.isDiffUpToDate.get()&&this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(e=>({range:e.modifiedRange,text:t.model.original.getValueInRange(e.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new Ci(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var t,i,n,s;const o=null===(i=null===(t=this._diffModel.get())||void 0===t?void 0:t.diff.get())||void 0===i?void 0:i.mappings;if(!o||0===o.length)return;const r=this._editors.modified.getPosition().lineNumber;let a;a="next"===e?null!==(n=o.find(e=>e.lineRangeMapping.modified.startLineNumber>r))&&void 0!==n?n:o[0]:null!==(s=Ru(o,e=>e.lineRangeMapping.modified.startLineNumber<r))&&void 0!==s?s:o[o.length-1],this._goTo(a),a.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(tz.diffLineDeleted,{source:"diffEditor.goToDiff"}):a.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(tz.diffLineInserted,{source:"diffEditor.goToDiff"}):a&&this._accessibilitySignalService.playSignal(tz.diffLineModified,{source:"diffEditor.goToDiff"})}revealFirstDiff(){const e=this._diffModel.get();e&&this.waitForDiff().then(()=>{var t;const i=null===(t=e.diff.get())||void 0===t?void 0:t.mappings;i&&0!==i.length&&this._goTo(i[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),n=i?this._editors.modified:this._editors.original,s=i?this._editors.original:this._editors.modified;let o;const r=n.getSelection();if(r){const n=null===(t=null===(e=this._diffModel.get())||void 0===e?void 0:e.diff.get())||void 0===t?void 0:t.mappings.map(e=>i?e.lineRangeMapping.flip():e.lineRangeMapping);if(n){const e=LK(r.getStartPosition(),n),t=LK(r.getEndPosition(),n);o=wi.plusRange(e,t)}}return{destination:s,destinationSelection:o}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.unchangedRegions.get();t&&Pz(e=>{for(const i of t)i.collapseAll(e)})}showAllUnchangedRegions(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.unchangedRegions.get();t&&Pz(e=>{for(const i of t)i.showAll(e)})}};ZU=$U([GU(3,vh),GU(4,bl),GU(5,yl),GU(6,XH),GU(7,XA)],ZU);var YU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},QU=function(e,t){return function(i,n){t(i,n,e)}};let XU=0,JU=!1;function ej(e){if(!e){if(JU)return;JU=!0}!function(e){ff=document.createElement("div"),ff.className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),ff.appendChild(e),e};pf=t(),_f=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),ff.appendChild(e),e};vf=i(),bf=i(),e.appendChild(ff)}(e||Pn.document.body)}let tj=class extends $N{constructor(e,t,i,n,s,o,r,a,l,h,d,c){const u={...t};u.ariaLabel=u.ariaLabel||mO.editorViewAccessibleLabel,u.ariaLabel=u.ariaLabel+";"+mO.accessibilityHelpMessage,super(e,u,{},i,n,s,o,a,l,h,d,c),this._standaloneKeybindingService=r instanceof cz?r:null,ej(u.ariaContainerElement),WO=(e,t)=>i.createInstance(yT,e,t,{})}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++XU,s=Ql.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,s),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),st.None;const t=e.id,i=e.label,n=Ql.and(Ql.equals("editorId",this.getId()),Ql.deserialize(e.precondition)),s=e.keybindings,o=Ql.and(n,Ql.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),h=new nt,d=this.getId()+":"+t;if(h.add(Ol.registerCommand(d,l)),r){const e={command:{id:d,title:i},when:n,group:r,order:a};h.add(Wh.appendMenuItem(Ph.EditorContext,e))}if(Array.isArray(s))for(const e of s)h.add(this._standaloneKeybindingService.addDynamicKeybinding(d,e,l,o));const c=new WL(d,i,i,void 0,n,(...t)=>Promise.resolve(e.run(this,...t)),this._contextKeyService);return this._actions.set(t,c),h.add(it(()=>{this._actions.delete(t)})),h}_triggerCommand(e,t){if(this._codeEditorService instanceof dI)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};tj=YU([QU(2,bl),QU(3,yl),QU(4,Al),QU(5,vh),QU(6,Iw),QU(7,DC),QU(8,HN),QU(9,Af),QU(10,Oc),QU(11,nm)],tj);let ij=class extends tj{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u,g,m){const f={...t};vz(h,f,!1);const p=a.registerEditorContainer(e);"string"==typeof f.theme&&a.setTheme(f.theme),void 0!==f.autoDetectHighContrast&&a.setAutoDetectHighContrast(Boolean(f.autoDetectHighContrast));const _=f.model;let v;if(delete f.model,super(e,f,i,n,s,o,r,a,l,d,g,m),this._configurationService=h,this._standaloneThemeService=a,this._register(p),void 0===_){const e=u.getLanguageIdByMimeType(f.language)||f.language||"plaintext";v=sj(c,u,f.value||"",e,void 0),this._ownsModel=!0}else v=_,this._ownsModel=!1;if(this._attachModel(v),v){const e={oldModelUrl:null,newModelUrl:v.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){vz(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};ij=YU([QU(2,bl),QU(3,yl),QU(4,Al),QU(5,vh),QU(6,Iw),QU(7,uH),QU(8,HN),QU(9,Xd),QU(10,Af),QU(11,Sl),QU(12,nc),QU(13,Oc),QU(14,nm)],ij);let nj=class extends ZU{constructor(e,t,i,n,s,o,r,a,l,h,d,c){const u={...t};vz(a,u,!0);const g=o.registerEditorContainer(e);"string"==typeof u.theme&&o.setTheme(u.theme),void 0!==u.autoDetectHighContrast&&o.setAutoDetectHighContrast(Boolean(u.autoDetectHighContrast)),super(e,u,{},n,i,s,c,h),this._configurationService=a,this._standaloneThemeService=o,this._register(g)}dispose(){super.dispose()}updateOptions(e){vz(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(tj,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};function sj(e,t,i,n,s){if(i=i||"",!n){const n=i.indexOf("\n");let o=i;return-1!==n&&(o=i.substring(0,n)),oj(e,i,t.createByFilepathOrFirstLine(s||null,o),s)}return oj(e,i,t.createById(n),s)}function oj(e,t,i,n){return e.createModel(t,i,n)}nj=YU([QU(2,bl),QU(3,vh),QU(4,yl),QU(5,uH),QU(6,HN),QU(7,Xd),QU(8,LT),QU(9,XA),QU(10,NH),QU(11,XH)],nj);i("4bWJ"),i("7RZT");class rj extends st{constructor(e,t,i={orientation:0}){var n;super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Ct),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new nt),i.hoverDelegate=null!==(n=i.hoverDelegate)&&void 0!==n?n:this._register(zO("element",!0)),this.options=i,this.lookupKeybindings="function"==typeof this.options.getKeyBinding,this.toggleMenuAction=this._register(new aj(()=>{var e;return null===(e=this.toggleMenuActionViewItem)||void 0===e?void 0:e.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new bP(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(e,n)=>{var s;if(e.id===aj.ID)return this.toggleMenuActionViewItem=new UR(e,e.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Ml.asClassNameArray(null!==(s=i.moreIcon)&&void 0!==s?s:Di.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const t=i.actionViewItemProvider(e,n);if(t)return t}if(e instanceof El){const i=new UR(e,e.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:e.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return i.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(i),this.disposables.add(this._onDidChangeDropdownVisibility.add(i.onDidChangeVisibility)),i}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(e=>{this.actionBar.push(e,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(e)})})}getKeybindingLabel(e){var t,i,n;const s=this.lookupKeybindings?null===(i=(t=this.options).getKeyBinding)||void 0===i?void 0:i.call(t,e):void 0;return null!==(n=null==s?void 0:s.getLabel())&&void 0!==n?n:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class aj extends kl{constructor(e,t){t=t||J.b("moreActions","More Actions..."),super(aj.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}aj.ID="toolbar.toggle.more";var lj=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},hj=function(e,t){return function(i,n){t(i,n,e)}};let dj=class extends rj{constructor(e,t,i,n,s,o,r){super(e,s,{getKeyBinding:e=>{var t;return null!==(t=o.lookupKeybinding(e.id))&&void 0!==t?t:void 0},...t,allowContextMenu:!0,skipTelemetry:"string"==typeof(null==t?void 0:t.telemetrySource)}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=s,this._sessionDisposables=this._store.add(new nt);const a=null==t?void 0:t.telemetrySource;a&&this._store.add(this.actionBar.onDidRun(e=>r.publicLog2("workbenchActionExecuted",{id:e.action.id,from:a})))}setActions(e,t=[],i){var n,s,o;this._sessionDisposables.clear();const r=e.slice(),a=t.slice(),h=[];let d=0;const c=[];let u=!1;if(-1!==(null===(n=this._options)||void 0===n?void 0:n.hiddenItemStrategy))for(let e=0;e<r.length;e++){const t=r[e];(t instanceof Hh||t instanceof Vh)&&(t.hideActions&&(h.push(t.hideActions.toggle),t.hideActions.toggle.checked&&d++,t.hideActions.isHidden&&(u=!0,r[e]=void 0,0!==(null===(s=this._options)||void 0===s?void 0:s.hiddenItemStrategy)&&(c[e]=t))))}if(void 0!==(null===(o=this._options)||void 0===o?void 0:o.overflowBehavior)){const e=function(e,t){const i=new Set;for(const n of t)e.has(n)&&i.add(n);return i}(new Set(this._options.overflowBehavior.exempted),j.map(r,e=>null==e?void 0:e.id)),t=this._options.overflowBehavior.maxItems-e.size;let i=0;for(let n=0;n<r.length;n++){const s=r[n];s&&(i++,e.has(s.id)||i>=t&&(r[n]=void 0,c[n]=s))}}l(r),l(c),super.setActions(r,xl.join(c,a)),h.length>0&&this._sessionDisposables.add(Zr(this.getElement(),"contextmenu",e=>{var t,n,s,o,r;const a=new to(Fr(this.getElement()),e),l=this.getItemAction(a.target);if(!l)return;a.preventDefault(),a.stopPropagation();let c,g=!1;if(1===d&&0===(null===(t=this._options)||void 0===t?void 0:t.hiddenItemStrategy)){g=!0;for(let e=0;e<h.length;e++)if(h[e].checked){h[e]=Il({id:l.id,label:l.label,checked:!0,enabled:!1,run(){}});break}}if(!g&&(l instanceof Hh||l instanceof Vh)){if(!l.hideActions)return;c=l.hideActions.hide}else c=Il({id:"label",label:Object(J.b)("hide","Hide"),enabled:!1,run(){}});const m=xl.join([c],h);(null===(n=this._options)||void 0===n?void 0:n.resetMenu)&&!i&&(i=[this._options.resetMenu]),u&&i&&(m.push(new xl),m.push(Il({id:"resetThisMenu",label:Object(J.b)("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>a,getActions:()=>m,menuId:null===(s=this._options)||void 0===s?void 0:s.contextMenu,menuActionOptions:{renderShortTitle:!0,...null===(o=this._options)||void 0===o?void 0:o.menuOptions},skipTelemetry:"string"==typeof(null===(r=this._options)||void 0===r?void 0:r.telemetrySource),contextKeyService:this._contextKeyService})}))}};dj=lj([hj(2,Fh),hj(3,vh),hj(4,LT),hj(5,Iw),hj(6,zh)],dj);let cj=class extends dj{constructor(e,t,i,n,s,o,r,a){super(e,{resetMenu:t,...i},n,s,o,r,a),this._onDidChangeMenuItems=this._store.add(new ft);const l=this._store.add(n.createMenu(t,s,{emitEventsForSubmenuChanges:!0})),h=()=>{var t,n,s;const o=[],r=[];!function(e,t,i,n,s,o){mP(e.getActions(t),i,!1,"string"==typeof n?e=>e===n:n,s,o)}(l,null==i?void 0:i.menuOptions,{primary:o,secondary:r},null===(t=null==i?void 0:i.toolbarOptions)||void 0===t?void 0:t.primaryGroup,null===(n=null==i?void 0:i.toolbarOptions)||void 0===n?void 0:n.shouldInlineSubmenu,null===(s=null==i?void 0:i.toolbarOptions)||void 0===s?void 0:s.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",0===o.length&&0===r.length),super.setActions(o,r)};this._store.add(l.onDidChange(()=>{h(),this._onDidChangeMenuItems.fire(this)})),h()}setActions(){throw new $e("This toolbar is populated from a menu.")}};cj=lj([hj(3,Fh),hj(4,vh),hj(5,LT),hj(6,Iw),hj(7,zh)],cj);class uj extends Dl{constructor(e){super(),this._getContext=e}runAction(e,t){return super.runAction(e,this._getContext())}}var gj=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},mj=function(e,t){return function(i,n){t(i,n,e)}};class fj{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let pj=class extends st{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Hz(this,void 0),this._collapsed=jz(this,e=>{var t;return null===(t=this._viewModel.read(e))||void 0===t?void 0:t.collapsed.read(e)}),this._editorContentHeight=Hz(this,500),this.contentHeight=jz(this,e=>(this._collapsed.read(e)?0:this._editorContentHeight.read(e))+this._outerEditorHeight),this._modifiedContentWidth=Hz(this,0),this._modifiedWidth=Hz(this,0),this._originalContentWidth=Hz(this,0),this._originalWidth=Hz(this,0),this.maxScroll=jz(this,e=>{const t=this._modifiedContentWidth.read(e)-this._modifiedWidth.read(e),i=this._originalContentWidth.read(e)-this._originalWidth.read(e);return t>i?{maxScroll:t,width:this._modifiedWidth.read(e)}:{maxScroll:i,width:this._originalWidth.read(e)}}),this._elements=tl("div.multiDiffEntry",[tl("div.header@header",[tl("div.header-content",[tl("div.collapse-button@collapseButton"),tl("div.file-path",[tl("div.title.modified.show-file-icons@primaryPath",[]),tl("div.status.deleted@status",["R"]),tl("div.title.original.show-file-icons@secondaryPath",[])]),tl("div.actions@actions")])]),tl("div.editorParent",[tl("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(ZU,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=_j(this.editor.getModifiedEditor()),this.isOriginalFocused=_j(this.editor.getOriginalEditor()),this.isFocused=jz(this,e=>this.isModifedFocused.read(e)||this.isOriginalFocused.read(e)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=new nt,this._headerHeight=48,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const s=new LV(this._elements.collapseButton,{});this._register(Yz(e=>{s.element.className="",s.icon=this._collapsed.read(e)?Di.chevronRight:Di.chevronDown})),this._register(s.onDidClick(()=>{var e;null===(e=this._viewModel.get())||void 0===e||e.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Yz(e=>{this._elements.editor.style.display=this._collapsed.read(e)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(e=>{const t=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(t,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(e=>{const t=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(t,void 0)})),this._register(this.editor.onDidContentSizeChange(e=>{Bz(t=>{this._editorContentHeight.set(e.contentHeight,t),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),t),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),t)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(e=>{if(this._isSettingScrollTop)return;if(!e.scrollTopChanged||!this._data)return;const t=e.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(t)})),this._register(Yz(e=>{const t=this.isFocused.read(e);this._elements.root.classList.toggle("focused",t)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(cj,this._elements.actions,Ph.MultiDiffEditorFileToolbar,{actionRunner:this._register(new uj(()=>{var e;return null===(e=this._viewModel.get())||void 0===e?void 0:e.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:e=>e.startsWith("navigation")},actionViewItemProvider:(e,t)=>function(e,t,i){return t instanceof Hh?e.createInstance(fP,t,i):t instanceof Vh?t.item.isSelection?e.createInstance(vP,t):t.item.rememberDefaultAction?e.createInstance(_P,t,{...i,persistLastActionId:!0}):e.createInstance(pP,t,i):void 0}(n,e,t)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){function t(e){return{...e,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}this._data=e;const i=e.viewModel.entry.value;i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{var e;this.editor.updateOptions(t(null!==(e=i.options)&&void 0!==e?e:{}))})),Bz(n=>{var s,o,r,a;null===(s=this._resourceLabel)||void 0===s||s.setUri(null!==(o=e.viewModel.modifiedUri)&&void 0!==o?o:e.viewModel.originalUri,{strikethrough:void 0===e.viewModel.modifiedUri});let l=!1,h=!1,d=!1,c="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(c="R",l=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(c="A",d=!0):(c="D",h=!0),this._elements.status.classList.toggle("renamed",l),this._elements.status.classList.toggle("deleted",h),this._elements.status.classList.toggle("added",d),this._elements.status.innerText=c,null===(r=this._resourceLabel2)||void 0===r||r.setUri(l?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setModel(e.viewModel.diffEditorViewModel,n),this.editor.updateOptions(t(null!==(a=i.options)&&void 0!==a?a:{}))})}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=e.start+"px",this._elements.root.style.height=e.length+"px",this._elements.root.style.width=t+"px",this._elements.root.style.position="absolute";const s=e.length-this._headerHeight,o=Math.max(0,Math.min(n.start-e.start,s));this._elements.header.style.transform=`translateY(${o}px)`,Bz(i=>{this.editor.layout({width:t-16-2,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",o>0||i>0),this._elements.header.classList.toggle("collapsed",o===s)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};function _j(e){return nK(t=>{const i=new nt;return i.add(e.onDidFocusEditorWidget(()=>t(!0))),i.add(e.onDidBlurEditorWidget(()=>t(!1))),i},()=>e.hasWidgetFocus())}pj=gj([mj(3,bl)],pj);class vj{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){var t;let i;if(0===this._unused.size)i=this._create(e),this._itemData.set(i,e);else{const n=[...this._unused.values()];i=null!==(t=n.find(t=>this._itemData.get(t).getId()===e.getId()))&&void 0!==t?t:n[0],this._unused.delete(i),this._itemData.set(i,e),i.setData(e)}return this._used.add(i),{object:i,dispose:()=>{this._used.delete(i),this._unused.size>5?i.dispose():this._unused.add(i)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var bj=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Cj=function(e,t){return function(i,n){t(i,n,e)}};let wj=class extends st{constructor(e,t,i,n,s,o){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=s,this._parentInstantiationService=o,this._elements=tl("div.monaco-component.multiDiffEditor",[tl("div@content",{style:{overflow:"hidden"}}),tl("div.monaco-editor@overflowWidgetsDomNode",{})]),this._sizeObserver=this._register(new pK(this._element,void 0)),this._objectPool=this._register(new vj(e=>{const t=this._instantiationService.createInstance(pj,this._elements.content,this._elements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return t.setData(e),t})),this._scrollable=this._register(new Zb({forceIntegerValues:!1,scheduleAtNextAnimationFrame:e=>ea(Fr(this._element),e),smoothScrollDuration:100})),this._scrollableElement=this._register(new nC(this._elements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this.scrollTop=nK(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=nK(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItems=$z(this,(e,t)=>{const i=this._viewModel.read(e);if(!i)return[];return i.items.read(e).map(e=>{var i;const n=t.add(new yj(e,this._objectPool,this.scrollLeft,e=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+e})})),s=null===(i=this._lastDocStates)||void 0===i?void 0:i[n.getKey()];return s&&Pz(e=>{n.setViewState(s,e)}),n})}),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(e,t)=>e.reduce((e,i)=>e+i.contentHeight.read(t)+this._spaceBetweenPx,0)),this.activeDiffItem=jz(this,e=>this._viewItems.read(e).find(t=>{var i;return null===(i=t.template.read(e))||void 0===i?void 0:i.isFocused.read(e)})),this.lastActiveDiffItem=function(e){let t=void 0;return jz(i=>(t=e(i,t),t))}((e,t)=>{var i;return null!==(i=this.activeDiffItem.read(e))&&void 0!==i?i:t}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._parentInstantiationService.createChild(new PN([vh,this._contextKeyService])),this._lastDocStates={},this._contextKeyService.createKey(yy.inMultiDiffEditor.key,!0),this._register(Jz((e,t)=>{const i=this._viewModel.read(e);if(i&&i.contextKeys)for(const[e,n]of Object.entries(i.contextKeys)){const i=this._contextKeyService.createKey(e,void 0);i.set(n),t.add(it(()=>i.reset()))}}));const r=this._parentContextKeyService.createKey(yy.multiDiffEditorAllCollapsed.key,!1);this._register(Yz(e=>{const t=this._viewModel.read(e);if(t){const i=t.items.read(e).every(t=>t.collapsed.read(e));r.set(i)}})),this._register(Yz(e=>{const t=this.lastActiveDiffItem.read(e);Pz(i=>{var n;null===(n=this._viewModel.read(e))||void 0===n||n.activeDiffItem.set(null==t?void 0:t.viewModel,i)})})),this._register(Yz(e=>{const t=this._dimension.read(e);this._sizeObserver.observe(t)})),this._elements.content.style.position="relative",this._register(Yz(e=>{const t=this._sizeObserver.height.read(e);this._elements.root.style.height=t+"px";const i=this._totalHeight.read(e);this._elements.content.style.height=i+"px";const n=this._sizeObserver.width.read(e);let s=n;const o=Vu(this._viewItems.read(e),t=>t.maxScroll.read(e).maxScroll);if(o){s=n+o.maxScroll.read(e).maxScroll}this._scrollableElement.setScrollDimensions({width:n,height:t,scrollHeight:i,scrollWidth:s})})),e.replaceChildren(this._scrollableElement.getDomNode()),this._register(it(()=>{e.replaceChildren()})),this._register(this._register(Yz(e=>{Bz(t=>{this.render(e)})})))}render(e){const t=this.scrollTop.read(e);let i=0,n=0,s=0;const o=this._sizeObserver.height.read(e),r=Au.ofStartAndLength(t,o),a=this._sizeObserver.width.read(e);for(const l of this._viewItems.read(e)){const h=l.contentHeight.read(e),d=Math.min(h,o),c=Au.ofStartAndLength(n,d),u=Au.ofStartAndLength(s,h);if(u.isBefore(r))i-=h-d,l.hide();else if(u.isAfter(r))l.hide();else{const e=Math.max(0,Math.min(r.start-u.start,h-d));i-=e;const n=Au.ofStartAndLength(t+i,o);l.render(c,e,a,n)}n+=d+this._spaceBetweenPx,s+=h+this._spaceBetweenPx}this._elements.content.style.transform=`translateY(${-(t+i)}px)`}};wj=bj([Cj(4,vh),Cj(5,bl)],wj);class yj extends st{constructor(e,t,i,n){var s,o;super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register((o=void 0,"string"==typeof(s=this)?new Kz(void 0,s,o):new Kz(s,void 0,o))),this.contentHeight=jz(this,e=>{var t,i,n;return null!==(n=null===(i=null===(t=this._templateRef.read(e))||void 0===t?void 0:t.object.contentHeight)||void 0===i?void 0:i.read(e))&&void 0!==n?n:this.viewModel.lastTemplateData.read(e).contentHeight}),this.maxScroll=jz(this,e=>{var t,i;return null!==(i=null===(t=this._templateRef.read(e))||void 0===t?void 0:t.object.maxScroll.read(e))&&void 0!==i?i:{maxScroll:0,scrollWidth:0}}),this.template=jz(this,e=>{var t;return null===(t=this._templateRef.read(e))||void 0===t?void 0:t.object}),this._isHidden=Hz(this,!1),this._register(Yz(e=>{var t;const i=this._scrollLeft.read(e);null===(t=this._templateRef.read(e))||void 0===t||t.object.setScrollLeft(i)})),this._register(Yz(e=>{const t=this._templateRef.read(e);if(!t)return;if(!this._isHidden.read(e))return;t.object.isFocused.read(e)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${null===(e=this.viewModel.entry.value.modified)||void 0===e?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var i;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const n=this.viewModel.lastTemplateData.get(),s=null===(i=e.selections)||void 0===i?void 0:i.map(yi.liftSelection);this.viewModel.lastTemplateData.set({...n,selections:s},t);const o=this._templateRef.get();o&&s&&o.object.editor.setSelections(s)}_updateTemplateData(e){var t;const i=this._templateRef.get();i&&this.viewModel.lastTemplateData.set({contentHeight:i.object.contentHeight.get(),selections:null!==(t=i.object.editor.getSelections())&&void 0!==t?t:void 0},e)}_clear(){const e=this._templateRef.get();e&&Pz(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let s=this._templateRef.get();if(!s){s=this._objectPool.getUnusedObj(new fj(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(s,void 0);const e=this.viewModel.lastTemplateData.get().selections;e&&s.object.editor.setSelections(e)}s.object.render(e,i,t,n)}}Zf("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},Object(J.b)("multiDiffEditor.headerBackground","The background color of the diff editor's header")),Zf("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},Object(J.b)("multiDiffEditor.background","The background color of the multi file diff editor")),Zf("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},Object(J.b)("multiDiffEditor.border","The border color of the multi file diff editor"));var Sj=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Lj=function(e,t){return function(i,n){t(i,n,e)}};let kj=class extends st{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Hz(this,void 0),this._viewModel=Hz(this,void 0),this._widgetImpl=$z(this,(e,t)=>(yK(pj,e),t.add(this._instantiationService.createInstance(yK(wj,e),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(lK(this._widgetImpl))}};function Dj(e,t,i){return yz.initialize(i||{}).createInstance(ij,e,t)}function xj(e){return yz.get(yl).onCodeEditorAdd(t=>{e(t)})}function Ej(e){return yz.get(yl).onDiffEditorAdd(t=>{e(t)})}function Nj(){return yz.get(yl).listCodeEditors()}function Ij(){return yz.get(yl).listDiffEditors()}function Tj(e,t,i){return yz.initialize(i||{}).createInstance(nj,e,t)}function Mj(e,t){const i=yz.initialize(t||{});return new kj(e,{},i)}function Aj(e){if("string"!=typeof e.id||"function"!=typeof e.run)throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Ol.registerCommand(e.id,e.run)}function Oj(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const t=Ql.deserialize(e.precondition),i=new nt;if(i.add(Ol.registerCommand(e.id,(i,...n)=>Xh.runEditorCommand(i,n,t,(t,i,n)=>Promise.resolve(e.run(i,...n))))),e.contextMenuGroupId){const n={command:{id:e.id,title:e.label},when:t,group:e.contextMenuGroupId,order:e.contextMenuOrder||0};i.add(Wh.appendMenuItem(Ph.EditorContext,n))}if(Array.isArray(e.keybindings)){const n=yz.get(Iw);if(n instanceof cz){const s=Ql.and(t,Ql.deserialize(e.keybindingContext));i.add(n.addDynamicKeybindings(e.keybindings.map(t=>({keybinding:t,command:e.id,when:s}))))}else console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService")}return i}function Rj(e){return Pj([e])}function Pj(e){const t=yz.get(Iw);return t instanceof cz?t.addDynamicKeybindings(e.map(e=>({keybinding:e.keybinding,command:e.command,commandArgs:e.commandArgs,when:Ql.deserialize(e.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),st.None)}function Fj(e,t,i){const n=yz.get(nc),s=n.getLanguageIdByMimeType(t)||t;return sj(yz.get(Sl),n,e,s,i)}function Bj(e,t){const i=yz.get(nc),n=i.getLanguageIdByMimeType(t)||t||"plaintext";e.setLanguage(i.createById(n))}function Wj(e,t,i){if(e){yz.get(zP).changeOne(t,e.uri,i)}}function Vj(e){yz.get(zP).changeAll(e,[])}function Hj(e){return yz.get(zP).read(e)}function zj(e){return yz.get(zP).onMarkerChanged(e)}function Kj(e){return yz.get(Sl).getModel(e)}function Uj(){return yz.get(Sl).getModels()}function jj(e){return yz.get(Sl).onModelAdded(e)}function qj(e){return yz.get(Sl).onModelRemoved(e)}function $j(e){return yz.get(Sl).onModelLanguageChanged(t=>{e({model:t.model,oldLanguage:t.oldLanguageId})})}function Gj(e){return function(e,t,i){return new mm(e,t,i)}(yz.get(Sl),yz.get(Oc),e)}function Zj(e,t){const i=yz.get(nc),n=yz.get(uH);return gf.colorizeElement(n,i,e,t).then(()=>{n.registerEditorContainer(e)})}function Yj(e,t,i){const n=yz.get(nc);return yz.get(uH).registerEditorContainer(Pn.document.body),gf.colorize(n,e,t,i)}function Qj(e,t,i=4){return yz.get(uH).registerEditorContainer(Pn.document.body),gf.colorizeModelLine(e,t,i)}function Xj(e,t){zi.getOrCreate(t);const i=function(e){const t=zi.get(e);return t||{getInitialState:()=>pm,tokenize:(t,i,n)=>_m(e,n)}}(t),n=Gn(e),s=[];let o=i.getInitialState();for(let e=0,t=n.length;e<t;e++){const t=n[e],r=i.tokenize(t,!0,o);s[e]=r.tokens,o=r.endState}return s}function Jj(e,t){yz.get(uH).defineTheme(e,t)}function eq(e){yz.get(uH).setTheme(e)}function tq(){_l.clearAllFontInfos()}function iq(e,t){return Ol.registerCommand({id:e,handler:t})}function nq(e){return yz.get(ET).registerOpener({open:async t=>("string"==typeof t&&(t=di.parse(t)),e.open(t))})}function sq(e){return yz.get(yl).registerCodeEditorOpenHandler(async(t,i,n)=>{var s;if(!i)return null;const o=null===(s=t.options)||void 0===s?void 0:s.selection;let r;return o&&"number"==typeof o.endLineNumber&&"number"==typeof o.endColumn?r=o:o&&(r={lineNumber:o.startLineNumber,column:o.startColumn}),await e.openCodeEditor(i,t.resource,r)?i:null})}function oq(e,t){return"boolean"==typeof e?e:t}function rq(e,t){return"string"==typeof e?e:t}function aq(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function lq(e,t){t=t.replace(/@@/g,"");let i,n=0;do{i=!1,t=t.replace(/@(\w+)/g,(function(n,s){i=!0;let o="";if("string"==typeof e[s])o=e[s];else{if(!(e[s]&&e[s]instanceof RegExp))throw void 0===e[s]?Ym(e,"language definition does not contain attribute '"+s+"', used at: "+t):Ym(e,"attribute reference '"+s+"' must be a string, used at: "+t);o=e[s].source}return $m(o)?"":"(?:"+o+")"})),n++}while(i&&n<5);t=t.replace(/\x01/g,"@");const s=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,s)}function hq(e,t,i,n){let s=-1,o=i,r=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(s=parseInt(r[3]),r[2]&&(s+=100)),o=r[4]);let a,l="~",h=o;if(o&&0!==o.length?/^\w*$/.test(h)?l="==":(r=o.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(l=r[1],h=r[2])):(l="!=",h=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(h))if("@"===l||"!@"===l){const i=e[h];if(!i)throw Ym(e,"the @ match target '"+h+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const i of t)if(!e(i))return!1;return!0}((function(e){return"string"==typeof e}),i))throw Ym(e,"the @ match target '"+h+"' must be an array of strings, in rule: "+t);const n=aq(i,e.ignoreCase);a=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l)if(h.indexOf("$")<0){const t=lq(e,"^"+h+"$");a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,i,n,s){return lq(e,"^"+Qm(e,h,i,n,s)+"$").test(t)};else if(h.indexOf("$")<0){const t=Gm(e,h);a=function(e){return"=="===l?e===t:e!==t}}else{const t=Gm(e,h);a=function(i,n,s,o,r){const a=Qm(e,t,n,s,o);return"=="===l?i===a:i!==a}}else{const t=aq(h.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===s?{name:i,value:n,test:function(e,t,i,n){return a(e,e,t,i,n)}}:{name:i,value:n,test:function(e,t,i,n){const o=function(e,t,i,n){if(n<0)return e;if(n<t.length)return t[n];if(n>=100){n-=100;const e=i.split(".");if(e.unshift(i),n<e.length)return e[n]}return null}(e,t,i,s);return a(o||"",e,t,i,n)}}}kj=Sj([Lj(2,bl)],kj);class dq{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if("string"==typeof t)i=t;else{if(!(t instanceof RegExp))throw Ym(e,"rules must start with a match string or regular expression: "+this.name);i=t.source}this.matchOnlyAtLineStart=i.length>0&&"^"===i[0],this.name=this.name+": "+i,this.regex=lq(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=function e(t,i,n){if(n){if("string"==typeof n)return n;if(n.token||""===n.token){if("string"!=typeof n.token)throw Ym(t,"a 'token' attribute must be of type string, in rule: "+i);{const e={token:n.token};if(n.token.indexOf("$")>=0&&(e.tokenSubst=!0),"string"==typeof n.bracket)if("@open"===n.bracket)e.bracket=1;else{if("@close"!==n.bracket)throw Ym(t,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+i);e.bracket=-1}if(n.next){if("string"!=typeof n.next)throw Ym(t,"the next state must be a string value in rule: "+i);{let s=n.next;if(!/^(@pop|@push|@popall)$/.test(s)&&("@"===s[0]&&(s=s.substr(1)),s.indexOf("$")<0&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(t,Qm(t,s,"",[],""))))throw Ym(t,"the next state '"+n.next+"' is not defined in rule: "+i);e.next=s}}return"number"==typeof n.goBack&&(e.goBack=n.goBack),"string"==typeof n.switchTo&&(e.switchTo=n.switchTo),"string"==typeof n.log&&(e.log=n.log),"string"==typeof n.nextEmbedded&&(e.nextEmbedded=n.nextEmbedded,t.usesEmbedded=!0),e}}if(Array.isArray(n)){const s=[];for(let o=0,r=n.length;o<r;o++)s[o]=e(t,i,n[o]);return{group:s}}if(n.cases){const s=[];for(const o in n.cases)if(n.cases.hasOwnProperty(o)){const r=e(t,i,n.cases[o]);"@default"===o||"@"===o||""===o?s.push({test:void 0,value:r,name:o}):"@eos"===o?s.push({test:function(e,t,i,n){return n},value:r,name:o}):s.push(hq(t,i,o,r))}const o=t.defaultToken;return{test:function(e,t,i,n){for(const o of s){if(!o.test||o.test(e,t,i,n))return o.value}return o}}}throw Ym(t,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+i)}return{token:""}}(e,this.name,t)}}function cq(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");const i={};i.languageId=e,i.includeLF=oq(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"==typeof t.start?t.start:null,i.ignoreCase=oq(t.ignoreCase,!1),i.unicode=oq(t.unicode,!1),i.tokenPostfix=rq(t.tokenPostfix,"."+i.languageId),i.defaultToken=rq(t.defaultToken,"source"),i.usesEmbedded=!1;const n=t;function s(e,o,r){for(const a of r){let r=a.include;if(r){if("string"!=typeof r)throw Ym(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw Ym(i,"include target '"+r+"' is not defined at: "+e);s(e+"."+r,o,t.tokenizer[r])}else{const t=new dq(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(n,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(n,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw Ym(i,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=a[1];e.next=a[2],t.setAction(n,e)}}else t.setAction(n,a[1]);else{if(!a.regex)throw Ym(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=oq(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}o.push(t)}}}if(n.languageId=e,n.includeLF=i.includeLF,n.ignoreCase=i.ignoreCase,n.unicode=i.unicode,n.noThrow=i.noThrow,n.usesEmbedded=i.usesEmbedded,n.stateNames=t.tokenizer,n.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw Ym(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(const e in t.tokenizer)if(t.tokenizer.hasOwnProperty(e)){i.start||(i.start=e);const n=t.tokenizer[e];i.tokenizer[e]=new Array,s("tokenizer."+e,i.tokenizer[e],n)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw Ym(i,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const e of t.brackets){let t=e;if(t&&Array.isArray(t)&&3===t.length&&(t={token:t[2],open:t[0],close:t[1]}),t.open===t.close)throw Ym(i,"open and close brackets in a 'brackets' attribute must be different: "+t.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof t.open||"string"!=typeof t.token||"string"!=typeof t.close)throw Ym(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");o.push({token:t.token+i.tokenPostfix,open:Gm(i,t.open),close:Gm(i,t.close)})}return i.brackets=o,i.noThrow=!0,i}function uq(e){kc.registerLanguage(e)}function gq(){let e=[];return e=e.concat(kc.getLanguages()),e}function mq(e){return yz.get(nc).languageIdCodec.encodeLanguageId(e)}function fq(e,t){return yz.withServices(()=>{const i=yz.get(nc).onDidRequestRichLanguageFeatures(n=>{n===e&&(i.dispose(),t())});return i})}function pq(e,t){return yz.withServices(()=>{const i=yz.get(nc).onDidRequestBasicLanguageFeatures(n=>{n===e&&(i.dispose(),t())});return i})}function _q(e,t){if(!yz.get(nc).isRegisteredLanguageId(e))throw new Error("Cannot set configuration for unknown language "+e);return yz.get(Oc).register(e,t,100)}class vq{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if("function"==typeof this._actual.tokenize)return bq.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new Ii(n.tokens,n.endState)}}class bq{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,o=e.length;s<o;s++){const o=e[s];let r=o.startIndex;0===s?r=0:r<n&&(r=n),i[s]=new Ei(r,o.scopes,t),n=r}return i}static adaptTokenize(e,t,i,n){const s=t.tokenize(i,n),o=bq._toClassicTokens(s.tokens,e);let r;return r=s.endState.equals(n)?n:s.endState,new Ni(o,r)}tokenize(e,t,i){return bq.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let o=0,r=0;for(let e=0,a=t.length;e<a;e++){const a=t[e],l=1024|n.match(i,a.scopes);if(o>0&&s[o-1]===l)continue;let h=a.startIndex;0===e?h=0:h<r&&(h=r),s[o++]=h,s[o++]=l,r=h}const a=new Uint32Array(o);for(let e=0;e<o;e++)a[e]=s[e];return a}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),s=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let o;return o=n.endState.equals(i)?i:n.endState,new Ii(s,o)}}function Cq(e){return e&&"function"==typeof e.then}function wq(e){const t=yz.get(uH);if(e){const i=[null];for(let t=1,n=e.length;t<n;t++)i[t]=Ug.fromHex(e[t]);t.setColorMapOverride(i)}else t.setColorMapOverride(null)}function yq(e,t){return function(e){return"tokenizeEncoded"in e}(t)?new vq(e,t):new bq(e,t,yz.get(nc),yz.get(uH))}function Sq(e,t){const i=new Hi(async()=>{const i=await Promise.resolve(t.create());return i?"function"==typeof i.getInitialState?yq(e,i):new df(yz.get(nc),yz.get(uH),e,cq(e,i),yz.get(Xd)):null});return zi.registerFactory(e,i)}function Lq(e,t){if(!yz.get(nc).isRegisteredLanguageId(e))throw new Error("Cannot set tokens provider for unknown language "+e);return Cq(t)?Sq(e,{create:()=>t}):zi.register(e,yq(e,t))}function kq(e,t){return Cq(t)?Sq(e,{create:()=>t}):zi.register(e,(t=>new df(yz.get(nc),yz.get(uH),e,cq(e,t),yz.get(Xd)))(t))}function Dq(e,t){return yz.get(nm).referenceProvider.register(e,t)}function xq(e,t){return yz.get(nm).renameProvider.register(e,t)}function Eq(e,t){return yz.get(nm).newSymbolNamesProvider.register(e,t)}function Nq(e,t){return yz.get(nm).signatureHelpProvider.register(e,t)}function Iq(e,t){return yz.get(nm).hoverProvider.register(e,{provideHover:(e,i,n)=>{const s=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n)).then(e=>{if(e)return!e.range&&s&&(e.range=new wi(i.lineNumber,s.startColumn,i.lineNumber,s.endColumn)),e.range||(e.range=new wi(i.lineNumber,i.column,i.lineNumber,i.column)),e})}})}function Tq(e,t){return yz.get(nm).documentSymbolProvider.register(e,t)}function Mq(e,t){return yz.get(nm).documentHighlightProvider.register(e,t)}function Aq(e,t){return yz.get(nm).linkedEditingRangeProvider.register(e,t)}function Oq(e,t){return yz.get(nm).definitionProvider.register(e,t)}function Rq(e,t){return yz.get(nm).implementationProvider.register(e,t)}function Pq(e,t){return yz.get(nm).typeDefinitionProvider.register(e,t)}function Fq(e,t){return yz.get(nm).codeLensProvider.register(e,t)}function Bq(e,t,i){return yz.get(nm).codeActionProvider.register(e,{providedCodeActionKinds:null==i?void 0:i.providedCodeActionKinds,documentation:null==i?void 0:i.documentation,provideCodeActions:(e,i,n,s)=>{const o=yz.get(zP).read({resource:e.uri}).filter(e=>wi.areIntersectingOrTouching(e,i));return t.provideCodeActions(e,i,{markers:o,only:n.only,trigger:n.trigger},s)},resolveCodeAction:t.resolveCodeAction})}function Wq(e,t){return yz.get(nm).documentFormattingEditProvider.register(e,t)}function Vq(e,t){return yz.get(nm).documentRangeFormattingEditProvider.register(e,t)}function Hq(e,t){return yz.get(nm).onTypeFormattingEditProvider.register(e,t)}function zq(e,t){return yz.get(nm).linkProvider.register(e,t)}function Kq(e,t){return yz.get(nm).completionProvider.register(e,t)}function Uq(e,t){return yz.get(nm).colorProvider.register(e,t)}function jq(e,t){return yz.get(nm).foldingRangeProvider.register(e,t)}function qq(e,t){return yz.get(nm).declarationProvider.register(e,t)}function $q(e,t){return yz.get(nm).selectionRangeProvider.register(e,t)}function Gq(e,t){return yz.get(nm).documentSemanticTokensProvider.register(e,t)}function Zq(e,t){return yz.get(nm).documentRangeSemanticTokensProvider.register(e,t)}function Yq(e,t){return yz.get(nm).inlineCompletionsProvider.register(e,t)}function Qq(e,t){return yz.get(nm).inlineEditProvider.register(e,t)}function Xq(e,t){return yz.get(nm).inlayHintsProvider.register(e,t)}const Jq=wl("IEditorCancelService"),e$=new _h("cancellableOperation",!1,Object(J.b)("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));rc(Jq,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext(e=>({key:e$.bindTo(e.get(vh)),tokens:new $})),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},1);Jh(new class extends Xh{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:e$})}runEditorCommand(e,t){e.get(Jq).cancel(t)}});class t${constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}class i${constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(t$.toKey(e))}has(e){return this._set.has(t$.toKey(e))}}function n$(e,t,i){const n=[],s=new i$,o=e.ordered(i);for(const e of o)n.push(e),e.extensionId&&s.add(e.extensionId);const r=t.ordered(i);for(const e of r){if(e.extensionId){if(s.has(e.extensionId))continue;s.add(e.extensionId)}n.push({displayName:e.displayName,extensionId:e.extensionId,provideDocumentFormattingEdits:(t,i,n)=>e.provideDocumentRangeFormattingEdits(t,t.getFullModelRange(),i,n)})}return n}class s${static setFormatterSelector(e){return{dispose:s$._selectors.unshift(e)}}static async select(e,t,i,n){if(0===e.length)return;const s=j.first(s$._selectors);return s?await s(e,t,i,n):void 0}}s$._selectors=new $,Ol.registerCommand("_executeFormatRangeProvider",(async function(e,...t){const[i,n,s]=t;O(di.isUri(i)),O(wi.isIRange(n));const o=e.get(Ll),r=e.get(WP),a=e.get(nm),l=await o.createModelReference(i);try{return async function(e,t,i,n,s,o){const r=t.documentRangeFormattingEditProvider.ordered(i);for(const t of r){const r=await Promise.resolve(t.provideDocumentRangeFormattingEdits(i,n,s,o)).catch(We);if(h(r))return await e.computeMoreMinimalEdits(i.uri,r)}}(r,a,l.object.textEditorModel,wi.lift(n),s,Lt.None)}finally{l.dispose()}})),Ol.registerCommand("_executeFormatDocumentProvider",(async function(e,...t){const[i,n]=t;O(di.isUri(i));const s=e.get(Ll),o=e.get(WP),r=e.get(nm),a=await s.createModelReference(i);try{return async function(e,t,i,n,s){const o=n$(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,i);for(const t of o){const o=await Promise.resolve(t.provideDocumentFormattingEdits(i,n,s)).catch(We);if(h(o))return await e.computeMoreMinimalEdits(i.uri,o)}}(o,r,a.object.textEditorModel,n,Lt.None)}finally{a.dispose()}})),Ol.registerCommand("_executeFormatOnTypeProvider",(async function(e,...t){const[i,n,s,o]=t;O(di.isUri(i)),O(Ci.isIPosition(n)),O("string"==typeof s);const r=e.get(Ll),a=e.get(WP),l=e.get(nm),h=await r.createModelReference(i);try{return function(e,t,i,n,s,o,r){const a=t.onTypeFormattingEditProvider.ordered(i);return 0===a.length||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(i,n,s,o,r)).catch(We).then(t=>e.computeMoreMinimalEdits(i.uri,t))}(a,l,h.object.textEditorModel,Ci.lift(n),s,o,Lt.None)}finally{h.dispose()}})),Pe.wrappingIndent.defaultValue=0,Pe.glyphMargin.defaultValue=!1,Pe.autoIndent.defaultValue=3,Pe.overviewRulerLanes.defaultValue=2,s$.setFormatterSelector((e,t,i)=>Promise.resolve(e[0]));const o$=Rn();o$.editor={create:Dj,getEditors:Nj,getDiffEditors:Ij,onDidCreateEditor:xj,onDidCreateDiffEditor:Ej,createDiffEditor:Tj,addCommand:Aj,addEditorAction:Oj,addKeybindingRule:Rj,addKeybindingRules:Pj,createModel:Fj,setModelLanguage:Bj,setModelMarkers:Wj,getModelMarkers:Hj,removeAllMarkers:Vj,onDidChangeMarkers:zj,getModels:Uj,getModel:Kj,onDidCreateModel:jj,onWillDisposeModel:qj,onDidChangeModelLanguage:$j,createWebWorker:Gj,colorizeElement:Zj,colorize:Yj,colorizeModelLine:Qj,tokenize:Xj,defineTheme:Jj,setTheme:eq,remeasureFonts:tq,registerCommand:iq,registerLinkOpener:nq,registerEditorOpener:sq,AccessibilitySupport:Ui,ContentWidgetPositionPreference:Yi,CursorChangeReason:Qi,DefaultEndOfLine:Xi,EditorAutoIndentStrategy:en,EditorOption:tn,EndOfLinePreference:nn,EndOfLineSequence:sn,MinimapPosition:fn,MouseTargetType:pn,OverlayWidgetPositionPreference:vn,OverviewRulerLane:bn,GlyphMarginLane:on,RenderLineNumbersType:wn,RenderMinimap:yn,ScrollbarVisibility:Ln,ScrollType:Sn,TextEditorCursorBlinkingStyle:In,TextEditorCursorStyle:Tn,TrackedRangeStickiness:Mn,WrappingIndent:An,InjectedTextCursorStops:an,PositionAffinity:Cn,ShowLightbulbIconMode:Dn,ConfigurationChangedEvent:ee,BareFontInfo:ml,FontInfo:fl,TextModelResolvedOptions:_u,FindMatch:vu,ApplyUpdateResult:ne,EditorZoom:ul,createMultiFileDiffEditor:Mj,EditorType:fm,EditorOptions:Pe},o$.languages={register:uq,getLanguages:gq,onLanguage:fq,onLanguageEncountered:pq,getEncodedLanguageId:mq,setLanguageConfiguration:_q,setColorMap:wq,registerTokensProviderFactory:Sq,setTokensProvider:Lq,setMonarchTokensProvider:kq,registerReferenceProvider:Dq,registerRenameProvider:xq,registerNewSymbolNameProvider:Eq,registerCompletionItemProvider:Kq,registerSignatureHelpProvider:Nq,registerHoverProvider:Iq,registerDocumentSymbolProvider:Tq,registerDocumentHighlightProvider:Mq,registerLinkedEditingRangeProvider:Aq,registerDefinitionProvider:Oq,registerImplementationProvider:Rq,registerTypeDefinitionProvider:Pq,registerCodeLensProvider:Fq,registerCodeActionProvider:Bq,registerDocumentFormattingEditProvider:Wq,registerDocumentRangeFormattingEditProvider:Vq,registerOnTypeFormattingEditProvider:Hq,registerLinkProvider:zq,registerColorProvider:Uq,registerFoldingRangeProvider:jq,registerDeclarationProvider:qq,registerSelectionRangeProvider:$q,registerDocumentSemanticTokensProvider:Gq,registerDocumentRangeSemanticTokensProvider:Zq,registerInlineCompletionsProvider:Yq,registerInlineEditProvider:Qq,registerInlayHintsProvider:Xq,DocumentHighlightKind:Ji,CompletionItemKind:$i,CompletionItemTag:Gi,CompletionItemInsertTextRule:qi,SymbolKind:En,SymbolTag:Nn,IndentAction:rn,CompletionTriggerKind:Zi,SignatureHelpTriggerKind:xn,InlayHintKind:ln,InlineCompletionTriggerKind:hn,InlineEditTriggerKind:dn,CodeActionTriggerType:ji,NewSymbolNameTag:_n,FoldingRangeKind:Vi,SelectedSuggestionInfo:Ri};const r$=o$.CancellationTokenSource,a$=o$.Emitter,l$=o$.KeyCode,h$=o$.KeyMod,d$=o$.Position,c$=o$.Range,u$=o$.Selection,g$=o$.SelectionDirection,m$=o$.MarkerSeverity,f$=o$.MarkerTag,p$=o$.Uri,_$=o$.Token,v$=o$.editor,b$=o$.languages,C$=globalThis.MonacoEnvironment;((null==C$?void 0:C$.globalAPI)||"function"==typeof define&&i("PDX0"))&&(globalThis.monaco=o$),void 0!==globalThis.require&&"function"==typeof globalThis.require.config&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]})},eZvg:function(e,t,i){},fewy:function(e,t,i){},fmRc:function(e,t,i){var n=i("Xi7e"),s=i("77Zs"),o=i("L8xA"),r=i("gCq4"),a=i("VaNO"),l=i("0Cz8");function h(e){var t=this.__data__=new n(e);this.size=t.size}h.prototype.clear=s,h.prototype.delete=o,h.prototype.get=r,h.prototype.has=a,h.prototype.set=l,e.exports=h},g3zJ:function(e,t,i){"use strict";(function(e){i.d(t,"n",(function(){return k})),i.d(t,"i",(function(){return D})),i.d(t,"g",(function(){return x})),i.d(t,"k",(function(){return E})),i.d(t,"m",(function(){return N})),i.d(t,"p",(function(){return I})),i.d(t,"f",(function(){return T})),i.d(t,"j",(function(){return M})),i.d(t,"o",(function(){return R})),i.d(t,"a",(function(){return P})),i.d(t,"h",(function(){return W})),i.d(t,"c",(function(){return V})),i.d(t,"e",(function(){return H})),i.d(t,"l",(function(){return z})),i.d(t,"d",(function(){return K})),i.d(t,"b",(function(){return U}));var n,s=i("MXXP");let o=!1,r=!1,a=!1,l=!1,h=!1,d=!1,c=!1,u=!1,g=!1,m=!1,f=void 0,p="en",_="en",v=void 0,b=void 0;const C=globalThis;let w=void 0;void 0!==C.vscode&&void 0!==C.vscode.process?w=C.vscode.process:void 0!==e&&(w=e);const y="string"==typeof(null===(n=null==w?void 0:w.versions)||void 0===n?void 0:n.electron),S=y&&"renderer"===(null==w?void 0:w.type);if("object"==typeof w){o="win32"===w.platform,r="darwin"===w.platform,a="linux"===w.platform,l=a&&!!w.env.SNAP&&!!w.env.SNAP_REVISION,c=y,g=!!w.env.CI||!!w.env.BUILD_ARTIFACTSTAGINGDIRECTORY,f="en",p="en";const e=w.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),i=t.availableLanguages["*"];f=t.locale,_=t.osLocale,p=i||"en",v=t._translationsConfigFile}catch(e){}h=!0}else if("object"!=typeof navigator||S)console.error("Unable to resolve platform.");else{b=navigator.userAgent,o=b.indexOf("Windows")>=0,r=b.indexOf("Macintosh")>=0,u=(b.indexOf("Macintosh")>=0||b.indexOf("iPad")>=0||b.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,a=b.indexOf("Linux")>=0,m=(null==b?void 0:b.indexOf("Mobi"))>=0,d=!0;f=s.a(s.b({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||"en",p=f,_=navigator.language}let L=0;r?L=1:o?L=3:a&&(L=2);const k=o,D=r,x=a,E=h,N=d,I=d&&"function"==typeof C.importScripts?C.origin:void 0,T=u,M=m,A=b,O="function"==typeof C.postMessage&&!C.importScripts,R=(()=>{if(O){const e=[];C.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.id===t.data.vscodeScheduleAsyncWork)return e.splice(i,1),void n.callback()}});let t=0;return i=>{const n=++t;e.push({id:n,callback:i}),C.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),P=r||u?2:o?1:3;let F=!0,B=!1;function W(){if(!B){B=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);F=513===t[0]}return F}const V=!!(A&&A.indexOf("Chrome")>=0),H=!!(A&&A.indexOf("Firefox")>=0),z=!!(!V&&A&&A.indexOf("Safari")>=0),K=!!(A&&A.indexOf("Edg/")>=0),U=!!(A&&A.indexOf("Android")>=0)}).call(this,i("8oxB"))},gCq4:function(e,t){e.exports=function(e){return this.__data__.get(e)}},gL5p:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"MonacoDiffEditor",{enumerable:!0,get:function(){return s.default}});var n=o(i("j6EG")),s=o(i("4oKn"));function o(e){return e&&e.__esModule?e:{default:e}}},iFQ5:function(e,t,i){},j6EG:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==h(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=e[s]}i.default=e,t&&t.set(e,i);return i}(i("CY4F")),s=a(i("17x9")),o=a(i("q1tI")),r=i("JwdM");function a(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?d(Object(i),!0).forEach((function(t){b(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):d(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function u(e,t){if(null==e)return{};var i,n,s=function(e,t){if(null==e)return{};var i,n,s={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(s[i]=e[i]);return s}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(s[i]=e[i])}return s}function g(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=v(e);if(t){var s=v(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return p(this,i)}}function p(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?_(e):t}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(l,e);var t,i,s,a=f(l);function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),b(_(t=a.call(this,e)),"assignRef",(function(e){t.containerElement=e})),t.containerElement=void 0,t}return t=l,(i=[{key:"componentDidMount",value:function(){this.initMonaco()}},{key:"componentDidUpdate",value:function(e){var t=this.props,i=t.value,s=t.language,o=t.theme,r=t.height,a=t.options,l=t.width,h=this.editor,d=h.getModel();if(null!=this.props.value&&this.props.value!==d.getValue()&&(this.__prevent_trigger_change_event=!0,this.editor.pushUndoStop(),d.pushEditOperations([],[{range:d.getFullModelRange(),text:i}]),this.editor.pushUndoStop(),this.__prevent_trigger_change_event=!1),e.language!==s&&n.editor.setModelLanguage(d,s),e.theme!==o&&n.editor.setTheme(o),!h||l===e.width&&r===e.height||h.layout(),e.options!==a){a.model;var c=u(a,["model"]);h.updateOptions(c)}}},{key:"componentWillUnmount",value:function(){this.destroyMonaco()}},{key:"destroyMonaco",value:function(){if(this.editor){this.editor.dispose();var e=this.editor.getModel();e&&e.dispose()}this._subscription&&this._subscription.dispose()}},{key:"initMonaco",value:function(){var e=null!=this.props.value?this.props.value:this.props.defaultValue,t=this.props,i=t.language,s=t.theme,o=t.options,r=t.overrideServices;this.containerElement&&(Object.assign(o,this.editorWillMount()),this.editor=n.editor.create(this.containerElement,c(c({value:e,language:i},o),s?{theme:s}:{}),r),this.editorDidMount(this.editor))}},{key:"editorWillMount",value:function(){var e=this.props.editorWillMount;return e(n)||{}}},{key:"editorDidMount",value:function(e){var t=this;this.props.editorDidMount(e,n),this._subscription=e.onDidChangeModelContent((function(i){t.__prevent_trigger_change_event||t.props.onChange(e.getValue(),i)}))}},{key:"render",value:function(){var e=this.props,t=e.width,i=e.height,n={width:(0,r.processSize)(t),height:(0,r.processSize)(i)};return o.default.createElement("div",{ref:this.assignRef,style:n,className:"react-monaco-editor-container"})}}])&&g(t.prototype,i),s&&g(t,s),l}(o.default.Component);C.propTypes={width:s.default.oneOfType([s.default.string,s.default.number]),height:s.default.oneOfType([s.default.string,s.default.number]),value:s.default.string,defaultValue:s.default.string,language:s.default.string,theme:s.default.string,options:s.default.object,overrideServices:s.default.object,editorDidMount:s.default.func,editorWillMount:s.default.func,onChange:s.default.func},C.defaultProps={width:"100%",height:"100%",value:null,defaultValue:"",language:"javascript",theme:null,options:{},overrideServices:{},editorDidMount:r.noop,editorWillMount:r.noop,onChange:r.noop};var w=C;t.default=w},k994:function(e,t,i){"use strict";i.r(t);i("SchZ"),i("Aosp"),i("L/Qf")},kLJU:function(e,t,i){},kekF:function(e,t){e.exports=function(e,t){return function(i){return e(t(i))}}},mBeV:function(e,t,i){},mdPL:function(e,t,i){(function(e){var n=i("WFqU"),s=t&&!t.nodeType&&t,o=s&&"object"==typeof e&&e&&!e.nodeType&&e,r=o&&o.exports===s&&n.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(e){}}();e.exports=a}).call(this,i("YuTi")(e))},nRg7:function(e,t,i){},prlp:function(e,t,i){},sEf8:function(e,t){e.exports=function(e){return function(t){return e(t)}}},sJnT:function(e,t,i){},wtJs:function(e,t,i){},"xq//":function(e,t,i){},ya7L:function(e,t,i){},yczy:function(e,t,i){},zZ0H:function(e,t){e.exports=function(e){return e}}}]);