|
|
function n(e){return n="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},n(e)}function o(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(){return s=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},s.apply(this,arguments)}function r(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"===typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter((function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable})))),n.forEach((function(t){o(e,t,i[t])}))}return e}function a(e,t){if(null==e)return{};var i,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(o[i]=e[i]);return o}function l(e,t){if(null==e)return{};var i,n,o=a(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i])}return o}function c(e){return d(e)||h(e)||u()}function d(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}function h(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance")}i.r(t),i.d(t,"MultiDrag",(function(){return Bt})),i.d(t,"Sortable",(function(){return Qe})),i.d(t,"Swap",(function(){return Lt}));var g="1.10.2";function f(e){if("undefined"!==typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var m=f(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),p=f(/Edge/i),_=f(/firefox/i),b=f(/safari/i)&&!f(/chrome/i)&&!f(/android/i),v=f(/iP(ad|od|hone)/i),w=f(/chrome/i)&&f(/android/i),C={capture:!1,passive:!1};function y(e,t,i){e.addEventListener(t,i,!m&&C)}function S(e,t,i){e.removeEventListener(t,i,!m&&C)}function x(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(i){return!1}return!1}}function k(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function L(e,t,i,n){if(e){i=i||document;do{if(null!=t&&(">"===t[0]?e.parentNode===i&&x(e,t):x(e,t))||n&&e===i)return e;if(e===i)break}while(e=k(e))}return null}var E,D=/\s+/g;function N(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(D," ").replace(" "+t+" "," ");e.className=(n+(i?" "+t:"")).replace(D," ")}}function I(e,t,i){var n=e&&e.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),void 0===t?i:i[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=i+("string"===typeof i?"":"px")}}function T(e,t){var i="";if("string"===typeof e)i=e;else do{var n=I(e,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(i)}function M(e,t,i){if(e){var n=e.getElementsByTagName(t),o=0,s=n.length;if(i)for(;o<s;o++)i(n[o],o);return n}return[]}function O(){var e=document.scrollingElement;return e||document.documentElement}function A(e,t,i,n,o){if(e.getBoundingClientRect||e===window){var s,r,a,l,c,d,h;if(e!==window&&e!==O()?(s=e.getBoundingClientRect(),r=s.top,a=s.left,l=s.bottom,c=s.right,d=s.height,h=s.width):(r=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(t||i)&&e!==window&&(o=o||e.parentNode,!m))do{if(o&&o.getBoundingClientRect&&("none"!==I(o,"transform")||i&&"static"!==I(o,"position"))){var u=o.getBoundingClientRect();r-=u.top+parseInt(I(o,"border-top-width")),a-=u.left+parseInt(I(o,"border-left-width")),l=r+s.height,c=a+s.width;break}}while(o=o.parentNode);if(n&&e!==window){var g=T(o||e),f=g&&g.a,p=g&&g.d;g&&(r/=p,a/=f,h/=f,d/=p,l=r+d,c=a+h)}return{top:r,left:a,bottom:l,right:c,width:h,height:d}}}function P(e,t,i){var n=z(e,!0),o=A(e)[t];while(n){var s=A(n)[i],r=void 0;if(r="top"===i||"left"===i?o>=s:o<=s,!r)return n;if(n===O())break;n=z(n,!1)}return!1}function R(e,t,i){var n=0,o=0,s=e.children;while(o<s.length){if("none"!==s[o].style.display&&s[o]!==Qe.ghost&&s[o]!==Qe.dragged&&L(s[o],i.draggable,e,!1)){if(n===t)return s[o];n++}o++}return null}function F(e,t){var i=e.lastElementChild;while(i&&(i===Qe.ghost||"none"===I(i,"display")||t&&!x(i,t)))i=i.previousElementSibling;return i||null}function B(e,t){var i=0;if(!e||!e.parentNode)return-1;while(e=e.previousElementSibling)"TEMPLATE"===e.nodeName.toUpperCase()||e===Qe.clone||t&&!x(e,t)||i++;return i}function W(e){var t=0,i=0,n=O();if(e)do{var o=T(e),s=o.a,r=o.d;t+=e.scrollLeft*s,i+=e.scrollTop*r}while(e!==n&&(e=e.parentNode));return[t,i]}function V(e,t){for(var i in e)if(e.hasOwnProperty(i))for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[i][n])return Number(i);return-1}function z(e,t){if(!e||!e.getBoundingClientRect)return O();var i=e,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var o=I(i);if(i.clientWidth<i.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!i.getBoundingClientRect||i===document.body)return O();if(n||t)return i;n=!0}}}while(i=i.parentNode);return O()}function H(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function K(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function j(e,t){return function(){if(!E){var i=arguments,n=this;1===i.length?e.call(n,i[0]):e.apply(n,i),E=setTimeout((function(){E=void 0}),t)}}}function U(){clearTimeout(E),E=void 0}function $(e,t,i){e.scrollLeft+=t,e.scrollTop+=i}function q(e){var t=window.Polymer,i=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):i?i(e).clone(!0)[0]:e.cloneNode(!0)}function G(e,t){I(e,"position","absolute"),I(e,"top",t.top),I(e,"left",t.left),I(e,"width",t.width),I(e,"height",t.height)}function Y(e){I(e,"position",""),I(e,"top",""),I(e,"left",""),I(e,"width",""),I(e,"height","")}var X="Sortable"+(new Date).getTime();function Z(){var e,t=[];return{captureAnimationState:function(){if(t=[],this.options.animation){var e=[].slice.call(this.el.children);e.forEach((function(e){if("none"!==I(e,"display")&&e!==Qe.ghost){t.push({target:e,rect:A(e)});var i=r({},t[t.length-1].rect);if(e.thisAnimationDuration){var n=T(e,!0);n&&(i.top-=n.f,i.left-=n.e)}e.fromRect=i}}))}},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(V(t,{target:e}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(e),void("function"===typeof i&&i());var o=!1,s=0;t.forEach((function(e){var t=0,i=e.target,r=i.fromRect,a=A(i),l=i.prevFromRect,c=i.prevToRect,d=e.rect,h=T(i,!0);h&&(a.top-=h.f,a.left-=h.e),i.toRect=a,i.thisAnimationDuration&&K(l,a)&&!K(r,a)&&(d.top-a.top)/(d.left-a.left)===(r.top-a.top)/(r.left-a.left)&&(t=J(d,l,c,n.options)),K(a,r)||(i.prevFromRect=r,i.prevToRect=a,t||(t=n.options.animation),n.animate(i,d,a,t)),t&&(o=!0,s=Math.max(s,t),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout((function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null}),t),i.thisAnimationDuration=t)})),clearTimeout(e),o?e=setTimeout((function(){"function"===typeof i&&i()}),s):"function"===typeof i&&i(),t=[]},animate:function(e,t,i,n){if(n){I(e,"transition",""),I(e,"transform","");var o=T(this.el),s=o&&o.a,r=o&&o.d,a=(t.left-i.left)/(s||1),l=(t.top-i.top)/(r||1);e.animatingX=!!a,e.animatingY=!!l,I(e,"transform","translate3d("+a+"px,"+l+"px,0)"),Q(e),I(e,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),I(e,"transform","translate3d(0,0,0)"),"number"===typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){I(e,"transition",""),I(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),n)}}}}function Q(e){return e.offsetWidth}function J(e,t,i,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*n.animation}var ee=[],te={initializeByDefault:!0},ie={mount:function(e){for(var t in te)te.hasOwnProperty(t)&&!(t in e)&&(e[t]=te[t]);ee.push(e)},pluginEvent:function(e,t,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var o=e+"Global";ee.forEach((function(n){t[n.pluginName]&&(t[n.pluginName][o]&&t[n.pluginName][o](r({sortable:t},i)),t.options[n.pluginName]&&t[n.pluginName][e]&&t[n.pluginName][e](r({sortable:t},i)))}))},initializePlugins:function(e,t,i,n){for(var o in ee.forEach((function(n){var o=n.pluginName;if(e.options[o]||n.initializeByDefault){var r=new n(e,t,e.options);r.sortable=e,r.options=e.options,e[o]=r,s(i,r.defaults)}})),e.options)if(e.options.hasOwnProperty(o)){var r=this.modifyOption(e,o,e.options[o]);"undefined"!==typeof r&&(e.options[o]=r)}},getEventProperties:function(e,t){var i={};return ee.forEach((function(n){"function"===typeof n.eventProperties&&s(i,n.eventProperties.call(t[n.pluginName],e))})),i},modifyOption:function(e,t,i){var n;return ee.forEach((function(o){e[o.pluginName]&&o.optionListeners&&"function"===typeof o.optionListeners[t]&&(n=o.optionListeners[t].call(e[o.pluginName],i))})),n}};function ne(e){var t=e.sortable,i=e.rootEl,n=e.name,o=e.targetEl,s=e.cloneEl,a=e.toEl,l=e.fromEl,c=e.oldIndex,d=e.newIndex,h=e.oldDraggableIndex,u=e.newDraggableIndex,g=e.originalEvent,f=e.putSortable,_=e.extraEventProperties;if(t=t||i&&i[X],t){var b,v=t.options,w="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||m||p?(b=document.createEvent("Event"),b.initEvent(n,!0,!0)):b=new CustomEvent(n,{bubbles:!0,cancelable:!0}),b.to=a||i,b.from=l||i,b.item=o||i,b.clone=s,b.oldIndex=c,b.newIndex=d,b.oldDraggableIndex=h,b.newDraggableIndex=u,b.originalEvent=g,b.pullMode=f?f.lastPutMode:void 0;var C=r({},_,ie.getEventProperties(n,t));for(var y in C)b[y]=C[y];i&&i.dispatchEvent(b),v[w]&&v[w].call(t,b)}}var oe=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,o=l(i,["evt"]);ie.pluginEvent.bind(Qe)(e,t,r({dragEl:re,parentEl:ae,ghostEl:le,rootEl:ce,nextEl:de,lastDownEl:he,cloneEl:ue,cloneHidden:ge,dragStarted:Le,putSortable:ve,activeSortable:Qe.active,originalEvent:n,oldIndex:fe,oldDraggableIndex:pe,newIndex:me,newDraggableIndex:_e,hideGhostForTarget:Ge,unhideGhostForTarget:Ye,cloneNowHidden:function(){ge=!0},cloneNowShown:function(){ge=!1},dispatchSortableEvent:function(e){se({sortable:t,name:e,originalEvent:n})}},o))};function se(e){ne(r({putSortable:ve,cloneEl:ue,targetEl:re,rootEl:ce,oldIndex:fe,oldDraggableIndex:pe,newIndex:me,newDraggableIndex:_e},e))}var re,ae,le,ce,de,he,ue,ge,fe,me,pe,_e,be,ve,we,Ce,ye,Se,xe,ke,Le,Ee,De,Ne,Ie,Te=!1,Me=!1,Oe=[],Ae=!1,Pe=!1,Re=[],Fe=!1,Be=[],We="undefined"!==typeof document,Ve=v,ze=p||m?"cssFloat":"float",He=We&&!w&&!v&&"draggable"in document.createElement("div"),Ke=function(){if(We){if(m)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),je=function(e,t){var i=I(e),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=R(e,0,t),s=R(e,1,t),r=o&&I(o),a=s&&I(s),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+A(o).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+A(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&r["float"]&&"none"!==r["float"]){var d="left"===r["float"]?"left":"right";return!s||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return o&&("block"===r.display||"flex"===r.display||"table"===r.display||"grid"===r.display||l>=n&&"none"===i[ze]||s&&"none"===i[ze]&&l+c>n)?"vertical":"horizontal"},Ue=function(e,t,i){var n=i?e.left:e.top,o=i?e.right:e.bottom,s=i?e.width:e.height,r=i?t.left:t.top,a=i?t.right:t.bottom,l=i?t.width:t.height;return n===r||o===a||n+s/2===r+l/2},$e=function(e,t){var i;return Oe.some((function(n){if(!F(n)){var o=A(n),s=n[X].options.emptyInsertThreshold,r=e>=o.left-s&&e<=o.right+s,a=t>=o.top-s&&t<=o.bottom+s;return s&&r&&a?i=n:void 0}})),i},qe=function(e){function t(e,i){return function(n,o,s,r){var a=n.options.group.name&&o.options.group.name&&n.options.group.name===o.options.group.name;if(null==e&&(i||a))return!0;if(null==e||!1===e)return!1;if(i&&"clone"===e)return e;if("function"===typeof e)return t(e(n,o,s,r),i)(n,o,s,r);var l=(i?n:o).options.group.name;return!0===e||"string"===typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var i={},o=e.group;o&&"object"==n(o)||(o={name:o}),i.name=o.name,i.checkPull=t(o.pull,!0),i.checkPut=t(o.put),i.revertClone=o.revertClone,e.group=i},Ge=function(){!Ke&&le&&I(le,"display","none")},Ye=function(){!Ke&&le&&I(le,"display","")};We&&document.addEventListener("click",(function(e){if(Me)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Me=!1,!1}),!0);var Xe=function(e){if(re){e=e.touches?e.touches[0]:e;var t=$e(e.clientX,e.clientY);if(t){var i={};for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);i.target=i.rootEl=t,i.preventDefault=void 0,i.stopPropagation=void 0,t[X]._onDragOver(i)}}},Ze=function(e){re&&re.parentNode[X]._isOutsideThisEl(e.target)};function Qe(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=s({},t),e[X]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return je(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Qe.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var n in ie.initializePlugins(this,e,i),i)!(n in t)&&(t[n]=i[n]);for(var o in qe(t),this)"_"===o.charAt(0)&&"function"===typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!t.forceFallback&&He,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?y(e,"pointerdown",this._onTapStart):(y(e,"mousedown",this._onTapStart),y(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(y(e,"dragover",this),y(e,"dragenter",this)),Oe.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),s(this,Z())}function Je(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function et(e,t,i,n,o,s,r,a){var l,c,d=e[X],h=d.options.onMove;return!window.CustomEvent||m||p?(l=document.createEvent("Event"),l.initEvent("move",!0,!0)):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=i,l.draggedRect=n,l.related=o||t,l.relatedRect=s||A(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),h&&(c=h.call(d,l,r)),c}function tt(e){e.draggable=!1}function it(){Fe=!1}function nt(e,t,i){var n=A(F(i.el,i.options.draggable)),o=10;return t?e.clientX>n.right+o||e.clientX<=n.right&&e.clientY>n.bottom&&e.clientX>=n.left:e.clientX>n.right&&e.clientY>n.top||e.clientX<=n.right&&e.clientY>n.bottom+o}function ot(e,t,i,n,o,s,r,a){var l=n?e.clientY:e.clientX,c=n?i.height:i.width,d=n?i.top:i.left,h=n?i.bottom:i.right,u=!1;if(!r)if(a&&Ne<c*o){if(!Ae&&(1===De?l>d+c*s/2:l<h-c*s/2)&&(Ae=!0),Ae)u=!0;else if(1===De?l<d+Ne:l>h-Ne)return-De}else if(l>d+c*(1-o)/2&&l<h-c*(1-o)/2)return st(t);return u=u||r,u&&(l<d+c*s/2||l>h-c*s/2)?l>d+c/2?1:-1:0}function st(e){return B(re)<B(e)?1:-1}function rt(e){var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,n=0;while(i--)n+=t.charCodeAt(i);return n.toString(36)}function at(e){Be.length=0;var t=e.getElementsByTagName("input"),i=t.length;while(i--){var n=t[i];n.checked&&Be.push(n)}}function lt(e){return setTimeout(e,0)}function ct(e){return clearTimeout(e)}Qe.prototype={constructor:Qe,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Ee=null)},_getDirection:function(e,t){return"function"===typeof this.options.direction?this.options.direction.call(this,e,t,re):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,i=this.el,n=this.options,o=n.preventOnFilter,s=e.type,r=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,a=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||a,c=n.filter;if(at(i),!re&&!(/mousedown|pointerdown/.test(s)&&0!==e.button||n.disabled)&&!l.isContentEditable&&(a=L(a,n.draggable,i,!1),(!a||!a.animated)&&he!==a)){if(fe=B(a),pe=B(a,n.draggable),"function"===typeof c){if(c.call(this,e,a,this))return se({sortable:t,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),oe("filter",t,{evt:e}),void(o&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some((function(n){if(n=L(l,n.trim(),i,!1),n)return se({sortable:t,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),oe("filter",t,{evt:e}),!0})),c))return void(o&&e.cancelable&&e.preventDefault());n.handle&&!L(l,n.handle,i,!1)||this._prepareDragStart(e,r,a)}}},_prepareDragStart:function(e,t,i){var n,o=this,s=o.el,r=o.options,a=s.ownerDocument;if(i&&!re&&i.parentNode===s){var l=A(i);if(ce=s,re=i,ae=re.parentNode,de=re.nextSibling,he=i,be=r.group,Qe.dragged=re,we={target:re,clientX:(t||e).clientX,clientY:(t||e).clientY},xe=we.clientX-l.left,ke=we.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,re.style["will-change"]="all",n=function(){oe("delayEnded",o,{evt:e}),Qe.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!_&&o.nativeDraggable&&(re.draggable=!0),o._triggerDragStart(e,t),se({sortable:o,name:"choose",originalEvent:e}),N(re,r.chosenClass,!0))},r.ignore.split(",").forEach((function(e){M(re,e.trim(),tt)})),y(a,"dragover",Xe),y(a,"mousemove",Xe),y(a,"touchmove",Xe),y(a,"mouseup",o._onDrop),y(a,"touchend",o._onDrop),y(a,"touchcancel",o._onDrop),_&&this.nativeDraggable&&(this.options.touchStartThreshold=4,re.draggable=!0),oe("delayStart",this,{evt:e}),!r.delay||r.delayOnTouchOnly&&!t||this.nativeDraggable&&(p||m))n();else{if(Qe.eventCanceled)return void this._onDrop();y(a,"mouseup",o._disableDelayedDrag),y(a,"touchend",o._disableDelayedDrag),y(a,"touchcancel",o._disableDelayedDrag),y(a,"mousemove",o._delayedDragTouchMoveHandler),y(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&y(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(n,r.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){re&&tt(re),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;S(e,"mouseup",this._disableDelayedDrag),S(e,"touchend",this._disableDelayedDrag),S(e,"touchcancel",this._disableDelayedDrag),S(e,"mousemove",this._delayedDragTouchMoveHandler),S(e,"touchmove",this._delayedDragTouchMoveHandler),S(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?y(document,"pointermove",this._onTouchMove):y(document,t?"touchmove":"mousemove",this._onTouchMove):(y(re,"dragend",this),y(ce,"dragstart",this._onDragStart));try{document.selection?lt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(i){}},_dragStarted:function(e,t){if(Te=!1,ce&&re){oe("dragStarted",this,{evt:t}),this.nativeDraggable&&y(document,"dragover",Ze);var i=this.options;!e&&N(re,i.dragClass,!1),N(re,i.ghostClass,!0),Qe.active=this,e&&this._appendGhost(),se({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Ce){this._lastX=Ce.clientX,this._lastY=Ce.clientY,Ge();var e=document.elementFromPoint(Ce.clientX,Ce.clientY),t=e;while(e&&e.shadowRoot){if(e=e.shadowRoot.elementFromPoint(Ce.clientX,Ce.clientY),e===t)break;t=e}if(re.parentNode[X]._isOutsideThisEl(e),t)do{if(t[X]){var i=void 0;if(i=t[X]._onDragOver({clientX:Ce.clientX,clientY:Ce.clientY,target:e,rootEl:t}),i&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Ye()}},_onTouchMove:function(e){if(we){var t=this.options,i=t.fallbackTolerance,n=t.fallbackOffset,o=e.touches?e.touches[0]:e,s=le&&T(le,!0),r=le&&s&&s.a,a=le&&s&&s.d,l=Ve&&Ie&&W(Ie),c=(o.clientX-we.clientX+n.x)/(r||1)+(l?l[0]-Re[0]:0)/(r||1),d=(o.clientY-we.clientY+n.y)/(a||1)+(l?l[1]-Re[1]:0)/(a||1);if(!Qe.active&&!Te){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<i)return;this._onDragStart(e,!0)}if(le){s?(s.e+=c-(ye||0),s.f+=d-(Se||0)):s={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");I(le,"webkitTransform",h),I(le,"mozTransform",h),I(le,"msTransform",h),I(le,"transform",h),ye=c,Se=d,Ce=o}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!le){var e=this.options.fallbackOnBody?document.body:ce,t=A(re,!0,Ve,!0,e),i=this.options;if(Ve){Ie=e;while("static"===I(Ie,"position")&&"none"===I(Ie,"transform")&&Ie!==document)Ie=Ie.parentNode;Ie!==document.body&&Ie!==document.documentElement?(Ie===document&&(Ie=O()),t.top+=Ie.scrollTop,t.left+=Ie.scrollLeft):Ie=O(),Re=W(Ie)}le=re.cloneNode(!0),N(le,i.ghostClass,!1),N(le,i.fallbackClass,!0),N(le,i.dragClass,!0),I(le,"transition",""),I(le,"transform",""),I(le,"box-sizing","border-box"),I(le,"margin",0),I(le,"top",t.top),I(le,"left",t.left),I(le,"width",t.width),I(le,"height",t.height),I(le,"opacity","0.8"),I(le,"position",Ve?"absolute":"fixed"),I(le,"zIndex","100000"),I(le,"pointerEvents","none"),Qe.ghost=le,e.appendChild(le),I(le,"transform-origin",xe/parseInt(le.style.width)*100+"% "+ke/parseInt(le.style.height)*100+"%")}},_onDragStart:function(e,t){var i=this,n=e.dataTransfer,o=i.options;oe("dragStart",this,{evt:e}),Qe.eventCanceled?this._onDrop():(oe("setupClone",this),Qe.eventCanceled||(ue=q(re),ue.draggable=!1,ue.style["will-change"]="",this._hideClone(),N(ue,this.options.chosenClass,!1),Qe.clone=ue),i.cloneId=lt((function(){oe("clone",i),Qe.eventCanceled||(i.options.removeCloneOnHide||ce.insertBefore(ue,re),i._hideClone(),se({sortable:i,name:"clone"}))})),!t&&N(re,o.dragClass,!0),t?(Me=!0,i._loopId=setInterval(i._emulateDragOver,50)):(S(document,"mouseup",i._onDrop),S(document,"touchend",i._onDrop),S(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",o.setData&&o.setData.call(i,n,re)),y(document,"drop",i),I(re,"transform","translateZ(0)")),Te=!0,i._dragStartId=lt(i._dragStarted.bind(i,t,e)),y(document,"selectstart",i),Le=!0,b&&I(document.body,"user-select","none"))},_onDragOver:function(e){var t,i,n,o,s=this.el,a=e.target,l=this.options,c=l.group,d=Qe.active,h=be===c,u=l.sort,g=ve||d,f=this,m=!1;if(!Fe){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),a=L(a,l.draggable,s,!0),M("dragOver"),Qe.eventCanceled)return m;if(re.contains(e.target)||a.animated&&a.animatingX&&a.animatingY||f._ignoreWhileAnimating===a)return R(!1);if(Me=!1,d&&!l.disabled&&(h?u||(n=!ce.contains(re)):ve===this||(this.lastPutMode=be.checkPull(this,d,re,e))&&c.checkPut(this,d,re,e))){if(o="vertical"===this._getDirection(e,a),t=A(re),M("dragOverValid"),Qe.eventCanceled)return m;if(n)return ae=ce,O(),this._hideClone(),M("revert"),Qe.eventCanceled||(de?ce.insertBefore(re,de):ce.appendChild(re)),R(!0);var p=F(s,l.draggable);if(!p||nt(e,o,this)&&!p.animated){if(p===re)return R(!1);if(p&&s===e.target&&(a=p),a&&(i=A(a)),!1!==et(ce,s,re,t,a,i,e,!!a))return O(),s.appendChild(re),ae=s,W(),R(!0)}else if(a.parentNode===s){i=A(a);var _,b,v=0,w=re.parentNode!==s,C=!Ue(re.animated&&re.toRect||t,a.animated&&a.toRect||i,o),y=o?"top":"left",S=P(a,"top","top")||P(re,"top","top"),x=S?S.scrollTop:void 0;if(Ee!==a&&(_=i[y],Ae=!1,Pe=!C&&l.invertSwap||w),v=ot(e,a,i,o,C?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,Pe,Ee===a),0!==v){var k=B(re);do{k-=v,b=ae.children[k]}while(b&&("none"===I(b,"display")||b===le))}if(0===v||b===a)return R(!1);Ee=a,De=v;var E=a.nextElementSibling,D=!1;D=1===v;var T=et(ce,s,re,t,a,i,e,D);if(!1!==T)return 1!==T&&-1!==T||(D=1===T),Fe=!0,setTimeout(it,30),O(),D&&!E?s.appendChild(re):a.parentNode.insertBefore(re,D?E:a),S&&$(S,0,x-S.scrollTop),ae=re.parentNode,void 0===_||Pe||(Ne=Math.abs(_-A(a)[y])),W(),R(!0)}if(s.contains(re))return R(!1)}return!1}function M(l,c){oe(l,f,r({evt:e,isOwner:h,axis:o?"vertical":"horizontal",revert:n,dragRect:t,targetRect:i,canSort:u,fromSortable:g,target:a,completed:R,onMove:function(i,n){return et(ce,s,re,t,i,A(i),e,n)},changed:W},c))}function O(){M("dragOverAnimationCapture"),f.captureAnimationState(),f!==g&&g.captureAnimationState()}function R(t){return M("dragOverCompleted",{insertion:t}),t&&(h?d._hideClone():d._showClone(f),f!==g&&(N(re,ve?ve.options.ghostClass:d.options.ghostClass,!1),N(re,l.ghostClass,!0)),ve!==f&&f!==Qe.active?ve=f:f===Qe.active&&ve&&(ve=null),g===f&&(f._ignoreWhileAnimating=a),f.animateAll((function(){M("dragOverAnimationComplete"),f._ignoreWhileAnimating=null})),f!==g&&(g.animateAll(),g._ignoreWhileAnimating=null)),(a===re&&!re.animated||a===s&&!a.animated)&&(Ee=null),l.dragoverBubble||e.rootEl||a===document||(re.parentNode[X]._isOutsideThisEl(e.target),!t&&Xe(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function W(){me=B(re),_e=B(re,l.draggable),se({sortable:f,name:"change",toEl:s,newIndex:me,newDraggableIndex:_e,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){S(document,"mousemove",this._onTouchMove),S(document,"touchmove",this._onTouchMove),S(document,"pointermove",this._onTouchMove),S(document,"dragover",Xe),S(document,"mousemove",Xe),S(document,"touchmove",Xe)},_offUpEvents:function(){var e=this.el.ownerDocument;S(e,"mouseup",this._onDrop),S(e,"touchend",this._onDrop),S(e,"pointerup",this._onDrop),S(e,"touchcancel",this._onDrop),S(document,"selectstart",this)},_onDrop:function(e){var t=this.el,i=this.options;me=B(re),_e=B(re,i.draggable),oe("drop",this,{evt:e}),ae=re&&re.parentNode,me=B(re),_e=B(re,i.draggable),Qe.eventCanceled||(Te=!1,Pe=!1,Ae=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ct(this.cloneId),ct(this._dragStartId),this.nativeDraggable&&(S(document,"drop",this),S(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),b&&I(document.body,"user-select",""),I(re,"transform",""),e&&(Le&&(e.cancelable&&e.preventDefault(),!i.dropBubble&&e.stopPropagation()),le&&le.parentNode&&le.parentNode.removeChild(le),(ce===ae||ve&&"clone"!==ve.lastPutMode)&&ue&&ue.parentNode&&ue.parentNode.removeChild(ue),re&&(this.nativeDraggable&&S(re,"dragend",this),tt(re),re.style["will-change"]="",Le&&!Te&&N(re,ve?ve.options.ghostClass:this.options.ghostClass,!1),N(re,this.options.chosenClass,!1),se({sortable:this,name:"unchoose",toEl:ae,newIndex:null,newDraggableIndex:null,originalEvent:e}),ce!==ae?(me>=0&&(se({rootEl:ae,name:"add",toEl:ae,fromEl:ce,originalEvent:e}),se({sortable:this,name:"remove",toEl:ae,originalEvent:e}),se({rootEl:ae,name:"sort",toEl:ae,fromEl:ce,originalEvent:e}),se({sortable:this,name:"sort",toEl:ae,originalEvent:e})),ve&&ve.save()):me!==fe&&me>=0&&(se({sortable:this,name:"update",toEl:ae,originalEvent:e}),se({sortable:this,name:"sort",toEl:ae,originalEvent:e})),Qe.active&&(null!=me&&-1!==me||(me=fe,_e=pe),se({sortable:this,name:"end",toEl:ae,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){oe("nulling",this),ce=re=ae=le=de=ue=he=ge=we=Ce=Le=me=_e=fe=pe=Ee=De=ve=be=Qe.dragged=Qe.ghost=Qe.clone=Qe.active=null,Be.forEach((function(e){e.checked=!0})),Be.length=ye=Se=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":re&&(this._onDragOver(e),Je(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e,t=[],i=this.el.children,n=0,o=i.length,s=this.options;n<o;n++)e=i[n],L(e,s.draggable,this.el,!1)&&t.push(e.getAttribute(s.dataIdAttr)||rt(e));return t},sort:function(e){var t={},i=this.el;this.toArray().forEach((function(e,n){var o=i.children[n];L(o,this.options.draggable,i,!1)&&(t[e]=o)}),this),e.forEach((function(e){t[e]&&(i.removeChild(t[e]),i.appendChild(t[e]))}))},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return L(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var i=this.options;if(void 0===t)return i[e];var n=ie.modifyOption(this,e,t);i[e]="undefined"!==typeof n?n:t,"group"===e&&qe(i)},destroy:function(){oe("destroy",this);var e=this.el;e[X]=null,S(e,"mousedown",this._onTapStart),S(e,"touchstart",this._onTapStart),S(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(S(e,"dragover",this),S(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Oe.splice(Oe.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ge){if(oe("hideClone",this),Qe.eventCanceled)return;I(ue,"display","none"),this.options.removeCloneOnHide&&ue.parentNode&&ue.parentNode.removeChild(ue),ge=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(ge){if(oe("showClone",this),Qe.eventCanceled)return;ce.contains(re)&&!this.options.group.revertClone?ce.insertBefore(ue,re):de?ce.insertBefore(ue,de):ce.appendChild(ue),this.options.group.revertClone&&this.animate(re,ue),I(ue,"display",""),ge=!1}}else this._hideClone()}},We&&y(document,"touchmove",(function(e){(Qe.active||Te)&&e.cancelable&&e.preventDefault()})),Qe.utils={on:y,off:S,css:I,find:M,is:function(e,t){return!!L(e,t,e,!1)},extend:H,throttle:j,closest:L,toggleClass:N,clone:q,index:B,nextTick:lt,cancelNextTick:ct,detectDirection:je,getChild:R},Qe.get=function(e){return e[X]},Qe.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Qe.utils=r({},Qe.utils,e.utils)),ie.mount(e)}))},Qe.create=function(e,t){return new Qe(e,t)},Qe.version=g;var dt,ht,ut,gt,ft,mt,pt=[],_t=!1;function bt(){function e(){for(var e in this.defaults={scroll:!0,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"===typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?y(document,"pointermove",this._handleFallbackAutoScroll):t.touches?y(document,"touchmove",this._handleFallbackAutoScroll):y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?S(document,"dragover",this._handleAutoScroll):(S(document,"pointermove",this._handleFallbackAutoScroll),S(document,"touchmove",this._handleFallbackAutoScroll),S(document,"mousemove",this._handleFallbackAutoScroll)),wt(),vt(),U()},nulling:function(){ft=ht=dt=_t=mt=ut=gt=null,pt.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var i=this,n=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,s=document.elementFromPoint(n,o);if(ft=e,t||p||m||b){yt(e,this.options,s,t);var r=z(s,!0);!_t||mt&&n===ut&&o===gt||(mt&&wt(),mt=setInterval((function(){var s=z(document.elementFromPoint(n,o),!0);s!==r&&(r=s,vt()),yt(e,i.options,s,t)}),10),ut=n,gt=o)}else{if(!this.options.bubbleScroll||z(s,!0)===O())return void vt();yt(e,this.options,z(s,!1),!1)}}},s(e,{pluginName:"scroll",initializeByDefault:!0})}function vt(){pt.forEach((function(e){clearInterval(e.pid)})),pt=[]}function wt(){clearInterval(mt)}var Ct,yt=j((function(e,t,i,n){if(t.scroll){var o,s=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,c=O(),d=!1;ht!==i&&(ht=i,vt(),dt=t.scroll,o=t.scrollFn,!0===dt&&(dt=z(i,!0)));var h=0,u=dt;do{var g=u,f=A(g),m=f.top,p=f.bottom,_=f.left,b=f.right,v=f.width,w=f.height,C=void 0,y=void 0,S=g.scrollWidth,x=g.scrollHeight,k=I(g),L=g.scrollLeft,E=g.scrollTop;g===c?(C=v<S&&("auto"===k.overflowX||"scroll"===k.overflowX||"visible"===k.overflowX),y=w<x&&("auto"===k.overflowY||"scroll"===k.overflowY||"visible"===k.overflowY)):(C=v<S&&("auto"===k.overflowX||"scroll"===k.overflowX),y=w<x&&("auto"===k.overflowY||"scroll"===k.overflowY));var D=C&&(Math.abs(b-s)<=a&&L+v<S)-(Math.abs(_-s)<=a&&!!L),N=y&&(Math.abs(p-r)<=a&&E+w<x)-(Math.abs(m-r)<=a&&!!E);if(!pt[h])for(var T=0;T<=h;T++)pt[T]||(pt[T]={});pt[h].vx==D&&pt[h].vy==N&&pt[h].el===g||(pt[h].el=g,pt[h].vx=D,pt[h].vy=N,clearInterval(pt[h].pid),0==D&&0==N||(d=!0,pt[h].pid=setInterval(function(){n&&0===this.layer&&Qe.active._onTouchMove(ft);var t=pt[this.layer].vy?pt[this.layer].vy*l:0,i=pt[this.layer].vx?pt[this.layer].vx*l:0;"function"===typeof o&&"continue"!==o.call(Qe.dragged.parentNode[X],i,t,e,ft,pt[this.layer].el)||$(pt[this.layer].el,i,t)}.bind({layer:h}),24))),h++}while(t.bubbleScroll&&u!==c&&(u=z(u,!1)));_t=d}}),30),St=function(e){var t=e.originalEvent,i=e.putSortable,n=e.dragEl,o=e.activeSortable,s=e.dispatchSortableEvent,r=e.hideGhostForTarget,a=e.unhideGhostForTarget;if(t){var l=i||o;r();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(s("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function xt(){}function kt(){}function Lt(){function e(){this.defaults={swapClass:"sortable-swap-highlight"}}return e.prototype={dragStart:function(e){var t=e.dragEl;Ct=t},dragOverValid:function(e){var t=e.completed,i=e.target,n=e.onMove,o=e.activeSortable,s=e.changed,r=e.cancel;if(o.options.swap){var a=this.sortable.el,l=this.options;if(i&&i!==a){var c=Ct;!1!==n(i)?(N(i,l.swapClass,!0),Ct=i):Ct=null,c&&c!==Ct&&N(c,l.swapClass,!1)}s(),t(!0),r()}},drop:function(e){var t=e.activeSortable,i=e.putSortable,n=e.dragEl,o=i||this.sortable,s=this.options;Ct&&N(Ct,s.swapClass,!1),Ct&&(s.swap||i&&i.options.swap)&&n!==Ct&&(o.captureAnimationState(),o!==t&&t.captureAnimationState(),Et(n,Ct),o.animateAll(),o!==t&&t.animateAll())},nulling:function(){Ct=null}},s(e,{pluginName:"swap",eventProperties:function(){return{swapItem:Ct}}})}function Et(e,t){var i,n,o=e.parentNode,s=t.parentNode;o&&s&&!o.isEqualNode(t)&&!s.isEqualNode(e)&&(i=B(e),n=B(t),o.isEqualNode(s)&&i<n&&n++,o.insertBefore(t,o.children[i]),s.insertBefore(e,s.children[n]))}xt.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,i=e.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=R(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(t,n):this.sortable.el.appendChild(t),this.sortable.animateAll(),i&&i.animateAll()},drop:St},s(xt,{pluginName:"revertOnSpill"}),kt.prototype={onSpill:function(e){var t=e.dragEl,i=e.putSortable,n=i||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:St},s(kt,{pluginName:"removeOnSpill"});var Dt,Nt,It,Tt,Mt,Ot=[],At=[],Pt=!1,Rt=!1,Ft=!1;function Bt(){function e(e){for(var t in this)"_"===t.charAt(0)&&"function"===typeof this[t]&&(this[t]=this[t].bind(this));e.options.supportPointer?y(document,"pointerup",this._deselectMultiDrag):(y(document,"mouseup",this._deselectMultiDrag),y(document,"touchend",this._deselectMultiDrag)),y(document,"keydown",this._checkKeyDown),y(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(t,i){var n="";Ot.length&&Nt===e?Ot.forEach((function(e,t){n+=(t?", ":"")+e.textContent})):n=i.textContent,t.setData("Text",n)}}}return e.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){var t=e.dragEl;It=t},delayEnded:function(){this.isMultiDrag=~Ot.indexOf(It)},setupClone:function(e){var t=e.sortable,i=e.cancel;if(this.isMultiDrag){for(var n=0;n<Ot.length;n++)At.push(q(Ot[n])),At[n].sortableIndex=Ot[n].sortableIndex,At[n].draggable=!1,At[n].style["will-change"]="",N(At[n],this.options.selectedClass,!1),Ot[n]===It&&N(At[n],this.options.chosenClass,!1);t._hideClone(),i()}},clone:function(e){var t=e.sortable,i=e.rootEl,n=e.dispatchSortableEvent,o=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||Ot.length&&Nt===t&&(Vt(!0,i),n("clone"),o()))},showClone:function(e){var t=e.cloneNowShown,i=e.rootEl,n=e.cancel;this.isMultiDrag&&(Vt(!1,i),At.forEach((function(e){I(e,"display","")})),t(),Mt=!1,n())},hideClone:function(e){var t=this,i=(e.sortable,e.cloneNowHidden),n=e.cancel;this.isMultiDrag&&(At.forEach((function(e){I(e,"display","none"),t.options.removeCloneOnHide&&e.parentNode&&e.parentNode.removeChild(e)})),i(),Mt=!0,n())},dragStartGlobal:function(e){e.sortable;!this.isMultiDrag&&Nt&&Nt.multiDrag._deselectMultiDrag(),Ot.forEach((function(e){e.sortableIndex=B(e)})),Ot=Ot.sort((function(e,t){return e.sortableIndex-t.sortableIndex})),Ft=!0},dragStarted:function(e){var t=this,i=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(i.captureAnimationState(),this.options.animation)){Ot.forEach((function(e){e!==It&&I(e,"position","absolute")}));var n=A(It,!1,!0,!0);Ot.forEach((function(e){e!==It&&G(e,n)})),Rt=!0,Pt=!0}i.animateAll((function(){Rt=!1,Pt=!1,t.options.animation&&Ot.forEach((function(e){Y(e)})),t.options.sort&&zt()}))}},dragOver:function(e){var t=e.target,i=e.completed,n=e.cancel;Rt&&~Ot.indexOf(t)&&(i(!1),n())},revert:function(e){var t=e.fromSortable,i=e.rootEl,n=e.sortable,o=e.dragRect;Ot.length>1&&(Ot.forEach((function(e){n.addAnimationState({target:e,rect:Rt?A(e):o}),Y(e),e.fromRect=o,t.removeAnimationState(e)})),Rt=!1,Wt(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(e){var t=e.sortable,i=e.isOwner,n=e.insertion,o=e.activeSortable,s=e.parentEl,r=e.putSortable,a=this.options;if(n){if(i&&o._hideClone(),Pt=!1,a.animation&&Ot.length>1&&(Rt||!i&&!o.options.sort&&!r)){var l=A(It,!1,!0,!0);Ot.forEach((function(e){e!==It&&(G(e,l),s.appendChild(e))})),Rt=!0}if(!i)if(Rt||zt(),Ot.length>1){var c=Mt;o._showClone(t),o.options.animation&&!Mt&&c&&At.forEach((function(e){o.addAnimationState({target:e,rect:Tt}),e.fromRect=Tt,e.thisAnimationDuration=null}))}else o._showClone(t)}},dragOverAnimationCapture:function(e){var t=e.dragRect,i=e.isOwner,n=e.activeSortable;if(Ot.forEach((function(e){e.thisAnimationDuration=null})),n.options.animation&&!i&&n.multiDrag.isMultiDrag){Tt=s({},t);var o=T(It,!0);Tt.top-=o.f,Tt.left-=o.e}},dragOverAnimationComplete:function(){Rt&&(Rt=!1,zt())},drop:function(e){var t=e.originalEvent,i=e.rootEl,n=e.parentEl,o=e.sortable,s=e.dispatchSortableEvent,r=e.oldIndex,a=e.putSortable,l=a||this.sortable;if(t){var c=this.options,d=n.children;if(!Ft)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),N(It,c.selectedClass,!~Ot.indexOf(It)),~Ot.indexOf(It))Ot.splice(Ot.indexOf(It),1),Dt=null,ne({sortable:o,rootEl:i,name:"deselect",targetEl:It,originalEvt:t});else{if(Ot.push(It),ne({sortable:o,rootEl:i,name:"select",targetEl:It,originalEvt:t}),t.shiftKey&&Dt&&o.el.contains(Dt)){var h,u,g=B(Dt),f=B(It);if(~g&&~f&&g!==f)for(f>g?(u=g,h=f):(u=f,h=g+1);u<h;u++)~Ot.indexOf(d[u])||(N(d[u],c.selectedClass,!0),Ot.push(d[u]),ne({sortable:o,rootEl:i,name:"select",targetEl:d[u],originalEvt:t}))}else Dt=It;Nt=l}if(Ft&&this.isMultiDrag){if((n[X].options.sort||n!==i)&&Ot.length>1){var m=A(It),p=B(It,":not(."+this.options.selectedClass+")");if(!Pt&&c.animation&&(It.thisAnimationDuration=null),l.captureAnimationState(),!Pt&&(c.animation&&(It.fromRect=m,Ot.forEach((function(e){if(e.thisAnimationDuration=null,e!==It){var t=Rt?A(e):m;e.fromRect=t,l.addAnimationState({target:e,rect:t})}}))),zt(),Ot.forEach((function(e){d[p]?n.insertBefore(e,d[p]):n.appendChild(e),p++})),r===B(It))){var _=!1;Ot.forEach((function(e){e.sortableIndex===B(e)||(_=!0)})),_&&s("update")}Ot.forEach((function(e){Y(e)})),l.animateAll()}Nt=l}(i===n||a&&"clone"!==a.lastPutMode)&&At.forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)}))}},nullingGlobal:function(){this.isMultiDrag=Ft=!1,At.length=0},destroyGlobal:function(){this._deselectMultiDrag(),S(document,"pointerup",this._deselectMultiDrag),S(document,"mouseup",this._deselectMultiDrag),S(document,"touchend",this._deselectMultiDrag),S(document,"keydown",this._checkKeyDown),S(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(("undefined"===typeof Ft||!Ft)&&Nt===this.sortable&&(!e||!L(e.target,this.options.draggable,this.sortable.el,!1))&&(!e||0===e.button))while(Ot.length){var t=Ot[0];N(t,this.options.selectedClass,!1),Ot.shift(),ne({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t,originalEvt:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},s(e,{pluginName:"multiDrag",utils:{select:function(e){var t=e.parentNode[X];t&&t.options.multiDrag&&!~Ot.indexOf(e)&&(Nt&&Nt!==t&&(Nt.multiDrag._deselectMultiDrag(),Nt=t),N(e,t.options.selectedClass,!0),Ot.push(e))},deselect:function(e){var t=e.parentNode[X],i=Ot.indexOf(e);t&&t.options.multiDrag&&~i&&(N(e,t.options.selectedClass,!1),Ot.splice(i,1))}},eventProperties:function(){var e=this,t=[],i=[];return Ot.forEach((function(n){var o;t.push({multiDragElement:n,index:n.sortableIndex}),o=Rt&&n!==It?-1:Rt?B(n,":not(."+e.options.selectedClass+")"):B(n),i.push({multiDragElement:n,index:o})})),{items:c(Ot),clones:[].concat(At),oldIndicies:t,newIndicies:i}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),"ctrl"===e?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function Wt(e,t){Ot.forEach((function(i,n){var o=t.children[i.sortableIndex+(e?Number(n):0)];o?t.insertBefore(i,o):t.appendChild(i)}))}function Vt(e,t){At.forEach((function(i,n){var o=t.children[i.sortableIndex+(e?Number(n):0)];o?t.insertBefore(i,o):t.appendChild(i)}))}function zt(){Ot.forEach((function(e){e!==It&&e.parentNode&&e.parentNode.removeChild(e)}))}Qe.mount(new bt),Qe.mount(kt,xt),t["default"]=Qe},7979:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".codicon-wrench-subaction{opacity:.5}@-webkit-keyframes codicon-spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes codicon-spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.codicon-gear.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-notebook-state-executing.codicon-modifier-spin,.codicon-sync.codicon-modifier-spin{-webkit-animation:codicon-spin 1.5s steps(30) infinite;animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{-webkit-animation-duration:1s!important;animation-duration:1s!important;-webkit-animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}",""]),e.exports=t},"7c08":function(e,t,i){var n=i("ce47");e.exports=function(e){return n(e.length)}},"7d86":function(e,t,i){var n=i("e244"),o=i("9564"),s=i("0b05"),r=i("69f1"),a=i("72c7"),l=i("9550"),c=i("35d6"),d=i("32a5").CONFIGURABLE,h=c.get,u=c.enforce,g=String(String).split("String");(e.exports=function(e,t,i,l){var c,h=!!l&&!!l.unsafe,f=!!l&&!!l.enumerable,m=!!l&&!!l.noTargetGet,p=l&&void 0!==l.name?l.name:t;o(i)&&("Symbol("===String(p).slice(0,7)&&(p="["+String(p).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!s(i,"name")||d&&i.name!==p)&&r(i,"name",p),c=u(i),c.source||(c.source=g.join("string"==typeof p?p:""))),e!==n?(h?!m&&e[t]&&(f=!0):delete e[t],f?e[t]=i:r(e,t,i)):f?e[t]=i:a(t,i)})(Function.prototype,"toString",(function(){return o(this)&&h(this).source||l(this)}))},"7e50":function(e,t,i){var n=i("83ec"),o=i("ac97"),s=i("45ad"),r=i("42b1").f,a=i("55ab"),l=o((function(){r(1)})),c=!a||l;n({target:"Object",stat:!0,forced:c,sham:!a},{getOwnPropertyDescriptor:function(e,t){return r(s(e),t)}})},"7eca":function(e,t,i){"use strict";function n(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,(function(e,i){const n=i[0];return"undefined"!==typeof t[n]?t[n]:e})),i}function o(e,t,...i){return n(t,i)}i.r(t),i.d(t,"CancellationTokenSource",(function(){return pK})),i.d(t,"Emitter",(function(){return _K})),i.d(t,"KeyCode",(function(){return bK})),i.d(t,"KeyMod",(function(){return vK})),i.d(t,"Position",(function(){return wK})),i.d(t,"Range",(function(){return CK})),i.d(t,"Selection",(function(){return yK})),i.d(t,"SelectionDirection",(function(){return SK})),i.d(t,"MarkerSeverity",(function(){return xK})),i.d(t,"MarkerTag",(function(){return kK})),i.d(t,"Uri",(function(){return LK})),i.d(t,"Token",(function(){return EK})),i.d(t,"editor",(function(){return DK})),i.d(t,"languages",(function(){return NK}));var s=i("1cb4");const r="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function a(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of r)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}const l=a();function c(e){let t=l;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 d={maxLen:1e3,windowSize:15,timeBudget:150};function h(e,t,i,n,o=d){if(i.length>o.maxLen){let s=e-o.maxLen/2;return s<0?s=0:n+=s,i=i.substring(s,e+o.maxLen/2),h(e,t,i,n,o)}const s=Date.now(),r=e-1-n;let a=-1,l=null;for(let c=1;;c++){if(Date.now()-s>=o.timeBudget)break;const e=r-o.windowSize*c;t.lastIndex=Math.max(0,e);const n=u(t,i,r,a);if(!n&&l)break;if(l=n,e<=0)break;a=e}if(l){let 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 u(e,t,i,n){let o;while(o=e.exec(t)){const t=o.index||0;if(t<=i&&e.lastIndex>=i)return o;if(n>0&&t>n)return null}return null}const g=8;class f{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class m{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class p{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class _{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}compute(e,t,i){return i}}class b{constructor(e,t=null){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0,this.deps=t}validate(e){return this.defaultValue}}class v{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}validate(e){return"undefined"===typeof e?this.defaultValue:e}compute(e,t,i){return i}}function w(e,t){return"undefined"===typeof e?t:"false"!==e&&Boolean(e)}class C extends v{constructor(e,t,i,n){"undefined"!==typeof n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return w(e,this.defaultValue)}}function y(e,t,i,n){if("undefined"===typeof e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),o=Math.min(n,o),0|o)}class S extends v{constructor(e,t,i,n,o,s){"undefined"!==typeof s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}static clampedInt(e,t,i,n){return y(e,t,i,n)}validate(e){return S.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class x extends v{constructor(e,t,i,n,o){"undefined"!==typeof o&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if("number"===typeof e)return e;if("undefined"===typeof e)return t;const i=parseFloat(e);return isNaN(i)?t:i}validate(e){return this.validationFn(x.float(e,this.defaultValue))}}class k extends v{static string(e,t){return"string"!==typeof e?t:e}constructor(e,t,i,n){"undefined"!==typeof n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return k.string(e,this.defaultValue)}}function L(e,t,i){return"string"!==typeof e||-1===i.indexOf(e)?t:e}class E extends v{constructor(e,t,i,n,o){"undefined"!==typeof o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return L(e,this.defaultValue,this._allowedValues)}}class D extends _{constructor(e,t,i,n,o,s,r){"undefined"!==typeof r&&(r.type="string",r.enum=o,r.default=n),super(e,t,i,r),this._allowedValues=o,this._convert=s}validate(e){return"string"!==typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}function N(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class I extends _{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[o("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),o("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled."),o("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:"auto",description:o("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers. Setting to on will disable word wrapping.")})}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}}class T extends _{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(19,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:o("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:o("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:w(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:w(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function M(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var O;function A(e){switch(e){case"line":return O.Line;case"block":return O.Block;case"underline":return O.Underline;case"line-thin":return O.LineThin;case"block-outline":return O.BlockOutline;case"underline-thin":return O.UnderlineThin}}(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"})(O||(O={}));class P extends b{constructor(){super(126,[65,33])}compute(e,t,i){const n=["monaco-editor"];return t.get(33)&&n.push(t.get(33)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(65)?n.push("mouse-default"):"copy"===t.get(65)&&n.push("mouse-copy"),t.get(99)&&n.push("showUnused"),t.get(124)&&n.push("showDeprecated"),n.join(" ")}}class R extends C{constructor(){super(32,"emptySelectionClipboard",!0,{description:o("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class F extends _{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(35,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:o("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:[o("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),o("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),o("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:o("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:[o("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),o("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),o("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:o("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:o("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:s["f"]},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:o("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:o("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:w(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:"boolean"===typeof e.seedSearchStringFromSelection?e.seedSearchStringFromSelection?"always":"never":L(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"===typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":L(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:w(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:w(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:w(t.loop,this.defaultValue.loop)}}}class B extends _{constructor(){super(44,"fontLigatures",B.OFF,{anyOf:[{type:"boolean",description:o("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:o("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:o("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"undefined"===typeof e?this.defaultValue:"string"===typeof e?"false"===e?B.OFF:"true"===e?B.ON:e:Boolean(e)?B.ON:B.OFF}}B.OFF='"liga" off, "calt" off',B.ON='"liga" on, "calt" on';class W extends b{constructor(){super(43)}compute(e,t,i){return e.fontInfo}}class V extends v{constructor(){super(45,"fontSize",_e.fontSize,{type:"number",minimum:6,maximum:100,default:_e.fontSize,description:o("fontSize","Controls the font size in pixels.")})}validate(e){let t=x.float(e,this.defaultValue);return 0===t?_e.fontSize:x.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class z extends _{constructor(){super(46,"fontWeight",_e.fontWeight,{anyOf:[{type:"number",minimum:z.MINIMUM_VALUE,maximum:z.MAXIMUM_VALUE,errorMessage:o("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:z.SUGGESTION_VALUES}],default:_e.fontWeight,description:o("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(S.clampedInt(e,_e.fontWeight,z.MINIMUM_VALUE,z.MAXIMUM_VALUE))}}z.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],z.MINIMUM_VALUE=1,z.MAXIMUM_VALUE=1e3;class H extends _{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:[o("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),o("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),o("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(50,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:o("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":Object.assign({description:o("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:o("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:o("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:o("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:o("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:o("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:o("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:o("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:o("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:o("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,o,s;if(!e||"object"!==typeof e)return this.defaultValue;const r=e;return{multiple:L(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:L(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:L(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:L(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=r.multipleImplementations)&&void 0!==o?o:L(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(s=r.multipleReferences)&&void 0!==s?s:L(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:k.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:k.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:k.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:k.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:k.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class K extends _{constructor(){const e={enabled:!0,delay:300,sticky:!0,above:!0};super(52,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:o("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,description:o("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:o("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.above":{type:"boolean",default:e.above,description:o("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:w(t.enabled,this.defaultValue.enabled),delay:S.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:w(t.sticky,this.defaultValue.sticky),above:w(t.above,this.defaultValue.above)}}}class j extends b{constructor(){super(129,[49,57,37,64,91,59,60,93,116,119,120,121,2])}compute(e,t,i){return j.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})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=e.scrollBeyondLastLine?t-1:0,n=(e.viewLineCount+i)/(e.pixelRatio*e.height),o=Math.floor(e.viewLineCount/n);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:i,desiredRatio:n,minimapLineCount:o}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,o=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(o*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const s=t.stableMinimapLayoutInput,r=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=o>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,f=e.minimap.size,m=e.minimap.side,p=e.verticalScrollbarWidth,_=e.viewLineCount,b=e.remainingWidth,v=e.isViewportWrapping,w=d?2:3;let C=Math.floor(o*n);const y=C/o;let S=!1,x=!1,k=w*h,L=h/o,E=1;if("fill"===f||"fit"===f){const{typicalViewportLineCount:i,extraLinesBeyondLastLine:s,desiredRatio:l,minimapLineCount:d}=j.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,height:n,lineHeight:a,pixelRatio:o}),u=_/d;if(u>1)S=!0,x=!0,h=1,k=1,L=h/o;else{let n=!1,c=h+1;if("fit"===f){const e=Math.ceil((_+s)*k);v&&r&&b<=t.stableFitRemainingWidth?(n=!0,c=t.stableFitMaxMinimapScale):n=e>C}if("fill"===f||n){S=!0;const n=h;k=Math.min(a*o,Math.max(1,Math.floor(1/l))),v&&r&&b<=t.stableFitRemainingWidth&&(c=t.stableFitMaxMinimapScale),h=Math.min(c,Math.max(1,Math.floor(k/w))),h>n&&(E=Math.min(2,h/n)),L=h/o/E,C=Math.ceil(Math.max(i,_+s)*k),v?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const D=Math.floor(u*L),N=Math.min(D,Math.max(0,Math.floor((b-p-2)*L/(l+L)))+g);let I=Math.floor(o*N);const T=I/o;I=Math.floor(I*E);const M=d?1:2,O="left"===m?0:i-N-p;return{renderMinimap:M,minimapLeft:O,minimapWidth:N,minimapHeightIsEditorHeight:S,minimapIsSampling:x,minimapScale:h,minimapLineHeight:k,minimapCanvasInnerWidth:I,minimapCanvasInnerHeight:C,minimapCanvasOuterWidth:T,minimapCanvasOuterHeight:y}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,o=0|t.lineHeight,s=0|t.lineNumbersDigitCount,r=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,c=t.viewLineCount,d=e.get(121),h="inherit"===d?e.get(120):d,u="inherit"===h?e.get(116):h,g=e.get(119),f=e.get(2),m=t.isDominatedByLongLines,_=e.get(49),b=0!==e.get(59).renderType,v=e.get(60),w=e.get(93),C=e.get(64),y=e.get(91),x=y.verticalScrollbarSize,k=y.verticalHasArrows,L=y.arrowSize,E=y.horizontalScrollbarSize,D=e.get(57),N=e.get(37);let I;if("string"===typeof D&&/^\d+(\.\d+)?ch$/.test(D)){const e=parseFloat(D.substr(0,D.length-2));I=S.clampedInt(e*r,0,0,1e3)}else I=S.clampedInt(D,0,0,1e3);N&&(I+=16);let T=0;if(b){const e=Math.max(s,v);T=Math.round(e*a)}let M=0;_&&(M=o);let O=0,A=O+M,P=A+T,R=P+I;const F=i-M-T-I;let B=!1,W=!1,V=-1;2!==f&&("inherit"===h&&m?(B=!0,W=!0):"on"===u||"bounded"===u?W=!0:"wordWrapColumn"===u&&(V=g));const z=j._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:w,minimap:C,verticalScrollbarWidth:x,viewLineCount:c,remainingWidth:F,isViewportWrapping:W},t.memory||new p);0!==z.renderMinimap&&0===z.minimapLeft&&(O+=z.minimapWidth,A+=z.minimapWidth,P+=z.minimapWidth,R+=z.minimapWidth);const H=F-z.minimapWidth,K=Math.max(1,Math.floor((H-x-2)/r)),U=k?L:0;return W&&(V=Math.max(1,K),"bounded"===u&&(V=Math.min(V,g))),{width:i,height:n,glyphMarginLeft:O,glyphMarginWidth:M,lineNumbersLeft:A,lineNumbersWidth:T,decorationsLeft:P,decorationsWidth:I,contentLeft:R,contentWidth:H,minimap:z,viewportColumn:K,isWordWrapMinified:B,isViewportWrapping:W,wrappingColumn:V,verticalScrollbarWidth:x,horizontalScrollbarHeight:E,overviewRuler:{top:U,width:x,height:n-2*U,right:0}}}}class U extends _{constructor(){const e={enabled:!0};super(56,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:o("codeActions","Enables the code action lightbulb in the editor.")}})}validate(e){if(!e||"object"!==typeof e)return this.defaultValue;const t=e;return{enabled:w(t.enabled,this.defaultValue.enabled)}}}class $ extends _{constructor(){const e={enabled:!0,fontSize:0,fontFamily:""};super(125,"inlayHints",e,{"editor.inlayHints.enabled":{type:"boolean",default:e.enabled,description:o("inlayHints.enable","Enables the inlay hints in the editor.")},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:o("inlayHints.fontSize","Controls font size of inlay hints in the editor. A default of 90% of `#editor.fontSize#` is used when the configured value is less than `5` or greater than the editor font size.")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:o("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the `#editor.fontFamily#` is used.")}})}validate(e){if(!e||"object"!==typeof e)return this.defaultValue;const t=e;return{enabled:w(t.enabled,this.defaultValue.enabled),fontSize:S.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:k.string(t.fontFamily,this.defaultValue.fontFamily)}}}class q extends x{constructor(){super(58,"lineHeight",_e.lineHeight,e=>x.clamp(e,0,150),{markdownDescription:o("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}}class G extends _{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(64,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:o("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[o("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),o("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),o("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:o("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:o("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:o("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:o("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:o("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:o("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:w(t.enabled,this.defaultValue.enabled),size:L(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:L(t.side,this.defaultValue.side,["right","left"]),showSlider:L(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:w(t.renderCharacters,this.defaultValue.renderCharacters),scale:S.clampedInt(t.scale,1,1,3),maxColumn:S.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function Y(e){return"ctrlCmd"===e?s["f"]?"metaKey":"ctrlKey":"altKey"}class X extends _{constructor(){super(74,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:o("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:o("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:S.clampedInt(t.top,0,0,1e3),bottom:S.clampedInt(t.bottom,0,0,1e3)}}}class Z extends _{constructor(){const e={enabled:!0,cycle:!1};super(75,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:o("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:o("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:w(t.enabled,this.defaultValue.enabled),cycle:w(t.cycle,this.defaultValue.cycle)}}}class Q extends b{constructor(){super(127)}compute(e,t,i){return e.pixelRatio}}class J extends _{constructor(){const e={other:!0,comments:!1,strings:!1};super(78,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:o("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:e.comments,description:o("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{type:"boolean",default:e.other,description:o("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}}}],default:e,description:o("quickSuggestions","Controls whether suggestions should automatically show up while typing.")}),this.defaultValue=e}validate(e){if("boolean"===typeof e)return e;if(e&&"object"===typeof e){const t=e,i={other:w(t.other,this.defaultValue.other),comments:w(t.comments,this.defaultValue.comments),strings:w(t.strings,this.defaultValue.strings)};return!!(i.other&&i.comments&&i.strings)||!!(i.other||i.comments||i.strings)&&i}return this.defaultValue}}class ee extends _{constructor(){super(59,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[o("lineNumbers.off","Line numbers are not rendered."),o("lineNumbers.on","Line numbers are rendered as absolute number."),o("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),o("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:o("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return"undefined"!==typeof e&&("function"===typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}function te(e){const t=e.get(86);return"editable"===t?e.get(80):"on"!==t}class ie extends _{constructor(){const e=[],t={type:"number",description:o("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(90,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:o("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:o("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)){let t=[];for(let i of e)if("number"===typeof i)t.push({column:S.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"===typeof i){const e=i;t.push({column:S.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}}function ne(e,t){if("string"!==typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}class oe extends _{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};super(91,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[o("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),o("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),o("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:o("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[o("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),o("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),o("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:o("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:o("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:o("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:o("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||"object"!==typeof e)return this.defaultValue;const t=e,i=S.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=S.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:S.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:ne(t.vertical,this.defaultValue.vertical),horizontal:ne(t.horizontal,this.defaultValue.horizontal),useShadows:w(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:w(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:w(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:w(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:w(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:S.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:S.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:w(t.scrollByPage,this.defaultValue.scrollByPage)}}}class se extends _{constructor(){const e={enabled:!0,mode:"subwordSmart"};super(54,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:o("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")}})}validate(e){if(!e||"object"!==typeof e)return this.defaultValue;const t=e;return{enabled:w(t.enabled,this.defaultValue.enabled),mode:L(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"])}}}class re extends _{constructor(){const e={enabled:be.bracketPairColorizationOptions.enabled};super(12,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,description:o("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use 'workbench.colorCustomizations' to override the bracket highlight colors.")}})}validate(e){if(!e||"object"!==typeof e)return this.defaultValue;const t=e;return{enabled:w(t.enabled,this.defaultValue.enabled)}}}class ae extends _{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(13,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[o("editor.guides.bracketPairs.true","Enables bracket pair guides."),o("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),o("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:o("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[o("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),o("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),o("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:o("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:o("editor.guides.highlightActiveBracketPair","Controls whether bracket pair guides are enabled or not.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:o("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:"boolean",default:e.highlightActiveIndentation,description:o("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:le(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:le(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:w(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:w(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:w(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation)}}}function le(e,t,i){const n=i.indexOf(e);return-1===n?t:i[n]}class ce extends _{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!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(105,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[o("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),o("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:o("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:o("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:o("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:o("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:o("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:o("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:o("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:o("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:o("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:o("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:o("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:o("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!==typeof e)return this.defaultValue;const t=e;return{insertMode:L(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:w(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:w(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:w(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:w(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:w(t.showIcons,this.defaultValue.showIcons),showStatusBar:w(t.showStatusBar,this.defaultValue.showStatusBar),preview:w(t.preview,this.defaultValue.preview),previewMode:L(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:w(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:w(t.showMethods,this.defaultValue.showMethods),showFunctions:w(t.showFunctions,this.defaultValue.showFunctions),showConstructors:w(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:w(t.showDeprecated,this.defaultValue.showDeprecated),showFields:w(t.showFields,this.defaultValue.showFields),showVariables:w(t.showVariables,this.defaultValue.showVariables),showClasses:w(t.showClasses,this.defaultValue.showClasses),showStructs:w(t.showStructs,this.defaultValue.showStructs),showInterfaces:w(t.showInterfaces,this.defaultValue.showInterfaces),showModules:w(t.showModules,this.defaultValue.showModules),showProperties:w(t.showProperties,this.defaultValue.showProperties),showEvents:w(t.showEvents,this.defaultValue.showEvents),showOperators:w(t.showOperators,this.defaultValue.showOperators),showUnits:w(t.showUnits,this.defaultValue.showUnits),showValues:w(t.showValues,this.defaultValue.showValues),showConstants:w(t.showConstants,this.defaultValue.showConstants),showEnums:w(t.showEnums,this.defaultValue.showEnums),showEnumMembers:w(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:w(t.showKeywords,this.defaultValue.showKeywords),showWords:w(t.showWords,this.defaultValue.showWords),showColors:w(t.showColors,this.defaultValue.showColors),showFiles:w(t.showFiles,this.defaultValue.showFiles),showReferences:w(t.showReferences,this.defaultValue.showReferences),showFolders:w(t.showFolders,this.defaultValue.showFolders),showTypeParameters:w(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:w(t.showSnippets,this.defaultValue.showSnippets),showUsers:w(t.showUsers,this.defaultValue.showUsers),showIssues:w(t.showIssues,this.defaultValue.showIssues)}}}class de extends _{constructor(){super(101,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:o("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"===typeof e?{selectLeadingAndTrailingWhitespace:w(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}:this.defaultValue}}class he extends b{constructor(){super(128,[80])}compute(e,t,i){const n=t.get(80);return!!n||e.tabFocusMode}}function ue(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}class ge extends b{constructor(){super(130,[129])}compute(e,t,i){const n=t.get(129);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}const fe="Consolas, 'Courier New', monospace",me="Menlo, Monaco, 'Courier New', monospace",pe="'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",_e={fontFamily:s["f"]?me:s["d"]?pe:fe,fontWeight:"normal",fontSize:s["f"]?12:14,lineHeight:0,letterSpacing:0},be={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!1}},ve=[];function we(e){return ve[e.id]=e,e}const Ce={acceptSuggestionOnCommitCharacter:we(new C(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:o("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:we(new E(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",o("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:o("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:we(new I),accessibilityPageSize:we(new S(3,"accessibilityPageSize",10,1,1073741824,{description:o("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.")})),ariaLabel:we(new k(4,"ariaLabel",o("editorViewAccessibleLabel","Editor content"))),autoClosingBrackets:we(new E(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",o("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),o("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:o("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingDelete:we(new E(6,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",o("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:o("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:we(new E(7,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",o("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:o("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:we(new E(8,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",o("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),o("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:o("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:we(new D(9,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],N,{enumDescriptions:[o("editor.autoIndent.none","The editor will not insert indentation automatically."),o("editor.autoIndent.keep","The editor will keep the current line's indentation."),o("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),o("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),o("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:o("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:we(new C(10,"automaticLayout",!1)),autoSurround:we(new E(11,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[o("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),o("editor.autoSurround.quotes","Surround with quotes but not brackets."),o("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:o("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:we(new re),bracketPairGuides:we(new ae),stickyTabStops:we(new C(103,"stickyTabStops",!1,{description:o("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:we(new C(14,"codeLens",!0,{description:o("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:we(new k(15,"codeLensFontFamily","",{description:o("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:we(new S(16,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:o("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to `0`, the 90% of `#editor.fontSize#` is used.")})),colorDecorators:we(new C(17,"colorDecorators",!0,{description:o("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),columnSelection:we(new C(18,"columnSelection",!1,{description:o("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:we(new T),contextmenu:we(new C(20,"contextmenu",!0)),copyWithSyntaxHighlighting:we(new C(21,"copyWithSyntaxHighlighting",!0,{description:o("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:we(new D(22,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],M,{description:o("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:we(new C(23,"cursorSmoothCaretAnimation",!1,{description:o("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:we(new D(24,"cursorStyle",O.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],A,{description:o("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:we(new S(25,"cursorSurroundingLines",0,0,1073741824,{description:o("cursorSurroundingLines","Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:we(new E(26,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[o("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),o("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],description:o("cursorSurroundingLinesStyle","Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:we(new S(27,"cursorWidth",0,0,1073741824,{markdownDescription:o("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:we(new C(28,"disableLayerHinting",!1)),disableMonospaceOptimizations:we(new C(29,"disableMonospaceOptimizations",!1)),domReadOnly:we(new C(30,"domReadOnly",!1)),dragAndDrop:we(new C(31,"dragAndDrop",!0,{description:o("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:we(new R),extraEditorClassName:we(new k(33,"extraEditorClassName","")),fastScrollSensitivity:we(new x(34,"fastScrollSensitivity",5,e=>e<=0?5:e,{markdownDescription:o("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:we(new F),fixedOverflowWidgets:we(new C(36,"fixedOverflowWidgets",!1)),folding:we(new C(37,"folding",!0,{description:o("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:we(new E(38,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[o("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),o("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:o("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:we(new C(39,"foldingHighlight",!0,{description:o("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:we(new C(40,"foldingImportsByDefault",!1,{description:o("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),unfoldOnClickAfterEndOfLine:we(new C(41,"unfoldOnClickAfterEndOfLine",!1,{description:o("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:we(new k(42,"fontFamily",_e.fontFamily,{description:o("fontFamily","Controls the font family.")})),fontInfo:we(new W),fontLigatures2:we(new B),fontSize:we(new V),fontWeight:we(new z),formatOnPaste:we(new C(47,"formatOnPaste",!1,{description:o("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:we(new C(48,"formatOnType",!1,{description:o("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:we(new C(49,"glyphMargin",!0,{description:o("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:we(new H),hideCursorInOverviewRuler:we(new C(51,"hideCursorInOverviewRuler",!1,{description:o("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:we(new K),inDiffEditor:we(new C(53,"inDiffEditor",!1)),letterSpacing:we(new x(55,"letterSpacing",_e.letterSpacing,e=>x.clamp(e,-5,20),{description:o("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:we(new U),lineDecorationsWidth:we(new v(57,"lineDecorationsWidth",10)),lineHeight:we(new q),lineNumbers:we(new ee),lineNumbersMinChars:we(new S(60,"lineNumbersMinChars",5,1,300)),linkedEditing:we(new C(61,"linkedEditing",!1,{description:o("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.")})),links:we(new C(62,"links",!0,{description:o("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:we(new E(63,"matchBrackets","always",["always","near","never"],{description:o("matchBrackets","Highlight matching brackets.")})),minimap:we(new G),mouseStyle:we(new E(65,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:we(new x(66,"mouseWheelScrollSensitivity",1,e=>0===e?1:e,{markdownDescription:o("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:we(new C(67,"mouseWheelZoom",!1,{markdownDescription:o("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:we(new C(68,"multiCursorMergeOverlapping",!0,{description:o("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:we(new D(69,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],Y,{markdownEnumDescriptions:[o("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),o("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:o({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. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:we(new E(70,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[o("multiCursorPaste.spread","Each cursor pastes a single line of the text."),o("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:o("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),occurrencesHighlight:we(new C(71,"occurrencesHighlight",!0,{description:o("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:we(new C(72,"overviewRulerBorder",!0,{description:o("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:we(new S(73,"overviewRulerLanes",3,0,3)),padding:we(new X),parameterHints:we(new Z),peekWidgetDefaultFocus:we(new E(76,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[o("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),o("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:o("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:we(new C(77,"definitionLinkOpensInPeek",!1,{description:o("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:we(new J),quickSuggestionsDelay:we(new S(79,"quickSuggestionsDelay",10,0,1073741824,{description:o("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:we(new C(80,"readOnly",!1)),renameOnType:we(new C(81,"renameOnType",!1,{description:o("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:o("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:we(new C(82,"renderControlCharacters",!0,{description:o("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:we(new C(83,"renderFinalNewline",!0,{description:o("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:we(new E(84,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",o("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:o("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:we(new C(85,"renderLineHighlightOnlyWhenFocus",!1,{description:o("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:we(new E(86,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:we(new E(87,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",o("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),o("renderWhitespace.selection","Render whitespace characters only on selected text."),o("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:o("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:we(new S(88,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:we(new C(89,"roundedSelection",!0,{description:o("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:we(new ie),scrollbar:we(new oe),scrollBeyondLastColumn:we(new S(92,"scrollBeyondLastColumn",5,0,1073741824,{description:o("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:we(new C(93,"scrollBeyondLastLine",!0,{description:o("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:we(new C(94,"scrollPredominantAxis",!0,{description:o("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:we(new C(95,"selectionClipboard",!0,{description:o("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:s["d"]})),selectionHighlight:we(new C(96,"selectionHighlight",!0,{description:o("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:we(new C(97,"selectOnLineNumbers",!0)),showFoldingControls:we(new E(98,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[o("showFoldingControls.always","Always show the folding controls."),o("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:o("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:we(new C(99,"showUnused",!0,{description:o("showUnused","Controls fading out of unused code.")})),showDeprecated:we(new C(124,"showDeprecated",!0,{description:o("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:we(new $),snippetSuggestions:we(new E(100,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[o("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),o("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),o("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),o("snippetSuggestions.none","Do not show snippet suggestions.")],description:o("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:we(new de),smoothScrolling:we(new C(102,"smoothScrolling",!1,{description:o("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:we(new S(104,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:we(new ce),inlineSuggest:we(new se),suggestFontSize:we(new S(106,"suggestFontSize",0,0,1e3,{markdownDescription:o("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")})),suggestLineHeight:we(new S(107,"suggestLineHeight",0,0,1e3,{markdownDescription:o("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.")})),suggestOnTriggerCharacters:we(new C(108,"suggestOnTriggerCharacters",!0,{description:o("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:we(new E(109,"suggestSelection","recentlyUsed",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[o("suggestSelection.first","Always select the first suggestion."),o("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),o("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:o("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:we(new E(110,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[o("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),o("tabCompletion.off","Disable tab completions."),o("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:o("tabCompletion","Enables tab completions.")})),tabIndex:we(new S(111,"tabIndex",0,-1,1073741824)),unusualLineTerminators:we(new E(112,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[o("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),o("unusualLineTerminators.off","Unusual line terminators are ignored."),o("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:o("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:we(new C(113,"useShadowDOM",!0)),useTabStops:we(new C(114,"useTabStops",!0,{description:o("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordSeparators:we(new k(115,"wordSeparators",r,{description:o("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:we(new E(116,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[o("wordWrap.off","Lines will never wrap."),o("wordWrap.on","Lines will wrap at the viewport width."),o({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),o({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:o({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:we(new k(117,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:we(new k(118,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:we(new S(119,"wordWrapColumn",80,1,1073741824,{markdownDescription:o({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:we(new E(120,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:we(new E(121,"wordWrapOverride2","inherit",["off","on","inherit"])),wrappingIndent:we(new D(122,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],ue,{enumDescriptions:[o("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),o("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),o("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),o("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:o("wrappingIndent","Controls the indentation of wrapped lines.")})),wrappingStrategy:we(new E(123,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[o("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."),o("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.")],description:o("wrappingStrategy","Controls the algorithm that computes wrapping points.")})),editorClassName:we(new P),pixelRatio:we(new Q),tabFocusMode:we(new he),layoutInfo:we(new j),wrappingInfo:we(new ge)};class ye{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{if(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)}}const Se=new ye;function xe(e){De(e)||Se.onUnexpectedError(e)}function ke(e){De(e)||Se.onUnexpectedExternalError(e)}function Le(e){if(e instanceof Error){let{name:t,message:i}=e;const n=e.stacktrace||e.stack;return{$isError:!0,name:t,message:i,stack:n}}return e}const Ee="Canceled";function De(e){return e instanceof Error&&e.name===Ee&&e.message===Ee}function Ne(){const e=new Error(Ee);return e.name=e.message,e}function Ie(e){return e?new Error("Illegal argument: "+e):new Error("Illegal argument")}function Te(e){return e?new Error("Illegal state: "+e):new Error("Illegal state")}class Me extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}function Oe(e){const t=this;let i,n=!1;return function(){return n||(n=!0,i=e.apply(t,arguments)),i}}var Ae;(function(e){function t(e){return e&&"object"===typeof e&&"function"===typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function n(){return i}function*o(e){yield e}function s(e){return e||i}function r(e){return!e||!0===e[Symbol.iterator]().next().done}function a(e){return e[Symbol.iterator]().next().value}function l(e,t){for(const i of e)if(t(i))return!0;return!1}function c(e,t){for(const i of e)if(t(i))return i}function*d(e,t){for(const i of e)t(i)&&(yield i)}function*h(e,t){let i=0;for(const n of e)yield t(n,i++)}function*u(...e){for(const t of e)for(const e of t)yield e}function*g(e){for(const t of e)for(const e of t)yield e}function f(e,t,i){let n=i;for(const o of e)n=t(n,o);return n}function*m(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]}function p(t,i=Number.POSITIVE_INFINITY){const n=[];if(0===i)return[n,t];const o=t[Symbol.iterator]();for(let s=0;s<i;s++){const t=o.next();if(t.done)return[n,e.empty()];n.push(t.value)}return[n,{[Symbol.iterator](){return o}}]}function _(e,t,i=((e,t)=>e===t)){const n=e[Symbol.iterator](),o=t[Symbol.iterator]();while(1){const e=n.next(),t=o.next();if(e.done!==t.done)return!1;if(e.done)return!0;if(!i(e.value,t.value))return!1}}e.empty=n,e.single=o,e.from=s,e.isEmpty=r,e.first=a,e.some=l,e.find=c,e.filter=d,e.map=h,e.concat=u,e.concatNested=g,e.reduce=f,e.slice=m,e.consume=p,e.equals=_})(Ae||(Ae={}));const Pe=!1;let Re=null;function Fe(e){Re=e}if(Pe){const e="__is_disposable_tracked__";Fe(new class{trackDisposable(t){const i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==Ye.None)try{t[e]=!0}catch(n){}}markAsDisposed(t){if(t&&t!==Ye.None)try{t[e]=!0}catch(i){}}markAsSingleton(e){}})}function Be(e){return null===Re||void 0===Re||Re.trackDisposable(e),e}function We(e){null===Re||void 0===Re||Re.markAsDisposed(e)}function Ve(e,t){null===Re||void 0===Re||Re.setParent(e,t)}function ze(e,t){if(Re)for(const i of e)Re.setParent(i,t)}function He(e){return null===Re||void 0===Re||Re.markAsSingleton(e),e}class Ke extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function je(e){return"function"===typeof e.dispose&&0===e.dispose.length}function Ue(e){if(Ae.is(e)){let i=[];for(const n of e)if(n)try{n.dispose()}catch(t){i.push(t)}if(1===i.length)throw i[0];if(i.length>1)throw new Ke(i);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function $e(...e){const t=qe(()=>Ue(e));return ze(e,t),t}function qe(e){const t=Be({dispose:Oe(()=>{We(t),e()})});return t}class Ge{constructor(){this._toDispose=new Set,this._isDisposed=!1,Be(this)}dispose(){this._isDisposed||(We(this),this._isDisposed=!0,this.clear())}clear(){try{Ue(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return Ve(e,this),this._isDisposed?Ge.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}}Ge.DISABLE_DISPOSED_WARNING=!1;class Ye{constructor(){this._store=new Ge,Be(this),Ve(this._store,this)}dispose(){We(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}Ye.None=Object.freeze({dispose(){}});class Xe{constructor(){this._isDisposed=!1,Be(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&&Ve(e,this),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,We(this),null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}clearAndLeak(){const e=this._value;return this._value=void 0,e&&Ve(e,null),e}}class Ze{constructor(e){this.object=e}dispose(){}}class Qe{constructor(e){this.element=e,this.next=Qe.Undefined,this.prev=Qe.Undefined}}Qe.Undefined=new Qe(void 0);class Je{constructor(){this._first=Qe.Undefined,this._last=Qe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Qe.Undefined}clear(){let e=this._first;while(e!==Qe.Undefined){const t=e.next;e.prev=Qe.Undefined,e.next=Qe.Undefined,e=t}this._first=Qe.Undefined,this._last=Qe.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new Qe(e);if(this._first===Qe.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!==Qe.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Qe.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Qe.Undefined&&e.next!==Qe.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Qe.Undefined&&e.next===Qe.Undefined?(this._first=Qe.Undefined,this._last=Qe.Undefined):e.next===Qe.Undefined?(this._last=this._last.prev,this._last.next=Qe.Undefined):e.prev===Qe.Undefined&&(this._first=this._first.next,this._first.prev=Qe.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;while(e!==Qe.Undefined)yield e.element,e=e.next}}const et=s["b"].performance&&"function"===typeof s["b"].performance.now;class tt{constructor(e){this._highResolution=et&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new tt(e)}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?s["b"].performance.now():Date.now()}}var it;(function(e){function t(e){return(t,i=null,n)=>{let o,s=!1;return o=e(e=>{if(!s)return o?o.dispose():s=!0,t.call(i,e)},null,n),s&&o.dispose(),o}}function i(e,t){return l((i,n=null,o)=>e(e=>i.call(n,t(e)),null,o))}function n(e,t){return l((i,n=null,o)=>e(e=>{t(e),i.call(n,e)},null,o))}function o(e,t){return l((i,n=null,o)=>e(e=>t(e)&&i.call(n,e),null,o))}function s(e){return e}function r(...e){return(t,i=null,n)=>$e(...e.map(e=>e(e=>t.call(i,e),null,n)))}function a(e,t,n){let o=n;return i(e,e=>(o=t(o,e),o))}function l(e){let t;const i=new rt({onFirstListenerAdd(){t=e(i.fire,i)},onLastListenerRemove(){t.dispose()}});return i.event}function c(e,t,i=100,n=!1,o){let s,r=void 0,a=void 0,l=0;const c=new rt({leakWarningThreshold:o,onFirstListenerAdd(){s=e(e=>{l++,r=t(r,e),n&&!a&&(c.fire(r),r=void 0),clearTimeout(a),a=setTimeout(()=>{const e=r;r=void 0,a=void 0,(!n||l>1)&&c.fire(e),l=0},i)})},onLastListenerRemove(){s.dispose()}});return c.event}function d(e,t=((e,t)=>e===t)){let i,n=!0;return o(e,e=>{const o=n||!t(e,i);return n=!1,i=e,o})}function h(t,i){return[e.filter(t,i),e.filter(t,e=>!i(e))]}function u(e,t=!1,i=[]){let n=i.slice(),o=e(e=>{n?n.push(e):r.fire(e)});const s=()=>{n&&n.forEach(e=>r.fire(e)),n=null},r=new rt({onFirstListenerAdd(){o||(o=e(e=>r.fire(e)))},onFirstListenerDidAdd(){n&&(t?setTimeout(s):s())},onLastListenerRemove(){o&&o.dispose(),o=null}});return r.event}e.None=()=>Ye.None,e.once=t,e.map=i,e.forEach=n,e.filter=o,e.signal=s,e.any=r,e.reduce=a,e.debounce=c,e.latch=d,e.split=h,e.buffer=u;class g{constructor(e){this.event=e}map(e){return new g(i(this.event,e))}forEach(e){return new g(n(this.event,e))}filter(e){return new g(o(this.event,e))}reduce(e,t){return new g(a(this.event,e,t))}latch(){return new g(d(this.event))}debounce(e,t=100,i=!1,n){return new g(c(this.event,e,t,i,n))}on(e,t,i){return this.event(e,t,i)}once(e,i,n){return t(this.event)(e,i,n)}}function f(e){return new g(e)}function m(e,t,i=(e=>e)){const n=(...e)=>r.fire(i(...e)),o=()=>e.on(t,n),s=()=>e.removeListener(t,n),r=new rt({onFirstListenerAdd:o,onLastListenerRemove:s});return r.event}function p(e,t,i=(e=>e)){const n=(...e)=>r.fire(i(...e)),o=()=>e.addEventListener(t,n),s=()=>e.removeEventListener(t,n),r=new rt({onFirstListenerAdd:o,onLastListenerRemove:s});return r.event}function _(e){return new Promise(i=>t(e)(i))}e.chain=f,e.fromNodeEventEmitter=m,e.fromDOMEventEmitter=p,e.toPromise=_})(it||(it={}));class nt{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${nt._idPool++}`}start(e){this._stopWatch=new tt(!0),this._listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this._elapsedOverall+=e,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${e.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}nt._idPool=0;let ot=-1;class st{constructor(e,t=Math.random().toString(18).slice(2,5)){this.customThreshold=e,this.name=t,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(e){let t=ot;if("number"===typeof this.customThreshold&&(t=this.customThreshold),t<=0||e<t)return;this._stacks||(this._stacks=new Map);const i=(new Error).stack.split("\n").slice(3).join("\n"),n=this._stacks.get(i)||0;if(this._stacks.set(i,n+1),this._warnCountdown-=1,this._warnCountdown<=0){let i;this._warnCountdown=.5*t;let n=0;for(const[e,t]of this._stacks)(!i||n<t)&&(i=e,n=t);console.warn(`[${this.name}] potential listener LEAK detected, having ${e} listeners already. MOST frequent listener (${n}):`),console.warn(i)}return()=>{const e=this._stacks.get(i)||0;this._stacks.set(i,e-1)}}}class rt{constructor(e){var t;this._disposed=!1,this._options=e,this._leakageMon=ot>0?new st(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=(null===(t=this._options)||void 0===t?void 0:t._profName)?new nt(this._options._profName):void 0}get event(){return this._event||(this._event=(e,t,i)=>{var n;this._listeners||(this._listeners=new Je);const o=this._listeners.isEmpty();o&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(t?[e,t]:e);o&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t);const r=null===(n=this._leakageMon)||void 0===n?void 0:n.check(this._listeners.size),a=qe(()=>{if(r&&r(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const e=this._listeners&&!this._listeners.isEmpty();e||this._options.onLastListenerRemove(this)}});return i instanceof Ge?i.add(a):Array.isArray(i)&&i.push(a),a}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Je);for(let t of this._listeners)this._deliveryQueue.push([t,e]);null===(t=this._perfMon)||void 0===t||t.start(this._deliveryQueue.size);while(this._deliveryQueue.size>0){const[e,t]=this._deliveryQueue.shift();try{"function"===typeof e?e.call(void 0,t):e[0].call(e[1],t)}catch(n){xe(n)}}null===(i=this._perfMon)||void 0===i||i.stop()}}dispose(){var e,t,i,n,o;this._disposed||(this._disposed=!0,null===(e=this._listeners)||void 0===e||e.clear(),null===(t=this._deliveryQueue)||void 0===t||t.clear(),null===(n=null===(i=this._options)||void 0===i?void 0:i.onLastListenerRemove)||void 0===n||n.call(i),null===(o=this._leakageMon)||void 0===o||o.dispose())}}class at extends rt{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Je,this._mergeFn=null===e||void 0===e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0===--this._isPaused)if(this._mergeFn){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}else while(!this._isPaused&&0!==this._eventQueue.size)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class lt extends at{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 ct{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 dt{constructor(){this.listening=!1,this.inputEvent=it.None,this.inputEventListener=Ye.None,this.emitter=new rt({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{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 ht=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var ut;(function(e){function t(t){return t===e.None||t===e.Cancelled||(t instanceof gt||!(!t||"object"!==typeof t)&&("boolean"===typeof t.isCancellationRequested&&"function"===typeof t.onCancellationRequested))}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:it.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ht})})(ut||(ut={}));class gt{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?ht:(this._emitter||(this._emitter=new rt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class ft{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 gt),this._token}cancel(){this._token?this._token instanceof gt&&this._token.cancel():this._token=ut.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof gt&&this._token.dispose():this._token=ut.None}}class mt{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 pt=new mt,_t=new mt,bt=new mt,vt=new Array(230),wt={},Ct=[],yt=Object.create(null),St=Object.create(null),xt=[],kt=[];for(let IK=0;IK<=193;IK++)xt[IK]=-1;for(let IK=0;IK<=126;IK++)kt[IK]=-1;var Lt;function Et(e,t){const i=(65535&t)<<16>>>0;return(e|i)>>>0}(function(){const e="",t=[[0,1,0,"None",0,"unknown",0,"VK_UNKNOWN",e,e],[0,1,1,"Hyper",0,e,0,e,e,e],[0,1,2,"Super",0,e,0,e,e,e],[0,1,3,"Fn",0,e,0,e,e,e],[0,1,4,"FnLock",0,e,0,e,e,e],[0,1,5,"Suspend",0,e,0,e,e,e],[0,1,6,"Resume",0,e,0,e,e,e],[0,1,7,"Turbo",0,e,0,e,e,e],[0,1,8,"Sleep",0,e,0,"VK_SLEEP",e,e],[0,1,9,"WakeUp",0,e,0,e,e,e],[31,0,10,"KeyA",31,"A",65,"VK_A",e,e],[32,0,11,"KeyB",32,"B",66,"VK_B",e,e],[33,0,12,"KeyC",33,"C",67,"VK_C",e,e],[34,0,13,"KeyD",34,"D",68,"VK_D",e,e],[35,0,14,"KeyE",35,"E",69,"VK_E",e,e],[36,0,15,"KeyF",36,"F",70,"VK_F",e,e],[37,0,16,"KeyG",37,"G",71,"VK_G",e,e],[38,0,17,"KeyH",38,"H",72,"VK_H",e,e],[39,0,18,"KeyI",39,"I",73,"VK_I",e,e],[40,0,19,"KeyJ",40,"J",74,"VK_J",e,e],[41,0,20,"KeyK",41,"K",75,"VK_K",e,e],[42,0,21,"KeyL",42,"L",76,"VK_L",e,e],[43,0,22,"KeyM",43,"M",77,"VK_M",e,e],[44,0,23,"KeyN",44,"N",78,"VK_N",e,e],[45,0,24,"KeyO",45,"O",79,"VK_O",e,e],[46,0,25,"KeyP",46,"P",80,"VK_P",e,e],[47,0,26,"KeyQ",47,"Q",81,"VK_Q",e,e],[48,0,27,"KeyR",48,"R",82,"VK_R",e,e],[49,0,28,"KeyS",49,"S",83,"VK_S",e,e],[50,0,29,"KeyT",50,"T",84,"VK_T",e,e],[51,0,30,"KeyU",51,"U",85,"VK_U",e,e],[52,0,31,"KeyV",52,"V",86,"VK_V",e,e],[53,0,32,"KeyW",53,"W",87,"VK_W",e,e],[54,0,33,"KeyX",54,"X",88,"VK_X",e,e],[55,0,34,"KeyY",55,"Y",89,"VK_Y",e,e],[56,0,35,"KeyZ",56,"Z",90,"VK_Z",e,e],[22,0,36,"Digit1",22,"1",49,"VK_1",e,e],[23,0,37,"Digit2",23,"2",50,"VK_2",e,e],[24,0,38,"Digit3",24,"3",51,"VK_3",e,e],[25,0,39,"Digit4",25,"4",52,"VK_4",e,e],[26,0,40,"Digit5",26,"5",53,"VK_5",e,e],[27,0,41,"Digit6",27,"6",54,"VK_6",e,e],[28,0,42,"Digit7",28,"7",55,"VK_7",e,e],[29,0,43,"Digit8",29,"8",56,"VK_8",e,e],[30,0,44,"Digit9",30,"9",57,"VK_9",e,e],[21,0,45,"Digit0",21,"0",48,"VK_0",e,e],[3,1,46,"Enter",3,"Enter",13,"VK_RETURN",e,e],[9,1,47,"Escape",9,"Escape",27,"VK_ESCAPE",e,e],[1,1,48,"Backspace",1,"Backspace",8,"VK_BACK",e,e],[2,1,49,"Tab",2,"Tab",9,"VK_TAB",e,e],[10,1,50,"Space",10,"Space",32,"VK_SPACE",e,e],[83,0,51,"Minus",83,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[81,0,52,"Equal",81,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[87,0,53,"BracketLeft",87,"[",219,"VK_OEM_4","[","OEM_4"],[89,0,54,"BracketRight",89,"]",221,"VK_OEM_6","]","OEM_6"],[88,0,55,"Backslash",88,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,0,56,"IntlHash",0,e,0,e,e,e],[80,0,57,"Semicolon",80,";",186,"VK_OEM_1",";","OEM_1"],[90,0,58,"Quote",90,"'",222,"VK_OEM_7","'","OEM_7"],[86,0,59,"Backquote",86,"`",192,"VK_OEM_3","`","OEM_3"],[82,0,60,"Comma",82,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[84,0,61,"Period",84,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[85,0,62,"Slash",85,"/",191,"VK_OEM_2","/","OEM_2"],[8,1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",e,e],[59,1,64,"F1",59,"F1",112,"VK_F1",e,e],[60,1,65,"F2",60,"F2",113,"VK_F2",e,e],[61,1,66,"F3",61,"F3",114,"VK_F3",e,e],[62,1,67,"F4",62,"F4",115,"VK_F4",e,e],[63,1,68,"F5",63,"F5",116,"VK_F5",e,e],[64,1,69,"F6",64,"F6",117,"VK_F6",e,e],[65,1,70,"F7",65,"F7",118,"VK_F7",e,e],[66,1,71,"F8",66,"F8",119,"VK_F8",e,e],[67,1,72,"F9",67,"F9",120,"VK_F9",e,e],[68,1,73,"F10",68,"F10",121,"VK_F10",e,e],[69,1,74,"F11",69,"F11",122,"VK_F11",e,e],[70,1,75,"F12",70,"F12",123,"VK_F12",e,e],[0,1,76,"PrintScreen",0,e,0,e,e,e],[79,1,77,"ScrollLock",79,"ScrollLock",145,"VK_SCROLL",e,e],[7,1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",e,e],[19,1,79,"Insert",19,"Insert",45,"VK_INSERT",e,e],[14,1,80,"Home",14,"Home",36,"VK_HOME",e,e],[11,1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",e,e],[20,1,82,"Delete",20,"Delete",46,"VK_DELETE",e,e],[13,1,83,"End",13,"End",35,"VK_END",e,e],[12,1,84,"PageDown",12,"PageDown",34,"VK_NEXT",e,e],[17,1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",e],[15,1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",e],[18,1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",e],[16,1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",e],[78,1,89,"NumLock",78,"NumLock",144,"VK_NUMLOCK",e,e],[108,1,90,"NumpadDivide",108,"NumPad_Divide",111,"VK_DIVIDE",e,e],[103,1,91,"NumpadMultiply",103,"NumPad_Multiply",106,"VK_MULTIPLY",e,e],[106,1,92,"NumpadSubtract",106,"NumPad_Subtract",109,"VK_SUBTRACT",e,e],[104,1,93,"NumpadAdd",104,"NumPad_Add",107,"VK_ADD",e,e],[3,1,94,"NumpadEnter",3,e,0,e,e,e],[94,1,95,"Numpad1",94,"NumPad1",97,"VK_NUMPAD1",e,e],[95,1,96,"Numpad2",95,"NumPad2",98,"VK_NUMPAD2",e,e],[96,1,97,"Numpad3",96,"NumPad3",99,"VK_NUMPAD3",e,e],[97,1,98,"Numpad4",97,"NumPad4",100,"VK_NUMPAD4",e,e],[98,1,99,"Numpad5",98,"NumPad5",101,"VK_NUMPAD5",e,e],[99,1,100,"Numpad6",99,"NumPad6",102,"VK_NUMPAD6",e,e],[100,1,101,"Numpad7",100,"NumPad7",103,"VK_NUMPAD7",e,e],[101,1,102,"Numpad8",101,"NumPad8",104,"VK_NUMPAD8",e,e],[102,1,103,"Numpad9",102,"NumPad9",105,"VK_NUMPAD9",e,e],[93,1,104,"Numpad0",93,"NumPad0",96,"VK_NUMPAD0",e,e],[107,1,105,"NumpadDecimal",107,"NumPad_Decimal",110,"VK_DECIMAL",e,e],[92,0,106,"IntlBackslash",92,"OEM_102",226,"VK_OEM_102",e,e],[58,1,107,"ContextMenu",58,"ContextMenu",93,e,e,e],[0,1,108,"Power",0,e,0,e,e,e],[0,1,109,"NumpadEqual",0,e,0,e,e,e],[71,1,110,"F13",71,"F13",124,"VK_F13",e,e],[72,1,111,"F14",72,"F14",125,"VK_F14",e,e],[73,1,112,"F15",73,"F15",126,"VK_F15",e,e],[74,1,113,"F16",74,"F16",127,"VK_F16",e,e],[75,1,114,"F17",75,"F17",128,"VK_F17",e,e],[76,1,115,"F18",76,"F18",129,"VK_F18",e,e],[77,1,116,"F19",77,"F19",130,"VK_F19",e,e],[0,1,117,"F20",0,e,0,"VK_F20",e,e],[0,1,118,"F21",0,e,0,"VK_F21",e,e],[0,1,119,"F22",0,e,0,"VK_F22",e,e],[0,1,120,"F23",0,e,0,"VK_F23",e,e],[0,1,121,"F24",0,e,0,"VK_F24",e,e],[0,1,122,"Open",0,e,0,e,e,e],[0,1,123,"Help",0,e,0,e,e,e],[0,1,124,"Select",0,e,0,e,e,e],[0,1,125,"Again",0,e,0,e,e,e],[0,1,126,"Undo",0,e,0,e,e,e],[0,1,127,"Cut",0,e,0,e,e,e],[0,1,128,"Copy",0,e,0,e,e,e],[0,1,129,"Paste",0,e,0,e,e,e],[0,1,130,"Find",0,e,0,e,e,e],[0,1,131,"AudioVolumeMute",112,"AudioVolumeMute",173,"VK_VOLUME_MUTE",e,e],[0,1,132,"AudioVolumeUp",113,"AudioVolumeUp",175,"VK_VOLUME_UP",e,e],[0,1,133,"AudioVolumeDown",114,"AudioVolumeDown",174,"VK_VOLUME_DOWN",e,e],[105,1,134,"NumpadComma",105,"NumPad_Separator",108,"VK_SEPARATOR",e,e],[110,0,135,"IntlRo",110,"ABNT_C1",193,"VK_ABNT_C1",e,e],[0,1,136,"KanaMode",0,e,0,e,e,e],[0,0,137,"IntlYen",0,e,0,e,e,e],[0,1,138,"Convert",0,e,0,e,e,e],[0,1,139,"NonConvert",0,e,0,e,e,e],[0,1,140,"Lang1",0,e,0,e,e,e],[0,1,141,"Lang2",0,e,0,e,e,e],[0,1,142,"Lang3",0,e,0,e,e,e],[0,1,143,"Lang4",0,e,0,e,e,e],[0,1,144,"Lang5",0,e,0,e,e,e],[0,1,145,"Abort",0,e,0,e,e,e],[0,1,146,"Props",0,e,0,e,e,e],[0,1,147,"NumpadParenLeft",0,e,0,e,e,e],[0,1,148,"NumpadParenRight",0,e,0,e,e,e],[0,1,149,"NumpadBackspace",0,e,0,e,e,e],[0,1,150,"NumpadMemoryStore",0,e,0,e,e,e],[0,1,151,"NumpadMemoryRecall",0,e,0,e,e,e],[0,1,152,"NumpadMemoryClear",0,e,0,e,e,e],[0,1,153,"NumpadMemoryAdd",0,e,0,e,e,e],[0,1,154,"NumpadMemorySubtract",0,e,0,e,e,e],[0,1,155,"NumpadClear",0,e,0,e,e,e],[0,1,156,"NumpadClearEntry",0,e,0,e,e,e],[5,1,0,e,5,"Ctrl",17,"VK_CONTROL",e,e],[4,1,0,e,4,"Shift",16,"VK_SHIFT",e,e],[6,1,0,e,6,"Alt",18,"VK_MENU",e,e],[57,1,0,e,57,"Meta",0,"VK_COMMAND",e,e],[5,1,157,"ControlLeft",5,e,0,"VK_LCONTROL",e,e],[4,1,158,"ShiftLeft",4,e,0,"VK_LSHIFT",e,e],[6,1,159,"AltLeft",6,e,0,"VK_LMENU",e,e],[57,1,160,"MetaLeft",57,e,0,"VK_LWIN",e,e],[5,1,161,"ControlRight",5,e,0,"VK_RCONTROL",e,e],[4,1,162,"ShiftRight",4,e,0,"VK_RSHIFT",e,e],[6,1,163,"AltRight",6,e,0,"VK_RMENU",e,e],[57,1,164,"MetaRight",57,e,0,"VK_RWIN",e,e],[0,1,165,"BrightnessUp",0,e,0,e,e,e],[0,1,166,"BrightnessDown",0,e,0,e,e,e],[0,1,167,"MediaPlay",0,e,0,e,e,e],[0,1,168,"MediaRecord",0,e,0,e,e,e],[0,1,169,"MediaFastForward",0,e,0,e,e,e],[0,1,170,"MediaRewind",0,e,0,e,e,e],[114,1,171,"MediaTrackNext",119,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",e,e],[115,1,172,"MediaTrackPrevious",120,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",e,e],[116,1,173,"MediaStop",121,"MediaStop",178,"VK_MEDIA_STOP",e,e],[0,1,174,"Eject",0,e,0,e,e,e],[117,1,175,"MediaPlayPause",122,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",e,e],[0,1,176,"MediaSelect",123,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",e,e],[0,1,177,"LaunchMail",124,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",e,e],[0,1,178,"LaunchApp2",125,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",e,e],[0,1,179,"LaunchApp1",0,e,0,"VK_MEDIA_LAUNCH_APP1",e,e],[0,1,180,"SelectTask",0,e,0,e,e,e],[0,1,181,"LaunchScreenSaver",0,e,0,e,e,e],[0,1,182,"BrowserSearch",115,"BrowserSearch",170,"VK_BROWSER_SEARCH",e,e],[0,1,183,"BrowserHome",116,"BrowserHome",172,"VK_BROWSER_HOME",e,e],[112,1,184,"BrowserBack",117,"BrowserBack",166,"VK_BROWSER_BACK",e,e],[113,1,185,"BrowserForward",118,"BrowserForward",167,"VK_BROWSER_FORWARD",e,e],[0,1,186,"BrowserStop",0,e,0,"VK_BROWSER_STOP",e,e],[0,1,187,"BrowserRefresh",0,e,0,"VK_BROWSER_REFRESH",e,e],[0,1,188,"BrowserFavorites",0,e,0,"VK_BROWSER_FAVORITES",e,e],[0,1,189,"ZoomToggle",0,e,0,e,e,e],[0,1,190,"MailReply",0,e,0,e,e,e],[0,1,191,"MailForward",0,e,0,e,e,e],[0,1,192,"MailSend",0,e,0,e,e,e],[109,1,0,e,109,"KeyInComposition",229,e,e,e],[111,1,0,e,111,"ABNT_C2",194,"VK_ABNT_C2",e,e],[91,1,0,e,91,"OEM_8",223,"VK_OEM_8",e,e],[0,1,0,e,0,e,0,"VK_CLEAR",e,e],[0,1,0,e,0,e,0,"VK_KANA",e,e],[0,1,0,e,0,e,0,"VK_HANGUL",e,e],[0,1,0,e,0,e,0,"VK_JUNJA",e,e],[0,1,0,e,0,e,0,"VK_FINAL",e,e],[0,1,0,e,0,e,0,"VK_HANJA",e,e],[0,1,0,e,0,e,0,"VK_KANJI",e,e],[0,1,0,e,0,e,0,"VK_CONVERT",e,e],[0,1,0,e,0,e,0,"VK_NONCONVERT",e,e],[0,1,0,e,0,e,0,"VK_ACCEPT",e,e],[0,1,0,e,0,e,0,"VK_MODECHANGE",e,e],[0,1,0,e,0,e,0,"VK_SELECT",e,e],[0,1,0,e,0,e,0,"VK_PRINT",e,e],[0,1,0,e,0,e,0,"VK_EXECUTE",e,e],[0,1,0,e,0,e,0,"VK_SNAPSHOT",e,e],[0,1,0,e,0,e,0,"VK_HELP",e,e],[0,1,0,e,0,e,0,"VK_APPS",e,e],[0,1,0,e,0,e,0,"VK_PROCESSKEY",e,e],[0,1,0,e,0,e,0,"VK_PACKET",e,e],[0,1,0,e,0,e,0,"VK_DBE_SBCSCHAR",e,e],[0,1,0,e,0,e,0,"VK_DBE_DBCSCHAR",e,e],[0,1,0,e,0,e,0,"VK_ATTN",e,e],[0,1,0,e,0,e,0,"VK_CRSEL",e,e],[0,1,0,e,0,e,0,"VK_EXSEL",e,e],[0,1,0,e,0,e,0,"VK_EREOF",e,e],[0,1,0,e,0,e,0,"VK_PLAY",e,e],[0,1,0,e,0,e,0,"VK_ZOOM",e,e],[0,1,0,e,0,e,0,"VK_NONAME",e,e],[0,1,0,e,0,e,0,"VK_PA1",e,e],[0,1,0,e,0,e,0,"VK_OEM_CLEAR",e,e]];let i=[],n=[];for(const o of t){const[e,t,s,r,a,l,c,d,h,u]=o;if(n[s]||(n[s]=!0,Ct[s]=r,yt[r]=s,St[r.toLowerCase()]=s,t&&(xt[s]=a,0!==a&&3!==a&&5!==a&&4!==a&&6!==a&&57!==a&&(kt[a]=s))),!i[a]){if(i[a]=!0,!l)throw new Error(`String representation missing for key code ${a} around scan code ${r}`);pt.define(a,l),_t.define(a,h||l),bt.define(a,u||h||l)}c&&(vt[c]=a),d&&(wt[d]=a)}kt[3]=46})(),function(e){function t(e){return pt.keyCodeToStr(e)}function i(e){return pt.strToKeyCode(e)}function n(e){return _t.keyCodeToStr(e)}function o(e){return bt.keyCodeToStr(e)}function s(e){return _t.strToKeyCode(e)||bt.strToKeyCode(e)}function r(e){if(e>=93&&e<=108)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return pt.keyCodeToStr(e)}e.toString=t,e.fromString=i,e.toUserSettingsUS=n,e.toUserSettingsGeneral=o,e.fromUserSettings=s,e.toElectronAccelerator=r}(Lt||(Lt={}));var Dt=i("f940");const Nt=65,It=97,Tt=90,Mt=122,Ot=46,At=47,Pt=92,Rt=58,Ft=63;class Bt 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 o=-1!==e.indexOf(".")?"property":"argument";let s=`The "${e}" ${o} ${n} of type ${t}`;s+=". Received type "+typeof i,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function Wt(e,t){if("string"!==typeof e)throw new Bt(t,"string",e)}function Vt(e){return e===At||e===Pt}function zt(e){return e===At}function Ht(e){return e>=Nt&&e<=Tt||e>=It&&e<=Mt}function Kt(e,t,i,n){let o="",s=0,r=-1,a=0,l=0;for(let c=0;c<=e.length;++c){if(c<e.length)l=e.charCodeAt(c);else{if(n(l))break;l=At}if(n(l)){if(r===c-1||1===a);else if(2===a){if(o.length<2||2!==s||o.charCodeAt(o.length-1)!==Ot||o.charCodeAt(o.length-2)!==Ot){if(o.length>2){const e=o.lastIndexOf(i);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(i)),r=c,a=0;continue}if(0!==o.length){o="",s=0,r=c,a=0;continue}}t&&(o+=o.length>0?i+"..":"..",s=2)}else o.length>0?o+=`${i}${e.slice(r+1,c)}`:o=e.slice(r+1,c),s=c-r-1;r=c,a=0}else l===Ot&&-1!==a?++a:a=-1}return o}function jt(e,t){if(null===t||"object"!==typeof t)throw new Bt("pathObject","Object",t);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 Ut={resolve(...e){let t="",i="",n=!1;for(let o=e.length-1;o>=-1;o--){let s;if(o>=0){if(s=e[o],Wt(s,"path"),0===s.length)continue}else 0===t.length?s=Dt["a"]():(s=Dt["b"]["="+t]||Dt["a"](),(void 0===s||s.slice(0,2).toLowerCase()!==t.toLowerCase()&&s.charCodeAt(2)===Pt)&&(s=t+"\\"));const r=s.length;let a=0,l="",c=!1;const d=s.charCodeAt(0);if(1===r)Vt(d)&&(a=1,c=!0);else if(Vt(d))if(c=!0,Vt(s.charCodeAt(1))){let e=2,t=e;while(e<r&&!Vt(s.charCodeAt(e)))e++;if(e<r&&e!==t){const i=s.slice(t,e);t=e;while(e<r&&Vt(s.charCodeAt(e)))e++;if(e<r&&e!==t){t=e;while(e<r&&!Vt(s.charCodeAt(e)))e++;e!==r&&e===t||(l=`\\\\${i}\\${s.slice(t,e)}`,a=e)}}}else a=1;else Ht(d)&&s.charCodeAt(1)===Rt&&(l=s.slice(0,2),a=2,r>2&&Vt(s.charCodeAt(2))&&(c=!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=`${s.slice(a)}\\${i}`,n=c,c&&t.length>0)break}return i=Kt(i,!n,"\\",Vt),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){Wt(e,"path");const t=e.length;if(0===t)return".";let i,n=0,o=!1;const s=e.charCodeAt(0);if(1===t)return zt(s)?"\\":e;if(Vt(s))if(o=!0,Vt(e.charCodeAt(1))){let o=2,s=o;while(o<t&&!Vt(e.charCodeAt(o)))o++;if(o<t&&o!==s){const r=e.slice(s,o);s=o;while(o<t&&Vt(e.charCodeAt(o)))o++;if(o<t&&o!==s){s=o;while(o<t&&!Vt(e.charCodeAt(o)))o++;if(o===t)return`\\\\${r}\\${e.slice(s)}\\`;o!==s&&(i=`\\\\${r}\\${e.slice(s,o)}`,n=o)}}}else n=1;else Ht(s)&&e.charCodeAt(1)===Rt&&(i=e.slice(0,2),n=2,t>2&&Vt(e.charCodeAt(2))&&(o=!0,n=3));let r=n<t?Kt(e.slice(n),!o,"\\",Vt):"";return 0!==r.length||o||(r="."),r.length>0&&Vt(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?o?"\\"+r:r:o?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){Wt(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return Vt(i)||t>2&&Ht(i)&&e.charCodeAt(1)===Rt&&Vt(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let s=0;s<e.length;++s){const n=e[s];Wt(n,"path"),n.length>0&&(void 0===t?t=i=n:t+="\\"+n)}if(void 0===t)return".";let n=!0,o=0;if("string"===typeof i&&Vt(i.charCodeAt(0))){++o;const e=i.length;e>1&&Vt(i.charCodeAt(1))&&(++o,e>2&&(Vt(i.charCodeAt(2))?++o:n=!1))}if(n){while(o<t.length&&Vt(t.charCodeAt(o)))o++;o>=2&&(t="\\"+t.slice(o))}return Ut.normalize(t)},relative(e,t){if(Wt(e,"from"),Wt(t,"to"),e===t)return"";const i=Ut.resolve(e),n=Ut.resolve(t);if(i===n)return"";if(e=i.toLowerCase(),t=n.toLowerCase(),e===t)return"";let o=0;while(o<e.length&&e.charCodeAt(o)===Pt)o++;let s=e.length;while(s-1>o&&e.charCodeAt(s-1)===Pt)s--;const r=s-o;let a=0;while(a<t.length&&t.charCodeAt(a)===Pt)a++;let l=t.length;while(l-1>a&&t.charCodeAt(l-1)===Pt)l--;const c=l-a,d=r<c?r:c;let h=-1,u=0;for(;u<d;u++){const i=e.charCodeAt(o+u);if(i!==t.charCodeAt(a+u))break;i===Pt&&(h=u)}if(u!==d){if(-1===h)return n}else{if(c>d){if(t.charCodeAt(a+u)===Pt)return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>d&&(e.charCodeAt(o+u)===Pt?h=u:2===u&&(h=3)),-1===h&&(h=0)}let g="";for(u=o+h+1;u<=s;++u)u!==s&&e.charCodeAt(u)!==Pt||(g+=0===g.length?"..":"\\..");return a+=h,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===Pt&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!==typeof e)return e;if(0===e.length)return"";const t=Ut.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===Pt){if(t.charCodeAt(1)===Pt){const e=t.charCodeAt(2);if(e!==Ft&&e!==Ot)return"\\\\?\\UNC\\"+t.slice(2)}}else if(Ht(t.charCodeAt(0))&&t.charCodeAt(1)===Rt&&t.charCodeAt(2)===Pt)return"\\\\?\\"+t;return e},dirname(e){Wt(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const o=e.charCodeAt(0);if(1===t)return Vt(o)?e:".";if(Vt(o)){if(i=n=1,Vt(e.charCodeAt(1))){let o=2,s=o;while(o<t&&!Vt(e.charCodeAt(o)))o++;if(o<t&&o!==s){s=o;while(o<t&&Vt(e.charCodeAt(o)))o++;if(o<t&&o!==s){s=o;while(o<t&&!Vt(e.charCodeAt(o)))o++;if(o===t)return e;o!==s&&(i=n=o+1)}}}}else Ht(o)&&e.charCodeAt(1)===Rt&&(i=t>2&&Vt(e.charCodeAt(2))?3:2,n=i);let s=-1,r=!0;for(let a=t-1;a>=n;--a)if(Vt(e.charCodeAt(a))){if(!r){s=a;break}}else r=!1;if(-1===s){if(-1===i)return".";s=i}return e.slice(0,s)},basename(e,t){void 0!==t&&Wt(t,"ext"),Wt(e,"path");let i,n=0,o=-1,s=!0;if(e.length>=2&&Ht(e.charCodeAt(0))&&e.charCodeAt(1)===Rt&&(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(Vt(l)){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1===--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=n;--i)if(Vt(e.charCodeAt(i))){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){Wt(e,"path");let t=0,i=-1,n=0,o=-1,s=!0,r=0;e.length>=2&&e.charCodeAt(1)===Rt&&Ht(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(Vt(t)){if(!s){n=a+1;break}}else-1===o&&(s=!1,o=a+1),t===Ot?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===o||0===r||1===r&&i===o-1&&i===n+1?"":e.slice(i,o)},format:jt.bind(null,"\\"),parse(e){Wt(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,o=e.charCodeAt(0);if(1===i)return Vt(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(Vt(o)){if(n=1,Vt(e.charCodeAt(1))){let t=2,o=t;while(t<i&&!Vt(e.charCodeAt(t)))t++;if(t<i&&t!==o){o=t;while(t<i&&Vt(e.charCodeAt(t)))t++;if(t<i&&t!==o){o=t;while(t<i&&!Vt(e.charCodeAt(t)))t++;t===i?n=t:t!==o&&(n=t+1)}}}}else if(Ht(o)&&e.charCodeAt(1)===Rt){if(i<=2)return t.root=t.dir=e,t;if(n=2,Vt(e.charCodeAt(2))){if(3===i)return t.root=t.dir=e,t;n=3}}n>0&&(t.root=e.slice(0,n));let s=-1,r=n,a=-1,l=!0,c=e.length-1,d=0;for(;c>=n;--c)if(o=e.charCodeAt(c),Vt(o)){if(!l){r=c+1;break}}else-1===a&&(l=!1,a=c+1),o===Ot?-1===s?s=c:1!==d&&(d=1):-1!==s&&(d=-1);return-1!==a&&(-1===s||0===d||1===d&&s===a-1&&s===r+1?t.base=t.name=e.slice(r,a):(t.name=e.slice(r,s),t.base=e.slice(r,a),t.ext=e.slice(s,a))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},$t={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=-1&&!i;n--){const o=n>=0?e[n]:Dt["a"]();Wt(o,"path"),0!==o.length&&(t=`${o}/${t}`,i=o.charCodeAt(0)===At)}return t=Kt(t,!i,"/",zt),i?"/"+t:t.length>0?t:"."},normalize(e){if(Wt(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===At,i=e.charCodeAt(e.length-1)===At;return e=Kt(e,!t,"/",zt),0===e.length?t?"/":i?"./":".":(i&&(e+="/"),t?"/"+e:e)},isAbsolute(e){return Wt(e,"path"),e.length>0&&e.charCodeAt(0)===At},join(...e){if(0===e.length)return".";let t;for(let i=0;i<e.length;++i){const n=e[i];Wt(n,"path"),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":$t.normalize(t)},relative(e,t){if(Wt(e,"from"),Wt(t,"to"),e===t)return"";if(e=$t.resolve(e),t=$t.resolve(t),e===t)return"";const i=1,n=e.length,o=n-i,s=1,r=t.length-s,a=o<r?o:r;let l=-1,c=0;for(;c<a;c++){const n=e.charCodeAt(i+c);if(n!==t.charCodeAt(s+c))break;n===At&&(l=c)}if(c===a)if(r>a){if(t.charCodeAt(s+c)===At)return t.slice(s+c+1);if(0===c)return t.slice(s+c)}else o>a&&(e.charCodeAt(i+c)===At?l=c:0===c&&(l=0));let d="";for(c=i+l+1;c<=n;++c)c!==n&&e.charCodeAt(c)!==At||(d+=0===d.length?"..":"/..");return`${d}${t.slice(s+l)}`},toNamespacedPath(e){return e},dirname(e){if(Wt(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===At;let i=-1,n=!0;for(let o=e.length-1;o>=1;--o)if(e.charCodeAt(o)===At){if(!n){i=o;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&Wt(t,"ext"),Wt(e,"path");let i,n=0,o=-1,s=!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(l===At){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1===--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===At){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){Wt(e,"path");let t=-1,i=0,n=-1,o=!0,s=0;for(let r=e.length-1;r>=0;--r){const a=e.charCodeAt(r);if(a!==At)-1===n&&(o=!1,n=r+1),a===Ot?-1===t?t=r:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){i=r+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===i+1?"":e.slice(t,n)},format:jt.bind(null,"/"),parse(e){Wt(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===At;let n;i?(t.root="/",n=1):n=0;let o=-1,s=0,r=-1,a=!0,l=e.length-1,c=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==At)-1===r&&(a=!1,r=l+1),t===Ot?-1===o?o=l:1!==c&&(c=1):-1!==o&&(c=-1);else if(!a){s=l+1;break}}if(-1!==r){const n=0===s&&i?1:s;-1===o||0===c||1===c&&o===r-1&&o===s+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,o),t.base=e.slice(n,r),t.ext=e.slice(o,r))}return s>0?t.dir=e.slice(0,s-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};$t.win32=Ut.win32=Ut,$t.posix=Ut.posix=$t;const qt="win32"===Dt["c"]?Ut.normalize:$t.normalize,Gt="win32"===Dt["c"]?Ut.resolve:$t.resolve,Yt="win32"===Dt["c"]?Ut.relative:$t.relative,Xt="win32"===Dt["c"]?Ut.dirname:$t.dirname,Zt="win32"===Dt["c"]?Ut.basename:$t.basename,Qt="win32"===Dt["c"]?Ut.extname:$t.extname,Jt="win32"===Dt["c"]?Ut.sep:$t.sep,ei=/^\w[\w\d+.-]*$/,ti=/^\//,ii=/^\/\//;function ni(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&&!ei.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!ti.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(ii.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 ("//")')}function oi(e,t){return e||t?e:"file"}function si(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==ai&&(t=ai+t):t=ai;break}return t}const ri="",ai="/",li=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class ci{constructor(e,t,i,n,o,s=!1){"object"===typeof e?(this.scheme=e.scheme||ri,this.authority=e.authority||ri,this.path=e.path||ri,this.query=e.query||ri,this.fragment=e.fragment||ri):(this.scheme=oi(e,s),this.authority=t||ri,this.path=si(this.scheme,i||ri),this.query=n||ri,this.fragment=o||ri,ni(this,s))}static isUri(e){return e instanceof ci||!!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)}get fsPath(){return mi(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=ri),void 0===i?i=this.authority:null===i&&(i=ri),void 0===n?n=this.path:null===n&&(n=ri),void 0===o?o=this.query:null===o&&(o=ri),void 0===s?s=this.fragment:null===s&&(s=ri),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new hi(t,i,n,o,s)}static parse(e,t=!1){const i=li.exec(e);return i?new hi(i[2]||ri,vi(i[4]||ri),vi(i[5]||ri),vi(i[7]||ri),vi(i[9]||ri),t):new hi(ri,ri,ri,ri,ri)}static file(e){let t=ri;if(s["i"]&&(e=e.replace(/\\/g,ai)),e[0]===ai&&e[1]===ai){const i=e.indexOf(ai,2);-1===i?(t=e.substring(2),e=ai):(t=e.substring(2,i),e=e.substring(i)||ai)}return new hi("file",t,e,ri,ri)}static from(e){const t=new hi(e.scheme,e.authority,e.path,e.query,e.fragment);return ni(t,!0),t}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return i=s["i"]&&"file"===e.scheme?ci.file(Ut.join(mi(e,!0),...t)).path:$t.join(e.path,...t),e.with({path:i})}toString(e=!1){return pi(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof ci)return e;{const t=new hi(e);return t._formatted=e.external,t._fsPath=e._sep===di?e.fsPath:null,t}}return e}}const di=s["i"]?1:void 0;class hi extends ci{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=mi(this,!1)),this._fsPath}toString(e=!1){return e?pi(this,!0):(this._formatted||(this._formatted=pi(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=di),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 ui={[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 gi(e,t){let i=void 0,n=-1;for(let o=0;o<e.length;o++){const s=e.charCodeAt(o);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||t&&47===s)-1!==n&&(i+=encodeURIComponent(e.substring(n,o)),n=-1),void 0!==i&&(i+=e.charAt(o));else{void 0===i&&(i=e.substr(0,o));const t=ui[s];void 0!==t?(-1!==n&&(i+=encodeURIComponent(e.substring(n,o)),n=-1),i+=t):-1===n&&(n=o)}}return-1!==n&&(i+=encodeURIComponent(e.substring(n))),void 0!==i?i: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+=ui[n]):void 0!==t&&(t+=e[i])}return void 0!==t?t:e}function mi(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,s["i"]&&(i=i.replace(/\//g,"\\")),i}function pi(e,t){const i=t?fi:gi;let n="",{scheme:o,authority:s,path:r,query:a,fragment:l}=e;if(o&&(n+=o,n+=":"),(s||"file"===o)&&(n+=ai,n+=ai),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),e=t.indexOf(":"),-1===e?n+=i(t,!1):(n+=i(t.substr(0,e),!1),n+=":",n+=i(t.substr(e+1),!1)),n+="@"}s=s.toLowerCase(),e=s.indexOf(":"),-1===e?n+=i(s,!1):(n+=i(s.substr(0,e),!1),n+=s.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)}return a&&(n+="?",n+=i(a,!1)),l&&(n+="#",n+=t?l:gi(l,!1)),n}function _i(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+_i(e.substr(3)):e}}const bi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function vi(e){return e.match(bi)?e.replace(bi,e=>_i(e)):e}class wi{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 wi(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return wi.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return wi.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column}isBeforeOrEqual(e){return wi.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column}static compare(e,t){let i=0|e.lineNumber,n=0|t.lineNumber;if(i===n){let i=0|e.column,n=0|t.column;return i-n}return i-n}clone(){return new wi(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new wi(e.lineNumber,e.column)}static isIPosition(e){return e&&"number"===typeof e.lineNumber&&"number"===typeof e.column}}class Ci{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 Ci.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Ci.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))}containsRange(e){return Ci.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 Ci.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 Ci.plusRange(this,e)}static plusRange(e,t){let i,n,o,s;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?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new Ci(i,n,o,s)}intersectRanges(e){return Ci.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,c=t.endColumn;return i<r?(i=r,n=a):i===r&&(n=Math.max(n,a)),o>l?(o=l,s=c):o===l&&(s=Math.min(s,c)),i>o||i===o&&n>s?null:new Ci(i,n,o,s)}equalsRange(e){return Ci.equalsRange(this,e)}static equalsRange(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Ci.getEndPosition(this)}static getEndPosition(e){return new wi(e.endLineNumber,e.endColumn)}getStartPosition(){return Ci.getStartPosition(this)}static getStartPosition(e){return new wi(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Ci(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Ci(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Ci.collapseToStart(this)}static collapseToStart(e){return new Ci(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new Ci(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Ci(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){const i=0|e.endColumn,n=0|t.endColumn;return i-n}return i-n}return i-n}return i-n}const i=e?1:0,n=t?1:0;return i-n}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}}class yi extends Ci{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 wi(this.positionLineNumber,this.positionColumn)}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 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,o){return 0===o?new yi(e,t,i,n):new yi(i,n,e,t)}}class Si{constructor(e,t,i){this._tokenBrand=void 0,this.offset=0|e,this.type=t,this.language=i}toString(){return"("+this.offset+", "+this.type+")"}}class xi{constructor(e,t){this._tokenizationResultBrand=void 0,this.tokens=e,this.endState=t}}class ki{constructor(e,t){this._tokenizationResult2Brand=void 0,this.tokens=e,this.endState=t}}var Li,Ei,Di,Ni,Ii,Ti,Mi,Oi,Ai,Pi,Ri,Fi,Bi,Wi,Vi,zi,Hi,Ki,ji,Ui,$i,qi,Gi,Yi,Xi,Zi,Qi,Ji,en,tn,nn,on,sn,rn,an;(function(e){e[e["Unknown"]=0]="Unknown",e[e["Disabled"]=1]="Disabled",e[e["Enabled"]=2]="Enabled"})(Li||(Li={})),function(e){e[e["KeepWhitespace"]=1]="KeepWhitespace",e[e["InsertAsSnippet"]=4]="InsertAsSnippet"}(Ei||(Ei={})),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"}(Di||(Di={})),function(e){e[e["Deprecated"]=1]="Deprecated"}(Ni||(Ni={})),function(e){e[e["Invoke"]=0]="Invoke",e[e["TriggerCharacter"]=1]="TriggerCharacter",e[e["TriggerForIncompleteCompletions"]=2]="TriggerForIncompleteCompletions"}(Ii||(Ii={})),function(e){e[e["EXACT"]=0]="EXACT",e[e["ABOVE"]=1]="ABOVE",e[e["BELOW"]=2]="BELOW"}(Ti||(Ti={})),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"}(Mi||(Mi={})),function(e){e[e["LF"]=1]="LF",e[e["CRLF"]=2]="CRLF"}(Oi||(Oi={})),function(e){e[e["Text"]=0]="Text",e[e["Read"]=1]="Read",e[e["Write"]=2]="Write"}(Ai||(Ai={})),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"}(Pi||(Pi={})),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["autoClosingBrackets"]=5]="autoClosingBrackets",e[e["autoClosingDelete"]=6]="autoClosingDelete",e[e["autoClosingOvertype"]=7]="autoClosingOvertype",e[e["autoClosingQuotes"]=8]="autoClosingQuotes",e[e["autoIndent"]=9]="autoIndent",e[e["automaticLayout"]=10]="automaticLayout",e[e["autoSurround"]=11]="autoSurround",e[e["bracketPairColorization"]=12]="bracketPairColorization",e[e["guides"]=13]="guides",e[e["codeLens"]=14]="codeLens",e[e["codeLensFontFamily"]=15]="codeLensFontFamily",e[e["codeLensFontSize"]=16]="codeLensFontSize",e[e["colorDecorators"]=17]="colorDecorators",e[e["columnSelection"]=18]="columnSelection",e[e["comments"]=19]="comments",e[e["contextmenu"]=20]="contextmenu",e[e["copyWithSyntaxHighlighting"]=21]="copyWithSyntaxHighlighting",e[e["cursorBlinking"]=22]="cursorBlinking",e[e["cursorSmoothCaretAnimation"]=23]="cursorSmoothCaretAnimation",e[e["cursorStyle"]=24]="cursorStyle",e[e["cursorSurroundingLines"]=25]="cursorSurroundingLines",e[e["cursorSurroundingLinesStyle"]=26]="cursorSurroundingLinesStyle",e[e["cursorWidth"]=27]="cursorWidth",e[e["disableLayerHinting"]=28]="disableLayerHinting",e[e["disableMonospaceOptimizations"]=29]="disableMonospaceOptimizations",e[e["domReadOnly"]=30]="domReadOnly",e[e["dragAndDrop"]=31]="dragAndDrop",e[e["emptySelectionClipboard"]=32]="emptySelectionClipboard",e[e["extraEditorClassName"]=33]="extraEditorClassName",e[e["fastScrollSensitivity"]=34]="fastScrollSensitivity",e[e["find"]=35]="find",e[e["fixedOverflowWidgets"]=36]="fixedOverflowWidgets",e[e["folding"]=37]="folding",e[e["foldingStrategy"]=38]="foldingStrategy",e[e["foldingHighlight"]=39]="foldingHighlight",e[e["foldingImportsByDefault"]=40]="foldingImportsByDefault",e[e["unfoldOnClickAfterEndOfLine"]=41]="unfoldOnClickAfterEndOfLine",e[e["fontFamily"]=42]="fontFamily",e[e["fontInfo"]=43]="fontInfo",e[e["fontLigatures"]=44]="fontLigatures",e[e["fontSize"]=45]="fontSize",e[e["fontWeight"]=46]="fontWeight",e[e["formatOnPaste"]=47]="formatOnPaste",e[e["formatOnType"]=48]="formatOnType",e[e["glyphMargin"]=49]="glyphMargin",e[e["gotoLocation"]=50]="gotoLocation",e[e["hideCursorInOverviewRuler"]=51]="hideCursorInOverviewRuler",e[e["hover"]=52]="hover",e[e["inDiffEditor"]=53]="inDiffEditor",e[e["inlineSuggest"]=54]="inlineSuggest",e[e["letterSpacing"]=55]="letterSpacing",e[e["lightbulb"]=56]="lightbulb",e[e["lineDecorationsWidth"]=57]="lineDecorationsWidth",e[e["lineHeight"]=58]="lineHeight",e[e["lineNumbers"]=59]="lineNumbers",e[e["lineNumbersMinChars"]=60]="lineNumbersMinChars",e[e["linkedEditing"]=61]="linkedEditing",e[e["links"]=62]="links",e[e["matchBrackets"]=63]="matchBrackets",e[e["minimap"]=64]="minimap",e[e["mouseStyle"]=65]="mouseStyle",e[e["mouseWheelScrollSensitivity"]=66]="mouseWheelScrollSensitivity",e[e["mouseWheelZoom"]=67]="mouseWheelZoom",e[e["multiCursorMergeOverlapping"]=68]="multiCursorMergeOverlapping",e[e["multiCursorModifier"]=69]="multiCursorModifier",e[e["multiCursorPaste"]=70]="multiCursorPaste",e[e["occurrencesHighlight"]=71]="occurrencesHighlight",e[e["overviewRulerBorder"]=72]="overviewRulerBorder",e[e["overviewRulerLanes"]=73]="overviewRulerLanes",e[e["padding"]=74]="padding",e[e["parameterHints"]=75]="parameterHints",e[e["peekWidgetDefaultFocus"]=76]="peekWidgetDefaultFocus",e[e["definitionLinkOpensInPeek"]=77]="definitionLinkOpensInPeek",e[e["quickSuggestions"]=78]="quickSuggestions",e[e["quickSuggestionsDelay"]=79]="quickSuggestionsDelay",e[e["readOnly"]=80]="readOnly",e[e["renameOnType"]=81]="renameOnType",e[e["renderControlCharacters"]=82]="renderControlCharacters",e[e["renderFinalNewline"]=83]="renderFinalNewline",e[e["renderLineHighlight"]=84]="renderLineHighlight",e[e["renderLineHighlightOnlyWhenFocus"]=85]="renderLineHighlightOnlyWhenFocus",e[e["renderValidationDecorations"]=86]="renderValidationDecorations",e[e["renderWhitespace"]=87]="renderWhitespace",e[e["revealHorizontalRightPadding"]=88]="revealHorizontalRightPadding",e[e["roundedSelection"]=89]="roundedSelection",e[e["rulers"]=90]="rulers",e[e["scrollbar"]=91]="scrollbar",e[e["scrollBeyondLastColumn"]=92]="scrollBeyondLastColumn",e[e["scrollBeyondLastLine"]=93]="scrollBeyondLastLine",e[e["scrollPredominantAxis"]=94]="scrollPredominantAxis",e[e["selectionClipboard"]=95]="selectionClipboard",e[e["selectionHighlight"]=96]="selectionHighlight",e[e["selectOnLineNumbers"]=97]="selectOnLineNumbers",e[e["showFoldingControls"]=98]="showFoldingControls",e[e["showUnused"]=99]="showUnused",e[e["snippetSuggestions"]=100]="snippetSuggestions",e[e["smartSelect"]=101]="smartSelect",e[e["smoothScrolling"]=102]="smoothScrolling",e[e["stickyTabStops"]=103]="stickyTabStops",e[e["stopRenderingLineAfter"]=104]="stopRenderingLineAfter",e[e["suggest"]=105]="suggest",e[e["suggestFontSize"]=106]="suggestFontSize",e[e["suggestLineHeight"]=107]="suggestLineHeight",e[e["suggestOnTriggerCharacters"]=108]="suggestOnTriggerCharacters",e[e["suggestSelection"]=109]="suggestSelection",e[e["tabCompletion"]=110]="tabCompletion",e[e["tabIndex"]=111]="tabIndex",e[e["unusualLineTerminators"]=112]="unusualLineTerminators",e[e["useShadowDOM"]=113]="useShadowDOM",e[e["useTabStops"]=114]="useTabStops",e[e["wordSeparators"]=115]="wordSeparators",e[e["wordWrap"]=116]="wordWrap",e[e["wordWrapBreakAfterCharacters"]=117]="wordWrapBreakAfterCharacters",e[e["wordWrapBreakBeforeCharacters"]=118]="wordWrapBreakBeforeCharacters",e[e["wordWrapColumn"]=119]="wordWrapColumn",e[e["wordWrapOverride1"]=120]="wordWrapOverride1",e[e["wordWrapOverride2"]=121]="wordWrapOverride2",e[e["wrappingIndent"]=122]="wrappingIndent",e[e["wrappingStrategy"]=123]="wrappingStrategy",e[e["showDeprecated"]=124]="showDeprecated",e[e["inlayHints"]=125]="inlayHints",e[e["editorClassName"]=126]="editorClassName",e[e["pixelRatio"]=127]="pixelRatio",e[e["tabFocusMode"]=128]="tabFocusMode",e[e["layoutInfo"]=129]="layoutInfo",e[e["wrappingInfo"]=130]="wrappingInfo"}(Ri||(Ri={})),function(e){e[e["TextDefined"]=0]="TextDefined",e[e["LF"]=1]="LF",e[e["CRLF"]=2]="CRLF"}(Fi||(Fi={})),function(e){e[e["LF"]=0]="LF",e[e["CRLF"]=1]="CRLF"}(Bi||(Bi={})),function(e){e[e["None"]=0]="None",e[e["Indent"]=1]="Indent",e[e["IndentOutdent"]=2]="IndentOutdent",e[e["Outdent"]=3]="Outdent"}(Wi||(Wi={})),function(e){e[e["Other"]=0]="Other",e[e["Type"]=1]="Type",e[e["Parameter"]=2]="Parameter"}(Vi||(Vi={})),function(e){e[e["Automatic"]=0]="Automatic",e[e["Explicit"]=1]="Explicit"}(zi||(zi={})),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["NumLock"]=78]="NumLock",e[e["ScrollLock"]=79]="ScrollLock",e[e["Semicolon"]=80]="Semicolon",e[e["Equal"]=81]="Equal",e[e["Comma"]=82]="Comma",e[e["Minus"]=83]="Minus",e[e["Period"]=84]="Period",e[e["Slash"]=85]="Slash",e[e["Backquote"]=86]="Backquote",e[e["BracketLeft"]=87]="BracketLeft",e[e["Backslash"]=88]="Backslash",e[e["BracketRight"]=89]="BracketRight",e[e["Quote"]=90]="Quote",e[e["OEM_8"]=91]="OEM_8",e[e["IntlBackslash"]=92]="IntlBackslash",e[e["Numpad0"]=93]="Numpad0",e[e["Numpad1"]=94]="Numpad1",e[e["Numpad2"]=95]="Numpad2",e[e["Numpad3"]=96]="Numpad3",e[e["Numpad4"]=97]="Numpad4",e[e["Numpad5"]=98]="Numpad5",e[e["Numpad6"]=99]="Numpad6",e[e["Numpad7"]=100]="Numpad7",e[e["Numpad8"]=101]="Numpad8",e[e["Numpad9"]=102]="Numpad9",e[e["NumpadMultiply"]=103]="NumpadMultiply",e[e["NumpadAdd"]=104]="NumpadAdd",e[e["NUMPAD_SEPARATOR"]=105]="NUMPAD_SEPARATOR",e[e["NumpadSubtract"]=106]="NumpadSubtract",e[e["NumpadDecimal"]=107]="NumpadDecimal",e[e["NumpadDivide"]=108]="NumpadDivide",e[e["KEY_IN_COMPOSITION"]=109]="KEY_IN_COMPOSITION",e[e["ABNT_C1"]=110]="ABNT_C1",e[e["ABNT_C2"]=111]="ABNT_C2",e[e["AudioVolumeMute"]=112]="AudioVolumeMute",e[e["AudioVolumeUp"]=113]="AudioVolumeUp",e[e["AudioVolumeDown"]=114]="AudioVolumeDown",e[e["BrowserSearch"]=115]="BrowserSearch",e[e["BrowserHome"]=116]="BrowserHome",e[e["BrowserBack"]=117]="BrowserBack",e[e["BrowserForward"]=118]="BrowserForward",e[e["MediaTrackNext"]=119]="MediaTrackNext",e[e["MediaTrackPrevious"]=120]="MediaTrackPrevious",e[e["MediaStop"]=121]="MediaStop",e[e["MediaPlayPause"]=122]="MediaPlayPause",e[e["LaunchMediaPlayer"]=123]="LaunchMediaPlayer",e[e["LaunchMail"]=124]="LaunchMail",e[e["LaunchApp2"]=125]="LaunchApp2",e[e["MAX_VALUE"]=126]="MAX_VALUE"}(Hi||(Hi={})),function(e){e[e["Hint"]=1]="Hint",e[e["Info"]=2]="Info",e[e["Warning"]=4]="Warning",e[e["Error"]=8]="Error"}(Ki||(Ki={})),function(e){e[e["Unnecessary"]=1]="Unnecessary",e[e["Deprecated"]=2]="Deprecated"}(ji||(ji={})),function(e){e[e["Inline"]=1]="Inline",e[e["Gutter"]=2]="Gutter"}(Ui||(Ui={})),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"}($i||($i={})),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"}(qi||(qi={})),function(e){e[e["Left"]=1]="Left",e[e["Center"]=2]="Center",e[e["Right"]=4]="Right",e[e["Full"]=7]="Full"}(Gi||(Gi={})),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"}(Yi||(Yi={})),function(e){e[e["None"]=0]="None",e[e["Text"]=1]="Text",e[e["Blocks"]=2]="Blocks"}(Xi||(Xi={})),function(e){e[e["Smooth"]=0]="Smooth",e[e["Immediate"]=1]="Immediate"}(Zi||(Zi={})),function(e){e[e["Auto"]=1]="Auto",e[e["Hidden"]=2]="Hidden",e[e["Visible"]=3]="Visible"}(Qi||(Qi={})),function(e){e[e["LTR"]=0]="LTR",e[e["RTL"]=1]="RTL"}(Ji||(Ji={})),function(e){e[e["Invoke"]=1]="Invoke",e[e["TriggerCharacter"]=2]="TriggerCharacter",e[e["ContentChange"]=3]="ContentChange"}(en||(en={})),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"}(tn||(tn={})),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"}(on||(on={})),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"}(sn||(sn={})),function(e){e[e["AlwaysGrowsWhenTypingAtEdges"]=0]="AlwaysGrowsWhenTypingAtEdges",e[e["NeverGrowsWhenTypingAtEdges"]=1]="NeverGrowsWhenTypingAtEdges",e[e["GrowsOnlyWhenTypingBefore"]=2]="GrowsOnlyWhenTypingBefore",e[e["GrowsOnlyWhenTypingAfter"]=3]="GrowsOnlyWhenTypingAfter"}(rn||(rn={})),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 ln{static chord(e,t){return Et(e,t)}}function cn(){return{editor:void 0,languages:void 0,CancellationTokenSource:ft,Emitter:rt,KeyCode:Hi,KeyMod:ln,Position:wi,Range:Ci,Selection:yi,SelectionDirection:Ji,MarkerSeverity:Ki,MarkerTag:ji,Uri:ci,Token:Si}}ln.CtrlCmd=2048,ln.Shift=1024,ln.Alt=512,ln.WinCtrl=256;var dn;i("769f");(function(e){function t(t){return t[e.DI_DEPENDENCIES]||[]}e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=t})(dn||(dn={}));const hn=gn("instantiationService");function un(e,t,i,n){t[dn.DI_TARGET]===t?t[dn.DI_DEPENDENCIES].push({id:e,index:i,optional:n}):(t[dn.DI_DEPENDENCIES]=[{id:e,index:i,optional:n}],t[dn.DI_TARGET]=t)}function gn(e){if(dn.serviceIds.has(e))return dn.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");un(t,e,n,!1)};return t.toString=()=>e,dn.serviceIds.set(e,t),t}function fn(e){return function(t,i,n){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");un(e,t,n,!0)}}const mn=gn("codeEditorService");class pn{constructor(){this._zoomLevel=0,this._lastZoomLevelChangeTime=0,this._onDidChangeZoomLevel=new rt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this._zoomFactor=1}getZoomLevel(){return this._zoomLevel}getTimeSinceLastZoomLevelChanged(){return Date.now()-this._lastZoomLevelChangeTime}getZoomFactor(){return this._zoomFactor}getPixelRatio(){let e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}function _n(){return pn.INSTANCE.getZoomLevel()}function bn(){return pn.INSTANCE.getTimeSinceLastZoomLevelChanged()}function vn(e){return pn.INSTANCE.onDidChangeZoomLevel(e)}function wn(){return pn.INSTANCE.getZoomFactor()}function Cn(){return pn.INSTANCE.getPixelRatio()}pn.INSTANCE=new pn;const yn=navigator.userAgent,Sn=yn.indexOf("Firefox")>=0,xn=yn.indexOf("AppleWebKit")>=0,kn=yn.indexOf("Chrome")>=0,Ln=!kn&&yn.indexOf("Safari")>=0,En=!kn&&!Ln&&xn,Dn=yn.indexOf("Android")>=0,Nn=window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches,In={clipboard:{writeText:s["g"]||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:s["g"]||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>s["g"]||Nn?0:navigator.keyboard||Ln?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function Tn(e,t){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new An(0!==n?[Mn(i,t),Mn(n,t)]:[Mn(i,t)])}function Mn(e,t){const i=!!(2048&e),n=!!(256&e),o=2===t?n:i,s=!!(1024&e),r=!!(512&e),a=2===t?i:n,l=255&e;return new On(o,s,r,a,l)}class On{constructor(e,t,i,n,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=o}equals(e){return 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}toChord(){return new An([this])}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class An{constructor(e){if(0===e.length)throw Ie("parts");this.parts=e}}class Pn{constructor(e,t,i,n,o,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=o,this.keyAriaLabel=s}}class Rn{}function Fn(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return Lt.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(Sn){if(59===t)return 80;if(107===t)return 81;if(109===t)return 83;if(s["f"]&&224===t)return 57}else if(xn){if(91===t)return 57;if(s["f"]&&93===t)return 57;if(!s["f"]&&92===t)return 57}return vt[t]||0}const Bn=s["f"]?256:2048,Wn=512,Vn=1024,zn=s["f"]?2048:256;class Hn{constructor(e){this._standardKeyboardEventBrand=!0;let 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.keyCode=Fn(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._asRuntimeKeybinding=this._computeRuntimeKeybinding()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeybinding(){return this._asRuntimeKeybinding}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|=Bn),this.altKey&&(t|=Wn),this.shiftKey&&(t|=Vn),this.metaKey&&(t|=zn),t|=e,t}_computeRuntimeKeybinding(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new On(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let Kn=!1,jn=null;function Un(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return Kn=!0,null}catch(t){return Kn=!0,null}return e.parent}class $n{static getSameOriginWindowChain(){if(!jn){jn=[];let e,t=window;do{e=Un(t),e?jn.push({window:t,iframeElement:t.frameElement||null}):jn.push({window:t,iframeElement:null}),t=e}while(t)}return jn.slice(0)}static hasDifferentOriginAncestor(){return jn||this.getSameOriginWindowChain(),Kn}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0,o=this.getSameOriginWindowChain();for(const s of o){if(i+=s.window.scrollY,n+=s.window.scrollX,s.window===t)break;if(!s.iframeElement)break;let e=s.iframeElement.getBoundingClientRect();i+=e.top,n+=e.left}return{top:i,left:n}}}class qn{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=0===e.button,this.middleButton=1===e.button,this.rightButton=2===e.button,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,"dblclick"===e.type&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,"number"===typeof e.pageX?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);let t=$n.getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class Gn{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){let t=e,i=e;if("undefined"!==typeof t.wheelDeltaY)this.deltaY=t.wheelDeltaY/120;else if("undefined"!==typeof 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?Sn&&!s["f"]?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if("undefined"!==typeof t.wheelDeltaX)Ln&&s["i"]?this.deltaX=-t.wheelDeltaX/120:this.deltaX=t.wheelDeltaX/120;else if("undefined"!==typeof 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?Sn&&!s["f"]?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation()}}var Yn=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Xn(e){return!!e&&"function"===typeof e.then}function Zn(e){const t=new ft,i=e(t.token),n=new Promise((e,n)=>{const o=t.token.onCancellationRequested(()=>{o.dispose(),t.dispose(),n(Ne())});Promise.resolve(i).then(i=>{o.dispose(),t.dispose(),e(i)},e=>{o.dispose(),t.dispose(),n(e)})});return new class{cancel(){t.cancel()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}class Qn{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{this.queuedPromise=null;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)})})}}class Jn{constructor(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){return 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()}})),this.timeout=setTimeout(()=>{this.timeout=null,this.doResolve&&this.doResolve(null)},t),this.completionPromise}isTriggered(){return null!==this.timeout}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject&&this.doReject(Ne()),this.completionPromise=null)}cancelTimeout(){null!==this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){this.cancel()}}class eo{constructor(e){this.delayer=new Jn(e),this.throttler=new Qn}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}dispose(){this.delayer.dispose()}}function to(e,t){return t?new Promise((i,n)=>{const o=setTimeout(()=>{s.dispose(),i()},e),s=t.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(Ne())})}):Zn(t=>to(e,t))}function io(e,t=0){const i=setTimeout(e,t);return qe(()=>clearTimeout(i))}class no{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 oo{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class so{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(){this.runner&&this.runner()}}let ro;(function(){ro="function"!==typeof requestIdleCallback||"function"!==typeof cancelIdleCallback?e=>{const t=setTimeout(()=>{const t=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0,clearTimeout(t))}}}:(e,t)=>{const i=requestIdleCallback(e,"number"===typeof t?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(i))}}}})();class ao{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=ro(()=>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}}var lo,co;(function(e){function t(e){return Yn(this,void 0,void 0,(function*(){let t=void 0;const i=yield Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("undefined"!==typeof t)throw t;return i}))}function i(e){return new Promise((t,i)=>Yn(this,void 0,void 0,(function*(){try{yield e(t,i)}catch(n){i(n)}})))}e.settled=t,e.withAsyncBody=i})(lo||(lo={})),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.userData="vscode-userdata",e.vscodeCustomEditor="vscode-custom-editor",e.vscodeNotebook="vscode-notebook",e.vscodeNotebookCell="vscode-notebook-cell",e.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",e.vscodeNotebookCellOutput="vscode-notebook-cell-output",e.vscodeInteractive="vscode-interactive",e.vscodeInteractiveInput="vscode-interactive-input",e.vscodeSettings="vscode-settings",e.vscodeWorkspaceTrust="vscode-workspace-trust",e.vscodeTerminal="vscode-terminal",e.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.extension="extension",e.vscodeFileResource="vscode-file",e.tmp="tmp"}(co||(co={}));class ho{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)return this._delegate(e);const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let r="path="+encodeURIComponent(e.path);return"string"===typeof o&&(r+="&tkn="+encodeURIComponent(o)),ci.from({scheme:s["h"]?this._preferredWebSchema:co.vscodeRemoteResource,authority:`${i}:${n}`,path:"/vscode-remote-resource",query:r})}}const uo=new ho;class go{asBrowserUri(e,t){const i=this.toUri(e,t);return i.scheme===co.vscodeRemote?uo.rewrite(i):i.scheme===co.file&&(s["g"]||"function"===typeof s["b"].importScripts&&s["b"].origin===`${co.vscodeFileResource}://${go.FALLBACK_AUTHORITY}`)?i.with({scheme:co.vscodeFileResource,authority:i.authority||go.FALLBACK_AUTHORITY,query:null,fragment:null}):i}toUri(e,t){return ci.isUri(e)?e:ci.parse(t.toUrl(e))}}go.FALLBACK_AUTHORITY="vscode-app";const fo=new go;function mo(e){while(e.firstChild)e.firstChild.remove()}function po(e){var t;return null!==(t=null===e||void 0===e?void 0:e.isConnected)&&void 0!==t&&t}class _o{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 bo(e,t,i,n){return new _o(e,t,i,n)}function vo(e){return function(t){return e(new qn(t))}}function wo(e){return function(t){return e(new Hn(t))}}let Co=function(e,t,i,n){let o=i;return"click"===t||"mousedown"===t?o=vo(i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(o=wo(i)),bo(e,t,o,n)};function yo(e,t){return bo(e,"mouseout",i=>{let n=i.relatedTarget;while(n&&n!==e)n=n.parentNode;n!==e&&t(i)})}function So(e,t){return bo(e,"pointerout",i=>{let n=i.relatedTarget;while(n&&n!==e)n=n.parentNode;n!==e&&t(i)})}let xo,ko,Lo=null;function Eo(e){if(!Lo){const e=e=>setTimeout(()=>e((new Date).getTime()),0);Lo=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}return Lo.call(self,e)}class Do{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){xe(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let e=[],t=null,i=!1,n=!1,o=()=>{i=!1,t=e,e=[],n=!0;while(t.length>0){t.sort(Do.sort);let e=t.shift();e.execute()}n=!1};ko=(t,n=0)=>{let s=new Do(t,n);return e.push(s),i||(i=!0,Eo(o)),s},xo=(e,i)=>{if(n){let n=new Do(e,i);return t.push(n),n}return ko(e,i)}})();const No=8,Io=function(e,t){return t};class To extends Ye{constructor(e,t,i,n=Io,o=No){super();let s=null,r=0,a=this._register(new no),l=()=>{r=(new Date).getTime(),i(s),s=null};this._register(bo(e,t,e=>{s=n(s,e);let t=(new Date).getTime()-r;t>=o?(a.cancel(),l()):a.setIfNotSet(l,o-t)}))}}function Mo(e,t,i,n,o){return new To(e,t,i,n,o)}function Oo(e){return document.defaultView.getComputedStyle(e,null)}function Ao(e){if(e!==document.body)return new Ro(e.clientWidth,e.clientHeight);if(s["c"]&&window.visualViewport)return new Ro(window.visualViewport.width,window.visualViewport.height);if(window.innerWidth&&window.innerHeight)return new Ro(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new Ro(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new Ro(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class Po{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let n=Oo(e),o="0";return n&&(o=n.getPropertyValue?n.getPropertyValue(t):n.getAttribute(i)),Po.convertToPixels(e,o)}static getBorderLeftWidth(e){return Po.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Po.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Po.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Po.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Po.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Po.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Po.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Po.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Po.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Po.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Po.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Po.getDimension(e,"margin-bottom","marginBottom")}}class Ro{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Ro(e,t):this}static is(e){return"object"===typeof e&&"number"===typeof e.height&&"number"===typeof e.width}static lift(e){return e instanceof Ro?e:new Ro(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&(e.width===t.width&&e.height===t.height)}}function Fo(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;while(null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement){i-=e.scrollTop;const o=qo(e)?null:Oo(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=Po.getBorderLeftWidth(e),i+=Po.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}function Bo(e){let t=e.getBoundingClientRect();return{left:t.left+Wo.scrollX,top:t.top+Wo.scrollY,width:t.width,height:t.height}}const Wo=new class{get scrollX(){return"number"===typeof window.scrollX?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft}get scrollY(){return"number"===typeof window.scrollY?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop}};function Vo(e){let t=Po.getMarginLeft(e)+Po.getMarginRight(e);return e.offsetWidth+t}function zo(e){let t=Po.getBorderLeftWidth(e)+Po.getBorderRightWidth(e),i=Po.getPaddingLeft(e)+Po.getPaddingRight(e);return e.offsetWidth-t-i}function Ho(e){let t=Po.getBorderTopWidth(e)+Po.getBorderBottomWidth(e),i=Po.getPaddingTop(e)+Po.getPaddingBottom(e);return e.offsetHeight-t-i}function Ko(e){let t=Po.getMarginTop(e)+Po.getMarginBottom(e);return e.offsetHeight+t}function jo(e,t){while(e){if(e===t)return!0;e=e.parentNode}return!1}function Uo(e,t,i){while(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}function $o(e,t,i){return!!Uo(e,t,i)}function qo(e){return e&&!!e.host&&!!e.mode}function Go(e){return!!Yo(e)}function Yo(e){while(e.parentNode){if(e===document.body)return null;e=e.parentNode}return qo(e)?e:null}function Xo(){let e=document.activeElement;while(null===e||void 0===e?void 0:e.shadowRoot)e=e.shadowRoot.activeElement;return e}function Zo(e=document.getElementsByTagName("head")[0]){let t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}let Qo=null;function Jo(){return Qo||(Qo=Zo()),Qo}function es(e){var t,i;return(null===(t=null===e||void 0===e?void 0:e.sheet)||void 0===t?void 0:t.rules)?e.sheet.rules:(null===(i=null===e||void 0===e?void 0:e.sheet)||void 0===i?void 0:i.cssRules)?e.sheet.cssRules:[]}function ts(e,t,i=Jo()){i&&t&&i.sheet.insertRule(e+"{"+t+"}",0)}function is(e,t=Jo()){if(!t)return;let i=es(t),n=[];for(let o=0;o<i.length;o++){let t=i[o];-1!==t.selectorText.indexOf(e)&&n.push(o)}for(let o=n.length-1;o>=0;o--)t.sheet.deleteRule(n[o])}function ns(e){return"object"===typeof HTMLElement?e instanceof HTMLElement:e&&"object"===typeof e&&1===e.nodeType&&"string"===typeof e.nodeName}const os={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",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",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:xn?"webkitAnimationStart":"animationstart",ANIMATION_END:xn?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:xn?"webkitAnimationIteration":"animationiteration"},ss={stop:function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)}};function rs(e){let t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}function as(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}class ls extends Ye{constructor(e){super(),this._onDidFocus=this._register(new rt),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new rt),this.onDidBlur=this._onDidBlur.event;let t=jo(document.activeElement,e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{let i=jo(document.activeElement,e);i!==t&&(t?o():n())},this._register(bo(e,os.FOCUS,n,!0)),this._register(bo(e,os.BLUR,o,!0))}}function cs(e){return new ls(e)}function ds(e,...t){if(e.append(...t),1===t.length&&"string"!==typeof t[0])return t[0]}function hs(e,...t){e.innerText="",ds(e,...t)}const us=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var gs;function fs(e,t,i,...n){let o=us.exec(t);if(!o)throw new Error("Bad use of emmet");i=Object.assign({},i||{});let s,r=o[1]||"div";return s=e!==gs.HTML?document.createElementNS(e,r):document.createElement(r),o[3]&&(s.id=o[3]),o[4]&&(s.className=o[4].replace(/\./g," ").trim()),Object.keys(i).forEach(e=>{const t=i[e];"undefined"!==typeof t&&(/^on\w+$/.test(e)?s[e]=t:"selected"===e?t&&s.setAttribute(e,"true"):s.setAttribute(e,t))}),s.append(...n),s}function ms(e,t,...i){return fs(gs.HTML,e,t,...i)}function ps(...e){for(let t of e)t.style.display="",t.removeAttribute("aria-hidden")}function _s(...e){for(let t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function bs(e){return Array.prototype.slice.call(document.getElementsByTagName(e),0)}function vs(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio}function ws(e){window.open(e,"_blank","noopener")}function Cs(e){const t=()=>{e(),i=ko(t)};let i=ko(t);return qe(()=>i.dispose())}function ys(e){return e?`url('${fo.asBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Ss(e){return`'${e.replace(/'/g,"%27")}'`}(function(e){e["HTML"]="http://www.w3.org/1999/xhtml",e["SVG"]="http://www.w3.org/2000/svg"})(gs||(gs={})),ms.SVG=function(e,t,...i){return fs(gs.SVG,e,t,...i)},uo.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");class xs extends rt{constructor(){super(),this._subscriptions=new Ge,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(bo(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Hn(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)),this._subscriptions.add(bo(window,"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)),this._subscriptions.add(bo(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(bo(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(bo(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(bo(window,"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 xs.instance||(xs.instance=new xs),xs.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}function ks(e,t){const i=window.matchMedia(e);"function"===typeof i.addEventListener?i.addEventListener("change",t):i.addListener(t)}function Ls(e){return!e||"string"!==typeof e||0===e.trim().length}const Es=/{(\d+)}/g;function Ds(e,...t){return 0===t.length?e:e.replace(Es,(function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]}))}function Ns(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function Is(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Ts(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let n=0;while(e.indexOf(t,n)===n)n+=i;return e.substring(n)}function Ms(e,t){if(!e||!t)return e;const i=t.length,n=e.length;if(0===i||0===n)return e;let o=n,s=-1;while(1){if(s=e.lastIndexOf(t,o-1),-1===s||s+i!==o)break;if(0===s)return"";o=s}return e.substring(0,o)}function Os(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function As(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=Is(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 Ps(e){if("^"===e.source||"^$"===e.source||"$"===e.source||"^\\s*$"===e.source)return!1;const t=e.exec("");return!(!t||0!==e.lastIndex)}function Rs(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")}function Fs(e){return e.split(/\r\n|\r|\n/)}function Bs(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 Ws(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 Vs(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 zs(e,t){return e<t?-1:e>t?1:0}function Hs(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){let n=e.charCodeAt(i),s=t.charCodeAt(o);if(n<s)return-1;if(n>s)return 1}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function Ks(e,t){return js(e,t,0,e.length,0,t.length)}function js(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){let r=e.charCodeAt(i),a=t.charCodeAt(o);if(r===a)continue;if(r>=128||a>=128)return Hs(e.toLowerCase(),t.toLowerCase(),i,n,o,s);Us(r)&&(r-=32),Us(a)&&(a-=32);const l=r-a;if(0!==l)return l}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function Us(e){return e>=97&&e<=122}function $s(e){return e>=65&&e<=90}function qs(e,t){return e.length===t.length&&0===js(e,t)}function Gs(e,t){const i=t.length;return!(t.length>e.length)&&0===js(e,t,0,i)}function Ys(e,t){let i,n=Math.min(e.length,t.length);for(i=0;i<n;i++)if(e.charCodeAt(i)!==t.charCodeAt(i))return i;return n}function Xs(e,t){let i,n=Math.min(e.length,t.length);const o=e.length-1,s=t.length-1;for(i=0;i<n;i++)if(e.charCodeAt(o-i)!==t.charCodeAt(s-i))return i;return n}function Zs(e){return 55296<=e&&e<=56319}function Qs(e){return 56320<=e&&e<=57343}function Js(e,t){return t-56320+(e-55296<<10)+65536}function er(e,t,i){const n=e.charCodeAt(i);if(Zs(n)&&i+1<t){const t=e.charCodeAt(i+1);if(Qs(t))return Js(n,t)}return n}function tr(e,t){const i=e.charCodeAt(t-1);if(Qs(i)&&t>1){const n=e.charCodeAt(t-2);if(Zs(n))return Js(n,i)}return i}function ir(e,t){const i=wr.getInstance(),n=t,o=e.length,s=er(e,o,t);t+=s>=65536?2:1;let r=i.getGraphemeBreakType(s);while(t<o){const n=er(e,o,t),s=i.getGraphemeBreakType(n);if(vr(r,s))break;t+=n>=65536?2:1,r=s}return t-n}function nr(e,t){const i=wr.getInstance(),n=t,o=tr(e,t);t-=o>=65536?2:1;let s=i.getGraphemeBreakType(o);while(t>0){const n=tr(e,t),o=i.getGraphemeBreakType(n);if(vr(o,s))break;t-=n>=65536?2:1,s=o}return n-t}const or=/(?:[\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-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function sr(e){return or.test(e)}const rr=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function ar(e){return rr.test(e)}const lr=/^[\t\n\r\x20-\x7E]*$/;function cr(e){return lr.test(e)}const dr=/[\u2028\u2029]/;function hr(e){return dr.test(e)}function ur(e){for(let t=0,i=e.length;t<i;t++)if(gr(e.charCodeAt(t)))return!0;return!1}function gr(e){return e=+e,e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function fr(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<=129003||e>=129280&&e<=129535||e>=129648&&e<=129750}const mr=String.fromCharCode(65279);function pr(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function _r(e){const t=26;return e%=2*t,e<t?String.fromCharCode(97+e):String.fromCharCode(65+e-t)}function br(e){const t=wr.getInstance();return t.getGraphemeBreakType(e)}function vr(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 wr{constructor(){this._data=Cr()}static getInstance(){return wr._INSTANCE||(wr._INSTANCE=new wr),wr._INSTANCE}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;while(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 Cr(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,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,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,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,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,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,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,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,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,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,2259,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,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,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,6848,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,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,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,9776,9783,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,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,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,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,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function yr(e,t){if(0===e)return 0;const i=Sr(e,t);if(void 0!==i)return i;const n=tr(t,e);return e-=xr(n),e}function Sr(e,t){let i=tr(t,e);e-=xr(i);while(kr(i)||65039===i||8419===i){if(0===e)return;i=tr(t,e),e-=xr(i)}if(fr(i)){if(e>=0){const i=tr(t,e);8205===i&&(e-=xr(i))}return e}}function xr(e){return e>=65536?2:1}function kr(e){return 127995<=e&&e<=127999}var Lr,Er;wr._INSTANCE=null;class Dr{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){const t=e.charCodeAt(0),i=this._value.charCodeAt(this._pos);return t-i}value(){return this._value[this._pos]}}class Nr{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++){const t=this._value.charCodeAt(this._to);if(46===t){if(!e)break;this._from++}else e=!1}return this}cmp(e){return this._caseSensitive?Hs(e,this._value,0,e.length,this._from,this._to):js(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class Ir{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){return this._value=e.replace(/\\$|\/$/,""),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++){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?Hs(e,this._value,0,e.length,this._from,this._to):js(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class Tr{constructor(e){this._ignorePathCasing=e,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 Ir(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),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 Ks(e,this._value.scheme);if(2===this._states[this._stateIdx])return Ks(e,this._value.authority);if(3===this._states[this._stateIdx])return this._pathIterator.cmp(e);if(4===this._states[this._stateIdx])return zs(e,this._value.query);if(5===this._states[this._stateIdx])return zs(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 Mr{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 Or{constructor(e){this._iter=e}static forUris(e=(()=>!1)){return new Or(new Tr(e))}static forStrings(){return new Or(new Dr)}static forConfigKeys(){return new Or(new Nr)}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new Mr,this._root.segment=i.value());const o=[];n=this._root;while(1){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new Mr,n.left.segment=i.value()),o.push([-1,n]),n=n.left;else if(e<0)n.right||(n.right=new Mr,n.right.segment=i.value()),o.push([1,n]),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new Mr,n.mid.segment=i.value()),o.push([0,n]),n=n.mid}}const s=n.value;n.value=t,n.key=e;for(let r=o.length-1;r>=0;r--){const e=o[r][1];e.updateHeight();const t=e.balanceFactor();if(t<-1||t>1){const t=o[r][0],i=o[r+1][0];if(1===t&&1===i)o[r][1]=e.rotateLeft();else if(-1===t&&-1===i)o[r][1]=e.rotateRight();else if(1===t&&-1===i)e.right=o[r+1][1]=o[r+1][1].rotateRight(),o[r][1]=e.rotateLeft();else{if(-1!==t||1!==i)throw new Error;e.left=o[r+1][1]=o[r+1][1].rotateLeft(),o[r][1]=e.rotateRight()}if(r>0)switch(o[r-1][0]){case-1:o[r-1][1].left=o[r][1];break;case 1:o[r-1][1].right=o[r][1];break;case 0:o[r-1][1].mid=o[r][1];break}else this._root=o[0][1]}}return s}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;while(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?void 0:t.value)&&void 0===(null===t||void 0===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),o=[];let s=this._root;while(s){const e=n.cmp(s.segment);if(e>0)o.push([-1,s]),s=s.left;else if(e<0)o.push([1,s]),s=s.right;else{if(!n.hasNext())break;n.next(),o.push([0,s]),s=s.mid}}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const e=this._min(s.right),{key:t,value:i,segment:n}=e;this._delete(e.key,!1),s.key=t,s.value=i,s.segment=n}else{const e=null!==(i=s.left)&&void 0!==i?i:s.right;if(o.length>0){const[t,i]=o[o.length-1];switch(t){case-1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e;break}}else this._root=e}for(let e=o.length-1;e>=0;e--){const t=o[e][1];t.updateHeight();const i=t.balanceFactor();if(i>1?(t.right.balanceFactor()>=0||(t.right=o[e+1][1]=o[e+1][1].rotateRight()),o[e][1]=t.rotateLeft()):i<-1&&(t.left.balanceFactor()<=0||(t.left=o[e+1][1]=o[e+1][1].rotateLeft()),o[e][1]=t.rotateRight()),e>0)switch(o[e-1][0]){case-1:o[e-1][1].left=o[e][1];break;case 1:o[e-1][1].right=o[e][1];break;case 0:o[e-1][1].mid=o[e][1];break}else this._root=o[0][1]}}}_min(e){while(e.left)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n=void 0;while(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){const t=this._iter.reset(e);let i=this._root;while(i){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())return i.mid?this._entries(i.mid):void 0;t.next(),i=i.mid}}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}*_entries(e){e&&(e.left&&(yield*this._entries(e.left)),e.value&&(yield[e.key,e.value]),e.mid&&(yield*this._entries(e.mid)),e.right&&(yield*this._entries(e.right)))}}class Ar{constructor(e,t){this.uri=e,this.value=t}}class Pr{constructor(e,t){this[Lr]="ResourceMap",e instanceof Pr?(this.map=new Map(e.map),this.toKey=null!==t&&void 0!==t?t:Pr.defaultToKey):(this.map=new Map,this.toKey=null!==e&&void 0!==e?e:Pr.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),new Ar(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){"undefined"!==typeof t&&(e=e.bind(t));for(let[i,n]of this.map)e(n.value,n.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(Lr=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}}Pr.defaultToKey=e=>e.toString();class Rr{constructor(){this[Er]="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:this.addItemLast(n);break;default:this.addItemLast(n);break}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;while(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](){return 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](){return 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](){return 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}[(Er=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;while(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 Fr extends Rr{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))}}var Br=i("c223");function Wr(e){let t=JSON.parse(e);return t=Vr(t),t}function Vr(e,t=0){if(!e||t>200)return e;if("object"===typeof e){switch(e.$mid){case 1:return ci.revive(e);case 2:return new RegExp(e.source,e.flags)}if(e instanceof Br["a"]||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;i<e.length;++i)e[i]=Vr(e[i],t+1);else for(const i in e)Object.hasOwnProperty.call(e,i)&&(e[i]=Vr(e[i],t+1))}return e}function zr(e){return e.replace(/[\\/]/g,$t.sep)}function Hr(e){return-1===e.indexOf("/")&&(e=zr(e)),/^[a-zA-Z]:(\/|$)/.test(e)&&(e="/"+e),e}function Kr(e,t,i,n=Jt){if(e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(i){const i=Gs(e,t);if(!i)return!1;if(t.length===e.length)return!0;let o=t.length;return t.charAt(t.length-1)===n&&o--,e.charAt(o)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function jr(e){return mi(e,!0)}class Ur{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:zs(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()}joinPath(e,...t){return ci.joinPath(e,...t)}basenameOrAuthority(e){return qr(e)||e.authority}basename(e){return $t.basename(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===co.file?t=ci.file(Xt(jr(e))).path:(t=$t.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===co.file?ci.file(qt(jr(e))).path:$t.normalize(e.path),e.with({path:t})}resolvePath(e,t){if(e.scheme===co.file){const i=ci.file(Gt(jr(e),t));return e.with({authority:i.authority,path:i.path})}return t=Hr(t),e.with({path:$t.resolve(e.path,t)})}}const $r=new Ur(()=>!1),qr=($r.isEqual.bind($r),$r.basenameOrAuthority.bind($r),$r.basename.bind($r)),Gr=($r.dirname.bind($r),$r.joinPath.bind($r),$r.normalizePath.bind($r));$r.resolvePath.bind($r);var Yr;function Xr(e){return"string"===typeof e}function Zr(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Qr(e){return"number"===typeof e&&!isNaN(e)}function Jr(e){return!0===e||!1===e}function ea(e){return"undefined"===typeof e}function ta(e){return!ia(e)}function ia(e){return ea(e)||null===e}function na(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function oa(e){return"function"===typeof e}function sa(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)ra(e[n],t[n])}function ra(e,t){if(Xr(t)){if(typeof e!==t)throw new Error("argument does not match constraint: typeof "+t)}else if(oa(t)){try{if(e instanceof t)return}catch(i){}if(!ia(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 aa(e){let t=[],i=Object.getPrototypeOf(e);while(Object.prototype!==i)t=t.concat(Object.getOwnPropertyNames(i)),i=Object.getPrototypeOf(i);return t}function la(e){const t=[];for(const i of aa(e))"function"===typeof e[i]&&t.push(i);return t}function ca(e,t){const i=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)};let n={};for(const o of e)n[o]=i(o);return n}function da(e){return null===e?void 0:e}function ha(e,t="Unreachable"){throw new Error(t)}(function(e){function t(t){const i=new Map,n=t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";"));n.split(";").forEach(e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(e.META_DATA_MIME,o),i}e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=t})(Yr||(Yr={}));const ua=gn("commandService"),ga=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new rt,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.description){const t=[];for(let n of e.description.args)t.push(n.constraint);const i=e.handler;e.handler=function(e,...n){return sa(n,t),i(e,...n)}}const{id:i}=e;let n=this._commands.get(i);n||(n=new Je,this._commands.set(i,n));let o=n.unshift(e),s=qe(()=>{o();const e=this._commands.get(i);(null===e||void 0===e?void 0:e.isEmpty())&&this._commands.delete(i)});return this._onDidRegisterCommand.fire(i),s}registerCommandAlias(e,t){return ga.registerCommand(e,(e,...i)=>e.get(ua).executeCommand(t,...i))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return Ae.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}};var fa;ga.registerCommand("noop",()=>{}),function(e){e[e["API"]=0]="API",e[e["USER"]=1]="USER"}(fa||(fa={}));var ma=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const pa=gn("openerService");Object.freeze({_serviceBrand:void 0,registerOpener(){return Ye.None},registerValidator(){return Ye.None},registerExternalUriResolver(){return Ye.None},setDefaultExternalOpener(){},registerExternalOpener(){return Ye.None},open(){return ma(this,void 0,void 0,(function*(){return!1}))},resolveExternalUri(e){return ma(this,void 0,void 0,(function*(){return{resolved:e,dispose(){}}}))}});function _a(e,t){return ci.isUri(e)?qs(e.scheme,t):Gs(e,t+":")}var ba=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},va=function(e,t){return function(i,n){t(i,n,e)}},wa=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Ca=class{constructor(e){this._commandService=e}open(e,t){return wa(this,void 0,void 0,(function*(){if(!_a(e,co.command))return!1;if(!(null===t||void 0===t?void 0:t.allowCommands))return!0;"string"===typeof e&&(e=ci.parse(e));let i=[];try{i=Wr(decodeURIComponent(e.query))}catch(n){try{i=Wr(e.query)}catch(o){}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0}))}};Ca=ba([va(0,ua)],Ca);let ya=class{constructor(e){this._editorService=e}open(e,t){return wa(this,void 0,void 0,(function*(){"string"===typeof e&&(e=ci.parse(e));let i=void 0;const n=/^L?(\d+)(?:,(\d+))?/.exec(e.fragment);return n&&(i={startLineNumber:parseInt(n[1]),startColumn:n[2]?parseInt(n[2]):1},e=e.with({fragment:""})),e.scheme===co.file&&(e=Gr(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,context:(null===t||void 0===t?void 0:t.fromUserGesture)?fa.USER:fa.API},null===t||void 0===t?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),null===t||void 0===t?void 0:t.openToSide),!0}))}};ya=ba([va(0,mn)],ya);let Sa=class{constructor(e,t){this._openers=new Je,this._validators=new Je,this._resolvers=new Je,this._resolvedUriTargets=new Pr(e=>e.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Je,this._defaultExternalOpener={openExternal:e=>wa(this,void 0,void 0,(function*(){return _a(e,co.http)||_a(e,co.https)?ws(e):window.location.href=e,!0}))},this._openers.push({open:(e,t)=>wa(this,void 0,void 0,(function*(){return!!((null===t||void 0===t?void 0:t.openExternal)||_a(e,co.mailto)||_a(e,co.http)||_a(e,co.https))&&(yield this._doOpenExternal(e,t),!0)}))}),this._openers.push(new Ca(t)),this._openers.push(new ya(e))}registerOpener(e){const t=this._openers.unshift(e);return{dispose:t}}registerValidator(e){const t=this._validators.push(e);return{dispose:t}}registerExternalUriResolver(e){const t=this._resolvers.push(e);return{dispose:t}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){const t=this._externalOpeners.push(e);return{dispose:t}}open(e,t){var i;return wa(this,void 0,void 0,(function*(){const n="string"===typeof e?ci.parse(e):e,o=null!==(i=this._resolvedUriTargets.get(n))&&void 0!==i?i:e;for(const e of this._validators)if(!(yield e.shouldOpen(o)))return!1;for(const i of this._openers){const n=yield i.open(e,t);if(n)return!0}return!1}))}resolveExternalUri(e,t){return wa(this,void 0,void 0,(function*(){for(const n of this._resolvers)try{const i=yield n.resolveExternalUri(e,t);if(i)return this._resolvedUriTargets.has(i.resolved)||this._resolvedUriTargets.set(i.resolved,e),i}catch(i){}throw new Error("Could not resolve external URI: "+e.toString())}))}_doOpenExternal(e,t){return wa(this,void 0,void 0,(function*(){const i="string"===typeof e?ci.parse(e):e;let n,o;try{n=(yield this.resolveExternalUri(i,t)).resolved}catch(s){n=i}if(o="string"===typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),null===t||void 0===t?void 0:t.allowContributedOpeners){const e="string"===typeof(null===t||void 0===t?void 0:t.allowContributedOpeners)?null===t||void 0===t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners){const n=yield t.openExternal(o,{sourceUri:i,preferredOpenerId:e},ut.None);if(n)return!0}}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},ut.None)}))}dispose(){this._validators.clear()}};function xa(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function ka(e){if(!e||"object"!==typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.keys(e).forEach(i=>{e[i]&&"object"===typeof e[i]?t[i]=ka(e[i]):t[i]=e[i]}),t}function La(e){if(!e||"object"!==typeof e)return e;const t=[e];while(t.length>0){const e=t.shift();Object.freeze(e);for(const i in e)if(Ea.call(e,i)){const n=e[i];"object"!==typeof n||Object.isFrozen(n)||t.push(n)}}return e}Sa=ba([va(0,mn),va(1,ua)],Sa);const Ea=Object.prototype.hasOwnProperty;function Da(e,t,i=!0){return Zr(e)?(Zr(t)&&Object.keys(t).forEach(n=>{n in e?i&&(Zr(e[n])&&Zr(t[n])?Da(e[n],t[n],i):e[n]=t[n]):e[n]=t[n]}),e):t}function Na(e,t){if(e===t)return!0;if(null===e||void 0===e||null===t||void 0===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(!Na(e[i],t[i]))return!1}else{const o=[];for(n in e)o.push(n);o.sort();const s=[];for(n in t)s.push(n);if(s.sort(),!Na(o,s))return!1;for(i=0;i<o.length;i++)if(!Na(e[o[i]],t[o[i]]))return!1}return!0}function Ia(e,t,i){const n=t(e);return"undefined"===typeof n?i:n}const Ta={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0};class Ma extends Ye{constructor(e,t={}){super(),this._onDidUpdate=this._register(new rt),this._editor=e,this._options=Da(t,Ta,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=Boolean(this._options.alwaysRevealFirst),this._register(this._editor.onDidDispose(()=>this.dispose())),this._register(this._editor.onDidUpdateDiff(()=>this._onDiffUpdated())),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition(e=>{this.ignoreSelectionChange||(this.nextIdx=-1)})),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel(e=>{this.revealFirst=!0})),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&null!==this._editor.getLineChanges()&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach(e=>{!this._options.ignoreCharChanges&&e.charChanges?e.charChanges.forEach(e=>{this.ranges.push({rhs:!0,range:new Ci(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})}):0===e.modifiedEndLineNumber?this.ranges.push({rhs:!0,range:new Ci(e.modifiedStartLineNumber,1,e.modifiedStartLineNumber+1,1)}):this.ranges.push({rhs:!0,range:new Ci(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber+1,1)})}),this.ranges.sort((e,t)=>Ci.compareRangesUsingStarts(e.range,t.range)),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1,i=this._editor.getPosition();if(i){for(let n=0,o=this.ranges.length;n<o&&!t;n++){let o=this.ranges[n].range;i.isBeforeOrEqual(o.getStartPosition())&&(this.nextIdx=n+(e?0:-1),t=!0)}t||(this.nextIdx=e?0:this.ranges.length-1),this.nextIdx<0&&(this.nextIdx=this.ranges.length-1)}else this.nextIdx=0}_move(e,t){if(xa(!this.disposed,"Illegal State - diff navigator has been disposed"),!this.canNavigate())return;-1===this.nextIdx?this._initIdx(e):e?(this.nextIdx+=1,this.nextIdx>=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));let i=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{let e=i.range.getStartPosition();this._editor.setPosition(e),this._editor.revealRangeInCenter(i.range,t)}finally{this.ignoreSelectionChange=!1}}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this._move(!0,e)}previous(e=0){this._move(!1,e)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}}const Oa=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new rt,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))}},Aa=s["f"]?1.5:1.35,Pa=8;class Ra{constructor(e){this._bareFontInfoBrand=void 0,this.zoomLevel=e.zoomLevel,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}static createFromValidatedSettings(e,t,i,n){const o=e.get(42),s=e.get(46),r=e.get(45),a=e.get(44),l=e.get(58),c=e.get(55);return Ra._create(o,s,r,a,l,c,t,i,n)}static _create(e,t,i,n,o,s,r,a,l){0===o?o=Aa*i:o<Pa&&(o*=i),o=Math.round(o),o<Pa&&(o=Pa);const c=1+(l?0:.1*Oa.getZoomLevel());return i*=c,o*=c,new Ra({zoomLevel:r,pixelRatio:a,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:n,lineHeight:o,letterSpacing:s})}getId(){return this.zoomLevel+"-"+this.pixelRatio+"-"+this.fontFamily+"-"+this.fontWeight+"-"+this.fontSize+"-"+this.fontFeatureSettings+"-"+this.lineHeight+"-"+this.letterSpacing}getMassagedFontFamily(e){const t=Ra._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}const Fa=1;class Ba extends Ra{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=Fa,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.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}}function Wa(e){return e&&"string"===typeof e.id}const Va={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var za,Ha,Ka;(function(e){e[e["Left"]=1]="Left",e[e["Center"]=2]="Center",e[e["Right"]=4]="Right",e[e["Full"]=7]="Full"})(za||(za={})),function(e){e[e["Inline"]=1]="Inline",e[e["Gutter"]=2]="Gutter"}(Ha||(Ha={}));class ja{constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,0|e.tabSize),this.indentSize=0|e.tabSize,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.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&Na(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 Ua{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}(function(e){e[e["Disabled"]=0]="Disabled",e[e["EnabledForActive"]=1]="EnabledForActive",e[e["Enabled"]=2]="Enabled"})(Ka||(Ka={}));class $a{constructor(e,t,i){this.visibleColumn=e,this.className=t,this.horizontalLine=i}}class qa{constructor(e,t){this.top=e,this.endColumn=t}}class Ga{constructor(e,t,i,n,o,s){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=n,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class Ya{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function Xa(e,t){return(t<<5)-t+e|0}function Za(e,t){t=Xa(149417,t);for(let i=0,n=e.length;i<n;i++)t=Xa(e.charCodeAt(i),t);return t}function Qa(e,t,i=32){const n=i-t,o=~((1<<n)-1);return(e<<t|(o&e)>>>n)>>>0}function Ja(e,t=0,i=e.byteLength,n=0){for(let o=0;o<i;o++)e[t+o]=n}function el(e,t,i="0"){while(e.length<t)e=i+e;return e}function tl(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join(""):el((e>>>0).toString(16),t/4)}class il{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,o,s=this._buffLen,r=this._leftoverHighSurrogate;0!==r?(n=r,o=-1,r=0):(n=e.charCodeAt(0),o=0);while(1){let a=n;if(Zs(n)){if(!(o+1<t)){r=n;break}{const t=e.charCodeAt(o+1);Qs(t)?(o++,a=Js(n,t)):a=65533}}else Qs(n)&&(a=65533);if(s=this._push(i,s,a),o++,!(o<t))break;n=e.charCodeAt(o)}this._buffLen=s,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()),tl(this._h0)+tl(this._h1)+tl(this._h2)+tl(this._h3)+tl(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Ja(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Ja(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=il._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,Qa(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let i,n,o,s=this._h0,r=this._h1,a=this._h2,l=this._h3,c=this._h4;for(let d=0;d<80;d++)d<20?(i=r&a|~r&l,n=1518500249):d<40?(i=r^a^l,n=1859775393):d<60?(i=r&a|r&l|a&l,n=2400959708):(i=r^a^l,n=3395469782),o=Qa(s,5)+i+c+n+e.getUint32(4*d,!1)&4294967295,c=l,l=a,a=Qa(r,30),r=s,s=o;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+c&4294967295}}function nl(e,t,i){return Math.min(Math.max(e,t),i)}il._bigBlock32=new DataView(new ArrayBuffer(320));const ol="**",sl="/",rl="[/\\\\]",al="[^/\\\\]",ll=/\//g;function cl(e){switch(e){case 0:return"";case 1:return al+"*?";default:return`(?:${rl}|${al}+${rl}|${rl}${al}+)*?`}}function dl(e,t){if(!e)return[];const i=[];let n=!1,o=!1,s="";for(const r of e){switch(r){case t:if(!n&&!o){i.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=r}return s&&i.push(s),i}function hl(e){if(!e)return"";let t="";const i=dl(e,sl);if(i.every(e=>e===ol))t=".*";else{let e=!1;i.forEach((n,o)=>{if(n===ol)return void(e||(t+=cl(2),e=!0));let s=!1,r="",a=!1,l="";for(const e of n)if("}"!==e&&s)r+=e;else if(!a||"]"===e&&l)switch(e){case"{":s=!0;continue;case"[":a=!0;continue;case"}":const i=dl(r,","),n=`(?:${i.map(e=>hl(e)).join("|")})`;t+=n,s=!1,r="";break;case"]":t+="["+l+"]",a=!1,l="";break;case"?":t+=al;continue;case"*":t+=cl(1);continue;default:t+=Is(e)}else{let t;t="-"===e?e:"^"!==e&&"!"!==e||l?e===sl?"":Is(e):"^",l+=t}o<i.length-1&&(i[o+1]!==ol||o+2<i.length)&&(t+=rl),e=!1})}return t}const ul=/^\*\*\/\*\.[\w\.-]+$/,gl=/^\*\*\/([\w\.-]+)\/?$/,fl=/^{\*\*\/[\*\.]?[\w\.-]+\/?(,\*\*\/[\*\.]?[\w\.-]+\/?)*}$/,ml=/^{\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?(,\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?)*}$/,pl=/^\*\*((\/[\w\.-]+)+)\/?$/,_l=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,bl=new Fr(1e4),vl=function(){return!1},wl=function(){return null};function Cl(e,t){if(!e)return wl;let i;i="string"!==typeof e?e.pattern:e,i=i.trim();const n=`${i}_${!!t.trimForExclusions}`;let o,s=bl.get(n);if(s)return yl(s,e);if(ul.test(i)){const e=i.substr(4);s=function(t,n){return"string"===typeof t&&t.endsWith(e)?i:null}}else s=(o=gl.exec(Sl(i,t)))?xl(o[1],i):(t.trimForExclusions?ml:fl).test(i)?kl(i,t):(o=pl.exec(Sl(i,t)))?Ll(o[1].substr(1),i,!0):(o=_l.exec(Sl(i,t)))?Ll(o[1],i,!1):El(i);return bl.set(n,s),yl(s,e)}function yl(e,t){return"string"===typeof t?e:function(i,n){return Kr(i,t.base)?e(Yt(t.base,i),n):null}}function Sl(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function xl(e,t){const i="/"+e,n="\\"+e,o=function(o,s){return"string"!==typeof o?null:s?s===e?t:null:o===e||o.endsWith(i)||o.endsWith(n)?t:null},s=[e];return o.basenames=s,o.patterns=[t],o.allBasenames=s,o}function kl(e,t){const i=Ol(e.slice(1,-1).split(",").map(e=>Cl(e,t)).filter(e=>e!==wl),e),n=i.length;if(!n)return wl;if(1===n)return i[0];const o=function(t,n){for(let o=0,s=i.length;o<s;o++)if(i[o](t,n))return e;return null},s=i.find(e=>!!e.allBasenames);s&&(o.allBasenames=s.allBasenames);const r=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return r.length&&(o.allPaths=r),o}function Ll(e,t,i){const n=Jt===$t.sep,o=n?e:e.replace(ll,Jt),s=Jt+o,r=$t.sep+e,a=i?function(i,a){return"string"!==typeof i||i!==o&&!i.endsWith(s)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,s){return"string"!==typeof i||i!==o&&(n||i!==e)?null:t};return a.allPaths=[(i?"*/":"./")+e],a}function El(e){try{const t=new RegExp(`^${hl(e)}$`);return function(i){return t.lastIndex=0,"string"===typeof i&&t.test(i)?e:null}}catch(t){return wl}}function Dl(e,t,i){return!(!e||"string"!==typeof t)&&Nl(e)(t,void 0,i)}function Nl(e,t={}){if(!e)return vl;if("string"===typeof e||Il(e)){const i=Cl(e,t);if(i===wl)return vl;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return Tl(e,t)}function Il(e){const t=e;return t&&"string"===typeof t.base&&"string"===typeof t.pattern}function Tl(e,t){const i=Ol(Object.getOwnPropertyNames(e).map(i=>Ml(i,e[i],t)).filter(e=>e!==wl)),n=i.length;if(!n)return wl;if(!i.some(e=>!!e.requiresSiblings)){if(1===n)return i[0];const e=function(e,t){for(let n=0,o=i.length;n<o;n++){const o=i[n](e,t);if(o)return o}return null},t=i.find(e=>!!e.allBasenames);t&&(e.allBasenames=t.allBasenames);const o=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return o.length&&(e.allPaths=o),e}const o=function(e,t,n){let o=void 0;for(let s=0,r=i.length;s<r;s++){const r=i[s];r.requiresSiblings&&n&&(t||(t=Zt(e)),o||(o=t.substr(0,t.length-Qt(e).length)));const a=r(e,t,o,n);if(a)return a}return null},s=i.find(e=>!!e.allBasenames);s&&(o.allBasenames=s.allBasenames);const r=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return r.length&&(o.allPaths=r),o}function Ml(e,t,i){if(!1===t)return wl;const n=Cl(e,i);if(n===wl)return wl;if("boolean"===typeof t)return n;if(t){const i=t.when;if("string"===typeof i){const t=(t,o,s,r)=>{if(!r||!n(t,o))return null;const a=i.replace("$(basename)",s),l=r(a);return Xn(l)?l.then(t=>t?e:null):l?e:null};return t.requiresSiblings=!0,t}}return n}function Ol(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 o;if(t){o=[];for(let e=0,i=n.length;e<i;e++)o.push(t)}else o=i.reduce((e,t)=>{const i=t.patterns;return i?e.concat(i):e},[]);const s=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?o[i]:null};s.basenames=n,s.patterns=o,s.allBasenames=n;const r=e.filter(e=>!e.basenames);return r.push(s),r}function Al(e,t,i,n){if(Array.isArray(e)){let o=0;for(const s of e){const e=Al(s,t,i,n);if(10===e)return e;e>o&&(o=e)}return o}if("string"===typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:o,pattern:s,scheme:r,hasAccessToAllModels:a}=e;if(!n&&!a)return 0;let l=0;if(r)if(r===t.scheme)l=10;else{if("*"!==r)return 0;l=5}if(o)if(o===i)l=10;else{if("*"!==o)return 0;l=Math.max(l,5)}if(s){let e;if(e="string"===typeof s?s:Object.assign(Object.assign({},s),{base:qt(s.base)}),e!==t.fsPath&&!Dl(e,t.fsPath))return 0;l=10}return l}return 0}const Pl=gn("modelService");function Rl(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}function Fl(e){return"string"!==typeof e&&(Array.isArray(e)?e.every(Fl):!!e.exclusive)}class Bl{constructor(){this._clock=0,this._entries=[],this._onDidChange=new rt}get onDidChange(){return 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),qe(()=>{if(i){let 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(let i of this._entries)i._score>0&&t.push(i.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){if(e){this._updateScores(e);for(const e of this._entries)e._score>0&&t(e)}}_updateScores(e){let t={uri:e.uri.toString(),language:e.getLanguageId()};if(!this._lastCandidate||this._lastCandidate.language!==t.language||this._lastCandidate.uri!==t.uri){this._lastCandidate=t;for(let t of this._entries)if(t._score=Al(t.selector,e.uri,e.getLanguageId(),Rl(e)),Fl(t.selector)&&t._score>0){for(let e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(Bl._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:e._time<t._time?1:e._time>t._time?-1:0}}new WeakMap;class Wl{constructor(){this._map=new Map,this._promises=new Map,this._onDidChange=new rt,this.onDidChange=this._onDidChange.event,this._colorMap=null}fire(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._map.set(e,t),this.fire([e]),qe(()=>{this._map.get(e)===t&&(this._map.delete(e),this.fire([e]))})}registerPromise(e,t){let i=null,n=!1;return this._promises.set(e,t.then(t=>{this._promises.delete(e),!n&&t&&(i=this.register(e,t))})),qe(()=>{n=!0,i&&i.dispose()})}getPromise(e){const t=this.get(e);if(t)return Promise.resolve(t);const i=this._promises.get(e);return i?i.then(t=>this.get(e)):null}get(e){return this._map.get(e)||null}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._map.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}}class Vl{constructor(){this._icons=new Map,this._onDidRegister=new rt}add(e){const t=this._icons.get(e.id);t?e.description?t.description=e.description:console.error("Duplicate registration of codicon "+e.id):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const zl=new Vl,Hl=zl;function Kl(e,t){return new Ul(e,t)}function jl(e){return e?e.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}class Ul{constructor(e,t,i){this.id=e,this.definition=t,this.description=i,zl.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var $l;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){if(e instanceof Ul)return["codicon","codicon-"+e.id];const n=t.exec(e.id);if(!n)return i(Ul.error);let[,o,s]=n;const r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s.substr(1)),r}function n(e){return i(e).join(" ")}function o(e){return"."+i(e).join(".")}e.asClassNameArray=i,e.asClassName=n,e.asCSSSelector=o})($l||($l={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(Ul||(Ul={}));class ql{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(1792&e)>>>8}static getFontStyle(e){return(14336&e)>>>11}static getForeground(e){return(8372224&e)>>>14}static getBackground(e){return(4286578688&e)>>>23}static getClassNameFromMetadata(e){let t=this.getForeground(e),i="mtk"+t,n=this.getFontStyle(e);return 1&n&&(i+=" mtki"),2&n&&(i+=" mtkb"),4&n&&(i+=" mtku"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;return 1&n&&(o+="font-style: italic;"),2&n&&(o+="font-weight: bold;"),4&n&&(o+="text-decoration: underline;"),o}}(function(){let e=Object.create(null);e[0]="symbol-method",e[1]="symbol-function",e[2]="symbol-constructor",e[3]="symbol-field",e[4]="symbol-variable",e[5]="symbol-class",e[6]="symbol-struct",e[7]="symbol-interface",e[8]="symbol-module",e[9]="symbol-property",e[10]="symbol-event",e[11]="symbol-operator",e[12]="symbol-unit",e[13]="symbol-value",e[14]="symbol-constant",e[15]="symbol-enum",e[16]="symbol-enum-member",e[17]="symbol-keyword",e[27]="symbol-snippet",e[18]="symbol-text",e[19]="symbol-color",e[20]="symbol-file",e[21]="symbol-reference",e[22]="symbol-customcolor",e[23]="symbol-folder",e[24]="symbol-type-parameter",e[25]="account",e[26]="issues"})();(function(){let e=Object.create(null);e["method"]=0,e["function"]=1,e["constructor"]=2,e["field"]=3,e["variable"]=4,e["class"]=5,e["struct"]=6,e["interface"]=7,e["module"]=8,e["property"]=9,e["event"]=10,e["operator"]=11,e["unit"]=12,e["value"]=13,e["constant"]=14,e["enum"]=15,e["enum-member"]=16,e["enumMember"]=16,e["keyword"]=17,e["snippet"]=27,e["text"]=18,e["color"]=19,e["file"]=20,e["reference"]=21,e["customcolor"]=22,e["folder"]=23,e["type-parameter"]=24,e["typeParameter"]=24,e["account"]=25,e["issue"]=26})();var Gl,Yl,Xl,Zl,Ql;(function(e){e[e["Automatic"]=0]="Automatic",e[e["Explicit"]=1]="Explicit"})(Gl||(Gl={})),function(e){e[e["Invoke"]=1]="Invoke",e[e["TriggerCharacter"]=2]="TriggerCharacter",e[e["ContentChange"]=3]="ContentChange"}(Yl||(Yl={})),function(e){e[e["Text"]=0]="Text",e[e["Read"]=1]="Read",e[e["Write"]=2]="Write"}(Xl||(Xl={})),function(e){const t=new Map;t.set("file",0),t.set("module",1),t.set("namespace",2),t.set("package",3),t.set("class",4),t.set("method",5),t.set("property",6),t.set("field",7),t.set("constructor",8),t.set("enum",9),t.set("interface",10),t.set("function",11),t.set("variable",12),t.set("constant",13),t.set("string",14),t.set("number",15),t.set("boolean",16),t.set("array",17),t.set("object",18),t.set("key",19),t.set("null",20),t.set("enum-member",21),t.set("struct",22),t.set("event",23),t.set("operator",24),t.set("type-parameter",25);const i=new Map;function n(e){return t.get(e)}function o(e){return i.get(e)}function s(e,t){const n=i.get(e);let o=n&&Hl.get("symbol-"+n);return o||(console.info("No codicon found for SymbolKind "+e),o=Ul.symbolProperty),`${t?"inline":"block"} ${o.classNames}`}i.set(0,"file"),i.set(1,"module"),i.set(2,"namespace"),i.set(3,"package"),i.set(4,"class"),i.set(5,"method"),i.set(6,"property"),i.set(7,"field"),i.set(8,"constructor"),i.set(9,"enum"),i.set(10,"interface"),i.set(11,"function"),i.set(12,"variable"),i.set(13,"constant"),i.set(14,"string"),i.set(15,"number"),i.set(16,"boolean"),i.set(17,"array"),i.set(18,"object"),i.set(19,"key"),i.set(20,"null"),i.set(21,"enum-member"),i.set(22,"struct"),i.set(23,"event"),i.set(24,"operator"),i.set(25,"type-parameter"),e.fromString=n,e.toString=o,e.toCssClassName=s}(Zl||(Zl={}));class Jl{constructor(e){this.value=e}}Jl.Comment=new Jl("comment"),Jl.Imports=new Jl("imports"),Jl.Region=new Jl("region"),function(e){e[e["Other"]=0]="Other",e[e["Type"]=1]="Type",e[e["Parameter"]=2]="Parameter"}(Ql||(Ql={}));const ec=new Bl,tc=new Bl,ic=new Bl,nc=new Bl,oc=new Bl,sc=new Bl,rc=new Bl,ac=new Bl,lc=new Bl,cc=new Bl,dc=new Bl,hc=new Bl,uc=new Bl,gc=new Bl,fc=new Bl,mc=new Bl,pc=new Bl,_c=new Bl,bc=new Bl,vc=new Bl,wc=new Bl,Cc=new Bl,yc=new Bl,Sc=new Bl,xc=new Bl,kc=new Wl;class Lc{clone(){return this}equals(e){return this===e}}const Ec=new Lc,Dc="vs.editor.nullMode";function Nc(e,t,i,n){return new xi([new Si(n,"",e)],i)}function Ic(e,t,i,n){let o=new Uint32Array(2);return o[0]=n,o[1]=(16384|e<<0|2<<23)>>>0,new ki(o,null===i?Ec:i)}const Tc="editorWorkerService",Mc=gn(Tc),Oc=gn("modeService"),Ac=gn("textModelService"),Pc="$initialize";let Rc=!1;function Fc(e){s["h"]&&(Rc||(Rc=!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 Bc{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=0}}class Wc{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class Vc{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=2}}class zc{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class Hc{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class Kc{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,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send(new Bc(this._workerId,i,e,t))})}listen(e,t){let i=null;const n=new rt({onFirstListenerAdd:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new Vc(this._workerId,i,e,t))},onLastListenerRemove:()=>{this._pendingEmitters.delete(i),this._send(new Hc(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");let 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){let t=e.req,i=this._handler.handleMessage(e.method,e.args);i.then(e=>{this._send(new Wc(this._workerId,t,e,void 0))},e=>{e.detail instanceof Error&&(e.detail=Le(e.detail)),this._send(new Wc(this._workerId,t,void 0,Le(e)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(e=>{this._send(new zc(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){let 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 jc extends Ye{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=>{n&&n(e)})),this._protocol=new Kc({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(n){return Promise.reject(n)}},handleEvent:(e,t)=>{if($c(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(Uc(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 o=null;"undefined"!==typeof s["b"].require&&"function"===typeof s["b"].require.getConfig?o=s["b"].require.getConfig():"undefined"!==typeof s["b"].requirejs&&(o=s["b"].requirejs.s.contexts._.config);const r=la(i);this._onModuleLoaded=this._protocol.sendMessage(Pc,[this._worker.getId(),JSON.parse(JSON.stringify(o)),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(qc(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 Uc(e){return"o"===e[0]&&"n"===e[1]&&$s(e.charCodeAt(2))}function $c(e){return/^onDynamic/.test(e)&&$s(e.charCodeAt(9))}function qc(e,t,i){const n=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},o=e=>function(t){return i(e,t)};let s={};for(const r of e)$c(r)?s[r]=o(r):Uc(r)?s[r]=i(r,void 0):s[r]=n(r);return s}var Gc;const Yc=null===(Gc=window.trustedTypes)||void 0===Gc?void 0:Gc.createPolicy("defaultWorkerFactory",{createScriptURL:e=>e});function Xc(e,t){if(s["b"].MonacoEnvironment){if("function"===typeof s["b"].MonacoEnvironment.getWorker)return s["b"].MonacoEnvironment.getWorker(e,t);if("function"===typeof s["b"].MonacoEnvironment.getWorkerUrl){const i=s["b"].MonacoEnvironment.getWorkerUrl(e,t);return new Worker(Yc?Yc.createScriptURL(i):i,{name:t})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Zc(e){return"function"===typeof e.then}class Qc{constructor(e,t,i,n,o){this.id=t;const s=Xc("workerMain.js",i);Zc(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=o,"function"===typeof e.addEventListener&&e.addEventListener("error",o)})}getId(){return this.id}postMessage(e,t){this.worker&&this.worker.then(i=>i.postMessage(e,t))}dispose(){this.worker&&this.worker.then(e=>e.terminate()),this.worker=null}}class Jc{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){let n=++Jc.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new Qc(e,n,this._label||"anonymous"+n,t,e=>{Fc(e),this._webWorkerFailedBeforeError=e,i(e)})}}var ed;Jc.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"}(ed||(ed={}));class td{constructor(e){if(this._standardAutoClosingPairConditionalBrand=void 0,this.open=e.open,this.close=e.close,this._standardTokenMask=0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++){const i=e.notIn[t];switch(i){case"string":this._standardTokenMask|=2;break;case"comment":this._standardTokenMask|=1;break;case"regex":this._standardTokenMask|=4;break}}}isOK(e){return 0===(this._standardTokenMask&e)}}class id{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)nd(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),nd(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),nd(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),nd(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),1===t.close.length&&1===t.open.length&&nd(this.autoClosingPairsCloseSingleChar,t.close,t)}}function nd(e,t,i){e.has(t)?e.get(t).push(i):e.set(t,[i])}function od(e,t){let i=e.getCount(),n=e.findTokenIndexAtOffset(t),o=e.getLanguageId(n),s=n;while(s+1<i&&e.getLanguageId(s+1)===o)s++;let r=n;while(r>0&&e.getLanguageId(r-1)===o)r--;return new sd(e,o,r,s+1,e.getStartOffset(r),e.getEndOffset(s))}class sd{constructor(e,t,i,n,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=s}getLineContent(){const e=this._actual.getLineContent();return e.substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){const t=this._actual.getLineContent();return t.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 rd(e){return 0!==(7&e)}class ad{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(e=>new td(e)):e.brackets?this._autoClosingPairs=e.brackets.map(e=>new td({open:e[0],close:e[1]})):this._autoClosingPairs=[],e.colorizedBracketPairs?this._colorizedBracketPairs=ld(e.colorizedBracketPairs.map(e=>[e[0],e[1]])):e.brackets?this._colorizedBracketPairs=ld(e.brackets.map(e=>[e[0],e[1]]).filter(e=>!("<"===e[0]&&">"===e[1]))):this._colorizedBracketPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new td({open:t.open,close:t.close||""}))}this._autoCloseBefore="string"===typeof e.autoCloseBefore?e.autoCloseBefore:ad.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(){return this._autoCloseBefore}static shouldAutoClosePair(e,t,i){if(0===t.getTokenCount())return!0;const n=t.findTokenIndexAtOffset(i-2),o=t.getStandardTokenType(n);return e.isOK(o)}getSurroundingPairs(){return this._surroundingPairs}getColorizedBrackets(){return this._colorizedBracketPairs}}function ld(e){return e.filter(([e,t])=>""!==e&&""!==t)}let cd,dd,hd;function ud(){return cd||(cd=new TextDecoder("UTF-16LE")),cd}function gd(){return dd||(dd=new TextDecoder("UTF-16BE")),dd}function fd(){return hd||(hd=s["e"]()?ud():gd()),hd}ad.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=";:.,=}])> \n\t";const md="undefined"!==typeof TextDecoder;let pd,_d;function bd(e,t,i){const n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?vd(e,t,i):ud().decode(n)}function vd(e,t,i){let n=[],o=0;for(let s=0;s<i;s++){const i=Br["b"](e,t);t+=2,n[o++]=String.fromCharCode(i)}return n.join("")}md?(pd=e=>new wd(e),_d=bd):(pd=e=>new Cd,_d=vd);class wd{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 fd().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}write1(e){const t=this._capacity-this._bufferLength;t<=1&&(0===t||Zs(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCII(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIIString(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 Cd{constructor(){this._pieces=[],this._piecesLen=0}reset(){this._pieces=[],this._piecesLen=0}build(){return this._pieces.join("")}write1(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCII(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCIIString(e){this._pieces[this._piecesLen++]=e}}class yd{constructor(e,t,i,n,o,s){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=o,this.reversedRegex=s,this._openSet=yd._toSet(this.open),this._closeSet=yd._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}}function Sd(e){const t=e.length;e=e.map(e=>[e[0].toLowerCase(),e[1].toLowerCase()]);const i=[];for(let r=0;r<t;r++)i[r]=r;const n=(e,t)=>{const[i,n]=e,[o,s]=t;return i===o||i===s||n===o||n===s},o=(e,n)=>{const o=Math.min(e,n),s=Math.max(e,n);for(let r=0;r<t;r++)i[r]===s&&(i[r]=o)};for(let r=0;r<t;r++){const s=e[r];for(let a=r+1;a<t;a++){const t=e[a];n(s,t)&&o(i[r],i[a])}}const s=[];for(let r=0;r<t;r++){let n=[],o=[];for(let s=0;s<t;s++)if(i[s]===r){const[t,i]=e[s];n.push(t),o.push(i)}n.length>0&&s.push({open:n,close:o})}return s}class xd{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Sd(t);this.brackets=i.map((t,n)=>new yd(e,n,t.open,t.close,Dd(t.open,t.close,i,n),Nd(t.open,t.close,i,n))),this.forwardRegex=Id(this.brackets),this.reversedRegex=Td(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const e of n.open)this.textIsBracket[e]=n,this.textIsOpenBracket[e]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,e.length);for(const e of n.close)this.textIsBracket[e]=n,this.textIsOpenBracket[e]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,e.length)}}}function kd(e,t,i,n){for(let o=0,s=t.length;o<s;o++){if(o===i)continue;const s=t[o];for(const t of s.open)t.indexOf(e)>=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function Ld(e,t){return e.length-t.length}function Ed(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 Dd(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let s=0,r=o.length;s<r;s++)kd(o[s],i,n,o);return o=Ed(o),o.sort(Ld),o.reverse(),Od(o)}function Nd(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let s=0,r=o.length;s<r;s++)kd(o[s],i,n,o);return o=Ed(o),o.sort(Ld),o.reverse(),Od(o.map(Ad))}function Id(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=Ed(t),Od(t)}function Td(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=Ed(t),Od(t.map(Ad))}function Md(e){const t=/^[\w ]+$/.test(e);return e=Is(e),t?`\\b${e}\\b`:e}function Od(e){let t=`(${e.map(Md).join(")|(")})`;return As(t,!0)}const Ad=function(){function e(e){if(md){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return fd().decode(t)}{let t=[],i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charAt(n);return t.join("")}}let t=null,i=null;return function(n){return t!==n&&(t=n,i=e(t)),i}}();class Pd{static _findPrevBracketInText(e,t,i,n){let o=i.match(e);if(!o)return null;let s=i.length-(o.index||0),r=o[0].length,a=n+s;return new Ci(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,o){const s=Ad(i),r=s.substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,r,n)}static findNextBracketInText(e,t,i,n){let o=i.match(e);if(!o)return null;let s=o.index||0,r=o[0].length;if(0===r)return null;let a=n+s;return new Ci(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}}class Rd{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let 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 e=e.filter((e,t,i)=>i.indexOf(e)===t),e}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if(rd(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,r=Pd.findPrevBracketInRange(o,1,s,0,s.length);if(!r)return null;const a=s.substring(r.startColumn-1,r.endColumn-1).toLowerCase(),l=this._richEditBrackets.textIsOpenBracket[a];if(l)return null;const c=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(c)?{matchOpenBracket:a}:null}}function Fd(e){return e.global&&(e.lastIndex=0),!0}class Bd{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&Fd(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&Fd(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&Fd(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&Fd(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 Wd{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(e=>{const t=Wd._createOpenBracketRegExp(e[0]),i=Wd._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 o=0,s=this._regExpRules.length;o<s;o++){let e=this._regExpRules[o];const s=[{reg:e.beforeText,text:i},{reg:e.afterText,text:n},{reg:e.previousLineText,text:t}].every(e=>!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text)));if(s)return e.action}if(e>=2&&i.length>0&&n.length>0)for(let o=0,s=this._brackets.length;o<s;o++){let e=this._brackets[o];if(e.openRegExp.test(i)&&e.closeRegExp.test(n))return{indentAction:ed.IndentOutdent}}if(e>=2&&i.length>0)for(let o=0,s=this._brackets.length;o<s;o++){let e=this._brackets[o];if(e.openRegExp.test(i))return{indentAction:ed.Indent}}return null}static _createOpenBracketRegExp(e){let t=Is(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",Wd._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=Is(e);return/\B/.test(t.charAt(t.length-1))||(t+="\\b"),t="^\\s*"+t,Wd._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(t){return xe(t),null}}}class Vd{constructor(){this.data=new Map}add(e,t){xa(Xr(e)),xa(Zr(t)),xa(!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}}const zd=new Vd,Hd={JSONContribution:"base.contributions.json"};function Kd(e){return e.length>0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e}class jd{constructor(){this._onDidChangeSchema=new rt,this.schemasById={}}registerSchema(e,t){this.schemasById[Kd(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Ud=new jd;zd.add(Hd.JSONContribution,Ud);const $d={Configuration:"base.contributions.configuration"},qd={properties:{},patternProperties:{}},Gd={properties:{},patternProperties:{}},Yd={properties:{},patternProperties:{}},Xd={properties:{},patternProperties:{}},Zd={properties:{},patternProperties:{}},Qd={properties:{},patternProperties:{}},Jd="vscode://schemas/settings/resourceLanguage",eh=zd.as(Hd.JSONContribution);class th{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new rt,this._onDidUpdateConfiguration=new rt,this.defaultValues={},this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:o("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting",allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},eh.registerSchema(Jd,this.resourceLanguageSettingsSchema)}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=this.doRegisterConfigurations(e,t);eh.registerSchema(Jd,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(i)}registerOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t){const i=[];return e.forEach(e=>{i.push(...this.validateAndRegisterProperties(e,t,e.extensionInfo)),this.configurationContributors.push(e),this.registerJSONConfiguration(e)}),i}validateAndRegisterProperties(e,t=!0,i,n=3){var o;n=ia(e.scope)?n:e.scope;let s=[],r=e.properties;if(r)for(let l in r){if(t&&ah(l)){delete r[l];continue}const e=r[l];this.updatePropertyDefaultValue(l,e),nh.test(l)?e.scope=void 0:(e.scope=ia(e.scope)?n:e.scope,e.restricted=ia(e.restricted)?!!(null===(o=null===i||void 0===i?void 0:i.restrictedConfigurations)||void 0===o?void 0:o.includes(l)):e.restricted),!r[l].hasOwnProperty("included")||r[l].included?(this.configurationProperties[l]=r[l],!r[l].deprecationMessage&&r[l].markdownDeprecationMessage&&(r[l].deprecationMessage=r[l].markdownDeprecationMessage),s.push(l)):(this.excludedConfigurationProperties[l]=r[l],delete r[l])}let a=e.allOf;if(a)for(let l of a)s.push(...this.validateAndRegisterProperties(l,t,i,n));return s}getConfigurationProperties(){return this.configurationProperties}registerJSONConfiguration(e){const t=e=>{let i=e.properties;if(i)for(const t in i)this.updateSchema(t,i[t]);let n=e.allOf;n&&n.forEach(t)};t(e)}updateSchema(e,t){switch(qd.properties[e]=t,t.scope){case 1:Gd.properties[e]=t;break;case 2:Yd.properties[e]=t;break;case 6:Xd.properties[e]=t;break;case 3:Zd.properties[e]=t;break;case 4:Qd.properties[e]=t;break;case 5:Qd.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:o("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:o("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:Jd};this.updatePropertyDefaultValue(t,i),qd.properties[t]=i,Gd.properties[t]=i,Yd.properties[t]=i,Xd.properties[t]=i,Zd.properties[t]=i,Qd.properties[t]=i}this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.defaultValues[e];ea(i)&&(i=t.default),ea(i)&&(i=sh(t.type)),t.default=i}}const ih="\\[.*\\]$",nh=new RegExp(ih);function oh(e){return e.substring(1,e.length-1)}function sh(e){const t=Array.isArray(e)?e[0]:e;switch(t){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const rh=new th;function ah(e){return e.trim()?nh.test(e)?o("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==rh.getConfigurationProperties()[e]?o("config.property.duplicate","Cannot register '{0}'. This property is already registered.",e):null:o("config.property.empty","Cannot register an empty property")}zd.add($d.Configuration,rh);const lh=gn("configurationService");function ch(e,t){const i=Object.create(null);for(let n in e)dh(i,n,e[n],t);return i}function dh(e,t,i,n){const o=t.split("."),s=o.pop();let r=e;for(let l=0;l<o.length;l++){let e=o[l],i=r[e];switch(typeof i){case"undefined":i=r[e]=Object.create(null);break;case"object":break;default:return void n(`Ignoring ${t} as ${o.slice(0,l+1).join(".")} is ${JSON.stringify(i)}`)}r=i}if("object"===typeof r&&null!==r)try{r[s]=i}catch(a){n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}else n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}function hh(e,t){const i=t.split(".");uh(e,i)}function uh(e,t){const i=t.shift();if(0!==t.length){if(-1!==Object.keys(e).indexOf(i)){const n=e[i];"object"!==typeof n||Array.isArray(n)||(uh(n,t),0===Object.keys(n).length&&delete e[i])}}else delete e[i]}function gh(e,t,i){function n(e,t){let i=e;for(const n of t){if("object"!==typeof i||null===i)return;i=i[n]}return i}const o=t.split("."),s=n(e,o);return"undefined"===typeof s?i:s}function fh(){const e=zd.as($d.Configuration).getConfigurationProperties();return Object.keys(e)}function mh(){const e=Object.create(null),t=zd.as($d.Configuration).getConfigurationProperties();for(let i in t){let n=t[i].default;dh(e,i,n,e=>console.error("Conflict in default settings: "+e))}return e}class ph{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const _h=[];function bh(e,t,i){t instanceof ph||(t=new ph(t,[],i)),_h.push([e,t])}function vh(){return _h}var wh=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ch=function(e,t){return function(i,n){t(i,n,e)}};class yh{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}const Sh=gn("languageConfigurationService");let xh=class extends Ye{constructor(e,t){super(),this.configurationService=e,this.modeService=t,this.onDidChangeEmitter=this._register(new rt),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Lh));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])=>this.modeService.validateLanguageId(e));if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new yh(void 0));else for(const i of n)i&&(this.configurations.delete(i),this.onDidChangeEmitter.fire(new yh(i)))})),this._register(Th.onDidChange(e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new yh(e.languageId))}))}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=kh(e,this.configurationService,this.modeService),this.configurations.set(e,t)),t}};function kh(e,t,i){let n=Th.getLanguageConfiguration(e);if(!n){const t=i.validateLanguageId(e);if(!t)throw new Error("Unexpected languageId");n=new Ph(t,{})}const o=Eh(n.languageId,t),s=Oh([n.underlyingConfig,o]),r=new Ph(n.languageId,s);return r}xh=wh([Ch(0,lh),Ch(1,Oc)],xh);const Lh={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Eh(e,t){const i=t.getValue(Lh.brackets,{overrideIdentifier:e}),n=t.getValue(Lh.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:Dh(i),colorizedBracketPairs:Dh(n)}}function Dh(e){if(Array.isArray(e))return e.map(e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]}).filter(e=>!!e)}class Nh{constructor(e){this.languageId=e}}class Ih{constructor(){this._entries=new Map,this._onDidChange=new rt,this.onDidChange=this._onDidChange.event}register(e,t,i=0){let n=this._entries.get(e);n||(n=new Mh(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new Nh(e)),qe(()=>{o.dispose(),this._onDidChange.fire(new Nh(e))})}getLanguageConfiguration(e){let t=this._entries.get(e);return(null===t||void 0===t?void 0:t.getResolvedConfiguration())||null}getIndentationRules(e){const t=this.getLanguageConfiguration(e);return t&&t.indentationRules||null}_getElectricCharacterSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.electricCharacter||null}getElectricCharacters(e){let t=this._getElectricCharacterSupport(e);return t?t.getElectricCharacters():[]}onElectricCharacter(e,t,i){let n=od(t,i-1),o=this._getElectricCharacterSupport(n.languageId);return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}getComments(e){let t=this.getLanguageConfiguration(e);return t&&t.comments||null}_getCharacterPairSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.characterPair||null}getAutoClosingPairs(e){const t=this._getCharacterPairSupport(e);return new id(t?t.getAutoClosingPairs():[])}getAutoCloseBeforeSet(e){let t=this._getCharacterPairSupport(e);return t?t.getAutoCloseBeforeSet():ad.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED}getSurroundingPairs(e){let t=this._getCharacterPairSupport(e);return t?t.getSurroundingPairs():[]}shouldAutoClosePair(e,t,i){const n=od(t,i-1);return ad.shouldAutoClosePair(e,n,i-n.firstCharOffset)}getWordDefinition(e){let t=this.getLanguageConfiguration(e);return c(t&&t.wordDefinition||null)}getFoldingRules(e){let t=this.getLanguageConfiguration(e);return t?t.foldingRules:{}}getIndentRulesSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.indentRulesSupport||null}getPrecedingValidLine(e,t,i){let n=e.getLanguageIdAtPosition(t,0);if(t>1){let o,s=-1;for(o=t-1;o>=1;o--){if(e.getLanguageIdAtPosition(o,0)!==n)return s;let t=e.getLineContent(o);if(!i.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return o;s=o}}return-1}getInheritIndentForLine(e,t,i,n=!0){if(e<4)return null;const o=this.getIndentRulesSupport(t.getLanguageId());if(!o)return null;if(i<=1)return{indentation:"",action:null};const s=this.getPrecedingValidLine(t,i,o);if(s<0)return null;if(s<1)return{indentation:"",action:null};const r=t.getLineContent(s);if(o.shouldIncrease(r)||o.shouldIndentNextLine(r))return{indentation:Ws(r),action:ed.Indent,line:s};if(o.shouldDecrease(r))return{indentation:Ws(r),action:null,line:s};{if(1===s)return{indentation:Ws(t.getLineContent(s)),action:null,line:s};const e=s-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:Ws(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:Ws(t.getLineContent(s)),action:null,line:s};for(let n=s;n>0;n--){const e=t.getLineContent(n);if(o.shouldIncrease(e))return{indentation:Ws(e),action:ed.Indent,line:n};if(o.shouldIndentNextLine(e)){let e=0;for(let i=n-1;i>0;i--)if(!o.shouldIndentNextLine(t.getLineContent(n))){e=i;break}return{indentation:Ws(t.getLineContent(e+1)),action:null,line:e+1}}if(o.shouldDecrease(e))return{indentation:Ws(e),action:null,line:n}}return{indentation:Ws(t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,i,n,o){if(e<4)return null;const s=this.getLanguageConfiguration(i);if(!s)return null;const r=this.getIndentRulesSupport(i);if(!r)return null;const a=this.getInheritIndentForLine(e,t,n),l=t.getLineContent(n);if(a){const i=a.line;if(void 0!==i){const n=s.onEnter(e,"",t.getLineContent(i),"");if(n){let e=Ws(t.getLineContent(i));return n.removeText&&(e=e.substring(0,e.length-n.removeText)),n.indentAction===ed.Indent||n.indentAction===ed.IndentOutdent?e=o.shiftIndent(e):n.indentAction===ed.Outdent&&(e=o.unshiftIndent(e)),r.shouldDecrease(l)&&(e=o.unshiftIndent(e)),n.appendText&&(e+=n.appendText),Ws(e)}}return r.shouldDecrease(l)?a.action===ed.Indent?a.indentation:o.unshiftIndent(a.indentation):a.action===ed.Indent?o.shiftIndent(a.indentation):a.indentation}return null}getIndentForEnter(e,t,i,n){if(e<4)return null;t.forceTokenization(i.startLineNumber);const o=t.getLineTokens(i.startLineNumber),s=od(o,i.startColumn-1),r=s.getLineContent();let a,l,c=!1;if(s.firstCharOffset>0&&o.getLanguageId(0)!==s.languageId?(c=!0,a=r.substr(0,i.startColumn-1-s.firstCharOffset)):a=o.getLineContent().substring(0,i.startColumn-1),i.isEmpty())l=r.substr(i.startColumn-1-s.firstCharOffset);else{const e=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn);l=e.getLineContent().substr(i.endColumn-1-s.firstCharOffset)}const d=this.getIndentRulesSupport(s.languageId);if(!d)return null;const h=a,u=Ws(a),g={getLineTokens:e=>t.getLineTokens(e),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i),getLineContent:e=>e===i.startLineNumber?h:t.getLineContent(e)},f=Ws(o.getLineContent()),m=this.getInheritIndentForLine(e,g,i.startLineNumber+1);if(!m){const e=c?f:u;return{beforeEnter:e,afterEnter:e}}let p=c?f:m.indentation;return m.action===ed.Indent&&(p=n.shiftIndent(p)),d.shouldDecrease(l)&&(p=n.unshiftIndent(p)),{beforeEnter:c?f:u,afterEnter:p}}getIndentActionForType(e,t,i,n,o){if(e<4)return null;const s=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn);if(s.firstCharOffset)return null;const r=this.getIndentRulesSupport(s.languageId);if(!r)return null;const a=s.getLineContent(),l=a.substr(0,i.startColumn-1-s.firstCharOffset);let c;if(i.isEmpty())c=a.substr(i.startColumn-1-s.firstCharOffset);else{const e=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn);c=e.getLineContent().substr(i.endColumn-1-s.firstCharOffset)}if(!r.shouldDecrease(l+c)&&r.shouldDecrease(l+n+c)){const n=this.getInheritIndentForLine(e,t,i.startLineNumber,!1);if(!n)return null;let s=n.indentation;return n.action!==ed.Indent&&(s=o.unshiftIndent(s)),s}return null}getIndentMetadata(e,t){const i=this.getIndentRulesSupport(e.getLanguageId());return i?t<1||t>e.getLineCount()?null:i.getIndentMetadata(e.getLineContent(t)):null}getEnterAction(e,t,i){const n=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn),o=this.getLanguageConfiguration(n.languageId);if(!o)return null;const s=n.getLineContent(),r=s.substr(0,i.startColumn-1-n.firstCharOffset);let a;if(i.isEmpty())a=s.substr(i.startColumn-1-n.firstCharOffset);else{const e=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn);a=e.getLineContent().substr(i.endColumn-1-n.firstCharOffset)}let l="";if(i.startLineNumber>1&&0===n.firstCharOffset){const e=this.getScopedLineTokens(t,i.startLineNumber-1);e.languageId===n.languageId&&(l=e.getLineContent())}const c=o.onEnter(e,l,r,a);if(!c)return null;const d=c.indentAction;let h=c.appendText;const u=c.removeText||0;h?d===ed.Indent&&(h="\t"+h):h=d===ed.Indent||d===ed.IndentOutdent?"\t":"";let g=this.getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return u&&(g=g.substring(0,g.length-u)),{indentAction:d,appendText:h,removeText:u,indentation:g}}getIndentationAtPosition(e,t,i){const n=e.getLineContent(t);let o=Ws(n);return o.length>i-1&&(o=o.substring(0,i-1)),o}getScopedLineTokens(e,t,i){e.forceTokenization(t);const n=e.getLineTokens(t),o="undefined"===typeof i?e.getLineMaxColumn(t)-1:i-1;return od(n,o)}}const Th=new Ih;class Mh{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new Ah(e,t,++this._order);return this._entries.push(i),this._resolved=null,qe(()=>{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 Ph(this.languageId,e))}return this._resolved}_resolve(){return 0===this._entries.length?null:(this._entries.sort(Ah.cmp),Oh(this._entries.map(e=>e.configuration)))}}function Oh(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 Ah{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 Ph{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 Wd(this.underlyingConfig):null,this.comments=Ph._handleComments(this.underlyingConfig),this.characterPair=new ad(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||l,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Bd(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{}}getWordDefinition(){return c(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new xd(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Rd(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}static _handleComments(e){let t=e.comments;if(!t)return null;let i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){let[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}bh(Sh,xh);class Rh{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 Fh{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 Bh(e,t,i){return new Hh(new Fh(e),new Fh(t)).ComputeDiff(i).changes}class Wh{static Assert(e,t){if(!e)throw new Error(t)}}class Vh{static Copy(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}static Copy2(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}}class zh{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 Rh(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 Hh{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,s]=Hh._getElements(e),[r,a,l]=Hh._getElements(t);this._hasStrings=s&&l,this._originalStringElements=n,this._originalElementsOrHash=o,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(Hh._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i<n;i++)e[i]=Za(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;const i=Hh._getStrictElement(this._originalSequence,e),n=Hh._getStrictElement(this._modifiedSequence,t);return i===n}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,o){const s=[!1];let r=this.ComputeDiffRecursive(e,t,i,n,s);return o&&(r=this.PrettifyChanges(r)),{quitEarly:s[0],changes:r}}ComputeDiffRecursive(e,t,i,n,o){o[0]=!1;while(e<=t&&i<=n&&this.ElementsAreEqual(e,i))e++,i++;while(t>=e&&n>=i&&this.ElementsAreEqual(t,n))t--,n--;if(e>t||i>n){let o;return i<=n?(Wh.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new Rh(e,0,i,n-i+1)]):e<=t?(Wh.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[new Rh(e,t-e+1,i,0)]):(Wh.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Wh.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}const s=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,s,r,o),l=s[0],c=r[0];if(null!==a)return a;if(!o[0]){const s=this.ComputeDiffRecursive(e,l,i,c,o);let r=[];return r=o[0]?[new Rh(l+1,t-(l+1)+1,c+1,n-(c+1)+1)]:this.ComputeDiffRecursive(l+1,t,c+1,n,o),this.ConcatenateChanges(s,r)}return[new Rh(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,m,p,_){let b=null,v=null,w=new zh,C=t,y=i,S=u[0]-m[0]-n,x=-1073741824,k=this.m_forwardHistory.length-1;do{const t=S+e;t===C||t<y&&l[t-1]<l[t+1]?(d=l[t+1],g=d-S-n,d<x&&w.MarkNextChange(),x=d,w.AddModifiedElement(d+1,g),S=t+1-e):(d=l[t-1]+1,g=d-S-n,d<x&&w.MarkNextChange(),x=d-1,w.AddOriginalElement(d,g+1),S=t-1-e),k>=0&&(l=this.m_forwardHistory[k],e=l[0],C=1,y=l.length-1)}while(--k>=-1);if(b=w.getReverseChanges(),_[0]){let e=u[0]+1,t=m[0]+1;if(null!==b&&b.length>0){const i=b[b.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}v=[new Rh(e,h-e+1,t,f-t+1)]}else{w=new zh,C=s,y=r,S=u[0]-m[0]-a,x=1073741824,k=p?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+o;e===C||e<y&&c[e-1]>=c[e+1]?(d=c[e+1]-1,g=d-S-a,d>x&&w.MarkNextChange(),x=d+1,w.AddOriginalElement(d+1,g+1),S=e+1-o):(d=c[e-1],g=d-S-a,d>x&&w.MarkNextChange(),x=d,w.AddModifiedElement(d+1,g+1),S=e-1-o),k>=0&&(c=this.m_reverseHistory[k],o=c[0],C=1,y=c.length-1)}while(--k>=-1);v=w.getChanges()}return this.ConcatenateChanges(b,v)}ComputeRecursionPoint(e,t,i,n,o,s,r){let a=0,l=0,c=0,d=0,h=0,u=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),f=g+1,m=new Int32Array(f),p=new Int32Array(f),_=n-i,b=t-e,v=e-i,w=t-n,C=b-_,y=C%2===0;m[_]=e,p[b]=t,r[0]=!1;for(let S=1;S<=g/2+1;S++){let g=0,C=0;c=this.ClipDiagonalBound(_-S,S,_,f),d=this.ClipDiagonalBound(_+S,S,_,f);for(let e=c;e<=d;e+=2){a=e===c||e<d&&m[e-1]<m[e+1]?m[e+1]:m[e-1]+1,l=a-(e-_)-v;const i=a;while(a<t&&l<n&&this.ElementsAreEqual(a+1,l+1))a++,l++;if(m[e]=a,a+l>g+C&&(g=a,C=l),!y&&Math.abs(e-b)<=S-1&&a>=p[e])return o[0]=a,s[0]=l,i<=p[e]&&S<=1448?this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r):null}const x=(g-e+(C-i)-S)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,x))return r[0]=!0,o[0]=g,s[0]=C,x>0&&S<=1448?this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r):(e++,i++,[new Rh(e,t-e+1,i,n-i+1)]);h=this.ClipDiagonalBound(b-S,S,b,f),u=this.ClipDiagonalBound(b+S,S,b,f);for(let f=h;f<=u;f+=2){a=f===h||f<u&&p[f-1]>=p[f+1]?p[f+1]-1:p[f-1],l=a-(f-b)-w;const g=a;while(a>e&&l>i&&this.ElementsAreEqual(a,l))a--,l--;if(p[f]=a,y&&Math.abs(f-_)<=S&&a<=m[f])return o[0]=a,s[0]=l,g>=m[f]&&S<=1448?this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r):null}if(S<=1447){let e=new Int32Array(d-c+2);e[0]=_-c+1,Vh.Copy2(m,c,e,1,d-c+1),this.m_forwardHistory.push(e),e=new Int32Array(u-h+2),e[0]=b-h+1,Vh.Copy2(p,h,e,1,u-h+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,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,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,s=i.originalLength>0,r=i.modifiedLength>0;while(i.originalStart+i.originalLength<n&&i.modifiedStart+i.modifiedLength<o&&(!s||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),t=this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength);if(t&&!e)break;i.originalStart++,i.modifiedStart++}let 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,o=0;if(t>0){const i=e[t-1];n=i.originalStart+i.originalLength,o=i.modifiedStart+i.modifiedLength}const s=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,c=i.modifiedStart-e;if(t<n||c<o)break;if(s&&!this.OriginalElementsAreEqual(t,t+i.originalLength))break;if(r&&!this.ModifiedElementsAreEqual(c,c+i.modifiedLength))break;const d=t===n&&c===o,h=(d?5:0)+this._boundaryScore(t,i.originalLength,c,i.modifiedLength);h>l&&(l=h,a=e)}i.originalStart-=a,i.modifiedStart-=a;const c=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],c)&&(e[t-1]=c[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],o=n.originalStart-i.originalStart-i.originalLength,s=i.originalStart,r=n.originalStart+n.originalLength,a=r-s,l=i.modifiedStart,c=n.modifiedStart+n.modifiedLength,d=c-l;if(o<5&&a<20&&d<20){const e=this._findBetterContiguousSequence(s,a,l,d,o);if(e){const[t,s]=e;t===i.originalStart+i.originalLength&&s===i.modifiedStart+i.modifiedLength||(i.originalLength=t-i.originalStart,i.modifiedLength=s-i.modifiedStart,n.originalStart=t+o,n.modifiedStart=s+o,n.originalLength=r-n.originalStart,n.modifiedLength=c-n.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,n,o){if(t<o||n<o)return null;const s=e+t-o+1,r=i+n-o+1;let a=0,l=0,c=0;for(let d=e;d<s;d++)for(let e=i;e<r;e++){const t=this._contiguousSequenceScore(d,e,o);t>0&&t>a&&(a=t,l=d,c=e)}return a>0?[l,c]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o<i;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;n+=this._originalStringElements[e+o].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){const o=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(i,n)?1:0;return o+s}ConcatenateChanges(e,t){let 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 Vh.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],Vh.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return Vh.Copy(e,0,i,0,e.length),Vh.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(Wh.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Wh.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 o=e.originalLength;const s=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Rh(n,o,s,r),!0}return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e<n)return e;const o=i,s=n-i-1,r=t%2===0;if(e<0){const e=o%2===0;return r===e?0:1}{const e=s%2===0;return r===e?n-1:n-2}}}const Kh=3;function jh(e,t,i,n){const o=new Hh(e,t,i);return o.ComputeDiff(n)}class Uh{constructor(e){const t=[],i=[];for(let n=0,o=e.length;n<o;n++)t[n]=Zh(e[n],1),i[n]=Qh(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=[],o=[],s=[];let r=0;for(let a=t;a<=i;a++){const t=this.lines[a],i=e?this._startColumns[a]:1,l=e?this._endColumns[a]:t.length+1;for(let e=i;e<l;e++)n[r]=t.charCodeAt(e-1),o[r]=a+1,s[r]=e,r++}return new $h(n,o,s)}}class $h{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}getElements(){return this._charCodes}getStartLineNumber(e){return this._lineNumbers[e]}getStartColumn(e){return this._columns[e]}getEndLineNumber(e){return this._lineNumbers[e]}getEndColumn(e){return this._columns[e]+1}}class qh{constructor(e,t,i,n,o,s,r,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=r,this.modifiedEndColumn=a}static createFromDiffChange(e,t,i){let n,o,s,r,a,l,c,d;return 0===e.originalLength?(n=0,o=0,s=0,r=0):(n=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),r=t.getEndColumn(e.originalStart+e.originalLength-1)),0===e.modifiedLength?(a=0,l=0,c=0,d=0):(a=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),c=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=i.getEndColumn(e.modifiedStart+e.modifiedLength-1)),new qh(n,o,s,r,a,l,c,d)}}function Gh(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,o=e.length;n<o;n++){const o=e[n],s=o.originalStart-(i.originalStart+i.originalLength),r=o.modifiedStart-(i.modifiedStart+i.modifiedLength),a=Math.min(s,r);a<Kh?(i.originalLength=o.originalStart+o.originalLength-i.originalStart,i.modifiedLength=o.modifiedStart+o.modifiedLength-i.modifiedStart):(t.push(o),i=o)}return t}class Yh{constructor(e,t,i,n,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=o}static createFromDiffResult(e,t,i,n,o,s,r){let a,l,c,d,h=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?(c=n.getStartLineNumber(t.modifiedStart)-1,d=0):(c=n.getStartLineNumber(t.modifiedStart),d=n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),s&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const s=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);let l=jh(s,a,o,!0).changes;r&&(l=Gh(l)),h=[];for(let e=0,t=l.length;e<t;e++)h.push(qh.createFromDiffChange(l[e],s,a))}return new Yh(a,l,c,d,h)}}class Xh{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 Uh(e),this.modified=new Uh(t),this.continueLineDiff=Jh(i.maxComputationTime),this.continueCharDiff=Jh(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:[{modifiedEndColumn:0,modifiedEndLineNumber:0,modifiedStartColumn:0,modifiedStartLineNumber:0,originalEndColumn:0,originalEndLineNumber:0,originalStartColumn:0,originalStartLineNumber: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:[{modifiedEndColumn:0,modifiedEndLineNumber:0,modifiedStartColumn:0,modifiedStartLineNumber:0,originalEndColumn:0,originalEndLineNumber:0,originalStartColumn:0,originalStartLineNumber:0}]}]};const e=jh(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(Yh.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[i],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:e}}const n=[];let o=0,s=0;for(let r=-1,a=t.length;r<a;r++){const e=r+1<a?t[r+1]:null,i=e?e.originalStart:this.originalLines.length,l=e?e.modifiedStart:this.modifiedLines.length;while(o<i&&s<l){const e=this.originalLines[o],t=this.modifiedLines[s];if(e!==t){{let i=Zh(e,1),r=Zh(t,1);while(i>1&&r>1){const n=e.charCodeAt(i-2),o=t.charCodeAt(r-2);if(n!==o)break;i--,r--}(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,i,s+1,1,r)}{let i=Qh(e,1),r=Qh(t,1);const a=e.length+1,l=t.length+1;while(i<a&&r<l){const t=e.charCodeAt(i-1),n=e.charCodeAt(r-1);if(t!==n)break;i++,r++}(i<a||r<l)&&this._pushTrimWhitespaceCharChange(n,o+1,i,a,s+1,r,l)}}o++,s++}e&&(n.push(Yh.createFromDiffResult(this.shouldIgnoreTrimWhitespace,e,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=e.originalLength,s+=e.modifiedLength)}return{quitEarly:i,changes:n}}_pushTrimWhitespaceCharChange(e,t,i,n,o,s,r){if(this._mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r))return;let a=void 0;this.shouldComputeCharChanges&&(a=[new qh(t,i,t,n,o,s,o,r)]),e.push(new Yh(t,t,o,o,a))}_mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r){const a=e.length;if(0===a)return!1;const l=e[a-1];return 0!==l.originalEndLineNumber&&0!==l.modifiedEndLineNumber&&(l.originalEndLineNumber+1===t&&l.modifiedEndLineNumber+1===o&&(l.originalEndLineNumber=t,l.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new qh(t,i,t,n,o,s,o,r)),!0))}}function Zh(e,t){const i=Bs(e);return-1===i?t:i+1}function Qh(e,t){const i=Vs(e);return-1===i?t:i+2}function Jh(e){if(0===e)return()=>!0;const t=Date.now();return()=>Date.now()-t<e}function eu(e){return e<0?0:e>255?255:0|e}function tu(e){return e<0?0:e>4294967295?4294967295:0|e}class iu{constructor(e,t){this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class nu{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=tu(e);const i=this.values,n=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),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)}changeValue(e,t){return e=tu(e),t=tu(t),this.values[e]!==t&&(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=tu(e),t=tu(t);const i=this.values,n=this.prefixSum;if(e>=i.length)return!1;let o=i.length-e;return t>=o&&(t=o),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=tu(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,o=0,s=0;while(t<=i)if(n=t+(i-t)/2|0,o=this.prefixSum[n],s=o-this.values[n],e<s)i=n-1;else{if(!(e>=o))break;t=n+1}return new iu(n,e-s)}}class ou{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 i of t)this._acceptDeleteRange(i.range),this._acceptInsertText(new wi(i.range.startLineNumber,i.range.startColumn),i.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 nu(i)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.changeValue(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;let i=Fs(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]);let n=new Uint32Array(i.length-1);for(let o=1;o<i.length;o++)this._lines.splice(e.lineNumber+o-1,0,i[o]),n[o-1]=i[o].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,n)}}class su{constructor(e){let t=eu(e);this._defaultValue=t,this._asciiMap=su._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);for(let i=0;i<256;i++)t[i]=e;return t}set(e,t){let i=eu(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}}class ru{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,s=e*t;o<s;o++)n[o]=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 au{constructor(e){let t=0,i=0;for(let o=0,s=e.length;o<s;o++){let[n,s,r]=e[o];s>t&&(t=s),n>i&&(i=n),r>i&&(i=r)}t++,i++;let n=new ru(i,t,0);for(let o=0,s=e.length;o<s;o++){let[t,i,s]=e[o];n.set(t,i,s)}this._states=n,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let lu=null;function cu(){return null===lu&&(lu=new au([[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]])),lu}let du=null;function hu(){if(null===du){du=new su(0);const e=" \t<>'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…";for(let i=0;i<e.length;i++)du.set(e.charCodeAt(i),1);const t=".,;";for(let i=0;i<t.length;i++)du.set(t.charCodeAt(i),2)}return du}class uu{static _createLink(e,t,i,n,o){let s=o-1;do{const i=t.charCodeAt(s),n=e.get(i);if(2!==n)break;s--}while(s>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(s);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&s--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:s+2},url:t.substring(n,s+1)}}static computeLinks(e,t=cu()){const i=hu();let n=[];for(let o=1,s=e.getLineCount();o<=s;o++){const s=e.getLineContent(o),r=s.length;let a=0,l=0,c=0,d=1,h=!1,u=!1,g=!1,f=!1;while(a<r){let e=!1;const r=s.charCodeAt(a);if(13===d){let t;switch(r){case 40:h=!0,t=0;break;case 41:t=h?0:1;break;case 91:g=!0,u=!0,t=0;break;case 93:g=!1,t=u?0:1;break;case 123:f=!0,t=0;break;case 125:t=f?0:1;break;case 39:t=34===c||96===c?0:1;break;case 34:t=39===c||96===c?0:1;break;case 96:t=39===c||34===c?0:1;break;case 42:t=42===c?1:0;break;case 124:t=124===c?1:0;break;case 32:t=g?0:1;break;default:t=i.get(r)}1===t&&(n.push(uu._createLink(i,s,o,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,h=!1,u=!1,f=!1,l=a+1,c=r),a++}13===d&&n.push(uu._createLink(i,s,o,l,r))}return n}}function gu(e){return e&&"function"===typeof e.getLineCount&&"function"===typeof e.getLineContent?uu.computeLinks(e):[]}class fu{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,n,o){if(e&&t){let i=this.doNavigateValueSet(t,o);if(i)return{range:e,value:i}}if(i&&n){let e=this.doNavigateValueSet(n,o);if(e)return{range:i,value:e}}return null}doNavigateValueSet(e,t){let i=this.numberReplace(e,t);return null!==i?i:this.textReplace(e,t)}numberReplace(e,t){let i=Math.pow(10,e.length-(e.lastIndexOf(".")+1)),n=Number(e),o=parseFloat(e);return isNaN(n)||isNaN(o)||n!==o?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 o=0,s=e.length;null===n&&o<s;o++)n=this.valueSetReplace(e[o],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}}fu.INSTANCE=new fu;var mu=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class pu extends ou{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){let i=h(e.column,c(t),this._lines[e.lineNumber-1],0);return i?new Ci(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let n=0,o="",s=0,r=[];return{*[Symbol.iterator](){while(1)if(s<r.length){const e=o.substring(r[s].start,r[s].end);s+=1,yield e}else{if(!(n<t.length))break;o=t[n],r=i(o,e),s=0,n+=1}}}}getLineWords(e,t){let i=this._lines[e-1],n=this._wordenize(i,t),o=[];for(const s of n)o.push({word:i.substring(s.start,s.end),startColumn:s.start+1,endColumn:s.end+1});return o}_wordenize(e,t){const i=[];let n;t.lastIndex=0;while(n=t.exec(e)){if(0===n[0].length)break;i.push({start:n.index,end:n.index+n[0].length})}return i}getValueInRange(e){if(e=this._validateRange(e),e.startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);let t=this._eol,i=e.startLineNumber-1,n=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let s=i+1;s<n;s++)o.push(this._lines[s]);return o.push(this._lines[n].substring(0,e.endColumn-1)),o.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();let 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(!wi.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{let 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 _u{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(){let e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new pu(ci.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;let i=this._models[e];i.onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeDiff(e,t,i,n){return mu(this,void 0,void 0,(function*(){const o=this._getModel(e),s=this._getModel(t);if(!o||!s)return null;const r=o.getLinesContent(),a=s.getLinesContent(),l=new Xh(r,a,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:n}),c=l.computeDiff(),d=!(c.changes.length>0)&&this._modelsAreIdentical(o,s);return{quitEarly:c.quitEarly,identical:d,changes:c.changes}}))}_modelsAreIdentical(e,t){const i=e.getLineCount(),n=t.getLineCount();if(i!==n)return!1;for(let o=1;o<=i;o++){const i=e.getLineContent(o),n=t.getLineContent(o);if(i!==n)return!1}return!0}computeMoreMinimalEdits(e,t){return mu(this,void 0,void 0,(function*(){const i=this._getModel(e);if(!i)return t;const n=[];let o=void 0;t=t.slice(0).sort((e,t)=>{if(e.range&&t.range)return Ci.compareRangesUsingStarts(e.range,t.range);let i=e.range?0:1,n=t.range?0:1;return i-n});for(let{range:e,text:s,eol:r}of t){if("number"===typeof r&&(o=r),Ci.isEmpty(e)&&!s)continue;const t=i.getValueInRange(e);if(s=s.replace(/\r\n|\n|\r/g,i.eol),t===s)continue;if(Math.max(s.length,t.length)>_u._diffLimit){n.push({range:e,text:s});continue}const a=Bh(t,s,!1),l=i.offsetAt(Ci.lift(e).getStartPosition());for(const e of a){const t=i.positionAt(l+e.originalStart),o=i.positionAt(l+e.originalStart+e.originalLength),r={text:s.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:o.lineNumber,endColumn:o.column}};i.getValueInRange(r.range)!==r.text&&n.push(r)}}return"number"===typeof o&&n.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),n}))}computeLinks(e){return mu(this,void 0,void 0,(function*(){let t=this._getModel(e);return t?gu(t):null}))}textualSuggest(e,t,i,n){return mu(this,void 0,void 0,(function*(){const o=new tt(!0),s=new RegExp(i,n),r=new Set;e:for(let i of e){const e=this._getModel(i);if(e)for(let i of e.words(s))if(i!==t&&isNaN(Number(i))&&(r.add(i),r.size>_u._suggestionsLimit))break e}return{words:Array.from(r),duration:o.elapsed()}}))}computeWordRanges(e,t,i,n){return mu(this,void 0,void 0,(function*(){let o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(i,n),r=Object.create(null);for(let e=t.startLineNumber;e<t.endLineNumber;e++){let t=o.getLineWords(e,s);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}))}navigateValueSet(e,t,i,n,o){return mu(this,void 0,void 0,(function*(){let s=this._getModel(e);if(!s)return null;let r=new RegExp(n,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});let a=s.getValueInRange(t),l=s.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},r);if(!l)return null;let c=s.getValueInRange(l),d=fu.INSTANCE.navigateValueSet(t,a,l,c,i);return d}))}loadForeignModule(e,t,i){const n=(e,t)=>this._host.fhr(e,t),o=ca(i,n);let s={host:o,getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(la(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(i){return Promise.reject(i)}}}_u._diffLimit=1e5,_u._suggestionsLimit=1e4,"function"===typeof importScripts&&(s["b"].monaco=cn());const bu=gn("textResourceConfigurationService"),vu=gn("textResourcePropertiesService");function wu(e,t=0){return e[e.length-(1+t)]}function Cu(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function yu(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,o=e.length;n<o;n++)if(!i(e[n],t[n]))return!1;return!0}function Su(e,t,i){let n=0,o=e.length-1;while(n<=o){const s=(n+o)/2|0,r=i(e[s],t);if(r<0)n=s+1;else{if(!(r>0))return s;o=s-1}}return-(n+1)}function xu(e){return e.filter(e=>!!e)}function ku(e){return!Array.isArray(e)||0===e.length}function Lu(e){return Array.isArray(e)&&e.length>0}function Eu(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 Du(e,t){const i=Nu(e,t);if(-1!==i)return e[i]}function Nu(e,t){for(let i=e.length-1;i>=0;i--){const n=e[i];if(t(n))return i}return-1}function Iu(e,t){return e.length>0?e[0]:t}function Tu(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 o=i;o<t;o++)n.push(o);else for(let o=i;o>t;o--)n.push(o);return n}function Mu(e,t,i){const n=e.slice(0,t),o=e.slice(t);return n.concat(i,o)}function Ou(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function Au(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function Pu(e,t,i){const n=Fu(e,t),o=e.length,s=i.length;e.length=o+s;for(let r=o-1;r>=n;r--)e[r+s]=e[r];for(let r=0;r<s;r++)e[r+n]=i[r]}function Ru(e,t,i,n){const o=Fu(e,t),s=e.splice(o,i);return Pu(e,o,n),s}function Fu(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}class Bu{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}takeWhile(e){let t=this.firstIdx;while(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;while(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(){return this.items[this.firstIdx]}}const Wu=gn("logService");var Vu;(function(e){e[e["Trace"]=0]="Trace",e[e["Debug"]=1]="Debug",e[e["Info"]=2]="Info",e[e["Warning"]=3]="Warning",e[e["Error"]=4]="Error",e[e["Critical"]=5]="Critical",e[e["Off"]=6]="Off"})(Vu||(Vu={}));const zu=Vu.Info;class Hu extends Ye{constructor(){super(...arguments),this.level=zu,this._onDidChangeLogLevel=this._register(new rt)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}class Ku extends Hu{constructor(e=zu){super(),this.setLevel(e)}trace(e,...t){this.getLevel()<=Vu.Trace&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.getLevel()<=Vu.Debug&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.getLevel()<=Vu.Info&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.getLevel()<=Vu.Error&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}class ju extends Ye{constructor(e){super(),this.logger=e,this._register(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)}error(e,...t){this.logger.error(e,...t)}}var Uu=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},$u=function(e,t){return function(i,n){t(i,n,e)}},qu=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Gu=6e4,Yu=3e5;function Xu(e,t){let i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let Zu=class extends Ye{constructor(e,t,i){super(),this._modelService=e,this._workerManager=this._register(new Ju(this._modelService)),this._logService=i,this._register(vc.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(e,t)=>Xu(this._modelService,e.uri)?this._workerManager.withWorker().then(t=>t.computeLinks(e.uri)).then(e=>e&&{links:e}):Promise.resolve({links:[]})})),this._register(ic.register("*",new Qu(this._workerManager,t,this._modelService)))}dispose(){super.dispose()}computeDiff(e,t,i,n){return this._workerManager.withWorker().then(o=>o.computeDiff(e,t,i,n))}computeMoreMinimalEdits(e,t){if(Lu(t)){if(!Xu(this._modelService,e))return Promise.resolve(t);const i=tt.create(!0),n=this._workerManager.withWorker().then(i=>i.computeMoreMinimalEdits(e,t));return n.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed())),Promise.race([n,to(1e3).then(()=>t)])}return Promise.resolve(void 0)}canNavigateValueSet(e){return Xu(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return Xu(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};Zu=Uu([$u(0,Pl),$u(1,bu),$u(2,Wu)],Zu);class Qu{constructor(e,t,i){this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return qu(this,void 0,void 0,(function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestionsMode)Xu(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())Xu(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):"allDocuments"!==i.wordBasedSuggestionsMode&&t.getLanguageId()!==e.getLanguageId()||n.push(t.uri));if(0===n.length)return;const o=Th.getWordDefinition(e.getLanguageId()),s=e.getWordAtPosition(t),r=s?new Ci(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):Ci.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=yield this._workerManager.withWorker(),c=yield l.textualSuggest(n,null===s||void 0===s?void 0:s.word,o);return c?{duration:c.duration,suggestions:c.words.map(e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}}))}:void 0}))}}class Ju extends Ye{constructor(e){super(),this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime();let t=this._register(new oo);t.cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(Yu/2)),this._register(this._modelService.onModelRemoved(e=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;let e=this._modelService.getModels();0===e.length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;let e=(new Date).getTime()-this._lastWorkerUsedTime;e>Yu&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new ng(this._modelService,!1,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)}}class eg extends Ye{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){let e=new oo;e.cancelAndSet(()=>this._checkStopModelSync(),Math.round(Gu/2)),this._register(e)}}dispose(){for(let e in this._syncedModels)Ue(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){let e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){let e=(new Date).getTime(),t=[];for(let i in this._syncedModelsLastUsedTime){let n=e-this._syncedModelsLastUsedTime[i];n>Gu&&t.push(i)}for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){let i=this._modelService.getModel(e);if(!i)return;if(!t&&i.isTooLargeForSyncing())return;let n=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new Ge;o.add(i.onDidChangeContent(e=>{this._proxy.acceptModelChanged(n.toString(),e)})),o.add(i.onWillDispose(()=>{this._stopModelSync(n)})),o.add(qe(()=>{this._proxy.acceptRemovedModel(n)})),this._syncedModels[n]=o}_stopModelSync(e){let t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Ue(t)}}class tg{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class ig{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class ng extends Ye{constructor(e,t,i){super(),this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new Jc(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 jc(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new ig(this)))}catch(e){Fc(e),this._worker=new tg(new _u(new ig(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(Fc(e),this._worker=new tg(new _u(new ig(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new eg(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return qu(this,void 0,void 0,(function*(){return this._disposed?Promise.reject(Ne()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,n))}computeMoreMinimalEdits(e,t){return this._withSyncedResources([e]).then(i=>i.computeMoreMinimalEdits(e.toString(),t))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}textualSuggest(e,t,i){return qu(this,void 0,void 0,(function*(){const n=yield this._withSyncedResources(e),o=i.source,s=Rs(i);return n.textualSuggest(e.map(e=>e.toString()),t,o,s)}))}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{let n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);let o=Th.getWordDefinition(n.getLanguageId()),s=o.source,r=Rs(o);return i.computeWordRanges(e.toString(),t,s,r)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(n=>{let o=this._modelService.getModel(e);if(!o)return null;let s=Th.getWordDefinition(o.getLanguageId()),r=s.source,a=Rs(s);return n.navigateValueSet(e.toString(),t,i,r,a)})}dispose(){super.dispose(),this._disposed=!0}}function og(e,t){return new sg(e,t)}class sg extends ng{constructor(e,t){super(e,t.keepIdleModels||!1,t.label),this._foreignModuleId=t.moduleId,this._foreignModuleCreateData=t.createData||null,this._foreignModuleHost=t.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(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?la(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)};let o={};for(const e of t)o[e]=n(e,i);return o})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(e=>this.getProxy())}}class rg{constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}static createEmpty(e,t){const i=rg.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new rg(n,e,t)}equals(e){return e instanceof rg&&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,o=n+(i<<1);for(let s=n;s<o;s++)if(this._tokens[s]!==e._tokens[s])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){const t=this._tokens[1+(e<<1)];return t}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=ql.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return ql.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return ql.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return ql.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return ql.getInlineStyleFromMetadata(i,t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return rg.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new ag(this,e,t,i)}static convertToEndOffset(e,t){const i=e.length>>>1,n=i-1;for(let o=0;o<n;o++)e[o<<1]=e[o+1<<1];e[n<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,n=(e.length>>>1)-1;while(i<n){const o=i+Math.floor((n-i)/2),s=e[o<<1];if(s===t)return o+1;s<t?i=o+1:s>t&&(n=o)}return i}withInserted(e){if(0===e.length)return this;let t=0,i=0,n="";const o=new Array;let s=0;while(1){let 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(s,r);const e=this._tokens[1+(t<<1)];o.push(n.length,e),t++,s=r}else{if(!a)break;if(a.offset>s){n+=this._text.substring(s,a.offset);const e=this._tokens[1+(t<<1)];o.push(n.length,e),s=a.offset}n+=a.text,o.push(n.length,a.tokenMetadata),i++}}return new rg(new Uint32Array(o),n,this._languageIdCodec)}}rg.defaultTokenMetadata=16793600;class ag{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 o=this._firstTokenIndex,s=e.getCount();o<s;o++){const t=e.getStartOffset(o);if(t>=i)break;this._tokensCount++}}equals(e){return e instanceof ag&&(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)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class lg{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,n=t.length;if(i!==n)return!1;for(let o=0;o<i;o++)if(!lg._equals(e[o],t[o]))return!1;return!0}static extractWrapped(e,t,i){if(0===e.length)return e;const n=t+1,o=i+1,s=i-t,r=[];let a=0;for(const l of e)l.endColumn<=n||l.startColumn>=o||(r[a++]=new lg(Math.max(1,l.startColumn-n+1),Math.min(s+1,l.endColumn-n+1),l.className,l.type));return r}static filter(e,t,i,n){if(0===e.length)return[];let o=[],s=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 c=l.startLineNumber===t?l.startColumn:i,d=l.endLineNumber===t?l.endColumn:n;o[s++]=new lg(c,d,a.inlineClassName,a.type)}return o}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=lg._typeCompare(e.type,t.type);return 0!==i?i:e.className!==t.className?e.className<t.className?-1:1:0}}class cg{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class dg{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){while(this.count>0&&this.stopOffsets[0]<e){let e=0;while(e+1<this.count&&this.stopOffsets[e]===this.stopOffsets[e+1])e++;i.push(new cg(t,this.stopOffsets[e],this.classNames.join(" "),dg._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 cg(t,e-1,this.classNames.join(" "),dg._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 hg{static normalize(e,t){if(0===t.length)return[];let i=[];const n=new dg;let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];let a=r.startColumn,l=r.endColumn;const c=r.className,d=1===r.type?2:2===r.type?4:0;if(a>1){const t=e.charCodeAt(a-2);Zs(t)&&a--}if(l>1){const t=e.charCodeAt(l-2);Zs(t)&&l--}const h=a-1,u=l-2;o=n.consumeLowerThan(h,o,i),0===n.count&&(o=h),n.insert(u,c,d)}return n.consumeLowerThan(1073741824,o,i),i}}class ug{constructor(e,t,i){this._linePartBrand=void 0,this.endIndex=e,this.type=t,this.metadata=i}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class gg{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class fg{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,m,p,_,b){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(lg.compare),this.tabSize=c,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=f,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=p,this.fontLigatures=_,this.selectionsOnLine=b&&b.sort((e,t)=>e.startOffset<t.startOffset?-1:1);const v=Math.abs(g-h),w=Math.abs(u-h);v<w?(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&&lg.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class mg{constructor(e,t){this.partIndex=e,this.charIndex=t}}class pg{constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._absoluteOffsets=new Uint32Array(this.length)}static getPartIndex(e){return(4294901760&e)>>>16}static getCharIndex(e){return(65535&e)>>>0}setColumnInfo(e,t,i,n){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._absoluteOffsets[e-1]=n+i}getAbsoluteOffset(e){return 0===this._absoluteOffsets.length?0:this._absoluteOffsets[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=pg.getPartIndex(t),n=pg.getCharIndex(t);return new mg(i,n)}getColumn(e,t){const i=this.partDataToCharOffset(e.partIndex,t,e.charIndex);return i+1}partDataToCharOffset(e,t,i){if(0===this.length)return 0;let n=(e<<16|i<<0)>>>0,o=0,s=this.length-1;while(o+1<s){let e=o+s>>>1,t=this._data[e];if(t===n)return e;t>n?s=e:o=e}if(o===s)return o;let r=this._data[o],a=this._data[s];if(r===n)return o;if(a===n)return s;let l,c=pg.getPartIndex(r),d=pg.getCharIndex(r),h=pg.getPartIndex(a);l=c!==h?t:pg.getCharIndex(a);let u=i-d,g=l-i;return u<=g?o:s}}class _g{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function bg(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendASCIIString("<span>");let i=0,n=0,o=0;for(const r of e.lineDecorations)1!==r.type&&2!==r.type||(t.appendASCIIString('<span class="'),t.appendASCIIString(r.className),t.appendASCIIString('"></span>'),1===r.type&&(o|=1,i++),2===r.type&&(o|=2,n++));t.appendASCIIString("</span>");const s=new pg(1,i+n);return s.setColumnInfo(1,i,0,0),new _g(s,!1,o)}return t.appendASCIIString("<span><span></span></span>"),new _g(new pg(0,0),!1,0)}return Ng(yg(e),t)}class vg{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function wg(e){let t=pd(1e4),i=bg(e,t);return new vg(i.characterMapping,t.build(),i.containsRTL,i.containsForeignElements)}class Cg{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.parts=s,this.containsForeignElements=r,this.fauxIndentLength=a,this.tabSize=l,this.startVisibleColumn=c,this.containsRTL=d,this.spaceWidth=h,this.renderSpaceCharCode=u,this.renderWhitespace=g,this.renderControlCharacters=f}}function yg(e){const t=e.lineContent;let i,n;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter<t.length?(i=!0,n=e.stopRenderingLineAfter):(i=!1,n=t.length);let o=Sg(e.lineTokens,e.fauxIndentLength,n);(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace)&&(o=Eg(e,t,n,o));let s=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?s|=1:2===i.type&&(s|=2)}o=Dg(t,n,o,e.lineDecorations)}return e.containsRTL||(o=xg(t,o,!e.isBasicASCII||e.fontLigatures)),e.renderControlCharacters&&!e.isBasicASCII&&(o=Lg(t,o)),new Cg(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,t,n,i,o,s,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.containsRTL,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}function Sg(e,t,i){let n=[],o=0;t>0&&(n[o++]=new ug(t,"",0));for(let s=0,r=e.getCount();s<r;s++){const r=e.getEndOffset(s);if(r<=t)continue;const a=e.getClassName(s);if(r>=i){n[o++]=new ug(i,a,0);break}n[o++]=new ug(r,a,0)}return n}function xg(e,t,i){let n=0,o=[],s=0;if(i)for(let r=0,a=t.length;r<a;r++){const i=t[r],a=i.endIndex;if(n+50<a){const t=i.type,r=i.metadata;let l=-1,c=n;for(let i=n;i<a;i++)32===e.charCodeAt(i)&&(l=i),-1!==l&&i-c>=50&&(o[s++]=new ug(l+1,t,r),c=l+1,l=-1);c!==a&&(o[s++]=new ug(a,t,r))}else o[s++]=i;n=a}else for(let r=0,a=t.length;r<a;r++){const e=t[r],i=e.endIndex;let a=i-n;if(a>50){const t=e.type,r=e.metadata,l=Math.ceil(a/50);for(let e=1;e<l;e++){let i=n+50*e;o[s++]=new ug(i,t,r)}o[s++]=new ug(i,t,r)}else o[s++]=e;n=i}return o}function kg(e){return e<32?9!==e:127===e||(e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e)}function Lg(e,t){let i=[],n=new ug(0,"",0),o=0;for(const s of t){const t=s.endIndex;for(;o<t;o++){const t=e.charCodeAt(o);kg(t)&&(o>n.endIndex&&(n=new ug(o,s.type,s.metadata),i.push(n)),n=new ug(o+1,"mtkcontrol",s.metadata),i.push(n))}o>n.endIndex&&(n=new ug(t,s.type,s.metadata),i.push(n))}return i}function Eg(e,t,i,n){const o=e.continuesWithWrappedLine,s=e.fauxIndentLength,r=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,c=e.selectionsOnLine,d=1===e.renderWhitespace,h=3===e.renderWhitespace,u=e.renderSpaceWidth!==e.spaceWidth;let g=[],f=0,m=0,p=n[m].type,_=n[m].endIndex;const b=n.length;let v,w=!1,C=Bs(t);-1===C?(w=!0,C=i,v=i):v=Vs(t);let y=!1,S=0,x=c&&c[S],k=a%r;for(let E=s;E<i;E++){const e=t.charCodeAt(E);let o;if(x&&E>=x.endOffset&&(S++,x=c&&c[S]),E<C||E>v)o=!0;else if(9===e)o=!0;else if(32===e)if(d)if(y)o=!0;else{const e=E+1<i?t.charCodeAt(E+1):0;o=32===e||9===e}else o=!0;else o=!1;if(o&&c&&(o=!!x&&x.startOffset<=E&&x.endOffset>E),o&&h&&(o=w||E>v),y){if(!o||!l&&k>=r){if(u){const e=f>0?g[f-1].endIndex:s;for(let t=e+1;t<=E;t++)g[f++]=new ug(t,"mtkw",1)}else g[f++]=new ug(E,"mtkw",1);k%=r}}else(E===_||o&&E>s)&&(g[f++]=new ug(E,p,0),k%=r);9===e?k=r:gr(e)?k+=2:k++,y=o;while(E===_){if(m++,!(m<b))break;p=n[m].type,_=n[m].endIndex}}let L=!1;if(y)if(o&&d){let e=i>0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0,o=32===e&&32!==n&&9!==n;o||(L=!0)}else L=!0;if(L)if(u){const e=f>0?g[f-1].endIndex:s;for(let t=e+1;t<=i;t++)g[f++]=new ug(t,"mtkw",1)}else g[f++]=new ug(i,"mtkw",1);else g[f++]=new ug(i,p,0);return g}function Dg(e,t,i,n){n.sort(lg.compare);const o=hg.normalize(e,n),s=o.length;let r=0,a=[],l=0,c=0;for(let h=0,u=i.length;h<u;h++){const e=i[h],t=e.endIndex,n=e.type,d=e.metadata;while(r<s&&o[r].startOffset<t){const e=o[r];if(e.startOffset>c&&(c=e.startOffset,a[l++]=new ug(c,n,d)),!(e.endOffset+1<=t)){c=t,a[l++]=new ug(c,n+" "+e.className,d|e.metadata);break}c=e.endOffset+1,a[l++]=new ug(c,n+" "+e.className,d|e.metadata),r++}t>c&&(c=t,a[l++]=new ug(c,n,d))}const d=i[i.length-1].endIndex;if(r<s&&o[r].startOffset===d)while(r<s&&o[r].startOffset===d){const e=o[r];a[l++]=new ug(c,e.className,e.metadata),r++}return a}function Ng(e,t){const i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,o=e.containsForeignElements,s=e.lineContent,r=e.len,a=e.isOverflowing,l=e.parts,c=e.fauxIndentLength,d=e.tabSize,h=e.startVisibleColumn,u=e.containsRTL,g=e.spaceWidth,f=e.renderSpaceCharCode,m=e.renderWhitespace,p=e.renderControlCharacters,_=new pg(r+1,l.length);let b=!1,v=0,w=h,C=0,y=0,S=0,x=0;u?t.appendASCIIString('<span dir="ltr">'):t.appendASCIIString("<span>");for(let k=0,L=l.length;k<L;k++){x+=S;const e=l[k],a=e.endIndex,h=e.type,u=0!==m&&e.isWhitespace(),L=u&&!i&&("mtkw"===h||!o),E=v===a&&e.isPseudoAfter();if(C=0,t.appendASCIIString('<span class="'),t.appendASCIIString(L?"mtkz":h),t.appendASCII(34),u){let e=0;{let t=v,i=w;for(;t<a;t++){const n=s.charCodeAt(t),o=0|(9===n?d-i%d:1);e+=o,t>=c&&(i+=o)}}for(L&&(t.appendASCIIString(' style="width:'),t.appendASCIIString(String(g*e)),t.appendASCIIString('px"')),t.appendASCII(62);v<a;v++){_.setColumnInfo(v+1,k-y,C,x),y=0;const e=s.charCodeAt(v);let i;if(9===e){i=d-w%d|0,!n||i>1?t.write1(8594):t.write1(65515);for(let e=2;e<=i;e++)t.write1(160)}else i=1,t.write1(f);C+=i,v>=c&&(w+=i)}S=e}else{let e=0;for(t.appendASCII(62);v<a;v++){_.setColumnInfo(v+1,k-y,C,x),y=0;const i=s.charCodeAt(v);let n=1,o=1;switch(i){case 9:n=d-w%d,o=n;for(let e=1;e<=n;e++)t.write1(160);break;case 32:t.write1(160);break;case 60:t.appendASCIIString("<");break;case 62:t.appendASCIIString(">");break;case 38:t.appendASCIIString("&");break;case 0:p?t.write1(9216):t.appendASCIIString("�");break;case 65279:case 8232:case 8233:case 133:t.write1(65533);break;default:gr(i)&&o++,p&&i<32?t.write1(9216+i):p&&127===i?t.write1(9249):p&&kg(i)?(t.appendASCIIString("[U+"),t.appendASCIIString(Ig(i)),t.appendASCIIString("]"),n=8):t.write1(i)}C+=n,e+=n,v>=c&&(w+=o)}S=e}E?y++:y=0,v>=r&&!b&&e.isPseudoAfter()&&(b=!0,_.setColumnInfo(v+1,k,C,x)),t.appendASCIIString("</span>")}return b||_.setColumnInfo(r+1,l.length-1,C,x),a&&t.appendASCIIString("<span>…</span>"),t.appendASCIIString("</span>"),new _g(_,u,o)}function Ig(e){return e.toString(16).toUpperCase().padStart(4,"0")}class Tg{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 Mg{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e,t){const i=this.outputLineIndex>0?t:0;return new wi(e+this.outputLineIndex,i+this.outputOffset+1)}}class Og{constructor(e,t,i,n,o){this.breakOffsets=e,this.breakOffsetsVisibleColumn=t,this.wrappedTextIndentLength=i,this.injectionOffsets=n,this.injectionOptions=o}getInputOffsetOfOutputPosition(e,t){let i=0;if(i=0===e?t:this.breakOffsets[e-1]+t,null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length;n++){if(!(i>this.injectionOffsets[n]))break;i<this.injectionOffsets[n]+this.injectionOptions[n].content.length?i=this.injectionOffsets[n]:i-=this.injectionOptions[n].content.length}return i}getOutputPositionOfInputOffset(e,t=2){let i=0;if(null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length;n++){if(e<this.injectionOffsets[n])break;if(1!==t&&e===this.injectionOffsets[n])break;i+=this.injectionOptions[n].content.length}return e+=i,this.getOutputPositionOfOffsetInUnwrappedLine(e,t)}getOutputPositionOfOffsetInUnwrappedLine(e,t=2){let i=0,n=this.breakOffsets.length-1,o=0,s=0;while(i<=n){o=i+(n-i)/2|0;const r=this.breakOffsets[o];if(s=o>0?this.breakOffsets[o-1]:0,0===t)if(e<=s)n=o-1;else{if(!(e>r))break;i=o+1}else if(e<s)n=o-1;else{if(!(e>=r))break;i=o+1}}return new Mg(o,e-s)}outputPositionToOffsetInUnwrappedLine(e,t){let i=(e>0?this.breakOffsets[e-1]:0)+t;return e>0&&(i-=this.wrappedTextIndentLength),i}normalizeOffsetAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t)return e===i.offsetInUnwrappedLine+i.length?i.offsetInUnwrappedLine+i.length:i.offsetInUnwrappedLine;if(1===t){let e=i.offsetInUnwrappedLine+i.length,t=i.injectedTextIndex;while(t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t])e+=this.injectionOptions[t+1].content.length,t++;return e}let n=i.offsetInUnwrappedLine,o=i.injectedTextIndex;while(o-1>=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o])n-=this.injectionOptions[o-1].content.length,o++;return n}getInjectedText(e,t){const i=this.outputPositionToOffsetInUnwrappedLine(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 o=0;o<t.length;o++){const s=i[o].content.length,r=t[o]+n,a=t[o]+n+s;if(r>e)break;if(e<=a)return{injectedTextIndex:o,offsetInUnwrappedLine:r,length:s};n+=s}}}}class Ag{constructor(e,t){this.tabSize=e,this.data=t}}class Pg{constructor(e,t,i,n,o,s,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=r}}class Rg{constructor(e,t,i,n,o,s,r,a,l,c){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=Rg.isBasicASCII(i,s),this.containsRTL=Rg.containsRTL(i,this.isBasicASCII,o),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=c}static isBasicASCII(e,t){return!t||cr(e)}static containsRTL(e,t,i){return!(t||!i)&&sr(e)}}class Fg{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class Bg{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new Fg(new Ci(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Wg{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class Vg{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static cmp(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}}function zg(e){return Array.isArray(e)}function Hg(e){return!zg(e)}function Kg(e){return"string"===typeof e}function jg(e){return!Kg(e)}function Ug(e){return!e}function $g(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function qg(e){return e.replace(/[&<>'"_]/g,"-")}function Gg(e,t){console.log(`${e.languageId}: ${t}`)}function Yg(e,t){return new Error(`${e.languageId}: ${t}`)}function Xg(e,t,i,n,o){const s=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return t.replace(s,(function(t,s,a,l,c,d,h,u,g){return Ug(a)?Ug(l)?!Ug(c)&&c<n.length?$g(e,n[c]):!Ug(h)&&e&&"string"===typeof e[h]?e[h]:(null===r&&(r=o.split("."),r.unshift(o)),!Ug(d)&&d<r.length?$g(e,r[d]):""):$g(e,i):"$"}))}function Zg(e,t){let i=t;while(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}function Qg(e,t){let i=t;while(i&&i.length>0){const t=e.stateNames[i];if(t)return!0;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return!1}const Jg=5;class ef{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new tf(e,t);let i=tf.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new tf(e,t),this._entries[i]=n,n)}}ef._INSTANCE=new ef(Jg);class tf{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";while(null!==e)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){while(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 tf._equals(this,e)}push(e){return ef.create(this,e)}pop(){return this.parent}popall(){let e=this;while(e.parent)e=e.parent;return e}switchTo(e){return ef.create(this.parent,e)}}class nf{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){let e=this.state.clone();return e===this.state?this:new nf(this.languageId,this.state)}}class of{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(null!==t)return new sf(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new sf(e,t);let i=tf.getStackElementId(e),n=this._entries[i];return n||(n=new sf(e,null),this._entries[i]=n,n)}}of._INSTANCE=new of(Jg);class sf{constructor(e,t){this.stack=e,this.embeddedModeData=t}clone(){let e=this.embeddedModeData?this.embeddedModeData.clone():null;return e===this.embeddedModeData?this:of.create(this.stack,this.embeddedModeData)}equals(e){return e instanceof sf&&(!!this.stack.equals(e.stack)&&(null===this.embeddedModeData&&null===e.embeddedModeData||null!==this.embeddedModeData&&null!==e.embeddedModeData&&this.embeddedModeData.equals(e.embeddedModeData)))}}class rf{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterMode(e,t){this._languageId=t}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new Si(e,t,this._languageId)))}nestedModeTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=kc.get(o);if(!r)return this.enterMode(n,o),this.emit(n,""),s;let a=r.tokenize(e,t,s,n);return this._tokens=this._tokens.concat(a.tokens),this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new xi(this._tokens,e)}}class af{constructor(e,t){this._modeService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterMode(e,t){this._currentLanguageId=this._modeService.languageIdCodec.encodeLanguageId(t)}emit(e,t){let i=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){let n=null!==e?e.length:0,o=t.length,s=null!==i?i.length:0;if(0===n&&0===o&&0===s)return new Uint32Array(0);if(0===n&&0===o)return i;if(0===o&&0===s)return e;let r=new Uint32Array(n+o+s);null!==e&&r.set(e);for(let a=0;a<o;a++)r[n+a]=t[a];return null!==i&&r.set(i,n+o),r}nestedModeTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=kc.get(o);if(!r)return this.enterMode(n,o),this.emit(n,""),s;let a=r.tokenize2(e,t,s,n);return this._prependTokens=af._merge(this._prependTokens,this._tokens,a.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,a.endState}finalize(e){return new ki(af._merge(this._prependTokens,this._tokens,null),e)}}class lf{constructor(e,t,i,n){this._modeService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=n,this._embeddedModes=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let o=!1;this._tokenizationRegistryListener=kc.onDidChange(e=>{if(o)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i<n;i++){let n=e.changedLanguages[i];if(this._embeddedModes[n]){t=!0;break}}t&&(o=!0,kc.fire([this._languageId]),o=!1)})}dispose(){this._tokenizationRegistryListener.dispose()}getLoadStatus(){let e=[];for(let t in this._embeddedModes){const i=kc.get(t);if(i){if(i instanceof lf){const t=i.getLoadStatus();!1===t.loaded&&e.push(t.promise)}continue}const n=kc.getPromise(t);n&&e.push(n)}return 0===e.length?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(e=>{})}}getInitialState(){let e=ef.create(null,this._lexer.start);return of.create(e,null)}tokenize(e,t,i,n){let o=new rf,s=this._tokenize(e,t,i,n,o);return o.finalize(s)}tokenize2(e,t,i,n){let o=new af(this._modeService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(e,t,i,n,o);return o.finalize(s)}_tokenize(e,t,i,n,o){return i.embeddedModeData?this._nestedTokenize(e,t,i,n,o):this._myTokenize(e,t,i,n,o)}_findLeavingNestedModeOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=Zg(this._lexer,t.stack.state),!i))throw Yg(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const s of i){if(!jg(s.action)||"@pop"!==s.action.nextEmbedded)continue;o=!0;let t=s.regex,i=s.regex.source;if("^(?:"===i.substr(0,4)&&")"===i.substr(i.length-1,1)){let e=(t.ignoreCase?"i":"")+(t.unicode?"u":"");t=new RegExp(i.substr(4,i.length-5),e)}let r=e.search(t);-1===r||0!==r&&s.matchOnlyAtLineStart||(-1===n||r<n)&&(n=r)}if(!o)throw Yg(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return n}_nestedTokenize(e,t,i,n,o){let s=this._findLeavingNestedModeOffset(e,i);if(-1===s){let s=o.nestedModeTokenize(e,t,i.embeddedModeData,n);return of.create(i.stack,new nf(i.embeddedModeData.languageId,s))}let r=e.substring(0,s);r.length>0&&o.nestedModeTokenize(r,!1,i.embeddedModeData,n);let a=e.substring(s);return this._myTokenize(a,t,i,n+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterMode(n,this._languageId);const s=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedModeData,c=i.stack,d=0,h=null,u=!0;while(u||d<a){const i=d,g=c.depth,f=h?h.groups.length:0,m=c.state;let p=null,_=null,b=null,v=null,w=null;if(h){p=h.matches;const e=h.groups.shift();_=e.matched,b=e.action,v=h.rule,0===h.groups.length&&(h=null)}else{if(!u&&d>=a)break;u=!1;let e=this._lexer.tokenizer[m];if(!e&&(e=Zg(this._lexer,m),!e))throw Yg(this._lexer,"tokenizer state is not defined: "+m);let t=r.substr(d);for(const i of e)if((0===d||!i.matchOnlyAtLineStart)&&(p=t.match(i.regex),p)){_=p[0],b=i.action;break}}if(p||(p=[""],_=""),b||(d<a&&(p=[r.charAt(d)],_=p[0]),b=this._lexer.defaultToken),null===_)break;d+=_.length;while(Hg(b)&&jg(b)&&b.test)b=b.test(_,p,m,d===a);let C=null;if("string"===typeof b||Array.isArray(b))C=b;else if(b.group)C=b.group;else if(null!==b.token&&void 0!==b.token){if(C=b.tokenSubst?Xg(this._lexer,b.token,_,p,m):b.token,b.nextEmbedded)if("@pop"===b.nextEmbedded){if(!l)throw Yg(this._lexer,"cannot pop embedded mode if not inside one");l=null}else{if(l)throw Yg(this._lexer,"cannot enter embedded mode from within an embedded mode");w=Xg(this._lexer,b.nextEmbedded,_,p,m)}if(b.goBack&&(d=Math.max(0,d-b.goBack)),b.switchTo&&"string"===typeof b.switchTo){let e=Xg(this._lexer,b.switchTo,_,p,m);if("@"===e[0]&&(e=e.substr(1)),!Zg(this._lexer,e))throw Yg(this._lexer,"trying to switch to a state '"+e+"' that is undefined in rule: "+this._safeRuleName(v));c=c.switchTo(e)}else{if(b.transform&&"function"===typeof b.transform)throw Yg(this._lexer,"action.transform not supported");if(b.next)if("@push"===b.next){if(c.depth>=this._lexer.maxStack)throw Yg(this._lexer,"maximum tokenizer stack size reached: ["+c.state+","+c.parent.state+",...]");c=c.push(m)}else if("@pop"===b.next){if(c.depth<=1)throw Yg(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(v));c=c.pop()}else if("@popall"===b.next)c=c.popall();else{let e=Xg(this._lexer,b.next,_,p,m);if("@"===e[0]&&(e=e.substr(1)),!Zg(this._lexer,e))throw Yg(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(v));c=c.push(e)}}b.log&&"string"===typeof b.log&&Gg(this._lexer,this._lexer.languageId+": "+Xg(this._lexer,b.log,_,p,m))}if(null===C)throw Yg(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(v));const y=i=>{let s=this._modeService.getModeIdForLanguageName(i);s&&(i=s);const r=this._getNestedEmbeddedModeData(i);if(d<a){const i=e.substr(d);return this._nestedTokenize(i,t,of.create(c,r),n+d,o)}return of.create(c,r)};if(Array.isArray(C)){if(h&&h.groups.length>0)throw Yg(this._lexer,"groups cannot be nested: "+this._safeRuleName(v));if(p.length!==C.length+1)throw Yg(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(v));let e=0;for(let t=1;t<p.length;t++)e+=p[t].length;if(e!==_.length)throw Yg(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(v));h={rule:v,matches:p,groups:[]};for(let t=0;t<C.length;t++)h.groups[t]={action:C[t],matched:p[t+1]};d-=_.length}else{{if("@rematch"===C&&(d-=_.length,_="",p=null,C="",null!==w))return y(w);if(0===_.length){if(0===a||g!==c.depth||m!==c.state||(h?h.groups.length:0)!==f)continue;throw Yg(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(v))}let e=null;if(Kg(C)&&0===C.indexOf("@brackets")){let t=C.substr("@brackets".length),i=cf(this._lexer,_);if(!i)throw Yg(this._lexer,"@brackets token returned but no bracket defined as: "+_);e=qg(i.token+t)}else{let t=""===C?"":C+this._lexer.tokenPostfix;e=qg(t)}i<s&&o.emit(i+n,e)}if(null!==w)return y(w)}}return of.create(c,l)}_getNestedEmbeddedModeData(e){let t=this._locateMode(e);if(t){let e=kc.get(t);if(e)return new nf(t,e.getInitialState())}return new nf(t||Dc,Ec)}_locateMode(e){if(!e||!this._modeService.isRegisteredMode(e))return null;if(e===this._languageId)return e;const t=this._modeService.getModeId(e);return t&&(this._modeService.triggerMode(t),this._embeddedModes[t]=!0),t}}function cf(e,t){if(!t)return null;t=$g(e,t);let i=e.brackets;for(const n of i){if(n.open===t)return{token:n.token,bracketType:1};if(n.close===t)return{token:n.token,bracketType:-1}}return null}function df(e,t,i,n){return new lf(e,t,i,n)}var hf;const uf=null===(hf=window.trustedTypes)||void 0===hf?void 0:hf.createPolicy("standaloneColorizer",{createHTML:e=>e});class gf{static colorizeElement(e,t,i,n){n=n||{};let o=n.theme||"vs",s=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();e.setTheme(o);let r=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;let a=e=>{var t;const n=null!==(t=null===uf||void 0===uf?void 0:uf.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n};return this.colorize(t,r||"",s,n).then(a,e=>console.error(e))}static colorize(e,t,i,n){const o=e.languageIdCodec;let s=4;n&&"number"===typeof n.tabSize&&(s=n.tabSize),pr(t)&&(t=t.substr(1));let r=Fs(t),a=e.getModeId(i);if(!a)return Promise.resolve(mf(r,s,o));e.triggerMode(a);const l=kc.get(a);if(l)return ff(r,s,l,o);const c=kc.getPromise(a);return new Promise(c?(e,t)=>{c.then(i=>{ff(r,s,i,o).then(e,t)},t)}:(e,t)=>{let i=null,n=null;const l=()=>{i&&(i.dispose(),i=null),n&&(n.dispose(),n=null);const l=kc.get(a);l?ff(r,s,l,o).then(e,t):e(mf(r,s,o))};n=new no,n.cancelAndSet(l,500),i=kc.onDidChange(e=>{e.changedLanguages.indexOf(a)>=0&&l()})})}static colorizeLine(e,t,i,n,o=4){const s=Rg.isBasicASCII(e,t),r=Rg.containsRTL(e,s,i);let a=wg(new fg(!1,!0,e,!1,s,r,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null));return a.html}static colorizeModelLine(e,t,i=4){let n=e.getLineContent(t);e.forceTokenization(t);let o=e.getLineTokens(t),s=o.inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,i)}}function ff(e,t,i,n){return new Promise((o,s)=>{const r=()=>{const a=pf(e,t,i,n);if(i instanceof lf){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(r,s)}o(a)};r()})}function mf(e,t,i){let n=[];const o=16793600,s=new Uint32Array(2);s[0]=0,s[1]=o;for(let r=0,a=e.length;r<a;r++){let o=e[r];s[0]=o.length;const a=new rg(s,o,i),l=Rg.isBasicASCII(o,!0),c=Rg.containsRTL(o,l,!0);let d=wg(new fg(!1,!0,o,!1,l,c,0,a,[],t,0,0,0,0,-1,"none",!1,!1,null));n=n.concat(d.html),n.push("<br/>")}return n.join("")}function pf(e,t,i,n){let o=[],s=i.getInitialState();for(let r=0,a=e.length;r<a;r++){let a=e[r],l=i.tokenize2(a,!0,s,0);rg.convertToEndOffset(l.tokens,a.length);let c=new rg(l.tokens,a,n);const d=Rg.isBasicASCII(a,!0),h=Rg.containsRTL(a,d,!0);let u=wg(new fg(!1,!0,a,!1,d,h,0,c.inflate(),[],t,0,0,0,0,-1,"none",!1,!1,null));o=o.concat(u.html),o.push("<br/>"),s=l.endState}return o.join("")}var _f;(function(e){e[e["Ignore"]=0]="Ignore",e[e["Info"]=1]="Info",e[e["Warning"]=2]="Warning",e[e["Error"]=3]="Error"})(_f||(_f={})),function(e){const t="error",i="warning",n="warn",o="info",s="ignore";function r(s){return s?qs(t,s)?e.Error:qs(i,s)||qs(n,s)?e.Warning:qs(o,s)?e.Info:e.Ignore:e.Ignore}function a(n){switch(n){case e.Error:return t;case e.Warning:return i;case e.Info:return o;default:return s}}e.fromValue=r,e.toString=a}(_f||(_f={}));var bf=_f;function vf(e){return!(!e||"function"!==typeof e.getEditorType)&&e.getEditorType()===Va.ICodeEditor}const wf=gn("IWorkspaceEditService");function Cf(e){return Zr(e)&&(Boolean(e.newUri)||Boolean(e.oldUri))}function yf(e){return Zr(e)&&ci.isUri(e.resource)&&Zr(e.edit)}class Sf{constructor(e){this.metadata=e}static convert(e){return e.edits.map(e=>{if(yf(e))return new xf(e.resource,e.edit,e.modelVersionId,e.metadata);if(Cf(e))return new kf(e.oldUri,e.newUri,e.options,e.metadata);throw new Error("Unsupported edit")})}}class xf extends Sf{constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class kf extends Sf{constructor(e,t,i,n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const Lf=Object.prototype.hasOwnProperty;function Ef(e,t){for(let i in e)if(Lf.call(e,i)){const n=t({key:i,value:e[i]},(function(){delete e[i]}));if(!1===n)return}}class Df{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)}}const Nf=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new rt,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus!==e&&(this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus))}},If=Object.hasOwnProperty;class Tf{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Mf{constructor(){this._values=[]}_read(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Of{static readOptions(e){const t=e,i=new Mf;for(const n of ve){const e="_never_"===n.name?void 0:t[n.name];i._write(n.id,e)}return i}static validateOptions(e){const t=new m;for(const i of ve)t._write(i.id,i.validate(e._read(i.id)));return t}static computeOptions(e,t){const i=new Tf;for(const n of ve)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)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&yu(e,t);for(let i in e)if(!Of._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of ve){const s=!Of._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(n=!0)}return n?new f(i):null}}function Af(e){const t=e.wordWrap;!0===t?e.wordWrap="on":!1===t&&(e.wordWrap="off");const i=e.lineNumbers;!0===i?e.lineNumbers="on":!1===i&&(e.lineNumbers="off");const n=e.autoClosingBrackets;!1===n&&(e.autoClosingBrackets="never",e.autoClosingQuotes="never",e.autoSurround="never");const o=e.cursorBlinking;"visible"===o&&(e.cursorBlinking="solid");const s=e.renderWhitespace;!0===s?e.renderWhitespace="boundary":!1===s&&(e.renderWhitespace="none");const r=e.renderLineHighlight;!0===r?e.renderLineHighlight="line":!1===r&&(e.renderLineHighlight="none");const a=e.acceptSuggestionOnEnter;!0===a?e.acceptSuggestionOnEnter="on":!1===a&&(e.acceptSuggestionOnEnter="off");const l=e.tabCompletion;!1===l?e.tabCompletion="off":!0===l&&(e.tabCompletion="onlySnippets");const c=e.suggest;if(c&&"object"===typeof c.filteredTypes&&c.filteredTypes){const e={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"};Ef(e,e=>{const t=c.filteredTypes[e.key];!1===t&&(c[e.value]=t)})}const d=e.hover;!0===d?e.hover={enabled:!0}:!1===d&&(e.hover={enabled:!1});const h=e.parameterHints;!0===h?e.parameterHints={enabled:!0}:!1===h&&(e.parameterHints={enabled:!1});const u=e.autoIndent;!0===u?e.autoIndent="full":!1===u&&(e.autoIndent="advanced");const g=e.matchBrackets;!0===g?e.matchBrackets="always":!1===g&&(e.matchBrackets="never");const{renderIndentGuides:f,highlightActiveIndentGuide:m}=e;e.guides||(e.guides={}),void 0!==f&&(e.guides.indentation=!!f),void 0!==m&&(e.guides.highlightActiveIndentation=!!m)}function Pf(e){const t=ka(e);return Af(t),t}class Rf extends Ye{constructor(e,t){super(),this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new rt),this.onDidChangeFast=this._onDidChangeFast.event,this.isSimpleWidget=e,this._isDominatedByLongLines=!1,this._computeOptionsMemory=new p,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._rawOptions=Pf(t),this._readOptions=Of.readOptions(this._rawOptions),this._validatedOptions=Of.validateOptions(this._readOptions),this._register(Oa.onDidChangeZoomLevel(e=>this._recomputeOptions())),this._register(Nf.onDidChangeTabFocus(e=>this._recomputeOptions()))}observeReferenceElement(e){}updatePixelRatio(){}_recomputeOptions(){const e=this.options,t=this._computeInternalOptions();if(e){const i=Of.checkEquals(e,t);if(null===i)return;this.options=t,this._onDidChangeFast.fire(i),this._onDidChange.fire(i)}else this.options=t}getRawOptions(){return this._rawOptions}_computeInternalOptions(){const e=this._getEnvConfiguration(),t=Ra.createFromValidatedSettings(this._validatedOptions,e.zoomLevel,e.pixelRatio,this.isSimpleWidget),i={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,fontInfo:this.readConfiguration(t),extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Nf.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return Of.computeOptions(this._validatedOptions,i)}static _subsetEquals(e,t){for(const i in t)if(If.call(t,i)){const n=t[i],o=e[i];if(o===n)continue;if(Array.isArray(o)&&Array.isArray(n)){if(!yu(o,n))return!1;continue}if(o&&"object"===typeof o&&n&&"object"===typeof n){if(!this._subsetEquals(o,n))return!1;continue}return!1}return!0}updateOptions(e){if("undefined"===typeof e)return;const t=Pf(e);Rf._subsetEquals(this._rawOptions,t)||(this._rawOptions=Da(this._rawOptions,t||{}),this._readOptions=Of.readOptions(this._rawOptions),this._validatedOptions=Of.validateOptions(this._readOptions),this._recomputeOptions())}setIsDominatedByLongLines(e){this._isDominatedByLongLines=e,this._recomputeOptions()}setMaxLineNumber(e){const t=Rf._digitCount(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}static _digitCount(e){let t=0;while(e)e=Math.floor(e/10),t++;return t||1}}const Ff=Object.freeze({id:"editor",order:5,type:"object",title:o("editorConfigurationTitle","Editor"),scope:5}),Bf=zd.as($d.Configuration),Wf=Object.assign(Object.assign({},Ff),{properties:{"editor.tabSize":{type:"number",default:be.tabSize,minimum:1,markdownDescription:o("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.insertSpaces":{type:"boolean",default:be.insertSpaces,markdownDescription:o("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.detectIndentation":{type:"boolean",default:be.detectIndentation,markdownDescription:o("detectIndentation","Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.")},"editor.trimAutoWhitespace":{type:"boolean",default:be.trimAutoWhitespace,description:o("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:be.largeFileOptimizations,description:o("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:o("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[o("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),o("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),o("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:o("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[o("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),o("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),o("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:o("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:o("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:o("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.language.brackets":{type:"array",default:!1,description:o("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:o("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:o("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:"array",default:!1,description:o("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:o("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:o("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:o("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:50,description:o("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:o("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:o("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:o("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:o("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[o("wordWrap.off","Lines will never wrap."),o("wordWrap.on","Lines will wrap at the viewport width."),o("wordWrap.inherit","Lines will wrap according to the `#editor.wordWrap#` setting.")]}}});function Vf(e){return"undefined"!==typeof e.type||"undefined"!==typeof e.anyOf}for(const IK of ve){const e=IK.schema;if("undefined"!==typeof e)if(Vf(e))Wf.properties["editor."+IK.name]=e;else for(let t in e)If.call(e,t)&&(Wf.properties[t]=e[t])}let zf=null;function Hf(){return null===zf&&(zf=Object.create(null),Object.keys(Wf.properties).forEach(e=>{zf[e]=!0})),zf}function Kf(e){const t=Hf();return t["editor."+e]||!1}function jf(e){const t=Hf();return t["diffEditor."+e]||!1}Bf.registerConfiguration(Wf);class Uf{static insert(e,t){return{range:new Ci(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}}}class $f{constructor(e={},t=[],i=[]){this._contents=e,this._keys=t,this._overrides=i,this.isFrozen=!1,this.overrideConfigurations=new Map}get contents(){return this.checkAndFreeze(this._contents)}get overrides(){return this.checkAndFreeze(this._overrides)}get keys(){return this.checkAndFreeze(this._keys)}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?gh(this.contents,e):this.contents}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=ka(this.contents),i=ka(this.overrides),n=[...this.keys];for(const o of e){this.mergeContents(t,o.contents);for(const e of o.overrides){const[t]=i.filter(t=>yu(t.identifiers,e.identifiers));t?this.mergeContents(t.contents,e.contents):i.push(ka(e))}for(const e of o.keys)-1===n.indexOf(e)&&n.push(e)}return new $f(t,n,i)}freeze(){return this.isFrozen=!0,this}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!==typeof t||!Object.keys(t).length)return this;let i={};for(const n of Eu([...Object.keys(this.contents),...Object.keys(t)])){let e=this.contents[n],o=t[n];o&&("object"===typeof e&&"object"===typeof o?(e=ka(e),this.mergeContents(e,o)):e=o),i[n]=e}return new $f(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t))i in e&&Zr(e[i])&&Zr(t[i])?this.mergeContents(e[i],t[i]):e[i]=ka(t[i])}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?La(e):e}getContentsForOverrideIdentifer(e){for(const t of this.overrides)if(-1!==t.identifiers.indexOf(e))return t.contents;return null}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.addKey(e),dh(this.contents,e,t,e=>{throw new Error(e)})}removeValue(e){this.removeKey(e)&&hh(this.contents,e)}addKey(e){let t=this.keys.length;for(let i=0;i<t;i++)0===e.indexOf(this.keys[i])&&(t=i);this.keys.splice(t,1,e)}removeKey(e){let t=this.keys.indexOf(e);return-1!==t&&(this.keys.splice(t,1),!0)}}class qf extends $f{constructor(){const e=mh(),t=fh(),i=[];for(const n of Object.keys(e))nh.test(n)&&i.push({identifiers:[oh(n).trim()],keys:Object.keys(e[n]),contents:ch(e[n],e=>console.error("Conflict in default settings file: "+e))});super(e,t,i)}}class Gf{constructor(e,t,i=new $f,n=new $f,o=new Pr,s=new $f,r=new Pr,a=!0){this._defaultConfiguration=e,this._localUserConfiguration=t,this._remoteUserConfiguration=i,this._workspaceConfiguration=n,this._folderConfigurations=o,this._memoryConfiguration=s,this._memoryConfigurationByResource=r,this._freeze=a,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Pr,this._userConfiguration=null}getValue(e,t,i){const n=this.getConsolidateConfigurationModel(t,i);return n.getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=new $f,this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration),this._freeze&&this._userConfiguration.freeze()),this._userConfiguration}getConsolidateConfigurationModel(e,t){let i=this.getConsolidatedConfigurationModelForResource(e,t);return e.overrideIdentifier?i.override(e.overrideIdentifier):i}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._freeze&&(this._workspaceConfiguration=this._workspaceConfiguration.freeze())),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._freeze&&(t=t.freeze()),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.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:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.user),n=this.parseConfigurationModel(e.workspace),o=e.folders.reduce((e,t)=>(e.set(ci.revive(t[0]),this.parseConfigurationModel(t[1])),e),new Pr);return new Gf(t,i,new $f,n,o,new $f,new Pr,!1)}static parseConfigurationModel(e){return new $f(e.contents,e.keys,e.overrides).freeze()}}class Yf{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._previousConfiguration=void 0;const o=new Set;e.keys.forEach(e=>o.add(e)),e.overrides.forEach(([,e])=>e.forEach(e=>o.add(e))),this.affectedKeys=[...o.values()];const s=new $f;this.affectedKeys.forEach(e=>s.setValue(e,{})),this.affectedKeysTree=s.contents}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Gf.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;if(this.doesAffectedKeysTreeContains(this.affectedKeysTree,e)){if(t){const n=this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(i=this.previous)||void 0===i?void 0:i.workspace):void 0,o=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Na(n,o)}return!0}return!1}doesAffectedKeysTreeContains(e,t){let i,n=ch({[t]:!0},()=>{});while("object"===typeof n&&(i=Object.keys(n)[0])){if(e=e[i],!e)return!1;n=n[i]}return!0}}const Xf=/^(cursor|delete)/;class Zf extends Ye{constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new rt),this._currentChord=null,this._currentChordChecker=new oo,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Qf.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new no,this._logging=!1}get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:it.None}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){const i=this.resolveKeyboardEvent(e);if(i.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),null;const[n]=i.getDispatchParts();if(null===n)return null;const o=this._contextKeyService.getContext(t),s=this._currentChord?this._currentChord.keypress:null;return this._getResolver().resolve(o,s,n)}_enterChordMode(e,t){this._currentChord={keypress:e,label:t},this._currentChordStatusMessage=this._notificationService.status(o("first.chord","({0}) was pressed. Waiting for second key of chord...",t));const i=Date.now();this._currentChordChecker.cancelAndSet(()=>{this._documentHasFocus()?Date.now()-i>5e3&&this._leaveChordMode():this._leaveChordMode()},500)}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchParts();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=Qf.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Qf.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[o]=i.getParts();return this._ignoreSingleModifiers=new Qf(o),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){let n=!1;if(e.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;let s=null,r=null;if(i){const[t]=e.getSingleModifierDispatchParts();s=t,r=t}else[s]=e.getDispatchParts(),r=this._currentChord?this._currentChord.keypress:null;if(null===s)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const a=this._contextKeyService.getContext(t),l=e.getLabel(),c=this._getResolver().resolve(a,r,s);return this._logService.trace("KeybindingService#dispatch",l,null===c||void 0===c?void 0:c.commandId),c&&c.enterChord?(n=!0,this._enterChordMode(s,l),n):(this._currentChord&&(c&&c.commandId||(this._notificationService.status(o("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,l),{hideAfter:1e4}),n=!0)),this._leaveChordMode(),c&&c.commandId&&(c.bubble||(n=!0),"undefined"===typeof c.commandArgs?this._commandService.executeCommand(c.commandId).then(void 0,e=>this._notificationService.warn(e)):this._commandService.executeCommand(c.commandId,c.commandArgs).then(void 0,e=>this._notificationService.warn(e)),Xf.test(c.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"keybinding"})),n)}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class Qf{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}}}Qf.EMPTY=new Qf(null);let Jf=s["k"]||"";const em=new Map;em.set("false",!1),em.set("true",!0),em.set("isMac",s["f"]),em.set("isLinux",s["d"]),em.set("isWindows",s["i"]),em.set("isWeb",s["h"]),em.set("isMacNative",s["f"]&&!s["h"]),em.set("isEdge",Jf.indexOf("Edg/")>=0),em.set("isFirefox",Jf.indexOf("Firefox")>=0),em.set("isChrome",Jf.indexOf("Chrome")>=0),em.set("isSafari",Jf.indexOf("Safari")>=0);const tm=Object.prototype.hasOwnProperty;class im{static has(e){return am.create(e)}static equals(e,t){return lm.create(e,t)}static regex(e,t){return bm.create(e,t)}static not(e){return um.create(e)}static and(...e){return Cm.create(e,null)}static or(...e){return ym.create(e,null,!0)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let i=e.split("||");return ym.create(i.map(e=>this._deserializeAndExpression(e,t)),null,!0)}static _deserializeAndExpression(e,t){let i=e.split("&&");return Cm.create(i.map(e=>this._deserializeOne(e,t)),null)}static _deserializeOne(e,t){if(e=e.trim(),e.indexOf("!=")>=0){let i=e.split("!=");return hm.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){let i=e.split("==");return lm.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){let i=e.split("=~");return bm.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" in ")>=0){let t=e.split(" in ");return cm.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const t=e.split(">=");return mm.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const t=e.split(">");return fm.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const t=e.split("<=");return _m.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const t=e.split("<");return pm.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?um.create(e.substr(1).trim()):am.create(e)}static _deserializeValue(e,t){if(e=e.trim(),"true"===e)return!0;if("false"===e)return!1;let i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){if(Ls(e)){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let i=e.indexOf("/"),n=e.lastIndexOf("/");if(i===n||i<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}let o=e.slice(i+1,n),s="i"===e[n+1]?"i":"";try{return new RegExp(o,s)}catch(r){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${r}`);return console.warn(`bad regexp-value '${e}', parse error: ${r}`),null}}}function nm(e,t){const i=e?e.substituteConstants():void 0,n=t?t.substituteConstants():void 0;return!i&&!n||!(!i||!n)&&i.equals(n)}function om(e,t){return e.cmp(t)}class sm{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 rm.INSTANCE}}sm.INSTANCE=new sm;class rm{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 sm.INSTANCE}}rm.INSTANCE=new rm;class am{constructor(e,t){this.key=e,this.negated=t,this.type=2}static create(e,t=null){const i=em.get(e);return"boolean"===typeof i?i?rm.INSTANCE:sm.INSTANCE:new am(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:Lm(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=em.get(this.key);return"boolean"===typeof e?e?rm.INSTANCE:sm.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=um.create(this.key,this)),this.negated}}class lm{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}static create(e,t,i=null){if("boolean"===typeof t)return t?am.create(e,i):um.create(e,i);const n=em.get(e);if("boolean"===typeof n){const e=n?"true":"false";return t===e?rm.INSTANCE:sm.INSTANCE}return new lm(e,t,i)}cmp(e){return e.type!==this.type?this.type-e.type:Em(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=em.get(this.key);if("boolean"===typeof e){const t=e?"true":"false";return this.value===t?rm.INSTANCE:sm.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=hm.create(this.key,this.value,this)),this.negated}}class cm{constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}static create(e,t){return new cm(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:Em(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.indexOf(i)>=0:"string"===typeof i&&"object"===typeof t&&null!==t&&tm.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=dm.create(this)),this.negated}}class dm{constructor(e){this._actual=e,this.type=11}static create(e){return new dm(e)}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(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class hm{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}static create(e,t,i=null){if("boolean"===typeof t)return t?um.create(e,i):am.create(e,i);const n=em.get(e);if("boolean"===typeof n){const e=n?"true":"false";return t===e?sm.INSTANCE:rm.INSTANCE}return new hm(e,t,i)}cmp(e){return e.type!==this.type?this.type-e.type:Em(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=em.get(this.key);if("boolean"===typeof e){const t=e?"true":"false";return this.value===t?sm.INSTANCE:rm.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=lm.create(this.key,this.value,this)),this.negated}}class um{constructor(e,t){this.key=e,this.negated=t,this.type=3}static create(e,t=null){const i=em.get(e);return"boolean"===typeof i?i?sm.INSTANCE:rm.INSTANCE:new um(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:Lm(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=em.get(this.key);return"boolean"===typeof e?e?sm.INSTANCE:rm.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return"!"+this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=am.create(this.key,this)),this.negated}}function gm(e,t){if("string"===typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"===typeof e||"number"===typeof e?t(e):sm.INSTANCE}class fm{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}static create(e,t,i=null){return gm(t,t=>new fm(e,t,i))}cmp(e){return e.type!==this.type?this.type-e.type:Em(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=_m.create(this.key,this.value,this)),this.negated}}class mm{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}static create(e,t,i=null){return gm(t,t=>new mm(e,t,i))}cmp(e){return e.type!==this.type?this.type-e.type:Em(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=pm.create(this.key,this.value,this)),this.negated}}class pm{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}static create(e,t,i=null){return gm(t,t=>new pm(e,t,i))}cmp(e){return e.type!==this.type?this.type-e.type:Em(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=mm.create(this.key,this.value,this)),this.negated}}class _m{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}static create(e,t,i=null){return gm(t,t=>new _m(e,t,i))}cmp(e){return e.type!==this.type?this.type-e.type:Em(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=fm.create(this.key,this.value,this)),this.negated}}class bm{constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}static create(e,t){return new bm(e,t)}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){let t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=vm.create(this)),this.negated}}class vm{constructor(e){this._actual=e,this.type=8}static create(e){return new vm(e)}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(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function wm(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 Cm{constructor(e,t){this.expr=e,this.negated=t,this.type=6}static create(e,t){return Cm._normalizeArr(e,t)}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=om(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=wm(this.expr);return e===this.expr?this:Cm.create(e,this.negated)}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){const i=[];let n=!1;for(const o of e)if(o)if(1!==o.type){if(0===o.type)return sm.INSTANCE;6!==o.type?i.push(o):i.push(...o.expr)}else n=!0;if(0===i.length&&n)return rm.INSTANCE;if(0!==i.length){if(1===i.length)return i[0];i.sort(om);for(let e=1;e<i.length;e++)i[e-1].equals(i[e])&&(i.splice(e,1),e--);if(1===i.length)return i[0];while(i.length>1){const e=i[i.length-1];if(9!==e.type)break;i.pop();const t=i.pop(),n=0===i.length,o=ym.create(e.expr.map(e=>Cm.create([e,t],null)),null,n);o&&(i.push(o),i.sort(om))}return 1===i.length?i[0]:new Cm(i,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(let t of this.expr)e.push(t.negate());this.negated=ym.create(e,this,!0)}return this.negated}}class ym{constructor(e,t){this.expr=e,this.negated=t,this.type=9}static create(e,t,i){return ym._normalizeArr(e,t,i)}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=om(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=wm(this.expr);return e===this.expr?this:ym.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=[],o=!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 rm.INSTANCE;9!==i.type?n.push(i):n=n.concat(i.expr)}else o=!0}if(0===n.length&&o)return sm.INSTANCE;n.sort(om)}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++)Dm(n[e],n[t])&&(n.splice(t,1),t--);if(1===n.length)return n[0]}return new ym(n,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());while(e.length>1){const t=e.shift(),i=e.shift(),n=[];for(const e of Nm(t))for(const t of Nm(i))n.push(Cm.create([e,t],null));const o=0===e.length;e.unshift(ym.create(n,null,o))}this.negated=e[0]}return this.negated}}class Sm extends am{constructor(e,t,i){super(e,null),this._defaultValue=t,"object"===typeof i?Sm._info.push(Object.assign(Object.assign({},i),{key:e})):!0!==i&&Sm._info.push({key:e,description:i,type:null!==t&&void 0!==t?typeof t:void 0})}static all(){return Sm._info.values()}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return lm.create(this.key,e)}}Sm._info=[];const xm=gn("contextKeyService"),km="setContext";function Lm(e,t){return e<t?-1:e>t?1:0}function Em(e,t,i,n){return e<i?-1:e>i?1:t<n?-1:t>n?1:0}function Dm(e,t){if(6===t.type&&9!==e.type&&6!==e.type)for(const o of t.expr)if(e.equals(o))return!0;const i=e.negate(),n=Nm(i).concat(Nm(t));n.sort(om);for(let o=0;o<n.length;o++){const e=n[o],t=e.negate();for(let i=o+1;i<n.length;i++){const e=n[i];if(t.equals(e))return!0}}return!1}function Nm(e){return 9===e.type?e.expr:[e]}class Im{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(let n=0,o=e.length;n<o;n++){const t=e[n].command;t&&this._defaultBoundCommands.set(t,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=Im.combine(e,t);for(let n=0,o=this._keybindings.length;n<o;n++){let e=this._keybindings[n];0!==e.keypressParts.length&&(e.when&&0===e.when.type||this._addKeyPress(e.keypressParts[0],e))}}static _isTargetedForRemoval(e,t,i,n,o){if(e.command!==n)return!1;if(t&&e.keypressParts[0]!==t)return!1;if(i&&e.keypressParts[1]!==i)return!1;if(o){if(!e.when)return!1;if(!nm(o,e.when))return!1}return!0}static combine(e,t){e=e.slice(0);let i=[];for(const n of t){if(!n.command||0===n.command.length||"-"!==n.command.charAt(0)){i.push(n);continue}const t=n.command.substr(1),o=n.keypressParts[0],s=n.keypressParts[1],r=n.when;for(let i=e.length-1;i>=0;i--)this._isTargetedForRemoval(e[i],o,s,t,r)&&e.splice(i,1)}return e.concat(i)}_addKeyPress(e,t){const i=this._map.get(e);if("undefined"===typeof i)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let n=i.length-1;n>=0;n--){let e=i[n];if(e.command===t.command)continue;const o=e.keypressParts.length>1,s=t.keypressParts.length>1;o&&s&&e.keypressParts[1]!==t.keypressParts[1]||Im.whenIsEntirelyIncluded(e.when,t.when)&&this._removeFromLookupMap(e)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);"undefined"===typeof t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);if("undefined"!==typeof 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)&&Dm(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if("undefined"===typeof i||0===i.length)return null;if(1===i.length)return i[0];for(let n=i.length-1;n>=0;n--){const e=i[n];if(t.contextMatchesRules(e.when))return e}return i[i.length-1]}resolve(e,t,i){this._log(`| Resolving ${i}${t?" chorded from "+t:""}`);let n=null;if(null!==t){const e=this._map.get(t);if("undefined"===typeof e)return this._log("\\ No keybinding entries."),null;n=[];for(let t=0,o=e.length;t<o;t++){let o=e[t];o.keypressParts[1]===i&&n.push(o)}}else{const e=this._map.get(i);if("undefined"===typeof e)return this._log("\\ No keybinding entries."),null;n=e}let o=this._findCommand(e,n);return o?null===t&&o.keypressParts.length>1&&null!==o.keypressParts[1]?(this._log(`\\ From ${n.length} keybinding entries, matched chord, when: ${Tm(o.when)}, source: ${Mm(o)}.`),{enterChord:!0,leaveChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${n.length} keybinding entries, matched ${o.command}, when: ${Tm(o.when)}, source: ${Mm(o)}.`),{enterChord:!1,leaveChord:o.keypressParts.length>1,commandId:o.command,commandArgs:o.commandArgs,bubble:o.bubble}):(this._log(`\\ From ${n.length} keybinding entries, no when clauses matched the context.`),null)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){let n=t[i];if(Im.contextMatchesRules(e,n.when))return n}return null}static contextMatchesRules(e,t){return!t||t.evaluate(e)}}function Tm(e){return e?""+e.serialize():"no when condition"}function Mm(e){return e.extensionId?e.isBuiltinExtension?"built-in extension "+e.extensionId:"user extension "+e.extensionId:e.isDefault?"built-in":"user"}class Om{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===s["a"]){if(e&&e.win)return e.win}else if(2===s["a"]){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=Om.bindToCurrentPlatform(e);if(t&&t.primary){const i=Tn(t.primary,s["a"]);i&&this._registerDefaultKeybinding(i,e.id,e.args,e.weight,0,e.when)}if(t&&Array.isArray(t.secondary))for(let i=0,n=t.secondary.length;i<n;i++){const n=t.secondary[i],o=Tn(n,s["a"]);o&&this._registerDefaultKeybinding(o,e.id,e.args,e.weight,-i-1,e.when)}}registerCommandAndKeybindingRule(e){this.registerKeybindingRule(e),ga.registerCommand(e)}static _mightProduceChar(e){return e>=21&&e<=30||(e>=31&&e<=56||(80===e||81===e||82===e||83===e||84===e||85===e||86===e||110===e||111===e||87===e||88===e||89===e||90===e||91===e||92===e))}_assertNoCtrlAlt(e,t){e.ctrlKey&&e.altKey&&!e.metaKey&&Om._mightProduceChar(e.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",e," for ",t)}_registerDefaultKeybinding(e,t,i,n,o,r){1===s["a"]&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e.parts,command:t,commandArgs:i,when:r,weight1:n,weight2:o,extensionId:null,isBuiltinExtension:!1}),this._cachedMergedKeybindings=null}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Rm)),this._cachedMergedKeybindings.slice(0)}}const Am=new Om,Pm={EditorModes:"platform.keybindingsRegistry"};function Rm(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.command<t.command?-1:e.command>t.command?1:e.weight2-t.weight2}zd.add(Pm.EditorModes,Am);class Fm{constructor(e,t,i,n,o,s,r){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.keypressParts=e?Bm(e.getDispatchParts()):[],e&&0===this.keypressParts.length&&(this.keypressParts=Bm(e.getSingleModifierDispatchParts())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=r}}function Bm(e){let t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n)return t;t.push(n)}return t}class Wm{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 o=0,s=t.length;o<s;o++){const s=t[o],r=i(s);if(null===r)return null;n[o]=Km(s,r,this.modifierLabels[e])}return n.join(" ")}}const Vm=new Wm({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:o({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:o({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:o({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:o({key:"windowsKey",comment:["This is the short form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:o({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:o({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:o({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:o({key:"superKey",comment:["This is the short form for the Super key on the keyboard"]},"Super"),separator:"+"}),zm=new Wm({ctrlKey:o({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:o({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:o({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:o({key:"cmdKey.long",comment:["This is the long form for the Command key on the keyboard"]},"Command"),separator:"+"},{ctrlKey:o({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:o({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:o({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:o({key:"windowsKey.long",comment:["This is the long form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:o({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:o({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:o({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:o({key:"superKey.long",comment:["This is the long form for the Super key on the keyboard"]},"Super"),separator:"+"}),Hm=new Wm({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"});function Km(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 jm extends Rn{constructor(e,t){if(super(),0===t.length)throw Ie("parts");this._os=e,this._parts=t}getLabel(){return Vm.toLabel(this._os,this._parts,e=>this._getLabel(e))}getAriaLabel(){return zm.toLabel(this._os,this._parts,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._parts.length>1||this._parts[0].isDuplicateModifierCase()?null:Hm.toLabel(this._os,this._parts,e=>this._getElectronAccelerator(e))}isChord(){return this._parts.length>1}getParts(){return this._parts.map(e=>this._getPart(e))}_getPart(e){return new Pn(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchParts(){return this._parts.map(e=>this._getDispatchPart(e))}getSingleModifierDispatchParts(){return this._parts.map(e=>this._getSingleModifierDispatchPart(e))}}class Um extends jm{constructor(e,t){super(t,e.parts)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Lt.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Lt.toString(e.keyCode)}_getElectronAccelerator(e){return Lt.toElectronAccelerator(e.keyCode)}_getDispatchPart(e){return Um.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+=Lt.toString(e.keyCode),t}_getSingleModifierDispatchPart(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=xt[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 83;case 52:return 81;case 53:return 87;case 54:return 89;case 55:return 88;case 56:return 0;case 57:return 80;case 58:return 90;case 59:return 86;case 60:return 82;case 61:return 84;case 62:return 85;case 106:return 92}return 0}static _resolveSimpleUserBinding(e){if(!e)return null;if(e instanceof On)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new On(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveUserBinding(e,t){const i=Bm(e.map(e=>this._resolveSimpleUserBinding(e)));return i.length>0?[new Um(new An(i),t)]:[]}}const $m=gn("notificationService");class qm{}const Gm=gn("contextService");class Ym{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}}}var Xm,Zm,Qm,Jm,ep,tp,ip,np,op;(function(e){e.noSelection=o("noSelection","No selection"),e.singleSelectionRange=o("singleSelectionRange","Line {0}, Column {1} ({2} selected)"),e.singleSelection=o("singleSelection","Line {0}, Column {1}"),e.multiSelectionRange=o("multiSelectionRange","{0} selections ({1} characters selected)"),e.multiSelection=o("multiSelection","{0} selections"),e.emergencyConfOn=o("emergencyConfOn","Now changing the setting `accessibilitySupport` to 'on'."),e.openingDocs=o("openingDocs","Now opening the Editor Accessibility documentation page."),e.readonlyDiffEditor=o("readonlyDiffEditor"," in a read-only pane of a diff editor."),e.editableDiffEditor=o("editableDiffEditor"," in a pane of a diff editor."),e.readonlyEditor=o("readonlyEditor"," in a read-only code editor"),e.editableEditor=o("editableEditor"," in a code editor"),e.changeConfigToOnMac=o("changeConfigToOnMac","To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),e.changeConfigToOnWinLinux=o("changeConfigToOnWinLinux","To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),e.auto_on=o("auto_on","The editor is configured to be optimized for usage with a Screen Reader."),e.auto_off=o("auto_off","The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),e.tabFocusModeOnMsg=o("tabFocusModeOnMsg","Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),e.tabFocusModeOnMsgNoKb=o("tabFocusModeOnMsgNoKb","Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."),e.tabFocusModeOffMsg=o("tabFocusModeOffMsg","Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),e.tabFocusModeOffMsgNoKb=o("tabFocusModeOffMsgNoKb","Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),e.openDocMac=o("openDocMac","Press Command+H now to open a browser window with more information related to editor accessibility."),e.openDocWinLinux=o("openDocWinLinux","Press Control+H now to open a browser window with more information related to editor accessibility."),e.outroMsg=o("outroMsg","You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),e.showAccessibilityHelpAction=o("showAccessibilityHelpAction","Show Accessibility Help")})(Xm||(Xm={})),function(e){e.inspectTokensAction=o("inspectTokens","Developer: Inspect Tokens")}(Zm||(Zm={})),function(e){e.gotoLineActionLabel=o("gotoLineActionLabel","Go to Line/Column...")}(Qm||(Qm={})),function(e){e.helpQuickAccessActionLabel=o("helpQuickAccess","Show all Quick Access Providers")}(Jm||(Jm={})),function(e){e.quickCommandActionLabel=o("quickCommandActionLabel","Command Palette"),e.quickCommandHelp=o("quickCommandActionHelp","Show And Run Commands")}(ep||(ep={})),function(e){e.quickOutlineActionLabel=o("quickOutlineActionLabel","Go to Symbol..."),e.quickOutlineByCategoryActionLabel=o("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")}(tp||(tp={})),function(e){e.editorViewAccessibleLabel=o("editorViewAccessibleLabel","Editor content"),e.accessibilityHelpMessage=o("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")}(ip||(ip={})),function(e){e.toggleHighContrast=o("toggleHighContrast","Toggle High Contrast Theme")}(np||(np={})),function(e){e.bulkEditServiceSummary=o("bulkEditServiceSummary","Made {0} edits in {1} files")}(op||(op={}));var sp=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},rp=function(e,t){return function(i,n){t(i,n,e)}},ap=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class lp{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new rt}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}function cp(e,t,i){return vf(e)?t(e):i(e)}let dp=class{constructor(e){this.modelService=e}setEditor(e){this.editor=e}createModelReference(e){let t=null;return this.editor&&(t=cp(this.editor,t=>this.findModel(t,e),t=>this.findModel(t.getOriginalEditor(),e)||this.findModel(t.getModifiedEditor(),e))),t?Promise.resolve(new Ze(new lp(t))):Promise.reject(new Error("Model not found"))}findModel(e,t){let i=this.modelService.getModel(t);return i&&i.uri.toString()!==t.toString()?null:i}};dp=sp([rp(0,Pl)],dp);class hp{show(){return hp.NULL_PROGRESS_RUNNER}showWhile(e,t){return ap(this,void 0,void 0,(function*(){yield e}))}}hp.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class up{confirm(e){return this.doConfirm(e).then(e=>({confirmed:e,checkboxChecked:!1}))}doConfirm(e){let t=e.message;return e.detail&&(t=t+"\n\n"+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}}class gp{info(e){return this.notify({severity:bf.Info,message:e})}warn(e){return this.notify({severity:bf.Warning,message:e})}error(e){return this.notify({severity:bf.Error,message:e})}notify(e){switch(e.severity){case bf.Error:console.error(e.message);break;case bf.Warning:console.warn(e.message);break;default:console.log(e.message);break}return gp.NO_OP}status(e,t){return Ye.None}}gp.NO_OP=new qm;class fp{constructor(e){this._onWillExecuteCommand=new rt,this._onDidExecuteCommand=new rt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=ga.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(n){return Promise.reject(n)}}}class mp extends Zf{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._register(bo(s,os.KEY_DOWN,e=>{const t=new Hn(e),i=this._dispatch(t,t.target);i&&(t.preventDefault(),t.stopPropagation())})),this._register(bo(window,os.KEY_UP,e=>{const t=new Hn(e),i=this._singleModifierDispatch(t,t.target);i&&t.preventDefault()}))}addDynamicKeybinding(e,t,i,n){const o=Tn(t,s["a"]),r=new Ge;return o&&(this._dynamicKeybindings.push({keybinding:o.parts,command:e,when:n,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),r.add(qe(()=>{for(let t=0;t<this._dynamicKeybindings.length;t++){let i=this._dynamicKeybindings[t];if(i.command===e)return this._dynamicKeybindings.splice(t,1),void this.updateResolver({source:1})}}))),r.add(ga.registerCommand(e,i)),this.updateResolver({source:1}),r}updateResolver(e){this._cachedResolver=null,this._onDidUpdateKeybindings.fire(e)}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(Am.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new Im(e,t,e=>this._log(e))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){let i=[],n=0;for(const o of e){const e=o.when||void 0,r=o.keybinding;if(r){const a=Um.resolveUserBinding(r,s["a"]);for(const s of a)i[n++]=new Fm(s,o.command,o.commandArgs,e,t,null,!1)}else i[n++]=new Fm(void 0,o.command,o.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){let t=new On(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new Um(t,s["a"])}}function pp(e){return e&&"object"===typeof e&&(!e.overrideIdentifier||"string"===typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof ci)}class _p{constructor(){this._onDidChangeConfiguration=new rt,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new Gf(new qf,new $f)}getValue(e,t){const i="string"===typeof e?e:void 0,n=pp(e)?e:pp(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()};let i=[];for(const n of e){const[e,t]=n;this.getValue(e)!==t&&(this._configuration.updateValue(e,t),i.push(e))}if(i.length>0){const e=new Yf({keys:i,overrides:[]},t,this._configuration);e.source=7,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}}class bp{constructor(e){this.configurationService=e,this._onDidChangeConfiguration=new rt,this.configurationService.onDidChangeConfiguration(e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})})}getValue(e,t,i){const n=wi.isIPosition(t)?t:null,o=n?"string"===typeof i?i:void 0:"string"===typeof t?t:void 0;return"undefined"===typeof o?this.configurationService.getValue():this.configurationService.getValue(o)}}let vp=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:s["d"]||s["f"]?"\n":"\r\n"}};vp=sp([rp(0,lh)],vp);class wp{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class Cp{constructor(){const e=ci.from({scheme:Cp.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new Ym({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}}function yp(e,t,i){if(!t)return;if(!(e instanceof _p))return;let n=[];Object.keys(t).forEach(e=>{Kf(e)&&n.push(["editor."+e,t[e]]),i&&jf(e)&&n.push(["diffEditor."+e,t[e]])}),n.length>0&&e.updateValues(n)}Cp.SCHEME="inmemory";class Sp{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return ap(this,void 0,void 0,(function*(){const t=new Map;for(let o of e){if(!(o instanceof xf))throw new Error("bad edit - only text edits are supported");const e=this._modelService.getModel(o.resource);if(!e)throw new Error("bad edit - model not found");if("number"===typeof o.versionId&&e.getVersionId()!==o.versionId)throw new Error("bad state - model changed in the meantime");let i=t.get(e);i||(i=[],t.set(e,i)),i.push(Uf.replaceMove(Ci.lift(o.textEdit.range),o.textEdit.text))}let i=0,n=0;for(const[e,o]of t)e.pushStackElement(),e.pushEditOperations([],o,()=>[]),e.pushStackElement(),n+=1,i+=o.length;return{ariaSummary:Ds(op.bulkEditServiceSummary,i,n)}}))}}class xp{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}}class kp{constructor(e,t){this._codeEditorService=e,this._container=t,this.onDidLayout=it.None}get dimension(){return this._dimension||(this._dimension=Ao(window.document.body)),this._dimension}get container(){return this._container}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}}i("0678");const Lp=2e4;let Ep,Dp,Np,Ip,Tp;function Mp(e){Ep=document.createElement("div"),Ep.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"),Ep.appendChild(e),e};Dp=t(),Np=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("role","complementary"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),Ep.appendChild(e),e};Ip=i(),Tp=i(),e.appendChild(Ep)}function Op(e){Ep&&(Dp.textContent!==e?(mo(Np),Pp(Dp,e)):(mo(Dp),Pp(Np,e)))}function Ap(e){Ep&&(s["f"]?Op(e):Ip.textContent!==e?(mo(Tp),Pp(Ip,e)):(mo(Ip),Pp(Tp,e)))}function Pp(e,t){mo(e),t.length>Lp&&(t=t.substr(0,Lp)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}const Rp=gn("markerDecorationsService");var Fp,Bp=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Wp extends Ye{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}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}))}run(e,t){return Bp(this,void 0,void 0,(function*(){this._actionCallback&&(yield this._actionCallback(e))}))}}class Vp extends Ye{constructor(){super(...arguments),this._onBeforeRun=this._register(new rt),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new rt),this.onDidRun=this._onDidRun.event}run(e,t){return Bp(this,void 0,void 0,(function*(){if(!e.enabled)return;this._onBeforeRun.fire({action:e});let i=void 0;try{yield this.runAction(e,t)}catch(n){i=n}this._onDidRun.fire({action:e,error:i})}))}runAction(e,t){return Bp(this,void 0,void 0,(function*(){yield e.run(t)}))}}class zp extends Wp{constructor(e){super(zp.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}zp.ID="vs.actions.separator";class Hp{constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=e,this.label=t,this.class=n,this._actions=i}get actions(){return this._actions}dispose(){}run(){return Bp(this,void 0,void 0,(function*(){}))}}class Kp extends Wp{constructor(){super(Kp.ID,o("submenu.empty","(empty)"),void 0,!1)}}Kp.ID="vs.actions.empty",function(e){e["DARK"]="dark",e["LIGHT"]="light",e["HIGH_CONTRAST"]="hc"}(Fp||(Fp={}));const jp=gn("themeService");var Up,$p;function qp(e){return{id:e}}function Gp(e){switch(e){case Fp.DARK:return"vs-dark";case Fp.HIGH_CONTRAST:return"hc-black";default:return"vs"}}(function(e){function t(e){return e&&"object"===typeof e&&"string"===typeof e.id}e.isThemeColor=t})(Up||(Up={})),function(e){function t(e){return e&&"object"===typeof e&&"string"===typeof e.id&&("undefined"===typeof e.color||Up.isThemeColor(e.color))}e.isThemeIcon=t;const i=new RegExp(`^\\$\\((${$l.iconNameExpression}(?:${$l.iconModifierExpression})?)\\)$`);function n(e){const t=i.exec(e);if(!t)return;let[,n]=t;return{id:n}}function o(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}}function s(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)}function r(e,t){return{id:e.id,color:t?qp(t):void 0}}e.fromString=n,e.modify=o,e.isEqual=s,e.asThemeIcon=r,e.asClassNameArray=$l.asClassNameArray,e.asClassName=$l.asClassName,e.asCSSSelector=$l.asCSSSelector}($p||($p={}));const Yp={ThemingContribution:"base.contributions.theming"};class Xp{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new rt}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),qe(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}let Zp=new Xp;function Qp(e){return Zp.onColorThemeChange(e)}zd.add(Yp.ThemingContribution,Zp);class Jp extends Ye{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(){}}var e_=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},t_=function(e,t){return function(i,n){t(i,n,e)}};function i_(e){return void 0!==e.command}class n_{constructor(e){this.id=n_._idPool++,this._debugName=e}}n_._idPool=0,n_.CommandPalette=new n_("CommandPalette"),n_.EditorContext=new n_("EditorContext"),n_.SimpleEditorContext=new n_("SimpleEditorContext"),n_.EditorContextCopy=new n_("EditorContextCopy"),n_.EditorContextPeek=new n_("EditorContextPeek"),n_.MenubarEditMenu=new n_("MenubarEditMenu"),n_.MenubarCopy=new n_("MenubarCopy"),n_.MenubarGoMenu=new n_("MenubarGoMenu"),n_.MenubarSelectionMenu=new n_("MenubarSelectionMenu"),n_.InlineCompletionsActions=new n_("InlineCompletionsActions");const o_=gn("menuService"),s_=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new rt,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:e=>e===n_.CommandPalette}}addCommand(e){return this.addCommands(Ae.single(e))}addCommands(e){for(const t of e)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),qe(()=>{let t=!1;for(const i of e)t=this._commands.delete(i.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}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){return this.appendMenuItems(Ae.single({id:e,item:t}))}appendMenuItems(e){const t=new Set,i=new Je;for(const{id:n,item:o}of e){let e=this._menuItems.get(n);e||(e=new Je,this._menuItems.set(n,e)),i.push(e.push(o)),t.add(n)}return this._onDidChangeMenu.fire(t),qe(()=>{if(i.size>0){for(let e of i)e();this._onDidChangeMenu.fire(t),i.clear()}})}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===n_.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)i_(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 r_ extends Hp{constructor(e,t,i,n){super("submenuitem."+e.submenu.id,"string"===typeof e.title?e.title:e.title.value,[],"submenu"),this.item=e,this._menuService=t,this._contextKeyService=i,this._options=n}get actions(){const e=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),i=t.getActions(this._options);t.dispose();for(const[,n]of i)n.length>0&&(e.push(...n),e.push(new zp));return e.length&&e.pop(),e}}let a_=class e{constructor(t,i,n,o,s){var r,a;if(this._commandService=s,this.id=t.id,this.label=(null===n||void 0===n?void 0:n.renderShortTitle)&&t.shortTitle?"string"===typeof t.shortTitle?t.shortTitle:t.shortTitle.value:"string"===typeof t.title?t.title:t.title.value,this.tooltip=null!==(a="string"===typeof t.tooltip?t.tooltip:null===(r=t.tooltip)||void 0===r?void 0:r.value)&&void 0!==a?a:"",this.enabled=!t.precondition||o.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const e=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=o.contextMatchesRules(e.condition),this.checked&&e.tooltip&&(this.tooltip="string"===typeof e.tooltip?e.tooltip:e.tooltip.value),e.title&&(this.label="string"===typeof e.title?e.title:e.title.value)}this.item=t,this.alt=i?new e(i,void 0,n,o,s):void 0,this._options=n,$p.isThemeIcon(t.icon)&&(this.class=$l.asClassName(t.icon))}dispose(){}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)}};a_=e_([t_(3,xm),t_(4,ua)],a_);const l_=gn("telemetryService");class c_{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}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?im.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};Am.registerKeybindingRule(i)}}ga.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){s_.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 d_ extends c_{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i){return this._implementations.push({priority:e,name:t,implementation:i}),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(Wu);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const n of this._implementations){const o=n.implementation(e,t);if(o){if(i.trace(`Command '${this.id}' was handled by '${n.name}'.`),"boolean"===typeof o)return;return o}}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class h_ extends c_{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class u_ extends c_{static bindToContribution(e){return class extends u_{constructor(e){super(e),this._callback=e.handler}runEditorCommand(t,i,n){const o=e(i);o&&this._callback(e(i),n)}}}runCommand(e,t){const i=e.get(mn),n=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(n)return n.invokeWithinContext(e=>{const i=e.get(xm);if(i.contextMatchesRules(da(this.precondition)))return this.runEditorCommand(e,n,t)})}}class g_ extends u_{constructor(e){super(g_.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=n_.EditorContext),t.title||(t.title=e.label),t.when=im.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(l_).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}function f_(e){return v_.INSTANCE.registerEditorCommand(e),e}function m_(e){const t=new e;return v_.INSTANCE.registerEditorAction(t),t}function p_(e,t){v_.INSTANCE.registerEditorContribution(e,t)}var __;(function(e){function t(e){return v_.INSTANCE.getEditorCommand(e)}function i(){return v_.INSTANCE.getEditorActions()}function n(){return v_.INSTANCE.getEditorContributions()}function o(e){return v_.INSTANCE.getEditorContributions().filter(t=>e.indexOf(t.id)>=0)}function s(){return v_.INSTANCE.getDiffEditorContributions()}e.getEditorCommand=t,e.getEditorActions=i,e.getEditorContributions=n,e.getSomeEditorContributions=o,e.getDiffEditorContributions=s})(__||(__={}));const b_={EditorCommonContributions:"editor.contributions"};class v_{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t){this.editorContributions.push({id:e,ctor:t})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions.slice(0)}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function w_(e){return e.register(),e}v_.INSTANCE=new v_,zd.add(b_.EditorCommonContributions,v_.INSTANCE);const C_=w_(new d_({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:n_.MenubarEditMenu,group:"1_do",title:o({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:n_.CommandPalette,group:"",title:o("undo","Undo"),order:1}]}));w_(new h_(C_,{id:"default:undo",precondition:void 0}));const y_=w_(new d_({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:n_.MenubarEditMenu,group:"1_do",title:o({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:n_.CommandPalette,group:"",title:o("redo","Redo"),order:1}]}));w_(new h_(y_,{id:"default:redo",precondition:void 0}));const S_=w_(new d_({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:n_.MenubarSelectionMenu,group:"1_basic",title:o({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:n_.CommandPalette,group:"",title:o("selectAll","Select All"),order:1}]}));var x_=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},k_=function(e,t){return function(i,n){t(i,n,e)}};let L_=class{constructor(e,t){}dispose(){}};L_.ID="editor.contrib.markerDecorations",L_=x_([k_(1,Rp)],L_),p_(L_.ID,L_);i("0556");class E_{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class D_{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=this._bareFontInfo.getMassagedFontFamily(Ln?_e.fontFamily:null),t=document.createElement("div");t.style.position="absolute",t.style.top="-50000px",t.style.width="50000px";const i=document.createElement("div");i.style.fontFamily=e,i.style.fontWeight=this._bareFontInfo.fontWeight,i.style.fontSize=this._bareFontInfo.fontSize+"px",i.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,i.style.lineHeight=this._bareFontInfo.lineHeight+"px",i.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",t.appendChild(i);const n=document.createElement("div");n.style.fontFamily=e,n.style.fontWeight="bold",n.style.fontSize=this._bareFontInfo.fontSize+"px",n.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,n.style.lineHeight=this._bareFontInfo.lineHeight+"px",n.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",t.appendChild(n);const o=document.createElement("div");o.style.fontFamily=e,o.style.fontWeight=this._bareFontInfo.fontWeight,o.style.fontSize=this._bareFontInfo.fontSize+"px",o.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,o.style.lineHeight=this._bareFontInfo.lineHeight+"px",o.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",o.style.fontStyle="italic",t.appendChild(o);const s=[];for(const r of this._requests){let e;0===r.type&&(e=i),2===r.type&&(e=n),1===r.type&&(e=o),e.appendChild(document.createElement("br"));const t=document.createElement("span");D_._render(t,r),e.appendChild(t),s.push(t)}this._container=t,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)}}}function N_(e,t){const i=new D_(e,t);i.read()}class I_ extends Ye{constructor(e,t,i){super(),this.referenceDomElement=e,this.changeCallback=i,this.width=-1,this.height=-1,this.resizeObserver=null,this.measureReferenceDomElementToken=-1,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this.width}getHeight(){return this.height}startObserving(){"undefined"!==typeof ResizeObserver?!this.resizeObserver&&this.referenceDomElement&&(this.resizeObserver=new ResizeObserver(e=>{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()}),this.resizeObserver.observe(this.referenceDomElement)):-1===this.measureReferenceDomElementToken&&(this.measureReferenceDomElementToken=setInterval(()=>this.observe(),100))}stopObserving(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),-1!==this.measureReferenceDomElementToken&&(clearInterval(this.measureReferenceDomElementToken),this.measureReferenceDomElementToken=-1)}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.changeCallback())}}class T_{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])}}function M_(){O_.INSTANCE.clearCache()}class O_ extends Ye{constructor(){super(),this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,this._cache=new T_,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearCache(){this._cache=new T_,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readConfiguration(e){if(!this._cache.has(e)){let t=O_._actualReadConfiguration(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new Ba({zoomLevel:_n(),pixelRatio:Cn(),fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}static createRequest(e,t,i,n){const o=new E_(e,t);return i.push(o),n&&n.push(o),o}static _actualReadConfiguration(e){const t=[],i=[],n=this.createRequest("n",0,t,i),o=this.createRequest("m",0,t,null),s=this.createRequest(" ",0,t,i),r=this.createRequest("0",0,t,i),a=this.createRequest("1",0,t,i),l=this.createRequest("2",0,t,i),c=this.createRequest("3",0,t,i),d=this.createRequest("4",0,t,i),h=this.createRequest("5",0,t,i),u=this.createRequest("6",0,t,i),g=this.createRequest("7",0,t,i),f=this.createRequest("8",0,t,i),m=this.createRequest("9",0,t,i),p=this.createRequest("→",0,t,i),_=this.createRequest("→",0,t,null),b=this.createRequest("·",0,t,i),v=this.createRequest(String.fromCharCode(11825),0,t,null),w="|/-_ilm%";for(let L=0,E=w.length;L<E;L++)this.createRequest(w.charAt(L),0,t,i),this.createRequest(w.charAt(L),1,t,i),this.createRequest(w.charAt(L),2,t,i);N_(e,t);const C=Math.max(r.width,a.width,l.width,c.width,d.width,h.width,u.width,g.width,f.width,m.width);let y=e.fontFeatureSettings===B.OFF;const S=i[0].width;for(let L=1,E=i.length;y&&L<E;L++){const e=S-i[L].width;if(e<-.001||e>.001){y=!1;break}}let x=!0;y&&_.width!==S&&(x=!1),_.width>p.width&&(x=!1);const k=bn()>2e3;return new Ba({zoomLevel:_n(),pixelRatio:Cn(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:y,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:x,spaceWidth:s.width,middotWidth:b.width,wsmiddotWidth:v.width,maxDigitWidth:C},k)}}O_.INSTANCE=new O_;class A_ extends Rf{constructor(e,t,i=null,n){super(e,t),this.accessibilityService=n,this._elementSizeObserver=this._register(new I_(i,t.dimension,()=>this._recomputeOptions())),this._register(O_.INSTANCE.onDidChange(()=>this._recomputeOptions())),this._validatedOptions.get(10)&&this._elementSizeObserver.startObserving(),this._register(vn(e=>this._recomputeOptions())),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._recomputeOptions()}static applyFontInfoSlow(e,t){e.style.fontFamily=t.getMassagedFontFamily(Ln?_e.fontFamily:null),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px"}static applyFontInfo(e,t){e.setFontFamily(t.getMassagedFontFamily(Ln?_e.fontFamily:null)),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)}observeReferenceElement(e){this._elementSizeObserver.observe(e)}updatePixelRatio(){this._recomputeOptions()}static _getExtraEditorClassName(){let e="";return Ln||En||(e+="no-user-select "),Ln&&(e+="no-minimap-shadow "),s["f"]&&(e+="mac "),e}_getEnvConfiguration(){return{extraEditorClassName:A_._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:xn||Sn,pixelRatio:Cn(),zoomLevel:_n(),accessibilitySupport:this.accessibilityService.isScreenReaderOptimized()?2:this.accessibilityService.getAccessibilitySupport()}}readConfiguration(e){return O_.INSTANCE.readConfiguration(e)}}class P_{constructor(e){this.domNode=e,this._maxWidth=-1,this._width=-1,this._height=-1,this._top=-1,this._left=-1,this._bottom=-1,this._right=-1,this._fontFamily="",this._fontWeight="",this._fontSize=-1,this._fontFeatureSettings="",this._lineHeight=-1,this._letterSpacing=-100,this._className="",this._display="",this._position="",this._visibility="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth+"px")}setWidth(e){this._width!==e&&(this._width=e,this.domNode.style.width=this._width+"px")}setHeight(e){this._height!==e&&(this._height=e,this.domNode.style.height=this._height+"px")}setTop(e){this._top!==e&&(this._top=e,this.domNode.style.top=this._top+"px")}unsetTop(){-1!==this._top&&(this._top=-1,this.domNode.style.top="")}setLeft(e){this._left!==e&&(this._left=e,this.domNode.style.left=this._left+"px")}setBottom(e){this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom+"px")}setRight(e){this._right!==e&&(this._right=e,this.domNode.style.right=this._right+"px")}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){this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize+"px")}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setLineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight+"px")}setLetterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing+"px")}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)}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 R_(e){return new P_(e)}function F_(e,t,i){let n=null,o=null;if("function"===typeof i.value?(n="value",o=i.value,0!==o.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"===typeof i.get&&(n="get",o=i.get),!o)throw new Error("not supported");const s="$memoize$"+t;i[n]=function(...e){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,e)}),this[s]}}var B_,W_=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>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"})(B_||(B_={}));class V_ extends Ye{constructor(){super(),this.dispatched=!1,this.activeTouches={},this.handle=null,this.targets=[],this.ignoreTargets=[],this._lastSetTapCountTime=0,this._register(bo(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(bo(document,"touchend",e=>this.onTouchEnd(e))),this._register(bo(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){return V_.isTouchDevice()?(V_.INSTANCE||(V_.INSTANCE=new V_),V_.INSTANCE.targets.push(e),{dispose:()=>{V_.INSTANCE.targets=V_.INSTANCE.targets.filter(t=>t!==e)}}):Ye.None}static ignoreTarget(e){return V_.isTouchDevice()?(V_.INSTANCE||(V_.INSTANCE=new V_),V_.INSTANCE.ignoreTargets.push(e),{dispose:()=>{V_.INSTANCE.ignoreTargets=V_.INSTANCE.ignoreTargets.filter(t=>t!==e)}}):Ye.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){let 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]};let o=this.newGestureEvent(B_.Start,n.target);o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e){let t=Date.now(),i=Object.keys(this.activeTouches).length;for(let n=0,o=e.changedTouches.length;n<o;n++){let o=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("move of an UNKNOWN touch",o);continue}let s=this.activeTouches[o.identifier],r=Date.now()-s.initialTimeStamp;if(r<V_.HOLD_DELAY&&Math.abs(s.initialPageX-wu(s.rollingPageX))<30&&Math.abs(s.initialPageY-wu(s.rollingPageY))<30){let e=this.newGestureEvent(B_.Tap,s.initialTarget);e.pageX=wu(s.rollingPageX),e.pageY=wu(s.rollingPageY),this.dispatchEvent(e)}else if(r>=V_.HOLD_DELAY&&Math.abs(s.initialPageX-wu(s.rollingPageX))<30&&Math.abs(s.initialPageY-wu(s.rollingPageY))<30){let e=this.newGestureEvent(B_.Contextmenu,s.initialTarget);e.pageX=wu(s.rollingPageX),e.pageY=wu(s.rollingPageY),this.dispatchEvent(e)}else if(1===i){let e=wu(s.rollingPageX),i=wu(s.rollingPageY),n=wu(s.rollingTimestamps)-s.rollingTimestamps[0],o=e-s.rollingPageX[0],r=i-s.rollingPageY[0];const a=this.targets.filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(a,t,Math.abs(o)/n,o>0?1:-1,e,Math.abs(r)/n,r>0?1:-1,i)}this.dispatchEvent(this.newGestureEvent(B_.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===B_.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>V_.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==B_.Change&&e.type!==B_.Contextmenu||(this._lastSetTapCountTime=0);for(let t=0;t<this.ignoreTargets.length;t++)if(e.initialTarget instanceof Node&&this.ignoreTargets[t].contains(e.initialTarget))return;this.targets.forEach(t=>{e.initialTarget instanceof Node&&t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)})}inertia(e,t,i,n,o,s,r,a){this.handle=ko(()=>{let l=Date.now(),c=l-t,d=0,h=0,u=!0;i+=V_.SCROLL_FRICTION*c,s+=V_.SCROLL_FRICTION*c,i>0&&(u=!1,d=n*i*c),s>0&&(u=!1,h=r*s*c);let g=this.newGestureEvent(B_.Change);g.translationX=d,g.translationY=h,e.forEach(e=>e.dispatchEvent(g)),u||this.inertia(e,l,i,n,o+d,s,r,a+h)})}onTouchMove(e){let t=Date.now();for(let i=0,n=e.changedTouches.length;i<n;i++){let n=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}let o=this.activeTouches[n.identifier],s=this.newGestureEvent(B_.Change,o.initialTarget);s.translationX=n.pageX-wu(o.rollingPageX),s.translationY=n.pageY-wu(o.rollingPageY),s.pageX=n.pageX,s.pageY=n.pageY,this.dispatchEvent(s),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}function z_(e,t){let i=new qn(t);return i.preventDefault(),{leftButton:i.leftButton,buttons:i.buttons,posx:i.posx,posy:i.posy}}V_.SCROLL_FRICTION=-.005,V_.HOLD_DELAY=700,V_.CLEAR_TAP_COUNT_TIME=400,W_([F_],V_,"isTouchDevice",null);class H_{constructor(){this._hooks=new Ge,this._mouseMoveEventMerger=null,this._mouseMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._mouseMoveEventMerger=null,this._mouseMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._mouseMoveEventMerger}startMonitoring(e,t,i,n,o){if(this.isMonitoring())return;this._mouseMoveEventMerger=i,this._mouseMoveCallback=n,this._onStopCallback=o;const r=$n.getSameOriginWindowChain(),a=s["c"]?"pointermove":"mousemove",l="mouseup",c=r.map(e=>e.window.document),d=Yo(e);d&&c.unshift(d);for(const s of c)this._hooks.add(Mo(s,a,e=>{e.buttons===t?this._mouseMoveCallback(e):this.stopMonitoring(!0)},(e,t)=>this._mouseMoveEventMerger(e,t))),this._hooks.add(bo(s,l,e=>this.stopMonitoring(!0)));if($n.hasDifferentOriginAncestor()){let e=r[r.length-1];this._hooks.add(bo(e.window.document,"mouseout",e=>{let t=new qn(e);"html"===t.target.tagName.toLowerCase()&&this.stopMonitoring(!0)})),this._hooks.add(bo(e.window.document,"mouseover",e=>{let t=new qn(e);"html"===t.target.tagName.toLowerCase()&&this.stopMonitoring(!0)})),this._hooks.add(bo(e.window.document.body,"mouseleave",e=>{this.stopMonitoring(!0)}))}}}class K_{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new j_(this.x-Wo.scrollX,this.y-Wo.scrollY)}}class j_{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new K_(this.clientX+Wo.scrollX,this.clientY+Wo.scrollY)}}class U_{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}function $_(e){const t=Bo(e);return new U_(t.left,t.top,t.width,t.height)}class q_ extends qn{constructor(e,t){super(e),this._editorMouseEventBrand=void 0,this.pos=new K_(this.posx,this.posy),this.editorPos=$_(t)}}class G_{constructor(e){this._editorViewDomNode=e}_create(e){return new q_(e,this._editorViewDomNode)}onContextMenu(e,t){return bo(e,"contextmenu",e=>{t(this._create(e))})}onMouseUp(e,t){return bo(e,"mouseup",e=>{t(this._create(e))})}onMouseDown(e,t){return bo(e,"mousedown",e=>{t(this._create(e))})}onMouseLeave(e,t){return yo(e,e=>{t(this._create(e))})}onMouseMoveThrottled(e,t,i,n){const o=(e,t)=>i(e,this._create(t));return Mo(e,"mousemove",t,o,n)}}class Y_{constructor(e){this._editorViewDomNode=e}_create(e){return new q_(e,this._editorViewDomNode)}onPointerUp(e,t){return bo(e,"pointerup",e=>{t(this._create(e))})}onPointerDown(e,t){return bo(e,"pointerdown",e=>{t(this._create(e))})}onPointerLeave(e,t){return So(e,e=>{t(this._create(e))})}onPointerMoveThrottled(e,t,i,n){const o=(e,t)=>i(e,this._create(t));return Mo(e,"pointermove",t,o,n)}}class X_ extends Ye{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new H_),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=Co(document,"keydown",e=>{const t=e.toKeybinding();t.isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0,e.browserEvent)},!0);const s=(e,t)=>i(e,new q_(t,this._editorViewDomNode));this._globalMouseMoveMonitor.startMonitoring(e,t,s,n,e=>{this._keydownListener.dispose(),o(e)})}stopMonitoring(){this._globalMouseMoveMonitor.stopMonitoring(!0)}}class Z_ extends Ye{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++){let 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 Q_ extends Z_{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class J_{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){let i=[],n=0;while(e&&e!==document.body){if(e===t)break;e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement}const o=new Uint8Array(n);for(let s=0;s<n;s++)o[s]=i[n-s-1];return o}}class eb{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){return this._viewLayout.getVerticalOffsetForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class tb extends eb{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 ib{constructor(e,t,i){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i}}class nb{constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}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 nb(n.left,n.width)}return 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 sb{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class rb{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class ab{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,o){const s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,n),s.getClientRects()}catch(r){return null}finally{this._detachRange(s,o)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(ob.compare);let t=[],i=0,n=e[0];for(let o=1,s=e.length;o<s;o++){const s=e[o];n.left+n.width+.9>=s.left?n.width=Math.max(n.width,s.left+s.width-n.left):(t[i++]=n,n=s)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t){if(!e||0===e.length)return null;const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];i[n]=new ob(Math.max(0,o.left-t),o.width)}return this._mergeAdjacentRanges(i)}static readHorizontalRanges(e,t,i,n,o,s,r){const a=0,l=e.children.length-1;if(a>l)return null;if(t=Math.min(l,Math.max(a,t)),n=Math.min(l,Math.max(a,n)),t===n&&i===o&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(i,s)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let c=e.children[t].firstChild,d=e.children[n].firstChild;if(c&&d||(!c&&0===i&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&0===o&&n>0&&(d=e.children[n-1].firstChild,o=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const h=this._readClientRects(c,i,d,o,r);return this._createHorizontalRangesFromClientRects(h,s)}}const lb=function(){return!!s["g"]||!(s["d"]||Sn||Ln)}();let cb=!0;class db{constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectDeltaLeftRead=!1,this.endNode=t}get clientRectDeltaLeft(){return this._clientRectDeltaLeftRead||(this._clientRectDeltaLeftRead=!0,this._clientRectDeltaLeft=this._domNode.getBoundingClientRect().left),this._clientRectDeltaLeft}}class hb{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(43);this.renderWhitespace=i.get(87),this.renderControlCharacters=i.get(82),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(29),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(58),this.stopRenderingLineAfter=i.get(104),this.fontLigatures=i.get(44)}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 ub{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=R_(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return(this._options.themeType===Fp.HIGH_CONTRAST||"selection"===this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),s=this._options,r=lg.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let a=null;if(s.themeType===Fp.HIGH_CONTRAST||"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:o.minColumn,n=i.endLineNumber===e?i.endColumn:o.maxColumn;t<n&&(s.themeType===Fp.HIGH_CONTRAST||"selection"!==this._options.renderWhitespace?r.push(new lg(t,n,"inline-selected-text",0)):(a||(a=[]),a.push(new gg(t-1,n-1))))}}const l=new fg(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,r,o.tabSize,o.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==B.OFF,a);if(this._renderedViewLine&&this._renderedViewLine.input.equals(l))return!1;n.appendASCIIString('<div style="top:'),n.appendASCIIString(String(t)),n.appendASCIIString("px;height:"),n.appendASCIIString(String(this._options.lineHeight)),n.appendASCIIString('px;" class="'),n.appendASCIIString(ub.CLASS_NAME),n.appendASCIIString('">');const c=bg(l,n);n.appendASCIIString("</div>");let d=null;return cb&&lb&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===c.containsForeignElements&&o.content.length<300&&l.lineTokens.getCount()<100&&(d=new gb(this._renderedViewLine?this._renderedViewLine.domNode:null,l,c.characterMapping)),d||(d=pb(this._renderedViewLine?this._renderedViewLine.domNode:null,l,c.characterMapping,c.containsRTL,c.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(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof gb}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof gb?this._renderedViewLine.monospaceAssumptionsAreValid():cb}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof gb&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t|=0,i|=0,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 o=0|this._renderedViewLine.input.stopRenderingLineAfter;let s=!1;-1!==o&&t>o+1&&i>o+1&&(s=!0),-1!==o&&t>o+1&&(t=o+1),-1!==o&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return r&&r.length>0?new rb(s,r):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}ub.CLASS_NAME="view-line";class gb{constructor(e,t,i){this.domNode=e,this.input=t,this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){return Math.round(this._getCharPosition(this._characterMapping.length))}getWidthIsFast(){return!0}monospaceAssumptionsAreValid(){if(!this.domNode)return cb;const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;return Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),cb=!1),cb}toSlowRenderedLine(){return pb(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getCharPosition(t),s=this._getCharPosition(i);return[new ob(o,s-o)]}_getCharPosition(e){const t=this._characterMapping.getAbsoluteOffset(e);return this._charWidth*t}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;while(t)t=t.previousSibling,o++;return this._characterMapping.getColumn(new mg(o,i),n)}}class fb{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,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(){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const o=this._readPixelOffset(this.domNode,e,t,n);if(-1===o)return null;const s=this._readPixelOffset(this.domNode,e,i,n);return-1===s?null:[new ob(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const n=this._readPixelOffset(e,t,i,o);return-1===n?null:[new ob(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,o)}_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();const t=this._getReadingTarget(e);return t.firstChild?t.firstChild.offsetWidth:0}if(null!==this._pixelOffsetCache){const o=this._pixelOffsetCache[i];if(-1!==o)return o;const s=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=ab.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n.clientRectDeltaLeft,n.endNode);return t&&0!==t.length?t[0].left:-1}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();const o=this._characterMapping.getDomPosition(i),s=ab.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n.clientRectDeltaLeft,n.endNode);if(!s||0===s.length)return-1;const r=s[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getAbsoluteOffset(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())];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return ab.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,n.clientRectDeltaLeft,n.endNode)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;while(t)t=t.previousSibling,o++;return this._characterMapping.getColumn(new mg(o,i),n)}}class mb extends fb{_readVisibleRangesForRange(e,t,i,n,o){const s=super._readVisibleRangesForRange(e,t,i,n,o);if(!s||0===s.length||i===n||1===i&&n===this._characterMapping.length)return s;if(!this.input.containsRTL){const i=this._readPixelOffset(e,t,n,o);if(-1!==i){const e=s[s.length-1];e.left<i&&(e.width=i-e.left)}}return s}}const pb=function(){return xn?_b:bb}();function _b(e,t,i,n,o){return new mb(e,t,i,n,o)}function bb(e,t,i,n,o){return new fb(e,t,i,n,o)}function vb(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class wb{constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}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}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${vb(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${vb(this.oldText)}")`:`(replace@${this.oldPosition} "${vb(this.oldText)}" with "${vb(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Br["f"](e,n,i),i+=4;for(let o=0;o<n;o++)Br["e"](e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=Br["c"](e,t);return t+=4,_d(e,t,i)}writeSize(){return 8+wb._writeStringSize(this.oldText)+wb._writeStringSize(this.newText)}write(e,t){return Br["f"](e,this.oldPosition,t),t+=4,Br["f"](e,this.newPosition,t),t+=4,t=wb._writeString(e,this.oldText,t),t=wb._writeString(e,this.newText,t),t}static read(e,t,i){const n=Br["c"](e,t);t+=4;const o=Br["c"](e,t);t+=4;const s=wb._readString(e,t);t+=wb._writeStringSize(s);const r=wb._readString(e,t);return t+=wb._writeStringSize(r),i.push(new wb(n,s,o,r)),t}}function Cb(e,t){if(null===e||0===e.length)return t;const i=new yb(e,t);return i.compress()}class yb{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);while(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]=yb._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(e),n=t;continue}if(i.newPosition<n.oldPosition){const[e,t]=yb._splitPrev(i,n.oldPosition-i.newPosition);this._acceptPrev(e),i=t;continue}let o,s;if(n.oldEnd===i.newEnd)o=i,s=n,i=this._getPrev(++e),n=this._getCurr(++t);else if(n.oldEnd<i.newEnd){const[e,r]=yb._splitPrev(i,n.oldLength);o=e,s=n,i=r,n=this._getCurr(++t)}else{const[t,r]=yb._splitCurr(n,i.newLength);o=i,s=t,i=this._getPrev(++e),n=r}this._result[this._resultLen++]=new wb(o.oldPosition,o.oldText,s.newPosition,s.newText),this._prevDeltaOffset+=o.newLength-o.oldLength,this._currDeltaOffset+=s.newLength-s.oldLength}const o=yb._merge(this._result),s=yb._removeNoOps(o);return s}_acceptCurr(e){this._result[this._resultLen++]=yb._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++]=yb._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 wb(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new wb(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 wb(e.oldPosition,e.oldText,e.newPosition,i),new wb(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new wb(e.oldPosition,i,e.newPosition,e.newText),new wb(e.oldPosition+t,n,e.newEnd,"")]}static _merge(e){if(0===e.length)return e;let t=[],i=0,n=e[0];for(let o=1;o<e.length;o++){const s=e[o];n.oldEnd===s.oldPosition?n=new wb(n.oldPosition,n.oldText+s.oldText,n.newPosition,n.newText+s.newText):(t[i++]=n,n=s)}return t[i++]=n,t}static _removeNoOps(e){if(0===e.length)return e;let t=[],i=0;for(let n=0;n<e.length;n++){const o=e[n];o.oldText!==o.newText&&(t[i++]=o)}return t}}function Sb(e){return e.toString()}class xb{constructor(e,t,i,n,o,s,r){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=s,this.changes=r}static create(e,t){const i=e.getAlternativeVersionId(),n=Eb(e);return new xb(i,i,n,n,t,t,[])}append(e,t,i,n,o){t.length>0&&(this.changes=Cb(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(Br["f"](e,t?t.length:0,i),i+=4,t)for(const n of t)Br["f"](e,n.selectionStartLineNumber,i),i+=4,Br["f"](e,n.selectionStartColumn,i),i+=4,Br["f"](e,n.positionLineNumber,i),i+=4,Br["f"](e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Br["c"](e,t);t+=4;for(let o=0;o<n;o++){const n=Br["c"](e,t);t+=4;const o=Br["c"](e,t);t+=4;const s=Br["c"](e,t);t+=4;const r=Br["c"](e,t);t+=4,i.push(new yi(n,o,s,r))}return t}serialize(){let e=10+xb._writeSelectionsSize(this.beforeCursorState)+xb._writeSelectionsSize(this.afterCursorState)+4;for(const n of this.changes)e+=n.writeSize();const t=new Uint8Array(e);let i=0;Br["f"](t,this.beforeVersionId,i),i+=4,Br["f"](t,this.afterVersionId,i),i+=4,Br["g"](t,this.beforeEOL,i),i+=1,Br["g"](t,this.afterEOL,i),i+=1,i=xb._writeSelections(t,this.beforeCursorState,i),i=xb._writeSelections(t,this.afterCursorState,i),Br["f"](t,this.changes.length,i),i+=4;for(const n of this.changes)i=n.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const n=Br["c"](t,i);i+=4;const o=Br["c"](t,i);i+=4;const s=Br["d"](t,i);i+=1;const r=Br["d"](t,i);i+=1;const a=[];i=xb._readSelections(t,i,a);const l=[];i=xb._readSelections(t,i,l);const c=Br["c"](t,i);i+=4;const d=[];for(let h=0;h<c;h++)i=wb.read(t,i,d);return new xb(n,o,s,r,a,l,d)}}class kb{constructor(e,t){this.model=e,this._data=xb.create(e,t)}get type(){return 0}get resource(){return ci.isUri(this.model)?this.model:this.model.uri}get label(){return o("edit","Typing")}toString(){const e=this._data instanceof xb?this._data:xb.deserialize(this._data);return e.changes.map(e=>e.toString()).join(", ")}matchesResource(e){const t=ci.isUri(this.model)?this.model:this.model.uri;return t.toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof xb}append(e,t,i,n,o){this._data instanceof xb&&this._data.append(e,t,i,n,o)}close(){this._data instanceof xb&&(this._data=this._data.serialize())}open(){this._data instanceof xb||(this._data=xb.deserialize(this._data))}undo(){if(ci.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof xb&&(this._data=this._data.serialize());const e=xb.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(ci.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof xb&&(this._data=this._data.serialize());const e=xb.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof xb&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Lb{constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const i of this._editStackElementsArr){const e=Sb(i.resource);this._editStackElementsMap.set(e,i)}this._delegate=null}get resources(){return this._editStackElementsArr.map(e=>e.resource)}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=Sb(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Sb(ci.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Sb(e.uri);if(this._editStackElementsMap.has(t)){const i=this._editStackElementsMap.get(t);return i.canAppend(e)}return!1}append(e,t,i,n,o){const s=Sb(e.uri),r=this._editStackElementsMap.get(s);r.append(e,t,i,n,o)}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=Sb(e);if(this._editStackElementsMap.has(t)){const e=this._editStackElementsMap.get(t);return e.heapSize()}return 0}split(){return this._editStackElementsArr}toString(){let e=[];for(const t of this._editStackElementsArr)e.push(`${qr(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function Eb(e){const t=e.getEOL();return"\n"===t?0:1}function Db(e){return!!e&&(e instanceof kb||e instanceof Lb)}class Nb{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Db(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Db(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(Db(t)&&t.canAppend(this._model))return t;const i=new kb(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],Eb(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),s=Nb._computeCursorState(i,o),r=o.map((e,t)=>({index:t,textChange:e.textChange}));return r.sort((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition),n.append(this._model,r.map(e=>e.textChange),Eb(this._model),this._model.getAlternativeVersionId(),s),s}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return xe(i),null}}}class Ib{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Tb(e,t,i,n,o){let s;for(o.spacesDiff=0,o.looksLikeAlignment=!1,s=0;s<t&&s<n;s++){let t=e.charCodeAt(s),n=i.charCodeAt(s);if(t!==n)break}let r=0,a=0;for(let u=s;u<t;u++){let t=e.charCodeAt(u);32===t?r++:a++}let l=0,c=0;for(let u=s;u<n;u++){let e=i.charCodeAt(u);32===e?l++:c++}if(r>0&&a>0)return;if(l>0&&c>0)return;let d=Math.abs(a-c),h=Math.abs(r-l);if(0===d)return o.spacesDiff=h,void(h>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)&&(o.looksLikeAlignment=!0));h%d!==0||(o.spacesDiff=h/d)}function Mb(e,t,i){const n=Math.min(e.getLineCount(),1e4);let o=0,s=0,r="",a=0;const l=[2,4,6,8,3,5,7],c=8;let d=[0,0,0,0,0,0,0,0,0],h=new Ib;for(let f=1;f<=n;f++){let n=e.getLineLength(f),l=e.getLineContent(f);const u=n<=65536;let g=!1,m=0,p=0,_=0;for(let t=0,i=n;t<i;t++){let i=u?l.charCodeAt(t):e.getLineCharCode(f,t);if(9===i)_++;else{if(32!==i){g=!0,m=t;break}p++}}if(!g)continue;if(_>0?o++:p>1&&s++,Tb(r,a,l,m,h),h.looksLikeAlignment&&(!i||t!==h.spacesDiff))continue;let b=h.spacesDiff;b<=c&&d[b]++,r=l,a=m}let u=i;o!==s&&(u=o<s);let g=t;if(u){let e=u?0:.1*n;l.forEach(t=>{let i=d[t];i>e&&(e=i,g=t)}),4===g&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function Ob(e){return(1&e.metadata)>>>0}function Ab(e,t){e.metadata=254&e.metadata|t<<0}function Pb(e){return(2&e.metadata)>>>1===1}function Rb(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function Fb(e){return(4&e.metadata)>>>2===1}function Bb(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function Wb(e){return(24&e.metadata)>>>3}function Vb(e,t){e.metadata=231&e.metadata|t<<3}function zb(e){return(32&e.metadata)>>>5===1}function Hb(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class Kb{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Ab(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,Bb(this,!1),Vb(this,1),Hb(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Rb(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;let t=this.options.className;Bb(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),Vb(this,this.options.stickiness),Hb(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 jb=new Kb(null,0,0);jb.parent=jb,jb.left=jb,jb.right=jb,Ab(jb,0);class Ub{constructor(){this.root=jb,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o){return this.root===jb?[]:ev(this,e,t,i,n,o)}search(e,t,i){return this.root===jb?[]:Jb(this,e,t,i)}collectNodesFromOwner(e){return Zb(this,e)}collectNodesPostOrder(){return Qb(this)}insert(e){tv(this,e),this._normalizeDeltaIfNecessary()}delete(e){nv(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;while(e!==this.root)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,s=i.end+n;i.setCachedOffsets(o,s,t)}acceptReplace(e,t,i,n){const o=Yb(this,e,e+t);for(let s=0,r=o.length;s<r;s++){const e=o[s];nv(this,e)}this._normalizeDeltaIfNecessary(),Xb(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let s=0,r=o.length;s<r;s++){const r=o[s];r.start=r.cachedAbsoluteStart,r.end=r.cachedAbsoluteEnd,Gb(r,e,e+t,i,n),r.maxEnd=r.end,tv(this,r)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,$b(this))}}function $b(e){let t=e.root,i=0;while(t!==jb)t.left===jb||Pb(t.left)?t.right===jb||Pb(t.right)?(t.start=i+t.start,t.end=i+t.end,t.delta=0,cv(t),Rb(t,!0),Rb(t.left,!1),Rb(t.right,!1),t===t.parent.right&&(i-=t.parent.delta),t=t.parent):(i+=t.delta,t=t.right):t=t.left;Rb(e.root,!1)}function qb(e,t,i,n){return e<i||!(e>i)&&(1!==n&&(2===n||t))}function Gb(e,t,i,n,o){const s=Wb(e),r=0===s||2===s,a=1===s||2===s,l=i-t,c=n,d=Math.min(l,c),h=e.start;let u=!1;const g=e.end;let f=!1;t<=h&&g<=i&&zb(e)&&(e.start=t,u=!0,e.end=t,f=!0);{const e=o?1:l>0?2:0;!u&&qb(h,r,t,e)&&(u=!0),!f&&qb(g,a,t,e)&&(f=!0)}if(d>0&&!o){const e=l>c?2:0;!u&&qb(h,r,t+d,e)&&(u=!0),!f&&qb(g,a,t+d,e)&&(f=!0)}{const n=o?1:0;!u&&qb(h,r,i,n)&&(e.start=t+c,u=!0),!f&&qb(g,a,i,n)&&(e.end=t+c,f=!0)}const m=c-l;u||(e.start=Math.max(0,h+m)),f||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function Yb(e,t,i){let n=e.root,o=0,s=0,r=0,a=0,l=[],c=0;while(n!==jb)if(Pb(n))Rb(n.left,!1),Rb(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;else{if(!Pb(n.left)){if(s=o+n.maxEnd,s<t){Rb(n,!0);continue}if(n.left!==jb){n=n.left;continue}}r=o+n.start,r>i?Rb(n,!0):(a=o+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[c++]=n),Rb(n,!0),n.right===jb||Pb(n.right)||(o+=n.delta,n=n.right))}return Rb(e.root,!1),l}function Xb(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=n-(i-t);while(o!==jb)if(Pb(o))Rb(o.left,!1),Rb(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),cv(o),o=o.parent;else{if(!Pb(o.left)){if(r=s+o.maxEnd,r<t){Rb(o,!0);continue}if(o.left!==jb){o=o.left;continue}}a=s+o.start,a>i?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),Rb(o,!0)):(Rb(o,!0),o.right===jb||Pb(o.right)||(s+=o.delta,o=o.right))}Rb(e.root,!1)}function Zb(e,t){let i=e.root,n=[],o=0;while(i!==jb)Pb(i)?(Rb(i.left,!1),Rb(i.right,!1),i=i.parent):i.left===jb||Pb(i.left)?(i.ownerId===t&&(n[o++]=i),Rb(i,!0),i.right===jb||Pb(i.right)||(i=i.right)):i=i.left;return Rb(e.root,!1),n}function Qb(e){let t=e.root,i=[],n=0;while(t!==jb)Pb(t)?(Rb(t.left,!1),Rb(t.right,!1),t=t.parent):t.left===jb||Pb(t.left)?t.right===jb||Pb(t.right)?(i[n++]=t,Rb(t,!0)):t=t.right:t=t.left;return Rb(e.root,!1),i}function Jb(e,t,i,n){let o=e.root,s=0,r=0,a=0,l=[],c=0;while(o!==jb){if(Pb(o)){Rb(o.left,!1),Rb(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==jb&&!Pb(o.left)){o=o.left;continue}r=s+o.start,a=s+o.end,o.setCachedOffsets(r,a,n);let e=!0;t&&o.ownerId&&o.ownerId!==t&&(e=!1),i&&Fb(o)&&(e=!1),e&&(l[c++]=o),Rb(o,!0),o.right===jb||Pb(o.right)||(s+=o.delta,o=o.right)}return Rb(e.root,!1),l}function ev(e,t,i,n,o,s){let r=e.root,a=0,l=0,c=0,d=0,h=[],u=0;while(r!==jb)if(Pb(r))Rb(r.left,!1),Rb(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;else{if(!Pb(r.left)){if(l=a+r.maxEnd,l<t){Rb(r,!0);continue}if(r.left!==jb){r=r.left;continue}}if(c=a+r.start,c>i)Rb(r,!0);else{if(d=a+r.end,d>=t){r.setCachedOffsets(c,d,s);let e=!0;n&&r.ownerId&&r.ownerId!==n&&(e=!1),o&&Fb(r)&&(e=!1),e&&(h[u++]=r)}Rb(r,!0),r.right===jb||Pb(r.right)||(a+=r.delta,r=r.right)}}return Rb(e.root,!1),h}function tv(e,t){if(e.root===jb)return t.parent=jb,t.left=jb,t.right=jb,Ab(t,0),e.root=t,e.root;iv(e,t),dv(t.parent);let i=t;while(i!==e.root&&1===Ob(i.parent))if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===Ob(t)?(Ab(i.parent,0),Ab(t,0),Ab(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,rv(e,i)),Ab(i.parent,0),Ab(i.parent.parent,1),av(e,i.parent.parent))}else{const t=i.parent.parent.left;1===Ob(t)?(Ab(i.parent,0),Ab(t,0),Ab(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,av(e,i)),Ab(i.parent,0),Ab(i.parent.parent,1),rv(e,i.parent.parent))}return Ab(e.root,0),t}function iv(e,t){let i=0,n=e.root;const o=t.start,s=t.end;while(1){const e=hv(o,s,n.start+i,n.end+i);if(e<0){if(n.left===jb){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===jb){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=jb,t.right=jb,Ab(t,1)}function nv(e,t){let i,n;if(t.left===jb?(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===jb?(i=t.left,n=t):(n=ov(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,Ab(i,0),t.detach(),sv(),cv(i),void(e.root.parent=jb);let o,s=1===Ob(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,Ab(n,Ob(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==jb&&(n.left.parent=n),n.right!==jb&&(n.right.parent=n)),t.detach(),s)return dv(i.parent),n!==t&&(dv(n),dv(n.parent)),void sv();dv(i),dv(i.parent),n!==t&&(dv(n),dv(n.parent));while(i!==e.root&&0===Ob(i))i===i.parent.left?(o=i.parent.right,1===Ob(o)&&(Ab(o,0),Ab(i.parent,1),rv(e,i.parent),o=i.parent.right),0===Ob(o.left)&&0===Ob(o.right)?(Ab(o,1),i=i.parent):(0===Ob(o.right)&&(Ab(o.left,0),Ab(o,1),av(e,o),o=i.parent.right),Ab(o,Ob(i.parent)),Ab(i.parent,0),Ab(o.right,0),rv(e,i.parent),i=e.root)):(o=i.parent.left,1===Ob(o)&&(Ab(o,0),Ab(i.parent,1),av(e,i.parent),o=i.parent.left),0===Ob(o.left)&&0===Ob(o.right)?(Ab(o,1),i=i.parent):(0===Ob(o.left)&&(Ab(o.right,0),Ab(o,1),rv(e,o),o=i.parent.left),Ab(o,Ob(i.parent)),Ab(i.parent,0),Ab(o.left,0),av(e,i.parent),i=e.root));Ab(i,0),sv()}function ov(e){while(e.left!==jb)e=e.left;return e}function sv(){jb.parent=jb,jb.delta=0,jb.start=0,jb.end=0}function rv(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!==jb&&(i.left.parent=t),i.parent=t.parent,t.parent===jb?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,cv(t),cv(i)}function av(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!==jb&&(i.right.parent=t),i.parent=t.parent,t.parent===jb?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,cv(t),cv(i)}function lv(e){let t=e.end;if(e.left!==jb){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==jb){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function cv(e){e.maxEnd=lv(e)}function dv(e){while(e!==jb){const t=lv(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function hv(e,t,i,n){return e===i?t-n:e-i}class uv{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!==gv)return fv(this.right);let e=this;while(e.parent!==gv){if(e.parent.left===e)break;e=e.parent}return e.parent===gv?gv:e.parent}prev(){if(this.left!==gv)return mv(this.left);let e=this;while(e.parent!==gv){if(e.parent.right===e)break;e=e.parent}return e.parent===gv?gv:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const gv=new uv(null,0);function fv(e){while(e.left!==gv)e=e.left;return e}function mv(e){while(e.right!==gv)e=e.right;return e}function pv(e){return e===gv?0:e.size_left+e.piece.length+pv(e.right)}function _v(e){return e===gv?0:e.lf_left+e.piece.lineFeedCnt+_v(e.right)}function bv(){gv.parent=gv}function vv(e,t){let 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!==gv&&(i.left.parent=t),i.parent=t.parent,t.parent===gv?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function wv(e,t){let i=t.left;t.left=i.right,i.right!==gv&&(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===gv?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function Cv(e,t){let i,n;if(t.left===gv?(n=t,i=n.right):t.right===gv?(n=t,i=n.left):(n=fv(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),bv(),void(e.root.parent=gv);let o,s=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,xv(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,xv(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!==gv&&(n.left.parent=n),n.right!==gv&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,xv(e,n)),t.detach(),i.parent.left===i){let t=pv(i),n=_v(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){let o=t-i.parent.size_left,s=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,Sv(e,i.parent,o,s)}}if(xv(e,i.parent),s)bv();else{while(i!==e.root&&0===i.color)i===i.parent.left?(o=i.parent.right,1===o.color&&(o.color=0,i.parent.color=1,vv(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,wv(e,o),o=i.parent.right),o.color=i.parent.color,i.parent.color=0,o.right.color=0,vv(e,i.parent),i=e.root)):(o=i.parent.left,1===o.color&&(o.color=0,i.parent.color=1,wv(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,vv(e,o),o=i.parent.left),o.color=i.parent.color,i.parent.color=0,o.left.color=0,wv(e,i.parent),i=e.root));i.color=0,bv()}}function yv(e,t){xv(e,t);while(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&&(t=t.parent,vv(e,t)),t.parent.color=0,t.parent.parent.color=1,wv(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&&(t=t.parent,wv(e,t)),t.parent.color=0,t.parent.parent.color=1,vv(e,t.parent.parent))}e.root.color=0}function Sv(e,t,i,n){while(t!==e.root&&t!==gv)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function xv(e,t){let i=0,n=0;if(t!==e.root){while(t!==e.root&&t===t.parent.right)t=t.parent;if(t!==e.root){t=t.parent,i=pv(t.left)-t.size_left,n=_v(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;while(t!==e.root&&(0!==i||0!==n))t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}}gv.parent=gv,gv.left=gv,gv.right=gv,gv.color=0;class kv 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)}}function Lv(e){let t={};return i=>(t.hasOwnProperty(i)||(t[i]=e(i)),t[i])}const Ev=Lv(e=>new kv(e)),Dv=999;class Nv{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?Iv(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=As(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(n){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Tv(t,this.wordSeparators?Ev(this.wordSeparators):null,i?this.searchString:null)}}function Iv(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t<i;t++){const n=e.charCodeAt(t);if(92===n){if(t++,t>=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n)return!0}}return!1}class Tv{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}function Mv(e,t,i){if(!i)return new Ua(e,null);let n=[];for(let o=0,s=t.length;o<s;o++)n[o]=t[o];return new Ua(e,n)}class Ov{constructor(e){let t=[],i=0;for(let n=0,o=e.length;n<o;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;while(i<n){const o=i+((n-i)/2>>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class Av{static findMatches(e,t,i,n,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new Bv(s.wordSeparators,s.regex),n,o):this._doFindMatchesLineByLine(e,i,s,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,s){let r,a,l=0;if(n?(l=n.findLineFeedCountBeforeOffset(o),r=t+o+l):r=t+o,n){let e=n.findLineFeedCountBeforeOffset(o+s.length),t=e-l;a=r+s.length+t}else a=r+s.length;const c=e.getPositionAt(r),d=e.getPositionAt(a);return new Ci(c.lineNumber,c.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,n,o){const s=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new Ov(r):null,l=[];let c,d=0;i.reset(0);while(c=i.next(r))if(l[d++]=Mv(this._getMultilineMatchRange(e,s,r,a,c.index,c[0]),c,n),d>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,o){const s=[];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,s,n,o),s}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o);for(let l=t.startLineNumber+1;l<t.endLineNumber&&r<o;l++)r=this._findMatchesInLine(i,e.getLineContent(l),l,0,r,s,n,o);if(r<o){const a=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);r=this._findMatchesInLine(i,a,t.endLineNumber,0,r,s,n,o)}return s}static _findMatchesInLine(e,t,i,n,o,s,r,a){const l=e.wordSeparators;if(!r&&e.simpleSearch){const r=e.simpleSearch,c=r.length,d=t.length;let h=-c;while(-1!==(h=t.indexOf(r,h+c)))if((!l||Fv(l,t,d,h,c))&&(s[o++]=new Ua(new Ci(i,h+1+n,i,h+1+c+n),null),o>=a))return o;return o}const c=new Bv(e.wordSeparators,e.regex);let d;c.reset(0);do{if(d=c.next(t),d&&(s[o++]=Mv(new Ci(i,d.index+1+n,i,d.index+1+d[0].length+n),d,r),o>=a))return o}while(d);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new Bv(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,s,n):this._doFindNextMatchLineByLine(e,i,s,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new wi(t.lineNumber,1),s=e.getOffsetAt(o),r=e.getLineCount(),a=e.getValueInRange(new Ci(o.lineNumber,o.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new Ov(a):null;i.reset(t.column-1);let c=i.next(a);return c?Mv(this._getMultilineMatchRange(e,s,a,l,c.index,c[0]),c,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new wi(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s),a=this._findFirstMatchInLine(i,r,s,t.column,n);if(a)return a;for(let l=1;l<=o;l++){const t=(s+l-1)%o,r=e.getLineContent(t+1),a=this._findFirstMatchInLine(i,r,t+1,1,n);if(a)return a}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const s=e.next(t);return s?Mv(new Ci(i,s.index+1,i,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new Bv(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,s,n):this._doFindPreviousMatchLineByLine(e,i,s,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new Ci(1,1,t.lineNumber,t.column),i,n,10*Dv);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new wi(s,e.getLineMaxColumn(s)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,s,n);if(a)return a;for(let l=1;l<=o;l++){const t=(o+s-l-1)%o,r=e.getLineContent(t+1),a=this._findLastMatchInLine(i,r,t+1,n);if(a)return a}return null}static _findLastMatchInLine(e,t,i,n){let o,s=null;e.reset(0);while(o=e.next(t))s=Mv(new Ci(i,o.index+1,i,o.index+1+o[0].length),o,n);return s}}function Pv(e,t,i,n,o){if(0===n)return!0;const s=t.charCodeAt(n-1);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}function Rv(e,t,i,n,o){if(n+o===i)return!0;const s=t.charCodeAt(n+o);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n+o-1);if(0!==e.get(i))return!0}return!1}function Fv(e,t,i,n,o){return Pv(e,t,i,n,o)&&Rv(e,t,i,n,o)}class Bv{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,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(0===o){er(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||Fv(this._wordSeparators,e,t,n,o))return i}while(i);return null}}const Wv=65535;function Vv(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class zv{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function Hv(e,t=!0){let i=[0],n=1;for(let o=0,s=e.length;o<s;o++){const t=e.charCodeAt(o);13===t?o+1<s&&10===e.charCodeAt(o+1)?(i[n++]=o+2,o++):i[n++]=o+1:10===t&&(i[n++]=o+1)}return t?Vv(i):i}function Kv(e,t){e.length=0,e[0]=0;let i=1,n=0,o=0,s=0,r=!0;for(let l=0,c=t.length;l<c;l++){const a=t.charCodeAt(l);13===a?l+1<c&&10===t.charCodeAt(l+1)?(s++,e[i++]=l+2,l++):(n++,e[i++]=l+1):10===a?(o++,e[i++]=l+1):r&&9!==a&&(a<32||a>126)&&(r=!1)}const a=new zv(Vv(e),n,o,s,r);return e.length=0,a}class jv{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class Uv{constructor(e,t){this.buffer=e,this.lineStarts=t}}class $v{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==gv&&e.iterate(e.root,e=>(e!==gv&&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 qv{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let 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--){let 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,i=this._cache;for(let n=0;n<i.length;n++){let o=i[n];(null===o.node.parent||o.nodeStartOffset>=e)&&(i[n]=null,t=!0)}if(t){let e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}class Gv{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Uv("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=gv,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,s=e.length;o<s;o++)if(e[o].buffer.length>0){e[o].lineStarts||(e[o].lineStarts=Hv(e[o].buffer));let t=new jv(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),n=this.rbInsertRight(n,t)}this._searchCache=new qv(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=Wv,i=t-Math.floor(t/3),n=2*i,o="",s=0,r=[];if(this.iterate(this.root,t=>{let a=this.getNodeContent(t),l=a.length;if(s<=i||s+l<n)return o+=a,s+=l,!0;let c=o.replace(/\r\n|\r|\n/g,e);return r.push(new Uv(c,Hv(c))),o=a,s=l,!0}),s>0){let t=o.replace(/\r\n|\r|\n/g,e);r.push(new Uv(t,Hv(t)))}this.create(r,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new $v(this,e)}getOffsetAt(e,t){let i=0,n=this.root;while(n!==gv)if(n.left!==gv&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;let o=this.getAccumulatedValue(n,e-n.lf_left-2);return i+(o+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,n=e;while(t!==gv)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){let o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,0===o.index){let e=this.getOffsetAt(i+1,1),t=n-e;return new wi(i+1,t+1)}return new wi(i+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===gv){let t=this.getOffsetAt(i+1,1),o=n-e-t;return new wi(i+1,o+1)}t=t.right}return new wi(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";let i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){let i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(o+e.remainder,o+t.remainder)}let i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start),s=n.substring(o+e.remainder,o+i.piece.length);i=i.next();while(i!==gv){let e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){s+=e.substring(n,n+t.remainder);break}s+=e.substr(n,i.piece.length),i=i.next()}return s}getLinesContent(){let e=[],t=0,i="",n=!1;return this.iterate(this.root,o=>{if(o===gv)return!0;const s=o.piece;let r=s.length;if(0===r)return!0;const a=this._buffers[s.bufferIndex].buffer,l=this._buffers[s.bufferIndex].lineStarts,c=s.start.line,d=s.end.line;let h=l[c]+s.start.column;if(n&&(10===a.charCodeAt(h)&&(h++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(c===d)return this._EOLNormalized||13!==a.charCodeAt(h+r-1)?i+=a.substr(h,r):(n=!0,i+=a.substr(h,r-1)),!0;i+=this._EOLNormalized?a.substring(h,Math.max(h,l[c+1]-this._EOLLength)):a.substring(h,l[c+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=c+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]+s.end.column-1)?i=a.substr(l[d],s.end.column):(n=!0,0===s.end.column?t--:i=a.substr(l[d],s.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){let t=e.node.next();if(!t)return 0;let i=this._buffers[t.piece.bufferIndex],n=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(n)}{let t=this._buffers[e.node.piece.bufferIndex],i=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start),n=i+e.remainder;return t.buffer.charCodeAt(n)}}getLineCharCode(e,t){let i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){let t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,i,n,o,s,r,a,l,c,d){let h,u,g,f=this._buffers[e.piece.bufferIndex],m=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),p=this.offsetInBuffer(e.piece.bufferIndex,o),_=this.offsetInBuffer(e.piece.bufferIndex,s),b={line:0,column:0};t._wordSeparators?(u=f.buffer.substring(p,_),g=e=>e+p,t.reset(0)):(u=f.buffer,g=e=>e,t.reset(p));do{if(h=t.next(u),h){if(g(h.index)>=_)return c;this.positionInBuffer(e,g(h.index)-m,b);let t=this.getLineFeedCnt(e.piece.bufferIndex,o,b),s=b.line===o.line?b.column-o.column+n:b.column+1,r=s+h[0].length;if(d[c++]=Mv(new Ci(i+t,s,i+t,r),h,a),g(h.index)+h[0].length>=_)return c;if(c>=l)return c}}while(h);return c}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const r=new Bv(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];let l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let c=this.positionInBuffer(a.node,a.remainder),d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,c,d,t,i,n,s,o),o;let h=e.startLineNumber,u=a.node;while(u!==l.node){let l=this.getLineFeedCnt(u.piece.bufferIndex,c,u.piece.end);if(l>=1){let a=this._buffers[u.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[c.line+l],f=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,r,h,f,c,this.positionInBuffer(u,g-d),t,i,n,s,o),s>=n)return o;h+=l}let d=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const a=this.getLineContent(h).substring(d,e.endColumn-1);return s=this._findMatchesInLine(t,r,a,e.endLineNumber,d,s,o,i,n),o}if(s=this._findMatchesInLine(t,r,this.getLineContent(h).substr(d),h,d,s,o,i,n),s>=n)return o;h++,a=this.nodeAt2(h,1),u=a.node,c=this.positionInBuffer(a.node,a.remainder)}if(h===e.endLineNumber){let a=h===e.startLineNumber?e.startColumn-1:0;const l=this.getLineContent(h).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,r,l,e.endLineNumber,a,s,o,i,n),o}let g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,r,h,g,c,d,t,i,n,s,o),o}_findMatchesInLine(e,t,i,n,o,s,r,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=i.length;let h=-a;while(-1!==(h=i.indexOf(t,h+a)))if((!c||Fv(c,i,d,h,a))&&(r[s++]=new Ua(new Ci(n,h+1+o,n,h+1+a+o),null),s>=l))return s;return s}let d;t.reset(0);do{if(d=t.next(i),d&&(r[s++]=Mv(new Ci(n,d.index+1+o,n,d.index+1+d[0].length+o),d,a),s>=l))return s}while(d);return s}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==gv){let{node:i,remainder:n,nodeStartOffset:o}=this.nodeAt(e),s=i.piece,r=s.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&s.end.line===this._lastChangeBufferPos.line&&s.end.column===this._lastChangeBufferPos.column&&o+s.length===e&&t.length<Wv)return this.appendToNode(i,t),void this.computeBufferMetadata();if(o===e)this.insertContentToNodeLeft(t,i),this._searchCache.validate(e);else if(o+i.piece.length>e){let e=[],o=new jv(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),this.offsetInBuffer(r,s.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)){let e=this.nodeCharCodeAt(i,n);if(10===e){let e={line:o.start.line+1,column:0};o=new jv(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){let o=this.nodeCharCodeAt(i,n-1);if(13===o){let o=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,o),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a)}else this.deleteNodeTail(i,a);let l=this.createNewPieces(t);o.length>0&&this.rbInsertRight(i,o);let c=i;for(let t=0;t<l.length;t++)c=this.rbInsertRight(c,l[t]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,i)}else{let e=this.createNewPieces(t),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===gv)return;let i=this.nodeAt(e),n=this.nodeAt(e+t),o=i.node,s=n.node;if(o===s){let s=this.positionInBuffer(o,i.remainder),r=this.positionInBuffer(o,n.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){let e=o.next();return Cv(this,o),this.validateCRLFWithPrevNode(e),void this.computeBufferMetadata()}return this.deleteNodeHead(o,r),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),void this.computeBufferMetadata()}return i.nodeStartOffset+o.piece.length===e+t?(this.deleteNodeTail(o,s),this.validateCRLFWithNextNode(o),void this.computeBufferMetadata()):(this.shrinkNode(o,s,r),void this.computeBufferMetadata())}let r=[],a=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,a),this._searchCache.validate(e),0===o.piece.length&&r.push(o);let l=this.positionInBuffer(s,n.remainder);this.deleteNodeHead(s,l),0===s.piece.length&&r.push(s);let c=o.next();for(let h=c;h!==gv&&h!==s;h=h.next())r.push(h);let d=0===o.piece.length?o.prev():o;this.deleteNodes(r),this.validateCRLFWithNextNode(d),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){let i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){let n=t.piece,o={line:n.start.line+1,column:0},s=new jv(n.bufferIndex,o,n.end,this.getLineFeedCnt(n.bufferIndex,o,n.end),n.length-1);t.piece=s,e+="\n",Sv(this,t,-1,-1),0===t.piece.length&&i.push(t)}let n=this.createNewPieces(e),o=this.rbInsertLeft(t,n[n.length-1]);for(let s=n.length-2;s>=0;s--)o=this.rbInsertLeft(o,n[s]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");let i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]),o=n;for(let s=1;s<i.length;s++)o=this.rbInsertRight(o,i[s]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){let n=e.piece,o=e.piece.bufferIndex,s=this._buffers[o].lineStarts,r=s[n.start.line]+n.start.column,a=r+t,l=n.start.line,c=n.end.line,d=0,h=0,u=0;while(l<=c){if(d=l+(c-l)/2|0,u=s[d],d===c)break;if(h=s[d+1],a<u)c=d-1;else{if(!(a>=h))break;l=d+1}}return i?(i.line=d,i.column=a-u,null):{line:d,column:a-u}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;let n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;let o=n[i.line+1],s=n[i.line]+i.column;if(o>s+1)return i.line-t.line;let r=s-1,a=this._buffers[e].buffer;return 13===a.charCodeAt(r)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){let i=this._buffers[e].lineStarts;return i[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)Cv(this,e[t])}createNewPieces(e){if(e.length>Wv){let t=[];while(e.length>Wv){const i=e.charCodeAt(Wv-1);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,Wv-1),e=e.substring(Wv-1)):(n=e.substring(0,Wv),e=e.substring(Wv));let o=Hv(n);t.push(new jv(this._buffers.length,{line:0,column:0},{line:o.length-1,column:n.length-o[o.length-1]},o.length-1,n.length)),this._buffers.push(new Uv(n,o))}let i=Hv(e);return t.push(new jv(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 Uv(e,i)),t}let t=this._buffers[0].buffer.length;const i=Hv(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 o=this._buffers[0].buffer.length;let s=this._buffers[0].lineStarts.length-1,r=o-this._buffers[0].lineStarts[s],a={line:s,column:r},l=new jv(0,n,a,this.getLineFeedCnt(0,n,a),o-t);return this._lastChangeBufferPos=a,[l]}getLineRawContent(e,t=0){let i=this.root,n="",o=this._searchCache.get2(e);if(o){i=o.node;let s=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),r=this._buffers[i.piece.bufferIndex].buffer,a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt!==e){let n=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return r.substring(a+s,a+n-t)}n=r.substring(a+s,a+i.piece.length)}else{let o=0;const s=e;while(i!==gv)if(i.left!==gv&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){let 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 o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:s-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){let t=this.getAccumulatedValue(i,e-i.lf_left-2),o=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=o.substring(s+t,s+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}}i=i.next();while(i!==gv){let e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){let o=this.getAccumulatedValue(i,0),s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(s,s+o-t),n}{let 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;while(e!==gv)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){let i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){let t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==o)return{index:t,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;let i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),s=t,r=this.offsetInBuffer(i.bufferIndex,s),a=this.getLineFeedCnt(i.bufferIndex,i.start,s),l=a-n,c=r-o,d=i.length+c;e.piece=new jv(i.bufferIndex,i.start,s,a,d),Sv(this,e,c,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),s=t,r=this.getLineFeedCnt(i.bufferIndex,s,i.end),a=this.offsetInBuffer(i.bufferIndex,s),l=r-n,c=o-a,d=i.length+c;e.piece=new jv(i.bufferIndex,s,i.end,r,d),Sv(this,e,c,l)}shrinkNode(e,t,i){const n=e.piece,o=n.start,s=n.end,r=n.length,a=n.lineFeedCnt,l=t,c=this.getLineFeedCnt(n.bufferIndex,n.start,l),d=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new jv(n.bufferIndex,n.start,l,c,d),Sv(this,e,d-r,c-a);let h=new jv(n.bufferIndex,i,s,this.getLineFeedCnt(n.bufferIndex,i,s),this.offsetInBuffer(n.bufferIndex,s)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,h);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 o=Hv(t,!1);for(let u=0;u<o.length;u++)o[u]+=n;if(i){let e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const s=this._buffers[0].lineStarts.length-1,r=this._buffers[0].buffer.length-this._buffers[0].lineStarts[s],a={line:s,column:r},l=e.piece.length+t.length,c=e.piece.lineFeedCnt,d=this.getLineFeedCnt(0,e.piece.start,a),h=d-c;e.piece=new jv(e.piece.bufferIndex,e.piece.start,a,d,l),this._lastChangeBufferPos=a,Sv(this,e,t.length,h)}nodeAt(e){let t=this.root,i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;while(t!==gv)if(t.size_left>e)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;let 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;while(i!==gv)if(i.left!==gv&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){let o=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){let o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}i=i.next();while(i!==gv){if(i.piece.lineFeedCnt>0){let 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){let e=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:e}}t-=i.piece.length,i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;let 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;while(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===gv||0===e.piece.lineFeedCnt)return!1;let t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;if(n===i.length-1)return!1;let s=i[n+1];return!(s>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o)}endWithCR(e){return"string"===typeof e?13===e.charCodeAt(e.length-1):e!==gv&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let i,n=[],o=this._buffers[e.piece.bufferIndex].lineStarts;i=0===e.piece.end.column?{line:e.piece.end.line-1,column:o[e.piece.end.line]-o[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new jv(e.piece.bufferIndex,e.piece.start,i,r,s),Sv(this,e,-1,-1),0===e.piece.length&&n.push(e);let a={line:t.piece.start.line+1,column:0};const l=t.piece.length-1,c=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new jv(t.piece.bufferIndex,a,t.piece.end,c,l),Sv(this,t,-1,-1),0===t.piece.length&&n.push(t);let d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let h=0;h<n.length;h++)Cv(this,n[h])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let i=t.next();if(this.startWithLF(i)){if(e+="\n",1===i.piece.length)Cv(this,i);else{const e=i.piece,t={line:e.start.line+1,column:0},n=e.length-1,o=this.getLineFeedCnt(e.bufferIndex,t,e.end);i.piece=new jv(e.bufferIndex,t,e.end,o,n),Sv(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===gv)return t(gv);let i=this.iterate(e.left,t);return i?t(e)&&this.iterate(e.right,t):i}getNodeContent(e){if(e===gv)return"";let t,i=this._buffers[e.piece.bufferIndex],n=e.piece,o=this.offsetInBuffer(n.bufferIndex,n.start),s=this.offsetInBuffer(n.bufferIndex,n.end);return t=i.buffer.substring(o,s),t}getPieceContent(e){let t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end),o=t.buffer.substring(i,n);return o}rbInsertRight(e,t){let i=new uv(t,1);i.left=gv,i.right=gv,i.parent=gv,i.size_left=0,i.lf_left=0;let n=this.root;if(n===gv)this.root=i,i.color=0;else if(e.right===gv)e.right=i,i.parent=e;else{let t=fv(e.right);t.left=i,i.parent=t}return yv(this,i),i}rbInsertLeft(e,t){let i=new uv(t,1);if(i.left=gv,i.right=gv,i.parent=gv,i.size_left=0,i.lf_left=0,this.root===gv)this.root=i,i.color=0;else if(e.left===gv)e.left=i,i.parent=e;else{let t=mv(e.left);t.right=i,i.parent=t}return yv(this,i),i}}function Yv(e){let t=0,i=0,n=0,o=0;for(let s=0,r=e.length;s<r;s++){const a=e.charCodeAt(s);13===a?(0===t&&(i=s),t++,s+1<r&&10===e.charCodeAt(s+1)?(o|=2,s++):o|=3,n=s+1):10===a&&(o|=1,0===t&&(i=s),t++,n=s+1)}return 0===t&&(i=e.length),[t,i,e.length-n,o]}function Xv(e){return(16384|e<<0|2<<23)>>>0}const Zv=new Uint32Array(0).buffer;class Qv{constructor(){this.tokens=[]}add(e,t){if(this.tokens.length>0){const i=this.tokens[this.tokens.length-1],n=i.startLineNumber+i.tokens.length-1;if(n+1===e)return void i.tokens.push(t)}this.tokens.push(new iw(e,[t]))}}class Jv{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return 0===e?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(0===e)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),n=this._getEndCharacter(e-1);return new Ci(0,t+1,i,n+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return 0===this._getTokenCount()}getLineTokens(e){let t=0,i=this._getTokenCount()-1;while(t<i){const n=t+Math.floor((i-t)/2),o=this._getDeltaLine(n);if(o<e)t=n+1;else{if(!(o>e)){let o=n;while(o>t&&this._getDeltaLine(o-1)===e)o--;let s=n;while(s<i&&this._getDeltaLine(s+1)===e)s++;return new ew(this._tokens.subarray(4*o,4*s+4))}i=n-1}}return this._getDeltaLine(t)===e?new ew(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,n){const o=this._tokens,s=this._tokenCount;let r=0,a=!1,l=0;for(let c=0;c<s;c++){const s=4*c,d=o[s],h=o[s+1],u=o[s+2],g=o[s+3];if((d>e||d===e&&u>=t)&&(d<i||d===i&&h<=n))a=!0;else{if(0===r&&(l=d),a){const e=4*r;o[e]=d-l,o[e+1]=h,o[e+2]=u,o[e+3]=g}r++}}return this._tokenCount=r,l}split(e,t,i,n){const o=this._tokens,s=this._tokenCount;let r=[],a=[],l=r,c=0,d=0;for(let h=0;h<s;h++){const s=4*h,r=o[s],u=o[s+1],g=o[s+2],f=o[s+3];if(r>e||r===e&&g>=t){if(r<i||r===i&&u<=n)continue;l!==a&&(l=a,c=0,d=r)}l[c++]=r-d,l[c++]=u,l[c++]=g,l[c++]=f}return[new Jv(new Uint32Array(r)),new Jv(new Uint32Array(a)),d]}acceptDeleteRange(e,t,i,n,o){const s=this._tokens,r=this._tokenCount,a=n-t;let l=0,c=!1;for(let d=0;d<r;d++){const h=4*d;let u=s[h],g=s[h+1],f=s[h+2];const m=s[h+3];if(u<t||u===t&&f<=i){l++;continue}if(u===t&&g<i)u===n&&f>o?f-=o-i:f=i;else if(u===t&&g===i){if(!(u===n&&f>o)){c=!0;continue}f-=o-i}else if(u<n||u===n&&g<o){if(!(u===n&&f>o)){c=!0;continue}u===t?(g=i,f=g+(f-o)):(g=0,f=g+(f-o))}else if(u>n){if(0===a&&!c){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,f+=e),u-=a,g-=o-i,f-=o-i}const p=4*l;s[p]=u,s[p+1]=g,s[p+2]=f,s[p+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,s){const r=0===i&&1===n&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),a=this._tokens,l=this._tokenCount;for(let c=0;c<l;c++){const s=4*c;let l=a[s],d=a[s+1],h=a[s+2];if(!(l<e||l===e&&h<t)){if(l===e&&h===t){if(!r)continue;h+=1}else if(l===e&&d<t&&t<h)0===i?h+=n:h=t;else{if(l===e&&d===t&&r)continue;if(l===e)if(l+=i,0===i)d+=n,h+=n;else{const e=h-d;d=o+(d-t),h=d+e}else l+=i}a[s]=l,a[s+1]=d,a[s+2]=h}}}}class ew{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}class tw{constructor(e,t){this.startLineNumber=e,this.tokens=t,this.endLineNumber=this.startLineNumber+this.tokens.getMaxDeltaLine()}toString(){return this.tokens.toString(this.startLineNumber)}_updateEndLineNumber(){this.endLineNumber=this.startLineNumber+this.tokens.getMaxDeltaLine()}isEmpty(){return this.tokens.isEmpty()}getLineTokens(e){return this.startLineNumber<=e&&e<=this.endLineNumber?this.tokens.getLineTokens(e-this.startLineNumber):null}getRange(){const e=this.tokens.getRange();return e?new Ci(this.startLineNumber+e.startLineNumber,e.startColumn,this.startLineNumber+e.endLineNumber,e.endColumn):e}removeTokens(e){const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber;this.startLineNumber+=this.tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber,[n,o,s]=this.tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new tw(this.startLineNumber,n),new tw(this.startLineNumber+s,o)]}applyEdit(e,t){const[i,n,o]=Yv(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new wi(e.startLineNumber,e.startColumn),t,i,n,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber;if(i<0){const e=i-t;return void(this.startLineNumber-=e)}const n=this.tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this.startLineNumber=0,void this.tokens.clear();if(t<0){const n=-t;this.startLineNumber-=n,this.tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this.tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(0===t&&0===i)return;const s=e.lineNumber-this.startLineNumber;if(s<0)return void(this.startLineNumber+=t);const r=this.tokens.getMaxDeltaLine();s>=r+1||this.tokens.acceptInsertText(s,e.column-1,t,i,n,o)}}class iw{constructor(e,t){this.startLineNumber=e,this.tokens=t}}function nw(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class ow{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(),o=t[t.length-1].getRange();if(!n||!o)return e;i=e.plusRange(n).plusRange(o)}let n=null;for(let o=0,s=this._pieces.length;o<s;o++){const e=this._pieces[o];if(e.endLineNumber<i.startLineNumber)continue;if(e.startLineNumber>i.endLineNumber){n=n||{index:o};break}if(e.removeTokens(i),e.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(e.endLineNumber<i.startLineNumber)continue;if(e.startLineNumber>i.endLineNumber){n=n||{index:o};continue}const[t,r]=e.split(i);t.isEmpty()?n=n||{index:o}:r.isEmpty()||(this._pieces.splice(o,1,t,r),o++,s++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=Mu(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSemanticTokens(e,t){const i=this._pieces;if(0===i.length)return t;const n=ow._findFirstPieceWithLine(i,e),o=i[n].getLineTokens(e);if(!o)return t;const s=t.getCount(),r=o.getCount();let a=0,l=[],c=0,d=0;const h=(e,t)=>{e!==d&&(d=e,l[c++]=e,l[c++]=t)};for(let u=0;u<r;u++){const e=o.getStartCharacter(u),i=o.getEndCharacter(u),n=o.getMetadata(u),r=((1&n?2048:0)|(2&n?4096:0)|(4&n?8192:0)|(8&n?8372224:0)|(16&n?4286578688:0))>>>0,l=~r>>>0;while(a<s&&t.getEndOffset(a)<=e)h(t.getEndOffset(a),t.getMetadata(a)),a++;a<s&&t.getStartOffset(a)<e&&h(e,t.getMetadata(a));while(a<s&&t.getEndOffset(a)<i)h(t.getEndOffset(a),t.getMetadata(a)&l|n&r),a++;if(a<s)h(i,t.getMetadata(a)&l|n&r),t.getEndOffset(a)===i&&a++;else{const e=Math.min(Math.max(0,a-1),s-1);h(i,t.getMetadata(e)&l|n&r)}}while(a<s)h(t.getEndOffset(a),t.getMetadata(a)),a++;return new rg(new Uint32Array(l),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,n=e.length-1;while(i<n){let o=i+Math.floor((n-i)/2);if(e[o].endLineNumber<t)i=o+1;else{if(!(e[o].startLineNumber>t)){while(o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber)o--;return o}n=o-1}}return i}acceptEdit(e,t,i,n,o){for(const s of this._pieces)s.acceptEdit(e,t,i,n,o)}}class sw{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let n=null;if(t<this._len&&(n=this._lineTokens[t]),null!==n&&n!==Zv)return new rg(nw(n),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=Xv(this._languageIdCodec.encodeLanguageId(e)),new rg(o,i,this._languageIdCodec)}static _massageTokens(e,t,i){const n=i?nw(i):null;if(0===t){let t=!1;if(n&&n.length>1&&(t=ql.getLanguageId(n[1])!==e),!t)return Zv}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=Xv(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){while(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;let i=[];for(let n=0;n<t;n++)i[n]=null;this._lineTokens=Mu(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,n,o){const s=sw._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,n);this._ensureLine(t);const r=this._lineTokens[t];return this._lineTokens[t]=s,!!o&&!sw._equals(r,s)}static _equals(e,t){if(!e||!t)return!e&&!t;const i=nw(e),n=nw(t);if(i.length!==n.length)return!1;for(let o=0,s=i.length;o<s;o++)if(i[o]!==n[o])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new wi(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]=sw._delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=sw._deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i<this._len&&(n=sw._deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=sw._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]=sw._deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=sw._insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=sw._insert(this._lineTokens[n],e.column-1,i))}static _deleteBeginning(e,t){return null===e||e===Zv?e:sw._delete(e,0,t)}static _deleteEnding(e,t){if(null===e||e===Zv)return e;const i=nw(e),n=i[i.length-2];return sw._delete(e,t,n)}static _delete(e,t,i){if(null===e||e===Zv||t===i)return e;const n=nw(e),o=n.length>>>1;if(0===t&&n[n.length-2]===i)return Zv;const s=rg.findIndexInTokensArray(n,t),r=s>0?n[s-1<<1]:0,a=n[s<<1];if(i<a){const r=i-t;for(let e=s;e<o;e++)n[e<<1]-=r;return e}let l,c;r!==t?(n[s<<1]=t,l=s+1<<1,c=t):(l=s<<1,c=r);const d=i-t;for(let u=s+1;u<o;u++){const e=n[u<<1]-d;e>c&&(n[l++]=e,n[l++]=n[1+(u<<1)],c=e)}if(l===n.length)return e;let h=new Uint32Array(l);return h.set(n.subarray(0,l),0),h.buffer}static _append(e,t){if(t===Zv)return e;if(e===Zv)return t;if(null===e)return e;if(null===t)return null;const i=nw(e),n=nw(t),o=n.length>>>1;let s=new Uint32Array(i.length+n.length);s.set(i,0);let r=i.length;const a=i[i.length-2];for(let l=0;l<o;l++)s[r++]=n[l<<1]+a,s[r++]=n[1+(l<<1)];return s.buffer}static _insert(e,t,i){if(null===e||e===Zv)return e;const n=nw(e),o=n.length>>>1;let s=rg.findIndexInTokensArray(n,t);if(s>0){const e=n[s-1<<1];e===t&&s--}for(let r=s;r<o;r++)n[r<<1]+=i;return e}}class rw extends Ye{constructor(e,t,i,n,o,s,r){super(),this._onDidChangeContent=this._register(new rt),this._BOM=t,this._mightContainNonBasicASCII=!s,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new Gv(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){let i=e+t;const n=this.getPositionAt(e),o=this.getPositionAt(i);return new Ci(n.lineNumber,n.column,o.lineNumber,o.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;let i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);return n-i}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let t=n;t<=o;t++){const s=this.getLineContent(t),r=t===n?e.startColumn-1:0,a=t===o?e.endColumn-1:s.length;for(let e=r;e<a;e++)Zs(s.charCodeAt(e))?(i+=1,e+=1):i+=1}return i+=this._getEndOfLine(t).length*(o-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=Bs(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Vs(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,o=this._mightContainUnusualLineTerminators,s=this._mightContainNonBasicASCII,r=!0,a=[];for(let f=0;f<e.length;f++){let t=e[f];r&&t._isTracked&&(r=!1);let i=t.range;if(t.text){let e=!0;s||(e=!cr(t.text),s=e),!n&&e&&(n=sr(t.text)),!o&&e&&(o=hr(t.text))}let l="",c=0,d=0,h=0;if(t.text){let e;[c,d,h,e]=Yv(t.text);const i=this.getEOL(),n="\r\n"===i?2:1;l=0===e||e===n?t.text:t.text.replace(/\r\n|\r|\n/g,i)}a[f]={sortIndex:f,identifier:t.identifier||null,range:i,rangeOffset:this.getOffsetAt(i.startLineNumber,i.startColumn),rangeLength:this.getValueLengthInRange(i),text:l,eolCount:c,firstLineLength:d,lastLineLength:h,forceMoveMarkers:Boolean(t.forceMoveMarkers),isAutoWhitespaceEdit:t.isAutoWhitespaceEdit||!1}}a.sort(rw._sortOpsAscending);let l=!1;for(let f=0,m=a.length-1;f<m;f++){let e=a[f].range.getEndPosition(),t=a[f+1].range.getStartPosition();if(t.isBeforeOrEqual(e)){if(t.isBefore(e))throw new Error("Overlapping ranges are not allowed!");l=!0}}r&&(a=this._reduceOperations(a));let c=i||t?rw._getInverseEditRanges(a):[],d=[];if(t)for(let f=0;f<a.length;f++){let e=a[f],t=c[f];if(e.isAutoWhitespaceEdit&&e.range.isEmpty())for(let i=t.startLineNumber;i<=t.endLineNumber;i++){let n="";i===t.startLineNumber&&(n=this.getLineContent(e.range.startLineNumber),-1!==Bs(n))||d.push({lineNumber:i,oldContent:n})}}let h=null;if(i){let e=0;h=[];for(let t=0;t<a.length;t++){const i=a[t],n=c[t],o=this.getValueInRange(i.range),s=i.rangeOffset+e;e+=i.text.length-o.length,h[t]={sortIndex:i.sortIndex,identifier:i.identifier,range:n,text:o,textChange:new wb(i.rangeOffset,o,s,i.text)}}l||h.sort((e,t)=>e.sortIndex-t.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;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++){let t=d[e].lineNumber;if(e>0&&d[e-1].lineNumber===t)continue;let i=d[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===Bs(n)&&g.push(t)}}return this._onDidChangeContent.fire(),new Ya(h,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,o=new Ci(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let s=i.startLineNumber,r=i.startColumn;const a=[];for(let u=0,g=e.length;u<g;u++){const i=e[u],n=i.range;t=t||i.forceMoveMarkers,a.push(this.getValueInRange(new Ci(s,r,n.startLineNumber,n.startColumn))),i.text.length>0&&a.push(i.text),s=n.endLineNumber,r=n.endColumn}const l=a.join(""),[c,d,h]=Yv(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:l,eolCount:c,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(rw._sortOpsDescending);let t=[];for(let i=0;i<e.length;i++){let n=e[i];const o=n.range.startLineNumber,s=n.range.startColumn,r=n.range.endLineNumber,a=n.range.endColumn;if(o===r&&s===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 Ci(o,s,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){let t=[],i=0,n=0,o=null;for(let s=0,r=e.length;s<r;s++){let r,a,l,c=e[s];if(o?o.range.endLineNumber===c.range.startLineNumber?(r=i,a=n+(c.range.startColumn-o.range.endColumn)):(r=i+(c.range.startLineNumber-o.range.endLineNumber),a=c.range.startColumn):(r=c.range.startLineNumber,a=c.range.startColumn),c.text.length>0){const e=c.eolCount+1;l=1===e?new Ci(r,a,r,a+c.firstLineLength):new Ci(r,a,r+e-1,c.lastLineLength+1)}else l=new Ci(r,a,r,a);i=l.endLineNumber,n=l.endColumn,t.push(l),o=c}return t}static _sortOpsAscending(e,t){let i=Ci.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=Ci.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class aw{constructor(e,t,i,n,o,s,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=s,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);let 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 o=0,s=i.length;o<s;o++){let e=i[o].buffer.replace(/\r\n|\r|\n/g,t),n=Hv(e);i[o]=new Uv(e,n)}const n=new rw(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class lw{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&&pr(e)&&(this.BOM=mr,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=Kv(this._tmpLineStarts,e);this.chunks.push(new Uv(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=sr(e)),this.isBasicASCII||this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=hr(e))}finish(e=!0){return this._finish(),new aw(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;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);let t=Hv(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class cw{constructor(){this.changeType=1}}class dw{constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}static applyInjectedText(e,t){if(!t||0===t.length)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.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 dw(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new dw(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}}class hw{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class uw{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class gw{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class fw{constructor(){this.changeType=5}}class mw{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++){const i=this.changes[t];if(i.changeType===e)return!0}return!1}static merge(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.versionId,o=e.isUndoing||t.isUndoing,s=e.isRedoing||t.isRedoing;return new mw(i,n,o,s)}}class pw{constructor(e){this.changes=e}}class _w{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=mw.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=_w._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new _w(t,i)}static _mergeChangeEvents(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.eol,o=t.versionId,s=e.isUndoing||t.isUndoing,r=e.isRedoing||t.isRedoing,a=e.isFlush||t.isFlush;return{changes:i,eol:n,versionId:o,isUndoing:s,isRedoing:r,isFlush:a}}}class bw{constructor(){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0}_reset(e){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0,e&&this._setBeginState(0,e)}flush(e){this._reset(e)}get invalidLineStartIndex(){return this._invalidLineStartIndex}_invalidateLine(e){e<this._len&&(this._valid[e]=!1),e<this._invalidLineStartIndex&&(this._invalidLineStartIndex=e)}_isValid(e){return e<this._len&&this._valid[e]}getBeginState(e){return e<this._len?this._beginState[e]:null}_ensureLine(e){while(e>=this._len)this._beginState[this._len]=null,this._valid[this._len]=!1,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._beginState.splice(e,t),this._valid.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const i=[],n=[];for(let o=0;o<t;o++)i[o]=null,n[o]=!1;this._beginState=Mu(this._beginState,e,i),this._valid=Mu(this._valid,e,n),this._len+=t}_setValid(e,t){this._ensureLine(e),this._valid[e]=t}_setBeginState(e,t){this._ensureLine(e),this._beginState[e]=t}setEndState(e,t,i){if(this._setValid(t,!0),this._invalidLineStartIndex=t+1,t===e-1)return;const n=this.getBeginState(t+1);if(null===n||!i.equals(n))return this._setBeginState(t+1,i),void this._invalidateLine(t+1);let o=t+1;while(o<e){if(!this._isValid(o))break;o++}this._invalidLineStartIndex=o}setFakeTokens(e){this._setValid(e,!1)}applyEdits(e,t){const i=e.endLineNumber-e.startLineNumber,n=t,o=Math.min(i,n);for(let s=o;s>=0;s--)this._invalidateLine(e.startLineNumber+s-1);this._acceptDeleteRange(e),this._acceptInsertText(new wi(e.startLineNumber,e.startColumn),t)}_acceptDeleteRange(e){const t=e.startLineNumber-1;t>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){const i=e.lineNumber-1;i>=this._len||this._insertLines(e.lineNumber,t)}}class vw extends Ye{constructor(e,t){super(),this._textModel=e,this._languageIdCodec=t,this._isDisposed=!1,this._tokenizationStateStore=new bw,this._tokenizationSupport=null,this._register(kc.onDidChange(e=>{const t=this._textModel.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&(this._resetTokenizationState(),this._textModel.clearTokens())})),this._register(this._textModel.onDidChangeContentFast(e=>{if(e.isFlush)this._resetTokenizationState();else{for(let t=0,i=e.changes.length;t<i;t++){const i=e.changes[t],[n]=Yv(i.text);this._tokenizationStateStore.applyEdits(i.range,n)}this._beginBackgroundTokenization()}})),this._register(this._textModel.onDidChangeAttached(()=>{this._beginBackgroundTokenization()})),this._register(this._textModel.onDidChangeLanguage(()=>{this._resetTokenizationState(),this._textModel.clearTokens()})),this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}_resetTokenizationState(){const[e,t]=ww(this._textModel);this._tokenizationSupport=e,this._tokenizationStateStore.flush(t),this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&s["j"](()=>{this._isDisposed||this._revalidateTokensNow()})}_revalidateTokensNow(){const e=this._textModel.getLineCount(),t=1,i=new Qv,n=tt.create(!1);let o=-1;while(this._hasLinesToTokenize()){if(n.elapsed()>t)break;if(o=this._tokenizeOneInvalidLine(i),o>=e)break}this._beginBackgroundTokenization(),this._textModel.setTokens(i.tokens,!this._hasLinesToTokenize())}tokenizeViewport(e,t){const i=new Qv;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.tokens,!this._hasLinesToTokenize())}reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new Qv;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens,!this._hasLinesToTokenize())}isCheapToTokenize(e){if(!this._tokenizationSupport)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e<t||this._textModel.getLineLength(e)<2048)}_hasLinesToTokenize(){return!!this._tokenizationSupport&&this._tokenizationStateStore.invalidLineStartIndex<this._textModel.getLineCount()}_tokenizeOneInvalidLine(e){if(!this._hasLinesToTokenize())return this._textModel.getLineCount()+1;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return this._updateTokensUntilLine(e,t),t}_updateTokensUntilLine(e,t){if(!this._tokenizationSupport)return;const i=this._textModel.getLanguageId(),n=this._textModel.getLineCount(),o=t-1;for(let s=this._tokenizationStateStore.invalidLineStartIndex;s<=o;s++){const t=this._textModel.getLineContent(s+1),o=this._tokenizationStateStore.getBeginState(s),r=Cw(this._languageIdCodec,i,this._tokenizationSupport,t,!0,o);e.add(s+1,r.tokens),this._tokenizationStateStore.setEndState(n,s,r.endState),s=this._tokenizationStateStore.invalidLineStartIndex-1}}_tokenizeViewport(e,t,i){if(!this._tokenizationSupport)return;if(i<=this._tokenizationStateStore.invalidLineStartIndex)return;if(t<=this._tokenizationStateStore.invalidLineStartIndex)return void this._updateTokensUntilLine(e,i);let n=this._textModel.getLineFirstNonWhitespaceColumn(t);const o=[];let s=null;for(let l=t-1;n>1&&l>=1;l--){const e=this._textModel.getLineFirstNonWhitespaceColumn(l);if(0!==e&&e<n){if(s=this._tokenizationStateStore.getBeginState(l-1),s)break;o.push(this._textModel.getLineContent(l)),n=e}}s||(s=this._tokenizationSupport.getInitialState());const r=this._textModel.getLanguageId();let a=s;for(let l=o.length-1;l>=0;l--){const e=Cw(this._languageIdCodec,r,this._tokenizationSupport,o[l],!1,a);a=e.endState}for(let l=t;l<=i;l++){const t=this._textModel.getLineContent(l),i=Cw(this._languageIdCodec,r,this._tokenizationSupport,t,!0,a);e.add(l,i.tokens),this._tokenizationStateStore.setFakeTokens(l-1),a=i.endState}}}function ww(e){const t=e.getLanguageId();let i=e.isTooLargeForTokenization()?null:kc.get(t),n=null;if(i)try{n=i.getInitialState()}catch(o){xe(o),i=null}return[i,n]}function Cw(e,t,i,n,o,s){let r=null;if(i)try{r=i.tokenize2(n,o,s.clone(),0)}catch(a){xe(a)}return r||(r=Ic(e.encodeLanguageId(t),n,s,0)),rg.convertToEndOffset(r.tokens,n.length),r}function yw(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}class Sw{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=yw(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 xw{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=yw(Math.max(Math.min(1,t),0),3),this.l=yw(Math.max(Math.min(1,i),0),3),this.a=yw(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,o=e.a,s=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const c=(r+s)/2,d=s-r;if(d>0){switch(l=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),s){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;break}a*=60,a=Math.round(a)}return new xw(a,l,c,o)}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:o}=e;let s,r,a;if(0===i)s=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,o=2*n-e;s=xw._hue2rgb(o,e,t+1/3),r=xw._hue2rgb(o,e,t),a=xw._hue2rgb(o,e,t-1/3)}return new Sw(Math.round(255*s),Math.round(255*r),Math.round(255*a),o)}}class kw{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=yw(Math.max(Math.min(1,t),0),3),this.v=yw(Math.max(Math.min(1,i),0),3),this.a=yw(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,o=Math.max(t,i,n),s=Math.min(t,i,n),r=o-s,a=0===o?0:r/o;let l;return l=0===r?0:o===t?((i-n)/r%6+6)%6:o===i?(n-t)/r+2:(t-i)/r+4,new kw(Math.round(60*l),a,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,s=n*i,r=s*(1-Math.abs(t/60%2-1)),a=n-s;let[l,c,d]=[0,0,0];return t<60?(l=s,c=r):t<120?(l=r,c=s):t<180?(c=s,d=r):t<240?(c=r,d=s):t<300?(l=r,d=s):t<=360&&(l=s,d=r),l=Math.round(255*(l+a)),c=Math.round(255*(c+a)),d=Math.round(255*(d+a)),new Sw(l,c,d,o)}}class Lw{constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof Sw)this.rgba=e;else if(e instanceof xw)this._hsla=e,this.rgba=xw.toRGBA(e);else{if(!(e instanceof kw))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=kw.toRGBA(e)}}static fromHex(e){return Lw.Format.CSS.parseHex(e)||Lw.red}get hsla(){return this._hsla?this._hsla:xw.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:kw.fromRGBA(this.rgba)}equals(e){return!!e&&Sw.equals(this.rgba,e.rgba)&&xw.equals(this.hsla,e.hsla)&&kw.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=Lw._relativeLuminanceForComponent(this.rgba.r),t=Lw._relativeLuminanceForComponent(this.rgba.g),i=Lw._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return yw(n,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){const e=(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3;return e>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t<i}lighten(e){return new Lw(new xw(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new Lw(new xw(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:o}=this.rgba;return new Lw(new Sw(t,i,n,o*e))}isTransparent(){return 0===this.rgba.a}isOpaque(){return 1===this.rgba.a}opposite(){return new Lw(new Sw(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}toString(){return this._toString||(this._toString=Lw.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-n)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(n-o)/n,e.darken(i)}}Lw.white=new Lw(new Sw(255,255,255,1)),Lw.black=new Lw(new Sw(0,0,0,1)),Lw.red=new Lw(new Sw(255,0,0,1)),Lw.blue=new Lw(new Sw(0,0,255,1)),Lw.cyan=new Lw(new Sw(0,255,255,1)),Lw.lightgrey=new Lw(new Sw(211,211,211,1)),Lw.transparent=new Lw(new Sw(0,0,0,0)),function(e){let t;(function(t){let i;(function(t){function i(t){return 1===t.rgba.a?`rgb(${t.rgba.r}, ${t.rgba.g}, ${t.rgba.b})`:e.Format.CSS.formatRGBA(t)}function n(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`}function o(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)}function s(e){return`hsla(${e.hsla.h}, ${(100*e.hsla.s).toFixed(2)}%, ${(100*e.hsla.l).toFixed(2)}%, ${e.hsla.a.toFixed(2)})`}function r(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}function a(e){return`#${r(e.rgba.r)}${r(e.rgba.g)}${r(e.rgba.b)}`}function l(t,i=!1){return i&&1===t.rgba.a?e.Format.CSS.formatHex(t):`#${r(t.rgba.r)}${r(t.rgba.g)}${r(t.rgba.b)}${r(Math.round(255*t.rgba.a))}`}function c(t){return t.isOpaque()?e.Format.CSS.formatHex(t):e.Format.CSS.formatRGBA(t)}function d(t){const i=t.length;if(0===i)return null;if(35!==t.charCodeAt(0))return null;if(7===i){const i=16*h(t.charCodeAt(1))+h(t.charCodeAt(2)),n=16*h(t.charCodeAt(3))+h(t.charCodeAt(4)),o=16*h(t.charCodeAt(5))+h(t.charCodeAt(6));return new e(new Sw(i,n,o,1))}if(9===i){const i=16*h(t.charCodeAt(1))+h(t.charCodeAt(2)),n=16*h(t.charCodeAt(3))+h(t.charCodeAt(4)),o=16*h(t.charCodeAt(5))+h(t.charCodeAt(6)),s=16*h(t.charCodeAt(7))+h(t.charCodeAt(8));return new e(new Sw(i,n,o,s/255))}if(4===i){const i=h(t.charCodeAt(1)),n=h(t.charCodeAt(2)),o=h(t.charCodeAt(3));return new e(new Sw(16*i+i,16*n+n,16*o+o))}if(5===i){const i=h(t.charCodeAt(1)),n=h(t.charCodeAt(2)),o=h(t.charCodeAt(3)),s=h(t.charCodeAt(4));return new e(new Sw(16*i+i,16*n+n,16*o+o,(16*s+s)/255))}return null}function h(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:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}t.formatRGB=i,t.formatRGBA=n,t.formatHSL=o,t.formatHSLA=s,t.formatHex=a,t.formatHexA=l,t.format=c,t.parseHex=d})(i=t.CSS||(t.CSS={}))})(t=e.Format||(e.Format={}))}(Lw||(Lw={}));const Ew=gn("undoRedoService");class Dw{constructor(e,t){this.resource=e,this.elements=t}}class Nw{constructor(){this.id=Nw._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}Nw._ID=0,Nw.None=new Nw;class Iw{constructor(){this.id=Iw._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}Iw._ID=0,Iw.None=new Iw;class Tw{constructor(e,t,i){this.range=e,this.nestingLevel=t,this.isInvalid=i}}class Mw{constructor(e,t,i,n){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n}}class Ow extends Mw{constructor(e,t,i,n,o){super(e,t,i,n),this.minVisibleColumnIndentation=o}}class Aw{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}function Pw(e,t,i,n){return e!==i?Ww(i-e,n):Ww(0,n-t)}const Rw=0;function Fw(e){return 0===e}const Bw=Math.pow(2,26);function Ww(e,t){return e*Bw+t}function Vw(e){const t=e,i=Math.floor(t/Bw),n=t-i*Bw;return new Aw(i,n)}function zw(e){return Math.floor(e/Bw)}function Hw(e){return e}function Kw(e,t){return t<Bw?e+t:e-e%Bw+t}function jw(e,t){const i=e,n=t,o=n-i;if(o<=0)return Rw;const s=Math.floor(i/Bw),r=Math.floor(n/Bw),a=n-r*Bw;if(s===r){const e=i-s*Bw;return Ww(0,a-e)}return Ww(r-s,a)}function Uw(e,t){return e<t}function $w(e,t){return e<=t}function qw(e,t){return e>=t}function Gw(e){return Ww(e.lineNumber-1,e.column-1)}function Yw(e,t){const i=e,n=Math.floor(i/Bw),o=i-n*Bw,s=t,r=Math.floor(s/Bw),a=s-r*Bw;return new Ci(n+1,o+1,r+1,a+1)}function Xw(e){const t=Fs(e);return Ww(t.length-1,t[t.length-1].length)}function Zw(e){return e}class Qw{constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}}class Jw{constructor(e,t){this.documentLength=t,this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(e=>eC.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):this.documentLength;return jw(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ww(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ww(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Vw(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ww(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ww(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){while(this.nextEditIdx<this.edits.length){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(!$w(i,e))break;{this.nextEditIdx++;const e=Vw(i),n=Vw(this.translateOldToCur(t.endOffsetBeforeObj)),o=e.lineCount-n.lineCount;this.deltaOldToNewLineCount+=o;const s=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,r=e.columnCount-n.columnCount;this.deltaOldToNewColumnCount=s+r,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}}}}class eC{constructor(e,t,i){this.endOffsetBeforeObj=Vw(t),this.endOffsetAfterObj=Vw(Kw(e,i)),this.offsetObj=Vw(e)}static from(e){return new eC(e.startOffset,e.endOffset,e.newLength)}}class tC{static visibleColumnFromColumn(e,t,i){const n=e.length,o=t-1<n?t-1:n;let s=0,r=0;while(r<o){const t=er(e,o,r);if(r+=t>=65536?2:1,9===t)s=tC.nextRenderTabStop(s,i);else{let i=br(t);while(r<o){const t=er(e,o,r),n=br(t);if(vr(i,n))break;r+=t>=65536?2:1,i=n}gr(t)||fr(t)?s+=2:s+=1}}return s}static visibleColumnsByColumns(e,t){const i=e.length;let n=new Array;n.push(-1);let o=0,s=0;while(s<i){const r=er(e,i,s);if(s+=r>=65536?2:1,n.push(o),r>=65536&&n.push(o),9===r)o=tC.nextRenderTabStop(o,t);else{let t=br(r);while(s<i){const a=er(e,i,s),l=br(a);if(vr(t,l))break;s+=a>=65536?2:1,n.push(o),r>=65536&&n.push(o),t=l}gr(r)||fr(r)?o+=2:o+=1}}return n.push(o),n}static visibleColumnFromColumn2(e,t,i){return this.visibleColumnFromColumn(t.getLineContent(i.lineNumber),i.column,e.tabSize)}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length;let o=0,s=1,r=0;while(r<n){const a=er(e,n,r);let l;if(r+=a>=65536?2:1,9===a)l=tC.nextRenderTabStop(o,i);else{let t=br(a);while(r<n){const i=er(e,n,r),o=br(i);if(vr(t,o))break;r+=i>=65536?2:1,t=o}l=gr(a)||fr(a)?o+2:o+1}const c=r+1;if(l>=t){const e=t-o,i=l-t;return i<e?c:s}o=l,s=c}return n+1}static columnFromVisibleColumn2(e,t,i,n){let o=this.columnFromVisibleColumn(t.getLineContent(i),n,e.tabSize),s=t.getLineMinColumn(i);if(o<s)return s;let r=t.getLineMaxColumn(i);return o>r?r:o}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)}}const iC=new Array;class nC{constructor(e,t){this.items=e,this.additionalItems=t}static create(e,t){if(e<=128&&0===t.length){let i=nC.cache[e];return i||(i=new nC(e,t),nC.cache[e]=i),i}return new nC(e,t)}static getEmpty(){return this.empty}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:nC.create(e,this.additionalItems)}n--;const o=this.additionalItems.slice(0);while(o.length<n)o.push(0);return o[n]|=1<<(31&i),nC.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===iC&&e.additionalItems===iC)return t===this.items?this:t===e.items?e:nC.create(t,iC);const i=new Array;for(let n=0;n<Math.max(this.additionalItems.length,e.additionalItems.length);n++){const t=this.additionalItems[n]||0,o=e.additionalItems[n]||0;i.push(t|o)}return nC.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}}nC.cache=new Array(129),nC.empty=nC.create(0,iC);const oC={getKey(e){return e}};class sC{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 rC{constructor(e){this._length=e}get length(){return this._length}}class aC extends rC{constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}static create(e,t,i){let n=e.length;return t&&(n=Kw(n,t.length)),i&&(n=Kw(n,i.length)),new aC(n,e,t,i,t?t.missingOpeningBracketIds:nC.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=new Array;return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new aC(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(Kw(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class lC extends rC{constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}static create23(e,t,i,n=!1){let o=e.length,s=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Kw(o,t.length),s=s.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Kw(o,i.length),s=s.merge(i.missingOpeningBracketIds)}return n?new dC(o,e.listHeight+1,e,t,i,s):new cC(o,e.listHeight+1,e,t,i,s)}static getEmpty(){return new uC(Rw,0,[],nC.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}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();const e=this.childrenLength;if(0===e)return;const t=this.getChild(0),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(0,i),i}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;let t,i=this;while(4===i.kind&&(t=i.childrenLength)>0)i=i.getChild(t-1);return i.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=Kw(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 o=0;o<this.childrenLength;o++){const e=this.getChild(o);e&&(i=Math.min(i,e.computeMinIndentation(n,t)),n=Kw(n,e.length))}return this.cachedMinIndentation=i,i}}class cC extends lC{constructor(e,t,i,n,o,s){super(e,t,s),this._item1=i,this._item2=n,this._item3=o}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}deepClone(){return new cC(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 dC extends cC{toMutable(){return new cC(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class hC extends lC{constructor(e,t,i,n){super(e,t,n),this._children=i}get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}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 hC(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 uC extends hC{toMutable(){return new hC(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const gC=[];class fC extends rC{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return gC}deepClone(){return this}}class mC extends fC{get kind(){return 0}get missingOpeningBracketIds(){return nC.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=Vw(e),n=(0===i.columnCount?i.lineCount:i.lineCount+1)+1,o=zw(Kw(e,this.length))+1;let s=Number.MAX_SAFE_INTEGER;for(let r=n;r<=o;r++){const e=t.getLineFirstNonWhitespaceColumn(r),i=t.getLineContent(r);if(0===e)continue;const n=tC.visibleColumnFromColumn(i,e,t.getOptions().tabSize);s=Math.min(s,n)}return s}}class pC extends fC{constructor(e){super(e)}static create(e){const t=Zw(e),i=pC.cacheByLength.get(t);if(i)return i;const n=new pC(e);return pC.cacheByLength.set(t,n),n}get kind(){return 1}get missingOpeningBracketIds(){return nC.getEmpty()}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}pC.cacheByLength=new Map;class _C extends fC{constructor(e,t){super(t),this.missingOpeningBracketIds=e}get kind(){return 3}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class bC{constructor(e,t,i,n,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=o}}class vC{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new wC(this.textModel,this.bracketTokens),this._offset=Rw,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return Ww(this.textBufferLineCount,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Kw(this._offset,e);const t=Vw(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=Kw(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class wC{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,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+=Hw(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.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;while(1){const n=this.lineTokens,o=n.getCount();let s=null;if(this.lineTokenOffset<o){const r=n.getMetadata(this.lineTokenOffset);while(this.lineTokenOffset+1<o&&r===n.getMetadata(this.lineTokenOffset+1))this.lineTokenOffset++;const a=0===ql.getTokenType(r),l=n.getEndOffset(this.lineTokenOffset);if(a&&l!==this.lineCharOffset){const e=n.getLanguageId(this.lineTokenOffset),t=this.line.substring(this.lineCharOffset,l),i=this.bracketTokens.getSingleLanguageBracketTokens(e),o=i.regExpGlobal;if(o){o.lastIndex=0;const e=o.exec(t);e&&(s=i.getToken(e[0]),s&&(this.lineCharOffset+=e.index))}}if(i+=l-this.lineCharOffset,s){if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=s;break}return this.lineCharOffset+=Hw(s.length),s}this.lineTokenOffset++,this.lineCharOffset=l}else{if(this.lineIdx===this.textBufferLineCount-1)break;if(this.lineIdx++,this.lineTokens=this.textModel.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=Pw(e,t,this.lineIdx,this.lineCharOffset);return new bC(n,0,-1,nC.getEmpty(),new mC(n))}}class CC{constructor(e,t){this.text=e,this._offset=Rw,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(t.getRegExpStr()+"|\n","g"):null,o=[];let s,r=0,a=0,l=0,c=0;const d=new Array;for(let g=0;g<60;g++)d.push(new bC(Ww(0,g),0,-1,nC.getEmpty(),new mC(Ww(0,g))));const h=new Array;for(let g=0;g<60;g++)h.push(new bC(Ww(1,g),0,-1,nC.getEmpty(),new mC(Ww(1,g))));if(n){n.lastIndex=0;while(null!==(s=n.exec(e))){const e=s.index,i=s[0];if("\n"===i)r++,a=e+1;else{if(l!==e){let t;if(c===r){const i=e-l;if(i<d.length)t=d[i];else{const e=Ww(0,i);t=new bC(e,0,-1,nC.getEmpty(),new mC(e))}}else{const i=r-c,n=e-a;if(1===i&&n<h.length)t=h[n];else{const e=Ww(i,n);t=new bC(e,0,-1,nC.getEmpty(),new mC(e))}}o.push(t)}o.push(t.getToken(i)),l=e+i.length,c=r}}}const u=e.length;if(l!==u){const e=c===r?Ww(0,u-l):Ww(r-c,u-a);o.push(new bC(e,0,-1,nC.getEmpty(),new mC(e)))}this.length=Ww(r,u-a),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new Me}}class yC{constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}static createFromLanguage(e,t){function i(e,i){return t.getKey(`${e}:::${i}`)}const n=e.characterPair.getColorizedBrackets(),o=new Map,s=new Set;for(const[a,l]of n){s.add(a);let t=o.get(l);const n=i(e.languageId,a);t||(t={openingBrackets:nC.getEmpty(),first:n},o.set(l,t)),t.openingBrackets=t.openingBrackets.add(n,oC)}const r=new Map;for(const[a,l]of o){const e=Ww(0,a.length);r.set(a,new bC(e,2,l.first,l.openingBrackets,pC.create(e)))}for(const a of s){const t=Ww(0,a.length),n=i(e.languageId,a);r.set(a,new bC(t,1,n,nC.getEmpty().add(n,oC),pC.create(t)))}return new yC(r)}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(e=>SC(e)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"g"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e)}get isEmpty(){return 0===this.map.size}}function SC(e){const t=Is(e),i=/^[\w ]+$/.test(e);return i?`\\b${t}\\b`:t}class xC{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){const t=this.languageIdToBracketTokens.get(e);if(!t)return!1;const i=yC.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider).getRegExpStr();return t.getRegExpStr()!==i}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=yC.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function kC(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;t++;while(t<e.length&&e[t].listHeight===n)t++;return t-i>=2?LC(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),o=i();if(!o)return n;for(let r=i();r;r=i())EC(n,o)<=EC(o,r)?(n=DC(n,o),o=r):o=DC(o,r);const s=DC(n,o);return s}function LC(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;while(i>3){const n=i>>1;for(let o=0;o<n;o++){const n=o<<1;e[o]=lC.create23(e[n],e[n+1],n+3===i?e[n+2]:null,t)}i=n}return lC.create23(e[0],e[1],i>=3?e[2]:null,t)}function EC(e,t){return Math.abs(e.listHeight-t.listHeight)}function DC(e,t){return e.listHeight===t.listHeight?lC.create23(e,t,null,!1):e.listHeight>t.listHeight?NC(e,t):IC(t,e)}function NC(e,t){e=e.toMutable();let i=e;const n=new Array;let o;while(1){if(t.listHeight===i.listHeight){o=t;break}if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeLastElementMutable()}for(let s=n.length-1;s>=0;s--){const e=n[s];o?e.childrenLength>=3?o=lC.create23(e.unappendChild(),o,null,!1):(e.appendChildOfSameHeight(o),o=void 0):e.handleChildrenChanged()}return o?lC.create23(e,o,null,!1):e}function IC(e,t){e=e.toMutable();let i=e;const n=new Array;while(t.listHeight!==i.listHeight){if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let o=t;for(let s=n.length-1;s>=0;s--){const e=n[s];o?e.childrenLength>=3?o=lC.create23(o,e.unprependChild(),null,!1):(e.prependChildOfSameHeight(o),o=void 0):e.handleChildrenChanged()}return o?lC.create23(o,e,null,!1):e}class TC{constructor(e){this.lastOffset=Rw,this.nextNodes=[e],this.offsets=[Rw],this.idxs=[]}readLongestNodeAt(e,t){if(Uw(e,this.lastOffset))throw new Error("Invalid offset");this.lastOffset=e;while(1){const i=OC(this.nextNodes);if(!i)return;const n=OC(this.offsets);if(Uw(e,n))return;if(Uw(n,e))if(Kw(n,i.length)<=e)this.nextNodeAfterCurrent();else{const e=MC(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=MC(i);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){while(1){const e=OC(this.offsets),t=OC(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const i=OC(this.nextNodes),n=MC(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push(Kw(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}}function MC(e,t=-1){while(1){if(t++,t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function OC(e){return e.length>0?e[e.length-1]:void 0}function AC(e,t,i,n){const o=new PC(e,t,i,n);return o.parseDocument()}class PC{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 TC(i):void 0,this.positionMapper=new Jw(t,e.length)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(nC.getEmpty());return e||(e=lC.getEmpty()),e}parseList(e){const t=new Array;while(1){const i=this.tokenizer.peek();if(!i||2===i.kind&&i.bracketIds.intersects(e))break;const n=this.parseChild(e);4===n.kind&&0===n.childrenLength||t.push(n)}const i=this.oldNodeReader?kC(t):LC(t,this.createImmutableLists);return i}parseChild(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(!Fw(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),i=>{if(!Uw(i.length,t))return!1;const n=i.canBeReused(e);return n});if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}this._itemsConstructed++;const t=this.tokenizer.read();switch(t.kind){case 2:return new _C(t.bracketIds,t.length);case 0:return t.astNode;case 1:const i=e.merge(t.bracketIds),n=this.parseList(i),o=this.tokenizer.peek();return o&&2===o.kind&&(o.bracketId===t.bracketId||o.bracketIds.intersects(t.bracketIds))?(this.tokenizer.read(),aC.create(t.astNode,n,o.astNode)):aC.create(t.astNode,n,null);default:throw new Error("unexpected")}}}class RC extends Ye{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.cache=this._register(new Xe),this.onDidChangeEmitter=new rt,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(e.onDidChangeOptions(e=>{this.cache.clear(),this.updateCache()})),this._register(e.onDidChangeLanguage(e=>{this.cache.clear(),this.updateCache()})),this._register(this.languageConfigurationService.onDidChange(e=>{var t;e.languageId&&!(null===(t=this.cache.value)||void 0===t?void 0:t.object.didLanguageChange(e.languageId))||(this.cache.clear(),this.updateCache())}))}get isDocumentSupported(){const e=5e6;return this.textModel.getValueLength()<=e}updateCache(){if(this.bracketsRequested&&this.isDocumentSupported){if(!this.cache.value){const e=new Ge;this.cache.value=FC(e.add(new BC(this.textModel,e=>this.languageConfigurationService.getLanguageConfiguration(e))),e),e.add(this.cache.value.object.onDidChange(e=>this.onDidChangeEmitter.fire(e))),this.onDidChangeEmitter.fire()}}else this.cache.clear(),this.onDidChangeEmitter.fire()}handleContentChanged(e){var t;null===(t=this.cache.value)||void 0===t||t.object.handleContentChanged(e)}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateCache(),(null===(t=this.cache.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!1))||[]}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateCache(),(null===(t=this.cache.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!0))||[]}getBracketsInRange(e){var t;return this.bracketsRequested=!0,this.updateCache(),(null===(t=this.cache.value)||void 0===t?void 0:t.object.getBracketsInRange(e))||[]}}function FC(e,t){return{object:e,dispose:()=>null===t||void 0===t?void 0:t.dispose()}}class BC extends Ye{constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new rt,this.denseKeyProvider=new sC,this.brackets=new xC(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this._register(e.onBackgroundTokenizationStateChanged(()=>{if(2===e.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}})),this._register(e.onDidChangeTokens(({ranges:e})=>{const t=e.map(e=>new Qw(Ww(e.fromLineNumber-1,0),Ww(e.toLineNumber,0),Ww(e.toLineNumber-e.fromLineNumber+1,0)));this.astWithTokens=this.parseDocumentFromTextBuffer(t,this.astWithTokens,!1),this.initialAstWithoutTokens||this.didChangeEmitter.fire()})),0===e.backgroundTokenizationState){const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new CC(this.textModel.getValue(),e);this.initialAstWithoutTokens=AC(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}else 2===e.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):1===e.backgroundTokenizationState&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens)}didLanguageChange(e){return this.brackets.didLanguageChange(e)}handleContentChanged(e){const t=e.changes.map(e=>{const t=Ci.lift(e.range);return new Qw(Gw(t.getStartPosition()),Gw(t.getEndPosition()),Xw(e.text))}).reverse();this.astWithTokens=this.parseDocumentFromTextBuffer(t,this.astWithTokens,!1),this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(t,this.initialAstWithoutTokens,!1))}parseDocumentFromTextBuffer(e,t,i){const n=!1,o=n?null===t||void 0===t?void 0:t.deepClone():t,s=new vC(this.textModel,this.brackets),r=AC(s,e,o,i);return r}getBracketsInRange(e){const t=Ww(e.startLineNumber-1,e.startColumn-1),i=Ww(e.endLineNumber-1,e.endColumn-1),n=new Array,o=this.initialAstWithoutTokens||this.astWithTokens;return WC(o,Rw,o.length,t,i,n),n}getBracketPairsInRange(e,t){const i=new Array,n=Gw(e.getStartPosition()),o=Gw(e.getEndPosition()),s=this.initialAstWithoutTokens||this.astWithTokens,r=new VC(i,t,this.textModel);return zC(s,Rw,s.length,n,o,r),i}}function WC(e,t,i,n,o,s,r=0){if(1===e.kind){const e=Yw(t,i);s.push(new Tw(e,r-1,!1))}else if(3===e.kind){const e=Yw(t,i);s.push(new Tw(e,r-1,!0))}else if(4===e.kind)for(const a of e.children)i=Kw(t,a.length),$w(t,o)&&qw(i,n)&&WC(a,t,i,n,o,s,r),t=i;else if(2===e.kind){r++;{const a=e.openingBracket;i=Kw(t,a.length),$w(t,o)&&qw(i,n)&&WC(a,t,i,n,o,s,r),t=i}if(e.child){const a=e.child;i=Kw(t,a.length),$w(t,o)&&qw(i,n)&&WC(a,t,i,n,o,s,r),t=i}if(e.closingBracket){const a=e.closingBracket;i=Kw(t,a.length),$w(t,o)&&qw(i,n)&&WC(a,t,i,n,o,s,r),t=i}}}class VC{constructor(e,t,i){this.result=e,this.includeMinIndentation=t,this.textModel=i}}function zC(e,t,i,n,o,s,r=0){var a;if(2===e.kind){const n=Kw(t,e.openingBracket.length);let o=-1;s.includeMinIndentation&&(o=e.computeMinIndentation(t,s.textModel)),s.result.push(new Ow(Yw(t,i),Yw(t,n),e.closingBracket?Yw(Kw(n,(null===(a=e.child)||void 0===a?void 0:a.length)||Rw),i):void 0,r,o)),r++}let l=t;for(const c of e.children){const e=l;l=Kw(l,c.length),$w(e,o)&&$w(n,l)&&zC(c,e,l,n,o,s,r)}}const HC={ColorContribution:"base.contributions.colors"};class KC{constructor(){this._onDidChangeSchema=new rt,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){let s={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=s;let r={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(r.deprecationMessage=o),this.colorSchema.properties[e]=r,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const e=i.defaults[t.type];return ex(e,t)}}getColorSchema(){return this.colorSchema}toString(){let e=(e,t)=>{let i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)};return Object.keys(this.colorsById).sort(e).map(e=>`- \`${e}\`: ${this.colorsById[e].description}`).join("\n")}}const jC=new KC;function UC(e,t,i,n,o){return jC.registerColor(e,t,i,n,o)}zd.add(HC.ColorContribution,jC);const $C=UC("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},o("foreground","Overall foreground color. This color is only used if not overridden by a component.")),qC=(UC("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},o("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),UC("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},o("iconForeground","The default color for icons in the workbench.")),UC("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},o("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component."))),GC=UC("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},o("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),YC=UC("contrastActiveBorder",{light:null,dark:null,hc:qC},o("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),XC=(UC("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},o("textLinkForeground","Foreground color for links in text.")),UC("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},o("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover.")),UC("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:Lw.black},o("textCodeBlockBackground","Background color for code blocks in text.")),UC("widget.shadow",{dark:XS(Lw.black,.36),light:XS(Lw.black,.16),hc:null},o("widgetShadow","Shadow color of widgets such as find/replace inside the editor."))),ZC=UC("input.background",{dark:"#3C3C3C",light:Lw.white,hc:Lw.black},o("inputBoxBackground","Input box background.")),QC=UC("input.foreground",{dark:$C,light:$C,hc:$C},o("inputBoxForeground","Input box foreground.")),JC=UC("input.border",{dark:null,light:null,hc:GC},o("inputBoxBorder","Input box border.")),ey=(UC("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:GC},o("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),UC("inputOption.activeBackground",{dark:XS(qC,.4),light:XS(qC,.2),hc:Lw.transparent},o("inputOption.activeBackground","Background color of activated options in input fields.")),UC("inputOption.activeForeground",{dark:Lw.white,light:Lw.black,hc:null},o("inputOption.activeForeground","Foreground color of activated options in input fields.")),UC("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:Lw.black},o("inputValidationInfoBackground","Input validation background color for information severity."))),ty=UC("inputValidation.infoForeground",{dark:null,light:null,hc:null},o("inputValidationInfoForeground","Input validation foreground color for information severity.")),iy=UC("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:GC},o("inputValidationInfoBorder","Input validation border color for information severity.")),ny=UC("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:Lw.black},o("inputValidationWarningBackground","Input validation background color for warning severity.")),oy=UC("inputValidation.warningForeground",{dark:null,light:null,hc:null},o("inputValidationWarningForeground","Input validation foreground color for warning severity.")),sy=UC("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:GC},o("inputValidationWarningBorder","Input validation border color for warning severity.")),ry=UC("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:Lw.black},o("inputValidationErrorBackground","Input validation background color for error severity.")),ay=UC("inputValidation.errorForeground",{dark:null,light:null,hc:null},o("inputValidationErrorForeground","Input validation foreground color for error severity.")),ly=UC("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:GC},o("inputValidationErrorBorder","Input validation border color for error severity.")),cy=UC("dropdown.background",{dark:"#3C3C3C",light:Lw.white,hc:Lw.black},o("dropdownBackground","Dropdown background.")),dy=UC("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:Lw.white},o("dropdownForeground","Dropdown foreground.")),hy=UC("button.foreground",{dark:Lw.white,light:Lw.white,hc:Lw.white},o("buttonForeground","Button foreground color.")),uy=UC("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},o("buttonBackground","Button background color.")),gy=UC("button.hoverBackground",{dark:YS(uy,.2),light:GS(uy,.2),hc:null},o("buttonHoverBackground","Button background color when hovering.")),fy=UC("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:Lw.black},o("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),my=UC("badge.foreground",{dark:Lw.white,light:"#333",hc:Lw.white},o("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),py=UC("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},o("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),_y=UC("scrollbarSlider.background",{dark:Lw.fromHex("#797979").transparent(.4),light:Lw.fromHex("#646464").transparent(.4),hc:XS(GC,.6)},o("scrollbarSliderBackground","Scrollbar slider background color.")),by=UC("scrollbarSlider.hoverBackground",{dark:Lw.fromHex("#646464").transparent(.7),light:Lw.fromHex("#646464").transparent(.7),hc:XS(GC,.8)},o("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),vy=UC("scrollbarSlider.activeBackground",{dark:Lw.fromHex("#BFBFBF").transparent(.4),light:Lw.fromHex("#000000").transparent(.6),hc:GC},o("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),wy=UC("progressBar.background",{dark:Lw.fromHex("#0E70C0"),light:Lw.fromHex("#0E70C0"),hc:GC},o("progressBarBackground","Background color of the progress bar that can show for long running operations.")),Cy=UC("editorError.background",{dark:null,light:null,hc:null},o("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),yy=UC("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hc:null},o("editorError.foreground","Foreground color of error squigglies in the editor.")),Sy=UC("editorError.border",{dark:null,light:null,hc:Lw.fromHex("#E47777").transparent(.8)},o("errorBorder","Border color of error boxes in the editor.")),xy=UC("editorWarning.background",{dark:null,light:null,hc:null},o("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),ky=UC("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hc:null},o("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Ly=UC("editorWarning.border",{dark:null,light:null,hc:Lw.fromHex("#FFCC00").transparent(.8)},o("warningBorder","Border color of warning boxes in the editor.")),Ey=UC("editorInfo.background",{dark:null,light:null,hc:null},o("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Dy=UC("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},o("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Ny=UC("editorInfo.border",{dark:null,light:null,hc:Lw.fromHex("#3794FF").transparent(.8)},o("infoBorder","Border color of info boxes in the editor.")),Iy=UC("editorHint.foreground",{dark:Lw.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},o("editorHint.foreground","Foreground color of hint squigglies in the editor.")),Ty=UC("editorHint.border",{dark:null,light:null,hc:Lw.fromHex("#eeeeee").transparent(.8)},o("hintBorder","Border color of hint boxes in the editor.")),My=UC("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:Lw.black},o("editorBackground","Editor background color.")),Oy=UC("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:Lw.white},o("editorForeground","Editor default foreground color.")),Ay=UC("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},o("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Py=UC("editorWidget.foreground",{dark:$C,light:$C,hc:$C},o("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Ry=UC("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:GC},o("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.")),Fy=(UC("editorWidget.resizeBorder",{light:null,dark:null,hc:null},o("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.")),UC("quickInput.background",{dark:Ay,light:Ay,hc:Ay},o("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette."))),By=UC("quickInput.foreground",{dark:Py,light:Py,hc:Py},o("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Wy=UC("quickInputTitle.background",{dark:new Lw(new Sw(255,255,255,.105)),light:new Lw(new Sw(0,0,0,.06)),hc:"#000000"},o("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),Vy=UC("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:Lw.white},o("pickerGroupForeground","Quick picker color for grouping labels.")),zy=UC("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:Lw.white},o("pickerGroupBorder","Quick picker color for grouping borders.")),Hy=UC("keybindingLabel.background",{dark:new Lw(new Sw(128,128,128,.17)),light:new Lw(new Sw(221,221,221,.4)),hc:Lw.transparent},o("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Ky=UC("keybindingLabel.foreground",{dark:Lw.fromHex("#CCCCCC"),light:Lw.fromHex("#555555"),hc:Lw.white},o("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),jy=UC("keybindingLabel.border",{dark:new Lw(new Sw(51,51,51,.6)),light:new Lw(new Sw(204,204,204,.4)),hc:new Lw(new Sw(111,195,223))},o("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Uy=UC("keybindingLabel.bottomBorder",{dark:new Lw(new Sw(68,68,68,.6)),light:new Lw(new Sw(187,187,187,.4)),hc:new Lw(new Sw(111,195,223))},o("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),$y=UC("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},o("editorSelectionBackground","Color of the editor selection.")),qy=UC("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},o("editorSelectionForeground","Color of the selected text for high contrast.")),Gy=UC("editor.inactiveSelectionBackground",{light:XS($y,.5),dark:XS($y,.5),hc:XS($y,.5)},o("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),Yy=UC("editor.selectionHighlightBackground",{light:JS($y,My,.3,.6),dark:JS($y,My,.3,.6),hc:null},o("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),Xy=(UC("editor.selectionHighlightBorder",{light:null,dark:null,hc:YC},o("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),UC("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},o("editorFindMatch","Color of the current search match.")),UC("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},o("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0)),Zy=(UC("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},o("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),UC("editor.findMatchBorder",{light:null,dark:null,hc:YC},o("editorFindMatchBorder","Border color of the current search match.")),UC("editor.findMatchHighlightBorder",{light:null,dark:null,hc:YC},o("findMatchHighlightBorder","Border color of the other search matches.")),UC("editor.findRangeHighlightBorder",{dark:null,light:null,hc:XS(YC,.4)},o("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),UC("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},o("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),UC("editorHoverWidget.background",{light:Ay,dark:Ay,hc:Ay},o("hoverBackground","Background color of the editor hover."))),Qy=(UC("editorHoverWidget.foreground",{light:Py,dark:Py,hc:Py},o("hoverForeground","Foreground color of the editor hover.")),UC("editorHoverWidget.border",{light:Ry,dark:Ry,hc:Ry},o("hoverBorder","Border color of the editor hover.")),UC("editorHoverWidget.statusBarBackground",{dark:YS(Zy,.2),light:GS(Zy,.05),hc:Ay},o("statusBarBackground","Background color of the editor hover status bar.")),UC("editorLink.activeForeground",{dark:"#4E94CE",light:Lw.blue,hc:Lw.cyan},o("activeLinkForeground","Color of active links.")),UC("editorInlayHint.foreground",{dark:XS(my,.8),light:XS(my,.8),hc:my},o("editorInlayHintForeground","Foreground color of inline hints"))),Jy=UC("editorInlayHint.background",{dark:XS(fy,.6),light:XS(fy,.3),hc:fy},o("editorInlayHintBackground","Background color of inline hints")),eS=(UC("editorInlayHint.typeForeground",{dark:Qy,light:Qy,hc:Qy},o("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),UC("editorInlayHint.typeBackground",{dark:Jy,light:Jy,hc:Jy},o("editorInlayHintBackgroundTypes","Background color of inline hints for types")),UC("editorInlayHint.parameterForeground",{dark:Qy,light:Qy,hc:Qy},o("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),UC("editorInlayHint.parameterBackground",{dark:Jy,light:Jy,hc:Jy},o("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),UC("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},o("editorLightBulbForeground","The color used for the lightbulb actions icon.")),UC("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},o("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),new Lw(new Sw(155,185,85,.2))),tS=new Lw(new Sw(255,0,0,.2)),iS=UC("diffEditor.insertedTextBackground",{dark:eS,light:eS,hc:null},o("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),nS=UC("diffEditor.removedTextBackground",{dark:tS,light:tS,hc:null},o("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),oS=UC("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},o("diffEditorInsertedOutline","Outline color for the text that got inserted.")),sS=UC("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},o("diffEditorRemovedOutline","Outline color for text that got removed.")),rS=UC("diffEditor.border",{dark:null,light:null,hc:GC},o("diffEditorBorder","Border color between the two text editors.")),aS=UC("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hc:null},o("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),lS=UC("list.focusBackground",{dark:null,light:null,hc:null},o("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.")),cS=UC("list.focusForeground",{dark:null,light:null,hc:null},o("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.")),dS=UC("list.focusOutline",{dark:qC,light:qC,hc:YC},o("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.")),hS=UC("list.activeSelectionBackground",{dark:"#094771",light:"#0060C0",hc:null},o("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.")),uS=UC("list.activeSelectionForeground",{dark:Lw.white,light:Lw.white,hc:null},o("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.")),gS=UC("list.activeSelectionIconForeground",{dark:null,light:null,hc:null},o("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.")),fS=UC("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},o("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.")),mS=UC("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},o("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.")),pS=UC("list.inactiveSelectionIconForeground",{dark:null,light:null,hc:null},o("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.")),_S=UC("list.inactiveFocusBackground",{dark:null,light:null,hc:null},o("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.")),bS=UC("list.inactiveFocusOutline",{dark:null,light:null,hc:null},o("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.")),vS=UC("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},o("listHoverBackground","List/Tree background when hovering over items using the mouse.")),wS=UC("list.hoverForeground",{dark:null,light:null,hc:null},o("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),CS=UC("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},o("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),yS=UC("list.highlightForeground",{dark:"#18A3FF",light:"#0066BF",hc:qC},o("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),SS=(UC("list.focusHighlightForeground",{dark:yS,light:QS(hS,yS,"#9DDDFF"),hc:yS},o("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),UC("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:Lw.black},o("listFilterWidgetBackground","Background color of the type filter widget in lists and trees."))),xS=UC("listFilterWidget.outline",{dark:Lw.transparent,light:Lw.transparent,hc:"#f38518"},o("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),kS=UC("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:GC},o("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),LS=UC("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},o("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),ES=UC("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hc:null},o("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),DS=UC("quickInput.list.focusBackground",{dark:null,light:null,hc:null},"",void 0,o("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),NS=UC("quickInputList.focusForeground",{dark:uS,light:uS,hc:uS},o("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),IS=UC("quickInputList.focusIconForeground",{dark:gS,light:gS,hc:gS},o("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),TS=UC("quickInputList.focusBackground",{dark:ZS(DS,hS),light:ZS(DS,hS),hc:null},o("quickInput.listFocusBackground","Quick picker background color for the focused item.")),MS=UC("menu.border",{dark:null,light:null,hc:GC},o("menuBorder","Border color of menus.")),OS=UC("menu.foreground",{dark:dy,light:$C,hc:dy},o("menuForeground","Foreground color of menu items.")),AS=UC("menu.background",{dark:cy,light:cy,hc:cy},o("menuBackground","Background color of menu items.")),PS=UC("menu.selectionForeground",{dark:uS,light:uS,hc:uS},o("menuSelectionForeground","Foreground color of the selected menu item in menus.")),RS=UC("menu.selectionBackground",{dark:hS,light:hS,hc:hS},o("menuSelectionBackground","Background color of the selected menu item in menus.")),FS=UC("menu.selectionBorder",{dark:null,light:null,hc:YC},o("menuSelectionBorder","Border color of the selected menu item in menus.")),BS=UC("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:GC},o("menuSeparatorBackground","Color of a separator menu item in menus.")),WS=(UC("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hc:null},o("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse")),UC("editor.snippetTabstopHighlightBackground",{dark:new Lw(new Sw(124,124,124,.3)),light:new Lw(new Sw(10,50,100,.2)),hc:new Lw(new Sw(124,124,124,.3))},o("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),UC("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},o("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),UC("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},o("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),UC("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new Lw(new Sw(10,50,100,.5)),hc:"#525252"},o("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),UC("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},o("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),UC("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},o("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),UC("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},o("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),UC("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hc:"#ffffff"},o("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),UC("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},o("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0)),VS=UC("minimap.errorHighlight",{dark:new Lw(new Sw(255,18,18,.7)),light:new Lw(new Sw(255,18,18,.7)),hc:new Lw(new Sw(255,50,50,1))},o("minimapError","Minimap marker color for errors.")),zS=UC("minimap.warningHighlight",{dark:ky,light:ky,hc:Ly},o("overviewRuleWarning","Minimap marker color for warnings.")),HS=UC("minimap.background",{dark:null,light:null,hc:null},o("minimapBackground","Minimap background color.")),KS=UC("minimap.foregroundOpacity",{dark:Lw.fromHex("#000f"),light:Lw.fromHex("#000f"),hc:Lw.fromHex("#000f")},o("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),jS=UC("minimapSlider.background",{light:XS(_y,.5),dark:XS(_y,.5),hc:XS(_y,.5)},o("minimapSliderBackground","Minimap slider background color.")),US=UC("minimapSlider.hoverBackground",{light:XS(by,.5),dark:XS(by,.5),hc:XS(by,.5)},o("minimapSliderHoverBackground","Minimap slider background color when hovering.")),$S=UC("minimapSlider.activeBackground",{light:XS(vy,.5),dark:XS(vy,.5),hc:XS(vy,.5)},o("minimapSliderActiveBackground","Minimap slider background color when clicked on."));UC("problemsErrorIcon.foreground",{dark:yy,light:yy,hc:yy},o("problemsErrorIconForeground","The color used for the problems error icon.")),UC("problemsWarningIcon.foreground",{dark:ky,light:ky,hc:ky},o("problemsWarningIconForeground","The color used for the problems warning icon.")),UC("problemsInfoIcon.foreground",{dark:Dy,light:Dy,hc:Dy},o("problemsInfoIconForeground","The color used for the problems info icon."));function qS(e,t){var i,n,o;switch(e.op){case 0:return null===(i=ex(e.value,t))||void 0===i?void 0:i.darken(e.factor);case 1:return null===(n=ex(e.value,t))||void 0===n?void 0:n.lighten(e.factor);case 2:return null===(o=ex(e.value,t))||void 0===o?void 0:o.transparent(e.factor);case 3:for(const i of e.values){const e=ex(i,t);if(e)return e}return;case 5:return ex(t.defines(e.if)?e.then:e.else,t);case 4:const s=ex(e.value,t);if(!s)return;const r=ex(e.background,t);return r?s.isDarkerThan(r)?Lw.getLighterColor(s,r,e.factor).transparent(e.transparency):Lw.getDarkerColor(s,r,e.factor).transparent(e.transparency):s.transparent(e.factor*e.transparency);default:throw ha(e)}}function GS(e,t){return{op:0,value:e,factor:t}}function YS(e,t){return{op:1,value:e,factor:t}}function XS(e,t){return{op:2,value:e,factor:t}}function ZS(...e){return{op:3,values:e}}function QS(e,t,i){return{op:5,if:e,then:t,else:i}}function JS(e,t,i,n){return{op:4,value:e,background:t,factor:i,transparency:n}}function ex(e,t){if(null!==e)return"string"===typeof e?"#"===e[0]?Lw.fromHex(e):t.getColor(e):e instanceof Lw?e:"object"===typeof e?qS(e,t):void 0}const tx="vscode://schemas/workbench-colors";let ix=zd.as(Hd.JSONContribution);ix.registerSchema(tx,jC.getColorSchema());const nx=new so(()=>ix.notifySchemaChanged(tx),200);jC.onDidChangeSchema(()=>{nx.isScheduled()||nx.schedule()});const ox=UC("editor.lineHighlightBackground",{dark:null,light:null,hc:null},o("lineHighlight","Background color for the highlight of line at the cursor position.")),sx=UC("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},o("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),rx=UC("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},o("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),ax=UC("editor.rangeHighlightBorder",{dark:null,light:null,hc:YC},o("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),lx=UC("editor.symbolHighlightBackground",{dark:Xy,light:Xy,hc:null},o("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),cx=UC("editor.symbolHighlightBorder",{dark:null,light:null,hc:YC},o("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0),dx=UC("editorCursor.foreground",{dark:"#AEAFAD",light:Lw.black,hc:Lw.white},o("caret","Color of the editor cursor.")),hx=UC("editorCursor.background",null,o("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),ux=UC("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},o("editorWhitespaces","Color of whitespace characters in the editor.")),gx=UC("editorIndentGuide.background",{dark:ux,light:ux,hc:ux},o("editorIndentGuides","Color of the editor indentation guides.")),fx=UC("editorIndentGuide.activeBackground",{dark:ux,light:ux,hc:ux},o("editorActiveIndentGuide","Color of the active editor indentation guides.")),mx=UC("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:Lw.white},o("editorLineNumbers","Color of editor line numbers.")),px=UC("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:YC},o("editorActiveLineNumber","Color of editor active line number"),!1,o("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),_x=UC("editorLineNumber.activeForeground",{dark:px,light:px,hc:px},o("editorActiveLineNumber","Color of editor active line number")),bx=UC("editorRuler.foreground",{dark:"#5A5A5A",light:Lw.lightgrey,hc:Lw.white},o("editorRuler","Color of the editor rulers.")),vx=(UC("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hc:"#999999"},o("editorCodeLensForeground","Foreground color of editor CodeLens")),UC("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},o("editorBracketMatchBackground","Background color behind matching brackets")),UC("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:GC},o("editorBracketMatchBorder","Color for matching brackets boxes")),UC("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},o("editorOverviewRulerBorder","Color of the overview ruler border."))),wx=UC("editorOverviewRuler.background",null,o("editorOverviewRulerBackground","Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.")),Cx=UC("editorGutter.background",{dark:My,light:My,hc:My},o("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),yx=UC("editorUnnecessaryCode.border",{dark:null,light:null,hc:Lw.fromHex("#fff").transparent(.8)},o("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),Sx=UC("editorUnnecessaryCode.opacity",{dark:Lw.fromHex("#000a"),light:Lw.fromHex("#0007"),hc:null},o("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.")),xx=(UC("editorGhostText.border",{dark:null,light:null,hc:Lw.fromHex("#fff").transparent(.8)},o("editorGhostTextBorder","Border color of ghost text in the editor.")),UC("editorGhostText.foreground",{dark:Lw.fromHex("#ffffff56"),light:Lw.fromHex("#0007"),hc:null},o("editorGhostTextForeground","Foreground color of the ghost text in the editor.")),new Lw(new Sw(0,122,204,.6))),kx=(UC("editorOverviewRuler.rangeHighlightForeground",{dark:xx,light:xx,hc:xx},o("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),UC("editorOverviewRuler.errorForeground",{dark:new Lw(new Sw(255,18,18,.7)),light:new Lw(new Sw(255,18,18,.7)),hc:new Lw(new Sw(255,50,50,1))},o("overviewRuleError","Overview ruler marker color for errors."))),Lx=UC("editorOverviewRuler.warningForeground",{dark:ky,light:ky,hc:Ly},o("overviewRuleWarning","Overview ruler marker color for warnings.")),Ex=UC("editorOverviewRuler.infoForeground",{dark:Dy,light:Dy,hc:Ny},o("overviewRuleInfo","Overview ruler marker color for infos.")),Dx=UC("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hc:"#FFD700"},o("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Nx=UC("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hc:"#DA70D6"},o("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Ix=UC("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hc:"#87CEFA"},o("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Tx=UC("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Mx=UC("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Ox=UC("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Ax=UC("editorBracketHighlight.unexpectedBracket.foreground",{dark:new Lw(new Sw(255,18,18,.8)),light:new Lw(new Sw(255,18,18,.8)),hc:new Lw(new Sw(255,50,50,1))},o("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Px=UC("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Rx=UC("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Fx=UC("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Bx=UC("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Wx=UC("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Vx=UC("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),zx=UC("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Hx=UC("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Kx=UC("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),jx=UC("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Ux=UC("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),$x=UC("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},o("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));Qp((e,t)=>{const i=e.getColor(My);i&&t.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${i}; }`);const n=e.getColor(Oy);n&&t.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${n}; }`);const o=e.getColor(Cx);o&&t.addRule(`.monaco-editor .margin { background-color: ${o}; }`);const s=e.getColor(rx);s&&t.addRule(`.monaco-editor .rangeHighlight { background-color: ${s}; }`);const r=e.getColor(ax);r&&t.addRule(`.monaco-editor .rangeHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${r}; }`);const a=e.getColor(lx);a&&t.addRule(`.monaco-editor .symbolHighlight { background-color: ${a}; }`);const l=e.getColor(cx);l&&t.addRule(`.monaco-editor .symbolHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${l}; }`);const c=e.getColor(ux);c&&(t.addRule(`.monaco-editor .mtkw { color: ${c} !important; }`),t.addRule(`.monaco-editor .mtkz { color: ${c} !important; }`))});class qx extends Ye{constructor(e){super(),this.textModel=e,this.colorProvider=new Gx,this.onDidChangeEmitter=new rt,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.onDidChangeOptions(t=>{this.colorizationOptions=e.getOptions().bracketPairColorizationOptions})),this._register(e.bracketPairs.onDidChange(e=>{this.onDidChangeEmitter.fire()}))}getDecorationsInRange(e,t,i){if(void 0===t)return[];if(!this.colorizationOptions.enabled)return[];const n=new Array,o=this.textModel.bracketPairs.getBracketsInRange(e);for(const s of o)n.push({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s)},ownerId:0,range:s.range});return n}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new Ci(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Gx{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(e.nestingLevel)}getInlineClassNameOfLevel(e){return"bracket-highlighting-"+e%30}}Qp((e,t)=>{const i=[Dx,Nx,Ix,Tx,Mx,Ox],n=new Gx;t.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${e.getColor(Ax)}; }`);let o=i.map(t=>e.getColor(t)).filter(e=>!!e).filter(e=>!e.isTransparent());for(let s=0;s<30;s++){const e=o[s%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(s)} { color: ${e}; }`)}});var Yx=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Xx=function(e,t){return function(i,n){t(i,n,e)}};function Zx(){return new lw}function Qx(e){const t=Zx();return t.acceptChunk(e),t.finish()}function Jx(e,t){const i="string"===typeof e?Qx(e):e;return i.create(t)}let ek=0;const tk=999,ik=1e4;class nk{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;let e=[],t=0,i=0;do{let 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("")}while(1)}}const ok=()=>{throw new Error("Invalid change accessor")};class sk{constructor(){this._searchCanceledBrand=void 0}}function rk(e){return e instanceof sk?null:e}sk.INSTANCE=new sk;let ak=class e extends Ye{constructor(t,i,n,o=null,s,r,a){super(),this._undoRedoService=s,this._modeService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new rt),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Ck(e=>this.handleBeforeFireDecorationsChangedEvent(e))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeLanguage=this._register(new rt),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new rt),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new rt),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidChangeOptions=this._register(new rt),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new rt),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeContentOrInjectedText=this._register(new rt),this.onDidChangeContentOrInjectedText=this._onDidChangeContentOrInjectedText.event,this._eventEmitter=this._register(new yk),this._backgroundTokenizationState=0,this._onBackgroundTokenizationStateChanged=this._register(new rt),this.onBackgroundTokenizationStateChanged=this._onBackgroundTokenizationStateChanged.event,this._register(this._eventEmitter.fastEvent(e=>{this._onDidChangeContentOrInjectedText.fire(e.rawContentChangedEvent)})),ek++,this.id="$model"+ek,this.isForSimpleWidget=i.isForSimpleWidget,this._associatedResource="undefined"===typeof o||null===o?ci.parse("inmemory://model/"+ek):o,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=Jx(t,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=e.resolveOptions(this._buffer,i);const d=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new Ci(1,1,d,this._buffer.getLineLength(d)+1),0);i.largeFileOptimizations?this._isTooLargeForTokenization=h>e.LARGE_FILE_SIZE_THRESHOLD||d>e.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=h>e.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageId=n||Dc,this._languageRegistryListener=this._languageConfigurationService.onDidChange(e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}),this._instanceId=_r(ek),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new uk,this._commandManager=new Nb(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new sw(this._modeService.languageIdCodec),this._tokens2=new ow(this._modeService.languageIdCodec),this._tokenization=new vw(this,this._modeService.languageIdCodec),this._bracketPairColorizer=this._register(new RC(this,this._languageConfigurationService)),this._decorationProvider=this._register(new qx(this)),this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()}))}static resolveOptions(e,t){if(t.detectIndentation){const i=Mb(e,t.tabSize,t.insertSpaces);return new ja({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new ja({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}onDidChangeContentFast(e){return this._eventEmitter.fastEvent(t=>e(t.contentChangedEvent))}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}get bracketPairs(){return this._bracketPairColorizer}get backgroundTokenizationState(){return this._backgroundTokenizationState}handleTokenizationProgress(e){if(2===this._backgroundTokenizationState)return;const t=e?2:1;this._backgroundTokenizationState!==t&&(this._backgroundTokenizationState=t,this._onBackgroundTokenizationStateChanged.fire())}dispose(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this._isDisposing=!1;const e=new rw([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._bracketPairColorizer.handleContentChanged(t),this._isDisposing||this._eventEmitter.fire(new _w(e,t))}setValue(e){if(this._assertNotDisposed(),null===e)return;const{textBuffer:t,disposable:i}=Jx(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,s,r){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:r}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokens.flush(),this._tokens2.flush(),this._decorations=Object.create(null),this._decorationsTree=new uk,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new mw([new cw],this._versionId,!1,!1),this._createContentChanged2(new Ci(1,1,o,s),0,n,this.getValue(),!1,!1,!0))}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),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new mw([new fw],this._versionId,!1,!1),this._createContentChanged2(new Ci(1,1,o,s),0,n,this.getValue(),!1,!1,!1))}_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],o=n.range,s=n.cachedAbsoluteStart-n.start,r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);n.cachedAbsoluteStart=r,n.cachedAbsoluteEnd=a,n.cachedVersionId=e,n.start=r-s,n.end=a-s,cv(n)}}onBeforeAttached(){this._attachedEditorCount++,1===this._attachedEditorCount&&this._onDidChangeAttached.fire(void 0)}onBeforeDetached(){this._attachedEditorCount--,0===this._attachedEditorCount&&this._onDidChangeAttached.fire(void 0)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}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>=ik?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();let t="undefined"!==typeof e.tabSize?e.tabSize:this._options.tabSize,i="undefined"!==typeof e.indentSize?e.indentSize:this._options.indentSize,n="undefined"!==typeof e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o="undefined"!==typeof e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s="undefined"!==typeof e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,r=new ja({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(r))return;let a=this._options.createChangeEvent(r);this._options=r,this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();let i=Mb(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}static _normalizeIndentationFromWhitespace(e,t,i){let n=0;for(let s=0;s<e.length;s++)"\t"===e.charAt(s)?n+=t:n++;let o="";if(!i){let e=Math.floor(n/t);n%=t;for(let t=0;t<e;t++)o+="\t"}for(let s=0;s<n;s++)o+=" ";return o}static normalizeIndentation(t,i,n){let o=Bs(t);return-1===o&&(o=t.length),e._normalizeIndentationFromWhitespace(t.substring(0,o),i,n)+t.substring(o)}normalizeIndentation(t){return this._assertNotDisposed(),e.normalizeIndentation(t,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(dr.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();let t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();let 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){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new nk(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 Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),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 Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor("number"!==typeof i||isNaN(i)?1:i),s=Math.floor("number"!==typeof n||isNaN(n)?1:n);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const e=this.getLineMaxColumn(o);s>=e&&(s=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!==typeof r||isNaN(r)?1:r),c=Math.floor("number"!==typeof a||isNaN(a)?1:a);if(l<1)l=1,c=1;else if(l>t)l=t,c=this.getLineMaxColumn(l);else if(c<=1)c=1;else{const e=this.getLineMaxColumn(l);c>=e&&(c=e)}return i===o&&n===s&&r===l&&a===c&&e instanceof Ci&&!(e instanceof yi)?e:new Ci(o,s,l,c)}_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;const n=this._buffer.getLineCount();if(e>n)return!1;if(1===t)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(1===i){const i=this._buffer.getLineCharCode(e,t-2);if(Zs(i))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor("number"!==typeof e||isNaN(e)?1:e),o=Math.floor("number"!==typeof t||isNaN(t)?1:t),s=this._buffer.getLineCount();if(n<1)return new wi(1,1);if(n>s)return new wi(s,this.getLineMaxColumn(s));if(o<=1)return new wi(n,1);const r=this.getLineMaxColumn(n);if(o>=r)return new wi(n,r);if(1===i){const e=this._buffer.getLineCharCode(n,o-2);if(Zs(e))return new wi(n,o-1)}return new wi(n,o)}validatePosition(e){const t=1;return this._assertNotDisposed(),e instanceof wi&&this._isValidPosition(e.lineNumber,e.column,t)?e:this._validatePosition(e.lineNumber,e.column,t)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(o,s,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,r=Zs(e),a=Zs(t);return!r&&!a}return!0}validateRange(e){const t=1;if(this._assertNotDisposed(),e instanceof Ci&&!(e instanceof yi)&&this._isValidRange(e,t))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,s=i.column,r=n.lineNumber,a=n.column;if(1===t){const e=s>1?this._buffer.getLineCharCode(o,s-2):0,t=a>1&&a<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,a-2):0,i=Zs(e),n=Zs(t);return i||n?o===r&&s===a?new Ci(o,s-1,r,a-1):i&&n?new Ci(o,s-1,r,a+1):i?new Ci(o,s-1,r,a):new Ci(o,s,r,a+1):new Ci(o,s,r,a)}return new Ci(o,s,r,a)}modifyPosition(e,t){this._assertNotDisposed();let 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 Ci(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,s,r=tk){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every(e=>Ci.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 c;if(l.push(a.reduce((e,t)=>Ci.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t))),!i&&e.indexOf("\n")<0){const t=new Nv(e,i,n,o),a=t.parseSearchRequest();if(!a)return[];c=e=>this.findMatchesLineByLine(e,a,s,r)}else c=t=>Av.findMatches(this,new Nv(e,i,n,o),t,s,r);return l.map(c).reduce((e,t)=>e.concat(t),[])}findNextMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new Nv(e,i,n,o),a=t.parseSearchRequest();if(!a)return null;const l=this.getLineCount();let c=new Ci(r.lineNumber,r.column,l,this.getLineMaxColumn(l)),d=this.findMatchesLineByLine(c,a,s,1);return Av.findNextMatch(this,new Nv(e,i,n,o),r,s),d.length>0?d[0]:(c=new Ci(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),d=this.findMatchesLineByLine(c,a,s,1),d.length>0?d[0]:null)}return Av.findNextMatch(this,new Nv(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return Av.findPreviousMatch(this,new Nv(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){const t="\n"===this.getEOL()?0:1;if(t!==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 Ga?e:new Ga(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){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){let i=t.map(e=>({range:this.validateRange(e.range),text:e.text})),n=!0;if(e)for(let t=0,o=e.length;t<o;t++){let o=e[t],s=!1;for(let e=0,t=i.length;e<t;e++){let t=i[e].range,n=t.startLineNumber>o.endLineNumber,r=o.startLineNumber>t.endLineNumber;if(!n&&!r){s=!0;break}}if(!s){n=!1;break}}if(n)for(let e=0,o=this._trimAutoWhitespaceLines.length;e<o;e++){let n=this._trimAutoWhitespaceLines[e],o=this.getLineMaxColumn(n),s=!0;for(let e=0,t=i.length;e<t;e++){let t=i[e].range,r=i[e].text;if(!(n<t.startLineNumber||n>t.endLineNumber)&&(!(n===t.startLineNumber&&t.startColumn===o&&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)))){s=!1;break}}if(s){const e=new Ci(n,1,n,o);t.push(new Ga(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)}_applyUndo(e,t,i,n){const o=e.map(e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new Ci(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new Ci(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),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),o=this._buffer.getLineCount(),s=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==s.length){for(let i=0,n=s.length;i<n;i++){const e=s[i],[t,n,o]=Yv(e.text);this._tokens.acceptEdit(e.range,t,n),this._tokens2.acceptEdit(e.range,t,n,o,e.text.length>0?e.text.charCodeAt(0):0),this._decorationsTree.acceptReplace(e.rangeOffset,e.rangeLength,e.text.length,e.forceMoveMarkers)}let e=[];this._increaseVersionId();let t=i;for(let i=0,n=s.length;i<n;i++){const n=s[i],[r]=Yv(n.text);this._onDidChangeDecorations.fire();const a=n.range.startLineNumber,l=n.range.endLineNumber,c=l-a,d=r,h=Math.min(c,d),u=d-c,g=o-t-u+a,f=g,m=g+d,p=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new wi(f,1)),this.getOffsetAt(new wi(m,this.getLineMaxColumn(m))),0),_=dw.fromDecorations(p),b=new Bu(_);for(let t=h;t>=0;t--){const i=a+t,n=g+t;b.takeFromEndWhile(e=>e.lineNumber>n);const o=b.takeFromEndWhile(e=>e.lineNumber===n);e.push(new hw(i,this.getLineContent(n),o))}if(h<c){const t=a+h;e.push(new uw(t+1,l))}if(h<d){const i=new Bu(_),n=a+h,s=d-h,r=o-t-s+n+1;let l=[],c=[];for(let e=0;e<s;e++){let t=r+e;c[e]=this.getLineContent(t),i.takeWhile(e=>e.lineNumber<t),l[e]=i.takeWhile(e=>e.lineNumber===t)}e.push(new gw(n+1,a+d,c,l))}t+=u}this._emitContentChangedEvent(new mw(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),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=[...e],i=t.map(e=>new hw(e,this.getLineContent(e),this._getInjectedTextInLine(e)));this._onDidChangeContentOrInjectedText.fire(new pw(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){let 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,wk(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)},n=null;try{n=t(i)}catch(o){xe(o)}return i.addDecoration=ok,i.changeDecoration=ok,i.changeDecorationOptions=ok,i.removeDecoration=ok,i.deltaDecorations=ok,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_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:vk[i]}])[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),s,r,o),n.setOptions(vk[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;i<n;i++){const e=t[i];this._decorationsTree.delete(e),delete this._decorations[e.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){let o=this.getLineCount(),s=Math.min(o,Math.max(1,e)),r=Math.min(o,Math.max(1,t)),a=this.getLineMaxColumn(r);const l=new Ci(s,1,r,a),c=this._getDecorationsInRange(l,i,n);return c.push(...this._decorationProvider.getDecorationsInRange(l,i,n)),c}getDecorationsInRange(e,t=0,i=!1){let n=this.validateRange(e);const o=this._getDecorationsInRange(n,t,i);return o.push(...this._decorationProvider.getDecorationsInRange(n,t,i)),o}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0)}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 dw.fromDecorations(n).filter(t=>t.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}_getDecorationsInRange(e,t,i){const n=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,n,o,t,i)}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),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),s=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,s,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),o=!(!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)}n!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i){const n=this.getVersionId(),o=t.length;let s=0;const r=i.length;let a=0,l=new Array(r);while(s<o||a<r){let c=null;if(s<o){do{c=this._decorations[t[s++]]}while(!c&&s<o);if(c){if(c.options.after){const e=this._decorationsTree.getNodeRange(this,c);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(c.options.before){const e=this._decorationsTree.getNodeRange(this,c);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}this._decorationsTree.delete(c),this._onDidChangeDecorations.checkAffectedAndFire(c.options)}}if(a<r){if(!c){const e=++this._lastDecorationId,t=`${this._instanceId};${e}`;c=new Kb(t,0,0),this._decorations[t]=c}const t=i[a],o=this._validateRangeRelaxedNoAllocations(t.range),s=wk(t.options),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),d=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);c.ownerId=e,c.reset(n,r,d,o),c.setOptions(s),c.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),c.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber),this._onDidChangeDecorations.checkAffectedAndFire(s),this._decorationsTree.insert(c),l[a]=c.id,a++}else c&&delete this._decorations[c.id]}return l}setTokens(e,t=!1){if(0!==e.length){let t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];let o=0,s=0,r=!1;for(let e=0,t=n.tokens.length;e<t;e++){const t=n.startLineNumber+e;if(r)this._tokens.setTokens(this._languageId,t-1,this._buffer.getLineLength(t),n.tokens[e],!1),s=t;else{const i=this._tokens.setTokens(this._languageId,t-1,this._buffer.getLineLength(t),n.tokens[e],!0);i&&(r=!0,o=t,s=t)}}r&&t.push({fromLineNumber:o,toLineNumber:s})}t.length>0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:t})}this.handleTokenizationProgress(t)}setSemanticTokens(e,t){this._tokens2.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]})}hasCompleteSemanticTokens(){return this._tokens2.isComplete()}hasSomeSemanticTokens(){return!this._tokens2.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._tokens2.setPartial(e,t);this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._buffer.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._buffer.getLineCount()}]})}_emitModelTokensChangedEvent(e){this._isDisposing||this._onDidChangeTokens.fire(e)}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this.getLineContent(e),i=this._tokens.getTokens(this._languageId,e-1,t);return this._tokens2.addSemanticTokens(e,i)}getLanguageId(){return this._languageId}setMode(e){if(this._languageId===e)return;let t={oldLanguage:this._languageId,newLanguage:e};this._languageId=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}getLanguageIdAtPosition(e,t){const i=this.validatePosition(new wi(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}getWordAtPosition(t){this._assertNotDisposed();const i=this.validatePosition(t),n=this.getLineContent(i.lineNumber),o=this._getLineTokens(i.lineNumber),s=o.findTokenIndexAtOffset(i.column-1),[r,a]=e._findLanguageBoundaries(o,s),l=h(i.column,this.getLanguageConfiguration(o.getLanguageId(s)).getWordDefinition(),n.substring(r,a),r);if(l&&l.startColumn<=t.column&&t.column<=l.endColumn)return l;if(s>0&&r===i.column-1){const[r,a]=e._findLanguageBoundaries(o,s-1),l=h(i.column,this.getLanguageConfiguration(o.getLanguageId(s-1)).getWordDefinition(),n.substring(r,a),r);if(l&&l.startColumn<=t.column&&t.column<=l.endColumn)return l}return null}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 o=e.getLineContent().length;for(let s=t,r=e.getCount();s<r&&e.getLanguageId(s)===i;s++)o=e.getEndOffset(s);return[n,o]}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}}findMatchingBracketUp(e,t){let i=e.toLowerCase(),n=this.validatePosition(t),o=this._getLineTokens(n.lineNumber),s=o.getLanguageId(o.findTokenIndexAtOffset(n.column-1)),r=this.getLanguageConfiguration(s).brackets;if(!r)return null;let a=r.textIsBracket[i];return a?rk(this._findMatchingBracketUp(a,n,null)):null}matchBracket(e){return this._matchBracket(this.validatePosition(e))}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),s=t.getLanguageId(n);let r=Math.max(0,e.column-1-i.maxBracketLength);for(let l=n-1;l>=0;l--){const e=t.getEndOffset(l);if(e<=r)break;if(rd(t.getStandardTokenType(l))||t.getLanguageId(l)!==s){r=e;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=n+1;l<o;l++){const e=t.getStartOffset(l);if(e>=a)break;if(rd(t.getStandardTokenType(l))||t.getLanguageId(l)!==s){a=e;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e){const t=e.lineNumber,i=this._getLineTokens(t),n=this._buffer.getLineContent(t),o=i.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const s=this.getLanguageConfiguration(i.getLanguageId(o)).brackets;if(s&&!rd(i.getStandardTokenType(o))){let{searchStartOffset:r,searchEndOffset:a}=this._establishBracketSearchOffsets(e,i,s,o),l=null;while(1){const i=Pd.findNextBracketInRange(s.forwardRegex,t,n,r,a);if(!i)break;if(i.startColumn<=e.column&&e.column<=i.endColumn){const e=n.substring(i.startColumn-1,i.endColumn-1).toLowerCase(),t=this._matchFoundBracket(i,s.textIsBracket[e],s.textIsOpenBracket[e],null);if(t){if(t instanceof sk)return null;l=t}}r=i.endColumn-1}if(l)return l}if(o>0&&i.getStartOffset(o)===e.column-1){const s=o-1,r=this.getLanguageConfiguration(i.getLanguageId(s)).brackets;if(r&&!rd(i.getStandardTokenType(s))){let{searchStartOffset:o,searchEndOffset:a}=this._establishBracketSearchOffsets(e,i,r,s);const l=Pd.findPrevBracketInRange(r.reversedRegex,t,n,o,a);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn){const e=n.substring(l.startColumn-1,l.endColumn-1).toLowerCase(),t=this._matchFoundBracket(l,r.textIsBracket[e],r.textIsOpenBracket[e],null);if(t)return t instanceof sk?null:t}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof sk?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let s=-1,r=0;const a=(t,n,a,l)=>{while(1){if(i&&++r%100===0&&!i())return sk.INSTANCE;const c=Pd.findPrevBracketInRange(o,t,n,a,l);if(!c)break;const d=n.substring(c.startColumn-1,c.endColumn-1).toLowerCase();if(e.isOpen(d)?s++:e.isClose(d)&&s--,0===s)return c;l=c.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const e=this._getLineTokens(l),i=e.getCount(),o=this._buffer.getLineContent(l);let s=i-1,r=o.length,c=o.length;l===t.lineNumber&&(s=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,c=t.column-1);let d=!0;for(;s>=0;s--){const t=e.getLanguageId(s)===n&&!rd(e.getStandardTokenType(s));if(t)d?r=e.getStartOffset(s):(r=e.getStartOffset(s),c=e.getEndOffset(s));else if(d&&r!==c){const e=a(l,o,r,c);if(e)return e}d=t}if(d&&r!==c){const e=a(l,o,r,c);if(e)return e}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let s=1,r=0;const a=(t,n,a,l)=>{while(1){if(i&&++r%100===0&&!i())return sk.INSTANCE;const c=Pd.findNextBracketInRange(o,t,n,a,l);if(!c)break;const d=n.substring(c.startColumn-1,c.endColumn-1).toLowerCase();if(e.isOpen(d)?s++:e.isClose(d)&&s--,0===s)return c;a=c.endColumn-1}return null},l=this.getLineCount();for(let c=t.lineNumber;c<=l;c++){const e=this._getLineTokens(c),i=e.getCount(),o=this._buffer.getLineContent(c);let s=0,r=0,l=0;c===t.lineNumber&&(s=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,l=t.column-1);let d=!0;for(;s<i;s++){const t=e.getLanguageId(s)===n&&!rd(e.getStandardTokenType(s));if(t)d||(r=e.getStartOffset(s)),l=e.getEndOffset(s);else if(d&&r!==l){const e=a(c,o,r,l);if(e)return e}d=t}if(d&&r!==l){const e=a(c,o,r,l);if(e)return e}}return null}findPrevBracket(e){const t=this.validatePosition(e);let i=null,n=null;for(let o=t.lineNumber;o>=1;o--){const e=this._getLineTokens(o),s=e.getCount(),r=this._buffer.getLineContent(o);let a=s-1,l=r.length,c=r.length;if(o===t.lineNumber){a=e.findTokenIndexAtOffset(t.column-1),l=t.column-1,c=t.column-1;const o=e.getLanguageId(a);i!==o&&(i=o,n=this.getLanguageConfiguration(i).brackets)}let d=!0;for(;a>=0;a--){const t=e.getLanguageId(a);if(i!==t){if(n&&d&&l!==c){const e=Pd.findPrevBracketInRange(n.reversedRegex,o,r,l,c);if(e)return this._toFoundBracket(n,e);d=!1}i=t,n=this.getLanguageConfiguration(i).brackets}const s=!!n&&!rd(e.getStandardTokenType(a));if(s)d?l=e.getStartOffset(a):(l=e.getStartOffset(a),c=e.getEndOffset(a));else if(n&&d&&l!==c){const e=Pd.findPrevBracketInRange(n.reversedRegex,o,r,l,c);if(e)return this._toFoundBracket(n,e)}d=s}if(n&&d&&l!==c){const e=Pd.findPrevBracketInRange(n.reversedRegex,o,r,l,c);if(e)return this._toFoundBracket(n,e)}}return null}findNextBracket(e){const t=this.validatePosition(e),i=this.getLineCount();let n=null,o=null;for(let s=t.lineNumber;s<=i;s++){const e=this._getLineTokens(s),i=e.getCount(),r=this._buffer.getLineContent(s);let a=0,l=0,c=0;if(s===t.lineNumber){a=e.findTokenIndexAtOffset(t.column-1),l=t.column-1,c=t.column-1;const i=e.getLanguageId(a);n!==i&&(n=i,o=this.getLanguageConfiguration(n).brackets)}let d=!0;for(;a<i;a++){const t=e.getLanguageId(a);if(n!==t){if(o&&d&&l!==c){const e=Pd.findNextBracketInRange(o.forwardRegex,s,r,l,c);if(e)return this._toFoundBracket(o,e);d=!1}n=t,o=this.getLanguageConfiguration(n).brackets}const i=!!o&&!rd(e.getStandardTokenType(a));if(i)d||(l=e.getStartOffset(a)),c=e.getEndOffset(a);else if(o&&d&&l!==c){const e=Pd.findNextBracketInRange(o.forwardRegex,s,r,l,c);if(e)return this._toFoundBracket(o,e)}d=i}if(o&&d&&l!==c){const e=Pd.findNextBracketInRange(o.forwardRegex,s,r,l,c);if(e)return this._toFoundBracket(o,e)}}return null}findEnclosingBrackets(e,t){let i;if("undefined"===typeof t)i=null;else{const e=Date.now();i=()=>Date.now()-e<=t}const n=this.validatePosition(e),o=this.getLineCount(),s=new Map;let r=[];const a=(e,t)=>{if(!s.has(e)){let i=[];for(let e=0,n=t?t.brackets.length:0;e<n;e++)i[e]=0;s.set(e,i)}r=s.get(e)};let l=0;const c=(e,t,n,o,s)=>{while(1){if(i&&++l%100===0&&!i())return sk.INSTANCE;const a=Pd.findNextBracketInRange(e.forwardRegex,t,n,o,s);if(!a)break;const c=n.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),d=e.textIsBracket[c];if(d&&(d.isOpen(c)?r[d.index]++:d.isClose(c)&&r[d.index]--,-1===r[d.index]))return this._matchFoundBracket(a,d,!1,i);o=a.endColumn-1}return null};let d=null,h=null;for(let u=n.lineNumber;u<=o;u++){const e=this._getLineTokens(u),t=e.getCount(),i=this._buffer.getLineContent(u);let o=0,s=0,r=0;if(u===n.lineNumber){o=e.findTokenIndexAtOffset(n.column-1),s=n.column-1,r=n.column-1;const t=e.getLanguageId(o);d!==t&&(d=t,h=this.getLanguageConfiguration(d).brackets,a(d,h))}let l=!0;for(;o<t;o++){const t=e.getLanguageId(o);if(d!==t){if(h&&l&&s!==r){const e=c(h,u,i,s,r);if(e)return rk(e);l=!1}d=t,h=this.getLanguageConfiguration(d).brackets,a(d,h)}const n=!!h&&!rd(e.getStandardTokenType(o));if(n)l||(s=e.getStartOffset(o)),r=e.getEndOffset(o);else if(h&&l&&s!==r){const e=c(h,u,i,s,r);if(e)return rk(e)}l=n}if(h&&l&&s!==r){const e=c(h,u,i,s,r);if(e)return rk(e)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.getValueInRange(t);i=i.toLowerCase();let n=e.textIsBracket[i];return n?{range:t,open:n.open,close:n.close,isOpen:e.textIsOpenBracket[i]}:null}static computeIndentLevel(e,t){let i=0,n=0,o=e.length;while(n<o){let o=e.charCodeAt(n);if(32===o)i++;else{if(9!==o)break;i=i-i%t+t}n++}return n===o?-1:i}_computeIndentLevel(t){return e.computeIndentLevel(this._buffer.getLineContent(t+1),this._options.tabSize)}getActiveIndentGuide(e,t,i){this._assertNotDisposed();const n=this.getLineCount();if(e<1||e>n)throw new Error("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this._languageId).foldingRules,s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,c=-1;const d=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,c=-1;for(let t=e;t<n;t++){let e=this._computeIndentLevel(t);if(e>=0){l=t,c=e;break}}}};let h=-2,u=-1,g=-2,f=-1;const m=e=>{if(-2===h){h=-1,u=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){h=t,u=e;break}}}if(-1!==g&&(-2===g||g<e-1)){g=-1,f=-1;for(let t=e;t<n;t++){let e=this._computeIndentLevel(t);if(e>=0){g=t,f=e;break}}}};let p=0,_=!0,b=0,v=!0,w=0,C=0;for(let y=0;_||v;y++){const o=e-y,r=e+y;y>1&&(o<1||o<t)&&(_=!1),y>1&&(r>n||r>i)&&(v=!1),y>5e4&&(_=!1,v=!1);let g=-1;if(_){const e=this._computeIndentLevel(o-1);e>=0?(l=o-1,c=e,g=Math.ceil(e/this._options.indentSize)):(d(o),g=this._getIndentLevelForWhitespaceLine(s,a,c))}let S=-1;if(v){const e=this._computeIndentLevel(r-1);e>=0?(h=r-1,u=e,S=Math.ceil(e/this._options.indentSize)):(m(r),S=this._getIndentLevelForWhitespaceLine(s,u,f))}if(0!==y){if(1===y){if(r<=n&&S>=0&&C+1===S){_=!1,p=r,b=r,w=S;continue}if(o>=1&&g>=0&&g-1===C){v=!1,p=o,b=o,w=g;continue}if(p=e,b=e,w=C,0===w)return{startLineNumber:p,endLineNumber:b,indent:w}}_&&(g>=w?p=o:_=!1),v&&(S>=w?b=r:v=!1)}else C=g}return{startLineNumber:p,endLineNumber:b,indent:w}}getLinesBracketGuides(e,t,i,n){var o,s,r,a,l;const c=[],d=this._bracketPairColorizer.getBracketPairsInRangeWithMinIndentation(new Ci(e,1,t,this.getLineMaxColumn(t)));let h=void 0;if(i&&d.length>0){const n=e<=i.lineNumber&&i.lineNumber<=t?d.filter(e=>e.range.containsPosition(i)):this._bracketPairColorizer.getBracketPairsInRange(Ci.fromPositions(i));h=null===(o=Du(n,e=>e.range.startLineNumber!==e.range.endLineNumber))||void 0===o?void 0:o.range}const u=new Bu(d),g=new Array,f=new Array,m=new ck;for(let p=e;p<=t;p++){let e=new Array;f.length>0&&(e=e.concat(f),f.length=0),c.push(e);for(const i of u.takeWhile(e=>e.openingBracketRange.startLineNumber<=p)||[]){if(i.range.startLineNumber===i.range.endLineNumber)continue;const e=Math.min(this.getVisibleColumnFromPosition(i.openingBracketRange.getStartPosition()),this.getVisibleColumnFromPosition(null!==(r=null===(s=i.closingBracketRange)||void 0===s?void 0:s.getStartPosition())&&void 0!==r?r:i.range.getEndPosition()),i.minVisibleColumnIndentation+1);let t=!1;if(i.closingBracketRange){const e=Bs(this.getLineContent(i.closingBracketRange.startLineNumber));e<i.closingBracketRange.startColumn-1&&(t=!0)}const n=i.openingBracketRange.getStartPosition(),o=null!==(l=null===(a=i.closingBracketRange)||void 0===a?void 0:a.getStartPosition())&&void 0!==l?l:i.range.getEndPosition();void 0===i.closingBracketRange?g[i.nestingLevel]=null:g[i.nestingLevel]={nestingLevel:i.nestingLevel,guideVisibleColumn:e,start:n,visibleStartColumn:this.getVisibleColumnFromPosition(n),end:o,visibleEndColumn:this.getVisibleColumnFromPosition(o),bracketPair:i,renderHorizontalEndLineAtTheBottom:t}}for(const i of g){if(!i)continue;const t=h&&i.bracketPair.range.equalsRange(h),o=m.getInlineClassNameOfLevel(i.nestingLevel)+(n.highlightActive&&t?" "+m.activeClassName:"");(t&&n.horizontalGuides!==Ka.Disabled||n.includeInactive&&n.horizontalGuides===Ka.Enabled)&&(i.start.lineNumber===p&&i.guideVisibleColumn<i.visibleStartColumn&&e.push(new $a(i.guideVisibleColumn,o,new qa(!1,i.start.column))),i.end.lineNumber===p+1&&i.guideVisibleColumn<i.visibleEndColumn&&f.push(new $a(i.guideVisibleColumn,o,new qa(!i.renderHorizontalEndLineAtTheBottom,i.end.column))))}let t=Number.MAX_SAFE_INTEGER;for(let i=g.length-1;i>=0;i--){const o=g[i];if(!o)continue;const s=n.highlightActive&&h&&o.bracketPair.range.equalsRange(h),r=m.getInlineClassNameOfLevel(o.nestingLevel)+(s?" "+m.activeClassName:"");(s||n.includeInactive)&&o.renderHorizontalEndLineAtTheBottom&&o.end.lineNumber===p+1&&f.push(new $a(o.guideVisibleColumn,r,null)),o.end.lineNumber<=p||o.start.lineNumber>=p||(o.guideVisibleColumn>=t&&!s||(t=o.guideVisibleColumn,(s||n.includeInactive)&&e.push(new $a(o.guideVisibleColumn,r,null))))}e.sort((e,t)=>e.visibleColumn-t.visibleColumn)}return c}getVisibleColumnFromPosition(e){return tC.visibleColumnFromColumn(this.getLineContent(e.lineNumber),e.column,this._options.tabSize)+1}getLinesIndentGuides(e,t){this._assertNotDisposed();const i=this.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.getLanguageConfiguration(this._languageId).foldingRules,o=Boolean(n&&n.offSide);let s=new Array(t-e+1),r=-2,a=-1,l=-2,c=-1;for(let d=e;d<=t;d++){let t=d-e;const n=this._computeIndentLevel(d-1);if(n>=0)r=d-1,a=n,s[t]=Math.ceil(n/this._options.indentSize);else{if(-2===r){r=-1,a=-1;for(let e=d-2;e>=0;e--){let t=this._computeIndentLevel(e);if(t>=0){r=e,a=t;break}}}if(-1!==l&&(-2===l||l<d-1)){l=-1,c=-1;for(let e=d;e<i;e++){let t=this._computeIndentLevel(e);if(t>=0){l=e,c=t;break}}}s[t]=this._getIndentLevelForWhitespaceLine(o,a,c)}}return s}_getIndentLevelForWhitespaceLine(e,t,i){return-1===t||-1===i?0:t<i?1+Math.floor(t/this._options.indentSize):t===i||e?Math.ceil(i/this._options.indentSize):1+Math.floor(i/this._options.indentSize)}normalizePosition(e,t){return e}getLineIndentColumn(e){return lk(this.getLineContent(e))+1}};function lk(e){let t=0;for(const i of e){if(" "!==i&&"\t"!==i)break;t++}return t}ak.MODEL_SYNC_LIMIT=52428800,ak.LARGE_FILE_SIZE_THRESHOLD=20971520,ak.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5,ak.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:be.tabSize,indentSize:be.indentSize,insertSpaces:be.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:be.trimAutoWhitespace,largeFileOptimizations:be.largeFileOptimizations,bracketPairColorizationOptions:be.bracketPairColorizationOptions},ak=Yx([Xx(4,Ew),Xx(5,Oc),Xx(6,Sh)],ak);class ck{constructor(){this.activeClassName="indent-active"}getInlineClassNameOfLevel(e){return"bracket-indent-guide lvl-"+e%30}}function dk(e){return!(!e.options.overviewRuler||!e.options.overviewRuler.color)}function hk(e){return!!e.options.after||!!e.options.before}class uk{constructor(){this._decorationsTree0=new Ub,this._decorationsTree1=new Ub,this._injectedTextDecorationsTree=new Ub}ensureAllNodesHaveRanges(e){this.getAll(e,0,!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,o){const s=e.getVersionId(),r=this._intervalSearch(t,i,n,o,s);return this._ensureNodesHaveRanges(e,r)}_intervalSearch(e,t,i,n,o){const s=this._decorationsTree0.intervalSearch(e,t,i,n,o),r=this._decorationsTree1.intervalSearch(e,t,i,n,o),a=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o);return s.concat(r).concat(a)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,o);return this._ensureNodesHaveRanges(e,s).filter(e=>e.options.showIfCollapsed||!e.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i);return this._ensureNodesHaveRanges(e,n).filter(e=>e.options.showIfCollapsed||!e.range.isEmpty())}getAll(e,t,i,n){const o=e.getVersionId(),s=this._search(t,i,n,o);return this._ensureNodesHaveRanges(e,s)}_search(e,t,i,n){if(i)return this._decorationsTree1.search(e,t,n);{const i=this._decorationsTree0.search(e,t,n),o=this._decorationsTree1.search(e,t,n),s=this._injectedTextDecorationsTree.search(e,t,n);return i.concat(o).concat(s)}}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){hk(e)?this._injectedTextDecorationsTree.insert(e):dk(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){hk(e)?this._injectedTextDecorationsTree.delete(e):dk(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){hk(e)?this._injectedTextDecorationsTree.resolveNode(e,t):dk(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 gk(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class fk{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class mk extends fk{constructor(e){super(e),this._resolvedColor=null,this.position="number"===typeof e.position?e.position:za.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;let i=e?t.getColor(e.id):null;return i?i.toString():""}}class pk extends fk{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?Lw.fromHex(e):t.getColor(e.id)}}class _k{constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1}static from(e){return e instanceof _k?e:new _k(e)}}class bk{constructor(e){this.description=e.description,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?gk(e.className):null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new mk(e.overviewRuler):null,this.minimap=e.minimap?new pk(e.minimap):null,this.glyphMarginClassName=e.glyphMarginClassName?gk(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?gk(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?gk(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?gk(e.marginClassName):null,this.inlineClassName=e.inlineClassName?gk(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?gk(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?gk(e.afterContentClassName):null,this.after=e.after?_k.from(e.after):null,this.before=e.before?_k.from(e.before):null}static register(e){return new bk(e)}static createDynamic(e){return new bk(e)}}bk.EMPTY=bk.register({description:"empty"});const vk=[bk.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),bk.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),bk.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),bk.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function wk(e){return e instanceof bk?e:bk.createDynamic(e)}class Ck extends Ye{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new rt),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;if(this._deferredCnt--,0===this._deferredCnt){if(this._shouldFire){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler};this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._actual.fire(e)}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){this._affectsMinimap||(this._affectsMinimap=!(!e.minimap||!e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!(!e.overviewRuler||!e.overviewRuler.color)),this._shouldFire=!0}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._shouldFire=!0}}class yk extends Ye{constructor(){super(),this._fastEmitter=this._register(new rt),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new rt),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))}}const Sk=()=>!0,xk=()=>!1,kk=e=>" "===e||"\t"===e;class Lk{constructor(e,t,i){this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const n=i.options,o=n.get(129);this.readOnly=n.get(80),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=n.get(103),this.lineHeight=n.get(58),this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=n.get(114),this.wordSeparators=n.get(115),this.emptySelectionClipboard=n.get(32),this.copyWithSyntaxHighlighting=n.get(21),this.multiCursorMergeOverlapping=n.get(68),this.multiCursorPaste=n.get(70),this.autoClosingBrackets=n.get(5),this.autoClosingQuotes=n.get(8),this.autoClosingDelete=n.get(6),this.autoClosingOvertype=n.get(7),this.autoSurround=n.get(11),this.autoIndent=n.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:Lk._getShouldAutoClose(e,this.autoClosingQuotes),bracket:Lk._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=Th.getAutoClosingPairs(e);let s=Lk._getSurroundingPairs(e);if(s)for(const r of s)this.surroundingPairs[r.open]=r.close}static shouldRecreate(e){return e.hasChanged(129)||e.hasChanged(115)||e.hasChanged(32)||e.hasChanged(68)||e.hasChanged(70)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(114)||e.hasChanged(58)||e.hasChanged(80)}get electricChars(){if(!this._electricChars){this._electricChars={};let e=Lk._getElectricCharacters(this._languageId);if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}normalizeIndentation(e){return ak.normalizeIndentation(e,this.indentSize,this.insertSpaces)}static _getElectricCharacters(e){try{return Th.getElectricCharacters(e)}catch(t){return xe(t),null}}static _getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return kk;case"languageDefined":return Lk._getLanguageDefinedShouldAutoClose(e);case"always":return Sk;case"never":return xk}}static _getLanguageDefinedShouldAutoClose(e){try{const t=Th.getAutoCloseBeforeSet(e);return e=>-1!==t.indexOf(e)}catch(t){return xe(t),xk}}static _getSurroundingPairs(e){try{return Th.getSurroundingPairs(e)}catch(t){return xe(t),null}}}class Ek{constructor(e,t,i,n){this._singleCursorStateBrand=void 0,this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=n,this.selection=Ek._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&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 Ek(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new wi(t,i),n):new Ek(new Ci(t,i,t,i),n,new wi(t,i),n)}static _computeSelection(e,t){let i,n,o,s;return e.isEmpty()?(i=e.startLineNumber,n=e.startColumn,o=t.lineNumber,s=t.column):t.isBeforeOrEqual(e.getStartPosition())?(i=e.endLineNumber,n=e.endColumn,o=t.lineNumber,s=t.column):(i=e.startLineNumber,n=e.startColumn,o=t.lineNumber,s=t.column),new yi(i,n,o,s)}}class Dk{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class Nk{constructor(e){this.modelState=e,this.viewState=null}}class Ik{constructor(e){this.modelState=null,this.viewState=e}}class Tk{constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}static fromModelState(e){return new Nk(e)}static fromViewState(e){return new Ik(e)}static fromModelSelection(e){const t=e.selectionStartLineNumber,i=e.selectionStartColumn,n=e.positionLineNumber,o=e.positionColumn,s=new Ek(new Ci(t,i,t,i),0,new wi(n,o),0);return Tk.fromModelState(s)}static fromModelSelections(e){let t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}}class Mk{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function Ok(e){return"'"===e||'"'===e||"`"===e}class Ak{static whitespaceVisibleColumn(e,t,i){const n=e.length;let o=0,s=-1,r=-1;for(let a=0;a<n;a++){if(a===t)return[s,r,o];o%i===0&&(s=a,r=o);const n=e.charCodeAt(a);switch(n){case 32:o+=1;break;case 9:o=tC.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===n?[s,r,o]:[-1,-1,-1]}static atomicPosition(e,t,i,n){const o=e.length,[s,r,a]=Ak.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;break}if(l){if(-1===s)return-1;let t=r;for(let n=s;n<o;++n){if(t===r+i)return s;const o=e.charCodeAt(n);switch(o){case 32:t+=1;break;case 9:t=tC.nextRenderTabStop(t,i);break;default:return-1}}return t===r+i?s:-1}const c=tC.nextRenderTabStop(a,i);let d=a;for(let h=t;h<o;h++){if(d===c)return h;const t=e.charCodeAt(h);switch(t){case 32:d+=1;break;case 9:d=tC.nextRenderTabStop(d,i);break;default:return-1}}return d===c?o:-1}}class Pk{constructor(e=null){this.hitTarget=e,this.type=0}}class Rk{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var Fk;(function(e){function t(e,t,i){const n=e.getPositionFromDOMInfo(t,i);return n?new Rk(n,t,null):new Pk(t)}e.createFromDOMInfo=t})(Fk||(Fk={}));class Bk{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class Wk{constructor(e,t,i=0,n=null,o=null,s=null){this.element=e,this.type=t,this.mouseColumn=i,this.position=n,!o&&n&&(o=new Ci(n.lineNumber,n.column,n.lineNumber,n.column)),this.range=o,this.detail=s}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+" - "+e.detail}toString(){return Wk.toString(this)}}class Vk{static isTextArea(e){return 2===e.length&&3===e[0]&&6===e[1]}static isChildOfViewLines(e){return e.length>=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}}class zk{constructor(e,t,i){this.model=e.model;const n=e.configuration.options;this.layoutInfo=n.get(129),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(58),this.stickyTabStops=n.get(103),this.typicalHalfwidthCharacterWidth=n.get(43).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return zk.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.model.getLineCount();let s,r=null,a=null;return i.afterLineNumber!==o&&(a=new wi(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new wi(i.afterLineNumber,e.model.getLineMaxColumn(i.afterLineNumber))),s=null===a?r:null===r?a:t<n?r:a,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:r,positionAfter:a,position:s}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const e=this._context.model.getLineCount(),t=this._context.model.getLineMaxColumn(e);return{range:new Ci(e,t,e,t),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.model.getLineMaxColumn(t);return{range:new Ci(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 zk._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){while(e&&e!==document.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 Hk{constructor(e,t,i){this.editorPos=t,this.pos=i,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+i.y-t.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+i.x-t.x-e.layoutInfo.contentLeft,this.isInMarginArea=i.x-t.x<e.layoutInfo.contentLeft&&i.x-t.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,$k._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class Kk extends Hk{constructor(e,t,i,n){super(e,t,i),this._ctx=e,n?(this.target=n,this.targetPath=J_.collect(n,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}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}fulfill(e,t=null,i=null,n=null){let o=this.mouseColumn;return t&&t.column<this._ctx.model.getLineMaxColumn(t.lineNumber)&&(o=tC.visibleColumnFromColumn(this._ctx.model.getLineContent(t.lineNumber),t.column,this._ctx.model.getTextModelOptions().tabSize)+1),new Wk(this.target,e,o,t,i,n)}withTarget(e){return new Kk(this._ctx,this.editorPos,this.pos,e)}}const jk={isAfterLines:!0};function Uk(e){return{isAfterLines:!1,horizontalDistanceToText:e}}class $k{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=J_.collect(t,this._viewHelper.viewDomNode);return!(!Vk.isChildOfContentWidgets(i)&&!Vk.isChildOfOverflowingContentWidgets(i))||!!Vk.isChildOfOverlayWidgets(i)}createMouseTarget(e,t,i,n){const o=new zk(this._context,this._viewHelper,e),s=new Kk(o,t,i,n);try{const e=$k._createMouseTarget(o,s,!1);return e}catch(r){return s.fulfill(0)}}static _createMouseTarget(e,t,i){if(null===t.target){if(i)return t.fulfill(0);const n=$k._doHitTest(e,t);return 1===n.type?$k.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}const n=t;let o=null;return o=o||$k._hitTestContentWidget(e,n),o=o||$k._hitTestOverlayWidget(e,n),o=o||$k._hitTestMinimap(e,n),o=o||$k._hitTestScrollbarSlider(e,n),o=o||$k._hitTestViewZone(e,n),o=o||$k._hitTestMargin(e,n),o=o||$k._hitTestViewCursor(e,n),o=o||$k._hitTestTextArea(e,n),o=o||$k._hitTestViewLines(e,n,i),o=o||$k._hitTestScrollbar(e,n),o||t.fulfill(0)}static _hitTestContentWidget(e,t){if(Vk.isChildOfContentWidgets(t.targetPath)||Vk.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfill(9,null,null,i):t.fulfill(0)}return null}static _hitTestOverlayWidget(e,t){if(Vk.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfill(12,null,null,i):t.fulfill(0)}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.fulfill(6,e.position,null,{mightBeForeignElement:!1})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const s of i){if(n<s.contentLeft)continue;if(n>s.contentLeft+s.width)continue;const i=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(i<=o&&o<=i+s.height)return t.fulfill(6,s.position,null,{mightBeForeignElement:!1})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfill(e,i.position,null,i)}return null}static _hitTestTextArea(e,t){return Vk.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfill(6,e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1}):t.fulfill(1,e.lastRenderData.lastTextareaPosition):null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.pos.x-t.editorPos.x);const s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfill(2,n,i.range,s):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfill(3,n,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfill(4,n,i.range,s)))}return null}static _hitTestViewLines(e,t,i){if(!Vk.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfill(7,new wi(1,1),null,jk);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return t.fulfill(7,new wi(i,n),null,jk)}if(i){if(Vk.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.model.getLineLength(i)){const n=e.getLineWidth(i),o=Uk(t.mouseContentHorizontalOffset-n);return t.fulfill(7,new wi(i,1),null,o)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const o=Uk(t.mouseContentHorizontalOffset-n),s=new wi(i,e.model.getLineMaxColumn(i));return t.fulfill(7,s,null,o)}}return t.fulfill(0)}const n=$k._doHitTest(e,t);return 1===n.type?$k.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(Vk.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new wi(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Vk.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.model.getLineMaxColumn(i);return t.fulfill(11,new wi(i,n))}}return null}static _hitTestScrollbar(e,t){if(Vk.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new wi(i,n))}return null}getMouseColumn(e,t){const i=this._context.configuration.options,n=i.get(129),o=this._context.viewLayout.getCurrentScrollLeft()+t.x-e.x-n.contentLeft;return $k._getMouseColumn(o,i.get(43).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){if(e<0)return 1;const i=Math.round(e/t);return i+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const s=n.lineNumber,r=n.column,a=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>a){const e=Uk(t.mouseContentHorizontalOffset-a);return t.fulfill(7,n,null,e)}const l=e.visibleRangeForPosition(s,r);if(!l)return t.fulfill(0,n);const c=l.left;if(t.mouseContentHorizontalOffset===c)return t.fulfill(6,n,null,{mightBeForeignElement:!!o});const d=[];if(d.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(s,r-1);t&&d.push({offset:t.left,column:r-1})}const h=e.model.getLineMaxColumn(s);if(r<h){const t=e.visibleRangeForPosition(s,r+1);t&&d.push({offset:t.left,column:r+1})}d.sort((e,t)=>e.offset-t.offset);const u=t.pos.toClientCoordinates(),g=i.getBoundingClientRect(),f=g.left<=u.clientX&&u.clientX<=g.right;for(let m=1;m<d.length;m++){const e=d[m-1],i=d[m];if(e.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=i.offset){const r=new Ci(s,e.column,s,i.column);return t.fulfill(6,n,r,{mightBeForeignElement:!f||!!o})}}return t.fulfill(6,n,null,{mightBeForeignElement:!f||!!o})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.getVerticalOffsetForLineNumber(i),o=n+Math.floor(e.lineHeight/2);let s=t.pos.y+(o-t.mouseVerticalOffset);s<=t.editorPos.y&&(s=t.editorPos.y+1),s>=t.editorPos.y+e.layoutInfo.height&&(s=t.editorPos.y+e.layoutInfo.height-1);const r=new K_(t.pos.x,s),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates());return 1===a.type?a:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Yo(e.viewDomNode);let n;if(n=i?"undefined"===typeof i.caretRangeFromPoint?qk(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):document.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new Pk;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,i=t?t.parentNode:null,s=i?i.parentNode:null,r=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;return r===ub.CLASS_NAME?Fk.createFromDOMInfo(e,t,n.startOffset):new Pk(o.parentNode)}if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,i=t?t.parentNode:null,n=i&&i.nodeType===i.ELEMENT_NODE?i.className:null;return n===ub.CLASS_NAME?Fk.createFromDOMInfo(e,o,o.textContent.length):new Pk(o)}return new Pk}static _doHitTestWithCaretPositionFromPoint(e,t){const i=document.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;return s===ub.CLASS_NAME?Fk.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Pk(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,o=t?t.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(n===ub.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t)return Fk.createFromDOMInfo(e,t,0)}else if(s===ub.CLASS_NAME)return Fk.createFromDOMInfo(e,i.offsetNode,0)}return new Pk(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.getTextModelOptions(),o=Ak.atomicPosition(i,e.column-1,n,2);return-1!==o?new wi(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new Pk;if("function"===typeof document.caretRangeFromPoint?i=this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),1===i.type){const t=e.model.getInjectedTextAt(i.position),n=e.model.normalizePosition(i.position,2);!t&&n.equals(i.position)||(i=new Rk(n,i.spanNode,t))}return 1===i.type&&e.stickyTabStops&&(i=new Rk(this._snapToSoftTabBoundary(i.position,e.model),i.spanNode,i.injectedText)),i}}function qk(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(null!==o){while(o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild)o=o.lastChild;const e=o.getBoundingClientRect(),i=window.getComputedStyle(o,null).getPropertyValue("font"),s=o.innerText;let r,a=e.left,l=0;if(t>e.left+e.width)l=s.length;else{const e=Gk.getInstance();for(let n=0;n<s.length+1;n++){if(r=e.getCharWidth(s.charAt(n),i)/2,a+=r,t<a){l=n;break}a+=r}}n.setStart(o.firstChild,l),n.setEnd(o.firstChild,l)}return n}class Gk{constructor(){this._cache={},this._canvas=document.createElement("canvas")}static getInstance(){return Gk._INSTANCE||(Gk._INSTANCE=new Gk),Gk._INSTANCE}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 o=n.measureText(e),s=o.width;return this._cache[i]=s,s}}function Yk(e){return function(t,i){let n=!1;return e&&(n=e.mouseTargetIsWidget(i)),n||i.preventDefault(),i}}Gk._INSTANCE=null;class Xk extends Z_{constructor(e,t,i){super(),this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new $k(this._context,i),this._mouseDownOperation=this._register(new Zk(this._context,this.viewController,this.viewHelper,(e,t)=>this._createMouseTarget(e,t),e=>this._getMouseColumn(e))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(129).height;const n=new G_(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,e=>this._onContextMenu(e,!0))),this._register(n.onMouseMoveThrottled(this.viewHelper.viewDomNode,e=>this._onMouseMove(e),Yk(this.mouseTargetFactory),Xk.MOUSE_MOVE_MINIMUM_TIME)),this._register(n.onMouseUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))),this._register(n.onMouseDown(this.viewHelper.viewDomNode,e=>this._onMouseDown(e)));const o=e=>{if(this.viewController.emitMouseWheel(e),!this._context.configuration.options.get(67))return;const t=new Gn(e),i=s["f"]?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;if(i){const e=Oa.getZoomLevel(),i=t.deltaY>0?1:-1;Oa.setZoomLevel(e+i),t.preventDefault(),t.stopPropagation()}};this._register(bo(this.viewHelper.viewDomNode,os.MOUSE_WHEEL,o,{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(129)){const e=this._context.configuration.options.get(129).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}onScrollChanged(e){return this._mouseDownOperation.onScrollChanged(),!1}getTargetAtClientPoint(e,t){const i=new j_(e,t),n=i.toPageCoordinates(),o=$_(this.viewHelper.viewDomNode);return n.y<o.y||n.y>o.y+o.height||n.x<o.x||n.x>o.x+o.width?null:this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,n,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=Yo(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,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.editorPos,e.pos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){if(this._mouseDownOperation.isActive())return;const t=e.timestamp;t<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){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){const t=this._createMouseTarget(e,!0),i=6===t.type||7===t.type,n=2===t.type||3===t.type||4===t.type,o=3===t.type,r=this._context.configuration.options.get(97),a=8===t.type||5===t.type,l=9===t.type;let c=e.leftButton||e.middleButton;s["f"]&&e.leftButton&&e.ctrlKey&&(c=!1);const d=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(c&&(i||o&&r))d(),this._mouseDownOperation.start(t.type,e);else if(n)e.preventDefault();else if(a){const i=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(i.viewZoneId)&&(d(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}Xk.MOUSE_MOVE_MINIMUM_TIME=100;class Zk extends Ye{constructor(e,t,i,n,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._createMouseTarget=n,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new X_(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new no),this._mouseState=new Qk,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,!0);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):this._dispatchMouse(t,!0))}start(e,t){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const i=this._findMousePosition(t,!0);if(!i||!i.position)return;this._mouseState.trySetCount(t.detail,i.position),t.detail=this._mouseState.count;const n=this._context.configuration.options;if(!n.get(80)&&n.get(31)&&!n.get(18)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===i.type&&i.position&&this._currentSelection.containsPosition(i.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,Yk(null),e=>this._onMouseDownThenMove(e),e=>{const t=this._findMousePosition(this._lastMouseEvent,!0);e&&e instanceof KeyboardEvent?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(i,t.shiftKey),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,Yk(null),e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onScrollChanged(){this._isActive&&this._onScrollTimeout.setIfNotSet(()=>{if(!this._lastMouseEvent)return;const e=this._findMousePosition(this._lastMouseEvent,!1);e&&(this._mouseState.isDragAndDrop||this._dispatchMouse(e,!0))},10)}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.model,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const i=Math.max(n.getCurrentScrollTop()-(t.y-e.posy),0),s=zk.getZoneAtCoord(this._context,i);if(s){const e=this._helpPositionJumpOverViewZone(s);if(e)return new Wk(null,13,o,e)}const r=n.getLineNumberAtVerticalOffset(i);return new Wk(null,13,o,new wi(r,1))}if(e.posy>t.y+t.height){const s=n.getCurrentScrollTop()+(e.posy-t.y),r=zk.getZoneAtCoord(this._context,s);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return new Wk(null,13,o,e)}const a=n.getLineNumberAtVerticalOffset(s);return new Wk(null,13,o,new wi(a,i.getLineMaxColumn(a)))}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+(e.posy-t.y));return e.posx<t.x?new Wk(null,13,o,new wi(s,1)):e.posx>t.x+t.width?new Wk(null,13,o,new wi(s,i.getLineMaxColumn(s))):null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t),o=n.position;if(!o)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return new Wk(n.element,n.type,n.mouseColumn,e,null,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new wi(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,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})}}class Qk{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 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}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>Qk.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)}}var Jk;Qk.CLEAR_MOUSE_DOWN_COUNT_TIME=400,function(e){e.text="text/plain",e.binary="application/octet-stream",e.unknown="application/unknown",e.markdown="text/markdown",e.latex="text/latex"}(Jk||(Jk={}));let eL=[],tL=[],iL=[];function nL(e,t=!1){const i=oL(e);eL.push(i),i.userConfigured?iL.push(i):tL.push(i),t&&!i.userConfigured&&eL.forEach(e=>{e.mime===i.mime||e.userConfigured||(i.extension&&e.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&e.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&e.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&e.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function oL(e){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:e.userConfigured,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?Nl(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf($t.sep)>=0}}function sL(e){e?(eL=eL.filter(e=>!e.userConfigured),iL=[]):(eL=[],tL=[],iL=[])}function rL(e,t){let i;if(e)switch(e.scheme){case co.file:i=e.fsPath;break;case co.data:const t=Yr.parseMetaData(e);i=t.get(Yr.META_DATA_LABEL);break;default:i=e.path}if(!i)return[Jk.unknown];i=i.toLowerCase();const n=Zt(i),o=aL(i,n,iL);if(o)return[o,Jk.text];const s=aL(i,n,tL);if(s)return[s,Jk.text];if(t){const e=lL(t);if(e)return[e,Jk.text]}return[Jk.unknown]}function aL(e,t,i){var n;let o=null,s=null,r=null;for(let a=i.length-1;a>=0;a--){const l=i[a];if(t===l.filenameLowercase){o=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){const i=l.filepatternOnPath?e:t;(null===(n=l.filepatternLowercase)||void 0===n?void 0:n.call(l,i))&&(s=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&t.endsWith(l.extensionLowercase)&&(r=l)}return o?o.mime:s?s.mime:r?r.mime:null}function lL(e){if(pr(e)&&(e=e.substr(1)),e.length>0)for(let t=eL.length-1;t>=0;t--){const i=eL[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i.mime}return null}const cL=!1;class dL{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selectionStartPosition=n,this.selectionEndPosition=o}toString(){return"[ <"+this.value+">, selectionStart: "+this.selectionStart+", selectionEnd: "+this.selectionEnd+"]"}static readFromTextArea(e){return new dL(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new dL(this.value,this.value.length,this.value.length,null,null)}writeToTextArea(e,t,i){cL&&console.log("writeToTextArea "+e+": "+this.toString()),t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,t,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,t,1)}const t=this.value.substring(this.selectionStart,e);if(-1===t.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selectionStartPosition,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;while(-1!==(o=t.indexOf("\n",o+1)))n++;return[e,i*t.length,n]}static selectedText(e){return new dL(e,0,e.length,null,null)}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};cL&&(console.log("------------------------deduceInput"),console.log("PREVIOUS STATE: "+e.toString()),console.log("CURRENT STATE: "+t.toString()));let n=e.value,o=e.selectionStart,s=e.selectionEnd,r=t.value,a=t.selectionStart,l=t.selectionEnd;const c=n.substring(s),d=r.substring(l),h=Xs(c,d);r=r.substring(0,r.length-h),n=n.substring(0,n.length-h);const u=n.substring(0,o),g=r.substring(0,a),f=Ys(u,g);if(r=r.substring(f),n=n.substring(f),a-=f,o-=f,l-=f,s-=f,cL&&(console.log("AFTER DIFFING PREVIOUS STATE: <"+n+">, selectionStart: "+o+", selectionEnd: "+s),console.log("AFTER DIFFING CURRENT STATE: <"+r+">, selectionStart: "+a+", selectionEnd: "+l)),i&&a===l&&n.length>0){let e=null;if(a===r.length?r.startsWith(n)&&(e=r.substring(n.length)):r.endsWith(n)&&(e=r.substring(0,r.length-n.length)),null!==e&&e.length>0&&(/\uFE0F/.test(e)||ar(e)))return{text:e,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0}}if(a===l){if(n===r&&0===o&&s===n.length&&a===r.length&&-1===r.indexOf("\n")&&ur(r))return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const e=u.length-f;return cL&&console.log("REMOVE PREVIOUS: "+(u.length-f)+" chars"),{text:r,replacePrevCharCnt:e,replaceNextCharCnt:0,positionDelta:0}}const m=s-o;return{text:r,replacePrevCharCnt:m,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(cL&&(console.log("------------------------deduceAndroidCompositionInput"),console.log("PREVIOUS STATE: "+e.toString()),console.log("CURRENT STATE: "+t.toString())),e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(Ys(e.value,t.value),e.selectionEnd),n=Math.min(Xs(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),s=t.value.substring(i,t.value.length-n),r=e.selectionStart-i,a=e.selectionEnd-i,l=t.selectionStart-i,c=t.selectionEnd-i;return cL&&(console.log("AFTER DIFFING PREVIOUS STATE: <"+o+">, selectionStart: "+r+", selectionEnd: "+a),console.log("AFTER DIFFING CURRENT STATE: <"+s+">, selectionStart: "+l+", selectionEnd: "+c)),{text:s,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:c-s.length}}}dL.EMPTY=new dL("",0,0,null,null);class hL{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,o=i+t;return new Ci(n,1,o+1,1)}static fromEditorSelection(e,t,i,n,o){const s=hL._getPageOfLine(i.startLineNumber,n),r=hL._getRangeForPage(s,n),a=hL._getPageOfLine(i.endLineNumber,n),l=hL._getRangeForPage(a,n),c=r.intersectRanges(new Ci(1,1,i.startLineNumber,i.startColumn));let d=t.getValueInRange(c,1);const h=t.getLineCount(),u=t.getLineMaxColumn(h),g=l.intersectRanges(new Ci(i.endLineNumber,i.endColumn,h,u));let f,m=t.getValueInRange(g,1);if(s===a||s+1===a)f=t.getValueInRange(i,1);else{const e=r.intersectRanges(i),n=l.intersectRanges(i);f=t.getValueInRange(e,1)+String.fromCharCode(8230)+t.getValueInRange(n,1)}if(o){const e=500;d.length>e&&(d=d.substring(d.length-e,d.length)),m.length>e&&(m=m.substring(0,e)),f.length>2*e&&(f=f.substring(0,e)+String.fromCharCode(8230)+f.substring(f.length-e,f.length))}return new dL(d+f+m,d.length,d.length+f.length,new wi(i.startLineNumber,i.startColumn),new wi(i.endLineNumber,i.endColumn))}}var uL;(function(e){e.Tap="-monaco-textarea-synthetic-tap"})(uL||(uL={}));const gL={forceCopyWithSyntaxHighlighting:!1};class fL{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)}}fL.INSTANCE=new fL;class mL extends Ye{constructor(e,t){super(),this.textArea=t,this._onFocus=this._register(new rt),this.onFocus=this._onFocus.event,this._onBlur=this._register(new rt),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new rt),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new rt),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new rt),this.onCut=this._onCut.event,this._onPaste=this._register(new rt),this.onPaste=this._onPaste.event,this._onType=this._register(new rt),this.onType=this._onType.event,this._onCompositionStart=this._register(new rt),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new rt),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new rt),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new rt),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._host=e,this._textArea=this._register(new _L(t)),this._asyncTriggerCut=this._register(new so(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new so(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=dL.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._isDoingComposition=!1,this._nextCommand=0;let i=null;this._register(Co(t.domNode,"keydown",e=>{(109===e.keyCode||this._isDoingComposition&&1===e.keyCode)&&e.stopPropagation(),e.equals(9)&&e.preventDefault(),i=e,this._onKeyDown.fire(e)})),this._register(Co(t.domNode,"keyup",e=>{this._onKeyUp.fire(e)})),this._register(bo(t.domNode,"compositionstart",e=>{if(cL&&console.log("[compositionstart]",e),!this._isDoingComposition){if(this._isDoingComposition=!0,s["f"]&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data){const t=i&&i.equals(109)&&("ArrowRight"===i.code||"ArrowLeft"===i.code);if(t||Sn)return cL&&console.log("[compositionstart] Handling long press case on macOS + arrow key or Firefox",e),this._textAreaState=new dL(this._textAreaState.value,this._textAreaState.selectionStart-1,this._textAreaState.selectionEnd,this._textAreaState.selectionStartPosition?new wi(this._textAreaState.selectionStartPosition.lineNumber,this._textAreaState.selectionStartPosition.column-1):null,this._textAreaState.selectionEndPosition),void this._onCompositionStart.fire({revealDeltaColumns:-1})}Dn?this._onCompositionStart.fire({revealDeltaColumns:-this._textAreaState.selectionStart}):(this._setAndWriteTextAreaState("compositionstart",dL.EMPTY),this._onCompositionStart.fire({revealDeltaColumns:0}))}}));const n=e=>{const t=this._textAreaState,i=dL.readFromTextArea(this._textArea);return[i,dL.deduceInput(t,i,e)]},o=()=>{const e=this._textAreaState,t=dL.readFromTextArea(this._textArea);return[t,dL.deduceAndroidCompositionInput(e,t)]},r=e=>{const t=this._textAreaState,i=dL.selectedText(e),n={text:i.value,replacePrevCharCnt:t.selectionEnd-t.selectionStart,replaceNextCharCnt:0,positionDelta:0};return[i,n]};this._register(bo(t.domNode,"compositionupdate",e=>{if(cL&&console.log("[compositionupdate]",e),Dn){const[t,i]=o();return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const[t,i]=r(e.data||"");this._textAreaState=t,this._onType.fire(i),this._onCompositionUpdate.fire(e)})),this._register(bo(t.domNode,"compositionend",e=>{if(cL&&console.log("[compositionend]",e),!this._isDoingComposition)return;if(this._isDoingComposition=!1,Dn){const[e,t]=o();return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const[t,i]=r(e.data||"");this._textAreaState=t,this._onType.fire(i),(kn||Sn)&&(this._textAreaState=dL.readFromTextArea(this._textArea)),this._onCompositionEnd.fire()})),this._register(bo(t.domNode,"input",()=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._isDoingComposition)return;const[e,t]=n(s["f"]);0===t.replacePrevCharCnt&&1===t.text.length&&Zs(t.text.charCodeAt(0))||(this._textAreaState=e,0===this._nextCommand?""===t.text&&0===t.replacePrevCharCnt||this._onType.fire(t):(""===t.text&&0===t.replacePrevCharCnt||this._firePaste(t.text,null),this._nextCommand=0))})),this._register(bo(t.domNode,"cut",e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()})),this._register(bo(t.domNode,"copy",e=>{this._ensureClipboardGetsEditorSelection(e)})),this._register(bo(t.domNode,"paste",e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),pL.canUseTextData(e)){const[t,i]=pL.getTextData(e);""!==t&&this._firePaste(t,i)}else this._textArea.getSelectionStart()!==this._textArea.getSelectionEnd()&&this._setAndWriteTextAreaState("paste",dL.EMPTY),this._nextCommand=1})),this._register(bo(t.domNode,"focus",()=>{const e=this._hasFocus;this._setHasFocus(!0),Ln&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(bo(t.domNode,"blur",()=>{this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(bo(t.domNode,uL.Tap,()=>{Dn&&this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return bo(document,"selectionchange",t=>{if(!this._hasFocus)return;if(this._isDoingComposition)return;if(!kn)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100)return;if(!this._textAreaState.selectionStartPosition||!this._textAreaState.selectionEndPosition)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)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),c=this._host.deduceModelPosition(l[0],l[1],l[2]),d=this._textAreaState.deduceEditorPosition(a),h=this._host.deduceModelPosition(d[0],d[1],d[2]),u=new yi(c.lineNumber,c.column,h.lineNumber,h.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(){const e=Yo(this.textArea.domNode);e?this._setHasFocus(e.activeElement===this.textArea.domNode):po(this.textArea.domNode)?this._setHasFocus(document.activeElement===this.textArea.domNode):this._setHasFocus(!1)}_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.writeScreenReaderContent("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}writeScreenReaderContent(e){this._isDoingComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(pL.canUseTextData(e)),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};fL.INSTANCE.set(Sn?t.text.replace(/\r\n/g,"\n"):t.text,i),pL.canUseTextData(e)?pL.setTextData(e,t.text,t.html,i):this._setAndWriteTextAreaState("copy or cut",dL.selectedText(t.text))}_firePaste(e,t){t||(t=fL.INSTANCE.get(e)),this._onPaste.fire({text:e,metadata:t})}}class pL{static canUseTextData(e){return!!e.clipboardData}static getTextData(e){if(e.clipboardData){e.preventDefault();const i=e.clipboardData.getData(Jk.text);let n=null;const o=e.clipboardData.getData("vscode-editor-data");if("string"===typeof o)try{n=JSON.parse(o),1!==n.version&&(n=null)}catch(t){}return[i,n]}throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")}static setTextData(e,t,i,n){if(e.clipboardData)return e.clipboardData.setData(Jk.text,t),"string"===typeof i&&e.clipboardData.setData("text/html",i),e.clipboardData.setData("vscode-editor-data",JSON.stringify(n)),void e.preventDefault();throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")}}class _L extends Ye{constructor(e){super(),this._actual=e,this._ignoreSelectionChangeTime=0}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.domNode.value}setValue(e,t){const i=this._actual.domNode;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.domNode.selectionDirection?this._actual.domNode.selectionEnd:this._actual.domNode.selectionStart}getSelectionEnd(){return"backward"===this._actual.domNode.selectionDirection?this._actual.domNode.selectionStart:this._actual.domNode.selectionEnd}setSelectionRange(e,t,i){const n=this._actual.domNode;let o=null;const s=Yo(n);o=s?s.activeElement:document.activeElement;const r=o===n,a=n.selectionStart,l=n.selectionEnd;if(r&&a===t&&l===i)Sn&&window.parent!==window&&n.focus();else{if(r)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(Sn&&window.parent!==window&&n.focus());try{const e=rs(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),as(n,e)}catch(c){}}}}class bL extends Xk{constructor(e,t,i){super(e,t,i),this._register(V_.addTarget(this.viewHelper.linesContentDomNode)),this._register(bo(this.viewHelper.linesContentDomNode,B_.Tap,e=>this.onTap(e))),this._register(bo(this.viewHelper.linesContentDomNode,B_.Change,e=>this.onChange(e))),this._register(bo(this.viewHelper.linesContentDomNode,B_.Contextmenu,e=>this._onContextMenu(new q_(e,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(bo(this.viewHelper.linesContentDomNode,"pointerdown",e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"}));const n=new Y_(this.viewHelper.viewDomNode);this._register(n.onPointerMoveThrottled(this.viewHelper.viewDomNode,e=>this._onMouseMove(e),Yk(this.mouseTargetFactory),Xk.MOUSE_MOVE_MINIMUM_TIME)),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=>this._onMouseDown(e)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new q_(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1})}onChange(e){"touch"===this._lastPointerType&&this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e)}}class vL extends Xk{constructor(e,t,i){super(e,t,i),this._register(V_.addTarget(this.viewHelper.linesContentDomNode)),this._register(bo(this.viewHelper.linesContentDomNode,B_.Tap,e=>this.onTap(e))),this._register(bo(this.viewHelper.linesContentDomNode,B_.Change,e=>this.onChange(e))),this._register(bo(this.viewHelper.linesContentDomNode,B_.Contextmenu,e=>this._onContextMenu(new q_(e,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new q_(e,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(uL.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position)}}onChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}}class wL extends Ye{constructor(e,t,i){super(),s["c"]&&In.pointerEvents?this.handler=this._register(new bL(e,t,i)):window.TouchEvent?this.handler=this._register(new vL(e,t,i)):this.handler=this._register(new Xk(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}i("1a37"),i("1f2d");class CL extends Z_{}class yL extends CL{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new wi(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(58);const t=e.get(59);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(83);const i=e.get(129);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.model.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}_getLineRenderLineNumber(e){const t=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new wi(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=s["d"]?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o='<div class="'+yL.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">',r=this._context.model.getLineCount(),a=[];for(let s=i;s<=n;s++){const e=s-i;if(!this._renderFinalNewline&&s===r&&0===this._context.model.getLineLength(s)){a[e]="";continue}const n=this._getLineRenderLineNumber(s);n?s===this._activeLineNumber?a[e]='<div class="active-line-number '+yL.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">'+n+"</div>":a[e]=o+n+"</div>":a[e]=""}this._renderResult=a}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}yL.CLASS_NAME="line-numbers",Qp((e,t)=>{const i=e.getColor(mx);i&&t.addRule(`.monaco-editor .line-numbers { color: ${i}; }`);const n=e.getColor(_x);n&&t.addRule(`.monaco-editor .line-numbers.active-line-number { color: ${n}; }`)});class SL extends Q_{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._canUseLayerHinting=!t.get(28),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=R_(document.createElement("div")),this._domNode.setClassName(SL.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=R_(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(SL.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(129);return this._canUseLayerHinting=!t.get(28),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)}}SL.CLASS_NAME="glyph-margin",SL.OUTER_CLASS_NAME="margin";i("53d7");const xL="monaco-mouse-cursor-text";class kL{constructor(e,t,i){this._visibleTextAreaBrand=void 0,this.top=e,this.left=t,this.width=i}setWidth(e){return new kL(this.top,this.left,e)}}const LL=Sn;class EL extends Q_{constructor(e,t,i){super(e),this._primaryCursorPosition=new wi(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._viewHelper=i,this._scrollLeft=0,this._scrollTop=0;const n=this._context.configuration.options,r=n.get(129);this._setAccessibilityOptions(n),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=n.get(43),this._lineHeight=n.get(58),this._emptySelectionClipboard=n.get(32),this._copyWithSyntaxHighlighting=n.get(21),this._visibleTextArea=null,this._selections=[new yi(1,1,1,1)],this._modelSelections=[new yi(1,1,1,1)],this._lastRenderPosition=null,this.textArea=R_(document.createElement("textarea")),J_.write(this.textArea,6),this.textArea.setClassName("inputarea "+xL),this.textArea.setAttribute("wrap","off"),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(n)),this.textArea.setAttribute("tabindex",String(n.get(111))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",o("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),n.get(30)&&n.get(80)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=R_(document.createElement("div")),this.textAreaCover.setPosition("absolute");const a={getLineCount:()=>this._context.model.getLineCount(),getLineMaxColumn:e=>this._context.model.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.model.getValueInRange(e,t)},l={getDataToCopy:e=>{const t=this._context.model.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,s["i"]),i=this._context.model.getEOL(),n=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),o=Array.isArray(t)?t:null,r=Array.isArray(t)?t.join(i):t;let a=void 0,l=null;if(e&&(gL.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&r.length<65536)){const e=this._context.model.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(a=e.html,l=e.mode)}return{isFromEmptySelection:n,multicursorText:o,text:r,html:a,mode:l}},getScreenReaderContent:e=>{if(1===this._accessibilitySupport){if(s["f"]){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new dL(i,i.length,i.length,t,t)}}return dL.EMPTY}if(Dn){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new dL(i,n,n,t,t)}return dL.EMPTY}return hL.fromEditorSelection(e,a,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.model.deduceModelPositionRelativeToViewPosition(e,t,i)};this._textAreaInput=this._register(new mL(l,this.textArea)),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="undefined"!==typeof 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?(cL&&console.log(` => compositionType: <<${e.text}>>, ${e.replacePrevCharCnt}, ${e.replaceNextCharCnt}, ${e.positionDelta}`),this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta)):(cL&&console.log(` => type: <<${e.text}>>`),this._viewController.type(e.text))})),this._register(this._textAreaInput.onSelectionChangeRequest(e=>{this._viewController.setSelection(e)})),this._register(this._textAreaInput.onCompositionStart(e=>{const t=this._selections[0].startLineNumber,i=this._selections[0].startColumn+e.revealDeltaColumns;this._context.model.revealRange("keyboard",!0,new Ci(t,i,t,i),0,1);const n=this._viewHelper.visibleRangeForPositionRelativeToEditor(t,i);n&&(this._visibleTextArea=new kL(this._context.viewLayout.getVerticalOffsetForLineNumber(t),n.left,LL?0:1),this._render()),this.textArea.setClassName(`inputarea ${xL} ime-input`),this._viewController.compositionStart(),this._context.model.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(e=>{this._visibleTextArea&&(this._visibleTextArea=this._visibleTextArea.setWidth(DL(e.data,this._fontInfo)),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName("inputarea "+xL),this._viewController.compositionEnd(),this._context.model.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.model.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.model.setHasFocus(!1)}))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.model.getLineContent(e.lineNumber),n=Ev(t);let o=!0,s=e.column,r=!0,a=e.column,l=0;while(l<50&&(o||r)){if(o&&s<=1&&(o=!1),o){const e=i.charCodeAt(s-2),t=n.get(e);0!==t?o=!1:s--}if(r&&a>i.length&&(r=!1),r){const e=i.charCodeAt(a-1),t=n.get(e);0!==t?r=!1:a++}l++}return[i.substring(s-1,a-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.model.getLineContent(e.lineNumber),i=Ev(this._context.configuration.options.get(115));let n=e.column,o=0;while(n>1){const s=t.charCodeAt(n-2),r=i.get(s);if(0!==r||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.model.getLineContent(e.lineNumber),i=t.charAt(e.column-2);if(!Zs(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){const t=e.get(2);return 1===t?o("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",s["d"]?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===Ce.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(43),this._lineHeight=t.get(58),this._emptySelectionClipboard=t.get(32),this._copyWithSyntaxHighlighting=t.get(21),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(111))),(e.hasChanged(30)||e.hasChanged(80))&&(t.get(30)&&t.get(80)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("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)}prepareRender(e){this._primaryCursorPosition=new wi(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){if(this._visibleTextArea)return void this._renderInsideEditor(null,this._visibleTextArea.top-this._scrollTop,this._contentLeft+this._visibleTextArea.left-this._scrollLeft,this._visibleTextArea.width,this._lineHeight);if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;t<0||t>this._contentHeight?this._renderAtTopLeft():s["f"]?this._renderInsideEditor(this._primaryCursorPosition,t,e,LL?0:1,this._lineHeight):this._renderInsideEditor(this._primaryCursorPosition,t,e,LL?0:1,LL?0:1)}_renderInsideEditor(e,t,i,n,o){this._lastRenderPosition=e;const s=this.textArea,r=this.textAreaCover;A_.applyFontInfo(s,this._fontInfo),s.setTop(t),s.setLeft(i),s.setWidth(n),s.setHeight(o),r.setTop(0),r.setLeft(0),r.setWidth(0),r.setHeight(0)}_renderAtTopLeft(){this._lastRenderPosition=null;const e=this.textArea,t=this.textAreaCover;if(A_.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),LL)return e.setWidth(0),e.setHeight(0),t.setWidth(0),void t.setHeight(0);e.setWidth(1),e.setHeight(1),t.setWidth(1),t.setHeight(1);const i=this._context.configuration.options;i.get(49)?t.setClassName("monaco-editor-background textAreaCover "+SL.OUTER_CLASS_NAME):0!==i.get(59).renderType?t.setClassName("monaco-editor-background textAreaCover "+yL.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")}}function DL(e,t){const i=document.createElement("canvas"),n=i.getContext("2d");n.font=NL(t);const o=n.measureText(e);return Sn?o.width+2:o.width}function NL(e){return IL("normal",e.fontWeight,e.fontSize,e.lineHeight,e.fontFamily)}function IL(e,t,i,n,o){return`${e} normal ${t} ${i}px / ${n}px ${o}`}class TL{static columnSelect(e,t,i,n,o,s){let r=Math.abs(o-i)+1,a=i>o,l=n>s,c=n<s,d=[];for(let h=0;h<r;h++){let o=i+(a?-h:h),r=tC.columnFromVisibleColumn2(e,t,o,n),u=tC.columnFromVisibleColumn2(e,t,o,s),g=tC.visibleColumnFromColumn2(e,t,new wi(o,r)),f=tC.visibleColumnFromColumn2(e,t,new wi(o,u));if(c){if(g>s)continue;if(f<n)continue}if(l){if(f>n)continue;if(g<s)continue}d.push(new Ek(new Ci(o,r,o,r),0,new wi(o,u),0))}if(0===d.length)for(let h=0;h<r;h++){const e=i+(a?-h:h),n=t.getLineMaxColumn(e);d.push(new Ek(new Ci(e,n,e,n),0,new wi(e,n),0))}return{viewStates:d,reversed:a,fromLineNumber:i,fromVisualColumn:n,toLineNumber:o,toVisualColumn:s}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,TL.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let a=o;a<=s;a++){const i=t.getLineMaxColumn(a),o=tC.visibleColumnFromColumn2(e,t,new wi(a,i));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 o=n?e.pageSize:1,s=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){const o=n?e.pageSize:1,s=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}}class ML{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){let i=t.getInverseEditOperations(),n=i[0].range;return new yi(n.endLineNumber,n.endColumn,n.endLineNumber,n.endColumn)}}class OL{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){let i=t.getInverseEditOperations(),n=i[0].range;return new yi(n.startLineNumber,n.startColumn,n.startLineNumber,n.startColumn)}}class AL{constructor(e,t,i,n,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let i=t.getInverseEditOperations(),n=i[0].range;return new yi(n.endLineNumber+this._lineNumberDeltaOffset,n.endColumn+this._columnDeltaOffset,n.endLineNumber+this._lineNumberDeltaOffset,n.endColumn+this._columnDeltaOffset)}}class PL{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 RL{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class FL{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-nr(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new wi(i,e.getLineMaxColumn(i))}return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=Ak.atomicPosition(o,t.column-1,i,0);if(-1!==s&&s+1>=n)return new wi(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?FL.leftPositionAtomicSoftTabs(t,i,e.tabSize):FL.leftPosition(t,i);return new RL(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.startLineNumber,r=i.selection.startColumn;else{const n=i.position.delta(void 0,-(o-1)),a=t.normalizePosition(FL.clipPositionColumn(n,t),0),l=FL.left(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static clipPositionColumn(e,t){return new wi(e.lineNumber,FL.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+=ir(e.getLineContent(t),i-1):t<e.getLineCount()&&(t+=1,i=e.getLineMinColumn(t)),new wi(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,o){if(i<e.getLineIndentColumn(t)){const o=e.getLineContent(t),s=Ak.atomicPosition(o,i-1,n,1);if(-1!==s)return new wi(t,s+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const n=e.stickyTabStops?FL.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):FL.rightPosition(t,i.lineNumber,i.column);return new RL(n.lineNumber,n.column,0)}static moveRight(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.endLineNumber,r=i.selection.endColumn;else{const n=i.position.delta(void 0,o-1),a=t.normalizePosition(FL.clipPositionColumn(n,t),1),l=FL.right(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static vertical(e,t,i,n,o,s,r){const a=tC.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,l=t.getLineCount(),c=1===i&&1===n,d=i===l&&n===t.getLineMaxColumn(i),h=s<i?c:d;return i=s,i<1?(i=1,n=r?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):i>l?(i=l,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=tC.columnFromVisibleColumn2(e,t,i,a),o=h?0:a-tC.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),new RL(i,n,o)}static down(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i+s,r)}static moveDown(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.endLineNumber,r=i.selection.endColumn):(s=i.position.lineNumber,r=i.position.column);let a=FL.down(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){let n=i.selection,o=FL.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=FL.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new Ek(new Ci(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new wi(s.lineNumber,s.column),s.leftoverVisibleColumns)}static up(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i-s,r)}static moveUp(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.startLineNumber,r=i.selection.startColumn):(s=i.position.lineNumber,r=i.position.column);let a=FL.up(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){let n=i.selection,o=FL.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=FL.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new Ek(new Ci(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new wi(s.lineNumber,s.column),s.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;while(o>1&&this._isBlankLine(t,o))o--;while(o>1&&!this._isBlankLine(t,o))o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let s=i.position.lineNumber;while(s<o&&this._isBlankLine(t,s))s++;while(s<o&&!this._isBlankLine(t,s))s++;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToBeginningOfLine(e,t,i,n){let o,s=i.position.lineNumber,r=t.getLineMinColumn(s),a=t.getLineFirstNonWhitespaceColumn(s)||r,l=i.position.column;return o=l===a?r:a,i.move(n,s,o,0)}static moveToEndOfLine(e,t,i,n,o){let s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){let o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}}class BL{static deleteRight(e,t,i,n){let o=[],s=3!==e;for(let r=0,a=n.length;r<a;r++){const e=n[r];let a=e;if(a.isEmpty()){let n=e.getPosition(),o=FL.right(t,i,n);a=new Ci(o.lineNumber,o.column,n.lineNumber,n.column)}a.isEmpty()?o[r]=null:(a.startLineNumber!==a.endLineNumber&&(s=!0),o[r]=new ML(a,""))}return[s,o]}static isAutoClosingPairDelete(e,t,i,n,o,s,r){if("never"===t&&"never"===i)return!1;if("never"===e)return!1;for(let a=0,l=s.length;a<l;a++){const l=s[a],c=l.getPosition();if(!l.isEmpty())return!1;const d=o.getLineContent(c.lineNumber);if(c.column<2||c.column>=d.length+1)return!1;const h=d.charAt(c.column-2),u=n.get(h);if(!u)return!1;if(Ok(h)){if("never"===i)return!1}else if("never"===t)return!1;const g=d.charAt(c.column-1);let f=!1;for(const e of u)e.open===h&&e.close===g&&(f=!0);if(!f)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t<i;t++){const i=r[t];if(c.lineNumber===i.startLineNumber&&c.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){let n=[];for(let o=0,s=i.length;o<s;o++){const e=i[o].getPosition(),t=new Ci(e.lineNumber,e.column-1,e.lineNumber,e.column+1);n[o]=new ML(t,"")}return[!0,n]}static deleteLeft(e,t,i,n,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,n,o))return this._runAutoClosingPairDelete(t,i,n);const s=[];let r=2!==e;for(let a=0,l=n.length;a<l;a++){let e=BL.getDeleteRange(n[a],i,t);e.isEmpty()?s[a]=null:(e.startLineNumber!==e.endLineNumber&&(r=!0),s[a]=new ML(e,""))}return[r,s]}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),o=Bs(e),s=-1===o?e.length+1:o+1;if(n.column<=s){const e=tC.visibleColumnFromColumn2(i,t,n),o=tC.prevIndentTabStop(e,i.indentSize),s=tC.columnFromVisibleColumn2(i,t,n.lineNumber,o);return new Ci(n.lineNumber,s,n.lineNumber,n.column)}}return Ci.fromPositions(BL.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=yr(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 wi(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){let n=[],o=null;i.sort((e,t)=>wi.compare(e.getStartPosition(),t.getEndPosition()));for(let s=0,r=i.length;s<r;s++){const r=i[s];if(r.isEmpty())if(e.emptySelectionClipboard){let e,i,a,l,c=r.getPosition();c.lineNumber<t.getLineCount()?(e=c.lineNumber,i=1,a=c.lineNumber+1,l=1):c.lineNumber>1&&(null===o||void 0===o?void 0:o.endLineNumber)!==c.lineNumber?(e=c.lineNumber-1,i=t.getLineMaxColumn(c.lineNumber-1),a=c.lineNumber,l=t.getLineMaxColumn(c.lineNumber)):(e=c.lineNumber,i=1,a=c.lineNumber,l=t.getLineMaxColumn(c.lineNumber));let d=new Ci(e,i,a,l);o=d,d.isEmpty()?n[s]=null:n[s]=new ML(d,"")}else n[s]=null;else n[s]=new ML(r,"")}return new Mk(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class WL{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){let n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;for(let o=i.column-2;o>=0;o--){let i=e.charCodeAt(o),s=t.get(i);if(0===s){if(2===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){let o=e.length;for(let s=n;s<o;s++){let n=e.charCodeAt(s),o=t.get(n);if(1===o)return s;if(1===i&&2===o)return s;if(2===i&&0===o)return s}return o}static _findNextWordOnLine(e,t,i){let n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=0,o=e.length;for(let s=i.column-1;s<o;s++){let i=e.charCodeAt(s),o=t.get(i);if(0===o){if(2===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s)}return 0!==n?this._createWord(e,n,1,this._findStartOfWord(e,t,n,o-1),o):null}static _findStartOfWord(e,t,i,n){for(let o=n;o>=0;o--){let n=e.charCodeAt(o),s=t.get(n);if(1===s)return o+1;if(1===i&&2===s)return o+1;if(2===i&&0===s)return o+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,s=i.column;1===s&&o>1&&(o-=1,s=t.getLineMaxColumn(o));let r=WL._findPreviousWordOnLine(e,t,new wi(o,s));if(0===n)return new wi(o,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start===1&&0===r.nextCharClass&&(r=WL._findPreviousWordOnLine(e,t,new wi(o,r.start+1))),new wi(o,r?r.start+1:1);if(3===n){while(r&&2===r.wordType)r=WL._findPreviousWordOnLine(e,t,new wi(o,r.start+1));return new wi(o,r?r.start+1:1)}return r&&s<=r.end+1&&(r=WL._findPreviousWordOnLine(e,t,new wi(o,r.start+1))),new wi(o,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 wi(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let s=t.column-1;s>1;s--){const e=o.charCodeAt(s-2),t=o.charCodeAt(s-1);if(95===e&&95!==t)return new wi(i,s);if(Us(e)&&$s(t))return new wi(i,s);if($s(e)&&$s(t)&&s+1<n){const e=o.charCodeAt(s);if(Us(e))return new wi(i,s)}}return new wi(i,1)}static moveWordRight(e,t,i,n){let o=i.lineNumber,s=i.column,r=!1;s===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(r=!0,o+=1,s=1);let a=WL._findNextWordOnLine(e,t,new wi(o,s));if(2===n)a&&2===a.wordType&&a.end-a.start===1&&0===a.nextCharClass&&(a=WL._findNextWordOnLine(e,t,new wi(o,a.end+1))),s=a?a.end+1:t.getLineMaxColumn(o);else if(3===n){r&&(s=0);while(a&&(2===a.wordType||a.start+1<=s))a=WL._findNextWordOnLine(e,t,new wi(o,a.end+1));s=a?a.start+1:t.getLineMaxColumn(o)}else a&&!r&&s>=a.start+1&&(a=WL._findNextWordOnLine(e,t,new wi(o,a.end+1))),s=a?a.start+1:t.getLineMaxColumn(o);return new wi(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new wi(i+1,1):t;const o=e.getLineContent(i);for(let s=t.column+1;s<n;s++){const e=o.charCodeAt(s-2),t=o.charCodeAt(s-1);if(95!==e&&95===t)return new wi(i,s);if(Us(e)&&$s(t))return new wi(i,s);if($s(e)&&$s(t)&&s+1<n){const e=o.charCodeAt(s);if(Us(e))return new wi(i,s)}}return new wi(i,n)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-2,o=Vs(i,n);return o+1<n?new Ci(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(BL.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const t=e.selection.getPosition();return new Ci(t.lineNumber,t.column-1,t.lineNumber,t.column+1)}const r=new wi(o.positionLineNumber,o.positionColumn);let a=r.lineNumber,l=r.column;if(1===a&&1===l)return null;if(s){let e=this._deleteWordLeftWhitespace(n,r);if(e)return e}let c=WL._findPreviousWordOnLine(i,n,r);return 0===t?c?l=c.start+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a)):(c&&l<=c.end+1&&(c=WL._findPreviousWordOnLine(i,n,new wi(a,c.start+1))),c?l=c.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new Ci(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new wi(i.positionLineNumber,i.positionColumn);let o=this._deleteInsideWordWhitespace(t,n);return o||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 o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,s))return null;while(o>0&&this._charAtIsWhitespace(i,o-1))o--;while(s+1<n&&this._charAtIsWhitespace(i,s+1))s++;return new Ci(t.lineNumber,o+1,t.lineNumber,s+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const n=t.getLineContent(i.lineNumber),o=n.length;if(0===o)return i.lineNumber>1?new Ci(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new Ci(i.lineNumber,1,i.lineNumber+1,1):new Ci(i.lineNumber,1,i.lineNumber,1);const s=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 Ci(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,s=!1;while(i-1<o&&this._charAtIsWhitespace(n,i-1))s=!0,i++;if(!s)while(t>1&&this._charAtIsWhitespace(n,t-2))t--;return r(t,i)},l=WL._findPreviousWordOnLine(e,t,i);if(l&&s(l))return a(l);const c=WL._findNextWordOnLine(e,t,i);return c&&s(c)?a(c):l&&c?r(l.end+1,c.start+1):l?r(l.start+1,l.end+1):c?r(c.start+1,c.end+1):r(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=WL._moveWordPartLeft(e,i);return new Ci(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let n=t;n<i;n++){let 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,o=this._findFirstNonWhitespaceChar(i,n);return n+1<o?new Ci(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;const r=new wi(o.positionLineNumber,o.positionColumn);let a=r.lineNumber,l=r.column;const c=n.getLineCount(),d=n.getLineMaxColumn(a);if(a===c&&l===d)return null;if(s){let e=this._deleteWordRightWhitespace(n,r);if(e)return e}let h=WL._findNextWordOnLine(i,n,r);return 2===t?h?l=h.end+1:l<d||a===c?l=d:(a++,h=WL._findNextWordOnLine(i,n,new wi(a,1)),l=h?h.start+1:n.getLineMaxColumn(a)):(h&&l>=h.start+1&&(h=WL._findNextWordOnLine(i,n,new wi(a,h.end+1))),h?l=h.start+1:l<d||a===c?l=d:(a++,h=WL._findNextWordOnLine(i,n,new wi(a,1)),l=h?h.start+1:n.getLineMaxColumn(a))),new Ci(a,l,r.lineNumber,r.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=WL._moveWordPartRight(e,i);return new Ci(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){const n=new Ci(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=Ev(t),o=WL._findPreviousWordOnLine(n,e,i);if(o&&1===o.wordType&&o.start<=i.column-1&&i.column-1<=o.end)return WL._createWordAtPosition(e,i.lineNumber,o);const s=WL._findNextWordOnLine(n,e,i);return s&&1===s.wordType&&s.start<=i.column-1&&i.column-1<=s.end?WL._createWordAtPosition(e,i.lineNumber,s):null}static word(e,t,i,n,o){const s=Ev(e.wordSeparators);let r,a,l=WL._findPreviousWordOnLine(s,t,o),c=WL._findNextWordOnLine(s,t,o);if(!n){let e,i;return l&&1===l.wordType&&l.start<=o.column-1&&o.column-1<=l.end?(e=l.start+1,i=l.end+1):c&&1===c.wordType&&c.start<=o.column-1&&o.column-1<=c.end?(e=c.start+1,i=c.end+1):(e=l?l.end+1:1,i=c?c.start+1:t.getLineMaxColumn(o.lineNumber)),new Ek(new Ci(o.lineNumber,e,o.lineNumber,i),0,new wi(o.lineNumber,i),0)}l&&1===l.wordType&&l.start<o.column-1&&o.column-1<l.end?(r=l.start+1,a=l.end+1):c&&1===c.wordType&&c.start<o.column-1&&o.column-1<c.end?(r=c.start+1,a=c.end+1):(r=o.column,a=o.column);let d,h=o.lineNumber;if(i.selectionStart.containsPosition(o))d=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){d=r;let e=new wi(h,d);i.selectionStart.containsPosition(e)&&(d=i.selectionStart.endColumn)}else{d=a;let e=new wi(h,d);i.selectionStart.containsPosition(e)&&(d=i.selectionStart.startColumn)}return i.move(!0,h,d,0)}}class VL{static addCursorDown(e,t,i){let n=[],o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new Tk(r.modelState,r.viewState),n[o++]=i?Tk.fromModelState(FL.translateDown(e.cursorConfig,e.model,r.modelState)):Tk.fromViewState(FL.translateDown(e.cursorConfig,e,r.viewState))}return n}static addCursorUp(e,t,i){let n=[],o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new Tk(r.modelState,r.viewState),n[o++]=i?Tk.fromModelState(FL.translateUp(e.cursorConfig,e.model,r.modelState)):Tk.fromViewState(FL.translateUp(e.cursorConfig,e,r.viewState))}return n}static moveToBeginningOfLine(e,t,i){let n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=this._moveToLineStart(e,s,i)}return n}static _moveToLineStart(e,t,i){const n=t.viewState.position.column,o=t.modelState.position.column,s=n===o,r=t.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(r),l=n===a;return s||l?this._moveToLineStartByModel(e,t,i):this._moveToLineStartByView(e,t,i)}static _moveToLineStartByView(e,t,i){return Tk.fromViewState(FL.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return Tk.fromModelState(FL.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){let o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=this._moveToLineEnd(e,r,i,n)}return o}static _moveToLineEnd(e,t,i,n){const o=t.viewState.position,s=e.getLineMaxColumn(o.lineNumber),r=o.column===s,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),c=s-o.column===l-a.column;return r||c?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return Tk.fromViewState(FL.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return Tk.fromModelState(FL.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){let i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.selection.startLineNumber,r=e.model.getLineCount();let a,l=o.modelState.selection.endLineNumber;l===r?a=e.model.getLineMaxColumn(r):(l++,a=1),i[n]=Tk.fromModelState(new Ek(new Ci(s,1,s,1),0,new wi(l,a),0))}return i}static moveToBeginningOfBuffer(e,t,i){let n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=Tk.fromModelState(FL.moveToBeginningOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){let n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=Tk.fromModelState(FL.moveToEndOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static selectAll(e,t){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return Tk.fromModelState(new Ek(new Ci(1,1,1,1),0,new wi(i,n),0))}static line(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new wi(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);if(!i||!t.modelState.hasSelection()){const t=e.model.getLineCount();let i=s.lineNumber+1,n=1;return i>t&&(i=t,n=e.model.getLineMaxColumn(i)),Tk.fromModelState(new Ek(new Ci(s.lineNumber,1,i,n),0,new wi(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumber<a)return Tk.fromViewState(t.viewState.move(t.modelState.hasSelection(),r.lineNumber,1,0));if(s.lineNumber>a){const i=e.getLineCount();let n=r.lineNumber+1,o=1;return n>i&&(n=i,o=e.getLineMaxColumn(n)),Tk.fromViewState(t.viewState.move(t.modelState.hasSelection(),n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return Tk.fromModelState(t.modelState.move(t.modelState.hasSelection(),e.lineNumber,e.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return Tk.fromModelState(WL.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Tk(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Tk.fromViewState(new Ek(new Ci(i,n,i,n),0,new wi(i,n),0))}static moveTo(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new wi(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return Tk.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,o,s){switch(i){case 0:return 4===s?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===s?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===s?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===s?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return 2===s?t.map(t=>Tk.fromViewState(FL.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n))):t.map(t=>Tk.fromModelState(FL.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n)));case 5:return 2===s?t.map(t=>Tk.fromViewState(FL.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n))):t.map(t=>Tk.fromModelState(FL.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,o){const s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 14:{let i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];i[o]=this.findPositionInViewportIfOutside(e,r,s,n)}return i}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){let o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new Tk(t.modelState,t.viewState);{let s;s=o>i.endLineNumber-1?i.endLineNumber-1:o<i.startLineNumber?i.startLineNumber:o;const r=FL.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,s,!1);return Tk.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=>Tk.fromViewState(FL.moveLeft(e.cursorConfig,e,t.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){let n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineContent(r).length/2);n[o]=Tk.fromViewState(FL.moveLeft(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveRight(e,t,i,n){return t.map(t=>Tk.fromViewState(FL.moveRight(e.cursorConfig,e,t.viewState,i,n)))}static _moveHalfLineRight(e,t,i){let n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineContent(r).length/2);n[o]=Tk.fromViewState(FL.moveRight(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveDownByViewLines(e,t,i,n){let o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Tk.fromViewState(FL.moveDown(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveDownByModelLines(e,t,i,n){let o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Tk.fromModelState(FL.moveDown(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveUpByViewLines(e,t,i,n){let o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Tk.fromViewState(FL.moveUp(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveUpByModelLines(e,t,i,n){let o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Tk.fromModelState(FL.moveUp(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveToViewPosition(e,t,i,n,o){return Tk.fromViewState(t.viewState.move(i,n,o,0))}static _moveToModelPosition(e,t,i,n,o){return Tk.fromModelState(t.modelState.move(i,n,o,0))}static _moveToViewMinColumn(e,t,i){let n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMinColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){let n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewCenterColumn(e,t,i){let n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(r)+e.getLineMinColumn(r))/2);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewMaxColumn(e,t,i){let n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMaxColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){let n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}}var zL;(function(e){const t=function(e){if(!Zr(e))return!1;let t=e;return!!Xr(t.to)&&(!(!ea(t.select)&&!Jr(t.select))&&(!(!ea(t.by)&&!Xr(t.by))&&!(!ea(t.value)&&!Qr(t.value))))};function i(t){if(!t.to)return null;let i;switch(t.to){case e.RawDirection.Left:i=0;break;case e.RawDirection.Right:i=1;break;case e.RawDirection.Up:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.PrevBlankLine:i=4;break;case e.RawDirection.NextBlankLine:i=5;break;case e.RawDirection.WrappedLineStart:i=6;break;case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:i=7;break;case e.RawDirection.WrappedLineColumnCenter:i=8;break;case e.RawDirection.WrappedLineEnd:i=9;break;case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:i=10;break;case e.RawDirection.ViewPortTop:i=11;break;case e.RawDirection.ViewPortBottom:i=13;break;case e.RawDirection.ViewPortCenter:i=12;break;case e.RawDirection.ViewPortIfOutside:i=14;break;default:return null}let n=0;switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Character:n=3;break;case e.RawUnit.HalfLine:n=4;break}return{direction:i,unit:n,select:!!t.select,value:t.value||1}}e.description={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:t,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}}}}]},e.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"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},e.parse=i})(zL||(zL={}));const HL=Object.create(null);function KL(e,t){if(t<=0)return"";HL[e]||(HL[e]=["",e]);const i=HL[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}class jL{constructor(e,t){this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}static unshiftIndent(e,t,i,n,o){const s=tC.visibleColumnFromColumn(e,t,i);if(o){const e=KL(" ",n),t=tC.prevIndentTabStop(s,n),i=t/n;return KL(e,i)}{const e="\t",t=tC.prevRenderTabStop(s,i),n=t/i;return KL(e,n)}}static shiftIndent(e,t,i,n,o){const s=tC.visibleColumnFromColumn(e,t,i);if(o){const e=KL(" ",n),t=tC.nextIndentTabStop(s,n),i=t/n;return KL(e,i)}{const e="\t",t=tC.nextRenderTabStop(s,i),n=t/i;return KL(e,n)}}_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:o,indentSize:s,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,c=0;for(let d=i;d<=n;d++,l=c){c=0;let n,h=e.getLineContent(d),u=Bs(h);if((!this._opts.isUnshift||0!==h.length&&0!==u)&&(a||this._opts.isUnshift||0!==h.length)){if(-1===u&&(u=h.length),d>1){let t=tC.visibleColumnFromColumn(h,u+1,o);if(t%s!==0&&e.isCheapToTokenize(d-1)){let t=Th.getEnterAction(this._opts.autoIndent,e,new Ci(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)));if(t){if(c=l,t.appendText)for(let e=0,i=t.appendText.length;e<i&&c<s;e++){if(32!==t.appendText.charCodeAt(e))break;c++}t.removeText&&(c=Math.max(0,c-t.removeText));for(let e=0;e<c;e++){if(0===u||32!==h.charCodeAt(u-1))break;u--}}}}this._opts.isUnshift&&0===u||(n=this._opts.isUnshift?jL.unshiftIndent(h,u+1,o,s,r):jL.shiftIndent(h,u+1,o,s,r),this._addEditOperation(t,new Ci(d,1,d,u+1),n),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 o=r?KL(" ",s):"\t";for(let r=i;r<=n;r++){const n=e.getLineContent(r);let l=Bs(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,s);for(let e=0;e<l;e++){const t=n.charCodeAt(e);if(9===t){l=e+1;break}}this._addEditOperation(t,new Ci(r,1,r,l+1),"")}else this._addEditOperation(t,new Ci(r,1,r,1),o),r!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){let 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){let e=this._selection.startColumn,t=i.startColumn;return t<=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}}class UL{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new Ci(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new Ci(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){let i=t.getInverseEditOperations(),n=i[0].range,o=i[1].range;return new yi(n.endLineNumber,n.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class $L{static indent(e,t,i){if(null===t||null===i)return[];let n=[];for(let o=0,s=i.length;o<s;o++)n[o]=new jL(i[o],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent});return n}static outdent(e,t,i){let n=[];for(let o=0,s=i.length;o<s;o++)n[o]=new jL(i[o],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent});return n}static shiftIndent(e,t,i){return i=i||1,jL.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,jL.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,i,n){let o=[];for(let s=0,r=i.length;s<r;s++)o[s]=new ML(i[s],n[s]);return new Mk(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,o){let s=[];for(let r=0,a=i.length;r<a;r++){const e=i[r];let t=e.getPosition();if(o&&!e.isEmpty()&&(o=!1),o&&n.indexOf("\n")!==n.length-1&&(o=!1),o){let i=new Ci(t.lineNumber,1,t.lineNumber,1);s[r]=new PL(i,n,e,!0)}else s[r]=new ML(e,n)}return new Mk(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,o){if(n)return null;if(1===t.length)return null;if(o&&o.length===t.length)return o;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));let e=Fs(i);if(e.length===t.length)return e}return null}static paste(e,t,i,n,o,s){const r=this._distributePasteToCursors(e,i,n,o,s);return r?(i=i.sort(Ci.compareRangesUsingStarts),this._distributedPaste(e,t,i,r)):this._simplePaste(e,t,i,n,o)}static _goodIndentForLine(e,t,i){let n=null,o="";const s=Th.getInheritIndentForLine(e.autoIndent,t,i,!1);if(s)n=s.action,o=s.indentation;else if(i>1){let n;for(n=i-1;n>=1;n--){const e=t.getLineContent(n),i=Vs(e);if(i>=0)break}if(n<1)return null;const s=t.getLineMaxColumn(n),r=Th.getEnterAction(e.autoIndent,t,new Ci(n,s,n,s));r&&(o=r.indentation+r.appendText)}return n&&(n===ed.Indent&&(o=$L.shiftIndent(e,o)),n===ed.Outdent&&(o=$L.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="",s=i.getStartPosition();if(e.insertSpaces){let i=tC.visibleColumnFromColumn2(e,t,s),n=e.indentSize,r=n-i%n;for(let e=0;e<r;e++)o+=" "}else o="\t";return new ML(i,o,n)}static tab(e,t,i){let n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o];if(s.isEmpty()){let i=t.getLineContent(s.startLineNumber);if(/^\s*$/.test(i)&&t.isCheapToTokenize(s.startLineNumber)){let r=this._goodIndentForLine(e,t,s.startLineNumber);r=r||"\t";let a=e.normalizeIndentation(r);if(!i.startsWith(a)){n[o]=new ML(new Ci(s.startLineNumber,1,s.startLineNumber,i.length+1),a,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,s,!0)}else{if(s.startLineNumber===s.endLineNumber){let i=t.getLineMaxColumn(s.startLineNumber);if(1!==s.startColumn||s.endColumn!==i){n[o]=this._replaceJumpToNextIndent(e,t,s,!1);continue}}n[o]=new jL(s,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent})}}return n}static compositionType(e,t,i,n,o,s,r,a){const l=n.map(e=>this._compositionType(i,e,o,s,r,a));return new Mk(4,l,{shouldPushStackElementBefore:YL(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,s){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+o),c=new Ci(r.lineNumber,a,r.lineNumber,l),d=e.getValueInRange(c);return d===i&&0===s?null:new AL(c,i,0,s)}static _typeCommand(e,t,i){return i?new OL(e,t,!0):new ML(e,t,!0)}static _enter(e,t,i,n){if(0===e.autoIndent)return $L._typeCommand(n,"\n",i);if(!t.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){let o=t.getLineContent(n.startLineNumber),s=Ws(o).substring(0,n.startColumn-1);return $L._typeCommand(n,"\n"+e.normalizeIndentation(s),i)}const o=Th.getEnterAction(e.autoIndent,t,n);if(o){if(o.indentAction===ed.None)return $L._typeCommand(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ed.Indent)return $L._typeCommand(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ed.IndentOutdent){const t=e.normalizeIndentation(o.indentation),s=e.normalizeIndentation(o.indentation+o.appendText),r="\n"+s+"\n"+t;return i?new OL(n,r,!0):new AL(n,r,-1,s.length-t.length,!0)}if(o.indentAction===ed.Outdent){const t=$L.unshiftIndent(e,o.indentation);return $L._typeCommand(n,"\n"+e.normalizeIndentation(t+o.appendText),i)}}const s=t.getLineContent(n.startLineNumber),r=Ws(s).substring(0,n.startColumn-1);if(e.autoIndent>=4){const o=Th.getIndentForEnter(e.autoIndent,t,n,{unshiftIndent:t=>$L.unshiftIndent(e,t),shiftIndent:t=>$L.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)});if(o){let s=tC.visibleColumnFromColumn2(e,t,n.getEndPosition());const r=n.endColumn,a=t.getLineContent(n.endLineNumber),l=Bs(a);if(n=l>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,l+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new OL(n,"\n"+e.normalizeIndentation(o.afterEnter),!0);{let t=0;return r<=l+1&&(e.insertSpaces||(s=Math.ceil(s/e.indentSize)),t=Math.min(s+1-e.normalizeIndentation(o.afterEnter).length-1,0)),new AL(n,"\n"+e.normalizeIndentation(o.afterEnter),0,t,!0)}}}return $L._typeCommand(n,"\n"+e.normalizeIndentation(r),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;n<o;n++)if(!t.isCheapToTokenize(i[n].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const o=Th.getIndentationAtPosition(t,i.startLineNumber,i.startColumn),s=Th.getIndentActionForType(e.autoIndent,t,i,n,{shiftIndent:t=>$L.shiftIndent(e,t),unshiftIndent:t=>$L.unshiftIndent(e,t)});if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===o?$L._typeCommand(new Ci(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):$L._typeCommand(new Ci(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(o-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,r=i.length;s<r;s++){const r=i[s];if(!r.isEmpty())return!1;const a=r.getPosition(),l=t.getLineContent(a.lineNumber),c=l.charAt(a.column-1);if(c!==o)return!1;const d=Ok(o),h=a.column>2?l.charCodeAt(a.column-2):0;if(92===h&&d)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,o){let s=[];for(let r=0,a=n.length;r<a;r++){const e=n[r],t=e.getPosition(),i=new Ci(t.lineNumber,t.column,t.lineNumber,t.column+1);s[r]=new ML(i,o)}return new Mk(4,s,{shouldPushStackElementBefore:YL(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],s=n.some(e=>t.startsWith(e.open)),r=o.some(e=>t.startsWith(e.close));return!s&&r}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let s=null;for(const r of o)if(null===s||r.open.length>s.open.length){let e=!0;for(const o of i){const i=t.getValueInRange(new Ci(o.lineNumber,o.column-r.open.length+1,o.lineNumber,o.column));if(i+n!==r.open){e=!1;break}}e&&(s=r)}return s}static _findSubAutoClosingPairClose(e,t){if(t.open.length<=1)return"";const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const s of n)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!o||s.open.length>o.open.length)&&(o=s);return o?o.close:""}static _getAutoClosingPairClose(e,t,i,n,o){const s=Ok(n),r=s?e.autoClosingQuotes:e.autoClosingBrackets;if("never"===r)return null;const a=this._findAutoClosingPairOpen(e,t,i.map(e=>e.getPosition()),n);if(!a)return null;const l=this._findSubAutoClosingPairClose(e,a);let c=!0;const d=s?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;for(let u=0,g=i.length;u<g;u++){const s=i[u];if(!s.isEmpty())return null;const g=s.getPosition(),f=t.getLineContent(g.lineNumber),m=f.substring(g.column-1);if(m.startsWith(l)||(c=!1),f.length>g.column-1){const t=f.charAt(g.column-1),i=$L._isBeforeClosingBrace(e,m);if(!i&&!d(t))return null}if(!t.isCheapToTokenize(g.lineNumber))return null;if(1===a.open.length&&("'"===n||'"'===n)&&"always"!==r){const t=Ev(e.wordSeparators);if(o&&g.column>1&&0===t.get(f.charCodeAt(g.column-2)))return null;if(!o&&g.column>2&&0===t.get(f.charCodeAt(g.column-3)))return null}t.forceTokenization(g.lineNumber);const p=t.getLineTokens(g.lineNumber);let _=!1;try{_=Th.shouldAutoClosePair(a,p,o?g.column:g.column-1)}catch(h){xe(h)}if(!_)return null}return c?a.close.substring(0,a.close.length-l.length):a.close}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){let a=[];for(let l=0,c=n.length;l<c;l++){const e=n[l];a[l]=new qL(e,o,s,r)}return new Mk(4,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return Ok(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}static _isSurroundSelectionType(e,t,i,n){if(!$L._shouldSurroundChar(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;const o=Ok(n);for(let s=0,r=i.length;s<r;s++){const e=i[s];if(e.isEmpty())return!1;let n=!0;for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const o=t.getLineContent(i),s=i===e.startLineNumber?e.startColumn-1:0,r=i===e.endLineNumber?e.endColumn-1:o.length,a=o.substring(s,r);if(/[^ \t]/.test(a)){n=!1;break}}if(n)return!1;if(o&&e.startLineNumber===e.endLineNumber&&e.startColumn+1===e.endColumn){const i=t.getValueInRange(e);if(Ok(i))return!1}}return!0}static _runSurroundSelectionType(e,t,i,n,o){let s=[];for(let r=0,a=n.length;r<a;r++){const e=n[r],i=t.surroundingPairs[o];s[r]=new UL(e,o,i)}return new Mk(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,i){return!(1!==i.length||!t.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,n,o){if(!t.electricChars.hasOwnProperty(o)||!n.isEmpty())return null;let s=n.getPosition();i.forceTokenization(s.lineNumber);let r,a=i.getLineTokens(s.lineNumber);try{r=Th.onElectricCharacter(o,a,s.column)}catch(l){return xe(l),null}if(!r)return null;if(r.matchOpenBracket){let n=(a.getLineContent()+o).lastIndexOf(r.matchOpenBracket)+1,l=i.findMatchingBracketUp(r.matchOpenBracket,{lineNumber:s.lineNumber,column:n});if(l){if(l.startLineNumber===s.lineNumber)return null;let n=i.getLineContent(l.startLineNumber),r=Ws(n),a=t.normalizeIndentation(r),c=i.getLineContent(s.lineNumber),d=i.getLineFirstNonWhitespaceColumn(s.lineNumber)||s.column,h=c.substring(d-1,s.column-1),u=a+h+o,g=new Ci(s.lineNumber,1,s.lineNumber,s.column);const f=new ML(g,u);return new Mk(GL(u,e),[f],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,n,o,s){if(!n||yi.selectionsArrEqual(n,o))return null;let r=null;for(const l of o){if(!l.isEmpty())return null;const e=l.getPosition(),t=i.getValueInRange(new Ci(e.lineNumber,e.column-1,e.lineNumber,e.column));if(null===r)r=t;else if(r!==t)return null}if(!r)return null;if(this._isAutoClosingOvertype(t,i,o,s,r)){const e=o.map(e=>new ML(new Ci(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1));return new Mk(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const a=this._getAutoClosingPairClose(t,i,o,r,!1);return null!==a?this._runAutoClosingOpenCharType(e,t,i,o,r,!1,a):null}static typeWithInterceptors(e,t,i,n,o,s,r){if(!e&&"\n"===r){let e=[];for(let t=0,s=o.length;t<s;t++)e[t]=$L._enter(i,n,!1,o[t]);return new Mk(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,o)){let e=[],t=!1;for(let s=0,a=o.length;s<a;s++)if(e[s]=this._runAutoIndentType(i,n,o[s],r),!e[s]){t=!0;break}if(!t)return new Mk(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoClosingOvertype(i,n,o,s,r))return this._runAutoClosingOvertype(t,i,n,o,r);if(!e){const e=this._getAutoClosingPairClose(i,n,o,r,!0);if(e)return this._runAutoClosingOpenCharType(t,i,n,o,r,!0,e)}if(this._isSurroundSelectionType(i,n,o,r))return this._runSurroundSelectionType(t,i,n,o,r);if(!e&&this._isTypeInterceptorElectricChar(i,n,o)){const e=this._typeInterceptorElectricChar(t,i,n,o[0],r);if(e)return e}let a=[];for(let c=0,d=o.length;c<d;c++)a[c]=new ML(o[c],r);const l=GL(r,t);return new Mk(l,a,{shouldPushStackElementBefore:YL(t,l),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,o){let s=[];for(let a=0,l=n.length;a<l;a++)s[a]=new ML(n[a],o);const r=GL(o,e);return new Mk(r,s,{shouldPushStackElementBefore:YL(e,r),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(null===t||null===i)return[];let n=[];for(let o=0,s=i.length;o<s;o++){let s=i[o].positionLineNumber;if(1===s)n[o]=new OL(new Ci(1,1,1,1),"\n");else{s--;let i=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new Ci(s,i,s,i))}}return n}static lineInsertAfter(e,t,i){if(null===t||null===i)return[];let n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o].positionLineNumber;let r=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new Ci(s,r,s,r))}return n}static lineBreakInsert(e,t,i){let n=[];for(let o=0,s=i.length;o<s;o++)n[o]=this._enter(e,t,!0,i[o]);return n}}class qL extends AL{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){let i=t.getInverseEditOperations(),n=i[0].range;return this.closeCharacterRange=new Ci(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new Ci(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}}function GL(e,t){return" "===e?5===t||6===t?6:5:4}function YL(e,t){return!(!ZL(e)||ZL(t))||5!==e&&XL(e)!==XL(t)}function XL(e){return 6===e||5===e?"space":e}function ZL(e){return 4===e||5===e||6===e}var QL;(function(e){e.editorSimpleInput=new Sm("editorSimpleInput",!1,!0),e.editorTextFocus=new Sm("editorTextFocus",!1,o("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),e.focus=new Sm("editorFocus",!1,o("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),e.textInputFocus=new Sm("textInputFocus",!1,o("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),e.readOnly=new Sm("editorReadonly",!1,o("editorReadonly","Whether the editor is read only")),e.inDiffEditor=new Sm("inDiffEditor",!1,o("inDiffEditor","Whether the context is a diff editor")),e.columnSelection=new Sm("editorColumnSelection",!1,o("editorColumnSelection","Whether `editor.columnSelection` is enabled")),e.writable=e.readOnly.toNegated(),e.hasNonEmptySelection=new Sm("editorHasSelection",!1,o("editorHasSelection","Whether the editor has text selected")),e.hasOnlyEmptySelection=e.hasNonEmptySelection.toNegated(),e.hasMultipleSelections=new Sm("editorHasMultipleSelections",!1,o("editorHasMultipleSelections","Whether the editor has multiple selections")),e.hasSingleSelection=e.hasMultipleSelections.toNegated(),e.tabMovesFocus=new Sm("editorTabMovesFocus",!1,o("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),e.tabDoesNotMoveFocus=e.tabMovesFocus.toNegated(),e.isInWalkThroughSnippet=new Sm("isInEmbeddedEditor",!1,!0),e.canUndo=new Sm("canUndo",!1,!0),e.canRedo=new Sm("canRedo",!1,!0),e.hoverVisible=new Sm("editorHoverVisible",!1,o("editorHoverVisible","Whether the editor hover is visible")),e.inCompositeEditor=new Sm("inCompositeEditor",void 0,o("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),e.notInCompositeEditor=e.inCompositeEditor.toNegated(),e.languageId=new Sm("editorLangId","",o("editorLangId","The language identifier of the editor")),e.hasCompletionItemProvider=new Sm("editorHasCompletionItemProvider",!1,o("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),e.hasCodeActionsProvider=new Sm("editorHasCodeActionsProvider",!1,o("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),e.hasCodeLensProvider=new Sm("editorHasCodeLensProvider",!1,o("editorHasCodeLensProvider","Whether the editor has a code lens provider")),e.hasDefinitionProvider=new Sm("editorHasDefinitionProvider",!1,o("editorHasDefinitionProvider","Whether the editor has a definition provider")),e.hasDeclarationProvider=new Sm("editorHasDeclarationProvider",!1,o("editorHasDeclarationProvider","Whether the editor has a declaration provider")),e.hasImplementationProvider=new Sm("editorHasImplementationProvider",!1,o("editorHasImplementationProvider","Whether the editor has an implementation provider")),e.hasTypeDefinitionProvider=new Sm("editorHasTypeDefinitionProvider",!1,o("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),e.hasHoverProvider=new Sm("editorHasHoverProvider",!1,o("editorHasHoverProvider","Whether the editor has a hover provider")),e.hasDocumentHighlightProvider=new Sm("editorHasDocumentHighlightProvider",!1,o("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),e.hasDocumentSymbolProvider=new Sm("editorHasDocumentSymbolProvider",!1,o("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),e.hasReferenceProvider=new Sm("editorHasReferenceProvider",!1,o("editorHasReferenceProvider","Whether the editor has a reference provider")),e.hasRenameProvider=new Sm("editorHasRenameProvider",!1,o("editorHasRenameProvider","Whether the editor has a rename provider")),e.hasSignatureHelpProvider=new Sm("editorHasSignatureHelpProvider",!1,o("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),e.hasInlayHintsProvider=new Sm("editorHasInlayHintsProvider",!1,o("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),e.hasDocumentFormattingProvider=new Sm("editorHasDocumentFormattingProvider",!1,o("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),e.hasDocumentSelectionFormattingProvider=new Sm("editorHasDocumentSelectionFormattingProvider",!1,o("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),e.hasMultipleDocumentFormattingProvider=new Sm("editorHasMultipleDocumentFormattingProvider",!1,o("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),e.hasMultipleDocumentSelectionFormattingProvider=new Sm("editorHasMultipleDocumentSelectionFormattingProvider",!1,o("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))})(QL||(QL={}));const JL=0;class eE extends u_{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}var tE,iE,nE;(function(e){const t=function(e){if(!Zr(e))return!1;const t=e;return!!Xr(t.to)&&(!(!ea(t.by)&&!Xr(t.by))&&(!(!ea(t.value)&&!Qr(t.value))&&!(!ea(t.revealCursor)&&!Jr(t.revealCursor))))};function i(t){let i,n;switch(t.to){case e.RawDirection.Up:i=1;break;case e.RawDirection.Down:i=2;break;default:return null}switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Page:n=3;break;case e.RawUnit.HalfPage:n=4;break;default:n=2}const o=Math.floor(t.value||1),s=!!t.revealCursor;return{direction:i,unit:n,value:o,revealCursor:s,select:!!t.select}}e.description={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'\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:t,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},e.RawDirection={Up:"up",Down:"down"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage"},e.parse=i})(tE||(tE={})),function(e){const t=function(e){if(!Zr(e))return!1;const t=e;return!(!Qr(t.lineNumber)&&!Xr(t.lineNumber))&&!(!ea(t.at)&&!Xr(t.at))};e.description={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:t,schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},e.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}}(iE||(iE={}));class oE{constructor(e){e.addImplementation(1e4,"code-editor",(e,t)=>{const i=e.get(mn).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)}),e.addImplementation(1e3,"generic-dom-input-textarea",(e,t)=>{const i=document.activeElement;return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(),!0)}),e.addImplementation(0,"generic-dom",(e,t)=>{const i=e.get(mn).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 eE{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[VL.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),e.revealPrimaryCursor(t.source,!0)}}e.MoveTo=f_(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=f_(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends eE{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);e.setCursorStates(t.source,3,i.viewStates.map(e=>Tk.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=f_(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){const o=e.model.validatePosition(n.position),s=e.coordinatesConverter.validateViewPosition(new wi(n.viewPosition.lineNumber,n.viewPosition.column),o);let r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return TL.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=f_(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return TL.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=f_(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return TL.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return TL.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=f_(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=f_(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return TL.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=f_(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=f_(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends eE{constructor(){super({id:"cursorMove",precondition:void 0,description:zL.description})}runCoreEditorCommand(e,t){const i=zL.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,r._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,o=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 VL.simpleMove(e,t,i.direction,n,o,i.unit);case 11:case 13:case 12:case 14:return VL.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=r,e.CursorMove=f_(new r);class a extends eE{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:e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,VL.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=f_(new a({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=f_(new a({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:1039}})),e.CursorRight=f_(new a({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=f_(new a({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:1041}})),e.CursorUp=f_(new a({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=f_(new a({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=f_(new a({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:11}})),e.CursorPageUpSelect=f_(new a({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:1035}})),e.CursorDown=f_(new a({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=f_(new a({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=f_(new a({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:12}})),e.CursorPageDownSelect=f_(new a({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:1036}})),e.CreateCursor=f_(new class extends eE{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){let i;i=t.wholeLine?VL.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):VL.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const o=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;i<r;i++){const r=n[i];if((!o||r.modelState.selection.containsPosition(o))&&(!s||r.viewState.selection.containsPosition(s)))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=f_(new class extends eE{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=VL.moveTo(e,n[i],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class l extends eE{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,VL.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorHome=f_(new l({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=f_(new l({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class c extends eE{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],o=n.modelState.position.lineNumber;t[i]=Tk.fromModelState(n.modelState.move(this._inSelectionMode,o,1,0))}return t}}e.CursorLineStart=f_(new c({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=f_(new c({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:0,mac:{primary:1311}}}));class d extends eE{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,VL.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealPrimaryCursor(t.source,!0)}}e.CursorEnd=f_(new d({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:JL,kbExpr:QL.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:o("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=f_(new d({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:JL,kbExpr:QL.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:o("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class h extends eE{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,o=t.length;n<o;n++){const o=t[n],s=o.modelState.position.lineNumber,r=e.model.getLineMaxColumn(s);i[n]=Tk.fromModelState(o.modelState.move(this._inSelectionMode,s,r,0))}return i}}e.CursorLineEnd=f_(new h({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=f_(new h({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:0,mac:{primary:1315}}}));class u extends eE{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,VL.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorTop=f_(new u({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=f_(new u({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:3086,mac:{primary:3088}}}));class g extends eE{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,VL.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorBottom=f_(new g({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=f_(new g({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:3085,mac:{primary:3090}}}));class f extends eE{constructor(){super({id:"editorScroll",precondition:void 0,description:tE.description})}runCoreEditorCommand(e,t){const i=tE.parse(t);i&&this._runEditorScroll(e,t.source,i)}_runEditorScroll(e,t,i){const n=this._computeDesiredScrollTop(e,i);if(i.revealCursor){const o=e.getCompletelyVisibleViewRangeAtScrollTop(n);e.setCursorStates(t,3,[VL.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),o,i.select)])}e.setScrollTop(n,0)}_computeDesiredScrollTop(e,t){if(1===t.unit){const i=e.getCompletelyVisibleViewRange(),n=e.coordinatesConverter.convertViewRangeToModelRange(i);let o;o=1===t.direction?Math.max(1,n.startLineNumber-t.value):Math.min(e.model.getLineCount(),n.startLineNumber+t.value);const s=e.coordinatesConverter.convertModelPositionToViewPosition(new wi(o,1));return e.getVerticalOffsetForLineNumber(s.lineNumber)}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.getScrollTop()+n*e.cursorConfig.lineHeight}}e.EditorScrollImpl=f,e.EditorScroll=f_(new f),e.ScrollLineUp=f_(new class extends eE{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,i){e.EditorScroll._runEditorScroll(t,i.source,{direction:1,unit:2,value:1,revealCursor:!1,select:!1})}}),e.ScrollPageUp=f_(new class extends eE{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,i){e.EditorScroll._runEditorScroll(t,i.source,{direction:1,unit:3,value:1,revealCursor:!1,select:!1})}}),e.ScrollLineDown=f_(new class extends eE{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,i){e.EditorScroll._runEditorScroll(t,i.source,{direction:2,unit:2,value:1,revealCursor:!1,select:!1})}}),e.ScrollPageDown=f_(new class extends eE{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,i){e.EditorScroll._runEditorScroll(t,i.source,{direction:2,unit:3,value:1,revealCursor:!1,select:!1})}});class m extends eE{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[VL.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),e.revealPrimaryCursor(t.source,!0)}}e.WordSelect=f_(new m({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=f_(new m({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=f_(new class extends eE{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0),s=n[i];o[i]=VL.word(e,s,s.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class p extends eE{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[VL.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),e.revealPrimaryCursor(t.source,!1)}}e.LineSelect=f_(new p({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=f_(new p({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class _ extends eE{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=VL.line(e,n[i],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}}e.LastCursorLineSelect=f_(new _({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=f_(new _({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.ExpandLineSelection=f_(new class extends eE{constructor(){super({id:"expandLineSelection",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:2090}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,VL.expandLineSelection(e,e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}}),e.CancelSelection=f_(new class extends eE{constructor(){super({id:"cancelSelection",precondition:QL.hasNonEmptySelection,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[VL.cancelSelection(e,e.getPrimaryCursorState())]),e.revealPrimaryCursor(t.source,!0)}}),e.RemoveSecondaryCursors=f_(new class extends eE{constructor(){super({id:"removeSecondaryCursors",precondition:QL.hasMultipleSelections,kbOpts:{weight:JL+1,kbExpr:QL.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealPrimaryCursor(t.source,!0),Ap(o("removedCursor","Removed secondary cursors"))}}),e.RevealLine=f_(new class extends eE{constructor(){super({id:"revealLine",precondition:void 0,description:iE.description})}runCoreEditorCommand(e,t){const i=t,n=i.lineNumber||0;let o="number"===typeof n?n+1:parseInt(n)+1;o<1&&(o=1);const s=e.model.getLineCount();o>s&&(o=s);const r=new Ci(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case iE.RawAtArgument.Top:a=3;break;case iE.RawAtArgument.Center:a=1;break;case iE.RawAtArgument.Bottom:a=4;break;default:break}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends oE{constructor(){super(S_)}runDOMCommand(){Sn&&(document.activeElement.focus(),document.activeElement.select()),document.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,[VL.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=f_(new class extends eE{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[Tk.fromModelSelection(t.selection)])}})})(nE||(nE={}));const sE=im.and(QL.textInputFocus,QL.columnSelection);function rE(e,t){Am.registerKeybindingRule({id:e,primary:t,when:sE,weight:JL+1})}function aE(e){return e.register(),e}var lE,cE;rE(nE.CursorColumnSelectLeft.id,1039),rE(nE.CursorColumnSelectRight.id,1041),rE(nE.CursorColumnSelectUp.id,1040),rE(nE.CursorColumnSelectPageUp.id,1035),rE(nE.CursorColumnSelectDown.id,1042),rE(nE.CursorColumnSelectPageDown.id,1036),function(e){class t extends u_{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=f_(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:QL.writable,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,$L.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=f_(new class extends t{constructor(){super({id:"outdent",precondition:QL.writable,kbOpts:{weight:JL,kbExpr:im.and(QL.editorTextFocus,QL.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,$L.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=f_(new class extends t{constructor(){super({id:"tab",precondition:QL.writable,kbOpts:{weight:JL,kbExpr:im.and(QL.editorTextFocus,QL.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,$L.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=f_(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=BL.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=f_(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:JL,kbExpr:QL.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=BL.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends oE{constructor(){super(C_)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(80))return t.getModel().undo()}},e.Redo=new class extends oE{constructor(){super(y_)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(80))return t.getModel().redo()}}}(lE||(lE={}));class dE extends c_{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(mn).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function hE(e,t){aE(new dE("default:"+e,e)),aE(new dE(e,e,t))}hE("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),hE("replacePreviousChar"),hE("compositionType"),hE("compositionStart"),hE("compositionEnd"),hE("paste"),hE("cut");class uE{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){nE.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new wi(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(69)){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(69)){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=s["d"]&&t.get(95),n=t.get(18);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):2===e.mouseDownCount?this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)}_usualArgs(e){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e}}moveTo(e){nE.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){nE.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),nE.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),nE.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){nE.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){nE.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){nE.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){nE.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){nE.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){nE.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){nE.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){nE.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){nE.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 gE{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){this.onKeyDown&&this.onKeyDown(e)}emitKeyUp(e){this.onKeyUp&&this.onKeyUp(e)}emitContextMenu(e){this.onContextMenu&&this.onContextMenu(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove&&this.onMouseMove(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave&&this.onMouseLeave(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown&&this.onMouseDown(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp&&this.onMouseUp(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag&&this.onMouseDrag(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop&&this.onMouseDrop(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled&&this.onMouseDropCanceled()}emitMouseWheel(e){this.onMouseWheel&&this.onMouseWheel(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return gE.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){return new fE(e.element,e.type,e.mouseColumn,e.position?t.convertViewPositionToModelPosition(e.position):null,e.range?t.convertViewRangeToModelRange(e.range):null,e.detail)}}class fE{constructor(e,t,i,n,o,s){this.element=e,this.type=t,this.mouseColumn=i,this.position=n,this.range=o,this.detail=s}toString(){return Wk.toString(this)}}class mE{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 Error("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 o=0,s=0;for(let a=i;a<=n;a++){const i=a-this._rendLineNumberStart;e<=a&&a<=t&&(0===s?(o=i,s=1):s++)}if(e<i){let n=0;n=t<i?t-e+1:i-e,this._rendLineNumberStart-=n}const r=this._lines.splice(o,s);return r}onLinesChanged(e,t){if(0===this.getCount())return!1;const i=this.getStartLineNumber(),n=this.getEndLineNumber();let o=!1;for(let s=e;s<=t;s++)s>=i&&s<=n&&(this._lines[s-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o){const t=this._lines.splice(e-this._rendLineNumberStart,o-e+1);return t}const s=[];for(let d=0;d<i;d++)s[d]=this._createLine();const r=e-this._rendLineNumberStart,a=this._lines.slice(0,r),l=this._lines.slice(r,this._lines.length-i),c=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=a.concat(s).concat(l),c}onTokensChanged(e){if(0===this.getCount())return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let n=!1;for(let o=0,s=e.length;o<s;o++){const s=e[o];if(s.toLineNumber<t||s.fromLineNumber>i)continue;const r=Math.max(t,s.fromLineNumber),a=Math.min(i,s.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class pE{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new mE(()=>this._host.createVisibleLine())}_createDomNode(){const e=R_(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(129)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;i<n;i++){const e=t[i].getDomNode();e&&this.domNode.domNode.removeChild(e)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;i<n;i++){const e=t[i].getDomNode();e&&this.domNode.domNode.removeChild(e)}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 _E(this.domNode.domNode,this._host,e),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class _E{constructor(e,t,i){this.domNode=e,this.host=t,this.viewportData=i}render(e,t,i,n){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let e=t;e<=i;e++)o.lines[e-t]=this.host.createVisibleLine();return this._finishRendering(o,!0,n),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),n,t),o.rendLineNumberStart>t){const e=t,s=Math.min(i,o.rendLineNumberStart-1);e<=s&&(this._insertLinesBefore(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart<t){const e=Math.min(o.linesLength,t-o.rendLineNumberStart);e>0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const e=o.rendLineNumberStart+o.linesLength,s=i;e<=s&&(this._insertLinesAfter(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1,n=t-e+1;n>0&&(this._removeLinesAfter(o,n),o.linesLength-=n)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let a=t;a<=i;a++){const e=s+a;r[a].layoutLine(e,n[e-o])}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let a=t;a<=i;a++)s[r++]=this.host.createVisibleLine();e.lines=s.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,o){const s=[];let r=0;for(let a=t;a<=i;a++)s[r++]=this.host.createVisibleLine();e.lines=e.lines.concat(s)}_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){_E._ttPolicy&&(i=_E._ttPolicy.createHTML(i));const o=this.domNode.lastChild;t||!o?this.domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let s=this.domNode.lastChild;for(let r=e.linesLength-1;r>=0;r--){const t=e.lines[r];n[r]&&(t.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");_E._ttPolicy&&(t=_E._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;o<e.linesLength;o++){const t=e.lines[o];if(i[o]){const e=n.firstChild,i=t.getDomNode();i.parentNode.replaceChild(e,i),t.setDomNode(e)}}}_finishRendering(e,t,i){const n=_E._sb,o=e.linesLength,s=e.lines,r=e.rendLineNumberStart,a=[];{n.reset();let l=!1;for(let e=0;e<o;e++){const t=s[e];a[e]=!1;const o=t.getDomNode();if(o)continue;const c=t.renderLine(e+r,i[e],this.viewportData,n);c&&(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<o;e++){const o=s[e];if(l[e]=!1,a[e])continue;const c=o.renderLine(e+r,i[e],this.viewportData,n);c&&(l[e]=!0,t=!0)}t&&this._finishRenderingInvalidLines(e,n.build(),l)}}}_E._ttPolicy=null===(cE=window.trustedTypes)||void 0===cE?void 0:cE.createPolicy("editorViewLayer",{createHTML:e=>e}),_E._sb=pd(1e5);class bE extends Q_{constructor(e){super(e),this._visibleLines=new pE(this),this.domNode=this._visibleLines.domNode,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++){const t=this._dynamicOverlays[e];if(t.shouldRender())return!0}return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++){const t=this._dynamicOverlays[e];t.dispose()}this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new vE(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++){const t=this._visibleLines.getVisibleLine(n);t.onConfigurationChanged(e)}return!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 vE{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(58),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=R_(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(58)}renderLine(e,t,i,n){let o="";for(let s=0,r=this._dynamicOverlays.length;s<r;s++){const t=this._dynamicOverlays[s];o+=t.render(i.startLineNumber,e)}return this._renderedContent!==o&&(this._renderedContent=o,n.appendASCIIString('<div style="position:absolute;top:'),n.appendASCIIString(String(t)),n.appendASCIIString("px;width:100%;height:"),n.appendASCIIString(String(this._lineHeight)),n.appendASCIIString('px;">'),n.appendASCIIString(o),n.appendASCIIString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class wE extends bE{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._contentWidth=i.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 CE extends bE{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),A_.applyFontInfo(this.domNode,t.get(43))}onConfigurationChanged(e){const t=this._context.configuration.options;A_.applyFontInfo(this.domNode,t.get(43));const i=t.get(129);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 yE{constructor(e,t){this._coordinateBrand=void 0,this.top=e,this.left=t}}class SE extends Q_{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=R_(document.createElement("div")),J_.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=R_(document.createElement("div")),J_.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){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onLineMappingChanged(e);return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}addWidget(e){const t=new xE(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){const n=this._widgets[e.getId()];n.setPosition(t,i),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 xE{constructor(e,t,i){this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=R_(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,o=n.get(129);this._fixedOverflowWidgets=n.get(36),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(58),this._range=null,this._viewRange=null,this._preference=[],this._cachedDomNodeClientWidth=-1,this._cachedDomNodeClientHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),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(58),e.hasChanged(129)){const e=t.get(129);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}onLineMappingChanged(e){this._setPosition(this._range)}_setPosition(e){if(this._range=e,this._viewRange=null,this._range){const e=this._context.model.validateModelRange(this._range);(this._context.model.coordinatesConverter.modelPositionIsVisible(e.getStartPosition())||this._context.model.coordinatesConverter.modelPositionIsVisible(e.getEndPosition()))&&(this._viewRange=this._context.model.coordinatesConverter.convertModelRangeToViewRange(e))}}_getMaxWidth(){return this.allowEditorOverflow?window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth:this._contentWidth}setPosition(e,t){this._setPosition(e),this._preference=t,this._cachedDomNodeClientWidth=-1,this._cachedDomNodeClientHeight=-1}_layoutBoxInViewport(e,t,i,n,o){const s=e.top,r=s,a=t.top+this._lineHeight,l=o.viewportHeight-a,c=s-n,d=r>=n,h=a,u=l>=n;let g=e.left,f=t.left;return g+i>o.scrollLeft+o.viewportWidth&&(g=o.scrollLeft+o.viewportWidth-i),f+i>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-i),g<o.scrollLeft&&(g=o.scrollLeft),f<o.scrollLeft&&(f=o.scrollLeft),{fitsAbove:d,aboveTop:c,aboveLeft:g,fitsBelow:u,belowTop:h,belowLeft:f}}_layoutHorizontalSegmentInPage(e,t,i,n){const o=Math.max(0,t.left-n),s=Math.min(t.left+t.width+n,e.width);let r=t.left+i-Wo.scrollX;if(r+n>s){const e=r-(s-n);r-=e,i-=e}if(r<o){const e=r-o;r-=e,i-=e}return[i,r]}_layoutBoxInPage(e,t,i,n,o){const s=e.top-n,r=t.top+this._lineHeight,a=Bo(this._viewDomNode.domNode),l=a.top+s-Wo.scrollY,c=a.top+r-Wo.scrollY,d=Ao(document.body),[h,u]=this._layoutHorizontalSegmentInPage(d,a,e.left-o.scrollLeft+this._contentLeft,i),[g,f]=this._layoutHorizontalSegmentInPage(d,a,t.left-o.scrollLeft+this._contentLeft,i),m=22,p=22,_=l>=m,b=c+n<=d.height-p;return this._fixedOverflowWidgets?{fitsAbove:_,aboveTop:Math.max(l,m),aboveLeft:u,fitsBelow:b,belowTop:c,belowLeft:f}:{fitsAbove:_,aboveTop:s,aboveLeft:h,fitsBelow:b,belowTop:r,belowLeft:g}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new yE(e.top,e.left+this._contentLeft)}_getTopAndBottomLeft(e){if(!this._viewRange)return[null,null];const t=e.linesVisibleRangesForRange(this._viewRange,!1);if(!t||0===t.length)return[null,null];let i=t[0],n=t[0];for(const d of t)d.lineNumber<i.lineNumber&&(i=d),d.lineNumber>n.lineNumber&&(n=d);let o=1073741824;for(const d of i.ranges)d.left<o&&(o=d.left);let s=1073741824;for(const d of n.ranges)d.left<s&&(s=d.left);const r=e.getVerticalOffsetForLineNumber(i.lineNumber)-e.scrollTop,a=new yE(r,o),l=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.scrollTop,c=new yE(l,s);return[a,c]}_prepareRenderWidget(e){const[t,i]=this._getTopAndBottomLeft(e);if(!t||!i)return null;if(-1===this._cachedDomNodeClientWidth||-1===this._cachedDomNodeClientHeight){let e=null;if("function"===typeof this._actual.beforeRender&&(e=kE(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeClientWidth=e.width,this._cachedDomNodeClientHeight=e.height;else{const e=this.domNode.domNode;this._cachedDomNodeClientWidth=e.clientWidth,this._cachedDomNodeClientHeight=e.clientHeight}}let n;if(n=this.allowEditorOverflow?this._layoutBoxInPage(t,i,this._cachedDomNodeClientWidth,this._cachedDomNodeClientHeight,e):this._layoutBoxInViewport(t,i,this._cachedDomNodeClientWidth,this._cachedDomNodeClientHeight,e),this._preference)for(let o=1;o<=2;o++)for(const e of this._preference)if(1===e){if(!n)return null;if(2===o||n.fitsAbove)return{coordinate:new yE(n.aboveTop,n.aboveLeft),position:1}}else{if(2!==e)return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(t),position:0}:{coordinate:t,position:0};if(!n)return null;if(2===o||n.fitsBelow)return{coordinate:new yE(n.belowTop,n.belowLeft),position:2}}return null}onBeforeRender(e){this._viewRange&&this._preference&&(this._viewRange.endLineNumber<e.startLineNumber||this._viewRange.startLineNumber>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&&kE(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&&kE(this._actual.afterRender,this._actual,this._renderData.position)}}function kE(e,t,...i){try{return e.call(t,...i)}catch(n){return null}}i("a2e5");let LE=!0;class EE extends CL{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._renderLineHighlight=t.get(84),this._renderLineHighlightOnlyWhenFocus=t.get(85),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=LE?this._selections.slice(0,1):this._selections,i=t.map(e=>e.positionLineNumber);i.sort((e,t)=>e-t),yu(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=t.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(129);return this._lineHeight=t.get(58),this._renderLineHighlight=t.get(84),this._renderLineHighlightOnlyWhenFocus=t.get(85),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=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let s=0;const r=[];for(let a=i;a<=n;a++){const e=a-i;while(s<o&&this._cursorLineNumbers[s]<a)s++;s<o&&this._cursorLineNumbers[s]===a?r[e]=t:r[e]=""}this._renderData=r}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}}class DE extends EE{_renderOne(e){const t="current-line"+(this._shouldRenderOther()?" current-line-both":"");return`<div class="${t}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderOther(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class NE extends EE{_renderOne(e){const t="current-line"+(this._shouldRenderMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"");return`<div class="${t}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderThis(){return!0}_shouldRenderOther(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}Qp((e,t)=>{LE=!1;const i=e.getColor(ox);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(sx)){const i=e.getColor(sx);i&&(LE=!0,t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),"hc"===e.type&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});i("cc1a");class IE extends CL{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=t.get(43).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(58),this._typicalHalfwidthCharacterWidth=t.get(43).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 a=0,l=t.length;a<l;a++){const e=t[a];e.options.className&&(i[n++]=e)}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:Ci.compareRangesUsingStarts(e.range,t.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let a=o;a<=s;a++){const e=a-o;r[e]=""}this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r<a;r++){const e=t[r];if(!e.options.isWholeLine)continue;const a='<div class="cdr '+e.options.className+'" style="left:0;width:100%;height:'+n+'px;"></div>',l=Math.max(e.range.startLineNumber,o),c=Math.min(e.range.endLineNumber,s);for(let t=l;t<=c;t++){const e=t-o;i[e]+=a}}}_renderNormalDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber;let s=null,r=!1,a=null;for(let l=0,c=t.length;l<c;l++){const c=t[l];if(c.options.isWholeLine)continue;const d=c.options.className,h=Boolean(c.options.showIfCollapsed);let u=c.range;h&&1===u.endColumn&&u.endLineNumber!==u.startLineNumber&&(u=new Ci(u.startLineNumber,u.startColumn,u.endLineNumber-1,this._context.model.getLineMaxColumn(u.endLineNumber-1))),s===d&&r===h&&Ci.areIntersectingOrTouching(a,u)?a=Ci.plusRange(a,u):(null!==s&&this._renderNormalDecoration(e,a,s,r,n,o,i),s=d,r=h,a=u)}null!==s&&this._renderNormalDecoration(e,a,s,r,n,o,i)}_renderNormalDecoration(e,t,i,n,o,s,r){const a=e.linesVisibleRangesForRange(t,"findMatch"===i);if(a)for(let l=0,c=a.length;l<c;l++){const e=a[l];if(e.outsideRenderedLine)continue;const t=e.lineNumber-s;if(n&&1===e.ranges.length){const t=e.ranges[0];0===t.width&&(e.ranges[0]=new nb(t.left,this._typicalHalfwidthCharacterWidth))}for(let n=0,s=e.ranges.length;n<s;n++){const s=e.ranges[n],a='<div class="cdr '+i+'" style="left:'+String(s.left)+"px;width:"+String(s.width)+"px;height:"+o+'px;"></div>';r[t]+=a}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class TE extends Ye{onclick(e,t){this._register(bo(e,os.CLICK,e=>t(new qn(e))))}onmousedown(e,t){this._register(bo(e,os.MOUSE_DOWN,e=>t(new qn(e))))}onmouseover(e,t){this._register(bo(e,os.MOUSE_OVER,e=>t(new qn(e))))}onnonbubblingmouseout(e,t){this._register(yo(e,e=>t(new qn(e))))}onkeydown(e,t){this._register(bo(e,os.KEY_DOWN,e=>t(new Hn(e))))}onkeyup(e,t){this._register(bo(e,os.KEY_UP,e=>t(new Hn(e))))}oninput(e,t){this._register(bo(e,os.INPUT,t))}onblur(e,t){this._register(bo(e,os.BLUR,t))}onfocus(e,t){this._register(bo(e,os.FOCUS,t))}ignoreGesture(e){V_.ignoreTarget(e)}}const ME=11;class OE extends TE{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","undefined"!==typeof e.top&&(this.bgDomNode.style.top="0px"),"undefined"!==typeof e.left&&(this.bgDomNode.style.left="0px"),"undefined"!==typeof e.bottom&&(this.bgDomNode.style.bottom="0px"),"undefined"!==typeof e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...e.icon.classNamesArray),this.domNode.style.position="absolute",this.domNode.style.width=ME+"px",this.domNode.style.height=ME+"px","undefined"!==typeof e.top&&(this.domNode.style.top=e.top+"px"),"undefined"!==typeof e.left&&(this.domNode.style.left=e.left+"px"),"undefined"!==typeof e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),"undefined"!==typeof e.right&&(this.domNode.style.right=e.right+"px"),this._mouseMoveMonitor=this._register(new H_),this.onmousedown(this.bgDomNode,e=>this._arrowMouseDown(e)),this.onmousedown(this.domNode,e=>this._arrowMouseDown(e)),this._mousedownRepeatTimer=this._register(new oo),this._mousedownScheduleRepeatTimer=this._register(new no)}_arrowMouseDown(e){const t=()=>{this._mousedownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet(t,200),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,z_,e=>{},()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class AE extends Ye{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 no)}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(()=>{this._domNode&&this._domNode.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode&&this._domNode.setClassName(this._invisibleClassName+(e?" fade":"")))}}const PE=140;class RE extends TE{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 AE(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new H_),this._shouldRender=!0,this.domNode=R_(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this.onmousedown(this.domNode.domNode,e=>this._domNodeMouseDown(e))}_createArrow(e){const t=this._register(new OE(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=R_(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.onmousedown(this.slider.domNode,e=>{e.leftButton&&(e.preventDefault(),this._sliderMouseDown(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()))}_domNodeMouseDown(e){e.target===this.domNode.domNode&&this._onMouseDown(e)}delegateMouseDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderMousePosition(e);i<=o&&o<=n?e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{})):this._onMouseDown(e)}_onMouseDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"===typeof e.browserEvent.offsetX&&"number"===typeof e.browserEvent.offsetY)t=e.browserEvent.offsetX,i=e.browserEvent.offsetY;else{const n=Bo(this.domNode.domNode);t=e.posx-n.left,i=e.posy-n.top}const n=this._mouseDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{}))}_sliderMouseDown(e,t){const i=this._sliderMousePosition(e),n=this._sliderOrthogonalMousePosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,z_,e=>{const t=this._sliderOrthogonalMousePosition(e),r=Math.abs(t-n);if(s["i"]&&r>PE)return void this._setDesiredScrollPositionNow(o.getScrollPosition());const a=this._sliderMousePosition(e),l=a-i;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(l))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd(),t()}),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()}}const FE=20;class BE{constructor(e,t,i,n,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new BE(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,o){const s=Math.max(0,i-e),r=Math.max(0,s-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(FE,Math.floor(i*r/n))),c=(r-l)/(n-i),d=o*c;return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:c,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=BE._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)}}const WE=Kl("scrollbar-button-left",Ul.triangleLeft),VE=Kl("scrollbar-button-right",Ul.triangleRight);class zE extends RE{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new BE(t.horizontalHasArrows?t.arrowSize:0,2===t.horizontal?0:t.horizontalScrollbarSize,2===t.vertical?0:t.verticalScrollbarSize,n.width,n.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const e=(t.arrowSize-ME)/2,i=(t.horizontalScrollbarSize-ME)/2;this._createArrow({className:"scra",icon:WE,top:i,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Gn(null,1,0))}),this._createArrow({className:"scra",icon:VE,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Gn(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}_mouseDownRelativePosition(e,t){return e}_sliderMousePosition(e){return e.posx}_sliderOrthogonalMousePosition(e){return e.posy}_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}}const HE=Kl("scrollbar-button-up",Ul.triangleUp),KE=Kl("scrollbar-button-down",Ul.triangleDown);class jE extends RE{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new BE(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-ME)/2,i=(t.verticalScrollbarSize-ME)/2;this._createArrow({className:"scra",icon:HE,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Gn(null,0,1))}),this._createArrow({className:"scra",icon:KE,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Gn(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}_mouseDownRelativePosition(e,t){return t}_sliderMousePosition(e){return e.posy}_sliderOrthogonalMousePosition(e){return e.posx}_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 UE{constructor(e,t,i,n,o,s){this._scrollStateBrand=void 0,e|=0,t|=0,i|=0,n|=0,o|=0,s|=0,this.rawScrollLeft=i,this.rawScrollTop=s,e<0&&(e=0),i+e>t&&(i=t-e),i<0&&(i=0),n<0&&(n=0),s+n>o&&(s=o-n),s<0&&(s=0),this.width=e,this.scrollWidth=t,this.scrollLeft=i,this.height=n,this.scrollHeight=o,this.scrollTop=s}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 UE("undefined"!==typeof e.width?e.width:this.width,"undefined"!==typeof e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,"undefined"!==typeof e.height?e.height:this.height,"undefined"!==typeof e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new UE(this.width,this.scrollWidth,"undefined"!==typeof e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,"undefined"!==typeof e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=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:o,heightChanged:s,scrollHeightChanged:r,scrollTopChanged:a}}}class $E extends Ye{constructor(e,t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new rt),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e,this._scheduleAtNextAnimationFrame=t,this._state=new UE(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){const i=this._state.withScrollDimensions(e,t);this._setState(i,Boolean(this._smoothScrolling)),this._smoothScrolling&&this._smoothScrolling.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:"undefined"===typeof e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:"undefined"===typeof 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 XE(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=XE.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}_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 qE{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function GE(e,t){const i=t-e;return function(t){return e+i*QE(t)}}function YE(e,t,i){return function(n){return n<i?e(n/i):t((n-i)/(1-i))}}class XE{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){const n=Math.abs(e-t);if(n>2.5*i){let n,o;return e<t?(n=e+.75*i,o=t-.75*i):(n=e-.75*i,o=t+.75*i),YE(GE(e,n),GE(o,t),.33)}return GE(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 qE(e,i,!1)}return new qE(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return XE.start(e,t,i)}static start(e,t,i){i+=10;const n=Date.now()-10;return new XE(e,t,n,i)}}function ZE(e){return Math.pow(e,3)}function QE(e){return 1-ZE(1-e)}i("7043");const JE=500,eD=50,tD=!0;class iD{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class nD{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;do{const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}while(1);return t<=.5}accept(e,t,i){const n=new iD(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){const t=Math.abs(Math.round(e)-e);return t<.01}}nD.INSTANCE=new nD;class oD extends TE{constructor(e,t,i){super(),this._onScroll=this._register(new rt),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new rt),e.style.overflow="hidden",this._options=lD(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 jE(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new zE(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=R_(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=R_(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=R_(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.onnonbubblingmouseout(this._listenOnDomNode,e=>this._onMouseOut(e)),this._hideTimeout=this._register(new no),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Ue(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarMouseDown(e){this._verticalScrollbar.delegateMouseDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,s["f"]&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){"undefined"!==typeof e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),"undefined"!==typeof e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),"undefined"!==typeof e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),"undefined"!==typeof e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),"undefined"!==typeof e.horizontal&&(this._options.horizontal=e.horizontal),"undefined"!==typeof e.vertical&&(this._options.vertical=e.vertical),"undefined"!==typeof e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),"undefined"!==typeof e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),"undefined"!==typeof e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}_setListeningToMouseWheel(e){const t=this._mouseWheelToDispose.length>0;if(t!==e&&(this._mouseWheelToDispose=Ue(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new Gn(e))};this._mouseWheelToDispose.push(bo(this._listenOnDomNode,os.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){const t=nD.INSTANCE;if(tD){const i=window.devicePixelRatio/wn();s["i"]||s["d"]?t.accept(Date.now(),e.deltaX/i,e.deltaY/i):t.accept(Date.now(),e.deltaX,e.deltaY)}let i=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(Math.abs(n)>=Math.abs(o)?o=0:n=0),this._options.flipAxes&&([n,o]=[o,n]);const r=!s["f"]&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!r||o||(o=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);const a=this._scrollable.getFutureScrollPosition();let l={};if(n){const e=eD*n,t=a.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(l,t)}if(o){const e=eD*o,t=a.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(l,t)}if(l=this._scrollable.validateScrollPosition(l),a.scrollLeft!==l.scrollLeft||a.scrollTop!==l.scrollTop){const e=tD&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel();e?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),i=!0}}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(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":"",o=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName("shadow"+n),this._topShadowDomNode.setClassName("shadow"+o),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseOut(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(),JE)}}class sD extends oD{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new $E(0,e=>ko(e));super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class rD extends oD{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 aD extends sD{constructor(e,t){super(e,t),this._element=e,this.onScroll(e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)}),this.scanDomNode()}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})}}function lD(e){const t={lazyRender:"undefined"!==typeof e.lazyRender&&e.lazyRender,className:"undefined"!==typeof e.className?e.className:"",useShadows:"undefined"===typeof e.useShadows||e.useShadows,handleMouseWheel:"undefined"===typeof e.handleMouseWheel||e.handleMouseWheel,flipAxes:"undefined"!==typeof e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:"undefined"!==typeof e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:"undefined"!==typeof e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:"undefined"!==typeof e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:"undefined"!==typeof e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:"undefined"!==typeof e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:"undefined"===typeof e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:"undefined"===typeof e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:"undefined"!==typeof e.arrowSize?e.arrowSize:11,listenOnDomNode:"undefined"!==typeof e.listenOnDomNode?e.listenOnDomNode:null,horizontal:"undefined"!==typeof e.horizontal?e.horizontal:1,horizontalScrollbarSize:"undefined"!==typeof e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:"undefined"!==typeof e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:"undefined"!==typeof e.horizontalHasArrows&&e.horizontalHasArrows,vertical:"undefined"!==typeof e.vertical?e.vertical:1,verticalScrollbarSize:"undefined"!==typeof e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:"undefined"!==typeof e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:"undefined"!==typeof e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:"undefined"!==typeof e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize="undefined"!==typeof e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize="undefined"!==typeof e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,s["f"]&&(t.className+=" mac"),t}class cD extends Q_{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(91),r=o.get(66),a=o.get(34),l=o.get(94),c={listenOnDomNode:i.domNode,className:"editor-scrollable "+Gp(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new rD(t.domNode,c,this._context.viewLayout.getScrollable())),J_.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=R_(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.model.setScrollPosition(n,1)};this._register(bo(i.domNode,"scroll",e=>d(i.domNode,!0,!0))),this._register(bo(t.domNode,"scroll",e=>d(t.domNode,!0,!1))),this._register(bo(n.domNode,"scroll",e=>d(n.domNode,!0,!1))),this._register(bo(this.scrollbarDomNode.domNode,"scroll",e=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(129);this.scrollbarDomNode.setLeft(t.contentLeft);const i=e.get(64),n=i.side;"right"===n?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}delegateVerticalScrollbarMouseDown(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)}onConfigurationChanged(e){if(e.hasChanged(91)||e.hasChanged(66)||e.hasChanged(34)){const e=this._context.configuration.options,t=e.get(91),i=e.get(66),n=e.get(34),o=e.get(94),s={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(129)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+Gp(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}Qp((e,t)=>{const i=e.getColor(py);i&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tbox-shadow: ${i} 0 6px 6px -6px inset;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tbox-shadow: ${i} 6px 0 6px -6px inset;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\tbox-shadow: ${i} 6px 6px 6px -6px inset;\n\t\t\t}\n\t\t`);const n=e.getColor(_y);n&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\tbackground: ${n};\n\t\t\t}\n\t\t`);const o=e.getColor(by);o&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\tbackground: ${o};\n\t\t\t}\n\t\t`);const s=e.getColor(vy);s&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\tbackground: ${s};\n\t\t\t}\n\t\t`)});i("df70");class dD{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class hD extends CL{_render(e,t,i){const n=[];for(let r=e;r<=t;r++){const t=r-e;n[t]=[]}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 o=null,s=0;for(let r=0,a=i.length;r<a;r++){const a=i[r],l=a.className;let c=Math.max(a.startLineNumber,e)-e;const d=Math.min(a.endLineNumber,t)-e;o===l?(c=Math.max(s+1,c),s=Math.max(s,d)):(o=l,s=d);for(let e=c;e<=s;e++)n[e].push(o)}return n}}class uD extends hD{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._glyphMargin=t.get(49),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,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(129);return this._lineHeight=t.get(58),this._glyphMargin=t.get(49),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!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();let i=[],n=0;for(let o=0,s=t.length;o<s;o++){const e=t[o],s=e.options.glyphMarginClassName;s&&(i[n++]=new dD(e.range.startLineNumber,e.range.endLineNumber,s))}return i}prepareRender(e){if(!this._glyphMargin)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=this._lineHeight.toString(),s=this._glyphMarginLeft.toString(),r=this._glyphMarginWidth.toString(),a='" style="left:'+s+"px;width:"+r+"px;height:"+o+'px;"></div>',l=[];for(let c=t;c<=i;c++){const e=c-t,i=n[e];0===i.length?l[e]="":l[e]='<div class="cgmr codicon '+i.join(" ")+a}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}i("9c85");class gD extends CL{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(130),n=t.get(43);this._lineHeight=t.get(58),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),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(130),n=t.get(43);return this._lineHeight=t.get(58),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),!0}onCursorStateChanged(e){var t;const i=e.selections[0],n=i.getPosition();return!(null===(t=this._primaryPosition)||void 0===t?void 0:t.equals(n))&&(this._primaryPosition=n,!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,o;if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=e.scrollWidth,l=this._lineHeight,c=this._primaryPosition,d=this.getGuidesByLine(s,r,c),h=[];for(let u=s;u<=r;u++){const r=u-s,c=d[r];let g="";const f=null!==(i=null===(t=e.visibleRangeForPosition(new wi(u,1)))||void 0===t?void 0:t.left)&&void 0!==i?i:0;for(const t of c){const i=f+(t.visibleColumn-1)*this._spaceWidth;if(i>a||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const s=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",r=t.horizontalLine?(null!==(o=null===(n=e.visibleRangeForPosition(new wi(u,t.horizontalLine.endColumn)))||void 0===n?void 0:n.left)&&void 0!==o?o:i+this._spaceWidth)-i:this._spaceWidth;g+=`<div class="core-guide ${t.className} ${s}" style="left:${i}px;height:${l}px;width:${r}px"></div>`}h[r]=g}this._renderResult=h}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.model.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?Ka.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?Ka.EnabledForActive:Ka.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,o=this._bracketPairGuideOptions.indentation?this._context.model.getLinesIndentGuides(e,t):null;let s=0,r=0,a=0;if(this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.model.getActiveIndentGuide(i.lineNumber,e,t);s=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.model.getTextModelOptions(),c=[];for(let d=e;d<=t;d++){const t=new Array;c.push(t);const i=n?n[d-e]:[],h=new Bu(i),u=o?o[d-e]:[];for(let e=1;e<=u;e++){const n=(e-1)*l+1,o=0===i.length&&s<=d&&d<=r&&e===a;t.push(...h.takeWhile(e=>e.visibleColumn<n)||[]);const c=h.peek();c&&c.visibleColumn===n&&!c.horizontalLine||t.push(new $a(n,o?"core-guide-indent-active":"core-guide-indent",null))}t.push(...h.takeWhile(e=>!0)||[])}return c}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function fD(e){if(!e||!e.isTransparent())return e}Qp((e,t)=>{const i=e.getColor(gx);i&&t.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 ${i} inset; }`);const n=e.getColor(fx)||i;n&&t.addRule(`.monaco-editor .lines-content .core-guide-indent-active { box-shadow: 1px 0 0 0 ${n} inset; }`);const o=[{bracketColor:Dx,guideColor:Px,guideColorActive:zx},{bracketColor:Nx,guideColor:Rx,guideColorActive:Hx},{bracketColor:Ix,guideColor:Fx,guideColorActive:Kx},{bracketColor:Tx,guideColor:Bx,guideColorActive:jx},{bracketColor:Mx,guideColor:Wx,guideColorActive:Ux},{bracketColor:Ox,guideColor:Vx,guideColorActive:$x}],s=new ck;let r=o.map(t=>{var i,n;const o=e.getColor(t.bracketColor),s=e.getColor(t.guideColor),r=e.getColor(t.guideColorActive),a=fD(null!==(i=fD(s))&&void 0!==i?i:null===o||void 0===o?void 0:o.transparent(.3)),l=fD(null!==(n=fD(r))&&void 0!==n?n:o);if(a&&l)return{guideColor:a,guideColorActive:l}}).filter(ta);if(r.length>0){for(let e=0;e<30;e++){const i=r[e%r.length];t.addRule(`.monaco-editor .${s.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.${s.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${s.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${s.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}});i("11cb");class mD{constructor(){this._currentVisibleRange=new Ci(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class pD{constructor(e,t,i,n,o,s){this.lineNumber=e,this.startColumn=t,this.endColumn=i,this.startScrollTop=n,this.stopScrollTop=o,this.scrollType=s,this.type="range",this.minLineNumber=e,this.maxLineNumber=e}}class _D{constructor(e,t,i,n){this.selections=e,this.startScrollTop=t,this.stopScrollTop=i,this.scrollType=n,this.type="selections";let o=e[0].startLineNumber,s=e[0].endLineNumber;for(let r=1,a=e.length;r<a;r++){const t=e[r];o=Math.min(o,t.startLineNumber),s=Math.max(s,t.endLineNumber)}this.minLineNumber=o,this.maxLineNumber=s}}class bD extends Q_{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new pE(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,n=this._context.configuration.options,o=n.get(43),s=n.get(130);this._lineHeight=n.get(58),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=n.get(88),this._cursorSurroundingLines=n.get(25),this._cursorSurroundingLinesStyle=n.get(26),this._canUseLayerHinting=!n.get(28),this._viewLineOptions=new hb(i,this._context.theme.type),J_.write(this.domNode,7),this.domNode.setClassName("view-lines "+xL),A_.applyFontInfo(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new so(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new so(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new mD,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new ub(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(130)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(43),n=t.get(130);return this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(88),this._cursorSurroundingLines=t.get(25),this._cursorSurroundingLinesStyle=t.get(26),this._canUseLayerHinting=!t.get(28),A_.applyFontInfo(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(129)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new hb(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++){const e=this._visibleLines.getVisibleLine(t);e.onOptionsChanged(this._viewLineOptions)}return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).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.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 pD(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 _D(e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop),o=n<=this._lineHeight?1:e.scrollType;return this._context.model.setScrollPosition(i,o),!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.model.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.model.getLineCount())return null;if(1===this._context.model.getLineMaxColumn(n))return new wi(n,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(n<o||n>s)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(n,e,t);const a=this._context.model.getLineMinColumn(n);return r<a&&(r=a),new wi(n,r)}_getViewLineDomNode(e){while(e&&1===e.nodeType){if(e.className===ub.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++){const t=this._visibleLines.getVisibleLine(n);if(e===t.getDomNode())return n}return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();return e<t||e>i?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=Ci.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;let o=[],s=0;const r=new db(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new wi(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),c=this._visibleLines.getEndLineNumber();for(let d=n.startLineNumber;d<=n.endLineNumber;d++){if(d<l||d>c)continue;const e=d===n.startLineNumber?n.startColumn:1,h=d===n.endLineNumber?n.endColumn:this._context.model.getLineMaxColumn(d),u=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,e,h,r);if(u){if(t&&d<i){const e=a;a=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new wi(d+1,1)).lineNumber,e!==a&&(u.ranges[u.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[s++]=new ib(u.outsideRenderedLine,d,nb.from(u.ranges))}}return 0===s?null:o}_visibleRangesForLineRange(e,t,i){return this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,new db(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new sb(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let s=t;s<=i;s++){const t=this._visibleLines.getVisibleLine(s);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth()):o=!1}return o&&1===t&&i===this._context.model.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){const n=i.getWidth();n>t&&(t=n,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=n;o++){const e=this._visibleLines.getVisibleLine(o);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.model.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),s["d"]&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++){const e=this._visibleLines.getVisibleLine(i);if(e.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.model.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,o){const s=e.top,r=e.height,a=s+r;let l,c,d;if(n&&n.length>0){let e=n[0].startLineNumber,t=n[0].endLineNumber;for(let i=1,o=n.length;i<o;i++){const o=n[i];e=Math.min(e,o.startLineNumber),t=Math.max(t,o.endLineNumber)}l=!1,c=this._context.viewLayout.getVerticalOffsetForLineNumber(e),d=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!i)return-1;l=!0,c=this._context.viewLayout.getVerticalOffsetForLineNumber(i.startLineNumber),d=this._context.viewLayout.getVerticalOffsetForLineNumber(i.endLineNumber)+this._lineHeight}const h="mouse"===t&&"default"===this._cursorSurroundingLinesStyle;if(!h){const e=Math.min(r/this._lineHeight/2,this._cursorSurroundingLines);c-=e*this._lineHeight,d+=Math.max(0,e-1)*this._lineHeight}let u;if(0!==o&&4!==o||(d+=this._lineHeight),d-c>r){if(!l)return-1;u=c}else if(5===o||6===o)if(6===o&&s<=c&&d<=a)u=s;else{const e=Math.max(5*this._lineHeight,.2*r),t=c-e,i=d-r;u=Math.max(i,t)}else if(1===o||2===o)if(2===o&&s<=c&&d<=a)u=s;else{const e=(c+d)/2;u=Math.max(0,e-r/2)}else u=this._computeMinimumScrolling(s,a,c,d,3===o,4===o);return u}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=t.left,n=i+t.width;let o=1073741824,s=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)),s=Math.max(s,Math.round(e.left+e.width))}else for(const a of e.selections){if(a.startLineNumber!==a.endLineNumber)return null;const e=this._visibleRangesForLineRange(a.startLineNumber,a.startColumn,a.endColumn);if(!e)return null;for(const t of e.ranges)o=Math.min(o,Math.round(t.left)),s=Math.max(s,Math.round(t.left+t.width))}if(o=Math.max(0,o-bD.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding,"selections"===e.type&&s-o>t.width)return null;const r=this._computeMinimumScrolling(i,n,o,s);return{scrollLeft:r,maxHorizontalOffset:s}}_computeMinimumScrolling(e,t,i,n,o,s){e|=0,t|=0,i|=0,n|=0,o=!!o,s=!!s;const r=t-e,a=n-i;return a<r?o?i:s?Math.max(0,n-r):i<e?i:n>t?Math.max(0,n-r):e:i}}bD.HORIZONTAL_EXTRA_PX=30;i("b042");class vD extends hD{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(129);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.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,i=t.get(129);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.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){const t=e.getDecorationsInViewport();let i=[],n=0;for(let o=0,s=t.length;o<s;o++){const e=t[o],s=e.options.linesDecorationsClassName;s&&(i[n++]=new dD(e.range.startLineNumber,e.range.endLineNumber,s));const r=e.options.firstLineDecorationClassName;r&&(i[n++]=new dD(e.range.startLineNumber,e.range.startLineNumber,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=this._decorationsLeft.toString(),s=this._decorationsWidth.toString(),r='" style="left:'+o+"px;width:"+s+'px;"></div>',a=[];for(let l=t;l<=i;l++){const e=l-t,i=n[e];let o="";for(let t=0,n=i.length;t<n;t++)o+='<div class="cldr '+i[t]+r;a[e]=o}this._renderResult=a}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}i("a23c");class wD extends hD{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();let i=[],n=0;for(let o=0,s=t.length;o<s;o++){const e=t[o],s=e.options.marginClassName;s&&(i[n++]=new dD(e.range.startLineNumber,e.range.endLineNumber,s))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=[];for(let s=t;s<=i;s++){const e=s-t,i=n[e];let r="";for(let t=0,n=i.length;t<n;t++)r+='<div class="cmdr '+i[t]+'" style=""></div>';o[e]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}i("36df");class CD{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=CD._clamp(e),this.g=CD._clamp(t),this.b=CD._clamp(i),this.a=CD._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}}CD.Empty=new CD(0,0,0,0);class yD extends Ye{constructor(){super(),this._onDidChange=new rt,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(kc.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}static getInstance(){return this._INSTANCE||(this._INSTANCE=He(new yD)),this._INSTANCE}_updateColorMap(){const e=kc.getColorMap();if(!e)return this._colors=[CD.Empty],void(this._backgroundIsLight=!0);this._colors=[CD.Empty];for(let i=1;i<e.length;i++){const t=e[i].rgba;this._colors[i]=new CD(t.r,t.g,t.b,Math.round(255*t.a))}let 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}}yD._INSTANCE=null;const SD=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})(),xD=(e,t)=>(e-=32,e<0||e>96?t<=2?(e+96)%96:95:e);class kD{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=kD.soften(e,.8),this.charDataLight=kD.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=eu(e[n]*t);return i}renderChar(e,t,i,n,o,s,r,a,l,c,d){const h=1*this.scale,u=2*this.scale,g=d?1:u;if(t+h>e.width||i+g>e.height)return void console.warn("bad render request outside image data");const f=c?this.charDataLight:this.charDataNormal,m=xD(n,l),p=4*e.width,_=r.r,b=r.g,v=r.b,w=o.r-_,C=o.g-b,y=o.b-v,S=Math.max(s,a),x=e.data;let k=m*h*u,L=i*p+4*t;for(let E=0;E<g;E++){let e=L;for(let t=0;t<h;t++){const t=f[k++]/255*(s/255);x[e++]=_+w*t,x[e++]=b+C*t,x[e++]=v+y*t,x[e++]=S}L+=p}}blockRenderChar(e,t,i,n,o,s,r,a){const l=1*this.scale,c=2*this.scale,d=a?1:c;if(t+l>e.width||i+d>e.height)return void console.warn("bad render request outside image data");const h=4*e.width,u=o/255*.5,g=s.r,f=s.g,m=s.b,p=n.r-g,_=n.g-f,b=n.b-m,v=g+p*u,w=f+_*u,C=m+b*u,y=Math.max(o,r),S=e.data;let x=i*h+4*t;for(let k=0;k<d;k++){let e=x;for(let t=0;t<l;t++)S[e++]=v,S[e++]=w,S[e++]=C,S[e++]=y;x+=h}}}const LD={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},ED=e=>{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=LD[e[i]]<<4|15&LD[e[i+1]];return t},DD={1:Oe(()=>ED("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:Oe(()=>ED("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class ND{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=DD[e]?new kD(DD[e](),e):ND.createFromSampleData(ND.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 o of SD)i.fillText(String.fromCharCode(o),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){const i=61440;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");let n=ND._downsample(e,t);return new kD(n,t)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let c=0;c<r;c++){const n=c/r*16,o=(c+1)/r*16;for(let r=0;r<s;r++){const c=r/s*10,d=(r+1)/s*10;let h=0,u=0;for(let i=n;i<o;i++){const n=t+3840*Math.floor(i),o=1-(i-Math.floor(i));for(let t=c;t<d;t++){const i=1-(t-Math.floor(t)),s=n+4*Math.floor(t),r=i*o;u+=r,h+=e[s]*e[s+3]/255*r}}const g=h/u;l=Math.max(l,g),i[a++]=eu(g)}}return l}static _downsample(e,t){const i=2*t*1*t,n=96*i,o=new Uint8ClampedArray(n);let s=0,r=0,a=0;for(let l=0;l<96;l++)a=Math.max(a,this._downsampleChar(e,r,o,s,t)),s+=i,r+=40;if(a>0){const e=255/a;for(let t=0;t<n;t++)o[t]*=e}return o}}const ID=140,TD=2;class MD{constructor(e,t,i){const n=e.options,o=n.get(127),s=n.get(129),r=s.minimap,a=n.get(43),l=n.get(64);this.renderMinimap=r.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=r.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(93),this.showSlider=l.showSlider,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(58),this.minimapLeft=r.minimapLeft,this.minimapWidth=r.minimapWidth,this.minimapHeight=s.height,this.canvasInnerWidth=r.minimapCanvasInnerWidth,this.canvasInnerHeight=r.minimapCanvasInnerHeight,this.canvasOuterWidth=r.minimapCanvasOuterWidth,this.canvasOuterHeight=r.minimapCanvasOuterHeight,this.isSampling=r.minimapIsSampling,this.editorHeight=s.height,this.fontScale=r.minimapScale,this.minimapLineHeight=r.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=Oe(()=>ND.create(this.fontScale,a.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=MD._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=MD._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(HS);return i?new CD(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(KS);return t?CD._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.showSlider===e.showSlider&&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 OD{constructor(e,t,i,n,o,s,r,a){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=s,this.startLineNumber=r,this.endLineNumber=a}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}static create(e,t,i,n,o,s,r,a,l,c,d){const h=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),f=e.lineHeight;if(e.minimapHeightIsEditorHeight){const t=a*e.lineHeight+(e.scrollBeyondLastLine?o-e.lineHeight:0),i=Math.max(1,Math.floor(o*o/t)),n=Math.max(0,e.minimapHeight-i),s=n/(c-o),d=l*s,h=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new OD(l,c,h,s,d,i,1,Math.min(r,u))}let m,p;if(s&&i!==r){const e=i-t+1;m=Math.floor(e*u/h)}else{const e=o/f;m=Math.floor(e*u/h)}p=e.scrollBeyondLastLine?(r-1)*u/h:Math.max(0,r*u/h-m),p=Math.min(e.minimapHeight-m,p);const _=p/(c-o),b=l*_;let v=0;if(e.scrollBeyondLastLine){const e=o/f;v=e-1}if(g>=r+v){const e=1,t=r,i=p>0;return new OD(l,c,i,_,b,m,e,t)}{let e=Math.max(1,Math.floor(t-b*h/u));d&&d.scrollHeight===c&&(d.scrollTop>l&&(e=Math.min(e,d.startLineNumber)),d.scrollTop<l&&(e=Math.max(e,d.startLineNumber)));const i=Math.min(r,e+g-1),o=(l-n)/f,s=(t-e+o)*u/h;return new OD(l,c,!0,_,s,m,e,i)}}}class AD{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}AD.INVALID=new AD(-1);class PD{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new mE(()=>AD.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get(),i=t.lines;for(let n=0,o=i.length;n<o;n++)if(-1===i[n].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 RD{constructor(e,t,i,n){this._backgroundFillData=RD._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,o=i.g,s=i.b,r=i.a,a=new Uint8ClampedArray(e*t*4);let l=0;for(let c=0;c<t;c++)for(let t=0;t<e;t++)a[l]=n,a[l+1]=o,a[l+2]=s,a[l+3]=r,l+=4;return a}}class FD{constructor(e,t){this.samplingRatio=e,this.minimapLines=t}static compute(e,t,i){if(0===e.renderMinimap||!e.isSampling)return[null,[]];const n=e.pixelRatio,o=e.lineHeight,s=e.scrollBeyondLastLine,{minimapLineCount:r}=j.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:s,height:e.editorHeight,lineHeight:o,pixelRatio:n}),a=t/r,l=a/2;if(!i||0===i.minimapLines.length){let e=[];if(e[0]=1,r>1){for(let t=0,i=r-1;t<i;t++)e[t]=Math.round(t*a+l);e[r-1]=t}return[new FD(a,e),[]]}const c=i.minimapLines,d=c.length;let h=[],u=0,g=0,f=1;const m=10;let p=[],_=null;for(let b=0;b<r;b++){const e=Math.max(f,Math.round(b*a)),i=Math.max(e,Math.round((b+1)*a));while(u<d&&c[u]<e){if(p.length<m){const e=u+1+g;_&&"deleted"===_.type&&_._oldIndex===u-1?_.deleteToLineNumber++:(_={type:"deleted",_oldIndex:u,deleteFromLineNumber:e,deleteToLineNumber:e},p.push(_)),g--}u++}let n;if(u<d&&c[u]<=i)n=c[u],u++;else if(n=0===b?1:b+1===r?t:Math.round(b*a+l),p.length<m){const e=u+1+g;_&&"inserted"===_.type&&_._i===b-1?_.insertToLineNumber++:(_={type:"inserted",_i:b,insertFromLineNumber:e,insertToLineNumber:e},p.push(_)),g++}h[b]=n,f=n}if(p.length<m)while(u<d){const e=u+1+g;_&&"deleted"===_.type&&_._oldIndex===u-1?_.deleteToLineNumber++:(_={type:"deleted",_oldIndex:u,deleteFromLineNumber:e,deleteToLineNumber:e},p.push(_)),g--,u++}else p=[{type:"flush"}];return[new FD(a,h),p]}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;while(i>0&&this.minimapLines[i-1]>=e)i--;let n=this.modelLineToMinimapLine(t)-1;while(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 o=this.minimapLines.length-1;o>=0;o--){if(this.minimapLines[o]<e.fromLineNumber)break;this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),n=Math.max(n,o)):this.minimapLines[o]-=t}return[i,n]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0;i--){if(this.minimapLines[i]<e.fromLineNumber)break;this.minimapLines[i]+=t}}}class BD extends Q_{constructor(e){super(e),this.tokensColorTracker=yD.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new MD(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=FD.compute(this.options,this._context.model.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new WD(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new MD(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.toLineNumber);return!!t&&this._actual.onLinesChanged(t[0],t[1])}return this._actual.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i+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._context.model.invalidateMinimapColorCache(),this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){let 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]=FD.compute(this.options,this._context.model.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.model.getLineCount()}getRealLineCount(){return this._context.model.getLineCount()}getLineContent(e){return this._samplingState?this._context.model.getLineContent(this._samplingState.minimapLines[e-1]):this._context.model.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.model.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.model.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){let n=[];for(let o=0,s=t-e+1;o<s;o++)i[o]?n[o]=this._context.model.getViewLineData(this._samplingState.minimapLines[e+o-1]):n[o]=null;return n}return this._context.model.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],o=this._samplingState.minimapLines[t-1];i=new Ci(n,1,o,this._context.model.getLineMaxColumn(o))}else i=new Ci(e,1,t,this._context.model.getLineMaxColumn(t));const n=this._context.model.getDecorationsInViewport(i);if(this._samplingState){let e=[];for(const t of n){if(!t.options.minimap)continue;const i=t.range,n=this._samplingState.modelLineToMinimapLine(i.startLineNumber),o=this._samplingState.modelLineToMinimapLine(i.endLineNumber);e.push(new Wg(new Ci(n,i.startColumn,o,i.endColumn),t.options))}return e}return n}getOptions(){return this._context.model.getTextModelOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.model.revealRange("mouse",!1,new Ci(e,1,e,1),1,0)}setScrollTop(e){this._context.model.setScrollPosition({scrollTop:e},1)}}class WD extends Ye{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(WS),this._domNode=R_(document.createElement("div")),J_.write(this._domNode,8),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=R_(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=R_(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=R_(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=R_(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=R_(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._mouseDownListener=Co(this._domNode.domNode,"mousedown",e=>{e.preventDefault();const t=this._model.options.renderMinimap;if(0===t)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(e.leftButton&&this._lastRenderData){const t=Bo(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e.buttons,e.posx,i,e.posy,this._lastRenderData.renderedLayout)}return}const i=this._model.options.minimapLineHeight,n=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.browserEvent.offsetY,o=Math.floor(n/i);let s=o+this._lastRenderData.renderedLayout.startLineNumber;s=Math.min(s,this._model.getLineCount()),this._model.revealLineNumber(s)}),this._sliderMouseMoveMonitor=new H_,this._sliderMouseDownListener=Co(this._slider.domNode,"mousedown",e=>{e.preventDefault(),e.stopPropagation(),e.leftButton&&this._lastRenderData&&this._startSliderDragging(e.buttons,e.posx,e.posy,e.posy,this._lastRenderData.renderedLayout)}),this._gestureDisposable=V_.addTarget(this._domNode.domNode),this._sliderTouchStartListener=bo(this._domNode.domNode,B_.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=bo(this._domNode.domNode,B_.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=Co(this._domNode.domNode,B_.End,e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i,n,o){this._slider.toggleClassName("active",!0);const r=(e,n)=>{const r=Math.abs(n-t);if(s["i"]&&r>ID)return void this._model.setScrollTop(o.scrollTop);const a=e-i;this._model.setScrollTop(o.getDesiredScrollTopFromDelta(a))};n!==i&&r(n,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,z_,e=>r(e.posy,e.posx),()=>{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._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){return"always"===this._model.options.showSlider?"minimap slider-always":"minimap slider-mouseover"}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 RD(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){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(WS),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){const t=this._model.options.renderMinimap;if(0===t)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 i=OD.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(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(Ci.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:o}=this._model.options,s=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,o);const c=new VD(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,c,e,s),this._renderDecorationsLineHighlights(l,i,c,e,s);const d=new VD(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,d,e,s,a,r,n),this._renderDecorationsHighlights(l,i,d,e,s,a,r,n)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,r=0;for(const a of t){const t=Math.max(n.startLineNumber,a.startLineNumber),l=Math.min(n.endLineNumber,a.endLineNumber);if(t>l)continue;for(let e=t;e<=l;e++)i.set(e,!0);const c=(t-n.startLineNumber)*o,d=(l-n.startLineNumber)*o+o;r>=c||(r>s&&e.fillRect(g,s,e.canvas.width,r-s),s=c),r=d}r>s&&e.fillRect(g,s,e.canvas.width,r-s)}_renderDecorationsLineHighlights(e,t,i,n,o){const s=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||l.position!==Ha.Inline)continue;const c=Math.max(n.startLineNumber,a.range.startLineNumber),d=Math.min(n.endLineNumber,a.range.endLineNumber);if(c>d)continue;const h=l.getColor(this._theme);if(!h||h.isTransparent())continue;let u=s.get(h.toString());u||(u=h.transparent(.5).toString(),s.set(h.toString(),u)),e.fillStyle=u;for(let t=c;t<=d;t++){if(i.has(t))continue;i.set(t,!0);const s=(c-n.startLineNumber)*o;e.fillRect(g,s,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,s,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=Math.max(n.startLineNumber,l.startLineNumber),c=Math.min(n.endLineNumber,l.endLineNumber);if(!(t>c))for(let d=t;d<=c;d++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,d,o,o,s,r,a)}}_renderDecorationsHighlights(e,t,i,n,o,s,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const c=Math.max(n.startLineNumber,l.range.startLineNumber),d=Math.min(n.endLineNumber,l.range.endLineNumber);if(c>d)continue;const h=t.getColor(this._theme);if(h&&!h.isTransparent())for(let u=c;u<=d;u++)switch(t.position){case Ha.Inline:this.renderDecorationOnLine(e,i,l.range,h,n,u,o,o,s,r,a);continue;case Ha.Gutter:const t=(u-n.startLineNumber)*o,c=2;this.renderDecoration(e,h,c,t,TD,o);continue}}}renderDecorationOnLine(e,t,i,n,o,s,r,a,l,c,d){const h=(s-o.startLineNumber)*a;if(h+r<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:u,endLineNumber:g}=i,f=u===s?i.startColumn:1,m=g===s?i.endColumn:this._model.getLineMaxColumn(s),p=this.getXOffsetForPosition(t,s,f,l,c,d),_=this.getXOffsetForPosition(t,s,m,l,c,d);this.renderDecoration(e,n,p,h,_-p,r)}getXOffsetForPosition(e,t,i,n,o,s){if(1===i)return g;const r=(i-1)*o;if(r>=s)return s;let a=e.get(t);if(!a){const i=this._model.getLineContent(t);a=[g];let r=g;for(let e=1;e<i.length+1;e++){const t=i.charCodeAt(e-1),l=9===t?n*o:gr(t)?2*o:o,c=r+l;if(c>=s){a[e]=s;break}a[e]=c,r=c}e.set(t,a)}return i-1<a.length?a[i-1]:s}renderDecoration(e,t,i,n,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,s)}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 PD(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;let[s,r,a]=WD._renderUntouchedLines(o,t,i,n,this._lastRenderData);const l=this._model.getMinimapLinesRenderingData(t,i,a),c=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,h=this._model.options.backgroundColor,u=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,f=g.backgroundIsLight(),m=this._model.options.renderMinimap,p=this._model.options.charRenderer(),_=this._model.options.fontScale,b=this._model.options.minimapCharWidth,v=1===m?2:3,w=v*_,C=n>w?Math.floor((n-w)/2):0,y=h.a/255,S=new CD(Math.round((h.r-d.r)*y+d.r),Math.round((h.g-d.g)*y+d.g),Math.round((h.b-d.b)*y+d.b),255);let x=0;const k=[];for(let I=0,T=i-t+1;I<T;I++)a[I]&&WD._renderLine(o,S,h.a,f,m,b,g,u,p,x,C,c,l[I],_,n),k[I]=new AD(x),x+=n;const L=-1===s?0:s,E=-1===r?o.height:r,D=E-L,N=this._canvas.domNode.getContext("2d");return N.putImageData(o,0,0,0,L,o.width,D),new PD(e,o,k)}static _renderUntouchedLines(e,t,i,n,o){const s=[];if(!o){for(let e=0,n=i-t+1;e<n;e++)s[e]=!0;return[-1,-1,s]}const r=o._get(),a=r.imageData.data,l=r.rendLineNumberStart,c=r.lines,d=c.length,h=e.width,u=e.data,g=(i-t+1)*n*h*4;let f=-1,m=-1,p=-1,_=-1,b=-1,v=-1,w=0;for(let S=t;S<=i;S++){const e=S-t,i=S-l,o=i>=0&&i<d?c[i].dy:-1;if(-1===o){s[e]=!0,w+=n;continue}const r=o*h*4,C=(o+n)*h*4,y=w*h*4,x=(w+n)*h*4;_===r&&v===y?(_=C,v=x):(-1!==p&&(u.set(a.subarray(p,_),b),-1===f&&0===p&&p===b&&(f=_),-1===m&&_===g&&p===b&&(m=p)),p=r,_=C,b=y,v=x),s[e]=!1,w+=n}-1!==p&&(u.set(a.subarray(p,_),b),-1===f&&0===p&&p===b&&(f=_),-1===m&&_===g&&p===b&&(m=p));const C=-1===f?-1:f/(4*h),y=-1===m?-1:m/(4*h);return[C,y,s]}static _renderLine(e,t,i,n,o,s,r,a,l,c,d,h,u,f,m){const p=u.content,_=u.tokens,b=e.width-s,v=1===m;let w=g,C=0,y=0;for(let g=0,S=_.getCount();g<S;g++){const u=_.getEndOffset(g),m=_.getForeground(g),S=r.getColor(m);for(;C<u;C++){if(w>b)return;const r=p.charCodeAt(C);if(9===r){const e=h-(C+y)%h;y+=e-1,w+=e*s}else if(32===r)w+=s;else{const h=gr(r)?2:1;for(let u=0;u<h;u++)if(2===o?l.blockRenderChar(e,w,c+d,S,a,t,i,v):l.renderChar(e,w,c+d,r,S,a,t,i,f,n,v),w+=s,w>b)return}}}}}class VD{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,o=this._endLineNumber-this._startLineNumber+1;n<o;n++)this._values[n]=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]}}Qp((e,t)=>{const i=e.getColor(jS);i&&t.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${i}; }`);const n=e.getColor(US);n&&t.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${n}; }`);const o=e.getColor($S);o&&t.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${o}; }`);const s=e.getColor(py);s&&t.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${s} -6px 0 6px -6px inset; }`)});i("70a8");class zD extends Q_{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=R_(document.createElement("div")),J_.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=R_(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference!==t&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t],i=e.domNode.domNode;delete this._widgets[t],i.parentNode.removeChild(i),this.setShouldRender()}}_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 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.unsetTop()}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let i=0,n=t.length;i<n;i++){const e=t[i];this._renderWidget(this._widgets[e])}}}class HD{constructor(e,t){const i=e.options;this.lineHeight=i.get(58),this.pixelRatio=i.get(127),this.overviewRulerLanes=i.get(73),this.renderBorder=i.get(72);const n=t.getColor(vx);this.borderColor=n?n.toString():null,this.hideCursor=i.get(51);const o=t.getColor(dx);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const s=i.get(64),r=s.enabled,a=s.side,l=r?t.getColor(wx)||kc.getDefaultBackground():null;this.backgroundColor=null===l||"left"===a?null:Lw.Format.CSS.formatHex(l);const c=i.get(129),d=c.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[h,u]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=h,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),o=n-t-i,s=e,r=s+t,a=s+t+o;return[[0,s,r,s,a,s,r,s],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2===i){const t=Math.floor(n/2),i=n-t,o=e,s=o+t;return[[0,o,o,o,s,o,o,o],[0,t,t,t,i,t+i,t+i,t+i]]}{const t=e,i=n;return[[0,t,t,t,t,t,t,t],[0,i,i,i,i,i,i,i]]}}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&&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 KD extends Q_{constructor(e){super(e),this._domNode=R_(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=kc.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new HD(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)}onConfigurationChanged(e){return this._updateSettings(!1)}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(wi.compare),!0}onDecorationsChanged(e){return!!e.affectsOverviewRuler}onFlushed(e){return!0}onScrollChanged(e){return e.scrollHeightChanged}onZonesChanged(e){return!0}onThemeChanged(e){return this._context.model.invalidateOverviewRulerColorCache(),this._updateSettings(!1)}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render()}_render(){if(0===this._settings.overviewRulerLanes)return void this._domNode.setBackgroundColor(this._settings.backgroundColor?this._settings.backgroundColor:"");const e=this._settings.canvasWidth,t=this._settings.canvasHeight,i=this._settings.lineHeight,n=this._context.viewLayout,o=this._context.viewLayout.getScrollHeight(),s=t/o,r=this._context.model.getAllOverviewRulerDecorations(this._context.theme),a=6*this._settings.pixelRatio|0,l=a/2|0,c=this._domNode.domNode.getContext("2d");null===this._settings.backgroundColor?c.clearRect(0,0,e,t):(c.fillStyle=this._settings.backgroundColor,c.fillRect(0,0,e,t));const d=this._settings.x,h=this._settings.w;r.sort(Vg.cmp);for(const u of r){const e=u.color,o=u.data;c.fillStyle=e;let r=0,g=0,f=0;for(let u=0,m=o.length/3;u<m;u++){const e=o[3*u],m=o[3*u+1],p=o[3*u+2];let _=n.getVerticalOffsetForLineNumber(m)*s|0,b=(n.getVerticalOffsetForLineNumber(p)+i)*s|0;const v=b-_;if(v<a){let e=(_+b)/2|0;e<l?e=l:e+l>t&&(e=t-l),_=e-l,b=e+l}_>f+1||e!==r?(0!==u&&c.fillRect(d[r],g,h[r],f-g),r=e,g=_,f=b):b>f&&(f=b)}c.fillRect(d[r],g,h[r],f-g)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,i=e/2|0,o=this._settings.x[7],r=this._settings.w[7];c.fillStyle=this._settings.cursorColor;let a=-100,l=-100;for(let d=0,h=this._cursorPositions.length;d<h;d++){const h=this._cursorPositions[d];let u=n.getVerticalOffsetForLineNumber(h.lineNumber)*s|0;u<i?u=i:u+i>t&&(u=t-i);const g=u-i,f=g+e;g>l+1?(0!==d&&c.fillRect(o,a,r,l-a),a=g,l=f):f>l&&(l=f)}c.fillRect(o,a,r,l-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(c.beginPath(),c.lineWidth=1,c.strokeStyle=this._settings.borderColor,c.moveTo(0,0),c.lineTo(0,t),c.stroke(),c.moveTo(0,0),c.lineTo(e,0),c.stroke())}}class jD{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 UD{constructor(e,t,i){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.color=i,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class $D{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(UD.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=Math.floor(this._outerHeight),o=i/n,s=Math.floor(4*this._pixelRatio/2);let r=[];for(let a=0,l=this._zones.length;a<l;a++){const n=this._zones[a];if(!e){const e=n.getColorZones();if(e){r.push(e);continue}}const l=Math.floor(o*this._getVerticalOffsetForLine(n.startLineNumber)),c=Math.floor(o*(this._getVerticalOffsetForLine(n.endLineNumber)+t));let d=Math.floor((l+c)/2),h=c-d;h<s&&(h=s),d-h<0&&(d=h),d+h>i&&(d=i-h);const u=n.color;let g=this._color2Id[u];g||(g=++this._lastAssignedId,this._color2Id[u]=g,this._id2Color[g]=u);const f=new jD(d-h,d+h,g);n.setColorZone(f),r.push(f)}return this._colorZonesInvalid=!1,r.sort(jD.compare),r}}class qD extends Z_{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=R_(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new $D(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(58)),this._zoneManager.setPixelRatio(i.get(127)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(58)&&(this._zoneManager.setLineHeight(t.get(58)),this._render()),e.hasChanged(127)&&(this._zoneManager.setPixelRatio(t.get(127)),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(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,c=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=c):r>=l?r=Math.max(r,c):(e.fillRect(0,s,n,r-s),s=l,r=c)}e.fillRect(0,s,n,r-s)}}i("df93");class GD extends Q_{constructor(e){super(e),this.domNode=R_(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(90),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(90),this._typicalHalfwidthCharacterWidth=t.get(43).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.model.getTextModelOptions(),n=i;let o=t-e;while(o>0){const e=R_(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;while(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)}}}Qp((e,t)=>{const i=e.getColor(bx);i&&t.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${i} inset; }`)});i("9368");class YD extends Q_{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options,i=t.get(91);this._useShadows=i.useShadows,this._domNode=R_(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,t=e.get(129);0===t.minimap.renderMinimap||t.minimap.minimapWidth>0&&0===t.minimap.minimapLeft?this._width=t.width:this._width=t.width-t.minimap.minimapWidth-t.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(91);return this._useShadows=i.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":"")}}Qp((e,t)=>{const i=e.getColor(py);i&&t.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${i} 0 6px 6px -6px inset; }`)});i("adf0");class XD{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class ZD{constructor(e,t){this.lineNumber=e,this.ranges=t}}function QD(e){return new XD(e)}function JD(e){return new ZD(e.lineNumber,e.ranges.map(QD))}class eN extends CL{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(58),this._roundedSelection=t.get(89),this._typicalHalfwidthCharacterWidth=t.get(43).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(58),this._roundedSelection=t.get(89),this._typicalHalfwidthCharacterWidth=t.get(43).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++){const i=e[t];if(i.ranges.length>1)return!0}return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e<i.length;e++)i[e].lineNumber===n&&(o=i[e].ranges[0]);const r=t[t.length-1].lineNumber;if(r===e.endLineNumber)for(let e=i.length-1;!s&&e>=0;e--)i[e].lineNumber===r&&(s=i[e].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let r=0,a=t.length;r<a;r++){const e=t[r].ranges[0],i=e.left,l=e.left+e.width,c={top:0,bottom:0},d={top:0,bottom:0};if(r>0){const e=t[r-1].ranges[0].left,o=t[r-1].ranges[0].left+t[r-1].ranges[0].width;tN(i-e)<n?c.top=2:i>e&&(c.top=1),tN(l-o)<n?d.top=2:e<l&&l<o&&(d.top=1)}else o&&(c.top=o.startStyle.top,d.top=o.endStyle.top);if(r+1<a){const e=t[r+1].ranges[0].left,o=t[r+1].ranges[0].left+t[r+1].ranges[0].width;tN(i-e)<n?c.bottom=2:e<i&&i<o&&(c.bottom=1),tN(l-o)<n?d.bottom=2:l<o&&(d.bottom=1)}else s&&(c.bottom=s.startStyle.bottom,d.bottom=s.endStyle.bottom);e.startStyle=c,e.endStyle=d}}_getVisibleRangesWithStyle(e,t,i){const n=t.linesVisibleRangesForRange(e,!0)||[],o=n.map(JD),s=this._visibleRangesHaveGaps(o);return!s&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,o,i),o}_createSelectionPiece(e,t,i,n,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;left:"+n.toString()+"px;width:"+o.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const o=!!n[0].ranges[0].startStyle,s=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let c=0,d=n.length;c<d;c++){const d=n[c],h=d.lineNumber,u=h-t,g=i&&(h===l||h===a)?r:s,f=i&&h===a?1:0;let m="",p="";for(let e=0,t=d.ranges.length;e<t;e++){const t=d.ranges[e];if(o){const e=t.startStyle,i=t.endStyle;if(1===e.top||1===e.bottom){m+=this._createSelectionPiece(f,g,eN.SELECTION_CLASS_NAME,t.left-eN.ROUNDED_PIECE_WIDTH,eN.ROUNDED_PIECE_WIDTH);let i=eN.EDITOR_BACKGROUND_CLASS_NAME;1===e.top&&(i+=" "+eN.SELECTION_TOP_RIGHT),1===e.bottom&&(i+=" "+eN.SELECTION_BOTTOM_RIGHT),m+=this._createSelectionPiece(f,g,i,t.left-eN.ROUNDED_PIECE_WIDTH,eN.ROUNDED_PIECE_WIDTH)}if(1===i.top||1===i.bottom){m+=this._createSelectionPiece(f,g,eN.SELECTION_CLASS_NAME,t.left+t.width,eN.ROUNDED_PIECE_WIDTH);let e=eN.EDITOR_BACKGROUND_CLASS_NAME;1===i.top&&(e+=" "+eN.SELECTION_TOP_LEFT),1===i.bottom&&(e+=" "+eN.SELECTION_BOTTOM_LEFT),m+=this._createSelectionPiece(f,g,e,t.left+t.width,eN.ROUNDED_PIECE_WIDTH)}}let i=eN.SELECTION_CLASS_NAME;if(o){const e=t.startStyle,n=t.endStyle;0===e.top&&(i+=" "+eN.SELECTION_TOP_LEFT),0===e.bottom&&(i+=" "+eN.SELECTION_BOTTOM_LEFT),0===n.top&&(i+=" "+eN.SELECTION_TOP_RIGHT),0===n.bottom&&(i+=" "+eN.SELECTION_BOTTOM_RIGHT)}p+=this._createSelectionPiece(f,g,i,t.left,t.width)}e[u][0]+=m,e[u][1]+=p}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let s=i;s<=n;s++){const e=s-i;t[e]=["",""]}const o=[];for(let s=0,r=this._selections.length;s<r;s++){const n=this._selections[s];if(n.isEmpty()){o[s]=null;continue}const r=this._getVisibleRangesWithStyle(n,e,this._previousFrameVisibleRangesWithStyle[s]);o[s]=r,this._actualRenderOneSelection(t,i,this._selections.length>1,r)}this._previousFrameVisibleRangesWithStyle=o,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 tN(e){return e<0?-e:e}eN.SELECTION_CLASS_NAME="selected-text",eN.SELECTION_TOP_LEFT="top-left-radius",eN.SELECTION_BOTTOM_LEFT="bottom-left-radius",eN.SELECTION_TOP_RIGHT="top-right-radius",eN.SELECTION_BOTTOM_RIGHT="bottom-right-radius",eN.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",eN.ROUNDED_PIECE_WIDTH=10,Qp((e,t)=>{const i=e.getColor($y);i&&t.addRule(`.monaco-editor .focused .selected-text { background-color: ${i}; }`);const n=e.getColor(Gy);n&&t.addRule(`.monaco-editor .selected-text { background-color: ${n}; }`);const o=e.getColor(qy);o&&!o.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${o}; }`)});i("b856");class iN{constructor(e,t,i,n,o,s){this.top=e,this.left=t,this.width=i,this.height=n,this.textContent=o,this.textContentClassName=s}}class nN{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(43);this._cursorStyle=t.get(24),this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=R_(document.createElement("div")),this._domNode.setClassName("cursor "+xL),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),A_.applyFontInfo(this._domNode,i),this._domNode.setDisplay("none"),this._position=new wi(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(43);return this._cursorStyle=t.get(24),this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),A_.applyFontInfo(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_prepareRender(e){let t="";if(this._cursorStyle===O.Line||this._cursorStyle===O.LineThin){const i=e.visibleRangeForPosition(this._position);if(!i||i.outsideRenderedLine)return null;let n;if(this._cursorStyle===O.Line){if(n=vs(this._lineCursorWidth>0?this._lineCursorWidth:2),n>2){const e=this._context.model.getLineContent(this._position.lineNumber),i=ir(e,this._position.column-1);t=e.substr(this._position.column-1,i)}}else n=vs(1);let o=i.left;n>=2&&o>=1&&(o-=1);const s=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new iN(s,o,n,this._lineHeight,t,"")}const i=this._context.model.getLineContent(this._position.lineNumber),n=ir(i,this._position.column-1),o=e.linesVisibleRangesForRange(new Ci(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column+n),!1);if(!o||0===o.length)return null;const s=o[0];if(s.outsideRenderedLine||0===s.ranges.length)return null;const r=s.ranges[0],a=r.width<1?this._typicalHalfwidthCharacterWidth:r.width;let l="";if(this._cursorStyle===O.Block){const e=this._context.model.getViewLineData(this._position.lineNumber);t=i.substr(this._position.column-1,n);const o=e.tokens.findTokenIndexAtOffset(this._position.column-1);l=e.tokens.getClassName(o)}let c=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return this._cursorStyle!==O.Underline&&this._cursorStyle!==O.UnderlineThin||(c+=this._lineHeight-2,d=2),new iN(c,r.left,a,d,t,l)}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 ${xL} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),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 oN extends Q_{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(80),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new nN(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=R_(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 no,this._cursorFlatBlinkInterval=new oo,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(80),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;i<n;i++)this._secondaryCursors[i].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t){if(this._primaryCursor.onCursorPositionChanged(e),this._updateBlinking(),this._secondaryCursors.length<t.length){const e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){const e=new nN(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 i=0;i<t.length;i++)this._secondaryCursors[i].onCursorPositionChanged(t[i])}onCursorStateChanged(e){const t=[];for(let n=0,o=e.selections.length;n<o;n++)t[n]=e.selections[n].getPosition();this._onCursorPositionChanged(t[0],t.slice(1));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 i of this._secondaryCursors)if(t(i.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()},oN.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},oN.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case O.Line:e+=" cursor-line-style";break;case O.Block:e+=" cursor-block-style";break;case O.Underline:e+=" cursor-underline-style";break;case O.LineThin:e+=" cursor-line-thin-style";break;case O.BlockOutline:e+=" cursor-block-outline-style";break;case O.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 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){let t=[],i=0;const n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let o=0,s=this._secondaryCursors.length;o<s;o++){const n=this._secondaryCursors[o].render(e);n&&(t[i++]=n)}this._renderData=t}getLastRenderData(){return this._renderData}}oN.BLINK_INTERVAL=500,Qp((e,t)=>{const i=e.getColor(dx);if(i){let n=e.getColor(hx);n||(n=i.opposite()),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),"hc"===e.type&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const sN=()=>{throw new Error("Invalid change accessor")};class rN extends Q_{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=R_(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=R_(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 n of e)t.set(n.id,n);let i=!1;return this._context.model.changeWhitespace(e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o<s;o++){const s=n[o],r=this._zones[s],a=this._computeWhitespaceProps(r.delegate);r.isInHiddenArea=a.isInHiddenArea;const l=t.get(s);!l||l.afterLineNumber===a.afterViewLineNumber&&l.height===a.heightInPx||(e.changeOneWhitespace(s,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(r.delegate,a.heightInPx),i=!0)}}),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._lineHeight=t.get(58),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(58)&&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){return"undefined"!==typeof e.afterColumn?e.afterColumn:1e4}_computeWhitespaceProps(e){if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t,i;if("undefined"!==typeof e.afterColumn)t=this._context.model.validateModelPosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const i=this._context.model.validateModelPosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new wi(i,this._context.model.getModelLineMaxColumn(i))}i=t.column===this._context.model.getModelLineMaxColumn(t.lineNumber)?this._context.model.validateModelPosition({lineNumber:t.lineNumber+1,column:1}):this._context.model.validateModelPosition({lineNumber:t.lineNumber,column:t.column+1});const n=this._context.model.coordinatesConverter.convertModelPositionToViewPosition(t),o=this._context.model.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:n.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.model.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)}};aN(e,n),n.addZone=sN,n.removeZone=sN,n.layoutZone=sN}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n=e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),o={whitespaceId:n,delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:R_(t.domNode),marginDomNode:t.marginDomNode?R_(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.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(i){xe(i)}}_safeCallOnDomNodeTop(e,t){if("function"===typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(i){xe(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(i[s.id]=s,n=!0);const o=Object.keys(this._zones);for(let s=0,r=o.length;s<r;s++){const t=o[s],n=this._zones[t];let r=0,a=0,l="none";i.hasOwnProperty(t)?(r=i[t].verticalOffset-e.bigNumbersDelta,a=i[t].height,l="block",n.isVisible||(n.domNode.setAttribute("monaco-visible-view-zone","true"),n.isVisible=!0),this._safeCallOnDomNodeTop(n.delegate,e.getScrolledTopFromAbsoluteTop(i[t].verticalOffset))):(n.isVisible&&(n.domNode.removeAttribute("monaco-visible-view-zone"),n.isVisible=!1),this._safeCallOnDomNodeTop(n.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),n.domNode.setTop(r),n.domNode.setHeight(a),n.domNode.setDisplay(l),n.marginDomNode&&(n.marginDomNode.setTop(r),n.marginDomNode.setHeight(a),n.marginDomNode.setDisplay(l))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}function aN(e,t){try{return e(t)}catch(i){xe(i)}}class lN{constructor(e){this._theme=e}get type(){return this._theme.type}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class cN{constructor(e,t,i){this.configuration=e,this.theme=new lN(t),this.model=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.model.addViewEventHandler(e)}removeEventHandler(e){this.model.removeViewEventHandler(e)}}class dN{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 Ci(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class hN extends Z_{constructor(e,t,i,n,o,s){super(),this._selections=[new yi(1,1,1,1)],this._renderAnimationFrame=null;const r=new uE(t,n,o,e);this._context=new cN(t,i.getColorTheme(),n),this._configPixelRatio=this._context.configuration.options.get(127),this._context.addEventHandler(this),this._register(i.onDidColorThemeChange(e=>{this._context.theme.update(e),this._context.model.onDidColorThemeChange(),this.render(!0,!1)})),this._viewParts=[],this._textAreaHandler=new EL(this._context,r,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=R_(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=R_(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=R_(document.createElement("div")),J_.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new cD(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new bD(this._context,this._linesContent),this._viewZones=new rN(this._context),this._viewParts.push(this._viewZones);const a=new KD(this._context);this._viewParts.push(a);const l=new YD(this._context);this._viewParts.push(l);const c=new wE(this._context);this._viewParts.push(c),c.addDynamicOverlay(new DE(this._context)),c.addDynamicOverlay(new eN(this._context)),c.addDynamicOverlay(new gD(this._context)),c.addDynamicOverlay(new IE(this._context));const d=new CE(this._context);this._viewParts.push(d),d.addDynamicOverlay(new NE(this._context)),d.addDynamicOverlay(new uD(this._context)),d.addDynamicOverlay(new wD(this._context)),d.addDynamicOverlay(new vD(this._context)),d.addDynamicOverlay(new yL(this._context));const h=new SL(this._context);h.getDomNode().appendChild(this._viewZones.marginDomNode),h.getDomNode().appendChild(d.getDomNode()),this._viewParts.push(h),this._contentWidgets=new SE(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new oN(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new zD(this._context),this._viewParts.push(this._overlayWidgets);const u=new GD(this._context);this._viewParts.push(u);const g=new BD(this._context);if(this._viewParts.push(g),a){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(a.getDomNode(),e.insertBefore)}this._linesContent.appendChild(c.getDomNode()),this._linesContent.appendChild(u.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(h.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(l.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new wL(this._context,r,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._renderNow()}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new Bk(e,t)},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 wi(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPositionRelativeToEditor:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new wi(e,t)))}}_applyLayout(){const e=this._context.configuration.options,t=e.get(129);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(126)+" "+Gp(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this._configPixelRatio=this._context.configuration.options.get(127),this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return 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(){null===this._renderAnimationFrame&&(this._renderAnimationFrame=xo(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){uN(()=>this._actualRender())}_getViewPartsToRender(){let e=[],t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!po(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return;const t=this._context.viewLayout.getLinesViewportData();this._context.model.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new dN(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.model);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const n=new tb(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(n);for(const o of e)o.render(n),o.onDidRender();Math.abs(Cn()-this._configPixelRatio)>.001&&this._context.configuration.updatePixelRatio()}delegateVerticalScrollbarMouseDown(e){this._scrollbar.delegateVerticalScrollbarMouseDown(e)}restoreState(e){this._context.model.setScrollPosition({scrollTop:e.scrollTop},1),this._context.model.tokenizeViewport(),this._renderNow(),this._viewLines.updateLineWidths(),this._context.model.setScrollPosition({scrollLeft:e.scrollLeft},1)}getOffsetForColumn(e,t){const i=this._context.model.validateModelPosition({lineNumber:e,column:t}),n=this._context.model.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new wi(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?gE.convertViewToModelMouseTarget(i,this._context.model.coordinatesConverter):null}createOverviewRuler(e){return new qD(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()}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){let t=e.position&&e.position.range||null;if(null===t){const i=e.position?e.position.position:null;null!==i&&(t=new Ci(i.lineNumber,i.column,i.lineNumber,i.column))}const i=e.position?e.position.preference:null;this._contentWidgets.setWidgetPosition(e.widget,t,i),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,i=this._overlayWidgets.setWidgetPosition(e.widget,t);i&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}function uN(e){try{return e()}catch(t){xe(t)}}class gN{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Ek(new Ci(1,1,1,1),0,new wi(1,1),0),new Ek(new Ci(1,1,1,1),0,new wi(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 Tk(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return 0===this.modelState.selection.getDirection()?new yi(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new yi(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}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(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(i,2),r=this._validatePositionWithCache(e,n,i,s),a=this._validatePositionWithCache(e,o,n,r);return i.equals(s)&&n.equals(r)&&o.equals(a)?t:new Ek(Ci.fromPositions(r,a),t.selectionStartLeftoverVisibleColumns+n.column-r.column,s,t.leftoverVisibleColumns+i.column-s.column)}_setState(e,t,i){if(i&&(i=gN._validateViewState(e.viewModel,i)),t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),s=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new Ek(i,n,o,s)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new Ek(n,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new Ek(n,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new wi(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new wi(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new Ci(n.lineNumber,n.column,o.lineNumber,o.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Ek(s,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class fN{constructor(e){this.context=e,this.primaryCursor=new gN(e),this.secondaryCursors=[],this.lastAddedCursorIndex=0}dispose(){this.primaryCursor.dispose(this.context),this.killSecondaryCursors()}startTrackingSelections(){this.primaryCursor.startTrackingSelection(this.context);for(let e=0,t=this.secondaryCursors.length;e<t;e++)this.secondaryCursors[e].startTrackingSelection(this.context)}stopTrackingSelections(){this.primaryCursor.stopTrackingSelection(this.context);for(let e=0,t=this.secondaryCursors.length;e<t;e++)this.secondaryCursors[e].stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){this.primaryCursor.ensureValidState(this.context);for(let e=0,t=this.secondaryCursors.length;e<t;e++)this.secondaryCursors[e].ensureValidState(this.context)}readSelectionFromMarkers(){let e=[];e[0]=this.primaryCursor.readSelectionFromMarkers(this.context);for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].readSelectionFromMarkers(this.context);return e}getAll(){let e=[];e[0]=this.primaryCursor.asCursorState();for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].asCursorState();return e}getViewPositions(){let e=[];e[0]=this.primaryCursor.viewState.position;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].viewState.position;return e}getTopMostViewPosition(){let e=this.primaryCursor.viewState.position;for(let t=0,i=this.secondaryCursors.length;t<i;t++){const i=this.secondaryCursors[t].viewState.position;i.isBefore(e)&&(e=i)}return e}getBottomMostViewPosition(){let e=this.primaryCursor.viewState.position;for(let t=0,i=this.secondaryCursors.length;t<i;t++){const i=this.secondaryCursors[t].viewState.position;e.isBeforeOrEqual(i)&&(e=i)}return e}getSelections(){let e=[];e[0]=this.primaryCursor.modelState.selection;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].modelState.selection;return e}getViewSelections(){let e=[];e[0]=this.primaryCursor.viewState.selection;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].viewState.selection;return e}setSelections(e){this.setStates(Tk.fromModelSelections(e))}getPrimaryCursor(){return this.primaryCursor.asCursorState()}setStates(e){null!==e&&(this.primaryCursor.setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.secondaryCursors.length,i=e.length;if(t<i){let e=i-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>i){let e=t-i;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.secondaryCursors.length-1)}for(let n=0;n<i;n++)this.secondaryCursors[n].setState(this.context,e[n].modelState,e[n].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.secondaryCursors.push(new gN(this.context)),this.lastAddedCursorIndex=this.secondaryCursors.length}getLastAddedCursorIndex(){return 0===this.secondaryCursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)}_getAll(){let e=[];e[0]=this.primaryCursor;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t];return e}normalize(){if(0===this.secondaryCursors.length)return;let e=this._getAll(),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort((e,t)=>e.selection.startLineNumber===t.selection.startLineNumber?e.selection.startColumn-t.selection.startColumn:e.selection.startLineNumber-t.selection.startLineNumber);for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],s=n.selection,r=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let a;if(a=r.isEmpty()||s.isEmpty()?r.getStartPosition().isBeforeOrEqual(s.getEndPosition()):r.getStartPosition().isBefore(s.getEndPosition()),a){const s=n.index<o.index?i:i+1,r=n.index<o.index?i+1:i,a=t[r].index,l=t[s].index,c=t[r].selection,d=t[s].selection;if(!c.equalsSelection(d)){const i=c.plusRange(d),n=c.selectionStartLineNumber===c.startLineNumber&&c.selectionStartColumn===c.startColumn,o=d.selectionStartLineNumber===d.startLineNumber&&d.selectionStartColumn===d.startColumn;let r,h;a===this.lastAddedCursorIndex?(r=n,this.lastAddedCursorIndex=l):r=o,h=r?new yi(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new yi(i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn),t[s].selection=h;const u=Tk.fromModelSelection(h);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 mN{constructor(){this.type=0}}class pN{constructor(){this.type=1}}class _N{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class bN{constructor(e,t){this.type=3,this.selections=e,this.modelSelections=t}}class vN{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class wN{constructor(){this.type=5}}class CN{constructor(e){this.type=6,this.isFocused=e}}class yN{constructor(){this.type=7}}class SN{constructor(){this.type=8}}class xN{constructor(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}}class kN{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class LN{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class EN{constructor(e,t,i,n,o,s){this.type=12,this.source=e,this.range=t,this.selections=i,this.verticalType=n,this.revealHorizontal=o,this.scrollType=s}}class DN{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 NN{constructor(){this.type=14}}class IN{constructor(e){this.type=15,this.ranges=e}}class TN{constructor(){this.type=16}}class MN{constructor(){this.type=17}}class ON extends Ye{constructor(){super(),this._onEvent=this._register(new rt),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++)if(this._outgoingEvents[t].kind===e.kind)return void(this._outgoingEvents[t]=this._outgoingEvents[t].merge(e));this._outgoingEvents.push(e)}_emitOutgoingEvents(){while(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 AN),this._collector}endEmitViewEvents(){if(this._collectorCnt--,0===this._collectorCnt){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const i of e)this._addOutgoingEvent(i);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{const t=this.beginEmitViewEvents();t.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(){while(this._viewEventQueue){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class AN{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class PN{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}merge(e){return 0!==e.kind?this:new PN(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class RN{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}merge(e){return 1!==e.kind?this:new RN(this.oldHasFocus,e.hasFocus)}}class FN{constructor(e,t,i,n,o,s,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=s,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}merge(e){return 2!==e.kind?this:new FN(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class BN{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}}class WN{constructor(e,t,i,n,o,s,r){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=s,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,n=t.length;if(i!==n)return!1;for(let o=0;o<i;o++)if(!e[o].equalsSelection(t[o]))return!1;return!0}isNoOp(){return WN._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}merge(e){return 6!==e.kind?this:new WN(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class VN{constructor(){this.kind=5}isNoOp(){return!1}merge(e){return this}}class zN{constructor(e,t){this.modelVersionId=e.getVersionId(),this.cursorState=t.getCursorStates()}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 HN{constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){let 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){let t=[];for(let i=0;i<this._autoClosedEnclosingDecorations.length;i++){const e=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[i]);if(e&&(t.push(e),e.startLineNumber!==e.endLineNumber))return!1}t.sort(Ci.compareRangesUsingStarts),e.sort(Ci.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 KN extends Ye{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new Dk(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new fN(this.context),this._hasFocus=!1,this._isHandling=!1,this._isDoingComposition=!1,this._selectionsWhenCompositionStarted=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=Ue(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new Dk(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){let 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 o=!1;null!==n&&n.length>KN.MAX_CURSOR_COUNT&&(n=n.slice(0,KN.MAX_CURSOR_COUNT),o=!0);const s=new zN(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,s,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n){const o=this._cursors.getViewPositions();if(o.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),0,i,n);else{const s=o[0],r=new Ci(s.lineNumber,s.column,s.lineNumber,s.column);this._emitCursorRevealRange(e,t,r,null,0,i,n)}}_revealPrimaryCursor(e,t,i,n,o){const s=this._cursors.getViewPositions();if(s.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),i,n,o);else{const r=s[0],a=new Ci(r.lineNumber,r.column,r.lineNumber,r.column);this._emitCursorRevealRange(e,t,a,null,i,n,o)}}_emitCursorRevealRange(e,t,i,n,o,s,r){e.emitViewEvent(new EN(t,i,n,o,s,r))}saveState(){let e=[];const 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){let i=[];for(let n=0,o=t.length;n<o;n++){const e=t[n];let o=1,s=1;e.position&&e.position.lineNumber&&(o=e.position.lineNumber),e.position&&e.position.column&&(s=e.position.column);let r=o,a=s;e.selectionStart&&e.selectionStart.lineNumber&&(r=e.selectionStart.lineNumber),e.selectionStart&&e.selectionStart.column&&(a=e.selectionStart.column),i.push({selectionStartLineNumber:r,selectionStartColumn:a,positionLineNumber:o,positionColumn:s})}this.setStates(e,"restoreState",0,Tk.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!0,1)}onModelContentChanged(e,t){if(t instanceof pw){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{if(this._knownModelVersionId=t.versionId,this._isHandling)return;const i=t.containsEvent(1);if(this._prevEditOperationType=0,i)this._cursors.dispose(),this._cursors=new fN(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&t.resultingSelection&&t.resultingSelection.length>0){const i=Tk.fromModelSelections(t.resultingSelection);this.setStates(e,"modelChange",t.isUndoing?5:t.isRedoing?6:2,i)&&this._revealPrimaryCursor(e,"modelChange",0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Tk.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:tC.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:tC.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,Tk.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],n=[];for(let r=0,a=e.length;r<a;r++)i.push({range:e[r],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),n.push({range:t[r],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),s=this._model.deltaDecorations([],n);this._autoClosedActions.push(new HN(this._model,o,s))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=jN.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);let i=[],n=[];for(let t=0;t<e.commands.length;t++){const o=e.commands[t];o instanceof qL&&o.enclosingRange&&o.closeCharacterRange&&(i.push(o.closeCharacterRange),n.push(o.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,o){const s=new zN(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new bN(a,r)),!n||n.cursorState.length!==s.cursorState.length||s.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 WN(a,r,l,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let 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 o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,c=n.text.lastIndexOf(a,l-1);if(-1===c)return null;t.push([c,l])}return t}executeEdits(e,t,i,n){let o=null;"snippet"===t&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);let s=[],r=[];const a=this._model.pushEditOperations(this.getSelections(),i,e=>{if(o)for(let i=0,n=o.length;i<n;i++){const[t,n]=o[i],a=e[i],l=a.range.startLineNumber,c=a.range.startColumn-1+t,d=a.range.startColumn-1+n;s.push(new Ci(l,d+1,l,d+2)),r.push(new Ci(l,c+1,l,d+2))}const t=n(e);return t&&(this._isHandling=!0),t});a&&(this._isHandling=!1,this.setSelections(e,t,a,0)),s.length>0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=new zN(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){xe(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this._revealPrimaryCursor(t,i,0,!0,0)}setIsDoingComposition(e){this._isDoingComposition=e}getAutoClosedCharacters(){return HN.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit(()=>{"keyboard"===t&&(this._executeEditOperation($L.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),this.getAutoClosedCharacters())),this._selectionsWhenCompositionStarted=null)},e,t)}type(e,t,i){this._executeEdit(()=>{if("keyboard"===i){const e=t.length;let i=0;while(i<e){const e=ir(t,i),n=t.substr(i,e);this._executeEditOperation($L.typeWithInterceptors(this._isDoingComposition,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),n)),i+=e}}else this._executeEditOperation($L.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,o,s){if(0!==t.length||0!==i||0!==n)this._executeEdit(()=>{this._executeEditOperation($L.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))},e,s);else if(0!==o){const t=this.getSelections().map(e=>{const t=e.getPosition();return new yi(t.lineNumber,t.column+o,t.lineNumber,t.column+o)});this.setSelections(e,s,t,0)}}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation($L.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(BL.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Mk(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Mk(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}KN.MAX_CURSOR_COUNT=1e4;class jN{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let s=0,r=n.trackedRanges.length;s<r;s++)n.model._setTrackedRange(n.trackedRanges[s],null,0);return o}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,o=this._getLoserCursorMap(n);if(o.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;let s=[];for(let l=0,c=n.length;l<c;l++)o.hasOwnProperty(n[l].identifier.major.toString())||s.push(n[l]);i.hadTrackedEditOperation&&s.length>0&&(s[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,s,i=>{let 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 o=(e,t)=>e.identifier.minor-t.identifier.minor;let s=[];for(let r=0;r<e.selectionsBefore.length;r++)n[r].length>0?(n[r].sort(o),s[r]=t[r].computeCursorState(e.model,{getInverseEditOperations:()=>n[r],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)}})):s[r]=e.selectionsBefore[r];return s});r||(r=e.selectionsBefore);let a=[];for(let l in o)o.hasOwnProperty(l)&&a.push(parseInt(l,10));a.sort((e,t)=>t-e);for(const l of a)r.splice(l,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 o=0,s=t.length;o<s;o++){const s=t[o];if(s){const t=this._getEditOperationsFromCommand(e,o,s);i=i.concat(t.operations),n=n||t.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){let n=[],o=0;const s=(e,s,r=!1)=>{Ci.isEmpty(e)&&""===s||n.push({identifier:{major:t,minor:o++},range:e,text:s,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a=(e,t,i)=>{r=!0,s(e,t,i)},l=(t,i)=>{const n=yi.liftSelection(t);let o;if(n.isEmpty())if("boolean"===typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()},c={addEditOperation:s,addTrackedEditOperation:a,trackSelection:l};try{i.getEditOperations(e.model,c)}catch(d){return xe(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((e,t)=>-Ci.compareRangesUsingEnds(e.range,t.range));let t={};for(let i=1;i<e.length;i++){const n=e[i-1],o=e[i];if(Ci.getStartPosition(n.range).isBefore(Ci.getEndPosition(o.range))){let s;s=n.identifier.major>o.identifier.major?n.identifier.major:o.identifier.major,t[s.toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===s&&(e.splice(t,1),t<i&&i--,t--);i>0&&i--}}return t}}class UN{constructor(e,t,i,n,o,s){this.id=e,this.label=t,this.alias=i,this._precondition=n,this._run=o,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(){return this.isSupported()?this._run():Promise.resolve(void 0)}}function $N(e,t,i,n,o,s,r){let a="<div>",l=n,c=0,d=!0;for(let h=0,u=t.getCount();h<u;h++){const u=t.getEndOffset(h);if(u<=n)continue;let g="";for(;l<u&&l<o;l++){const t=e.charCodeAt(l);switch(t){case 9:let e=s-(l+c)%s;c+=e-1;while(e>0)r&&d?(g+=" ",d=!1):(g+=" ",d=!0),e--;break;case 60:g+="<",d=!1;break;case 62:g+=">",d=!1;break;case 38:g+="&",d=!1;break;case 0:g+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="<EFBFBD>",d=!1;break;case 13:g+="​",d=!1;break;case 32:r&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(t),d=!1}}if(a+=`<span style="${t.getInlineStyle(h,i)}">${g}</span>`,u>o||l>=o)break}return a+="</div>",a}class qN{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 GN{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}class YN{constructor(e,t,i,n){this._instanceId=_r(++YN.INSTANCE_COUNT),this._pendingChanges=new qN,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,o=e.length;while(n<o){const s=n+o>>>1;t===e[s].afterLineNumber?i<e[s].ordinal?o=s:n=s+1:t<e[s].afterLineNumber?o=s:n=s+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{const i={insertWhitespace:(e,i,n,o)=>{t=!0,e|=0,i|=0,n|=0,o|=0;const s=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new GN(s,e,i,n,o)),s},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})}};e(i)}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 a of i)n.add(a.id);const o=new Map;for(const a of t)o.set(a.id,a);const s=e=>{let t=[];for(const i of e)if(!n.has(i.id)){if(o.has(i.id)){const e=o.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=s(this._arr).concat(s(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=YN.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++){const n=this._arr[i].afterLineNumber;e<=n&&(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();const e=this._lineHeight*this._lineCount,t=this.getWhitespacesTotalHeight();return e+t+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;while(i<=n){const o=n-i|0,s=o/2|0,r=i+s|0;if(t[r].afterLineNumber<e){if(r+1>=t.length||t[r+1].afterLineNumber>=e)return r;i=r+1|0}else n=r-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e),i=t+1;return i<this._arr.length?i:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e){let t;this._checkPendingChanges(),e|=0,t=e>1?this._lineHeight*(e-1):0;const i=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e);return t+i+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();const t=this.getLinesTotalHeight();return e>t}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){if(0===this._paddingBottom)return!1;this._checkPendingChanges();const t=this.getLinesTotalHeight();return e>=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e|=0,e<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,o=t;while(n<o){const t=(n+o)/2|0,s=0|this.getVerticalOffsetForLineNumber(t);if(e>=s+i)n=t+1;else{if(e>=s)return t;o=t}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this._lineHeight,n=0|this.getLineNumberAtOrAfterVerticalOffset(e),o=0|this.getVerticalOffsetForLineNumber(n);let s=0|this._lineCount,r=0|this.getFirstWhitespaceIndexAfterLineNumber(n);const a=0|this.getWhitespacesCount();let l,c;-1===r?(r=a,c=s+1,l=0):(c=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let d=o,h=d;const u=5e5;let g=0;o>=u&&(g=Math.floor(o/u)*u,g=Math.floor(g/i)*i,h-=g);const f=[],m=e+(t-e)/2;let p=-1;for(let w=n;w<=s;w++){if(-1===p){const e=d,t=d+i;(e<=m&&m<t||e>m)&&(p=w)}d+=i,f[w-n]=h,h+=i;while(c===w)h+=l,d+=l,r++,r>=a?c=s+1:(c=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(d>=t){s=w;break}}-1===p&&(p=s);const _=0|this.getVerticalOffsetForLineNumber(s);let b=n,v=s;return b<v&&o<e&&b++,b<v&&_+i>t&&v--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:s,relativeVerticalOffset:f,centeredLineNumber:p,completelyVisibleStartLineNumber:b,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;const n=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=n+o)return-1;while(t<i){const n=Math.floor((t+i)/2),o=this.getVerticalOffsetForWhitespaceIndex(n),s=this.getHeightForWhitespaceIndex(n);if(e>=o+s)t=n+1;else{if(e>=o)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),o=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:s,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[];let o=[];for(let s=i;s<=n;s++){const e=this.getVerticalOffsetForWhitespaceIndex(s),i=this.getHeightForWhitespaceIndex(s);if(e>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:e,height:i})}return o}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}}YN.INSTANCE_COUNT=0;const XN=125;class ZN{constructor(e,t,i,n){e|=0,t|=0,i|=0,n|=0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),n<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 QN extends Ye{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new rt),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new ZN(0,0,0,0),this._scrollable=this._register(new $E(e,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 PN(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)}}class JN extends Ye{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(129),s=n.get(74);this._linesLayout=new YN(t,n.get(58),s.top,s.bottom),this._scrollable=this._register(new QN(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new ZN(o.contentWidth,0,o.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(102)?XN:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(58)&&this._linesLayout.setLineHeight(t.get(58)),e.hasChanged(74)){const e=t.get(74);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(129)){const e=t.get(129),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),s=o.contentWidth;this._scrollable.setScrollDimensions(new ZN(i,o.contentWidth,n,this._getContentHeight(i,n,s)))}else this._updateHeight();e.hasChanged(102)&&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,n=i.get(91);return 2===n.horizontal||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(93)?o+=Math.max(0,t-n.get(58)-n.get(74).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new ZN(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Tg(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Tg(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(130),n=t.get(43);if(i.isViewportWrapping){const i=t.get(129),o=t.get(64);return e>i.contentWidth+n.typicalHalfwidthCharacterWidth&&o.enabled&&"right"===o.side?e+i.verticalScrollbarWidth:e}{const i=t.get(92)*n.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i,o)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new ZN(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition();let t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),n=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-n,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)}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(){const e=this._scrollable.getScrollDimensions();return e.contentWidth}getScrollWidth(){const e=this._scrollable.getScrollDimensions();return e.scrollWidth}getContentHeight(){const e=this._scrollable.getScrollDimensions();return e.contentHeight}getScrollHeight(){const e=this._scrollable.getScrollDimensions();return e.scrollHeight}getCurrentScrollLeft(){const e=this._scrollable.getCurrentScrollPosition();return e.scrollLeft}getCurrentScrollTop(){const e=this._scrollable.getCurrentScrollPosition();return e.scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class eI{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){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t)}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 tI{constructor(e){this._counts=e,this._isValid=!1,this._validEndIndex=-1,this._modelToView=[],this._viewToModel=[]}_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._counts.length;e<t;e++){const t=this._counts[e],i=e>0?this._modelToView[e-1]:0;this._modelToView[e]=i+t;for(let n=0;n<t;n++)this._viewToModel[i+n]=e}this._modelToView.length=this._counts.length,this._viewToModel.length=this._modelToView[this._modelToView.length-1],this._isValid=!0,this._validEndIndex=this._counts.length-1}}changeValue(e,t){this._counts[e]!==t&&(this._counts[e]=t,this._invalidate(e))}removeValues(e,t){this._counts.splice(e,t),this._invalidate(e)}insertValues(e,t){this._counts=Mu(this._counts,e,t),this._invalidate(e)}getTotalValue(){return this._ensureValid(),this._viewToModel.length}getAccumulatedValue(e){return this._ensureValid(),this._modelToView[e]}getIndexOf(e){this._ensureValid();const t=this._viewToModel[e],i=t>0?this._modelToView[t-1]:0;return new iu(t,e-i)}}class iI{constructor(e,t,i,n,o,s,r,a,l){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=r,this.wrappingColumn=a,this.wrappingIndent=l,this._constructLines(!0,null)}dispose(){this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,[])}createCoordinatesConverter(){return new eI(this)}_constructLines(e,t){this.lines=[],e&&(this.hiddenAreasIds=[]);const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,s=this.createLineBreaksComputer(),r=new Bu(dw.fromDecorations(n));for(let f=0;f<o;f++){const e=r.takeWhile(e=>e.lineNumber===f+1);s.addRequest(i[f],e,t?t[f]:null)}const a=s.finalize();let l=[],c=this.hiddenAreasIds.map(e=>this.model.getDecorationRange(e)).sort(Ci.compareRangesUsingStarts),d=1,h=0,u=-1,g=u+1<c.length?h+1:o+2;for(let f=0;f<o;f++){let e=f+1;e===g&&(u++,d=c[u].startLineNumber,h=c[u].endLineNumber,g=u+1<c.length?h+1:o+2);let t=e>=d&&e<=h,i=hI(a[f],!t);l[f]=i.getViewLineCount(),this.lines[f]=i}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new tI(l)}getHiddenAreas(){return this.hiddenAreasIds.map(e=>this.model.getDecorationRange(e))}_reduceRanges(e){if(0===e.length)return[];let t=e.map(e=>this.model.validateRange(e)).sort(Ci.compareRangesUsingStarts),i=[],n=t[0].startLineNumber,o=t[0].endLineNumber;for(let s=1,r=t.length;s<r;s++){let e=t[s];e.startLineNumber>o+1?(i.push(new Ci(n,1,o,1)),n=e.startLineNumber,o=e.endLineNumber):e.endLineNumber>o&&(o=e.endLineNumber)}return i.push(new Ci(n,1,o,1)),i}setHiddenAreas(e){let t=this._reduceRanges(e),i=this.hiddenAreasIds.map(e=>this.model.getDecorationRange(e)).sort(Ci.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}let n=[];for(const d of t)n.push({range:d,options:bk.EMPTY});this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,n);let o=t,s=1,r=0,a=-1,l=a+1<o.length?r+1:this.lines.length+2,c=!1;for(let d=0;d<this.lines.length;d++){let e=d+1;e===l&&(a++,s=o[a].startLineNumber,r=o[a].endLineNumber,l=a+1<o.length?r+1:this.lines.length+2);let t=!1;if(e>=s&&e<=r?this.lines[d].isVisible()&&(this.lines[d]=this.lines[d].setVisible(!1),t=!0):(c=!0,this.lines[d].isVisible()||(this.lines[d]=this.lines[d].setVisible(!0),t=!0)),t){let e=this.lines[d].getViewLineCount();this.prefixSumComputer.changeValue(d,e)}}return c||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.lines.length)&&this.lines[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.lines.length?1:this.lines[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n){const o=this.fontInfo.equals(e),s=this.wrappingStrategy===t,r=this.wrappingColumn===i,a=this.wrappingIndent===n;if(o&&s&&r&&a)return!1;const l=o&&s&&!r&&a;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n;let c=null;if(l){c=[];for(let e=0,t=this.lines.length;e<t;e++)c[e]=this.lines[e].getLineBreakData()}return this._constructLines(!1,c),!0}createLineBreaksComputer(){const e="advanced"===this.wrappingStrategy?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory;return e.createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;let n=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,o=this.prefixSumComputer.getAccumulatedValue(i-1);return this.lines.splice(t-1,i-t+1),this.prefixSumComputer.removeValues(t-1,i-t+1),new kN(n,o)}onModelLinesInserted(e,t,i,n){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.lines[t-2].isVisible();let s=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,r=0,a=[],l=[];for(let c=0,d=n.length;c<d;c++){let e=hI(n[c],!o);a.push(e);let t=e.getViewLineCount();r+=t,l[c]=t}return this.lines=this.lines.slice(0,t-1).concat(a).concat(this.lines.slice(t-1)),this.prefixSumComputer.insertValues(t-1,l),new LN(s,s+r-1)}onModelLineChanged(e,t,i){if(null!==e&&e<=this._validModelVersionId)return[!1,null,null,null];let n=t-1,o=this.lines[n].getViewLineCount(),s=this.lines[n].isVisible(),r=hI(i,s);this.lines[n]=r;let a=this.lines[n].getViewLineCount(),l=!1,c=0,d=-1,h=0,u=-1,g=0,f=-1;o>a?(c=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,d=c+a-1,g=d+1,f=g+(o-a)-1,l=!0):o<a?(c=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,d=c+o-1,h=d+1,u=h+(a-o)-1,l=!0):(c=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,d=c+a-1),this.prefixSumComputer.changeValue(n,a);const m=c<=d?new xN(c,d):null,p=h<=u?new LN(h,u):null,_=g<=f?new kN(g,f):null;return[l,m,p,_]}acceptVersionId(e){this._validModelVersionId=e,1!==this.lines.length||this.lines[0].isVisible()||this.setHiddenAreas([])}getViewLineCount(){return this.prefixSumComputer.getTotalValue()}_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)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.getActiveIndentGuide(n.lineNumber,o.lineNumber,s.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);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return new nI(i+1,n)}getMinColumnOfViewLine(e){return this.lines[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.lines[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new wi(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.lines[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new wi(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(i),r=new Array;for(let a=i.modelLineNumber;a<=n.modelLineNumber;a++){const e=this.lines[a-1];if(e.isVisible()){let t=a===i.modelLineNumber?i.modelLineWrappedLineIdx:0,o=a===n.modelLineNumber?n.modelLineWrappedLineIdx+1:e.getViewLineCount();for(let e=t;e<o;e++)r.push(new nI(a,e))}if(!e.isVisible()&&s){const e=new wi(a-1,this.model.getLineMaxColumn(a-1)+1),t=Ci.fromPositions(s,e);o.push(new oI(t,r)),r=[],s=null}else e.isVisible()&&!s&&(s=new wi(a,1))}if(s){const e=Ci.fromPositions(s,this.getModelEndPositionOfViewLine(n));o.push(new oI(e,r))}return o}getViewLinesBracketGuides(e,t,i,n){const o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,s=[];for(const r of this.getViewLineInfosGroupedByModelRanges(e,t)){const e=r.modelRange.startLineNumber,t=this.model.getLinesBracketGuides(e,r.modelRange.endLineNumber,o,n);for(const i of r.viewLines)if(i.isWrappedLineContinuation&&1===this.getMinColumnOfViewLine(i))s.push([]);else{let n=t[i.modelLineNumber-e];n=n.map(e=>e.horizontalLine?new $a(e.visibleColumn,e.className,new qa(e.horizontalLine.top,this.convertModelPositionToViewPosition(i.modelLineNumber,e.horizontalLine.endColumn).column)):e),s.push(n)}}return s}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 o=[],s=[],r=[];const a=i.lineNumber-1,l=n.lineNumber-1;let c=null;for(let g=a;g<=l;g++){const e=this.lines[g];if(e.isVisible()){let t=e.getViewLineNumberOfModelPosition(0,g===a?i.column:1),n=e.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),o=n-t+1,l=0;o>1&&1===e.getViewLineMinColumn(this.model,g+1,n)&&(l=0===t?1:2),s.push(o),r.push(l),null===c&&(c=new wi(g+1,0))}else null!==c&&(o=o.concat(this.model.getLinesIndentGuides(c.lineNumber,g)),c=null)}null!==c&&(o=o.concat(this.model.getLinesIndentGuides(c.lineNumber,n.lineNumber)),c=null);const d=t-e+1;let h=new Array(d),u=0;for(let g=0,f=o.length;g<f;g++){let e,t=o[g],i=Math.min(d-u,s[g]),n=r[g];e=2===n?0:1===n?1:i;for(let o=0;o<i;o++)o===e&&(t=0),h[u++]=t}return h}getViewLineContent(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return this.lines[i].getViewLineContent(this.model,i+1,n)}getViewLineLength(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return this.lines[i].getViewLineLength(this.model,i+1,n)}getViewLineMinColumn(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return this.lines[i].getViewLineMinColumn(this.model,i+1,n)}getViewLineMaxColumn(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return this.lines[i].getViewLineMaxColumn(this.model,i+1,n)}getViewLineData(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return this.lines[i].getViewLineData(this.model,i+1,n)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);let n=this.prefixSumComputer.getIndexOf(e-1),o=e,s=n.index,r=n.remainder,a=[];for(let l=s,c=this.model.getLineCount();l<c;l++){let n=this.lines[l];if(!n.isVisible())continue;let c=l===s?r:0,d=n.getViewLineCount()-c,h=!1;o+d>t&&(h=!0,d=t-o+1);let u=c+d;if(n.getViewLinesData(this.model,l+1,c,u,o-e,i,a),o+=d,h)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);let n=this.prefixSumComputer.getIndexOf(e-1),o=n.index,s=n.remainder,r=this.lines[o],a=r.getViewLineMinColumn(this.model,o+1,s),l=r.getViewLineMaxColumn(this.model,o+1,s);t<a&&(t=a),t>l&&(t=l);let c=r.getModelColumnOfViewPosition(s,t),d=this.model.validatePosition(new wi(o+1,c));return d.equals(i)?new wi(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 Ci(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){e=this._toValidViewLineNumber(e);let i=this.prefixSumComputer.getIndexOf(e-1),n=i.index,o=i.remainder,s=this.lines[n].getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new wi(n+1,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new Ci(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2){const n=this.model.validatePosition(new wi(e,t)),o=n.lineNumber,s=n.column;let r=o-1,a=!1;while(r>0&&!this.lines[r].isVisible())r--,a=!0;if(0===r&&!this.lines[r].isVisible())return new wi(1,1);const l=1+(0===r?0:this.prefixSumComputer.getAccumulatedValue(r-1));let c;return c=a?this.lines[r].getViewPositionOfModelPosition(l,this.model.getLineMaxColumn(r+1),i):this.lines[o-1].getViewPositionOfModelPosition(l,s,i),c}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return Ci.fromPositions(i)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new Ci(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.lines[i].isVisible()){const e=1+(0===i?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(e,t)}while(i>0&&!this.lines[i].isVisible())i--;if(0===i&&!this.lines[i].isVisible())return 1;const n=1+(0===i?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i){const n=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),o=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(o.lineNumber-n.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new Ci(n.lineNumber,1,o.lineNumber,o.column),t,i);let s=[];const r=n.lineNumber-1,a=o.lineNumber-1;let l=null;for(let u=r;u<=a;u++){const e=this.lines[u];if(e.isVisible())null===l&&(l=new wi(u+1,u===r?n.column:1));else if(null!==l){const e=this.model.getLineMaxColumn(u);s=s.concat(this.model.getDecorationsInRange(new Ci(l.lineNumber,l.column,u,e),t,i)),l=null}}null!==l&&(s=s.concat(this.model.getDecorationsInRange(new Ci(l.lineNumber,l.column,o.lineNumber,o.column),t,i)),l=null),s.sort((e,t)=>{const i=Ci.compareRangesUsingStarts(e.range,t.range);return 0===i?e.id<t.id?-1:e.id>t.id?1:0:i});let c=[],d=0,h=null;for(const u of s){const e=u.id;h!==e&&(h=e,c[d++]=u)}return c}getInjectedTextAt(e){const t=this._toValidViewLineNumber(e.lineNumber),i=this.prefixSumComputer.getIndexOf(t-1),n=i.index,o=i.remainder;return this.lines[n].getInjectedTextAt(o,e.column)}normalizePosition(e,t){const i=this._toValidViewLineNumber(e.lineNumber),n=this.prefixSumComputer.getIndexOf(i-1),o=n.index,s=n.remainder;return this.lines[o].normalizePosition(this.model,o+1,s,e,t)}getLineIndentColumn(e){const t=this._toValidViewLineNumber(e),i=this.prefixSumComputer.getIndexOf(t-1),n=i.index,o=i.remainder;return 0===o?this.model.getLineIndentColumn(n+1):0}}class nI{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}}class oI{constructor(e,t){this.modelRange=e,this.viewLines=t}}class sI{constructor(){}isVisible(){return!0}setVisible(e){return e?this:rI.INSTANCE}getLineBreakData(){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){let n=e.getLineTokens(t),o=n.getLineContent();return new Pg(o,!1,1,o.length+1,0,n.inflate(),null)}getViewLinesData(e,t,i,n,o,s,r){s[o]?r[o]=this.getViewLineData(e,t,0):r[o]=null}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new wi(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i,n,o){return n}getInjectedTextAt(e,t){return null}}sI.INSTANCE=new sI;class rI{constructor(){}isVisible(){return!1}setVisible(e){return e?sI.INSTANCE:this}getLineBreakData(){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,o,s,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,n,o){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}rI.INSTANCE=new rI;class aI{constructor(e,t){this._lineBreakData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getLineBreakData(){return this._lineBreakData}getViewLineCount(){return this._isVisible?this._lineBreakData.breakOffsets.length:0}getInputStartOffsetOfOutputLineIndex(e){return this._lineBreakData.getInputOffsetOfOutputPosition(e,0)}getInputEndOffsetOfOutputLineIndex(e,t,i){return i+1===this._lineBreakData.breakOffsets.length?e.getLineMaxColumn(t)-1:this._lineBreakData.getInputOffsetOfOutputPosition(i+1,0)}getViewLineContent(e,t,i){if(!this._isVisible)throw new Error("Not supported");const n=i>0?this._lineBreakData.breakOffsets[i-1]:0,o=i<this._lineBreakData.breakOffsets.length?this._lineBreakData.breakOffsets[i]:this._lineBreakData.breakOffsets[this._lineBreakData.breakOffsets.length-1];let s;if(null!==this._lineBreakData.injectionOffsets){const i=this._lineBreakData.injectionOffsets.map((e,t)=>new dw(0,0,e+1,this._lineBreakData.injectionOptions[t],0));s=dw.applyInjectedText(e.getLineContent(t),i).substring(n,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=cI(this._lineBreakData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,i){if(!this._isVisible)throw new Error("Not supported");const n=i>0?this._lineBreakData.breakOffsets[i-1]:0,o=i<this._lineBreakData.breakOffsets.length?this._lineBreakData.breakOffsets[i]:this._lineBreakData.breakOffsets[this._lineBreakData.breakOffsets.length-1];let s=o-n;return i>0&&(s=this._lineBreakData.wrappedTextIndentLength+s),s}getViewLineMinColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return this._getViewLineMinColumn(i)}_getViewLineMinColumn(e){return e>0?this._lineBreakData.wrappedTextIndentLength+1:1}getViewLineMaxColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return this.getViewLineLength(e,t,i)+1}getViewLineData(e,t,i){if(!this._isVisible)throw new Error("Not supported");const n=this._lineBreakData,o=i>0?n.wrappedTextIndentLength:0,s=n.injectionOffsets,r=n.injectionOptions;let a,l,c;if(s){const d=e.getLineTokens(t).withInserted(s.map((e,t)=>({offset:e,text:r[t].content,tokenMetadata:rg.defaultTokenMetadata}))),h=i>0?n.breakOffsets[i-1]:0,u=n.breakOffsets[i];a=d.getLineContent().substring(h,u),l=d.sliceAndInflate(h,u,o),c=new Array;let g=0;for(let e=0;e<s.length;e++){const t=r[e].content.length,o=s[e]+g,a=s[e]+g+t;if(o>u)break;if(h<a){const t=r[e];if(t.inlineClassName){const e=i>0?n.wrappedTextIndentLength:0,s=e+Math.max(o-h,0),r=e+Math.min(a-h,u);s!==r&&c.push(new Bg(s,r,t.inlineClassName,t.inlineClassNameAffectsLetterSpacing))}}g+=t}}else{const n=this.getInputStartOffsetOfOutputLineIndex(i),s=this.getInputEndOffsetOfOutputLineIndex(e,t,i),r=e.getLineTokens(t);a=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:s+1}),l=r.sliceAndInflate(n,s,o),c=null}i>0&&(a=cI(n.wrappedTextIndentLength)+a);const d=i>0?n.wrappedTextIndentLength+1:1,h=a.length+1,u=i+1<this.getViewLineCount(),g=0===i?0:n.breakOffsetsVisibleColumn[i-1];return new Pg(a,u,d,h,g,l,c)}getViewLinesData(e,t,i,n,o,s,r){if(!this._isVisible)throw new Error("Not supported");for(let a=i;a<n;a++){let n=o+a-i;s[n]?r[n]=this.getViewLineData(e,t,a):r[n]=null}}getModelColumnOfViewPosition(e,t){if(!this._isVisible)throw new Error("Not supported");let i=t-1;return e>0&&(i<this._lineBreakData.wrappedTextIndentLength?i=0:i-=this._lineBreakData.wrappedTextIndentLength),this._lineBreakData.getInputOffsetOfOutputPosition(e,i)+1}getViewPositionOfModelPosition(e,t,i=2){if(!this._isVisible)throw new Error("Not supported");let n=this._lineBreakData.getOutputPositionOfInputOffset(t-1,i),o=n.outputLineIndex,s=n.outputOffset+1;return o>0&&(s+=this._lineBreakData.wrappedTextIndentLength),new wi(e+o,s)}getViewLineNumberOfModelPosition(e,t){if(!this._isVisible)throw new Error("Not supported");const i=this._lineBreakData.getOutputPositionOfInputOffset(t-1);return e+i.outputLineIndex}normalizePosition(e,t,i,n,o){if(null!==this._lineBreakData.injectionOffsets){const e=n.lineNumber-i,t=this._lineBreakData.outputPositionToOffsetInUnwrappedLine(i,n.column-1),s=this._lineBreakData.normalizeOffsetAroundInjections(t,o);if(s!==t)return this._lineBreakData.getOutputPositionOfOffsetInUnwrappedLine(s,o).toPosition(e,this._lineBreakData.wrappedTextIndentLength)}if(0===o){if(i>0&&n.column===this._getViewLineMinColumn(i))return new wi(n.lineNumber-1,this.getViewLineMaxColumn(e,t,i-1))}else if(1===o){const o=this.getViewLineCount()-1;if(i<o&&n.column===this.getViewLineMaxColumn(e,t,i))return new wi(n.lineNumber+1,this._getViewLineMinColumn(i+1))}return n}getInjectedTextAt(e,t){return this._lineBreakData.getInjectedText(e,t-1)}}let lI=[""];function cI(e){if(e>=lI.length)for(let t=1;t<=e;t++)lI[t]=dI(t);return lI[e]}function dI(e){return new Array(e+1).join(" ")}function hI(e,t){return null===e?t?sI.INSTANCE:rI.INSTANCE:new aI(e,t)}class uI{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}}class gI{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new uI(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){let e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new kN(t,i)}onModelLinesInserted(e,t,i,n){return new LN(t,i)}onModelLineChanged(e,t,i){return[!1,new xN(t,t),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;let n=new Array(i);for(let o=0;o<i;o++)n[o]=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){let t=this.model.getLineTokens(e),i=t.getLineContent();return new Pg(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);let o=[];for(let s=e;s<=t;s++){let t=s-e;i[t]||(o[t]=null),o[t]=this.getViewLineData(s)}return o}getDecorationsInRange(e,t,i){return this.model.getDecorationsInRange(e,t,i)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class fI{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,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,o=e.options;let s;if(o.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new wi(n.startLineNumber,1),0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new wi(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);s=new Ci(e.lineNumber,e.column,t.lineNumber,t.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new Wg(s,o),this._decorationsCache[t]=i}return i}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsViewportData(e),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}_getDecorationsViewportData(e){const t=this._linesCollection.getDecorationsInRange(e,this.editorId,te(this.configuration.options)),i=e.startLineNumber,n=e.endLineNumber;let o=[],s=0,r=[];for(let a=i;a<=n;a++)r[a-i]=[];for(let a=0,l=t.length;a<l;a++){let e=t[a],l=e.options,c=this._getOrCreateViewModelDecoration(e),d=c.range;if(o[s++]=c,l.inlineClassName){let e=new Fg(d,l.inlineClassName,l.inlineClassNameAffectsLetterSpacing?3:0),t=Math.max(i,d.startLineNumber),o=Math.min(n,d.endLineNumber);for(let n=t;n<=o;n++)r[n-i].push(e)}if(l.beforeContentClassName&&i<=d.startLineNumber&&d.startLineNumber<=n){let e=new Fg(new Ci(d.startLineNumber,d.startColumn,d.startLineNumber,d.startColumn),l.beforeContentClassName,1);r[d.startLineNumber-i].push(e)}if(l.afterContentClassName&&i<=d.endLineNumber&&d.endLineNumber<=n){let e=new Fg(new Ci(d.endLineNumber,d.endColumn,d.endLineNumber,d.endColumn),l.afterContentClassName,2);r[d.endLineNumber-i].push(e)}}return{decorations:o,inlineDecorations:r}}}const mI={ModesRegistry:"editor.modesRegistry"};class pI{constructor(){this._onDidChangeLanguages=new rt,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[],this._dynamicLanguages=[]}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[].concat(this._languages).concat(this._dynamicLanguages)}}const _I=new pI;zd.add(mI.ModesRegistry,_I);const bI="plaintext",vI=".txt";_I.registerLanguage({id:bI,extensions:[vI],aliases:[o("plainText.alias","Plain Text"),"text"],mimetypes:[Jk.text]}),Th.register(bI,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0);const wI=!0;class CI extends Ye{constructor(e,t,i,n,o,s){if(super(),this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new ON,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new Lk(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._tokenizeViewportSoon=this._register(new so(()=>this.tokenizeViewport(),50)),this._updateConfigurationViewLineCount=this._register(new so(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0,wI&&this.model.isTooLargeForTokenization())this._lines=new gI(this.model);else{const e=this._configuration.options,t=e.get(43),i=e.get(123),s=e.get(130),r=e.get(122);this._lines=new iI(this._editorId,this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new KN(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new JN(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(e=>{e.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new DN(e)),this._eventDispatcher.emitOutgoingEvent(new FN(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 fI(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(yD.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new TN)})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this.invalidateMinimapColorCache(),this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,null,1),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())}tokenizeViewport(){const e=this.viewLayout.getLinesViewportData(),t=new Ci(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber)),i=this._toModelVisibleRanges(t);for(const n of i)this.model.tokenizeViewport(n.startLineNumber,n.endLineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new CN(e)),this._eventDispatcher.emitOutgoingEvent(new RN(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new mN)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new pN)}onDidColorThemeChange(){this._eventDispatcher.emitSingleViewEvent(new NN)}_onConfigurationChanged(e,t){let i=null;if(-1!==this._viewportStartLine){let e=new wi(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));i=this.coordinatesConverter.convertViewPositionToModelPosition(e)}let n=!1;const o=this._configuration.options,s=o.get(43),r=o.get(123),a=o.get(130),l=o.get(122);if(this._lines.setWrappingSettings(s,r,a.wrappingColumn,l)&&(e.emitViewEvent(new wN),e.emitViewEvent(new SN),e.emitViewEvent(new vN(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),0!==this.viewLayout.getCurrentScrollTop()&&(n=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(80)&&(this._decorations.reset(),e.emitViewEvent(new vN(null))),e.emitViewEvent(new _N(t)),this.viewLayout.onConfigurationChanged(t),n&&i){const e=this.coordinatesConverter.convertModelPositionToViewPosition(i),t=this.viewLayout.getVerticalOffsetForLineNumber(e.lineNumber);this.viewLayout.setScrollPosition({scrollTop:t+this._viewportStartLineDelta},1)}Lk.shouldRecreate(t)&&(this.cursorConfig=new Lk(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const o=e.changes,s=e instanceof mw?e.versionId:null,r=this._lines.createLineBreaksComputer();for(const e of o)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();let l=0;for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new wN),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(s,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=a.slice(l,l+e.detail.length);l+=e.detail.length;const o=this._lines.onModelLinesInserted(s,e.fromLineNumber,e.toLineNumber,n);null!==o&&(t.emitViewEvent(o),this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),i=!0;break}case 2:{const i=a[l];l++;const[o,r,c,d]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),c&&(t.emitViewEvent(c),this.viewLayout.onLinesInserted(c.fromLineNumber,c.toLineNumber)),d&&(t.emitViewEvent(d),this.viewLayout.onLinesDeleted(d.fromLineNumber,d.toLineNumber));break}case 5:break}null!==s&&this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new SN),t.emitViewEvent(new vN(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}if(this._viewportStartLine=-1,this._configuration.setMaxLineNumber(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&this._viewportStartLineTrackedRange){const e=this.model._getTrackedRange(this._viewportStartLineTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStartLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(this.model.onDidChangeTokens(e=>{let t=[];for(let i=0,n=e.ranges.length;i<n;i++){const n=e.ranges[i],o=this.coordinatesConverter.convertModelPositionToViewPosition(new wi(n.fromLineNumber,1)).lineNumber,s=this.coordinatesConverter.convertModelPositionToViewPosition(new wi(n.toLineNumber,this.model.getLineMaxColumn(n.toLineNumber))).lineNumber;t[i]={fromLineNumber:o,toLineNumber:s}}this._eventDispatcher.emitSingleViewEvent(new IN(t)),e.tokenizationSupportChanged&&this._tokenizeViewportSoon.schedule()})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new yN),this.cursorConfig=new Lk(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new Lk(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new wN),e.emitViewEvent(new SN),e.emitViewEvent(new vN(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Lk(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new vN(e))}))}setHiddenAreas(e){let t=!1;try{const i=this._eventDispatcher.beginEmitViewEvents();t=this._lines.setHiddenAreas(e),t&&(i.emitViewEvent(new wN),i.emitViewEvent(new SN),i.emitViewEvent(new vN(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),t&&this._eventDispatcher.emitOutgoingEvent(new BN)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(129),t=this._configuration.options.get(58),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new Ci(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];let n=[],o=0,s=t.startLineNumber,r=t.startColumn,a=t.endLineNumber,l=t.endColumn;for(let c=0,d=i.length;c<d;c++){const e=i[c].startLineNumber,t=i[c].endLineNumber;t<s||(e>a||(s<e&&(n[o++]=new Ci(s,r,e-1,this.model.getLineMaxColumn(e-1))),s=t+1,r=1))}return(s<a||s===a&&r<l)&&(n[o++]=new Ci(s,r,a,l)),n}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new Ci(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new Ci(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 wi(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:n,firstPositionDeltaTop:o}}reduceRestoreState(e){if("undefined"===typeof 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}getTextModelOptions(){return this.model.getOptions()}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStartLine=e;let n=this.coordinatesConverter.convertViewPositionToModelPosition(new wi(e,this.getLineMinColumn(e)));this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,new Ci(n.lineNumber,n.column,n.lineNumber,n.column),1);const o=this.viewLayout.getVerticalOffsetForLineNumber(e),s=this.viewLayout.getCurrentScrollTop();this._viewportStartLineDelta=s-o}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=Bs(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Vs(this.getLineContent(e));return-1===t?0:t+2}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewLineRenderingData(e,t){let i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),s=this._lines.getViewLineData(t),r=this._decorations.getDecorationsViewportData(e).inlineDecorations,a=r[t-e.startLineNumber];return s.inlineDecorations&&(a=[...a,...s.inlineDecorations.map(e=>e.toInlineDecoration(t))]),new Rg(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,i,n,s.tokens,a,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){let n=this._lines.getViewLinesData(e,t,i);return new Ag(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,te(this._configuration.options)),i=new yI;for(const n of t){const t=n.options,o=t.overviewRuler;if(!o)continue;const s=o.position;if(0===s)continue;const r=o.getColor(e),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,s)}return i.asArray}invalidateOverviewRulerColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const e=t.options.overviewRuler;e&&e.invalidateCachedColor()}}invalidateMinimapColorCache(){const e=this.model.getAllDecorations();for(const t of e){const e=t.options.minimap;e&&e.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getModelLineMaxColumn(e){return this.model.getLineMaxColumn(e)}validateModelPosition(e){return this.model.validatePosition(e)}validateModelRange(e){return this.model.validateRange(e)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);const o=this.model.getOffsetAt(n),s=o+t;return this.model.getPositionAt(s)}getEOL(){return this.model.getEOL()}getPlainTextToCopy(e,t,i){const n=i?"\r\n":this.model.getEOL();e=e.slice(0),e.sort(Ci.compareRangesUsingStarts);let o=!1,s=!1;for(const a of e)a.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const i=e.map(e=>e.startLineNumber);let o="";for(let e=0;e<i.length;e++)e>0&&i[e-1]===i[e]||(o+=this.model.getLineContent(i[e])+n);return o}if(o&&t){let t=[],n=0;for(const o of e){const e=o.startLineNumber;o.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(o,i?2:0)),n=e}return 1===t.length?t[0]:t}let r=[];for(const a of e)a.isEmpty()||r.push(this.model.getValueInRange(a,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===bI)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 Ci(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(43),s=this._getColorMap(),r=/[:;\\\/<>]/.test(o.fontFamily),a=r||o.fontFamily===_e.fontFamily;let l;if(a)l=_e.fontFamily;else{l=o.fontFamily,l=l.replace(/"/g,"'");const e=/[,']/.test(l);if(!e){const e=/[+ ]/.test(l);e&&(l=`'${l}'`)}l=`${l}, ${_e.fontFamily}`}return{mode:i,html:`<div style="color: ${s[1]};background-color: ${s[2]};font-family: ${l};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,s)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const e=this.model.getLineTokens(c),d=e.getLineContent(),h=c===i?n-1:0,u=c===o?r-1:d.length;l+=""===d?"<br>":$N(d,e.inflate(),t,h,u,a,s["i"])}return l}_getColorMap(){let e=kc.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=Lw.Format.CSS.formatHex(e[i]);return t}pushStackElement(){this.model.pushStackElement()}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){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 VN):this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._cursor.setIsDoingComposition(!0),this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._cursor.setIsDoingComposition(!1),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,o){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,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){this._withViewEventsCollector(i=>this._cursor.revealPrimary(i,e,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new Ci(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new EN(e,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new Ci(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new EN(e,i,null,0,!0,0)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(s=>s.emitViewEvent(new EN(e,i,null,n,t,o)))}getVerticalOffsetForLineNumber(e){return this.viewLayout.getVerticalOffsetForLineNumber(e)}getScrollTop(){return this.viewLayout.getCurrentScrollTop()}setScrollTop(e,t){this.viewLayout.setScrollPosition({scrollTop:e},t)}setScrollPosition(e,t){this.viewLayout.setScrollPosition(e,t)}deltaScrollNow(e,t){this.viewLayout.deltaScrollNow(e,t)}changeWhitespace(e){const t=this.viewLayout.changeWhitespace(e);t&&(this._eventDispatcher.emitSingleViewEvent(new MN),this._eventDispatcher.emitOutgoingEvent(new BN))}setMaxLineWidth(e){this.viewLayout.setMaxLineWidth(e)}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class yI{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const s=this._asMap[e];if(s){const e=s.data,t=e[e.length-3],r=e[e.length-1];if(t===o&&r+1>=i)return void(n>r&&(e[e.length-1]=n));e.push(o,i,n)}else{const s=new Vg(e,t,[o,i,n]);this._asMap[e]=s,this.asArray.push(s)}}}class SI{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}const xI=gn("accessibilityService"),kI=new Sm("accessibilityModeEnabled",!1);class LI extends su{constructor(e,t){super(0);for(let i=0;i<e.length;i++)this.set(e.charCodeAt(i),1);for(let i=0;i<t.length;i++)this.set(t.charCodeAt(i),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 EI=[],DI=[];class NI{constructor(e,t){this.classifier=new LI(e,t)}static create(e){return new NI(e.get(118),e.get(117))}createLineBreaksComputer(e,t,i,n){t|=0,i=+i;const o=[],s=[],r=[];return{addRequest:(e,t,i)=>{o.push(e),s.push(t),r.push(i)},finalize:()=>{const a=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth;let l=[];for(let e=0,c=o.length;e<c;e++){const c=s[e],d=r[e];!d||d.injectionOptions||c?l[e]=TI(this.classifier,o[e],c,t,i,a,n):l[e]=II(this.classifier,d,o[e],t,i,a,n)}return EI.length=0,DI.length=0,l}}}}function II(e,t,i,n,o,s,r){if(-1===o)return null;const a=i.length;if(a<=1)return null;const l=t.breakOffsets,c=t.breakOffsetsVisibleColumn,d=PI(i,n,o,s,r),h=o-d;let u=EI,g=DI,f=0,m=0,p=0,_=o;const b=l.length;let v=0;if(v>=0){let e=Math.abs(c[v]-_);while(v+1<b){const t=Math.abs(c[v+1]-_);if(t>=e)break;e=t,v++}}while(v<b){let t=v<0?0:l[v],o=v<0?0:c[v];m>t&&(t=m,o=p);let r=0,d=0,w=0,C=0;if(o<=_){let p=o,b=0===t?0:i.charCodeAt(t-1),v=0===t?0:e.get(b),y=!0;for(let o=t;o<a;o++){const t=o,a=i.charCodeAt(o);let l,c;if(Zs(a)?(o++,l=0,c=2):(l=e.get(a),c=MI(a,p,n,s)),t>m&&AI(b,v,a,l)&&(r=t,d=p),p+=c,p>_){t>m?(w=t,C=p-c):(w=o+1,C=p),p-d>h&&(r=0),y=!1;break}b=a,v=l}if(y){f>0&&(u[f]=l[l.length-1],g[f]=c[l.length-1],f++);break}}if(0===r){let a=o,l=i.charCodeAt(t),c=e.get(l),u=!1;for(let n=t-1;n>=m;n--){const t=n+1,o=i.charCodeAt(n);if(9===o){u=!0;break}let g,f;if(Qs(o)?(n--,g=0,f=2):(g=e.get(o),f=gr(o)?s:1),a<=_){if(0===w&&(w=t,C=a),a<=_-h)break;if(AI(o,g,l,c)){r=t,d=a;break}}a-=f,l=o,c=g}if(0!==r){const e=h-(C-d);if(e<=n){const t=i.charCodeAt(w);let o;o=Zs(t)?2:MI(t,C,n,s),e-o<0&&(r=0)}}if(u){v--;continue}}if(0===r&&(r=w,d=C),r<=m){const e=i.charCodeAt(m);Zs(e)?(r=m+2,d=p+2):(r=m+1,d=p+MI(e,p,n,s))}m=r,u[f]=r,p=d,g[f]=d,f++,_=d+h;while(v<0||v<b&&c[v]<d)v++;let y=Math.abs(c[v]-_);while(v+1<b){const e=Math.abs(c[v+1]-_);if(e>=y)break;y=e,v++}}return 0===f?null:(u.length=f,g.length=f,EI=t.breakOffsets,DI=t.breakOffsetsVisibleColumn,t.breakOffsets=u,t.breakOffsetsVisibleColumn=g,t.wrappedTextIndentLength=d,t)}function TI(e,t,i,n,o,s,r){const a=dw.applyInjectedText(t,i);let l,c;if(i&&i.length>0?(l=i.map(e=>e.options),c=i.map(e=>e.column-1)):(l=null,c=null),-1===o)return l?new Og([a.length],[],0,c,l):null;const d=a.length;if(d<=1)return l?new Og([a.length],[],0,c,l):null;const h=PI(a,n,o,s,r),u=o-h;let g=[],f=[],m=0,p=0,_=0,b=o,v=a.charCodeAt(0),w=e.get(v),C=MI(v,0,n,s),y=1;Zs(v)&&(C+=1,v=a.charCodeAt(1),w=e.get(v),y++);for(let S=y;S<d;S++){const t=S,i=a.charCodeAt(S);let o,r;Zs(i)?(S++,o=0,r=2):(o=e.get(i),r=MI(i,C,n,s)),AI(v,w,i,o)&&(p=t,_=C),C+=r,C>b&&((0===p||C-_>u)&&(p=t,_=C-r),g[m]=p,f[m]=_,m++,b=_+u,p=0),v=i,w=o}return 0!==m||i&&0!==i.length?(g[m]=d,f[m]=C,new Og(g,f,h,c,l)):null}function MI(e,t,i,n){return 9===e?i-t%i:gr(e)||e<32?n:1}function OI(e,t){return t-e%t}function AI(e,t,i,n){return 32!==i&&(2===t||3===t&&2!==n||1===n||3===n&&1!==t)}function PI(e,t,i,n,o){let s=0;if(0!==o){const r=Bs(e);if(-1!==r){for(let i=0;i<r;i++){const n=9===e.charCodeAt(i)?OI(s,t):1;s+=n}const a=3===o?2:2===o?1:0;for(let e=0;e<a;e++){const e=OI(s,t);s+=e}s+n>i&&(s=0)}}return s}var RI;const FI=null===(RI=window.trustedTypes)||void 0===RI?void 0:RI.createPolicy("domLineBreaksComputer",{createHTML:e=>e});class BI{static create(){return new BI}constructor(){}createLineBreaksComputer(e,t,i,n){t|=0,i=+i;let o=[],s=[];return{addRequest:(e,t,i)=>{o.push(e),s.push(t)},finalize:()=>WI(o,e,t,i,n,s)}}}function WI(e,t,i,n,o,s){var r;function a(t){const i=s[t];if(i){const n=dw.applyInjectedText(e[t],i),o=i.map(e=>e.options),s=i.map(e=>e.column-1);return new Og([n.length],[],0,s,o)}return null}if(-1===n){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=a(i);return t}const l=Math.round(n*t.typicalHalfwidthCharacterWidth),c=3===o?2:2===o?1:0,d=Math.round(i*c),h=Math.ceil(t.spaceWidth*d),u=document.createElement("div");A_.applyFontInfoSlow(u,t);const g=pd(1e4),f=[],m=[],p=[],_=[],b=[];for(let x=0;x<e.length;x++){const n=dw.applyInjectedText(e[x],s[x]);let r=0,a=0,c=l;if(0!==o)if(r=Bs(n),-1===r)r=0;else{for(let t=0;t<r;t++){const e=9===n.charCodeAt(t)?i-a%i:1;a+=e}const e=Math.ceil(t.spaceWidth*a);e+t.typicalFullwidthCharacterWidth>l?(r=0,a=0):c=l-e}const d=n.substr(r),u=VI(d,a,i,c,g,h);f[x]=r,m[x]=a,p[x]=d,_[x]=u[0],b[x]=u[1]}const v=g.build(),w=null!==(r=null===FI||void 0===FI?void 0:FI.createHTML(v))&&void 0!==r?r:v;u.innerHTML=w,u.style.position="absolute",u.style.top="10000",u.style.wordWrap="break-word",document.body.appendChild(u);let C=document.createRange();const y=Array.prototype.slice.call(u.children,0);let S=[];for(let x=0;x<e.length;x++){const e=y[x],t=zI(C,e,p[x],_[x]);if(null===t){S[x]=a(x);continue}const i=f[x],n=m[x]+d,o=b[x],r=[];for(let s=0,a=t.length;s<a;s++)r[s]=o[t[s]];if(0!==i)for(let s=0,a=t.length;s<a;s++)t[s]+=i;let l,c;const h=s[x];h?(l=h.map(e=>e.options),c=h.map(e=>e.column-1)):(l=null,c=null),S[x]=new Og(t,r,n,c,l)}return document.body.removeChild(u),S}function VI(e,t,i,n,o,s){if(0!==s){let e=String(s);o.appendASCIIString('<div style="text-indent: -'),o.appendASCIIString(e),o.appendASCIIString("px; padding-left: "),o.appendASCIIString(e),o.appendASCIIString("px; box-sizing: border-box; width:")}else o.appendASCIIString('<div style="width:');o.appendASCIIString(String(n)),o.appendASCIIString('px;">');const r=e.length;let a=t,l=0,c=[],d=[],h=0<r?e.charCodeAt(0):0;o.appendASCIIString("<span>");for(let u=0;u<r;u++){0!==u&&u%16384===0&&o.appendASCIIString("</span><span>"),c[u]=l,d[u]=a;const t=h;h=u+1<r?e.charCodeAt(u+1):0;let n=1,s=1;switch(t){case 9:n=i-a%i,s=n;for(let e=1;e<=n;e++)e<n?o.write1(160):o.appendASCII(32);break;case 32:32===h?o.write1(160):o.appendASCII(32);break;case 60:o.appendASCIIString("<");break;case 62:o.appendASCIIString(">");break;case 38:o.appendASCIIString("&");break;case 0:o.appendASCIIString("�");break;case 65279:case 8232:case 8233:case 133:o.write1(65533);break;default:gr(t)&&s++,t<32?o.write1(9216+t):o.write1(t)}l+=n,a+=s}return o.appendASCIIString("</span>"),c[e.length]=l,d[e.length]=a,o.appendASCIIString("</div>"),[c,d]}function zI(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{HI(e,o,n,0,null,i.length-1,null,s)}catch(r){return console.log(r),null}return 0===s.length?null:(s.push(i.length),s)}function HI(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||KI(e,t,i[n],i[n+1]),r=r||KI(e,t,i[s],i[s+1]),Math.abs(o[0].top-r[0].top)<=.1)return;if(n+1===s)return void a.push(s);const l=n+(s-n)/2|0,c=KI(e,t,i[l],i[l+1]);HI(e,t,i,n,o,l,c,a),HI(e,t,i,l,c,s,r,a)}function KI(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()}var jI=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},UI=function(e,t){return function(i,n){t(i,n,e)}};let $I=0;class qI{constructor(e,t,i,n,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o}dispose(){Ue(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let GI=class e extends Ye{constructor(e,t,i,n,o,s,r,a,l,c){super(),this._onDidDispose=this._register(new rt),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new rt),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new rt),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new rt),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new rt),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new rt),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeConfiguration=this._register(new rt),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new rt),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new rt),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new rt),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new rt),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new rt),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new YI),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new YI),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new rt),this.onWillType=this._onWillType.event,this._onDidType=this._register(new rt),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new rt),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new rt),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new rt),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new rt),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new rt),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new rt),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new rt),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new rt),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onContextMenu=this._register(new rt),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new rt),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new rt),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new rt),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new rt),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new rt),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new rt),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new rt),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new rt),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new rt),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event;const d=Object.assign({},t);let h;this._domElement=e,this._overflowWidgetsDomNode=d.overflowWidgetsDomNode,delete d.overflowWidgetsDomNode,this._id=++$I,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this.isSimpleWidget=i.isSimpleWidget||!1,this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(d,c)),this._register(this._configuration.onDidChange(e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(129)){const e=t.get(129);this._onDidLayoutChange.fire(e)}})),this._contextKeyService=this._register(r.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=s,this._themeService=a,this._register(new XI(this,this._contextKeyService)),this._register(new ZI(this,this._contextKeyService)),this._instantiationService=n.createChild(new SI([xm,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new QI(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},h=Array.isArray(i.contributions)?i.contributions:__.getEditorContributions();for(const g of h)if(this._contributions[g.id])xe(new Error("Cannot have two contributions with the same id "+g.id));else try{const e=this._instantiationService.createInstance(g.ctor,this);this._contributions[g.id]=e}catch(u){xe(u)}__.getEditorActions().forEach(e=>{if(this._actions[e.id])return void xe(new Error("Cannot have two actions with the same id "+e.id));const t=new UN(e.id,e.label,e.alias,da(e.precondition),()=>this._instantiationService.invokeFunction(t=>Promise.resolve(e.runEditorCommand(t,this,null))),this._contextKeyService);this._actions[t.id]=t}),this._codeEditorService.addCodeEditor(this)}_createConfiguration(e,t){return new A_(this.isSimpleWidget,e,this._domElement,t)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Va.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,i=e.length;t<i;t++){const i=e[t];this._contributions[i].dispose()}this._contributions={},this._actions={},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?WL.getWordAtPosition(this._modelData.model,this._configuration.options.get(115),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){const t=e;if(null===this._modelData&&null===t)return;if(this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),n=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(n)}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(let e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(let 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 _getVerticalOffsetForPosition(e,t,i){const n=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber)}getTopForLineNumber(t){return this._modelData?e._getVerticalOffsetForPosition(this._modelData,t,1):-1}getTopForPosition(t,i){return this._modelData?e._getVerticalOffsetForPosition(this._modelData,t,i):-1}setHiddenAreas(e){this._modelData&&this._modelData.viewModel.setHiddenAreas(e.map(e=>Ci.lift(e)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return tC.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e){if(this._modelData){if(!wi.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections("api",[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!Ci.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,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 Ci(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(!wi.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new Ci(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){const t=yi.isISelection(e),i=Ci.isIRange(e);if(!t&&!i)throw new Error("Invalid arguments");if(t)this._setSelectionImpl(e);else if(i){const t={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(t)}}_setSelectionImpl(e){if(!this._modelData)return;const t=new yi(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections("api",[t])}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 Ci(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(!Ci.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(Ci.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.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if("number"!==typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.setScrollPosition(e,t)}saveViewState(){if(!this._modelData)return null;const e={},t=Object.keys(this._contributions);for(const o of t){const t=this._contributions[o];"function"===typeof t.saveViewState&&(e[o]=t.saveViewState())}const i=this._modelData.viewModel.saveCursorState(),n=this._modelData.viewModel.saveState();return{cursorState:i,viewState:n,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)?this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]);const i=t.contributionsState||{},n=Object.keys(this._contributions);for(let t=0,s=n.length;t<s;t++){const e=n[t],o=this._contributions[e];"function"===typeof o.restoreViewState&&o.restoreViewState(i[e])}const o=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(o)}}getContribution(e){return this._contributions[e]||null}getActions(){const e=[],t=Object.keys(this._actions);for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(this._actions[n])}return e}getSupportedActions(){let e=this.getActions();return e=e.filter(e=>e.isSupported()),e}getAction(e){return this._actions[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()).then(void 0,xe):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,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o){if(!this._modelData||0===t.length)return;const s=this._modelData.viewModel.getSelection().getStartPosition();this._modelData.viewModel.paste(t,i,n,e);const r=this._modelData.viewModel.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new Ci(s.lineNumber,s.column,r.lineNumber,r.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=__.getEditorCommand(t);return!!n&&(i=i||{},i.source=e,this._instantiationService.invokeFunction(e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,xe)}),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&(!this._configuration.options.get(80)&&(this._modelData.model.pushStackElement(),!0))}popUndoStop(){return!!this._modelData&&(!this._configuration.options.get(80)&&(this._modelData.model.popStackElement(),!0))}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(80))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)}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,te(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){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){const e=this._configuration.options,t=e.get(129);return t}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}delegateVerticalScrollbarMouseDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarMouseDown(e)}layout(e){this._configuration.observeReferenceElement(e),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."),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)}}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(t){if(!this._modelData||!this._modelData.hasRealView)return null;const i=this._modelData.model.validatePosition(t),n=this._configuration.options,o=n.get(129),s=e._getVerticalOffsetForPosition(this._modelData,i.lineNumber,i.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(i.lineNumber,i.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft();return{top:s,left:r,height:n.get(58)}}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){A_.applyFontInfoSlow(e,this._configuration.options.get(43))}_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.setMaxLineNumber(e.getLineCount()),e.onBeforeAttached();const i=new CI(this._id,this._configuration,e,BI.create(),NI.create(this._configuration.options),e=>ko(e));t.push(e.onDidChangeDecorations(e=>this._onDidChangeModelDecorations.fire(e))),t.push(e.onDidChangeLanguage(t=>{this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t)})),t.push(e.onDidChangeLanguageConfiguration(e=>this._onDidChangeModelLanguageConfiguration.fire(e))),t.push(e.onDidChangeContent(e=>this._onDidChangeModelContent.fire(e))),t.push(e.onDidChangeOptions(e=>this._onDidChangeModelOptions.fire(e))),t.push(e.onWillDispose(()=>this.setModel(null))),t.push(i.onEvent(e=>{switch(e.kind){case 0:this._onDidContentSizeChange.fire(e);break;case 1:this._editorTextFocus.setValue(e.hasFocus);break;case 2:this._onDidScrollChange.fire(e);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{e.reachedMaxCursorCount&&this._notificationService.warn(o("cursors.maximum","The number of cursors has been limited to {0}.",KN.MAX_CURSOR_COUNT));const t=[];for(let o=0,s=e.selections.length;o<s;o++)t[o]=e.selections[o].getPosition();const i={position:t[0],secondaryPositions:t.slice(1),reason:e.reason,source:e.source};this._onDidChangeCursorPosition.fire(i);const n={selection:e.selections[0],secondarySelections:e.selections.slice(1),modelVersionId:e.modelVersionId,oldSelections:e.oldSelections,oldModelVersionId:e.oldModelVersionId,source:e.source,reason:e.reason};this._onDidChangeCursorSelection.fire(n);break}}}));const[n,s]=this._createView(i);if(s){this._domElement.appendChild(n.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];n.addContentWidget(this._contentWidgets[i])}t=Object.keys(this._overlayWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];n.addOverlayWidget(this._overlayWidgets[i])}n.render(!1,!0),n.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new qI(e,i,n,s,t)}_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 o={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const o={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",o)}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 gE(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);const n=new hN(t,this._configuration,this._themeService,e,i,this._overflowWidgetsDomNode);return[n,!0]}_postDetachModelCleanup(e){e&&e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}};GI=jI([UI(3,hn),UI(4,mn),UI(5,ua),UI(6,xm),UI(7,jp),UI(8,$m),UI(9,xI)],GI);class YI extends Ye{constructor(){super(),this._onDidChangeToTrue=this._register(new rt),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new rt),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 XI extends Ye{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=QL.editorSimpleInput.bindTo(t),this._editorFocus=QL.focus.bindTo(t),this._textInputFocus=QL.textInputFocus.bindTo(t),this._editorTextFocus=QL.editorTextFocus.bindTo(t),this._editorTabMovesFocus=QL.tabMovesFocus.bindTo(t),this._editorReadonly=QL.readOnly.bindTo(t),this._inDiffEditor=QL.inDiffEditor.bindTo(t),this._editorColumnSelection=QL.columnSelection.bindTo(t),this._hasMultipleSelections=QL.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=QL.hasNonEmptySelection.bindTo(t),this._canUndo=QL.canUndo.bindTo(t),this._canRedo=QL.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._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(128)),this._editorReadonly.set(e.get(80)),this._inDiffEditor.set(e.get(53)),this._editorColumnSelection.set(e.get(18))}_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 ZI extends Ye{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this._langId=QL.languageId.bindTo(t),this._hasCompletionItemProvider=QL.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=QL.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=QL.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=QL.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=QL.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=QL.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=QL.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=QL.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=QL.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=QL.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=QL.hasReferenceProvider.bindTo(t),this._hasRenameProvider=QL.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=QL.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=QL.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=QL.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=QL.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=QL.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=QL.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=QL.isInWalkThroughSnippet.bindTo(t);const i=()=>this._update();this._register(e.onDidChangeModel(i)),this._register(e.onDidChangeModelLanguage(i)),this._register(ic.onDidChange(i)),this._register(mc.onDidChange(i)),this._register(gc.onDidChange(i)),this._register(cc.onDidChange(i)),this._register(dc.onDidChange(i)),this._register(hc.onDidChange(i)),this._register(uc.onDidChange(i)),this._register(sc.onDidChange(i)),this._register(ac.onDidChange(i)),this._register(rc.onDidChange(i)),this._register(ec.onDidChange(i)),this._register(tc.onDidChange(i)),this._register(pc.onDidChange(i)),this._register(_c.onDidChange(i)),this._register(oc.onDidChange(i)),this._register(fc.onDidChange(i)),i()}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._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(ic.has(e)),this._hasCodeActionsProvider.set(mc.has(e)),this._hasCodeLensProvider.set(gc.has(e)),this._hasDefinitionProvider.set(cc.has(e)),this._hasDeclarationProvider.set(dc.has(e)),this._hasImplementationProvider.set(hc.has(e)),this._hasTypeDefinitionProvider.set(uc.has(e)),this._hasHoverProvider.set(sc.has(e)),this._hasDocumentHighlightProvider.set(ac.has(e)),this._hasDocumentSymbolProvider.set(rc.has(e)),this._hasReferenceProvider.set(ec.has(e)),this._hasRenameProvider.set(tc.has(e)),this._hasSignatureHelpProvider.set(oc.has(e)),this._hasInlayHintsProvider.set(fc.has(e)),this._hasDocumentFormattingProvider.set(pc.has(e)||_c.has(e)),this._hasDocumentSelectionFormattingProvider.set(_c.has(e)),this._hasMultipleDocumentFormattingProvider.set(pc.all(e).length+_c.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(_c.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===co.walkThroughSnippet)}):this.reset()}}class QI extends Ye{constructor(e){super(),this._onChange=this._register(new rt),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(cs(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}const JI=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='"),eT=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 tT(e){return JI+encodeURIComponent(e.toString())+eT}const iT=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),nT=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');function oT(e){return iT+encodeURIComponent(e.toString())+nT}Qp((e,t)=>{const i=e.getColor(Sy);i&&t.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${i}; }`);const n=e.getColor(yy);n&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${tT(n)}") repeat-x bottom left; }`);const o=e.getColor(Cy);o&&t.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${o}; }`);const s=e.getColor(Ly);s&&t.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${s}; }`);const r=e.getColor(ky);r&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${tT(r)}") repeat-x bottom left; }`);const a=e.getColor(xy);a&&t.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const l=e.getColor(Ny);l&&t.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${l}; }`);const c=e.getColor(Dy);c&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${tT(c)}") repeat-x bottom left; }`);const d=e.getColor(Ey);d&&t.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${d}; }`);const h=e.getColor(Ty);h&&t.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${h}; }`);const u=e.getColor(Iy);u&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${oT(u)}") no-repeat bottom left; }`);const g=e.getColor(Sx);g&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${g.rgba.a}; }`);const f=e.getColor(yx);f&&t.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${f}; }`);const m=e.getColor(Oy)||"inherit";t.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${m}}`)});i("7115");class sT{constructor(e,t,i){const n=e=>this.emitter.fire(e);this.emitter=new rt({onFirstListenerAdd:()=>e.addEventListener(t,n,i),onLastListenerRemove:()=>e.removeEventListener(t,n,i)})}get event(){return this.emitter.event}dispose(){this.emitter.dispose()}}function rT(e){return e.preventDefault(),e.stopPropagation(),e}i("c901");var aT=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};let lT=!1;var cT;(function(e){e["North"]="north",e["South"]="south",e["East"]="east",e["West"]="west"})(cT||(cT={}));let dT=4;const hT=new rt;let uT=300;const gT=new rt;class fT{constructor(){this.disposables=new Ge}get onPointerMove(){return this.disposables.add(new sT(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new sT(window,"mouseup")).event}dispose(){this.disposables.dispose()}}aT([F_],fT.prototype,"onPointerMove",null),aT([F_],fT.prototype,"onPointerUp",null);class mT{constructor(e){this.el=e,this.disposables=new Ge}get onPointerMove(){return this.disposables.add(new sT(this.el,B_.Change)).event}get onPointerUp(){return this.disposables.add(new sT(this.el,B_.End)).event}dispose(){this.disposables.dispose()}}aT([F_],mT.prototype,"onPointerMove",null),aT([F_],mT.prototype,"onPointerUp",null);class pT{constructor(e){this.factory=e}get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}dispose(){}}aT([F_],pT.prototype,"onPointerMove",null),aT([F_],pT.prototype,"onPointerUp",null);class _T extends Ye{constructor(e,t,i){super(),this.hoverDelay=uT,this.hoverDelayer=this._register(new Jn(this.hoverDelay)),this._state=3,this._onDidEnablementChange=this._register(new rt),this.onDidEnablementChange=this._onDidEnablementChange.event,this._onDidStart=this._register(new rt),this.onDidStart=this._onDidStart.event,this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,this._onDidReset=this._register(new rt),this.onDidReset=this._onDidReset.event,this._onDidEnd=this._register(new rt),this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.orthogonalStartSashDisposables=this._register(new Ge),this.orthogonalStartDragHandleDisposables=this._register(new Ge),this.orthogonalEndSashDisposables=this._register(new Ge),this.orthogonalEndDragHandleDisposables=this._register(new Ge),this.el=ds(e,ms(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add("orthogonal-edge-"+i.orthogonalEdge),s["f"]&&this.el.classList.add("mac");const n=this._register(new sT(this.el,"mousedown")).event;this._register(n(e=>this.onPointerStart(e,new fT),this));const o=this._register(new sT(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new sT(this.el,"mouseenter")).event;this._register(r(()=>_T.onMouseEnter(this)));const a=this._register(new sT(this.el,"mouseleave")).event;this._register(a(()=>_T.onMouseLeave(this))),this._register(V_.addTarget(this.el));const l=it.map(this._register(new sT(this.el,B_.Start)).event,e=>{var t;return Object.assign(Object.assign({},e),{target:null!==(t=e.initialTarget)&&void 0!==t?t:null})});this._register(l(e=>this.onPointerStart(e,new mT(this.el)),this));const c=this._register(new sT(this.el,B_.Tap)).event,d=it.map(it.filter(it.debounce(c,(e,t)=>{var i;return{event:t,count:(null!==(i=null===e||void 0===e?void 0:e.count)&&void 0!==i?i:0)+1}},250),({count:e})=>2===e),({event:e})=>{var t;return Object.assign(Object.assign({},e),{target:null!==(t=e.initialTarget)&&void 0!==t?t:null})});this._register(d(this.onPointerDoublePress,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=dT,this._register(hT.event(e=>{this.size=e,this.layout()}))),this._register(gT.event(e=>this.hoverDelay=e)),this.hidden=!1,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",lT),this.layout()}get state(){return this._state}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))}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=ds(this.el,ms(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(qe(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new sT(this._orthogonalStartDragHandle,"mouseenter")).event(()=>_T.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new sT(this._orthogonalStartDragHandle,"mouseleave")).event(()=>_T.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=ds(this.el,ms(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(qe(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new sT(this._orthogonalEndDragHandle,"mouseenter")).event(()=>_T.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new sT(this._orthogonalEndDragHandle,"mouseleave")).event(()=>_T.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalEndSash=e}onPointerStart(e,t){ss.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new pT(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new pT(t))),!this.state)return;const n=bs("iframe");for(const s of n)s.style.pointerEvents="none";const o=e.pageX,r=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=Zo(this.el),d=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":s["f"]?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":s["f"]?"col-resize":"ew-resize",c.textContent=`* { cursor: ${e} !important; }`},h=new Ge;d(),i||this.onDidEnablementChange(d,null,h);const u=e=>{ss.stop(e,!1);const t={startX:o,currentX:e.pageX,startY:r,currentY:e.pageY,altKey:a};this._onDidChange.fire(t)},g=e=>{ss.stop(e,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const t of n)t.style.pointerEvents="auto"};t.onPointerMove(u,null,h),t.onPointerUp(g,null,h),h.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&&_T.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&_T.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){_T.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")}}hide(){this.hidden=!0,this.el.style.display="none",this.el.setAttribute("aria-hidden","true")}getOrthogonalSash(e){if(e.target&&e.target instanceof HTMLElement)return e.target.classList.contains("orthogonal-drag-handle")?e.target.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}const bT=gn("IEditorCancelService"),vT=new Sm("cancellableOperation",!1,o("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));bh(bT,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext(e=>{const t=vT.bindTo(e.get(xm)),i=new Je;return{key:t,tokens:i}}),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()))}},!0);f_(new class extends u_{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:vT})}runEditorCommand(e,t){e.get(bT).cancel(t)}});class wT{constructor(e,t,i){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=i}static capture(e){let t=null,i=0;if(0!==e.getScrollTop()){const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}}return new wT(t,i,e.getPosition())}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){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)}}i("c6b4");const CT={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Jk.text,TERMINALS:"Terminals"};class yT{constructor(e){this.data=e}update(){}getData(){return this.data}}const ST={CurrentDragAndDropData:void 0};i("154c");class xT extends Ye{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof Wp&&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 Vp)),this._actionRunner}set actionRunner(e){this._actionRunner=e}getAction(){return this._action}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(V_.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,Sn&&this._register(bo(e,os.DRAG_START,e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(CT.TEXT,this._action.label)}))),this._register(bo(t,B_.Tap,e=>this.onClick(e,!0))),this._register(bo(t,os.MOUSE_DOWN,e=>{i||ss.stop(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")})),s["f"]&&this._register(bo(t,os.CONTEXT_MENU,e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)})),this._register(bo(t,os.CLICK,e=>{ss.stop(e,!0),this.options&&this.options.isMenu||this.onClick(e)})),this._register(bo(t,os.DBLCLICK,e=>{ss.stop(e,!0)})),[os.MOUSE_UP,os.MOUSE_OUT].forEach(e=>{this._register(bo(t,e,e=>{ss.stop(e),t.classList.remove("active")}))})}onClick(e,t=!1){var i;ss.stop(e,!0);const n=ia(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(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),super.dispose()}}class kT extends xT{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),this.element&&(this.label=ds(this.element,ms("a.action-label"))),this.label&&(this._action.id===zp.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button")),this.options.label&&this.options.keybinding&&this.element&&(ds(this.element,ms("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}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.getAction().label)}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=o({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&this.label&&(this.label.title=e)}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getAction().class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label&&this.label.classList.remove("codicon")}updateEnabled(){this.getAction().enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element&&this.element.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element&&this.element.classList.add("disabled"))}updateChecked(){this.label&&(this.getAction().checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}var LT=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ET extends Ye{constructor(e,t={}){var i,n,o,s,r,a;let l,c;switch(super(),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new rt),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new rt({onFirstListenerAdd:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new rt),this.onDidRun=this._onDidRun.event,this._onBeforeRun=this._register(new rt),this.onBeforeRun=this._onBeforeRun.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!==(s=null===(o=this.options.triggerKeys)||void 0===o?void 0:o.keyDown)&&void 0!==s&&s,keys:null!==(a=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keys)&&void 0!==a?a:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Vp,this._register(this._actionRunner)),this._register(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._register(this._actionRunner.onBeforeRun(e=>this._onBeforeRun.fire(e))),this._actionIds=[],this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",!1!==t.animated&&this.domNode.classList.add("animated"),this._orientation){case 0:l=[15],c=[17];break;case 1:l=[16],c=[18],this.domNode.className+=" vertical";break}this._register(bo(this.domNode,os.KEY_DOWN,e=>{const t=new Hn(e);let i=!0;const n="number"===typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;l&&(t.equals(l[0])||t.equals(l[1]))?i=this.focusPrevious():c&&(t.equals(c[0])||t.equals(c[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 xT&&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(bo(this.domNode,os.KEY_UP,e=>{const t=new Hn(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))&&this.updateFocusedItem()})),this.focusTracker=this._register(cs(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{Xo()!==this.domNode&&jo(Xo(),this.domNode)||(this._onDidBlur.fire(),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.actionsList.setAttribute("role","toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const t=this.actionsList.children[e];if(jo(Xo(),t)){this.focusedItem=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){e&&(this._actionRunner=e,this.viewItems.forEach(t=>t.actionRunner=e))}getContainer(){return this.domNode}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=Qr(t.index)?t.index:null;i.forEach(e=>{const i=document.createElement("li");let o;i.className="action-item",i.setAttribute("role","presentation"),this.options.allowContextMenu||this._register(bo(i,os.CONTEXT_MENU,e=>{ss.stop(e,!0)})),this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e)),o||(o=new kT(this.context,e,t)),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(i),this.focusable&&o instanceof xT&&0===this.viewItems.length&&o.setFocusable(!0),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(o),this._actionIds.push(e.id)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,o),this._actionIds.splice(n,0,e.id),n++)}),"number"===typeof this.focusedItem&&this.focus(this.focusedItem)}clear(){Ue(this.viewItems),this.viewItems=[],this._actionIds=[],mo(this.actionsList)}length(){return 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&&"undefined"===typeof this.focusedItem){const e=this.viewItems.findIndex(e=>e.isEnabled());this.focusedItem=-1===e?void 0:e,this.updateFocus()}else void 0!==i&&(this.focusedItem=i),this.updateFocus()}focusFirst(){return this.focusedItem=this.length()>1?1:0,this.focusPrevious()}focusLast(){return this.focusedItem=this.length()<2?0:this.length()-2,this.focusNext()}focusNext(){if("undefined"===typeof this.focusedItem)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const e=this.focusedItem;let t;do{if(this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=e,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&this.options.focusOnlyEnabledItems&&!t.isEnabled());return this.updateFocus(),!0}focusPrevious(){if("undefined"===typeof this.focusedItem)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const e=this.focusedItem;let t;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(this.options.preventLoopNavigation)return this.focusedItem=e,!1;this.focusedItem=this.viewItems.length-1}t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&this.options.focusOnlyEnabledItems&&!t.isEnabled());return this.updateFocus(!0),!0}updateFocus(e,t){"undefined"===typeof this.focusedItem&&this.actionsList.focus({preventScroll:t});for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=n;if(i===this.focusedItem){let i=!0;oa(o.focus)||(i=!1),this.options.focusOnlyEnabledItems&&oa(n.isEnabled)&&!n.isEnabled()&&(i=!1),i?o.focus(e):this.actionsList.focus({preventScroll:t})}else oa(o.blur)&&o.blur()}}doTrigger(e){if("undefined"===typeof this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof xT){const i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}run(e,t){return LT(this,void 0,void 0,(function*(){yield this._actionRunner.run(e,t)}))}dispose(){Ue(this.viewItems),this.viewItems=[],this._actionIds=[],this.getContainer().remove(),super.dispose()}}const DT={IconContribution:"base.contributions.icons"};class NT{constructor(){this._onDidChange=new rt,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:o("iconDefintion.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:o("iconDefintion.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${$l.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.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 o}let s={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=s;let 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}getIconFont(e){return this.iconFontsById[e]}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{while($p.isThemeIcon(e.defaults))e=this.iconsById[e.defaults.id];return"codicon codicon-"+(e?e.id:"")};let i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(e=>this.iconsById[e]);for(const o of n.filter(e=>!!e.description).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|${$p.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(e=>!$p.isThemeIcon(e.defaults)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join("\n")}}const IT=new NT;function TT(e,t,i,n){return IT.registerIcon(e,t,i,n)}function MT(){return IT}function OT(){for(const e of Hl.all)IT.registerIcon(e.id,e.definition,e.description);Hl.onDidRegister(e=>IT.registerIcon(e.id,e.definition,e.description))}zd.add(DT.IconContribution,IT),OT();const AT="vscode://schemas/icons";let PT=zd.as(Hd.JSONContribution);PT.registerSchema(AT,IT.getIconSchema());const RT=new so(()=>PT.notifySchemaChanged(AT),200);IT.onDidChange(()=>{RT.isScheduled()||RT.schedule()});TT("widget-close",Ul.close,o("widgetClose","Icon for the close action in widgets."));var FT,BT=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},WT=function(e,t){return function(i,n){t(i,n,e)}},VT=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const zT=3;class HT{constructor(e,t,i,n){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=n}getType(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0}}class KT{constructor(e){this.entries=e}}const jT=TT("diff-review-insert",Ul.add,o("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),UT=TT("diff-review-remove",Ul.remove,o("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),$T=TT("diff-review-close",Ul.close,o("diffReviewCloseIcon","Icon for 'Close' in diff review."));let qT=class e extends Ye{constructor(e,t){super(),this._modeService=t,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=R_(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=R_(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new ET(this.actionBarContainer.domNode)),this._actionBar.push(new Wp("diffreview.close",o("label.close","Close"),"close-diff-review "+$p.asClassName($T),!0,()=>VT(this,void 0,void 0,(function*(){return this.hide()}))),{label:!1,icon:!0}),this.domNode=R_(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=R_(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new aD(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff(()=>{this._isVisible&&(this._diffs=this._compute(),this._render())})),this._register(e.getModifiedEditor().onDidChangeCursorPosition(()=>{this._isVisible&&this._render()})),this._register(Co(this.domNode.domNode,"click",e=>{e.preventDefault();let t=Uo(e.target,"diff-review-row");t&&this._goToRow(t)})),this._register(Co(this.domNode.domNode,"keydown",e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._goToRow(this._getNextRow())),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._goToRow(this._getPrevRow())),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this.hide()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this.accept())})),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e<i;e++)if(this._diffs[e]===this._currentDiff){t=e;break}e=this._diffs.length+t-1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(0===this._diffs.length)return;e%=this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new wi(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow())}next(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e<i;e++)if(this._diffs[e]===this._currentDiff){t=e;break}e=t+1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(0===this._diffs.length)return;e%=this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new wi(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow())}accept(){let e=-1,t=this._getCurrentFocusedRow();if(t){let i=parseInt(t.getAttribute("data-line"),10);isNaN(i)||(e=i)}this.hide(),-1!==e&&(this._diffEditor.setPosition(new wi(e,1)),this._diffEditor.revealPosition(new wi(e,1),1))}hide(){this._isVisible=!1,this._diffEditor.updateOptions({readOnly:!1}),this._diffEditor.focus(),this._diffEditor.doLayout(),this._render()}_getPrevRow(){let e=this._getCurrentFocusedRow();return e?e.previousElementSibling?e.previousElementSibling:e:this._getFirstRow()}_getNextRow(){let e=this._getCurrentFocusedRow();return e?e.nextElementSibling?e.nextElementSibling:e:this._getFirstRow()}_getFirstRow(){return this.domNode.domNode.querySelector(".diff-review-row")}_getCurrentFocusedRow(){let e=document.activeElement;return e&&/diff-review-row/.test(e.className)?e:null}_goToRow(e){let t=this._getCurrentFocusedRow();e.tabIndex=0,e.focus(),t&&t!==e&&(t.tabIndex=-1),this.scrollbar.scanDomNode()}isVisible(){return this._isVisible}layout(e,t,i){this._width=t,this.shadow.setTop(e-6),this.shadow.setWidth(t),this.shadow.setHeight(this._isVisible?6:0),this.domNode.setTop(e),this.domNode.setWidth(t),this.domNode.setHeight(i),this._content.setHeight(i),this._content.setWidth(t),this._isVisible?(this.actionBarContainer.setAttribute("aria-hidden","false"),this.actionBarContainer.setDisplay("block")):(this.actionBarContainer.setAttribute("aria-hidden","true"),this.actionBarContainer.setDisplay("none"))}_compute(){const t=this._diffEditor.getLineChanges();if(!t||0===t.length)return[];const i=this._diffEditor.getOriginalEditor().getModel(),n=this._diffEditor.getModifiedEditor().getModel();return i&&n?e._mergeAdjacent(t,i.getLineCount(),n.getLineCount()):[]}static _mergeAdjacent(e,t,i){if(!e||0===e.length)return[];let n=[],o=0;for(let l=0,c=e.length;l<c;l++){const s=e[l],r=s.originalStartLineNumber,a=s.originalEndLineNumber,d=s.modifiedStartLineNumber,h=s.modifiedEndLineNumber;let u=[],g=0;{const t=0===a?r:r-1,i=0===h?d:d-1;let n=1,o=1;if(l>0){const t=e[l-1];n=0===t.originalEndLineNumber?t.originalStartLineNumber+1:t.originalEndLineNumber+1,o=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber+1:t.modifiedEndLineNumber+1}let s=t-zT+1,c=i-zT+1;if(s<n){const e=n-s;s+=e,c+=e}if(c<o){const e=o-c;s+=e,c+=e}u[g++]=new HT(s,t,c,i)}0!==a&&(u[g++]=new HT(r,a,0,0)),0!==h&&(u[g++]=new HT(0,0,d,h));{const n=0===a?r+1:a+1,o=0===h?d+1:h+1;let s=t,f=i;if(l+1<c){const t=e[l+1];s=0===t.originalEndLineNumber?t.originalStartLineNumber:t.originalStartLineNumber-1,f=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber:t.modifiedStartLineNumber-1}let m=n+zT-1,p=o+zT-1;if(m>s){const e=s-m;m+=e,p+=e}if(p>f){const e=f-p;m+=e,p+=e}u[g++]=new HT(n,m,o,p)}n[o++]=new KT(u)}let s=n[0].entries,r=[],a=0;for(let l=1,c=n.length;l<c;l++){const e=n[l].entries,t=s[s.length-1],i=e[0];0===t.getType()&&0===i.getType()&&i.originalLineStart<=t.originalLineEnd?(s[s.length-1]=new HT(t.originalLineStart,i.originalLineEnd,t.modifiedLineStart,i.modifiedLineEnd),s=s.concat(e.slice(1))):(r[a++]=new KT(s),s=e)}return r[a++]=new KT(s),r}_findDiffIndex(e){const t=e.lineNumber;for(let i=0,n=this._diffs.length;i<n;i++){const e=this._diffs[i].entries,n=e[e.length-1].modifiedLineEnd;if(t<=n)return i}return 0}_render(){const t=this._diffEditor.getOriginalEditor().getOptions(),i=this._diffEditor.getModifiedEditor().getOptions(),n=this._diffEditor.getOriginalEditor().getModel(),s=this._diffEditor.getModifiedEditor().getModel(),r=n.getOptions(),a=s.getOptions();if(!this._isVisible||!n||!s)return mo(this._content.domNode),this._currentDiff=null,void this.scrollbar.scanDomNode();this._diffEditor.updateOptions({readOnly:!0});const l=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs[l]===this._currentDiff)return;this._currentDiff=this._diffs[l];const c=this._diffs[l].entries;let d=document.createElement("div");d.className="diff-review-table",d.setAttribute("role","list"),d.setAttribute("aria-label",'Difference review. Use "Stage | Unstage | Revert Selected Ranges" commands'),A_.applyFontInfoSlow(d,i.get(43));let h=0,u=0,g=0,f=0;for(let e=0,o=c.length;e<o;e++){const t=c[e],i=t.originalLineStart,n=t.originalLineEnd,o=t.modifiedLineStart,s=t.modifiedLineEnd;0!==i&&(0===h||i<h)&&(h=i),0!==n&&(0===u||n>u)&&(u=n),0!==o&&(0===g||o<g)&&(g=o),0!==s&&(0===f||s>f)&&(f=s)}let m=document.createElement("div");m.className="diff-review-row";let p=document.createElement("div");p.className="diff-review-cell diff-review-summary";const _=u-h+1,b=f-g+1;p.appendChild(document.createTextNode(`${l+1}/${this._diffs.length}: @@ -${h},${_} +${g},${b} @@`)),m.setAttribute("data-line",String(g));const v=e=>0===e?o("no_lines_changed","no lines changed"):1===e?o("one_line_changed","1 line changed"):o("more_lines_changed","{0} lines changed",e),w=v(_),C=v(b);m.setAttribute("aria-label",o({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}",l+1,this._diffs.length,h,w,g,C)),m.appendChild(p),m.setAttribute("role","listitem"),d.appendChild(m);const y=i.get(58);let S=g;for(let o=0,x=c.length;o<x;o++){const l=c[o];e._renderSection(d,l,S,y,this._width,t,n,r,i,s,a,this._modeService.languageIdCodec),0!==l.modifiedLineStart&&(S=l.modifiedLineEnd)}mo(this._content.domNode),this._content.domNode.appendChild(d),this.scrollbar.scanDomNode()}static _renderSection(t,i,n,s,r,a,l,c,d,h,u,g){const f=i.getType();let m="diff-review-row",p="";const _="diff-review-spacer";let b=null;switch(f){case 1:m="diff-review-row line-insert",p=" char-insert",b=jT;break;case 2:m="diff-review-row line-delete",p=" char-delete",b=UT;break}const v=i.originalLineStart,w=i.originalLineEnd,C=i.modifiedLineStart,y=i.modifiedLineEnd,S=Math.max(y-C,w-v),x=a.get(129),k=x.glyphMarginWidth+x.lineNumbersWidth,L=d.get(129),E=10+L.glyphMarginWidth+L.lineNumbersWidth;for(let D=0;D<=S;D++){const i=0===v?0:v+D,w=0===C?0:C+D,y=document.createElement("div");y.style.minWidth=r+"px",y.className=m,y.setAttribute("role","listitem"),0!==w&&(n=w),y.setAttribute("data-line",String(n));let S=document.createElement("div");S.className="diff-review-cell",S.style.height=s+"px",y.appendChild(S);const x=document.createElement("span");x.style.width=k+"px",x.style.minWidth=k+"px",x.className="diff-review-line-number"+p,0!==i?x.appendChild(document.createTextNode(String(i))):x.innerText=" ",S.appendChild(x);const L=document.createElement("span");L.style.width=E+"px",L.style.minWidth=E+"px",L.style.paddingRight="10px",L.className="diff-review-line-number"+p,0!==w?L.appendChild(document.createTextNode(String(w))):L.innerText=" ",S.appendChild(L);const N=document.createElement("span");if(N.className=_,b){const e=document.createElement("span");e.className=$p.asClassName(b),e.innerText=" ",N.appendChild(e)}else N.innerText=" ";let I;if(S.appendChild(N),0!==w){let t=this._renderLine(h,d,u.tabSize,w,g);e._ttPolicy&&(t=e._ttPolicy.createHTML(t)),S.insertAdjacentHTML("beforeend",t),I=h.getLineContent(w)}else{let t=this._renderLine(l,a,c.tabSize,i,g);e._ttPolicy&&(t=e._ttPolicy.createHTML(t)),S.insertAdjacentHTML("beforeend",t),I=l.getLineContent(i)}0===I.length&&(I=o("blankLine","blank"));let T="";switch(f){case 0:T=i===w?o({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",I,i):o("equalLine","{0} original line {1} modified line {2}",I,i,w);break;case 1:T=o("insertLine","+ {0} modified line {1}",I,w);break;case 2:T=o("deleteLine","- {0} original line {1}",I,i);break}y.setAttribute("aria-label",T),t.appendChild(y)}}static _renderLine(e,t,i,n,o){const s=e.getLineContent(n),r=t.get(43),a=rg.createEmpty(s,o),l=Rg.isBasicASCII(s,e.mightContainNonBasicASCII()),c=Rg.containsRTL(s,l,e.mightContainRTL()),d=wg(new fg(r.isMonospace&&!t.get(29),r.canUseHalfwidthRightwardsArrow,s,!1,l,c,0,a,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(104),t.get(87),t.get(82),t.get(44)!==B.OFF,null));return d.html}};qT._ttPolicy=null===(FT=window.trustedTypes)||void 0===FT?void 0:FT.createPolicy("diffReview",{createHTML:e=>e}),qT=BT([WT(1,Oc)],qT),Qp((e,t)=>{const i=e.getColor(mx);i&&t.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${i}; }`);const n=e.getColor(py);n&&t.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${n} 0 -6px 6px -6px inset; }`)});class GT extends g_{constructor(){super({id:"editor.action.diffReview.next",label:o("editor.action.diffReview.next","Go to Next Difference"),alias:"Go to Next Difference",precondition:im.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=XT(e);i&&i.diffReviewNext()}}class YT extends g_{constructor(){super({id:"editor.action.diffReview.prev",label:o("editor.action.diffReview.prev","Go to Previous Difference"),alias:"Go to Previous Difference",precondition:im.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=XT(e);i&&i.diffReviewPrev()}}function XT(e){const t=e.get(mn),i=t.listDiffEditors(),n=t.getActiveCodeEditor();if(!n)return null;for(let o=0,s=i.length;o<s;o++){const e=i[o];if(e.getModifiedEditor().getId()===n.getId()||e.getOriginalEditor().getId()===n.getId())return e}return null}m_(GT),m_(YT);const ZT=gn("contextViewService"),QT=gn("contextMenuService");var JT=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class eM extends Ye{constructor(e,t,i,n,s,r){super(),this._viewZoneId=e,this._marginDomNode=t,this.editor=i,this.diff=n,this._contextMenuService=s,this._clipboardService=r,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=Ul.lightBulb.classNames+" lightbulb-glyph",this._diffActions.style.position="absolute";const a=i.getOption(58),l=i.getModel().getEOL();this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=a+"px",this._diffActions.style.lineHeight=a+"px",this._marginDomNode.appendChild(this._diffActions);const c=[],d=0===n.modifiedEndLineNumber;c.push(new Wp("diff.clipboard.copyDeletedContent",d?n.originalEndLineNumber>n.modifiedStartLineNumber?o("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):o("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):n.originalEndLineNumber>n.modifiedStartLineNumber?o("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):o("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>JT(this,void 0,void 0,(function*(){const e=new Ci(n.originalStartLineNumber,1,n.originalEndLineNumber+1,1),t=n.originalModel.getValueInRange(e);yield this._clipboardService.writeText(t)}))));let h=0,u=void 0;n.originalEndLineNumber>n.modifiedStartLineNumber&&(u=new Wp("diff.clipboard.copyDeletedLineContent",d?o("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber):o("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.originalStartLineNumber),void 0,!0,()=>JT(this,void 0,void 0,(function*(){const e=n.originalModel.getLineContent(n.originalStartLineNumber+h);if(""===e){const e=n.originalModel.getEndOfLineSequence();yield this._clipboardService.writeText(0===e?"\n":"\r\n")}else yield this._clipboardService.writeText(e)}))),c.push(u));const g=i.getOption(80);g||c.push(new Wp("diff.inline.revertChange",o("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>JT(this,void 0,void 0,(function*(){const e=new Ci(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),t=n.originalModel.getValueInRange(e);if(0===n.modifiedEndLineNumber){const e=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new Ci(n.modifiedStartLineNumber,e,n.modifiedStartLineNumber,e),text:l+t}])}else{const e=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new Ci(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,e),text:t}])}}))));const f=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(u&&(u.label=d?o("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+h):o("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.originalStartLineNumber+h)),c),autoSelectFirstItem:!0})};this._register(Co(this._diffActions,"mousedown",e=>{const{top:t,height:i}=Bo(this._diffActions);let n=Math.floor(a/3);e.preventDefault(),f(e.posx,t+i+n)})),this._register(i.onMouseMove(e=>{if(8===e.target.type||5===e.target.type){const t=e.target.detail.viewZoneId;t===this._viewZoneId?(this.visibility=!0,h=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,a)):this.visibility=!1}else this.visibility=!1})),this._register(i.onMouseDown(e=>{if(e.event.rightButton&&(8===e.target.type||5===e.target.type)){const t=e.target.detail.viewZoneId;t===this._viewZoneId&&(e.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,a),f(e.event.posx,e.event.posy+a))}}))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}_updateLightBulbPosition(e,t,i){const{top:n}=Bo(e),o=t-n,s=Math.floor(o/i),r=s*i;if(this._diffActions.style.top=r+"px",this.diff.viewLineCounts){let e=0;for(let t=0;t<this.diff.viewLineCounts.length;t++)if(e+=this.diff.viewLineCounts[t],s<e)return t}return s}}const tM=gn("clipboardService");class iM{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}iM.None=Object.freeze({report(){}});const nM=gn("editorProgressService");var oM,sM=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},rM=function(e,t){return function(i,n){t(i,n,e)}};class aM{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter(e=>!this._zonesMap[String(e.id)])}clean(e){this._zones.length>0&&e.changeViewZones(e=>{for(const t of this._zones)e.removeZone(t)}),this._zones=[],this._zonesMap={},this._decorations=e.deltaDecorations(this._decorations,[])}apply(e,t,i,n){const o=n?wT.capture(e):null;e.changeViewZones(t=>{var n;for(const e of this._zones)t.removeZone(e);for(const e of this._inlineDiffMargins)e.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let o=0,s=i.zones.length;o<s;o++){const s=i.zones[o];s.suppressMouseDown=!0;const r=t.addZone(s);this._zones.push(r),this._zonesMap[String(r)]=!0,i.zones[o].diff&&s.marginDomNode&&(s.suppressMouseDown=!1,0!==(null===(n=i.zones[o].diff)||void 0===n?void 0:n.originalModel.getValueLength())&&this._inlineDiffMargins.push(new eM(r,s.marginDomNode,e,i.zones[o].diff,this._contextMenuService,this._clipboardService)))}}),o&&o.restore(e),this._decorations=e.deltaDecorations(this._decorations,i.decorations),t&&t.setZones(i.overviewZones)}}let lM=0;const cM=TT("diff-insert",Ul.add,o("diffInsertIcon","Line decoration for inserts in the diff editor.")),dM=TT("diff-remove",Ul.remove,o("diffRemoveIcon","Line decoration for removals in the diff editor.")),hM=null===(oM=window.trustedTypes)||void 0===oM?void 0:oM.createPolicy("diffEditorWidget",{createHTML:e=>e});let uM=class e extends Ye{constructor(t,i,n,o,s,r,a,l,c,d,h,u){super(),this._editorProgressService=u,this._onDidDispose=this._register(new rt),this.onDidDispose=this._onDidDispose.event,this._onDidUpdateDiff=this._register(new rt),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new rt),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._editorWorkerService=s,this._codeEditorService=l,this._contextKeyService=this._register(r.createScoped(t)),this._instantiationService=a.createChild(new SI([xm,this._contextKeyService])),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=c,this._notificationService=d,this._id=++lM,this._state=0,this._updatingDiffProgress=null,this._domElement=t,i=i||{},this._options=EM(i,{enableSplitViewResizing:!0,renderSideBySide:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit"}),"undefined"!==typeof i.isInEmbeddedEditor?this._contextKeyService.createKey("isInEmbeddedDiffEditor",i.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._updateDecorationsRunner=this._register(new so(()=>this._updateDecorations(),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=R_(document.createElement("div")),this._overviewViewportDomElement.setClassName("diffViewport"),this._overviewViewportDomElement.setPosition("absolute"),this._overviewDomElement=document.createElement("div"),this._overviewDomElement.className="diffOverview",this._overviewDomElement.style.position="absolute",this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode),this._register(Co(this._overviewDomElement,"mousedown",e=>{this._modifiedEditor.delegateVerticalScrollbarMouseDown(e)})),this._options.renderOverviewRuler&&this._containerDomElement.appendChild(this._overviewDomElement),this._originalDomNode=document.createElement("div"),this._originalDomNode.className="editor original",this._originalDomNode.style.position="absolute",this._originalDomNode.style.height="100%",this._containerDomElement.appendChild(this._originalDomNode),this._modifiedDomNode=document.createElement("div"),this._modifiedDomNode.className="editor modified",this._modifiedDomNode.style.position="absolute",this._modifiedDomNode.style.height="100%",this._containerDomElement.appendChild(this._modifiedDomNode),this._beginUpdateDecorationsTimeout=-1,this._currentlyChangingViewZones=!1,this._diffComputationToken=0,this._originalEditorState=new aM(h,o),this._modifiedEditorState=new aM(h,o),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new I_(this._containerDomElement,i.dimension,()=>this._onDidContainerSizeChanged())),i.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null,this._originalEditor=this._createLeftHandSideEditor(i,n.originalEditor||{}),this._modifiedEditor=this._createRightHandSideEditor(i,n.modifiedEditor||{}),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=a.createInstance(qT,this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode),this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._options.renderSideBySide?this._setStrategy(new bM(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new wM(this._createDataSource(),this._options.enableSplitViewResizing)),this._register(c.onDidColorThemeChange(t=>{this._strategy&&this._strategy.applyColors(t)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)}));const g=__.getDiffEditorContributions();for(const e of g)try{this._register(a.createInstance(e.ctor,this))}catch(f){xe(f)}this._codeEditorService.addDiffEditor(this)}_setState(e){this._state!==e&&(this._state=e,this._updatingDiffProgress&&(this._updatingDiffProgress.done(),this._updatingDiffProgress=null),1===this._state&&(this._updatingDiffProgress=this._editorProgressService.show(!0,1e3)))}diffReviewNext(){this._reviewPane.next()}diffReviewPrev(){this._reviewPane.prev()}static _getClassName(e,t){let i="monaco-diff-editor monaco-editor-background ";return t&&(i+="side-by-side "),i+=Gp(e.type),i}_recreateOverviewRulers(){this._options.renderOverviewRuler&&(this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._originalEditor.hasModel()&&(this._originalOverviewRuler=this._originalEditor.createOverviewRuler("original diffOverviewRuler"),this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode())),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._modifiedEditor.hasModel()&&(this._modifiedOverviewRuler=this._modifiedEditor.createOverviewRuler("modified diffOverviewRuler"),this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode())),this._layoutOverviewRulers())}_createLeftHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._originalDomNode,this._adjustOptionsForLeftHandSide(t),i);this._register(n.onDidScrollChange(e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._modifiedEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())})),this._register(n.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(n.onDidChangeConfiguration(e=>{n.getModel()&&(e.hasChanged(43)&&this._updateDecorationsRunner.schedule(),e.hasChanged(130)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(n.onDidChangeHiddenAreas(()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()})),this._register(n.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}));const o=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>o.set(!0))),this._register(n.onDidBlurEditorWidget(()=>o.set(!1))),this._register(n.onDidContentSizeChange(t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})})),n}_createRightHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._modifiedDomNode,this._adjustOptionsForRightHandSide(t),i);this._register(n.onDidScrollChange(e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._originalEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())})),this._register(n.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(n.onDidChangeConfiguration(e=>{n.getModel()&&(e.hasChanged(43)&&this._updateDecorationsRunner.schedule(),e.hasChanged(130)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(n.onDidChangeHiddenAreas(()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()})),this._register(n.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})),this._register(n.onDidChangeModelOptions(e=>{e.tabSize&&this._updateDecorationsRunner.schedule()}));const o=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>o.set(!0))),this._register(n.onDidBlurEditorWidget(()=>o.set(!1))),this._register(n.onDidContentSizeChange(t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})})),n}_createInnerEditor(e,t,i,n){return e.createInstance(GI,t,i,n)}dispose(){this._codeEditorService.removeDiffEditor(this),-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._cleanViewZonesAndDecorations(),this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode),this._options.renderOverviewRuler&&this._containerDomElement.removeChild(this._overviewDomElement),this._containerDomElement.removeChild(this._originalDomNode),this._originalEditor.dispose(),this._containerDomElement.removeChild(this._modifiedDomNode),this._modifiedEditor.dispose(),this._strategy.dispose(),this._containerDomElement.removeChild(this._reviewPane.domNode.domNode),this._containerDomElement.removeChild(this._reviewPane.shadow.domNode),this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode),this._reviewPane.dispose(),this._domElement.removeChild(this._containerDomElement),this._onDidDispose.fire(),super.dispose()}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Va.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(t){const i=EM(t,this._options),n=DM(this._options,i);this._options=i;const o=n.ignoreTrimWhitespace||n.renderIndicators,s=this._isVisible&&(n.maxComputationTime||n.maxFileSize);o?this._beginUpdateDecorations():s&&this._beginUpdateDecorationsSoon(),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(t)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(t)),this._strategy.setEnableSplitViewResizing(this._options.enableSplitViewResizing),n.renderSideBySide&&(this._options.renderSideBySide?this._setStrategy(new bM(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new wM(this._createDataSource(),this._options.enableSplitViewResizing)),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)),n.renderOverviewRuler&&(this._options.renderOverviewRuler?this._containerDomElement.appendChild(this._overviewDomElement):this._containerDomElement.removeChild(this._overviewDomElement))}getModel(){return{original:this._originalEditor.getModel(),modified:this._modifiedEditor.getModel()}}setModel(e){if(e&&(!e.original||!e.modified))throw new Error(e.original?"DiffEditorWidget.setModel: Modified model is null":"DiffEditorWidget.setModel: Original model is null");this._cleanViewZonesAndDecorations(),this._originalEditor.setModel(e?e.original:null),this._modifiedEditor.setModel(e?e.modified:null),this._updateDecorationsRunner.cancel(),e&&(this._originalEditor.setScrollTop(0),this._modifiedEditor.setScrollTop(0)),this._diffComputationResult=null,this._diffComputationToken++,this._setState(0),e&&(this._recreateOverviewRulers(),this._beginUpdateDecorations()),this._layoutOverviewViewport()}getDomNode(){return this._domElement}getVisibleColumnFromPosition(e){return this._modifiedEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._modifiedEditor.getPosition()}setPosition(e){this._modifiedEditor.setPosition(e)}revealLine(e,t=0){this._modifiedEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._modifiedEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._modifiedEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._modifiedEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._modifiedEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._modifiedEditor.revealPositionNearTop(e,t)}getSelection(){return this._modifiedEditor.getSelection()}getSelections(){return this._modifiedEditor.getSelections()}setSelection(e){this._modifiedEditor.setSelection(e)}setSelections(e){this._modifiedEditor.setSelections(e)}revealLines(e,t,i=0){this._modifiedEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._modifiedEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._modifiedEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._modifiedEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._modifiedEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._modifiedEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._modifiedEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._modifiedEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._modifiedEditor.getSupportedActions()}saveViewState(){const e=this._originalEditor.saveViewState(),t=this._modifiedEditor.saveViewState();return{original:e,modified:t}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._originalEditor.restoreViewState(t.original),this._modifiedEditor.restoreViewState(t.modified)}}layout(e){this._elementSizeObserver.observe(e)}focus(){this._modifiedEditor.focus()}hasTextFocus(){return this._originalEditor.hasTextFocus()||this._modifiedEditor.hasTextFocus()}trigger(e,t,i){this._modifiedEditor.trigger(e,t,i)}changeDecorations(e){return this._modifiedEditor.changeDecorations(e)}_onDidContainerSizeChanged(){this._doLayout()}_getReviewHeight(){return this._reviewPane.isVisible()?this._elementSizeObserver.getHeight():0}_layoutOverviewRulers(){if(!this._options.renderOverviewRuler)return;if(!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const t=this._elementSizeObserver.getHeight(),i=this._getReviewHeight(),n=e.ENTIRE_DIFF_OVERVIEW_WIDTH-2*e.ONE_OVERVIEW_WIDTH,o=this._modifiedEditor.getLayoutInfo();o&&(this._originalOverviewRuler.setLayout({top:0,width:e.ONE_OVERVIEW_WIDTH,right:n+e.ONE_OVERVIEW_WIDTH,height:t-i}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:e.ONE_OVERVIEW_WIDTH,height:t-i}))}_onViewZonesChanged(){this._currentlyChangingViewZones||this._updateDecorationsRunner.schedule()}_beginUpdateDecorationsSoon(){-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._beginUpdateDecorationsTimeout=window.setTimeout(()=>this._beginUpdateDecorations(),e.UPDATE_DIFF_DECORATIONS_DELAY)}static _equals(e,t){return!e&&!t||!(!e||!t)&&e.toString()===t.toString()}_beginUpdateDecorations(){this._beginUpdateDecorationsTimeout=-1;const t=this._originalEditor.getModel(),i=this._modifiedEditor.getModel();if(!t||!i)return;this._diffComputationToken++;const n=this._diffComputationToken,s=1024*this._options.maxFileSize*1024,r=e=>{const t=e.getValueLength();return 0===s||t<=s};r(t)&&r(i)?(this._setState(1),this._editorWorkerService.computeDiff(t.uri,i.uri,this._options.ignoreTrimWhitespace,this._options.maxComputationTime).then(e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=e,this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())},e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=null,this._updateDecorationsRunner.schedule())})):e._equals(t.uri,this._lastOriginalWarning)&&e._equals(i.uri,this._lastModifiedWarning)||(this._lastOriginalWarning=t.uri,this._lastModifiedWarning=i.uri,this._notificationService.warn(o("diff.tooLarge","Cannot compare files because one file is too large.")))}_cleanViewZonesAndDecorations(){this._originalEditorState.clean(this._originalEditor),this._modifiedEditorState.clean(this._modifiedEditor)}_updateDecorations(){if(!this._originalEditor.getModel()||!this._modifiedEditor.getModel())return;const e=this._diffComputationResult?this._diffComputationResult.changes:[],t=this._originalEditorState.getForeignViewZones(this._originalEditor.getWhitespaces()),i=this._modifiedEditorState.getForeignViewZones(this._modifiedEditor.getWhitespaces()),n=this._strategy.getEditorsDiffDecorations(e,this._options.ignoreTrimWhitespace,this._options.renderIndicators,t,i);try{this._currentlyChangingViewZones=!0,this._originalEditorState.apply(this._originalEditor,this._originalOverviewRuler,n.original,!1),this._modifiedEditorState.apply(this._modifiedEditor,this._modifiedOverviewRuler,n.modified,!0)}finally{this._currentlyChangingViewZones=!1}}_adjustOptionsForSubEditor(e){const t=Object.assign({},e);return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._options.renderSideBySide?t.wordWrapOverride1=this._options.diffWordWrap:t.wordWrapOverride1="off",e.originalAriaLabel&&(t.ariaLabel=e.originalAriaLabel),t.readOnly=!this._options.originalEditable,t.extraEditorClassName="original-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}_adjustOptionsForRightHandSide(t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.wordWrapOverride1=this._options.diffWordWrap,i.revealHorizontalRightPadding=Ce.revealHorizontalRightPadding.defaultValue+e.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",Object.assign(Object.assign({},i),{dimension:{height:0,width:0}})}doLayout(){this._elementSizeObserver.observe(),this._doLayout()}_doLayout(){const t=this._elementSizeObserver.getWidth(),i=this._elementSizeObserver.getHeight(),n=this._getReviewHeight(),o=this._strategy.layout();this._originalDomNode.style.width=o+"px",this._originalDomNode.style.left="0px",this._modifiedDomNode.style.width=t-o+"px",this._modifiedDomNode.style.left=o+"px",this._overviewDomElement.style.top="0px",this._overviewDomElement.style.height=i-n+"px",this._overviewDomElement.style.width=e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=t-e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewViewportDomElement.setWidth(e.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this._originalEditor.layout({width:o,height:i-n}),this._modifiedEditor.layout({width:t-o-(this._options.renderOverviewRuler?e.ENTIRE_DIFF_OVERVIEW_WIDTH:0),height:i-n}),(this._originalOverviewRuler||this._modifiedOverviewRuler)&&this._layoutOverviewRulers(),this._reviewPane.layout(i-n,t,n),this._layoutOverviewViewport()}_layoutOverviewViewport(){const e=this._computeOverviewViewport();e?(this._overviewViewportDomElement.setTop(e.top),this._overviewViewportDomElement.setHeight(e.height)):(this._overviewViewportDomElement.setTop(0),this._overviewViewportDomElement.setHeight(0))}_computeOverviewViewport(){const e=this._modifiedEditor.getLayoutInfo();if(!e)return null;const t=this._modifiedEditor.getScrollTop(),i=this._modifiedEditor.getScrollHeight(),n=Math.max(0,e.height),o=Math.max(0,n-0),s=i>0?o/i:0,r=Math.max(0,Math.floor(e.height*s)),a=Math.floor(t*s);return{height:r,top:a}}_createDataSource(){return{getWidth:()=>this._elementSizeObserver.getWidth(),getHeight:()=>this._elementSizeObserver.getHeight()-this._getReviewHeight(),getOptions:()=>({renderOverviewRuler:this._options.renderOverviewRuler}),getContainerDomNode:()=>this._containerDomElement,relayoutEditors:()=>{this._doLayout()},getOriginalEditor:()=>this._originalEditor,getModifiedEditor:()=>this._modifiedEditor}}_setStrategy(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getColorTheme()),this._diffComputationResult&&this._updateDecorations(),this._doLayout()}_getLineChangeAtOrBeforeLineNumber(e,t){const i=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===i.length||e<t(i[0]))return null;let n=0,o=i.length-1;while(n<o){const s=Math.floor((n+o)/2),r=t(i[s]),a=s+1<=o?t(i[s+1]):1073741824;e<r?o=s-1:e>=a?n=s+1:(n=s,o=s)}return i[n]}_getEquivalentLineForOriginalLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,e=>e.originalStartLineNumber);if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-i;return r<=o?n+Math.min(r,s):n+s-o+r}_getEquivalentLineForModifiedLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,e=>e.modifiedStartLineNumber);if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-n;return r<=s?i+Math.min(r,o):i+o-s+r}getDiffLineInformationForOriginal(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null}getDiffLineInformationForModified(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null}};uM.ONE_OVERVIEW_WIDTH=15,uM.ENTIRE_DIFF_OVERVIEW_WIDTH=30,uM.UPDATE_DIFF_DECORATIONS_DELAY=200,uM=sM([rM(3,tM),rM(4,Mc),rM(5,xm),rM(6,hn),rM(7,mn),rM(8,jp),rM(9,$m),rM(10,QT),rM(11,nM)],uM);class gM extends Ye{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=(e.getColor(iS)||eS).transparent(2),i=(e.getColor(nS)||tS).transparent(2),n=!t.equals(this._insertColor)||!i.equals(this._removeColor);return this._insertColor=t,this._removeColor=i,n}getEditorsDiffDecorations(e,t,i,n,o){o=o.sort((e,t)=>e.afterLineNumber-t.afterLineNumber),n=n.sort((e,t)=>e.afterLineNumber-t.afterLineNumber);const s=this._getViewZones(e,n,o,i),r=this._getOriginalEditorDecorations(e,t,i),a=this._getModifiedEditorDecorations(e,t,i);return{original:{decorations:r.decorations,overviewZones:r.overviewZones,zones:s.original},modified:{decorations:a.decorations,overviewZones:a.overviewZones,zones:s.modified}}}}class fM{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._index<this._source.length?this.current=this._source[this._index]:this.current=null}}class mM{constructor(e,t,i,n,o){this._lineChanges=e,this._originalForeignVZ=t,this._modifiedForeignVZ=i,this._originalEditor=n,this._modifiedEditor=o}static _getViewLineCount(e,t,i){const n=e.getModel(),o=e._getViewModel();if(n&&o){const e=LM(n,o,t,i);return e.endLineNumber-e.startLineNumber+1}return i-t+1}getViewZones(){const e=this._originalEditor.getOption(58),t=this._modifiedEditor.getOption(58),i=-1!==this._originalEditor.getOption(130).wrappingColumn,n=-1!==this._modifiedEditor.getOption(130).wrappingColumn,o=i||n,s=this._originalEditor.getModel(),r=this._originalEditor._getViewModel().coordinatesConverter,a=this._modifiedEditor._getViewModel().coordinatesConverter,l={original:[],modified:[]};let c=0,d=0,h=0,u=0,g=0,f=0;const m=(e,t)=>e.afterLineNumber-t.afterLineNumber,p=(e,t)=>{if(null===t.domNode&&e.length>0){const i=e[e.length-1];if(i.afterLineNumber===t.afterLineNumber&&null===i.domNode)return void(i.heightInLines+=t.heightInLines)}e.push(t)},_=new fM(this._modifiedForeignVZ),b=new fM(this._originalForeignVZ);let v=1,w=1;for(let C=0,y=this._lineChanges.length;C<=y;C++){const i=C<y?this._lineChanges[C]:null;null!==i?(h=i.originalStartLineNumber+(i.originalEndLineNumber>0?-1:0),u=i.modifiedStartLineNumber+(i.modifiedEndLineNumber>0?-1:0),d=i.originalEndLineNumber>0?mM._getViewLineCount(this._originalEditor,i.originalStartLineNumber,i.originalEndLineNumber):0,c=i.modifiedEndLineNumber>0?mM._getViewLineCount(this._modifiedEditor,i.modifiedStartLineNumber,i.modifiedEndLineNumber):0,g=Math.max(i.originalStartLineNumber,i.originalEndLineNumber),f=Math.max(i.modifiedStartLineNumber,i.modifiedEndLineNumber)):(h+=1e7+d,u+=1e7+c,g=h,f=u);let n=[],S=[];if(o){let e;e=i?i.originalEndLineNumber>0?i.originalStartLineNumber-v:i.modifiedStartLineNumber-w:s.getLineCount()-v;for(let t=0;t<e;t++){const e=v+t,i=w+t,o=r.getModelLineViewLineCount(e),s=a.getModelLineViewLineCount(i);o<s?n.push({afterLineNumber:e,heightInLines:s-o,domNode:null,marginDomNode:null}):o>s&&S.push({afterLineNumber:i,heightInLines:o-s,domNode:null,marginDomNode:null})}i&&(v=(i.originalEndLineNumber>0?i.originalEndLineNumber:i.originalStartLineNumber)+1,w=(i.modifiedEndLineNumber>0?i.modifiedEndLineNumber:i.modifiedStartLineNumber)+1)}while(_.current&&_.current.afterLineNumber<=f){let e;e=_.current.afterLineNumber<=u?h-u+_.current.afterLineNumber:g;let o=null;i&&i.modifiedStartLineNumber<=_.current.afterLineNumber&&_.current.afterLineNumber<=i.modifiedEndLineNumber&&(o=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),n.push({afterLineNumber:e,heightInLines:_.current.height/t,domNode:null,marginDomNode:o}),_.advance()}while(b.current&&b.current.afterLineNumber<=g){let t;t=b.current.afterLineNumber<=h?u-h+b.current.afterLineNumber:f,S.push({afterLineNumber:t,heightInLines:b.current.height/e,domNode:null}),b.advance()}if(null!==i&&SM(i)){const e=this._produceOriginalFromDiff(i,d,c);e&&n.push(e)}if(null!==i&&xM(i)){const e=this._produceModifiedFromDiff(i,d,c);e&&S.push(e)}let x=0,k=0;n=n.sort(m),S=S.sort(m);while(x<n.length&&k<S.length){const e=n[x],t=S[k],i=e.afterLineNumber-h,o=t.afterLineNumber-u;i<o?(p(l.original,e),x++):o<i?(p(l.modified,t),k++):e.shouldNotShrink?(p(l.original,e),x++):t.shouldNotShrink?(p(l.modified,t),k++):e.heightInLines>=t.heightInLines?(e.heightInLines-=t.heightInLines,k++):(t.heightInLines-=e.heightInLines,x++)}while(x<n.length)p(l.original,n[x]),x++;while(k<S.length)p(l.modified,S[k]),k++}return{original:mM._ensureDomNodes(l.original),modified:mM._ensureDomNodes(l.modified)}}static _ensureDomNodes(e){return e.map(e=>(e.domNode||(e.domNode=kM()),e))}}function pM(e,t,i,n,o){return{range:new Ci(e,t,i,n),options:o}}const _M={charDelete:bk.register({description:"diff-editor-char-delete",className:"char-delete"}),charDeleteWholeLine:bk.register({description:"diff-editor-char-delete-whole-line",className:"char-delete",isWholeLine:!0}),charInsert:bk.register({description:"diff-editor-char-insert",className:"char-insert"}),charInsertWholeLine:bk.register({description:"diff-editor-char-insert-whole-line",className:"char-insert",isWholeLine:!0}),lineInsert:bk.register({description:"diff-editor-line-insert",className:"line-insert",marginClassName:"line-insert",isWholeLine:!0}),lineInsertWithSign:bk.register({description:"diff-editor-line-insert-with-sign",className:"line-insert",linesDecorationsClassName:"insert-sign "+$p.asClassName(cM),marginClassName:"line-insert",isWholeLine:!0}),lineDelete:bk.register({description:"diff-editor-line-delete",className:"line-delete",marginClassName:"line-delete",isWholeLine:!0}),lineDeleteWithSign:bk.register({description:"diff-editor-line-delete-with-sign",className:"line-delete",linesDecorationsClassName:"delete-sign "+$p.asClassName(dM),marginClassName:"line-delete",isWholeLine:!0}),lineDeleteMargin:bk.register({description:"diff-editor-line-delete-margin",marginClassName:"line-delete"})};class bM extends gM{constructor(e,t){super(e),this._disableSash=!1===t,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new _T(this._dataSource.getContainerDomNode(),this,{orientation:0})),this._disableSash&&(this._sash.state=0),this._sash.onDidStart(()=>this._onSashDragStart()),this._sash.onDidChange(e=>this._onSashDrag(e)),this._sash.onDidEnd(()=>this._onSashDragEnd()),this._sash.onDidReset(()=>this._onSashReset())}setEnableSplitViewResizing(e){const t=!1===e;this._disableSash!==t&&(this._disableSash=t,this._sash.state=this._disableSash?0:3)}layout(e=this._sashRatio){const t=this._dataSource.getWidth(),i=t-(this._dataSource.getOptions().renderOverviewRuler?uM.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let n=Math.floor((e||.5)*i);const o=Math.floor(.5*i);return n=this._disableSash?o:n||o,i>2*bM.MINIMUM_EDITOR_WIDTH?(n<bM.MINIMUM_EDITOR_WIDTH&&(n=bM.MINIMUM_EDITOR_WIDTH),n>i-bM.MINIMUM_EDITOR_WIDTH&&(n=i-bM.MINIMUM_EDITOR_WIDTH)):n=o,this._sashPosition!==n&&(this._sashPosition=n,this._sash.layout()),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const t=this._dataSource.getWidth(),i=t-(this._dataSource.getOptions().renderOverviewRuler?uM.ENTIRE_DIFF_OVERVIEW_WIDTH:0),n=this.layout((this._startSashPosition+(e.currentX-e.startX))/i);this._sashRatio=n/i,this._dataSource.relayoutEditors()}_onSashDragEnd(){this._sash.layout()}_onSashReset(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()}getVerticalSashTop(e){return 0}getVerticalSashLeft(e){return this._sashPosition}getVerticalSashHeight(e){return this._dataSource.getHeight()}_getViewZones(e,t,i){const n=this._dataSource.getOriginalEditor(),o=this._dataSource.getModifiedEditor(),s=new vM(e,t,i,n,o);return s.getViewZones()}_getOriginalEditorDecorations(e,t,i){const n=this._dataSource.getOriginalEditor(),o=String(this._removeColor),s={decorations:[],overviewZones:[]},r=n.getModel(),a=n._getViewModel();for(const l of e)if(xM(l)){s.decorations.push({range:new Ci(l.originalStartLineNumber,1,l.originalEndLineNumber,1073741824),options:i?_M.lineDeleteWithSign:_M.lineDelete}),SM(l)&&l.charChanges||s.decorations.push(pM(l.originalStartLineNumber,1,l.originalEndLineNumber,1073741824,_M.charDeleteWholeLine));const e=LM(r,a,l.originalStartLineNumber,l.originalEndLineNumber);if(s.overviewZones.push(new UD(e.startLineNumber,e.endLineNumber,o)),l.charChanges)for(const i of l.charChanges)if(xM(i))if(t)for(let e=i.originalStartLineNumber;e<=i.originalEndLineNumber;e++){let t,n;t=e===i.originalStartLineNumber?i.originalStartColumn:r.getLineFirstNonWhitespaceColumn(e),n=e===i.originalEndLineNumber?i.originalEndColumn:r.getLineLastNonWhitespaceColumn(e),s.decorations.push(pM(e,t,e,n,_M.charDelete))}else s.decorations.push(pM(i.originalStartLineNumber,i.originalStartColumn,i.originalEndLineNumber,i.originalEndColumn,_M.charDelete))}return s}_getModifiedEditorDecorations(e,t,i){const n=this._dataSource.getModifiedEditor(),o=String(this._insertColor),s={decorations:[],overviewZones:[]},r=n.getModel(),a=n._getViewModel();for(const l of e)if(SM(l)){s.decorations.push({range:new Ci(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824),options:i?_M.lineInsertWithSign:_M.lineInsert}),xM(l)&&l.charChanges||s.decorations.push(pM(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824,_M.charInsertWholeLine));const e=LM(r,a,l.modifiedStartLineNumber,l.modifiedEndLineNumber);if(s.overviewZones.push(new UD(e.startLineNumber,e.endLineNumber,o)),l.charChanges)for(const i of l.charChanges)if(SM(i))if(t)for(let e=i.modifiedStartLineNumber;e<=i.modifiedEndLineNumber;e++){let t,n;t=e===i.modifiedStartLineNumber?i.modifiedStartColumn:r.getLineFirstNonWhitespaceColumn(e),n=e===i.modifiedEndLineNumber?i.modifiedEndColumn:r.getLineLastNonWhitespaceColumn(e),s.decorations.push(pM(e,t,e,n,_M.charInsert))}else s.decorations.push(pM(i.modifiedStartLineNumber,i.modifiedStartColumn,i.modifiedEndLineNumber,i.modifiedEndColumn,_M.charInsert))}return s}}bM.MINIMUM_EDITOR_WIDTH=100;class vM extends mM{constructor(e,t,i,n,o){super(e,t,i,n,o)}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){return null}_produceOriginalFromDiff(e,t,i){return i>t?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i-t,domNode:null}:null}_produceModifiedFromDiff(e,t,i){return t>i?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-i,domNode:null}:null}}class wM extends gM{constructor(e,t){super(e),this._decorationsLeft=e.getOriginalEditor().getLayoutInfo().decorationsLeft,this._register(e.getOriginalEditor().onDidLayoutChange(t=>{this._decorationsLeft!==t.decorationsLeft&&(this._decorationsLeft=t.decorationsLeft,e.relayoutEditors())}))}setEnableSplitViewResizing(e){}_getViewZones(e,t,i,n){const o=this._dataSource.getOriginalEditor(),s=this._dataSource.getModifiedEditor(),r=new CM(e,t,i,o,s,n);return r.getViewZones()}_getOriginalEditorDecorations(e,t,i){const n=String(this._removeColor),o={decorations:[],overviewZones:[]},s=this._dataSource.getOriginalEditor(),r=s.getModel(),a=s._getViewModel();for(const l of e)if(xM(l)){o.decorations.push({range:new Ci(l.originalStartLineNumber,1,l.originalEndLineNumber,1073741824),options:_M.lineDeleteMargin});const e=LM(r,a,l.originalStartLineNumber,l.originalEndLineNumber);o.overviewZones.push(new UD(e.startLineNumber,e.endLineNumber,n))}return o}_getModifiedEditorDecorations(e,t,i){const n=this._dataSource.getModifiedEditor(),o=String(this._insertColor),s={decorations:[],overviewZones:[]},r=n.getModel(),a=n._getViewModel();for(const l of e)if(SM(l)){s.decorations.push({range:new Ci(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824),options:i?_M.lineInsertWithSign:_M.lineInsert});const e=LM(r,a,l.modifiedStartLineNumber,l.modifiedEndLineNumber);if(s.overviewZones.push(new UD(e.startLineNumber,e.endLineNumber,o)),l.charChanges){for(const i of l.charChanges)if(SM(i))if(t)for(let e=i.modifiedStartLineNumber;e<=i.modifiedEndLineNumber;e++){let t,n;t=e===i.modifiedStartLineNumber?i.modifiedStartColumn:r.getLineFirstNonWhitespaceColumn(e),n=e===i.modifiedEndLineNumber?i.modifiedEndColumn:r.getLineLastNonWhitespaceColumn(e),s.decorations.push(pM(e,t,e,n,_M.charInsert))}else s.decorations.push(pM(i.modifiedStartLineNumber,i.modifiedStartColumn,i.modifiedEndLineNumber,i.modifiedEndColumn,_M.charInsert))}else s.decorations.push(pM(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824,_M.charInsertWholeLine))}return s}layout(){return Math.max(5,this._decorationsLeft)}}class CM extends mM{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._originalModel=n.getModel(),this._renderIndicators=s,this._pendingLineChange=[],this._pendingViewZones=[],this._lineBreaksComputer=this._modifiedEditor._getViewModel().createLineBreaksComputer()}getViewZones(){const e=super.getViewZones();return this._finalize(e),e}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){const e=document.createElement("div");return e.className="inline-added-margin-view-zone",e}_produceOriginalFromDiff(e,t,i){const n=document.createElement("div");return n.className="inline-added-margin-view-zone",{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i,domNode:document.createElement("div"),marginDomNode:n}}_produceModifiedFromDiff(e,t,i){const n=document.createElement("div");n.className="view-lines line-delete "+xL;const o=document.createElement("div");o.className="inline-deleted-margin-view-zone";const s={shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:0,domNode:n,marginDomNode:o,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalModel:this._originalModel,viewLineCounts:null}};for(let r=e.originalStartLineNumber;r<=e.originalEndLineNumber;r++)this._lineBreaksComputer.addRequest(this._originalModel.getLineContent(r),null,null);return this._pendingLineChange.push(e),this._pendingViewZones.push(s),s}_finalize(e){const t=this._modifiedEditor.getOptions(),i=this._modifiedEditor.getModel().getOptions().tabSize,n=t.get(43),o=t.get(29),s=n.typicalHalfwidthCharacterWidth,r=t.get(92),a=this._originalModel.mightContainNonBasicASCII(),l=this._originalModel.mightContainRTL(),c=t.get(58),d=t.get(129),h=d.decorationsWidth,u=t.get(104),g=t.get(87),f=t.get(82),m=t.get(44),p=this._lineBreaksComputer.finalize();let _=0;for(let b=0;b<this._pendingLineChange.length;b++){const t=this._pendingLineChange[b],d=this._pendingViewZones[b],v=d.domNode;A_.applyFontInfoSlow(v,n);const w=d.marginDomNode;A_.applyFontInfoSlow(w,n);const C=[];if(t.charChanges)for(const e of t.charChanges)xM(e)&&C.push(new Fg(new Ci(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),"char-delete",0));const y=C.length>0,S=pd(1e4);let x=0,k=0,L=null;for(let s=t.originalStartLineNumber;s<=t.originalEndLineNumber;s++){const r=s-t.originalStartLineNumber,b=this._originalModel.getLineTokens(s),v=b.getLineContent(),E=p[_++],D=lg.filter(C,s,1,v.length+1);if(E){let t=0;for(const e of E.breakOffsets){const s=b.sliceAndInflate(t,e,0),r=v.substring(t,e);x=Math.max(x,this._renderOriginalLine(k++,r,s,lg.extractWrapped(D,t,e),y,a,l,n,o,c,h,u,g,f,m,i,S,w)),t=e}L||(L=[]);while(L.length<r)L[L.length]=1;L[r]=E.breakOffsets.length,d.heightInLines+=E.breakOffsets.length-1;const p=document.createElement("div");p.className="line-delete",e.original.push({afterLineNumber:s,afterColumn:0,heightInLines:E.breakOffsets.length-1,domNode:kM(),marginDomNode:p})}else x=Math.max(x,this._renderOriginalLine(k++,v,b,D,y,a,l,n,o,c,h,u,g,f,m,i,S,w))}x+=r;const E=S.build(),D=hM?hM.createHTML(E):E;if(v.innerHTML=D,d.minWidthInPx=x*s,L){const e=t.originalEndLineNumber-t.originalStartLineNumber;while(L.length<=e)L[L.length]=1}d.diff.viewLineCounts=L}e.original.sort((e,t)=>e.afterLineNumber-t.afterLineNumber)}_renderOriginalLine(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,m,p,_){p.appendASCIIString('<div class="view-line'),o||p.appendASCIIString(" char-delete"),p.appendASCIIString('" style="top:'),p.appendASCIIString(String(e*c)),p.appendASCIIString('px;width:1000000px;">');const b=Rg.isBasicASCII(t,s),v=Rg.containsRTL(t,b,r),w=bg(new fg(a.isMonospace&&!l,a.canUseHalfwidthRightwardsArrow,t,!1,b,v,0,i,n,m,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,h,u,g,f!==B.OFF,null),p);if(p.appendASCIIString("</div>"),this._renderIndicators){const t=document.createElement("div");t.className="delete-sign "+$p.asClassName(dM),t.setAttribute("style",`position:absolute;top:${e*c}px;width:${d}px;height:${c}px;right:0;`),_.appendChild(t)}return w.characterMapping.getAbsoluteOffset(w.characterMapping.length)}}function yM(e,t){return L(e,t,["off","on","inherit"])}function SM(e){return e.modifiedEndLineNumber>0}function xM(e){return e.originalEndLineNumber>0}function kM(){const e=document.createElement("div");return e.className="diagonal-fill",e}function LM(e,t,i,n){const o=e.getLineCount();return i=Math.min(o,Math.max(1,i)),n=Math.min(o,Math.max(1,n)),t.coordinatesConverter.convertModelRangeToViewRange(new Ci(i,e.getLineMinColumn(i),n,e.getLineMaxColumn(n)))}function EM(e,t){return{enableSplitViewResizing:w(e.enableSplitViewResizing,t.enableSplitViewResizing),renderSideBySide:w(e.renderSideBySide,t.renderSideBySide),maxComputationTime:y(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:y(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:w(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:w(e.renderIndicators,t.renderIndicators),originalEditable:w(e.originalEditable,t.originalEditable),diffCodeLens:w(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:w(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:yM(e.diffWordWrap,t.diffWordWrap)}}function DM(e,t){return{enableSplitViewResizing:e.enableSplitViewResizing!==t.enableSplitViewResizing,renderSideBySide:e.renderSideBySide!==t.renderSideBySide,maxComputationTime:e.maxComputationTime!==t.maxComputationTime,maxFileSize:e.maxFileSize!==t.maxFileSize,ignoreTrimWhitespace:e.ignoreTrimWhitespace!==t.ignoreTrimWhitespace,renderIndicators:e.renderIndicators!==t.renderIndicators,originalEditable:e.originalEditable!==t.originalEditable,diffCodeLens:e.diffCodeLens!==t.diffCodeLens,renderOverviewRuler:e.renderOverviewRuler!==t.renderOverviewRuler,diffWordWrap:e.diffWordWrap!==t.diffWordWrap}}Qp((e,t)=>{const i=e.getColor(iS);i&&(t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { background-color: ${i}; }`),t.addRule(`.monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: ${i}; }`),t.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${i}; }`));const n=e.getColor(nS);n&&(t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { background-color: ${n}; }`),t.addRule(`.monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: ${n}; }`),t.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${n}; }`));const o=e.getColor(oS);o&&t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${"hc"===e.type?"dashed":"solid"} ${o}; }`);const s=e.getColor(sS);s&&t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${"hc"===e.type?"dashed":"solid"} ${s}; }`);const r=e.getColor(py);r&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${r}; }`);const a=e.getColor(rS);a&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${a}; }`);const l=e.getColor(_y);l&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport {\n\t\t\t\tbackground: ${l};\n\t\t\t}\n\t\t`);const c=e.getColor(by);c&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:hover {\n\t\t\t\tbackground: ${c};\n\t\t\t}\n\t\t`);const d=e.getColor(vy);d&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:active {\n\t\t\t\tbackground: ${d};\n\t\t\t}\n\t\t`);const h=e.getColor(aS);t.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${h} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${h} 50%, ${h} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`)});const NM=gn("themeService"),IM=gn("keybindingService");class TM extends Ye{constructor(){super(),this._onCodeEditorAdd=this._register(new rt),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new rt),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new rt),this._onDiffEditorRemove=this._register(new rt),this._onDecorationTypeRegistered=this._register(new rt),this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null)}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])}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.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}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i)){const e=this._modelProperties.get(i);return e.get(t)}}}var MM=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},OM=function(e,t){return function(i,n){t(i,n,e)}};class AM{constructor(e,t,i){this._parent=e,this._editorId=t,this._styleSheet=i,this._refCount=0}ref(){this._refCount++}unref(){var e;this._refCount--,0===this._refCount&&(null===(e=this._styleSheet.parentNode)||void 0===e||e.removeChild(this._styleSheet),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){const i=this._styleSheet.sheet;i.insertRule(e,t)}removeRulesContainingSelector(e){is(e,this._styleSheet)}}class PM{constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){const i=this._styleSheet.sheet;i.insertRule(e,t)}removeRulesContainingSelector(e){is(e,this._styleSheet)}}let RM=class extends TM{constructor(e,t){super(),this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._globalStyleSheet=e||null,this._themeService=t}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=new PM(Zo())),this._globalStyleSheet}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!Go(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const e=new AM(this,i,Zo(t));this._editorStyleSheets.set(i,e)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,n,o){let s=this._decorationOptionProviders.get(t);if(!s){const r=this._getOrCreateStyleSheet(o),a={styleSheet:r,key:t,parentTypeKey:n,options:i||Object.create(null)};s=n?new FM(this._themeService,r,a):new BM(e,this._themeService,r,a),this._decorationOptionProviders.set(t,s),this._onDecorationTypeRegistered.fire(t)}s.refCount++}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.removeDecorations(e))))}resolveDecorationOptions(e,t){const i=this._decorationOptionProviders.get(e);if(!i)throw new Error("Unknown decoration type key: "+e);return i.getOptions(this,t)}};RM=MM([OM(1,jp)],RM);class FM{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new VM(3,i,e),this._afterContentRules=new VM(4,i,e)}getOptions(e,t){const i=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(i.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(i.afterContentClassName=this._afterContentRules.className),i}dispose(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null),this._styleSheet.unref()}}class BM{constructor(e,t,i,n){this._disposables=new Ge,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const o=e=>{const i=new VM(e,n,t);if(this._disposables.add(i),i.hasContent)return i.className},s=e=>{const i=new VM(e,n,t);return this._disposables.add(i),i.hasContent?{className:i.className,hasLetterSpacing:i.hasLetterSpacing}:null};this.className=o(0);const r=s(1);if(r&&(this.inlineClassName=r.className,this.inlineClassNameAffectsLetterSpacing=r.hasLetterSpacing),this.beforeContentClassName=o(3),this.afterContentClassName=o(4),n.options.beforeInjectedText&&n.options.beforeInjectedText.contentText){const e=s(5);this.beforeInjectedText={content:n.options.beforeInjectedText.contentText,inlineClassName:null===e||void 0===e?void 0:e.className,inlineClassNameAffectsLetterSpacing:(null===e||void 0===e?void 0:e.hasLetterSpacing)||n.options.beforeInjectedText.affectsLetterSpacing}}if(n.options.afterInjectedText&&n.options.afterInjectedText.contentText){const e=s(6);this.afterInjectedText={content:n.options.afterInjectedText.contentText,inlineClassName:null===e||void 0===e?void 0:e.className,inlineClassNameAffectsLetterSpacing:(null===e||void 0===e?void 0:e.hasLetterSpacing)||n.options.afterInjectedText.affectsLetterSpacing}}this.glyphMarginClassName=o(2);const a=n.options;this.isWholeLine=Boolean(a.isWholeLine),this.stickiness=a.rangeBehavior;const l=a.light&&a.light.overviewRulerColor||a.overviewRulerColor,c=a.dark&&a.dark.overviewRulerColor||a.overviewRulerColor;"undefined"===typeof l&&"undefined"===typeof c||(this.overviewRuler={color:l||c,darkColor:c||l,position:a.overviewRulerLane||za.Center})}getOptions(e,t){return t?{description:this.description,inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness,before:this.beforeInjectedText,after:this.afterInjectedText}:this}dispose(){this._disposables.dispose(),this._styleSheet.unref()}}const WM={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",fontSize:"font-size:{0};",fontFamily:"font-family:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",padding:"padding:{0};",width:"width:{0};",height:"height:{0};",verticalAlign:"vertical-align:{0};"};class VM{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let n=zM.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+zM.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=zM.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=i.onDidColorThemeChange(e=>{this._theme=i.getColorTheme(),this._removeCSS(),this._buildCSS()}):this._themeListener=null}dispose(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)}get hasContent(){return this._hasContent}get hasLetterSpacing(){return this._hasLetterSpacing}get className(){return this._className}_buildCSS(){const e=this._providerArgs.options;let t,i,n;switch(this._ruleType){case 0:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),n=this.getCSSTextForModelDecorationClassName(e.dark);break;case 1:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),n=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case 2:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case 3:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case 4:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;case 5:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case 6:t=this.getCSSTextForModelDecorationContentClassName(e.afterInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.afterInjectedText),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.afterInjectedText);break;default:throw new Error("Unknown rule type: "+this._ruleType)}const o=this._providerArgs.styleSheet;let s=!1;t.length>0&&(o.insertRule(`${this._unThemedSelector} {${t}}`,0),s=!0),i.length>0&&(o.insertRule(`.vs${this._unThemedSelector} {${i}}`,0),s=!0),n.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector} {${n}}`,0),s=!0),this._hasContent=s}_removeCSS(){this._providerArgs.styleSheet.removeRulesContainingSelector(this._unThemedSelector)}getCSSTextForModelDecorationClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")}getCSSTextForModelDecorationInlineClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")}getCSSTextForModelDecorationContentClassName(e){if(!e)return"";const t=[];if("undefined"!==typeof e){if(this.collectBorderSettingsCSSText(e,t),"undefined"!==typeof e.contentIconPath&&t.push(Ds(WM.contentIconPath,ys(ci.revive(e.contentIconPath)))),"string"===typeof e.contentText){const i=e.contentText.match(/^.*$/m)[0],n=i.replace(/['\\]/g,"\\$&");t.push(Ds(WM.contentText,n))}this.collectCSSText(e,["verticalAlign","fontStyle","fontWeight","fontSize","fontFamily","textDecoration","color","opacity","backgroundColor","margin","padding"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")}getCSSTextForModelDecorationGlyphMarginClassName(e){if(!e)return"";const t=[];return"undefined"!==typeof e.gutterIconPath&&(t.push(Ds(WM.gutterIconPath,ys(ci.revive(e.gutterIconPath)))),"undefined"!==typeof e.gutterIconSize&&t.push(Ds(WM.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return!!this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)&&(t.push(Ds("box-sizing: border-box;")),!0)}collectCSSText(e,t,i){const n=i.length;for(let o of t){const t=this.resolveValue(e[o]);"string"===typeof t&&i.push(Ds(WM[o],t))}return i.length!==n}resolveValue(e){if(Wa(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}class zM{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let n=".monaco-editor ."+this.getClassName(e,i);return t&&(n=n+"."+this.getClassName(t,i)),3===i?n+="::before":4===i&&(n+="::after"),n}}var HM=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},KM=function(e,t){return function(i,n){t(i,n,e)}};let jM=class extends RM{constructor(e,t,i){super(e,i),this.onCodeEditorAdd(()=>this._checkContextKey()),this.onCodeEditorRemove(()=>this._checkContextKey()),this._editorIsOpen=t.createKey("editorIsOpen",!1),this._activeCodeEditor=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}openCodeEditor(e,t,i){return t?Promise.resolve(this.doOpenEditor(t,e)):Promise.resolve(null)}doOpenEditor(e,t){const i=this.findModel(e,t.resource);if(!i){if(t.resource){const i=t.resource.scheme;if(i===co.http||i===co.https)return ws(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if("number"===typeof n.endLineNumber&&"number"===typeof n.endColumn)e.setSelection(n),e.revealRangeInCenter(n,1);else{const t={lineNumber:n.startLineNumber,column:n.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}};jM=HM([KM(1,xm),KM(2,jp)],jM);var UM=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},$M=function(e,t){return function(i,n){t(i,n,e)}};let qM=0,GM=!1;function YM(e){if(!e){if(GM)return;GM=!0}Mp(e||document.body)}let XM=class extends GI{constructor(e,t,i,n,o,s,r,a,l,c){const d=Object.assign({},t);d.ariaLabel=d.ariaLabel||ip.editorViewAccessibleLabel,d.ariaLabel=d.ariaLabel+";"+ip.accessibilityHelpMessage,super(e,d,{},i,n,o,s,a,l,c),this._standaloneKeybindingService=r instanceof mp?r:null,YM(d.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;let n="DYNAMIC_"+ ++qM,o=im.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),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"),Ye.None;const t=e.id,i=e.label,n=im.and(im.equals("editorId",this.getId()),im.deserialize(e.precondition)),o=e.keybindings,s=im.and(n,im.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),c=new Ge,d=this.getId()+":"+t;if(c.add(ga.registerCommand(d,l)),r){let e={command:{id:d,title:i},when:n,group:r,order:a};c.add(s_.appendMenuItem(n_.EditorContext,e))}if(Array.isArray(o))for(const u of o)c.add(this._standaloneKeybindingService.addDynamicKeybinding(d,u,l,s));let h=new UN(d,i,i,n,l,this._contextKeyService);return this._actions[t]=h,c.add(qe(()=>{delete this._actions[t]})),c}_triggerCommand(e,t){if(this._codeEditorService instanceof jM)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};XM=UM([$M(2,hn),$M(3,mn),$M(4,ua),$M(5,xm),$M(6,IM),$M(7,jp),$M(8,$m),$M(9,xI)],XM);let ZM=class extends XM{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f){const m=Object.assign({},t);yp(h,m,!1);const p=c.registerEditorContainer(e);"string"===typeof m.theme&&c.setTheme(m.theme),"undefined"!==typeof m.autoDetectHighContrast&&c.setAutoDetectHighContrast(Boolean(m.autoDetectHighContrast));let _,b=m.model;if(delete m.model,super(e,m,n,o,s,r,a,c,d,u),this._contextViewService=l,this._configurationService=h,this._standaloneThemeService=c,this._register(i),this._register(p),"undefined"===typeof b?(_=JM(g,f,m.value||"",m.language||Jk.text,void 0),this._ownsModel=!0):(_=b,this._ownsModel=!1),this._attachModel(_),_){let e={oldModelUrl:null,newModelUrl:_.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){yp(this._configurationService,e,!1),"string"===typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),"undefined"!==typeof e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_attachModel(e){super._attachModel(e),this._modelData&&this._contextViewService.setContainer(this._modelData.view.domNode.domNode)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};ZM=UM([$M(3,hn),$M(4,mn),$M(5,ua),$M(6,xm),$M(7,IM),$M(8,ZT),$M(9,NM),$M(10,$m),$M(11,lh),$M(12,xI),$M(13,Pl),$M(14,Oc)],ZM);let QM=class extends uM{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f){const m=Object.assign({},t);yp(h,m,!0);const p=c.registerEditorContainer(e);"string"===typeof m.theme&&c.setTheme(m.theme),"undefined"!==typeof m.autoDetectHighContrast&&c.setAutoDetectHighContrast(Boolean(m.autoDetectHighContrast)),super(e,m,{},f,a,o,n,l,c,d,u,g),this._contextViewService=r,this._configurationService=h,this._standaloneThemeService=c,this._register(i),this._register(p),this._contextViewService.setContainer(this._containerDomElement)}dispose(){super.dispose()}updateOptions(e){yp(this._configurationService,e,!0),"string"===typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),"undefined"!==typeof e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(XM,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 JM(e,t,i,n,o){if(i=i||"",!n){const n=i.indexOf("\n");let s=i;return-1!==n&&(s=i.substring(0,n)),eO(e,i,t.createByFilepathOrFirstLine(o||null,s),o)}return eO(e,i,t.create(n),o)}function eO(e,t,i,n){return e.createModel(t,i,n)}QM=UM([$M(3,hn),$M(4,xm),$M(5,IM),$M(6,ZT),$M(7,Mc),$M(8,mn),$M(9,NM),$M(10,$m),$M(11,lh),$M(12,QT),$M(13,nM),$M(14,tM)],QM);const tO=Object.prototype.hasOwnProperty;class iO{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Dc,0),this._register(bI,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]||Dc}}class nO extends Ye{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,nO.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new iO,this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(_I.onDidChangeLanguages(e=>{this._initializeFromRegistry()})))}dispose(){nO.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},sL();const e=_I.getLanguages();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=>{let 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})}),zd.as($d.Configuration).registerOverrideIdentifiers(_I.getLanguages().map(e=>e.id)),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;tO.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[]},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(let e of t.extensions)nL({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let a of t.filenames)nL({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(let a of t.filenamePatterns)nL({id:i,mime:n,filepattern:a},this._warnOnOverwrite);if("string"===typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{let t=new RegExp(e);Ps(t)||nL({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(r){xe(r)}}e.aliases.push(i);let o=null;if("undefined"!==typeof t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const a of o)a&&0!==a.length&&e.aliases.push(a);let s=null!==o&&o.length>0;if(s&&null===o[0]);else{let t=(s?o[0]:null)||i;!s&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration)}isRegisteredMode(e){return!!tO.call(this._mimeTypesMap,e)||tO.call(this._languages,e)}getModeIdForLanguageNameLowercase(e){return tO.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e]:null}extractModeIds(e){return e?e.split(",").map(e=>e.trim()).map(e=>tO.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:e).filter(e=>tO.call(this._languages,e)):[]}validateLanguageId(e){return e&&e!==Dc?tO.call(this._languages,e)?e:null:Dc}getModeIdsFromFilepathOrFirstLine(e,t){if(!e&&!t)return[];let i=rL(e,t);return this.extractModeIds(i.join(","))}}nO.instanceCount=0;class oO{constructor(e,t){let i;this._selector=t,this.languageId=this._selector(),this._onDidChange=new rt({onFirstListenerAdd:()=>{i=e(()=>this._evaluate())},onLastListenerRemove:()=>{i.dispose()}}),this.onDidChange=this._onDidChange.event}_evaluate(){const e=this._selector();e!==this.languageId&&(this.languageId=e,this._onDidChange.fire(this.languageId))}}class sO extends Ye{constructor(e=!1){super(),this._onDidEncounterLanguage=this._register(new rt),this.onDidEncounterLanguage=this._onDidEncounterLanguage.event,this._onLanguagesMaybeChanged=this._register(new rt({leakWarningThreshold:200})),this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,sO.instanceCount++,this._encounteredLanguages=new Set,this._registry=this._register(new nO(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onLanguagesMaybeChanged.fire()))}dispose(){sO.instanceCount--,super.dispose()}isRegisteredMode(e){return this._registry.isRegisteredMode(e)}getModeIdForLanguageName(e){return this._registry.getModeIdForLanguageNameLowercase(e)}getModeIdByFilepathOrFirstLine(e,t){const i=this._registry.getModeIdsFromFilepathOrFirstLine(e,t);return Iu(i,null)}getModeId(e){const t=this._registry.extractModeIds(e);return Iu(t,null)}validateLanguageId(e){return this._registry.validateLanguageId(e)}create(e){return new oO(this.onLanguagesMaybeChanged,()=>{const t=this.getModeId(e);return this._createModeAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new oO(this.onLanguagesMaybeChanged,()=>{const i=this.getModeIdByFilepathOrFirstLine(e,t);return this._createModeAndGetLanguageIdentifier(i)})}_createModeAndGetLanguageIdentifier(e){const t=this.validateLanguageId(e||"plaintext")||Dc;return this._getOrCreateMode(t),t}triggerMode(e){const t=this.getModeId(e);this._getOrCreateMode(t||"plaintext")}_getOrCreateMode(e){if(!this._encounteredLanguages.has(e)){this._encounteredLanguages.add(e);const t=this.validateLanguageId(e)||Dc;this._onDidEncounterLanguage.fire(t)}}}sO.instanceCount=0;var rO=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},aO=function(e,t){return function(i,n){t(i,n,e)}};let lO=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._modeService=i,this._logService=n,this._hashTable=new hO,this._hasWarnedOverlappingTokens=!1}getMetadata(e,t,i){const n=this._modeService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,n);let s;if(o)s=o.metadata,this._logService.getLevel()===Vu.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${ql.getForeground(s)}, fontStyle ${ql.getFontStyle(s).toString(2)}`);else{let o=this._legend.tokenTypes[e];const r=[];if(o){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()===Vu.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(o,r,i);if("undefined"===typeof n)s=2147483647;else{if(s=0,"undefined"!==typeof n.italic){const e=(n.italic?1:0)<<11;s|=1|e}if("undefined"!==typeof n.bold){const e=(n.bold?2:0)<<11;s|=2|e}if("undefined"!==typeof n.underline){const e=(n.underline?4:0)<<11;s|=4|e}if(n.foreground){const e=n.foreground<<14;s|=8|e}0===s&&(s=2147483647)}}else this._logService.getLevel()===Vu.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,o="not-in-legend";this._hashTable.add(e,t,n,s),this._logService.getLevel()===Vu.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${o}) / ${t} (${r.join(" ")}): foreground ${ql.getForeground(s)}, fontStyle ${ql.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}};function cO(e,t,i){const n=e.data,o=e.data.length/5|0,s=Math.max(Math.ceil(o/1024),400),r=[];let a=0,l=1,c=0;while(a<o){const e=a;let d=Math.min(e+s,o);if(d<o){let t=d;while(t-1>e&&0===n[5*t])t--;if(t-1===e){let e=d;while(e+1<o&&0===n[5*e])e++;d=e}else d=t}let h=new Uint32Array(4*(d-e)),u=0,g=0,f=0,m=0,p=0;while(a<d){const e=5*a,o=n[e],s=n[e+1],r=l+o|0,d=0===o?c+s|0:s,_=n[e+2],b=n[e+3],v=n[e+4],w=t.getMetadata(b,v,i);2147483647!==w&&(0===g&&(g=r),f===r&&p>d&&(t.warnOverlappingSemanticTokens(r,d+1),m<d?h[u-4+2]=d:u-=4),h[u]=r-g,h[u+1]=d,h[u+2]=d+_,h[u+3]=w,u+=4,f=r,m=d,p=d+_),l=r,c=d,a++}u!==h.length&&(h=h.subarray(0,u));const _=new tw(g,new Jv(h));r.push(_)}return r}lO=rO([aO(1,jp),aO(2,Oc),aO(3,Wu)],lO);class dO{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class hO{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=hO._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<hO._SIZES.length?2/3*this._currentLength:0),this._elements=[],hO._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 o=this._elements[n];while(o){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===i)return o;o=o.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=hO._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<hO._SIZES.length?2/3*this._currentLength:0),this._elements=[],hO._nullOutEntries(this._elements,this._currentLength);for(const t of e){let e=t;while(e){const t=e.next;e.next=null,this._add(e),e=t}}}this._add(new dO(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}}function uO(e){for(let t=0,i=e.length;t<i;t+=4){const i=e[t+0],n=e[t+1],o=e[t+2],s=e[t+3];e[t+0]=s,e[t+1]=o,e[t+2]=n,e[t+3]=i}}function gO(e){const t=new Uint8Array(e.buffer,e.byteOffset,4*e.length);return s["e"]()||uO(t),Br["a"].wrap(t)}function fO(e){const t=new Uint32Array(mO(e));let i=0;if(t[i++]=e.id,"full"===e.type)t[i++]=1,t[i++]=e.data.length,t.set(e.data,i),i+=e.data.length;else{t[i++]=2,t[i++]=e.deltas.length;for(const n of e.deltas)t[i++]=n.start,t[i++]=n.deleteCount,n.data?(t[i++]=n.data.length,t.set(n.data,i),i+=n.data.length):t[i++]=0}return gO(t)}function mO(e){let t=0;if(t+=2,"full"===e.type)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(const i of e.deltas)i.data&&(t+=i.data.length)}return t}hO._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];var pO=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function _O(e){return e&&!!e.data}function bO(e){return e&&Array.isArray(e.edits)}class vO{constructor(e,t){this.provider=e,this.tokens=t}}function wO(e){return Sc.has(e)}function CO(e){const t=Sc.orderedGroups(e);return t.length>0?t[0]:[]}function yO(e,t,i,n){return pO(this,void 0,void 0,(function*(){const o=CO(e),s=yield Promise.all(o.map(o=>pO(this,void 0,void 0,(function*(){let s;try{s=yield o.provideDocumentSemanticTokens(e,o===t?i:null,n)}catch(r){ke(r),s=null}return s&&(_O(s)||bO(s))||(s=null),new vO(o,s)}))));for(const e of s)if(e.tokens)return e;return s.length>0?s[0]:null}))}function SO(e){const t=Sc.orderedGroups(e);return t.length>0?t[0]:null}class xO{constructor(e,t){this.provider=e,this.tokens=t}}function kO(e){const t=xc.orderedGroups(e);return t.length>0?t[0]:[]}function LO(e,t,i){return pO(this,void 0,void 0,(function*(){const n=kO(e),o=yield Promise.all(n.map(n=>pO(this,void 0,void 0,(function*(){let o;try{o=yield n.provideDocumentRangeSemanticTokens(e,t,i)}catch(s){ke(s),o=null}return o&&_O(o)||(o=null),new xO(n,o)}))));for(const e of o)if(e.tokens)return e;return o.length>0?o[0]:null}))}ga.registerCommand("_provideDocumentSemanticTokensLegend",(e,...t)=>pO(void 0,void 0,void 0,(function*(){const[i]=t;na(i instanceof ci);const n=e.get(Pl).getModel(i);if(!n)return;const o=SO(n);return o?o[0].getLegend():e.get(ua).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)}))),ga.registerCommand("_provideDocumentSemanticTokens",(e,...t)=>pO(void 0,void 0,void 0,(function*(){const[i]=t;na(i instanceof ci);const n=e.get(Pl).getModel(i);if(!n)return;if(!wO(n))return e.get(ua).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const o=yield yO(n,null,null,ut.None);if(!o)return;const{provider:s,tokens:r}=o;if(!r||!_O(r))return;const a=fO({id:0,type:"full",data:r.data});return r.resultId&&s.releaseDocumentSemanticTokens(r.resultId),a}))),ga.registerCommand("_provideDocumentRangeSemanticTokensLegend",(e,...t)=>pO(void 0,void 0,void 0,(function*(){const[i,n]=t;na(i instanceof ci);const o=e.get(Pl).getModel(i);if(!o)return;const s=kO(o);if(0===s.length)return;if(1===s.length)return s[0].getLegend();if(!n||!Ci.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const r=yield LO(o,Ci.lift(n),ut.None);return r?r.provider.getLegend():void 0}))),ga.registerCommand("_provideDocumentRangeSemanticTokens",(e,...t)=>pO(void 0,void 0,void 0,(function*(){const[i,n]=t;na(i instanceof ci),na(Ci.isIRange(n));const o=e.get(Pl).getModel(i);if(!o)return;const s=yield LO(o,Ci.lift(n),ut.None);return s&&s.tokens?fO({id:0,type:"full",data:s.tokens.data}):void 0})));var EO=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},DO=function(e,t){return function(i,n){t(i,n,e)}};function NO(e){return e.toString()}function IO(e){const t=new il,i=e.createSnapshot();let n;while(n=i.read())t.update(n);return t.digest()}class TO{constructor(e,t,i){this._modelEventListeners=new Ge,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(t=>i(e,t)))}_disposeLanguageSelection(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null)}dispose(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()}setLanguage(e){this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange(()=>this.model.setMode(e.languageId)),this.model.setMode(e.languageId)}}const MO=s["d"]||s["f"]?1:2;class OO{constructor(e,t,i,n,o,s,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=s,this.versionId=r,this.alternativeVersionId=a}}let AO=class e extends Ye{constructor(e,t,i,n,o,s,r){super(),this._configurationService=e,this._resourcePropertiesService=t,this._themeService=i,this._logService=n,this._undoRedoService=o,this._modeService=s,this._languageConfigurationService=r,this._onModelAdded=this._register(new rt),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new rt),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new rt),this.onModelModeChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._semanticStyling=this._register(new BO(this._themeService,this._modeService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration(()=>this._updateModelOptions())),this._updateModelOptions(),this._register(new FO(this,this._themeService,this._configurationService,this._semanticStyling))}static _readModelOptions(e,t){var i;let n=be.tabSize;if(e.editor&&"undefined"!==typeof e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let o=n;if(e.editor&&"undefined"!==typeof e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(o=t),o<1&&(o=1)}let s=be.insertSpaces;e.editor&&"undefined"!==typeof e.editor.insertSpaces&&(s="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let r=MO;const a=e.eol;"\r\n"===a?r=2:"\n"===a&&(r=1);let l=be.trimAutoWhitespace;e.editor&&"undefined"!==typeof e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let c=be.detectIndentation;e.editor&&"undefined"!==typeof e.editor.detectIndentation&&(c="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let d=be.largeFileOptimizations;e.editor&&"undefined"!==typeof e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let h=be.bracketPairColorizationOptions;return(null===(i=e.editor)||void 0===i?void 0:i.bracketPairColorization)&&"object"===typeof e.editor.bracketPairColorization&&(h={enabled:!!e.editor.bracketPairColorization.enabled}),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:s,detectIndentation:c,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_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===s["a"]||2===s["a"]?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!==typeof e||e}getCreationOptions(t,i,n){let o=this._modelCreationOptionsByLanguageAndResource[t+i];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:t,resource:i}),r=this._getEOL(i,t);o=e._readModelOptions({editor:s,eol:r},n),this._modelCreationOptionsByLanguageAndResource[t+i]=o}return o}_updateModelOptions(){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=i.length;n<o;n++){const o=i[n],s=this._models[o],r=s.model.getLanguageId(),a=s.model.uri,l=t[r+a],c=this.getCreationOptions(r,a,s.model.isForSimpleWidget);e._setModelOptionsForModel(s.model,c,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&&Na(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(NO(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(NO(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(NO(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];this._disposedModels.forEach(e=>{e.sharesUndoRedoStack||t.push(e)}),t.sort((e,t)=>e.time-t.time);while(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 o=this.getCreationOptions(t,i,n),s=new ak(e,o,t,i,this._undoRedoService,this._modeService,this._languageConfigurationService);if(i&&this._disposedModels.has(NO(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=IO(s)===e.sha1;if(n||e.sharesUndoRedoStack){for(const e of t.past)Db(e)&&e.matchesResource(i)&&e.setModel(s);for(const e of t.future)Db(e)&&e.matchesResource(i)&&e.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,e=>Db(e)&&e.matchesResource(i)),n&&(s._overwriteVersionId(e.versionId),s._overwriteAlternativeVersionId(e.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=NO(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new TO(s,e=>this._onWillDispose(e),(e,t)=>this._onDidChangeLanguage(e,t));return this._models[r]=a,a}createModel(e,t,i,n=!1){let o;return t?(o=this._createModelData(e,t.languageId,i,n),this.setMode(o.model,t)):o=this._createModelData(e,bI,i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const i=this._models[NO(e.uri)];i&&i.setLanguage(t)}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=NO(e),i=this._models[t];return i?i.model:null}getSemanticTokensProviderStyling(e){return this._semanticStyling.get(e)}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===co.file||e.scheme===co.vscodeRemote||e.scheme===co.userData||e.scheme===co.vscodeNotebookCell||"fake-fs"===e.scheme}_onWillDispose(t){const i=NO(t.uri),n=this._models[i],o=this._undoRedoService.getUriComparisonKey(t.uri)!==t.uri.toString();let s=!1,r=0;if(o||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(t.uri)){const e=this._undoRedoService.getElements(t.uri);if(e.past.length>0||e.future.length>0){for(const i of e.past)Db(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri));for(const i of e.future)Db(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri))}}const a=e.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;if(s)if(!o&&r>a){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(t.uri,!1,e=>Db(e)&&e.matchesResource(t.uri)),this._insertDisposedModel(new OO(t.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,r,IO(t),t.getVersionId(),t.getAlternativeVersionId()));else if(!o){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[i],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[t.getLanguageId()+t.uri],this._onModelRemoved.fire(t)}_onDidChangeLanguage(t,i){const n=i.oldLanguage,o=t.getLanguageId(),s=this.getCreationOptions(n,t.uri,t.isForSimpleWidget),r=this.getCreationOptions(o,t.uri,t.isForSimpleWidget);e._setModelOptionsForModel(t,r,s),this._onModelModeChanged.fire({model:t,oldModeId:n})}};AO.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,AO=EO([DO(0,lh),DO(1,vu),DO(2,jp),DO(3,Wu),DO(4,Ew),DO(5,Oc),DO(6,Sh)],AO);const PO="editor.semanticHighlighting";function RO(e,t,i){var n;const o=null===(n=i.getValue(PO,{overrideIdentifier:e.getLanguageId(),resource:e.uri}))||void 0===n?void 0:n.enabled;return"boolean"===typeof o?o:t.getColorTheme().semanticHighlighting}class FO extends Ye{constructor(e,t,i,n){super(),this._watchers=Object.create(null),this._semanticStyling=n;const o=e=>{this._watchers[e.uri.toString()]=new VO(e,t,this._semanticStyling)},s=(e,t)=>{t.dispose(),delete this._watchers[e.uri.toString()]},r=()=>{for(let n of e.getModels()){const e=this._watchers[n.uri.toString()];RO(n,t,i)?e||o(n):e&&s(n,e)}};this._register(e.onModelAdded(e=>{RO(e,t,i)&&o(e)})),this._register(e.onModelRemoved(e=>{const t=this._watchers[e.uri.toString()];t&&s(e,t)})),this._register(i.onDidChangeConfiguration(e=>{e.affectsConfiguration(PO)&&r()})),this._register(t.onDidColorThemeChange(r))}}class BO extends Ye{constructor(e,t,i){super(),this._themeService=e,this._modeService=t,this._logService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}get(e){return this._caches.has(e)||this._caches.set(e,new lO(e.getLegend(),this._themeService,this._modeService,this._logService)),this._caches.get(e)}}class WO{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}class VO extends Ye{constructor(e,t,i){super(),this._isDisposed=!1,this._model=e,this._semanticStyling=i,this._fetchDocumentSemanticTokens=this._register(new so(()=>this._fetchDocumentSemanticTokensNow(),VO.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule()})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const n=()=>{Ue(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const t of Sc.all(e))"function"===typeof t.onDidChange&&this._documentProvidersChangeListeners.push(t.onDidChange(()=>this._fetchDocumentSemanticTokens.schedule(0)))};n(),this._register(Sc.onDidChange(()=>{n(),this._fetchDocumentSemanticTokens.schedule()})),this._register(t.onDidColorThemeChange(e=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule()})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!wO(this._model))return void(this._currentDocumentResponse&&this._model.setSemanticTokens(null,!1));const e=new ft,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=yO(this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e;const o=[],s=this._model.onDidChangeContent(e=>{o.push(e)});n.then(e=>{if(this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),e){const{provider:t,tokens:i}=e,n=this._semanticStyling.get(t);this._setDocumentSemanticTokens(t,i||null,n,o)}else this._setDocumentSemanticTokens(null,null,null,o)},e=>{const t=e&&(De(e)||"string"===typeof e.message&&-1!==e.message.indexOf("busy"));t||xe(e),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),o.length>0&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule())})}static _copy(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}_setDocumentSemanticTokens(e,t,i,n){const o=this._currentDocumentResponse,s=()=>{n.length>0&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule()};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed)e&&t&&e.releaseDocumentSemanticTokens(t.resultId);else if(e&&i){if(!t)return this._model.setSemanticTokens(null,!0),void s();if(bO(t)){if(!o)return void this._model.setSemanticTokens(null,!0);if(0===t.edits.length)t={resultId:t.resultId,data:o.data};else{let e=0;for(const o of t.edits)e+=(o.data?o.data.length:0)-o.deleteCount;const i=o.data,n=new Uint32Array(i.length+e);let s=i.length,r=n.length;for(let o=t.edits.length-1;o>=0;o--){const e=t.edits[o],a=s-(e.start+e.deleteCount);a>0&&(VO._copy(i,s-a,n,r-a,a),r-=a),e.data&&(VO._copy(e.data,0,n,r-e.data.length,e.data.length),r-=e.data.length),s=e.start}s>0&&VO._copy(i,0,n,0,s),t={resultId:t.resultId,data:n}}}if(_O(t)){this._currentDocumentResponse=new WO(e,t.resultId,t.data);const o=cO(t,i,this._model.getLanguageId());if(n.length>0)for(const e of n)for(const t of o)for(const i of e.changes)t.applyEdit(i.range,i.text);this._model.setSemanticTokens(o,!0)}else this._model.setSemanticTokens(null,!0);s()}else this._model.setSemanticTokens(null,!1)}}VO.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY=300;class zO{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}function HO(e){if(!e||!Array.isArray(e))return[];let t=[],i=0;for(let n=0,o=e.length;n<o;n++){let o=e[n],s=-1;if("string"===typeof o.fontStyle){s=0;let e=o.fontStyle.split(" ");for(let t=0,i=e.length;t<i;t++){let i=e[t];switch(i){case"italic":s|=1;break;case"bold":s|=2;break;case"underline":s|=4;break}}}let r=null;"string"===typeof o.foreground&&(r=o.foreground);let a=null;"string"===typeof o.background&&(a=o.background),t[i++]=new zO(o.token||"",n,s,r,a)}return t}function KO(e,t){e.sort((e,t)=>{let i=YO(e.token,t.token);return 0!==i?i:e.index-t.index});let i=0,n="000000",o="ffffff";while(e.length>=1&&""===e[0].token){let t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(o=t.background)}let s=new UO;for(let d of t)s.getId(d);let r=s.getId(n),a=s.getId(o),l=new XO(i,r,a),c=new ZO(l);for(let d=0,h=e.length;d<h;d++){let t=e[d];c.insert(t.token,t.fontStyle,s.getId(t.foreground),s.getId(t.background))}return new $O(s,c)}const jO=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class UO{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(jO);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]=Lw.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class $O{constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(HO(e),t)}static createFromParsedTokenTheme(e,t){return KO(e,t)}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if("undefined"===typeof i){let e=this._match(t),n=GO(t);i=(e.metadata|n<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const qO=/\b(comment|string|regex|regexp)\b/;function GO(e){let t=e.match(qO);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 4;case"regexp":return 4}throw new Error("Unexpected match for standard token type!")}function YO(e,t){return e<t?-1:e>t?1:0}class XO{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}clone(){return new XO(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<<14|this._background<<23)>>>0}}class ZO{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;let t,i,n=e.indexOf(".");-1===n?(t=e,i=""):(t=e.substring(0,n),i=e.substring(n+1));let o=this._children.get(t);return"undefined"!==typeof o?o.match(i):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);let o,s,r=e.indexOf(".");-1===r?(o=e,s=""):(o=e.substring(0,r),s=e.substring(r+1));let a=this._children.get(o);"undefined"===typeof a&&(a=new ZO(this._mainRule.clone()),this._children.set(o,a)),a.insert(s,t,i,n)}}function QO(e){let t=[];for(let i=1,n=e.length;i<n;i++){let 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.join("\n")}const JO={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:{[My]:"#FFFFFE",[Oy]:"#000000",[Gy]:"#E5EBF1",[gx]:"#D3D3D3",[fx]:"#939393",[Yy]:"#ADD6FF4D"}},eA={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:{[My]:"#1E1E1E",[Oy]:"#D4D4D4",[Gy]:"#3A3D41",[gx]:"#404040",[fx]:"#707070",[Yy]:"#ADD6FF26"}},tA={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:{[My]:"#000000",[Oy]:"#FFFFFF",[gx]:"#FFFFFF",[fx]:"#FFFFFF"}};function iA(){const e=new rt,t=MT();return t.onDidChange(()=>e.fire()),{onDidChange:e.event,getCSS(){const e={},i=i=>{let n=i.defaults;while($p.isThemeIcon(n)){const e=t.getIcon(n.id);if(!e)return;n=e.defaults}const o=n.fontId;if(o){const s=t.getIconFont(o);if(s)return e[o]=s,`.codicon-${i.id}:before { content: '${n.fontCharacter}'; font-family: ${Ss(o)}; }`}return`.codicon-${i.id}:before { content: '${n.fontCharacter}'; }`},n=[];for(let o of t.getIcons()){const e=i(o);e&&n.push(e)}for(let t in e){const i=e[t],o=i.definition.src.map(e=>`${ys(e.location)} format('${e.format}')`).join(", ");n.push(`@font-face { src: ${o}; font-family: ${Ss(t)}; font-display: block; }`)}return n.join("\n")}}}const nA="vs",oA="vs-dark",sA="hc-black",rA=zd.as(HC.ColorContribution),aA=zd.as(Yp.ThemingContribution);class lA{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;let i=t.base;e.length>0?(cA(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(let t in this.themeData.colors)e.set(t,Lw.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){let t=dA(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,Lw.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=rA.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case nA:return Fp.LIGHT;case sA:return Fp.HIGH_CONTRAST;default:return Fp.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){let i=dA(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=$O.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")),o=n.metadata,s=ql.getForeground(o),r=ql.getFontStyle(o);return{foreground:s,italic:Boolean(1&r),bold:Boolean(2&r),underline:Boolean(4&r)}}}function cA(e){return e===nA||e===oA||e===sA}function dA(e){switch(e){case nA:return JO;case oA:return eA;case sA:return tA}}function hA(e){let t=dA(e);return new lA(e,t)}class uA extends Ye{constructor(){super(),this._onColorThemeChange=this._register(new rt),this.onDidColorThemeChange=this._onColorThemeChange.event,this._environment=Object.create(null),this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(nA,hA(nA)),this._knownThemes.set(oA,hA(oA)),this._knownThemes.set(sA,hA(sA));const e=iA();this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(nA),e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}),ks("(forced-colors: active)",()=>{this._updateActualTheme()})}registerEditorContainer(e){return Go(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Zo(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),Ye.None}_registerShadowDomContainer(e){const t=Zo(e);return t.className="monaco-colors",t.textContent=this._allCSS,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(!cA(t.base)&&!cA(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new lA(e,t)),cA(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(nA),this._desiredTheme=t,this._updateActualTheme()}_updateActualTheme(){const e=this._autoDetectHighContrast&&window.matchMedia("(forced-colors: active)").matches?this._knownThemes.get(sA):this._desiredTheme;this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._updateActualTheme()}_updateThemeOrColorMap(){let e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};aA.getThemingParticipants().forEach(e=>e(this._theme,i,this._environment));const n=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(QO(n)),this._themeCSS=e.join("\n"),this._updateCSS(),kc.setColorMap(n),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}}}var gA=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},fA=function(e,t){return function(i,n){t(i,n,e)}};const mA="data-keybinding-context";class pA{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value["_contextId"]=e}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"undefined"===typeof t&&this._parent?this._parent.getValue(e):t}}class _A extends pA{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}_A.INSTANCE=new _A;class bA extends pA{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Or.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(e=>{if(6===e.source){const e=Array.from(Ae.map(this._values,([e])=>e));this._values.clear(),i.fire(new CA(e))}else{const t=[];for(const i of e.affectedKeys){const e="config."+i,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...Ae.map(n,([e])=>e)),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new CA(t))}})}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(bA._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(bA._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)}}bA._keyPrefix="config.";class vA{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){"undefined"===typeof this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class wA{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}}class CA{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}}class yA{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}}class SA{constructor(e){this._onDidChangeContext=new at({merge:e=>new yA(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 vA(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 kA(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId),i=Im.contextMatchesRules(t,e);return i}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 wA(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new wA(e))}getContext(e){return this._isDisposed?_A.INSTANCE:this.getContextValuesContainer(LA(e))}}let xA=class extends SA{constructor(e){super(0),this._contexts=new Map,this._toDispose=new Ge,this._lastContextId=0;const t=new bA(this._myContextId,e,this._onDidChangeContext);this._contexts.set(this._myContextId,t),this._toDispose.add(t)}dispose(){this._onDidChangeContext.dispose(),this._isDisposed=!0,this._toDispose.dispose()}getContextValuesContainer(e){return this._isDisposed?_A.INSTANCE:this._contexts.get(e)||_A.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");let t=++this._lastContextId;return this._contexts.set(t,new pA(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};xA=gA([fA(0,lh)],xA);class kA extends SA{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new Xe,this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(mA)){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(mA,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(this._onDidChangeContext.fire,this._onDidChangeContext)}dispose(){this._isDisposed||(this._onDidChangeContext.dispose(),this._parent.disposeContext(this._myContextId),this._parentChangeListener.dispose(),this._domNode.removeAttribute(mA),this._isDisposed=!0)}getContextValuesContainer(e){return this._isDisposed?_A.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)}}function LA(e){while(e){if(e.hasAttribute(mA)){const t=e.getAttribute(mA);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}ga.registerCommand(km,(function(e,t,i){e.get(xm).createKey(String(t),i)})),ga.registerCommand({id:"getContextKeyInfo",handler(){return[...Sm.all()].sort((e,t)=>e.key.localeCompare(t.key))},description:{description:o("getContextKeyInfo","A command that returns information about context keys"),args:[]}}),ga.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(let i of Sm.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))}));var EA;i("c3b4"),i("6d8f");function DA(e){let t=e.definition;while(t instanceof Ul)t=t.definition;return`.codicon-${e.id}:before { content: '${t.fontCharacter}'; }`}(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}function n(e,n){return!i(t(e,n))}function o(e,t){const n=[],o={start:e.start,end:Math.min(t.start,e.end)},s={start:Math.max(t.end,e.start),end:e.end};return i(o)||n.push(o),i(s)||n.push(s),n}e.intersect=t,e.isEmpty=i,e.intersects=n,e.relativeComplement=o})(EA||(EA={}));var NA;i("f743");function IA(e,t,i){const n=i.mode===NA.ALIGN?i.offset:i.offset+i.size,o=i.mode===NA.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=o?o-t:Math.max(e-t,0):t<=o?o-t:t<=e-n?n:0}(function(e){e[e["AVOID"]=0]="AVOID",e[e["ALIGN"]=1]="ALIGN"})(NA||(NA={}));class TA extends Ye{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Ye.None,this.toDisposeOnSetContainer=Ye.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=ms(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,_s(this.view),this.setContainer(e,t),this._register(qe(()=>this.setContainer(null,1)))}setContainer(e,t){var i;if(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.useFixedPosition=1!==t,this.useShadowDOM=3===t,this.useShadowDOM){this.shadowRootHostElement=ms(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=MA,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(ms("slot"))}else this.container.appendChild(this.view);const i=new Ge;TA.BUBBLE_UP_EVENTS.forEach(e=>{i.add(Co(this.container,e,e=>{this.onDOMEvent(e,!1)}))}),TA.BUBBLE_DOWN_EVENTS.forEach(e=>{i.add(Co(this.container,e,e=>{this.onDOMEvent(e,!0)},!0))}),this.toDisposeOnSetContainer=i}}show(e){this.isVisible()&&this.hide(),mo(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2500",this.view.style.position=this.useFixedPosition?"fixed":"absolute",ps(this.view),this.toDisposeOnClean=e.render(this.view)||Ye.None,this.delegate=e,this.doLayout(),this.delegate.focus&&this.delegate.focus()}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||s["c"]&&In.pointerEvents?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;let e,t=this.delegate.getAnchor();if(ns(t)){let i=Bo(t);e={top:i.top,left:i.left,width:i.width,height:i.height}}else e={top:t.y,left:t.x,width:t.width||1,height:t.height||2};const i=Vo(this.view),n=Ko(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,r=this.delegate.anchorAxisAlignment||0;let a,l;if(0===r){const t={offset:e.top-window.pageYOffset,size:e.height,position:0===o?0:1},r={offset:e.left,size:e.width,position:0===s?0:1,mode:NA.ALIGN};a=IA(window.innerHeight,n,t)+window.pageYOffset,EA.intersects({start:a,end:a+n},{start:t.offset,end:t.offset+t.size})&&(r.mode=NA.AVOID),l=IA(window.innerWidth,i,r)}else{const t={offset:e.left,size:e.width,position:0===s?0:1},r={offset:e.top,size:e.height,position:0===o?0:1,mode:NA.ALIGN};l=IA(window.innerWidth,i,t),EA.intersects({start:l,end:l+i},{start:t.offset,end:t.offset+t.size})&&(r.mode=NA.AVOID),a=IA(window.innerHeight,n,r)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===o?"bottom":"top"),this.view.classList.add(0===s?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const c=Bo(this.container);this.view.style.top=a-(this.useFixedPosition?Bo(this.view).top:c.top)+"px",this.view.style.left=l-(this.useFixedPosition?Bo(this.view).left:c.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null===t||void 0===t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),_s(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!jo(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}TA.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],TA.BUBBLE_DOWN_EVENTS=["click"];let MA='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t@font-face {\n\t\tfont-family: "codicon";\n\t\tfont-display: block;\n\t\tsrc: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");\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';function OA(...e){return function(t,i){for(let n=0,o=e.length;n<o;n++){const o=e[n](t,i);if(o)return o}return null}}const AA=PA.bind(void 0,!0);function PA(e,t,i){if(!i||i.length<t.length)return null;let n;return n=e?Gs(i,t):0===i.indexOf(t),n?t.length>0?[{start:0,end:t.length}]:[]:null}function RA(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]}function FA(e,t){return BA(e.toLowerCase(),t.toLowerCase(),0,0)}function BA(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let o=null;return(o=BA(e,t,i+1,n+1))?UA({start:n,end:n+1},o):null}return BA(e,t,i,n+1)}function WA(e){return 97<=e&&e<=122}function VA(e){return 65<=e&&e<=90}function zA(e){return 48<=e&&e<=57}function HA(e){return 32===e||9===e||10===e||13===e}const KA=new Set;function jA(e){return WA(e)||VA(e)||zA(e)}function UA(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function $A(e,t){for(let i=t;i<e.length;i++){const t=e.charCodeAt(i);if(VA(t)||zA(t)||i>0&&!jA(e.charCodeAt(i-1)))return i}return e.length}function qA(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let o=null,s=n+1;o=qA(e,t,i+1,n+1);while(!o&&(s=$A(t,s))<t.length)o=qA(e,t,i+1,s),s++;return null===o?null:UA({start:n,end:n+1},o)}}function GA(e){let t=0,i=0,n=0,o=0,s=0;for(let d=0;d<e.length;d++)s=e.charCodeAt(d),VA(s)&&t++,WA(s)&&i++,jA(s)&&n++,zA(s)&&o++;const r=t/e.length,a=i/e.length,l=n/e.length,c=o/e.length;return{upperPercent:r,lowerPercent:a,alphaPercent:l,numericPercent:c}}function YA(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}function XA(e){const{upperPercent:t,lowerPercent:i,alphaPercent:n,numericPercent:o}=e;return i>.2&&t<.8&&n>.6&&o<.2}function ZA(e){let t=0,i=0,n=0,o=0;for(let s=0;s<e.length;s++)n=e.charCodeAt(s),VA(n)&&t++,WA(n)&&i++,HA(n)&&o++;return 0!==t&&0!==i||0!==o?t<=5:e.length<=30}function QA(e,t){if(!t)return null;if(t=t.trim(),0===t.length)return null;if(!ZA(e))return null;if(t.length>60)return null;const i=GA(t);if(!XA(i)){if(!YA(i))return null;t=t.toLowerCase()}let n=null,o=0;e=e.toLowerCase();while(o<t.length&&null===(n=qA(e,t,0,o)))o=$A(t,o+1);return n}"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?".split("").forEach(e=>KA.add(e.charCodeAt(0)));const JA=OA(AA,QA,RA),eP=OA(AA,QA,FA),tP=new Fr(1e4);function iP(e,t,i=!1){if("string"!==typeof e||"string"!==typeof t)return null;let n=tP.get(e);n||(n=new RegExp(Os(e),"i"),tP.set(e,n));const o=n.exec(t);return o?[{start:o.index,end:o.index+o[0].length}]:i?eP(e,t):JA(e,t)}const nP=128;function oP(){const e=[],t=[];for(let i=0;i<=nP;i++)t[i]=0;for(let i=0;i<=nP;i++)e.push(t.slice(0));return e}function sP(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const rP=sP(2*nP),aP=sP(2*nP),lP=oP(),cP=oP(),dP=oP(),hP=!1;function uP(e,t,i,n,o){function s(e,t,i=" "){while(e.length<t)e=i+e;return e}let r=` | |${n.split("").map(e=>s(e,3)).join("|")}\n`;for(let a=0;a<=i;a++)r+=0===a?" |":t[a-1]+"|",r+=e[a].slice(0,o+1).map(e=>s(e.toString(),3)).join("|")+"\n";return r}function gP(e,t,i,n){e=e.substr(t),i=i.substr(n),console.log(uP(cP,e,e.length,i,i.length)),console.log(uP(dP,e,e.length,i,i.length)),console.log(uP(lP,e,e.length,i,i.length))}function fP(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 40:case 91:return!0;case void 0:return!1;default:return!!fr(i)}}function mP(e,t){if(t<0||t>=e.length)return!1;const i=e.charCodeAt(t);switch(i){case 32:case 9:return!0;default:return!1}}function pP(e,t,i){return t[e]!==i[e]}function _P(e,t,i,n,o,s,r=!1){while(t<i&&o<s)e[t]===n[o]&&(r&&(rP[t]=o),t+=1),o+=1;return t===i}var bP;function vP(e,t,i,n,o,s,r){const a=e.length>nP?nP:e.length,l=n.length>nP?nP:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!_P(t,i,a,o,s,l,!0))return;wP(a,l,i,s,t,o);let c=1,d=1,h=i,u=s;const g=[!1];for(c=1,h=i;h<a;c++,h++){const r=rP[h],f=aP[h],m=h+1<a?aP[h+1]:l;for(d=r-s+1,u=r;u<m;d++,u++){let a=Number.MIN_SAFE_INTEGER,m=!1;u<=f&&(a=CP(e,t,h,i,n,o,u,l,s,0===lP[c-1][d-1],g));let p=0;a!==Number.MAX_SAFE_INTEGER&&(m=!0,p=a+cP[c-1][d-1]);const _=u>r,b=_?cP[c][d-1]+(lP[c][d-1]>0?-5:0):0,v=u>r+1&&lP[c][d-1]>0,w=v?cP[c][d-2]+(lP[c][d-2]>0?-5:0):0;if(v&&(!_||w>=b)&&(!m||w>=p))cP[c][d]=w,dP[c][d]=3,lP[c][d]=0;else if(_&&(!m||b>=p))cP[c][d]=b,dP[c][d]=2,lP[c][d]=0;else{if(!m)throw new Error("not possible");cP[c][d]=p,dP[c][d]=1,lP[c][d]=lP[c-1][d-1]+1}}}if(hP&&gP(e,i,n,s),!g[0]&&!r)return;c--,d--;const f=[cP[c][d],s];let m=0,p=0;while(c>=1){let e=d;do{const t=dP[c][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+c-1]===o[s+d-1]&&!pP(e+s-1,n,o)&&m+1>lP[c][e]&&(e=d),e===d?m++:m=1,p||(p=e),c--,d=e-1,f.push(d)}l===a&&(f[0]+=2);const _=p-a;return f[0]-=_,f}function wP(e,t,i,n,o,s){let r=e-1,a=t-1;while(r>=i&&a>=n)o[r]===s[a]&&(aP[r]=a,r--),a--}function CP(e,t,i,n,o,s,r,a,l,c,d){if(t[i]!==s[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===i-n?h=e[i]===o[r]?7:5:!pP(r,o,s)||0!==r&&pP(r-1,o,s)?!fP(s,r)||0!==r&&fP(s,r-1)?(fP(s,r-1)||mP(s,r-1))&&(h=5,u=!0):h=5:(h=e[i]===o[r]?7:5,u=!0),h>1&&i===n&&(d[0]=!0),u||(u=pP(r,o,s)||fP(s,r-1)||mP(s,r-1)),i===n?r>l&&(h-=u?3:5):h+=c?u?2:0:u?0:1,r+1===a&&(h-=u?3:5),h}(function(e){function t(e){return!e||2===e.length&&-100===e[0]&&0===e[1]}e.Default=[-100,0],e.isDefault=t})(bP||(bP={}));const yP="$(",SP=new RegExp(`\\$\\(${$l.iconNameExpression}(?:${$l.iconModifierExpression})?\\)`,"g"),xP=new RegExp("(\\\\)?"+SP.source,"g");function kP(e){return e.replace(xP,(e,t)=>t?e:"\\"+e)}new RegExp("\\\\"+SP.source,"g");const LP=new RegExp(`(\\s)?(\\\\)?${SP.source}(\\s)?`,"g");function EP(e){return-1===e.indexOf(yP)?e:e.replace(LP,(e,t,i,n)=>i?e:t||n||"")}function DP(e){const t=e.indexOf(yP);return-1===t?{text:e}:NP(e,t)}function NP(e,t){const i=[];let n="";function o(e){if(e){n+=e;for(const t of e)i.push(c)}}let s,r,a=-1,l="",c=0,d=t;const h=e.length;o(e.substr(0,t));while(d<h){if(s=e[d],r=e[d+1],s===yP[0]&&r===yP[1])a=d,o(l),l=yP,d++;else if(")"===s&&-1!==a){const e=d-a+1;c+=e,a=-1,l=""}else-1!==a?/^[a-z0-9\-]$/i.test(s)?l+=s:(o(l),a=-1,l=""):o(s);d++}return o(l),{text:n,iconOffsets:i}}function IP(e,t,i=!1){const{text:n,iconOffsets:o}=t;if(!o||0===o.length)return iP(e,n,i);const s=Ts(n," "),r=n.length-s.length,a=iP(e,s,i);if(a)for(const l of a){const e=o[l.start+r]+r;l.start+=e,l.end+=e}return a}const TP=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,MP=/(&)?(&)([^\s&])/g,OP=Kl("menu-selection",Ul.check),AP=Kl("menu-submenu",Ul.chevronRight);var PP;(function(e){e[e["Right"]=0]="Right",e[e["Left"]=1]="Left"})(PP||(PP={}));class RP extends ET{constructor(e,t,i={}){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const n=document.createElement("div");n.classList.add("monaco-menu"),n.setAttribute("role","presentation"),super(n,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...s["f"]||s["d"]?[10]:[]],keyDown:!0}}),this.menuElement=n,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Ge),this.initializeStyleSheet(e),this._register(V_.addTarget(n)),bo(n,os.KEY_DOWN,e=>{const t=new Hn(e);t.equals(2)&&e.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(bo(n,os.KEY_DOWN,e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){ss.stop(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof BP&&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)}}})),s["d"]&&this._register(bo(n,os.KEY_DOWN,e=>{const t=new Hn(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),ss.stop(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),ss.stop(e,!0))})),this._register(bo(this.domNode,os.MOUSE_OUT,e=>{let t=e.relatedTarget;jo(t,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())})),this._register(bo(this.actionsList,os.MOUSE_OVER,e=>{let t=e.target;if(t&&jo(t,this.actionsList)&&t!==this.actionsList){while(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(V_.addTarget(this.actionsList)),this._register(bo(this.actionsList,B_.Tap,e=>{let t=e.initialTarget;if(t&&jo(t,this.actionsList)&&t!==this.actionsList){while(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()}}}));let o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new aD(n,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this._register(bo(n,B_.Change,e=>{ss.stop(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})})),this._register(bo(r,os.MOUSE_UP,e=>{e.preventDefault()})),n.style.maxHeight=Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)+"px",t=t.filter(e=>{var t;return!(null===(t=i.submenuIds)||void 0===t?void 0:t.has(e.id))||(console.warn("Found submenu cycle: "+e.id),!1)}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(e=>!(e instanceof WP)).forEach((e,t,i)=>{e.updatePositionInSet(t+1,i.length)})}initializeStyleSheet(e){Go(e)?(this.styleSheet=Zo(e),this.styleSheet.textContent=zP):(RP.globalStyleSheet||(RP.globalStyleSheet=Zo(),RP.globalStyleSheet.textContent=zP),this.styleSheet=RP.globalStyleSheet)}style(e){const t=this.getContainer(),i=e.foregroundColor?""+e.foregroundColor:"",n=e.backgroundColor?""+e.backgroundColor:"",o=e.borderColor?"1px solid "+e.borderColor:"",s=e.shadowColor?"0 2px 4px "+e.shadowColor:"";t.style.border=o,this.domNode.style.color=i,this.domNode.style.backgroundColor=n,t.style.boxShadow=s,this.viewItems&&this.viewItems.forEach(t=>{(t instanceof FP||t instanceof WP)&&t.style(e)})}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++){let i=this.actionsList.children[t];if(e===i){this.focusedItem=t;break}}}updateFocus(e){super.updateFocus(e,!0),"undefined"!==typeof this.focusedItem&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof zp)return new WP(t.context,e,{icon:!0});if(e instanceof Hp){const n=new BP(e,e.actions,i,Object.assign(Object.assign({},t),{submenuIds:new Set([...t.submenuIds||[],e.id])}));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 FP(t.context,e,i);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 FP extends xT{constructor(e,t,i={}){if(i.isMenu=!0,super(t,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="",this.options.label&&i.enableMnemonics){let e=this.getAction().label;if(e){let t=TP.exec(e);t&&(this.mnemonic=(t[1]?t[1]:t[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new so(()=>{this.element&&(this._register(bo(this.element,os.MOUSE_UP,e=>{if(ss.stop(e,!0),Sn){const t=new qn(e);if(t.rightButton)return;this.onClick(e)}else setTimeout(()=>{this.onClick(e)},0)})),this._register(bo(this.element,os.CONTEXT_MENU,e=>{ss.stop(e,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=ds(this.element,ms("a.action-menu-item")),this._action.id===zp.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",""+this.mnemonic)),this.check=ds(this.item,ms("span.menu-item-check"+OP.cssSelector)),this.check.setAttribute("role","none"),this.label=ds(this.item,ms("span.action-label")),this.options.label&&this.options.keybinding&&(ds(this.item,ms("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item&&this.item.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",""+e),this.item.setAttribute("aria-setsize",""+t))}updateLabel(){if(this.label&&this.options.label){mo(this.label);let e=EP(this.getAction().label);if(e){const t=VP(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=TP.exec(e);if(i){e=Ns(e),MP.lastIndex=0;let t=MP.exec(e);while(t&&t[1])t=MP.exec(e);const n=e=>e.replace(/&&/g,"&");t?this.label.append(Ts(n(e.substr(0,t.index))," "),ms("u",{"aria-hidden":"true"},t[3]),Ms(n(e.substr(t.index+t[0].length))," ")):this.label.innerText=n(e).trim(),this.item&&this.item.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=o({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&this.item&&(this.item.title=e)}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.getAction().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.getAction().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.getAction().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(){if(!this.menuStyle)return;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?"thin solid "+this.menuStyle.selectionBorderColor:"";this.item&&(this.item.style.color=t?t.toString():"",this.item.style.backgroundColor=i?i.toString():""),this.check&&(this.check.style.color=t?t.toString():""),this.container&&(this.container.style.border=n)}style(e){this.menuStyle=e,this.applyStyle()}}class BP extends FP{constructor(e,t,i,n){super(e,e,n),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new Ge),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:PP.Right,this.showScheduler=new so(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new so(()=>{this.element&&!jo(Xo(),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=ds(this.item,ms("span.submenu-indicator"+AP.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(bo(this.element,os.KEY_UP,e=>{let t=new Hn(e);(t.equals(17)||t.equals(3))&&(ss.stop(e,!0),this.createSubmenu(!0))})),this._register(bo(this.element,os.KEY_DOWN,e=>{let t=new Hn(e);Xo()===this.item&&(t.equals(17)||t.equals(3))&&ss.stop(e,!0)})),this._register(bo(this.element,os.MOUSE_OVER,e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(bo(this.element,os.MOUSE_LEAVE,e=>{this.mouseOver=!1})),this._register(bo(this.element,os.FOCUS_OUT,e=>{this.element&&!jo(Xo(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)})))}updateEnabled(){}onClick(e){ss.stop(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(t){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0};return o.left=IA(e.width,t.width,{position:n===PP.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(o.left=i.left+10),i.top+=10,i.height=0),o.top=IA(e.height,t.height,{position:0,offset:i.top,size:0}),o.top+t.height===i.top&&o.top+i.height+t.height<=e.height&&(o.top+=i.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=ds(this.element,ms("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=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 RP(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new Kp],this.submenuOptions),this.menuStyle&&this.parentData.submenu.style(this.menuStyle);const n=this.element.getBoundingClientRect(),o={top:n.top-i,left:n.left,height:n.height+2*i,width:n.width},s=this.submenuContainer.getBoundingClientRect(),{top:r,left:a}=this.calculateSubmenuMenuLayout(new Ro(window.innerWidth,window.innerHeight),Ro.lift(s),o,this.expandDirection);this.submenuContainer.style.left=a-s.left+"px",this.submenuContainer.style.top=r-s.top+"px",this.submenuDisposables.add(bo(this.submenuContainer,os.KEY_UP,e=>{let t=new Hn(e);t.equals(15)&&(ss.stop(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(bo(this.submenuContainer,os.KEY_DOWN,e=>{let t=new Hn(e);t.equals(15)&&ss.stop(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(){if(super.applyStyle(),!this.menuStyle)return;const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t?""+t:""),this.parentData.submenu&&this.parentData.submenu.style(this.menuStyle)}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class WP extends kT{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?""+e.separatorColor:"")}}function VP(e){const t=TP,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}let zP=`\n.monaco-menu {\n\tfont-size: 13px;\n\n}\n\n${DA(OP)}\n${DA(AP)}\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.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\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\topacity: 0.4;\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 #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\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}\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\tpadding: 0.5em 0 0 0;\n\tmargin-bottom: 0.5em;\n\twidth: 100%;\n\theight: 0px !important;\n\tmargin-left: .8em !important;\n\tmargin-right: .8em !important;\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.monaco-menu .monaco-action-bar.vertical .action-item {\n\tborder: thin solid transparent; /* prevents jumping behaviour on hover or focus */\n}\n\n\n/* High Contrast Theming */\n:host-context(.hc-black) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .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: .5em 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 1.8em;\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\tpadding: 0.2em 0 0 0;\n\tmargin-bottom: 0.2em;\n}\n\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: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}\n\n/* Arrows */\n.monaco-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.monaco-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n}\n.monaco-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.monaco-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.monaco-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.monaco-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: #DDD 0 6px 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: #DDD 6px 0 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.monaco-scrollable-element > .shadow.top.left {\n\tbox-shadow: #DDD 6px 6px 6px -6px inset;\n}\n\n/* ---------- Default Style ---------- */\n\n:host-context(.vs) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(100, 100, 100, .4);\n}\n:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(121, 121, 121, .4);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(111, 195, 223, .6);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: rgba(100, 100, 100, .7);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: rgba(111, 195, 223, .8);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(0, 0, 0, .6);\n}\n:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(191, 191, 191, .4);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(111, 195, 223, 1);\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.top {\n\tbox-shadow: none;\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.left {\n\tbox-shadow: #000 6px 0 6px -6px inset;\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.top.left {\n\tbox-shadow: #000 6px 6px 6px -6px inset;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.top {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.left {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.top.left {\n\tbox-shadow: none;\n}\n`;i("1a7b");function HP(e,t){const i=Object.create(null);for(let n in t){const o=t[n];o&&(i[n]=ex(o,e))}return i}function KP(e,t,i){function n(){const n=HP(e.getColorTheme(),t);"function"===typeof i?i(n):i.style(n)}return n(),e.onDidColorThemeChange(n)}function jP(e,t,i){return KP(t,Object.assign(Object.assign({},UP),i||{}),e)}const UP={listFocusBackground:lS,listFocusForeground:cS,listFocusOutline:dS,listActiveSelectionBackground:hS,listActiveSelectionForeground:uS,listActiveSelectionIconForeground:gS,listFocusAndSelectionBackground:hS,listFocusAndSelectionForeground:uS,listInactiveSelectionBackground:fS,listInactiveSelectionIconForeground:pS,listInactiveSelectionForeground:mS,listInactiveFocusBackground:_S,listInactiveFocusOutline:bS,listHoverBackground:vS,listHoverForeground:wS,listDropBackground:CS,listSelectionOutline:YC,listHoverOutline:YC,listFilterWidgetBackground:SS,listFilterWidgetOutline:xS,listFilterWidgetNoMatchesOutline:kS,listMatchesShadow:XC,treeIndentGuidesStroke:LS,tableColumnsBorder:ES},$P={shadowColor:XC,borderColor:MS,foregroundColor:OS,backgroundColor:AS,selectionForegroundColor:PS,selectionBackgroundColor:RS,selectionBorderColor:FS,separatorColor:BS};function qP(e,t,i){return KP(t,Object.assign(Object.assign({},$P),i),e)}class GP{constructor(e,t,i,n,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.themeService=o,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let i;this.focusToReturn=document.activeElement;let n=ns(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:n=>{let o=e.getMenuClassName?e.getMenuClassName():"";o&&(n.className+=" "+o),this.options.blockMouse&&(this.block=n.appendChild(ms(".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",bo(this.block,os.MOUSE_DOWN,e=>e.stopPropagation()));const s=new Ge,r=e.actionRunner||new Vp;return r.onBeforeRun(this.onActionRun,this,s),r.onDidRun(this.onDidActionRun,this,s),i=new RP(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:r,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)}),s.add(qP(i,this.themeService)),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,s),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,s),s.add(bo(window,os.BLUR,()=>this.contextViewService.hideContextView(!0))),s.add(bo(window,os.MOUSE_DOWN,e=>{if(e.defaultPrevented)return;let t=new qn(e),i=t.target;if(!t.rightButton){while(i){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}})),$e(s,i)},focus:()=>{i&&i.focus(!!e.autoSelectFirstItem)},onHide:t=>{e.onHide&&e.onHide(!!t),this.block&&(this.block.remove(),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},n,!!n)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&!De(e.error)&&this.notificationService.error(e.error)}}var YP=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},XP=function(e,t){return function(i,n){t(i,n,e)}};let ZP=class extends Ye{constructor(e,t,i,n,o){super(),this.contextMenuHandler=new GP(i,e,t,n,o)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(e),xs.getInstance().resetKeyStatus()}};ZP=YP([XP(0,l_),XP(1,$m),XP(2,ZT),XP(3,IM),XP(4,jp)],ZP);const QP=gn("layoutService");var JP=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},eR=function(e,t){return function(i,n){t(i,n,e)}};let tR=class extends Ye{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Ye.None,this.container=e.container,this.contextView=this._register(new TA(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?t!==this.container&&(this.container=t,this.setContainer(t,i?3:2)):this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.contextView.show(e);const n=qe(()=>{this.currentViewDisposable===n&&this.hideContextView()});return this.currentViewDisposable=n,n}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};tR=JP([eR(0,QP)],tR);const iR=gn("dialogService");class nR{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}}class oR{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(let 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(this._hashFn(t),n),n.incoming.set(this._hashFn(e),i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(let i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new nR(e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){let e=[];for(let[t,i]of this._nodes)e.push(`${t}, (incoming)[${[...i.incoming.keys()].join(", ")}], (outgoing)[${[...i.outgoing.keys()].join(",")}]`);return e.join("\n")}findCycleSlow(){for(let[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(let[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)}}}const sR=!1;class rR 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 aR{constructor(e=new SI,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(hn,this)}createChild(e){return new aR(e,this._strict,this)}invokeFunction(e,...t){let i=lR.traceInvocation(e),n=!1;try{const o={get:(e,t)=>{if(n)throw Te("service accessor is only valid during the invocation of its target method");const o=this._getOrCreateServiceInstance(e,i);if(!o&&t!==fn)throw new Error(`[invokeFunction] unknown service '${e}'`);return o}};return e(o,...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof ph?(i=lR.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=lR.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){let n=dn.getServiceDependencies(e).sort((e,t)=>e.index-t.index),o=[];for(const r of n){let t=this._getOrCreateServiceInstance(r.id,i);if(!t&&this._strict&&!r.optional)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${r.id}.`);o.push(t)}let s=n.length>0?n[0].index:t.length;if(t.length!==s){console.warn(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);let i=s-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,s)}return new e(...[...t,...o])}_setServiceInstance(e,t){if(this._services.get(e)instanceof ph)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let i=this._getServiceInstanceOrDescriptor(e);return i instanceof ph?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){const n=new oR(e=>e.id.toString());let o=0;const s=[{id:e,desc:t,_trace:i}];while(s.length){const t=s.pop();if(n.lookupOrInsertNode(t),o++>1e3)throw new rR(n);for(let i of dn.getServiceDependencies(t.desc.ctor)){let o=this._getServiceInstanceOrDescriptor(i.id);if(o||i.optional||console.warn(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`),o instanceof ph){const e={id:i.id,desc:o,_trace:t._trace.branch(i.id,!0)};n.insertEdge(t,e),s.push(e)}}}while(1){const e=n.roots();if(0===e.length){if(!n.isEmpty())throw new rR(n);break}for(const{data:t}of e){const e=this._getServiceInstanceOrDescriptor(t.id);if(e instanceof ph){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e)}n.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof ph)return this._createServiceInstance(t,i,n,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error("illegalState - creating UNKNOWN service instance "+t.name)}_createServiceInstance(e,t=[],i,n){if(i){const i=new ao(()=>this._createInstance(e,t,n));return new Proxy(Object.create(null),{get(e,t){if(t in e)return e[t];let n=i.value,o=n[t];return"function"!==typeof o||(o=o.bind(n),e[t]=o),o},set(e,t,n){return i.value[t]=n,!0}})}return this._createInstance(e,t,n)}}class lR{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return sR?new lR(1,e.name||e.toString().substring(0,42).replace(/\n/g,"")):lR._None}static traceCreation(e){return sR?new lR(0,e.name):lR._None}branch(e,t){let i=new lR(2,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;lR._totals+=e;let t=!1;function i(e,n){let o=[],s=new Array(e+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,o.push(`${s}CREATES -> ${r}`);let n=i(e+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}let n=[`${0===this.type?"CREATE":"CALL"} ${this.name}`,""+i(1,this),`DONE, took ${e.toFixed(2)}ms (grand total ${lR._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(n.join("\n"))}}lR._None=new class extends lR{constructor(){super(-1,null)}stop(){}branch(){return this}},lR._totals=0;const cR=gn("labelService");i("dff0");class dR{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}class hR extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function uR(e,t){const i=[];for(let n of t){if(e.start>=n.range.end)continue;if(e.end<n.range.start)break;const t=EA.intersect(e,n.range);EA.isEmpty(t)||i.push({range:t,size:n.size})}return i}function gR({start:e,end:t},i){return{start:e+i,end:t+i}}function fR(e){const t=[];let i=null;for(let n of e){const e=n.range.start,o=n.range.end,s=n.size;i&&s===i.size?i.range.end=o:(i={range:{start:e,end:o},size:s},t.push(i))}return t}function mR(...e){return fR(e.reduce((e,t)=>e.concat(t),[]))}class pR{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const n=i.length-t,o=uR({start:0,end:e},this.groups),s=uR({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(e=>({range:gR(e.range,n),size:e.size})),r=i.map((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size}));this.groups=mR(o,r,s),this._size=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;let t=0,i=0;for(let n of this.groups){const o=n.range.end-n.range.start,s=i+o*n.size;if(e<s)return t+Math.floor((e-i)/n.size);t+=o,i=s}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(let n of this.groups){const o=n.range.end-n.range.start,s=i+o;if(e<s)return t+(e-i)*n.size;t+=o*n.size,i=s}return-1}}function _R(e){try{e.parentElement&&e.parentElement.removeChild(e)}catch(t){}}class bR{constructor(e){this.renderers=e,this.cache=new Map}alloc(e){let t=this.getTemplateCache(e).pop();if(!t){const i=ms(".monaco-list-row"),n=this.getRenderer(e),o=n.renderTemplate(i);t={domNode:i,templateId:e,templateData:o}}return t}release(e){e&&this.releaseRow(e)}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(t.classList.remove("scrolling"),_R(t));const n=this.getTemplateCache(i);n.push(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){const e=this.getRenderer(t);e.disposeTemplate(i.templateData),i.templateData=null}}),this.cache.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error("No renderer found for "+e);return t}}var vR=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const wR={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(e){return[e]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class CR{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class yR{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class SR{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}}}function xR(e,t){return Array.isArray(e)&&Array.isArray(t)?yu(e,t):e===t}class kR{constructor(e){(null===e||void 0===e?void 0:e.getSetSize)?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(e,t,i)=>i,(null===e||void 0===e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null===e||void 0===e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null===e||void 0===e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class LR{constructor(e,t,i,n=wR){if(this.virtualDelegate=t,this.domId="list_id_"+ ++LR.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Jn(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Ye.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Ye.None,this.onDragLeaveTimeout=Ye.None,this.disposables=new Ge,this._onDidChangeContentHeight=new rt,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=new pR;for(const s of i)this.renderers.set(s.templateId,s);this.cache=this.disposables.add(new bR(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=Ia(n,e=>e.horizontalScrolling,wR.horizontalScrolling),this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight="undefined"===typeof n.additionalScrollHeight?0:n.additionalScrollHeight,this.accessibilityProvider=new kR(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows";const o=Ia(n,e=>e.transformOptimization,wR.transformOptimization);o&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add(V_.addTarget(this.rowsContainer)),this.scrollable=new $E(Ia(n,e=>e.smoothScrolling,!1)?125:0,e=>ko(e)),this.scrollableElement=this.disposables.add(new rD(this.rowsContainer,{alwaysConsumeMouseWheel:Ia(n,e=>e.alwaysConsumeMouseWheel,wR.alwaysConsumeMouseWheel),horizontal:1,vertical:Ia(n,e=>e.verticalScrollMode,wR.verticalScrollMode),useShadows:Ia(n,e=>e.useShadows,wR.useShadows),mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(bo(this.rowsContainer,B_.Change,e=>this.onTouchChange(e))),this.disposables.add(bo(this.scrollableElement.getDomNode(),"scroll",e=>e.target.scrollTop=0)),this.disposables.add(bo(this.domNode,"dragover",e=>this.onDragOver(this.toDragEvent(e)))),this.disposables.add(bo(this.domNode,"drop",e=>this.onDrop(this.toDragEvent(e)))),this.disposables.add(bo(this.domNode,"dragleave",e=>this.onDragLeave(this.toDragEvent(e)))),this.disposables.add(bo(this.domNode,"dragend",e=>this.onDragEnd(e))),this.setRowLineHeight=Ia(n,e=>e.setRowLineHeight,wR.setRowLineHeight),this.setRowHeight=Ia(n,e=>e.setRowHeight,wR.setRowHeight),this.supportDynamicHeights=Ia(n,e=>e.supportDynamicHeights,wR.supportDynamicHeights),this.dnd=Ia(n,e=>e.dnd,wR.dnd),this.layout()}get contentHeight(){return this.rangeMap.size}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:zo(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=""}}updateOptions(e){void 0!==e.additionalScrollHeight&&(this.additionalScrollHeight=e.additionalScrollHeight,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.mouseWheelScrollSensitivity&&this.scrollableElement.updateOptions({mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),void 0!==e.fastScrollSensitivity&&this.scrollableElement.updateOptions({fastScrollSensitivity:e.fastScrollSensitivity})}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),o={start:e,end:e+t},s=EA.intersect(n,o),r=new Map;for(let C=s.start;C<s.end;C++){const e=this.items[C];if(e.dragStartDisposable.dispose(),e.row){let t=r.get(e.templateId);t||(t=[],r.set(e.templateId,t));const i=this.renderers.get(e.templateId);i&&i.disposeElement&&i.disposeElement(e.element,C,e.row.templateData,e.size),t.push(e.row)}e.row=null}const a={start:e+t,end:this.items.length},l=EA.intersect(a,n),c=EA.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:Ye.None}));let h;0===e&&t>=this.items.length?(this.rangeMap=new pR,this.rangeMap.splice(0,0,d),h=this.items,this.items=d):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),f=gR(l,u),m=EA.intersect(g,f);for(let C=m.start;C<m.end;C++)this.updateItemInDOM(this.items[C],C);const p=EA.relativeComplement(f,g);for(const C of p)for(let e=C.start;e<C.end;e++)this.removeItemFromDOM(e);const _=c.map(e=>gR(e,u)),b={start:e,end:e+i.length},v=[b,..._].map(e=>EA.intersect(g,e)),w=this.getNextToLastElement(v);for(const C of v)for(let e=C.start;e<C.end;e++){const t=this.items[e],i=r.get(t.templateId),n=null===i||void 0===i?void 0:i.pop();this.insertItemInDOM(e,w,n)}for(const C of r.values())for(const e of C)this.cache.release(e);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(e=>e.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=this._scrollHeight+"px",this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=ko(()=>{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)"undefined"!==typeof t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10})}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(){const e=this.scrollableElement.getScrollDimensions();return e.height}element(e){return this.items[e].element}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){let i={height:"number"===typeof e?e:Ho(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),"undefined"!==typeof t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"===typeof t?t:zo(this.domNode)})}render(e,t,i,n,o,s=!1){const r=this.getRenderRange(t,i),a=EA.relativeComplement(r,e),l=EA.relativeComplement(e,r),c=this.getNextToLastElement(a);if(s){const t=EA.intersect(e,r);for(let e=t.start;e<t.end;e++)this.updateItemInDOM(this.items[e],e)}for(const d of a)for(let e=d.start;e<d.end;e++)this.insertItemInDOM(e,c);for(const d of l)for(let e=d.start;e<d.end;e++)this.removeItemFromDOM(e);void 0!==n&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&void 0!==o&&(this.rowsContainer.style.width=Math.max(o,this.renderWidth)+"px"),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t,i){const n=this.items[e];n.row||(n.row=null!==i&&void 0!==i?i:this.cache.alloc(n.templateId));const o=this.accessibilityProvider.getRole(n.element)||"listitem";n.row.domNode.setAttribute("role",o);const s=this.accessibilityProvider.isChecked(n.element);"undefined"!==typeof s&&n.row.domNode.setAttribute("aria-checked",String(!!s)),n.row.domNode.parentElement||(t?this.rowsContainer.insertBefore(n.row.domNode,t):this.rowsContainer.appendChild(n.row.domNode)),this.updateItemInDOM(n,e);const r=this.renderers.get(n.templateId);if(!r)throw new Error("No renderer found for template id "+n.templateId);r&&r.renderElement(n.element,e,n.row.templateData,n.size);const a=this.dnd.getDragURI(n.element);n.dragStartDisposable.dispose(),n.row.domNode.draggable=!!a,a&&(n.dragStartDisposable=bo(n.row.domNode,"dragstart",e=>this.onDragStart(n.element,a,e))),this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=Sn?"-moz-fit-content":"fit-content",e.width=zo(e.row.domNode);const t=window.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.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(){const e=this.scrollableElement.getScrollPosition();return e.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.additionalScrollHeight}get onMouseClick(){return it.map(this.disposables.add(new sT(this.domNode,"click")).event,e=>this.toMouseEvent(e))}get onMouseDblClick(){return it.map(this.disposables.add(new sT(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e))}get onMouseMiddleClick(){return it.filter(it.map(this.disposables.add(new sT(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e)),e=>1===e.browserEvent.button)}get onMouseDown(){return it.map(this.disposables.add(new sT(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e))}get onContextMenu(){return it.any(it.map(this.disposables.add(new sT(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e)),it.map(this.disposables.add(new sT(this.domNode,B_.Contextmenu)).event,e=>this.toGestureEvent(e)))}get onTouchStart(){return it.map(this.disposables.add(new sT(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e))}get onTap(){return it.map(this.disposables.add(new sT(this.rowsContainer,B_.Tap)).event,e=>this.toGestureEvent(e))}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}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){if(!i.dataTransfer)return;const n=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(CT.TEXT,t),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(n,i)),"undefined"===typeof e&&(e=String(n.length));const t=ms(".monaco-drag-image");t.textContent=e,document.body.appendChild(t),i.dataTransfer.setDragImage(t,-10,-10),setTimeout(()=>document.body.removeChild(t),0)}this.currentDragData=new CR(n),ST.CurrentDragAndDropData=new yR(n),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),ST.CurrentDragAndDropData&&"vscode-ui"===ST.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(ST.CurrentDragAndDropData)this.currentDragData=ST.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new SR}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop="boolean"===typeof t?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let i;if(e.browserEvent.dataTransfer.dropEffect="boolean"!==typeof t&&0===t.effect?"copy":"move",i="boolean"!==typeof t&&t.feedback?t.feedback:"undefined"===typeof e.index?[-1]:[e.index],i=Eu(i).filter(e=>e>=-1&&e<this.length).sort((e,t)=>e-t),i=-1===i[0]?[-1]:i,xR(this.currentDragFeedback,i))return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackDisposable.dispose(),-1===i[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=qe(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const e of i){const t=this.items[e];t.dropTarget=!0,t.row&&t.row.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=qe(()=>{for(const e of i){const t=this.items[e];t.dropTarget=!1,t.row&&t.row.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=io(()=>this.clearDragOverFeedback(),100),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.currentDragData=void 0,ST.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,ST.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Ye.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=Fo(this.domNode).top;this.dragOverAnimationDisposable=Cs(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=io(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3),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)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;while(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 o,s;e===this.elementTop(n.start)?(o=n.start,s=0):n.end-n.start>1&&(o=n.start+1,s=this.elementTop(o)-e);let r=0;while(1){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=EA.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=EA.relativeComplement(a,n);for(const e of l)for(let t=e.start;t<e.end;t++){const e=t+1,i=e<this.items.length?this.items[e].row:null,n=i?i.domNode:null;this.insertItemInDOM(t,n)}for(let e=a.start;e<a.end;e++)this.items[e].row&&this.updateItemInDOM(this.items[e],e);if("number"===typeof o){const t=this.scrollable.getFutureScrollPosition().scrollTop-e,n=this.elementTop(o)-s+t;this.setScrollTop(n,i)}return void this._onDidChangeContentHeight.fire(this.contentHeight)}}}probeDynamicHeight(e){const t=this.items[e];if(this.virtualDelegate.getDynamicHeight){const e=this.virtualDelegate.getDynamicHeight(t.element);if(null!==e){const i=t.size;return t.size=e,t.lastDynamicHeightWidth=this.renderWidth,e-i}}if(!t.hasDynamicHeight||t.lastDynamicHeightWidth===this.renderWidth)return 0;if(this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(t.element))return 0;const i=t.size;if(!this.setRowHeight&&t.row){let e=t.row.domNode.offsetHeight;return t.size=e,t.lastDynamicHeightWidth=this.renderWidth,e-i}const n=this.cache.alloc(t.templateId);n.domNode.style.height="",this.rowsContainer.appendChild(n.domNode);const o=this.renderers.get(t.templateId);return o&&(o.renderElement(t.element,e,n.templateData,void 0),o.disposeElement&&o.disposeElement(t.element,e,n.templateData,void 0)),t.size=n.domNode.offsetHeight,this.virtualDelegate.setDynamicHeight&&this.virtualDelegate.setDynamicHeight(t.element,t.size),t.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(n.domNode),this.cache.release(n),t.size-i}getNextToLastElement(e){const t=e[e.length-1];if(!t)return null;const i=this.items[t.end];return i&&i.row?i.row.domNode:null}getElementDomId(e){return`${this.domId}_${e}`}dispose(){if(this.items){for(const e of this.items)if(e.row){const t=this.renderers.get(e.row.templateId);t&&(t.disposeElement&&t.disposeElement(e.element,-1,e.row.templateData,void 0),t.disposeTemplate(e.row.templateData))}this.items=[]}this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),Ue(this.disposables)}}LR.InstanceCount=0,vR([F_],LR.prototype,"onMouseClick",null),vR([F_],LR.prototype,"onMouseDblClick",null),vR([F_],LR.prototype,"onMouseMiddleClick",null),vR([F_],LR.prototype,"onMouseDown",null),vR([F_],LR.prototype,"onContextMenu",null),vR([F_],LR.prototype,"onTouchStart",null),vR([F_],LR.prototype,"onTap",null);var ER,DR=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},NR=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class IR{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return"template:"+this.trait.trait}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 o of this.renderedElements)o.index<e?n.push(o):o.index>=e+t&&n.push({index:o.index+i-t,templateData:o.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 TR{constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new rt,this.onChange=this._onChange.event}get trait(){return this._trait}get renderer(){return new IR(this)}splice(e,t,i){var n;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,s=e+t,r=[...this.sortedIndexes.filter(t=>t<e),...i.map((t,i)=>t?i+e:-1).filter(e=>-1!==e),...this.sortedIndexes.filter(e=>e>=s).map(e=>e+o)],a=this.length+o;if(this.sortedIndexes.length>0&&0===r.length&&a>0){const t=null!==(n=this.sortedIndexes.find(t=>t>=e))&&void 0!==n?n:a-1;r.push(Math.min(t,a-1))}this.renderer.splice(e,t,i.length),this._set(r,r),this.length=a}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(ZR),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=YR(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return Su(this.sortedIndexes,e,ZR)>=0}dispose(){Ue(this._onChange)}}DR([F_],TR.prototype,"renderer",null);class MR extends TR{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 OR{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,i.map(()=>!1));const n=this.trait.get().map(e=>this.identityProvider.getId(this.view.element(e)).toString()),o=i.map(e=>n.indexOf(this.identityProvider.getId(e).toString())>-1);this.trait.splice(e,t,o)}}function AR(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function PR(e){return!!e.classList.contains("monaco-editor")||!e.classList.contains("monaco-list")&&(!!e.parentElement&&PR(e.parentElement))}class RR{constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Ge,this.multipleSelectionDisposables=new Ge,this.onKeyDown.filter(e=>3===e.keyCode).on(this.onEnter,this,this.disposables),this.onKeyDown.filter(e=>16===e.keyCode).on(this.onUpArrow,this,this.disposables),this.onKeyDown.filter(e=>18===e.keyCode).on(this.onDownArrow,this,this.disposables),this.onKeyDown.filter(e=>11===e.keyCode).on(this.onPageUpArrow,this,this.disposables),this.onKeyDown.filter(e=>12===e.keyCode).on(this.onPageDownArrow,this,this.disposables),this.onKeyDown.filter(e=>9===e.keyCode).on(this.onEscape,this,this.disposables),!1!==i.multipleSelectionSupport&&this.onKeyDown.filter(e=>(s["f"]?e.metaKey:e.ctrlKey)&&31===e.keyCode).on(this.onCtrlA,this,this.multipleSelectionDisposables)}get onKeyDown(){return it.chain(this.disposables.add(new sT(this.view.domNode,"keydown")).event).filter(e=>!AR(e.target)).map(e=>new Hn(e))}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionDisposables.clear(),e.multipleSelectionSupport&&this.onKeyDown.filter(e=>(s["f"]?e.metaKey:e.ctrlKey)&&31===e.keyCode).on(this.onCtrlA,this,this.multipleSelectionDisposables))}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(Tu(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()}}DR([F_],RR.prototype,"onKeyDown",null),function(e){e[e["Idle"]=0]="Idle",e[e["Typing"]=1]="Typing"}(ER||(ER={}));const FR=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>=93&&e.keyCode<=102||e.keyCode>=80&&e.keyCode<=90)}};class BR{constructor(e,t,i,n){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.delegate=n,this.enabled=!1,this.state=ER.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Ge,this.disposables=new Ge,this.updateOptions(e.options)}updateOptions(e){const t="undefined"===typeof e.enableKeyboardNavigation||!!e.enableKeyboardNavigation;t?this.enable():this.disable(),"undefined"!==typeof e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)}enable(){if(this.enabled)return;const e=it.chain(this.enabledDisposables.add(new sT(this.view.domNode,"keydown")).event).filter(e=>!AR(e.target)).filter(()=>this.automaticKeyboardNavigation||this.triggered).map(e=>new Hn(e)).filter(e=>this.delegate.mightProducePrintableCharacter(e)).forEach(e=>{e.stopPropagation(),e.preventDefault()}).map(e=>e.browserEvent.key).event,t=it.debounce(e,()=>null,800),i=it.reduce(it.any(e,t),(e,t)=>null===t?null:(e||"")+t);i(this.onInput,this,this.enabledDisposables),t(this.onClear,this,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&&Op(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=ER.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===ER.Idle?1:0;this.state=ER.Typing;for(let o=0;o<this.list.length;o++){const t=(i+o+n)%this.list.length,s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(t)),r=s&&s.toString();if("undefined"===typeof r||AA(e,r))return this.previouslyFocused=i,this.list.setFocus([t]),void this.list.reveal(t)}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class WR{constructor(e,t){this.list=e,this.view=t,this.disposables=new Ge;const i=it.chain(this.disposables.add(new sT(t.domNode,"keydown")).event).filter(e=>!AR(e.target)).map(e=>new Hn(e));i.filter(e=>2===e.keyCode&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey).on(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 o=window.getComputedStyle(n);"hidden"!==o.visibility&&"none"!==o.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function VR(e){return s["f"]?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function zR(e){return e.browserEvent.shiftKey}function HR(e){return e instanceof MouseEvent&&2===e.button}const KR={isSelectionSingleChangeEvent:VR,isSelectionRangeChangeEvent:zR};class jR{constructor(e){this.list=e,this.disposables=new Ge,this._onPointer=new rt,this.onPointer=this._onPointer.event,!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||KR),this.mouseSupport="undefined"===typeof 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(V_.addTarget(e.getHTMLElement()))),it.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||KR))}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){PR(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(PR(e.browserEvent.target))return;const t="undefined"===typeof e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(AR(e.browserEvent.target)||PR(e.browserEvent.target))return;const t=e.index;return"undefined"===typeof t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionRangeChangeEvent(e)||this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),HR(e.browserEvent)||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e))}onDoubleClick(e){if(AR(e.browserEvent.target)||PR(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;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("undefined"===typeof i){const e=this.list.getFocus()[0];i=null!==e&&void 0!==e?e:t,this.list.setAnchor(i)}const n=Math.min(i,t),o=Math.max(i,t),s=Tu(n,o+1),r=this.list.getSelection(),a=GR(YR(r,[i]),i);if(0===a.length)return;const l=YR(s,XR(r,a));this.list.setSelection(l,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 UR{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&"."+this.selectorSuffix,i=[];e.listBackground&&(e.listBackground.isOpaque()?i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`):s["f"]||console.warn(`List with id '${this.selectorSuffix}' was styled with a non-opaque background color. This will break sub-pixel antialiasing.`)),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listFocusOutline&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&i.push(`\n\t\t\t\t.monaco-list${t}.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }\n\t\t\t`),e.listFilterWidgetBackground&&i.push(`.monaco-list-type-filter { background-color: ${e.listFilterWidgetBackground} }`),e.listFilterWidgetOutline&&i.push(`.monaco-list-type-filter { border: 1px solid ${e.listFilterWidgetOutline}; }`),e.listFilterWidgetNoMatchesOutline&&i.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${e.listFilterWidgetNoMatchesOutline}; }`),e.listMatchesShadow&&i.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${e.listMatchesShadow}; }`),e.tableColumnsBorder&&i.push(`\n\t\t\t\t.monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t}`),this.styleElement.textContent=i.join("\n")}}const $R={listFocusBackground:Lw.fromHex("#7FB0D0"),listActiveSelectionBackground:Lw.fromHex("#0E639C"),listActiveSelectionForeground:Lw.fromHex("#FFFFFF"),listActiveSelectionIconForeground:Lw.fromHex("#FFFFFF"),listFocusAndSelectionBackground:Lw.fromHex("#094771"),listFocusAndSelectionForeground:Lw.fromHex("#FFFFFF"),listInactiveSelectionBackground:Lw.fromHex("#3F3F46"),listInactiveSelectionIconForeground:Lw.fromHex("#FFFFFF"),listHoverBackground:Lw.fromHex("#2A2D2E"),listDropBackground:Lw.fromHex("#383B3D"),treeIndentGuidesStroke:Lw.fromHex("#a9a9a9"),tableColumnsBorder:Lw.fromHex("#cccccc").transparent(.2)},qR={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function GR(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;while(o>=0&&e[o]===t-(i-o))n.push(e[o--]);n.reverse(),o=i;while(o<e.length&&e[o]===t+(o-i))n.push(e[o++]);return n}function YR(e,t){const i=[];let n=0,o=0;while(n<e.length||o<t.length)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){i.push(e[n]),n++,o++;continue}e[n]<t[o]?i.push(e[n++]):i.push(t[o++])}return i}function XR(e,t){const i=[];let n=0,o=0;while(n<e.length||o<t.length)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){n++,o++;continue}e[n]<t[o]?i.push(e[n++]):o++}return i}const ZR=(e,t)=>e-t;class QR{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 o=0;for(const s of this.renderers)s.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){let o=0;for(const s of this.renderers)s.disposeElement&&s.disposeElement(e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class JR{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 o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"===typeof o?i.setAttribute("aria-level",""+o):i.removeAttribute("aria-level")}disposeTemplate(e){}}class eF{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements(),i=t.indexOf(e)>-1?t:[e];return i}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var o,s;null===(s=(o=this.dnd).onDragLeave)||void 0===s||s.call(o,e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}}class tF{constructor(e,t,i,n,o=qR){var s;this.user=e,this._options=o,this.focus=new TR("focused"),this.anchor=new TR("anchor"),this.eventBufferer=new ct,this._ariaLabel="",this.disposables=new Ge,this._onDidDispose=new rt,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(s=this._options.accessibilityProvider)||void 0===s?void 0:s.getWidgetRole():"list";this.selection=new MR("listbox"!==r),Da(o,$R,!1);const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new JR(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(e=>new QR(e.templateId,[...a,e]));const l=Object.assign(Object.assign({},o),{dnd:o.dnd&&new eF(this,o.dnd)});if(this.view=new LR(t,i,n,l),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const e=Zo(this.view.domNode);this.styleController=new UR(e,this.view.domId)}if(this.spliceable=new dR([new OR(this.focus,this.view,o.identityProvider),new OR(this.selection,this.view,o.identityProvider),new OR(this.anchor,this.view,o.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 WR(this,this.view)),("boolean"!==typeof o.keyboardSupport||o.keyboardSupport)&&(this.keyboardController=new RR(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||FR;this.typeLabelController=new BR(this,this.view,o.keyboardNavigationLabelProvider,e),this.disposables.add(this.typeLabelController)}this.mouseController=this.createMouseController(o),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")}get onDidChangeFocus(){return it.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e))}get onDidChangeSelection(){return it.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e))}get domId(){return this.view.domId}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 onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=it.chain(this.disposables.add(new sT(this.view.domNode,"keydown")).event).map(e=>new Hn(e)).filter(t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode).map(rT).filter(()=>!1).event,i=it.chain(this.disposables.add(new sT(this.view.domNode,"keyup")).event).forEach(()=>e=!1).map(e=>new Hn(e)).filter(e=>58===e.keyCode||e.shiftKey&&68===e.keyCode).map(rT).map(({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0,n="undefined"!==typeof i?this.view.element(i):void 0,o="undefined"!==typeof i?this.view.domElement(i):this.view.domNode;return{index:i,element:n,anchor:o,browserEvent:e}}).event,n=it.chain(this.view.onContextMenu).filter(t=>!e).map(({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:{x:i.pageX+1,y:i.pageY},browserEvent:i})).event;return it.any(t,i,n)}get onKeyDown(){return this.disposables.add(new sT(this.view.domNode,"keydown")).event}get onDidFocus(){return it.signal(this.disposables.add(new sT(this.view.domNode,"focus",!0)).event)}createMouseController(e){return new jR(this)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e),this.typeLabelController&&this.typeLabelController.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===(t=this.keyboardController)||void 0===t||t.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new hR(this.user,"Invalid start index: "+e);if(t<0)throw new hR(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)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}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 i of e)if(i<0||i>=this.length)throw new hR(this.user,"Invalid index "+i);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if("undefined"!==typeof e){if(e<0||e>=this.length)throw new hR(this.user,"Invalid index "+e);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return Iu(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return"undefined"===typeof e?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new hR(this.user,"Invalid index "+i);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,n);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);s>-1&&this.setFocus([s],i)}focusNextPage(e,t){return NR(this,void 0,void 0,(function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.view.element(i),o=this.getFocusedElements()[0];if(o!==n){const n=this.findPreviousIndex(i,!1,t);n>-1&&o!==this.view.element(n)?this.setFocus([n],e):this.setFocus([i],e)}else{const n=this.view.getScrollTop();this.view.setScrollTop(n+this.view.renderHeight-this.view.elementHeight(i)),this.view.getScrollTop()!==n&&(this.setFocus([]),yield to(0),yield this.focusNextPage(e,t))}}))}focusPreviousPage(e,t){return NR(this,void 0,void 0,(function*(){let i;const n=this.view.getScrollTop();i=0===n?this.view.indexAt(n):this.view.indexAfter(n-1);const o=this.view.element(i),s=this.getFocusedElements()[0];if(s!==o){const n=this.findNextIndex(i,!1,t);n>-1&&s!==this.view.element(n)?this.setFocus([n],e):this.setFocus([i],e)}else{const i=n;this.view.setScrollTop(n-this.view.renderHeight),this.view.getScrollTop()!==i&&(this.setFocus([]),yield to(0),yield this.focusPreviousPage(e,t))}}))}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){if(e<0||e>=this.length)throw new hR(this.user,"Invalid index "+e);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(Qr(t)){const e=o-this.view.renderHeight;this.view.setScrollTop(e*nl(t,0,1)+n)}else{const e=n+o,t=i+this.view.renderHeight;n<i&&e>=t||(n<i||e>=t&&o>=this.view.renderHeight?this.view.setScrollTop(n):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e){if(e<0||e>=this.length)throw new hR(this.user,"Invalid index "+e);const t=this.view.getScrollTop(),i=this.view.elementTop(e),n=this.view.elementHeight(e);if(i<t||i+n>t+this.view.renderHeight)return null;const o=n-this.view.renderHeight;return Math.abs((t-i)/o)}getHTMLElement(){return this.view.domNode}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()}}DR([F_],tF.prototype,"onDidChangeFocus",null),DR([F_],tF.prototype,"onDidChangeSelection",null),DR([F_],tF.prototype,"onContextMenu",null),DR([F_],tF.prototype,"onKeyDown",null),DR([F_],tF.prototype,"onDidFocus",null);class iF{constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){const t=this.renderer.renderTemplate(e);return{data:t,disposable:Ye.None}}renderElement(e,t,i,n){if(i.disposable&&i.disposable.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,n);const s=new ft,r=o.resolve(e,s.token);i.disposable={dispose:()=>s.cancel()},this.renderer.renderPlaceholder(e,i.data),r.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}}function oF(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new nF(e,t.accessibilityProvider)})}class sF{constructor(e,t,i,n,o={}){const s=()=>this.model,r=n.map(e=>new iF(e,s));this.list=new tF(e,t,i,r,oF(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return it.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 it.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 it.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,Tu(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()}}i("b400");const rF={separatorBorder:Lw.transparent};class aF{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)}set size(e){this._size=e}get size(){return this._size}get visible(){return"undefined"===typeof this._cachedVisibleSize}setVisible(e,t){e!==this.visible&&(e?(this.size=nl(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),this.view.setVisible&&this.view.setVisible(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 snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){return this.disposable.dispose(),this.view}}class lF extends aF{layoutContainer(e){this.container.style.top=e+"px",this.container.style.height=this.size+"px"}}class cF extends aF{layoutContainer(e){this.container.style.left=e+"px",this.container.style.width=this.size+"px"}}var dF,hF;(function(e){e[e["Idle"]=0]="Idle",e[e["Busy"]=1]="Busy"})(dF||(dF={})),function(e){function t(e){return{type:"split",index:e}}function i(e){return{type:"invisible",cachedVisibleSize:e}}e.Distribute={type:"distribute"},e.Split=t,e.Invisible=i}(hF||(hF={}));class uF extends Ye{constructor(e,t={}){var i,n;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=dF.Idle,this._onDidSashChange=this._register(new rt),this.onDidSashChange=this._onDidSashChange.event,this._onDidSashReset=this._register(new rt),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.orientation=ea(t.orientation)?0:t.orientation,this.inverseAltBehavior=!!t.inverseAltBehavior,this.proportionalLayout=!!ea(t.proportionalLayout)||!!t.proportionalLayout,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=ds(this.el,ms(".sash-container")),this.viewContainer=ms(".split-view-container"),this.scrollable=new $E(125,ko),this.scrollableElement=this._register(new rD(this.viewContainer,{vertical:0===this.orientation?null!==(i=t.scrollbarVisibility)&&void 0!==i?i:1:2,horizontal:1===this.orientation?null!==(n=t.scrollbarVisibility)&&void 0!==n?n:1:2},this.scrollable)),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(e=>{this.viewContainer.scrollTop=e.scrollTop,this.viewContainer.scrollLeft=e.scrollLeft})),ds(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||rF),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((e,t)=>{const i=ea(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())}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}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)for(let n=0;n<this.viewItems.length;n++){const t=this.viewItems[n];t.size=nl(Math.round(this.proportions[n]*e),t.minimumSize,t.maximumSize)}else{const t=Tu(this.viewItems.length),n=t.filter(e=>1===this.viewItems[e].priority),o=t.filter(e=>2===this.viewItems[e].priority);this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.size/this.contentSize))}onSashStart({sash:e,start:t,alt:i}){for(const r of this.viewItems)r.enabled=!1;const n=this.sashItems.findIndex(t=>t.sash===e),o=$e(bo(document.body,"keydown",e=>s(this.sashDragState.current,e.altKey)),bo(document.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(e,t)=>{const i=this.viewItems.map(e=>e.size);let s,r,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t){const e=n===this.sashItems.length-1;if(e){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=Tu(n,-1),t=Tu(n+1,this.viewItems.length),o=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),c=0===t.length?Number.NEGATIVE_INFINITY:t.reduce((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize),0),d=Math.max(o,c),h=Math.min(l,a),u=this.findFirstSnapIndex(e),g=this.findFirstSnapIndex(t);if("number"===typeof u){const e=this.viewItems[u],t=Math.floor(e.viewMinimumSize/2);s={index:u,limitDelta:e.visible?d-t:d+t,size:e.size}}if("number"===typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?h+t:h-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:i,minDelta:a,maxDelta:l,alt:t,snapBefore:s,snapAfter:r,disposable:o}};s(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:s,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const c=e-i,d=this.resize(t,c,n,void 0,void 0,s,r,a,l);if(o){const e=t===this.sashItems.length-1,i=this.viewItems.map(e=>e.size),n=e?t:t+1,o=this.viewItems[n],s=o.size-o.maximumSize,r=o.size-o.minimumSize,a=e?t-1:t+1;this.resize(a,-d,i,void 0,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t="number"===typeof t?t:e.size,t=nl(t,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(this.state!==dF.Idle)throw new Error("Cant modify splitview");if(this.state=dF.Busy,e<0||e>=this.viewItems.length)return;const i=Tu(this.viewItems.length).filter(t=>t!==e),n=[...i.filter(e=>1===this.viewItems[e].priority),e],o=i.filter(e=>2===this.viewItems[e].priority),s=this.viewItems[e];t=Math.round(t),t=nl(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(n,o),this.state=dF.Idle}distributeViewSizes(){const e=[];let t=0;for(const r of this.viewItems)r.maximumSize-r.minimumSize>0&&(e.push(r),t+=r.size);const i=Math.floor(t/e.length);for(const r of e)r.size=nl(i,r.minimumSize,r.maximumSize);const n=Tu(this.viewItems.length),o=n.filter(e=>1===this.viewItems[e].priority),s=n.filter(e=>2===this.viewItems[e].priority);this.relayout(o,s)}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!==dF.Idle)throw new Error("Cant modify splitview");this.state=dF.Busy;const o=ms(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const s=e.onDidChange(e=>this.onViewChange(c,e)),r=qe(()=>this.viewContainer.removeChild(o)),a=$e(s,r);let l;l="number"===typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize;const c=0===this.orientation?new lF(o,e,l,a):new cF(o,e,l,a);if(this.viewItems.splice(i,0,c),this.viewItems.length>1){let e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash};const t=0===this.orientation?new _T(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:1})):new _T(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},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}),o=it.map(t.onDidStart,n),s=o(this.onSashStart,this),r=it.map(t.onDidChange,n),a=r(this.onSashChange,this),l=it.map(t.onDidEnd,()=>this.sashItems.findIndex(e=>e.sash===t)),c=l(this.onSashEnd,this),d=t.onDidReset(()=>{const e=this.sashItems.findIndex(e=>e.sash===t),i=Tu(e,-1),n=Tu(e+1,this.viewItems.length),o=this.findFirstSnapIndex(i),s=this.findFirstSnapIndex(n);("number"!==typeof o||this.viewItems[o].visible)&&("number"!==typeof s||this.viewItems[s].visible)&&this._onDidSashReset.fire(e)}),h=$e(s,a,c,d,t),u={sash:t,disposable:h};this.sashItems.splice(i-1,0,u)}let d;o.appendChild(e.element),"number"!==typeof t&&"split"===t.type&&(d=[t.index]),n||this.relayout([i],d),this.state=dF.Idle,n||"number"===typeof t||"distribute"!==t.type||this.distributeViewSizes()}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,o,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const c=Tu(e,-1),d=Tu(e+1,this.viewItems.length);if(o)for(const y of o)Ou(c,y),Ou(d,y);if(n)for(const y of n)Au(c,y),Au(d,y);const h=c.map(e=>this.viewItems[e]),u=c.map(e=>i[e]),g=d.map(e=>this.viewItems[e]),f=d.map(e=>i[e]),m=c.reduce((e,t)=>e+(this.viewItems[t].minimumSize-i[t]),0),p=c.reduce((e,t)=>e+(this.viewItems[t].maximumSize-i[t]),0),_=0===d.length?Number.POSITIVE_INFINITY:d.reduce((e,t)=>e+(i[t]-this.viewItems[t].minimumSize),0),b=0===d.length?Number.NEGATIVE_INFINITY:d.reduce((e,t)=>e+(i[t]-this.viewItems[t].maximumSize),0),v=Math.max(m,b,s),w=Math.min(_,p,r);let C=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;C=i!==e.visible,e.setVisible(i,a.size)}if(!C&&l){const e=this.viewItems[l.index],i=t<l.limitDelta;C=i!==e.visible,e.setVisible(i,l.size)}if(C)return this.resize(e,t,i,n,o,s,r);t=nl(t,v,w);for(let y=0,S=t;y<h.length;y++){const e=h[y],t=nl(u[y]+S,e.minimumSize,e.maximumSize),i=t-u[y];S-=i,e.size=t}for(let y=0,S=t;y<g.length;y++){const e=g[y],t=nl(f[y]-S,e.minimumSize,e.maximumSize),i=t-f[y];S+=i,e.size=t}return t}distributeEmptySpace(e){const t=this.viewItems.reduce((e,t)=>e+t.size,0);let i=this.size-t;const n=Tu(this.viewItems.length-1,-1),o=n.filter(e=>1===this.viewItems[e].priority),s=n.filter(e=>2===this.viewItems[e].priority);for(const r of s)Ou(n,r);for(const r of o)Au(n,r);"number"===typeof e&&Au(n,e);for(let r=0;0!==i&&r<n.length;r++){const e=this.viewItems[n[r]],t=nl(e.size+i,e.minimumSize,e.maximumSize),o=t-e.size;i-=o,e.size=t}}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 o=n.map(t=>e=t.size-t.minimumSize>0||e).reverse();e=!1;const s=n.map(t=>e=t.maximumSize-t.size>0||e).reverse();let r=0;for(let a=0;a<this.sashItems.length;a++){const{sash:e}=this.sashItems[a],n=this.viewItems[a];r+=n.size;const l=!(t[a]&&s[a+1]),c=!(i[a]&&o[a+1]);if(l&&c){const i=Tu(a,-1),n=Tu(a+1,this.viewItems.length),s=this.findFirstSnapIndex(i),l=this.findFirstSnapIndex(n),c="number"===typeof s&&!this.viewItems[s].visible,d="number"===typeof l&&!this.viewItems[l].visible;c&&o[a]&&(r>0||this.startSnappingEnabled)?e.state=1:d&&t[a]&&(r<this.contentSize||this.endSnappingEnabled)?e.state=2:e.state=0}else e.state=l&&!c?1:!l&&c?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}}dispose(){super.dispose(),this.viewItems.forEach(e=>e.dispose()),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[]}}var gF;i("acff");class fF{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=fF.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(e=>[e.templateId,e]));this.renderers=[];for(const o of e){const e=n.get(o.templateId);if(!e)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=ds(e,ms(".monaco-table-tr")),i=[],n=[];for(let s=0;s<this.columns.length;s++){const e=this.renderers[s],o=ds(t,ms(".monaco-table-td",{"data-col-index":s}));o.style.width=this.getColumnSize(s)+"px",i.push(o),n.push(e.renderTemplate(o))}const o={container:e,cellContainers:i,cellTemplateData:n};return this.renderedTemplates.add(o),o}renderElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.columns[o],r=s.project(e),a=this.renderers[o];a.renderElement(r,t,i.cellTemplateData[o],n)}}disposeElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.renderers[o];if(s.disposeElement){const r=this.columns[o],a=r.project(e);s.disposeElement(a,t,i.cellTemplateData[o],n)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++){const i=this.renderers[t];i.disposeTemplate(e.cellTemplateData[t])}mo(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=t+"px"}}function mF(e){return{getHeight(t){return e.getHeight(t)},getTemplateId(){return fF.TemplateId}}}fF.TemplateId="row";class pF{constructor(e,t){this.column=e,this.index=t,this._onDidLayout=new rt,this.onDidLayout=this._onDidLayout.event,this.element=ms(".monaco-table-th",{"data-col-index":t,title:e.tooltip},e.label)}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:it.None}layout(e){this._onDidLayout.fire([this.index,e])}}class _F{constructor(e,t,i,n,o,s){this.virtualDelegate=i,this.domId="table_id_"+ ++_F.InstanceCount,this.cachedHeight=0,this.domNode=ds(t,ms(".monaco-table."+this.domId));const r=n.map((e,t)=>new pF(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=new uF(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 fF(n,o,e=>this.splitview.getViewSize(e));this.list=new tF(e,this.domNode,mF(i),[l],s),this.columnLayoutDisposable=it.any(...r.map(e=>e.onDidLayout))(([e,t])=>l.layoutColumn(e,t)),this.styleElement=Zo(this.domNode),this.style({})}get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}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.splitview.dispose(),this.list.dispose(),this.columnLayoutDisposable.dispose()}}_F.InstanceCount=0,function(e){e[e["Unknown"]=0]="Unknown",e[e["Twistie"]=1]="Twistie",e[e["Element"]=2]="Element"}(gF||(gF={}));class bF extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class vF{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 wF(e){return"object"===typeof e&&"visibility"in e&&"data"in e}function CF(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function yF(e){return"boolean"===typeof e.collapsible}class SF{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new ct,this._onDidChangeCollapseState=new rt,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new rt,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new rt,this.onDidSplice=this._onDidSplice.event,this.collapseByDefault="undefined"!==typeof n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren="undefined"!==typeof 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=Ae.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,o,s){var r;void 0===n&&(n=Ae.empty()),void 0===s&&(s=null!==(r=o.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,o);const l=[...n],c=t[t.length-1],d=new Hh({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+i)].map(t=>e.getId(t.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,o);const h=t.slice(0,-1),u=(t,i,n)=>{if(s>0)for(let r=0;r<n;r++)t--,i--,this.spliceSmart(e,[...h,t,0],Number.MAX_SAFE_INTEGER,l[i].children,o,s-1)};let g=Math.min(a.children.length,c+i),f=l.length;for(const m of d.changes.sort((e,t)=>t.originalStart-e.originalStart))u(g,f,g-(m.originalStart+m.originalLength)),g=m.originalStart,f=m.modifiedStart-c,this.spliceSimple([...h,g],m.originalLength,Ae.slice(l,f,f+m.modifiedLength),o);u(g,f,g)}spliceSimple(e,t,i=Ae.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:r,listIndex:a,revealed:l,visible:c}=this.getParentNodeWithListIndex(e),d=[],h=Ae.map(i,e=>this.createTreeNode(e,r,r.visible?1:0,l,d,n)),u=e[e.length-1],g=r.children.length>0;let f=0;for(let y=u;y>=0&&y<r.children.length;y--){const e=r.children[y];if(e.visible){f=e.visibleChildIndex;break}}const m=[];let p=0,_=0;for(const y of h)m.push(y),_+=y.renderNodeCount,y.visible&&(y.visibleChildIndex=f+p++);const b=Ru(r.children,u,t,m);s?r.lastDiffIds?Ru(r.lastDiffIds,u,t,m.map(e=>s.getId(e.element).toString())):r.lastDiffIds=r.children.map(e=>s.getId(e.element).toString()):r.lastDiffIds=void 0;let v=0;for(const y of b)y.visible&&v++;if(0!==v)for(let y=u+m.length;y<r.children.length;y++){const e=r.children[y];e.visible&&(e.visibleChildIndex-=v)}if(r.visibleChildrenCount+=p-v,l&&c){const e=b.reduce((e,t)=>e+(t.visible?t.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(r,_-e),this.list.splice(a,e,d)}if(b.length>0&&o){const e=t=>{o(t),t.children.forEach(e)};b.forEach(e)}const w=r.children.length>0;g!==w&&this.setCollapsible(e.slice(0,-1),w),this._onDidSplice.fire({insertedNodes:m,deletedNodes:b});let C=r;while(C){if(2===C.visibility){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);"undefined"===typeof 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);"undefined"===typeof t&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&s&&!yF(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e<i.children.length;e++){const t=i.children[e];if(t.visible){if(n>-1){n=-1;break}n=e}}n>-1&&this._setCollapseState([...e,n],t)}return s}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const s=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=s-(-1===t?0:1);return this.list.splice(t+1,a,r.slice(1)),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(yF(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})),!yF(t)&&t.recursive)for(const o of e.children)n=this._setNodeCollapseState(o,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);while(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)}createTreeNode(e,t,i,n,o,s){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"===typeof e.collapsible?e.collapsible:"undefined"!==typeof e.collapsed,collapsed:"undefined"===typeof e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&o.push(r);const l=e.children||Ae.empty(),c=n&&0!==a&&!r.collapsed,d=Ae.map(l,e=>this.createTreeNode(e,r,a,c,o,s));let h=0,u=1;for(const g of d)r.children.push(g),u+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=h++);return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=h,r.visible=2===a?h>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=u):(r.renderNodeCount=0,n&&o.pop()),s&&s(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 o;if(e!==this.root){if(o=this._filterNode(e,t),0===o)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const s=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===o)e.visibleChildrenCount=0;else{let t=0;for(const s of e.children)r=this._updateNodeAfterFilterChange(s,o,i,n&&!e.collapsed)||r,s.visible&&(s.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===o?r:1===o,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-s):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)while(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):wF(i)?(e.filterData=i.data,CF(i.visibility)):(e.filterData=void 0,CF(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:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new bF(this.user,"Invalid tree location");const r=t.children[s];return{node:r,listIndex:i,revealed:n,visible:o&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[s,...r]=e;if(s<0||s>t.children.length)throw new bF(this.user,"Invalid tree location");for(let a=0;a<s;a++)i+=t.children[a].renderNodeCount;return n=n&&!t.collapsed,o=o&&t.visible,0===r.length?{parentNode:t,listIndex:i,revealed:n,visible:o}:this.getParentNodeWithListIndex(r,t.children[s],i+1,n,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;while(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?[]:Cu(e)[0]}}const xF=Kl("tree-item-expanded",Ul.chevronDown),kF=Kl("tree-filter-on-type-on",Ul.listFilter),LF=Kl("tree-filter-on-type-off",Ul.listSelection),EF=Kl("tree-filter-clear",Ul.close),DF=Kl("tree-item-loading",Ul.loading);var NF;i("72b1");class IF extends CR{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function TF(e){return e instanceof CR?new IF(e):e}class MF{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Ye.None}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){this.dnd.onDragStart&&this.dnd.onDragStart(TF(e),t)}onDragOver(e,t,i,n,o=!0){const s=this.dnd.onDragOver(TF(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),"undefined"===typeof t)return s;if(r&&"boolean"!==typeof s&&s.autoExpand&&(this.autoExpandDisposable=io(()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0},500)),"boolean"===typeof s||!s.accept||"undefined"===typeof s.bubble||s.feedback){if(!o){const e="boolean"===typeof s?s:s.accept,t="boolean"===typeof s?void 0:s.effect;return{accept:e,effect:t,feedback:[i]}}return s}if(1===s.bubble){const i=this.modelProvider(),o=i.getNodeLocation(t),s=i.getParentNodeLocation(o),r=i.getNode(s),a=s&&i.getListIndex(s);return this.onDragOver(e,r,a,n,!1)}const a=this.modelProvider(),l=a.getNodeLocation(t),c=a.getListIndex(l),d=a.getListRenderCount(l);return Object.assign(Object.assign({},s),{feedback:Tu(c,c+d)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(TF(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function OF(e,t){return t&&Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId(e){return t.identityProvider.getId(e.element)}},dnd:t.dnd&&new MF(e,t.dnd),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return t.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return t.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:t.accessibilityProvider&&Object.assign(Object.assign({},t.accessibilityProvider),{getSetSize(t){const i=e(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n),s=i.getNode(o);return s.visibleChildrenCount},getPosInSet(e){return e.visibleChildIndex+1},isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?e=>t.accessibilityProvider.isChecked(e.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?e=>t.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel(e){return t.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return t.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?e=>t.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(e=>t.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),enableKeyboardNavigation:t.simpleKeyboardNavigation})}class AF{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){this.delegate.setDynamicHeight&&this.delegate.setDynamicHeight(e.element,t)}}(function(e){e["None"]="none",e["OnHover"]="onHover",e["Always"]="always"})(NF||(NF={}));class PF{constructor(e,t=[]){this._elements=t,this.onDidChange=it.forEach(e,e=>this._elements=e)}get elements(){return this._elements}}class RF{constructor(e,t,i,n,o={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=RF.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new Df,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Ye.None,this.disposables=new Ge,this.templateId=e.templateId,this.updateOptions(o),it.map(i,e=>e.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if("undefined"!==typeof e.indent&&(this.indent=nl(e.indent,0,40)),"undefined"!==typeof e.renderIndentGuides){const t=e.renderIndentGuides!==NF.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const e=new Ge;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}"undefined"!==typeof e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=ds(e,ms(".monaco-tl-row")),i=ds(t,ms(".monaco-tl-indent")),n=ds(t,ms(".monaco-tl-twistie")),o=ds(t,ms(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:Ye.None,templateData:s}}renderElement(e,t,i,n){"number"===typeof n&&(this.renderedNodes.set(e,{templateData:i,height:n}),this.renderedElements.set(e.element,e));const o=RF.DefaultIndent+(e.depth-1)*this.indent;i.twistie.style.paddingLeft=o+"px",i.indent.style.width=o+this.indent-16+"px",this.renderTwistie(e,i),"number"===typeof n&&this.renderIndentGuides(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement&&this.renderer.disposeElement(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.renderTwistie(e,t.templateData),this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderIndentGuides(e,t.templateData))}renderTwistie(e,t){t.twistie.classList.remove(...xF.classNamesArray);let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...xF.classNamesArray),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded")}renderIndentGuides(e,t){if(mo(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Ge,n=this.modelProvider();let o=e;while(1){const e=n.getNodeLocation(o),s=n.getParentNodeLocation(e);if(!s)break;const r=n.getNode(s),a=ms(".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(qe(()=>this.renderedIndentGuides.delete(r,a))),o=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 o=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):o&&t.add(i.getNode(o))}catch(o){}}),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(),Ue(this.disposables)}}RF.DefaultIndent=8;class FF{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 Ge,e.onWillRefilter(this.reset,this,this.disposables)}get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}filter(e,t){if(this._filter){const i=this._filter.filter(e,t);if(this.tree.options.simpleKeyboardNavigation)return i;let n;if(n="boolean"===typeof i?i?1:0:wF(i)?CF(i.visibility):i,0===n)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:bP.Default,visibility:!0};const i=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),n=Array.isArray(i)?i:[i];for(const o of n){const e=o&&o.toString();if("undefined"===typeof e)return{data:bP.Default,visibility:!0};const t=vP(this._pattern,this._lowercasePattern,0,e,e.toLowerCase(),0,!0);if(t)return this._matchCount++,1===n.length?{data:t,visibility:!0}:{data:{label:e,score:t},visibility:!0}}return this.tree.options.filterOnType?2:{data:bP.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Ue(this.disposables)}}class BF{constructor(e,t,i,n,s){this.tree=e,this.view=i,this.filter=n,this.keyboardNavigationDelegate=s,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new rt,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new rt,this.enabledDisposables=new Ge,this.disposables=new Ge,this.domNode=ms(".monaco-list-type-filter."+this.positionClassName),this.domNode.draggable=!0,this.disposables.add(bo(this.domNode,"dragstart",()=>this.onDragStart())),this.messageDomNode=ds(i.getHTMLElement(),ms(".monaco-list-type-filter-message")),this.labelDomNode=ds(this.domNode,ms("span.label"));const r=ds(this.domNode,ms(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=ds(r,ms("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),this.disposables.add(bo(this.filterOnTypeDomNode,"input",()=>this.onDidChangeFilterOnType())),this.clearDomNode=ds(r,ms("button.clear"+EF.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=o("clear","Clear"),this.keyboardNavigationEventFilter=e.options.keyboardNavigationEventFilter,t.onDidSplice(this.onDidSpliceModel,this,this.disposables),this.updateOptions(e.options)}get enabled(){return this._enabled}get pattern(){return this._pattern}get filterOnType(){return this._filterOnType}updateOptions(e){e.simpleKeyboardNavigation?this.disable():this.enable(),"undefined"!==typeof e.filterOnType&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType,this.updateFilterOnTypeTitleAndIcon()),"undefined"!==typeof e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=this.enabledDisposables.add(new sT(this.view.getHTMLElement(),"keydown")),t=it.chain(e.event).filter(e=>!AR(e.target)||e.target===this.filterOnTypeDomNode).filter(e=>"Dead"!==e.key&&!/^Media/.test(e.key)).map(e=>new Hn(e)).filter(this.keyboardNavigationEventFilter||(()=>!0)).filter(()=>this.automaticKeyboardNavigation||this.triggered).filter(e=>this.keyboardNavigationDelegate.mightProducePrintableCharacter(e)&&!(18===e.keyCode||16===e.keyCode||15===e.keyCode||17===e.keyCode)||(this.pattern.length>0||this.triggered)&&(9===e.keyCode||1===e.keyCode)&&!e.altKey&&!e.ctrlKey&&!e.metaKey||1===e.keyCode&&(s["f"]?e.altKey&&!e.metaKey:e.ctrlKey)&&!e.shiftKey).forEach(e=>{e.stopPropagation(),e.preventDefault()}).event,i=this.enabledDisposables.add(new sT(this.clearDomNode,"click"));it.chain(it.any(t,i.event)).event(this.onEventOrInput,this,this.enabledDisposables),this.filter.pattern="",this.tree.refilter(),this.render(),this._enabled=!0,this.triggered=!1}disable(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.clear(),this.tree.refilter(),this.render(),this._enabled=!1,this.triggered=!1)}onEventOrInput(e){"string"===typeof e?this.onInput(e):e instanceof MouseEvent||9===e.keyCode||1===e.keyCode&&(s["f"]?e.altKey:e.ctrlKey)?this.onInput(""):1===e.keyCode?this.onInput(0===this.pattern.length?"":this.pattern.substr(0,this.pattern.length-1)):this.onInput(this.pattern+e.browserEvent.key)}onInput(e){const t=this.view.getHTMLElement();e&&!this.domNode.parentElement?t.append(this.domNode):!e&&this.domNode.parentElement&&(this.domNode.remove(),this.tree.domFocus()),this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,e=>!bP.isDefault(e.filterData));const i=this.tree.getFocus();if(i.length>0){const e=i[0];null===this.tree.getRelativeTop(e)&&this.tree.reveal(e,.5)}this.render(),e||(this.triggered=!1)}onDragStart(){const e=this.view.getHTMLElement(),{left:t}=Bo(e),i=e.clientWidth,n=i/2,o=this.domNode.clientWidth,s=new Ge;let r=this.positionClassName;const a=()=>{switch(r){case"nw":this.domNode.style.top="4px",this.domNode.style.left="4px";break;case"ne":this.domNode.style.top="4px",this.domNode.style.left=i-o-6+"px";break}},l=e=>{e.preventDefault();const i=e.clientX-t;e.dataTransfer&&(e.dataTransfer.dropEffect="none"),r=i<n?"nw":"ne",a()},c=()=>{this.positionClassName=r,this.domNode.className="monaco-list-type-filter "+this.positionClassName,this.domNode.style.top="",this.domNode.style.left="",Ue(s)};a(),this.domNode.classList.remove(r),this.domNode.classList.add("dragging"),s.add(qe(()=>this.domNode.classList.remove("dragging"))),s.add(bo(document,"dragover",e=>l(e))),s.add(bo(this.domNode,"dragend",()=>c())),ST.CurrentDragAndDropData=new yT("vscode-ui"),s.add(qe(()=>ST.CurrentDragAndDropData=void 0))}onDidSpliceModel(){this._enabled&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}onDidChangeFilterOnType(){this.tree.updateOptions({filterOnType:this.filterOnTypeDomNode.checked}),this.tree.refilter(),this.tree.domFocus(),this.render(),this.updateFilterOnTypeTitleAndIcon()}updateFilterOnTypeTitleAndIcon(){this.filterOnType?(this.filterOnTypeDomNode.classList.remove(...LF.classNamesArray),this.filterOnTypeDomNode.classList.add(...kF.classNamesArray),this.filterOnTypeDomNode.title=o("disable filter on type","Disable Filter on Type")):(this.filterOnTypeDomNode.classList.remove(...kF.classNamesArray),this.filterOnTypeDomNode.classList.add(...LF.classNamesArray),this.filterOnTypeDomNode.title=o("enable filter on type","Enable Filter on Type"))}render(){const e=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&this.tree.options.filterOnType&&e?(this.messageDomNode.textContent=o("empty","No elements found"),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),this.domNode.classList.toggle("no-matches",e),this.domNode.title=o("found","Matched {0} out of {1} elements",this.filter.matchCount,this.filter.totalCount),this.labelDomNode.textContent=this.pattern.length>16?"…"+this.pattern.substr(this.pattern.length-16):this.pattern,this._onDidChangeEmptyState.fire(this._empty)}shouldAllowFocus(e){return!(this.enabled&&this.pattern&&!this.filterOnType)||(this.filter.totalCount>0&&this.filter.matchCount<=1||!bP.isDefault(e.filterData))}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),Ue(this.disposables)}}function WF(e){let t=gF.Unknown;return $o(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=gF.Twistie:$o(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(t=gF.Element),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function VF(e,t){t(e),e.children.forEach(e=>VF(e,t))}class zF{constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new rt,this.onDidChange=this._onDidChange.event}get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}set(e,t){var i;!(null===(i=t)||void 0===i?void 0:i.__forceEvent)&&yu(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=>VF(e,i)),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach(e=>VF(e,n));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach(e=>VF(e,s));const r=[];for(const a of this.nodes){const e=this.identityProvider.getId(a.element).toString(),t=i.has(e);if(t){const t=o.get(e);t&&r.push(t)}else r.push(a)}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 HF extends jR{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(AR(e.browserEvent.target)||PR(e.browserEvent.target))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;let o=!1;if(o="function"===typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick,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){const i=this.tree.model,s=i.getNodeLocation(t),r=e.browserEvent.altKey;if(this.tree.setFocus([s]),i.setCollapsed(s,void 0,r),o&&n)return}super.onViewPointer(e)}onDoubleClick(e){const t=e.browserEvent.target.classList.contains("monaco-tl-twistie");!t&&this.tree.expandOnDoubleClick&&super.onDoubleClick(e)}}class KF extends tF{constructor(e,t,i,n,o,s,r,a){super(e,t,i,n,a),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=r}createMouseController(e){return new HF(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];let s;i.forEach((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i),this.anchorTrait.has(t)&&(s=e+i)}),n.length>0&&super.setFocus(Eu([...super.getFocus(),...n])),o.length>0&&super.setSelection(Eu([...super.getSelection(),...o])),"number"===typeof s&&super.setAnchor(s)}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||("undefined"===typeof e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class jF{constructor(e,t,i,n,o={}){this._options=o,this.eventBufferer=new ct,this.disposables=new Ge,this._onWillRefilter=new rt,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new rt;const s=new AF(i),r=new dt,a=new dt,l=new PF(a.event);this.renderers=n.map(e=>new RF(e,()=>this.model,r.event,l,o));for(let h of this.renderers)this.disposables.add(h);let c;o.keyboardNavigationLabelProvider&&(c=new FF(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:c}),this.disposables.add(c)),this.focus=new zF(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new zF(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new zF(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new KF(e,t,s,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},OF(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const d=it.forEach(this.model.onDidSplice,e=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)})});if(d(()=>null,null,this.disposables),a.input=it.chain(it.any(d,this.focus.onDidChange,this.selection.onDidChange)).debounce(()=>null,0).map(()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);return[...e.values()]}).event,!1!==o.keyboardSupport){const e=it.chain(this.view.onKeyDown).filter(e=>!AR(e.target)).map(e=>new Hn(e));e.filter(e=>15===e.keyCode).on(this.onLeftArrow,this,this.disposables),e.filter(e=>17===e.keyCode).on(this.onRightArrow,this,this.disposables),e.filter(e=>10===e.keyCode).on(this.onSpace,this,this.disposables)}if(o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||FR;this.typeFilterController=new BF(this,this.model,this.view,c,e),this.focusNavigationFilter=e=>this.typeFilterController.shouldAllowFocus(e),this.disposables.add(this.typeFilterController)}this.styleElement=Zo(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===NF.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return it.map(this.view.onMouseDblClick,WF)}get onPointer(){return it.map(this.view.onPointer,WF)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnDoubleClick(){return"undefined"===typeof this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return"undefined"===typeof this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}updateOptions(e={}){this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(Object.assign(Object.assign({},this._options),{enableKeyboardNavigation:this._options.simpleKeyboardNavigation})),this.typeFilterController&&this.typeFilterController.updateOptions(this._options),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===NF.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t="."+this.view.domId,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeIndentGuidesStroke.transparent(.4)}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join("\n"),this.view.style(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,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){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){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)}focusNext(e=1,t=!1,i,n=this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);-1!==i&&this.view.reveal(i,t)}getRelativeTop(e){const t=this.model.getListIndex(e);return-1===t?null:this.view.getRelativeTop(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),o=this.model.setCollapsed(n,!0);if(!o){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),o=this.model.setCollapsed(n,!1);if(!o){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),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){Ue(this.disposables),this.view.dispose()}}class UF{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new SF(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){return i.sorter.compare(e.element,t.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=Ae.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=Ae.empty(),i){const n=new Set,o=new Set,s=e=>{var t;if(null===e.element)return;const s=e;if(n.add(s.element),this.nodes.set(s.element,s),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.add(e),this.nodesByIdentity.set(e,s)}null===(t=i.onDidCreateNode)||void 0===t||t.call(i,s)},r=e=>{var t;if(null===e.element)return;const s=e;if(n.has(s.element)||this.nodes.delete(s.element),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.has(e)||this.nodesByIdentity.delete(e)}null===(t=i.onDidDeleteNode)||void 0===t||t.call(i,s)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:s,onDidDeleteNode:r}))}preserveCollapseState(e=Ae.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Ae.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)return Object.assign(Object.assign({},e),{children:this.preserveCollapseState(e.children)});const i="boolean"===typeof e.collapsible?e.collapsible:t.collapsible,n="undefined"!==typeof e.collapsed?e.collapsed:t.collapsed;return Object.assign(Object.assign({},e),{collapsible:i,collapsed:n,children:this.preserveCollapseState(e.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(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),o=this.model.getNode(n);return o.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 $F(e){const t=[e.element],i=e.incompressible||!1;return{element:{elements:t,incompressible:i},children:Ae.map(Ae.from(e.children),$F),collapsible:e.collapsible,collapsed:e.collapsed}}function qF(e){const t=[e.element],i=e.incompressible||!1;let n,o;while(1){if([o,n]=Ae.consume(Ae.from(e.children),2),1!==o.length)break;if(o[0].incompressible)break;e=o[0],t.push(e.element)}return{element:{elements:t,incompressible:i},children:Ae.map(Ae.concat(o,n),qF),collapsible:e.collapsible,collapsed:e.collapsed}}function GF(e,t=0){let i;return i=t<e.element.elements.length-1?[GF(e,t+1)]:Ae.map(Ae.from(e.children),e=>GF(e,0)),0===t&&e.element.incompressible?{element:e.element.elements[t],children:i,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:i,collapsible:e.collapsible,collapsed:e.collapsed}}function YF(e){return GF(e,0)}function XF(e,t,i){return e.element===t?Object.assign(Object.assign({},e),{children:i}):Object.assign(Object.assign({},e),{children:Ae.map(Ae.from(e.children),e=>XF(e,t,i))})}const ZF=e=>({getId(t){return t.elements.map(t=>e.getId(t).toString()).join("\0")}});class QF{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new UF(e,t,i),this.enabled="undefined"===typeof i.compressionEnabled||i.compressionEnabled,this.identityProvider=i.identityProvider}get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}setChildren(e,t=Ae.empty(),i){const n=i.diffIdentityProvider&&ZF(i.diffIdentityProvider);if(null===e){const e=Ae.map(t,this.enabled?qF:$F);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const o=this.nodes.get(e);if(!o)throw new Error("Unknown compressed tree node");const s=this.model.getNode(o),r=this.model.getParentNodeLocation(o),a=this.model.getNode(r),l=YF(s),c=XF(l,e,t),d=(this.enabled?qF:$F)(c),h=a.children.map(e=>e===s?d:e);this._setChildren(a.element,h,{diffIdentityProvider:n,diffDepth:s.depth-a.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode(),i=t.children,n=Ae.map(i,YF),o=Ae.map(n,e?qF:$F);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,o=e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},s=e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:s}))}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("undefined"===typeof 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]}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 JF=e=>e[e.length-1];class eB{constructor(e,t){this.unwrapper=e,this.node=t}get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new eB(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}}function tB(e,t){return{splice(i,n,o){t.splice(i,n,o.map(t=>e.map(t)))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}function iB(e,t){return Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId(i){return t.identityProvider.getId(e(i))}},sorter:t.sorter&&{compare(e,i){return t.sorter.compare(e.elements[0],i.elements[0])}},filter:t.filter&&{filter(i,n){return t.filter.filter(e(i),n)}}})}class nB{constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||JF;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new vF(e=>new eB(n,e)),this.model=new QF(e,tB(this.nodeMapper,t),iB(n,i))}get onDidSplice(){return it.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 it.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return it.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}setChildren(e,t=Ae.empty(),i={}){this.model.setChildren(e,t,i)}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)}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 oB=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};class sB extends jF{constructor(e,t,i,n,o={}){super(e,t,i,n,o)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=Ae.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 UF(e,t,i)}}class rB{constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}renderTemplate(e){const t=this.renderer.renderTemplate(e);return{compressedTreeNode:void 0,data:t}}renderElement(e,t,i,n){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===o.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return!!this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}function aB(e,t){return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(o){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}oB([F_],rB.prototype,"compressedTreeNodeProvider",null);class lB extends sB{constructor(e,t,i,n,o={}){const s=()=>this,r=n.map(e=>new rB(s,e));super(e,t,i,r,aB(s,o))}setChildren(e,t=Ae.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new nB(e,t,i)}updateOptions(e={}){super.updateOptions(e),"undefined"!==typeof e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var cB=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function dB(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function hB(e,t){return!!t.parent&&(t.parent===e||hB(e,t.parent))}function uB(e,t){return e===t||hB(e,t)||hB(t,e)}class gB{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new gB(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}}class fB{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){const t=this.renderer.renderTemplate(e);return{templateData:t}}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(...DF.classNamesArray),!0):(t.classList.remove(...DF.classNamesArray),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(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 pB(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class _B extends CR{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function bB(e){return e instanceof CR?new _B(e):e}class vB{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){this.dnd.onDragStart&&this.dnd.onDragStart(bB(e),t)}onDragOver(e,t,i,n,o=!0){return this.dnd.onDragOver(bB(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(bB(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function wB(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new vB(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},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){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return 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){return e.filter.filter(t.element,i)}},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}),sorter:void 0,expandOnlyOnTwistieClick:"undefined"===typeof e.expandOnlyOnTwistieClick?void 0:"function"!==typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),additionalScrollHeight:e.additionalScrollHeight})}function CB(e,t){t(e),e.children.forEach(e=>CB(e,t))}class yB{constructor(e,t,i,n,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new rt,this._onDidChangeNodeSlowState=new rt,this.nodeMapper=new vF(e=>new gB(e)),this.disposables=new Ge,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren="undefined"!==typeof s.autoExpandSingleChildren&&s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,i,n,s),this.root=dB({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}get onDidChangeFocus(){return it.map(this.tree.onDidChangeFocus,mB)}get onDidChangeSelection(){return it.map(this.tree.onDidChangeSelection,mB)}get onMouseDblClick(){return it.map(this.tree.onMouseDblClick,pB)}get onPointer(){return it.map(this.tree.onPointer,pB)}get onDidFocus(){return this.tree.onDidFocus}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,i,n,o){const s=new AF(i),r=n.map(e=>new fB(e,this.nodeMapper,this._onDidChangeNodeSlowState.event)),a=wB(o)||{};return new sB(e,t,s,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}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return cB(this,void 0,void 0,(function*(){this.refreshPromises.forEach(e=>e.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield 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)}))}_updateChildren(e=this.root.element,t=!0,i=!1,n,o){return cB(this,void 0,void 0,(function*(){if("undefined"===typeof this.root.element)throw new bF(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield it.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,n,o),i)try{this.tree.rerender(s)}catch(r){}}))}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return cB(this,void 0,void 0,(function*(){if("undefined"===typeof this.root.element)throw new bF(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield it.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(yield this.root.refreshPromise,yield it.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&&(yield this.root.refreshPromise,yield it.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setSelection(i,t)}getSelection(){const e=this.tree.getSelection();return e.map(e=>e.element)}setFocus(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setFocus(i,t)}getFocus(){const e=this.tree.getFocus();return e.map(e=>e.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}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}refreshAndRenderNode(e,t,i,n){return cB(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)}))}refreshNode(e,t,i){return cB(this,void 0,void 0,(function*(){let n;return this.subTreeRefreshPromises.forEach((o,s)=>{!n&&uB(s,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n||this.doRefreshSubTree(e,t,i)}))}doRefreshSubTree(e,t,i){return cB(this,void 0,void 0,(function*(){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 o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield lo.settled(o.map(e=>this.doRefreshSubTree(e,t,i)))}finally{n()}}))}doRefreshNode(e,t,i){return cB(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=to(800);t.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},e=>null),n=this.doGetChildren(e).finally(()=>t.cancel())}else n=Promise.resolve(Ae.empty());try{const o=yield n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),De(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}))}doGetChildren(e){let t=this.refreshPromises.get(e);return t||(t=Zn(()=>cB(this,void 0,void 0,(function*(){const t=yield this.dataSource.getChildren(e.element);return this.processChildren(t)}))),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(xe))}setChildren(e,t,i,n){const o=[...t];if(0===e.children.length&&0===o.length)return[];const s=new Map,r=new Map;for(const c of e.children)if(s.set(c.element,c),this.identityProvider){const e=this.tree.isCollapsed(c);r.set(c.id,{node:c,collapsed:e})}const a=[],l=o.map(t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=dB({element:t,parent:e,hasChildren:o});return o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(i.collapsedByDefault=!1,a.push(i)),i}const l=this.identityProvider.getId(t).toString(),c=r.get(l);if(c){const e=c.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?c.collapsed?(e.children.forEach(e=>CB(e,e=>this.nodes.delete(e.element))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(e.collapsedByDefault=!1,a.push(e)),e}const d=dB({element:t,parent:e,id:l,hasChildren:o});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?a.push(d):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(d.collapsedByDefault=!1,a.push(d)),d});for(const c of s.values())CB(c,e=>this.nodes.delete(e.element));for(const c of l)this.nodes.set(c.element,c);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].collapsedByDefault=!1,a.push(l[0])),a}render(e,t,i){const n=e.children.map(e=>this.asTreeElement(e,t)),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId(e){return i.diffIdentityProvider.getId(e.element)}}});this.tree.setChildren(e===this.root?null:e,n,o),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 i=!(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?Ae.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()}}class SB{constructor(e){this.node=e}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 SB(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}}class xB{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){const t=this.renderer.renderTemplate(e);return{templateData:t}}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(...DF.classNamesArray),!0):(t.classList.remove(...DF.classNamesArray),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Ue(this.disposables)}}function kB(e){const t=e&&wB(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(e=>e.element))}})})}class LB extends yB{constructor(e,t,i,n,o,s,r={}){super(e,t,i,o,s,r),this.compressionDelegate=n,this.compressibleNodeMapper=new vF(e=>new SB(e)),this.filter=r.filter}createTree(e,t,i,n,o){const s=new AF(i),r=n.map(e=>new xB(e,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),a=kB(o)||{};return new lB(e,t,s,r,a)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=e=>this.identityProvider.getId(e).toString(),n=e=>{const t=new Set;for(const n of e){const e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(const n of e.element.elements)t.add(i(n.element))}return t},o=n(this.tree.getSelection()),s=n(this.tree.getFocus());super.render(e,t);const r=this.getSelection();let a=!1;const l=this.getFocus();let c=!1;const d=e=>{const t=e.element;if(t)for(let n=0;n<t.elements.length;n++){const e=i(t.elements[n].element),d=t.elements[t.elements.length-1].element;o.has(e)&&-1===r.indexOf(d)&&(r.push(d),a=!0),s.has(e)&&-1===l.indexOf(d)&&(l.push(d),c=!0)}e.children.forEach(d)};d(this.tree.getCompressedTreeNode(e===this.root?null:e)),a&&this.setSelection(r),c&&this.setFocus(l)}processChildren(e){return this.filter&&(e=Ae.filter(e,e=>{const t=this.filter.filter(e,1),i=EB(t);if(2===i)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===i})),super.processChildren(e)}}function EB(e){return"boolean"===typeof e?e?1:0:wF(e)?CF(e.visibility):CF(e)}class DB extends jF{constructor(e,t,i,n,o,s={}){super(e,t,i,n,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,i){return new UF(e,t,i)}}new Sm("isWindows",s["i"],o("isWindows","Whether the operating system is Windows"));const NB="inputFocus";var IB=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},TB=function(e,t){return function(i,n){t(i,n,e)}};const MB=gn("listService");let OB=class{constructor(e){this._themeService=e,this.disposables=new Ge,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}get lastFocusedList(){return this._lastFocusedWidget}register(e,t){if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;const e=new UR(Zo(),"");this.disposables.add(jP(e,this._themeService))}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),e.getHTMLElement()===document.activeElement&&(this._lastFocusedWidget=e),$e(e.onDidFocus(()=>this._lastFocusedWidget=e),qe(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(e=>e!==i),this._lastFocusedWidget===e&&(this._lastFocusedWidget=void 0)}))}dispose(){this.disposables.dispose()}};OB=IB([TB(0,jp)],OB);const AB=new Sm("listFocus",!0),PB=new Sm("listSupportsMultiselect",!0),RB=(im.and(AB,im.not(NB)),new Sm("listHasSelectionOrFocus",!1)),FB=new Sm("listDoubleSelection",!1),BB=new Sm("listMultiSelection",!1),WB=new Sm("listSelectionNavigation",!1),VB="listAutomaticKeyboardNavigation";function zB(e,t){const i=e.createScoped(t.getHTMLElement());return AB.bindTo(i),i}const HB="workbench.list.multiSelectModifier",KB="workbench.list.openMode",jB="workbench.list.horizontalScrolling",UB="workbench.list.keyboardNavigation",$B="workbench.list.automaticKeyboardNavigation",qB="workbench.tree.indent",GB="workbench.tree.renderIndentGuides",YB="workbench.list.smoothScrolling",XB="workbench.list.mouseWheelScrollSensitivity",ZB="workbench.list.fastScrollSensitivity",QB="workbench.tree.expandMode";function JB(e){return"alt"===e.getValue(HB)}class eW extends Ye{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=JB(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(HB)&&(this.useAltAsMultipleSelectionModifier=JB(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:VR(e)}isSelectionRangeChangeEvent(e){return zR(e)}}function tW(e,t,i){var n;const o=new Ge,s=Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(e){return i.mightProducePrintableCharacter(e)}},smoothScrolling:Boolean(t.getValue(YB)),mouseWheelScrollSensitivity:t.getValue(XB),fastScrollSensitivity:t.getValue(ZB),multipleSelectionController:null!==(n=e.multipleSelectionController)&&void 0!==n?n:o.add(new eW(t))});return[s,o]}let iW=class extends tF{constructor(e,t,i,n,o,s,r,a,l,c){const d="undefined"!==typeof o.horizontalScrolling?o.horizontalScrolling:Boolean(l.getValue(jB)),[h,u]=tW(o,l,c);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},HP(a.getColorTheme(),UP)),h),{horizontalScrolling:d})),this.disposables.add(u),this.contextKeyService=zB(s,this),this.themeService=a,this.listSupportsMultiSelect=PB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport);const g=WB.bindTo(this.contextKeyService);g.set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=RB.bindTo(this.contextKeyService),this.listDoubleSelection=FB.bindTo(this.contextKeyService),this.listMultiSelection=BB.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=JB(l),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),o.overrideStyles&&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(HB)&&(this._useAltAsMultipleSelectionModifier=JB(l));let t={};if(e.affectsConfiguration(jB)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(jB));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(YB)){const e=Boolean(l.getValue(YB));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(XB)){const e=l.getValue(XB);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(ZB)){const e=l.getValue(ZB);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new rW(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=jP(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),super.dispose()}};iW=IB([TB(5,xm),TB(6,MB),TB(7,jp),TB(8,lh),TB(9,IM)],iW);let nW=class extends sF{constructor(e,t,i,n,o,s,r,a,l,c){const d="undefined"!==typeof o.horizontalScrolling?o.horizontalScrolling:Boolean(l.getValue(jB)),[h,u]=tW(o,l,c);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},HP(a.getColorTheme(),UP)),h),{horizontalScrolling:d})),this.disposables=new Ge,this.disposables.add(u),this.contextKeyService=zB(s,this),this.themeService=a,this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=PB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport);const g=WB.bindTo(this.contextKeyService);g.set(Boolean(o.selectionNavigation)),this._useAltAsMultipleSelectionModifier=JB(l),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),o.overrideStyles&&this.disposables.add(jP(this,a,o.overrideStyles)),this.disposables.add(l.onDidChangeConfiguration(e=>{e.affectsConfiguration(HB)&&(this._useAltAsMultipleSelectionModifier=JB(l));let t={};if(e.affectsConfiguration(jB)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(jB));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(YB)){const e=Boolean(l.getValue(YB));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(XB)){const e=l.getValue(XB);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(ZB)){const e=l.getValue(ZB);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new rW(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=jP(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),this.disposables.dispose(),super.dispose()}};nW=IB([TB(5,xm),TB(6,MB),TB(7,jp),TB(8,lh),TB(9,IM)],nW);let oW=class extends _F{constructor(e,t,i,n,o,s,r,a,l,c,d){const h="undefined"!==typeof s.horizontalScrolling?s.horizontalScrolling:Boolean(c.getValue(jB)),[u,g]=tW(s,c,d);super(e,t,i,n,o,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},HP(l.getColorTheme(),UP)),u),{horizontalScrolling:h})),this.disposables=new Ge,this.disposables.add(g),this.contextKeyService=zB(r,this),this.themeService=l,this.listSupportsMultiSelect=PB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport);const f=WB.bindTo(this.contextKeyService);f.set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=RB.bindTo(this.contextKeyService),this.listDoubleSelection=FB.bindTo(this.contextKeyService),this.listMultiSelection=BB.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=JB(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),s.overrideStyles&&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(c.onDidChangeConfiguration(e=>{e.affectsConfiguration(HB)&&(this._useAltAsMultipleSelectionModifier=JB(c));let t={};if(e.affectsConfiguration(jB)&&void 0===this.horizontalScrolling){const e=Boolean(c.getValue(jB));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(YB)){const e=Boolean(c.getValue(YB));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(XB)){const e=c.getValue(XB);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(ZB)){const e=c.getValue(ZB);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new aW(this,Object.assign({configurationService:c},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=jP(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),this.disposables.dispose(),super.dispose()}};oW=IB([TB(6,xm),TB(7,MB),TB(8,jp),TB(9,lh),TB(10,IM)],oW);class sW extends Ye{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new rt),this.onDidOpen=this._onDidOpen.event,this._register(it.filter(this.widget.onDidChangeSelection,e=>e.browserEvent instanceof KeyboardEvent)(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?void 0:t.openOnSingleClick)&&(null===t||void 0===t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null===t||void 0===t?void 0:t.configurationService.getValue(KB)),this._register(null===t||void 0===t?void 0:t.configurationService.onDidChangeConfiguration(()=>{this.openOnSingleClick="doubleClick"!==(null===t||void 0===t?void 0:t.configurationService.getValue(KB))}))):this.openOnSingleClick=null===(i=null===t||void 0===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,o=!1;this._open(this.getSelectedElement(),i,n,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;const i=2===t.detail;if(i)return;const n=1===t.button,o=!0,s=n,r=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,r,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16;if(n)return;const o=!1,s=!0,r=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,r,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class rW extends sW{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class aW extends sW{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class lW 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 cW(e,t){let i=!1;return n=>{if(i)return i=!1,!1;const o=t.softDispatch(n,e);return o&&o.enterChord?(i=!0,!1):(i=!1,!0)}}let dW=class extends sB{constructor(e,t,i,n,o,s,r,a,l,c,d){const{options:h,getAutomaticKeyboardNavigation:u,disposable:g}=mW(t,o,s,l,c,d);super(e,t,i,n,h),this.disposables.add(g),this.internals=new pW(this,o,u,o.overrideStyles,s,r,a,l,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};dW=IB([TB(5,xm),TB(6,MB),TB(7,jp),TB(8,lh),TB(9,IM),TB(10,xI)],dW);let hW=class extends lB{constructor(e,t,i,n,o,s,r,a,l,c,d){const{options:h,getAutomaticKeyboardNavigation:u,disposable:g}=mW(t,o,s,l,c,d);super(e,t,i,n,h),this.disposables.add(g),this.internals=new pW(this,o,u,o.overrideStyles,s,r,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};hW=IB([TB(5,xm),TB(6,MB),TB(7,jp),TB(8,lh),TB(9,IM),TB(10,xI)],hW);let uW=class extends DB{constructor(e,t,i,n,o,s,r,a,l,c,d,h){const{options:u,getAutomaticKeyboardNavigation:g,disposable:f}=mW(t,s,r,c,d,h);super(e,t,i,n,o,u),this.disposables.add(f),this.internals=new pW(this,s,g,s.overrideStyles,r,a,l,c,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};uW=IB([TB(6,xm),TB(7,MB),TB(8,jp),TB(9,lh),TB(10,IM),TB(11,xI)],uW);let gW=class extends yB{constructor(e,t,i,n,o,s,r,a,l,c,d,h){const{options:u,getAutomaticKeyboardNavigation:g,disposable:f}=mW(t,s,r,c,d,h);super(e,t,i,n,o,u),this.disposables.add(f),this.internals=new pW(this,s,g,s.overrideStyles,r,a,l,c,h),this.disposables.add(this.internals)}get onDidOpen(){return this.internals.onDidOpen}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};gW=IB([TB(6,xm),TB(7,MB),TB(8,jp),TB(9,lh),TB(10,IM),TB(11,xI)],gW);let fW=class extends LB{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u){const{options:g,getAutomaticKeyboardNavigation:f,disposable:m}=mW(t,r,a,d,h,u);super(e,t,i,n,o,s,g),this.disposables.add(m),this.internals=new pW(this,r,f,r.overrideStyles,a,l,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function mW(e,t,i,n,o,s){var r;const a=()=>{let e=Boolean(i.getContextKeyValue(VB));return e&&(e=Boolean(n.getValue($B))),e},l=s.isScreenReaderOptimized(),c=t.simpleKeyboardNavigation||l?"simple":n.getValue(UB),d=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(n.getValue(jB)),[h,u]=tW(t,n,o),g=t.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},h),{indent:"number"===typeof n.getValue(qB)?n.getValue(qB):void 0,renderIndentGuides:n.getValue(GB),smoothScrolling:Boolean(n.getValue(YB)),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:"simple"===c,filterOnType:"filter"===c,horizontalScrolling:d,keyboardNavigationEventFilter:cW(e,o),additionalScrollHeight:g,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:null!==(r=t.expandOnlyOnTwistieClick)&&void 0!==r?r:"doubleClick"===n.getValue(QB)})}}fW=IB([TB(7,xm),TB(8,MB),TB(9,jp),TB(10,lh),TB(11,IM),TB(12,xI)],fW);let pW=class{constructor(e,t,i,n,o,s,r,a,l){this.tree=e,this.themeService=r,this.disposables=[],this.contextKeyService=zB(o,e),this.listSupportsMultiSelect=PB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport);const c=WB.bindTo(this.contextKeyService);c.set(Boolean(t.selectionNavigation)),this.hasSelectionOrFocus=RB.bindTo(this.contextKeyService),this.hasDoubleSelection=FB.bindTo(this.contextKeyService),this.hasMultiSelection=BB.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=JB(a);const d=new Set;d.add(VB);const h=()=>{const t=l.isScreenReaderOptimized(),i=t?"simple":a.getValue(UB);e.updateOptions({simpleKeyboardNavigation:"simple"===i,filterOnType:"filter"===i})};this.updateStyleOverrides(n),this.disposables.push(this.contextKeyService,s.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)}),a.onDidChangeConfiguration(n=>{let o={};if(n.affectsConfiguration(HB)&&(this._useAltAsMultipleSelectionModifier=JB(a)),n.affectsConfiguration(qB)){const e=a.getValue(qB);o=Object.assign(Object.assign({},o),{indent:e})}if(n.affectsConfiguration(GB)){const e=a.getValue(GB);o=Object.assign(Object.assign({},o),{renderIndentGuides:e})}if(n.affectsConfiguration(YB)){const e=Boolean(a.getValue(YB));o=Object.assign(Object.assign({},o),{smoothScrolling:e})}if(n.affectsConfiguration(UB)&&h(),n.affectsConfiguration($B)&&(o=Object.assign(Object.assign({},o),{automaticKeyboardNavigation:i()})),n.affectsConfiguration(jB)&&void 0===t.horizontalScrolling){const e=Boolean(a.getValue(jB));o=Object.assign(Object.assign({},o),{horizontalScrolling:e})}if(n.affectsConfiguration(QB)&&void 0===t.expandOnlyOnTwistieClick&&(o=Object.assign(Object.assign({},o),{expandOnlyOnTwistieClick:"doubleClick"===a.getValue(QB)})),n.affectsConfiguration(XB)){const e=a.getValue(XB);o=Object.assign(Object.assign({},o),{mouseWheelScrollSensitivity:e})}if(n.affectsConfiguration(ZB)){const e=a.getValue(ZB);o=Object.assign(Object.assign({},o),{fastScrollSensitivity:e})}Object.keys(o).length>0&&e.updateOptions(o)}),this.contextKeyService.onDidChangeContext(t=>{t.affectsSome(d)&&e.updateOptions({automaticKeyboardNavigation:i()})}),l.onDidChangeScreenReaderOptimized(()=>h())),this.navigator=new lW(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}get onDidOpen(){return this.navigator.onDidOpen}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){Ue(this.styler),this.styler=e?jP(this.tree,this.themeService,e):Ye.None}dispose(){this.disposables=Ue(this.disposables),Ue(this.styler),this.styler=void 0}};pW=IB([TB(4,xm),TB(5,MB),TB(6,jp),TB(7,lh),TB(8,xI)],pW);const _W=zd.as($d.Configuration);var bW,vW;_W.registerConfiguration({id:"workbench",order:7,title:o("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[HB]:{type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[o("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),o("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:o({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.")},[KB]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:o({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.")},[jB]:{type:"boolean",default:!1,description:o("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[qB]:{type:"number",default:8,minimum:0,maximum:40,description:o("tree indent setting","Controls tree indentation in pixels.")},[GB]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:o("render tree indent guides","Controls whether the tree should render indent guides.")},[YB]:{type:"boolean",default:!1,description:o("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[XB]:{type:"number",default:1,description:o("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[ZB]:{type:"number",default:5,description:o("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[UB]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[o("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),o("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),o("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:o("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")},[$B]:{type:"boolean",default:!0,markdownDescription:o("automatic keyboard navigation setting","Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.")},[QB]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:o("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.")}}}),function(e){e[e["Hint"]=1]="Hint",e[e["Info"]=2]="Info",e[e["Warning"]=4]="Warning",e[e["Error"]=8]="Error"}(bW||(bW={})),function(e){function t(e,t){return t-e}e.compare=t;const i=Object.create(null);function n(e){return i[e]||""}function s(t){switch(t){case bf.Error:return e.Error;case bf.Warning:return e.Warning;case bf.Info:return e.Info;case bf.Ignore:return e.Hint}}function r(t){switch(t){case e.Error:return bf.Error;case e.Warning:return bf.Warning;case e.Info:return bf.Info;case e.Hint:return bf.Ignore}}i[e.Error]=o("sev.error","Error"),i[e.Warning]=o("sev.warning","Warning"),i[e.Info]=o("sev.info","Info"),e.toString=n,e.fromSeverity=s,e.toSeverity=r}(bW||(bW={})),function(e){const t="";function i(e){return n(e,!0)}function n(e,i){let n=[t];return e.source?n.push(e.source.replace("¦","\\¦")):n.push(t),e.code?"string"===typeof e.code?n.push(e.code.replace("¦","\\¦")):n.push(e.code.value.replace("¦","\\¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(bW.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("¦","\\¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=i,e.makeKeyOptionalMessage=n}(vW||(vW={}));const wW=gn("markerService");class CW{constructor(){this._byResource=new Pr,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 o=this._byOwner.get(t);o||(o=new Pr,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){let i=this._byResource.get(e);return null===i||void 0===i?void 0:i.get(t)}delete(e,t){let i=!1,n=!1,o=this._byResource.get(e);o&&(i=o.delete(t));let s=this._byOwner.get(t);if(s&&(n=s.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,o;return"string"===typeof e?null!==(i=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==i?i:Ae.empty():ci.isUri(e)?null!==(o=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==o?o:Ae.empty():Ae.map(Ae.concat(...this._byOwner.values()),e=>e[1])}}class yW{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Pr,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(e.scheme===co.inMemory||e.scheme===co.walkThrough||e.scheme===co.walkThroughSnippet)return t;for(const{severity:i}of this._service.read({resource:e}))i===bW.Error?t.errors+=1:i===bW.Warning?t.warnings+=1:i===bW.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 SW{constructor(){this._onMarkerChanged=new lt({delay:0,merge:SW._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new CW,this._stats=new yW(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(ku(i)){const i=this._data.delete(t,e);i&&this._onMarkerChanged.fire([t])}else{const n=[];for(const o of i){const i=SW._toMarker(e,t,o);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:c,endColumn:d,relatedInformation:h,tags:u}=i;if(s)return a=a>0?a:1,l=l>0?l:1,c=c>=a?c:a,d=d>0?d:l,{resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:c,endColumn:d,relatedInformation:h,tags:u}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const e=this._data.get(i,t);if(e){const t=[];for(const i of e)if(SW._accept(i,n)){const e=t.push(i);if(o>0&&e===o)break}return t}return[]}if(t||i){const e=this._data.values(null!==i&&void 0!==i?i:t),s=[];for(const t of e)for(const e of t)if(SW._accept(e,n)){const t=s.push(e);if(o>0&&t===o)return s}return s}{const e=[];for(let t of this._data.values())for(let i of t)if(SW._accept(i,n)){const t=e.push(i);if(o>0&&t===o)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new Pr;for(let i of e)for(let e of i)t.set(e,!0);return Array.from(t.keys())}}var xW,kW=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};(function(e){e[e["None"]=0]="None",e[e["Initialized"]=1]="Initialized",e[e["Closed"]=2]="Closed"})(xW||(xW={}));class LW extends Ye{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new rt),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=xW.None,this.cache=new Map,this.flushDelayer=new eo(LW.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;null===(t=e.changed)||void 0===t||t.forEach((e,t)=>this.accept(t,e)),null===(i=e.deleted)||void 0===i||i.forEach(e=>this.accept(e,void 0))}accept(e,t){if(this.state===xW.Closed)return;let i=!1;if(ia(t))i=this.cache.delete(e);else{const n=this.cache.get(e);n!==t&&(this.cache.set(e,t),i=!0)}i&&this._onDidChangeStorage.fire(e)}get(e,t){const i=this.cache.get(e);return ia(i)?t:i}getBoolean(e,t){const i=this.get(e);return ia(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return ia(i)?t:parseInt(i,10)}set(e,t){return kW(this,void 0,void 0,(function*(){if(this.state===xW.Closed)return;if(ia(t))return this.delete(e);const i=String(t),n=this.cache.get(e);return n!==i?(this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire(e),this.flushDelayer.trigger(()=>this.flushPending())):void 0}))}delete(e){return kW(this,void 0,void 0,(function*(){if(this.state===xW.Closed)return;const t=this.cache.delete(e);return t?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire(e),this.flushDelayer.trigger(()=>this.flushPending())):void 0}))}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return kW(this,void 0,void 0,(function*(){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)while(this.whenFlushedCallbacks.length)null===(e=this.whenFlushedCallbacks.pop())||void 0===e||e()})}))}dispose(){this.flushDelayer.dispose(),super.dispose()}}LW.DEFAULT_FLUSH_DELAY=100;class EW{constructor(){this.onDidChangeItemsExternal=it.None,this.items=new Map}updateItems(e){return kW(this,void 0,void 0,(function*(){e.insert&&e.insert.forEach((e,t)=>this.items.set(t,e)),e.delete&&e.delete.forEach(e=>this.items.delete(e))}))}}const DW="__$__targetStorageMarker",NW=gn("storageService");var IW;(function(e){e[e["NONE"]=0]="NONE",e[e["SHUTDOWN"]=1]="SHUTDOWN"})(IW||(IW={}));class TW extends Ye{constructor(e={flushInterval:TW.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new at),this._onDidChangeTarget=this._register(new at),this._onWillSaveState=this._register(new rt),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._globalKeyTargets=void 0}emitDidChangeValue(e,t){t===DW?(0===e?this._globalKeyTargets=void 0:1===e&&(this._workspaceKeyTargets=void 0),this._onDidChangeTarget.fire({scope:e})):this._onDidChangeValue.fire({scope:e,key:t,target:this.getKeyTargets(e)[t]})}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){ia(t)?this.remove(e,i):this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,i,n),null===(o=this.getStorage(i))||void 0===o||o.set(e,t)})}remove(e,t){this.withPausedEmitters(()=>{var i;this.updateKeyTarget(e,t,void 0),null===(i=this.getStorage(t))||void 0===i||i.delete(e)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i){var n,o;const s=this.getKeyTargets(t);"number"===typeof i?s[e]!==i&&(s[e]=i,null===(n=this.getStorage(t))||void 0===n||n.set(DW,JSON.stringify(s))):"number"===typeof s[e]&&(delete s[e],null===(o=this.getStorage(t))||void 0===o||o.set(DW,JSON.stringify(s)))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get globalKeyTargets(){return this._globalKeyTargets||(this._globalKeyTargets=this.loadKeyTargets(0)),this._globalKeyTargets}getKeyTargets(e){return 0===e?this.globalKeyTargets:this.workspaceKeyTargets}loadKeyTargets(e){const t=this.get(DW,e);if(t)try{return JSON.parse(t)}catch(i){}return Object.create(null)}}TW.DEFAULT_FLUSH_INTERVAL=6e4;class MW extends TW{constructor(){super(),this.globalStorage=this._register(new LW(new EW)),this.workspaceStorage=this._register(new LW(new EW)),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.globalStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e)))}getStorage(e){return 0===e?this.globalStorage:this.workspaceStorage}}var OW=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},AW=function(e,t){return function(i,n){t(i,n,e)}};let PW=class{constructor(e){this._commandService=e}createMenu(e,t,i){return new RW(e,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t,this)}};PW=OW([AW(0,ua)],PW);let RW=class e{constructor(e,t,i,n,o){this._id=e,this._options=t,this._commandService=i,this._contextKeyService=n,this._menuService=o,this._disposables=new Ge,this._menuGroups=[],this._contextKeys=new Set,this._build();const s=new so(()=>{this._build(),this._onDidChange.fire(this)},t.eventDebounceDelay);this._disposables.add(s),this._disposables.add(s_.onDidChangeMenu(t=>{t.has(e)&&s.schedule()}));const r=this._disposables.add(new Ge),a=()=>{const e=new so(()=>this._onDidChange.fire(this),t.eventDebounceDelay);r.add(e),r.add(n.onDidChangeContext(t=>{t.affectsSome(this._contextKeys)&&e.schedule()}))};this._onDidChange=new rt({onFirstListenerAdd:a,onLastListenerRemove:r.clear.bind(r)}),this.onDidChange=this._onDidChange.event}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const t=s_.getMenuItems(this._id);let i;t.sort(e._compareMenuItems);for(const e of t){const t=e.group||"";i&&i[0]===t||(i=[t,[]],this._menuGroups.push(i)),i[1].push(e),this._collectContextKeys(e)}}_collectContextKeys(t){if(e._fillInKbExprKeys(t.when,this._contextKeys),i_(t)){if(t.command.precondition&&e._fillInKbExprKeys(t.command.precondition,this._contextKeys),t.command.toggled){const i=t.command.toggled.condition||t.command.toggled;e._fillInKbExprKeys(i,this._contextKeys)}}else this._options.emitEventsForSubmenuChanges&&s_.getMenuItems(t.submenu).forEach(this._collectContextKeys,this)}getActions(e){const t=[];for(let i of this._menuGroups){const[n,o]=i,s=[];for(const t of o)if(this._contextKeyService.contextMatchesRules(t.when)){const i=i_(t)?new a_(t.command,t.alt,e,this._contextKeyService,this._commandService):new r_(t,this._menuService,this._contextKeyService,e);s.push(i)}s.length>0&&t.push([n,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(let i of e.keys())t.add(i)}static _compareMenuItems(t,i){let n=t.group,o=i.group;if(n!==o){if(!n)return 1;if(!o)return-1;if("navigation"===n)return-1;if("navigation"===o)return 1;let e=n.localeCompare(o);if(0!==e)return e}let s=t.order||0,r=i.order||0;return s<r?-1:s>r?1:e._compareTitles(i_(t)?t.command.title:t.title,i_(i)?i.command.title:i.title)}static _compareTitles(e,t){const i="string"===typeof e?e:e.original,n="string"===typeof t?t:t.original;return i.localeCompare(n)}};RW=OW([AW(2,ua),AW(3,xm),AW(4,o_)],RW);var FW=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},BW=function(e,t){return function(i,n){t(i,n,e)}};class WW extends Ye{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(qe(()=>{this.model.deltaDecorations([...this._markersData.keys()],[]),this._markersData.clear()}))}update(e,t){const i=[...this._markersData.keys()];this._markersData.clear();const n=this.model.deltaDecorations(i,t);for(let o=0;o<n.length;o++)this._markersData.set(n[o],e[o]);return 0!==i.length||0!==n.length}getMarker(e){return this._markersData.get(e.id)}}let VW=class extends Ye{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new rt),this._markerDecorations=new Pr,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 WW(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==co.inMemory&&e.uri.scheme!==co.internal&&e.uri.scheme!==co.vscode||this._markerService&&this._markerService.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});let i=t.map(t=>({range:this._createDecorationRange(e.model,t),options:this._createDecorationOption(t)}));e.update(t,i)&&this._onDidChangeMarker.fire(e.model)}_createDecorationRange(e,t){let i=Ci.lift(t);return t.severity!==bW.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),e.validateRange(i)}_createDecorationOption(e){let t,i,n,o=void 0,s=void 0;switch(e.severity){case bW.Hint:t=this._hasMarkerTag(e,2)?void 0:this._hasMarkerTag(e,1)?"squiggly-unnecessary":"squiggly-hint",i=0;break;case bW.Warning:t="squiggly-warning",o=qp(Lx),i=20,n={color:qp(zS),position:Ha.Inline};break;case bW.Info:t="squiggly-info",o=qp(Ex),i=10;break;case bW.Error:default:t="squiggly-error",o=qp(kx),i=30,n={color:qp(VS),position:Ha.Inline};break}return e.tags&&(-1!==e.tags.indexOf(1)&&(s="squiggly-inline-unnecessary"),-1!==e.tags.indexOf(2)&&(s="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:o,position:za.Right},minimap:n,zIndex:i,inlineClassName:s}}_hasMarkerTag(e,t){return!!e.tags&&e.tags.indexOf(t)>=0}};VW=FW([BW(0,Pl),BW(1,wW)],VW);var zW=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},HW=function(e,t){return function(i,n){t(i,n,e)}};let KW=class extends Ye{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new rt,this._accessibilityModeEnabledContext=kI.bindTo(this._contextKeyService);const i=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(i(),this._onDidChangeScreenReaderOptimized.fire())})),i(),this.onDidChangeScreenReaderOptimized(()=>i())}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}getAccessibilitySupport(){return this._accessibilitySupport}};KW=zW([HW(0,xm),HW(1,lh)],KW);var jW=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class UW{constructor(){this.mapTextToType=new Map,this.findText=""}writeText(e,t){return jW(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,n=document.body.appendChild(ms("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(n)}))}readText(e){return jW(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}}))}readFindText(){return jW(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return jW(this,void 0,void 0,(function*(){this.findText=e}))}}var $W=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},qW=function(e,t){return function(i,n){t(i,n,e)}},GW=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const YW=!1;function XW(e){return e.scheme===co.file?e.fsPath:e.path}let ZW=0;class QW{constructor(e,t,i,n,o,s,r){this.id=++ZW,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=o,this.sourceId=s,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 JW{constructor(e,t){this.resourceLabel=e,this.reason=t}}class eV{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements){const i=0===n.reason?e:t;i.push(n.resourceLabel)}let i=[];return e.length>0&&i.push(o({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(o({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 tV{constructor(e,t,i,n,o,s,r){this.id=++ZW,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=o,this.sourceId=s,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 eV),this.removedResources.has(t)||this.removedResources.set(t,new JW(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 eV),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new JW(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class iV{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(){let 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 t of this._future)1===t.type&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i<n;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new Dw(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let r=0,a=this._past.length;r<a;r++,n++){const s=this._past[r];i&&(n>=t||s.id!==e.elements[n])&&(i=!1,o=0),i||1!==s.type||s.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let r=this._future.length-1;r>=0;r--,n++){const o=this._future[r];i&&(n>=t||o.id!==e.elements[n])&&(i=!1,s=r),i||1!==o.type||o.removeResource(this.resourceLabel,this.strResource,0)}-1!==o&&(this._past=this._past.slice(0,o)),-1!==s&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.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 nV{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].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 oV=new iV("","");oV.locked=!0;let sV=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}: `);let t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join("\n"))}pushElement(e,t=Nw.None,i=Iw.None){if(0===e.type){const n=XW(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new QW(e,n,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,o=[],s=[];for(const t of e.resources){const e=XW(t),i=this.getUriComparisonKey(t);n.has(i)||(n.add(i),o.push(e),s.push(i))}1===o.length?this._pushElement(new QW(e,o[0],s[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new tV(e,o,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}YW&&this._print("pushElement")}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const i=e.resourceLabels[t],n=e.strResources[t];let o;this._editStacks.has(n)?o=this._editStacks.get(n):(o=new iV(i,n),this._editStacks.set(n,o)),o.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 o of i){const e=XW(o.resource),t=this.getUriComparisonKey(o.resource),i=new QW(o,e,t,0,0,0,0);n.set(i.strResource,i)}for(const o of e.strResources){if(t&&t.has(o))continue;const i=this._editStacks.get(o);i.splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const o of i){const e=XW(o.resource),t=this.getUriComparisonKey(o.resource),i=new QW(o,e,t,0,0,0,0);n.set(i.strResource,i)}for(const o of e.strResources){if(t&&t.has(o))continue;const i=this._editStacks.get(o);i.splitFutureWorkspaceElement(e,n)}}removeElements(e){const t="string"===typeof e?e:this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);e.dispose(),this._editStacks.delete(t)}YW&&this._print("removeElements")}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);if(this._editStacks.has(n)){const e=this._editStacks.get(n);e.setElementsValidFlag(t,i)}YW&&this._print("setElementsValidFlag")}createSnapshot(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);return i.createSnapshot(e)}return new Dw(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))}YW&&this._print("restoreSnapshot")}getElements(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);return e.getElements()}return{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&(s.sourceId===e&&(!t||s.sourceOrder>t.sourceOrder)&&(t=s,i=n))}return[t,i]}canUndo(e){if(e instanceof Iw){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);return e.hasPastElements()}return!1}_onError(e,t){xe(e);for(const i of t.strResources)this.removeElements(i);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,o){const s=this._acquireLocks(i);let r;try{r=t()}catch(a){return s(),n.dispose(),this._onError(a,e)}return r?r.then(()=>(s(),n.dispose(),o()),t=>(s(),n.dispose(),this._onError(t,e))):(s(),n.dispose(),o())}_invokeWorkspacePrepare(e){return GW(this,void 0,void 0,(function*(){if("undefined"===typeof e.actual.prepareUndoRedo)return Ye.None;const t=e.actual.prepareUndoRedo();return"undefined"===typeof t?Ye.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||"undefined"===typeof e.actual.prepareUndoRedo)return t(Ye.None);const i=e.actual.prepareUndoRedo();return i?je(i)?t(i):i.then(e=>t(e)):t(Ye.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||oV);return new nV(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new rV(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new rV}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,o({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,o({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 o of i.editStacks)o.getClosestPastElement()!==t&&s.push(o.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,o({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 r=[];for(const o of i.editStacks)o.locked&&r.push(o.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,o({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,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,o({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),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.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}_confirmAndExecuteWorkspaceUndo(e,t,i,n){return GW(this,void 0,void 0,(function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const s=yield this._dialogService.show(bf.Info,o("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),[o({key:"ok",comment:["{0} denotes a number that is > 1"]},"Undo in {0} Files",i.editStacks.length),o("nok","Undo this File"),o("cancel","Cancel")],{cancelId:2});if(2===s.choice)return;if(1===s.choice)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=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return s.dispose(),r.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 nV([e]),n,()=>this._continueUndoInGroup(t.groupId,i))));{const e=o({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,o]of this._editStacks){const s=o.getClosestPastElement();s&&(s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,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 Iw){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),o=n.getClosestPastElement();if(!o)return;if(o.groupId){const[e,n]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&n)return this._undo(n,t,i)}const s=o.sourceId!==t||o.confirmBeforeUndo;if(s&&!i)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{YW&&this._print("undo")}}_confirmAndContinueUndo(e,t,i){return GW(this,void 0,void 0,(function*(){const n=yield this._dialogService.show(bf.Info,o("confirmDifferentSource","Would you like to undo '{0}'?",i.label),[o("confirmDifferentSource.yes","Yes"),o("cancel","Cancel")],{cancelId:1});if(1!==n.choice)return this._undo(e,t,!0)}))}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&(s.sourceId===e&&(!t||s.sourceOrder<t.sourceOrder)&&(t=s,i=n))}return[t,i]}canRedo(e){if(e instanceof Iw){const[,t]=this._findClosestRedoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);return e.hasFutureElements()}return!1}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(n),new rV(this._redo(e));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new rV}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,o({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,o({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 o of i.editStacks)o.getClosestFutureElement()!==t&&s.push(o.resourceLabel);if(s.length>0)return this._tryToSplitAndRedo(e,t,null,o({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 r=[];for(const o of i.editStacks)o.locked&&r.push(o.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,o({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,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,o({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)}_executeWorkspaceRedo(e,t,i){return GW(this,void 0,void 0,(function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.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 nV([e]),i,()=>this._continueRedoInGroup(t.groupId))));{const e=o({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,o]of this._editStacks){const s=o.getClosestFutureElement();s&&(s.groupId===e&&(!t||s.groupOrder<t.groupOrder)&&(t=s,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 Iw){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{YW&&this._print("redo")}}}};sV=$W([qW(0,iR),qW(1,$m)],sV);class rV{constructor(e){this.returnValue=e}}bh(Ew,sV);i("88cb");const aV=new RegExp(`(\\\\)?\\$\\((${$l.iconNameExpression}(?:${$l.iconModifierExpression})?)\\)`,"g");function lV(e){const t=new Array;let i,n=0,o=0;while(null!==(i=aV.exec(e))){o=i.index||0,t.push(e.substring(n,o)),n=(i.index||0)+i[0].length;const[,s,r]=i;t.push(s?`$(${r})`:cV({id:r}))}return n<e.length&&t.push(e.substring(n)),t}function cV(e){const t=ms("span");return t.classList.add(...$l.asClassNameArray(e)),t}i("e635");const dV={buttonBackground:Lw.fromHex("#0E639C"),buttonHoverBackground:Lw.fromHex("#006BB3"),buttonForeground:Lw.white};class hV extends Ye{constructor(e,t){super(),this._onDidClick=this._register(new rt),this.options=t||Object.create(null),Da(this.options,dV,!1),this.buttonForeground=this.options.buttonForeground,this.buttonBackground=this.options.buttonBackground,this.buttonHoverBackground=this.options.buttonHoverBackground,this.buttonSecondaryForeground=this.options.buttonSecondaryForeground,this.buttonSecondaryBackground=this.options.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=this.options.buttonSecondaryHoverBackground,this.buttonBorder=this.options.buttonBorder,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),e.appendChild(this._element),this._register(V_.addTarget(this._element)),[os.CLICK,B_.Tap].forEach(e=>{this._register(bo(this._element,e,e=>{this.enabled?this._onDidClick.fire(e):ss.stop(e)}))}),this._register(bo(this._element,os.KEY_DOWN,e=>{const t=new Hn(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._element.blur(),i=!0),i&&ss.stop(t,!0)})),this._register(bo(this._element,os.MOUSE_OVER,e=>{this._element.classList.contains("disabled")||this.setHoverBackground()})),this._register(bo(this._element,os.MOUSE_OUT,e=>{this.applyStyles()})),this.focusTracker=this._register(cs(this._element)),this._register(this.focusTracker.onDidFocus(()=>this.setHoverBackground())),this._register(this.focusTracker.onDidBlur(()=>this.applyStyles())),this.applyStyles()}get onDidClick(){return this._onDidClick.event}setHoverBackground(){let e;e=this.options.secondary?this.buttonSecondaryHoverBackground?this.buttonSecondaryHoverBackground.toString():null:this.buttonHoverBackground?this.buttonHoverBackground.toString():null,e&&(this._element.style.backgroundColor=e)}style(e){this.buttonForeground=e.buttonForeground,this.buttonBackground=e.buttonBackground,this.buttonHoverBackground=e.buttonHoverBackground,this.buttonSecondaryForeground=e.buttonSecondaryForeground,this.buttonSecondaryBackground=e.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=e.buttonSecondaryHoverBackground,this.buttonBorder=e.buttonBorder,this.applyStyles()}applyStyles(){if(this._element){let e,t;this.options.secondary?(t=this.buttonSecondaryForeground?this.buttonSecondaryForeground.toString():"",e=this.buttonSecondaryBackground?this.buttonSecondaryBackground.toString():""):(t=this.buttonForeground?this.buttonForeground.toString():"",e=this.buttonBackground?this.buttonBackground.toString():"");const i=this.buttonBorder?this.buttonBorder.toString():"";this._element.style.color=t,this._element.style.backgroundColor=e,this._element.style.borderWidth=i?"1px":"",this._element.style.borderStyle=i?"solid":"",this._element.style.borderColor=i}}get element(){return this._element}set label(e){this._element.classList.add("monaco-text-button"),this.options.supportIcons?hs(this._element,...lV(e)):this._element.textContent=e,"string"===typeof this.options.title?this._element.title=this.options.title:this.options.title&&(this._element.title=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("f5ab");const uV={badgeBackground:Lw.fromHex("#4D4D4D"),badgeForeground:Lw.fromHex("#FFFFFF")};class gV{constructor(e,t){this.count=0,this.options=t||Object.create(null),Da(this.options,uV,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=ds(e,ms(".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(){this.element.textContent=Ds(this.countFormat,this.count),this.element.title=Ds(this.titleFormat,this.count),this.applyStyles()}style(e){this.badgeBackground=e.badgeBackground,this.badgeForeground=e.badgeForeground,this.badgeBorder=e.badgeBorder,this.applyStyles()}applyStyles(){if(this.element){const e=this.badgeBackground?this.badgeBackground.toString():"",t=this.badgeForeground?this.badgeForeground.toString():"",i=this.badgeBorder?this.badgeBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}}}i("2adc");const fV="done",mV="active",pV="infinite",_V="discrete",bV={progressBarBackground:Lw.fromHex("#0E70C0")};class vV extends Ye{constructor(e,t){super(),this.options=t||Object.create(null),Da(this.options,bV,!1),this.workedVal=0,this.progressBarBackground=this.options.progressBarBackground,this._register(this.showDelayedScheduler=new so(()=>ps(this.element),0)),this.create(e)}create(e){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.element.appendChild(this.bit),this.applyStyles()}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(mV,pV,_V),this.workedVal=0,this.totalWork=void 0}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(fV),this.element.classList.contains(pV)?(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(_V,fV),this.element.classList.add(mV,pV),this}getContainer(){return this.element}style(e){this.progressBarBackground=e.progressBarBackground,this.applyStyles()}applyStyles(){if(this.bit){const e=this.progressBarBackground?this.progressBarBackground.toString():"";this.bit.style.backgroundColor=e}}}class wV{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}new wV("id#");i("358f");const CV={},yV=new wV("quick-input-button-icon-");function SV(e){if(!e)return;let t;const i=e.dark.toString();return CV[i]?t=CV[i]:(t=yV.nextId(),ts("."+t,"background-image: "+ys(e.light||e.dark)),ts(`.vs-dark .${t}, .hc-black .${t}`,"background-image: "+ys(e.dark)),CV[i]=t),t}const xV={ctrlCmd:!1,alt:!1};var kV,LV;function EV(e,t={}){const i=NV(t);return i.textContent=e,i}function DV(e,t={}){const i=NV(t);return TV(i,MV(e,!!t.renderCodeSegments),t.actionHandler,t.renderCodeSegments),i}function NV(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}(function(e){e[e["Blur"]=1]="Blur",e[e["Gesture"]=2]="Gesture",e[e["Other"]=3]="Other"})(kV||(kV={})),function(e){e[e["NONE"]=0]="NONE",e[e["FIRST"]=1]="FIRST",e[e["SECOND"]=2]="SECOND",e[e["LAST"]=3]="LAST"}(LV||(LV={}));class IV{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 TV(e,t,i,n){let o;if(2===t.type)o=document.createTextNode(t.content||"");else if(3===t.type)o=document.createElement("b");else if(4===t.type)o=document.createElement("i");else if(7===t.type&&n)o=document.createElement("code");else if(5===t.type&&i){const e=document.createElement("a");e.href="#",i.disposables.add(Co(e,"click",e=>{i.callback(String(t.index),e)})),o=e}else 8===t.type?o=document.createElement("br"):1===t.type&&(o=e);o&&e!==o&&e.appendChild(o),o&&Array.isArray(t.children)&&t.children.forEach(e=>{TV(o,e,i,n)})}function MV(e,t){const i={type:1,children:[]};let n=0,o=i;const s=[],r=new IV(e);while(!r.eos()){let e=r.next();const i="\\"===e&&0!==AV(r.peek(),t);if(i&&(e=r.next()),!i&&OV(e,t)&&e===r.peek()){r.advance(),2===o.type&&(o=s.pop());const i=AV(e,t);if(o.type===i||5===o.type&&6===i)o=s.pop();else{const e={type:i,children:[]};5===i&&(e.index=n,n++),o.children.push(e),s.push(o),o=e}}else if("\n"===e)2===o.type&&(o=s.pop()),o.children.push({type:8});else if(2!==o.type){const t={type:2,content:e};o.children.push(t),s.push(o),o=t}else o.content+=e}return 2===o.type&&(o=s.pop()),s.length,i}function OV(e,t){return 0!==AV(e,t)}function AV(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}i("eba9");const PV=ms,RV={inputBackground:Lw.fromHex("#3C3C3C"),inputForeground:Lw.fromHex("#CCCCCC"),inputValidationInfoBorder:Lw.fromHex("#55AAFF"),inputValidationInfoBackground:Lw.fromHex("#063B49"),inputValidationWarningBorder:Lw.fromHex("#B89500"),inputValidationWarningBackground:Lw.fromHex("#352A05"),inputValidationErrorBorder:Lw.fromHex("#BE1100"),inputValidationErrorBackground:Lw.fromHex("#5A1D1D")};class FV extends TE{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new rt),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),Da(this.options,RV,!1),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.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=ds(e,PV(".monaco-inputbox.idle"));let o=this.options.flexibleHeight?"textarea":"input",s=ds(this.element,PV(".ibwrapper"));if(this.input=ds(s,PV(o+".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=ds(s,PV("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new sD(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),ds(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(e=>this.input.scrollTop=e.scrollTop));const t=this._register(new sT(document,"selectionchange")),i=it.filter(t.event,()=>{const e=document.getSelection();return(null===e||void 0===e?void 0:e.anchorNode)===s});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.ignoreGesture(this.input),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new ET(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}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}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:Ko(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===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()}get width(){return Vo(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){const e=parseFloat(this.mirror.style.paddingLeft||"")||0,i=parseFloat(this.mirror.style.paddingRight||"")||0;t=e+i}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.options.flexibleHeight&&this.options.flexibleWidth?this.input.style.width=`calc(100% - ${e}px)`:this.input.style.paddingRight=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){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=i.border?"1px solid "+i.border:"",(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?void 0:e.type}stylesForType(e){switch(e){case 1:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground,foreground:this.inputValidationInfoForeground};case 2:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground,foreground:this.inputValidationWarningForeground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground,foreground:this.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,t,i=()=>e.style.width=Vo(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:t=>{if(!this.message)return null;e=ds(t,PV(".monaco-inputbox-container")),i();const n={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?DV(this.message.content,n):EV(this.message.content,n);o.classList.add(this.classForType(this.message.type));const s=this.stylesForType(this.message.type);return o.style.backgroundColor=s.background?s.background.toString():"",o.style.color=s.foreground?s.foreground.toString():"",o.style.border=s.border?"1px solid "+s.border:"",ds(e,o),null},onHide:()=>{this.state="closed"},layout:i}),t=3===this.message.type?o("alertErrorMessage","Error: {0}",this.message.content):2===this.message.type?o("alertWarningMessage","Warning: {0}",this.message.content):o("alertInfoMessage","Info: {0}",this.message.content),Op(t),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=e.charCodeAt(e.length-1),i=10===t?" ":"",n=(e+i).replace(/\u000c/g,"");n?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}style(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){const e=this.inputBackground?this.inputBackground.toString():"",t=this.inputForeground?this.inputForeground.toString():"",i=this.inputBorder?this.inputBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor="inherit",this.input.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Ko(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,o=t.value;null!==i&&null!==n&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar&&this.actionbar.dispose(),super.dispose()}}const BV=ms;class WV extends Ye{constructor(e){super(),this.parent=e,this.onKeyDown=e=>bo(this.inputBox.inputElement,os.KEY_DOWN,t=>{e(new Hn(t))}),this.onMouseDown=e=>bo(this.inputBox.inputElement,os.MOUSE_DOWN,t=>{e(new qn(t))}),this.onDidChange=e=>this.inputBox.onDidChange(e),this.container=ds(this.parent,BV(".quick-input-box")),this.inputBox=this._register(new FV(this.container,void 0))}get value(){return this.inputBox.value}set value(e){this.inputBox.value=e}select(e=null){this.inputBox.select(e)}isSelectionAtEnd(){return this.inputBox.isSelectionAtEnd()}get placeholder(){return this.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.inputBox.getAriaLabel()}set ariaLabel(e){this.inputBox.setAriaLabel(e)}get password(){return"password"===this.inputBox.inputElement.type}set password(e){this.inputBox.inputElement.type=e?"password":"text"}setAttribute(e,t){this.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===bf.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===bf.Info?1:e===bf.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===bf.Info?1:e===bf.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}class VV{constructor(e,t){this.supportIcons=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=document.createElement("span"),this.domNode.className="monaco-highlighted-label",e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=VV.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&Na(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);e.push(ms("span",void 0,...this.supportIcons?lV(n):[n])),t=i.end}const n=this.text.substring(i.start,i.end),o=ms("span.highlight",void 0,...this.supportIcons?lV(n):[n]);i.extraClasses&&o.classList.add(i.extraClasses),e.push(o),t=i.end}if(t<this.text.length){const i=this.text.substring(t);e.push(ms("span",void 0,...this.supportIcons?lV(i):[i]))}hs(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,o)=>{n="\r\n"===e?-1:0,o+=i;for(const i of t)i.end<=o||(i.start>=o&&(i.start+=n),i.end>=o&&(i.end+=n));return i+=n,"⏎"})}}class zV{constructor(e="",t=!1){var i,n,o;if(this.value=e,"string"!==typeof this.value)throw Ie("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!==(o=t.supportHtml)&&void 0!==o&&o)}appendText(e,t=0){return this.value+=KV(this.supportThemeIcons?kP(e):e).replace(/([ \t]+)/g,(e,t)=>" ".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```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}}function HV(e){return e instanceof zV||!(!e||"object"!==typeof e)&&("string"===typeof e.value&&("boolean"===typeof e.isTrusted||void 0===e.isTrusted)&&("boolean"===typeof e.supportThemeIcons||void 0===e.supportThemeIcons))}function KV(e){return e.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")}var jV=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function UV(e,t){Xr(t)?e.title=t:(null===t||void 0===t?void 0:t.markdownNotSupportedFallback)?e.title=t.markdownNotSupportedFallback:e.removeAttribute("title")}class $V{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t){var i;return jV(this,void 0,void 0,(function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(void 0===e||Xr(e)||e instanceof HTMLElement)n=e;else if(oa(e.markdown)){this._hoverWidget||this.show(o("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new ft;const i=this._cancellationTokenSource.token;if(n=yield e.markdown(i),this.isDisposed||i.isCancellationRequested)return}else n=null!==(i=e.markdown)&&void 0!==i?i:e.markdownNotSupportedFallback;this.show(n,t)}))}show(e,t){const i=this._hoverWidget;if(this.hasContent(e)){const n={content:e,target:this.target,showPointer:"element"===this.hoverDelegate.placement,hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!i};this._hoverWidget=this.hoverDelegate.showHover(n,t)}null===i||void 0===i||i.dispose()}hasContent(e){return!!e&&(!HV(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 qV(e,t,i){let n,o;const s=(t,i)=>{var s;t&&(null===o||void 0===o||o.dispose(),o=void 0),i&&(null===n||void 0===n||n.dispose(),n=void 0),null===(s=e.onDidHideHover)||void 0===s||s.call(e)},r=(n,s,r)=>new no(()=>jV(this,void 0,void 0,(function*(){o&&!o.isDisposed||(o=new $V(e,r||t,n>0),yield o.update(i,s))})),n),a=()=>{if(n)return;const i=new Ge,o=e=>s(!1,e.fromElement===t);i.add(bo(t,os.MOUSE_LEAVE,o,!0));const a=()=>s(!0,!0);i.add(bo(t,os.MOUSE_DOWN,a,!0));const l={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>l.x=e.x+10;i.add(bo(t,os.MOUSE_MOVE,e,!0))}i.add(r(e.delay,!1,l)),n=i},l=bo(t,os.MOUSE_OVER,a,!0),c={show:e=>{s(!1,!0),r(0,e)},hide:()=>{s(!0,!0)},update:e=>jV(this,void 0,void 0,(function*(){i=e,yield null===o||void 0===o?void 0:o.update(i)})),dispose:()=>{l.dispose(),s(!0,!0)}};return c}i("8c32");class GV{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 YV extends Ye{constructor(e,t){super(),this.customHovers=new Map,this.domNode=this._register(new GV(ds(e,ms(".monaco-icon-label")))),this.labelContainer=ds(this.domNode.element,ms(".monaco-icon-label-container"));const i=ds(this.labelContainer,ms("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new GV(ds(this.labelContainer,ms("span.monaco-icon-description-container")))),(null===t||void 0===t?void 0:t.supportHighlights)||(null===t||void 0===t?void 0:t.supportIcons)?this.nameNode=new QV(i,!!t.supportIcons):this.nameNode=new XV(i),(null===t||void 0===t?void 0:t.supportDescriptionHighlights)?this.descriptionNodeFactory=()=>new VV(ds(this.descriptionContainer.element,ms("span.label-description")),!!t.supportIcons):this.descriptionNodeFactory=()=>this._register(new GV(ds(this.descriptionContainer.element,ms("span.label-description")))),this.hoverDelegate=null===t||void 0===t?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"];i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough")),this.domNode.className=n.join(" "),this.setupHover((null===i||void 0===i?void 0:i.descriptionTitle)?this.labelContainer:this.element,null===i||void 0===i?void 0:i.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof VV?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,null===i||void 0===i?void 0:i.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,(null===i||void 0===i?void 0:i.descriptionTitle)||""),this.descriptionNode.empty=!t))}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),t)if(this.hoverDelegate){const i=qV(this.hoverDelegate,e,t);i&&this.customHovers.set(e,i)}else UV(e,t);else e.removeAttribute("title")}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}}class XV{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!Na(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=ds(this.container,ms("a.label-name",{id:null===t||void 0===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],o=(null===t||void 0===t?void 0:t.domId)&&`${null===t||void 0===t?void 0:t.domId}_${i}`;ds(this.container,ms("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&ds(this.container,ms("span.label-separator",void 0,(null===t||void 0===t?void 0:t.separator)||"/"))}}}}function ZV(e,t,i){if(!i)return;let n=0;return e.map(e=>{const o={start:n,end:n+e.length},s=i.map(e=>EA.intersect(o,e)).filter(e=>!EA.isEmpty(e)).map(({start:e,end:t})=>({start:e-n,end:t-n}));return n=o.end+t.length,s})}class QV{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!Na(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 VV(ds(this.container,ms("a.label-name",{id:null===t||void 0===t?void 0:t.domId})),this.supportIcons)),this.singleLabel.set(e,null===t||void 0===t?void 0:t.matches,void 0,null===t||void 0===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?void 0:t.separator)||"/",n=ZV(e,i,null===t||void 0===t?void 0:t.matches);for(let o=0;o<e.length;o++){const s=e[o],r=n?n[o]:void 0,a=(null===t||void 0===t?void 0:t.domId)&&`${null===t||void 0===t?void 0:t.domId}_${o}`,l=ms("a.label-name",{id:a,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"}),c=new VV(ds(this.container,l),this.supportIcons);c.set(s,r,void 0,null===t||void 0===t?void 0:t.labelEscapeNewLines),o<e.length-1&&ds(l,ms("span.label-separator",void 0,i))}}}}i("d557");const JV=ms;class ez{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null),this.labelBackground=this.options.keybindingLabelBackground,this.labelForeground=this.options.keybindingLabelForeground,this.labelBorder=this.options.keybindingLabelBorder,this.labelBottomBorder=this.options.keybindingLabelBottomBorder,this.labelShadow=this.options.keybindingLabelShadow,this.domNode=ds(e,JV(".monaco-keybinding")),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&ez.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){if(this.clear(),this.keybinding){let[e,t]=this.keybinding.getParts();e&&this.renderPart(this.domNode,e,this.matches?this.matches.firstPart:null),t&&(ds(this.domNode,JV("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderPart(this.domNode,t,this.matches?this.matches.chordPart:null)),this.domNode.title=this.keybinding.getAriaLabel()||""}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.applyStyles(),this.didEverRender=!0}clear(){mo(this.domNode),this.keyElements.clear()}renderPart(e,t,i){const n=Vm.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,Boolean(null===i||void 0===i?void 0:i.ctrlKey),n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,Boolean(null===i||void 0===i?void 0:i.shiftKey),n.separator),t.altKey&&this.renderKey(e,n.altKey,Boolean(null===i||void 0===i?void 0:i.altKey),n.separator),t.metaKey&&this.renderKey(e,n.metaKey,Boolean(null===i||void 0===i?void 0:i.metaKey),n.separator);const o=t.keyLabel;o&&this.renderKey(e,o,Boolean(null===i||void 0===i?void 0:i.keyCode),"")}renderKey(e,t,i,n){ds(e,this.createKeyElement(t,i?".highlight":"")),n&&ds(e,JV("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){ds(e,this.createKeyElement(o("unbound","Unbound")))}createKeyElement(e,t=""){const i=JV("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),i}style(e){this.labelBackground=e.keybindingLabelBackground,this.labelForeground=e.keybindingLabelForeground,this.labelBorder=e.keybindingLabelBorder,this.labelBottomBorder=e.keybindingLabelBottomBorder,this.labelShadow=e.keybindingLabelShadow,this.applyStyles()}applyStyles(){var e;if(this.element){for(const t of this.keyElements)this.labelBackground&&(t.style.backgroundColor=null===(e=this.labelBackground)||void 0===e?void 0:e.toString()),this.labelBorder&&(t.style.borderColor=this.labelBorder.toString()),this.labelBottomBorder&&(t.style.borderBottomColor=this.labelBottomBorder.toString()),this.labelShadow&&(t.style.boxShadow="inset 0 -1px 0 "+this.labelShadow);this.labelForeground&&(this.element.style.color=this.labelForeground.toString())}}static areSame(e,t){return e===t||!e&&!t||!!e&&!!t&&Na(e.firstPart,t.firstPart)&&Na(e.chordPart,t.chordPart)}}const tz=new ao(()=>{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}});function iz(e,t,i=!1){const n=e||"",o=t||"",s=tz.value.collator.compare(n,o);return tz.value.collatorIsNumeric&&0===s&&n!==o?n<o?-1:1:s}function nz(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=oz(e,t,i);if(s)return s;const r=n.endsWith(i),a=o.endsWith(i);if(r!==a)return r?-1:1;const l=iz(n,o);return 0!==l?l:n.localeCompare(o)}function oz(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=n.startsWith(i),r=o.startsWith(i);if(s!==r)return s?-1:1;if(s&&r){if(n.length<o.length)return-1;if(n.length>o.length)return 1}return 0}var sz=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},rz=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const az=ms;class lz{constructor(e){this.hidden=!1,this._onChecked=new rt,this.onChecked=this._onChecked.event,Object.assign(this,e)}get checked(){return!!this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire(e))}dispose(){this._onChecked.dispose()}}class cz{get templateId(){return cz.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=ds(e,az(".quick-input-list-entry"));const i=ds(t.entry,az("label.quick-input-list-label"));t.toDisposeTemplate.push(Co(i,os.CLICK,e=>{t.checkbox.offsetParent||e.preventDefault()})),t.checkbox=ds(i,az("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Co(t.checkbox,os.CHANGE,e=>{t.element.checked=t.checkbox.checked}));const n=ds(i,az(".quick-input-list-rows")),o=ds(n,az(".quick-input-list-row")),r=ds(n,az(".quick-input-list-row"));t.label=new YV(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const a=ds(o,az(".quick-input-list-entry-keybinding"));t.keybinding=new ez(a,s["a"]);const l=ds(r,az(".quick-input-list-label-meta"));return t.detail=new VV(l,!0),t.separator=ds(t.entry,az(".quick-input-list-separator")),t.actionBar=new ET(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){i.toDisposeElement=Ue(i.toDisposeElement),i.element=e,i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked(e=>i.checkbox.checked=e));const{labelHighlights:n,descriptionHighlights:o,detailHighlights:s}=e,r=Object.create(null);r.matches=n||[],r.descriptionTitle=e.saneDescription,r.descriptionMatches=o||[],r.extraClasses=e.item.iconClasses,r.italic=e.item.italic,r.strikethrough=e.item.strikethrough,i.label.setLabel(e.saneLabel,e.saneDescription,r),i.keybinding.set(e.item.keybinding),i.detail.set(e.saneDetail,s),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),i.actionBar.clear();const a=e.item.buttons;a&&a.length?(i.actionBar.push(a.map((t,i)=>{let n=t.iconClass||(t.iconPath?SV(t.iconPath):void 0);t.alwaysVisible&&(n=n?n+" always-visible":"always-visible");const o=new Wp("id-"+i,"",n,!0,()=>rz(this,void 0,void 0,(function*(){e.fireButtonTriggered({button:t,item:e.item})})));return o.tooltip=t.tooltip||"",o}),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=Ue(i.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=Ue(e.toDisposeElement),e.toDisposeTemplate=Ue(e.toDisposeTemplate)}}cz.ID="listelement";class dz{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return cz.ID}}var hz;(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"})(hz||(hz={}));class uz{constructor(e,t,i){this.parent=e,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnMeta=!0,this.sortByLabel=!0,this._onChangedAllVisibleChecked=new rt,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new rt,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new rt,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new rt,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new rt,this.onButtonTriggered=this._onButtonTriggered.event,this._onKeyDown=new rt,this.onKeyDown=this._onKeyDown.event,this._onLeave=new rt,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=ds(this.parent,az(".quick-input-list"));const n=new dz,o=new fz;this.list=i.createList("QuickInput",this.container,n,[new cz],{identityProvider:{getId:e=>e.saneLabel},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 Hn(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(s["f"]?e.metaKey:e.ctrlKey)&&this.list.setFocus(Tu(this.list.length));break;case 16:const t=this.list.getFocus();1===t.length&&0===t[0]&&this._onLeave.fire();break;case 18:const i=this.list.getFocus();1===i.length&&i[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(bo(this.container,os.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]))})),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return it.map(this.list.onDidChangeFocus,e=>e.elements.map(e=>e.item))}get onDidChangeSelection(){return it.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}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=Ue(this.elementDisposables);const t=e=>this.fireButtonTriggered(e);this.inputElements=e,this.elements=e.reduce((i,n,o)=>{var s,r,a;if("separator"!==n.type){const l=o&&e[o-1],c=n.label&&n.label.replace(/\r?\n/g," "),d=n.meta&&n.meta.replace(/\r?\n/g," "),h=n.description&&n.description.replace(/\r?\n/g," "),u=n.detail&&n.detail.replace(/\r?\n/g," "),g=n.ariaLabel||[c,h,u].map(e=>jl(e)).filter(e=>!!e).join(", ");i.push(new lz({index:o,item:n,saneLabel:c,saneMeta:d,saneAriaLabel:g,saneDescription:h,saneDetail:u,labelHighlights:null===(s=n.highlights)||void 0===s?void 0:s.label,descriptionHighlights:null===(r=n.highlights)||void 0===r?void 0:r.description,detailHighlights:null===(a=n.highlights)||void 0===a?void 0:a.detail,checked:!1,separator:l&&"separator"===l.type?l:void 0,fireButtonTriggered:t}))}return i},[]),this.elementDisposables.push(...this.elements),this.elementDisposables.push(...this.elements.map(e=>e.onChecked(()=>this.fireCheckedEvents()))),this.elementsToIndexes=this.elements.reduce((e,t,i)=>(e.set(t.item,i),e),new Map),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)}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===hz.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=hz.First),e===hz.Previous&&0===this.list.getFocus()[0]&&(e=hz.Last),e===hz.Second&&this.list.length<2&&(e=hz.First),e){case hz.First:this.list.focusFirst();break;case hz.Second:this.list.focusNth(1);break;case hz.Last:this.list.focusLast();break;case hz.Next:this.list.focusNext();break;case hz.Previous:this.list.focusPrevious();break;case hz.NextPage:this.list.focusNextPage();break;case hz.PreviousPage:this.list.focusPreviousPage();break}const t=this.list.getFocus()[0];"number"===typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${44*Math.floor(e/44)}px)`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;if(e=e.trim(),e&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let t;this.elements.forEach(i=>{const n=this.matchOnLabel?da(IP(e,DP(i.saneLabel))):void 0,o=this.matchOnDescription?da(IP(e,DP(i.saneDescription||""))):void 0,s=this.matchOnDetail?da(IP(e,DP(i.saneDetail||""))):void 0,r=this.matchOnMeta?da(IP(e,DP(i.saneMeta||""))):void 0;if(n||o||s||r?(i.labelHighlights=n,i.descriptionHighlights=o,i.detailHighlights=s,i.hidden=!1):(i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!i.item.alwaysShow),i.separator=void 0,!this.sortByLabel){const e=i.index&&this.inputElements[i.index-1];t=e&&"separator"===e.type?e:t,t&&!i.hidden&&(i.separator=t,t=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.separator=t&&"separator"===t.type?t:void 0});const t=this.elements.filter(e=>!e.hidden);if(this.sortByLabel&&e){const i=e.toLowerCase();t.sort((e,t)=>gz(e,t,i))}return this.elementsToIndexes=t.reduce((e,t,i)=>(e.set(t.item,i),e),new Map),this.list.splice(0,this.list.length,t),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(t.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=Ue(this.elementDisposables),this.disposables=Ue(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)}style(e){this.list.style(e)}}function gz(e,t,i){const n=e.labelHighlights||[],o=t.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:0===n.length&&0===o.length?0:nz(e.saneLabel,t.saneLabel,i)}sz([F_],uz.prototype,"onDidChangeFocus",null),sz([F_],uz.prototype,"onDidChangeSelection",null);class fz{getWidgetAriaLabel(){return o("quickInput","Quick Input")}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(){return"option"}}var mz=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const pz=ms,_z=Kl("quick-input-back",Ul.arrowLeft),bz={iconClass:_z.classNames,tooltip:o("quickInput.back","Back"),handle:-1};class vz extends Ye{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.noValidationMessage=vz.noPromptMessage,this._severity=bf.Ignore,this.buttonsUpdated=!1,this.onDidTriggerButtonEmitter=this._register(new rt),this.onDidHideEmitter=this._register(new rt),this.onDisposeEmitter=this._register(new rt),this.visibleDisposables=this._register(new Ge),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&&!s["c"];this._ignoreFocusOut=e&&!s["c"],t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!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.update())}hide(){this.visible&&this.ui.hide()}didHide(e=kV.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:e||" "===this.ui.title.innerHTML||(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this.busy&&!this.busyDelay&&(this.busyDelay=new no,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===bz);this.ui.leftActionBar.push(e.map((e,t)=>{const i=new Wp("id-"+t,"",e.iconClass||SV(e.iconPath),!0,()=>mz(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)})));return i.tooltip=e.tooltip||"",i}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter(e=>e!==bz);this.ui.rightActionBar.push(t.map((e,t)=>{const i=new Wp("id-"+t,"",e.iconClass||SV(e.iconPath),!0,()=>mz(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)})));return i.tooltip=e.tooltip||"",i}),{icon:!0,label:!1})}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,hs(this.ui.message,...lV(i))),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?o("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==bf.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.paddingBottom="4px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.paddingBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}vz.noPromptMessage=o("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class wz extends vz{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new rt),this.onWillAcceptEmitter=this._register(new rt),this.onDidAcceptEmitter=this._register(new rt),this.onDidCustomEmitter=this._register(new rt),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=this.ui.isScreenReaderOptimized()?LV.NONE:LV.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new rt),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new rt),this.onDidTriggerItemButtonEmitter=this._register(new rt),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}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this._value!==e&&(this._value=e||"",this.update(),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 sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=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?xV: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.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(hz.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{if(e===this.value)return;this._value=e;const t=this.ui.list.filter(this.filterValue(this.ui.inputBox.value));t&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(e)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(hz.Next),this.canSelectMany&&this.ui.list.domFocus(),ss.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(hz.Previous):this.ui.list.focus(hz.Last),this.canSelectMany&&this.ui.list.domFocus(),ss.stop(e,!0);break;case 12:this.ui.list.focus(hz.NextPage),this.canSelectMany&&this.ui.list.domFocus(),ss.stop(e,!0);break;case 11:this.ui.list.focus(hz.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),ss.stop(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(hz.First),ss.stop(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(hz.Last),ss.stop(e,!0));break}})),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&&yu(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&&yu(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&1===t.button))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&yu(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.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 bo(this.ui.container,os.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Hn(e),i=t.keyCode,n=this._quickNavigate.keybindings,o=n.some(e=>{const[n,o]=e.getParts();return!o&&(n.shiftKey&&4===i?!(t.ctrlKey||t.altKey||t.metaKey):!(!n.altKey||6!==i)||(!(!n.ctrlKey||5!==i)||!(!n.metaKey||57!==i)))});o&&(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._hideInput&&this._items.length>0;this.ui.container.classList.toggle("hidden-input",t&&!this.description);const i={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!t,progressBar:!t,visibleCount:!0,count:this.canSelectMany,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||"");const n=this.ariaLabel||this.placeholder||wz.DEFAULT_ARIA_LABEL;if(this.ui.inputBox.ariaLabel!==n&&(this.ui.inputBox.ariaLabel=n),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,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 LV.NONE:this._itemActivation=LV.FIRST;break;case LV.SECOND:this.ui.list.focus(hz.Second),this._itemActivation=LV.FIRST;break;case LV.LAST:this.ui.list.focus(hz.Last),this._itemActivation=LV.FIRST;break;default:this.trySelectFirst();break}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||"",this.ui.setComboboxAccessibility(!0),i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(hz.First)),this.keepScrollPosition&&(this.scrollTop=e)}}wz.DEFAULT_ARIA_LABEL=o("quickInputBox.ariaLabel","Type to narrow down results.");class Cz extends Ye{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new rt),this.onDidCustomEmitter=this._register(new rt),this.onDidTriggerButtonEmitter=this._register(new rt),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new rt),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new rt),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};this._register(bo(window,os.KEY_DOWN,e,!0)),this._register(bo(window,os.KEY_UP,e,!0)),this._register(bo(window,os.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=ds(this.parentElement,pz(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Zo(e),i=ds(e,pz(".quick-input-titlebar")),n=this._register(new ET(i));n.domNode.classList.add("quick-input-left-action-bar");const s=ds(i,pz(".quick-input-title")),r=this._register(new ET(i));r.domNode.classList.add("quick-input-right-action-bar");const a=ds(e,pz(".quick-input-description")),l=ds(e,pz(".quick-input-header")),c=ds(l,pz("input.quick-input-check-all"));c.type="checkbox",this._register(Co(c,os.CHANGE,e=>{const t=c.checked;S.setAllVisibleChecked(t)})),this._register(bo(c,os.CLICK,e=>{(e.x||e.y)&&g.setFocus()}));const d=ds(l,pz(".quick-input-description")),h=ds(l,pz(".quick-input-and-message")),u=ds(h,pz(".quick-input-filter")),g=this._register(new WV(u));g.setAttribute("aria-describedby",this.idPrefix+"message");const f=ds(u,pz(".quick-input-visible-count"));f.setAttribute("aria-live","polite"),f.setAttribute("aria-atomic","true");const m=new gV(f,{countFormat:o({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")}),p=ds(u,pz(".quick-input-count"));p.setAttribute("aria-live","polite");const _=new gV(p,{countFormat:o({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")}),b=ds(l,pz(".quick-input-action")),v=new hV(b);v.label=o("ok","OK"),this._register(v.onDidClick(e=>{this.onDidAcceptEmitter.fire()}));const w=ds(l,pz(".quick-input-action")),C=new hV(w);C.label=o("custom","Custom"),this._register(C.onDidClick(e=>{this.onDidCustomEmitter.fire()}));const y=ds(h,pz(`#${this.idPrefix}message.quick-input-message`)),S=this._register(new uz(e,this.idPrefix+"list",this.options));this._register(S.onChangedAllVisibleChecked(e=>{c.checked=e})),this._register(S.onChangedVisibleCount(e=>{m.setCount(e)})),this._register(S.onChangedCheckedCount(e=>{_.setCount(e)})),this._register(S.onLeave(()=>{setTimeout(()=>{g.setFocus(),this.controller instanceof wz&&this.controller.canSelectMany&&S.clearFocus()},0)})),this._register(S.onDidChangeFocus(()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")}));const x=new vV(e);x.getContainer().classList.add("quick-input-progress");const k=cs(e);return this._register(k),this._register(bo(e,os.FOCUS,e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0},!0)),this._register(k.onDidBlur(()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(kV.Blur),this.previousFocusElement=void 0})),this._register(bo(e,os.FOCUS,e=>{g.setFocus()})),this._register(bo(e,os.KEY_DOWN,t=>{const i=new Hn(t);switch(i.keyCode){case 3:ss.stop(t,!0),this.onDidAcceptEmitter.fire();break;case 9:ss.stop(t,!0),this.hide(kV.Gesture);break;case 2:if(!i.altKey&&!i.ctrlKey&&!i.metaKey){const n=[".action-label.codicon"];e.classList.contains("show-checkboxes")?n.push("input"):n.push("input[type=text]"),this.getUI().list.isDisplayed()&&n.push(".monaco-list");const o=e.querySelectorAll(n.join(", "));i.shiftKey&&i.target===o[0]?(ss.stop(t,!0),o[o.length-1].focus()):i.shiftKey||i.target!==o[o.length-1]||(ss.stop(t,!0),o[0].focus())}break}})),this.ui={container:e,styleSheet:t,leftActionBar:n,titleBar:i,title:s,description1:a,description2:d,rightActionBar:r,checkAll:c,filterContainer:u,inputBox:g,visibleCountContainer:f,visibleCount:m,countContainer:p,count:_,okContainer:b,ok:v,message:y,customButtonContainer:w,customButton:C,list:S,progressBar:x,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setComboboxAccessibility:e=>this.setComboboxAccessibility(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e)},this.updateStyles(),this.ui}pick(e,t={},i=ut.None){return new Promise((n,o)=>{let s=e=>{s=n,t.onKeyMods&&t.onKeyMods(r.keyMods),n(e)};if(i.isCancellationRequested)return void s(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept(()=>{if(r.canSelectMany)s(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(s(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&&(s(t),r.hide())}}),r.onDidTriggerItemButton(e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},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]),o=r.keepScrollPosition;r.keepScrollPosition=!0,r.items=e,n&&(r.activeItems=n),r.keepScrollPosition=o}}}))),r.onDidChangeValue(e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])}),i.onCancellationRequested(()=>{r.hide()}),r.onDidHide(()=>{Ue(l),s(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.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,r.quickNavigate=t.quickNavigate,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=>{o(e),r.hide()})})}createQuickPick(){const e=this.getUI();return new wz(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i&&i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(bf.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),hs(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,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="";const n=this.options.backKeybindingLabel();bz.tooltip=n?o("quickInput.backWithKeybinding","Back ({0})",n):o("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}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.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[e.checkBox?"add":"remove"]("show-checkboxes"),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"),t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.getAction().enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.getAction().enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t;const i=this.controller;if(i){const n=!(null===(t=this.ui)||void 0===t?void 0:t.container.contains(document.activeElement));this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",n||(this.previousFocusElement&&this.previousFocusElement.offsetParent?(this.previousFocusElement.focus(),this.previousFocusElement=void 0):this.options.returnFocus()),i.didHide(e)}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui){this.ui.container.style.top=this.titleBarOffset+"px";const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,Cz.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,contrastBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e?e.toString():"",this.ui.container.style.backgroundColor=t?t.toString():"",this.ui.container.style.color=i?i.toString():"",this.ui.container.style.border=n?"1px solid "+n:"",this.ui.container.style.boxShadow=o?"0 0 8px 2px "+o:"",this.ui.inputBox.style(this.styles.inputBox),this.ui.count.style(this.styles.countBadge),this.ui.ok.style(this.styles.button),this.ui.customButton.style(this.styles.button),this.ui.progressBar.style(this.styles.progressBar),this.ui.list.style(this.styles.list);const s=[];this.styles.list.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`),this.styles.list.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const r=s.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}}var yz;Cz.MAX_WIDTH=600,function(e){e[e["PRESERVE"]=0]="PRESERVE",e[e["LAST"]=1]="LAST"}(yz||(yz={}));const Sz={Quickaccess:"workbench.contributions.quickaccess"};class xz{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),qe(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return xu([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){const t=e&&this.providers.find(t=>e.startsWith(t.prefix))||void 0;return t||this.defaultProvider}}zd.add(Sz.Quickaccess,new xz);const kz=gn("quickInputService");var Lz=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ez=function(e,t){return function(i,n){t(i,n,e)}};let Dz=class extends Ye{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=zd.as(Sz.Quickaccess),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[o,s]=this.getOrInstantiateProvider(e),r=this.visibleQuickAccess,a=null===r||void 0===r?void 0:r.descriptor;if(r&&s&&a===s)return e===s.prefix||(null===i||void 0===i?void 0:i.preserveValue)||(r.picker.value=e),void this.adjustValueSelection(r.picker,s,i);if(s&&!(null===i||void 0===i?void 0:i.preserveValue)){let t=void 0;if(r&&a&&a!==s){const e=r.value.substr(a.prefix.length);e&&(t=`${s.prefix}${e}`)}if(!t){const e=null===o||void 0===o?void 0:o.defaultFilterValue;e===yz.LAST?t=this.lastAcceptedPickerValues.get(s):"string"===typeof e&&(t=`${s.prefix}${e}`)}"string"===typeof t&&(e=t)}const l=new Ge,c=l.add(this.quickInputService.createQuickPick());c.value=e,this.adjustValueSelection(c,s,i),c.placeholder=null===s||void 0===s?void 0:s.placeholder,c.quickNavigate=null===i||void 0===i?void 0:i.quickNavigateConfiguration,c.hideInput=!!c.quickNavigate&&!r,("number"===typeof(null===i||void 0===i?void 0:i.itemActivation)||(null===i||void 0===i?void 0:i.quickNavigateConfiguration))&&(c.itemActivation=null!==(n=null===i||void 0===i?void 0:i.itemActivation)&&void 0!==n?n:LV.SECOND),c.contextKey=null===s||void 0===s?void 0:s.contextKey,c.filterValue=e=>e.substring(s?s.prefix.length:0),(null===s||void 0===s?void 0:s.placeholder)&&(c.ariaLabel=null===s||void 0===s?void 0:s.placeholder);let d=void 0,h=void 0;t&&(d=new Promise(e=>h=e),l.add(Oe(c.onWillAccept)(e=>{e.veto(),c.hide()}))),l.add(this.registerPickerListeners(c,o,s,e));const u=l.add(new ft);return o&&l.add(o.provide(c,u.token)),Oe(c.onDidHide)(()=>{0===c.selectedItems.length&&u.cancel(),l.dispose(),null===h||void 0===h||h(c.selectedItems)}),c.show(),t?d:void 0}adjustValueSelection(e,t,i){var n;let o;o=(null===i||void 0===i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null===t||void 0===t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n){const o=new Ge,s=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return o.add(qe(()=>{s===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),o.add(e.onDidChangeValue(e=>{const[i]=this.getOrInstantiateProvider(e);i!==t?this.show(e,{preserveValue:!0}):s.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]}};Dz=Lz([Ez(0,kz),Ez(1,hn)],Dz);var Nz=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Iz=function(e,t){return function(i,n){t(i,n,e)}};let Tz=class extends Jp{constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.accessibilityService=n,this.layoutService=o,this.contexts=new Map}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Dz))),this._quickAccess}createController(e=this.layoutService,t){var i,n;const o={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,isScreenReaderOptimized:()=>this.accessibilityService.isScreenReaderOptimized(),backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),returnFocus:()=>e.focus(),createList:(e,t,i,n,o)=>this.instantiationService.createInstance(iW,e,t,i,n,o),styles:this.computeStyles()},s=this._register(new Cz(Object.assign(Object.assign({},o),t)));return s.layout(e.dimension,null!==(n=null===(i=e.offset)||void 0===i?void 0:i.top)&&void 0!==n?n:0),this._register(e.onDidLayout(t=>{var i,n;return s.layout(t,null!==(n=null===(i=e.offset)||void 0===i?void 0:i.top)&&void 0!==n?n:0)})),this._register(s.onShow(()=>this.resetContextKeys())),this._register(s.onHide(()=>this.resetContextKeys())),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Sm(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),t&&t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=ut.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},HP(this.theme,{quickInputBackground:Fy,quickInputForeground:By,quickInputTitleBackground:Wy,contrastBorder:GC,widgetShadow:XC})),inputBox:HP(this.theme,{inputForeground:QC,inputBackground:ZC,inputBorder:JC,inputValidationInfoBackground:ey,inputValidationInfoForeground:ty,inputValidationInfoBorder:iy,inputValidationWarningBackground:ny,inputValidationWarningForeground:oy,inputValidationWarningBorder:sy,inputValidationErrorBackground:ry,inputValidationErrorForeground:ay,inputValidationErrorBorder:ly}),countBadge:HP(this.theme,{badgeBackground:fy,badgeForeground:my,badgeBorder:GC}),button:HP(this.theme,{buttonForeground:hy,buttonBackground:uy,buttonHoverBackground:gy,buttonBorder:GC}),progressBar:HP(this.theme,{progressBarBackground:wy}),keybindingLabel:HP(this.theme,{keybindingLabelBackground:Hy,keybindingLabelForeground:Ky,keybindingLabelBorder:jy,keybindingLabelBottomBorder:Uy,keybindingLabelShadow:XC}),list:HP(this.theme,{listBackground:Fy,listInactiveFocusForeground:NS,listInactiveSelectionIconForeground:IS,listInactiveFocusBackground:TS,listFocusOutline:YC,listInactiveFocusOutline:YC,pickerGroupBorder:zy,pickerGroupForeground:Vy})}}};Tz=Nz([Iz(0,hn),Iz(1,xm),Iz(2,jp),Iz(3,xI),Iz(4,QP)],Tz);var Mz=function(e,t,i,n){var o,s=arguments.length,r=s<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--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Oz=function(e,t){return function(i,n){t(i,n,e)}};let Az=class extends Tz{constructor(e,t,i,n,o,s){super(t,i,n,o,s),this.host=void 0;const r=Rz.get(e);this.host={_serviceBrand:void 0,get container(){return r.widget.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus()}}createController(){return super.createController(this.host)}};Az=Mz([Oz(1,hn),Oz(2,xm),Oz(3,jp),Oz(4,xI),Oz(5,QP)],Az);let Pz=class{constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}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(Az,e);this.mapEditorToService.set(e,t),Oe(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},i=ut.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}};Pz=Mz([Oz(0,hn),Oz(1,mn)],Pz);class Rz{constructor(e){this.editor=e,this.widget=new Fz(this.editor)}static get(e){return e.getContribution(Rz.ID)}dispose(){this.widget.dispose()}}Rz.ID="editor.controller.quickInput";class Fz{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Fz.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}var Bz;Fz.ID="editor.contrib.quickInputWidget",p_(Rz.ID,Rz),function(e){const t=new SI;class i{constructor(e,t){this._serviceId=e,this._factory=t,this._value=null}get id(){return this._serviceId}get(e){if(!this._value){if(e&&(this._value=e[this._serviceId.toString()]),this._value||(this._value=this._factory(e)),!this._value)throw new Error("Service "+this._serviceId+" is missing!");t.set(this._serviceId,this._value)}return this._value}}e.LazyStaticService=i;let n=[];function o(e,t){let o=new i(e,t);return n.push(o),o}function s(e){let t=new SI;for(const[n,o]of vh())t.set(n,o);for(let n in e)e.hasOwnProperty(n)&&t.set(gn(n),e[n]);n.forEach(i=>t.set(i.id,i.get(e)));let i=new aR(t,!0);return t.set(hn,i),[t,i]}e.init=s,e.instantiationService=o(hn,()=>new aR(t,!0));const r=new _p;e.configurationService=o(lh,()=>r),e.resourceConfigurationService=o(bu,()=>new bp(r)),e.resourcePropertiesService=o(vu,()=>new vp(r)),e.contextService=o(Gm,()=>new Cp),e.labelService=o(cR,()=>new xp),e.telemetryService=o(l_,()=>new wp),e.dialogService=o(iR,()=>new up),e.notificationService=o($m,()=>new gp),e.markerService=o(wW,()=>new SW),e.modeService=o(Oc,e=>new sO),e.standaloneThemeService=o(NM,()=>new uA),e.logService=o(Wu,()=>new ju(new Ku)),e.undoRedoService=o(Ew,t=>new sV(e.dialogService.get(t),e.notificationService.get(t))),e.languageConfigurationService=o(Sh,t=>new xh(e.configurationService.get(t),e.modeService.get(t))),e.modelService=o(Pl,t=>new AO(e.configurationService.get(t),e.resourcePropertiesService.get(t),e.standaloneThemeService.get(t),e.logService.get(t),e.undoRedoService.get(t),e.modeService.get(t),e.languageConfigurationService.get(t))),e.markerDecorationsService=o(Rp,t=>new VW(e.modelService.get(t),e.markerService.get(t))),e.contextKeyService=o(xm,t=>new xA(e.configurationService.get(t))),e.codeEditorService=o(mn,t=>new jM(null,e.contextKeyService.get(t),e.standaloneThemeService.get(t))),e.editorProgressService=o(nM,()=>new hp),e.storageService=o(NW,()=>new MW),e.editorWorkerService=o(Mc,t=>new Zu(e.modelService.get(t),e.resourceConfigurationService.get(t),e.logService.get(t)))}(Bz||(Bz={}));class Wz extends Ye{constructor(e,t){super();const[i,n]=Bz.init(t);this._serviceCollection=i,this._instantiationService=n;const o=this.get(lh),s=this.get($m),r=this.get(l_),a=this.get(jp),l=this.get(Wu),c=this.get(xm);let d=(e,i)=>{let n=null;return t&&(n=t[e.toString()]),n||(n=i()),this._serviceCollection.set(e,n),n};d(xI,()=>new KW(c,o)),d(MB,()=>new OB(a));let h=d(ua,()=>new fp(this._instantiationService)),u=d(IM,()=>this._register(new mp(c,h,r,s,l,e))),g=d(QP,()=>new kp(Bz.codeEditorService.get(mn),e));d(kz,()=>new Pz(n,Bz.codeEditorService.get(mn)));let f=d(ZT,()=>this._register(new tR(g)));d(tM,()=>new UW),d(QT,()=>{const e=new ZP(r,s,f,u,a);return e.configure({blockMouse:!1}),this._register(e)}),d(o_,()=>new PW(h)),d(wf,()=>new Sp(Bz.modelService.get(Pl)))}get(e){let t=this._serviceCollection.get(e);if(!t)throw new Error("Missing service "+e);return t}set(e,t){this._serviceCollection.set(e,t)}has(e){return this._serviceCollection.has(e)}}function Vz(e,t,i){let n=new Wz(e,t),o=null;n.has(Ac)||(o=new dp(Bz.modelService.get()),n.set(Ac,o)),n.has(pa)||n.set(pa,new Sa(n.get(mn),n.get(ua)));let s=i(n);return o&&o.setEditor(s),s}function zz(e,t,i){return Vz(e,i||{},i=>new ZM(e,t,i,i.get(hn),i.get(mn),i.get(ua),i.get(xm),i.get(IM),i.get(ZT),i.get(NM),i.get($m),i.get(lh),i.get(xI),i.get(Pl),i.get(Oc)))}function Hz(e){return Bz.codeEditorService.get().onCodeEditorAdd(t=>{e(t)})}function Kz(e,t,i){return Vz(e,i||{},i=>new QM(e,t,i,i.get(hn),i.get(xm),i.get(IM),i.get(ZT),i.get(Mc),i.get(mn),i.get(NM),i.get($m),i.get(lh),i.get(QT),i.get(nM),i.get(tM)))}function jz(e,t){return new Ma(e,t)}function Uz(e,t,i){return JM(Bz.modelService.get(),Bz.modeService.get(),e,t,i)}function $z(e,t){Bz.modelService.get().setMode(e,Bz.modeService.get().create(t))}function qz(e,t,i){e&&Bz.markerService.get().changeOne(t,e.uri,i)}function Gz(e){return Bz.markerService.get().read(e)}function Yz(e){return Bz.markerService.get().onMarkerChanged(e)}function Xz(e){return Bz.modelService.get().getModel(e)}function Zz(){return Bz.modelService.get().getModels()}function Qz(e){return Bz.modelService.get().onModelAdded(e)}function Jz(e){return Bz.modelService.get().onModelRemoved(e)}function eH(e){return Bz.modelService.get().onModelModeChanged(t=>{e({model:t.model,oldLanguage:t.oldModeId})})}function tH(e){return og(Bz.modelService.get(),e)}function iH(e,t){const i=Bz.standaloneThemeService.get();return i.registerEditorContainer(e),gf.colorizeElement(i,Bz.modeService.get(),e,t)}function nH(e,t,i){const n=Bz.standaloneThemeService.get();return n.registerEditorContainer(document.body),gf.colorize(Bz.modeService.get(),e,t,i)}function oH(e,t,i=4){const n=Bz.standaloneThemeService.get();return n.registerEditorContainer(document.body),gf.colorizeModelLine(e,t,i)}function sH(e){let t=kc.get(e);return t||{getInitialState:()=>Ec,tokenize:(t,i,n,o)=>Nc(e,t,n,o)}}function rH(e,t){let i=Bz.modeService.get();i.triggerMode(t);let n=sH(t),o=Fs(e),s=[],r=n.getInitialState();for(let a=0,l=o.length;a<l;a++){let e=o[a],t=n.tokenize(e,!0,r,0);s[a]=t.tokens,r=t.endState}return s}function aH(e,t){Bz.standaloneThemeService.get().defineTheme(e,t)}function lH(e){Bz.standaloneThemeService.get().setTheme(e)}function cH(){M_()}function dH(e,t){return ga.registerCommand({id:e,handler:t})}function hH(){return{create:zz,onDidCreateEditor:Hz,createDiffEditor:Kz,createDiffNavigator:jz,createModel:Uz,setModelLanguage:$z,setModelMarkers:qz,getModelMarkers:Gz,onDidChangeMarkers:Yz,getModels:Zz,getModel:Xz,onDidCreateModel:Qz,onWillDisposeModel:Jz,onDidChangeModelLanguage:eH,createWebWorker:tH,colorizeElement:iH,colorize:nH,colorizeModelLine:oH,tokenize:rH,defineTheme:aH,setTheme:lH,remeasureFonts:cH,registerCommand:dH,AccessibilitySupport:Li,ContentWidgetPositionPreference:Ti,CursorChangeReason:Mi,DefaultEndOfLine:Oi,EditorAutoIndentStrategy:Pi,EditorOption:Ri,EndOfLinePreference:Fi,EndOfLineSequence:Bi,MinimapPosition:Ui,MouseTargetType:$i,OverlayWidgetPositionPreference:qi,OverviewRulerLane:Gi,RenderLineNumbersType:Yi,RenderMinimap:Xi,ScrollbarVisibility:Qi,ScrollType:Zi,TextEditorCursorBlinkingStyle:on,TextEditorCursorStyle:sn,TrackedRangeStickiness:rn,WrappingIndent:an,ConfigurationChangedEvent:f,BareFontInfo:Ra,FontInfo:Ba,TextModelResolvedOptions:ja,FindMatch:Ua,EditorType:Va,EditorOptions:Ce}}function uH(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 gH(e,t){return"boolean"===typeof e?e:t}function fH(e,t){return"string"===typeof e?e:t}function mH(e){const t={};for(const i of e)t[i]=!0;return t}function pH(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=mH(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 _H(e,t){t=t.replace(/@@/g,"");let i,n=0;do{i=!1,t=t.replace(/@(\w+)/g,(function(n,o){i=!0;let s="";if("string"===typeof e[o])s=e[o];else{if(!(e[o]&&e[o]instanceof RegExp))throw void 0===e[o]?Yg(e,"language definition does not contain attribute '"+o+"', used at: "+t):Yg(e,"attribute reference '"+o+"' must be a string, used at: "+t);s=e[o].source}return Ug(s)?"":"(?:"+s+")"})),n++}while(i&&n<5);t=t.replace(/\x01/g,"@");let o=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,o)}function bH(e,t,i,n){if(n<0)return e;if(n<t.length)return t[n];if(n>=100){n-=100;let e=i.split(".");if(e.unshift(i),n<e.length)return e[n]}return null}function vH(e,t,i,n){let o=-1,s=i,r=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(o=parseInt(r[3]),r[2]&&(o+=100)),s=r[4]);let a,l="~",c=s;if(s&&0!==s.length?/^\w*$/.test(c)?l="==":(r=s.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(l=r[1],c=r[2])):(l="!=",c=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(c))if("@"===l||"!@"===l){let i=e[c];if(!i)throw Yg(e,"the @ match target '"+c+"' is not defined, in rule: "+t);if(!uH((function(e){return"string"===typeof e}),i))throw Yg(e,"the @ match target '"+c+"' must be an array of strings, in rule: "+t);let n=pH(i,e.ignoreCase);a=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l)if(c.indexOf("$")<0){let t=_H(e,"^"+c+"$");a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,i,n,o){let s=_H(e,"^"+Xg(e,c,i,n,o)+"$");return s.test(t)};else if(c.indexOf("$")<0){let t=$g(e,c);a=function(e){return"=="===l?e===t:e!==t}}else{let t=$g(e,c);a=function(i,n,o,s,r){let a=Xg(e,t,n,o,s);return"=="===l?i===a:i!==a}}else{let t=pH(c.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===o?{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){let s=bH(e,t,i,o);return a(s||"",e,t,i,n)}}}function wH(e,t,i){if(i){if("string"===typeof i)return i;if(i.token||""===i.token){if("string"!==typeof i.token)throw Yg(e,"a 'token' attribute must be of type string, in rule: "+t);{let n={token:i.token};if(i.token.indexOf("$")>=0&&(n.tokenSubst=!0),"string"===typeof i.bracket)if("@open"===i.bracket)n.bracket=1;else{if("@close"!==i.bracket)throw Yg(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);n.bracket=-1}if(i.next){if("string"!==typeof i.next)throw Yg(e,"the next state must be a string value in rule: "+t);{let o=i.next;if(!/^(@pop|@push|@popall)$/.test(o)&&("@"===o[0]&&(o=o.substr(1)),o.indexOf("$")<0&&!Qg(e,Xg(e,o,"",[],""))))throw Yg(e,"the next state '"+i.next+"' is not defined in rule: "+t);n.next=o}}return"number"===typeof i.goBack&&(n.goBack=i.goBack),"string"===typeof i.switchTo&&(n.switchTo=i.switchTo),"string"===typeof i.log&&(n.log=i.log),"string"===typeof i.nextEmbedded&&(n.nextEmbedded=i.nextEmbedded,e.usesEmbedded=!0),n}}if(Array.isArray(i)){let n=[];for(let o=0,s=i.length;o<s;o++)n[o]=wH(e,t,i[o]);return{group:n}}if(i.cases){let n=[];for(let s in i.cases)if(i.cases.hasOwnProperty(s)){const o=wH(e,t,i.cases[s]);"@default"===s||"@"===s||""===s?n.push({test:void 0,value:o,name:s}):"@eos"===s?n.push({test:function(e,t,i,n){return n},value:o,name:s}):n.push(vH(e,t,s,o))}const o=e.defaultToken;return{test:function(e,t,i,s){for(const o of n){const n=!o.test||o.test(e,t,i,s);if(n)return o.value}return o}}}throw Yg(e,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+t)}return{token:""}}class CH{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 Yg(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=_H(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=wH(e,this.name,t)}}function yH(e,t){if(!t||"object"!==typeof t)throw new Error("Monarch: expecting a language definition object");let i={};i.languageId=e,i.includeLF=gH(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"===typeof t.start?t.start:null,i.ignoreCase=gH(t.ignoreCase,!1),i.unicode=gH(t.unicode,!1),i.tokenPostfix=fH(t.tokenPostfix,"."+i.languageId),i.defaultToken=fH(t.defaultToken,"source"),i.usesEmbedded=!1;let n=t;function o(e,s,r){for(const a of r){let r=a.include;if(r){if("string"!==typeof r)throw Yg(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw Yg(i,"include target '"+r+"' is not defined at: "+e);o(e+"."+r,s,t.tokenizer[r])}else{const t=new CH(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 Yg(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 Yg(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=gH(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}s.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 Yg(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(let r in t.tokenizer)if(t.tokenizer.hasOwnProperty(r)){i.start||(i.start=r);const e=t.tokenizer[r];i.tokenizer[r]=new Array,o("tokenizer."+r,i.tokenizer[r],e)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw Yg(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"}];let s=[];for(let r of t.brackets){let e=r;if(e&&Array.isArray(e)&&3===e.length&&(e={token:e[2],open:e[0],close:e[1]}),e.open===e.close)throw Yg(i,"open and close brackets in a 'brackets' attribute must be different: "+e.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!==typeof e.open||"string"!==typeof e.token||"string"!==typeof e.close)throw Yg(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");s.push({token:e.token+i.tokenPostfix,open:$g(i,e.open),close:$g(i,e.close)})}return i.brackets=s,i.noThrow=!0,i}function SH(e){_I.registerLanguage(e)}function xH(){let e=[];return e=e.concat(_I.getLanguages()),e}function kH(e){const t=Bz.modeService.get();return t.languageIdCodec.encodeLanguageId(e)}function LH(e,t){let i=Bz.modeService.get().onDidEncounterLanguage(n=>{n===e&&(i.dispose(),t())});return i}function EH(e,t){const i=Bz.modeService.get().validateLanguageId(e);if(!i)throw new Error("Cannot set configuration for unknown language "+e);return Th.register(i,t,100)}class DH{constructor(e,t){this._languageId=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i,n){if("function"===typeof this._actual.tokenize)return NH.adaptTokenize(this._languageId,this._actual,e,i,n);throw new Error("Not supported!")}tokenize2(e,t,i){let n=this._actual.tokenizeEncoded(e,i);return new ki(n.tokens,n.endState)}}class NH{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._modeService=i,this._standaloneThemeService=n}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t,i){let n=[],o=0;for(let s=0,r=e.length;s<r;s++){const r=e[s];let a=r.startIndex;0===s?a=0:a<o&&(a=o),n[s]=new Si(a+i,r.scopes,t),o=a}return n}static adaptTokenize(e,t,i,n,o){let s,r=t.tokenize(i,n),a=NH._toClassicTokens(r.tokens,e,o);return s=r.endState.equals(n)?n:r.endState,new xi(a,s)}tokenize(e,t,i,n){return NH.adaptTokenize(this._languageId,this._actual,e,i,n)}_toBinaryTokens(e,t,i){const n=e.encodeLanguageId(this._languageId),o=this._standaloneThemeService.getColorTheme().tokenTheme;let s=[],r=0,a=0;for(let c=0,d=t.length;c<d;c++){const e=t[c],l=o.match(n,e.scopes);if(r>0&&s[r-1]===l)continue;let d=e.startIndex;0===c?d=0:d<a&&(d=a),s[r++]=d+i,s[r++]=l,a=d}let l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=s[c];return l}tokenize2(e,t,i,n){let o,s=this._actual.tokenize(e,i),r=this._toBinaryTokens(this._modeService.languageIdCodec,s.tokens,n);return o=s.endState.equals(i)?i:s.endState,new ki(r,o)}}function IH(e){return"tokenizeEncoded"in e}function TH(e){return e&&"function"===typeof e.then}function MH(e){if(e){const t=[null];for(let i=1,n=e.length;i<n;i++)t[i]=Lw.fromHex(e[i]);Bz.standaloneThemeService.get().setColorMapOverride(t)}else Bz.standaloneThemeService.get().setColorMapOverride(null)}function OH(e,t){const i=Bz.modeService.get().validateLanguageId(e);if(!i)throw new Error("Cannot set tokens provider for unknown language "+e);const n=e=>IH(e)?new DH(i,e):new NH(i,e,Bz.modeService.get(),Bz.standaloneThemeService.get());return TH(t)?kc.registerPromise(e,t.then(e=>n(e))):kc.register(e,n(t))}function AH(e,t){const i=t=>df(Bz.modeService.get(),Bz.standaloneThemeService.get(),e,yH(e,t));return TH(t)?kc.registerPromise(e,t.then(e=>i(e))):kc.register(e,i(t))}function PH(e,t){return ec.register(e,t)}function RH(e,t){return tc.register(e,t)}function FH(e,t){return oc.register(e,t)}function BH(e,t){return sc.register(e,{provideHover:(e,i,n)=>{let o=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n)).then(e=>{if(e)return!e.range&&o&&(e.range=new Ci(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),e.range||(e.range=new Ci(i.lineNumber,i.column,i.lineNumber,i.column)),e})}})}function WH(e,t){return rc.register(e,t)}function VH(e,t){return ac.register(e,t)}function zH(e,t){return lc.register(e,t)}function HH(e,t){return cc.register(e,t)}function KH(e,t){return hc.register(e,t)}function jH(e,t){return uc.register(e,t)}function UH(e,t){return gc.register(e,t)}function $H(e,t,i){return mc.register(e,{providedCodeActionKinds:null===i||void 0===i?void 0:i.providedCodeActionKinds,provideCodeActions:(e,i,n,o)=>{let s=Bz.markerService.get().read({resource:e.uri}).filter(e=>Ci.areIntersectingOrTouching(e,i));return t.provideCodeActions(e,i,{markers:s,only:n.only},o)},resolveCodeAction:t.resolveCodeAction})}function qH(e,t){return pc.register(e,t)}function GH(e,t){return _c.register(e,t)}function YH(e,t){return bc.register(e,t)}function XH(e,t){return vc.register(e,t)}function ZH(e,t){return ic.register(e,t)}function QH(e,t){return wc.register(e,t)}function JH(e,t){return yc.register(e,t)}function eK(e,t){return dc.register(e,t)}function tK(e,t){return Cc.register(e,t)}function iK(e,t){return Sc.register(e,t)}function nK(e,t){return xc.register(e,t)}function oK(e,t){return nc.register(e,t)}function sK(e,t){return fc.register(e,t)}function rK(){return{register:SH,getLanguages:xH,onLanguage:LH,getEncodedLanguageId:kH,setLanguageConfiguration:EH,setColorMap:MH,setTokensProvider:OH,setMonarchTokensProvider:AH,registerReferenceProvider:PH,registerRenameProvider:RH,registerCompletionItemProvider:ZH,registerSignatureHelpProvider:FH,registerHoverProvider:BH,registerDocumentSymbolProvider:WH,registerDocumentHighlightProvider:VH,registerLinkedEditingRangeProvider:zH,registerDefinitionProvider:HH,registerImplementationProvider:KH,registerTypeDefinitionProvider:jH,registerCodeLensProvider:UH,registerCodeActionProvider:$H,registerDocumentFormattingEditProvider:qH,registerDocumentRangeFormattingEditProvider:GH,registerOnTypeFormattingEditProvider:YH,registerLinkProvider:XH,registerColorProvider:QH,registerFoldingRangeProvider:JH,registerDeclarationProvider:eK,registerSelectionRangeProvider:tK,registerDocumentSemanticTokensProvider:iK,registerDocumentRangeSemanticTokensProvider:nK,registerInlineCompletionsProvider:oK,registerInlayHintsProvider:sK,DocumentHighlightKind:Ai,CompletionItemKind:Di,CompletionItemTag:Ni,CompletionItemInsertTextRule:Ei,SymbolKind:tn,SymbolTag:nn,IndentAction:Wi,CompletionTriggerKind:Ii,SignatureHelpTriggerKind:en,InlayHintKind:Vi,InlineCompletionTriggerKind:zi,FoldingRangeKind:Jl}}class aK{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"===typeof e?e.toLowerCase():e._lower}}var lK,cK=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function dK(e){const t=[],i=new Set,n=pc.ordered(e);for(const s of n)t.push(s),s.extensionId&&i.add(aK.toKey(s.extensionId));const o=_c.ordered(e);for(const s of o){if(s.extensionId){if(i.has(aK.toKey(s.extensionId)))continue;i.add(aK.toKey(s.extensionId))}t.push({displayName:s.displayName,extensionId:s.extensionId,provideDocumentFormattingEdits(e,t,i){return s.provideDocumentRangeFormattingEdits(e,e.getFullModelRange(),t,i)}})}return t}class hK{static setFormatterSelector(e){const t=hK._selectors.unshift(e);return{dispose:t}}static select(e,t,i){return cK(this,void 0,void 0,(function*(){if(0===e.length)return;const n=Ae.first(hK._selectors);return n?yield n(e,t,i):void 0}))}}function uK(e,t,i,n,o){return cK(this,void 0,void 0,(function*(){const s=_c.ordered(t);for(const r of s){let s=yield Promise.resolve(r.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(ke);if(Lu(s))return yield e.computeMoreMinimalEdits(t.uri,s)}}))}function gK(e,t,i,n){return cK(this,void 0,void 0,(function*(){const o=dK(t);for(const s of o){let o=yield Promise.resolve(s.provideDocumentFormattingEdits(t,i,n)).catch(ke);if(Lu(o))return yield e.computeMoreMinimalEdits(t.uri,o)}}))}function fK(e,t,i,n,o){const s=bc.ordered(t);return 0===s.length||s[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(s[0].provideOnTypeFormattingEdits(t,i,n,o,ut.None)).catch(ke).then(i=>e.computeMoreMinimalEdits(t.uri,i))}hK._selectors=new Je,ga.registerCommand("_executeFormatRangeProvider",(function(e,...t){return cK(this,void 0,void 0,(function*(){const[i,n,o]=t;na(ci.isUri(i)),na(Ci.isIRange(n));const s=e.get(Ac),r=e.get(Mc),a=yield s.createModelReference(i);try{return uK(r,a.object.textEditorModel,Ci.lift(n),o,ut.None)}finally{a.dispose()}}))})),ga.registerCommand("_executeFormatDocumentProvider",(function(e,...t){return cK(this,void 0,void 0,(function*(){const[i,n]=t;na(ci.isUri(i));const o=e.get(Ac),s=e.get(Mc),r=yield o.createModelReference(i);try{return gK(s,r.object.textEditorModel,n,ut.None)}finally{r.dispose()}}))})),ga.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){return cK(this,void 0,void 0,(function*(){const[i,n,o,s]=t;na(ci.isUri(i)),na(wi.isIPosition(n)),na("string"===typeof o);const r=e.get(Ac),a=e.get(Mc),l=yield r.createModelReference(i);try{return fK(a,l.object.textEditorModel,wi.lift(n),o,s)}finally{l.dispose()}}))})),Ce.wrappingIndent.defaultValue=0,Ce.glyphMargin.defaultValue=!1,Ce.autoIndent.defaultValue=3,Ce.overviewRulerLanes.defaultValue=2,hK.setFormatterSelector((e,t,i)=>Promise.resolve(e[0]));const mK=cn();mK.editor=hH(),mK.languages=rK();const pK=mK.CancellationTokenSource,_K=mK.Emitter,bK=mK.KeyCode,vK=mK.KeyMod,wK=mK.Position,CK=mK.Range,yK=mK.Selection,SK=mK.SelectionDirection,xK=mK.MarkerSeverity,kK=mK.MarkerTag,LK=mK.Uri,EK=mK.Token,DK=mK.editor,NK=mK.languages;((null===(lK=s["b"].MonacoEnvironment)||void 0===lK?void 0:lK.globalAPI)||"function"===typeof define&&i("e6b2"))&&(self.monaco=mK),"undefined"!==typeof self.require&&"function"===typeof self.require.config&&self.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"]})},"7f36":function(e,t,i){"use strict";var n=i("7eca");i.d(t,"a",(function(){return n["languages"]}))},"7f82":function(e,t,i){var n=i("e244"),o=i("58d1"),s=i("eee7"),r=i("0b38"),a=i("762a"),l=i("f10c"),c=i("1810"),d=n.TypeError,h=c("toPrimitive");e.exports=function(e,t){if(!s(e)||r(e))return e;var i,n=a(e,h);if(n){if(void 0===t&&(t="default"),i=o(n,e,t),!s(i)||r(i))return i;throw d("Can't convert object to primitive value")}return void 0===t&&(t="number"),l(e,t)}},8120:function(e,t,i){"use strict";var n=i("83ec"),o=i("3395").trim,s=i("c55c");n({target:"String",proto:!0,forced:s("trim")},{trim:function(){return o(this)}})},"81e5":function(e,t,i){var n=i("6f9e");e.exports=n({}.isPrototypeOf)},"826e":function(e,t,i){"use strict";i.d(t,"a",(function(){return d}));var n,o,s,r=i("5491"),a=(i("ef61"),i("fa89"),i("f96e"),i("2eb0"),i("7352"),i("b485"),i("8120"),i("2c50"),i("d927"),i("d2a1"),i("b13d"),i("a2c3"),i("a8de"),i("9bf1"),i("f05e"),/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g),l=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/,c={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"'":"\\'","\\":"\\\\"};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.space||2,n=0!=t.dropQuotesOnKeys,o=t.dropQuotesOnNumbers||!1,s=t.inlineShortArrays||!1,r=t.inlineShortArraysDepth||1,a=t.quoteType||"single",l=t.minify||!1;o&&h(e);var c=f(e,null,l?void 0:i,n,a);if(s&&!l){var d=g(c);if(r>1)for(var u=1;u<r;u++)if(c=d,d=g(c),d==c)break;c=d}return c}function h(e){if(u(e)){var t=Object.keys(e);t&&t.forEach((function(t){var i=e[t];if("string"==typeof i){var n=i-0;e[t]=isNaN(n)?i:n}else(u(i)||Array.isArray(i))&&h(i)}))}}function u(e){return e&&"object"==Object(r["a"])(e)}function g(e,t){if(t||(t=80),"number"!=typeof t||t<20)throw"Invalid width '"+t+"'. Expecting number equal or larger than 20.";var i=e.split("\n"),n=0,o=null,s=[];while(n<i.length){var r=!!i[n].match(/\[/),a=!!i[n].match(/\],?/);if(r&&!a)s=[i[n]],o=n;else if(a&&!r&&o){s.push((i[n]||"").trim());var l=s.join(" ");l.length<t&&(i.splice(o,n-o+1,l),n=o),o=null,s=[]}else o&&s.push((i[n]||"").trim());n+=1}return i.join("\n")}function f(e,t,i,a,l){var c;if(n="",o="","number"===typeof i)for(c=0;c<i;c+=1)o+=" ";else"string"===typeof i&&(o=i);if(s=t,t&&"function"!==typeof t&&("object"!==Object(r["a"])(t)||"number"!==typeof t.length))throw new Error("JSON.stringify");return m("",{"":e},a,l)}function m(e,t,i,a){var l,c,d,h,u,g=n,f=t[e];switch(f&&"object"===Object(r["a"])(f)&&"function"===typeof f.toJSON&&(f=f.toJSON(e)),"function"===typeof s&&(f=s.call(t,e,f)),Object(r["a"])(f)){case"function":return f;case"string":return p(f,a);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":return String(f);case"object":if(!f)return"null";if(n+=o,u=[],"[object Array]"===Object.prototype.toString.apply(f)){for(h=f.length,l=0;l<h;l+=1)u[l]=m(l,f,i,a)||"null";return d=0===u.length?"[]":n?"[\n"+n+u.join(",\n"+n)+"\n"+g+"]":"["+u.join(",")+"]",n=g,d}if(s&&"object"===Object(r["a"])(s))for(h=s.length,l=0;l<h;l+=1)"string"===typeof s[l]&&(c=s[l],d=m(c,f,i,a),d&&u.push((i?_(c,a):p(c,a))+(n?": ":":")+d));else for(c in f)Object.prototype.hasOwnProperty.call(f,c)&&(d=m(c,f,i,a),d&&u.push((i?_(c,a):p(c,a))+(n?": ":":")+d));return d=0===u.length?"{}":n?"{\n"+n+u.join(",\n"+n)+"\n"+g+"}":"{"+u.join(",")+"}",n=g,d}}function p(e,t){a.lastIndex=0;var i='"';return"single"===t&&(i="'"),a.test(e)?i+e.replace(a,(function(e){var t=c[e];return"string"===typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+i:i+e+i}function _(e,t){return l.test(e)?e:p(e,t)}},"82a4":function(e,t,i){var n=i("933a"),o=Function.prototype,s=o.apply,r=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?r.bind(s):function(){return r.apply(s,arguments)})},"838a":function(e,t,i){var n=i("e244"),o=i("55ab"),s=i("d73d"),r=i("c401"),a=i("b896").f,l=i("35d6").get,c=RegExp.prototype,d=n.TypeError;o&&s&&a(c,"dotAll",{configurable:!0,get:function(){if(this!==c){if("RegExp"===r(this))return!!l(this).dotAll;throw d("Incompatible receiver, RegExp required")}}})},"83ec":function(e,t,i){var n=i("e244"),o=i("42b1").f,s=i("69f1"),r=i("7d86"),a=i("72c7"),l=i("8c42"),c=i("a056");e.exports=function(e,t){var i,d,h,u,g,f,m=e.target,p=e.global,_=e.stat;if(d=p?n:_?n[m]||a(m,{}):(n[m]||{}).prototype,d)for(h in t){if(g=t[h],e.noTargetGet?(f=o(d,h),u=f&&f.value):u=d[h],i=c(p?h:m+(_?".":"#")+h,e.forced),!i&&void 0!==u){if(typeof g==typeof u)continue;l(g,u)}(e.sham||u&&u.sham)&&s(g,"sham",!0),r(d,h,g,e)}}},"84f7":function(e,t,i){var n=i("55ab"),o=i("32a5").EXISTS,s=i("6f9e"),r=i("b896").f,a=Function.prototype,l=s(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,d=s(c.exec),h="name";n&&!o&&r(a,h,{configurable:!0,get:function(){try{return d(c,l(this))[1]}catch(e){return""}}})},"863c":function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));i("ef61"),i("c225"),i("37fd"),i("fa89"),i("7e50"),i("f96e"),i("2c69");var n=i("6d21");function o(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 s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?o(Object(i),!0).forEach((function(t){Object(n["a"])(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}},"871d":function(module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("d927"),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("84f7"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("b105"),core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("085b"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3__),_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("d895");__webpack_exports__["a"]={name:"config-tree",props:["data"],components:{MonacoEditor:_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_4__["a"]},data:function(){return{dialogForm:{},dialogVisible:!1,dialogRules:{label:{required:!0,message:"请输入label"},value:{required:!0,message:"请输入value"}},dialogStatus:"add",selectData:void 0,dialogInputType:"text",option:{column:[{type:"input",prop:"key",label:"key"},{type:"input",prop:"value",label:"value"}]},options:{fullScreen:!0,minimap:{enabled:!1}},dicFormatter:""}},watch:{"data.prop":{handler:function(){!this.avueVersion("2.9.0")&&this.data.cascaderItem&&(this.$set(this.data,"cascader",this.data.cascaderItem),this.$delete(this.data,"cascaderItem"));var e=this.data.dicFormatter;this.dicFormatter=e?e+"":"(res) => {\r\n return res.data\r\n}"},immediate:!0},dicFormatter:{handler:function handler(val){try{this.data.dicFormatter=eval(val)}catch(e){}}}},methods:{handleRemoveCascaderItemFields:function(e){this.avueVersion("2.9.0")?this.data.cascaderItem.splice(e,1):this.data.cascader.splice(e,1)},handleAddCascaderItemFields:function(){this.avueVersion("2.9.0")?(this.data.cascaderItem||this.$set(this.data,"cascaderItem",[]),this.data.cascaderItem.push("")):(this.data.cascader||(this.$set(this.data,"cascader",[]),delete this.data.cascaderItem),this.data.cascader.push(""))},handleTabClick:function(e){var t=e.name;"remote"!=t||this.data.dicQueryConfig||(this.data.dicQueryConfig=[])},handleParentNodeAdd:function(){this.selectData=void 0,this.dialogStatus="add",this.dialogVisible=!0},handleNodeAdd:function(e){this.selectData=e,this.dialogStatus="add",this.dialogVisible=!0},handleNodeRemove:function(e,t){var i=e.parent,n=i.data.children||i.data,o=n.findIndex((function(e){return e.id===t.id}));n.splice(o,1)},handleDialogAdd:function(){var e=this;this.$refs.dialogForm.validate((function(t){if(t){var i=e.dialogForm,n=i.label,o=i.value,s=e.$refs.tree.getNode(o);if(s)e.$message.error("value重复");else{var r=e.selectData,a={label:n,value:"number"==e.dialogInputType?new Number(o):o};r?(r.children||e.$set(r,"children",[]),r.children.push(a)):e.$set(e.data.dicData,e.data.dicData.length,a),e.beforeClose()}}}))},beforeClose:function(){this.$refs.dialogForm.clearValidate(),this.dialogForm={},this.dialogVisible=!1}}}},"88cb":function(e,t,i){var n=i("1ffd");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("3237f5a0",n,!0,{sourceMap:!1,shadowMode:!1})},"8aa3":function(e,t,i){var n=i("d6ed"),o=i("6f9e"),s=i("b4fd"),r=i("c673"),a=i("7c08"),l=i("f152"),c=o([].push),d=function(e){var t=1==e,i=2==e,o=3==e,d=4==e,h=6==e,u=7==e,g=5==e||h;return function(f,m,p,_){for(var b,v,w=r(f),C=s(w),y=n(m,p),S=a(C),x=0,k=_||l,L=t?k(f,S):i||u?k(f,0):void 0;S>x;x++)if((g||x in C)&&(b=C[x],v=y(b,x,w),e))if(t)L[x]=v;else if(v)switch(e){case 3:return!0;case 5:return b;case 6:return x;case 2:c(L,b)}else switch(e){case 4:return!1;case 7:c(L,b)}return h?-1:o||d?d:L}};e.exports={forEach:d(0),map:d(1),filter:d(2),some:d(3),every:d(4),find:d(5),findIndex:d(6),filterReject:d(7)}},"8c32":function(e,t,i){var n=i("e09a");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("130c92b9",n,!0,{sourceMap:!1,shadowMode:!1})},"8c42":function(e,t,i){var n=i("0b05"),o=i("c1ca"),s=i("42b1"),r=i("b896");e.exports=function(e,t,i){for(var a=o(t),l=r.f,c=s.f,d=0;d<a.length;d++){var h=a[d];n(e,h)||i&&n(i,h)||l(e,h,c(t,h))}}},"8d60":function(e,t,i){"use strict";var n=i("83ec"),o=i("8aa3").map,s=i("72d4"),r=s("map");n({target:"Array",proto:!0,forced:!r},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},"8dab":function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{-moz-user-select:none;user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;-ms-touch-action:none;touch-action:none}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-multiple,.monaco-list.selection-single{outline:0!important}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000}.monaco-list-type-filter{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;border-radius:2px;padding:0 3px;max-width:calc(100% - 10px);text-overflow:ellipsis;overflow:hidden;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:all-scroll;font-size:13px;line-height:18px;height:20px;z-index:1;top:4px}.monaco-list-type-filter.dragging{-webkit-transition:top .2s,left .2s;transition:top .2s,left .2s}.monaco-list-type-filter.ne{right:4px}.monaco-list-type-filter.nw{left:4px}.monaco-list-type-filter>.controls{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .2s;transition:width .2s;width:0}.monaco-list-type-filter.dragging>.controls,.monaco-list-type-filter:hover>.controls{width:36px}.monaco-list-type-filter>.controls>*{border:none;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;background:none;width:16px;height:16px;-ms-flex-negative:0;flex-shrink:0;margin:0;padding:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;cursor:pointer}.monaco-list-type-filter>.controls>.filter{margin-left:4px}.monaco-list-type-filter-message{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-list-type-filter{cursor:-webkit-grab;cursor:grab}.monaco-list-type-filter.dragging{cursor:-webkit-grabbing;cursor:grabbing}",""]),e.exports=t},"8dcc":function(e,t,i){var n=i("e244"),o=n.String;e.exports=function(e){try{return o(e)}catch(t){return"Object"}}},"8e45":function(e,t,i){var n=i("6f9e"),o=n("".replace),s=function(e){return String(Error(e).stack)}("zxcasd"),r=/\n\s*at [^:]*:[^\n]*/,a=r.test(s);e.exports=function(e,t){if(a&&"string"==typeof e)while(t--)e=o(e,r,"");return e}},"8fed":function(e,t,i){var n=i("2c21"),o=i("ac97");e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},"933a":function(e,t,i){var n=i("ac97");e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9368:function(e,t,i){var n=i("3c82");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("09a41916",n,!0,{sourceMap:!1,shadowMode:!1})},9550:function(e,t,i){var n=i("6f9e"),o=i("9564"),s=i("2f6c"),r=n(Function.toString);o(s.inspectSource)||(s.inspectSource=function(e){return r(e)}),e.exports=s.inspectSource},9564:function(e,t){e.exports=function(e){return"function"==typeof e}},"95d1":function(e,t,i){var n=i("e244"),o=i("a909"),s=i("679c"),r=i("e2da"),a=i("69f1"),l=i("1810"),c=l("iterator"),d=l("toStringTag"),h=r.values,u=function(e,t){if(e){if(e[c]!==h)try{a(e,c,h)}catch(n){e[c]=h}if(e[d]||a(e,d,t),o[t])for(var i in r)if(e[i]!==r[i])try{a(e,i,r[i])}catch(n){e[i]=r[i]}}};for(var g in o)u(n[g]&&n[g].prototype,g);u(s,"DOMTokenList")},"96cd":function(e,t,i){var n=i("6f9e");e.exports=n([].slice)},"986e":function(e,t,i){var n=i("f0db"),o=i("2f6c");(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.21.1",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"})},"9bf1":function(e,t,i){"use strict";var n=i("83ec"),o=i("e244"),s=i("5a43"),r=i("fc4e"),a=i("eee7"),l=i("3352"),c=i("7c08"),d=i("45ad"),h=i("acd4"),u=i("1810"),g=i("72d4"),f=i("96cd"),m=g("slice"),p=u("species"),_=o.Array,b=Math.max;n({target:"Array",proto:!0,forced:!m},{slice:function(e,t){var i,n,o,u=d(this),g=c(u),m=l(e,g),v=l(void 0===t?g:t,g);if(s(u)&&(i=u.constructor,r(i)&&(i===_||s(i.prototype))?i=void 0:a(i)&&(i=i[p],null===i&&(i=void 0)),i===_||void 0===i))return f(u,m,v);for(n=new(void 0===i?_:i)(b(v-m,0)),o=0;m<v;m++,o++)m in u&&h(n,o,u[m]);return n.length=o,n}})},"9c85":function(e,t,i){var n=i("eca0");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("07f8c3b0",n,!0,{sourceMap:!1,shadowMode:!1})},"9d6f":function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".mtkcontrol{color:#fff!important;background:#960000!important}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{-moz-user-select:none;user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .mtkz{display:inline-block}",""]),e.exports=t},a056:function(e,t,i){var n=i("ac97"),o=i("9564"),s=/#|\.prototype\./,r=function(e,t){var i=l[a(e)];return i==d||i!=c&&(o(t)?n(t):!!t)},a=r.normalize=function(e){return String(e).replace(s,".").toLowerCase()},l=r.data={},c=r.NATIVE="N",d=r.POLYFILL="P";e.exports=r},a078:function(e,t,i){"use strict";var n=i("4eaf").charAt,o=i("04c3"),s=i("35d6"),r=i("325d"),a="String Iterator",l=s.set,c=s.getterFor(a);r(String,"String",(function(e){l(this,{type:a,string:o(e),index:0})}),(function(){var e,t=c(this),i=t.string,o=t.index;return o>=i.length?{value:void 0,done:!0}:(e=n(i,o),t.index+=e.length,{value:e,done:!1})}))},a0c9:function(e,t,i){"use strict";e.exports=function(e,t){return t||(t={}),e=e&&e.__esModule?e.default:e,"string"!==typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},a133:function(e,t,i){var n=i("e244"),o=i("5a43"),s=i("fc4e"),r=i("eee7"),a=i("1810"),l=a("species"),c=n.Array;e.exports=function(e){var t;return o(e)&&(t=e.constructor,s(t)&&(t===c||o(t.prototype))?t=void 0:r(t)&&(t=t[l],null===t&&(t=void 0))),void 0===t?c:t}},a23c:function(e,t,i){var n=i("e263");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("152b2786",n,!0,{sourceMap:!1,shadowMode:!1})},a2c3:function(e,t,i){"use strict";i("2eb0");var n=i("83ec"),o=i("e244"),s=i("58d1"),r=i("6f9e"),a=i("9564"),l=i("eee7"),c=function(){var e=!1,t=/[ac]/;return t.exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e}(),d=o.Error,h=r(/./.test);n({target:"RegExp",proto:!0,forced:!c},{test:function(e){var t=this.exec;if(!a(t))return h(this,e);var i=s(t,this,e);if(null!==i&&!l(i))throw new d("RegExp exec method returned something other than an Object or null");return!!i}})},a2e5:function(e,t,i){var n=i("3f13");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("175f4c4c",n,!0,{sourceMap:!1,shadowMode:!1})},a40b:function(e,t,i){"use strict";i("57dc")},a484:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".dic[data-v-43992f4e]{display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:5px}",""]),e.exports=t},a52d:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}",""]),e.exports=t},a55b:function(e,t,i){var n=i("fbcf"),o=i("4e6a"),s=i("1810"),r=s("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||void 0==(i=n(s)[r])?t:o(i)}},a5f6:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"form-config-container"},[i("el-form",{attrs:{"label-position":"left","label-suffix":":","label-width":"130px",size:"small"}},[i("el-form-item",{attrs:{label:"标签对齐方式"}},[i("el-select",{attrs:{placeholder:"标签对齐方式"},model:{value:e.data.labelPosition,callback:function(t){e.$set(e.data,"labelPosition",t)},expression:"data.labelPosition"}},[i("el-option",{attrs:{label:"左对齐",value:"left"}}),i("el-option",{attrs:{label:"右对齐",value:"right"}}),i("el-option",{attrs:{label:"顶部对齐",value:"top"}})],1)],1),i("el-form-item",{attrs:{label:"标签宽度"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{min:80,max:200,step:10,"controls-position":"right",placeholder:"标签宽度"},model:{value:e.data.labelWidth,callback:function(t){e.$set(e.data,"labelWidth",t)},expression:"data.labelWidth"}})],1),i("el-form-item",{attrs:{label:"标签后缀"}},[i("el-input",{attrs:{placeholder:"标签后缀"},model:{value:e.data.labelSuffix,callback:function(t){e.$set(e.data,"labelSuffix",t)},expression:"data.labelSuffix"}})],1),i("el-form-item",{attrs:{label:"项之间的间隔"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{min:0,max:60,step:5,"controls-position":"right",placeholder:"项之间的间隔"},model:{value:e.data.gutter,callback:function(t){e.$set(e.data,"gutter",t)},expression:"data.gutter"}})],1),i("el-form-item",{attrs:{label:"多分组转标签"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.tabs,callback:function(t){e.$set(e.data,"tabs",t)},expression:"data.tabs"}})],1),i("el-form-item",{attrs:{label:"详情模式"}},[i("el-switch",{model:{value:e.data.detail,callback:function(t){e.$set(e.data,"detail",t)},expression:"data.detail"}})],1),i("el-form-item",{attrs:{label:"显示按钮"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.menuBtn,callback:function(t){e.$set(e.data,"menuBtn",t)},expression:"data.menuBtn"}})],1),e.data.menuBtn?i("el-form-item",{attrs:{label:"显示提交按钮"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.submitBtn,callback:function(t){e.$set(e.data,"submitBtn",t)},expression:"data.submitBtn"}})],1):e._e(),e.data.menuBtn&&e.data.submitBtn?i("el-form-item",{attrs:{label:"提交按钮的文字"}},[i("el-input",{attrs:{placeholder:"提交按钮的文字"},model:{value:e.data.submitText,callback:function(t){e.$set(e.data,"submitText",t)},expression:"data.submitText"}})],1):e._e(),e.data.menuBtn?i("el-form-item",{attrs:{label:"显示清空按钮"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.emptyBtn,callback:function(t){e.$set(e.data,"emptyBtn",t)},expression:"data.emptyBtn"}})],1):e._e(),e.data.menuBtn&&e.data.emptyBtn?i("el-form-item",{attrs:{label:"清空按钮的文字"}},[i("el-input",{attrs:{placeholder:"提交按钮的文字"},model:{value:e.data.emptyText,callback:function(t){e.$set(e.data,"emptyText",t)},expression:"data.emptyText"}})],1):e._e(),i("el-form-item",{attrs:{label:"全局只读"}},[i("el-switch",{model:{value:e.data.readonly,callback:function(t){e.$set(e.data,"readonly",t)},expression:"data.readonly"}})],1),i("el-form-item",{attrs:{label:"全局禁用"}},[i("el-switch",{model:{value:e.data.disabled,callback:function(t){e.$set(e.data,"disabled",t)},expression:"data.disabled"}})],1)],1)],1)},o=[],s={name:"form-config",props:["data"]},r=s,a=i("e3d4"),l=Object(a["a"])(r,n,o,!1,null,null,null);t["a"]=l.exports},a780:function(e,t,i){var n=i("6043");e.exports=n("document","documentElement")},a7f7:function(e,t,i){var n=i("e244"),o=i("0b05"),s=i("9564"),r=i("c673"),a=i("5350"),l=i("4467"),c=a("IE_PROTO"),d=n.Object,h=d.prototype;e.exports=l?d.getPrototypeOf:function(e){var t=r(e);if(o(t,c))return t[c];var i=t.constructor;return s(i)&&t instanceof i?i.prototype:t instanceof d?h:null}},a8de:function(e,t,i){"use strict";var n=i("82a4"),o=i("58d1"),s=i("6f9e"),r=i("e820"),a=i("ac97"),l=i("fbcf"),c=i("9564"),d=i("409e"),h=i("ce47"),u=i("04c3"),g=i("0874"),f=i("61c0"),m=i("762a"),p=i("c243"),_=i("ec23"),b=i("1810"),v=b("replace"),w=Math.max,C=Math.min,y=s([].concat),S=s([].push),x=s("".indexOf),k=s("".slice),L=function(e){return void 0===e?e:String(e)},E=function(){return"$0"==="a".replace(/./,"$0")}(),D=function(){return!!/./[v]&&""===/./[v]("a","$0")}(),N=!a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));r("replace",(function(e,t,i){var s=D?"$":"$0";return[function(e,i){var n=g(this),s=void 0==e?void 0:m(e,v);return s?o(s,e,n,i):o(t,u(n),e,i)},function(e,o){var r=l(this),a=u(e);if("string"==typeof o&&-1===x(o,s)&&-1===x(o,"$<")){var g=i(t,r,a,o);if(g.done)return g.value}var m=c(o);m||(o=u(o));var b=r.global;if(b){var v=r.unicode;r.lastIndex=0}var E=[];while(1){var D=_(r,a);if(null===D)break;if(S(E,D),!b)break;var N=u(D[0]);""===N&&(r.lastIndex=f(a,h(r.lastIndex),v))}for(var I="",T=0,M=0;M<E.length;M++){D=E[M];for(var O=u(D[0]),A=w(C(d(D.index),a.length),0),P=[],R=1;R<D.length;R++)S(P,L(D[R]));var F=D.groups;if(m){var B=y([O],P,A,a);void 0!==F&&S(B,F);var W=u(n(o,void 0,B))}else W=p(O,a,A,P,F,o);A>=T&&(I+=k(a,T,A)+W,T=A+O.length)}return I+k(a,T)}]}),!N||!E||D)},a909:function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},a909c:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".el-tag[data-v-4dd9db69]{vertical-align:top}.el-tag+.el-tag[data-v-4dd9db69],.input-new-tag[data-v-4dd9db69]{margin-left:5px}.input-new-tag[data-v-4dd9db69]{width:90px;vertical-align:bottom}.color-picker[data-v-4dd9db69]{left:10px;vertical-align:top}",""]),e.exports=t},ac97:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},aca4:function(e,t,i){var n=i("1810");t.f=n},acd4:function(e,t,i){"use strict";var n=i("6b7e"),o=i("b896"),s=i("4d82");e.exports=function(e,t,i){var r=n(t);r in e?o.f(e,r,s(0,i)):e[r]=i}},acff:function(e,t,i){var n=i("3ffb");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("2dbbf432",n,!0,{sourceMap:!1,shadowMode:!1})},ad2f:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-count-badge{padding:3px 6px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}",""]),e.exports=t},adae:function(e,t,i){"use strict";var n=i("83ec"),o=i("8aa3").find,s=i("6e10"),r="find",a=!0;r in[]&&Array(1)[r]((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),s(r)},adf0:function(e,t,i){var n=i("a52d");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("fc7bcae8",n,!0,{sourceMap:!1,shadowMode:!1})},b012:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{-webkit-transition:all 80ms;transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{-webkit-box-sizing:border-box;box-sizing:border-box;background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important;-webkit-box-sizing:border-box;box-sizing:border-box}@-webkit-keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@-webkit-keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@-webkit-keyframes monaco-cursor-expand{0%,20%{-webkit-transform:scaleY(1);transform:scaleY(1)}80%,to{-webkit-transform:scaleY(0);transform:scaleY(0)}}@keyframes monaco-cursor-expand{0%,20%{-webkit-transform:scaleY(1);transform:scaleY(1)}80%,to{-webkit-transform:scaleY(0);transform:scaleY(0)}}.cursor-smooth{-webkit-animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{-webkit-animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{-webkit-animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}",""]),e.exports=t},b042:function(e,t,i){var n=i("e4f5");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("3da601af",n,!0,{sourceMap:!1,shadowMode:!1})},b105:function(e,t,i){"use strict";var n=i("83ec"),o=i("8aa3").findIndex,s=i("6e10"),r="findIndex",a=!0;r in[]&&Array(1)[r]((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),s(r)},b13d:function(e,t,i){"use strict";var n=i("83ec"),o=i("58d1");n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return o(URL.prototype.toString,this)}})},b1ef:function(e,t,i){var n=i("6f9e");e.exports=n(1..valueOf)},b400:function(e,t,i){var n=i("bba7");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("02378fc5",n,!0,{sourceMap:!1,shadowMode:!1})},b485:function(e,t,i){"use strict";var n=i("58d1"),o=i("e820"),s=i("fbcf"),r=i("ce47"),a=i("04c3"),l=i("0874"),c=i("762a"),d=i("61c0"),h=i("ec23");o("match",(function(e,t,i){return[function(t){var i=l(this),o=void 0==t?void 0:c(t,e);return o?n(o,t,i):new RegExp(t)[e](a(i))},function(e){var n=s(this),o=a(e),l=i(t,n,o);if(l.done)return l.value;if(!n.global)return h(n,o);var c=n.unicode;n.lastIndex=0;var u,g=[],f=0;while(null!==(u=h(n,o))){var m=a(u[0]);g[f]=m,""===m&&(n.lastIndex=d(o,r(n.lastIndex),c)),f++}return 0===f?null:g}]}))},b4fd:function(e,t,i){var n=i("e244"),o=i("6f9e"),s=i("ac97"),r=i("c401"),a=n.Object,l=o("".split);e.exports=s((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==r(e)?l(e,""):a(e)}:a},b609:function(e,t,i){var n=i("55ab"),o=i("ac97");e.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},b623:function(e,t,i){var n=i("e244"),o=i("9564"),s=i("8dcc"),r=n.TypeError;e.exports=function(e){if(o(e))return e;throw r(s(e)+" is not a function")}},b856:function(e,t,i){var n=i("b012");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("2d7da4a9",n,!0,{sourceMap:!1,shadowMode:!1})},b896:function(e,t,i){var n=i("e244"),o=i("55ab"),s=i("bf6f"),r=i("b609"),a=i("fbcf"),l=i("6b7e"),c=n.TypeError,d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u="enumerable",g="configurable",f="writable";t.f=o?r?function(e,t,i){if(a(e),t=l(t),a(i),"function"===typeof e&&"prototype"===t&&"value"in i&&f in i&&!i[f]){var n=h(e,t);n&&n[f]&&(e[t]=i.value,i={configurable:g in i?i[g]:n[g],enumerable:u in i?i[u]:n[u],writable:!1})}return d(e,t,i)}:d:function(e,t,i){if(a(e),t=l(t),a(i),s)try{return d(e,t,i)}catch(n){}if("get"in i||"set"in i)throw c("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},bba7:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,'.monaco-split-view2{position:relative;width:100%;height:100%}.monaco-split-view2>.sash-container{position:absolute;width:100%;height:100%;pointer-events:none}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:auto}.monaco-split-view2>.monaco-scrollable-element{width:100%;height:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{width:100%;height:100%;white-space:nowrap;position:relative}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{white-space:normal;position:absolute}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{content:" ";position:absolute;top:0;left:0;z-index:5;pointer-events:none;background-color:var(--separator-border)}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}',""]),e.exports=t},bd77:function(e,t,i){var n=i("8fed");e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},bf1d:function(e,t,i){var n=i("c401"),o=i("45ad"),s=i("f0f1").f,r=i("2ae8"),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],l=function(e){try{return s(e)}catch(t){return r(a)}};e.exports.f=function(e){return a&&"Window"==n(e)?l(e):s(o(e))}},bf6f:function(e,t,i){var n=i("55ab"),o=i("ac97"),s=i("f146");e.exports=!n&&!o((function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},c09a:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:hsla(0,0%,100%,.01)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar{background:transparent}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:hsla(0,0%,67.1%,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active{background:none}.monaco-diff-editor .delete-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-editor .insert-sign{font-size:11px!important;opacity:.7!important;display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.hc-black .insert-sign{opacity:1}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .inline-deleted-margin-view-zone{text-align:right}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}",""]),e.exports=t},c1ca:function(e,t,i){var n=i("6043"),o=i("6f9e"),s=i("f0f1"),r=i("0ef1"),a=i("fbcf"),l=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=s.f(a(e)),i=r.f;return i?l(t,i(e)):t}},c223:function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return r})),i.d(t,"e",(function(){return a})),i.d(t,"c",(function(){return l})),i.d(t,"f",(function(){return c})),i.d(t,"d",(function(){return d})),i.d(t,"g",(function(){return h}));const n="undefined"!==typeof e;let o;class s{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(t){return n&&!e.isBuffer(t)&&(t=e.from(t.buffer,t.byteOffset,t.byteLength)),new s(t)}toString(){return n?this.buffer.toString():(o||(o=new TextDecoder),o.decode(this.buffer))}}function r(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function a(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function l(e,t){return e[t]*Math.pow(2,24)+e[t+1]*Math.pow(2,16)+e[t+2]*Math.pow(2,8)+e[t+3]}function c(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 d(e,t){return e[t]}function h(e,t,i){e[i]=t}}).call(this,i("f20c").Buffer)},c225:function(e,t,i){"use strict";var n=i("83ec"),o=i("e244"),s=i("6043"),r=i("82a4"),a=i("58d1"),l=i("6f9e"),c=i("f0db"),d=i("55ab"),h=i("8fed"),u=i("ac97"),g=i("0b05"),f=i("5a43"),m=i("9564"),p=i("eee7"),_=i("81e5"),b=i("0b38"),v=i("fbcf"),w=i("c673"),C=i("45ad"),y=i("6b7e"),S=i("04c3"),x=i("4d82"),k=i("ca2b"),L=i("3e1a"),E=i("f0f1"),D=i("bf1d"),N=i("0ef1"),I=i("42b1"),T=i("b896"),M=i("c732"),O=i("11b0"),A=i("96cd"),P=i("7d86"),R=i("986e"),F=i("5350"),B=i("fd3f"),W=i("76b2"),V=i("1810"),z=i("aca4"),H=i("6baf"),K=i("63ef"),j=i("35d6"),U=i("8aa3").forEach,$=F("hidden"),q="Symbol",G="prototype",Y=V("toPrimitive"),X=j.set,Z=j.getterFor(q),Q=Object[G],J=o.Symbol,ee=J&&J[G],te=o.TypeError,ie=o.QObject,ne=s("JSON","stringify"),oe=I.f,se=T.f,re=D.f,ae=O.f,le=l([].push),ce=R("symbols"),de=R("op-symbols"),he=R("string-to-symbol-registry"),ue=R("symbol-to-string-registry"),ge=R("wks"),fe=!ie||!ie[G]||!ie[G].findChild,me=d&&u((function(){return 7!=k(se({},"a",{get:function(){return se(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=oe(Q,t);n&&delete Q[t],se(e,t,i),n&&e!==Q&&se(Q,t,n)}:se,pe=function(e,t){var i=ce[e]=k(ee);return X(i,{type:q,tag:e,description:t}),d||(i.description=t),i},_e=function(e,t,i){e===Q&&_e(de,t,i),v(e);var n=y(t);return v(i),g(ce,n)?(i.enumerable?(g(e,$)&&e[$][n]&&(e[$][n]=!1),i=k(i,{enumerable:x(0,!1)})):(g(e,$)||se(e,$,x(1,{})),e[$][n]=!0),me(e,n,i)):se(e,n,i)},be=function(e,t){v(e);var i=C(t),n=L(i).concat(Se(i));return U(n,(function(t){d&&!a(we,i,t)||_e(e,t,i[t])})),e},ve=function(e,t){return void 0===t?k(e):be(k(e),t)},we=function(e){var t=y(e),i=a(ae,this,t);return!(this===Q&&g(ce,t)&&!g(de,t))&&(!(i||!g(this,t)||!g(ce,t)||g(this,$)&&this[$][t])||i)},Ce=function(e,t){var i=C(e),n=y(t);if(i!==Q||!g(ce,n)||g(de,n)){var o=oe(i,n);return!o||!g(ce,n)||g(i,$)&&i[$][n]||(o.enumerable=!0),o}},ye=function(e){var t=re(C(e)),i=[];return U(t,(function(e){g(ce,e)||g(B,e)||le(i,e)})),i},Se=function(e){var t=e===Q,i=re(t?de:C(e)),n=[];return U(i,(function(e){!g(ce,e)||t&&!g(Q,e)||le(n,ce[e])})),n};if(h||(J=function(){if(_(ee,this))throw te("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?S(arguments[0]):void 0,t=W(e),i=function(e){this===Q&&a(i,de,e),g(this,$)&&g(this[$],t)&&(this[$][t]=!1),me(this,t,x(1,e))};return d&&fe&&me(Q,t,{configurable:!0,set:i}),pe(t,e)},ee=J[G],P(ee,"toString",(function(){return Z(this).tag})),P(J,"withoutSetter",(function(e){return pe(W(e),e)})),O.f=we,T.f=_e,M.f=be,I.f=Ce,E.f=D.f=ye,N.f=Se,z.f=function(e){return pe(V(e),e)},d&&(se(ee,"description",{configurable:!0,get:function(){return Z(this).description}}),c||P(Q,"propertyIsEnumerable",we,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!h,sham:!h},{Symbol:J}),U(L(ge),(function(e){H(e)})),n({target:q,stat:!0,forced:!h},{for:function(e){var t=S(e);if(g(he,t))return he[t];var i=J(t);return he[t]=i,ue[i]=t,i},keyFor:function(e){if(!b(e))throw te(e+" is not a symbol");if(g(ue,e))return ue[e]},useSetter:function(){fe=!0},useSimple:function(){fe=!1}}),n({target:"Object",stat:!0,forced:!h,sham:!d},{create:ve,defineProperty:_e,defineProperties:be,getOwnPropertyDescriptor:Ce}),n({target:"Object",stat:!0,forced:!h},{getOwnPropertyNames:ye,getOwnPropertySymbols:Se}),n({target:"Object",stat:!0,forced:u((function(){N.f(1)}))},{getOwnPropertySymbols:function(e){return N.f(w(e))}}),ne){var xe=!h||u((function(){var e=J();return"[null]"!=ne([e])||"{}"!=ne({a:e})||"{}"!=ne(Object(e))}));n({target:"JSON",stat:!0,forced:xe},{stringify:function(e,t,i){var n=A(arguments),o=t;if((p(t)||void 0!==e)&&!b(e))return f(t)||(t=function(e,t){if(m(o)&&(t=a(o,this,e,t)),!b(t))return t}),n[1]=t,r(ne,null,n)}})}if(!ee[Y]){var ke=ee.valueOf;P(ee,Y,(function(e){return a(ke,this)}))}K(J,q),B[$]=!0},c243:function(e,t,i){var n=i("6f9e"),o=i("c673"),s=Math.floor,r=n("".charAt),a=n("".replace),l=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,d=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,i,n,h,u){var g=i+e.length,f=n.length,m=d;return void 0!==h&&(h=o(h),m=c),a(u,m,(function(o,a){var c;switch(r(a,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,i);case"'":return l(t,g);case"<":c=h[l(a,1,-1)];break;default:var d=+a;if(0===d)return o;if(d>f){var u=s(d/10);return 0===u?o:u<=f?void 0===n[u-1]?r(a,1):n[u-1]+r(a,1):o}c=n[d-1]}return void 0===c?"":c}))}},c293:function(module,__webpack_exports__,__webpack_require__){"use strict";var _utils_monaco_editor__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("d895");__webpack_exports__["a"]={name:"config-custom",components:{MonacoEditor:_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_0__["a"]},props:["data"],data:function(){return{params:this.data.params||{},event:this.data.event||{},options:{fullScreen:!0,minimap:{enabled:!1}}}},watch:{"data.params":function(e){this.params=e||{}},"data.event":function(e){this.event=e||{}},params:function params(val){try{this.data.params=eval("("+val+")")}catch(e){}},event:function event(val){try{this.data.event=eval("("+val+")")}catch(e){}}}}},c3b4:function(e,t,i){var n=i("10b1");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("4c19d8df",n,!0,{sourceMap:!1,shadowMode:!1})},c401:function(e,t,i){var n=i("6f9e"),o=n({}.toString),s=n("".slice);e.exports=function(e){return s(o(e),8,-1)}},c55c:function(e,t,i){var n=i("32a5").PROPER,o=i("ac97"),s=i("d554"),r="
";e.exports=function(e){return o((function(){return!!s[e]()||r[e]()!==r||n&&s[e].name!==e}))}},c673:function(e,t,i){var n=i("e244"),o=i("0874"),s=n.Object;e.exports=function(e){return s(o(e))}},c6b4:function(e,t,i){var n=i("6aad");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("9f17fb24",n,!0,{sourceMap:!1,shadowMode:!1})},c732:function(e,t,i){var n=i("55ab"),o=i("b609"),s=i("b896"),r=i("fbcf"),a=i("45ad"),l=i("3e1a");t.f=n&&!o?Object.defineProperties:function(e,t){r(e);var i,n=a(t),o=l(t),c=o.length,d=0;while(c>d)s.f(e,i=o[d++],n[i]);return e}},c8ed:function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(n){"object"===typeof window&&(i=window)}e.exports=i},c901:function(e,t,i){var n=i("f39a");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("174a5076",n,!0,{sourceMap:!1,shadowMode:!1})},c91b:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-text-button{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;padding:4px;text-align:center;cursor:pointer;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled,.monaco-button.disabled:focus{opacity:.4!important;cursor:default}.monaco-text-button>.codicon{margin:0 .2em;color:inherit!important}.monaco-button-dropdown{display:-webkit-box;display:-ms-flexbox;display:flex;cursor:pointer}.monaco-button-dropdown>.monaco-dropdown-button{margin-left:1px}.monaco-description-button{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.monaco-description-button .monaco-button-label{font-weight:500}.monaco-description-button .monaco-button-description{font-style:italic}",""]),e.exports=t},ca23:function(e,t,i){var n=i("9564"),o=i("eee7"),s=i("13a8");e.exports=function(e,t,i){var r,a;return s&&n(r=t.constructor)&&r!==i&&o(a=r.prototype)&&a!==i.prototype&&s(e,a),e}},ca2b:function(e,t,i){var n,o=i("fbcf"),s=i("c732"),r=i("e629"),a=i("fd3f"),l=i("a780"),c=i("f146"),d=i("5350"),h=">",u="<",g="prototype",f="script",m=d("IE_PROTO"),p=function(){},_=function(e){return u+f+h+e+u+"/"+f+h},b=function(e){e.write(_("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){var e,t=c("iframe"),i="java"+f+":";return t.style.display="none",l.appendChild(t),t.src=String(i),e=t.contentWindow.document,e.open(),e.write(_("document.F=Object")),e.close(),e.F},w=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}w="undefined"!=typeof document?document.domain&&n?b(n):v():b(n);var e=r.length;while(e--)delete w[g][r[e]];return w()};a[m]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(p[g]=o(e),i=new p,p[g]=null,i[m]=e):i=w(),void 0===t?i:s.f(i,t)}},cc1a:function(e,t,i){var n=i("11e2");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("15ad24d4",n,!0,{sourceMap:!1,shadowMode:!1})},ce47:function(e,t,i){var n=i("409e"),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},cf00:function(e,t,i){"use strict";i("0562")},d2a1:function(e,t,i){var n=i("83ec"),o=i("e244"),s=i("82a4"),r=i("3abc"),a="WebAssembly",l=o[a],c=7!==Error("e",{cause:7}).cause,d=function(e,t){var i={};i[e]=r(e,t,c),n({global:!0,forced:c},i)},h=function(e,t){if(l&&l[e]){var i={};i[e]=r(a+"."+e,t,c),n({target:a,stat:!0,forced:c},i)}};d("Error",(function(e){return function(t){return s(e,this,arguments)}})),d("EvalError",(function(e){return function(t){return s(e,this,arguments)}})),d("RangeError",(function(e){return function(t){return s(e,this,arguments)}})),d("ReferenceError",(function(e){return function(t){return s(e,this,arguments)}})),d("SyntaxError",(function(e){return function(t){return s(e,this,arguments)}})),d("TypeError",(function(e){return function(t){return s(e,this,arguments)}})),d("URIError",(function(e){return function(t){return s(e,this,arguments)}})),h("CompileError",(function(e){return function(t){return s(e,this,arguments)}})),h("LinkError",(function(e){return function(t){return s(e,this,arguments)}})),h("RuntimeError",(function(e){return function(t){return s(e,this,arguments)}}))},d30c:function(e,t,i){"use strict";var n=i("6043"),o=i("b896"),s=i("1810"),r=i("55ab"),a=s("species");e.exports=function(e){var t=n(e),i=o.f;r&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},d53b:function(e,t,i){var n=i("e244"),o=i("6965"),s=i("9564"),r=i("c401"),a=i("1810"),l=a("toStringTag"),c=n.Object,d="Arguments"==r(function(){return arguments}()),h=function(e,t){try{return e[t]}catch(i){}};e.exports=o?r:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=h(t=c(e),l))?i:d?r(t):"Object"==(n=r(t))&&s(t.callee)?"Arguments":n}},d543:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));i("fa89");function n(e,t,i,n,o,s,r){try{var a=e[s](r),l=a.value}catch(c){return void i(c)}a.done?t(l):Promise.resolve(l).then(n,o)}function o(e){return function(){var t=this,i=arguments;return new Promise((function(o,s){var r=e.apply(t,i);function a(e){n(r,o,s,a,l,"next",e)}function l(e){n(r,o,s,a,l,"throw",e)}a(void 0)}))}}},d554:function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},d557:function(e,t,i){var n=i("312a");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("3cf09572",n,!0,{sourceMap:!1,shadowMode:!1})},d6ed:function(e,t,i){var n=i("6f9e"),o=i("b623"),s=i("933a"),r=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:s?r(e,t):function(){return e.apply(t,arguments)}}},d73d:function(e,t,i){var n=i("ac97"),o=i("e244"),s=o.RegExp;e.exports=n((function(){var e=s(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},d80d:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"widget-config"},[this.data&&Object.keys(this.data).length>0?i("el-form",{attrs:{"label-suffix":":",labelPosition:"left",labelWidth:"90px",size:"small"}},[i("el-collapse",{model:{value:e.collapse,callback:function(t){e.collapse=t},expression:"collapse"}},[i("el-collapse-item",{attrs:{name:"1",title:"基本属性"}},[e.data.type&&!e.data.component?i("el-form-item",{attrs:{label:"类型"}},[i("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择类型"},on:{change:e.handleChangeType},model:{value:e.data.type,callback:function(t){e.$set(e.data,"type",t)},expression:"data.type"}},e._l(e.fields,(function(t){return i("el-option-group",{key:t.title,attrs:{label:t.title}},e._l(t.list,(function(e){return i("el-option",{key:e.type,attrs:{label:e.label,value:e.type}})})),1)})),1)],1):e._e(),i("el-form-item",{attrs:{label:"属性值"}},[i("el-input",{attrs:{clearable:"",placeholder:"属性值"},model:{value:e.data.prop,callback:function(t){e.$set(e.data,"prop",t)},expression:"data.prop"}})],1),i("el-form-item",{attrs:{label:"标题"}},[i("el-input",{attrs:{clearable:"",placeholder:"标题"},model:{value:e.data.label,callback:function(t){e.$set(e.data,"label",t)},expression:"data.label"}})],1),["group","dynamic","title"].includes(e.data.type)?e._e():i("el-form-item",{attrs:{label:"标题宽度"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{min:80,step:10,"controls-position":"right",placeholder:"标签宽度"},model:{value:e.data.labelWidth,callback:function(t){e.$set(e.data,"labelWidth",t)},expression:"data.labelWidth"}})],1),e.data.subfield?e._e():i("el-form-item",{attrs:{label:"标签位置"}},[i("el-select",{attrs:{placeholder:"标签位置",clearable:""},model:{value:e.data.labelPosition,callback:function(t){e.$set(e.data,"labelPosition",t)},expression:"data.labelPosition"}},[i("el-option",{attrs:{label:"上",value:"top"}}),i("el-option",{attrs:{label:"左",value:"left"}}),i("el-option",{attrs:{label:"右",value:"right"}})],1)],1),e.data.subfield?i("el-form-item",{attrs:{label:"宽度"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{"controls-position":"right",placeholder:"宽度",min:100},model:{value:e.data.width,callback:function(t){e.$set(e.data,"width",t)},expression:"data.width"}})],1):e._e(),e.data.subfield||["group"].includes(e.data.type)?e._e():i("el-form-item",{attrs:{label:"表单栅格"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{"controls-position":"right",placeholder:"表单栅格",min:2,max:24},model:{value:e.data.span,callback:function(t){e.$set(e.data,"span",t)},expression:"data.span"}})],1),["cascader","checkbox","radio","select","tree","upload","img","array","slider","timerange","daterange","datetimerange"].includes(e.data.type)?i("el-form-item",{attrs:{label:"数据类型"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/docs/datatype.html",target:"_blank"}},[e._v("数据类型 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-select",{attrs:{placeholder:"数据类型",clearable:""},model:{value:e.data.dataType,callback:function(t){e.$set(e.data,"dataType",t)},expression:"data.dataType"}},[i("el-option",{attrs:{label:"String",value:"string"}}),i("el-option",{attrs:{label:"Number",value:"number"}}),i("el-option",{attrs:{label:"Array",value:"array"}})],1)],2):e._e(),i("el-form-item",{attrs:{label:"字段提示"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/form/form-tip.html",target:"_blank"}},[e._v("字段提示 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-input",{attrs:{clearable:"",placeholder:"字段提示"},model:{value:e.data.tip,callback:function(t){e.$set(e.data,"tip",t)},expression:"data.tip"}})],2),e.data.tip&&!["upload"].includes(e.data.type)?i("el-form-item",{attrs:{label:"字段提示位置","label-width":"110px"}},[i("el-select",{attrs:{placeholder:"字段提示位置",clearable:""},model:{value:e.data.tipPlacement,callback:function(t){e.$set(e.data,"tipPlacement",t)},expression:"data.tipPlacement"}},[i("el-option",{attrs:{label:"上",value:"top"}}),i("el-option",{attrs:{label:"下",value:"bottom"}}),i("el-option",{attrs:{label:"左",value:"left"}}),i("el-option",{attrs:{label:"右",value:"right"}})],1)],1):e._e(),i("el-form-item",{attrs:{label:"标题提示"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/form/form-tip.html",target:"_blank"}},[e._v("标题提示 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-input",{attrs:{clearable:"",placeholder:"标题提示"},model:{value:e.data.labelTip,callback:function(t){e.$set(e.data,"labelTip",t)},expression:"data.labelTip"}})],2),e.data.labelTip&&!["upload"].includes(e.data.type)?i("el-form-item",{attrs:{label:"标题提示位置","label-width":"110px"}},[i("el-select",{attrs:{placeholder:"标题提示位置",clearable:""},model:{value:e.data.labelTipPlacement,callback:function(t){e.$set(e.data,"labelTipPlacement",t)},expression:"data.labelTipPlacement"}},[i("el-option",{attrs:{label:"上",value:"top"}}),i("el-option",{attrs:{label:"下",value:"bottom"}}),i("el-option",{attrs:{label:"左",value:"left"}}),i("el-option",{attrs:{label:"右",value:"right"}})],1)],1):e._e(),["color","dynamic","group","ueditor","upload","map"].includes(e.data.type)?e._e():i("el-form-item",{attrs:{label:"默认值"}},[e.defaultValues&&e.defaultValues[e.data.type]?[i("el-select",{attrs:{"allow-create":"",clearable:"",filterable:"",placeholder:"默认值"},model:{value:e.data.value,callback:function(t){e.$set(e.data,"value",t)},expression:"data.value"}},e._l(e.defaultValues[e.data.type],(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)]:[i("el-input",{attrs:{clearable:"",placeholder:"默认值"},model:{value:e.data.value,callback:function(t){e.$set(e.data,"value",t)},expression:"data.value"}})]],2),i("el-form-item",{attrs:{label:"详情模式"}},[i("el-switch",{model:{value:e.data.detail,callback:function(t){e.$set(e.data,"detail",t)},expression:"data.detail"}})],1),i("el-form-item",{attrs:{label:"是否只读"}},[i("el-switch",{model:{value:e.data.readonly,callback:function(t){e.$set(e.data,"readonly",t)},expression:"data.readonly"}})],1),i("el-form-item",{attrs:{label:"是否禁用"}},[i("el-switch",{model:{value:e.data.disabled,callback:function(t){e.$set(e.data,"disabled",t)},expression:"data.disabled"}})],1),i("el-form-item",{attrs:{label:"是否可见"}},[i("el-switch",{model:{value:e.data.display,callback:function(t){e.$set(e.data,"display",t)},expression:"data.display"}})],1),i("el-form-item",{attrs:{label:"是否必填"}},[i("el-switch",{model:{value:e.data.required,callback:function(t){e.$set(e.data,"required",t)},expression:"data.required"}}),e.data.required?i("el-input",{attrs:{placeholder:"正则表达式"},model:{value:e.data.pattern,callback:function(t){e.$set(e.data,"pattern",t)},expression:"data.pattern"}}):e._e()],1)],1),i("el-collapse-item",{attrs:{name:"2",title:"组件属性"}},[i(e.getComponent,{tag:"component",attrs:{data:e.data,"default-values":e.defaultValues}})],1),["group"].includes(e.data.type)?e._e():i("el-collapse-item",{attrs:{name:"3",title:"事件属性"}},[i("config-event",{attrs:{data:e.data}})],1)],1)],1):i("avue-empty",{staticStyle:{"margin-top":"100%"},attrs:{desc:"拖拽字段进行配置"}})],1)},o=[],s=(i("2f62"),i("f54f"),i("838a"),i("2eb0"),i("4423"),i("f05e"),i("adae"),i("fa89"),i("f96e"),i("ef61"),i("1e33")),r=["year","month","week","date","datetime","time","daterange","timerange","datetimerange","dates"],a={name:"widget-config",props:["data","defaultValues"],computed:{getComponent:function(){var e="config-",t=this.data,i=t.type,n=t.component;if((!i||n)&&"ueditor"!=i)return e+"custom";var o="input";return o=[void 0,"input","password","url"].includes(i)?"input":r.includes(i)?"date":["array","img"].includes(i)?"array":["tree","cascader"].includes(i)?"tree":["radio","checkbox","select"].includes(i)?"select":i,e+o}},watch:{"data.required":function(e){this.validator.required=e?{required:!0,message:"".concat(this.data.label,"必须填写")}:null,this.generateRule()},"data.pattern":function(e){this.validator.pattern=e?{pattern:new RegExp(e),message:"".concat(this.data.label,"格式不匹配")}:null,this.generateRule()}},data:function(){return{fields:s["a"],collapse:["1","2","3"],validator:{type:null,required:null,pattern:null,length:null}}},methods:{handleChangeType:function(e){if(e){var t=this.fields.find((function(t){return t.list.find((function(t){return t.type==e}))}));if(t)for(var i in t)t&&Object.prototype.hasOwnProperty.call(t,i)&&!["icon","label","span"].includes(i)&&(this.data[i]=t[i])}},generateRule:function(){var e=this,t=[];Object.keys(this.validator).forEach((function(i){e.validator[i]&&t.push(e.validator[i])})),0==t.length?delete this.data.rules:this.data.rules=t}}},l=a,c=i("e3d4"),d=Object(c["a"])(l,n,o,!1,null,null,null);t["a"]=d.exports},d85b:function(e,t){e.exports={}},d895:function(e,t,i){"use strict";var n=i("863c"),o=i("5491"),s=(i("085b"),i("2eb0"),i("a2c3"),i("7eca")),r=i("7f36"),a={},l={},c=function(){function e(e){var t=this;this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((function(e,i){t._lazyLoadPromiseResolve=e,t._lazyLoadPromiseReject=i}))}return e.getOrCreate=function(t){return l[t]||(l[t]=new e(t)),l[t]},e.prototype.whenLoaded=function(){return this._lazyLoadPromise},e.prototype.load=function(){var e=this;return this._loadingTriggered||(this._loadingTriggered=!0,a[this._languageId].loader().then((function(t){return e._lazyLoadPromiseResolve(t)}),(function(t){return e._lazyLoadPromiseReject(t)}))),this._lazyLoadPromise},e}();function d(e){var t=e.id;a[t]=e,r["a"].register(e);var i=c.getOrCreate(t);r["a"].setMonarchTokensProvider(t,i.whenLoaded().then((function(e){return e.language}))),r["a"].onLanguage(t,(function(){i.load().then((function(e){r["a"].setLanguageConfiguration(t,e.conf)}))}))}d({id:"javascript",extensions:[".js",".es6",".jsx",".mjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:function(){return Promise.resolve().then(i.bind(null,"f8f9"))}});var h=i("826e");function u(){}t["a"]={name:"MonacoEditor",props:{diffEditor:{type:Boolean,default:!1},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},original:String,value:[String,Object],language:{type:String,default:"javascript"},theme:{type:String,default:"vs"},readOnly:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},editorMounted:{type:Function,default:u},editorBeforeMount:{type:Function,default:u},keyIndex:{type:String}},watch:{options:{deep:!0,handler:function(e){this.editor&&this.editor.updateOptions(e)}},keyIndex:function(){var e=this.value;"object"==Object(o["a"])(e)&&(e=Object(h["a"])(e)),this.editor&&e!==this._getValue()&&this._setValue(e)},language:function(){if(this.editor)if(this.diffEditor){var e=this.editor.getModel(),t=e.original,i=e.modified;s["editor"].setModelLanguage(t,this.language),s["editor"].setModelLanguage(i,this.language)}else s["editor"].setModelLanguage(this.editor.getModel(),this.language)},theme:function(){this.editor&&s["editor"].setTheme(this.theme)},style:function(){var e=this;this.editor&&this.$nextTick((function(){e.editor.layout()}))},value:function(e){this.editor&&e!==this._getValue()&&this._setValue(e)}},computed:{style:function(){return{width:/^\d+$/.test(this.width)?"".concat(this.width,"px"):this.width,height:/^\d+$/.test(this.height)?"".concat(this.height,"px"):this.height,position:"relative"}}},mounted:function(){this.initMonaco()},beforeDestroy:function(){this.editor&&this.editor.dispose()},render:function(e){var t=this.options.fullScreen;return e("div",{class:"monaco_editor_container",style:this.style},[t?e("i",{class:"el-icon-full-screen",style:{width:"1.2em",height:"1.2em",position:"absolute",left:"0px",top:"0px",zIndex:"1",cursor:"pointer"},on:{click:this._handleFullScreen}}):""])},methods:{initMonaco:function(){var e=this.value,t=this.language,i=this.theme,o=this.readOnly,r=this.options;Object.assign(r,this._editorBeforeMount()),this.editor=s["editor"][this.diffEditor?"createDiffEditor":"create"](this.$el,Object(n["a"])({value:"string"==typeof e?e:Object(h["a"])(e),language:t,theme:i,readOnly:o},r)),this.diffEditor&&this._setModel(this.value,this.original),this._editorMounted(this.editor)},_handleFullScreen:function(){this.isMaximum?this.minEditor():this.maxEditor()},maxEditor:function(){var e=this;this.isMaximum=!0;var t=this.$el;this.originSize={width:t.clientWidth,height:t.clientHeight},t.classList.add("editor-fullscreen"),this.editor.layout({height:document.body.clientHeight,width:document.body.clientWidth}),document.addEventListener("keyup",(function(t){27==t.keyCode&&e.minEditor()}))},minEditor:function(){this.isMaximum=!1;var e=this.$el;e.classList.remove("editor-fullscreen"),this.editor.layout({height:this.originSize.height,width:this.originSize.width}),document.removeEventListener("keyup",(function(){}))},_getEditor:function(){return this.editor?this.diffEditor?this.editor.modifiedEditor:this.editor:null},_setModel:function(e,t){var i=this.language,n=s["editor"].createModel(t,i),o=s["editor"].createModel(e,i);this.editor.setModel({original:n,modified:o})},_setValue:function(e){var t=this._getEditor();if(t)return t.setValue(e)},_getValue:function(){var e=this._getEditor();return e?e.getValue():""},_editorBeforeMount:function(){var e=this.editorBeforeMount(s);return e||{}},_editorMounted:function(e){var t=this;this.editorMounted(e,s),this.diffEditor?e.onDidUpdateDiff((function(e){var i=t._getValue();t._emitChange(i,e)})):e.onDidChangeModelContent((function(e){var i=t._getValue();t._emitChange(i,e)}))},_emitChange:function(e,t){this.$emit("change",e,t),this.$emit("input",e)}}}},d927:function(e,t,i){"use strict";var n=i("83ec"),o=i("e244"),s=i("3352"),r=i("409e"),a=i("7c08"),l=i("c673"),c=i("f152"),d=i("acd4"),h=i("72d4"),u=h("splice"),g=o.TypeError,f=Math.max,m=Math.min,p=9007199254740991,_="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!u},{splice:function(e,t){var i,n,o,h,u,b,v=l(this),w=a(v),C=s(e,w),y=arguments.length;if(0===y?i=n=0:1===y?(i=0,n=w-C):(i=y-2,n=m(f(r(t),0),w-C)),w+i-n>p)throw g(_);for(o=c(v,n),h=0;h<n;h++)u=C+h,u in v&&d(o,h,v[u]);if(o.length=n,i<n){for(h=C;h<w-n;h++)u=h+n,b=h+i,u in v?v[b]=v[u]:delete v[b];for(h=w;h>w-n+i;h--)delete v[h-1]}else if(i>n)for(h=w-n;h>C;h--)u=h+n-1,b=h+i-1,u in v?v[b]=v[u]:delete v[b];for(h=0;h<i;h++)v[h+C]=arguments[h+2];return v.length=w-n+i,o}})},d958:function(e,t,i){(function(t,n){e.exports=n(i("76d1"))})("undefined"!==typeof self&&self,(function(e){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="fb15")}({"01f9":function(e,t,i){"use strict";var n=i("2d00"),o=i("5ca1"),s=i("2aba"),r=i("32e9"),a=i("84f2"),l=i("41a0"),c=i("7f20"),d=i("38fd"),h=i("2b4c")("iterator"),u=!([].keys&&"next"in[].keys()),g="@@iterator",f="keys",m="values",p=function(){return this};e.exports=function(e,t,i,_,b,v,w){l(i,t,_);var C,y,S,x=function(e){if(!u&&e in D)return D[e];switch(e){case f:return function(){return new i(this,e)};case m:return function(){return new i(this,e)}}return function(){return new i(this,e)}},k=t+" Iterator",L=b==m,E=!1,D=e.prototype,N=D[h]||D[g]||b&&D[b],I=N||x(b),T=b?L?x("entries"):I:void 0,M="Array"==t&&D.entries||N;if(M&&(S=d(M.call(new e)),S!==Object.prototype&&S.next&&(c(S,k,!0),n||"function"==typeof S[h]||r(S,h,p))),L&&N&&N.name!==m&&(E=!0,I=function(){return N.call(this)}),n&&!w||!u&&!E&&D[h]||r(D,h,I),a[t]=I,a[k]=p,b)if(C={values:L?I:x(m),keys:v?I:x(f),entries:T},w)for(y in C)y in D||s(D,y,C[y]);else o(o.P+o.F*(u||E),t,C);return C}},"02f4":function(e,t,i){var n=i("4588"),o=i("be13");e.exports=function(e){return function(t,i){var s,r,a=String(o(t)),l=n(i),c=a.length;return l<0||l>=c?e?"":void 0:(s=a.charCodeAt(l),s<55296||s>56319||l+1===c||(r=a.charCodeAt(l+1))<56320||r>57343?e?a.charAt(l):s:e?a.slice(l,l+2):r-56320+(s-55296<<10)+65536)}}},"0390":function(e,t,i){"use strict";var n=i("02f4")(!0);e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}},"0bfb":function(e,t,i){"use strict";var n=i("cb7c");e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},"0d58":function(e,t,i){var n=i("ce10"),o=i("e11e");e.exports=Object.keys||function(e){return n(e,o)}},1495:function(e,t,i){var n=i("86cc"),o=i("cb7c"),s=i("0d58");e.exports=i("9e1e")?Object.defineProperties:function(e,t){o(e);var i,r=s(t),a=r.length,l=0;while(a>l)n.f(e,i=r[l++],t[i]);return e}},"214f":function(e,t,i){"use strict";i("b0c5");var n=i("2aba"),o=i("32e9"),s=i("79e5"),r=i("be13"),a=i("2b4c"),l=i("520a"),c=a("species"),d=!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),h=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2===i.length&&"a"===i[0]&&"b"===i[1]}();e.exports=function(e,t,i){var u=a(e),g=!s((function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})),f=g?!s((function(){var t=!1,i=/a/;return i.exec=function(){return t=!0,null},"split"===e&&(i.constructor={},i.constructor[c]=function(){return i}),i[u](""),!t})):void 0;if(!g||!f||"replace"===e&&!d||"split"===e&&!h){var m=/./[u],p=i(r,u,""[e],(function(e,t,i,n,o){return t.exec===l?g&&!o?{done:!0,value:m.call(t,i,n)}:{done:!0,value:e.call(i,t,n)}:{done:!1}})),_=p[0],b=p[1];n(String.prototype,e,_),o(RegExp.prototype,u,2==t?function(e,t){return b.call(e,this,t)}:function(e){return b.call(e,this)})}}},"230e":function(e,t,i){var n=i("d3f4"),o=i("7726").document,s=n(o)&&n(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},"23c6":function(e,t,i){var n=i("2d95"),o=i("2b4c")("toStringTag"),s="Arguments"==n(function(){return arguments}()),r=function(e,t){try{return e[t]}catch(i){}};e.exports=function(e){var t,i,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=r(t=Object(e),o))?i:s?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},2621:function(e,t){t.f=Object.getOwnPropertySymbols},"2aba":function(e,t,i){var n=i("7726"),o=i("32e9"),s=i("69a8"),r=i("ca5a")("src"),a=i("fa5b"),l="toString",c=(""+a).split(l);i("8378").inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,i,a){var l="function"==typeof i;l&&(s(i,"name")||o(i,"name",t)),e[t]!==i&&(l&&(s(i,r)||o(i,r,e[t]?""+e[t]:c.join(String(t)))),e===n?e[t]=i:a?e[t]?e[t]=i:o(e,t,i):(delete e[t],o(e,t,i)))})(Function.prototype,l,(function(){return"function"==typeof this&&this[r]||a.call(this)}))},"2aeb":function(e,t,i){var n=i("cb7c"),o=i("1495"),s=i("e11e"),r=i("613b")("IE_PROTO"),a=function(){},l="prototype",c=function(){var e,t=i("230e")("iframe"),n=s.length,o="<",r=">";t.style.display="none",i("fab2").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+r+"document.F=Object"+o+"/script"+r),e.close(),c=e.F;while(n--)delete c[l][s[n]];return c()};e.exports=Object.create||function(e,t){var i;return null!==e?(a[l]=n(e),i=new a,a[l]=null,i[r]=e):i=c(),void 0===t?i:o(i,t)}},"2b4c":function(e,t,i){var n=i("5537")("wks"),o=i("ca5a"),s=i("7726").Symbol,r="function"==typeof s,a=e.exports=function(e){return n[e]||(n[e]=r&&s[e]||(r?s:o)("Symbol."+e))};a.store=n},"2d00":function(e,t){e.exports=!1},"2d95":function(e,t){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},"2fdb":function(e,t,i){"use strict";var n=i("5ca1"),o=i("d2c8"),s="includes";n(n.P+n.F*i("5147")(s),"String",{includes:function(e){return!!~o(this,e,s).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},"32e9":function(e,t,i){var n=i("86cc"),o=i("4630");e.exports=i("9e1e")?function(e,t,i){return n.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},"38fd":function(e,t,i){var n=i("69a8"),o=i("4bf8"),s=i("613b")("IE_PROTO"),r=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?r:null}},"41a0":function(e,t,i){"use strict";var n=i("2aeb"),o=i("4630"),s=i("7f20"),r={};i("32e9")(r,i("2b4c")("iterator"),(function(){return this})),e.exports=function(e,t,i){e.prototype=n(r,{next:o(1,i)}),s(e,t+" Iterator")}},"456d":function(e,t,i){var n=i("4bf8"),o=i("0d58");i("5eda")("keys",(function(){return function(e){return o(n(e))}}))},4588:function(e,t){var i=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:i)(e)}},4630:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"4bf8":function(e,t,i){var n=i("be13");e.exports=function(e){return Object(n(e))}},5147:function(e,t,i){var n=i("2b4c")("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(i){try{return t[n]=!1,!"/./"[e](t)}catch(o){}}return!0}},"520a":function(e,t,i){"use strict";var n=i("0bfb"),o=RegExp.prototype.exec,s=String.prototype.replace,r=o,a="lastIndex",l=function(){var e=/a/,t=/b*/g;return o.call(e,"a"),o.call(t,"a"),0!==e[a]||0!==t[a]}(),c=void 0!==/()??/.exec("")[1],d=l||c;d&&(r=function(e){var t,i,r,d,h=this;return c&&(i=new RegExp("^"+h.source+"$(?!\\s)",n.call(h))),l&&(t=h[a]),r=o.call(h,e),l&&r&&(h[a]=h.global?r.index+r[0].length:t),c&&r&&r.length>1&&s.call(r[0],i,(function(){for(d=1;d<arguments.length-2;d++)void 0===arguments[d]&&(r[d]=void 0)})),r}),e.exports=r},"52a7":function(e,t){t.f={}.propertyIsEnumerable},5537:function(e,t,i){var n=i("8378"),o=i("7726"),s="__core-js_shared__",r=o[s]||(o[s]={});(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:i("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"5ca1":function(e,t,i){var n=i("7726"),o=i("8378"),s=i("32e9"),r=i("2aba"),a=i("9b43"),l="prototype",c=function(e,t,i){var d,h,u,g,f=e&c.F,m=e&c.G,p=e&c.S,_=e&c.P,b=e&c.B,v=m?n:p?n[t]||(n[t]={}):(n[t]||{})[l],w=m?o:o[t]||(o[t]={}),C=w[l]||(w[l]={});for(d in m&&(i=t),i)h=!f&&v&&void 0!==v[d],u=(h?v:i)[d],g=b&&h?a(u,n):_&&"function"==typeof u?a(Function.call,u):u,v&&r(v,d,u,e&c.U),w[d]!=u&&s(w,d,g),_&&C[d]!=u&&(C[d]=u)};n.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},"5eda":function(e,t,i){var n=i("5ca1"),o=i("8378"),s=i("79e5");e.exports=function(e,t){var i=(o.Object||{})[e]||Object[e],r={};r[e]=t(i),n(n.S+n.F*s((function(){i(1)})),"Object",r)}},"5f1b":function(e,t,i){"use strict";var n=i("23c6"),o=RegExp.prototype.exec;e.exports=function(e,t){var i=e.exec;if("function"===typeof i){var s=i.call(e,t);if("object"!==typeof s)throw new TypeError("RegExp exec method returned something other than an Object or null");return s}if("RegExp"!==n(e))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},"613b":function(e,t,i){var n=i("5537")("keys"),o=i("ca5a");e.exports=function(e){return n[e]||(n[e]=o(e))}},"626a":function(e,t,i){var n=i("2d95");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},6762:function(e,t,i){"use strict";var n=i("5ca1"),o=i("c366")(!0);n(n.P,"Array",{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("9c6c")("includes")},6821:function(e,t,i){var n=i("626a"),o=i("be13");e.exports=function(e){return n(o(e))}},"69a8":function(e,t){var i={}.hasOwnProperty;e.exports=function(e,t){return i.call(e,t)}},"6a99":function(e,t,i){var n=i("d3f4");e.exports=function(e,t){if(!n(e))return e;var i,o;if(t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;if("function"==typeof(i=e.valueOf)&&!n(o=i.call(e)))return o;if(!t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},7333:function(e,t,i){"use strict";var n=i("0d58"),o=i("2621"),s=i("52a7"),r=i("4bf8"),a=i("626a"),l=Object.assign;e.exports=!l||i("79e5")((function(){var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!=l({},e)[i]||Object.keys(l({},t)).join("")!=n}))?function(e,t){var i=r(e),l=arguments.length,c=1,d=o.f,h=s.f;while(l>c){var u,g=a(arguments[c++]),f=d?n(g).concat(d(g)):n(g),m=f.length,p=0;while(m>p)h.call(g,u=f[p++])&&(i[u]=g[u])}return i}:l},7726:function(e,t){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},"77f1":function(e,t,i){var n=i("4588"),o=Math.max,s=Math.min;e.exports=function(e,t){return e=n(e),e<0?o(e+t,0):s(e,t)}},"79e5":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"7f20":function(e,t,i){var n=i("86cc").f,o=i("69a8"),s=i("2b4c")("toStringTag");e.exports=function(e,t,i){e&&!o(e=i?e:e.prototype,s)&&n(e,s,{configurable:!0,value:t})}},8378:function(e,t){var i=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=i)},"84f2":function(e,t){e.exports={}},"86cc":function(e,t,i){var n=i("cb7c"),o=i("c69a"),s=i("6a99"),r=Object.defineProperty;t.f=i("9e1e")?Object.defineProperty:function(e,t,i){if(n(e),t=s(t,!0),n(i),o)try{return r(e,t,i)}catch(a){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},"9b43":function(e,t,i){var n=i("d8e8");e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,o){return e.call(t,i,n,o)}}return function(){return e.apply(t,arguments)}}},"9c6c":function(e,t,i){var n=i("2b4c")("unscopables"),o=Array.prototype;void 0==o[n]&&i("32e9")(o,n,{}),e.exports=function(e){o[n][e]=!0}},"9def":function(e,t,i){var n=i("4588"),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},"9e1e":function(e,t,i){e.exports=!i("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},a352:function(t,i){t.exports=e},a481:function(e,t,i){"use strict";var n=i("cb7c"),o=i("4bf8"),s=i("9def"),r=i("4588"),a=i("0390"),l=i("5f1b"),c=Math.max,d=Math.min,h=Math.floor,u=/\$([$&`']|\d\d?|<[^>]*>)/g,g=/\$([$&`']|\d\d?)/g,f=function(e){return void 0===e?e:String(e)};i("214f")("replace",2,(function(e,t,i,m){return[function(n,o){var s=e(this),r=void 0==n?void 0:n[t];return void 0!==r?r.call(n,s,o):i.call(String(s),n,o)},function(e,t){var o=m(i,e,this,t);if(o.done)return o.value;var h=n(e),u=String(this),g="function"===typeof t;g||(t=String(t));var _=h.global;if(_){var b=h.unicode;h.lastIndex=0}var v=[];while(1){var w=l(h,u);if(null===w)break;if(v.push(w),!_)break;var C=String(w[0]);""===C&&(h.lastIndex=a(u,s(h.lastIndex),b))}for(var y="",S=0,x=0;x<v.length;x++){w=v[x];for(var k=String(w[0]),L=c(d(r(w.index),u.length),0),E=[],D=1;D<w.length;D++)E.push(f(w[D]));var N=w.groups;if(g){var I=[k].concat(E,L,u);void 0!==N&&I.push(N);var T=String(t.apply(void 0,I))}else T=p(k,u,L,E,N,t);L>=S&&(y+=u.slice(S,L)+T,S=L+k.length)}return y+u.slice(S)}];function p(e,t,n,s,r,a){var l=n+e.length,c=s.length,d=g;return void 0!==r&&(r=o(r),d=u),i.call(a,d,(function(i,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(l);case"<":a=r[o.slice(1,-1)];break;default:var d=+o;if(0===d)return i;if(d>c){var u=h(d/10);return 0===u?i:u<=c?void 0===s[u-1]?o.charAt(1):s[u-1]+o.charAt(1):i}a=s[d-1]}return void 0===a?"":a}))}}))},aae3:function(e,t,i){var n=i("d3f4"),o=i("2d95"),s=i("2b4c")("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==o(e))}},ac6a:function(e,t,i){for(var n=i("cadf"),o=i("0d58"),s=i("2aba"),r=i("7726"),a=i("32e9"),l=i("84f2"),c=i("2b4c"),d=c("iterator"),h=c("toStringTag"),u=l.Array,g={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},f=o(g),m=0;m<f.length;m++){var p,_=f[m],b=g[_],v=r[_],w=v&&v.prototype;if(w&&(w[d]||a(w,d,u),w[h]||a(w,h,_),l[_]=u,b))for(p in n)w[p]||s(w,p,n[p],!0)}},b0c5:function(e,t,i){"use strict";var n=i("520a");i("5ca1")({target:"RegExp",proto:!0,forced:n!==/./.exec},{exec:n})},be13:function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},c366:function(e,t,i){var n=i("6821"),o=i("9def"),s=i("77f1");e.exports=function(e){return function(t,i,r){var a,l=n(t),c=o(l.length),d=s(r,c);if(e&&i!=i){while(c>d)if(a=l[d++],a!=a)return!0}else for(;c>d;d++)if((e||d in l)&&l[d]===i)return e||d||0;return!e&&-1}}},c649:function(e,t,i){"use strict";(function(e){i.d(t,"c",(function(){return c})),i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return o})),i.d(t,"d",(function(){return l}));i("a481");function n(){return"undefined"!==typeof window?window.console:e.console}var o=n();function s(e){var t=Object.create(null);return function(i){var n=t[i];return n||(t[i]=e(i))}}var r=/-(\w)/g,a=s((function(e){return e.replace(r,(function(e,t){return t?t.toUpperCase():""}))}));function l(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function c(e,t,i){var n=0===i?e.children[0]:e.children[i-1].nextSibling;e.insertBefore(t,n)}}).call(this,i("c8ba"))},c69a:function(e,t,i){e.exports=!i("9e1e")&&!i("79e5")((function(){return 7!=Object.defineProperty(i("230e")("div"),"a",{get:function(){return 7}}).a}))},c8ba:function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(n){"object"===typeof window&&(i=window)}e.exports=i},ca5a:function(e,t){var i=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++i+n).toString(36))}},cadf:function(e,t,i){"use strict";var n=i("9c6c"),o=i("d53b"),s=i("84f2"),r=i("6821");e.exports=i("01f9")(Array,"Array",(function(e,t){this._t=r(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,i=this._i++;return!e||i>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?i:"values"==t?e[i]:[i,e[i]])}),"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},cb7c:function(e,t,i){var n=i("d3f4");e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},ce10:function(e,t,i){var n=i("69a8"),o=i("6821"),s=i("c366")(!1),r=i("613b")("IE_PROTO");e.exports=function(e,t){var i,a=o(e),l=0,c=[];for(i in a)i!=r&&n(a,i)&&c.push(i);while(t.length>l)n(a,i=t[l++])&&(~s(c,i)||c.push(i));return c}},d2c8:function(e,t,i){var n=i("aae3"),o=i("be13");e.exports=function(e,t,i){if(n(t))throw TypeError("String#"+i+" doesn't accept regex!");return String(o(e))}},d3f4:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},d53b:function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},d8e8:function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},e11e:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},f559:function(e,t,i){"use strict";var n=i("5ca1"),o=i("9def"),s=i("d2c8"),r="startsWith",a=""[r];n(n.P+n.F*i("5147")(r),"String",{startsWith:function(e){var t=s(this,e,r),i=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return a?a.call(t,n,i):t.slice(i,i+n.length)===n}})},f6fd:function(e,t){(function(e){var t="currentScript",i=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(n){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(n.stack)||[!1])[1];for(e in i)if(i[e].src==t||"interactive"==i[e].readyState)return i[e];return null}}})})(document)},f751:function(e,t,i){var n=i("5ca1");n(n.S+n.F,"Object",{assign:i("7333")})},fa5b:function(e,t,i){e.exports=i("5537")("native-function-to-string",Function.toString)},fab2:function(e,t,i){var n=i("7726").document;e.exports=n&&n.documentElement},fb15:function(e,t,i){"use strict";var n;(i.r(t),"undefined"!==typeof window)&&(i("f6fd"),(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(i.p=n[1]));i("f751"),i("f559"),i("ac6a"),i("cadf"),i("456d");function o(e){if(Array.isArray(e))return e}function s(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var i=[],n=!0,o=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done);n=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){o=!0,s=l}finally{try{n||null==a["return"]||a["return"]()}finally{if(o)throw s}}return i}}function r(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 a(e,t){if(e){if("string"===typeof e)return r(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(e,t):void 0}}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){return o(e)||s(e,t)||a(e,t)||l()}i("6762"),i("2fdb");function d(e){if(Array.isArray(e))return r(e)}function h(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e){return d(e)||h(e)||a(e)||u()}var f=i("a352"),m=i.n(f),p=i("c649");function _(e,t,i){return void 0===i||(e=e||{},e[t]=i),e}function b(e,t){return e.map((function(e){return e.elm})).indexOf(t)}function v(e,t,i,n){if(!e)return[];var o=e.map((function(e){return e.elm})),s=t.length-n,r=g(t).map((function(e,t){return t>=s?o.length:o.indexOf(e)}));return i?r.filter((function(e){return-1!==e})):r}function w(e,t){var i=this;this.$nextTick((function(){return i.$emit(e.toLowerCase(),t)}))}function C(e){var t=this;return function(i){null!==t.realList&&t["onDrag"+e](i),w.call(t,e,i)}}function y(e){return["transition-group","TransitionGroup"].includes(e)}function S(e){if(!e||1!==e.length)return!1;var t=c(e,1),i=t[0].componentOptions;return!!i&&y(i.tag)}function x(e,t,i){return e[i]||(t[i]?t[i]():void 0)}function k(e,t,i){var n=0,o=0,s=x(t,i,"header");s&&(n=s.length,e=e?[].concat(g(s),g(e)):g(s));var r=x(t,i,"footer");return r&&(o=r.length,e=e?[].concat(g(e),g(r)):g(r)),{children:e,headerOffset:n,footerOffset:o}}function L(e,t){var i=null,n=function(e,t){i=_(i,e,t)},o=Object.keys(e).filter((function(e){return"id"===e||e.startsWith("data-")})).reduce((function(t,i){return t[i]=e[i],t}),{});if(n("attrs",o),!t)return i;var s=t.on,r=t.props,a=t.attrs;return n("on",s),n("props",r),Object.assign(i.attrs,a),i}var E=["Start","Add","Remove","Update","End"],D=["Choose","Unchoose","Sort","Filter","Clone"],N=["Move"].concat(E,D).map((function(e){return"on"+e})),I=null,T={options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:function(e){return e}},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},M={name:"draggable",inheritAttrs:!1,props:T,data:function(){return{transitionMode:!1,noneFunctionalComponentMode:!1}},render:function(e){var t=this.$slots.default;this.transitionMode=S(t);var i=k(t,this.$slots,this.$scopedSlots),n=i.children,o=i.headerOffset,s=i.footerOffset;this.headerOffset=o,this.footerOffset=s;var r=L(this.$attrs,this.componentData);return e(this.getTag(),r,n)},created:function(){null!==this.list&&null!==this.value&&p["b"].error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&p["b"].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),void 0!==this.options&&p["b"].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted:function(){var e=this;if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));var t={};E.forEach((function(i){t["on"+i]=C.call(e,i)})),D.forEach((function(i){t["on"+i]=w.bind(e,i)}));var i=Object.keys(this.$attrs).reduce((function(t,i){return t[Object(p["a"])(i)]=e.$attrs[i],t}),{}),n=Object.assign({},this.options,i,t,{onMove:function(t,i){return e.onDragMove(t,i)}});!("draggable"in n)&&(n.draggable=">*"),this._sortable=new m.a(this.rootContainer,n),this.computeIndexes()},beforeDestroy:function(){void 0!==this._sortable&&this._sortable.destroy()},computed:{rootContainer:function(){return this.transitionMode?this.$el.children[0]:this.$el},realList:function(){return this.list?this.list:this.value}},watch:{options:{handler:function(e){this.updateOptions(e)},deep:!0},$attrs:{handler:function(e){this.updateOptions(e)},deep:!0},realList:function(){this.computeIndexes()}},methods:{getIsFunctional:function(){var e=this._vnode.fnOptions;return e&&e.functional},getTag:function(){return this.tag||this.element},updateOptions:function(e){for(var t in e){var i=Object(p["a"])(t);-1===N.indexOf(i)&&this._sortable.option(i,e[t])}},getChildrenNodes:function(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;var e=this.$slots.default;return this.transitionMode?e[0].child.$slots.default:e},computeIndexes:function(){var e=this;this.$nextTick((function(){e.visibleIndexes=v(e.getChildrenNodes(),e.rootContainer.children,e.transitionMode,e.footerOffset)}))},getUnderlyingVm:function(e){var t=b(this.getChildrenNodes()||[],e);if(-1===t)return null;var i=this.realList[t];return{index:t,element:i}},getUnderlyingPotencialDraggableComponent:function(e){var t=e.__vue__;return t&&t.$options&&y(t.$options._componentTag)?t.$parent:!("realList"in t)&&1===t.$children.length&&"realList"in t.$children[0]?t.$children[0]:t},emitChanges:function(e){var t=this;this.$nextTick((function(){t.$emit("change",e)}))},alterList:function(e){if(this.list)e(this.list);else{var t=g(this.value);e(t),this.$emit("input",t)}},spliceList:function(){var e=arguments,t=function(t){return t.splice.apply(t,g(e))};this.alterList(t)},updatePosition:function(e,t){var i=function(i){return i.splice(t,0,i.splice(e,1)[0])};this.alterList(i)},getRelatedContextFromMoveEvent:function(e){var t=e.to,i=e.related,n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};var o=n.realList,s={list:o,component:n};if(t!==i&&o&&n.getUnderlyingVm){var r=n.getUnderlyingVm(i);if(r)return Object.assign(r,s)}return s},getVmIndex:function(e){var t=this.visibleIndexes,i=t.length;return e>i-1?i:t[e]},getComponent:function(){return this.$slots.default[0].componentInstance},resetTransitionData:function(e){if(this.noTransitionOnDrag&&this.transitionMode){var t=this.getChildrenNodes();t[e].data=null;var i=this.getComponent();i.children=[],i.kept=void 0}},onDragStart:function(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),I=e.item},onDragAdd:function(e){var t=e.item._underlying_vm_;if(void 0!==t){Object(p["d"])(e.item);var i=this.getVmIndex(e.newIndex);this.spliceList(i,0,t),this.computeIndexes();var n={element:t,newIndex:i};this.emitChanges({added:n})}},onDragRemove:function(e){if(Object(p["c"])(this.rootContainer,e.item,e.oldIndex),"clone"!==e.pullMode){var t=this.context.index;this.spliceList(t,1);var i={element:this.context.element,oldIndex:t};this.resetTransitionData(t),this.emitChanges({removed:i})}else Object(p["d"])(e.clone)},onDragUpdate:function(e){Object(p["d"])(e.item),Object(p["c"])(e.from,e.item,e.oldIndex);var t=this.context.index,i=this.getVmIndex(e.newIndex);this.updatePosition(t,i);var n={element:this.context.element,oldIndex:t,newIndex:i};this.emitChanges({moved:n})},updateProperty:function(e,t){e.hasOwnProperty(t)&&(e[t]+=this.headerOffset)},computeFutureIndex:function(e,t){if(!e.element)return 0;var i=g(t.to.children).filter((function(e){return"none"!==e.style["display"]})),n=i.indexOf(t.related),o=e.component.getVmIndex(n),s=-1!==i.indexOf(I);return s||!t.willInsertAfter?o:o+1},onDragMove:function(e,t){var i=this.move;if(!i||!this.realList)return!0;var n=this.getRelatedContextFromMoveEvent(e),o=this.context,s=this.computeFutureIndex(n,e);Object.assign(o,{futureIndex:s});var r=Object.assign({},e,{relatedContext:n,draggedContext:o});return i(r,t)},onDragEnd:function(){this.computeIndexes(),I=null}}};"undefined"!==typeof window&&"Vue"in window&&window.Vue.component("draggable",M);var O=M;t["default"]=O}})["default"]}))},d9a1:function(e,t,i){"use strict";i("0e76")},df3c:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".context-view{position:absolute;z-index:2500}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;z-index:2500;color:inherit}",""]),e.exports=t},df69:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-drawer",{attrs:{visible:e.visible,size:"80%","append-to-body":""},on:{"update:visible":function(t){e.visible=t}}},[i("el-table",{attrs:{data:e.list,border:""}},[i("el-table-column",{attrs:{align:"center",width:"60"},scopedSlots:e._u([{key:"header",fn:function(){return[i("el-button",{attrs:{icon:"el-icon-plus",type:"primary",circle:"",size:"mini"},on:{click:function(t){return e.list.push({})}}})]},proxy:!0},{key:"default",fn:function(t){var n=t.$index;return[i("el-button",{attrs:{icon:"el-icon-minus",type:"danger",circle:"",size:"mini"},on:{click:function(t){return e.list.splice(n,1)}}})]}}])}),i("el-table-column",{attrs:{label:"字段名",prop:"label",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[i("el-input",{attrs:{placeholder:"请输入 字段名"},model:{value:n.label,callback:function(t){e.$set(n,"label",t)},expression:"row.label"}})]}}])}),i("el-table-column",{attrs:{label:"Prop",prop:"prop",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[i("el-input",{attrs:{placeholder:"请输入 prop"},model:{value:n.prop,callback:function(t){e.$set(n,"prop",t)},expression:"row.prop"}})]}}])}),i("el-table-column",{attrs:{label:"类型",prop:"type",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[i("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择 类型",filterable:""},model:{value:n.type,callback:function(t){e.$set(n,"type",t)},expression:"row.type"}},e._l(e.fields,(function(e){return i("el-option",{key:e.value,attrs:{label:e.value,value:e.value}})})),1)]}}])}),i("el-table-column",{attrs:{label:"搜索",prop:"search",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[i("el-switch",{model:{value:n.search,callback:function(t){e.$set(n,"search",t)},expression:"row.search"}})]}}])}),i("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[["select","cascader","tree","radio","checkbox"].includes(n.type)?[i("el-button",{attrs:{type:"text"},on:{click:function(t){return e.handleDic(n)}}},[e._v("字典配置")])]:e._e()]}}])})],1),i("span",{staticClass:"afd-drawer-foot"},[i("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("确定")]),i("el-button",{on:{click:function(t){e.visible=!1}}},[e._v("取消")])],1)],1)},o=[],s=[{label:"输入框",value:"input"},{label:"选择框",value:"select"},{label:"密码框",value:"password"},{label:"数字框",value:"number"},{label:"上传框",value:"upload"},{label:"颜色选择器",value:"color"},{label:"地图选择器",value:"map"},{label:"图标选择器",value:"icon"},{label:"树型下拉框",value:"tree"},{label:"单选框",value:"radio"},{label:"多选",value:"checkbox"},{label:"开关框",value:"switch"},{label:"文本框",value:"textarea"},{label:"时间框",value:"time"},{label:"时间范围",value:"timerange"},{label:"级联框",value:"cascader"},{label:"日期框",value:"date"},{label:"日期时间框",value:"datetime"},{label:"日期时间范围",value:"datetimerange"},{label:"多个日期",value:"dates"},{label:"月",value:"month"},{label:"周",value:"week"},{label:"年",value:"year"}],r={name:"column",props:{column:[]},emits:["submit"],watch:{column:{handler:function(e){this.list=e},deep:!0,immediate:!0}},data:function(){return{fields:s,visible:!1,list:[]}},methods:{handleSubmit:function(){this.$emit("submit",this.deepClone(this.list)),this.visible=!1},handleDic:function(e){console.log(e),this.$message.error("暂未实现")}}},a=r,l=i("e3d4"),c=Object(l["a"])(a,n,o,!1,null,null,null);t["a"]=c.exports},df70:function(e,t,i){var n=i("139d");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("70a7146b",n,!0,{sourceMap:!1,shadowMode:!1})},df93:function(e,t,i){var n=i("e577");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("7f190836",n,!0,{sourceMap:!1,shadowMode:!1})},dff0:function(e,t,i){var n=i("8dab");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("7ef46c60",n,!0,{sourceMap:!1,shadowMode:!1})},e09a:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-icon-label{display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:0;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;-ms-flex-negative:0;flex-shrink:0}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;-webkit-box-flex:1;-ms-flex:1;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;margin:auto 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}",""]),e.exports=t},e0e0:function(e,t,i){"use strict";var n=i("15b2").IteratorPrototype,o=i("ca2b"),s=i("4d82"),r=i("63ef"),a=i("d85b"),l=function(){return this};e.exports=function(e,t,i,c){var d=t+" Iterator";return e.prototype=o(n,{next:s(+!c,i)}),r(e,d,!1,!0),a[d]=l,e}},e244:function(e,t,i){(function(t){var i=function(e){return e&&e.Math==Math&&e};e.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,i("c8ed"))},e248:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".context-view .monaco-menu{min-width:130px}",""]),e.exports=t},e263:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}",""]),e.exports=t},e2da:function(e,t,i){"use strict";var n=i("45ad"),o=i("6e10"),s=i("d85b"),r=i("35d6"),a=i("b896").f,l=i("325d"),c=i("f0db"),d=i("55ab"),h="Array Iterator",u=r.set,g=r.getterFor(h);e.exports=l(Array,"Array",(function(e,t){u(this,{type:h,target:n(e),index:0,kind:t})}),(function(){var e=g(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");var f=s.Arguments=s.Array;if(o("keys"),o("values"),o("entries"),!c&&d&&"values"!==f.name)try{a(f,"name",{value:"values"})}catch(m){}},e3d4:function(e,t,i){"use strict";function n(e,t,i,n,o,s,r,a){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),r?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",(function(){return n}))},e3f4:function(e,t,i){(function(e){function i(e,t){for(var i=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),i++):i&&(e.splice(n,1),i--)}if(t)for(;i--;i)e.unshift("..");return e}function n(e){"string"!==typeof e&&(e+="");var t,i=0,n=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){i=t+1;break}}else-1===n&&(o=!1,n=t+1);return-1===n?"":e.slice(i,n)}function o(e,t){if(e.filter)return e.filter(t);for(var i=[],n=0;n<e.length;n++)t(e[n],n,e)&&i.push(e[n]);return i}t.resolve=function(){for(var t="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var r=s>=0?arguments[s]:e.cwd();if("string"!==typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(t=r+"/"+t,n="/"===r.charAt(0))}return t=i(o(t.split("/"),(function(e){return!!e})),!n).join("/"),(n?"/":"")+t||"."},t.normalize=function(e){var n=t.isAbsolute(e),r="/"===s(e,-1);return e=i(o(e.split("/"),(function(e){return!!e})),!n).join("/"),e||n||(e="."),e&&r&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(o(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,i){function n(e){for(var t=0;t<e.length;t++)if(""!==e[t])break;for(var i=e.length-1;i>=0;i--)if(""!==e[i])break;return t>i?[]:e.slice(t,i-t+1)}e=t.resolve(e).substr(1),i=t.resolve(i).substr(1);for(var o=n(e.split("/")),s=n(i.split("/")),r=Math.min(o.length,s.length),a=r,l=0;l<r;l++)if(o[l]!==s[l]){a=l;break}var c=[];for(l=a;l<o.length;l++)c.push("..");return c=c.concat(s.slice(a)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!==typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),i=47===t,n=-1,o=!0,s=e.length-1;s>=1;--s)if(t=e.charCodeAt(s),47===t){if(!o){n=s;break}}else o=!1;return-1===n?i?"/":".":i&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var i=n(e);return t&&i.substr(-1*t.length)===t&&(i=i.substr(0,i.length-t.length)),i},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,i=0,n=-1,o=!0,s=0,r=e.length-1;r>=0;--r){var a=e.charCodeAt(r);if(47!==a)-1===n&&(o=!1,n=r+1),46===a?-1===t?t=r:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){i=r+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===i+1?"":e.slice(t,n)};var s="b"==="ab".substr(-1)?function(e,t,i){return e.substr(t,i)}:function(e,t,i){return t<0&&(t=e.length+t),e.substr(t,i)}}).call(this,i("2552"))},e4f5:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}",""]),e.exports=t},e577:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .view-ruler{position:absolute;top:0}",""]),e.exports=t},e5d9:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:transparent;-webkit-transition:opacity .1s linear;transition:opacity .1s linear}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{-webkit-transition:opacity .8s linear;transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}",""]),e.exports=t},e629:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},e635:function(e,t,i){var n=i("c91b");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("8ddd7898",n,!0,{sourceMap:!1,shadowMode:!1})},e669:function(module,__webpack_exports__,__webpack_require__){"use strict";var _Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("5491"),_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("d543"),_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("863c"),regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("fc08"),regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("085b"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("fa89"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("f96e"),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("b105"),core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("d927"),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("2eb0"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("a8de"),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("ef61"),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("2f62"),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_12__),_fieldsConfig_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("1e33"),_utils_index__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("e74d"),_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("826e"),_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("d895"),_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("3a5d"),_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_17__),_mixins_history__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("2790"),vuedraggable__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("d958"),vuedraggable__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(vuedraggable__WEBPACK_IMPORTED_MODULE_19__),_WidgetForm__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("17b9"),_FormConfig__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("a5f6"),_WidgetConfig__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("d80d");__webpack_exports__["a"]={name:"FormDesign",components:{Draggable:vuedraggable__WEBPACK_IMPORTED_MODULE_19___default.a,MonacoEditor:_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_16__["a"],WidgetForm:_WidgetForm__WEBPACK_IMPORTED_MODULE_20__["a"],FormConfig:_FormConfig__WEBPACK_IMPORTED_MODULE_21__["a"],WidgetConfig:_WidgetConfig__WEBPACK_IMPORTED_MODULE_22__["a"]},mixins:[_mixins_history__WEBPACK_IMPORTED_MODULE_18__["a"]],props:{options:{type:[Object,String],default:function(){return{column:[]}}},storage:{type:Boolean,default:!1},asideLeftWidth:{type:[String,Number],default:"270px"},asideRightWidth:{type:[String,Number],default:"380px"},showGithubStar:{type:Boolean,default:!0},toolbar:{type:Array,default:function(){return["import","generate","preview","clear"]}},undoRedo:{type:Boolean,default:!0},includeFields:{type:Array,default:function(){var e=[];return _fieldsConfig_js__WEBPACK_IMPORTED_MODULE_13__["a"].forEach((function(t){t.list.forEach((function(t){e.push(t.type)}))})),e}},customFields:{type:Array},defaultValues:{type:Object}},watch:{options:{handler:function handler(val){var _this2=this,options=val;if("string"==typeof options)try{options=eval("("+options+")")}catch(e){console.error("非法配置"),options={column:[]}}this.transAvueOptionsToFormDesigner(options).then((function(e){_this2.widgetForm=Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__["a"])({},_this2.widgetForm),e)}))},deep:!0},widgetFormSelect:{handler:function(){"form"==this.configTab&&(this.configTab="widget")},deep:!0}},computed:{leftWidth:function(){return"string"==typeof this.asideLeftWidth?this.asideLeftWidth:"".concat(this.asideLeftWidth,"px")},rightWidth:function(){return"string"==typeof this.asideRightWidth?this.asideRightWidth:"".concat(this.asideRightWidth,"px")}},data:function(){return{widgetEmpty:_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_17___default.a,fields:_fieldsConfig_js__WEBPACK_IMPORTED_MODULE_13__["a"],widgetForm:{column:[],labelPosition:"left",labelSuffix:":",labelWidth:120,gutter:0,menuBtn:!0,submitBtn:!0,submitText:"提交",emptyBtn:!0,emptyText:"清空",menuPosition:"center"},option:{},configTab:"form",widgetFormSelect:{},previewVisible:!1,generateJsonVisible:!1,importJsonVisible:!1,importJson:{},form:{},configOption:{generateType:"json",space:2,quoteType:"single",dropQuotesOnKeys:!0},history:{index:0,maxStep:20,steps:[]}}},mounted:function(){this.handleLoadStorage(),this.handleLoadCss()},methods:{handleLoadStorage:function handleLoadStorage(){var _this3=this;return Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(regeneratorRuntime.mark((function _callee(){var options;return regeneratorRuntime.wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(options=_this3.options,"string"==typeof options)try{options=eval("("+options+")")}catch(e){console.error("非法配置"),options={column:[]}}return options.column||(options.column=[]),_context.t0=_this3,_context.next=6,_this3.transAvueOptionsToFormDesigner(Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__["a"])({},_this3.widgetForm),options));case 6:_context.t1=_context.sent,_context.t2=[_context.t1],_context.t3=_this3.storage,_context.t4={index:0,maxStep:20,steps:_context.t2,storage:_context.t3},_this3.widgetForm=_context.t0.initHistory.call(_context.t0,_context.t4),_this3.undoRedo&&window.addEventListener("keydown",(function(e){(e.metaKey&&!e.shiftKey&&90==e.keyCode||e.ctrlKey&&!e.shiftKey&&90==e.keyCode)&&(_this3.widgetForm=_this3.handleUndo()),(e.metaKey&&e.shiftKey&&90==e.keyCode||e.ctrlKey&&e.shiftKey&&90==e.keyCode||e.ctrlKey&&89==e.keyCode)&&(_this3.widgetForm=_this3.handleRedo())}),!1);case 12:case"end":return _context.stop()}}),_callee)})))()},handleLoadCss:function(){var e=document.getElementsByTagName("head")[0],t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href="https://at.alicdn.com/t/font_1254447_zc9iezc230c.css",e.appendChild(t)},handleAvueDoc:function(){window.open("https://avuejs.com/form/form.html","_blank")},handleFieldClick:function(e){var t=this,i=this.widgetForm.column.findIndex((function(e){return e.prop==t.widgetFormSelect.prop}))+1,n=0;-1==i?(this.widgetForm.column.push(e),n=this.widgetForm.column.length-1):(this.widgetForm.column.splice(i,0,e),n=i),this.$refs.widgetForm.handleWidgetAdd({newIndex:n})},handlePreview:function(){var e=this;this.widgetForm.column&&0!=this.widgetForm.column.length?this.transformToAvueOptions(this.widgetForm,!0).then((function(t){e.option=t,e.previewVisible=!0})):this.$message.error("没有需要展示的内容")},handleImportJsonSubmit:function(){var e=this;try{this.transAvueOptionsToFormDesigner(this.importJson).then((function(t){e.widgetForm=t,e.importJsonVisible=!1,e.handleHistoryChange(e.widgetForm)}))}catch(t){this.$message.error(t.message)}},handleGenerateJson:function(){var e=this;this.transformToAvueOptions(this.widgetForm).then((function(t){e.option=t,e.generateJsonVisible=!0}))},handleGenerate:function(){var e=this;this.transformToAvueOptions(this.widgetForm).then((function(t){e.configOption.generateType&&"string"==e.configOption.generateType?e.$emit("submit",Object(_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_15__["a"])(t,Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__["a"])({minify:!0},e.configOption))):e.$emit("submit",t)}))},handleCopy:function(){var e=this;this.transformToAvueOptions(this.widgetForm).then((function(t){e.$Clipboard({text:Object(_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_15__["a"])(t,Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__["a"])({minify:!0},e.configOption))}).then((function(){e.$message.success("复制成功")})).catch((function(){e.$message.error("复制失败")}))}))},handlePreviewSubmit:function(e,t){var i=this;t?this.$alert(this.form).then((function(){t()})).catch((function(){t()})):this.$refs.form.validate((function(e,t){e&&i.$alert(i.form).then((function(){t()})).catch((function(){t()}))}))},handleBeforeClose:function(){this.$refs.form.resetForm(),this.form={},this.previewVisible=!1},handleClear:function(){var e=this;this.widgetForm&&this.widgetForm.column&&this.widgetForm.column.length>0?this.$confirm("确定要清空吗?","警告",{type:"warning"}).then((function(){e.$set(e.widgetForm,"column",[]),e.$set(e,"form",{}),e.$set(e,"widgetFormSelect",{}),e.handleHistoryChange(e.widgetForm)})).catch((function(){})):this.$message.error("没有需要清空的内容")},transformToAvueOptions:function transformToAvueOptions(obj){var _this12=this,isPreview=arguments.length>1&&void 0!==arguments[1]&&arguments[1],_this=this;return new Promise((function(resolve,reject){try{(function(){var data=_this.deepClone(obj);for(var key in data)Object(_utils_index__WEBPACK_IMPORTED_MODULE_14__["c"])(data[key])&&delete data[key];for(var _loop=function _loop(_i){var col=data.column[_i];if(isPreview){var event=["change","blur","click","focus"];event.forEach((function(e){col[e]&&(col[e]=eval((col[e]+"").replace(/this/g,"_this")))})),col.event&&Object.keys(col.event).forEach((function(key){return col.event[key]=eval((col.event[key]+"").replace(/this/g,"_this"))}))}if("dynamic"==col.type&&col.children&&col.children.column&&col.children.column.length>0){var c=col.children.column;c.forEach((function(e){delete e.subfield})),_this12.transformToAvueOptions(col.children,isPreview).then((function(e){col.children=e}))}else if("group"==col.type){data.group||(data.group=[]);var group={label:col.label,icon:col.icon,prop:col.prop,arrow:col.arrow,collapse:col.collapse,display:col.display};_this12.transformToAvueOptions(col.children,isPreview).then((function(e){group.column=e.column,data.group.push(group)})),data.column.splice(_i,1),_i--}else if(["checkbox","radio","tree","cascader","select"].includes(col.type)){if("static"==col.dicOption){delete col.dicUrl,delete col.dicMethod,delete col.dicQuery,delete col.dicQueryConfig;var _col$props=col.props,label=_col$props.label,value=_col$props.value,desc=_col$props.desc;col.dicData.forEach((function(e){if(e.label){var t=e.label;delete e.label,e[label]=t}if(e.value){var i=e.value;delete e.value,e[value]=i}if(e.desc){var n=e.desc;delete e.desc,e[desc]=n}}))}else if("remote"==col.dicOption)if(delete col.dicData,col.dicQueryConfig&&col.dicQueryConfig.length>0){var query={};col.dicQueryConfig.forEach((function(e){e.key&&e.value&&(query[e.key]=e.value)})),col.dicQuery=query,delete col.dicQueryConfig}else delete col.dicQueryConfig;delete col.dicOption}else if(["upload"].includes(col.type)){if(col.headersConfig&&col.headersConfig.length>0){var headers={};col.headersConfig.forEach((function(e){e.key&&e.value&&(headers[e.key]=e.value)})),col.headers=headers}else delete col.headers;if(delete col.headersConfig,col.dataConfig&&col.dataConfig.length>0){var _data={};col.dataConfig.forEach((function(e){e.key&&e.value&&(_data[e.key]=e.value)})),col.data=_data}else delete col.data;delete col.dataConfig}for(var _key in col)Object(_utils_index__WEBPACK_IMPORTED_MODULE_14__["c"])(col[_key])&&delete col[_key];i=_i},i=0;i<data.column.length;i++)_loop(i);resolve(data)})()}catch(e){reject(e)}}))},transAvueOptionsToFormDesigner:function transAvueOptionsToFormDesigner(obj){var _this13=this;"string"==typeof obj&&(obj=eval("("+obj+")"));var data=this.deepClone(obj);return new Promise((function(e,t){try{if(data.column&&data.column.length>0&&data.column.forEach((function(e){if("dynamic"==e.type&&e.children&&e.children.column&&e.children.column.length>0){var t=e.children.column;t.forEach((function(e){e.subfield=!0})),_this13.transAvueOptionsToFormDesigner(e.children).then((function(t){e.children=t}))}else if(["checkbox","radio","tree","cascader","select"].includes(e.type)){if(!e.dicData&&e.dicQuery&&"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_0__["a"])(e.dicQuery)){var i=[];for(var n in e.dicQuery)i.push({key:n,value:e.dicQuery[n],$cellEdit:!0});e.dicQueryConfig=i}e.dicUrl?e.dicOption="remote":e.dicOption="static",e.dicData?e.props&&e.dicData.forEach((function(t){var i=e.props,n=i.label,o=i.value,s=i.desc;if(n){var r=t[n];delete t[n],t.label=r}if(o){var a=t[o];delete t[o],t.value=a}if(s){var l=t[s];delete t[s],t.desc=l}})):e.dicData=[]}else if(["upload"].includes(e.type)){if(e.headers&&"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_0__["a"])(e.headers)){var o=[];for(var s in e.headers)o.push({key:s,value:e.headers[s],$cellEdit:!0});e.headersConfig=o}else e.headersConfig=[];if(e.data&&"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_0__["a"])(e.data)){var r=[];for(var a in e.data)r.push({key:a,value:e.data[a],$cellEdit:!0});e.dataConfig=r}else e.dataConfig=[]}})),data.group&&data.group.length>0){for(var i=function(e){data.column||(data.column=[]);var t=data.group[e],i={type:"group",label:t.label,icon:t.icon,prop:t.prop,arrow:t.arrow,collapse:t.collapse,display:t.display};_this13.transAvueOptionsToFormDesigner(t).then((function(e){i.children=e,data.column.push(i)}))},n=0;n<data.group.length;n++)i(n);delete data.group}e(data)}catch(o){t(o)}}))},getData:function(){var e=arguments,t=this;return Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(regeneratorRuntime.mark((function i(){var n,o,s;return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=e.length>0&&void 0!==e[0]?e[0]:"json",o=e.length>1&&void 0!==e[1]?e[1]:{},"string"!=n){i.next=11;break}return i.t0=_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_15__["a"],i.next=6,t.transformToAvueOptions(t.widgetForm);case 6:return i.t1=i.sent,i.t2=Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__["a"])({minify:!0},o),i.abrupt("return",(0,i.t0)(i.t1,i.t2));case 11:if("app"!=n){i.next=19;break}return i.next=14,t.transformToAvueOptions(t.widgetForm);case 14:return s=i.sent,t.parseJson(s),i.abrupt("return",s);case 19:return i.next=21,t.transformToAvueOptions(t.widgetForm);case 21:return i.abrupt("return",i.sent);case 22:case"end":return i.stop()}}),i)})))()},parseJson:function(e){for(var t in e){var i=e[t];i&&i.length>0&&"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_0__["a"])(i)||"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_nosync_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_0__["a"])(i)?this.parseJson(i):"function"==typeof i&&(e[t]=i+"")}}}}},e6b2:function(e,t){(function(t){e.exports=t}).call(this,{})},e74d:function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){return a}));i("fa89"),i("f96e"),i("2eb0"),i("7352"),i("a8de"),i("f05e"),i("2f62");function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=s(e);return o(t)||t.split(".").forEach((function(e){i=o(i[e])?"":i[e]})),i}function o(e){if(e instanceof Date||"boolean"===typeof e||"number"===typeof e||e instanceof Array)return!1;if(e instanceof Function){var t=e.toString().replace(/\s+/g,""),i=["({value})=>{}","(res,cb)=>{}","(res)=>{}","()=>{}"];return!!i.includes(t)}if(e instanceof Object){for(var n in e)return!1;return!0}return"null"===e||null==e||"undefined"===e||void 0===e||""===e}var s=function e(t){var i,n=r(t);if("array"===n)i=[];else{if("object"!==n)return t;i={}}if("array"===n)for(var o=0,s=t.length;o<s;o++)t[o]=function(){return t[o],t[o]}(),t[o]&&delete t[o].$parent,i.push(e(t[o]));else if("object"===n)for(var a in t)t&&delete t.$parent,i[a]=e(t[a]);return i},r=function(e){var t=Object.prototype.toString,i={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return e instanceof Element?"element":i[t.call(e)]},a=function(e){if(window.AVUE){var t=window.AVUE.version.split(".");e=e.split(".");var i=Math.max(t.length,e.length);while(t.length<i)t.push("0");while(e.length<i)e.push("0");for(var n=0;n<i;n++){var o=parseInt(t[n]),s=parseInt(e[n]);if(o>s)return!1;if(o<s)return!0}return!0}}},e820:function(e,t,i){"use strict";i("2eb0");var n=i("6f9e"),o=i("7d86"),s=i("6e1d"),r=i("ac97"),a=i("1810"),l=i("69f1"),c=a("species"),d=RegExp.prototype;e.exports=function(e,t,i,h){var u=a(e),g=!r((function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})),f=g&&!r((function(){var t=!1,i=/a/;return"split"===e&&(i={},i.constructor={},i.constructor[c]=function(){return i},i.flags="",i[u]=/./[u]),i.exec=function(){return t=!0,null},i[u](""),!t}));if(!g||!f||i){var m=n(/./[u]),p=t(u,""[e],(function(e,t,i,o,r){var a=n(e),l=t.exec;return l===s||l===d.exec?g&&!r?{done:!0,value:m(t,i,o)}:{done:!0,value:a(i,t,o)}:{done:!1}}));o(String.prototype,e,p[0]),o(d,u,p[1])}h&&l(d[u],"sham",!0)}},eba9:function(e,t,i){var n=i("58a5");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("05f4173a",n,!0,{sourceMap:!1,shadowMode:!1})},ec23:function(e,t,i){var n=i("e244"),o=i("58d1"),s=i("fbcf"),r=i("9564"),a=i("c401"),l=i("6e1d"),c=n.TypeError;e.exports=function(e,t){var i=e.exec;if(r(i)){var n=o(i,e,t);return null!==n&&s(n),n}if("RegExp"===a(e))return o(l,e,t);throw c("RegExp#exec called on incompatible receiver")}},eca0:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .lines-content .core-guide{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box}",""]),e.exports=t},eee7:function(e,t,i){var n=i("9564");e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},ef61:function(e,t,i){var n=i("83ec"),o=i("c673"),s=i("3e1a"),r=i("ac97"),a=r((function(){s(1)}));n({target:"Object",stat:!0,forced:a},{keys:function(e){return s(o(e))}})},f05e:function(e,t,i){"use strict";var n=i("6f9e"),o=i("32a5").PROPER,s=i("7d86"),r=i("fbcf"),a=i("81e5"),l=i("04c3"),c=i("ac97"),d=i("ff5c"),h="toString",u=RegExp.prototype,g=u[h],f=n(d),m=c((function(){return"/a/b"!=g.call({source:"a",flags:"b"})})),p=o&&g.name!=h;(m||p)&&s(RegExp.prototype,h,(function(){var e=r(this),t=l(e.source),i=e.flags,n=l(void 0===i&&a(u,e)&&!("flags"in u)?f(e):i);return"/"+t+"/"+n}),{unsafe:!0})},f0db:function(e,t){e.exports=!1},f0f1:function(e,t,i){var n=i("396d"),o=i("e629"),s=o.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},f10c:function(e,t,i){var n=i("e244"),o=i("58d1"),s=i("9564"),r=i("eee7"),a=n.TypeError;e.exports=function(e,t){var i,n;if("string"===t&&s(i=e.toString)&&!r(n=o(i,e)))return n;if(s(i=e.valueOf)&&!r(n=o(i,e)))return n;if("string"!==t&&s(i=e.toString)&&!r(n=o(i,e)))return n;throw a("Can't convert object to primitive value")}},f146:function(e,t,i){var n=i("e244"),o=i("eee7"),s=n.document,r=o(s)&&o(s.createElement);e.exports=function(e){return r?s.createElement(e):{}}},f152:function(e,t,i){var n=i("a133");e.exports=function(e,t){return new(n(e))(0===t?0:t)}},f20c:function(e,t,i){"use strict";(function(e){ |