From 41b946ac738104dfe20bd6df4c3f7eaf7ea0b5cf Mon Sep 17 00:00:00 2001 From: Hibariya Date: Thu, 5 Apr 2018 07:06:42 +0900 Subject: [PATCH 1/5] Completion support with monaco editor --- .babelrc | 14 + .gitignore | 2 + Gemfile | 2 + app/assets/javascripts/adhoq/application.js | 1 + .../javascripts/adhoq/previewer.js.coffee | 8 + .../adhoq/current_tables_controller.rb | 23 +- .../queries/_current_tables_leftbar.html.slim | 2 +- app/views/adhoq/queries/_form.html.slim | 4 +- editor/dist/query_editor.bundle.js | 9 + editor/index.js | 2 + editor/query_editor.js | 96 + editor/style.css | 11 + editor/webpack.config.js | 28 + lib/adhoq/engine.rb | 2 + package.json | 21 + spec/spec_helper.rb | 1 + yarn.lock | 5335 +++++++++++++++++ 17 files changed, 5557 insertions(+), 4 deletions(-) create mode 100644 .babelrc create mode 100644 editor/dist/query_editor.bundle.js create mode 100644 editor/index.js create mode 100644 editor/query_editor.js create mode 100644 editor/style.css create mode 100644 editor/webpack.config.js create mode 100644 package.json create mode 100644 yarn.lock diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..4d1bbf8 --- /dev/null +++ b/.babelrc @@ -0,0 +1,14 @@ +{ + "presets": [ + ["es2015", { + "modules": false, + "targets": { + "browsers": "> 1%", + "uglify": true + }, + "useBuiltIns": true + }], + "env", + "stage-0" + ] +} diff --git a/.gitignore b/.gitignore index 2ef3859..97d3e20 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ tmp/* coverage/* gemfiles/*.lock ./Gemfile.lock +.cache +Gemfile.lock diff --git a/Gemfile b/Gemfile index fa046eb..5fada3d 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,8 @@ gemspec # Git. Remember to move these dependencies to your gemspec before releasing # your gem to rubygems.org. +gem 'axlsx', github: 'randym/axlsx' + # To use debugger # gem 'debugger' group :test do diff --git a/app/assets/javascripts/adhoq/application.js b/app/assets/javascripts/adhoq/application.js index 6f7eb62..c9e6543 100644 --- a/app/assets/javascripts/adhoq/application.js +++ b/app/assets/javascripts/adhoq/application.js @@ -16,5 +16,6 @@ //= require ./bootstrap //= require ./previewer //= require ./current_tables +//= require query_editor.bundle window.Adhoq = {} diff --git a/app/assets/javascripts/adhoq/previewer.js.coffee b/app/assets/javascripts/adhoq/previewer.js.coffee index b7606fd..d5b887a 100644 --- a/app/assets/javascripts/adhoq/previewer.js.coffee +++ b/app/assets/javascripts/adhoq/previewer.js.coffee @@ -18,6 +18,14 @@ class Previewer ) source: -> + # NOTE: Sometimes the textarea is empty even if the monaco editor has some contents. + # That's why the editor source is preferred. + @editorSource() || @domSource() + + editorSource: -> + Adhoq.editor && Adhoq.editor.getValue() + + domSource: -> $(@el.data('source')).val() result: -> diff --git a/app/controllers/adhoq/current_tables_controller.rb b/app/controllers/adhoq/current_tables_controller.rb index d50fd78..b5d1f5c 100644 --- a/app/controllers/adhoq/current_tables_controller.rb +++ b/app/controllers/adhoq/current_tables_controller.rb @@ -11,11 +11,32 @@ def index reject {|klass| klass.abstract_class? || hidden_model_names.include?(klass.name) || klass.name.nil? }. sort_by(&:name) - render layout: false + respond_to do |format| + format.html { render layout: false } + format.json { render json: tables_as_json(@ar_classes) } + end end private + def tables_as_json(ar_classes) + ar_classes.map {|ar_class| + { + table_name: ar_class.table_name, + columns: ar_class.columns.map {|column| + { + name: column.name, + type: column.type, + primary_key: column.name == ar_class.primary_key, + null: column.null, + limit: column.limit, + default: column.default + } + } + } + } + end + def eager_load_models return unless Rails.env.development? [Rails.application, Adhoq::Engine].each(&:eager_load!) diff --git a/app/views/adhoq/queries/_current_tables_leftbar.html.slim b/app/views/adhoq/queries/_current_tables_leftbar.html.slim index ec17b81..66a1e81 100644 --- a/app/views/adhoq/queries/_current_tables_leftbar.html.slim +++ b/app/views/adhoq/queries/_current_tables_leftbar.html.slim @@ -1,5 +1,5 @@ #current-tables - a.loading[href=current_tables_path] + a.loading[href=current_tables_path(format: 'html')] javascript: $(function() { diff --git a/app/views/adhoq/queries/_form.html.slim b/app/views/adhoq/queries/_form.html.slim index ca16060..2330949 100644 --- a/app/views/adhoq/queries/_form.html.slim +++ b/app/views/adhoq/queries/_form.html.slim @@ -8,7 +8,8 @@ | Show tables .form-group - = f.text_area :query, class: 'form-control', rows: 15, required: true + .form-control.query-editor + #query_field(data-current-tables-path="#{current_tables_path}" data-id="query_query" data-name="query[query]" data-placeholder="#{@query.persisted? ? 'Edit' : 'New'} query") .modal.fade#nameAndDesc[role='dialog'] .modal-dialog @@ -90,4 +91,3 @@ javascript: Adhoq.enablePreviewKeybordShortCut($('#query_query'), '#previews .tab-pane.active a:has(".fa-refresh")') }); - diff --git a/editor/dist/query_editor.bundle.js b/editor/dist/query_editor.bundle.js new file mode 100644 index 0000000..75c0003 --- /dev/null +++ b/editor/dist/query_editor.bundle.js @@ -0,0 +1,9 @@ +!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=504)}([function(t,e,n){"use strict";n.d(e,"k",function(){return p}),n.d(e,"z",function(){return g}),n.d(e,"v",function(){return y}),n.d(e,"e",function(){return b}),n.d(e,"B",function(){return C}),n.d(e,"I",function(){return w}),n.d(e,"f",function(){return S}),n.d(e,"i",function(){return M}),n.d(e,"g",function(){return N}),n.d(e,"E",function(){return I}),n.d(e,"G",function(){return E}),n.d(e,"h",function(){return z}),n.d(e,"o",function(){return F}),n.d(e,"s",function(){return Y}),n.d(e,"q",function(){return U}),n.d(e,"d",function(){return Z}),n.d(e,"u",function(){return G}),n.d(e,"p",function(){return X}),n.d(e,"t",function(){return K}),n.d(e,"x",function(){return Q}),n.d(e,"n",function(){return q}),n.d(e,"m",function(){return J}),n.d(e,"A",function(){return et}),n.d(e,"y",function(){return nt}),n.d(e,"c",function(){return it}),n.d(e,"b",function(){return ot}),n.d(e,"F",function(){return rt}),n.d(e,"D",function(){return st}),n.d(e,"J",function(){return ut}),n.d(e,"j",function(){return ct}),n.d(e,"a",function(){return ht}),n.d(e,"H",function(){return dt}),n.d(e,"w",function(){return ft}),n.d(e,"C",function(){return pt}),n.d(e,"r",function(){return gt}),n.d(e,"l",function(){return mt}),n.d(e,"K",function(){return vt});var i,o=n(11),r=(n(8),n(29)),s=n(21),a=n(7),u=n(23),c=n(63),l=n(43),h=n(3),d=n(44),f=(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function p(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function g(t){for(;t;){if(t===document.body)return!0;t=t.parentNode}return!1}var m=new(function(){function t(){}return t.prototype._findClassName=function(t,e){var n=t.className;if(n){e=e.trim();var i=n.length,o=e.length;if(0!==o)if(i=0;){if(r=s+o,(0===s||32===n.charCodeAt(s-1))&&32===n.charCodeAt(r))return this._lastStart=s,void(this._lastEnd=r+1);if(s>0&&32===n.charCodeAt(s-1)&&r===i)return this._lastStart=s-1,void(this._lastEnd=r);if(0===s&&r===i)return this._lastStart=0,void(this._lastEnd=r)}this._lastStart=-1}else this._lastStart=-1}else this._lastStart=-1},t.prototype.hasClass=function(t,e){return this._findClassName(t,e),-1!==this._lastStart},t.prototype.addClass=function(t,e){t.className?(this._findClassName(t,e),-1===this._lastStart&&(t.className=t.className+" "+e)):t.className=e},t.prototype.removeClass=function(t,e){this._findClassName(t,e),-1!==this._lastStart&&(t.className=t.className.substring(0,this._lastStart)+t.className.substring(this._lastEnd))},t.prototype.toggleClass=function(t,e,n){this._findClassName(t,e),-1===this._lastStart||void 0!==n&&n||this.removeClass(t,e),-1!==this._lastStart||void 0!==n&&!n||this.addClass(t,e)},t}()),v=new(function(){function t(){}return t.prototype.hasClass=function(t,e){return e&&t.classList&&t.classList.contains(e)},t.prototype.addClass=function(t,e){e&&t.classList&&t.classList.add(e)},t.prototype.removeClass=function(t,e){e&&t.classList&&t.classList.remove(e)},t.prototype.toggleClass=function(t,e,n){t.classList&&t.classList.toggle(e,n)},t}()),_=u.j?m:v,y=_.hasClass.bind(_),b=_.addClass.bind(_),C=_.removeClass.bind(_),w=_.toggleClass.bind(_),L=function(){function t(t,e,n,i){this._node=t,this._type=e,this._handler=n,this._useCapture=i||!1,this._node.addEventListener(this._type,this._handler,this._useCapture)}return t.prototype.dispose=function(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._useCapture),this._node=null,this._handler=null)},t}();function S(t,e,n,i){return new L(t,e,n,i)}var M=function(t,e,n,i){var o=n;return"click"===e||"mousedown"===e?o=function(t){return function(e){return t(new l.b(e))}}(n):"keydown"!==e&&"keypress"!==e&&"keyup"!==e||(o=function(t){return function(e){return t(new c.a(e))}}(n)),S(t,e,o,i)};function N(t,e){return S(t,"mouseout",function(n){for(var i=n.relatedTarget||n.toElement;i&&i!==t;)i=i.parentNode;i!==t&&e(n)})}var I,E,x=null;var D,T,O,A,k,j=function(){function t(t,e){this._runner=t,this.priority=e,this._canceled=!1}return t.prototype.dispose=function(){this._canceled=!0},t.prototype.execute=function(){if(!this._canceled)try{this._runner()}catch(t){Object(s.e)(t)}},t.sort=function(t,e){return e.priority-t.priority},t}();D=[],T=null,O=!1,A=!1,k=function(){for(O=!1,T=D,D=[],A=!0;T.length>0;){T.sort(j.sort),T.shift().execute()}A=!1},E=function(t,e){void 0===e&&(e=0);var n,i=new j(t,e);return D.push(i),O||(O=!0,n=k,x||(x=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||function(t){return setTimeout(function(){return t((new Date).getTime())},0)}),x(n)),i},I=function(t,e){if(A){var n=new j(t,e);return T.push(n),n}return E(t,e)};var R=16,P=function(t,e){return e},W=function(t){function e(e,n,i,o,s){void 0===o&&(o=P),void 0===s&&(s=R);var a=t.call(this)||this,u=null,c=0,l=a._register(new r.d),h=function(){c=(new Date).getTime(),i(u),u=null};return a._register(S(e,n,function(t){u=o(u,t);var e=(new Date).getTime()-c;e>=s?(l.cancel(),h()):l.setIfNotSet(h,s-e)})),a}return f(e,t),e}(a.a);function z(t,e,n,i,o){return new W(t,e,n,i,o)}function F(t){return document.defaultView.getComputedStyle(t,null)}var B=function(t,e){return parseFloat(e)||0};function V(t,e,n){var i=F(t),o="0";return i&&(o=i.getPropertyValue?i.getPropertyValue(e):i.getAttribute(n)),B(t,o)}var H={getBorderLeftWidth:function(t){return V(t,"border-left-width","borderLeftWidth")},getBorderTopWidth:function(t){return V(t,"border-top-width","borderTopWidth")},getBorderBottomWidth:function(t){return V(t,"border-bottom-width","borderBottomWidth")},getPaddingTop:function(t){return V(t,"padding-top","paddingTop")},getPaddingBottom:function(t){return V(t,"padding-bottom","paddingBottom")},getMarginLeft:function(t){return V(t,"margin-left","marginLeft")},getMarginTop:function(t){return V(t,"margin-top","marginTop")},getMarginRight:function(t){return V(t,"margin-right","marginRight")},getMarginBottom:function(t){return V(t,"margin-bottom","marginBottom")},__commaSentinel:!1};function Y(t){for(var e=t.offsetParent,n=t.offsetTop,i=t.offsetLeft;null!==(t=t.parentNode)&&t!==document.body&&t!==document.documentElement;){n-=t.scrollTop;var o=F(t);o&&(i-="rtl"!==o.direction?t.scrollLeft:-t.scrollLeft),t===e&&(i+=H.getBorderLeftWidth(t),n+=H.getBorderTopWidth(t),n+=t.offsetTop,i+=t.offsetLeft,e=t.offsetParent)}return{left:i,top:n}}function U(t){var e=t.getBoundingClientRect();return{left:e.left+Z.scrollX,top:e.top+Z.scrollY,width:e.width,height:e.height}}var Z=new(function(){function t(){}return Object.defineProperty(t.prototype,"scrollX",{get:function(){return"number"==typeof window.scrollX?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollY",{get:function(){return"number"==typeof window.scrollY?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop},enumerable:!0,configurable:!0}),t}());function G(t){var e=H.getMarginLeft(t)+H.getMarginRight(t);return t.offsetWidth+e}function X(t){var e=H.getBorderTopWidth(t)+H.getBorderBottomWidth(t),n=H.getPaddingTop(t)+H.getPaddingBottom(t);return t.offsetHeight-e-n}function K(t){var e=H.getMarginTop(t)+H.getMarginBottom(t);return t.offsetHeight+e}function Q(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function q(t,e,n){for(;t;){if(y(t,e))return t;if(n&&y(t,n))return null;t=t.parentNode}return null}function J(t){void 0===t&&(t=document.getElementsByTagName("head")[0]);var e=document.createElement("style");return e.type="text/css",e.media="screen",t.appendChild(e),e}var $=null;function tt(){return $||($=J()),$}function et(t,e){if(void 0===e&&(e=tt()),e){for(var n=function(t){return t&&t.sheet&&t.sheet.rules?t.sheet.rules:t&&t.sheet&&t.sheet.cssRules?t.sheet.cssRules:[]}(e),i=[],o=0;o=0;o--)e.sheet.deleteRule(i[o])}}function nt(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName}var it={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",UNLOAD:"unload",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",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:u.m?"webkitAnimationStart":"animationstart",ANIMATION_END:u.m?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:u.m?"webkitAnimationIteration":"animationiteration"},ot={stop:function(t,e){t.preventDefault?t.preventDefault():t.returnValue=!1,e&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)}};function rt(t){for(var e=[],n=0;t&&t.nodeType===t.ELEMENT_NODE;n++)e[n]=t.scrollTop,t=t.parentNode;return e}function st(t,e){for(var n=0;t&&t.nodeType===t.ELEMENT_NODE;n++)t.scrollTop!==e[n]&&(t.scrollTop=e[n]),t=t.parentNode}var at=function(){function t(t){var e=this;this._onDidFocus=new h.a,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new h.a,this.onDidBlur=this._onDidBlur.event,this.disposables=[];var n=!1,i=!1;Object(d.a)(t,it.FOCUS,!0)(function(){i=!1,n||(n=!0,e._onDidFocus.fire())},null,this.disposables),Object(d.a)(t,it.BLUR,!0)(function(){n&&(i=!0,window.setTimeout(function(){i&&(i=!1,n=!1,e._onDidBlur.fire())},0))},null,this.disposables)}return t.prototype.dispose=function(){this.disposables=Object(a.d)(this.disposables),this._onDidFocus.dispose(),this._onDidBlur.dispose()},t}();function ut(t){return new at(t)}function ct(t){for(var e=[],n=1;nn||t===n&&e>i?(this.startLineNumber=n,this.startColumn=i,this.endLineNumber=t,this.endColumn=e):(this.startLineNumber=t,this.startColumn=e,this.endLineNumber=n,this.endColumn=i)}return t.prototype.isEmpty=function(){return t.isEmpty(this)},t.isEmpty=function(t){return t.startLineNumber===t.endLineNumber&&t.startColumn===t.endColumn},t.prototype.containsPosition=function(e){return t.containsPosition(this,e)},t.containsPosition=function(t,e){return!(e.lineNumbert.endLineNumber)&&(!(e.lineNumber===t.startLineNumber&&e.columnt.endColumn))},t.prototype.containsRange=function(e){return t.containsRange(this,e)},t.containsRange=function(t,e){return!(e.startLineNumbert.endLineNumber||e.endLineNumber>t.endLineNumber)&&(!(e.startLineNumber===t.startLineNumber&&e.startColumnt.endColumn)))},t.prototype.plusRange=function(e){return t.plusRange(this,e)},t.plusRange=function(e,n){var i,o,r,s;return n.startLineNumbere.endLineNumber?(r=n.endLineNumber,s=n.endColumn):n.endLineNumber===e.endLineNumber?(r=n.endLineNumber,s=Math.max(n.endColumn,e.endColumn)):(r=e.endLineNumber,s=e.endColumn),new t(i,o,r,s)},t.prototype.intersectRanges=function(e){return t.intersectRanges(this,e)},t.intersectRanges=function(e,n){var i=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn,a=n.startLineNumber,u=n.startColumn,c=n.endLineNumber,l=n.endColumn;return ic?(r=c,s=l):r===c&&(s=Math.min(s,l)),i>r?null:i===r&&o>s?null:new t(i,o,r,s)},t.prototype.equalsRange=function(e){return t.equalsRange(this,e)},t.equalsRange=function(t,e){return!!t&&!!e&&t.startLineNumber===e.startLineNumber&&t.startColumn===e.startColumn&&t.endLineNumber===e.endLineNumber&&t.endColumn===e.endColumn},t.prototype.getEndPosition=function(){return new i.a(this.endLineNumber,this.endColumn)},t.prototype.getStartPosition=function(){return new i.a(this.startLineNumber,this.startColumn)},t.prototype.toString=function(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"},t.prototype.setEndPosition=function(e,n){return new t(this.startLineNumber,this.startColumn,e,n)},t.prototype.setStartPosition=function(e,n){return new t(e,n,this.endLineNumber,this.endColumn)},t.prototype.collapseToStart=function(){return t.collapseToStart(this)},t.collapseToStart=function(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)},t.fromPositions=function(e,n){return void 0===n&&(n=e),new t(e.lineNumber,e.column,n.lineNumber,n.column)},t.lift=function(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null},t.isIRange=function(t){return t&&"number"==typeof t.startLineNumber&&"number"==typeof t.startColumn&&"number"==typeof t.endLineNumber&&"number"==typeof t.endColumn},t.areIntersectingOrTouching=function(t,e){return!(t.endLineNumbert.startLineNumber},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return u}),n.d(e,"c",function(){return c}),n.d(e,"e",function(){return l}),n.d(e,"b",function(){return h}),n.d(e,"h",function(){return d}),n.d(e,"g",function(){return f}),n.d(e,"d",function(){return g});var i,o=n(7),r=(n(8),n(157)),s=n(21),a=n(156);!function(t){var e={dispose:function(){}};t.None=function(){return e}}(i||(i={})),e.f=i;var u=function(){function t(t){this._options=t}return Object.defineProperty(t.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(n,i,o){e._listeners||(e._listeners=new a.a);var r=e._listeners.isEmpty();r&&e._options&&e._options.onFirstListenerAdd&&e._options.onFirstListenerAdd(e);var s,u=e._listeners.push(i?[n,i]:n);return r&&e._options&&e._options.onFirstListenerDidAdd&&e._options.onFirstListenerDidAdd(e),e._options&&e._options.onListenerDidAdd&&e._options.onListenerDidAdd(e,n,i),s={dispose:function(){s.dispose=t._noop,e._disposed||(u(),e._options&&e._options.onLastListenerRemove&&e._listeners.isEmpty()&&e._options.onLastListenerRemove(e))}},Array.isArray(o)&&o.push(s),s}),this._event},enumerable:!0,configurable:!0}),t.prototype.fire=function(t){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=[]);for(var e=this._listeners.iterator(),n=e.next();!n.done;n=e.next())this._deliveryQueue.push([n.value,t]);for(;this._deliveryQueue.length>0;){var i=this._deliveryQueue.shift(),o=i[0],r=i[1];try{"function"==typeof o?o.call(void 0,r):o[0].call(o[1],r)}catch(n){Object(s.e)(n)}}}},t.prototype.dispose=function(){this._listeners&&(this._listeners=void 0),this._deliveryQueue&&(this._deliveryQueue.length=0),this._disposed=!0},t._noop=function(){},t}();!function(){function t(){var t=this;this.hasListeners=!1,this.events=[],this.emitter=new u({onFirstListenerAdd:function(){return t.onFirstListenerAdd()},onLastListenerRemove:function(){return t.onLastListenerRemove()}})}Object.defineProperty(t.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this,n={event:t,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);return Object(o.g)(Object(r.a)(function(){e.hasListeners&&e.unhook(n);var t=e.events.indexOf(n);e.events.splice(t,1)}))},t.prototype.onFirstListenerAdd=function(){var t=this;this.hasListeners=!0,this.events.forEach(function(e){return t.hook(e)})},t.prototype.onLastListenerRemove=function(){var t=this;this.hasListeners=!1,this.events.forEach(function(e){return t.unhook(e)})},t.prototype.hook=function(t){var e=this;t.listener=t.event(function(t){return e.emitter.fire(t)})},t.prototype.unhook=function(t){t.listener.dispose(),t.listener=null},t.prototype.dispose=function(){this.emitter.dispose()}}();function c(){for(var t=[],e=0;e1)&&c.fire(t),a=0},n)})},onLastListenerRemove:function(){o.dispose()}});return c.event}var h=function(){function t(){this.buffers=[]}return t.prototype.wrapEvent=function(t){var e=this;return function(n,i,o){return t(function(t){var o=e.buffers[e.buffers.length-1];o?o.push(function(){return n.call(i,t)}):n.call(i,t)},void 0,o)}},t.prototype.bufferEvents=function(t){var e=[];this.buffers.push(e),t(),this.buffers.pop(),e.forEach(function(t){return t()})},t}();function d(t,e){return function(n,i,o){return void 0===i&&(i=null),t(function(t){return n.call(i,e(t))},null,o)}}function f(t,e){return function(n,i,o){return void 0===i&&(i=null),t(function(t){return e(t)&&n.call(i,t)},null,o)}}var p=function(){function t(t){this._event=t}return Object.defineProperty(t.prototype,"event",{get:function(){return this._event},enumerable:!0,configurable:!0}),t.prototype.map=function(e){return new t(d(this._event,e))},t.prototype.forEach=function(e){return new t((n=this._event,i=e,function(t,e,o){return void 0===e&&(e=null),n(function(n){i(n),t.call(e,n)},null,o)}));var n,i},t.prototype.filter=function(e){return new t(f(this._event,e))},t.prototype.on=function(t,e,n){return this._event(t,e,n)},t}();function g(t){return new p(t)}!function(){function t(){this.emitter=new u,this.event=this.emitter.event,this.disposable=o.e}Object.defineProperty(t.prototype,"input",{set:function(t){this.disposable.dispose(),this.disposable=t(this.emitter.fire,this.emitter)},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.disposable.dispose(),this.emitter.dispose()}}()},function(t,e,n){"use strict";n.r(e),n.d(e,"empty",function(){return o}),n.d(e,"isFalsyOrWhitespace",function(){return r}),n.d(e,"pad",function(){return s}),n.d(e,"format",function(){return u}),n.d(e,"escape",function(){return c}),n.d(e,"escapeRegExpCharacters",function(){return l}),n.d(e,"trim",function(){return h}),n.d(e,"ltrim",function(){return d}),n.d(e,"rtrim",function(){return f}),n.d(e,"convertSimple2RegExpPattern",function(){return p}),n.d(e,"stripWildcards",function(){return g}),n.d(e,"startsWith",function(){return m}),n.d(e,"endsWith",function(){return v}),n.d(e,"createRegExp",function(){return _}),n.d(e,"regExpLeadsToEndlessLoop",function(){return y}),n.d(e,"regExpContainsBackreference",function(){return b}),n.d(e,"canNormalize",function(){return C}),n.d(e,"normalizeNFC",function(){return L}),n.d(e,"normalizeNFD",function(){return M}),n.d(e,"firstNonWhitespaceIndex",function(){return E}),n.d(e,"getLeadingWhitespace",function(){return x}),n.d(e,"lastNonWhitespaceIndex",function(){return D}),n.d(e,"compare",function(){return T}),n.d(e,"compareIgnoreCase",function(){return O}),n.d(e,"equalsIgnoreCase",function(){return R}),n.d(e,"beginsWithIgnoreCase",function(){return W}),n.d(e,"commonPrefixLength",function(){return z}),n.d(e,"commonSuffixLength",function(){return F}),n.d(e,"overlap",function(){return V}),n.d(e,"isHighSurrogate",function(){return H}),n.d(e,"isLowSurrogate",function(){return Y}),n.d(e,"containsRTL",function(){return Z}),n.d(e,"containsEmoji",function(){return X}),n.d(e,"isBasicASCII",function(){return Q}),n.d(e,"containsFullWidthCharacter",function(){return q}),n.d(e,"isFullWidthCharacter",function(){return J}),n.d(e,"lcut",function(){return $}),n.d(e,"removeAnsiEscapeCodes",function(){return it}),n.d(e,"UTF8_BOM_CHARACTER",function(){return ot}),n.d(e,"startsWithUTF8BOM",function(){return rt}),n.d(e,"stripUTF8BOM",function(){return st}),n.d(e,"safeBtoa",function(){return at}),n.d(e,"repeat",function(){return ut}),n.d(e,"fuzzyContains",function(){return ct}),n.d(e,"containsUppercaseCharacter",function(){return lt});var i=n(58),o="";function r(t){return!t||"string"!=typeof t||0===t.trim().length}function s(t,e,n){void 0===n&&(n="0");for(var i=""+t,o=[i],r=i.length;r=e.length?t:e[i]})}function c(t){return t.replace(/[<|>|&]/g,function(t){switch(t){case"<":return"<";case">":return">";case"&":return"&";default:return t}})}function l(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\[\]\(\)\#]/g,"\\$&")}function h(t,e){return void 0===e&&(e=" "),f(d(t,e),e)}function d(t,e){if(!t||!e)return t;var n=e.length;if(0===n||0===t.length)return t;for(var i=0;t.indexOf(e,i)===i;)i+=n;return t.substring(i)}function f(t,e){if(!t||!e)return t;var n=e.length,i=t.length;if(0===n||0===i)return t;for(var o=i,r=-1;-1!==(r=t.lastIndexOf(e,o-1))&&r+n===o;){if(0===r)return"";o=r}return t.substring(0,o)}function p(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function g(t){return t.replace(/\*/g,"")}function m(t,e){if(t.length0?t.indexOf(e,n)===n:0===n&&t===e}function _(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("Cannot create regex from empty string");e||(t=l(t)),n.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t+="\\b"));var i="";return n.global&&(i+="g"),n.matchCase||(i+="i"),n.multiline&&(i+="m"),new RegExp(t,i)}function y(t){return"^"!==t.source&&"^$"!==t.source&&"$"!==t.source&&"^\\s*$"!==t.source&&(t.exec("")&&0===t.lastIndex)}function b(t){return!!t.match(/([^\\]|^)(\\\\)*\\\d+/)}var C="function"==typeof"".normalize,w=new i.a(1e4);function L(t){return I(t,"NFC",w)}var S=new i.a(1e4);function M(t){return I(t,"NFD",S)}var N=/[^\u0000-\u0080]/;function I(t,e,n){if(!C||!t)return t;var i,o=n.get(t);return o||(i=N.test(t)?t.normalize(e):t,n.set(t,i),i)}function E(t){for(var e=0,n=t.length;e=0;n--){var i=t.charCodeAt(n);if(32!==i&&9!==i)return n}return-1}function T(t,e){return te?1:0}function O(t,e){for(var n=Math.min(t.length,e.length),i=0;ie.length?1:0}function A(t){return t>=97&&t<=122}function k(t){return t>=65&&t<=90}function j(t){return A(t)||k(t)}function R(t,e){return(t?t.length:0)===(e?e.length:0)&&P(t,e)}function P(t,e,n){if(void 0===n&&(n=t.length),"string"!=typeof t||"string"!=typeof e)return!1;for(var i=0;it.length)&&P(t,e,n)}function z(t,e){var n,i=Math.min(t.length,e.length);for(n=0;n0;){if(B(t,o,n,e,0,i))return i;i-=1,o+=1}return 0}function H(t){return 55296<=t&&t<=56319}function Y(t){return 56320<=t&&t<=57343}var U=/(?:[\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 Z(t){return U.test(t)}var G=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEF8]|\uD83E[\uDD00-\uDDE6])/;function X(t){return G.test(t)}var K=/^[\t\n\r\x20-\x7E]*$/;function Q(t){return K.test(t)}function q(t){for(var e=0,n=t.length;e=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374}function $(t,e){if(t.length0&&65279===t.charCodeAt(0)}function st(t){return rt(t)?t.substr(1):t}function at(t){return btoa(encodeURIComponent(t))}function ut(t,e){for(var n="",i=0;i"),i}n.Namespace||(n.Namespace=Object.create(Object.prototype));var a={uninitialized:1,working:2,initialized:3};Object.defineProperties(n.Namespace,{defineWithParent:{value:s,writable:!0,enumerable:!0,configurable:!0},define:{value:function(t,n){return s(e,t,n)},writable:!0,enumerable:!0,configurable:!0},_lazy:{value:function(t){var e,n,o=a.uninitialized;return{setName:function(t){e=t},get:function(){switch(o){case a.initialized:return n;case a.uninitialized:o=a.working;try{i("WinJS.Namespace._lazy:"+e+",StartTM"),n=t()}finally{i("WinJS.Namespace._lazy:"+e+",StopTM"),o=a.uninitialized}return t=null,o=a.initialized,n;case a.working:throw"Illegal: reentrancy on initialization";default:throw"Illegal"}},set:function(t){switch(o){case a.working:throw"Illegal: reentrancy on initialization";default:o=a.initialized,n=t}},enumerable:!0,configurable:!0}},writable:!0,enumerable:!0,configurable:!0},_moduleDefine:{value:function(t,n,i){var s=[t],a=null;return n&&(a=r(e,n),s.push(a)),o(s,i,n||""),a},writable:!0,enumerable:!0,configurable:!0}})}(),function(){function e(t,e,i){return t=t||function(){},n.markSupportedForProcessing(t),e&&o(t.prototype,e),i&&o(t,i),t}t.Namespace.define("WinJS.Class",{define:e,derive:function(t,i,r,s){if(t){i=i||function(){};var a=t.prototype;return i.prototype=Object.create(a),n.markSupportedForProcessing(i),Object.defineProperty(i.prototype,"constructor",{value:i,writable:!0,configurable:!0,enumerable:!0}),r&&o(i.prototype,r),s&&o(i,s),i}return e(i,r,s)},mix:function(t){var e,n;for(t=t||function(){},e=1,n=arguments.length;e=0,s=f.indexOf("Macintosh")>=0,a=f.indexOf("Linux")>=0,c=!0,navigator.language}!function(t){t[t.Web=0]="Web",t[t.Mac=1]="Mac",t[t.Linux=2]="Linux",t[t.Windows=3]="Windows"}(o||(o={}));o.Web;u&&(s?o.Mac:r?o.Windows:a&&o.Linux);var p=r,g=s,m=a,v=u,_=c;var y="object"==typeof self?self:"object"==typeof i?i:{},b=s?2:r?1:3}).call(this,n(158),n(120))},function(t,e,n){"use strict";n.d(e,"b",function(){return l}),n.d(e,"f",function(){return h}),n.d(e,"c",function(){return d}),n.d(e,"d",function(){return f}),n.d(e,"e",function(){return p}),n.d(e,"a",function(){return g});var i=n(6),o=n(4),r=n(49),s=n(28),a=n(2),u=n(39),c=n(21),l=function(){function t(e,n,i,o){this._languageIdentifier=e;var r=o.editor;this.readOnly=r.readOnly,this.tabSize=i.tabSize,this.insertSpaces=i.insertSpaces,this.oneIndent=n,this.pageSize=Math.floor(r.layoutInfo.height/r.fontInfo.lineHeight)-2,this.lineHeight=r.lineHeight,this.useTabStops=r.useTabStops,this.wordSeparators=r.wordSeparators,this.emptySelectionClipboard=r.emptySelectionClipboard,this.autoClosingBrackets=r.autoClosingBrackets,this.autoIndent=r.autoIndent,this.autoClosingPairsOpen={},this.autoClosingPairsClose={},this.surroundingPairs={},this._electricChars=null;var s=t._getAutoClosingPairs(e);if(s)for(var a=0;a=i.length)&&o.isLowSurrogate(i.charCodeAt(n))},t.isHighSurrogate=function(t,e,n){var i=t.getLineContent(e);return!(n<0||n>=i.length)&&o.isHighSurrogate(i.charCodeAt(n))},t.isInsideSurrogatePair=function(t,e,n){return this.isHighSurrogate(t,e,n-2)},t.visibleColumnFromColumn=function(t,e,n){var i=t.length;i>e-1&&(i=e-1);for(var r=0,s=0;s=e)return u-es?s:o},t.nextTabStop=function(t,e){return t+e-t%e},t.prevTabStop=function(t,e){return t-1-(t-1)%e},t}()},function(t,e,n){"use strict";var i=n(3),o=n(155);function r(t,e,n){if(Array.isArray(t)){for(var i=0,s=0,a=t;si&&(i=u)}return i}if("string"==typeof t)return"*"===t?5:t===n?10:0;if(t){var c=t.language,l=t.pattern,h=t.scheme;i=0;if(h)if(h===e.scheme)i=10;else{if("*"!==h)return 0;i=5}if(c)if(c===n)i=10;else{if("*"!==c)return 0;i=Math.max(i,5)}if(l){if(l!==e.fsPath&&!Object(o.a)(l,e.fsPath))return 0;i=10}return i}return 0}var s=function(){function t(){this._clock=0,this._entries=[],this._onDidChange=new i.a}return Object.defineProperty(t.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),t.prototype.register=function(t,e){var n=this,i={selector:t,provider:e,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),{dispose:function(){if(i){var t=n._entries.indexOf(i);t>=0&&(n._entries.splice(t,1),n._lastCandidate=void 0,n._onDidChange.fire(n._entries.length),i=void 0)}}}},t.prototype.has=function(t){return this.all(t).length>0},t.prototype.all=function(t){if(!t||t.isTooLargeForHavingARichMode())return[];this._updateScores(t);for(var e=[],n=0,i=this._entries;n0&&e.push(o.provider)}return e},t.prototype.ordered=function(t){var e=[];return this._orderedForEach(t,function(t){return e.push(t.provider)}),e},t.prototype.orderedGroups=function(t){var e,n,i=[];return this._orderedForEach(t,function(t){e&&n===t._score?e.push(t.provider):(n=t._score,e=[t.provider],i.push(e))}),i},t.prototype._orderedForEach=function(t,e){if(t&&!t.isTooLargeForHavingARichMode()){this._updateScores(t);for(var n=0;n0&&e(i)}}},t.prototype._updateScores=function(e){var n={uri:e.uri.toString(),language:e.getLanguageIdentifier().language};if(!this._lastCandidate||this._lastCandidate.language!==n.language||this._lastCandidate.uri!==n.uri){this._lastCandidate=n;for(var i=0,o=this._entries;ie._score?-1:t._timee._time?-1:0},t}(),a=function(){function t(){this._onDidChange=new i.a,this.onDidChange=this._onDidChange.event,this._map=Object.create(null),this._colorMap=null}return t.prototype.fire=function(t){this._onDidChange.fire({changedLanguages:t,changedColorMap:!1})},t.prototype.register=function(t,e){var n=this;return this._map[t]=e,this.fire([t]),{dispose:function(){n._map[t]===e&&(delete n._map[t],n.fire([t]))}}},t.prototype.get=function(t){return this._map[t]||null},t.prototype.setColorMap=function(t){this._colorMap=t,this._onDidChange.fire({changedLanguages:Object.keys(this._map),changedColorMap:!0})},t.prototype.getColorMap=function(){return this._colorMap},t.prototype.getDefaultBackground=function(){return this._colorMap[2]},t}();n(10);n.d(e,"l",function(){return h}),n.d(e,"u",function(){return d}),n.d(e,"s",function(){return u}),n.d(e,"f",function(){return c}),n.d(e,"t",function(){return l}),n.d(e,"o",function(){return g}),n.d(e,"p",function(){return m}),n.d(e,"r",function(){return v}),n.d(e,"q",function(){return _}),n.d(e,"j",function(){return y}),n.d(e,"i",function(){return b}),n.d(e,"g",function(){return C}),n.d(e,"d",function(){return w}),n.d(e,"k",function(){return L}),n.d(e,"w",function(){return S}),n.d(e,"b",function(){return M}),n.d(e,"a",function(){return N}),n.d(e,"e",function(){return I}),n.d(e,"h",function(){return E}),n.d(e,"n",function(){return x}),n.d(e,"m",function(){return D}),n.d(e,"c",function(){return T}),n.d(e,"v",function(){return O});var u,c,l,h=function(){return function(t,e){this.language=t,this.id=e}}(),d=function(){function t(){}return t.getLanguageId=function(t){return(255&t)>>>0},t.getTokenType=function(t){return(1792&t)>>>8},t.getFontStyle=function(t){return(14336&t)>>>11},t.getForeground=function(t){return(8372224&t)>>>14},t.getBackground=function(t){return(4286578688&t)>>>23},t.getClassNameFromMetadata=function(t){var e="mtk"+this.getForeground(t),n=this.getFontStyle(t);return 1&n&&(e+=" mtki"),2&n&&(e+=" mtkb"),4&n&&(e+=" mtku"),e},t.getInlineStyleFromMetadata=function(t,e){var n=this.getForeground(t),i=this.getFontStyle(t),o="color: "+e[n]+";";return 1&i&&(o+="font-style: italic;"),2&i&&(o+="font-weight: bold;"),4&i&&(o+="text-decoration: underline;"),o},t}();!function(t){t[t.Invoke=0]="Invoke",t[t.TriggerCharacter=1]="TriggerCharacter",t[t.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(u||(u={})),function(t){t[t.Text=0]="Text",t[t.Read=1]="Read",t[t.Write=2]="Write"}(c||(c={})),function(t){t[t.File=0]="File",t[t.Module=1]="Module",t[t.Namespace=2]="Namespace",t[t.Package=3]="Package",t[t.Class=4]="Class",t[t.Method=5]="Method",t[t.Property=6]="Property",t[t.Field=7]="Field",t[t.Constructor=8]="Constructor",t[t.Enum=9]="Enum",t[t.Interface=10]="Interface",t[t.Function=11]="Function",t[t.Variable=12]="Variable",t[t.Constant=13]="Constant",t[t.String=14]="String",t[t.Number=15]="Number",t[t.Boolean=16]="Boolean",t[t.Array=17]="Array",t[t.Object=18]="Object",t[t.Key=19]="Key",t[t.Null=20]="Null",t[t.EnumMember=21]="EnumMember",t[t.Struct=22]="Struct",t[t.Event=23]="Event",t[t.Operator=24]="Operator",t[t.TypeParameter=25]="TypeParameter"}(l||(l={}));var f,p;(f=Object.create(null))[l.File]="file",f[l.Module]="module",f[l.Namespace]="namespace",f[l.Package]="package",f[l.Class]="class",f[l.Method]="method",f[l.Property]="property",f[l.Field]="field",f[l.Constructor]="constructor",f[l.Enum]="enum",f[l.Interface]="interface",f[l.Function]="function",f[l.Variable]="variable",f[l.Constant]="constant",f[l.String]="string",f[l.Number]="number",f[l.Boolean]="boolean",f[l.Array]="array",f[l.Object]="object",f[l.Key]="key",f[l.Null]="null",f[l.EnumMember]="enum-member",f[l.Struct]="struct",f[l.Event]="event",f[l.Operator]="operator",f[l.TypeParameter]="type-parameter";!function(t){t.Comment="comment",t.Imports="imports",t.Region="region"}(p||(p={}));var g=new s,m=new s,v=new s,_=new s,y=new s,b=new s,C=new s,w=new s,L=new s,S=new s,M=new s,N=new s,I=new s,E=new s,x=new s,D=new s,T=new s,O=(new s,new a)},function(t,e,n){"use strict";var i,o,r,s;n.d(e,"f",function(){return i}),n.d(e,"c",function(){return o}),n.d(e,"b",function(){return r}),n.d(e,"d",function(){return s}),n.d(e,"g",function(){return u}),n.d(e,"e",function(){return c}),n.d(e,"h",function(){return a}),n.d(e,"a",function(){return l}),function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=4]="Right",t[t.Full=7]="Full"}(i||(i={})),function(t){t[t.TextDefined=0]="TextDefined",t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"}(o||(o={})),function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"}(r||(r={})),function(t){t[t.LF=0]="LF",t[t.CRLF=1]="CRLF"}(s||(s={}));var a,u=function(){function t(t){this.tabSize=0|t.tabSize,this.insertSpaces=Boolean(t.insertSpaces),this.defaultEOL=0|t.defaultEOL,this.trimAutoWhitespace=Boolean(t.trimAutoWhitespace)}return t.prototype.equals=function(t){return this.tabSize===t.tabSize&&this.insertSpaces===t.insertSpaces&&this.defaultEOL===t.defaultEOL&&this.trimAutoWhitespace===t.trimAutoWhitespace},t.prototype.createChangeEvent=function(t){return{tabSize:this.tabSize!==t.tabSize,insertSpaces:this.insertSpaces!==t.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==t.trimAutoWhitespace}},t}(),c=function(){return function(t,e){this.range=t,this.matches=e}}();!function(t){t[t.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",t[t.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",t[t.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",t[t.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(a||(a={}));var l=function(){return function(t,e,n){this.reverseEdits=t,this.changes=e,this.trimAutoWhitespaceLineNumbers=n}}()},function(t,e,n){"use strict";function i(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}n.d(e,"b",function(){return o}),n.d(e,"a",function(){return a});var o=function(){function t(t,e,n,o){void 0===o&&(o=1),this.r=0|Math.min(255,Math.max(0,t)),this.g=0|Math.min(255,Math.max(0,e)),this.b=0|Math.min(255,Math.max(0,n)),this.a=i(Math.max(Math.min(1,o),0),3)}return t.equals=function(t,e){return t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a},t}(),r=function(){function t(t,e,n,o){this.h=0|Math.max(Math.min(360,t),0),this.s=i(Math.max(Math.min(1,e),0),3),this.l=i(Math.max(Math.min(1,n),0),3),this.a=i(Math.max(Math.min(1,o),0),3)}return t.equals=function(t,e){return t.h===e.h&&t.s===e.s&&t.l===e.l&&t.a===e.a},t.fromRGBA=function(e){var n=e.r/255,i=e.g/255,o=e.b/255,r=e.a,s=Math.max(n,i,o),a=Math.min(n,i,o),u=0,c=0,l=(a+s)/2,h=s-a;if(h>0){switch(c=Math.min(l<=.5?h/(2*l):h/(2-2*l),1),s){case n:u=(i-o)/h+(i1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},t.toRGBA=function(e){var n,i,r,s=e.h/360,a=e.s,u=e.l,c=e.a;if(0===a)n=i=r=u;else{var l=u<.5?u*(1+a):u+a-u*a,h=2*u-l;n=t._hue2rgb(h,l,s+1/3),i=t._hue2rgb(h,l,s),r=t._hue2rgb(h,l,s-1/3)}return new o(Math.round(255*n),Math.round(255*i),Math.round(255*r),c)},t}(),s=function(){function t(t,e,n,o){this.h=0|Math.max(Math.min(360,t),0),this.s=i(Math.max(Math.min(1,e),0),3),this.v=i(Math.max(Math.min(1,n),0),3),this.a=i(Math.max(Math.min(1,o),0),3)}return t.equals=function(t,e){return t.h===e.h&&t.s===e.s&&t.v===e.v&&t.a===e.a},t.fromRGBA=function(e){var n,i=e.r/255,o=e.g/255,r=e.b/255,s=Math.max(i,o,r),a=s-Math.min(i,o,r),u=0===s?0:a/s;return n=0===a?0:s===i?((o-r)/a%6+6)%6:s===o?(r-i)/a+2:(i-o)/a+4,new t(Math.round(60*n),u,s,e.a)},t.toRGBA=function(t){var e=t.h,n=t.s,i=t.v,r=t.a,s=i*n,a=s*(1-Math.abs(e/60%2-1)),u=i-s,c=[0,0,0],l=c[0],h=c[1],d=c[2];return e<60?(l=s,h=a):e<120?(l=a,h=s):e<180?(h=s,d=a):e<240?(h=a,d=s):e<300?(l=a,d=s):e<360&&(l=s,d=a),l=Math.round(255*(l+u)),h=Math.round(255*(h+u)),d=Math.round(255*(d+u)),new o(l,h,d,r)},t}(),a=function(){function t(t){if(!t)throw new Error("Color needs a value");if(t instanceof o)this.rgba=t;else if(t instanceof r)this._hsla=t,this.rgba=r.toRGBA(t);else{if(!(t instanceof s))throw new Error("Invalid color ctor argument");this._hsva=t,this.rgba=s.toRGBA(t)}}return t.fromHex=function(e){return t.Format.CSS.parseHex(e)||t.red},Object.defineProperty(t.prototype,"hsla",{get:function(){return this._hsla?this._hsla:r.fromRGBA(this.rgba)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hsva",{get:function(){return this._hsva?this._hsva:s.fromRGBA(this.rgba)},enumerable:!0,configurable:!0}),t.prototype.equals=function(t){return!!t&&o.equals(this.rgba,t.rgba)&&r.equals(this.hsla,t.hsla)&&s.equals(this.hsva,t.hsva)},t.prototype.getRelativeLuminance=function(){return i(.2126*t._relativeLuminanceForComponent(this.rgba.r)+.7152*t._relativeLuminanceForComponent(this.rgba.g)+.0722*t._relativeLuminanceForComponent(this.rgba.b),4)},t._relativeLuminanceForComponent=function(t){var e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},t.prototype.getContrastRatio=function(t){var e=this.getRelativeLuminance(),n=t.getRelativeLuminance();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},t.prototype.isDarker=function(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3<128},t.prototype.isLighter=function(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128},t.prototype.isLighterThan=function(t){return this.getRelativeLuminance()>t.getRelativeLuminance()},t.prototype.isDarkerThan=function(t){return this.getRelativeLuminance()=0){var e=t.split("!=");return new d(e[0].trim(),this._deserializeValue(e[1]))}if(t.indexOf("==")>=0){e=t.split("==");return new h(e[0].trim(),this._deserializeValue(e[1]))}if(t.indexOf("=~")>=0){e=t.split("=~");return new p(e[0].trim(),this._deserializeRegexValue(e[1]))}return/^\!\s*/.test(t)?new f(t.substr(1).trim()):new l(t)},t._deserializeValue=function(t){if("true"===(t=t.trim()))return!0;if("false"===t)return!1;var e=/^'([^']*)'$/.exec(t);return e?e[1].trim():t},t._deserializeRegexValue=function(t){if(Object(s.isFalsyOrWhitespace)(t))return console.warn("missing regexp-value for =~-expression"),null;var e=t.indexOf("/"),n=t.lastIndexOf("/");if(e===n||e<0)return console.warn("bad regexp-value '"+t+"', missing /-enclosure"),null;var i=t.slice(e+1,n);try{return new RegExp(i)}catch(e){return console.warn("bad regexp-value '"+t+"', parse error: "+e),null}},t}();function c(t,e){var n=t.getType(),i=e.getType();if(n!==i)return n-i;switch(n){case o.Defined:case o.Not:case o.Equals:case o.NotEquals:case o.Regex:return t.cmp(e);default:throw new Error("Unknown ContextKeyExpr!")}}var l=function(){function t(t){this.key=t}return t.prototype.getType=function(){return o.Defined},t.prototype.cmp=function(t){return this.keyt.key?1:0},t.prototype.equals=function(e){return e instanceof t&&this.key===e.key},t.prototype.evaluate=function(t){return!!t.getValue(this.key)},t.prototype.normalize=function(){return this},t.prototype.serialize=function(){return this.key},t.prototype.keys=function(){return[this.key]},t}(),h=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.getType=function(){return o.Equals},t.prototype.cmp=function(t){return this.keyt.key?1:this.valuet.value?1:0},t.prototype.equals=function(e){return e instanceof t&&(this.key===e.key&&this.value===e.value)},t.prototype.evaluate=function(t){return t.getValue(this.key)==this.value},t.prototype.normalize=function(){return"boolean"==typeof this.value?this.value?new l(this.key):new f(this.key):this},t.prototype.serialize=function(){return"boolean"==typeof this.value?this.normalize().serialize():this.key+" == '"+this.value+"'"},t.prototype.keys=function(){return[this.key]},t}(),d=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.getType=function(){return o.NotEquals},t.prototype.cmp=function(t){return this.keyt.key?1:this.valuet.value?1:0},t.prototype.equals=function(e){return e instanceof t&&(this.key===e.key&&this.value===e.value)},t.prototype.evaluate=function(t){return t.getValue(this.key)!=this.value},t.prototype.normalize=function(){return"boolean"==typeof this.value?this.value?new f(this.key):new l(this.key):this},t.prototype.serialize=function(){return"boolean"==typeof this.value?this.normalize().serialize():this.key+" != '"+this.value+"'"},t.prototype.keys=function(){return[this.key]},t}(),f=function(){function t(t){this.key=t}return t.prototype.getType=function(){return o.Not},t.prototype.cmp=function(t){return this.keyt.key?1:0},t.prototype.equals=function(e){return e instanceof t&&this.key===e.key},t.prototype.evaluate=function(t){return!t.getValue(this.key)},t.prototype.normalize=function(){return this},t.prototype.serialize=function(){return"!"+this.key},t.prototype.keys=function(){return[this.key]},t}(),p=function(){function t(t,e){this.key=t,this.regexp=e}return t.prototype.getType=function(){return o.Regex},t.prototype.cmp=function(t){if(this.keyt.key)return 1;var e=this.regexp?this.regexp.source:void 0;return et.regexp.source?1:0},t.prototype.equals=function(e){if(e instanceof t){var n=this.regexp?this.regexp.source:void 0;return this.key===e.key&&n===e.regexp.source}return!1},t.prototype.evaluate=function(t){return!!this.regexp&&this.regexp.test(t.getValue(this.key))},t.prototype.normalize=function(){return this},t.prototype.serialize=function(){return this.key+" =~ /"+(this.regexp?this.regexp.source:"")+"/"},t.prototype.keys=function(){return[this.key]},t}(),g=function(){function t(e){this.expr=t._normalizeArr(e)}return t.prototype.getType=function(){return o.And},t.prototype.equals=function(e){if(e instanceof t){if(this.expr.length!==e.expr.length)return!1;for(var n=0,i=this.expr.length;n=0,f=h.indexOf("Edge/")>=0,p=d||f,g=(h.indexOf("Opera"),h.indexOf("Firefox")>=0),m=h.indexOf("AppleWebKit")>=0,v=h.indexOf("Chrome")>=0,_=-1===h.indexOf("Chrome")&&h.indexOf("Safari")>=0,y=h.indexOf("iPad")>=0,b=h.indexOf("Chrome/56.")>=0&&-1===h.indexOf("Edge/")},function(t,e,n){"use strict";n.d(e,"g",function(){return i}),n.d(e,"j",function(){return o}),n.d(e,"h",function(){return r}),n.d(e,"k",function(){return d}),n.d(e,"i",function(){return s}),n.d(e,"l",function(){return f}),n.d(e,"e",function(){return p}),n.d(e,"d",function(){return b}),n.d(e,"f",function(){return C}),n.d(e,"b",function(){return L}),n.d(e,"c",function(){return S}),n.d(e,"a",function(){return M});var i,o,r,s,a=n(1),u=n(11),c=n(45),l=n(88),h=Object.assign||function(t){for(var e,n=1,i=arguments.length;n=2?(S=_?i.Large:i.LargeBlocks,A=2/b):(S=_?i.Small:i.SmallBlocks,A=1/b),(N=Math.max(0,Math.floor((O-d)*A/(l+A))))/A>y&&(N=Math.floor(y*A)),I=O-N,"left"===v?(M=0,E+=N,x+=N,D+=N,T+=N):M=e-N-d}else M=0,N=0,S=i.None,I=O;var k=Math.max(1,Math.floor((I-d)/l)),j=f?p:0;return{width:e,height:n,glyphMarginLeft:E,glyphMarginWidth:L,glyphMarginHeight:n,lineNumbersLeft:x,lineNumbersWidth:C,lineNumbersHeight:n,decorationsLeft:D,decorationsWidth:c,decorationsHeight:n,contentLeft:T,contentWidth:I,contentHeight:n,renderMinimap:S,minimapLeft:M,minimapWidth:N,viewportColumn:k,verticalScrollbarWidth:d,horizontalScrollbarHeight:g,overviewRuler:{top:j,width:d,height:n-2*j,right:0}}},t}(),L={fontFamily:u.d?"Menlo, Monaco, 'Courier New', monospace":u.c?"'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:u.d?12:14,lineHeight:0,letterSpacing:0},S={tabSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0},M={inDiffEditor:!1,wordSeparators:l.b,lineNumbersMinChars:5,lineDecorationsWidth:10,readOnly:!1,mouseStyle:"text",disableLayerHinting:!1,automaticLayout:!1,wordWrap:"off",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:o.Same,wordWrapBreakBeforeCharacters:"([{‘“〈《「『【〔([{「£¥$£¥++",wordWrapBreakAfterCharacters:" \t})]?|&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」",wordWrapBreakObtrusiveCharacters:".",autoClosingBrackets:!0,autoIndent:!0,dragAndDrop:!0,emptySelectionClipboard:!0,useTabStops:!0,multiCursorModifier:"altKey",accessibilitySupport:"auto",viewInfo:{extraEditorClassName:"",disableMonospaceOptimizations:!1,rulers:[],ariaLabel:a.a("editorViewAccessibleLabel","Editor content"),renderLineNumbers:1,renderCustomLineNumbers:null,selectOnLineNumbers:!0,glyphMargin:!0,revealHorizontalRightPadding:30,roundedSelection:!0,overviewRulerLanes:2,overviewRulerBorder:!0,cursorBlinking:r.Blink,mouseWheelZoom:!1,cursorStyle:s.Line,cursorWidth:0,hideCursorInOverviewRuler:!1,scrollBeyondLastLine:!0,smoothScrolling:!1,stopRenderingLineAfter:1e4,renderWhitespace:"none",renderControlCharacters:!1,fontLigatures:!1,renderIndentGuides:!0,renderLineHighlight:"line",scrollbar:{vertical:c.b.Auto,horizontal:c.b.Auto,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:10,horizontalSliderSize:10,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,mouseWheelScrollSensitivity:1},minimap:{enabled:!0,side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120},fixedOverflowWidgets:!1},contribInfo:{selectionClipboard:!0,hover:!0,links:!0,contextmenu:!0,quickSuggestions:{other:!0,comments:!1,strings:!1},quickSuggestionsDelay:10,parameterHints:!0,iconsInSuggestions:!0,formatOnType:!1,formatOnPaste:!1,suggestOnTriggerCharacters:!0,acceptSuggestionOnEnter:"on",acceptSuggestionOnCommitCharacter:!0,snippetSuggestions:"inline",wordBasedSuggestions:!0,suggestSelection:"recentlyUsed",suggestFontSize:0,suggestLineHeight:0,selectionHighlight:!0,occurrencesHighlight:!0,codeLens:!0,folding:!0,showFoldingControls:"mouseover",matchBrackets:!0,find:{seedSearchStringFromSelection:!0,autoFindInSelection:!1,globalFindClipboard:!1},colorDecorators:!0,lightbulbEnabled:!0}}},function(t,e,n){"use strict";n.d(e,"j",function(){return r}),n.d(e,"h",function(){return s}),n.d(e,"b",function(){return a}),n.d(e,"a",function(){return u}),n.d(e,"c",function(){return c}),n.d(e,"i",function(){return d}),n.d(e,"g",function(){return p}),n.d(e,"e",function(){return g}),n.d(e,"f",function(){return m}),n.d(e,"d",function(){return v});var i=n(11),o=n(4),r="/",s=i.g?"\\":"/";function a(t){var e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");if(0===e)return".";if(0==~e)return t[0];var n=t.substring(0,~e);return i.g&&":"===n[n.length-1]&&(n+=s),n}function u(t){var e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return 0===e?t:~e==t.length-1?u(t.substring(0,t.length-1)):t.substr(1+~e)}function c(t){var e=~(t=u(t)).lastIndexOf(".");return e?t.substring(~e):""}var l=/(\/\.\.?\/)|(\/\.\.?)$|^(\.\.?\/)|(\/\/+)|(\\)/,h=/(\\\.\.?\\)|(\\\.\.?)$|^(\.\.?\\)|(\\\\+)|(\/)/;function d(t,e){if(null===t||void 0===t)return t;var n=t.length;if(0===n)return".";var o=i.g&&e;if(function(t,e){return e?!h.test(t):!l.test(t)}(t,o))return t;for(var r=o?"\\":"/",s=function(t,e){void 0===e&&(e="/");if(!t)return"";var n=t.length,i=t.charCodeAt(0);if(47===i||92===i){if((47===(i=t.charCodeAt(1))||92===i)&&47!==(i=t.charCodeAt(2))&&92!==i){for(var o=3,r=o;o=65&&i<=90||i>=97&&i<=122)&&58===t.charCodeAt(1))return 47===(i=t.charCodeAt(2))||92===i?t.slice(0,2)+e:t.slice(0,2);var s=t.indexOf("://");if(-1!==s)for(s+=3;s0)&&".."!==g&&(c=-1===p?"":c.slice(0,p),u=!0)}else f(t,a,d,".")&&(s||c||d0){var i=t.charCodeAt(t.length-1);if(47!==i&&92!==i){var o=n.charCodeAt(0);47!==o&&92!==o&&(t+=r)}}t+=n}return d(t)};i.g;function g(t,e,n){var i=t===e;return!n||i?i:!(!t||!e)&&Object(o.equalsIgnoreCase)(t,e)}function m(t,e,n){if(t===e)return!0;if(!t||!e)return!1;if(e.length>t.length)return!1;if(n){if(!Object(o.beginsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;var i=e.length;return e.charAt(e.length-1)===s&&i--,t.charAt(i)===s}return e.charAt(e.length-1)!==s&&(e+=s),0===t.indexOf(e)}function v(t){return i.g?function(t){if(!t)return!1;var e=t.charCodeAt(0);if(47===e||92===e)return!0;if((e>=65&&e<=90||e>=97&&e<=122)&&t.length>2&&58===t.charCodeAt(1)){var n=t.charCodeAt(2);if(47===n||92===n)return!0}return!1}(t):function(t){return t&&47===t.charCodeAt(0)}(t)}},function(t,e,n){"use strict";n.d(e,"j",function(){return i}),n.d(e,"d",function(){return o}),n.d(e,"g",function(){return s}),n.d(e,"b",function(){return a}),n.d(e,"h",function(){return u}),n.d(e,"c",function(){return c}),n.d(e,"f",function(){return l}),n.d(e,"e",function(){return h}),n.d(e,"i",function(){return d}),n.d(e,"a",function(){return f});n(8);function i(t,e){return void 0===e&&(e=0),t[t.length-(1+e)]}function o(t,e,n){if(void 0===n&&(n=function(t,e){return t===e}),t.length!==e.length)return!1;for(var i=0,o=t.length;ie;o--)i.push(o);return i}function f(t,e,n){var i=t.slice(0,e),o=t.slice(e);return i.concat(n,o)}},function(t,e,n){"use strict";n.d(e,"c",function(){return s}),n.d(e,"f",function(){return a}),n.d(e,"b",function(){return c}),n.d(e,"d",function(){return l}),n.d(e,"a",function(){return h}),n.d(e,"e",function(){return f});var i=n(19),o=n(46),r=n(3),s=Object(i.c)("themeService");function a(t){return{id:t}}var u="dark",c="hc";function l(t){switch(t){case u:return"vs-dark";case c:return"hc-black";default:return"vs"}}var h={ThemingContribution:"base.contributions.theming"},d=new(function(){function t(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new r.a}return t.prototype.onThemeChange=function(t){var e=this;return this.themingParticipants.push(t),this.onThemingParticipantAddedEmitter.fire(t),{dispose:function(){var n=e.themingParticipants.indexOf(t);e.themingParticipants.splice(n,1)}}},Object.defineProperty(t.prototype,"onThemingParticipantAdded",{get:function(){return this.onThemingParticipantAddedEmitter.event},enumerable:!0,configurable:!0}),t.prototype.getThemingParticipants=function(){return this.themingParticipants},t}());function f(t){return d.onThemeChange(t)}o.a.add(h.ThemingContribution,d)},function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return u});var i,o,r=n(2),s=n(6),a=(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){t[t.LTR=0]="LTR",t[t.RTL=1]="RTL"}(o||(o={}));var u=function(t){function e(e,n,i,o){var r=t.call(this,e,n,i,o)||this;return r.selectionStartLineNumber=e,r.selectionStartColumn=n,r.positionLineNumber=i,r.positionColumn=o,r}return a(e,t),e.prototype.clone=function(){return new e(this.selectionStartLineNumber,this.selectionStartColumn,this.positionLineNumber,this.positionColumn)},e.prototype.toString=function(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"},e.prototype.equalsSelection=function(t){return e.selectionsEqual(this,t)},e.selectionsEqual=function(t,e){return t.selectionStartLineNumber===e.selectionStartLineNumber&&t.selectionStartColumn===e.selectionStartColumn&&t.positionLineNumber===e.positionLineNumber&&t.positionColumn===e.positionColumn},e.prototype.getDirection=function(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?o.LTR:o.RTL},e.prototype.setEndPosition=function(t,n){return this.getDirection()===o.LTR?new e(this.startLineNumber,this.startColumn,t,n):new e(t,n,this.startLineNumber,this.startColumn)},e.prototype.getPosition=function(){return new s.a(this.positionLineNumber,this.positionColumn)},e.prototype.setStartPosition=function(t,n){return this.getDirection()===o.LTR?new e(t,n,this.endLineNumber,this.endColumn):new e(this.endLineNumber,this.endColumn,t,n)},e.fromPositions=function(t,n){return void 0===n&&(n=t),new e(t.lineNumber,t.column,n.lineNumber,n.column)},e.liftSelection=function(t){return new e(t.selectionStartLineNumber,t.selectionStartColumn,t.positionLineNumber,t.positionColumn)},e.selectionsArrEqual=function(t,e){if(t&&!e||!t&&e)return!1;if(!t&&!e)return!0;if(t.length!==e.length)return!1;for(var n=0,i=t.length;n0?this.consume():this._onFinished.fire()},t.prototype.dispose=function(){this._onFinished.dispose()},t}());!function(){function t(){this.queues=Object.create(null)}t.prototype.queueFor=function(t){var e=this,n=t.toString();if(!this.queues[n]){var i=new _;i.onFinished(function(){i.dispose(),delete e.queues[n]}),this.queues[n]=i}return this.queues[n]}}();var y=function(t){function e(){var e=t.call(this)||this;return e._token=-1,e}return c(e,t),e.prototype.dispose=function(){this.cancel(),t.prototype.dispose.call(this)},e.prototype.cancel=function(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)},e.prototype.cancelAndSet=function(t,e){var n=this;this.cancel(),this._token=setTimeout(function(){n._token=-1,t()},e)},e.prototype.setIfNotSet=function(t,e){var n=this;-1===this._token&&(this._token=setTimeout(function(){n._token=-1,t()},e))},e}(a.a),b=function(t){function e(){var e=t.call(this)||this;return e._token=-1,e}return c(e,t),e.prototype.dispose=function(){this.cancel(),t.prototype.dispose.call(this)},e.prototype.cancel=function(){-1!==this._token&&(clearInterval(this._token),this._token=-1)},e.prototype.cancelAndSet=function(t,e){this.cancel(),this._token=setInterval(function(){t()},e)},e}(a.a),C=function(){function t(t,e){this.timeoutToken=-1,this.runner=t,this.timeout=e,this.timeoutHandler=this.onTimeout.bind(this)}return t.prototype.dispose=function(){this.cancel(),this.runner=null},t.prototype.cancel=function(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)},t.prototype.schedule=function(t){void 0===t&&(t=this.timeout),this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,t)},t.prototype.isScheduled=function(){return-1!==this.timeoutToken},t.prototype.onTimeout=function(){this.timeoutToken=-1,this.runner&&this.runner()},t}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}c(e,t),e.prototype.throttle=function(t){var e=this;return this.suspended=!0,m(t,function(){return e.resume()})},e.prototype.fire=function(e){return this.suspended?(this.lastEvent=e,void(this.hasLastEvent=!0)):t.prototype.fire.call(this,e)},e.prototype.resume=function(){this.suspended=!1,this.hasLastEvent&&this.fire(this.lastEvent),this.hasLastEvent=!1,this.lastEvent=void 0}}(u.a)},function(t,e,n){"use strict";var i;n.d(e,"a",function(){return i}),function(t){t[t.NotSet=0]="NotSet",t[t.ContentFlush=1]="ContentFlush",t[t.RecoverFromMarkers=2]="RecoverFromMarkers",t[t.Explicit=3]="Explicit",t[t.Paste=4]="Paste",t[t.Undo=5]="Undo",t[t.Redo=6]="Redo"}(i||(i={}))},function(t,e,n){var i=n(41);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var i,o,r={},s=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=i.apply(this,arguments)),o}),a=function(t){var e={};return function(t){if("function"==typeof t)return t();if(void 0===e[t]){var n=function(t){return document.querySelector(t)}.call(this,t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),u=null,c=0,l=[],h=n(298);function d(t,e){for(var n=0;n=0&&l.splice(e,1)}function m(t){var e=document.createElement("style");return t.attrs.type="text/css",v(e,t.attrs),p(t,e),e}function v(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function _(t,e){var n,i,o,r;if(e.transform&&t.css){if(!(r=e.transform(t.css)))return function(){};t.css=r}if(e.singleton){var s=c++;n=u||(u=m(e)),i=C.bind(null,n,s,!1),o=C.bind(null,n,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",v(e,t.attrs),p(t,e),e}(e),i=function(t,e,n){var i=n.css,o=n.sourceMap,r=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||r)&&(i=h(i));o&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var s=new Blob([i],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,e),o=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=m(e),i=function(t,e){var n=e.css,i=e.media;i&&t.setAttribute("media",i);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){g(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=s()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=f(t,e);return d(n,e),function(t){for(var i=[],o=0;o0;){var n=e.shift();for(var i in Object.freeze(n),n)if(s.call(n,i)){var o=n[i];"object"!=typeof o||Object.isFrozen(o)||e.push(o)}}return t}var s=Object.prototype.hasOwnProperty;function a(t,e,n){return void 0===n&&(n=!0),Object(i.g)(t)?(Object(i.g)(e)&&Object.keys(e).forEach(function(o){o in t?n&&(Object(i.g)(t[o])&&Object(i.g)(e[o])?a(t[o],e[o],n):t[o]=e[o]):t[o]=e[o]}),t):e}function u(t){for(var e=[],n=1;n1&&!!t.close}).map(function(t){return new i.b(t)}),n.docComment&&this._complexAutoClosePairs.push(new i.b({open:n.docComment.open,close:n.docComment.close}))}return t.prototype.getElectricCharacters=function(){var t=[];if(this._richEditBrackets)for(var e=0,n=this._richEditBrackets.brackets.length;e=0))return{appendText:s.close}}}return null},t}(),u=n(21),c=n(4),l=function(){function t(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=e.brackets.map(function(e){return{open:e[0],openRegExp:t._createOpenBracketRegExp(e[0]),close:e[1],closeRegExp:t._createCloseBracketRegExp(e[1])}}),this._regExpRules=e.regExpRules||[]}return t.prototype.onEnter=function(t,e,n){for(var o=0,r=this._regExpRules.length;o0&&n.length>0)for(o=0,r=this._brackets.length;o0)for(o=0,r=this._brackets.length;o1){var o=e-1,r=-1;for(o=e-1;o>=1;o--){if(t.getLanguageIdAtPosition(o,0)!==i)return r;var s=t.getLineContent(o);if(!n.shouldIgnore(s)&&!/^\s+$/.test(s)&&""!==s)return o;r=o}}return-1},t.prototype.getInheritIndentForLine=function(t,e,n){void 0===n&&(n=!0);var o=this.getIndentRulesSupport(t.getLanguageIdentifier().id);if(!o)return null;if(e<=1)return{indentation:"",action:null};var r=this.getPrecedingValidLine(t,e,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};var s=t.getLineContent(r);if(o.shouldIncrease(s)||o.shouldIndentNextLine(s))return{indentation:c.getLeadingWhitespace(s),action:i.a.Indent,line:r};if(o.shouldDecrease(s))return{indentation:c.getLeadingWhitespace(s),action:null,line:r};if(1===r)return{indentation:c.getLeadingWhitespace(t.getLineContent(r)),action:null,line:r};var a=r-1,u=o.getIndentMetadata(t.getLineContent(a));if(!(3&u)&&4&u){for(var l=0,h=a-1;h>0;h--)if(!o.shouldIndentNextLine(t.getLineContent(h))){l=h;break}return{indentation:c.getLeadingWhitespace(t.getLineContent(l+1)),action:null,line:l+1}}if(n)return{indentation:c.getLeadingWhitespace(t.getLineContent(r)),action:null,line:r};for(h=r;h>0;h--){var d=t.getLineContent(h);if(o.shouldIncrease(d))return{indentation:c.getLeadingWhitespace(d),action:i.a.Indent,line:h};if(o.shouldIndentNextLine(d)){l=0;for(var f=h-1;f>0;f--)if(!o.shouldIndentNextLine(t.getLineContent(h))){l=f;break}return{indentation:c.getLeadingWhitespace(t.getLineContent(l+1)),action:null,line:l+1}}if(o.shouldDecrease(d))return{indentation:c.getLeadingWhitespace(d),action:null,line:h}}return{indentation:c.getLeadingWhitespace(t.getLineContent(1)),action:null,line:1}},t.prototype.getGoodIndentForLine=function(t,e,n,o){var r=this.getIndentRulesSupport(e);if(!r)return null;var s=this.getInheritIndentForLine(t,n),a=t.getLineContent(n);if(s){var l=s.line;if(void 0!==l){var h=this._getOnEnterSupport(e),d=null;try{d=h.onEnter("",t.getLineContent(l),"")}catch(t){Object(u.e)(t)}if(d){var f=c.getLeadingWhitespace(t.getLineContent(l));return d.removeText&&(f=f.substring(0,f.length-d.removeText)),d.indentAction===i.a.Indent||d.indentAction===i.a.IndentOutdent?f=o.shiftIndent(f):d.indentAction===i.a.Outdent&&(f=o.unshiftIndent(f)),r.shouldDecrease(a)&&(f=o.unshiftIndent(f)),d.appendText&&(f+=d.appendText),c.getLeadingWhitespace(f)}}return r.shouldDecrease(a)?s.action===i.a.Indent?s.indentation:o.unshiftIndent(s.indentation):s.action===i.a.Indent?o.shiftIndent(s.indentation):s.indentation}return null},t.prototype.getIndentForEnter=function(t,e,n,o){t.forceTokenization(e.startLineNumber);var s,a,u=t.getLineTokens(e.startLineNumber),l=Object(r.a)(u,e.startColumn-1),h=l.getLineContent(),d=!1;(l.firstCharOffset>0&&u.getLanguageId(0)!==l.languageId?(d=!0,s=h.substr(0,e.startColumn-1-l.firstCharOffset)):s=u.getLineContent().substring(0,e.startColumn-1),e.isEmpty())?a=h.substr(e.startColumn-1-l.firstCharOffset):a=this.getScopedLineTokens(t,e.endLineNumber,e.endColumn).getLineContent().substr(e.endColumn-1-l.firstCharOffset);var f=this.getIndentRulesSupport(l.languageId);if(!f)return null;var p=s,g=c.getLeadingWhitespace(s);if(!o&&!d){var m=this.getInheritIndentForLine(t,e.startLineNumber);f.shouldDecrease(s)&&m&&(g=m.indentation,m.action!==i.a.Indent&&(g=n.unshiftIndent(g))),p=g+c.ltrim(c.ltrim(s," "),"\t")}var v={getLineTokens:function(e){return t.getLineTokens(e)},getLanguageIdentifier:function(){return t.getLanguageIdentifier()},getLanguageIdAtPosition:function(e,n){return t.getLanguageIdAtPosition(e,n)},getLineContent:function(n){return n===e.startLineNumber?p:t.getLineContent(n)}},_=c.getLeadingWhitespace(u.getLineContent()),y=this.getInheritIndentForLine(v,e.startLineNumber+1);if(!y){var b=d?_:g;return{beforeEnter:b,afterEnter:b}}var C=d?_:y.indentation;return y.action===i.a.Indent&&(C=n.shiftIndent(C)),f.shouldDecrease(a)&&(C=n.unshiftIndent(C)),{beforeEnter:d?_:g,afterEnter:C}},t.prototype.getIndentActionForType=function(t,e,n,o){var r=this.getScopedLineTokens(t,e.startLineNumber,e.startColumn),s=this.getIndentRulesSupport(r.languageId);if(!s)return null;var a,u=r.getLineContent(),c=u.substr(0,e.startColumn-1-r.firstCharOffset);e.isEmpty()?a=u.substr(e.startColumn-1-r.firstCharOffset):a=this.getScopedLineTokens(t,e.endLineNumber,e.endColumn).getLineContent().substr(e.endColumn-1-r.firstCharOffset);if(!s.shouldDecrease(c+a)&&s.shouldDecrease(c+n+a)){var l=this.getInheritIndentForLine(t,e.startLineNumber,!1);if(!l)return null;var h=l.indentation;return l.action!==i.a.Indent&&(h=o.unshiftIndent(h)),h}return null},t.prototype.getIndentMetadata=function(t,e){var n=this.getIndentRulesSupport(t.getLanguageIdentifier().id);return n?e<1||e>t.getLineCount()?null:n.getIndentMetadata(t.getLineContent(e)):null},t.prototype._getOnEnterSupport=function(t){var e=this._getRichEditSupport(t);return e&&e.onEnter||null},t.prototype.getRawEnterActionAtPosition=function(t,e,n){var i=this.getEnterAction(t,new p.a(e,n,e,n));return i?i.enterAction:null},t.prototype.getEnterAction=function(t,e){var n=this.getIndentationAtPosition(t,e.startLineNumber,e.startColumn),o=this.getScopedLineTokens(t,e.startLineNumber,e.startColumn),r=this._getOnEnterSupport(o.languageId);if(!r)return null;var s,a=o.getLineContent(),c=a.substr(0,e.startColumn-1-o.firstCharOffset);e.isEmpty()?s=a.substr(e.startColumn-1-o.firstCharOffset):s=this.getScopedLineTokens(t,e.endLineNumber,e.endColumn).getLineContent().substr(e.endColumn-1-o.firstCharOffset);var l=e.startLineNumber,h="";if(l>1&&0===o.firstCharOffset){var d=this.getScopedLineTokens(t,l-1);d.languageId===o.languageId&&(h=d.getLineContent())}var f=null;try{f=r.onEnter(h,c,s)}catch(t){Object(u.e)(t)}return f?(f.appendText||(f.indentAction===i.a.Indent||f.indentAction===i.a.IndentOutdent?f.appendText="\t":f.appendText=""),f.removeText&&(n=n.substring(0,n.length-f.removeText)),{enterAction:f,indentation:n}):null},t.prototype.getIndentationAtPosition=function(t,e,n){var i=t.getLineContent(e),o=c.getLeadingWhitespace(i);return o.length>n-1&&(o=o.substring(0,n-1)),o},t.prototype.getScopedLineTokens=function(t,e,n){t.forceTokenization(e);var i=t.getLineTokens(e),o=isNaN(n)?t.getLineMaxColumn(e)-1:n-1;return Object(r.a)(i,o)},t.prototype.getBracketsSupport=function(t){var e=this._getRichEditSupport(t);return e&&e.brackets||null},t}()))},function(t,e,n){"use strict";var i;n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o}),function(t){t[t.None=0]="None",t[t.Indent=1]="Indent",t[t.IndentOutdent=2]="IndentOutdent",t[t.Outdent=3]="Outdent"}(i||(i={}));var o=function(){function t(t){if(this.open=t.open,this.close=t.close,this._standardTokenMask=0,Array.isArray(t.notIn))for(var e=0,n=t.notIn.length;ee&&(n=e-t),n<0&&(n=0),i<0&&(i=0),r+i>o&&(r=o-i),r<0&&(r=0),this.width=t,this.scrollWidth=e,this.scrollLeft=n,this.height=i,this.scrollHeight=o,this.scrollTop=r}return t.prototype.equals=function(t){return this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop},t.prototype.withScrollDimensions=function(e){return new t(void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,this.scrollTop)},t.prototype.withScrollPosition=function(e){return new t(this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.scrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.scrollTop)},t.prototype.createScrollEvent=function(t){var e=this.width!==t.width,n=this.scrollWidth!==t.scrollWidth,i=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,r=this.scrollHeight!==t.scrollHeight,s=this.scrollTop!==t.scrollTop;return{width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:e,scrollWidthChanged:n,scrollLeftChanged:i,heightChanged:o,scrollHeightChanged:r,scrollTopChanged:s}},t}(),c=function(t){function e(e,n){var i=t.call(this)||this;return i._onScroll=i._register(new s.a),i.onScroll=i._onScroll.event,i._smoothScrollDuration=e,i._scheduleAtNextAnimationFrame=n,i._state=new u(0,0,0,0,0,0),i._smoothScrolling=null,i}return a(e,t),e.prototype.dispose=function(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),t.prototype.dispose.call(this)},e.prototype.setSmoothScrollDuration=function(t){this._smoothScrollDuration=t},e.prototype.validateScrollPosition=function(t){return this._state.withScrollPosition(t)},e.prototype.getScrollDimensions=function(){return this._state},e.prototype.setScrollDimensions=function(t){var e=this._state.withScrollDimensions(t);this._setState(e),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)},e.prototype.getFutureScrollPosition=function(){return this._smoothScrolling?this._smoothScrolling.to:this._state},e.prototype.getCurrentScrollPosition=function(){return this._state},e.prototype.setScrollPositionNow=function(t){var e=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e)},e.prototype.setScrollPositionSmooth=function(t){var e=this;if(0===this._smoothScrollDuration)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:void 0===t.scrollLeft?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:void 0===t.scrollTop?this._smoothScrolling.to.scrollTop:t.scrollTop};var n=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;var i=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration);this._smoothScrolling.dispose(),this._smoothScrolling=i}else{n=this._state.withScrollPosition(t);this._smoothScrolling=d.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(function(){e._smoothScrolling&&(e._smoothScrolling.animationFrameDisposable=null,e._performSmoothScrolling())})},e.prototype._performSmoothScrolling=function(){var t=this,e=this._smoothScrolling.tick(),n=this._state.withScrollPosition(e);if(this._setState(n),e.isDone)return this._smoothScrolling.dispose(),void(this._smoothScrolling=null);this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(function(){t._smoothScrolling&&(t._smoothScrolling.animationFrameDisposable=null,t._performSmoothScrolling())})},e.prototype._setState=function(t){var e=this._state;e.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(e)))},e}(r.a),l=function(){return function(t,e,n){this.scrollLeft=t,this.scrollTop=e,this.isDone=n}}();function h(t,e){var n=e-t;return function(e){return t+n*(1-function(t){return Math.pow(t,3)}(1-e))}}var d=function(){function t(t,e,n,i){this.from=t,this.to=e,this.duration=i,this._startTime=n,this.animationFrameDisposable=null,this._initAnimations()}return t.prototype._initAnimations=function(){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)},t.prototype._initAnimation=function(t,e,n){var i,o,r;if(Math.abs(t-e)>2.5*n){var s=void 0,a=void 0;return t0){var t=this.past.pop();try{for(var e=t.editOperations.length-1;e>=0;e--)t.editOperations[e]={operations:this.model.applyEdits(t.editOperations[e].operations)}}catch(t){return this.clear(),null}return this.future.push(t),{selections:t.beforeCursorState,recordedVersionId:t.beforeVersionId}}return null},t.prototype.redo=function(){if(this.future.length>0){if(this.currentOpenStackElement)throw new Error("How is this possible?");var t=this.future.pop();try{for(var e=0;e>>0}var I=new Uint32Array(0).buffer,E=function(){function t(t){this._state=t,this._lineTokens=null,this._invalid=!0}return t.prototype.deleteBeginning=function(t){null!==this._lineTokens&&this._lineTokens!==I&&this.delete(0,t)},t.prototype.deleteEnding=function(t){if(null!==this._lineTokens&&this._lineTokens!==I){var e=new Uint32Array(this._lineTokens),n=e[e.length-2];this.delete(t,n)}},t.prototype.delete=function(t,e){if(null!==this._lineTokens&&this._lineTokens!==I&&t!==e){var n=new Uint32Array(this._lineTokens),i=n.length>>>1;if(0!==t||n[n.length-2]!==e){var o=S.a.findIndexInTokensArray(n,t),r=o>0?n[o-1<<1]:0;if(ec&&(n[u++]=d,n[u++]=n[1+(h<<1)],c=d)}if(u!==n.length){var f=new Uint32Array(u);f.set(n.subarray(0,u),0),this._lineTokens=f.buffer}}}else this._lineTokens=I}},t.prototype.append=function(t){if(t!==I)if(this._lineTokens!==I){if(null!==this._lineTokens)if(null!==t){var e=new Uint32Array(this._lineTokens),n=new Uint32Array(t),i=n.length>>>1,o=new Uint32Array(e.length+n.length);o.set(e,0);for(var r=e.length,s=e[e.length-2],a=0;a>>1,o=S.a.findIndexInTokensArray(n,t);if(o>0)(o>0?n[o-1<<1]:0)===t&&o--;for(var r=o;r=t},t.prototype.hasLinesToTokenize=function(t){return this._invalidLineStartIndex=0;r--)this.invalidateLine(t.startLineNumber+r-1);this._acceptDeleteRange(t),this._acceptInsertText(new C.a(t.startLineNumber,t.startColumn),e,n)},t.prototype._acceptDeleteRange=function(t){var e=t.startLineNumber-1;if(!(e>=this._tokens.length))if(t.startLineNumber!==t.endLineNumber){var n=this._tokens[e];n.deleteEnding(t.startColumn-1);var i=t.endLineNumber-1,o=null;if(i=this._tokens.length))if(0!==e){var o=this._tokens[i];o.deleteEnding(t.column-1),o.insert(t.column-1,n);for(var r=new Array(e),s=e-1;s>=0;s--)r[s]=new E(null);this._tokens=M.a(this._tokens,t.lineNumber,r)}else this._tokens[i].insert(t.column-1,n)}},t.prototype._tokenizeOneLine=function(t,e){if(!this.hasLinesToTokenize(t))return t.getLineCount()+1;var n=this._invalidLineStartIndex+1;return this._updateTokensUntilLine(t,e,n),n},t.prototype._updateTokensUntilLine=function(t,e,n){if(this.tokenizationSupport){for(var i=t.getLineCount(),o=n-1,r=this._invalidLineStartIndex;r<=o;r++){var s=r+1,u=null,c=t.getLineContent(r+1);try{var l=this._getState(r).clone();u=this.tokenizationSupport.tokenize2(c,l,0)}catch(t){Object(a.e)(t)}if(u||(u=Object(_.e)(this.languageIdentifier.id,c,this._getState(r),0)),this._setTokens(this.languageIdentifier.id,r,c.length,u.tokens),e.registerChangedTokens(r+1),this._setIsInvalid(r,!1),s0?e[n-1]:null;i&&i.toLineNumber===t-1?i.toLineNumber++:e[n]={fromLineNumber:t,toLineNumber:t}},t.prototype.build=function(){return 0===this._ranges.length?null:{ranges:this._ranges}},t}();function T(t,e,n,i){var o;for(o=0;o0&&s>0)return 0;if(u>0&&c>0)return 0;var l=Math.abs(s-c),h=Math.abs(r-u);return 0===l?h:h%l==0?h/l:0}function O(t,e,n){for(var i=Math.min(t.getLineCount(),1e4),o=0,r=0,s="",a=0,u=[0,0,0,0,0,0,0,0,0],c=function(e){var n=t.getLineLength(e),i=t.getLineContent(e),c=void 0;c=n>65536?function(n){return t.getLineCharCode(e,n)}:function(t){return i.charCodeAt(t)};for(var l=!1,h=0,d=0,f=0,p=0,g=n;p0?o++:d>1&&r++;var v=T(s,a,i,h);v<=8&&u[v]++,s=i,a=h},l=1;l<=i;l++)c(l);var h=T(s,a,"",0);h<=8&&u[h]++;var d=n;o!==r&&(d=op&&(p=e,f=t)}),{insertSpaces:d,tabSize:f}}var A=n(24),k=n(130),j=function(){function t(t,e,n,i){this.searchString=t,this.isRegex=e,this.matchCase=n,this.wordSeparators=i}return t._isMultilineRegexSource=function(t){if(!t||0===t.length)return!1;for(var e=0,n=t.length;e=n)break;var i=t.charCodeAt(e);if(110===i||114===i)return!0}}return!1},t.prototype.parseSearchRequest=function(){if(""===this.searchString)return null;var e;e=this.isRegex?t._isMultilineRegexSource(this.searchString):this.searchString.indexOf("\n")>=0;var n=null;try{n=d.createRegExp(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0})}catch(t){return null}if(!n)return null;var i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new R(n,this.wordSeparators?Object(k.a)(this.wordSeparators):null,i?this.searchString:null)},t}(),R=function(){return function(t,e,n){this.regex=t,this.wordSeparators=e,this.simpleSearch=n}}();function P(t,e,n){if(!n)return new r.e(t,null);for(var i=[],o=0,s=e.length;o=o)break}return a}return this._doFindMatchesMultiline(t,n,new F(s.wordSeparators,s.regex),i,o)}return this._doFindMatchesLineByLine(t,n,s,i,o)},t._getMultilineMatchRange=function(t,e,n,i,o){var r,s;if("\r\n"===t.getEOL()){for(var a=0,u=0;u=o)return c;return c},t._doFindMatchesLineByLine=function(t,e,n,i,o){var r=[],s=0;if(e.startLineNumber===e.endLineNumber){var a=t.getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);return s=this._findMatchesInLine(n,a,e.startLineNumber,e.startColumn-1,s,r,i,o),r}var u=t.getLineContent(e.startLineNumber).substring(e.startColumn-1);s=this._findMatchesInLine(n,u,e.startLineNumber,e.startColumn-1,s,r,i,o);for(var c=e.startLineNumber+1;c=u))return o;return o}var g,m=new F(t.wordSeparators,t.regex);m.reset(0);do{if((g=m.next(e))&&(s[o++]=P(new c.a(n,g.index+1+i,n,g.index+1+g[0].length+i),g,a),o>=u))return o}while(g);return o},t.findNextMatch=function(t,e,n,i){var o=e.parseSearchRequest();if(!o)return null;var r=new F(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(t,n,r,i):this._doFindNextMatchLineByLine(t,n,r,i)},t._doFindNextMatchMultiline=function(t,e,n,i){var o=new C.a(e.lineNumber,1),s=t.getOffsetAt(o),a=t.getLineCount(),u=t.getValueInRange(new c.a(o.lineNumber,o.column,a,t.getLineMaxColumn(a)),r.c.LF);n.reset(e.column-1);var l=n.next(u);return l?P(this._getMultilineMatchRange(t,s,u,l.index,l[0]),l,i):1!==e.lineNumber||1!==e.column?this._doFindNextMatchMultiline(t,new C.a(1,1),n,i):null},t._doFindNextMatchLineByLine=function(t,e,n,i){var o=t.getLineCount(),r=e.lineNumber,s=t.getLineContent(r),a=this._findFirstMatchInLine(n,s,r,e.column,i);if(a)return a;for(var u=1;u<=o;u++){var c=(r+u-1)%o,l=t.getLineContent(c+1),h=this._findFirstMatchInLine(n,l,c+1,1,i);if(h)return h}return null},t._findFirstMatchInLine=function(t,e,n,i,o){t.reset(i-1);var r=t.next(e);return r?P(new c.a(n,r.index+1,n,r.index+1+r[0].length),r,o):null},t.findPreviousMatch=function(t,e,n,i){var o=e.parseSearchRequest();if(!o)return null;var r=new F(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(t,n,r,i):this._doFindPreviousMatchLineByLine(t,n,r,i)},t._doFindPreviousMatchMultiline=function(t,e,n,i){var o=this._doFindMatchesMultiline(t,new c.a(1,1,e.lineNumber,e.column),n,i,9990);if(o.length>0)return o[o.length-1];var r=t.getLineCount();return e.lineNumber!==r||e.column!==t.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(t,new C.a(r,t.getLineMaxColumn(r)),n,i):null},t._doFindPreviousMatchLineByLine=function(t,e,n,i){var o=t.getLineCount(),r=e.lineNumber,s=t.getLineContent(r).substring(0,e.column-1),a=this._findLastMatchInLine(n,s,r,i);if(a)return a;for(var u=1;u<=o;u++){var c=(o+r-u-1)%o,l=t.getLineContent(c+1),h=this._findLastMatchInLine(n,l,c+1,i);if(h)return h}return null},t._findLastMatchInLine=function(t,e,n,i){var o,r=null;for(t.reset(0);o=t.next(e);)r=P(new c.a(n,o.index+1,n,o.index+1+o[0].length),o,i);return r},t}();function z(t,e,n,i,o){return function(t,e,n,i,o){if(0===i)return!0;var r=e.charCodeAt(i-1);if(0!==t.get(r))return!0;if(o>0){var s=e.charCodeAt(i);if(0!==t.get(s))return!0}return!1}(t,e,0,i,o)&&function(t,e,n,i,o){if(i+o===n)return!0;var r=e.charCodeAt(i+o);if(0!==t.get(r))return!0;if(o>0){var s=e.charCodeAt(i+o-1);if(0!==t.get(s))return!0}return!1}(t,e,n,i,o)}var F=function(){function t(t,e){this._wordSeparators=t,this._searchRegex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}return t.prototype.reset=function(t){this._searchRegex.lastIndex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0},t.prototype.next=function(t){var e,n=t.length;do{if(this._prevMatchStartIndex+this._prevMatchLength===n)return null;if(!(e=this._searchRegex.exec(t)))return null;var i=e.index,o=e[0].length;if(i===this._prevMatchStartIndex&&o===this._prevMatchLength)return null;if(this._prevMatchStartIndex=i,this._prevMatchLength=o,!this._wordSeparators||z(this._wordSeparators,t,n,i,o))return e}while(e);return null},t}(),B=(n(8),function(){function t(){}return t._getEOL=function(t,e){var n=t.lines.length-1;return 0===n?e===r.b.LF?"\n":"\r\n":t.totalCRCount>n/2?"\r\n":"\n"},t.fromRawTextSource=function(e,n){return{lines:e.lines,BOM:e.BOM,EOL:t._getEOL(e,n),containsRTL:e.containsRTL,isBasicASCII:e.isBasicASCII}},t}()),V=n(106),H=function(){function t(t,e,n){this._lines=t,this._linesLength=this._lines.length,this._eol=e,this._bom=n,this._lineIndex=0}return t.prototype.read=function(){if(this._lineIndex>=this._linesLength)return null;var t=null;return t=0===this._lineIndex?this._bom+this._lines[this._lineIndex]:this._lines[this._lineIndex],this._lineIndex++,this._lineIndex0){g.sort(function(t,e){return e.lineNumber-t.lineNumber}),C=[];u=0;for(var w=g.length;u0&&g[u-1].lineNumber===v)){var L=g[u].oldContent,S=this.getLineContent(v);0!==S.length&&S!==L&&-1===d.firstNonWhitespaceIndex(S)&&C.push(v)}}}return new r.a(y,b,C)},t.prototype._reduceOperations=function(t){return t.length<1e3?t:[this._toSingleEditOperation(t)]},t.prototype._toSingleEditOperation=function(t){for(var e=!1,n=t[0].range,i=t[t.length-1].range,o=new c.a(n.startLineNumber,n.startColumn,i.endLineNumber,i.endColumn),s=n.startLineNumber,a=n.startColumn,u=[],l=0,h=t.length;l=0;p--){var g=s+p,m=r.lines?r.lines[p]:"";if(g===s||g===u){var v=g===s?a:1,_=g===u?l:this.getLineLength(g)+1;m=this._lines[g-1].substring(0,v-1)+m+this._lines[g-1].substring(_-1)}this._setLineContent(g,m)}if(f0){var d=a.lines.length,f=a.lines[0],p=a.lines[d-1];h=1===d?new c.a(u,l,u,l+f.length):new c.a(u,l,u+d-1,p.length+1)}else h=new c.a(u,l,u,l);e=h.endLineNumber,n=h.endColumn,i.push(h),o=a}return i},t}(),U=function(){function t(t){this.rawTextSource=t}return t.prototype.create=function(t){var e=B.fromRawTextSource(this.rawTextSource,t);return new Y(e)},t.prototype.getFirstLineText=function(t){return this.rawTextSource.lines[0].substr(0,t)},t}(),Z=function(){function t(){this.BOM="",this.lines=[],this.currLineIndex=0}return t.prototype.acceptLines=function(t){0===this.currLineIndex&&d.startsWithUTF8BOM(t[0])&&(this.BOM=d.UTF8_BOM_CHARACTER,t[0]=t[0].substr(1));for(var e=0,n=t.length;ethis._nodes.length-1?null:0===this._index?this._BOM+this._tree.getNodeContent(this._nodes[this._index++]):this._tree.getNodeContent(this._nodes[this._index++])},t}(),ft=function(){function t(t){this._limit=t,this._cache=[]}return t.prototype.get=function(t){for(var e=this._cache.length-1;e>=0;e--){var n=this._cache[e];if(n.nodeStartOffset<=t&&n.nodeStartOffset+n.node.piece.length>=t)return n}return null},t.prototype.get2=function(t){for(var e=this._cache.length-1;e>=0;e--){var n=this._cache[e];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=t)return n}return null},t.prototype.set=function(t){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(t)},t.prototype.valdiate=function(t){for(var e=!1,n=0;n=t)&&(this._cache[n]=null,e=!0)}if(e){var o=[];for(n=0;n0){t[o].lineStarts||(t[o].lineStarts=ct(t[o].buffer));var s=new lt(o+1,{line:0,column:0},{line:t[o].lineStarts.length-1,column:t[o].buffer.length-t[o].lineStarts[t[o].lineStarts.length-1]},t[o].lineStarts.length-1,t[o].buffer.length);this._buffers.push(t[o]),i=this.rbInsertRight(i,s)}this._searchCache=new ft(1),this._lastVisitedLine={lineNumber:0,value:null},this.computeBufferMetadata()},t.prototype.normalizeEOL=function(t){var e=this,n=65536-Math.floor(65536/3),i=2*n,o="",r=0,s=[];if(this.iterate(this.root,function(a){var u=e.getNodeContent(a),c=u.length;if(r<=n||r+c0){var a=o.replace(/\r\n|\r|\n/g,t);s.push(new ht(a,ct(a)))}this.create(s,t,!0)},t.prototype.getEOL=function(){return this._EOL},t.prototype.setEOL=function(t){this._EOL=t,this._EOLLength=this._EOL.length,this.normalizeEOL(t)},t.prototype.createSnapshot=function(t){return new dt(this,t)},t.prototype.equal=function(t){var e=this;if(this.getLength()!==t.getLength())return!1;if(this.getLineCount()!==t.getLineCount())return!1;return this.iterate(this.root,function(n){if(n===K)return!0;var i=e.getNodeContent(n),o=i.length,r=t.nodeAt(0),s=t.nodeAt(0+o);return i===t.getValueInRange2(r,s)})},t.prototype.getOffsetAt=function(t,e){for(var n=0,i=this.root;i!==K;)if(i.left!==K&&i.lf_left+1>=t)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt+1>=t)return(n+=i.size_left)+(this.getAccumulatedValue(i,t-i.lf_left-2)+e-1);t-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}return n},t.prototype.getPositionAt=function(t){t=Math.floor(t),t=Math.max(0,t);for(var e=this.root,n=0,i=t;e!==K;)if(0!==e.size_left&&e.size_left>=t)e=e.left;else{if(e.size_left+e.piece.length>=t){var o=this.getIndexOf(e,t-e.size_left);if(n+=e.lf_left+o.index,0===o.index){var r=i-this.getOffsetAt(n+1,1);return new C.a(n+1,r+1)}return new C.a(n+1,o.remainder+1)}if(t-=e.size_left+e.piece.length,n+=e.lf_left+e.piece.lineFeedCnt,e.right===K){r=i-t-this.getOffsetAt(n+1,1);return new C.a(n+1,r+1)}e=e.right}return new C.a(1,1)},t.prototype.getValueInRange=function(t){if(t.startLineNumber===t.endLineNumber&&t.startColumn===t.endColumn)return"";var e=this.nodeAt2(t.startLineNumber,t.startColumn),n=this.nodeAt2(t.endLineNumber,t.endColumn);return this.getValueInRange2(e,n)},t.prototype.getValueInRange2=function(t,e){if(t.node===e.node){var n=t.node,i=this._buffers[n.piece.bufferIndex].buffer,o=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i.substring(o+t.remainder,o+e.remainder)}var r=t.node,s=this._buffers[r.piece.bufferIndex].buffer,a=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start),u=s.substring(a+t.remainder,a+r.piece.length);for(r=r.next();r!==K;){var c=this._buffers[r.piece.bufferIndex].buffer,l=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);if(r===e.node){u+=c.substring(l,l+e.remainder);break}u+=c.substr(l,r.piece.length),r=r.next()}return u},t.prototype.getLinesContent=function(){return this.getContentOfSubTree(this.root).split(/\r\n|\r|\n/)},t.prototype.getLength=function(){return this._length},t.prototype.getLineCount=function(){return this._lineCnt},t.prototype.getLineContent=function(t){return this._lastVisitedLine.lineNumber===t?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=t,t===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(t):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(t,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(t).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)},t.prototype.getLineCharCode=function(t,e){var n=this.nodeAt2(t,e+1),i=this._buffers[n.node.piece.bufferIndex],o=this.offsetInBuffer(n.node.piece.bufferIndex,n.node.piece.start)+e;return i.buffer.charCodeAt(o)},t.prototype.getLineLength=function(t){if(t===this.getLineCount()){var e=this.getOffsetAt(t,1);return this.getLength()-e}return this.getOffsetAt(t+1,1)-this.getOffsetAt(t,1)-this._EOLLength},t.prototype.insert=function(t,e,n){if(void 0===n&&(n=!1),this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value=null,this.root!==K){var i=this.nodeAt(t),o=i.node,r=i.remainder,s=i.nodeStartOffset,a=(p=o.piece).bufferIndex,u=this.positionInBuffer(o,r);if(0===o.piece.bufferIndex&&p.end.line===this._lastChangeBufferPos.line&&p.end.column===this._lastChangeBufferPos.column&&s+p.length===t)return this.appendToNode(o,e),void this.computeBufferMetadata();if(s===t)this.insertContentToNodeLeft(e,o),this._searchCache.valdiate(t);else if(s+o.piece.length>t){var c=[],l=new lt(p.bufferIndex,u,p.end,this.getLineFeedCnt(p.bufferIndex,u,p.end),this.offsetInBuffer(a,p.end)-this.offsetInBuffer(a,u));if(this.shouldCheckCRLF()&&this.endWithCR(e))if(10===this.nodeCharCodeAt(o,r)){var h={line:l.start.line+1,column:0};l.start=h,l.length-=1,l.lineFeedCnt=this.getLineFeedCnt(l.bufferIndex,l.start,l.end),e+="\n"}if(this.shouldCheckCRLF()&&this.startWithLF(e))if(13===this.nodeCharCodeAt(o,r-1)){var d=this.positionInBuffer(o,r-1);this.deleteNodeTail(o,d),e="\r"+e,0===o.piece.length&&c.push(o)}else this.deleteNodeTail(o,u);else this.deleteNodeTail(o,u);var f=this.createNewPiece(e);l.length>0&&this.rbInsertRight(o,l),this.rbInsertRight(o,f),this.deleteNodes(c)}else this.insertContentToNodeRight(e,o)}else{var p=this.createNewPiece(e);this.rbInsertLeft(null,p)}this.computeBufferMetadata()},t.prototype.delete=function(t,e){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value=null,!(e<=0||this.root===K)){var n=this.nodeAt(t),i=this.nodeAt(t+e),o=n.node,r=i.node;if(o===r){var s=this.positionInBuffer(o,n.remainder),a=this.positionInBuffer(o,i.remainder);if(n.nodeStartOffset===t){if(e===o.piece.length){var u=o.next();return it(this,o),this.validateCRLFWithPrevNode(u),void this.computeBufferMetadata()}return this.deleteNodeHead(o,a),this._searchCache.valdiate(t),this.validateCRLFWithPrevNode(o),void this.computeBufferMetadata()}return n.nodeStartOffset+o.piece.length===t+e?(this.deleteNodeTail(o,s),this.validateCRLFWithNextNode(o),void this.computeBufferMetadata()):(this.shrinkNode(o,s,a),void this.computeBufferMetadata())}var c=[],l=this.positionInBuffer(o,n.remainder);this.deleteNodeTail(o,l),this._searchCache.valdiate(t),0===o.piece.length&&c.push(o);var h=this.positionInBuffer(r,i.remainder);this.deleteNodeHead(r,h),0===r.piece.length&&c.push(r);for(var d=o.next();d!==K&&d!==r;d=d.next())c.push(d);var f=0===o.piece.length?o.prev():o;this.deleteNodes(c),this.validateCRLFWithNextNode(f),this.computeBufferMetadata()}},t.prototype.insertContentToNodeLeft=function(t,e){var n=[];if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.startWithLF(e)){var i=e.piece,o={line:i.start.line+1,column:0};i.start=o,i.lineFeedCnt=this.getLineFeedCnt(i.bufferIndex,i.start,i.end),i.length-=1,t+="\n",rt(this,e,-1,-1),0===e.piece.length&&n.push(e)}var r=this.createNewPiece(t),s=this.rbInsertLeft(e,r);this.validateCRLFWithPrevNode(s),this.deleteNodes(n)},t.prototype.insertContentToNodeRight=function(t,e){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");var n=this.createNewPiece(t),i=this.rbInsertRight(e,n);this.validateCRLFWithPrevNode(i)},t.prototype.positionInBuffer=function(t,e){for(var n,i,o,r=t.piece,s=t.piece.bufferIndex,a=this._buffers[s].lineStarts,u=a[r.start.line]+r.start.column+e,c=r.start.line,l=r.end.line;c<=l&&(o=a[n=c+(l-c)/2|0],n!==l);)if(i=a[n+1],u=i))break;c=n+1}return{line:n,column:u-o}},t.prototype.getLineFeedCnt=function(t,e,n){if(0===n.column)return n.line-e.line;var i=this._buffers[t].lineStarts;if(n.line===i.length-1)return n.line-e.line;var o=i[n.line+1],r=i[n.line]+n.column;if(o>r+1)return n.line-e.line;var s=r-1;return 13===this._buffers[t].buffer.charCodeAt(s)?n.line-e.line+1:n.line-e.line},t.prototype.offsetInBuffer=function(t,e){return this._buffers[t].lineStarts[e.line]+e.column},t.prototype.deleteNodes=function(t){for(var e=0;e=t-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>t-1){r=this.getAccumulatedValue(n,t-n.lf_left-2),u=this.getAccumulatedValue(n,t-n.lf_left-1),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return c+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:c,nodeStartLineNumber:l-(t-1-n.lf_left)}),s.substring(a+r,a+u-e)}if(n.lf_left+n.piece.lineFeedCnt===t-1){r=this.getAccumulatedValue(n,t-n.lf_left-2),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);i=s.substring(a+r,a+n.piece.length);break}t-=n.lf_left+n.piece.lineFeedCnt,c+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==K;){s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){u=this.getAccumulatedValue(n,0),a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i+=s.substring(a,a+u-e)}a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);i+=s.substr(a,n.piece.length),n=n.next()}return i},t.prototype.computeBufferMetadata=function(){for(var t=this.root,e=1,n=0;t!==K;)e+=t.lf_left+t.piece.lineFeedCnt,n+=t.size_left+t.piece.length,t=t.right;this._lineCnt=e,this._length=n,this._searchCache.valdiate(this._length)},t.prototype.getIndexOf=function(t,e){var n=t.piece,i=this.positionInBuffer(t,e),o=i.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===e){var r=this.getLineFeedCnt(t.piece.bufferIndex,n.start,i);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:i.column}},t.prototype.getAccumulatedValue=function(t,e){if(e<0)return 0;var n=t.piece,i=this._buffers[n.bufferIndex].lineStarts,o=n.start.line+e+1;return o>n.end.line?i[n.end.line]+n.end.column-i[n.start.line]-n.start.column:i[o]-i[n.start.line]-n.start.column},t.prototype.deleteNodeTail=function(t,e){var n=t.piece,i=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.end);n.end=e;var r=this.offsetInBuffer(n.bufferIndex,n.end);n.lineFeedCnt=this.getLineFeedCnt(n.bufferIndex,n.start,n.end);var s=n.lineFeedCnt-i,a=r-o;n.length+=a,rt(this,t,a,s)},t.prototype.deleteNodeHead=function(t,e){var n=t.piece,i=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.start);n.start=e,n.lineFeedCnt=this.getLineFeedCnt(n.bufferIndex,n.start,n.end);var r=this.offsetInBuffer(n.bufferIndex,n.start),s=n.lineFeedCnt-i,a=o-r;n.length+=a,rt(this,t,a,s)},t.prototype.shrinkNode=function(t,e,n){var i=t.piece,o=i.start,r=i.end,s=i.length,a=i.lineFeedCnt;i.end=e,i.lineFeedCnt=this.getLineFeedCnt(i.bufferIndex,i.start,i.end);var u=this.offsetInBuffer(i.bufferIndex,e)-this.offsetInBuffer(i.bufferIndex,o),c=i.lineFeedCnt;i.length=u,rt(this,t,u-s,c-a);var l=new lt(i.bufferIndex,n,r,this.getLineFeedCnt(i.bufferIndex,n,r),this.offsetInBuffer(i.bufferIndex,r)-this.offsetInBuffer(i.bufferIndex,n)),h=this.rbInsertRight(t,l);this.validateCRLFWithPrevNode(h)},t.prototype.appendToNode=function(t,e){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");var n=this.shouldCheckCRLF()&&this.startWithLF(e)&&this.endWithCR(t),i=this._buffers[0].buffer.length;this._buffers[0].buffer+=e;for(var o=ct(e,!1),r=0;rt)e=e.left;else{if(e.size_left+e.piece.length>=t){i+=e.size_left;var o={node:e,remainder:t-e.size_left,nodeStartOffset:i};return this._searchCache.set(o),o}t-=e.size_left+e.piece.length,i+=e.size_left+e.piece.length,e=e.right}return null},t.prototype.nodeAt2=function(t,e){for(var n=this.root,i=0;n!==K;)if(n.left!==K&&n.lf_left>=t-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>t-1){var o=this.getAccumulatedValue(n,t-n.lf_left-2),r=this.getAccumulatedValue(n,t-n.lf_left-1);return i+=n.size_left,{node:n,remainder:Math.min(o+e-1,r),nodeStartOffset:i}}if(n.lf_left+n.piece.lineFeedCnt===t-1){if((o=this.getAccumulatedValue(n,t-n.lf_left-2))+e-1<=n.piece.length)return{node:n,remainder:o+e-1,nodeStartOffset:i};e-=n.piece.length-o;break}t-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==K;){if(n.piece.lineFeedCnt>0){r=this.getAccumulatedValue(n,0);var s=this.offsetOfNode(n);return{node:n,remainder:Math.min(e-1,r),nodeStartOffset:s}}if(n.piece.length>=e-1)return{node:n,remainder:e-1,nodeStartOffset:this.offsetOfNode(n)};e-=n.piece.length,n=n.next()}return null},t.prototype.nodeCharCodeAt=function(t,e){if(t.piece.lineFeedCnt<1)return-1;var n=this._buffers[t.piece.bufferIndex],i=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start)+e;return n.buffer.charCodeAt(i)},t.prototype.offsetOfNode=function(t){if(!t)return 0;for(var e=t.size_left;t!==this.root;)t.parent.right===t&&(e+=t.parent.size_left+t.parent.piece.length),t=t.parent;return e},t.prototype.shouldCheckCRLF=function(){return!(this._EOLNormalized&&"\n"===this._EOL)},t.prototype.startWithLF=function(t){if("string"==typeof t)return 10===t.charCodeAt(0);if(t===K||0===t.piece.lineFeedCnt)return!1;var e=t.piece,n=this._buffers[e.bufferIndex].lineStarts,i=e.start.line,o=n[i]+e.start.column;return i!==n.length-1&&(!(n[i+1]>o+1)&&10===this._buffers[e.bufferIndex].buffer.charCodeAt(o))},t.prototype.endWithCR=function(t){return"string"==typeof t?13===t.charCodeAt(t.length-1):t!==K&&0!==t.piece.lineFeedCnt&&13===this.nodeCharCodeAt(t,t.piece.length-1)},t.prototype.validateCRLFWithPrevNode=function(t){if(this.shouldCheckCRLF()&&this.startWithLF(t)){var e=t.prev();this.endWithCR(e)&&this.fixCRLF(e,t)}},t.prototype.validateCRLFWithNextNode=function(t){if(this.shouldCheckCRLF()&&this.endWithCR(t)){var e=t.next();this.startWithLF(e)&&this.fixCRLF(t,e)}},t.prototype.fixCRLF=function(t,e){var n=[],i=this._buffers[t.piece.bufferIndex].lineStarts;if(0===t.piece.end.column){var o={line:t.piece.end.line-1,column:i[t.piece.end.line]-i[t.piece.end.line-1]-1};t.piece.end=o}else{o={line:t.piece.end.line,column:t.piece.end.column-1};t.piece.end=o}t.piece.length-=1,t.piece.lineFeedCnt-=1,rt(this,t,-1,-1),0===t.piece.length&&n.push(t);var r={line:e.piece.start.line+1,column:0};e.piece.start=r,e.piece.length-=1,e.piece.lineFeedCnt=this.getLineFeedCnt(e.piece.bufferIndex,e.piece.start,e.piece.end),rt(this,e,-1,-1),0===e.piece.length&&n.push(e);var s=this.createNewPiece("\r\n");this.rbInsertRight(t,s);for(var a=0;a0){g.sort(function(t,e){return e.lineNumber-t.lineNumber}),C=[];u=0;for(var w=g.length;u0&&g[u-1].lineNumber===v)){var L=g[u].oldContent,S=this.getLineContent(v);0!==S.length&&S!==L&&-1===d.firstNonWhitespaceIndex(S)&&C.push(v)}}}return new r.a(y,b,C)},t.prototype._reduceOperations=function(t){return t.length<1e3?t:[this._toSingleEditOperation(t)]},t.prototype._toSingleEditOperation=function(t){for(var e=!1,n=t[0].range,i=t[t.length-1].range,o=new c.a(n.startLineNumber,n.startColumn,i.endLineNumber,i.endColumn),s=n.startLineNumber,a=n.startColumn,u=[],l=0,h=t.length;l0){var d=a.lines.length,f=a.lines[0],p=a.lines[d-1];h=1===d?new c.a(u,l,u,l+f.length):new c.a(u,l,u+d-1,p.length+1)}else h=new c.a(u,l,u,l);e=h.endLineNumber,n=h.endColumn,i.push(h),o=a}return i},t._sortOpsAscending=function(t,e){var n=c.a.compareRangesUsingEnds(t.range,e.range);return 0===n?t.sortIndex-e.sortIndex:n},t._sortOpsDescending=function(t,e){var n=c.a.compareRangesUsingEnds(t.range,e.range);return 0===n?e.sortIndex-t.sortIndex:-n},t}(),mt=function(){function t(t,e,n,i,o,r,s,a){this._chunks=t,this._bom=e,this._cr=n,this._lf=i,this._crlf=o,this._containsRTL=r,this._isBasicASCII=s,this._normalizeEOL=a}return t.prototype._getEOL=function(t){var e=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return 0===e?t===r.b.LF?"\n":"\r\n":n>e/2?"\r\n":"\n"},t.prototype.create=function(t){var e=this._getEOL(t),n=this._chunks;if(this._normalizeEOL&&("\r\n"===e&&(this._cr>0||this._lf>0)||"\n"===e&&(this._cr>0||this._crlf>0)))for(var i=0,o=n.length;i=55296&&e<=56319?(this._acceptChunk1(t.substr(0,t.length-1),!1),this._hasPreviousChar=!0,this._previousChar=e):(this._acceptChunk1(t,!1),this._hasPreviousChar=!1,this._previousChar=e)}},t.prototype._acceptChunk1=function(t,e){(e||0!==t.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+t):this._acceptChunk2(t))},t.prototype._acceptChunk2=function(t){var e=function(t,e){t.length=0,t[0]=0;for(var n=1,i=0,o=0,r=0,s=!0,a=0,u=e.length;a126)&&(s=!1)}var l=new ut(at(t),i,o,r,s);return t.length=0,l}(this._tmpLineStarts,t);this.chunks.push(new ht(t,e.lineStarts)),this.cr+=e.cr,this.lf+=e.lf,this.crlf+=e.crlf,this.isBasicASCII&&(this.isBasicASCII=e.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=d.containsRTL(t))},t.prototype.finish=function(t){return void 0===t&&(t=!0),this._finish(),new mt(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.isBasicASCII,t)},t.prototype._finish=function(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;var t=this.chunks[this.chunks.length-1];t.buffer+=String.fromCharCode(this._previousChar);var e=ct(t.buffer);t.lineStarts=e,13===this._previousChar&&this.cr++}},t}(),_t=function(){return function(t,e,n){this.start=t,this.length=e,this.text=n}}(),yt=function(){function t(t,e){void 0===e&&(e=null),this._str=t,this._lineStarts=null===e?function(t){for(var e=[],n=0,i=0,o=t.length;i=0;e--){var n=this._str.charCodeAt(e);if(13===n||10===n)return-2;if(32!==n&&9!==n)return e}return-1},t.normalizeEOL=function(e,n){return new t(e._str.replace(/\r\n|\r|\n/g,n))},t.deleteLastChar=function(e){var n,i=e.length(),o=e.newLineCount(),r=e._lineStarts;n=o>0&&r[o-1]===i?o-1:o;var s=new Uint32Array(n);return s.set(r),new t(e._str.substr(0,i-1),s)},t.insertFirstChar=function(e,n){var i=e.newLineCount(),o=e._lineStarts,r=13===n&&(0===i||1!==o[0]||10!==e.charCodeAt(0))||10===n,s=new Uint32Array(r?i+1:i);if(r){s[0]=1;for(var a=0;ao?i:l,_=0,y="",b=0,C=u.length;b=v&&(r.push(new t(y)),v=l>o?i:l,_=0,y="");var M=(g=L-S)<(m=v-_)?g:m;if(y+=w.substr(S,M),S+=M,l-=M,(_+=M)===v&&l>0){var N=y.charCodeAt(v-1);(13===N||55296<=N&&N<=56319)&&(v-=1,S-=1,_-=1,l+=1,y=y.substr(0,y.length-1))}}}r.push(new t(y))}},t}();function bt(t){var e=new Uint32Array(t.length);return e.set(t,0),e}var Ct=function(){return function(t,e,n,i,o){this.lineStarts=t,this.cr=e,this.lf=n,this.crlf=i,this.isBasicASCII=o}}();var wt=function(){function t(t,e,n,i,o,r){this._BOM=n;var s=Math.floor(Math.min(65536,Math.max(128,e))),a=s-Math.floor(s/3),u=2*a;this._actual=new Tt(t,a,u,i),this._mightContainRTL=o,this._mightContainNonBasicASCII=!r}return t.prototype.equals=function(e){return e instanceof t&&this._actual.equals(e._actual)},t.prototype.mightContainRTL=function(){return this._mightContainRTL},t.prototype.mightContainNonBasicASCII=function(){return this._mightContainNonBasicASCII},t.prototype.getBOM=function(){return this._BOM},t.prototype.getEOL=function(){return this._actual.getEOL()},t.prototype.getOffsetAt=function(t,e){return this._actual.convertPositionToOffset(t,e)},t.prototype.getPositionAt=function(t){return this._actual.convertOffsetToPosition(t)},t.prototype.getRangeAt=function(t,e){return this._actual.convertOffsetLenToRange(t,e)},t.prototype.getValueInRange=function(t,e){if(t.isEmpty())return"";var n=this._actual.getValueInRange(t);switch(e){case r.c.TextDefined:return n;case r.c.LF:return"\n"===this.getEOL()?n:n.replace(/\r\n/g,"\n");case r.c.CRLF:return"\r\n"===this.getEOL()?n:n.replace(/\n/g,"\r\n")}return null},t.prototype.createSnapshot=function(t){return this._actual.createSnapshot(t?this._BOM:"")},t.prototype.getValueLengthInRange=function(t,e){if(t.isEmpty())return 0;var n=t.endLineNumber-t.startLineNumber,i=this._actual.getValueLengthInRange(t);switch(e){case r.c.TextDefined:return i;case r.c.LF:return"\n"===this.getEOL()?i:i-n;case r.c.CRLF:return"\r\n"===this.getEOL()?i:i+n}return 0},t.prototype.getLength=function(){return this._actual.getLength()},t.prototype.getLineCount=function(){return this._actual.getLineCount()},t.prototype.getLinesContent=function(){return this._actual.getLinesContent()},t.prototype.getLineContent=function(t){return this._actual.getLineContent(t)},t.prototype.getLineCharCode=function(t,e){return this._actual.getLineCharCode(t,e)},t.prototype.getLineLength=function(t){return this._actual.getLineLength(t)},t.prototype.getLineFirstNonWhitespaceColumn=function(t){var e=this._actual.getLineFirstNonWhitespaceIndex(t);return-1===e?0:e+1},t.prototype.getLineLastNonWhitespaceColumn=function(t){var e=this._actual.getLineLastNonWhitespaceIndex(t);return-1===e?0:e+1},t.prototype.setEOL=function(t){this.getEOL()!==t&&this._actual.setEOL(t)},t._sortOpsAscending=function(t,e){var n=c.a.compareRangesUsingEnds(t.range,e.range);return 0===n?t.sortIndex-e.sortIndex:n},t._sortOpsDescending=function(t,e){var n=c.a.compareRangesUsingEnds(t.range,e.range);return 0===n?e.sortIndex-t.sortIndex:-n},t.prototype.applyEdits=function(e,n){if(0===e.length)return new r.a([],[],[]);for(var i=this._mightContainRTL,o=this._mightContainNonBasicASCII,s=!0,a=[],u=0;u0){g.sort(function(t,e){return e.lineNumber-t.lineNumber}),C=[];u=0;for(var w=g.length;u0&&g[u-1].lineNumber===v)){var L=g[u].oldContent,S=this.getLineContent(v);0!==S.length&&S!==L&&-1===d.firstNonWhitespaceIndex(S)&&C.push(v)}}}return new r.a(y,b,C)},t.prototype._reduceOperations=function(t){return t.length<1e3?t:[this._toSingleEditOperation(t)]},t.prototype._toSingleEditOperation=function(t){for(var e=!1,n=t[0].range,i=t[t.length-1].range,o=new c.a(n.startLineNumber,n.startColumn,i.endLineNumber,i.endColumn),s=n.startLineNumber,a=n.startColumn,u=[],l=0,h=t.length;l0){var d=a.lines.length,f=a.lines[0],p=a.lines[d-1];h=1===d?new c.a(u,l,u,l+f.length):new c.a(u,l,u+d-1,p.length+1)}else h=new c.a(u,l,u,l);e=h.endLineNumber,n=h.endColumn,i.push(h),o=a}return i},t}(),Lt=function(){return function(t){this.length=new Uint32Array(t),this.newLineCount=new Uint32Array(t)}}(),St=function(){function t(t,e,n,i){this.offset=t,this.leafIndex=e,this.leafStartOffset=n,this.leafStartNewLineCount=i}return t.prototype.set=function(t,e,n,i){this.offset=t,this.leafIndex=e,this.leafStartOffset=n,this.leafStartNewLineCount=i},t}(),Mt=function(){return function(t,e,n,i){this.initialIndex=t,this.offset=e,this.length=n,this.text=i}}(),Nt=function(){return function(t,e,n,i,o){this.startLeafIndex=t,this.startInnerOffset=e,this.endLeafIndex=n,this.endInnerOffset=i,this.text=o}}(),It=function(){return function(t,e,n){this.startLeafIndex=t,this.endLeafIndex=e,this.replacements=n}}(),Et=10,xt=new(function(){function t(){this._pool=[];for(var t=0;tthis._pool.length||(this._pool[this._len++]=t)},t.prototype.take=function(){if(0===this._len)return console.log("insufficient BufferCursor pool"),new St(0,0,0,0);var t=this._pool[this._len-1];return this._pool[this._len--]=null,t},t}()),Dt=function(){function t(t,e){this._pieces=t,this._piecesLength=this._pieces.length,this._BOM=e,this._piecesIndex=0}return t.prototype.read=function(){if(this._piecesIndex>=this._piecesLength)return null;var t=null;return t=0===this._piecesIndex?this._BOM+this._pieces[this._piecesIndex].text:this._pieces[this._piecesIndex].text,this._piecesIndex++,t},t}(),Tt=function(){function t(t,e,n,i){if(!(2*e>=n))throw new Error("assertion violation");this._minLeafLength=e,this._maxLeafLength=n,this._idealLeafLength=e+n>>>1,this._eol=i,this._eolLength=this._eol.length,this._leafs=t,this._nodes=null,this._nodesCount=0,this._leafsStart=0,this._leafsEnd=0,this._rebuildNodes()}return t.prototype.equals=function(e){return t.equals(this,e)},t.equals=function(t,e){var n=t.getLength();if(n!==e.getLength())return!1;if(t.getLineCount()!==e.getLineCount())return!1;for(var i=n,o=-1,r=null,s=0,a=0,u=-1,c=null,l=0,h=0;i>0;){0===a&&(o++,a=s=(r=t._leafs[o]).length()),0===h&&(u++,h=l=(c=e._leafs[u]).length());var d=Math.min(a,h);if(r.substr(s-a,d)!==c.substr(l-h,d))return!1;i-=d,a-=d,h-=d}return!0},t.prototype.getEOL=function(){return this._eol},t.prototype._rebuildNodes=function(){var t=this._leafs.length;this._nodesCount=1<=t)return n}(t),this._leafsStart=this._nodesCount,this._leafsEnd=this._leafsStart+t,this._nodes=new Lt(this._nodesCount);for(var e=this._nodesCount-1;e>=1;e--)this._updateSingleNode(e)},t.prototype._updateSingleNode=function(t){var e=Ot(t),n=At(t),i=0,o=0;if(this.IS_NODE(e))i+=this._nodes.length[e],o+=this._nodes.newLineCount[e];else if(this.IS_LEAF(e)){i+=(r=this._leafs[this.NODE_TO_LEAF_INDEX(e)]).length(),o+=r.newLineCount()}if(this.IS_NODE(n))i+=this._nodes.length[n],o+=this._nodes.newLineCount[n];else if(this.IS_LEAF(n)){var r;i+=(r=this._leafs[this.NODE_TO_LEAF_INDEX(n)]).length(),o+=r.newLineCount()}this._nodes.length[t]=i,this._nodes.newLineCount[t]=o},t.prototype._findOffset=function(t,e){if(t>this._nodes.length[1])return!1;for(var n=1,i=t,o=0,r=0;!this.IS_LEAF(n);){var s=Ot(n),a=At(n),u=0,c=0;if(this.IS_NODE(s))u=this._nodes.newLineCount[s],c=this._nodes.length[s];else if(this.IS_LEAF(s)){var l=this._leafs[this.NODE_TO_LEAF_INDEX(s)];u=l.newLineCount(),c=l.length()}var h=0;this.IS_NODE(a)?h+=this._nodes.length[a]:this.IS_LEAF(a)&&(h+=this._leafs[this.NODE_TO_LEAF_INDEX(a)].length()),ithis._nodes.length[1])return!1;for(var i=t-e.leafStartOffset,o=this._leafs.length,r=e.leafIndex,s=e.leafStartOffset,a=e.leafStartNewLineCount;;){var u=this._leafs[r];if(i=o)return n.set(t,r,s,a),!0;s+=u.length(),a+=u.newLineCount(),i-=u.length()}},t.prototype._findLineStart=function(t,e){var n=t-1;if(n<0||n>this._nodes.newLineCount[1])return e.set(0,0,0,0),!1;for(var i=1,o=0,r=0;!this.IS_LEAF(i);){var s=Ot(i),a=At(i),u=0,c=0;if(this.IS_NODE(s))u=this._nodes.newLineCount[s],c=this._nodes.length[s];else if(this.IS_LEAF(s)){var l=this._leafs[this.NODE_TO_LEAF_INDEX(s)];u=l.newLineCount(),c=l.length()}n<=u?i=s:(n-=u,o+=c,r+=u,i=a)}i=this.NODE_TO_LEAF_INDEX(i);var h=0===n?0:this._leafs[i].lineStartFor(n-1);return e.set(o+h,i,o,r),!0},t.prototype._findLineEnd=function(t,e,n){for(var i=e-1-t.leafStartNewLineCount,o=this._leafs.length,r=t.leafIndex,s=t.leafStartOffset,a=t.leafStartNewLineCount;;){var u=this._leafs[r];if(i=o)return void n.set(s+u.length(),r-1,s,a);s+=u.length(),a+=u.newLineCount(),i=0}},t.prototype._findLine=function(t,e,n){return!!this._findLineStart(t,e)&&(this._findLineEnd(e,t,n),!0)},t.prototype.getLength=function(){return this._nodes.length[1]},t.prototype.getLineCount=function(){return this._nodes.newLineCount[1]+1},t.prototype.getLineContent=function(t){var e,n=xt.take(),i=xt.take();if(!this._findLine(t,n,i))throw xt.put(n),xt.put(i),new Error("Line not found");return e=t===this.getLineCount()?this.extractString(n,i.offset-n.offset):this.extractString(n,i.offset-n.offset-this._eolLength),xt.put(n),xt.put(i),e},t.prototype.getLineCharCode=function(t,e){var n=xt.take();if(!this._findLineStart(t,n))throw xt.put(n),new Error("Line not found");var i=xt.take();this._findOffsetCloseAfter(n.offset+e,n,i);var o=this._leafs[i.leafIndex].charCodeAt(i.offset-i.leafStartNewLineCount);return xt.put(i),xt.put(n),o},t.prototype.getLineLength=function(t){var e,n=xt.take(),i=xt.take();if(!this._findLine(t,n,i))throw xt.put(n),xt.put(i),new Error("Line not found");return e=t===this.getLineCount()?i.offset-n.offset:i.offset-n.offset-this._eolLength,xt.put(n),xt.put(i),e},t.prototype.getLineFirstNonWhitespaceIndex=function(t){var e=xt.take();if(!this._findLineStart(t,e))throw xt.put(e),new Error("Line not found");var n=e.leafIndex,i=e.offset-e.leafStartOffset;xt.put(e);for(var o=this._leafs.length,r=0;;){var s=this._leafs[n],a=s.findLineFirstNonWhitespaceIndex(i);if(-2===a)return-1;if(-1!==a)return a-i+r;if(++n>=o)return-1;r+=s.length()-i,i=0}},t.prototype.getLineLastNonWhitespaceIndex=function(t){var e=xt.take(),n=xt.take();if(!this._findLineStart(t,e))throw xt.put(e),xt.put(n),new Error("Line not found");this._findLineEnd(e,t,n);var i=e.offset,o=n.offset,r=n.leafIndex,s=n.offset-n.leafStartOffset-this._eolLength;xt.put(e),xt.put(n);for(var a=0;;){var u=this._leafs[r],c=u.findLineLastNonWhitespaceIndex(s);if(-2===c)return-1;if(-1!==c){var l=s-1-c;return o-this._eolLength-l-a-i}if(--r<0)return-1;a+=s,s=u.length()}},t.prototype.getLinesContent=function(){for(var t=new Array(this.getLineCount()),e=0,n="",i=0,o=this._leafs.length;i0;){var r=this._leafs[i],s=Math.min(e,r.length()-n);if(o+=r.substr(n,s),n=0,0===(e-=s))break;i++}return o},t.prototype._getOffsetAt=function(t,e,n){var i=xt.take();if(!this._findLineStart(t,i))return xt.put(i),!1;var o=i.offset+e-1;return this._findOffsetCloseAfter(o,i,n)?(xt.put(i),!0):(xt.put(i),!1)},t.prototype.convertPositionToOffset=function(t,e){var n=xt.take();if(!this._findLineStart(t,n))throw xt.put(n),new Error("Position not found");var i=n.offset+e-1;return xt.put(n),i},t.prototype._findLineStartBeforeOffsetInLeaf=function(t,e,n,i,o){var r=this._leafs[e],s=r.findLineStartBeforeOffset(t-n),a=n+r.lineStartFor(s);return o.set(a,e,n,i),i+s+2},t.prototype._findLineStartBeforeOffset=function(t,e,n){for(var i=e.leafIndex,o=e.leafStartOffset,r=e.leafStartNewLineCount;;){var s=this._leafs[i];if(s.newLineCount()>=1&&s.lineStartFor(0)+o<=t)return this._findLineStartBeforeOffsetInLeaf(t,i,o,r,n);if(--i<0)return n.set(0,0,0,0),1;o-=this._leafs[i].length(),r-=this._leafs[i].newLineCount()}},t.prototype.convertOffsetToPosition=function(t){var e=xt.take(),n=xt.take();if(!this._findOffset(t,e))throw xt.put(e),xt.put(n),new Error("Offset not found");var i=this._findLineStartBeforeOffset(t,e,n),o=t-n.offset+1;return xt.put(e),xt.put(n),new C.a(i,o)},t.prototype.convertOffsetLenToRange=function(t,e){var n=xt.take(),i=xt.take();if(!this._findOffset(t,n))throw xt.put(n),xt.put(i),new Error("Offset not found");var o=this._findLineStartBeforeOffset(t,n,i),r=t-i.offset+1;if(!this._findOffset(t+e,n))throw xt.put(n),xt.put(i),new Error("Offset not found");var s=this._findLineStartBeforeOffset(t+e,n,i),a=t+e-i.offset+1;return xt.put(n),xt.put(i),new c.a(o,r,s,a)},t.prototype.getValueInRange=function(t){var e=xt.take();if(!this._getOffsetAt(t.startLineNumber,t.startColumn,e))throw xt.put(e),new Error("Line not found");var n=this.convertPositionToOffset(t.endLineNumber,t.endColumn),i=this.extractString(e,n-e.offset);return xt.put(e),i},t.prototype.createSnapshot=function(t){return new Dt(this._leafs,t)},t.prototype.getValueLengthInRange=function(t){var e=this.convertPositionToOffset(t.startLineNumber,t.startColumn);return this.convertPositionToOffset(t.endLineNumber,t.endColumn)-e},t.prototype._mergeAdjacentEdits=function(t){for(var e=[],n=0,i=t[0],o=1,r=t.length;o0)13===this._leafs[u].charCodeAt(c-1)&&(a="\r"+a,this._findOffsetCloseAfter(s.offset-1,n,i),u=i.leafIndex,c=i.offset-i.leafStartOffset);this._findOffset(s.offset+s.length,n);var l=n.leafIndex,h=n.offset-n.leafStartOffset,d=this._leafs[l];if(h0){var i=this._pushLeafReplacement(t,t,n);yt.replaceOffsetLen(this._leafs[t],e,this._idealLeafLength,this._maxLeafLength,i.replacements)}e.length=0},t.prototype._pushLeafEdits=function(t,e,n,i){0===e&&0===n.length||i.push(new _t(t,e,n))},t.prototype._appendLeaf=function(t,e,n){if(null===n)return e.push(t),n=t;var i=n.length(),o=t.length();if((i=55296&&s<=56319||13===s&&10===a){var u=yt.deleteLastChar(n);e[e.length-1]=u,t=yt.insertFirstChar(t,s)}return e.push(t),n=t},t._compareEdits=function(t,e){return t.offset===e.offset?t.length===e.length?t.initialIndex-e.initialIndex:t.length-e.length:t.offset-e.offset},t.prototype.replaceOffsetLen=function(e){e.sort(t._compareEdits);for(var n=this._leafs.length,i=this._resolveEdits(e),o=0,r=[],s=[],a=0,u=i.length;a=this._leafsStart&&te/2?"\r\n":"\n"},t.prototype.create=function(t){var e=this._getEOL(t),n=this._pieces;if("\r\n"===e&&(this._cr>0||this._lf>0)||"\n"===e&&(this._cr>0||this._crlf>0))for(var i=0,o=n.length;i=55296&&e<=56319?(this._acceptChunk1(t.substr(0,t.length-1),!1),this._hasPreviousChar=!0,this._previousChar=e):(this._acceptChunk1(t,!1),this._hasPreviousChar=!1,this._previousChar=e)}},t.prototype._acceptChunk1=function(t,e){(e||0!==t.length)&&(this._hasPreviousChar?this._acceptChunk2(t+String.fromCharCode(this._previousChar)):this._acceptChunk2(t))},t.prototype._acceptChunk2=function(t){var e=function(t,e){t.length=0;for(var n=0,i=0,o=0,r=0,s=!0,a=0,u=e.length;a126)&&(s=!1)}var l=new Ct(bt(t),i,o,r,s);return t.length=0,l}(this._tmpLineStarts,t);this._rawPieces.push(new yt(t,e.lineStarts)),this.cr+=e.cr,this.lf+=e.lf,this.crlf+=e.crlf,this.isBasicASCII&&(this.isBasicASCII=e.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=d.containsRTL(t))},t.prototype.finish=function(){return this._finish(),new kt(this._rawPieces,this._averageChunkSize,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.isBasicASCII)},t.prototype._finish=function(){if(0!==this._rawPieces.length){if(this._hasPreviousChar){this._hasPreviousChar=!1;var t=this._rawPieces[this._rawPieces.length-1],e=new yt(String.fromCharCode(this._previousChar)),n=yt.join(t,e);this._rawPieces[this._rawPieces.length-1]=n,13===this._previousChar&&this.cr++}}else this._acceptChunk1("",!0)},t}();n.d(e,"c",function(){return Bt}),n.d(e,"b",function(){return Yt}),n.d(e,"a",function(){return Kt});var Rt,Pt,Wt=(Rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}Rt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){t[t.LinesArray=0]="LinesArray",t[t.PieceTree=1]="PieceTree",t[t.Chunks=2]="Chunks"}(Pt||(Pt={}));var zt={TEXT_BUFFER_IMPLEMENTATION:Pt.PieceTree};function Ft(){return zt.TEXT_BUFFER_IMPLEMENTATION===Pt.PieceTree?new vt:zt.TEXT_BUFFER_IMPLEMENTATION===Pt.Chunks?new jt:new G}function Bt(t,e){var n,i;return("string"==typeof t?(n=t,(i=Ft()).acceptChunk(n),i.finish()):t).create(e)}var Vt=0;var Ht=function(){function t(t){this._source=t,this._eos=!1}return t.prototype.read=function(){if(this._eos)return null;for(var t=[],e=0,n=0;;){var i=this._source.read();if(null===i)return this._eos=!0,0===e?null:t.join("");if(i.length>0&&(t[e++]=i,n+=i.length),n>=65536)return t.join("")}},t}(),Yt=function(t){function e(n,a,l,h){void 0===h&&(h=null);var d=t.call(this)||this;d._onWillDispose=d._register(new o.a),d.onWillDispose=d._onWillDispose.event,d._onDidChangeDecorations=d._register(new Jt),d.onDidChangeDecorations=d._onDidChangeDecorations.event,d._onDidChangeLanguage=d._register(new o.a),d.onDidChangeLanguage=d._onDidChangeLanguage.event,d._onDidChangeLanguageConfiguration=d._register(new o.a),d.onDidChangeLanguageConfiguration=d._onDidChangeLanguageConfiguration.event,d._onDidChangeTokens=d._register(new o.a),d.onDidChangeTokens=d._onDidChangeTokens.event,d._onDidChangeOptions=d._register(new o.a),d.onDidChangeOptions=d._onDidChangeOptions.event,d._eventEmitter=d._register(new $t),Vt++,d.id="$model"+Vt,d._associatedResource=void 0===h||null===h?i.a.parse("inmemory://model/"+Vt):h,d._attachedEditorCount=0,d._buffer=Bt(n,a.defaultEOL),d._options=e.resolveOptions(d._buffer,a);var f,p=d._buffer.getLineCount(),g=d._buffer.getValueLengthInRange(new c.a(1,1,p,d._buffer.getLineLength(p)+1),r.c.TextDefined);return d._isTooLargeForTokenization=g>e.MODEL_TOKENIZATION_LIMIT||p>e.MANY_MANY_LINES,d._shouldSimplifyMode=d._isTooLargeForTokenization||g>e.MODEL_SYNC_LIMIT,d._setVersionId(1),d._isDisposed=!1,d._isDisposing=!1,d._languageIdentifier=l||_.a,d._tokenizationListener=s.v.onDidChange(function(t){-1!==t.changedLanguages.indexOf(d._languageIdentifier.language)&&(d._resetTokenizationState(),d.emitModelTokensChangedEvent({ranges:[{fromLineNumber:1,toLineNumber:d.getLineCount()}]}),d._shouldAutoTokenize()&&d._warmUpTokens())}),d._revalidateTokensTimeout=-1,d._languageRegistryListener=w.a.onDidChange(function(t){t.languageIdentifier.id===d._languageIdentifier.id&&d._onDidChangeLanguageConfiguration.fire({})}),d._resetTokenizationState(),d._instanceId=(f=Vt,(f%=52)<26?String.fromCharCode(97+f):String.fromCharCode(65+f-26)),d._lastDecorationId=0,d._decorations=Object.create(null),d._decorationsTree=new Ut,d._commandManager=new u(d),d._isUndoing=!1,d._isRedoing=!1,d._trimAutoWhitespaceLines=null,d}return Wt(e,t),e.createFromString=function(t,n,i,o){return void 0===n&&(n=e.DEFAULT_CREATION_OPTIONS),void 0===i&&(i=null),void 0===o&&(o=null),new e(t,n,i,o)},e.resolveOptions=function(t,e){if(e.detectIndentation){var n=O(t,e.tabSize,e.insertSpaces);return new r.g({tabSize:n.tabSize,insertSpaces:n.insertSpaces,trimAutoWhitespace:e.trimAutoWhitespace,defaultEOL:e.defaultEOL})}return new r.g({tabSize:e.tabSize,insertSpaces:e.insertSpaces,trimAutoWhitespace:e.trimAutoWhitespace,defaultEOL:e.defaultEOL})},e.prototype.onDidChangeRawContent=function(t){return this._eventEmitter.event(function(e){return t(e.rawContentChangedEvent)})},e.prototype.onDidChangeContent=function(t){return this._eventEmitter.event(function(e){return t(e.contentChangedEvent)})},e.prototype.dispose=function(){this._isDisposing=!0,this._onWillDispose.fire(),this._commandManager=null,this._decorations=null,this._decorationsTree=null,this._tokenizationListener.dispose(),this._languageRegistryListener.dispose(),this._clearTimers(),this._tokens=null,this._isDisposed=!0,this._buffer=null,t.prototype.dispose.call(this),this._isDisposing=!1},e.prototype._assertNotDisposed=function(){if(this._isDisposed)throw new Error("Model is disposed!")},e.prototype.equalsTextBuffer=function(t){return this._assertNotDisposed(),this._buffer.equals(t)},e.prototype._emitContentChangedEvent=function(t,e){this._isDisposing||this._eventEmitter.fire(new h.a(t,e))},e.prototype.setValue=function(t){if(this._assertNotDisposed(),null!==t){var e=Bt(t,this._options.defaultEOL);this.setValueFromTextBuffer(e)}},e.prototype._createContentChanged2=function(t,e,n,i,o,r,s,a,u){return{changes:[{range:new c.a(t,e,n,i),rangeLength:o,text:r}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:s,isRedoing:a,isFlush:u}},e.prototype.setValueFromTextBuffer=function(t){if(this._assertNotDisposed(),null!==t){var e=this.getFullModelRange(),n=this.getValueLengthInRange(e),i=this.getLineCount(),o=this.getLineMaxColumn(i);this._buffer=t,this._increaseVersionId(),this._resetTokenizationState(),this._decorations=Object.create(null),this._decorationsTree=new Ut,this._commandManager=new u(this),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new h.b([new h.d],this._versionId,!1,!1),this._createContentChanged2(1,1,i,o,n,this.getValue(),!1,!1,!0))}},e.prototype.setEOL=function(t){this._assertNotDisposed();var e=t===r.d.CRLF?"\r\n":"\n";if(this._buffer.getEOL()!==e){var n=this.getFullModelRange(),i=this.getValueLengthInRange(n),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(e),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new h.b([new h.c],this._versionId,!1,!1),this._createContentChanged2(1,1,o,s,i,this.getValue(),!1,!1,!1))}},e.prototype._onBeforeEOLChange=function(){var t=this.getVersionId(),e=this._decorationsTree.search(0,!1,!1,t);this._ensureNodesHaveRanges(e)},e.prototype._onAfterEOLChange=function(){for(var t=this.getVersionId(),e=this._decorationsTree.collectNodesPostOrder(),n=0,i=e.length;n0},e.prototype.isTooLargeForHavingARichMode=function(){return this._shouldSimplifyMode},e.prototype.isTooLargeForTokenization=function(){return this._isTooLargeForTokenization},e.prototype.isDisposed=function(){return this._isDisposed},e.prototype.isDominatedByLongLines=function(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;for(var t=0,e=0,n=this._buffer.getLineCount(),i=1;i<=n;i++){var o=this._buffer.getLineLength(i);o>=1e4?e+=o:t+=o}return e>t},Object.defineProperty(e.prototype,"uri",{get:function(){return this._associatedResource},enumerable:!0,configurable:!0}),e.prototype.getOptions=function(){return this._assertNotDisposed(),this._options},e.prototype.updateOptions=function(t){this._assertNotDisposed();var e=void 0!==t.tabSize?t.tabSize:this._options.tabSize,n=void 0!==t.insertSpaces?t.insertSpaces:this._options.insertSpaces,i=void 0!==t.trimAutoWhitespace?t.trimAutoWhitespace:this._options.trimAutoWhitespace,o=new r.g({tabSize:e,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:i});if(!this._options.equals(o)){var s=this._options.createChangeEvent(o);this._options=o,this._onDidChangeOptions.fire(s)}},e.prototype.detectIndentation=function(t,e){this._assertNotDisposed();var n=O(this._buffer,e,t);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize})},e._normalizeIndentationFromWhitespace=function(t,e,n){for(var i=0,o=0;othis.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(t)},e.prototype.getLinesContent=function(){return this._assertNotDisposed(),this._buffer.getLinesContent()},e.prototype.getEOL=function(){return this._assertNotDisposed(),this._buffer.getEOL()},e.prototype.getLineMinColumn=function(t){return this._assertNotDisposed(),1},e.prototype.getLineMaxColumn=function(t){if(this._assertNotDisposed(),t<1||t>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(t)+1},e.prototype.getLineFirstNonWhitespaceColumn=function(t){if(this._assertNotDisposed(),t<1||t>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(t)},e.prototype.getLineLastNonWhitespaceColumn=function(t){if(this._assertNotDisposed(),t<1||t>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(t)},e.prototype._validateRangeRelaxedNoAllocations=function(t){var e,n,i=this._buffer.getLineCount(),o=t.startLineNumber,r=t.startColumn;if(o<1)e=1,n=1;else if(o>i)e=i,n=this.getLineMaxColumn(e);else{if(e=0|o,r<=1)n=1;else n=r>=(d=this.getLineMaxColumn(e))?d:0|r}var s,a,u=t.endLineNumber,h=t.endColumn;if(u<1)s=1,a=1;else if(u>i)s=i,a=this.getLineMaxColumn(s);else{var d;if(s=0|u,h<=1)a=1;else a=h>=(d=this.getLineMaxColumn(s))?d:0|h}return o===e&&r===n&&u===s&&h===a&&t instanceof c.a&&!(t instanceof l.a)?t:new c.a(e,n,s,a)},e.prototype._validatePosition=function(t,e,n){var i=Math.floor("number"==typeof t?t:1),o=Math.floor("number"==typeof e?e:1),r=this._buffer.getLineCount();if(i<1)return new C.a(1,1);if(i>r)return new C.a(r,this.getLineMaxColumn(r));if(o<=1)return new C.a(i,1);var s=this.getLineMaxColumn(i);if(o>=s)return new C.a(i,s);if(n){var a=this._buffer.getLineCharCode(i,o-2);if(d.isHighSurrogate(a))return new C.a(i,o-1)}return new C.a(i,o)},e.prototype.validatePosition=function(t){return this._assertNotDisposed(),this._validatePosition(t.lineNumber,t.column,!0)},e.prototype.validateRange=function(t){this._assertNotDisposed();var e=this._validatePosition(t.startLineNumber,t.startColumn,!1),n=this._validatePosition(t.endLineNumber,t.endColumn,!1),i=e.lineNumber,o=e.column,r=n.lineNumber,s=n.column,a=o>1?this._buffer.getLineCharCode(i,o-2):0,u=s>1&&s<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,s-2):0,l=d.isHighSurrogate(a),h=d.isHighSurrogate(u);return l||h?i===r&&o===s?new c.a(i,o-1,r,s-1):l&&h?new c.a(i,o-1,r,s+1):l?new c.a(i,o-1,r,s):new c.a(i,o,r,s+1):new c.a(i,o,r,s)},e.prototype.modifyPosition=function(t,e){this._assertNotDisposed();var n=this.getOffsetAt(t)+e;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))},e.prototype.getFullModelRange=function(){this._assertNotDisposed();var t=this.getLineCount();return new c.a(1,1,t,this.getLineMaxColumn(t))},e.prototype.findMatches=function(t,e,n,i,o,r,s){var a;return void 0===s&&(s=999),this._assertNotDisposed(),a=c.a.isIRange(e)?this.validateRange(e):this.getFullModelRange(),W.findMatches(this,new j(t,n,i,o),a,r,s)},e.prototype.findNextMatch=function(t,e,n,i,o,r){this._assertNotDisposed();var s=this.validatePosition(e);return W.findNextMatch(this,new j(t,n,i,o),s,r)},e.prototype.findPreviousMatch=function(t,e,n,i,o,r){this._assertNotDisposed();var s=this.validatePosition(e);return W.findPreviousMatch(this,new j(t,n,i,o),s,r)},e.prototype.pushStackElement=function(){this._commandManager.pushStackElement()},e.prototype.pushEditOperations=function(t,e,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(t,e,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},e.prototype._pushEditOperations=function(t,e,n){var i=this;if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){for(var o=e.map(function(t){return{range:i.validateRange(t.range),text:t.text}}),r=!0,s=0,a=t.length;su.endLineNumber,p=u.startLineNumber>_.endLineNumber;if(!f&&!p){l=!0;break}}if(!l){r=!1;break}}if(r)for(s=0,a=this._trimAutoWhitespaceLines.length;s_.endLineNumber)&&!(g===_.startLineNumber&&_.startColumn===m&&_.isEmpty()&&y&&y.length>0&&"\n"===y.charAt(0))){v=!1;break}}v&&e.push({range:new c.a(g,1,g,m),text:null})}this._trimAutoWhitespaceLines=null}return this._commandManager.pushEditOperation(t,e,n)},e.prototype.applyEdits=function(t){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._applyEdits(t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},e._eolCount=function(t){for(var e=0,n=0,i=0,o=t.length;i=0;C--){var w=g+C,L=s-c-b+w;u.push(new h.e(w,this.getLineContent(L)))}if(ythis.getLineCount()?[]:this.getLinesDecorations(t,t,e,n)},e.prototype.getLinesDecorations=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=this.getLineCount(),r=Math.min(o,Math.max(1,t)),s=Math.min(o,Math.max(1,e)),a=this.getLineMaxColumn(s);return this._getDecorationsInRange(new c.a(r,1,s,a),n,i)},e.prototype.getDecorationsInRange=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var i=this.validateRange(t);return this._getDecorationsInRange(i,e,n)},e.prototype.getOverviewRulerDecorations=function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var n=this.getVersionId(),i=this._decorationsTree.search(t,e,!0,n);return this._ensureNodesHaveRanges(i)},e.prototype.getAllDecorations=function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var n=this.getVersionId(),i=this._decorationsTree.search(t,e,!1,n);return this._ensureNodesHaveRanges(i)},e.prototype._getDecorationsInRange=function(t,e,n){var i=this._buffer.getOffsetAt(t.startLineNumber,t.startColumn),o=this._buffer.getOffsetAt(t.endLineNumber,t.endColumn),r=this.getVersionId(),s=this._decorationsTree.intervalSearch(i,o,e,n,r);return this._ensureNodesHaveRanges(s)},e.prototype._ensureNodesHaveRanges=function(t){for(var e=0,n=t.length;ethis.getLineCount())throw new Error("Illegal value for lineNumber");var e=new D;this._tokens._updateTokensUntilLine(this._buffer,e,t);var n=e.build();n&&this._onDidChangeTokens.fire(n)},e.prototype.isCheapToTokenize=function(t){return this._tokens.isCheapToTokenize(t)},e.prototype.tokenizeIfCheap=function(t){this.isCheapToTokenize(t)&&this.forceTokenization(t)},e.prototype.getLineTokens=function(t){if(t<1||t>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(t)},e.prototype._getLineTokens=function(t){var e=this._buffer.getLineContent(t);return this._tokens.getTokens(this._languageIdentifier.id,t-1,e)},e.prototype.getLanguageIdentifier=function(){return this._languageIdentifier},e.prototype.getModeId=function(){return this._languageIdentifier.language},e.prototype.setMode=function(t){if(this._languageIdentifier.id!==t.id){var e={oldLanguage:this._languageIdentifier.language,newLanguage:t.language};this._languageIdentifier=t,this._resetTokenizationState(),this.emitModelTokensChangedEvent({ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]}),this._onDidChangeLanguage.fire(e),this._onDidChangeLanguageConfiguration.fire({})}},e.prototype.getLanguageIdAtPosition=function(t,e){if(!this._tokens.tokenizationSupport)return this._languageIdentifier.id;var n=this.validatePosition({lineNumber:t,column:e}),i=n.lineNumber,o=n.column,r=this._getLineTokens(i);return r.getLanguageId(r.findTokenIndexAtOffset(o-1))},e.prototype._beginBackgroundTokenization=function(){var t=this;this._shouldAutoTokenize()&&-1===this._revalidateTokensTimeout&&(this._revalidateTokensTimeout=setTimeout(function(){t._revalidateTokensTimeout=-1,t._revalidateTokensNow()},0))},e.prototype._warmUpTokens=function(){var t=Math.min(100,this.getLineCount());this._revalidateTokensNow(t),this._tokens.hasLinesToTokenize(this._buffer)&&this._beginBackgroundTokenization()},e.prototype._revalidateTokensNow=function(t){void 0===t&&(t=this._buffer.getLineCount());for(var e=new D,n=v.create(!1);this._tokens.hasLinesToTokenize(this._buffer)&&!(n.elapsed()>20);){if(this._tokens._tokenizeOneLine(this._buffer,e)>=t)break}this._tokens.hasLinesToTokenize(this._buffer)&&this._beginBackgroundTokenization();var i=e.build();i&&this._onDidChangeTokens.fire(i)},e.prototype.emitModelTokensChangedEvent=function(t){this._isDisposing||this._onDidChangeTokens.fire(t)},e.prototype.getWordAtPosition=function(t){this._assertNotDisposed();for(var e,n,i=this.validatePosition(t),o=this.getLineContent(i.lineNumber),r=this._getLineTokens(i.lineNumber),s=i.column-1,a=r.findTokenIndexAtOffset(s),u=r.getLanguageId(a),c=a;c>=0&&r.getLanguageId(c)===u;c--)e=r.getStartOffset(c);c=a;for(var l=r.getCount();c0&&n.getStartOffset(o)===t.column-1){a=n.getStartOffset(o);o--;var c=w.a.getBracketsSupport(n.getLanguageId(o));if(c&&!Object(y.b)(n.getStandardTokenType(o))){var l,h,d;s=Math.max(n.getStartOffset(o),t.column-1-c.maxBracketLength);if((l=b.a.findPrevBracketInToken(c.reversedRegex,e,i,s,a))&&l.startColumn<=t.column&&t.column<=l.endColumn)if(h=(h=i.substring(l.startColumn-1,l.endColumn-1)).toLowerCase(),d=this._matchFoundBracket(l,c.textIsBracket[h],c.textIsOpenBracket[h]))return d}}return null},e.prototype._matchFoundBracket=function(t,e,n){var i;if(n){if(i=this._findMatchingBracketDown(e,t.getEndPosition()))return[t,i]}else if(i=this._findMatchingBracketUp(e,t.getStartPosition()))return[t,i];return null},e.prototype._findMatchingBracketUp=function(t,e){for(var n=t.languageIdentifier.id,i=t.reversedRegex,o=-1,r=e.lineNumber;r>=1;r--){var s=this._getLineTokens(r),a=s.getCount(),u=this._buffer.getLineContent(r),c=a-1,l=-1;for(r===e.lineNumber&&(c=s.findTokenIndexAtOffset(e.column-1),l=e.column-1);c>=0;c--){var h=s.getLanguageId(c),d=s.getStandardTokenType(c),f=s.getStartOffset(c),p=s.getEndOffset(c);if(-1===l&&(l=p),h===n&&!Object(y.b)(d))for(;;){var g=b.a.findPrevBracketInToken(i,r,u,f,l);if(!g)break;var m=u.substring(g.startColumn-1,g.endColumn-1);if((m=m.toLowerCase())===t.open?o++:m===t.close&&o--,0===o)return g;l=g.startColumn-1}l=-1}}return null},e.prototype._findMatchingBracketDown=function(t,e){for(var n=t.languageIdentifier.id,i=t.forwardRegex,o=1,r=e.lineNumber,s=this.getLineCount();r<=s;r++){var a=this._getLineTokens(r),u=a.getCount(),c=this._buffer.getLineContent(r),l=0,h=0;for(r===e.lineNumber&&(l=a.findTokenIndexAtOffset(e.column-1),h=e.column-1);l=1;o--){var r=this._getLineTokens(o),s=r.getCount(),a=this._buffer.getLineContent(o),u=s-1,c=-1;for(o===e.lineNumber&&(u=r.findTokenIndexAtOffset(e.column-1),c=e.column-1);u>=0;u--){var l=r.getLanguageId(u),h=r.getStandardTokenType(u),d=r.getStartOffset(u),f=r.getEndOffset(u);if(-1===c&&(c=f),n!==l&&(n=l,i=w.a.getBracketsSupport(n)),i&&!Object(y.b)(h)){var p=b.a.findPrevBracketInToken(i.reversedRegex,o,a,d,c);if(p)return this._toFoundBracket(i,p)}c=-1}}return null},e.prototype.findNextBracket=function(t){for(var e=this.validatePosition(t),n=-1,i=null,o=e.lineNumber,r=this.getLineCount();o<=r;o++){var s=this._getLineTokens(o),a=s.getCount(),u=this._buffer.getLineContent(o),c=0,l=0;for(o===e.lineNumber&&(c=s.findTokenIndexAtOffset(e.column-1),l=e.column-1);cn)throw new Error("Illegal value for startLineNumber");if(e<1||e>n)throw new Error("Illegal value for endLineNumber");for(var i=w.a.getFoldingRules(this._languageIdentifier.id),o=i&&i.offSide,r=new Array(e-t+1),s=-2,a=-1,u=-2,c=-1,l=t;l<=e;l++){var h=l-t,d=this._computeIndentLevel(l-1);if(d>=0)s=l-1,a=d,r[h]=Math.ceil(d/this._options.tabSize);else{if(-2===s){s=-1,a=-1;for(var f=l-2;f>=0;f--){if((p=this._computeIndentLevel(f))>=0){s=f,a=p;break}}}if(-1!==u&&(-2===u||u=0){u=f,c=p;break}}}r[h]=-1===a||-1===c?0:a0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(t):this._deferredEvent=t:this._actual.fire(t)},e}(p.a)},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return s});var i=n(19),o=n(20),r=Object(i.c)("codeEditorService");function s(t){var e=function(t){if(t){var e=t.getControl();if(e){if(Object(o.d)(e))return{codeEditor:e,diffEditor:null};if(Object(o.e)(e))return{codeEditor:null,diffEditor:e}}}return{codeEditor:null,diffEditor:null}}(t);return e.codeEditor||e.diffEditor&&e.diffEditor.getModifiedEditor()||null}},function(t,e,n){"use strict";n.d(e,"b",function(){return m}),n.d(e,"a",function(){return L});n(247);var i,o=n(8),r=n(10),s=n(7),a=n(4),u=n(62),c=n(0),l=(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});var h={withElementById:function(t,e){u.a(r.h(t),"Expected String as parameter");var n=document.getElementById(t);return n?new m(n,e):null}},d="_msDataKey",f=function(){return function(t,e){this.width=t,this.height=e}}();function p(t){return t[d]||(t[d]={}),t[d]}function g(t){return!!t[d]}var m=function(){function t(t,e){this.offdom=e,this.container=t,this.currentElement=t,this.createdElements=[],this.toUnbind={},this.captureToUnbind={}}return t.prototype.asContainer=function(){return _(this,this.offdom)},t.prototype.clone=function(){var e=new t(this.container,this.offdom);return e.currentElement=this.currentElement,e.createdElements=this.createdElements,e.captureToUnbind=this.captureToUnbind,e.toUnbind=this.toUnbind,e},t.prototype.build=function(e,n){u.a(this.offdom,"This builder was not created off-dom, so build() can not be called."),e?e instanceof t&&(e=e.getHTMLElement()):e=this.container,u.a(e,"Builder can only be build() with a container provided."),u.a(c.y(e),"The container must either be a HTMLElement or a Builder.");var i,o,s=e,a=s.childNodes;if(r.f(n)&&n=0){var n=t.split("-");t=n[0];for(var i=1;i=0){var e=t.split("-");t=e[0];for(var n=1;n=0?this.padding.apply(this,t.split(" ")):(r.j(t)||(this.currentElement.style.paddingTop=this.toPixel(t)),r.j(e)||(this.currentElement.style.paddingRight=this.toPixel(e)),r.j(n)||(this.currentElement.style.paddingBottom=this.toPixel(n)),r.j(i)||(this.currentElement.style.paddingLeft=this.toPixel(i)),this)},t.prototype.margin=function(t,e,n,i){return r.h(t)&&t.indexOf(" ")>=0?this.margin.apply(this,t.split(" ")):(r.j(t)||(this.currentElement.style.marginTop=this.toPixel(t)),r.j(e)||(this.currentElement.style.marginRight=this.toPixel(e)),r.j(n)||(this.currentElement.style.marginBottom=this.toPixel(n)),r.j(i)||(this.currentElement.style.marginLeft=this.toPixel(i)),this)},t.prototype.position=function(t,e,n,i,o){return r.h(t)&&t.indexOf(" ")>=0?this.position.apply(this,t.split(" ")):(r.j(t)||(this.currentElement.style.top=this.toPixel(t)),r.j(e)||(this.currentElement.style.right=this.toPixel(e)),r.j(n)||(this.currentElement.style.bottom=this.toPixel(n)),r.j(i)||(this.currentElement.style.left=this.toPixel(i)),o||(o="absolute"),this.currentElement.style.position=o,this)},t.prototype.size=function(t,e){return r.h(t)&&t.indexOf(" ")>=0?this.size.apply(this,t.split(" ")):(r.j(t)||(this.currentElement.style.width=this.toPixel(t)),r.j(e)||(this.currentElement.style.height=this.toPixel(e)),this)},t.prototype.minSize=function(t,e){return r.h(t)&&t.indexOf(" ")>=0?this.minSize.apply(this,t.split(" ")):(r.j(t)||(this.currentElement.style.minWidth=this.toPixel(t)),r.j(e)||(this.currentElement.style.minHeight=this.toPixel(e)),this)},t.prototype.maxSize=function(t,e){return r.h(t)&&t.indexOf(" ")>=0?this.maxSize.apply(this,t.split(" ")):(r.j(t)||(this.currentElement.style.maxWidth=this.toPixel(t)),r.j(e)||(this.currentElement.style.maxHeight=this.toPixel(e)),this)},t.prototype.display=function(t){return this.currentElement.style.display=t,this},t.prototype.show=function(){return this.hasClass("builder-hidden")&&this.removeClass("builder-hidden"),this.attr("aria-hidden","false"),this.cancelVisibilityPromise(),this},t.prototype.showDelayed=function(t){var e=this;this.cancelVisibilityPromise();var n=o.b.timeout(t);return this.setProperty("__$visibility",n),n.done(function(){e.removeProperty("__$visibility"),e.show()}),this},t.prototype.hide=function(){return this.hasClass("builder-hidden")||this.addClass("builder-hidden"),this.attr("aria-hidden","true"),this.cancelVisibilityPromise(),this},t.prototype.isHidden=function(){return this.hasClass("builder-hidden")||"none"===this.currentElement.style.display},t.prototype.cancelVisibilityPromise=function(){var t=this.getProperty("__$visibility");t&&(t.cancel(),this.removeProperty("__$visibility"))},t.prototype.border=function(t,e,n){return r.h(t)&&t.indexOf(" ")>=0?this.border.apply(this,t.split(" ")):(this.currentElement.style.borderWidth=this.toPixel(t),n&&(this.currentElement.style.borderColor=n),e&&(this.currentElement.style.borderStyle=e),this)},t.prototype.borderTop=function(t,e,n){return r.h(t)&&t.indexOf(" ")>=0?this.borderTop.apply(this,t.split(" ")):(this.currentElement.style.borderTopWidth=this.toPixel(t),n&&(this.currentElement.style.borderTopColor=n),e&&(this.currentElement.style.borderTopStyle=e),this)},t.prototype.borderBottom=function(t,e,n){return r.h(t)&&t.indexOf(" ")>=0?this.borderBottom.apply(this,t.split(" ")):(this.currentElement.style.borderBottomWidth=this.toPixel(t),n&&(this.currentElement.style.borderBottomColor=n),e&&(this.currentElement.style.borderBottomStyle=e),this)},t.prototype.borderLeft=function(t,e,n){return r.h(t)&&t.indexOf(" ")>=0?this.borderLeft.apply(this,t.split(" ")):(this.currentElement.style.borderLeftWidth=this.toPixel(t),n&&(this.currentElement.style.borderLeftColor=n),e&&(this.currentElement.style.borderLeftStyle=e),this)},t.prototype.borderRight=function(t,e,n){return r.h(t)&&t.indexOf(" ")>=0?this.borderRight.apply(this,t.split(" ")):(this.currentElement.style.borderRightWidth=this.toPixel(t),n&&(this.currentElement.style.borderRightColor=n),e&&(this.currentElement.style.borderRightStyle=e),this)},t.prototype.toPixel=function(t){return-1===t.toString().indexOf("px")?t.toString()+"px":t},t.prototype.innerHtml=function(t,e){return e?this.currentElement.innerHTML+=t:this.currentElement.innerHTML=t,this},t.prototype.text=function(t,e){return e?0===this.currentElement.children.length?this.currentElement.textContent+=t:this.currentElement.appendChild(document.createTextNode(t)):this.currentElement.textContent=t,this},t.prototype.safeInnerHtml=function(t,e){return this.innerHtml(a.escape(t),e)},t.prototype.setProperty=function(t,e){return C(this.currentElement,t,e),this},t.prototype.getProperty=function(t,e){return function(t,e,n){if(g(t)){var i=p(t)[e];if(!r.i(i))return i}return n}(this.currentElement,t,e)},t.prototype.removeProperty=function(t){return g(this.currentElement)&&delete p(this.currentElement)[t],this},t.prototype.child=function(t){return void 0===t&&(t=0),y(this.currentElement.children.item(t))},t.prototype.unbindDescendants=function(t){if(t&&t.children)for(var e=0,n=t.children.length;ee.getLineMinColumn(n)?i.a.isLowSurrogate(e,n,o-2)?o-=2:o-=1:n>1&&(n-=1,o=e.getLineMaxColumn(n)),new s(n,o,0)},t.moveLeft=function(e,n,i,o,r){var s,a;if(i.hasSelection()&&!o)s=i.selection.startLineNumber,a=i.selection.startColumn;else{var u=t.left(e,n,i.position.lineNumber,i.position.column-(r-1));s=u.lineNumber,a=u.column}return i.move(o,s,a,0)},t.right=function(t,e,n,o){return ol?(n=l,u?o=e.getLineMaxColumn(n):(o=Math.min(e.getLineMaxColumn(n),o),i.a.isInsideSurrogatePair(e,n,o)&&(o-=1))):(o=i.a.columnFromVisibleColumn2(t,e,n,c),i.a.isInsideSurrogatePair(e,n,o)&&(o-=1)),r=c-i.a.visibleColumnFromColumn(e.getLineContent(n),o,t.tabSize),new s(n,o,r)},t.moveDown=function(e,n,i,o,r){var s,a;i.hasSelection()&&!o?(s=i.selection.endLineNumber,a=i.selection.endColumn):(s=i.position.lineNumber,a=i.position.column);var u=t.down(e,n,s,a,i.leftoverVisibleColumns,r,!0);return i.move(o,u.lineNumber,u.column,u.leftoverVisibleColumns)},t.translateDown=function(e,n,s){var a=s.selection,u=t.down(e,n,a.selectionStartLineNumber,a.selectionStartColumn,s.selectionStartLeftoverVisibleColumns,1,!1),c=t.down(e,n,a.positionLineNumber,a.positionColumn,s.leftoverVisibleColumns,1,!1);return new i.f(new r.a(u.lineNumber,u.column,u.lineNumber,u.column),u.leftoverVisibleColumns,new o.a(c.lineNumber,c.column),c.leftoverVisibleColumns)},t.up=function(t,e,n,o,r,a,u){var c=i.a.visibleColumnFromColumn(e.getLineContent(n),o,t.tabSize)+r;return(n-=a)<1?(n=1,u?o=e.getLineMinColumn(n):(o=Math.min(e.getLineMaxColumn(n),o),i.a.isInsideSurrogatePair(e,n,o)&&(o-=1))):(o=i.a.columnFromVisibleColumn2(t,e,n,c),i.a.isInsideSurrogatePair(e,n,o)&&(o-=1)),r=c-i.a.visibleColumnFromColumn(e.getLineContent(n),o,t.tabSize),new s(n,o,r)},t.moveUp=function(e,n,i,o,r){var s,a;i.hasSelection()&&!o?(s=i.selection.startLineNumber,a=i.selection.startColumn):(s=i.position.lineNumber,a=i.position.column);var u=t.up(e,n,s,a,i.leftoverVisibleColumns,r,!0);return i.move(o,u.lineNumber,u.column,u.leftoverVisibleColumns)},t.translateUp=function(e,n,s){var a=s.selection,u=t.up(e,n,a.selectionStartLineNumber,a.selectionStartColumn,s.selectionStartLeftoverVisibleColumns,1,!1),c=t.up(e,n,a.positionLineNumber,a.positionColumn,s.leftoverVisibleColumns,1,!1);return new i.f(new r.a(u.lineNumber,u.column,u.lineNumber,u.column),u.leftoverVisibleColumns,new o.a(c.lineNumber,c.column),c.leftoverVisibleColumns)},t.moveToBeginningOfLine=function(t,e,n,i){var o,r=n.position.lineNumber,s=e.getLineMinColumn(r),a=e.getLineFirstNonWhitespaceColumn(r)||s;return o=n.position.column===a?s:a,n.move(i,r,o,0)},t.moveToEndOfLine=function(t,e,n,i){var o=n.position.lineNumber,r=e.getLineMaxColumn(o);return n.move(i,o,r,0)},t.moveToBeginningOfBuffer=function(t,e,n,i){return n.move(i,1,1,0)},t.moveToEndOfBuffer=function(t,e,n,i){var o=e.getLineCount(),r=e.getLineMaxColumn(o);return n.move(i,o,r,0)},t}()},function(t,e,n){var i=n(92),o=Math.min;t.exports=function(t){return t>0?o(i(t),9007199254740991):0}},function(t,e,n){var i=n(31),o=n(220),r=n(94),s=Object.defineProperty;e.f=n(55)?Object.defineProperty:function(t,e,n){if(i(t),e=r(e,!0),i(n),o)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(38)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";n.d(e,"b",function(){return i}),n.d(e,"a",function(){return u}),n.d(e,"f",function(){return c}),n.d(e,"e",function(){return h}),n.d(e,"d",function(){return f}),n.d(e,"c",function(){return p});var i,o=function(){function t(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}return t.prototype.define=function(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t},t.prototype.keyCodeToStr=function(t){return this._keyCodeToStr[t]},t.prototype.strToKeyCode=function(t){return this._strToKeyCode[t.toLowerCase()]||0},t}(),r=new o,s=new o,a=new o;function u(t,e){return(t|(65535&e)<<16>>>0)>>>0}function c(t,e){if(0===t)return null;var n=(65535&t)>>>0,i=(4294901760&t)>>>16;return 0!==i?new d(l(n,e),l(i,e)):l(n,e)}function l(t,e){var n=!!(2048&t),i=!!(256&t);return new h(2===e?i:n,!!(1024&t),!!(512&t),2===e?n:i,255&t)}!function(){function t(t,e,n,i){void 0===n&&(n=e),void 0===i&&(i=n),r.define(t,e),s.define(t,n),a.define(t,i)}t(0,"unknown"),t(1,"Backspace"),t(2,"Tab"),t(3,"Enter"),t(4,"Shift"),t(5,"Ctrl"),t(6,"Alt"),t(7,"PauseBreak"),t(8,"CapsLock"),t(9,"Escape"),t(10,"Space"),t(11,"PageUp"),t(12,"PageDown"),t(13,"End"),t(14,"Home"),t(15,"LeftArrow","Left"),t(16,"UpArrow","Up"),t(17,"RightArrow","Right"),t(18,"DownArrow","Down"),t(19,"Insert"),t(20,"Delete"),t(21,"0"),t(22,"1"),t(23,"2"),t(24,"3"),t(25,"4"),t(26,"5"),t(27,"6"),t(28,"7"),t(29,"8"),t(30,"9"),t(31,"A"),t(32,"B"),t(33,"C"),t(34,"D"),t(35,"E"),t(36,"F"),t(37,"G"),t(38,"H"),t(39,"I"),t(40,"J"),t(41,"K"),t(42,"L"),t(43,"M"),t(44,"N"),t(45,"O"),t(46,"P"),t(47,"Q"),t(48,"R"),t(49,"S"),t(50,"T"),t(51,"U"),t(52,"V"),t(53,"W"),t(54,"X"),t(55,"Y"),t(56,"Z"),t(57,"Meta"),t(58,"ContextMenu"),t(59,"F1"),t(60,"F2"),t(61,"F3"),t(62,"F4"),t(63,"F5"),t(64,"F6"),t(65,"F7"),t(66,"F8"),t(67,"F9"),t(68,"F10"),t(69,"F11"),t(70,"F12"),t(71,"F13"),t(72,"F14"),t(73,"F15"),t(74,"F16"),t(75,"F17"),t(76,"F18"),t(77,"F19"),t(78,"NumLock"),t(79,"ScrollLock"),t(80,";",";","OEM_1"),t(81,"=","=","OEM_PLUS"),t(82,",",",","OEM_COMMA"),t(83,"-","-","OEM_MINUS"),t(84,".",".","OEM_PERIOD"),t(85,"/","/","OEM_2"),t(86,"`","`","OEM_3"),t(110,"ABNT_C1"),t(111,"ABNT_C2"),t(87,"[","[","OEM_4"),t(88,"\\","\\","OEM_5"),t(89,"]","]","OEM_6"),t(90,"'","'","OEM_7"),t(91,"OEM_8"),t(92,"OEM_102"),t(93,"NumPad0"),t(94,"NumPad1"),t(95,"NumPad2"),t(96,"NumPad3"),t(97,"NumPad4"),t(98,"NumPad5"),t(99,"NumPad6"),t(100,"NumPad7"),t(101,"NumPad8"),t(102,"NumPad9"),t(103,"NumPad_Multiply"),t(104,"NumPad_Add"),t(105,"NumPad_Separator"),t(106,"NumPad_Subtract"),t(107,"NumPad_Decimal"),t(108,"NumPad_Divide")}(),function(t){t.toString=function(t){return r.keyCodeToStr(t)},t.fromString=function(t){return r.strToKeyCode(t)},t.toUserSettingsUS=function(t){return s.keyCodeToStr(t)},t.toUserSettingsGeneral=function(t){return a.keyCodeToStr(t)},t.fromUserSettings=function(t){return s.strToKeyCode(t)||a.strToKeyCode(t)}}(i||(i={}));var h=function(){function t(t,e,n,i,o){this.type=1,this.ctrlKey=t,this.shiftKey=e,this.altKey=n,this.metaKey=i,this.keyCode=o}return t.prototype.equals=function(t){return 1===t.type&&(this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode)},t.prototype.getHashCode=function(){return""+(this.ctrlKey?"1":"0")+(this.shiftKey?"1":"0")+(this.altKey?"1":"0")+(this.metaKey?"1":"0")+this.keyCode},t.prototype.isModifierKey=function(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode},t.prototype.isDuplicateModifierCase=function(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode},t}(),d=function(){function t(t,e){this.type=2,this.firstPart=t,this.chordPart=e}return t.prototype.getHashCode=function(){return this.firstPart.getHashCode()+";"+this.chordPart.getHashCode()},t}(),f=function(){return function(t,e,n,i,o,r){this.ctrlKey=t,this.shiftKey=e,this.altKey=n,this.metaKey=i,this.keyLabel=o,this.keyAriaLabel=r}}(),p=function(){return function(){}}()},function(t,e,n){"use strict";function i(t,e,n){var i=null,o=null;if("function"==typeof n.value?(i="value",o=n.value):"function"==typeof n.get&&(i="get",o=n.get),!o)throw new Error("not supported");var r="$memoize$"+e;n[i]=function(){for(var t=[],e=0;e0)n.left||(n.left=new c,n.left.str=i.value()),n=n.left;else if(o<0)n.right||(n.right=new c,n.right.str=i.value()),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new c,n.mid.str=i.value()),n=n.mid}}var r=n.element;return n.element=e,r},t.prototype.get=function(t){for(var e=this._iter.reset(t),n=this._root;n;){var i=e.cmp(n.str);if(i>0)n=n.left;else if(i<0)n=n.right;else{if(!e.hasNext())break;e.next(),n=n.mid}}return n?n.element:void 0},t.prototype.delete=function(t){for(var e=this._iter.reset(t),n=[],i=this._root;i;){var o=e.cmp(i.str);if(o>0)n.push([1,i]),i=i.left;else if(o<0)n.push([-1,i]),i=i.right;else{if(!e.hasNext()){for(i.element=void 0;n.length>0&&i.isEmpty();){var r=n.pop(),s=r[0],a=r[1];switch(s){case 1:a.left=void 0;break;case 0:a.mid=void 0;break;case-1:a.right=void 0}i=a}break}e.next(),n.push([0,i]),i=i.mid}}},t.prototype.findSubstr=function(t){for(var e,n=this._iter.reset(t),i=this._root;i;){var o=n.cmp(i.str);if(o>0)i=i.left;else if(o<0)i=i.right;else{if(!n.hasNext())break;n.next(),e=i.element||e,i=i.mid}}return i&&i.element||e},t.prototype.findSuperstr=function(e){for(var n=this._iter.reset(e),i=this._root;i;){var o=n.cmp(i.str);if(o>0)i=i.left;else if(o<0)i=i.right;else{if(!n.hasNext()){if(!i.mid)return;var r=new t(this._iter);return r._root=i.mid,r}n.next(),i=i.mid}}},t.prototype.forEach=function(t){this._forEach(this._root,[],t)},t.prototype._forEach=function(t,e,n){t&&(this._forEach(t.left,e,n),e.push(t.str),t.element&&n(t.element,this._iter.join(e)),this._forEach(t.mid,e,n),e.pop(),this._forEach(t.right,e,n))},t}(),h=function(t){function e(){return t.call(this)||this}return r(e,t),e.prototype.keys=function(){return(t=this.map,e=[],t.forEach(function(t,n){return e.push(n)}),e).map(function(t){return o.a.parse(t)});var t,e},e}(function(){function t(t){this.ignoreCase=t,this.map=new Map}return t.prototype.set=function(t,e){this.map.set(this.toKey(t),e)},t.prototype.get=function(t){return this.map.get(this.toKey(t))},t.prototype.has=function(t){return this.map.has(this.toKey(t))},Object.defineProperty(t.prototype,"size",{get:function(){return this.map.size},enumerable:!0,configurable:!0}),t.prototype.clear=function(){this.map.clear()},t.prototype.delete=function(t){return this.map.delete(this.toKey(t))},t.prototype.forEach=function(t){this.map.forEach(t)},t.prototype.values=function(){return t=this.map,e=[],t.forEach(function(t){return e.push(t)}),e;var t,e},t.prototype.toKey=function(t){var e=t.toString();return this.ignoreCase&&(e=e.toLowerCase()),e},t}());!function(t){t[t.None=0]="None",t[t.AsOld=1]="AsOld",t[t.AsNew=2]="AsNew"}(s||(s={}));var d=function(t){function e(e,n){void 0===n&&(n=1);var i=t.call(this)||this;return i._limit=e,i._ratio=Math.min(Math.max(0,n),1),i}return r(e,t),Object.defineProperty(e.prototype,"limit",{get:function(){return this._limit},set:function(t){this._limit=t,this.checkTrim()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ratio",{get:function(){return this._ratio},set:function(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()},enumerable:!0,configurable:!0}),e.prototype.get=function(e){return t.prototype.get.call(this,e,s.AsNew)},e.prototype.peek=function(e){return t.prototype.get.call(this,e,s.None)},e.prototype.set=function(e,n){t.prototype.set.call(this,e,n,s.AsNew),this.checkTrim()},e.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},e}(function(){function t(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return t.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},t.prototype.isEmpty=function(){return!this._head&&!this._tail},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.get=function(t,e){void 0===e&&(e=s.None);var n=this._map.get(t);if(n)return e!==s.None&&this.touch(n,e),n.value},t.prototype.set=function(t,e,n){void 0===n&&(n=s.None);var i=this._map.get(t);if(i)i.value=e,n!==s.None&&this.touch(i,n);else{switch(i={key:t,value:e,next:void 0,previous:void 0},n){case s.None:this.addItemLast(i);break;case s.AsOld:this.addItemFirst(i);break;case s.AsNew:default:this.addItemLast(i)}this._map.set(t,i),this._size++}},t.prototype.delete=function(t){return!!this.remove(t)},t.prototype.remove=function(t){var e=this._map.get(t);if(e)return this._map.delete(t),this.removeItem(e),this._size--,e.value},t.prototype.shift=function(){if(this._head||this._tail){if(!this._head||!this._tail)throw new Error("Invalid list");var t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}},t.prototype.forEach=function(t,e){for(var n=this._head;n;)e?t.bind(e)(n.value,n.key,this):t(n.value,n.key,this),n=n.next},t.prototype.values=function(){for(var t=[],e=this._head;e;)t.push(e.value),e=e.next;return t},t.prototype.keys=function(){for(var t=[],e=this._head;e;)t.push(e.key),e=e.next;return t},t.prototype.trimOld=function(t){if(!(t>=this.size))if(0!==t){for(var e=this._head,n=this.size;e&&n>t;)this._map.delete(e.key),e=e.next,n--;this._head=e,this._size=n,e.previous=void 0}else this.clear()},t.prototype.addItemFirst=function(t){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");t.next=this._head,this._head.previous=t}else this._tail=t;this._head=t},t.prototype.addItemLast=function(t){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");t.previous=this._tail,this._tail.next=t}else this._head=t;this._tail=t},t.prototype.removeItem=function(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head)this._head=t.next;else if(t===this._tail)this._tail=t.previous;else{var e=t.next,n=t.previous;if(!e||!n)throw new Error("Invalid list");e.previous=n,n.next=e}},t.prototype.touch=function(t,e){if(!this._head||!this._tail)throw new Error("Invalid list");if(e===s.AsOld||e===s.AsNew)if(e===s.AsOld){if(t===this._head)return;var n=t.next,i=t.previous;t===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t}else if(e===s.AsNew){if(t===this._tail)return;n=t.next,i=t.previous;t===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t}},t}())},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return c});var i,o=n(26),r=n(7),s=n(0),a=n(57),u=function(t,e,n,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(r<3?o(s):r>3?o(e,n,s):o(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};!function(t){t.Tap="-monaco-gesturetap",t.Change="-monaco-gesturechange",t.Start="-monaco-gesturestart",t.End="-monaco-gesturesend",t.Contextmenu="-monaco-gesturecontextmenu"}(i||(i={}));var c=function(){function t(){var t=this;this.toDispose=[],this.activeTouches={},this.handle=null,this.targets=[],this.toDispose.push(s.f(document,"touchstart",function(e){return t.onTouchStart(e)})),this.toDispose.push(s.f(document,"touchend",function(e){return t.onTouchEnd(e)})),this.toDispose.push(s.f(document,"touchmove",function(e){return t.onTouchMove(e)}))}return t.addTarget=function(e){t.isTouchDevice()&&(t.INSTANCE||(t.INSTANCE=new t),t.INSTANCE.targets.push(e))},t.isTouchDevice=function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0},t.prototype.dispose=function(){this.handle&&(this.handle.dispose(),Object(r.d)(this.toDispose),this.handle=null)},t.prototype.onTouchStart=function(t){var e=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(var n=0,o=t.targetTouches.length;n=t.HOLD_DELAY&&Math.abs(l.initialPageX-o.j(l.rollingPageX))<30&&Math.abs(l.initialPageY-o.j(l.rollingPageY))<30){var d;(d=a.newGestureEvent(i.Contextmenu,l.initialTarget)).pageX=o.j(l.rollingPageX),d.pageY=o.j(l.rollingPageY),a.dispatchEvent(d)}else if(1===r){var f=o.j(l.rollingPageX),p=o.j(l.rollingPageY),g=o.j(l.rollingTimestamps)-l.rollingTimestamps[0],m=f-l.rollingPageX[0],v=p-l.rollingPageY[0],_=a.targets.filter(function(t){return l.initialTarget instanceof Node&&t.contains(l.initialTarget)});a.inertia(_,n,Math.abs(m)/g,m>0?1:-1,f,Math.abs(v)/g,v>0?1:-1,p)}a.dispatchEvent(a.newGestureEvent(i.End,l.initialTarget)),delete a.activeTouches[c.identifier]},a=this,u=0,c=e.changedTouches.length;u0&&(g=!1,f=r*o*d),u>0&&(g=!1,p=c*u*d);var m=h.newGestureEvent(i.Change);m.translationX=f,m.translationY=p,e.forEach(function(t){return t.dispatchEvent(m)}),g||h.inertia(e,s,o,r,a+f,u,c,l+p)})},t.prototype.onTouchMove=function(t){for(var e=Date.now(),n=0,r=t.changedTouches.length;n3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(s.pageX),a.rollingPageY.push(s.pageY),a.rollingTimestamps.push(e)}else console.warn("end of an UNKNOWN touch",s)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)},t.SCROLL_FRICTION=-.005,t.HOLD_DELAY=700,u([a.a],t,"isTouchDevice",null),t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"d",function(){return l}),n.d(e,"b",function(){return f}),n.d(e,"c",function(){return g}),n.d(e,"e",function(){return M});var i={EditorInfoDecoration:"squiggly-a-info",EditorWarningDecoration:"squiggly-b-warning",EditorErrorDecoration:"squiggly-c-error"};function o(t){return(1&t.metadata)>>>0}function r(t,e){t.metadata=254&t.metadata|e<<0}function s(t){return(2&t.metadata)>>>1==1}function a(t,e){t.metadata=253&t.metadata|(e?1:0)<<1}function u(t){return(4&t.metadata)>>>2==1}function c(t,e){t.metadata=251&t.metadata|(e?1:0)<<2}function l(t){return(8&t.metadata)>>>3==1}function h(t,e){t.metadata=247&t.metadata|(e?1:0)<<3}function d(t,e){t.metadata=207&t.metadata|e<<4}var f=function(){function t(t,e,n){this.metadata=0,this.parent=null,this.left=null,this.right=null,r(this,1),this.start=e,this.end=n,this.delta=0,this.maxEnd=n,this.id=t,this.ownerId=0,this.options=null,c(this,!1),d(this,1),h(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=n,this.range=null,a(this,!1)}return t.prototype.reset=function(t,e,n,i){this.start=e,this.end=n,this.maxEnd=n,this.cachedVersionId=t,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=n,this.range=i},t.prototype.setOptions=function(t){this.options=t;var e=this.options.className;c(this,e===i.EditorErrorDecoration||e===i.EditorWarningDecoration||e===i.EditorInfoDecoration),d(this,this.options.stickiness),h(this,!!this.options.overviewRuler.color)},t.prototype.setCachedOffsets=function(t,e,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=e},t.prototype.detach=function(){this.parent=null,this.left=null,this.right=null},t}(),p=new f(null,0,0);p.parent=p,p.left=p,p.right=p,r(p,0);var g=function(){function t(){this.root=p,this.requestNormalizeDelta=!1}return t.prototype.intervalSearch=function(t,e,n,i,o){return this.root===p?[]:function(t,e,n,i,o,r){var c=t.root,l=0,h=0,d=0,f=[],g=0;for(;c!==p;)if(s(c))a(c.left,!1),a(c.right,!1),c===c.parent.right&&(l-=c.parent.delta),c=c.parent;else{if(!s(c.left)){if(l+c.maxEndn)a(c,!0);else{if((d=l+c.end)>=e){c.setCachedOffsets(h,d,r);var m=!0;i&&c.ownerId&&c.ownerId!==i&&(m=!1),o&&u(c)&&(m=!1),m&&(f[g++]=c)}a(c,!0),c.right===p||s(c.right)||(l+=c.delta,c=c.right)}}return a(t.root,!1),f}(this,t,e,n,i,o)},t.prototype.search=function(t,e,n){return this.root===p?[]:_(this,t,e,n)},t.prototype.collectNodesFromOwner=function(t){return function(t,e){var n=t.root,i=[],o=0;for(;n!==p;)s(n)?(a(n.left,!1),a(n.right,!1),n=n.parent):n.left===p||s(n.left)?(n.ownerId===e&&(i[o++]=n),a(n,!0),n.right===p||s(n.right)||(n=n.right)):n=n.left;return a(t.root,!1),i}(this,t)},t.prototype.collectNodesPostOrder=function(){return function(t){var e=t.root,n=[],i=0;for(;e!==p;)s(e)?(a(e.left,!1),a(e.right,!1),e=e.parent):e.left===p||s(e.left)?e.right===p||s(e.right)?(n[i++]=e,a(e,!0)):e=e.right:e=e.left;return a(t.root,!1),n}(this)},t.prototype.insert=function(t){y(this,t),this._normalizeDeltaIfNecessary()},t.prototype.delete=function(t){b(this,t),this._normalizeDeltaIfNecessary()},t.prototype.resolveNode=function(t,e){for(var n=t,i=0;t!==this.root;)t===t.parent.right&&(i+=t.parent.delta),t=t.parent;var o=n.start+i,r=n.end+i;n.setCachedOffsets(o,r,e)},t.prototype.acceptReplace=function(t,e,n,i){for(var o=function(t,e,n){var i=t.root,o=0,r=0,u=0,c=[],l=0;for(;i!==p;)if(s(i))a(i.left,!1),a(i.right,!1),i===i.parent.right&&(o-=i.parent.delta),i=i.parent;else{if(!s(i.left)){if(o+i.maxEndn?a(i,!0):((u=o+i.end)>=e&&(i.setCachedOffsets(r,u,0),c[l++]=i),a(i,!0),i.right===p||s(i.right)||(o+=i.delta,i=i.right))}return a(t.root,!1),c}(this,t,t+e),r=0,u=o.length;rn?(o.start+=u,o.end+=u,o.delta+=u,(o.delta<-1073741824||o.delta>1073741824)&&(t.requestNormalizeDelta=!0),a(o,!0)):(a(o,!0),o.right===p||s(o.right)||(r+=o.delta,o=o.right))}a(t.root,!1)}(this,t,t+e,n),this._normalizeDeltaIfNecessary();for(r=0,u=o.length;rn)&&(1!==i&&(2===i||e))}function v(t,e,n,i,o){var r=function(t){return(48&t.metadata)>>>4}(t),s=0===r||2===r,a=1===r||2===r,u=n-e,c=i,l=Math.min(u,c),h=t.start,d=!1,f=t.end,p=!1,g=o?1:u>0?2:0;if(!d&&m(h,s,e,g)&&(d=!0),!p&&m(f,a,e,g)&&(p=!0),l>0&&!o){g=u>c?2:0;!d&&m(h,s,e+l,g)&&(d=!0),!p&&m(f,a,e+l,g)&&(p=!0)}g=o?1:0;!d&&m(h,s,n,g)&&(t.start=e+c,d=!0),!p&&m(f,a,n,g)&&(t.end=e+c,p=!0);var v=c-u;d||(t.start=Math.max(0,h+v),d=!0),p||(t.end=Math.max(0,f+v),p=!0),t.start>t.end&&(t.end=t.start)}function _(t,e,n,i){for(var o=t.root,r=0,c=0,l=0,h=[],d=0;o!==p;)if(s(o))a(o.left,!1),a(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;else if(o.left===p||s(o.left)){c=r+o.start,l=r+o.end,o.setCachedOffsets(c,l,i);var f=!0;e&&o.ownerId&&o.ownerId!==e&&(f=!1),n&&u(o)&&(f=!1),f&&(h[d++]=o),a(o,!0),o.right===p||s(o.right)||(r+=o.delta,o=o.right)}else o=o.left;return a(t.root,!1),h}function y(t,e){if(t.root===p)return e.parent=p,e.left=p,e.right=p,r(e,0),t.root=e,t.root;!function(t,e){var n=0,i=t.root,o=e.start,s=e.end;for(;;){var a=I(o,s,i.start+n,i.end+n);if(a<0){if(i.left===p){e.start-=n,e.end-=n,e.maxEnd-=n,i.left=e;break}i=i.left}else{if(i.right===p){e.start-=n+i.delta,e.end-=n+i.delta,e.maxEnd-=n+i.delta,i.right=e;break}n+=i.delta,i=i.right}}e.parent=i,e.left=p,e.right=p,r(e,1)}(t,e),N(e.parent);for(var n=e;n!==t.root&&1===o(n.parent);){var i;if(n.parent===n.parent.parent.left)1===o(i=n.parent.parent.right)?(r(n.parent,0),r(i,0),r(n.parent.parent,1),n=n.parent.parent):(n===n.parent.right&&w(t,n=n.parent),r(n.parent,0),r(n.parent.parent,1),L(t,n.parent.parent));else 1===o(i=n.parent.parent.left)?(r(n.parent,0),r(i,0),r(n.parent.parent,1),n=n.parent.parent):(n===n.parent.left&&L(t,n=n.parent),r(n.parent,0),r(n.parent.parent,1),w(t,n.parent.parent))}return r(t.root,0),e}function b(t,e){var n,i;if(e.left===p?(i=e,(n=e.right).delta+=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(t.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta):e.right===p?(n=e.left,i=e):((n=(i=function(t){for(;t.left!==p;)t=t.left;return t}(e.right)).right).start+=i.delta,n.end+=i.delta,n.delta+=i.delta,(n.delta<-1073741824||n.delta>1073741824)&&(t.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(t.requestNormalizeDelta=!0)),i===t.root)return t.root=n,r(n,0),e.detach(),C(),M(n),void(t.root.parent=p);var s,a=1===o(i);if(i===i.parent.left?i.parent.left=n:i.parent.right=n,i===e?n.parent=i.parent:(i.parent===e?n.parent=i:n.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,r(i,o(e)),e===t.root?t.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==p&&(i.left.parent=i),i.right!==p&&(i.right.parent=i)),e.detach(),a)return N(n.parent),i!==e&&(N(i),N(i.parent)),void C();for(N(n),N(n.parent),i!==e&&(N(i),N(i.parent));n!==t.root&&0===o(n);)n===n.parent.left?(1===o(s=n.parent.right)&&(r(s,0),r(n.parent,1),w(t,n.parent),s=n.parent.right),0===o(s.left)&&0===o(s.right)?(r(s,1),n=n.parent):(0===o(s.right)&&(r(s.left,0),r(s,1),L(t,s),s=n.parent.right),r(s,o(n.parent)),r(n.parent,0),r(s.right,0),w(t,n.parent),n=t.root)):(1===o(s=n.parent.left)&&(r(s,0),r(n.parent,1),L(t,n.parent),s=n.parent.left),0===o(s.left)&&0===o(s.right)?(r(s,1),n=n.parent):(0===o(s.left)&&(r(s.right,0),r(s,1),w(t,s),s=n.parent.left),r(s,o(n.parent)),r(n.parent,0),r(s.left,0),L(t,n.parent),n=t.root));r(n,0),C()}function C(){p.parent=p,p.delta=0,p.start=0,p.end=0}function w(t,e){var n=e.right;n.delta+=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(t.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,e.right=n.left,n.left!==p&&(n.left.parent=e),n.parent=e.parent,e.parent===p?t.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left=e,e.parent=n,M(e),M(n)}function L(t,e){var n=e.left;e.delta-=n.delta,(e.delta<-1073741824||e.delta>1073741824)&&(t.requestNormalizeDelta=!0),e.start-=n.delta,e.end-=n.delta,e.left=n.right,n.right!==p&&(n.right.parent=e),n.parent=e.parent,e.parent===p?t.root=n:e===e.parent.right?e.parent.right=n:e.parent.left=n,n.right=e,e.parent=n,M(e),M(n)}function S(t){var e=t.end;if(t.left!==p){var n=t.left.maxEnd;n>e&&(e=n)}if(t.right!==p){var i=t.right.maxEnd+t.delta;i>e&&(e=i)}return e}function M(t){t.maxEnd=S(t)}function N(t){for(;t!==p;){var e=S(t);if(t.maxEnd===e)return;t.maxEnd=e,t=t.parent}}function I(t,e,n,i){return t===n?e-i:t-n}},function(t,e,n){var i=n(93);t.exports=function(t){return Object(i(t))}},function(t,e,n){"use strict";function i(t,e){if(!t||null===t)throw new Error(e?"Assertion failed ("+e+")":"Assertion Failed")}n.d(e,"a",function(){return i})},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var i=n(56),o=n(11),r=n(23),s={};s[3]=7,s[8]=1,s[9]=2,s[13]=3,s[16]=4,s[17]=5,s[18]=6,s[19]=7,s[20]=8,s[27]=9,s[32]=10,s[33]=11,s[34]=12,s[35]=13,s[36]=14,s[37]=15,s[38]=16,s[39]=17,s[40]=18,s[45]=19,s[46]=20,s[48]=21,s[49]=22,s[50]=23,s[51]=24,s[52]=25,s[53]=26,s[54]=27,s[55]=28,s[56]=29,s[57]=30,s[65]=31,s[66]=32,s[67]=33,s[68]=34,s[69]=35,s[70]=36,s[71]=37,s[72]=38,s[73]=39,s[74]=40,s[75]=41,s[76]=42,s[77]=43,s[78]=44,s[79]=45,s[80]=46,s[81]=47,s[82]=48,s[83]=49,s[84]=50,s[85]=51,s[86]=52,s[87]=53,s[88]=54,s[89]=55,s[90]=56,s[93]=58,s[96]=93,s[97]=94,s[98]=95,s[99]=96,s[100]=97,s[101]=98,s[102]=99,s[103]=100,s[104]=101,s[105]=102,s[106]=103,s[107]=104,s[108]=105,s[109]=106,s[110]=107,s[111]=108,s[112]=59,s[113]=60,s[114]=61,s[115]=62,s[116]=63,s[117]=64,s[118]=65,s[119]=66,s[120]=67,s[121]=68,s[122]=69,s[123]=70,s[124]=71,s[125]=72,s[126]=73,s[127]=74,s[128]=75,s[129]=76,s[130]=77,s[144]=78,s[145]=79,s[186]=80,s[187]=81,s[188]=82,s[189]=83,s[190]=84,s[191]=85,s[192]=86,s[193]=110,s[194]=111,s[219]=87,s[220]=88,s[221]=89,s[222]=90,s[223]=91,s[226]=92,s[229]=109,r.j?s[91]=57:r.i?(s[59]=80,s[107]=81,s[109]=83,o.d&&(s[224]=57)):r.m&&(s[91]=57,o.d?s[93]=57:s[92]=57);var a=o.d?256:2048,u=o.d?2048:256,c=function(){function t(t){var e=t;this.browserEvent=e,this.target=e.target,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.keyCode=function(t){if(t.charCode){var e=String.fromCharCode(t.charCode).toUpperCase();return i.b.fromString(e)}return s[t.keyCode]||0}(e),this.code=e.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()}return t.prototype.preventDefault=function(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()},t.prototype.stopPropagation=function(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()},t.prototype.toKeybinding=function(){return this._asRuntimeKeybinding},t.prototype.equals=function(t){return this._asKeybinding===t},t.prototype._computeKeybinding=function(){var t=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(t=this.keyCode);var e=0;return this.ctrlKey&&(e|=a),this.altKey&&(e|=512),this.shiftKey&&(e|=1024),this.metaKey&&(e|=u),e|=t},t.prototype._computeRuntimeKeybinding=function(){var t=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(t=this.keyCode),new i.e(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var i=n(13),o=function(){function t(t,e){this._tokens=t,this._tokensCount=this._tokens.length>>>1,this._text=e}return t.prototype.equals=function(e){return e instanceof t&&this.slicedEquals(e,0,this._tokensCount)},t.prototype.slicedEquals=function(t,e,n){if(this._text!==t._text)return!1;if(this._tokensCount!==t._tokensCount)return!1;for(var i=e<<1,o=i+(n<<1),r=i;r0?this._tokens[t-1<<1]:0},t.prototype.getLanguageId=function(t){var e=this._tokens[1+(t<<1)];return i.u.getLanguageId(e)},t.prototype.getStandardTokenType=function(t){var e=this._tokens[1+(t<<1)];return i.u.getTokenType(e)},t.prototype.getForeground=function(t){var e=this._tokens[1+(t<<1)];return i.u.getForeground(e)},t.prototype.getClassName=function(t){var e=this._tokens[1+(t<<1)];return i.u.getClassNameFromMetadata(e)},t.prototype.getInlineStyle=function(t,e){var n=this._tokens[1+(t<<1)];return i.u.getInlineStyleFromMetadata(n,e)},t.prototype.getEndOffset=function(t){return this._tokens[t<<1]},t.prototype.findTokenIndexAtOffset=function(e){return t.findIndexInTokensArray(this._tokens,e)},t.prototype.inflate=function(){return this},t.prototype.sliceAndInflate=function(t,e,n){return new r(this,t,e,n)},t.convertToEndOffset=function(t,e){for(var n=(t.length>>>1)-1,i=0;i>>1)-1;ne&&(i=o)}return n},t}(),r=function(){function t(t,e,n,i){this._source=t,this._startOffset=e,this._endOffset=n,this._deltaOffset=i,this._firstTokenIndex=t.findTokenIndexAtOffset(e),this._tokensCount=0;for(var o=this._firstTokenIndex,r=t.getCount();o=n)break;this._tokensCount++}}return t.prototype.equals=function(e){return e instanceof t&&(this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount))},t.prototype.getCount=function(){return this._tokensCount},t.prototype.getForeground=function(t){return this._source.getForeground(this._firstTokenIndex+t)},t.prototype.getEndOffset=function(t){var e=this._source.getEndOffset(this._firstTokenIndex+t);return Math.min(this._endOffset,e)-this._startOffset+this._deltaOffset},t.prototype.getClassName=function(t){return this._source.getClassName(this._firstTokenIndex+t)},t.prototype.getInlineStyle=function(t,e){return this._source.getInlineStyle(this._firstTokenIndex+t,e)},t}()},function(t,e,n){"use strict";n.d(e,"b",function(){return i}),n.d(e,"a",function(){return r});var i,o=n(19);!function(t){t[t.Default=1]="Default",t[t.User=2]="User"}(i||(i={}));var r=Object(o.c)("keybindingService")},function(t,e,n){"use strict";n.d(e,"c",function(){return r}),n.d(e,"b",function(){return s}),n.d(e,"a",function(){return a}),n.d(e,"d",function(){return u}),n.d(e,"e",function(){return c});var i=n(13),o=n(72),r=new(function(){function t(){}return t.prototype.clone=function(){return this},t.prototype.equals=function(t){return this===t},t}()),s="vs.editor.nullMode",a=new i.l(s,0);function u(t,e,n,i){return new o.b([new o.a(i,"",t)],n)}function c(t,e,n,i){var r=new Uint32Array(2);return r[0]=i,r[1]=(16384|t<<0|2<<23)>>>0,new o.c(r,n)}},function(t,e,n){"use strict";n.d(e,"a",function(){return a});var i=n(56),o=n(11),r=n(36),s=n(46),a=new(function(){function t(){this.WEIGHT={editorCore:function(t){return void 0===t&&(t=0),0+t},editorContrib:function(t){return void 0===t&&(t=0),100+t},workbenchContrib:function(t){return void 0===t&&(t=0),200+t},builtinExtension:function(t){return void 0===t&&(t=0),300+t},externalExtension:function(t){return void 0===t&&(t=0),400+t}},this._keybindings=[],this._keybindingsSorted=!0}return t.bindToCurrentPlatform=function(t){if(1===o.a){if(t&&t.win)return t.win}else if(2===o.a){if(t&&t.mac)return t.mac}else if(t&&t.linux)return t.linux;return t},t.bindToCurrentPlatform2=function(t){if(1===o.a){if(t&&t.win)return t.win}else if(2===o.a){if(t&&t.mac)return t.mac}else if(t&&t.linux)return t.linux;return t},t.prototype.registerKeybindingRule=function(e,n){void 0===n&&(n=0);var r=t.bindToCurrentPlatform(e);if(r&&r.primary&&this._registerDefaultKeybinding(Object(i.f)(r.primary,o.a),e.id,e.weight,0,e.when,n),r&&Array.isArray(r.secondary))for(var s=0,a=r.secondary.length;s=21&&t<=30||(t>=31&&t<=56||(80===t||81===t||82===t||83===t||84===t||85===t||86===t||110===t||111===t||87===t||88===t||89===t||90===t||91===t||92===t))},t.prototype._assertNoCtrlAlt=function(e,n){e.ctrlKey&&e.altKey&&!e.metaKey&&t._mightProduceChar(e.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",e," for ",n)},t.prototype._registerDefaultKeybinding=function(t,e,n,i,r,s){0===s&&1===o.a&&(2===t.type?this._assertNoCtrlAlt(t.firstPart,e):this._assertNoCtrlAlt(t,e)),this._keybindings.push({keybinding:t,command:e,commandArgs:null,when:r,weight1:n,weight2:i}),this._keybindingsSorted=!1},t.prototype.getDefaultKeybindings=function(){return this._keybindingsSorted||(this._keybindings.sort(u),this._keybindingsSorted=!0),this._keybindings.slice(0)},t}());function u(t,e){return t.weight1!==e.weight1?t.weight1-e.weight1:t.commande.command?1:t.weight2-e.weight2}s.a.add("platform.keybindingsRegistry",a)},function(t,e,n){"use strict";n.r(e);var i,o=n(6),r=n(2),s=n(42),a=n(12),u=n(30),c=n(52),l=n(130),h=n(4),d=function(){function t(){}return t._createWord=function(t,e,n,i){return{start:n,end:i,wordType:e}},t._findPreviousWordOnLine=function(t,e,n){var i=e.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(i,t,n)},t._doFindPreviousWordOnLine=function(t,e,n){for(var i=0,o=n.column-2;o>=0;o--){var r=t.charCodeAt(o),s=e.get(r);if(0===s){if(2===i)return this._createWord(t,i,o+1,this._findEndOfWord(t,e,i,o+1));i=1}else if(2===s){if(1===i)return this._createWord(t,i,o+1,this._findEndOfWord(t,e,i,o+1));i=2}else if(1===s&&0!==i)return this._createWord(t,i,o+1,this._findEndOfWord(t,e,i,o+1))}return 0!==i?this._createWord(t,i,0,this._findEndOfWord(t,e,i,0)):null},t._findEndOfWord=function(t,e,n,i){for(var o=t.length,r=i;r=0;o--){var r=t.charCodeAt(o),s=e.get(r);if(1===s)return o+1;if(1===n&&2===s)return o+1;if(2===n&&0===s)return o+1}return 0},t.moveWordLeft=function(e,n,i,r){var s=i.lineNumber,a=i.column;1===a&&s>1&&(s-=1,a=n.getLineMaxColumn(s));var u=t._findPreviousWordOnLine(e,n,new o.a(s,a));return 0===r?a=u?u.start+1:1:(u&&a<=u.end+1&&(u=t._findPreviousWordOnLine(e,n,new o.a(s,u.start+1))),a=u?u.end+1:1),new o.a(s,a)},t.moveWordRight=function(e,n,i,r){var s=i.lineNumber,a=i.column;a===n.getLineMaxColumn(s)&&s=u.start+1&&(u=t._findNextWordOnLine(e,n,new o.a(s,u.end+1))),a=u?u.start+1:n.getLineMaxColumn(s)),new o.a(s,a)},t._deleteWordLeftWhitespace=function(t,e){var n=t.getLineContent(e.lineNumber),i=e.column-2,o=h.lastNonWhitespaceIndex(n,i);return o+11?l=1:(c--,l=n.getLineMaxColumn(c)):(d&&l<=d.end+1&&(d=t._findPreviousWordOnLine(e,n,new o.a(c,d.start+1))),d?l=d.end+1:l>1?l=1:(c--,l=n.getLineMaxColumn(c))),new r.a(c,l,u.lineNumber,u.column)},t._findFirstNonWhitespaceChar=function(t,e){for(var n=t.length,i=e;i=p.start+1&&(p=t._findNextWordOnLine(e,n,new o.a(c,p.end+1))),p?l=p.start+1:ll&&(h=l,d=t.model.getLineMaxColumn(h)),a.d.fromModelState(new a.f(new r.a(u.lineNumber,1,h,d),0,new o.a(h,d),0))}var f=e.modelState.selectionStart.getStartPosition().lineNumber;if(u.lineNumberf){l=t.viewModel.getLineCount();var p=c.lineNumber+1,g=1;return p>l&&(p=l,g=t.viewModel.getLineMaxColumn(p)),a.d.fromViewState(e.viewState.move(e.modelState.hasSelection(),p,g,0))}var m=e.modelState.selectionStart.getEndPosition();return a.d.fromModelState(e.modelState.move(e.modelState.hasSelection(),m.lineNumber,m.column,0))},t.word=function(t,e,n,i){var o=t.model.validatePosition(i);return a.d.fromModelState(d.word(t.config,t.model,e.modelState,n,o))},t.cancelSelection=function(t,e){if(!e.modelState.hasSelection())return new a.d(e.modelState,e.viewState);var n=e.viewState.position.lineNumber,i=e.viewState.position.column;return a.d.fromViewState(new a.f(new r.a(n,i,n,i),0,new o.a(n,i),0))},t.moveTo=function(t,e,n,i,r){var s=t.model.validatePosition(i),u=r?t.validateViewPosition(new o.a(r.lineNumber,r.column),s):t.convertModelPositionToViewPosition(s);return a.d.fromViewState(e.viewState.move(n,u.lineNumber,u.column,0))},t.move=function(t,e,n){var i=n.select,o=n.value;switch(n.direction){case 0:return 4===n.unit?this._moveHalfLineLeft(t,e,i):this._moveLeft(t,e,i,o);case 1:return 4===n.unit?this._moveHalfLineRight(t,e,i):this._moveRight(t,e,i,o);case 2:return 2===n.unit?this._moveUpByViewLines(t,e,i,o):this._moveUpByModelLines(t,e,i,o);case 3:return 2===n.unit?this._moveDownByViewLines(t,e,i,o):this._moveDownByModelLines(t,e,i,o);case 4:return this._moveToViewMinColumn(t,e,i);case 5:return this._moveToViewFirstNonWhitespaceColumn(t,e,i);case 6:return this._moveToViewCenterColumn(t,e,i);case 7:return this._moveToViewMaxColumn(t,e,i);case 8:return this._moveToViewLastNonWhitespaceColumn(t,e,i);case 9:var r=e[0],s=t.getCompletelyVisibleModelRange(),a=this._firstLineNumberInRange(t.model,s,o),u=t.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(t,r,i,a,u)];case 11:r=e[0],s=t.getCompletelyVisibleModelRange(),a=this._lastLineNumberInRange(t.model,s,o),u=t.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(t,r,i,a,u)];case 10:r=e[0],s=t.getCompletelyVisibleModelRange(),a=Math.round((s.startLineNumber+s.endLineNumber)/2),u=t.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(t,r,i,a,u)];case 12:for(var c=t.getCompletelyVisibleViewRange(),l=[],h=0,d=e.length;hn.endLineNumber-1&&(o=n.endLineNumber-1),os,h=i>u,d=iu)continue;if(yi)continue;if(_1&&o--,this.columnSelect(t,e,n.selection,i,o)},t.columnSelectRight=function(t,e,n,i,r){for(var s=0,u=Math.min(n.position.lineNumber,i),c=Math.max(n.position.lineNumber,i),l=u;l<=c;l++){var h=e.getLineMaxColumn(l),d=a.a.visibleColumnFromColumn2(t,e,new o.a(l,h));s=Math.max(s,d)}return re.getLineCount()&&(o=e.getLineCount()),this.columnSelect(t,e,n.selection,o,r)},t}(),v=n(17),_=n(67),y=n(50),b=n(18),C=n(96),w=n(100),L=n(137);n.d(e,"CoreEditorCommand",function(){return k}),n.d(e,"EditorScroll_",function(){return M}),n.d(e,"RevealLine_",function(){return N}),n.d(e,"CoreNavigationCommands",function(){return E}),n.d(e,"CoreEditingCommands",function(){return x});var S,M,N,I,E,x,D,T=(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}S(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),O=s.b,A=_.a.WEIGHT.editorCore(),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return T(e,t),e.prototype.runEditorCommand=function(t,e,n){var i=e._getCursors();i&&this.runCoreEditorCommand(i,n||{})},e}(g.c);function j(t){return t.get(y.a).getFocusedCodeEditor()}function R(t){_.a.registerCommandAndKeybindingRule(t.toCommandAndKeybindingRule(A))}!function(t){t.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:function(t){if(!f.g(t))return!1;var e=t;return!(!f.h(e.to)||!f.i(e.by)&&!f.h(e.by)||!f.i(e.value)&&!f.f(e.value)||!f.i(e.revealCursor)&&!f.c(e.revealCursor))}}]},t.RawDirection={Up:"up",Down:"down"},t.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage"},t.parse=function(e){var n,i;switch(e.to){case t.RawDirection.Up:n=1;break;case t.RawDirection.Down:n=2;break;default:return null}switch(e.by){case t.RawUnit.Line:i=1;break;case t.RawUnit.WrappedLine:i=2;break;case t.RawUnit.Page:i=3;break;case t.RawUnit.HalfPage:i=4;break;default:i=2}return{direction:n,unit:i,value:Math.floor(e.value||1),revealCursor:!!e.revealCursor,select:!!e.select}}}(M||(M={})),(I=N||(N={})).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:function(t){if(!f.g(t))return!1;var e=t;return!(!f.f(e.lineNumber)||!f.i(e.at)&&!f.h(e.at))}}]},I.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"},function(t){var e=function(t){function e(e){var n=t.call(this,e)||this;return n._inSelectionMode=e.inSelectionMode,n}return T(e,t),e.prototype.runCoreEditorCommand=function(t,e){t.context.model.pushStackElement(),t.setStates(e.source,u.a.Explicit,[p.moveTo(t.context,t.getPrimaryCursor(),this._inSelectionMode,e.position,e.viewPosition)]),t.reveal(!0,0,0)},e}(k);t.MoveTo=Object(g.g)(new e({id:"_moveTo",inSelectionMode:!1,precondition:null})),t.MoveToSelect=Object(g.g)(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:null}));var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return T(e,t),e.prototype.runCoreEditorCommand=function(t,e){t.context.model.pushStackElement();var n=this._getColumnSelectResult(t.context,t.getPrimaryCursor(),t.getColumnSelectData(),e);t.setStates(e.source,u.a.Explicit,n.viewStates.map(function(t){return a.d.fromViewState(t)})),t.setColumnSelectData({toViewLineNumber:n.toLineNumber,toViewVisualColumn:n.toVisualColumn}),t.reveal(!0,n.reversed?1:2,0)},e}(k);t.ColumnSelect=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"columnSelect",precondition:null})||this}return T(e,t),e.prototype._getColumnSelectResult=function(t,e,n,i){var r,s=t.model.validatePosition(i.position);return r=i.viewPosition?t.validateViewPosition(new o.a(i.viewPosition.lineNumber,i.viewPosition.column),s):t.convertModelPositionToViewPosition(s),m.columnSelect(t.config,t.viewModel,e.viewState.selection,r.lineNumber,i.mouseColumn-1)},e}(n))),t.CursorColumnSelectLeft=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"cursorColumnSelectLeft",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:3599,linux:{primary:0}}})||this}return T(e,t),e.prototype._getColumnSelectResult=function(t,e,n,i){return m.columnSelectLeft(t.config,t.viewModel,e.viewState,n.toViewLineNumber,n.toViewVisualColumn)},e}(n))),t.CursorColumnSelectRight=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"cursorColumnSelectRight",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:3601,linux:{primary:0}}})||this}return T(e,t),e.prototype._getColumnSelectResult=function(t,e,n,i){return m.columnSelectRight(t.config,t.viewModel,e.viewState,n.toViewLineNumber,n.toViewVisualColumn)},e}(n)));var s=function(t){function e(e){var n=t.call(this,e)||this;return n._isPaged=e.isPaged,n}return T(e,t),e.prototype._getColumnSelectResult=function(t,e,n,i){return m.columnSelectUp(t.config,t.viewModel,e.viewState,this._isPaged,n.toViewLineNumber,n.toViewVisualColumn)},e}(n);t.CursorColumnSelectUp=Object(g.g)(new s({isPaged:!1,id:"cursorColumnSelectUp",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:3600,linux:{primary:0}}})),t.CursorColumnSelectPageUp=Object(g.g)(new s({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:3595,linux:{primary:0}}}));var c=function(t){function e(e){var n=t.call(this,e)||this;return n._isPaged=e.isPaged,n}return T(e,t),e.prototype._getColumnSelectResult=function(t,e,n,i){return m.columnSelectDown(t.config,t.viewModel,e.viewState,this._isPaged,n.toViewLineNumber,n.toViewVisualColumn)},e}(n);t.CursorColumnSelectDown=Object(g.g)(new c({isPaged:!1,id:"cursorColumnSelectDown",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:3602,linux:{primary:0}}})),t.CursorColumnSelectPageDown=Object(g.g)(new c({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:3596,linux:{primary:0}}}));var l=function(t){function e(){return t.call(this,{id:"cursorMove",precondition:null,description:i.description})||this}return T(e,t),e.prototype.runCoreEditorCommand=function(t,e){var n=i.parse(e);n&&this._runCursorMove(t,e.source,n)},e.prototype._runCursorMove=function(t,e,n){t.context.model.pushStackElement(),t.setStates(e,u.a.Explicit,p.move(t.context,t.getAll(),n)),t.reveal(!0,0,0)},e}(k);t.CursorMoveImpl=l,t.CursorMove=Object(g.g)(new l);var h=function(e){function n(t){var n=e.call(this,t)||this;return n._staticArgs=t.args,n}return T(n,e),n.prototype.runCoreEditorCommand=function(e,n){var i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:e.context.config.pageSize}),t.CursorMove._runCursorMove(e,n.source,i)},n}(k);t.CursorLeft=Object(g.g)(new h({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:15,mac:{primary:15,secondary:[288]}}})),t.CursorLeftSelect=Object(g.g)(new h({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:1039}})),t.CursorRight=Object(g.g)(new h({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:17,mac:{primary:17,secondary:[292]}}})),t.CursorRightSelect=Object(g.g)(new h({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:1041}})),t.CursorUp=Object(g.g)(new h({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:16,mac:{primary:16,secondary:[302]}}})),t.CursorUpSelect=Object(g.g)(new h({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),t.CursorPageUp=Object(g.g)(new h({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:11}})),t.CursorPageUpSelect=Object(g.g)(new h({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:1035}})),t.CursorDown=Object(g.g)(new h({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:18,mac:{primary:18,secondary:[300]}}})),t.CursorDownSelect=Object(g.g)(new h({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),t.CursorPageDown=Object(g.g)(new h({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:12}})),t.CursorPageDownSelect=Object(g.g)(new h({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:null,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:1036}})),t.CreateCursor=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"createCursor",precondition:null})||this}return T(e,t),e.prototype.runCoreEditorCommand=function(t,e){var n=t.context;if(!n.config.readOnly){var i;i=e.wholeLine?p.line(n,t.getPrimaryCursor(),!1,e.position,e.viewPosition):p.moveTo(n,t.getPrimaryCursor(),!1,e.position,e.viewPosition);var o=t.getAll();if(o.length>1)for(var r=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null,a=0,c=o.length;ao&&(i=o);var s=new r.a(i,1,i,t.context.model.getLineMaxColumn(i)),a=0;if(n.at)switch(n.at){case N.RawAtArgument.Top:a=3;break;case N.RawAtArgument.Center:a=1;break;case N.RawAtArgument.Bottom:a=4}var u=t.context.convertModelRangeToViewRange(s);t.revealRange(!1,u,a,0)},e}(k))),t.SelectAll=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"selectAll",precondition:null})||this}return T(e,t),e.prototype.runCoreEditorCommand=function(t,e){t.context.model.pushStackElement(),t.setStates(e.source,u.a.Explicit,[p.selectAll(t.context,t.getPrimaryCursor())])},e}(k))),t.SetSelection=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"setSelection",precondition:null})||this}return T(e,t),e.prototype.runCoreEditorCommand=function(t,e){t.context.model.pushStackElement(),t.setStates(e.source,u.a.Explicit,[a.d.fromModelSelection(e.selection)])},e}(k)))}(E||(E={})),(D=x||(x={})).LineBreakInsert=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"lineBreakInsert",precondition:v.a.writable,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:null,mac:{primary:301}}})||this}return T(e,t),e.prototype.runEditorCommand=function(t,e,n){e.pushUndoStop(),e.executeCommands(this.id,w.a.lineBreakInsert(e._getCursorConfiguration(),e.getModel(),e.getSelections()))},e}(g.c))),D.Outdent=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"outdent",precondition:v.a.writable,kbOpts:{weight:A,kbExpr:b.b.and(v.a.textFocus,v.a.tabDoesNotMoveFocus),primary:1026}})||this}return T(e,t),e.prototype.runEditorCommand=function(t,e,n){e.pushUndoStop(),e.executeCommands(this.id,w.a.outdent(e._getCursorConfiguration(),e.getModel(),e.getSelections())),e.pushUndoStop()},e}(g.c))),D.Tab=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"tab",precondition:v.a.writable,kbOpts:{weight:A,kbExpr:b.b.and(v.a.textFocus,v.a.tabDoesNotMoveFocus),primary:2}})||this}return T(e,t),e.prototype.runEditorCommand=function(t,e,n){e.pushUndoStop(),e.executeCommands(this.id,w.a.tab(e._getCursorConfiguration(),e.getModel(),e.getSelections())),e.pushUndoStop()},e}(g.c))),D.DeleteLeft=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"deleteLeft",precondition:v.a.writable,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})||this}return T(e,t),e.prototype.runEditorCommand=function(t,e,n){var i=e._getCursors(),o=L.a.deleteLeft(i.getPrevEditOperationType(),e._getCursorConfiguration(),e.getModel(),e.getSelections()),r=o[0],s=o[1];r&&e.pushUndoStop(),e.executeCommands(this.id,s),i.setPrevEditOperationType(2)},e}(g.c))),D.DeleteRight=Object(g.g)(new(function(t){function e(){return t.call(this,{id:"deleteRight",precondition:v.a.writable,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})||this}return T(e,t),e.prototype.runEditorCommand=function(t,e,n){var i=e._getCursors(),o=L.a.deleteRight(i.getPrevEditOperationType(),e._getCursorConfiguration(),e.getModel(),e.getSelections()),r=o[0],s=o[1];r&&e.pushUndoStop(),e.executeCommands(this.id,s),i.setPrevEditOperationType(3)},e}(g.c)));var P=function(t){function e(e){var n=t.call(this,e)||this;return n._editorHandler=e.editorHandler,n._inputHandler=e.inputHandler,n}return T(e,t),e.prototype.runCommand=function(t,e){var n=j(t);if(n&&n.isFocused())return this._runEditorHandler(n,e);var i=document.activeElement;if(!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)){var o=function(t){var e=t.get(C.a),n=e.getActiveEditor&&e.getActiveEditor();return Object(y.b)(n)}(t);return o?(o.focus(),this._runEditorHandler(o,e)):void 0}document.execCommand(this._inputHandler)},e.prototype._runEditorHandler=function(t,e){var n=this._editorHandler;"string"==typeof n?t.trigger("keyboard",n,e):((e=e||{}).source="keyboard",n.runEditorCommand(null,t,e))},e}(g.a),W=function(t){function e(e,n){var i=t.call(this,{id:e,precondition:null})||this;return i._handlerId=n,i}return T(e,t),e.prototype.runCommand=function(t,e){var n=j(t);n&&n.trigger("keyboard",this._handlerId,e)},e}(g.a);function z(t){R(new W("default:"+t,t)),R(new W(t,t))}R(new P({editorHandler:E.SelectAll,inputHandler:"selectAll",id:"editor.action.selectAll",precondition:null,kbOpts:{weight:A,kbExpr:null,primary:2079}})),R(new P({editorHandler:O.Undo,inputHandler:"undo",id:O.Undo,precondition:v.a.writable,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:2104}})),R(new W("default:"+O.Undo,O.Undo)),R(new P({editorHandler:O.Redo,inputHandler:"redo",id:O.Redo,precondition:v.a.writable,kbOpts:{weight:A,kbExpr:v.a.textFocus,primary:2103,secondary:[3128],mac:{primary:3128}}})),R(new W("default:"+O.Redo,O.Redo)),z(O.Type),z(O.ReplacePreviousChar),z(O.CompositionStart),z(O.CompositionEnd),z(O.Paste),z(O.Cut)},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"c",function(){return i}),n.d(e,"b",function(){return s});var i,o=n(19),r=Object(o.c)("storageService");!function(t){t[t.GLOBAL=0]="GLOBAL",t[t.WORKSPACE=1]="WORKSPACE"}(i||(i={}));var s={_serviceBrand:void 0,store:function(){},remove:function(){},get:function(t,e,n){return n},getInteger:function(t,e,n){return n},getBoolean:function(t,e,n){return n}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"d",function(){return o}),n.d(e,"b",function(){return r}),n.d(e,"c",function(){return s});var i=function(){function t(t,e,n){for(var i=new Uint8Array(t*e),o=0,r=t*e;o255?255:0|t}function r(t){return t<0?0:t>4294967295?4294967295:0|t}function s(t){for(var e=t.length,n=new Uint32Array(e),i=0;i0&&t.getLanguageId(a-1)===r;)a--;return new o(t,r,a,s+1,t.getStartOffset(a),t.getEndOffset(s))}var o=function(){function t(t,e,n,i,o,r){this._actual=t,this.languageId=e,this._firstTokenIndex=n,this._lastTokenIndex=i,this.firstCharOffset=o,this._lastCharOffset=r}return t.prototype.getLineContent=function(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)},t.prototype.getTokenCount=function(){return this._lastTokenIndex-this._firstTokenIndex},t.prototype.findTokenIndexAtOffset=function(t){return this._actual.findTokenIndexAtOffset(t+this.firstCharOffset)-this._firstTokenIndex},t.prototype.getStandardTokenType=function(t){return this._actual.getStandardTokenType(t+this._firstTokenIndex)},t}();function r(t){return 0!=(7&t)}},function(t,e,n){var i=n(9),o=n(38),r=n(93),s=/"/g,a=function(t,e,n,i){var o=String(r(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(i).replace(s,""")+'"'),a+">"+o+""};t.exports=function(t,e){var n={};n[t]=e(a),i(i.P+i.F*o(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",n)}},function(t,e,n){var i=n(35),o=n(76),r=n(80),s=n(118)("src"),a=Function.toString,u=(""+a).split("toString");n(95).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var c="function"==typeof n;c&&(r(n,"name")||o(n,"name",e)),t[e]!==n&&(c&&(r(n,s)||o(n,s,t[e]?""+t[e]:u.join(String(e)))),t===i?t[e]=n:a?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||a.call(this)})},function(t,e,n){var i=n(54),o=n(119);t.exports=n(55)?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(80),o=n(61),r=n(183)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),i(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var i=n(133),o=n(119),r=n(79),s=n(94),a=n(80),u=n(220),c=Object.getOwnPropertyDescriptor;e.f=n(55)?c:function(t,e){if(t=r(t),e=s(e,!0),u)try{return c(t,e)}catch(t){}if(a(t,e))return o(!i.f.call(t,e),t[e])}},function(t,e,n){var i=n(134),o=n(93);t.exports=function(t){return i(o(t))}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){"use strict";n.d(e,"b",function(){return s}),n.d(e,"a",function(){return p});var i=n(4),o=n(2),r=function(){return function(t,e,n,i,o){this.languageIdentifier=t,this.open=e,this.close=n,this.forwardRegex=i,this.reversedRegex=o}}(),s=function(){return function(t,e){var n=this;this.brackets=e.map(function(e){return new r(t,e[0],e[1],u({open:e[0],close:e[1]}),c({open:e[0],close:e[1]}))}),this.forwardRegex=l(this.brackets),this.reversedRegex=h(this.brackets),this.textIsBracket={},this.textIsOpenBracket={};var i=0;this.brackets.forEach(function(t){n.textIsBracket[t.open.toLowerCase()]=t,n.textIsBracket[t.close.toLowerCase()]=t,n.textIsOpenBracket[t.open.toLowerCase()]=!0,n.textIsOpenBracket[t.close.toLowerCase()]=!1,i=Math.max(i,t.open.length),i=Math.max(i,t.close.length)}),this.maxBracketLength=i}}();function a(t,e){var n={};return function(i){var o=t(i);return n.hasOwnProperty(o)||(n[o]=e(i)),n[o]}}var u=a(function(t){return t.open+";"+t.close},function(t){return d([t.open,t.close])}),c=a(function(t){return t.open+";"+t.close},function(t){return d([f(t.open),f(t.close)])}),l=a(function(t){return t.map(function(t){return t.open+";"+t.close}).join(";")},function(t){var e=[];return t.forEach(function(t){e.push(t.open),e.push(t.close)}),d(e)}),h=a(function(t){return t.map(function(t){return t.open+";"+t.close}).join(";")},function(t){var e=[];return t.forEach(function(t){e.push(f(t.open)),e.push(f(t.close))}),d(e)});function d(t){var e="("+t.map(i.escapeRegExpCharacters).join(")|(")+")";return i.createRegExp(e,!0)}var f=function(){var t=null,e=null;return function(n){return t!==n&&(e=function(t){for(var e="",n=t.length-1;n>=0;n--)e+=t.charAt(n);return e}(t=n)),e}}(),p=function(){function t(){}return t._findPrevBracketInText=function(t,e,n,i){var r=n.match(t);if(!r)return null;var s=n.length-r.index,a=r[0].length,u=i+s;return new o.a(e,u-a+1,e,u+1)},t.findPrevBracketInToken=function(t,e,n,i,o){var r=f(n).substring(n.length-o,n.length-i);return this._findPrevBracketInText(t,e,r,i)},t.findNextBracketInText=function(t,e,n,i){var r=n.match(t);if(!r)return null;var s=r.index,a=r[0].length,u=i+s;return new o.a(e,u+1,e,u+1+a)},t.findNextBracketInToken=function(t,e,n,i,o){var r=n.substring(i,o);return this.findNextBracketInText(t,e,r,i)},t}()},function(t,e,n){"use strict";var i=n(38);t.exports=function(t,e){return!!t&&i(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var i=n(69);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var i=n(19),o=Object(i.c)("telemetryService")},function(t,e,n){"use strict";n.d(e,"b",function(){return c}),n.d(e,"a",function(){return l});var i,o=n(7),r=n(0),s=n(136),a=n(43),u=(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function c(t,e){var n=new a.b(e);return n.preventDefault(),{leftButton:n.leftButton,posx:n.posx,posy:n.posy}}var l=function(t){function e(){var e=t.call(this)||this;return e.hooks=[],e.mouseMoveEventMerger=null,e.mouseMoveCallback=null,e.onStopCallback=null,e}return u(e,t),e.prototype.dispose=function(){this.stopMonitoring(!1),t.prototype.dispose.call(this)},e.prototype.stopMonitoring=function(t){if(this.isMonitoring()){this.hooks=Object(o.d)(this.hooks),this.mouseMoveEventMerger=null,this.mouseMoveCallback=null;var e=this.onStopCallback;this.onStopCallback=null,t&&e()}},e.prototype.isMonitoring=function(){return this.hooks.length>0},e.prototype.startMonitoring=function(t,e,n){var i=this;if(!this.isMonitoring()){this.mouseMoveEventMerger=t,this.mouseMoveCallback=e,this.onStopCallback=n;for(var o=s.a.getSameOriginWindowChain(),u=0;u=0;a--)(o=t[a])&&(s=(r<3?o(s):r>3?o(e,n,s):o(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s},h=function(t,e){return function(n,i){e(n,i,t)}},d=function(){function t(){this.id=String(t.ID++)}return t.ID=1,t.EditorTitle=new t,t.EditorTitleContext=new t,t.EditorContext=new t,t.ExplorerContext=new t,t.OpenEditorsContext=new t,t.ProblemsPanelContext=new t,t.DebugVariablesContext=new t,t.DebugWatchContext=new t,t.DebugCallStackContext=new t,t.DebugBreakpointsContext=new t,t.DebugConsoleContext=new t,t.SCMTitle=new t,t.SCMSourceControl=new t,t.SCMResourceGroupContext=new t,t.SCMResourceContext=new t,t.SCMChangeContext=new t,t.CommandPalette=new t,t.ViewTitle=new t,t.ViewItemContext=new t,t.TouchBarContext=new t,t}(),f=Object(s.c)("menuService"),p=new(function(){function t(){this._commands=Object.create(null),this._menuItems=Object.create(null)}return t.prototype.addCommand=function(t){var e=this._commands[t.id];return this._commands[t.id]=t,void 0!==e},t.prototype.getCommand=function(t){return this._commands[t]},t.prototype.appendMenuItem=function(t,e){var n=t.id,i=this._menuItems[n];return i?i.push(e):this._menuItems[n]=i=[e],{dispose:function(){var t=i.indexOf(e);t>=0&&i.splice(t,1)}}},t.prototype.getMenuItems=function(t){var e=t.id,n=this._menuItems[e]||[];return e===d.CommandPalette.id&&this._appendImplicitItems(n),n},t.prototype._appendImplicitItems=function(t){for(var e=new Set,n=0,i=t;n/?";var o=function(t){void 0===t&&(t="");for(var e="(-?\\d*\\.\\d\\w*)|([^",n=0;n=0||(e+="\\"+i[n]);return e+="\\s]+)",new RegExp(e,"g")}();function r(t){var e=o;if(t&&t instanceof RegExp)if(t.global)e=t;else{var n="g";t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),e=new RegExp(t.source,n)}return e.lastIndex=0,e}function s(t,e,n,i){e.lastIndex=0;var o=e.exec(n);if(!o)return null;var r=o[0].indexOf(" ")>=0?function(t,e,n,i){var o,r=t-1-i;for(e.lastIndex=0;o=e.exec(n);){if(o.index>r)return null;if(e.lastIndex>=r)return{word:o[0],startColumn:i+1+o.index,endColumn:i+1+e.lastIndex}}return null}(t,e,n,i):function(t,e,n,i){var o,r=t-1-i,s=n.lastIndexOf(" ",r-1)+1,a=n.indexOf(" ",r);for(-1===a&&(a=n.length),e.lastIndex=s;o=e.exec(n);)if(o.index<=r&&e.lastIndex>=r)return{word:o[0],startColumn:i+1+o.index,endColumn:i+1+e.lastIndex};return null}(t,e,n,i);return e.lastIndex=0,r}},function(t,e,n){"use strict";n.d(e,"d",function(){return i}),n.d(e,"e",function(){return o}),n.d(e,"f",function(){return r}),n.d(e,"g",function(){return s}),n.d(e,"c",function(){return a}),n.d(e,"b",function(){return u}),n.d(e,"a",function(){return c});var i=function(){return function(){this.changeType=1}}(),o=function(){return function(t,e){this.changeType=2,this.lineNumber=t,this.detail=e}}(),r=function(){return function(t,e){this.changeType=3,this.fromLineNumber=t,this.toLineNumber=e}}(),s=function(){return function(t,e,n){this.changeType=4,this.fromLineNumber=t,this.toLineNumber=e,this.detail=n}}(),a=function(){return function(){this.changeType=5}}(),u=function(){function t(t,e,n,i){this.changes=t,this.versionId=e,this.isUndoing=n,this.isRedoing=i}return t.prototype.containsEvent=function(t){for(var e=0,n=this.changes.length;eC;C++)if((d||C in _)&&(m=y(g=_[C],C,v),t))if(n)w[C]=m;else if(m)switch(t){case 3:return!0;case 5:return g;case 6:return C;case 2:w.push(g)}else if(l)return!1;return h?-1:c||l?l:w}}},function(t,e,n){var i=n(9),o=n(95),r=n(38);t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],s={};s[t]=e(n),i(i.S+i.F*r(function(){n(1)}),"Object",s)}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i=n(41);t.exports=function(t,e){if(!i(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!i(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){var n=t.exports={version:"2.5.4"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var i,o=n(19),r=Object(o.c)("editorService");!function(t){t[t.ONE=0]="ONE",t[t.TWO=1]="TWO",t[t.THREE=2]="THREE"}(i||(i={}));var s,a;i.ONE,i.TWO,i.THREE;!function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT"}(s||(s={})),function(t){t[t.SHORT=0]="SHORT",t[t.MEDIUM=1]="MEDIUM",t[t.LONG=2]="LONG"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return s});var i=n(8),o=n(3),r=function(){function t(t,e,n,i,r){void 0===e&&(e=""),void 0===n&&(n=""),void 0===i&&(i=!0),this._onDidChange=new o.a,this._id=t,this._label=e,this._cssClass=n,this._enabled=i,this._actionCallback=r}return t.prototype.dispose=function(){this._onDidChange.dispose()},Object.defineProperty(t.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(t){this._setLabel(t)},enumerable:!0,configurable:!0}),t.prototype._setLabel=function(t){this._label!==t&&(this._label=t,this._onDidChange.fire({label:t}))},Object.defineProperty(t.prototype,"tooltip",{get:function(){return this._tooltip},set:function(t){this._setTooltip(t)},enumerable:!0,configurable:!0}),t.prototype._setTooltip=function(t){this._tooltip!==t&&(this._tooltip=t,this._onDidChange.fire({tooltip:t}))},Object.defineProperty(t.prototype,"class",{get:function(){return this._cssClass},set:function(t){this._setClass(t)},enumerable:!0,configurable:!0}),t.prototype._setClass=function(t){this._cssClass!==t&&(this._cssClass=t,this._onDidChange.fire({class:t}))},Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this._setEnabled(t)},enumerable:!0,configurable:!0}),t.prototype._setEnabled=function(t){this._enabled!==t&&(this._enabled=t,this._onDidChange.fire({enabled:t}))},Object.defineProperty(t.prototype,"checked",{get:function(){return this._checked},set:function(t){this._setChecked(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"radio",{get:function(){return this._radio},set:function(t){this._setRadio(t)},enumerable:!0,configurable:!0}),t.prototype._setChecked=function(t){this._checked!==t&&(this._checked=t,this._onDidChange.fire({checked:t}))},t.prototype._setRadio=function(t){this._radio!==t&&(this._radio=t,this._onDidChange.fire({radio:t}))},Object.defineProperty(t.prototype,"order",{get:function(){return this._order},set:function(t){this._order=t},enumerable:!0,configurable:!0}),t.prototype.run=function(t,e){return void 0!==this._actionCallback?this._actionCallback(t):i.b.as(!0)},t}(),s=function(){function t(){this._onDidBeforeRun=new o.a,this._onDidRun=new o.a}return Object.defineProperty(t.prototype,"onDidRun",{get:function(){return this._onDidRun.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDidBeforeRun",{get:function(){return this._onDidBeforeRun.event},enumerable:!0,configurable:!0}),t.prototype.run=function(t,e){var n=this;return t.enabled?(this._onDidBeforeRun.fire({action:t}),this.runAction(t,e).then(function(e){n._onDidRun.fire({action:t,result:e})},function(e){n._onDidRun.fire({action:t,error:e})})):i.b.as(null)},t.prototype.runAction=function(t,e){var n=e?t.run(e):t.run();return i.b.is(n)?n:i.b.wrap(n)},t.prototype.dispose=function(){this._onDidBeforeRun.dispose(),this._onDidRun.dispose()},t}()},function(t,e,n){var i=n(199),o=n(9),r=n(151)("metadata"),s=r.store||(r.store=new(n(196))),a=function(t,e,n){var o=s.get(t);if(!o){if(!n)return;s.set(t,o=new i)}var r=o.get(e);if(!r){if(!n)return;o.set(e,r=new i)}return r};t.exports={store:s,map:a,has:function(t,e,n){var i=a(e,n,!1);return void 0!==i&&i.has(t)},get:function(t,e,n){var i=a(e,n,!1);return void 0===i?void 0:i.get(t)},set:function(t,e,n,i){a(n,i,!0).set(t,e)},keys:function(t,e){var n=a(t,e,!1),i=[];return n&&n.forEach(function(t,e){i.push(e)}),i},key:function(t){return void 0===t||"symbol"==typeof t?t:String(t)},exp:function(t){o(o.S,"Reflect",t)}}},function(t,e,n){"use strict";if(n(55)){var i=n(117),o=n(35),r=n(38),s=n(9),a=n(141),u=n(160),c=n(84),l=n(111),h=n(119),d=n(76),f=n(109),p=n(92),g=n(53),m=n(194),v=n(115),_=n(94),y=n(80),b=n(132),C=n(41),w=n(61),L=n(169),S=n(114),M=n(77),N=n(113).f,I=n(167),E=n(118),x=n(48),D=n(90),T=n(150),O=n(143),A=n(164),k=n(123),j=n(146),R=n(112),P=n(165),W=n(204),z=n(54),F=n(78),B=z.f,V=F.f,H=o.RangeError,Y=o.TypeError,U=o.Uint8Array,Z=Array.prototype,G=u.ArrayBuffer,X=u.DataView,K=D(0),Q=D(2),q=D(3),J=D(4),$=D(5),tt=D(6),et=T(!0),nt=T(!1),it=A.values,ot=A.keys,rt=A.entries,st=Z.lastIndexOf,at=Z.reduce,ut=Z.reduceRight,ct=Z.join,lt=Z.sort,ht=Z.slice,dt=Z.toString,ft=Z.toLocaleString,pt=x("iterator"),gt=x("toStringTag"),mt=E("typed_constructor"),vt=E("def_constructor"),_t=a.CONSTR,yt=a.TYPED,bt=a.VIEW,Ct=D(1,function(t,e){return Nt(O(t,t[vt]),e)}),wt=r(function(){return 1===new U(new Uint16Array([1]).buffer)[0]}),Lt=!!U&&!!U.prototype.set&&r(function(){new U(1).set({})}),St=function(t,e){var n=p(t);if(n<0||n%e)throw H("Wrong offset!");return n},Mt=function(t){if(C(t)&&yt in t)return t;throw Y(t+" is not a typed array!")},Nt=function(t,e){if(!(C(t)&&mt in t))throw Y("It is not a typed array constructor!");return new t(e)},It=function(t,e){return Et(O(t,t[vt]),e)},Et=function(t,e){for(var n=0,i=e.length,o=Nt(t,i);i>n;)o[n]=e[n++];return o},xt=function(t,e,n){B(t,e,{get:function(){return this._d[n]}})},Dt=function(t){var e,n,i,o,r,s,a=w(t),u=arguments.length,l=u>1?arguments[1]:void 0,h=void 0!==l,d=I(a);if(void 0!=d&&!L(d)){for(s=d.call(a),i=[],e=0;!(r=s.next()).done;e++)i.push(r.value);a=i}for(h&&u>2&&(l=c(l,arguments[2],2)),e=0,n=g(a.length),o=Nt(this,n);n>e;e++)o[e]=h?l(a[e],e):a[e];return o},Tt=function(){for(var t=0,e=arguments.length,n=Nt(this,e);e>t;)n[t]=arguments[t++];return n},Ot=!!U&&r(function(){ft.call(new U(1))}),At=function(){return ft.apply(Ot?ht.call(Mt(this)):Mt(this),arguments)},kt={copyWithin:function(t,e){return W.call(Mt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return J(Mt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return P.apply(Mt(this),arguments)},filter:function(t){return It(this,Q(Mt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return $(Mt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(Mt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){K(Mt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return nt(Mt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return et(Mt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ct.apply(Mt(this),arguments)},lastIndexOf:function(t){return st.apply(Mt(this),arguments)},map:function(t){return Ct(Mt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return at.apply(Mt(this),arguments)},reduceRight:function(t){return ut.apply(Mt(this),arguments)},reverse:function(){for(var t,e=Mt(this).length,n=Math.floor(e/2),i=0;i1?arguments[1]:void 0)},sort:function(t){return lt.call(Mt(this),t)},subarray:function(t,e){var n=Mt(this),i=n.length,o=v(t,i);return new(O(n,n[vt]))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,g((void 0===e?i:v(e,i))-o))}},jt=function(t,e){return It(this,ht.call(Mt(this),t,e))},Rt=function(t){Mt(this);var e=St(arguments[1],1),n=this.length,i=w(t),o=g(i.length),r=0;if(o+e>n)throw H("Wrong length!");for(;r255?255:255&i),o.v[f](n*e+o.o,i,wt)}(this,n,t)},enumerable:!0})};y?(p=n(function(t,n,i,o){l(t,p,c,"_d");var r,s,a,u,h=0,f=0;if(C(n)){if(!(n instanceof G||"ArrayBuffer"==(u=b(n))||"SharedArrayBuffer"==u))return yt in n?Et(p,n):Dt.call(p,n);r=n,f=St(i,e);var v=n.byteLength;if(void 0===o){if(v%e)throw H("Wrong length!");if((s=v-f)<0)throw H("Wrong length!")}else if((s=g(o)*e)+f>v)throw H("Wrong length!");a=s/e}else a=m(n),r=new G(s=a*e);for(d(t,"_d",{b:r,o:f,l:s,e:a,v:new X(r)});h1)if(r.a.visibleColumnFromColumn(m,v+1,u)%u!=0&&e.isCheapToTokenize(g-1)){var _=c.a.getRawEnterActionAtPosition(e,g-1,e.getLineMaxColumn(g-1));if(_){if(p=f,_.appendText)for(var y=0,b=_.appendText.length;y1){var l=i-1;for(l=i-1;l>=1;l--){var d=n.getLineContent(l);if(a.lastNonWhitespaceIndex(d)>=0)break}if(l<1)return null;var f=n.getLineMaxColumn(l),p=c.a.getEnterAction(n,new s.a(l,f,l,f));p&&(r=p.indentation,(o=p.enterAction)&&(r+=o.appendText))}return o&&(o===h.a.Indent&&(r=t.shiftIndent(e,r)),o===h.a.Outdent&&(r=t.unshiftIndent(e,r)),r=e.normalizeIndentation(r)),r||null},t._replaceJumpToNextIndent=function(t,e,n,i){var s="",a=n.getStartPosition();if(t.insertSpaces)for(var u=r.a.visibleColumnFromColumn2(t,e,a),c=t.tabSize,l=c-u%c,h=0;h=0?u.setEndPosition(u.endLineNumber,Math.max(u.endColumn,x+1)):u.setEndPosition(u.endLineNumber,n.getLineMaxColumn(u.endLineNumber)),i)return new o.c(u,I+e.normalizeIndentation(w.afterEnter),!0);var D=0;return N<=x+1&&(e.insertSpaces||(M=Math.ceil(M/e.tabSize)),D=Math.min(M+1-e.normalizeIndentation(w.afterEnter).length-1,0)),new o.b(u,I+e.normalizeIndentation(w.afterEnter),0,D,!0)}return t._typeCommand(u,"\n"+e.normalizeIndentation(S),i)},t._isAutoIndentType=function(t,e,n){if(!t.autoIndent)return!1;for(var i=0,o=n.length;i1){var h=Object(f.a)(t.wordSeparators),d=l.charCodeAt(u.column-2);if(0===h.get(d))return!1}var p=l.charAt(u.column-1);if(p){var g=t.autoClosingPairsOpen[o]===o,m=!1;for(var v in t.autoClosingPairsClose){var _=t.autoClosingPairsOpen[v]===v;if((g||!_)&&p===v){m=!0;break}}if(!m&&!/\s/.test(p))return!1}if(!e.isCheapToTokenize(u.lineNumber))return!1;e.forceTokenization(u.lineNumber);var y=e.getLineTokens(u.lineNumber),b=!1;try{b=c.a.shouldAutoClosePair(o,y,u.column)}catch(t){Object(i.e)(t)}if(!b)return!1}return!0},t._runAutoClosingOpenCharType=function(t,e,n,i,s){for(var a=[],u=0,c=i.length;u140)n._setDesiredScrollPositionNow(s.getScrollPosition());else{var u=n._sliderMousePosition(t)-i;n._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(u))}},function(){n.slider.toggleClassName("active",!1),n._host.onDragEnd(),e()}),this._host.onDragStart()},e.prototype._setDesiredScrollPositionNow=function(t){var e={};this.writeScrollPosition(e,t),this._scrollable.setScrollPositionNow(e)},e}(u.a),b=function(){function t(t,e,n){this._scrollbarSize=Math.round(e),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=0,this._scrollSize=0,this._scrollPosition=0,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}return t.prototype.clone=function(){var e=new t(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize);return e.setVisibleSize(this._visibleSize),e.setScrollSize(this._scrollSize),e.setScrollPosition(this._scrollPosition),e},t.prototype.setVisibleSize=function(t){var e=Math.round(t);return this._visibleSize!==e&&(this._visibleSize=e,this._refreshComputedValues(),!0)},t.prototype.setScrollSize=function(t){var e=Math.round(t);return this._scrollSize!==e&&(this._scrollSize=e,this._refreshComputedValues(),!0)},t.prototype.setScrollPosition=function(t){var e=Math.round(t);return this._scrollPosition!==e&&(this._scrollPosition=e,this._refreshComputedValues(),!0)},t._computeValues=function(t,e,n,i,o){var r=Math.max(0,n-t),s=Math.max(0,r-2*e),a=i>0&&i>n;if(!a)return{computedAvailableSize:Math.round(r),computedIsNeeded:a,computedSliderSize:Math.round(s),computedSliderRatio:0,computedSliderPosition:0};var u=Math.round(Math.max(20,Math.floor(n*s/i))),c=(s-u)/(i-n),l=o*c;return{computedAvailableSize:Math.round(r),computedIsNeeded:a,computedSliderSize:Math.round(u),computedSliderRatio:c,computedSliderPosition:Math.round(l)}},t.prototype._refreshComputedValues=function(){var e=t._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},t.prototype.getArrowSize=function(){return this._arrowSize},t.prototype.getScrollPosition=function(){return this._scrollPosition},t.prototype.getRectangleLargeSize=function(){return this._computedAvailableSize},t.prototype.getRectangleSmallSize=function(){return this._scrollbarSize},t.prototype.isNeeded=function(){return this._computedIsNeeded},t.prototype.getSliderSize=function(){return this._computedSliderSize},t.prototype.getSliderPosition=function(){return this._computedSliderPosition},t.prototype.getDesiredScrollPositionFromOffset=function(t){if(!this._computedIsNeeded)return 0;var e=t-this._arrowSize-this._computedSliderSize/2;return Math.round(e/this._computedSliderRatio)},t.prototype.getDesiredScrollPositionFromDelta=function(t){if(!this._computedIsNeeded)return 0;var e=this._computedSliderPosition+t;return Math.round(e/this._computedSliderRatio)},t}(),C=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),w=function(t){function e(e,n,i){var o=t.call(this,{lazyRender:n.lazyRender,host:i,scrollbarState:new b(n.horizontalHasArrows?n.arrowSize:0,n.horizontal===g.b.Hidden?0:n.horizontalScrollbarSize,n.vertical===g.b.Hidden?0:n.verticalScrollbarSize),visibility:n.horizontal,extraScrollbarClassName:"horizontal",scrollable:e})||this;if(n.horizontalHasArrows){var r=(n.arrowSize-d)/2,a=(n.horizontalScrollbarSize-d)/2;o._createArrow({className:"left-arrow",top:a,left:r,bottom:void 0,right:void 0,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:function(){return o._host.onMouseWheel(new s.c(null,1,0))}}),o._createArrow({className:"right-arrow",top:a,left:void 0,bottom:void 0,right:r,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:function(){return o._host.onMouseWheel(new s.c(null,-1,0))}})}return o._createSlider(Math.floor((n.horizontalScrollbarSize-n.horizontalSliderSize)/2),0,null,n.horizontalSliderSize),o}return C(e,t),e.prototype._updateSlider=function(t,e){this.slider.setWidth(t),this.slider.setLeft(e)},e.prototype._renderDomNode=function(t,e){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setLeft(0),this.domNode.setBottom(0)},e.prototype.onDidScroll=function(t){return this._shouldRender=this._onElementScrollSize(t.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(t.width)||this._shouldRender,this._shouldRender},e.prototype._mouseDownRelativePosition=function(t,e){return t},e.prototype._sliderMousePosition=function(t){return t.posx},e.prototype._sliderOrthogonalMousePosition=function(t){return t.posy},e.prototype.writeScrollPosition=function(t,e){t.scrollLeft=e},e}(y),L=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),S=function(t){function e(e,n,i){var o=t.call(this,{lazyRender:n.lazyRender,host:i,scrollbarState:new b(n.verticalHasArrows?n.arrowSize:0,n.vertical===g.b.Hidden?0:n.verticalScrollbarSize,0),visibility:n.vertical,extraScrollbarClassName:"vertical",scrollable:e})||this;if(n.verticalHasArrows){var r=(n.arrowSize-d)/2,a=(n.verticalScrollbarSize-d)/2;o._createArrow({className:"up-arrow",top:r,left:a,bottom:void 0,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:function(){return o._host.onMouseWheel(new s.c(null,0,1))}}),o._createArrow({className:"down-arrow",top:void 0,left:a,bottom:r,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:function(){return o._host.onMouseWheel(new s.c(null,0,-1))}})}return o._createSlider(0,Math.floor((n.verticalScrollbarSize-n.verticalSliderSize)/2),n.verticalSliderSize,null),o}return L(e,t),e.prototype._updateSlider=function(t,e){this.slider.setHeight(t),this.slider.setTop(e)},e.prototype._renderDomNode=function(t,e){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setRight(0),this.domNode.setTop(0)},e.prototype.onDidScroll=function(t){return this._shouldRender=this._onElementScrollSize(t.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(t.height)||this._shouldRender,this._shouldRender},e.prototype._mouseDownRelativePosition=function(t,e){return e},e.prototype._sliderMousePosition=function(t){return t.posy},e.prototype._sliderOrthogonalMousePosition=function(t){return t.posx},e.prototype.writeScrollPosition=function(t,e){t.scrollTop=e},e}(y),M=n(3);n.d(e,"b",function(){return D}),n.d(e,"c",function(){return T}),n.d(e,"a",function(){return O});var N=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),I=function(){return function(t,e,n){this.timestamp=t,this.deltaX=e,this.deltaY=n,this.score=0}}(),E=function(){function t(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}return t.prototype.isPhysicalMouseWheel=function(){if(-1===this._front&&-1===this._rear)return!1;for(var t=1,e=0,n=1,i=this._rear;;){var o=i===this._front?t:Math.pow(2,-n);if(t-=o,e+=this._memory[i].score*o,i===this._front)break;i=(this._capacity+i-1)%this._capacity,n++}return e<=.5},t.prototype.accept=function(t,e,n){var i=new I(t,e,n);i.score=this._computeScore(i),-1===this._front&&-1===this._rear?(this._memory[0]=i,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]=i)},t.prototype._computeScore=function(t){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;var e=.5;-1===this._front&&-1===this._rear||this._memory[this._rear];return(Math.abs(t.deltaX-Math.round(t.deltaX))>0||Math.abs(t.deltaY-Math.round(t.deltaY))>0)&&(e+=.25),Math.min(Math.max(e,0),1)},t.INSTANCE=new t,t}(),x=function(t){function e(e,n,i){var o=t.call(this)||this;o._onScroll=o._register(new M.a),o.onScroll=o._onScroll.event,e.style.overflow="hidden",o._options=A(n),o._scrollable=i,o._register(o._scrollable.onScroll(function(t){o._onDidScroll(t),o._onScroll.fire(t)}));var r={onMouseWheel:function(t){return o._onMouseWheel(t)},onDragStart:function(){return o._onDragStart()},onDragEnd:function(){return o._onDragEnd()}};return o._verticalScrollbar=o._register(new S(o._scrollable,o._options,r)),o._horizontalScrollbar=o._register(new w(o._scrollable,o._options,r)),o._domNode=document.createElement("div"),o._domNode.className="monaco-scrollable-element "+o._options.className,o._domNode.setAttribute("role","presentation"),o._domNode.style.position="relative",o._domNode.style.overflow="hidden",o._domNode.appendChild(e),o._domNode.appendChild(o._horizontalScrollbar.domNode.domNode),o._domNode.appendChild(o._verticalScrollbar.domNode.domNode),o._options.useShadows&&(o._leftShadowDomNode=Object(c.b)(document.createElement("div")),o._leftShadowDomNode.setClassName("shadow"),o._domNode.appendChild(o._leftShadowDomNode.domNode),o._topShadowDomNode=Object(c.b)(document.createElement("div")),o._topShadowDomNode.setClassName("shadow"),o._domNode.appendChild(o._topShadowDomNode.domNode),o._topLeftShadowDomNode=Object(c.b)(document.createElement("div")),o._topLeftShadowDomNode.setClassName("shadow top-left-corner"),o._domNode.appendChild(o._topLeftShadowDomNode.domNode)),o._listenOnDomNode=o._options.listenOnDomNode||o._domNode,o._mouseWheelToDispose=[],o._setListeningToMouseWheel(o._options.handleMouseWheel),o.onmouseover(o._listenOnDomNode,function(t){return o._onMouseOver(t)}),o.onnonbubblingmouseout(o._listenOnDomNode,function(t){return o._onMouseOut(t)}),o._hideTimeout=o._register(new l.d),o._isDragging=!1,o._mouseIsOver=!1,o._shouldRender=!0,o}return N(e,t),e.prototype.dispose=function(){this._mouseWheelToDispose=Object(p.d)(this._mouseWheelToDispose),t.prototype.dispose.call(this)},e.prototype.getDomNode=function(){return this._domNode},e.prototype.getOverviewRulerLayoutInfo=function(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}},e.prototype.delegateVerticalScrollbarMouseDown=function(t){this._verticalScrollbar.delegateMouseDown(t)},e.prototype.getScrollDimensions=function(){return this._scrollable.getScrollDimensions()},e.prototype.setScrollDimensions=function(t){this._scrollable.setScrollDimensions(t)},e.prototype.updateClassName=function(t){this._options.className=t,r.d&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className},e.prototype.updateOptions=function(t){var e=A(t);this._options.handleMouseWheel=e.handleMouseWheel,this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity,this._setListeningToMouseWheel(this._options.handleMouseWheel),this._options.lazyRender||this._render()},e.prototype._setListeningToMouseWheel=function(t){var e=this;if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=Object(p.d)(this._mouseWheelToDispose),t)){var n=function(t){var n=new s.c(t);e._onMouseWheel(n)};this._mouseWheelToDispose.push(o.f(this._listenOnDomNode,"mousewheel",n)),this._mouseWheelToDispose.push(o.f(this._listenOnDomNode,"DOMMouseScroll",n))}},e.prototype._onMouseWheel=function(t){var e,n=E.INSTANCE;if(n.accept(Date.now(),t.deltaX,t.deltaY),t.deltaY||t.deltaX){var i=t.deltaY*this._options.mouseWheelScrollSensitivity,o=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.flipAxes&&(i=(e=[o,i])[0],o=e[1]);var s=!r.d&&t.browserEvent&&t.browserEvent.shiftKey;!this._options.scrollYToX&&!s||o||(o=i,i=0),r.d&&(i&&Math.abs(o)<.2&&(o=0),Math.abs(i)>.5*Math.abs(o)&&(o=0));var a=this._scrollable.getFutureScrollPosition(),u={};if(i){var c=a.scrollTop-50*i;this._verticalScrollbar.writeScrollPosition(u,c)}if(o){var l=a.scrollLeft-50*o;this._horizontalScrollbar.writeScrollPosition(u,l)}if(u=this._scrollable.validateScrollPosition(u),a.scrollLeft!==u.scrollLeft||a.scrollTop!==u.scrollTop)this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),this._shouldRender=!0}(this._options.alwaysConsumeMouseWheel||this._shouldRender)&&(t.preventDefault(),t.stopPropagation())},e.prototype._onDidScroll=function(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._reveal(),this._options.lazyRender||this._render()},e.prototype.renderNow=function(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()},e.prototype._render=function(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){var t=this._scrollable.getCurrentScrollPosition(),e=t.scrollTop>0,n=t.scrollLeft>0;this._leftShadowDomNode.setClassName("shadow"+(n?" left":"")),this._topShadowDomNode.setClassName("shadow"+(e?" top":"")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"+(e?" top":"")+(n?" left":""))}},e.prototype._onDragStart=function(){this._isDragging=!0,this._reveal()},e.prototype._onDragEnd=function(){this._isDragging=!1,this._hide()},e.prototype._onMouseOut=function(t){this._mouseIsOver=!1,this._hide()},e.prototype._onMouseOver=function(t){this._mouseIsOver=!0,this._reveal()},e.prototype._reveal=function(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()},e.prototype._hide=function(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())},e.prototype._scheduleHide=function(){var t=this;this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet(function(){return t._hide()},500)},e}(u.a),D=function(t){function e(e,n){var i=this;(n=n||{}).mouseWheelSmoothScroll=!1;var r=new g.a(0,function(t){return o.G(t)});return(i=t.call(this,e,n,r)||this)._register(r),i}return N(e,t),e.prototype.setScrollPosition=function(t){this._scrollable.setScrollPositionNow(t)},e.prototype.getScrollPosition=function(){return this._scrollable.getCurrentScrollPosition()},e}(x),T=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return N(e,t),e}(x),O=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._element=e,i.onScroll(function(t){t.scrollTopChanged&&(i._element.scrollTop=t.scrollTop),t.scrollLeftChanged&&(i._element.scrollLeft=t.scrollLeft)}),i.scanDomNode(),i}return N(e,t),e.prototype.scanDomNode=function(){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})},e}(D);function A(t){var e={lazyRender:void 0!==t.lazyRender&&t.lazyRender,className:void 0!==t.className?t.className:"",useShadows:void 0===t.useShadows||t.useShadows,handleMouseWheel:void 0===t.handleMouseWheel||t.handleMouseWheel,flipAxes:void 0!==t.flipAxes&&t.flipAxes,alwaysConsumeMouseWheel:void 0!==t.alwaysConsumeMouseWheel&&t.alwaysConsumeMouseWheel,scrollYToX:void 0!==t.scrollYToX&&t.scrollYToX,mouseWheelScrollSensitivity:void 0!==t.mouseWheelScrollSensitivity?t.mouseWheelScrollSensitivity:1,mouseWheelSmoothScroll:void 0===t.mouseWheelSmoothScroll||t.mouseWheelSmoothScroll,arrowSize:void 0!==t.arrowSize?t.arrowSize:11,listenOnDomNode:void 0!==t.listenOnDomNode?t.listenOnDomNode:null,horizontal:void 0!==t.horizontal?t.horizontal:g.b.Auto,horizontalScrollbarSize:void 0!==t.horizontalScrollbarSize?t.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==t.horizontalSliderSize?t.horizontalSliderSize:0,horizontalHasArrows:void 0!==t.horizontalHasArrows&&t.horizontalHasArrows,vertical:void 0!==t.vertical?t.vertical:g.b.Auto,verticalScrollbarSize:void 0!==t.verticalScrollbarSize?t.verticalScrollbarSize:10,verticalHasArrows:void 0!==t.verticalHasArrows&&t.verticalHasArrows,verticalSliderSize:void 0!==t.verticalSliderSize?t.verticalSliderSize:0};return e.horizontalSliderSize=void 0!==t.horizontalSliderSize?t.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=void 0!==t.verticalSliderSize?t.verticalSliderSize:e.verticalScrollbarSize,r.d&&(e.className+=" mac"),e}},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var i,o=n(7),r=n(43),s=n(63),a=n(0),u=(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.onclick=function(t,e){this._register(a.f(t,a.c.CLICK,function(t){return e(new r.b(t))}))},e.prototype.onmousedown=function(t,e){this._register(a.f(t,a.c.MOUSE_DOWN,function(t){return e(new r.b(t))}))},e.prototype.onmouseover=function(t,e){this._register(a.f(t,a.c.MOUSE_OVER,function(t){return e(new r.b(t))}))},e.prototype.onnonbubblingmouseout=function(t,e){this._register(a.g(t,function(t){return e(new r.b(t))}))},e.prototype.onkeydown=function(t,e){this._register(a.f(t,a.c.KEY_DOWN,function(t){return e(new s.a(t))}))},e.prototype.onkeyup=function(t,e){this._register(a.f(t,a.c.KEY_UP,function(t){return e(new s.a(t))}))},e.prototype.oninput=function(t,e){this._register(a.f(t,a.c.INPUT,e))},e.prototype.onblur=function(t,e){this._register(a.f(t,a.c.BLUR,e))},e.prototype.onfocus=function(t,e){this._register(a.f(t,a.c.FOCUS,e))},e.prototype.onchange=function(t,e){this._register(a.f(t,a.c.CHANGE,e))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return s});var i=n(71),o=function(){return function(t,e){this.index=t,this.remainder=e}}(),r=function(){function t(t){this.values=t,this.prefixSum=new Uint32Array(t.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}return t.prototype.getCount=function(){return this.values.length},t.prototype.insertValues=function(t,e){t=Object(i.b)(t);var n=this.values,o=this.prefixSum,r=e.length;return 0!==r&&(this.values=new Uint32Array(n.length+r),this.values.set(n.subarray(0,t),0),this.values.set(n.subarray(t),t+r),this.values.set(e,t),t-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},t.prototype.changeValue=function(t,e){return t=Object(i.b)(t),e=Object(i.b)(e),this.values[t]!==e&&(this.values[t]=e,t-1=n.length)return!1;var r=n.length-t;return e>=r&&(e=r),0!==e&&(this.values=new Uint32Array(n.length-e),this.values.set(n.subarray(0,t),0),this.values.set(n.subarray(t+e),t),this.prefixSum=new Uint32Array(this.values.length),t-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},t.prototype.getTotalValue=function(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)},t.prototype.getAccumulatedValue=function(t){return t<0?0:(t=Object(i.b)(t),this._getAccumulatedValue(t))},t.prototype._getAccumulatedValue=function(t){if(t<=this.prefixSumValidIndex[0])return this.prefixSum[t];var e=this.prefixSumValidIndex[0]+1;0===e&&(this.prefixSum[0]=this.values[0],e++),t>=this.values.length&&(t=this.values.length-1);for(var n=e;n<=t;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],t),this.prefixSum[t]},t.prototype.getIndexOf=function(t){t=Math.floor(t),this.getTotalValue();for(var e,n,i,r=0,s=this.values.length-1;r<=s;)if(e=r+(s-r)/2|0,t<(i=(n=this.prefixSum[e])-this.values[e]))s=e-1;else{if(!(t>=n))break;r=e+1}return new o(e,t-i)},t}(),s=function(){function t(t){this._cacheAccumulatedValueStart=0,this._cache=null,this._actual=new r(t),this._bustCache()}return t.prototype._bustCache=function(){this._cacheAccumulatedValueStart=0,this._cache=null},t.prototype.insertValues=function(t,e){this._actual.insertValues(t,e)&&this._bustCache()},t.prototype.changeValue=function(t,e){this._actual.changeValue(t,e)&&this._bustCache()},t.prototype.removeValues=function(t,e){this._actual.removeValues(t,e)&&this._bustCache()},t.prototype.getTotalValue=function(){return this._actual.getTotalValue()},t.prototype.getAccumulatedValue=function(t){return this._actual.getAccumulatedValue(t)},t.prototype.getIndexOf=function(t){if(t=Math.floor(t),null!==this._cache){var e=t-this._cacheAccumulatedValueStart;if(e>=0&&ey;y++)if((m=e?_(s(p=t[y])[0],p[1]):_(t[y]))===c||m===l)return m}else for(g=v.call(t);!(p=g.next()).done;)if((m=o(g,_,p.value,e))===c||m===l)return m}).BREAK=c,e.RETURN=l},function(t,e){t.exports=function(t,e,n,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){"use strict";var i=n(35),o=n(54),r=n(55),s=n(48)("species");t.exports=function(t){var e=i[t];r&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var i=n(218),o=n(182).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,o)}},function(t,e,n){var i=n(31),o=n(217),r=n(182),s=n(183)("IE_PROTO"),a=function(){},u=function(){var t,e=n(185)("iframe"),i=r.length;for(e.style.display="none",n(181).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("