@kusto/monaco-kusto 7.0.0 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.0.0(f23f8fe8dd705f8413d0d094c76eb0af2131aace)
3
+ * monaco-kusto version: 7.2.0(ff25adc61b13954e5ec288fcdc16c92483943ef5)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
7
- define("vs/language/kusto/kustoMode",["exports","vs/editor/editor.main","./main-c8dacaab"],(function(e,t,n){"use strict";function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=r(t),i=["onDidProvideCompletionItems"];function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e,t){if("object"!==a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===a(t)?t:String(t)}var l=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._monacoInstance=t,this._defaults=n,this._worker=null,this._idleCheckInterval=self.setInterval((function(){return r._checkIfIdle()}),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange((function(){return r._saveStateAndStopWorker()}))}var t,n,r;return t=e,n=[{key:"_stopWorker",value:function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}},{key:"_saveStateAndStopWorker",value:function(){var e=this;this._worker&&this._worker.getProxy().then((function(t){t.getSchema().then((function(t){e._storedState={schema:t},e._stopWorker()}))}))}},{key:"dispose",value:function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}},{key:"_checkIfIdle",value:function(){if(this._worker){var e=this._defaults.getWorkerMaxIdleTime(),t=Date.now()-this._lastUsedTime;e>0&&t>e&&this._saveStateAndStopWorker()}}},{key:"_getClient",value:function(){var e=this;this._lastUsedTime=Date.now();var t=this._defaults.languageSettings;t.onDidProvideCompletionItems;var n=u(t,i);return this._client||(this._worker=this._monacoInstance.editor.createWebWorker({moduleId:"vs/language/kusto/kustoWorker",label:"kusto",createData:{languageSettings:n,languageId:"kusto"}}),this._client=this._worker.getProxy().then((function(t){return e._storedState?t.setSchema(e._storedState.schema).then((function(){return t})):t}))),this._client}},{key:"getLanguageServiceWorker",value:function(){for(var e,t=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this._getClient().then((function(t){e=t})).then((function(e){return t._worker.withSyncedResources(r)})).then((function(t){return e}))}}],n&&s(t.prototype,n),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f={name:"kusto",mimeTypes:["text/kusto"],displayName:"Kusto",defaultToken:"invalid",brackets:[["[","]","delimiter.square"],["(",")","delimiter.parenthesis"]],wordDefinition:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,promotedOperatorCommandTokens:["where","count","extend","join","limit","order","project","project-away","project-rename","project-reorder","project-keep","render","sort","summarize","distinct","take","top","top-nested","top-hitters","union","mv-expand","mv-apply","reduce","evaluate","parse","parse-where","parse-kv","sample","sample-distinct","make-series","getschema","serialize","invoke","as","scan"],operatorCommandTokens:["filter","fork","facet","range","consume","find","search","print","partition","lookup","where","count","extend","join","limit","order","project","project-away","project-rename","project-reorder","project-keep","render","sort","summarize","distinct","take","top","top-nested","top-hitters","union","mv-expand","mv-apply","reduce","evaluate","parse","parse-where","parse-kv","sample","sample-distinct","make-series","getschema","serialize","invoke","as","scan"],keywords:["by","on","contains","notcontains","containscs","notcontainscs","startswith","has","matches","regex","true","false","and","or","typeof","int","string","date","datetime","time","long","real","​boolean","bool"],operators:["+","-","*","/",">","<","==","<>","<=",">=","~","!~"],builtinFunctions:["countof","bin","extentid","extract","extractjson","floor","iif","isnull","isnotnull","notnull","isempty","isnotempty","notempty","now","re2","strcat","strlen","toupper","tostring","count","cnt","sum","min","max","avg"],tokenizer:{root:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@dqstrings"},{include:"@literals"},{include:"@comments"},[/[;,.]/,"delimiter"],[/[()\[\]]/,"@brackets"],[/[<>=!%&+\-*/|~^]/,"operator"],[/[\w@#\-$]+/,{cases:{"@keywords":"keyword","@promotedOperatorCommandTokens":"operator.sql","@operatorCommandTokens":"keyword","@operators":"operator","@builtinFunctions":"predefined","@default":"identifier"}}]],whitespace:[[/\s+/,"white"]],comments:[["\\/\\/+.*","comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/H'/,{token:"string.quote",bracket:"@open",next:"@string"}],[/h'/,{token:"string.quote",bracket:"@open",next:"@string"}],[/'/,{token:"string.quote",bracket:"@open",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],dqstrings:[[/H"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}],[/h"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}],[/"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}]],dqstring:[[/[^"]+/,"string"],[/""/,"string"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],literals:[[/datetime\(\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}(:\d{2}(\.\d{0,3})?)?)?\)/,"number"],[/time\((\d+(s(ec(onds?)?)?|m(in(utes?)?)?|h(ours?)?|d(ays?)?)|(\s*(('[^']+')|("[^"]+"))\s*))\)/,"number"],[/guid\([\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}\)/,"number"],[/typeof\((int|string|date|datetime|time|long|real|boolean|bool)\)/,"number"]]}};function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function m(e){var t=d(e);return null!=e&&("object"==t||"function"==t)}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}var h="object"==("undefined"==typeof global?"undefined":p(global))&&global&&global.Object===Object&&global;function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}var v="object"==("undefined"==typeof self?"undefined":g(self))&&self&&self.Object===Object&&self,y=h||v||Function("return this")(),b=function(){return y.Date.now()},w=/\s/;var k=/^\s+/;function _(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&w.test(e.charAt(t)););return t}(e)+1).replace(k,""):e}var S=y.Symbol,C=Object.prototype,x=C.hasOwnProperty,I=C.toString,L=S?S.toStringTag:void 0;var O=Object.prototype.toString;var j="[object Null]",P="[object Undefined]",T=S?S.toStringTag:void 0;function E(e){return null==e?void 0===e?P:j:T&&T in Object(e)?function(e){var t=x.call(e,L),n=e[L];try{e[L]=void 0;var r=!0}catch(e){}var o=I.call(e);return r&&(t?e[L]=n:delete e[L]),o}(e):function(e){return O.call(e)}(e)}function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}var M="[object Symbol]";function F(e){return"symbol"==A(e)||function(e){return null!=e&&"object"==D(e)}(e)&&E(e)==M}var N=NaN,V=/^[-+]0x[0-9a-f]+$/i,K=/^0b[01]+$/i,R=/^0o[0-7]+$/i,q=parseInt;function W(e){if("number"==typeof e)return e;if(F(e))return N;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=_(e);var n=K.test(e);return n||R.test(e)?q(e.slice(2),n?2:8):V.test(e)?N:+e}var z=Math.max,U=Math.min;function G(e,t,n){var r,o,i,a,u,s,c=0,l=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function h(e){var n=e-s;return void 0===s||n>=t||n<0||f&&e-c>=i}function g(){var e=b();if(h(e))return v(e);u=setTimeout(g,function(e){var n=t-(e-s);return f?U(n,i-(e-c)):n}(e))}function v(e){return u=void 0,d&&r?p(e):(r=o=void 0,a)}function y(){var e=b(),n=h(e);if(r=arguments,o=this,s=e,n){if(void 0===u)return function(e){return c=e,u=setTimeout(g,t),l?p(e):a}(s);if(f)return clearTimeout(u),u=setTimeout(g,t),p(s)}return void 0===u&&(u=setTimeout(g,t)),a}return t=W(t)||0,m(n)&&(l=!!n.leading,i=(f="maxWait"in n)?z(W(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==u&&clearTimeout(u),c=0,r=s=o=u=void 0},y.flush=function(){return void 0===u?a:v(b())},y}function H(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Q(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||Q(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e){return function(e){if(Array.isArray(e))return Y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Q(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(e,t){if(e){if("string"==typeof e)return Y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Y(e,t):void 0}}function Y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}function J(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */J=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),u=new x(o||[]);return r(a,"_invoke",{value:k(e,n,u)}),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function d(){}function m(){}function p(){}var h={};s(h,i,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(I([])));v&&v!==t&&n.call(v,i)&&(h=v);var y=p.prototype=d.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function o(r,i,a,u){var s=l(e[r],e,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==X(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,a,u)}),(function(e){o("throw",e,a,u)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return o("throw",e,a,u)}))}u(s.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function k(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return L()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=_(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=l(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function _(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=l(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return m.prototype=p,r(y,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=s(p,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,u,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),s(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),s(y,u,"Generator"),s(y,i,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=I,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function Z(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ee(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Z(i,r,o,a,u,"next",e)}function u(e){Z(i,r,o,a,u,"throw",e)}a(void 0)}))}}function te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ie(r.key),r)}}function re(e,t,n){return t&&ne(e.prototype,t),n&&ne(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function oe(e,t,n){return(t=ie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ie(e){var t=function(e,t){if("object"!==X(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==X(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===X(t)?t:String(t)}var ae=function(){function e(t,n,r,i,a){var u=this;te(this,e),oe(this,"_disposables",[]),oe(this,"_contentListener",Object.create(null)),oe(this,"_configurationListener",Object.create(null)),oe(this,"_schemaListener",Object.create(null)),oe(this,"_cursorListener",Object.create(null)),oe(this,"_debouncedValidations",Object.create(null)),this._monacoInstance=t,this._languageId=n,this._worker=r,this.defaults=i;var s,c=function(e){var t=e.getLanguageId(),n=e.uri.toString();if(t===u._languageId){var r=u.getOrCreateDebouncedValidation(e,t);u._contentListener[n]=e.onDidChangeContent((function(e){var t=ue(e);r(t)})),u._configurationListener[n]=u.defaults.onDidChange((function(){self.setTimeout((function(){return u._doValidate(e,t,[])}),0)})),u._schemaListener[n]=a((function(){self.setTimeout((function(){return u._doValidate(e,t,[])}),0)}))}},l=function(e){var t=e.getId();u._cursorListener[t]||(e.onDidDispose((function(){var e;null===(e=u._cursorListener[t])||void 0===e||e.dispose(),delete u._cursorListener[t]})),u._cursorListener[t]=e.onDidChangeCursorSelection((function(t){var n=e.getModel(),r=n.getLanguageId();if(r===u._languageId){var o=n.getOffsetAt(t.selection.getPosition());u.getOrCreateDebouncedValidation(n,r)([{start:o,end:o}])}})))},f=function(e){u._monacoInstance.editor.setModelMarkers(e,u._languageId,[]);var t=e.uri.toString(),n=u._contentListener[t];n&&(n.dispose(),delete u._contentListener[t]);var r=u._configurationListener[t];r&&(r.dispose(),delete u._configurationListener[t]);var o=u._schemaListener[t];o&&(o.dispose(),delete u._schemaListener[t]);var i=u._debouncedValidations[t];i&&(i.cancel(),delete u._debouncedValidations[t])};this.defaults.languageSettings.enableQuickFixes&&this._disposables.push(o.languages.registerCodeActionProvider(this._languageId,{provideCodeActions:(s=ee(J().mark((function e(t,n,r,o){var i,a,s,c;return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.getOffsetAt(n.getStartPosition()),a=t.getOffsetAt(n.getEndPosition()),s=r.markers.length>0,e.next=5,u.getMonacoCodeActions(t,i,a,s);case 5:return c=e.sent,e.abrupt("return",{actions:c,dispose:function(){}});case 7:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return s.apply(this,arguments)})})),this._disposables.push(this._monacoInstance.editor.onDidCreateEditor(l)),this._disposables.push(this._monacoInstance.editor.onDidCreateModel(c)),this._disposables.push(this._monacoInstance.editor.onWillDisposeModel(f)),this._disposables.push(this._monacoInstance.editor.onDidChangeModelLanguage((function(e){f(e.model),c(e.model)}))),this._disposables.push({dispose:function(){for(var e in u._contentListener)u._contentListener[e].dispose();for(var t in u._cursorListener)u._cursorListener[t].dispose();for(var n in u._debouncedValidations)u._debouncedValidations[n].cancel()}}),this._monacoInstance.editor.getModels().forEach(c),this._monacoInstance.editor.getEditors().forEach(l)}var t;return re(e,[{key:"getMonacoCodeActions",value:(t=ee(J().mark((function e(t,n,r,o){var i,a,u,s,c,l,f,d=this;return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=[],e.next=3,this._worker(t.uri);case 3:return a=e.sent,u=t.uri,e.next=7,a.getResultActions(u.toString(),n,r);case 7:s=e.sent,c=J().mark((function e(){var n,r,a,u,c;return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=s[l]).kind.includes("Extract Function")){e.next=3;break}return e.abrupt("return","continue");case 3:if("quickfix"!=(a=null!==(n=d.defaults.languageSettings.quickFixCodeActions)&&void 0!==n&&n.find((function(e){return r.kind.includes(e)}))?"quickfix":"custom")||o){e.next=6;break}return e.abrupt("return",{v:void 0});case 6:u=r.changes,c=u.map((function(e){var n,r=t.getPositionAt(e.start),o=t.getPositionAt(e.start+e.deleteLength);return{resource:t.uri,textEdit:{range:{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:o.lineNumber,endColumn:o.column},text:null!==(n=e.insertText)&&void 0!==n?n:""}}})),i.push({title:r.title,diagnostics:[],kind:a,edit:{edits:$(c)}});case 9:case"end":return e.stop()}}),e)})),l=0;case 10:if(!(l<s.length)){e.next=20;break}return e.delegateYield(c(),"t0",12);case 12:if("continue"!==(f=e.t0)){e.next=15;break}return e.abrupt("continue",17);case 15:if("object"!==X(f)){e.next=17;break}return e.abrupt("return",f.v);case 17:l++,e.next=10;break;case 20:return e.abrupt("return",i);case 21:case"end":return e.stop()}}),e,this)}))),function(e,n,r,o){return t.apply(this,arguments)})},{key:"getOrCreateDebouncedValidation",value:function(e,t){var n=this,r=e.uri.toString();return this._debouncedValidations[r]||(this._debouncedValidations[r]=G((function(r){return n._doValidate(e,t,r)}),500)),this._debouncedValidations[r]}},{key:"dispose",value:function(){this._disposables.forEach((function(e){return e&&e.dispose()})),this._disposables=[]}},{key:"_doValidate",value:function(e,t,n){var r=this;if(!e.isDisposed()){var i=e.uri,a=e.getVersionId();this._worker(i).then((function(e){return e.doValidation(i.toString(),n)})).then((function(e){if(r._monacoInstance.editor.getModel(i).getVersionId()===a){var n=e.map((function(e){return n="number"==typeof(t=e).code?String(t.code):t.code,{severity:se(t.severity),startLineNumber:t.range.start.line+1,startColumn:t.range.start.character+1,endLineNumber:t.range.end.line+1,endColumn:t.range.end.character+1,message:t.message,code:n,source:t.source};var t,n})),u=r._monacoInstance.editor.getModel(i),s=u.getAllDecorations().filter((function(e){return"squiggly-error"==e.options.className})).map((function(e){return e.id}));if(u&&u.getLanguageId()===t){var c=r.defaults.languageSettings.syntaxErrorAsMarkDown;if(c&&c.enableSyntaxErrorAsMarkDown){var l=c.header?"**".concat(c.header,"** \n\n"):"",f=c.icon?"![](".concat(c.icon,")"):"",d="".concat(f," ").concat(l),m=n.map((function(e){return{range:{startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn},options:{hoverMessage:{value:d+e.message},className:"squiggly-error",zIndex:100,overviewRuler:{color:"rgb(255, 18, 18, 0.7)",position:o.editor.OverviewRulerLane.Right},minimap:{color:"rgb(255, 18, 18, 0.7)",position:o.editor.MinimapPosition.Inline}}}})),p=o.editor.getModelMarkers({owner:t,resource:i});p&&p.length>0&&(s=[],r._monacoInstance.editor.setModelMarkers(u,t,[])),u.deltaDecorations(s,m)}else u.deltaDecorations(s,[]),r._monacoInstance.editor.setModelMarkers(u,t,n)}}})).then(void 0,(function(e){console.error(e)}))}}}]),e}();function ue(e){return e.changes.map((function(e){return{start:e.rangeOffset,end:e.rangeOffset+e.text.length}}))}function se(e){switch(e){case n.DiagnosticSeverity.Error:return o.MarkerSeverity.Error;case n.DiagnosticSeverity.Warning:return o.MarkerSeverity.Warning;case n.DiagnosticSeverity.Information:return o.MarkerSeverity.Info;case n.DiagnosticSeverity.Hint:return o.MarkerSeverity.Hint;default:return o.MarkerSeverity.Info}}for(var ce={PlainText:0,Comment:1,Punctuation:2,Directive:3,Literal:4,StringLiteral:5,Type:6,Column:7,Table:8,Database:9,Function:10,Parameter:11,Variable:12,Identifier:13,ClientParameter:14,QueryParameter:15,ScalarOperator:16,MathOperator:17,QueryOperator:18,Command:19,Keyword:20,MaterializedView:21,SchemaMember:22,SignatureParameter:23,Option:24},le={},fe=0,de=Object.entries(ce);fe<de.length;fe++){var me=B(de[fe],2),pe=me[0],he=me[1];le[he]=pe}var ge={Column:"C71585",Comment:"008000",Database:"C71585",Function:"0000FF",Identifier:"000000",Keyword:"0000FF",Literal:"B22222",ScalarOperator:"0000FF",MaterializedView:"C71585",MathOperator:"000000",Command:"0000FF",Parameter:"2B91AF",PlainText:"000000",Punctuation:"000000",QueryOperator:"CC3700",QueryParameter:"CC3700",StringLiteral:"B22222",Table:"C71585",Type:"0000FF",Variable:"191970",Directive:"9400D3",ClientParameter:"b5cea8",SchemaMember:"C71585",SignatureParameter:"2B91AF",Option:"000000"},ve={Column:"4ec9b0",Comment:"6A9B34",Database:"c586c0",Function:"dcdcaa",Identifier:"d4d4d4",Keyword:"569cd6",Literal:"ce9178",ScalarOperator:"569cd6",MaterializedView:"c586c0",MathOperator:"d4d4d4",Command:"d4d4d4",Parameter:"2B91AF",PlainText:"d4d4d4",Punctuation:"d4d4d4",QueryOperator:"9cdcfe",QueryParameter:"9cdcfe",StringLiteral:"ce9178",Table:"c586c0",Type:"569cd6",Variable:"d7ba7d",Directive:"b5cea8",ClientParameter:"b5cea8",SchemaMember:"4ec9b0",SignatureParameter:"2B91AF",Option:"d4d4d4"},ye=function(){function e(t,n,r,o,i){var a,u,s,c=this;te(this,e),oe(this,"_disposables",[]),oe(this,"_contentListener",Object.create(null)),oe(this,"_configurationListener",Object.create(null)),oe(this,"_schemaListener",Object.create(null)),oe(this,"decorations",[]),this._monacoInstance=t,this._languageId=n,this._worker=r,a=document.getElementsByTagName("head")[0],(u=document.createElement("style")).type="text/css",u.media="screen",a.appendChild(u),u.innerHTML=(s=Object.keys(ce).map((function(e){return{classification:e,colorLight:ge[e],colorDark:ve[e]}})),s).map((function(e){return".vs .".concat(e.classification," {color: #").concat(e.colorLight,";} .vs-dark .").concat(e.classification," {color: #").concat(e.colorDark,";}")})).join("\n");var l=function(e){var t=e.getLanguageId();if(t===c._languageId){var n=G((function(n){return c._doColorization(e,t,n)}),500);c._contentListener[e.uri.toString()]=e.onDidChangeContent((function(e){var t=ue(e);n(t)})),c._configurationListener[e.uri.toString()]=o.onDidChange((function(){self.setTimeout((function(){return c._doColorization(e,t,[])}),0)})),c._schemaListener[e.uri.toString()]=i((function(){self.setTimeout((function(){return c._doColorization(e,t,[])}),0)}))}},f=function(e){e.deltaDecorations(c.decorations,[]);var t=e.uri.toString(),n=c._contentListener[t];n&&(n.dispose(),delete c._contentListener[t]);var r=c._configurationListener[t];r&&(r.dispose(),delete c._configurationListener[t]);var o=c._configurationListener[t];o&&(o.dispose(),delete c._schemaListener[t])};this._disposables.push(this._monacoInstance.editor.onDidCreateModel(l)),this._disposables.push(this._monacoInstance.editor.onWillDisposeModel(f)),this._disposables.push(this._monacoInstance.editor.onDidChangeModelLanguage((function(e){f(e.model),l(e.model)}))),this._disposables.push({dispose:function(){for(var e in c._contentListener)c._contentListener[e].dispose()}}),this._monacoInstance.editor.getModels().forEach(l)}return re(e,[{key:"dispose",value:function(){this._disposables.forEach((function(e){return e&&e.dispose()})),this._disposables=[]}},{key:"_rangeDoesNotIntersectAny",value:function(e,t){return t.every((function(t){return e.startLineNumber>t.lastImpactedLine||e.endLineNumber<t.firstImpactedLine}))}},{key:"_doColorization",value:function(e,t,n){var r=this;if(!e.isDisposed()){var i=e.uri,a=e.getVersionId();this._worker(i).then((function(e){return e.doColorization(i.toString(),n)})).then((function(n){if(r._monacoInstance.editor.getModel(e.uri).getVersionId()===a){var i=n.map((function(t){var n=t.classifications.map((function(t){return function(e,t){var n=e.getPositionAt(t.start),r=e.getPositionAt(t.start+t.length),i=new o.Range(n.lineNumber,n.column,r.lineNumber,r.column),a=le[t.kind];return{range:i,options:{inlineClassName:a,stickiness:o.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}}(e,t)})).filter((function(e){return"PlainText"!==e.options.inlineClassName&&"Identifier"!=e.options.inlineClassName})),r=e.getPositionAt(t.absoluteStart).lineNumber,i=e.getPositionAt(t.absoluteEnd);return{decorations:n,firstImpactedLine:r,lastImpactedLine:1==i.column&&i.lineNumber>1?i.lineNumber-1:i.lineNumber}})),u=i.map((function(t){return e.getLinesDecorations(t.firstImpactedLine,t.lastImpactedLine).filter((function(e){return ge[e.options.inlineClassName]})).map((function(e){return e.id}))})).reduce((function(e,t){return e.concat(t)}),[]),s=i.reduce((function(e,t){return e.concat(t.decorations)}),[]);e&&e.getLanguageId()===t&&(r.decorations=e.deltaDecorations(u,s))}})).then(void 0,(function(e){console.error(e)}))}}}]),e}();function be(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function we(e){if(e)return new o.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function ke(e){var t=o.languages.CompletionItemKind;switch(e){case n.CompletionItemKind.Text:return t.Text;case n.CompletionItemKind.Method:return t.Method;case n.CompletionItemKind.Function:return t.Function;case n.CompletionItemKind.Constructor:return t.Constructor;case n.CompletionItemKind.Field:return t.Field;case n.CompletionItemKind.Variable:return t.Variable;case n.CompletionItemKind.Class:return t.Class;case n.CompletionItemKind.Interface:return t.Interface;case n.CompletionItemKind.Module:return t.Module;case n.CompletionItemKind.Property:return t.Property;case n.CompletionItemKind.Unit:return t.Unit;case n.CompletionItemKind.Value:return t.Value;case n.CompletionItemKind.Enum:return t.Enum;case n.CompletionItemKind.Keyword:return t.Keyword;case n.CompletionItemKind.Snippet:return t.Snippet;case n.CompletionItemKind.Color:return t.Color;case n.CompletionItemKind.File:return t.File;case n.CompletionItemKind.Reference:return t.Reference}return t.Property}function _e(e){if(e)return{range:we(e.range),text:e.newText}}function Se(e){if(e){return{value:e,isTrusted:!0,uris:new Proxy({},{get:function(e,t,n){var r=t.toString().replace(".md",""),i=r.startsWith("https")?r:"".concat("https://learn.microsoft.com/azure/data-explorer/kusto/query","/").concat(r);return o.Uri.parse(i)}})}}}var Ce=function(){function e(t,n){te(this,e),this._worker=t,this.languageSettings=n}return re(e,[{key:"triggerCharacters",get:function(){return[" "]}},{key:"provideCompletionItems",value:function(e,t,r,i){var a=e.getWordUntilPosition(t),u=new o.Range(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn),s=e.uri,c=this.languageSettings.onDidProvideCompletionItems;return this._worker(s).then((function(e){return e.doComplete(s.toString(),be(t))})).then((function(e){return c?c(e):e})).then((function(e){if(e){var t=e.items.map((function(e){var t,r={label:e.label,insertText:e.insertText,sortText:e.sortText,filterText:e.filterText,documentation:Se(null===(t=e.documentation)||void 0===t?void 0:t.value),detail:e.detail,range:u,kind:ke(e.kind)};return e.textEdit&&(r.range=we(e.textEdit.range),r.insertText=e.textEdit.newText),e.insertTextFormat===n.InsertTextFormat.Snippet&&(r.insertTextRules=o.languages.CompletionItemInsertTextRule.InsertAsSnippet),r}));return{isIncomplete:e.isIncomplete,suggestions:t}}}))}}]),e}();function xe(e){return"string"==typeof e?{value:e}:(t=e)&&"object"===X(t)&&"string"==typeof t.kind?"plaintext"===e.kind?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.value+"\n"+e.value+"\n```\n"};var t}function Ie(e){if(e)return Array.isArray(e)?e.map(xe):[xe(e)]}function Le(e){return{uri:o.Uri.parse(e.uri),range:we(e.range)}}var Oe=function(){function e(t){te(this,e),this._worker=t}return re(e,[{key:"provideDefinition",value:function(e,t,n){var r=e.uri;return this._worker(r).then((function(e){return e.findDefinition(r.toString(),be(t))})).then((function(e){if(e&&0!=e.length)return[Le(e[0])]}))}}]),e}(),je=function(){function e(t){te(this,e),this._worker=t}return re(e,[{key:"provideReferences",value:function(e,t,n,r){var o=e.uri;return this._worker(o).then((function(e){return e.findReferences(o.toString(),be(t))})).then((function(e){if(e)return e.map(Le)}))}}]),e}();var Pe=function(){function e(t){te(this,e),this._worker=t}return re(e,[{key:"provideRenameEdits",value:function(e,t,n,r){var i=e.uri;return this._worker(i).then((function(e){return e.doRename(i.toString(),be(t),n)})).then((function(e){return function(e){if(e&&e.changes){var t=[];for(var n in e.changes){var r,i=o.Uri.parse(n),a=H(e.changes[n]);try{for(a.s();!(r=a.n()).done;){var u=r.value;t.push({resource:i,textEdit:{range:we(u.range),text:u.newText},versionId:void 0})}}catch(e){a.e(e)}finally{a.f()}}return{edits:t}}}(e)}))}}]),e}(),Te=function(){function e(t){te(this,e),this._worker=t}return re(e,[{key:"provideDocumentFormattingEdits",value:function(e,t,n){var r=e.uri;return this._worker(r).then((function(e){return e.doDocumentFormat(r.toString()).then((function(e){return e.map((function(e){return _e(e)}))}))}))}}]),e}(),Ee=function(){function e(t){te(this,e),this._worker=t}return re(e,[{key:"provideDocumentRangeFormattingEdits",value:function(e,t,n,r){var o=e.uri;return this._worker(o).then((function(e){return e.doRangeFormat(o.toString(),function(e){if(e)return{start:be(e.getStartPosition()),end:be(e.getEndPosition())}}(t)).then((function(e){return e.map((function(e){return _e(e)}))}))}))}}]),e}(),De=function(){function e(t){te(this,e),this._worker=t}return re(e,[{key:"provideFoldingRanges",value:function(e,t,n){var r=e.uri;return this._worker(r).then((function(e){return e.doFolding(r.toString()).then((function(e){return e.map((function(e){return function(e){return{start:e.startLine+1,end:e.endLine+1,kind:o.languages.FoldingRangeKind.Region}}(e)}))}))}))}}]),e}();var Ae,Me,Fe=function(){function e(t){te(this,e),this._worker=t}return re(e,[{key:"provideHover",value:function(e,t,n){var r=e.uri;return this._worker(r).then((function(e){return e.doHover(r.toString(),be(t))})).then((function(e){if(e)return{range:we(e.range),contents:Ie(e.contents)}}))}}]),e}();function Ne(e){return Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(e)}function Ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(n),!0).forEach((function(t){Re(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Re(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Ne(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ne(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ne(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qe(e){return function(e){if(Array.isArray(e))return We(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return We(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return We(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function We(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ze=new Promise((function(e,t){Me=e}));e.getKustoWorker=function(){return ze.then((function(){return Ae}))},e.setupMode=function(e,t){var n,r=new o.Emitter,i=[],a=new l(t,e);i.push(a);var u=function(e){for(var t=function(e,t,n,o){t.setSchema(e).then((function(){r.fire(e)}))},n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return a.getLanguageServiceWorker.apply(a,qe([e].concat(o))).then((function(e){return Ke(Ke({},e),{},{setSchema:function(n){return t(n,e)},setSchemaFromShowSchema:function(n,r,o,i,a){e.normalizeSchema(n,r,o).then((function(e){return i?Ke(Ke({},e),{},{globalScalarParameters:i,globalTabularParameters:a}):e})).then((function(n){return t(n,e)}))}})}))},s="kusto";return i.push(t.languages.registerCompletionItemProvider(s,new Ce(u,e.languageSettings))),e.languageSettings.useTokenColorization&&(n=t.languages.setMonarchTokensProvider(s,f)),e.onDidChange((function(e){e.languageSettings.useTokenColorization||void 0===n||(n.dispose(),n=void 0),e.languageSettings.useTokenColorization&&null==n&&(n=t.languages.setMonarchTokensProvider(s,f))})),i.push(new ae(t,s,u,e,r.event)),i.push(new ye(t,s,u,e,r.event)),i.push(t.languages.registerDocumentRangeFormattingEditProvider(s,new Ee(u))),i.push(t.languages.registerFoldingRangeProvider(s,new De(u))),i.push(t.languages.registerDefinitionProvider(s,new Oe(u))),i.push(t.languages.registerRenameProvider(s,new Pe(u))),i.push(t.languages.registerReferenceProvider(s,new je(u))),e.languageSettings.enableHover&&i.push(t.languages.registerHoverProvider(s,new Fe(u))),t.languages.registerDocumentFormattingEditProvider(s,new Te(u)),Ae=u,Me(u),t.languages.setLanguageConfiguration(s,{folding:{offSide:!1,markers:{start:/^\s*[\r\n]/gm,end:/^\s*[\r\n]/gm}},comments:{lineComment:"//",blockComment:null}}),Ae}}));
7
+ define("vs/language/kusto/kustoMode",["exports","vs/editor/editor.main","./main-e51f94c9"],(function(t,e,n){"use strict";function r(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o=r(e),i=["onDidProvideCompletionItems"];function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,s(r.key),r)}}function s(t){var e=function(t,e){if("object"!==a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===a(e)?e:String(e)}var l=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._monacoInstance=e,this._defaults=n,this._worker=null,this._idleCheckInterval=self.setInterval((function(){return r._checkIfIdle()}),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange((function(){return r._saveStateAndStopWorker()}))}var e,n,r;return e=t,n=[{key:"_stopWorker",value:function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}},{key:"_saveStateAndStopWorker",value:function(){var t=this;this._worker&&this._worker.getProxy().then((function(e){e.getSchema().then((function(e){t._storedState={schema:e},t._stopWorker()}))}))}},{key:"dispose",value:function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}},{key:"_checkIfIdle",value:function(){if(this._worker){var t=this._defaults.getWorkerMaxIdleTime(),e=Date.now()-this._lastUsedTime;t>0&&e>t&&this._saveStateAndStopWorker()}}},{key:"_getClient",value:function(){var t=this;this._lastUsedTime=Date.now();var e=this._defaults.languageSettings;e.onDidProvideCompletionItems;var n=u(e,i);return this._client||(this._worker=this._monacoInstance.editor.createWebWorker({moduleId:"vs/language/kusto/kustoWorker",label:"kusto",createData:{languageSettings:n,languageId:"kusto"}}),this._client=this._worker.getProxy().then((function(e){return t._storedState?e.setSchema(t._storedState.schema).then((function(){return e})):e}))),this._client}},{key:"getLanguageServiceWorker",value:function(){for(var t,e=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this._getClient().then((function(e){t=e})).then((function(t){return e._worker.withSyncedResources(r)})).then((function(e){return t}))}}],n&&c(e.prototype,n),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),f={name:"kusto",mimeTypes:["text/kusto"],displayName:"Kusto",defaultToken:"invalid",brackets:[["[","]","delimiter.square"],["(",")","delimiter.parenthesis"]],wordDefinition:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,promotedOperatorCommandTokens:["where","count","extend","join","limit","order","project","project-away","project-rename","project-reorder","project-keep","render","sort","summarize","distinct","take","top","top-nested","top-hitters","union","mv-expand","mv-apply","reduce","evaluate","parse","parse-where","parse-kv","sample","sample-distinct","make-series","getschema","serialize","invoke","as","scan"],operatorCommandTokens:["filter","fork","facet","range","consume","find","search","print","partition","lookup","where","count","extend","join","limit","order","project","project-away","project-rename","project-reorder","project-keep","render","sort","summarize","distinct","take","top","top-nested","top-hitters","union","mv-expand","mv-apply","reduce","evaluate","parse","parse-where","parse-kv","sample","sample-distinct","make-series","getschema","serialize","invoke","as","scan"],keywords:["by","on","contains","notcontains","containscs","notcontainscs","startswith","has","matches","regex","true","false","and","or","typeof","int","string","date","datetime","time","long","real","​boolean","bool"],operators:["+","-","*","/",">","<","==","<>","<=",">=","~","!~"],builtinFunctions:["countof","bin","extentid","extract","extractjson","floor","iif","isnull","isnotnull","notnull","isempty","isnotempty","notempty","now","re2","strcat","strlen","toupper","tostring","count","cnt","sum","min","max","avg"],tokenizer:{root:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@dqstrings"},{include:"@literals"},{include:"@comments"},[/[;,.]/,"delimiter"],[/[()\[\]]/,"@brackets"],[/[<>=!%&+\-*/|~^]/,"operator"],[/[\w@#\-$]+/,{cases:{"@keywords":"keyword","@promotedOperatorCommandTokens":"operator.sql","@operatorCommandTokens":"keyword","@operators":"operator","@builtinFunctions":"predefined","@default":"identifier"}}]],whitespace:[[/\s+/,"white"]],comments:[["\\/\\/+.*","comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/H'/,{token:"string.quote",bracket:"@open",next:"@string"}],[/h'/,{token:"string.quote",bracket:"@open",next:"@string"}],[/'/,{token:"string.quote",bracket:"@open",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],dqstrings:[[/H"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}],[/h"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}],[/"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}]],dqstring:[[/[^"]+/,"string"],[/""/,"string"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],literals:[[/datetime\(\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}(:\d{2}(\.\d{0,3})?)?)?\)/,"number"],[/time\((\d+(s(ec(onds?)?)?|m(in(utes?)?)?|h(ours?)?|d(ays?)?)|(\s*(('[^']+')|("[^"]+"))\s*))\)/,"number"],[/guid\([\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}\)/,"number"],[/typeof\((int|string|date|datetime|time|long|real|boolean|bool)\)/,"number"]]}};function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function p(t){var e=d(t);return null!=t&&("object"==e||"function"==e)}function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}var m="object"==("undefined"==typeof global?"undefined":h(global))&&global&&global.Object===Object&&global;function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}var v="object"==("undefined"==typeof self?"undefined":g(self))&&self&&self.Object===Object&&self,y=m||v||Function("return this")(),b=function(){return y.Date.now()},w=/\s/;var k=/^\s+/;function _(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&w.test(t.charAt(e)););return e}(t)+1).replace(k,""):t}var S=y.Symbol,x=Object.prototype,L=x.hasOwnProperty,C=x.toString,I=S?S.toStringTag:void 0;var O=Object.prototype.toString;var j="[object Null]",P="[object Undefined]",E=S?S.toStringTag:void 0;function T(t){return null==t?void 0===t?P:j:E&&E in Object(t)?function(t){var e=L.call(t,I),n=t[I];try{t[I]=void 0;var r=!0}catch(t){}var o=C.call(t);return r&&(e?t[I]=n:delete t[I]),o}(t):function(t){return O.call(t)}(t)}function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}var F="[object Symbol]";function M(t){return"symbol"==A(t)||function(t){return null!=t&&"object"==D(t)}(t)&&T(t)==F}var N=NaN,V=/^[-+]0x[0-9a-f]+$/i,K=/^0b[01]+$/i,R=/^0o[0-7]+$/i,q=parseInt;function W(t){if("number"==typeof t)return t;if(M(t))return N;if(p(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=p(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=_(t);var n=K.test(t);return n||R.test(t)?q(t.slice(2),n?2:8):V.test(t)?N:+t}var z=Math.max,G=Math.min;function U(t,e,n){var r,o,i,a,u,c,s=0,l=!1,f=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function h(e){var n=r,i=o;return r=o=void 0,s=e,a=t.apply(i,n)}function m(t){var n=t-c;return void 0===c||n>=e||n<0||f&&t-s>=i}function g(){var t=b();if(m(t))return v(t);u=setTimeout(g,function(t){var n=e-(t-c);return f?G(n,i-(t-s)):n}(t))}function v(t){return u=void 0,d&&r?h(t):(r=o=void 0,a)}function y(){var t=b(),n=m(t);if(r=arguments,o=this,c=t,n){if(void 0===u)return function(t){return s=t,u=setTimeout(g,e),l?h(t):a}(c);if(f)return clearTimeout(u),u=setTimeout(g,e),h(c)}return void 0===u&&(u=setTimeout(g,e)),a}return e=W(e)||0,p(n)&&(l=!!n.leading,i=(f="maxWait"in n)?z(W(n.maxWait)||0,e):i,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=c=o=u=void 0},y.flush=function(){return void 0===u?a:v(b())},y}function H(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Q(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function B(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||Q(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(t){return function(t){if(Array.isArray(t))return Y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Q(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(t,e){if(t){if("string"==typeof t)return Y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Y(t,e):void 0}}function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function X(t){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X(t)}function J(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */J=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),u=new L(o||[]);return r(a,"_invoke",{value:k(t,n,u)}),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function d(){}function p(){}function h(){}var m={};c(m,i,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(C([])));v&&v!==e&&n.call(v,i)&&(m=v);var y=h.prototype=d.prototype=Object.create(m);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,u){var c=l(t[r],t,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==X(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function k(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return I()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=_(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function _(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=l(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:I}}function I(){return{value:void 0,done:!0}}return p.prototype=h,r(y,"constructor",{value:h,configurable:!0}),r(h,"constructor",{value:p,configurable:!0}),p.displayName=c(h,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,c(t,u,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(y),c(y,u,"Generator"),c(y,i,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Z(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function tt(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Z(i,r,o,a,u,"next",t)}function u(t){Z(i,r,o,a,u,"throw",t)}a(void 0)}))}}function et(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,it(r.key),r)}}function rt(t,e,n){return e&&nt(t.prototype,e),n&&nt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ot(t,e,n){return(e=it(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function it(t){var e=function(t,e){if("object"!==X(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==X(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===X(e)?e:String(e)}var at=function(){function t(e,n,r,i,a){var u=this;et(this,t),ot(this,"_disposables",[]),ot(this,"_contentListener",Object.create(null)),ot(this,"_configurationListener",Object.create(null)),ot(this,"_schemaListener",Object.create(null)),ot(this,"_cursorListener",Object.create(null)),ot(this,"_debouncedValidations",Object.create(null)),this._monacoInstance=e,this._languageId=n,this._worker=r,this.defaults=i;var c,s=function(t){var e=t.getLanguageId(),n=t.uri.toString();if(e===u._languageId){var r=u.getOrCreateDebouncedValidation(t,e);u._contentListener[n]=t.onDidChangeContent((function(t){var e=ut(t);r(e)})),u._configurationListener[n]=u.defaults.onDidChange((function(){self.setTimeout((function(){return u._doValidate(t,e,[])}),0)})),u._schemaListener[n]=a((function(){self.setTimeout((function(){return u._doValidate(t,e,[])}),0)}))}},l=function(t){var e=t.getId();u._cursorListener[e]||(t.onDidDispose((function(){var t;null===(t=u._cursorListener[e])||void 0===t||t.dispose(),delete u._cursorListener[e]})),u._cursorListener[e]=t.onDidChangeCursorSelection((function(e){var n=t.getModel(),r=n.getLanguageId();if(r===u._languageId){var o=n.getOffsetAt(e.selection.getPosition());u.getOrCreateDebouncedValidation(n,r)([{start:o,end:o}])}})))},f=function(t){u._monacoInstance.editor.setModelMarkers(t,u._languageId,[]);var e=t.uri.toString(),n=u._contentListener[e];n&&(n.dispose(),delete u._contentListener[e]);var r=u._configurationListener[e];r&&(r.dispose(),delete u._configurationListener[e]);var o=u._schemaListener[e];o&&(o.dispose(),delete u._schemaListener[e]);var i=u._debouncedValidations[e];i&&(i.cancel(),delete u._debouncedValidations[e])};this.defaults.languageSettings.enableQuickFixes&&this._disposables.push(o.languages.registerCodeActionProvider(this._languageId,{provideCodeActions:(c=tt(J().mark((function t(e,n,r,o){var i,a,c,s;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.getOffsetAt(n.getStartPosition()),a=e.getOffsetAt(n.getEndPosition()),c=r.markers.length>0,t.next=5,u.getMonacoCodeActions(e,i,a,c);case 5:return s=t.sent,t.abrupt("return",{actions:s,dispose:function(){}});case 7:case"end":return t.stop()}}),t)}))),function(t,e,n,r){return c.apply(this,arguments)})})),this._disposables.push(this._monacoInstance.editor.onDidCreateEditor(l)),this._disposables.push(this._monacoInstance.editor.onDidCreateModel(s)),this._disposables.push(this._monacoInstance.editor.onWillDisposeModel(f)),this._disposables.push(this._monacoInstance.editor.onDidChangeModelLanguage((function(t){f(t.model),s(t.model)}))),this._disposables.push({dispose:function(){for(var t in u._contentListener)u._contentListener[t].dispose();for(var e in u._cursorListener)u._cursorListener[e].dispose();for(var n in u._debouncedValidations)u._debouncedValidations[n].cancel()}}),this._monacoInstance.editor.getModels().forEach(s),this._monacoInstance.editor.getEditors().forEach(l)}var e;return rt(t,[{key:"getMonacoCodeActions",value:(e=tt(J().mark((function t(e,n,r,o){var i,a,u,c,s,l,f,d=this;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=[],t.next=3,this._worker(e.uri);case 3:return a=t.sent,u=e.uri,t.next=7,a.getResultActions(u.toString(),n,r);case 7:c=t.sent,s=J().mark((function t(){var n,r,a,u,s;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=c[l]).kind.includes("Extract Function")){t.next=3;break}return t.abrupt("return","continue");case 3:if("quickfix"!=(a=null!==(n=d.defaults.languageSettings.quickFixCodeActions)&&void 0!==n&&n.find((function(t){return r.kind.includes(t)}))?"quickfix":"custom")||o){t.next=6;break}return t.abrupt("return",{v:void 0});case 6:u=r.changes,s=u.map((function(t){var n,r=e.getPositionAt(t.start),o=e.getPositionAt(t.start+t.deleteLength);return{resource:e.uri,textEdit:{range:{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:o.lineNumber,endColumn:o.column},text:null!==(n=t.insertText)&&void 0!==n?n:""}}})),i.push({title:r.title,diagnostics:[],kind:a,edit:{edits:$(s)}});case 9:case"end":return t.stop()}}),t)})),l=0;case 10:if(!(l<c.length)){t.next=20;break}return t.delegateYield(s(),"t0",12);case 12:if("continue"!==(f=t.t0)){t.next=15;break}return t.abrupt("continue",17);case 15:if("object"!==X(f)){t.next=17;break}return t.abrupt("return",f.v);case 17:l++,t.next=10;break;case 20:return t.abrupt("return",i);case 21:case"end":return t.stop()}}),t,this)}))),function(t,n,r,o){return e.apply(this,arguments)})},{key:"getOrCreateDebouncedValidation",value:function(t,e){var n=this,r=t.uri.toString();return this._debouncedValidations[r]||(this._debouncedValidations[r]=U((function(r){return n._doValidate(t,e,r)}),500)),this._debouncedValidations[r]}},{key:"dispose",value:function(){this._disposables.forEach((function(t){return t&&t.dispose()})),this._disposables=[]}},{key:"_doValidate",value:function(t,e,n){var r=this;if(!t.isDisposed()){var i=t.uri,a=t.getVersionId();this._worker(i).then((function(t){return t.doValidation(i.toString(),n)})).then((function(t){if(r._monacoInstance.editor.getModel(i).getVersionId()===a){var n=t.map((function(t){return n="number"==typeof(e=t).code?String(e.code):e.code,{severity:ct(e.severity),startLineNumber:e.range.start.line+1,startColumn:e.range.start.character+1,endLineNumber:e.range.end.line+1,endColumn:e.range.end.character+1,message:e.message,code:n,source:e.source};var e,n})),u=r._monacoInstance.editor.getModel(i),c=u.getAllDecorations().filter((function(t){return"squiggly-error"==t.options.className})).map((function(t){return t.id}));if(u&&u.getLanguageId()===e){var s=r.defaults.languageSettings.syntaxErrorAsMarkDown;if(s&&s.enableSyntaxErrorAsMarkDown){var l=s.header?"**".concat(s.header,"** \n\n"):"",f=s.icon?"![](".concat(s.icon,")"):"",d="".concat(f," ").concat(l),p=n.map((function(t){return{range:{startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn},options:{hoverMessage:{value:d+t.message},className:"squiggly-error",zIndex:100,overviewRuler:{color:"rgb(255, 18, 18, 0.7)",position:o.editor.OverviewRulerLane.Right},minimap:{color:"rgb(255, 18, 18, 0.7)",position:o.editor.MinimapPosition.Inline}}}})),h=o.editor.getModelMarkers({owner:e,resource:i});h&&h.length>0&&(c=[],r._monacoInstance.editor.setModelMarkers(u,e,[])),u.deltaDecorations(c,p)}else u.deltaDecorations(c,[]),r._monacoInstance.editor.setModelMarkers(u,e,n)}}})).then(void 0,(function(t){console.error(t)}))}}}]),t}();function ut(t){return t.changes.map((function(t){return{start:t.rangeOffset,end:t.rangeOffset+t.text.length}}))}function ct(t){switch(t){case n.DiagnosticSeverity.Error:return o.MarkerSeverity.Error;case n.DiagnosticSeverity.Warning:return o.MarkerSeverity.Warning;case n.DiagnosticSeverity.Information:return o.MarkerSeverity.Info;case n.DiagnosticSeverity.Hint:return o.MarkerSeverity.Hint;default:return o.MarkerSeverity.Info}}for(var st={PlainText:0,Comment:1,Punctuation:2,Directive:3,Literal:4,StringLiteral:5,Type:6,Column:7,Table:8,Database:9,Function:10,Parameter:11,Variable:12,Identifier:13,ClientParameter:14,QueryParameter:15,ScalarOperator:16,MathOperator:17,QueryOperator:18,Command:19,Keyword:20,MaterializedView:21,SchemaMember:22,SignatureParameter:23,Option:24},lt={},ft=0,dt=Object.entries(st);ft<dt.length;ft++){var pt=B(dt[ft],2),ht=pt[0],mt=pt[1];lt[mt]=ht}var gt={Column:"C71585",Comment:"008000",Database:"C71585",Function:"0000FF",Identifier:"000000",Keyword:"0000FF",Literal:"B22222",ScalarOperator:"0000FF",MaterializedView:"C71585",MathOperator:"000000",Command:"0000FF",Parameter:"2B91AF",PlainText:"000000",Punctuation:"000000",QueryOperator:"CC3700",QueryParameter:"CC3700",StringLiteral:"B22222",Table:"C71585",Type:"0000FF",Variable:"191970",Directive:"9400D3",ClientParameter:"b5cea8",SchemaMember:"C71585",SignatureParameter:"2B91AF",Option:"000000"},vt={Column:"4ec9b0",Comment:"6A9B34",Database:"c586c0",Function:"dcdcaa",Identifier:"d4d4d4",Keyword:"569cd6",Literal:"ce9178",ScalarOperator:"569cd6",MaterializedView:"c586c0",MathOperator:"d4d4d4",Command:"d4d4d4",Parameter:"2B91AF",PlainText:"d4d4d4",Punctuation:"d4d4d4",QueryOperator:"9cdcfe",QueryParameter:"9cdcfe",StringLiteral:"ce9178",Table:"c586c0",Type:"569cd6",Variable:"d7ba7d",Directive:"b5cea8",ClientParameter:"b5cea8",SchemaMember:"4ec9b0",SignatureParameter:"2B91AF",Option:"d4d4d4"},yt=function(){function t(e,n,r,o,i){var a,u,c,s=this;et(this,t),ot(this,"_disposables",[]),ot(this,"_contentListener",Object.create(null)),ot(this,"_configurationListener",Object.create(null)),ot(this,"_schemaListener",Object.create(null)),ot(this,"decorations",[]),this._monacoInstance=e,this._languageId=n,this._worker=r,a=document.getElementsByTagName("head")[0],(u=document.createElement("style")).type="text/css",u.media="screen",a.appendChild(u),u.innerHTML=(c=Object.keys(st).map((function(t){return{classification:t,colorLight:gt[t],colorDark:vt[t]}})),c).map((function(t){return".vs .".concat(t.classification," {color: #").concat(t.colorLight,";} .vs-dark .").concat(t.classification," {color: #").concat(t.colorDark,";}")})).join("\n");var l=function(t){var e=t.getLanguageId();if(e===s._languageId){var n=U((function(n){return s._doColorization(t,e,n)}),500);s._contentListener[t.uri.toString()]=t.onDidChangeContent((function(t){var e=ut(t);n(e)})),s._configurationListener[t.uri.toString()]=o.onDidChange((function(){self.setTimeout((function(){return s._doColorization(t,e,[])}),0)})),s._schemaListener[t.uri.toString()]=i((function(){self.setTimeout((function(){return s._doColorization(t,e,[])}),0)}))}},f=function(t){t.deltaDecorations(s.decorations,[]);var e=t.uri.toString(),n=s._contentListener[e];n&&(n.dispose(),delete s._contentListener[e]);var r=s._configurationListener[e];r&&(r.dispose(),delete s._configurationListener[e]);var o=s._configurationListener[e];o&&(o.dispose(),delete s._schemaListener[e])};this._disposables.push(this._monacoInstance.editor.onDidCreateModel(l)),this._disposables.push(this._monacoInstance.editor.onWillDisposeModel(f)),this._disposables.push(this._monacoInstance.editor.onDidChangeModelLanguage((function(t){f(t.model),l(t.model)}))),this._disposables.push({dispose:function(){for(var t in s._contentListener)s._contentListener[t].dispose()}}),this._monacoInstance.editor.getModels().forEach(l)}return rt(t,[{key:"dispose",value:function(){this._disposables.forEach((function(t){return t&&t.dispose()})),this._disposables=[]}},{key:"_rangeDoesNotIntersectAny",value:function(t,e){return e.every((function(e){return t.startLineNumber>e.lastImpactedLine||t.endLineNumber<e.firstImpactedLine}))}},{key:"_doColorization",value:function(t,e,n){var r=this;if(!t.isDisposed()){var i=t.uri,a=t.getVersionId();this._worker(i).then((function(t){return t.doColorization(i.toString(),n)})).then((function(n){if(r._monacoInstance.editor.getModel(t.uri).getVersionId()===a){var i=n.map((function(e){var n=e.classifications.map((function(e){return function(t,e){var n=t.getPositionAt(e.start),r=t.getPositionAt(e.start+e.length),i=new o.Range(n.lineNumber,n.column,r.lineNumber,r.column),a=lt[e.kind];return{range:i,options:{inlineClassName:a,stickiness:o.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}}(t,e)})).filter((function(t){return"PlainText"!==t.options.inlineClassName&&"Identifier"!=t.options.inlineClassName})),r=t.getPositionAt(e.absoluteStart).lineNumber,i=t.getPositionAt(e.absoluteEnd);return{decorations:n,firstImpactedLine:r,lastImpactedLine:1==i.column&&i.lineNumber>1?i.lineNumber-1:i.lineNumber}})),u=i.map((function(e){return t.getLinesDecorations(e.firstImpactedLine,e.lastImpactedLine).filter((function(t){return gt[t.options.inlineClassName]})).map((function(t){return t.id}))})).reduce((function(t,e){return t.concat(e)}),[]),c=i.reduce((function(t,e){return t.concat(e.decorations)}),[]);t&&t.getLanguageId()===e&&(r.decorations=t.deltaDecorations(u,c))}})).then(void 0,(function(t){console.error(t)}))}}}]),t}();function bt(t){if(t)return{character:t.column-1,line:t.lineNumber-1}}function wt(t){if(t)return new o.Range(t.start.line+1,t.start.character+1,t.end.line+1,t.end.character+1)}function kt(t){var e=o.languages.CompletionItemKind;switch(t){case n.CompletionItemKind.Text:return e.Text;case n.CompletionItemKind.Method:return e.Method;case n.CompletionItemKind.Function:return e.Function;case n.CompletionItemKind.Constructor:return e.Constructor;case n.CompletionItemKind.Field:return e.Field;case n.CompletionItemKind.Variable:return e.Variable;case n.CompletionItemKind.Class:return e.Class;case n.CompletionItemKind.Interface:return e.Interface;case n.CompletionItemKind.Module:return e.Module;case n.CompletionItemKind.Property:return e.Property;case n.CompletionItemKind.Unit:return e.Unit;case n.CompletionItemKind.Value:return e.Value;case n.CompletionItemKind.Enum:return e.Enum;case n.CompletionItemKind.Keyword:return e.Keyword;case n.CompletionItemKind.Snippet:return e.Snippet;case n.CompletionItemKind.Color:return e.Color;case n.CompletionItemKind.File:return e.File;case n.CompletionItemKind.Reference:return e.Reference}return e.Property}function _t(t){if(t)return{range:wt(t.range),text:t.newText}}function St(t){if(t){return{value:t,isTrusted:!0,uris:new Proxy({},{get:function(t,e,n){var r=e.toString().replace(".md",""),i=r.startsWith("https")?r:"".concat("https://learn.microsoft.com/azure/data-explorer/kusto/query","/").concat(r);return o.Uri.parse(i)}})}}}var xt=function(){function t(e,n){et(this,t),this._worker=e,this.languageSettings=n}return rt(t,[{key:"triggerCharacters",get:function(){return[" "]}},{key:"provideCompletionItems",value:function(t,e,r,i){var a=t.getWordUntilPosition(e),u=new o.Range(e.lineNumber,a.startColumn,e.lineNumber,a.endColumn),c=t.uri,s=this.languageSettings.onDidProvideCompletionItems;return this._worker(c).then((function(t){return t.doComplete(c.toString(),bt(e))})).then((function(t){return s?s(t):t})).then((function(t){if(t){var e=t.items.map((function(t){var e,r={label:t.label,insertText:t.insertText,sortText:t.sortText,filterText:t.filterText,documentation:St(null===(e=t.documentation)||void 0===e?void 0:e.value),detail:t.detail,range:u,kind:kt(t.kind)};return t.textEdit&&(r.range=wt(t.textEdit.range),r.insertText=t.textEdit.newText),t.insertTextFormat===n.InsertTextFormat.Snippet&&(r.insertTextRules=o.languages.CompletionItemInsertTextRule.InsertAsSnippet),r}));return{isIncomplete:t.isIncomplete,suggestions:e}}}))}}]),t}();function Lt(t){return"string"==typeof t?{value:t}:(e=t)&&"object"===X(e)&&"string"==typeof e.kind?"plaintext"===t.kind?{value:t.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:t.value}:{value:"```"+t.value+"\n"+t.value+"\n```\n"};var e}function Ct(t){if(t)return Array.isArray(t)?t.map(Lt):[Lt(t)]}function It(t){return{uri:o.Uri.parse(t.uri),range:wt(t.range)}}var Ot=function(){function t(e){et(this,t),this._worker=e}return rt(t,[{key:"provideDefinition",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.findDefinition(r.toString(),bt(e))})).then((function(t){if(t&&0!=t.length)return[It(t[0])]}))}}]),t}(),jt=function(){function t(e){et(this,t),this._worker=e}return rt(t,[{key:"provideReferences",value:function(t,e,n,r){var o=t.uri;return this._worker(o).then((function(t){return t.findReferences(o.toString(),bt(e))})).then((function(t){if(t)return t.map(It)}))}}]),t}();var Pt=function(){function t(e){et(this,t),this._worker=e}return rt(t,[{key:"provideRenameEdits",value:function(t,e,n,r){var i=t.uri;return this._worker(i).then((function(t){return t.doRename(i.toString(),bt(e),n)})).then((function(t){return function(t){if(t&&t.changes){var e=[];for(var n in t.changes){var r,i=o.Uri.parse(n),a=H(t.changes[n]);try{for(a.s();!(r=a.n()).done;){var u=r.value;e.push({resource:i,textEdit:{range:wt(u.range),text:u.newText},versionId:void 0})}}catch(t){a.e(t)}finally{a.f()}}return{edits:e}}}(t)}))}}]),t}(),Et=function(){function t(e){et(this,t),this._worker=e}return rt(t,[{key:"provideDocumentFormattingEdits",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.doDocumentFormat(r.toString()).then((function(t){return t.map((function(t){return _t(t)}))}))}))}}]),t}(),Tt=function(){function t(e){et(this,t),this._worker=e}return rt(t,[{key:"provideDocumentRangeFormattingEdits",value:function(t,e,n,r){var o=t.uri;return this._worker(o).then((function(t){return t.doRangeFormat(o.toString(),function(t){if(t)return{start:bt(t.getStartPosition()),end:bt(t.getEndPosition())}}(e)).then((function(t){return t.map((function(t){return _t(t)}))}))}))}}]),t}(),Dt=function(){function t(e){et(this,t),this._worker=e}return rt(t,[{key:"provideFoldingRanges",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.doFolding(r.toString()).then((function(t){return t.map((function(t){return function(t){return{start:t.startLine+1,end:t.endLine+1,kind:o.languages.FoldingRangeKind.Region}}(t)}))}))}))}}]),t}();var At,Ft,Mt=function(){function t(e){et(this,t),this._worker=e}return rt(t,[{key:"provideHover",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.doHover(r.toString(),bt(e))})).then((function(t){if(t)return{range:wt(t.range),contents:Ct(t.contents)}}))}}]),t}();function Nt(t){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}function Vt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vt(Object(n),!0).forEach((function(e){Rt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Rt(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Nt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Nt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Nt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qt(t){return function(t){if(Array.isArray(t))return Wt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Wt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function zt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */zt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),u=new L(o||[]);return r(a,"_invoke",{value:k(t,n,u)}),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function d(){}function p(){}function h(){}var m={};c(m,i,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(C([])));v&&v!==e&&n.call(v,i)&&(m=v);var y=h.prototype=d.prototype=Object.create(m);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,u){var c=l(t[r],t,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==Nt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function k(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return I()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=_(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function _(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=l(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:I}}function I(){return{value:void 0,done:!0}}return p.prototype=h,r(y,"constructor",{value:h,configurable:!0}),r(h,"constructor",{value:p,configurable:!0}),p.displayName=c(h,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,c(t,u,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(y),c(y,u,"Generator"),c(y,i,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Gt(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function Ut(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Gt(i,r,o,a,u,"next",t)}function u(t){Gt(i,r,o,a,u,"throw",t)}a(void 0)}))}}var Ht=new Promise((function(t,e){Ft=t}));t.getKustoWorker=function(){return Ht.then((function(){return At}))},t.setupMode=function(t,e){var n,r=new o.Emitter,i=[],a=new l(e,t);i.push(a);var u=function(t){for(var e=function(){var t=Ut(zt().mark((function t(e,n){var o;return zt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=n.setSchema(e),t.next=3,o.then((function(){r.fire(e)}));case 3:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return a.getLanguageServiceWorker.apply(a,qt([t].concat(o))).then((function(t){return Kt(Kt({},t),{},{setSchema:function(n){return e(n,t)},setSchemaFromShowSchema:function(n,r,o,i,a){return Ut(zt().mark((function u(){return zt().wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,t.normalizeSchema(n,r,o).then((function(n){(i||a)&&(n=Kt(Kt({},n),{},{globalScalarParameters:i,globalTabularParameters:a})),e(n,t)}));case 2:case"end":return u.stop()}}),u)})))()}})}))},c="kusto";return i.push(e.languages.registerCompletionItemProvider(c,new xt(u,t.languageSettings))),t.languageSettings.useTokenColorization&&(n=e.languages.setMonarchTokensProvider(c,f)),t.onDidChange((function(t){t.languageSettings.useTokenColorization||void 0===n||(n.dispose(),n=void 0),t.languageSettings.useTokenColorization&&null==n&&(n=e.languages.setMonarchTokensProvider(c,f))})),i.push(new at(e,c,u,t,r.event)),i.push(new yt(e,c,u,t,r.event)),i.push(e.languages.registerDocumentRangeFormattingEditProvider(c,new Tt(u))),i.push(e.languages.registerFoldingRangeProvider(c,new Dt(u))),i.push(e.languages.registerDefinitionProvider(c,new Ot(u))),i.push(e.languages.registerRenameProvider(c,new Pt(u))),i.push(e.languages.registerReferenceProvider(c,new jt(u))),t.languageSettings.enableHover&&i.push(e.languages.registerHoverProvider(c,new Mt(u))),e.languages.registerDocumentFormattingEditProvider(c,new Et(u)),At=u,Ft(u),e.languages.setLanguageConfiguration(c,{folding:{offSide:!1,markers:{start:/^\s*[\r\n]/gm,end:/^\s*[\r\n]/gm}},comments:{lineComment:"//",blockComment:null}}),At}}));