@kusto/monaco-kusto 6.1.0 → 6.1.2
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.
- package/README.md +757 -0
- package/copyMonacoFilesAMD.js +28 -0
- package/package.json +14 -34
- package/release/dev/Kusto.Language.Bridge.min.js +2 -0
- package/release/dev/bridge.min.js +7 -0
- package/release/dev/kusto.javascript.client.min.js +1 -0
- package/release/dev/kustoMode.js +55 -22
- package/release/dev/kustoWorker.js +119 -118
- package/release/dev/{main-ac12725e.js → main-1f7cc4fa.js} +2 -2
- package/release/dev/monaco.contribution.js +7 -9
- package/release/dev/newtonsoft.json.min.js +7 -0
- package/release/esm/commandFormatter.d.ts +1 -1
- package/release/esm/commandHighlighter.d.ts +2 -2
- package/release/esm/extendedEditor.d.ts +1 -1
- package/release/esm/kusto.worker.js +28 -37
- package/release/esm/kustoMode.d.ts +3 -1
- package/release/esm/kustoMode.js +44 -16
- package/release/esm/kustoWorker.d.ts +5 -8
- package/release/esm/languageFeatures.d.ts +1 -1
- package/release/esm/languageService/kustoLanguageService.d.ts +2 -1
- package/release/esm/languageService/kustoMonarchLanguageDefinition.d.ts +2 -1
- package/release/esm/languageService/renderInfo.d.ts +5 -5
- package/release/esm/monaco.contribution.d.ts +3 -3
- package/release/esm/monaco.contribution.js +10 -8
- package/release/esm/workerManager.d.ts +1 -1
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +4 -4
- package/release/min/{main-5b1cc297.js → main-d13ce646.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/dev/commandFormatter.d.ts +0 -6
- package/release/dev/commandHighlighter.d.ts +0 -20
- package/release/dev/extendedEditor.d.ts +0 -7
- package/release/dev/kustoMode.d.ts +0 -8
- package/release/dev/kustoWorker.d.ts +0 -92
- package/release/dev/languageFeatures.d.ts +0 -91
- package/release/dev/languageService/kustoLanguageService.d.ts +0 -143
- package/release/dev/languageService/kustoMonarchLanguageDefinition.d.ts +0 -1
- package/release/dev/languageService/renderInfo.d.ts +0 -31
- package/release/dev/languageService/schema.d.ts +0 -144
- package/release/dev/languageService/settings.d.ts +0 -30
- package/release/dev/monaco.contribution.d.ts +0 -15
- package/release/dev/workerManager.d.ts +0 -23
- package/release/min/commandFormatter.d.ts +0 -6
- package/release/min/commandHighlighter.d.ts +0 -20
- package/release/min/extendedEditor.d.ts +0 -7
- package/release/min/kustoMode.d.ts +0 -8
- package/release/min/kustoWorker.d.ts +0 -92
- package/release/min/languageFeatures.d.ts +0 -91
- package/release/min/languageService/kustoLanguageService.d.ts +0 -143
- package/release/min/languageService/kustoMonarchLanguageDefinition.d.ts +0 -1
- package/release/min/languageService/renderInfo.d.ts +0 -31
- package/release/min/languageService/schema.d.ts +0 -144
- package/release/min/languageService/settings.d.ts +0 -30
- package/release/min/monaco.contribution.d.ts +0 -15
- package/release/min/monaco.d.ts +0 -1
- package/release/min/workerManager.d.ts +0 -23
package/release/dev/kustoMode.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 6.1.
|
|
3
|
+
* monaco-kusto version: 6.1.2(4c9ec21ad04b49f9f8e8a8f7fe773fe9a8b47334)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/kustoMode', ['exports', './main-
|
|
8
|
+
define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function (exports, main) { 'use strict';
|
|
9
9
|
|
|
10
10
|
var _excluded = ["onDidProvideCompletionItems"];
|
|
11
11
|
function _typeof$7(obj) { "@babel/helpers - typeof"; return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$7(obj); }
|
|
@@ -135,10 +135,13 @@ define('vs/language/kusto/kustoMode', ['exports', './main-ac12725e'], (function
|
|
|
135
135
|
displayName: 'Kusto',
|
|
136
136
|
defaultToken: 'invalid',
|
|
137
137
|
brackets: [['[', ']', 'delimiter.square'], ['(', ')', 'delimiter.parenthesis']],
|
|
138
|
+
// types are wrong
|
|
138
139
|
wordDefinition: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
|
139
140
|
// .slice() call is for creating a shallow copy of the array since bridge.net shoves a $type property on the array which monaco doesn't like.
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
// Kusto.Data.IntelliSense.CslCommandParser.PromotedOperatorCommandTokens.slice(0),
|
|
142
|
+
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'],
|
|
143
|
+
// Kusto.Data.IntelliSense.CslCommandParser.OperatorCommandTokens.slice(0),
|
|
144
|
+
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'],
|
|
142
145
|
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'],
|
|
143
146
|
operators: ['+', '-', '*', '/', '>', '<', '==', '<>', '<=', '>=', '~', '!~'],
|
|
144
147
|
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'],
|
|
@@ -673,7 +676,11 @@ define('vs/language/kusto/kustoMode', ['exports', './main-ac12725e'], (function
|
|
|
673
676
|
return debounced;
|
|
674
677
|
}
|
|
675
678
|
|
|
676
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(
|
|
679
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
680
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest(); }
|
|
681
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
682
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
683
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
677
684
|
function _toConsumableArray$1(arr) { return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1(); }
|
|
678
685
|
function _nonIterableSpread$1() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
679
686
|
function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
|
|
@@ -695,8 +702,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-ac12725e'], (function
|
|
|
695
702
|
var Range = monaco.Range;
|
|
696
703
|
monaco.Thenable;
|
|
697
704
|
monaco.CancellationToken;
|
|
698
|
-
monaco.IDisposable;
|
|
699
|
-
var ClassificationKind = Kusto.Language.Editor.ClassificationKind;
|
|
705
|
+
monaco.IDisposable; // --- diagnostics ---
|
|
700
706
|
var DiagnosticsAdapter = /*#__PURE__*/function () {
|
|
701
707
|
function DiagnosticsAdapter(_monacoInstance, _languageId, _worker, defaults, onSchemaChange) {
|
|
702
708
|
var _this = this;
|
|
@@ -1089,6 +1095,44 @@ define('vs/language/kusto/kustoMode', ['exports', './main-ac12725e'], (function
|
|
|
1089
1095
|
source: diag.source
|
|
1090
1096
|
};
|
|
1091
1097
|
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Copy of Kusto.Language.Editor.ClassificationKind we don't have to depend on it in this file
|
|
1100
|
+
*/
|
|
1101
|
+
var ClassificationKind = {
|
|
1102
|
+
PlainText: 0,
|
|
1103
|
+
Comment: 1,
|
|
1104
|
+
Punctuation: 2,
|
|
1105
|
+
Directive: 3,
|
|
1106
|
+
Literal: 4,
|
|
1107
|
+
StringLiteral: 5,
|
|
1108
|
+
Type: 6,
|
|
1109
|
+
Column: 7,
|
|
1110
|
+
Table: 8,
|
|
1111
|
+
Database: 9,
|
|
1112
|
+
Function: 10,
|
|
1113
|
+
Parameter: 11,
|
|
1114
|
+
Variable: 12,
|
|
1115
|
+
Identifier: 13,
|
|
1116
|
+
ClientParameter: 14,
|
|
1117
|
+
QueryParameter: 15,
|
|
1118
|
+
ScalarOperator: 16,
|
|
1119
|
+
MathOperator: 17,
|
|
1120
|
+
QueryOperator: 18,
|
|
1121
|
+
Command: 19,
|
|
1122
|
+
Keyword: 20,
|
|
1123
|
+
MaterializedView: 21,
|
|
1124
|
+
SchemaMember: 22,
|
|
1125
|
+
SignatureParameter: 23,
|
|
1126
|
+
Option: 24
|
|
1127
|
+
};
|
|
1128
|
+
var ClassificationKindNames = {};
|
|
1129
|
+
for (var _i = 0, _Object$entries = Object.entries(ClassificationKind); _i < _Object$entries.length; _i++) {
|
|
1130
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
1131
|
+
key = _Object$entries$_i[0],
|
|
1132
|
+
value = _Object$entries$_i[1];
|
|
1133
|
+
ClassificationKindNames[value] = key;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1092
1136
|
// commented here is the color definitions are were defined by v1 intellisense terminology:
|
|
1093
1137
|
// { token: 'comment', foreground: '008000' }, // CommentToken Green
|
|
1094
1138
|
// { token: 'variable.predefined', foreground: '800080' }, // CalculatedColumnToken Purple
|
|
@@ -1226,8 +1270,8 @@ define('vs/language/kusto/kustoMode', ['exports', './main-ac12725e'], (function
|
|
|
1226
1270
|
}));
|
|
1227
1271
|
this._disposables.push({
|
|
1228
1272
|
dispose: function dispose() {
|
|
1229
|
-
for (var
|
|
1230
|
-
_this5._contentListener[
|
|
1273
|
+
for (var _key3 in _this5._contentListener) {
|
|
1274
|
+
_this5._contentListener[_key3].dispose();
|
|
1231
1275
|
}
|
|
1232
1276
|
}
|
|
1233
1277
|
});
|
|
@@ -1323,22 +1367,11 @@ define('vs/language/kusto/kustoMode', ['exports', './main-ac12725e'], (function
|
|
|
1323
1367
|
return ColorizationAdapter;
|
|
1324
1368
|
}();
|
|
1325
1369
|
|
|
1326
|
-
/**
|
|
1327
|
-
* Gets all keys of an enum (the string keys not the numeric values).
|
|
1328
|
-
* @param e Enum type
|
|
1329
|
-
*/
|
|
1330
|
-
function getEnumKeys(e) {
|
|
1331
|
-
return Object.keys(e).filter(function (k) {
|
|
1332
|
-
return typeof e[k] === 'number';
|
|
1333
|
-
});
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
1370
|
/**
|
|
1337
1371
|
* Generates a mapping between ClassificationKind and color.
|
|
1338
1372
|
*/
|
|
1339
1373
|
function getClassificationColorTriplets() {
|
|
1340
|
-
var
|
|
1341
|
-
var result = keys.map(function (key) {
|
|
1374
|
+
var result = Object.keys(ClassificationKind).map(function (key) {
|
|
1342
1375
|
return {
|
|
1343
1376
|
classification: key,
|
|
1344
1377
|
colorLight: classificationToColorLight[key],
|
|
@@ -1379,7 +1412,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-ac12725e'], (function
|
|
|
1379
1412
|
var start = model.getPositionAt(classification.start);
|
|
1380
1413
|
var end = model.getPositionAt(classification.start + classification.length);
|
|
1381
1414
|
var range = new Range(start.lineNumber, start.column, end.lineNumber, end.column);
|
|
1382
|
-
var inlineClassName =
|
|
1415
|
+
var inlineClassName = ClassificationKindNames[classification.kind];
|
|
1383
1416
|
return {
|
|
1384
1417
|
range: range,
|
|
1385
1418
|
options: {
|
|
@@ -1,94 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 6.1.
|
|
3
|
+
* monaco-kusto version: 6.1.2(4c9ec21ad04b49f9f8e8a8f7fe773fe9a8b47334)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/kustoWorker', ['exports', './main-
|
|
9
|
-
|
|
10
|
-
// Definition of schema object in the context of language services. This model is exposed to consumers of this library.
|
|
11
|
-
|
|
12
|
-
// an input parameter either be a scalar in which case it has a name, type and cslType, or it can be columnar, in which case
|
|
13
|
-
// it will have a name, and a list of scalar types which are the column types.
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Schema types:
|
|
17
|
-
* Engine – The main schema type. Contains clusters, databases, tables, table columns and functions.
|
|
18
|
-
* Cluster Manager – Internal only. A schema for clusters that manages other clusters.
|
|
19
|
-
* Data Management – Internal only. A schema for ingestion point operations.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
var dotnetTypeToKustoType = {
|
|
23
|
-
'System.SByte': 'bool',
|
|
24
|
-
'System.Byte': 'uint8',
|
|
25
|
-
'System.Int16': 'int16',
|
|
26
|
-
'System.UInt16': 'uint16',
|
|
27
|
-
'System.Int32': 'int',
|
|
28
|
-
'System.UInt32': 'uint',
|
|
29
|
-
'System.Int64': 'long',
|
|
30
|
-
'System.UInt64': 'ulong',
|
|
31
|
-
'System.String': 'string',
|
|
32
|
-
'System.Single': 'float',
|
|
33
|
-
'System.Double': 'real',
|
|
34
|
-
'System.DateTime': 'datetime',
|
|
35
|
-
'System.TimeSpan': 'timespan',
|
|
36
|
-
'System.Guid': 'guid',
|
|
37
|
-
'System.Boolean': 'bool',
|
|
38
|
-
'Newtonsoft.Json.Linq.JArray': 'dynamic',
|
|
39
|
-
'Newtonsoft.Json.Linq.JObject': 'dynamic',
|
|
40
|
-
'Newtonsoft.Json.Linq.JToken': 'dynamic',
|
|
41
|
-
'System.Object': 'dynamic',
|
|
42
|
-
'System.Data.SqlTypes.SqlDecimal': 'decimal'
|
|
43
|
-
};
|
|
44
|
-
var getCslTypeNameFromClrType = function getCslTypeNameFromClrType(clrType) {
|
|
45
|
-
return dotnetTypeToKustoType[clrType] || clrType;
|
|
46
|
-
};
|
|
47
|
-
var kustoTypeToEntityDataType = {
|
|
48
|
-
object: 'Object',
|
|
49
|
-
bool: 'Boolean',
|
|
50
|
-
uint8: 'Byte',
|
|
51
|
-
int16: 'Int16',
|
|
52
|
-
uint16: 'UInt16',
|
|
53
|
-
int: 'Int32',
|
|
54
|
-
uint: 'UInt32',
|
|
55
|
-
long: 'Int64',
|
|
56
|
-
ulong: 'UInt64',
|
|
57
|
-
float: 'Single',
|
|
58
|
-
real: 'Double',
|
|
59
|
-
decimal: 'Decimal',
|
|
60
|
-
datetime: 'DateTime',
|
|
61
|
-
string: 'String',
|
|
62
|
-
dynamic: 'Dynamic',
|
|
63
|
-
timespan: 'TimeSpan'
|
|
64
|
-
};
|
|
65
|
-
var getEntityDataTypeFromCslType = function getEntityDataTypeFromCslType(cslType) {
|
|
66
|
-
return kustoTypeToEntityDataType[cslType] || cslType;
|
|
67
|
-
};
|
|
68
|
-
var getCallName = function getCallName(fn) {
|
|
69
|
-
return "".concat(fn.name, "(").concat(fn.inputParameters.map(function (p) {
|
|
70
|
-
return "{".concat(p.name, "}");
|
|
71
|
-
}).join(','), ")");
|
|
72
|
-
};
|
|
73
|
-
var getExpression = function getExpression(fn) {
|
|
74
|
-
return "let ".concat(fn.name, " = ").concat(getInputParametersAsCslString(fn.inputParameters), " ").concat(fn.body);
|
|
75
|
-
};
|
|
76
|
-
var getInputParametersAsCslString = function getInputParametersAsCslString(inputParameters) {
|
|
77
|
-
return "(".concat(inputParameters.map(function (inputParameter) {
|
|
78
|
-
return getInputParameterAsCslString(inputParameter);
|
|
79
|
-
}).join(','), ")");
|
|
80
|
-
};
|
|
81
|
-
var getInputParameterAsCslString = function getInputParameterAsCslString(inputParameter) {
|
|
82
|
-
// If this is a tabular parameter
|
|
83
|
-
if (inputParameter.columns && inputParameter.columns.length > 0) {
|
|
84
|
-
var attributesAsString = inputParameter.columns.map(function (col) {
|
|
85
|
-
return "".concat(col.name, ":").concat(col.cslType || getCslTypeNameFromClrType(col.type));
|
|
86
|
-
}).join(',');
|
|
87
|
-
return "".concat(inputParameter.name, ":").concat(attributesAsString === '' ? '*' : attributesAsString);
|
|
88
|
-
} else {
|
|
89
|
-
return "".concat(inputParameter.name, ":").concat(inputParameter.cslType || getCslTypeNameFromClrType(inputParameter.type));
|
|
90
|
-
}
|
|
91
|
-
};
|
|
8
|
+
define('vs/language/kusto/kustoWorker', ['exports', './main-1f7cc4fa'], (function (exports, main) { 'use strict';
|
|
92
9
|
|
|
93
10
|
function _slicedToArray$2(arr, i) { return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest$2(); }
|
|
94
11
|
function _nonIterableRest$2() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -3517,6 +3434,102 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-ac12725e'], (functio
|
|
|
3517
3434
|
unicodeProperties(XRegExp);
|
|
3518
3435
|
unicodeScripts(XRegExp);
|
|
3519
3436
|
|
|
3437
|
+
// Definition of schema object in the context of language services. This model is exposed to consumers of this library.
|
|
3438
|
+
|
|
3439
|
+
// an input parameter either be a scalar in which case it has a name, type and cslType, or it can be columnar, in which case
|
|
3440
|
+
// it will have a name, and a list of scalar types which are the column types.
|
|
3441
|
+
/**
|
|
3442
|
+
* Schema types:
|
|
3443
|
+
* Engine – The main schema type. Contains clusters, databases, tables, table columns and functions.
|
|
3444
|
+
* Cluster Manager – Internal only. A schema for clusters that manages other clusters.
|
|
3445
|
+
* Data Management – Internal only. A schema for ingestion point operations.
|
|
3446
|
+
*/
|
|
3447
|
+
var dotnetTypeToKustoType = {
|
|
3448
|
+
'System.SByte': 'bool',
|
|
3449
|
+
'System.Byte': 'uint8',
|
|
3450
|
+
'System.Int16': 'int16',
|
|
3451
|
+
'System.UInt16': 'uint16',
|
|
3452
|
+
'System.Int32': 'int',
|
|
3453
|
+
'System.UInt32': 'uint',
|
|
3454
|
+
'System.Int64': 'long',
|
|
3455
|
+
'System.UInt64': 'ulong',
|
|
3456
|
+
'System.String': 'string',
|
|
3457
|
+
'System.Single': 'float',
|
|
3458
|
+
'System.Double': 'real',
|
|
3459
|
+
'System.DateTime': 'datetime',
|
|
3460
|
+
'System.TimeSpan': 'timespan',
|
|
3461
|
+
'System.Guid': 'guid',
|
|
3462
|
+
'System.Boolean': 'bool',
|
|
3463
|
+
'Newtonsoft.Json.Linq.JArray': 'dynamic',
|
|
3464
|
+
'Newtonsoft.Json.Linq.JObject': 'dynamic',
|
|
3465
|
+
'Newtonsoft.Json.Linq.JToken': 'dynamic',
|
|
3466
|
+
'System.Object': 'dynamic',
|
|
3467
|
+
'System.Data.SqlTypes.SqlDecimal': 'decimal'
|
|
3468
|
+
};
|
|
3469
|
+
var getCslTypeNameFromClrType = function getCslTypeNameFromClrType(clrType) {
|
|
3470
|
+
return dotnetTypeToKustoType[clrType] || clrType;
|
|
3471
|
+
};
|
|
3472
|
+
var kustoTypeToEntityDataType = {
|
|
3473
|
+
object: 'Object',
|
|
3474
|
+
bool: 'Boolean',
|
|
3475
|
+
uint8: 'Byte',
|
|
3476
|
+
int16: 'Int16',
|
|
3477
|
+
uint16: 'UInt16',
|
|
3478
|
+
int: 'Int32',
|
|
3479
|
+
uint: 'UInt32',
|
|
3480
|
+
long: 'Int64',
|
|
3481
|
+
ulong: 'UInt64',
|
|
3482
|
+
float: 'Single',
|
|
3483
|
+
real: 'Double',
|
|
3484
|
+
decimal: 'Decimal',
|
|
3485
|
+
datetime: 'DateTime',
|
|
3486
|
+
string: 'String',
|
|
3487
|
+
dynamic: 'Dynamic',
|
|
3488
|
+
timespan: 'TimeSpan'
|
|
3489
|
+
};
|
|
3490
|
+
var getEntityDataTypeFromCslType = function getEntityDataTypeFromCslType(cslType) {
|
|
3491
|
+
return kustoTypeToEntityDataType[cslType] || cslType;
|
|
3492
|
+
};
|
|
3493
|
+
var getCallName = function getCallName(fn) {
|
|
3494
|
+
return "".concat(fn.name, "(").concat(fn.inputParameters.map(function (p) {
|
|
3495
|
+
return "{".concat(p.name, "}");
|
|
3496
|
+
}).join(','), ")");
|
|
3497
|
+
};
|
|
3498
|
+
var getExpression = function getExpression(fn) {
|
|
3499
|
+
return "let ".concat(fn.name, " = ").concat(getInputParametersAsCslString(fn.inputParameters), " ").concat(fn.body);
|
|
3500
|
+
};
|
|
3501
|
+
var getInputParametersAsCslString = function getInputParametersAsCslString(inputParameters) {
|
|
3502
|
+
return "(".concat(inputParameters.map(function (inputParameter) {
|
|
3503
|
+
return getInputParameterAsCslString(inputParameter);
|
|
3504
|
+
}).join(','), ")");
|
|
3505
|
+
};
|
|
3506
|
+
var getInputParameterAsCslString = function getInputParameterAsCslString(inputParameter) {
|
|
3507
|
+
// If this is a tabular parameter
|
|
3508
|
+
if (inputParameter.columns && inputParameter.columns.length > 0) {
|
|
3509
|
+
var attributesAsString = inputParameter.columns.map(function (col) {
|
|
3510
|
+
return "".concat(col.name, ":").concat(col.cslType || getCslTypeNameFromClrType(col.type));
|
|
3511
|
+
}).join(',');
|
|
3512
|
+
return "".concat(inputParameter.name, ":").concat(attributesAsString === '' ? '*' : attributesAsString);
|
|
3513
|
+
} else {
|
|
3514
|
+
return "".concat(inputParameter.name, ":").concat(inputParameter.cslType || getCslTypeNameFromClrType(inputParameter.type));
|
|
3515
|
+
}
|
|
3516
|
+
};
|
|
3517
|
+
|
|
3518
|
+
// If we're running in a web worker - which doesn't share global context with the main thread -
|
|
3519
|
+
// we need to manually load dependencies that are not explicit- meaning our non-module dependencies
|
|
3520
|
+
// generated by Bridge.Net
|
|
3521
|
+
if (typeof document == 'undefined') {
|
|
3522
|
+
// monaco will run the worker from vs/base/worker so the relative path needs
|
|
3523
|
+
// to be from there (hence going up 2 dirs) This stinks because we're
|
|
3524
|
+
// requiring the host app to put files in specific locations
|
|
3525
|
+
importScripts(
|
|
3526
|
+
'../../language/kusto/bridge.min.js',
|
|
3527
|
+
'../../language/kusto/kusto.javascript.client.min.js',
|
|
3528
|
+
'../../language/kusto/newtonsoft.json.min.js',
|
|
3529
|
+
'../../language/kusto/Kusto.Language.Bridge.min.js'
|
|
3530
|
+
);
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3520
3533
|
var _symbolKindToName;
|
|
3521
3534
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest(); }
|
|
3522
3535
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -3537,29 +3550,8 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-ac12725e'], (functio
|
|
|
3537
3550
|
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
3538
3551
|
function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
|
|
3539
3552
|
function _toPrimitive$1(input, hint) { if (_typeof$1(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof$1(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3540
|
-
|
|
3541
|
-
// polyfill string endsWith
|
|
3542
|
-
if (!String.prototype.endsWith) {
|
|
3543
|
-
String.prototype.endsWith = function (search, this_len) {
|
|
3544
|
-
if (this_len === undefined || this_len > this.length) {
|
|
3545
|
-
this_len = this.length;
|
|
3546
|
-
}
|
|
3547
|
-
return this.substring(this_len - search.length, this_len) === search;
|
|
3548
|
-
};
|
|
3549
|
-
}
|
|
3550
|
-
|
|
3551
|
-
// If we're running in a web worker - which doesn't share global context with the main thread -
|
|
3552
|
-
// we need to manually load dependencies that are not explicit- meaning our non-module dependencies
|
|
3553
|
-
// generated by Bridge.Net
|
|
3554
|
-
if (typeof document == 'undefined') {
|
|
3555
|
-
// monaco will run the worker from vs/base/worker so the relative path needs to be from there (hence going up 2 dirs)
|
|
3556
|
-
importScripts('../../language/kusto/bridge.min.js');
|
|
3557
|
-
importScripts('../../language/kusto/kusto.javascript.client.min.js');
|
|
3558
|
-
importScripts('../../language/kusto/Kusto.Language.Bridge.min.js');
|
|
3559
|
-
}
|
|
3560
3553
|
var k = Kusto.Data.IntelliSense;
|
|
3561
3554
|
var parsing = Kusto.Language.Parsing;
|
|
3562
|
-
Kusto.Language.Syntax;
|
|
3563
3555
|
var k2 = Kusto.Language.Editor;
|
|
3564
3556
|
var sym = Kusto.Language.Symbols;
|
|
3565
3557
|
var GlobalState = Kusto.Language.GlobalState;
|
|
@@ -3586,15 +3578,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-ac12725e'], (functio
|
|
|
3586
3578
|
}]);
|
|
3587
3579
|
return ParseProperties;
|
|
3588
3580
|
}();
|
|
3589
|
-
var TokenKind
|
|
3590
|
-
|
|
3591
|
-
/**
|
|
3592
|
-
* A plain old javascript object that is roughly equivalent to the @kusto/language-service-next object, but without
|
|
3593
|
-
* all the Bridge.Net properties and methods. this object is being sent from web worker to main thread and turns out
|
|
3594
|
-
* that when posting the message we lose all properties (and functions), thus we use a POJO instead.
|
|
3595
|
-
* This issue started happening once upgrading to 0.20.0 from 0.15.5.
|
|
3596
|
-
*/
|
|
3597
|
-
(function (TokenKind) {
|
|
3581
|
+
var TokenKind = /*#__PURE__*/function (TokenKind) {
|
|
3598
3582
|
TokenKind[TokenKind["TableToken"] = 2] = "TableToken";
|
|
3599
3583
|
TokenKind[TokenKind["TableColumnToken"] = 4] = "TableColumnToken";
|
|
3600
3584
|
TokenKind[TokenKind["OperatorToken"] = 8] = "OperatorToken";
|
|
@@ -3614,7 +3598,16 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-ac12725e'], (functio
|
|
|
3614
3598
|
TokenKind[TokenKind["PluginToken"] = 131072] = "PluginToken";
|
|
3615
3599
|
TokenKind[TokenKind["BracketRangeToken"] = 262144] = "BracketRangeToken";
|
|
3616
3600
|
TokenKind[TokenKind["ClientDirectiveToken"] = 524288] = "ClientDirectiveToken";
|
|
3617
|
-
|
|
3601
|
+
return TokenKind;
|
|
3602
|
+
}({});
|
|
3603
|
+
|
|
3604
|
+
/**
|
|
3605
|
+
* A plain old javascript object that is roughly equivalent to the @kusto/language-service-next object, but without
|
|
3606
|
+
* all the Bridge.Net properties and methods. this object is being sent from web worker to main thread and turns out
|
|
3607
|
+
* that when posting the message we lose all properties (and functions), thus we use a POJO instead.
|
|
3608
|
+
* This issue started happening once upgrading to 0.20.0 from 0.15.5.
|
|
3609
|
+
*/
|
|
3610
|
+
|
|
3618
3611
|
/**
|
|
3619
3612
|
* convert the bridge.net object to a plain javascript object that only contains data.
|
|
3620
3613
|
* @param k2Classifications @kusto/language-service-next bridge.net object
|
|
@@ -3843,6 +3836,10 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-ac12725e'], (functio
|
|
|
3843
3836
|
|
|
3844
3837
|
// Adding to columns a prefix to their sortText so they will appear first in the list
|
|
3845
3838
|
var sortTextPrefix = lsItem.kind === main.CompletionItemKind.Field ? 0 : itemsAsArray.length;
|
|
3839
|
+
var countOfWords = lsItem.label.split('_').length;
|
|
3840
|
+
// We always want results with multiple words to show after shorter options.
|
|
3841
|
+
// For example: to show "count_distinct" after "count"
|
|
3842
|
+
sortTextPrefix = sortTextPrefix * countOfWords;
|
|
3846
3843
|
var startPosition = document.positionAt(completionItems.EditStart);
|
|
3847
3844
|
var endPosition = document.positionAt(completionItems.EditStart + completionItems.EditLength);
|
|
3848
3845
|
lsItem.textEdit = main.TextEdit.replace(main.Range.create(startPosition, endPosition), textToInsert);
|
|
@@ -5799,9 +5796,13 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-ac12725e'], (functio
|
|
|
5799
5796
|
_result$location$rang = result.location.range,
|
|
5800
5797
|
start = _result$location$rang.start,
|
|
5801
5798
|
end = _result$location$rang.end;
|
|
5802
|
-
var range = new monaco.Range(start.line + 1, start.character + 1, end.line + 1, end.character + 1);
|
|
5803
5799
|
return {
|
|
5804
|
-
range:
|
|
5800
|
+
range: {
|
|
5801
|
+
startLineNumber: start.line + 1,
|
|
5802
|
+
startColumn: start.character + 1,
|
|
5803
|
+
endLineNumber: end.line + 1,
|
|
5804
|
+
endColumn: end.character + 1
|
|
5805
|
+
},
|
|
5805
5806
|
text: text
|
|
5806
5807
|
};
|
|
5807
5808
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 6.1.
|
|
3
|
+
* monaco-kusto version: 6.1.2(4c9ec21ad04b49f9f8e8a8f7fe773fe9a8b47334)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/main-
|
|
8
|
+
define('vs/language/kusto/main-1f7cc4fa', ['exports'], (function (exports) { 'use strict';
|
|
9
9
|
|
|
10
10
|
/* --------------------------------------------------------------------------------------------
|
|
11
11
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 6.1.
|
|
3
|
+
* monaco-kusto version: 6.1.2(4c9ec21ad04b49f9f8e8a8f7fe773fe9a8b47334)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/monaco.contribution', ['require', 'exports'], (function (require, exports) { 'use strict';
|
|
8
|
+
define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main'], (function (require, exports, editor_main) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _typeof$2(obj) { "@babel/helpers - typeof"; return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$2(obj); }
|
|
11
11
|
function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -19,7 +19,7 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports'], (functio
|
|
|
19
19
|
*/
|
|
20
20
|
var KustoCommandHighlighter = /*#__PURE__*/function () {
|
|
21
21
|
/**
|
|
22
|
-
* Register to cursor movement and
|
|
22
|
+
* Register to cursor movement and selection events.
|
|
23
23
|
* @param editor monaco editor instance
|
|
24
24
|
*/
|
|
25
25
|
function KustoCommandHighlighter(editor) {
|
|
@@ -28,7 +28,7 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports'], (functio
|
|
|
28
28
|
_defineProperty$2(this, "disposables", []);
|
|
29
29
|
_defineProperty$2(this, "decorations", []);
|
|
30
30
|
this.editor = editor;
|
|
31
|
-
// Note that selection update is triggered not only for selection changes, but also just when no text selection is
|
|
31
|
+
// Note that selection update is triggered not only for selection changes, but also just when no text selection is occurring and cursor just moves around.
|
|
32
32
|
// This case is counted as a 0-length selection starting and ending on the cursor position.
|
|
33
33
|
this.editor.onDidChangeCursorSelection(function (changeEvent) {
|
|
34
34
|
if (_this.editor.getModel().getLanguageId() !== 'kusto') {
|
|
@@ -165,17 +165,15 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports'], (functio
|
|
|
165
165
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
166
166
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
167
167
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
168
|
-
var Emitter = monaco.Emitter;
|
|
169
|
-
monaco.IEvent;
|
|
170
|
-
|
|
171
|
-
// declare var require: <T>(moduleId: [string], callback: (module: T) => void) => void;
|
|
172
168
|
|
|
173
169
|
// --- Kusto configuration and defaults ---------
|
|
174
170
|
|
|
175
171
|
var LanguageServiceDefaultsImpl = /*#__PURE__*/function () {
|
|
172
|
+
// in milliseconds. For example - this is 2 minutes 2 * 60 * 1000
|
|
173
|
+
|
|
176
174
|
function LanguageServiceDefaultsImpl(languageSettings) {
|
|
177
175
|
_classCallCheck(this, LanguageServiceDefaultsImpl);
|
|
178
|
-
_defineProperty(this, "_onDidChange", new Emitter());
|
|
176
|
+
_defineProperty(this, "_onDidChange", new monaco.Emitter());
|
|
179
177
|
this.setLanguageSettings(languageSettings);
|
|
180
178
|
// default to never kill worker when idle.
|
|
181
179
|
// reason: when killing worker - schema gets lost. We transmit the schema back to main process when killing
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @version : 1.17.0 - A Bridge.NET implementation of Newtonsoft.Json
|
|
3
|
+
* @author : Object.NET, Inc. http://www.bridge.net/
|
|
4
|
+
* @copyright : Copyright (c) 2008-2019, Object.NET, Inc. (http://www.object.net/). All rights reserved.
|
|
5
|
+
* @license : See license.txt and https://github.com/bridgedotnet/Bridge.NET/blob/master/LICENSE.
|
|
6
|
+
*/
|
|
7
|
+
Bridge.assembly("Newtonsoft.Json",function($asm,globals){"use strict";Bridge.define("Newtonsoft.Json.DefaultValueHandling",{$kind:"enum",statics:{fields:{Include:0,Ignore:1,Populate:2,IgnoreAndPopulate:3}},$flags:!0});Bridge.define("Newtonsoft.Json.Formatting",{$kind:"enum",statics:{fields:{None:0,Indented:1}}});Bridge.define("Newtonsoft.Json.JsonConstructorAttribute",{inherits:[System.Attribute]});Bridge.define("Newtonsoft.Json.JsonException",{inherits:[System.Exception],ctors:{ctor:function(){this.$initialize();System.Exception.ctor.call(this)},$ctor1:function(message){this.$initialize();System.Exception.ctor.call(this,message)},$ctor2:function(message,innerException){this.$initialize();System.Exception.ctor.call(this,message,innerException)}}});Bridge.define("Newtonsoft.Json.JsonIgnoreAttribute",{inherits:[System.Attribute]});Bridge.define("Newtonsoft.Json.JsonPropertyAttribute",{inherits:[System.Attribute],fields:{_nullValueHandling:null,_defaultValueHandling:null,_objectCreationHandling:null,_typeNameHandling:null,_required:null,_order:null},props:{NullValueHandling:{get:function(){var $t;return $t=this._nullValueHandling,$t!=null?$t:0},set:function(value){this._nullValueHandling=value}},DefaultValueHandling:{get:function(){var $t;return $t=this._defaultValueHandling,$t!=null?$t:0},set:function(value){this._defaultValueHandling=value}},ObjectCreationHandling:{get:function(){var $t;return $t=this._objectCreationHandling,$t!=null?$t:0},set:function(value){this._objectCreationHandling=value}},TypeNameHandling:{get:function(){var $t;return $t=this._typeNameHandling,$t!=null?$t:0},set:function(value){this._typeNameHandling=value}},Required:{get:function(){var $t;return $t=this._required,$t!=null?$t:Newtonsoft.Json.Required.Default},set:function(value){this._required=value}},Order:{get:function(){var $t;return $t=this._order,$t!=null?$t:Bridge.getDefaultValue(System.Int32)},set:function(value){this._order=value}},PropertyName:null},ctors:{ctor:function(){this.$initialize();System.Attribute.ctor.call(this)},$ctor1:function(propertyName){this.$initialize();System.Attribute.ctor.call(this);this.PropertyName=propertyName}}});Bridge.define("Newtonsoft.Json.JsonSerializerSettings",{statics:{fields:{DefaultNullValueHandling:0,DefaultTypeNameHandling:0},ctors:{init:function(){this.DefaultNullValueHandling=Newtonsoft.Json.NullValueHandling.Include;this.DefaultTypeNameHandling=Newtonsoft.Json.TypeNameHandling.None}}},fields:{_defaultValueHandling:null,_typeNameHandling:null,_nullValueHandling:null,_objectCreationHandling:null},props:{NullValueHandling:{get:function(){var $t;return $t=this._nullValueHandling,$t!=null?$t:Newtonsoft.Json.JsonSerializerSettings.DefaultNullValueHandling},set:function(value){this._nullValueHandling=value}},ObjectCreationHandling:{get:function(){var $t;return $t=this._objectCreationHandling,$t!=null?$t:0},set:function(value){this._objectCreationHandling=value}},DefaultValueHandling:{get:function(){var $t;return $t=this._defaultValueHandling,$t!=null?$t:0},set:function(value){this._defaultValueHandling=value}},TypeNameHandling:{get:function(){var $t;return $t=this._typeNameHandling,$t!=null?$t:Newtonsoft.Json.JsonSerializerSettings.DefaultTypeNameHandling},set:function(value){this._typeNameHandling=value}},ContractResolver:null,SerializationBinder:null}});Bridge.define("Newtonsoft.Json.NullValueHandling",{$kind:"enum",statics:{fields:{Include:0,Ignore:1}}});Bridge.define("Newtonsoft.Json.ObjectCreationHandling",{$kind:"enum",statics:{fields:{Auto:0,Reuse:1,Replace:2}}});Bridge.define("Newtonsoft.Json.Required",{$kind:"enum",statics:{fields:{Default:0,AllowNull:1,Always:2,DisallowNull:3}}});Bridge.define("Newtonsoft.Json.Serialization.IContractResolver",{$kind:"interface"});Bridge.define("Newtonsoft.Json.Serialization.ISerializationBinder",{$kind:"interface"});Bridge.define("Newtonsoft.Json.TypeNameHandling",{$kind:"enum",statics:{fields:{None:0,Objects:1,Arrays:2,All:3,Auto:4}},$flags:!0});Bridge.define("Newtonsoft.Json.Utils.AssemblyVersion",{statics:{fields:{version:null,compiler:null},ctors:{init:function(){this.version="1.17.0";this.compiler="17.10.0"}}}});Bridge.define("Newtonsoft.Json.JsonSerializationException",{inherits:[Newtonsoft.Json.JsonException],ctors:{ctor:function(){this.$initialize();Newtonsoft.Json.JsonException.ctor.call(this)},$ctor1:function(message){this.$initialize();Newtonsoft.Json.JsonException.$ctor1.call(this,message)},$ctor2:function(message,innerException){this.$initialize();Newtonsoft.Json.JsonException.$ctor2.call(this,message,innerException)}}});Bridge.define("Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver",{inherits:[Newtonsoft.Json.Serialization.IContractResolver]});Bridge.define("Newtonsoft.Json.JsonConvert",{statics:{methods:{stringify:function(value,formatting,settings){return formatting===Newtonsoft.Json.Formatting.Indented?JSON.stringify(value,null," "):JSON.stringify(value)},parse:function(value){try{return JSON.parse(value)}catch(e){if(e instanceof SyntaxError)try{return eval("("+value+")")}catch(e){throw new Newtonsoft.Json.JsonException(e.message);}throw new Newtonsoft.Json.JsonException(e.message);}},getEnumerableElementType:function(type){var interfaceType,interfaces,j;if(System.String.startsWith(type.$$name,"System.Collections.Generic.IEnumerable"))interfaceType=type;else for(interfaces=Bridge.Reflection.getInterfaces(type),j=0;j<interfaces.length;j++)if(System.String.startsWith(interfaces[j].$$name,"System.Collections.Generic.IEnumerable")){interfaceType=interfaces[j];break}return interfaceType?Bridge.Reflection.getGenericArguments(interfaceType)[0]:null},validateReflectable:function(type){do{var ignoreMetaData=type===System.Object||type===Object||type.$literal||type.$kind==="anonymous",nometa=!Bridge.getMetadata(type);if(!ignoreMetaData&&nometa){Bridge.$jsonGuard&&delete Bridge.$jsonGuard;throw new System.InvalidOperationException(Bridge.getTypeName(type)+" is not reflectable and cannot be serialized.");}type=ignoreMetaData?null:Bridge.Reflection.getBaseType(type)}while(!ignoreMetaData&&type!=null)},defaultGuard:function(){Bridge.$jsonGuard&&Bridge.$jsonGuard.pop()},getValue:function(obj,name){name=name.toLowerCase();for(var key in obj)if(key.toLowerCase()==name)return obj[key]},getCacheByType:function(type){for(var t,cfg,i=0;i<Newtonsoft.Json.$cache.length;i++)if(t=Newtonsoft.Json.$cache[i],t.type===type)return t;return cfg={type:type},Newtonsoft.Json.$cache.push(cfg),cfg},getMembers:function(type,memberCode){var cache=Newtonsoft.Json.JsonConvert.getCacheByType(type),members,hasOrder;return cache[memberCode]?cache[memberCode]:(members=Bridge.Reflection.getMembers(type,memberCode,52),hasOrder=!1,members=members.map(function(m){var attr=System.Attribute.getCustomAttributes(m,Newtonsoft.Json.JsonPropertyAttribute),defValueAttr=System.Attribute.getCustomAttributes(m,System.ComponentModel.DefaultValueAttribute);return{member:m,attr:attr&&attr.length>0?attr[0]:null,defaultValue:defValueAttr&&defValueAttr.length>0?defValueAttr[0].Value:Bridge.getDefaultValue(m.rt)}}).filter(function(cfg){return!hasOrder&&cfg.attr&&cfg.attr.Order&&(hasOrder=!0),(cfg.attr||cfg.member.a===2)&&System.Attribute.getCustomAttributes(cfg.member,Newtonsoft.Json.JsonIgnoreAttribute).length===0}),hasOrder&&members.sort(function(a,b){return(a.attr&&a.attr.Order||0)-(b.attr&&b.attr.Order||0)}),cache[memberCode]=members,members)},preRawProcess:function(cfg,instance,value,settings){var attr=cfg.attr,defaultValueHandling=attr&&attr._defaultValueHandling!=null?attr._defaultValueHandling:settings.DefaultValueHandling,required=attr&&attr.Required;if(value===undefined&&(defaultValueHandling===Newtonsoft.Json.DefaultValueHandling.Populate||defaultValueHandling===Newtonsoft.Json.DefaultValueHandling.IgnoreAndPopulate)&&(value=cfg.defaultValue),(required===Newtonsoft.Json.Required.AllowNull||required===Newtonsoft.Json.Required.Always)&&value===undefined)throw new Newtonsoft.Json.JsonSerializationException("Required property '"+cfg.member.n+"' not found in JSON.");if(required===Newtonsoft.Json.Required.Always&&value===null)throw new Newtonsoft.Json.JsonSerializationException("Required property '"+cfg.member.n+"' expects a value but got null.");if(required===Newtonsoft.Json.Required.DisallowNull&&value===null)throw new Newtonsoft.Json.JsonSerializationException("Property '"+cfg.member.n+"' expects a value but got null.");return{value:value}},preProcess:function(cfg,instance,value,settings){var attr=cfg.attr,defaultValueHandling=attr&&attr._defaultValueHandling!=null?attr._defaultValueHandling:settings.DefaultValueHandling,nullValueHandling=attr&&attr._nullValueHandling!=null?attr._nullValueHandling:settings.NullValueHandling;if(value==null&&nullValueHandling===Newtonsoft.Json.NullValueHandling.Ignore)return!1;var x=Bridge.unbox(value,!0),y=cfg.defaultValue,oneNull=x==null||y==null&&!(x==null&&y==null);return!oneNull&&Bridge.equals(x,y)&&(defaultValueHandling===Newtonsoft.Json.DefaultValueHandling.Ignore||defaultValueHandling===Newtonsoft.Json.DefaultValueHandling.IgnoreAndPopulate)?!1:{value:value}},PopulateObject:function(value,target,settings,schema){var targetType,raw,key,each,typeElement,i,inSchema,needSet,targetValue,result;if(settings=settings||{},targetType=Bridge.getType(target),raw=typeof value=="string"?Newtonsoft.Json.JsonConvert.parse(value):value,targetType.$nullable&&(targetType=targetType.$nullableType),raw!=null&&typeof raw=="object")if(Bridge.isArray(null,targetType)){if(raw.length===undefined)return;for(i=0;i<raw.length;i++)target.push(Newtonsoft.Json.JsonConvert.DeserializeObject(raw[i],targetType.$elementType,settings,!0))}else if(Bridge.Reflection.isAssignableFrom(System.Collections.IDictionary,targetType)){var typesGeneric=System.Collections.Generic.Dictionary$2.getTypeParameters(targetType),typeKey=typesGeneric[0]||System.Object,typeValue=typesGeneric[1]||System.Object,keys;if(Bridge.is(raw,System.Collections.IDictionary))for(keys=System.Linq.Enumerable.from(raw.getKeys()).ToArray(),i=0;i<keys.length;i++)key=keys[i],target.setItem(Newtonsoft.Json.JsonConvert.DeserializeObject(key,typeKey,settings,!0),Newtonsoft.Json.JsonConvert.DeserializeObject(raw.get(key),typeValue,settings,!0),!1);else for(each in raw)raw.hasOwnProperty(each)&&target.setItem(Newtonsoft.Json.JsonConvert.DeserializeObject(each,typeKey,settings,!0),Newtonsoft.Json.JsonConvert.DeserializeObject(raw[each],typeValue,settings,!0),!1)}else if(Bridge.Reflection.isAssignableFrom(System.Collections.IList,targetType)||Bridge.Reflection.isAssignableFrom(System.Collections.ICollection,targetType))for(typeElement=System.Collections.Generic.List$1.getElementType(targetType)||System.Object,Bridge.isArray(raw)||(raw=raw.ToArray?raw.ToArray():Bridge.Collections.EnumerableHelpers.ToArray(typeElement,raw)),i=0;i<raw.length;i++)target.add(Newtonsoft.Json.JsonConvert.DeserializeObject(raw[i],typeElement,settings,!0));else{for(var camelCase=settings&&Bridge.is(settings.ContractResolver,Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver),fields=Newtonsoft.Json.JsonConvert.getMembers(targetType,4),properties=Newtonsoft.Json.JsonConvert.getMembers(targetType,16),value,cfg,f,p,mname,i=0;i<fields.length;i++)if(cfg=fields[i],f=cfg.member,mname=cfg.attr&&cfg.attr.PropertyName||(camelCase?f.n.charAt(0).toLowerCase()+f.n.substr(1):f.n),value=raw[mname],value===undefined&&(value=Newtonsoft.Json.JsonConvert.getValue(raw,mname)),inSchema=(schema||raw)[mname],inSchema===undefined&&(inSchema=Newtonsoft.Json.JsonConvert.getValue(schema||raw,mname)),result=Newtonsoft.Json.JsonConvert.preRawProcess(cfg,schema||raw,inSchema,settings),inSchema=result.value,inSchema!==undefined){var needSet=value===null||value===!1||value===!0||typeof value=="number"||typeof value=="string",targetValue=Bridge.unbox(Bridge.Reflection.fieldAccess(f,target)),instance=Newtonsoft.Json.JsonConvert.DeserializeObject(value,f.rt,settings,!0),result=Newtonsoft.Json.JsonConvert.preProcess(cfg,target,targetValue,settings);result!==!1&&(targetValue=result.value,needSet||targetValue==null?Bridge.Reflection.fieldAccess(f,target,instance):Newtonsoft.Json.JsonConvert.PopulateObject(instance,targetValue,settings,value))}for(i=0;i<properties.length;i++)cfg=properties[i],p=cfg.member,mname=cfg.attr&&cfg.attr.PropertyName||(camelCase?p.n.charAt(0).toLowerCase()+p.n.substr(1):p.n),value=raw[mname],value===undefined&&(value=Newtonsoft.Json.JsonConvert.getValue(raw,mname)),inSchema=(schema||raw)[mname],inSchema===undefined&&(inSchema=Newtonsoft.Json.JsonConvert.getValue(schema||raw,mname)),result=Newtonsoft.Json.JsonConvert.preRawProcess(cfg,schema||raw,inSchema,settings),inSchema=result.value,inSchema!==undefined&&(needSet=value===null||value===!1||value===!0||typeof value=="number"||typeof value=="string",targetValue=Bridge.unbox(Bridge.Reflection.midel(p.g,target)()),instance=Newtonsoft.Json.JsonConvert.DeserializeObject(value,p.rt,settings,!0),result=Newtonsoft.Json.JsonConvert.preProcess(cfg,target,targetValue,settings),result!==!1&&(targetValue=result.value,needSet||targetValue==null?p.s?Bridge.Reflection.midel(p.s,target)(instance):type.$kind==="anonymous"&&(target[p.n]=instance):Newtonsoft.Json.JsonConvert.PopulateObject(instance,targetValue,settings,value)))}},BindToName:function(settings,type){if(settings&&settings.SerializationBinder&&settings.SerializationBinder.Newtonsoft$Json$Serialization$ISerializationBinder$BindToName){var asm={},name={};return settings.SerializationBinder.Newtonsoft$Json$Serialization$ISerializationBinder$BindToName(type,asm,name),name.v+(asm.v?", "+asm.v:"")}return Bridge.Reflection.getTypeQName(type)},BindToType:function(settings,fullName,objectType){var type;if(settings&&settings.SerializationBinder&&settings.SerializationBinder.Newtonsoft$Json$Serialization$ISerializationBinder$BindToType?(type=Newtonsoft.Json.JsonConvert.SplitFullyQualifiedTypeName(fullName),type=settings.SerializationBinder.Newtonsoft$Json$Serialization$ISerializationBinder$BindToType(type.assemblyName,type.typeName)):type=Bridge.Reflection.getType(fullName),!type)throw new Newtonsoft.Json.JsonSerializationException("Type specified in JSON '"+fullName+"' was not resolved.");if(objectType&&!Bridge.Reflection.isAssignableFrom(objectType,type))throw new Newtonsoft.Json.JsonSerializationException("Type specified in JSON '"+Bridge.Reflection.getTypeQName(type)+"' is not compatible with '"+Bridge.Reflection.getTypeQName(objectType)+"'.");return type},SplitFullyQualifiedTypeName:function(fullyQualifiedTypeName){var assemblyDelimiterIndex=Newtonsoft.Json.JsonConvert.GetAssemblyDelimiterIndex(fullyQualifiedTypeName),typeName,assemblyName;return assemblyDelimiterIndex!=null?(typeName=Newtonsoft.Json.JsonConvert.Trim(fullyQualifiedTypeName,0,System.Nullable.getValueOrDefault(assemblyDelimiterIndex,0)),assemblyName=Newtonsoft.Json.JsonConvert.Trim(fullyQualifiedTypeName,System.Nullable.getValueOrDefault(assemblyDelimiterIndex,0)+1|0,(fullyQualifiedTypeName.length-System.Nullable.getValueOrDefault(assemblyDelimiterIndex,0)|0)-1|0)):(typeName=fullyQualifiedTypeName,assemblyName=null),{typeName:typeName,assemblyName:assemblyName}},GetAssemblyDelimiterIndex:function(fullyQualifiedTypeName){for(var current,scope=0,i=0;i<fullyQualifiedTypeName.length;i=i+1|0){current=fullyQualifiedTypeName.charCodeAt(i);switch(current){case 91:scope=scope+1|0;break;case 93:scope=scope-1|0;break;case 44:if(scope===0)return i;break}}return null},Trim:function(s,start,length){var end=(start+length|0)-1|0;if(end>=s.length)throw new System.ArgumentOutOfRangeException.$ctor1("length");for(;start<end;start=start+1|0)if(!System.Char.isWhiteSpace(String.fromCharCode(s.charCodeAt(start))))break;for(;end>=start;end=end-1|0)if(!System.Char.isWhiteSpace(String.fromCharCode(s.charCodeAt(end))))break;return s.substr(start,(end-start|0)+1|0)},SerializeObject:function(obj,formatting,settings,returnRaw,possibleType,dictKey){var objType,type,name,arr,i,removeGuard,wasBoxed,d,json,entr,keyJson,typeElement,enumerator,item,raw,nometa,handling,writeType,key,properties,cfg,p,typeNameHandling,oldTypeNameHandling,midx;if(Bridge.is(formatting,Newtonsoft.Json.JsonSerializerSettings)&&(settings=formatting,formatting=0),obj==null)return settings&&settings.NullValueHandling===Newtonsoft.Json.NullValueHandling.Ignore?void 0:returnRaw?null:Newtonsoft.Json.JsonConvert.stringify(null,formatting,settings);if(objType=Bridge.getType(obj),possibleType&&objType&&(possibleType.$kind==="interface"||Bridge.Reflection.isAssignableFrom(possibleType,objType))&&(possibleType=null),possibleType&&possibleType.$nullable&&(possibleType=possibleType.$nullableType),possibleType&&possibleType===System.Char)return String.fromCharCode(obj);if(type=possibleType||objType,typeof obj=="function")return name=Bridge.getTypeName(obj),returnRaw?name:Newtonsoft.Json.JsonConvert.stringify(name,formatting,settings);else if(typeof obj=="object"){if(removeGuard=Newtonsoft.Json.JsonConvert.defaultGuard,Bridge.$jsonGuard||(Bridge.$jsonGuard=[],removeGuard=function(){delete Bridge.$jsonGuard}),Bridge.$jsonGuard.indexOf(obj)>-1)return;if(type===System.Globalization.CultureInfo||type===System.Guid||type===System.Uri||type===System.Int64||type===System.UInt64||type===System.Decimal||type===System.DateTime||type===System.DateTimeOffset||type===System.Char||Bridge.Reflection.isEnum(type)?removeGuard():Bridge.$jsonGuard.push(obj),wasBoxed=!1,obj&&obj.$boxed&&(obj=Bridge.unbox(obj,!0),wasBoxed=!0),type===System.Globalization.CultureInfo)return returnRaw?obj.name:Newtonsoft.Json.JsonConvert.stringify(obj.name,formatting,settings);else if(type===System.Guid)return returnRaw?Bridge.toString(obj):Newtonsoft.Json.JsonConvert.stringify(Bridge.toString(obj),formatting,settings);else if(type===System.Uri)return returnRaw?obj.getAbsoluteUri():Newtonsoft.Json.JsonConvert.stringify(obj.getAbsoluteUri(),formatting,settings);else if(type===System.Int64||type===System.UInt64||type===System.Decimal)return returnRaw?obj.toJSON():obj.toString();else if(type===System.DateTime)return d=System.DateTime.format(obj,"yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"),returnRaw?d:Newtonsoft.Json.JsonConvert.stringify(d,formatting,settings);else if(type===System.TimeSpan)return d=Bridge.toString(obj),returnRaw?d:Newtonsoft.Json.JsonConvert.stringify(d,formatting,settings);else if(type===System.DateTimeOffset)return d=obj.ToString$1("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"),returnRaw?d:Newtonsoft.Json.JsonConvert.stringify(d,formatting,settings);else if(Bridge.isArray(null,type)){if(type.$elementType===System.Byte)return removeGuard(),json=System.Convert.toBase64String(obj),returnRaw?json:Newtonsoft.Json.JsonConvert.stringify(json,formatting,settings);for(arr=[],i=0;i<obj.length;i++)arr.push(Newtonsoft.Json.JsonConvert.SerializeObject(obj[i],formatting,settings,!0,type.$elementType));obj=arr;settings&&settings._typeNameHandling&&(handling=settings._typeNameHandling,writeType=handling==2||handling==3||handling==4&&possibleType&&possibleType!==objType,writeType&&(obj={$type:Newtonsoft.Json.JsonConvert.BindToName(settings,type),$values:arr}))}else if(Bridge.Reflection.isEnum(type))return dictKey?System.Enum.getName(type,obj):returnRaw?obj:Newtonsoft.Json.JsonConvert.stringify(obj,formatting,settings);else if(type===System.Char)return returnRaw?String.fromCharCode(obj):Newtonsoft.Json.JsonConvert.stringify(String.fromCharCode(obj),formatting,settings);else if(Bridge.Reflection.isAssignableFrom(System.Collections.IDictionary,type)){var typesGeneric=System.Collections.Generic.Dictionary$2.getTypeParameters(type),typeKey=typesGeneric[0],typeValue=typesGeneric[1],dict={},enm=Bridge.getEnumerator(obj);for(settings&&settings._typeNameHandling&&(handling=settings._typeNameHandling,writeType=handling==1||handling==3||handling==4&&possibleType&&possibleType!==objType,writeType&&(dict.$type=Newtonsoft.Json.JsonConvert.BindToName(settings,type)));enm.moveNext();)entr=enm.Current,keyJson=Newtonsoft.Json.JsonConvert.SerializeObject(entr.key,formatting,settings,!0,typeKey,!0),typeof keyJson=="object"&&(keyJson=Bridge.toString(entr.key)),dict[keyJson]=Newtonsoft.Json.JsonConvert.SerializeObject(entr.value,formatting,settings,!0,typeValue);obj=dict}else if(Bridge.Reflection.isAssignableFrom(System.Collections.IEnumerable,type)){for(typeElement=Newtonsoft.Json.JsonConvert.getEnumerableElementType(type),enumerator=Bridge.getEnumerator(obj,typeElement),arr=[];enumerator.moveNext();)item=enumerator.Current,arr.push(Newtonsoft.Json.JsonConvert.SerializeObject(item,formatting,settings,!0,typeElement));obj=arr;settings&&settings._typeNameHandling&&(handling=settings._typeNameHandling,writeType=handling==2||handling==3||handling==4&&possibleType&&possibleType!==objType,writeType&&(obj={$type:Newtonsoft.Json.JsonConvert.BindToName(settings,type),$values:arr}))}else if(!wasBoxed){if(raw={},nometa=!Bridge.getMetadata(type),Newtonsoft.Json.JsonConvert.validateReflectable(type),settings&&settings._typeNameHandling&&(handling=settings._typeNameHandling,writeType=handling==1||handling==3||handling==4&&possibleType&&possibleType!==objType,writeType&&(raw.$type=Newtonsoft.Json.JsonConvert.BindToName(settings,type))),nometa)if(obj.toJSON)raw=obj.toJSON();else for(key in obj)obj.hasOwnProperty(key)&&(raw[key]=Newtonsoft.Json.JsonConvert.SerializeObject(obj[key],formatting,settings,!0));else{var fields=Newtonsoft.Json.JsonConvert.getMembers(type,4),camelCase=settings&&Bridge.is(settings.ContractResolver,Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver),methods=Bridge.Reflection.getMembers(type,8,54);if(methods.length>0)for(midx=0;midx<methods.length;midx++)System.Attribute.isDefined(methods[midx],System.Runtime.Serialization.OnSerializingAttribute,!1)&&Bridge.Reflection.midel(methods[midx],obj)(null);for(i=0;i<fields.length;i++){var cfg=fields[i],f=cfg.member,fname=cfg.attr&&cfg.attr.PropertyName||(camelCase?f.n.charAt(0).toLowerCase()+f.n.substr(1):f.n),value=Bridge.Reflection.fieldAccess(f,obj),result=Newtonsoft.Json.JsonConvert.preProcess(cfg,obj,value,settings||{});result!==!1&&(cfg.attr&&(typeNameHandling=cfg.attr._typeNameHandling),typeNameHandling!=null&&(settings=settings||{},oldTypeNameHandling=settings._typeNameHandling,settings._typeNameHandling=typeNameHandling),raw[fname]=Newtonsoft.Json.JsonConvert.SerializeObject(result.value,formatting,settings,!0,f.rt),typeNameHandling!=null&&(settings._typeNameHandling=oldTypeNameHandling))}for(properties=Newtonsoft.Json.JsonConvert.getMembers(type,16),i=0;i<properties.length;i++)if(cfg=properties[i],p=cfg.member,!!p.g){var pname=cfg.attr&&cfg.attr.PropertyName||(camelCase?p.n.charAt(0).toLowerCase()+p.n.substr(1):p.n),value=Bridge.Reflection.midel(p.g,obj)(),result=Newtonsoft.Json.JsonConvert.preProcess(cfg,obj,value,settings||{});result!==!1&&(cfg.attr&&(typeNameHandling=cfg.attr._typeNameHandling),typeNameHandling!=null&&(settings=settings||{},oldTypeNameHandling=settings._typeNameHandling,settings._typeNameHandling=typeNameHandling),raw[pname]=Newtonsoft.Json.JsonConvert.SerializeObject(result.value,formatting,settings,!0,p.rt),typeNameHandling!=null&&(settings._typeNameHandling=oldTypeNameHandling))}if(methods.length>0)for(midx=0;midx<methods.length;midx++)if(System.Attribute.isDefined(methods[midx],System.Runtime.Serialization.OnSerializedAttribute,!1)){Bridge.Reflection.midel(methods[midx],obj)(null);break}}obj=raw}removeGuard()}else if(Bridge.Reflection.isEnum(type))return dictKey?System.Enum.getName(type,obj):returnRaw?obj:Newtonsoft.Json.JsonConvert.stringify(obj,formatting,settings);return returnRaw?obj:Newtonsoft.Json.JsonConvert.stringify(obj,formatting,settings)},getInstanceBuilder:function(type,raw,settings){var rawIsArray=Bridge.isArray(raw),isEnumerable=rawIsArray&&Bridge.Reflection.isAssignableFrom(System.Collections.IEnumerable,type),isObject=typeof raw=="object"&&!rawIsArray,isList=!1,idx,useDefault,i,prm,name,j,params,fn;if(isEnumerable||isObject){var ctors=Bridge.Reflection.getMembers(type,1,54),publicCtors=[],hasDefault=!1,jsonCtor=null;if(type===System.Version)ctors=[Bridge.Reflection.getMembers(type,1,284,null,[System.Int32,System.Int32,System.Int32,System.Int32])],jsonCtor=ctors[0];else if(ctors.length>0)for(ctors=ctors.filter(function(c){return!c.isSynthetic}),idx=0;idx<ctors.length;idx++){var c=ctors[idx],hasAttribute=System.Attribute.getCustomAttributes(c,Newtonsoft.Json.JsonConstructorAttribute).length>0,isDefault=(c.pi||[]).length===0;if(isDefault&&(hasDefault=!0),hasAttribute){if(jsonCtor!=null)throw new Newtonsoft.Json.JsonException("Multiple constructors with the JsonConstructorAttribute.");jsonCtor=c}c.a===2&&publicCtors.push(c)}if(!hasDefault&&!jsonCtor&&type.$kind==="struct"){if(useDefault=!0,publicCtors.length>0){useDefault=!1;jsonCtor=publicCtors[0];var params=jsonCtor.pi||[],fields=Newtonsoft.Json.JsonConvert.getMembers(type,4),properties=Newtonsoft.Json.JsonConvert.getMembers(type,16);for(i=0;i<params.length;i++){for(prm=params[i],name=prm.sn||prm.n,j=0;j<properties.length;j++){var cfg=properties[i],p=cfg.member,mname=cfg.attr&&cfg.attr.PropertyName||p.n;if(name===mname||name.toLowerCase()===mname.toLowerCase()&&cfg.s){useDefault=!0;break}}if(!useDefault)for(j=0;j<fields.length;j++){var cfg=fields[i],f=cfg.member,mname=cfg.attr&&cfg.attr.PropertyName||f.n;if(name===mname||name.toLowerCase()===mname.toLowerCase()&&!cfg.ro){useDefault=!0;break}}if(useDefault)break}}useDefault&&(jsonCtor={td:type})}if(!hasDefault&&ctors.length>0){if(publicCtors.length!==1&&jsonCtor==null)throw new Newtonsoft.Json.JsonSerializationException("Unable to find a constructor to use for type "+Bridge.getTypeName(type)+". A class should either have a default constructor or one constructor with arguments.");return(jsonCtor==null&&(jsonCtor=publicCtors[0]),params=jsonCtor.pi||[],isEnumerable)?function(raw){var args=[],arr,elementType,commonElementInstanceBuilder,useSameInstanceBuilderForAllValues,firstElementTypeName,nextElementTypeName,i,item,inst,names,useBuilder,v;if(Bridge.Reflection.isAssignableFrom(System.Collections.IEnumerable,params[0].pt)){if(arr=[],elementType=Bridge.Reflection.getGenericArguments(params[0].pt)[0]||Bridge.Reflection.getGenericArguments(type)[0]||System.Object,settings&&settings._typeNameHandling&&raw.length>0&&raw[0]){if(useSameInstanceBuilderForAllValues=!0,firstElementTypeName=raw[0].$type,firstElementTypeName){for(i=1;i<raw.length;i++)if(nextElementTypeName=raw[i]?raw[i].$type:null,!nextElementTypeName||nextElementTypeName!==firstElementTypeName){useSameInstanceBuilderForAllValues=!1;break}}else useSameInstanceBuilderForAllValues=!1;commonElementInstanceBuilder=useSameInstanceBuilderForAllValues?Newtonsoft.Json.JsonConvert.getInstanceBuilder(elementType,raw[0],settings):null}else commonElementInstanceBuilder=null;for(i=0;i<raw.length;i++)item=raw[i],useBuilder=commonElementInstanceBuilder&&!commonElementInstanceBuilder.default,useBuilder&&(inst=commonElementInstanceBuilder(item),arr[i]=inst.value,names=inst.names),arr[i]=Newtonsoft.Json.JsonConvert.DeserializeObject(item,elementType,settings,!0,useBuilder?arr[i]:undefined,names);args.push(arr);isList=!0}return v=Bridge.Reflection.invokeCI(jsonCtor,args),isList?{$list:!0,names:[],value:v}:{names:[],value:v}}:function(raw){for(var j,args=[],names=[],keys=Object.getOwnPropertyNames(raw),i=0;i<params.length;i++){var prm=params[i],name=prm.sn||prm.n,foundName=null;for(j=0;j<keys.length;j++)if(name===keys[j]){foundName=keys[j];break}if(!foundName)for(name=name.toLowerCase(),j=0;j<keys.length;j++)if(name===keys[j].toLowerCase()){foundName=keys[j];break}name=foundName;name?(args[i]=Newtonsoft.Json.JsonConvert.DeserializeObject(raw[name],prm.pt,settings,!0),names.push(name)):args[i]=Bridge.getDefaultValue(prm.pt)}return{names:names,value:Bridge.Reflection.invokeCI(jsonCtor,args)}}}}return fn=function(){return{names:[],value:Bridge.createInstance(type),"default":!0}},fn.default=!0,fn},createInstance:function(type,raw,settings){var builder=this.getInstanceBuilder(type,raw,settings);return builder(raw)},needReuse:function(objectCreationHandling,value,type,isDefCtor){return(objectCreationHandling===Newtonsoft.Json.ObjectCreationHandling.Reuse||objectCreationHandling===Newtonsoft.Json.ObjectCreationHandling.Auto&&value!=null)&&isDefCtor&&type.$kind!=="struct"&&type.$kind!=="enum"&&type!==System.String&&type!==System.Boolean&&type!==System.Int64&&type!==System.UInt64&&type!==System.Int32&&type!==System.UInt32&&type!==System.Int16&&type!==System.UInt16&&type!==System.Byte&&type!==System.SByte&&type!==System.Single&&type!==System.Double&&type!==System.Decimal?!0:!1},tryToGetCastOperator:function(raw,type){var typesToLookFor,i,typeToLookFor,explicitCastOnTarget,implicitCastOnTarget;if(raw===null)return null;if(typeof raw=="boolean"||typeof raw=="string")typesToLookFor=[Bridge.getType(raw)];else if(typeof raw=="number")typesToLookFor=[System.Double,System.Int64];else return null;for(i=0;i<typesToLookFor.length;i++){if(typeToLookFor=typesToLookFor[i],explicitCastOnTarget=Bridge.Reflection.getMembers(type,8,284,"op_Explicit",[typeToLookFor]),explicitCastOnTarget)return function(value){return Bridge.Reflection.midel(explicitCastOnTarget,null)(value)};if(implicitCastOnTarget=Bridge.Reflection.getMembers(type,8,284,"op_Implicit",[typeToLookFor]),implicitCastOnTarget)return function(value){return Bridge.Reflection.midel(implicitCastOnTarget,null)(value)}}return null},DeserializeObject:function(raw,type,settings,field,instance,i_names){var tPrms,obj,isObject,fromObject,realType,def,isDecimal,isSpecial,isFloat,parsed,castOperator,arr,typeElement,list,dictionary,each,typeName,o,isDefCtor,names,methods,camelCase,fields,value,cfg,f,p,mname,finst,i,properties,result,currentValue,objectCreationHandling,typeNameHandling,oldTypeNameHandling,svalue,midx;if(settings=settings||{},type.$kind==="interface"&&(System.Collections.IDictionary===type?type=System.Collections.Generic.Dictionary$2(System.Object,System.Object):Bridge.Reflection.isGenericType(type)&&Bridge.Reflection.isAssignableFrom(System.Collections.Generic.IDictionary$2,Bridge.Reflection.getGenericTypeDefinition(type))?(tPrms=System.Collections.Generic.Dictionary$2.getTypeParameters(type),type=System.Collections.Generic.Dictionary$2(tPrms[0]||System.Object,tPrms[1]||System.Object)):type===System.Collections.IList||type===System.Collections.ICollection?type=System.Collections.Generic.List$1(System.Object):Bridge.Reflection.isGenericType(type)&&(Bridge.Reflection.isAssignableFrom(System.Collections.Generic.IList$1,Bridge.Reflection.getGenericTypeDefinition(type))||Bridge.Reflection.isAssignableFrom(System.Collections.Generic.ICollection$1,Bridge.Reflection.getGenericTypeDefinition(type)))&&(type=System.Collections.Generic.List$1(System.Collections.Generic.List$1.getElementType(type)||System.Object))),field||typeof raw!="string"||(obj=Newtonsoft.Json.JsonConvert.parse(raw),(typeof obj=="object"||Bridge.isArray(obj)||type===System.Array.type(System.Byte,1)||type===Function||type==System.Type||type===System.Guid||type===System.Globalization.CultureInfo||type===System.Uri||type===System.DateTime||type===System.DateTimeOffset||type===System.Char||Bridge.Reflection.isEnum(type))&&(raw=obj)),isObject=type===Object||type===System.Object,fromObject=Bridge.isObject(raw),isObject&&fromObject&&raw&&raw.$type&&(realType=Newtonsoft.Json.JsonConvert.BindToType(settings,raw.$type,type),type=realType,isObject=!1),isObject&&fromObject||type.$literal&&!Bridge.getMetadata(type))return Bridge.merge(isObject?{}:instance||Bridge.createInstance(type),raw);if(def=Bridge.getDefaultValue(type),type.$nullable&&(type=type.$nullableType),raw===null)return def;else if(raw===!1)return type===System.Boolean?!1:type===System.String?"false":(castOperator=Newtonsoft.Json.JsonConvert.tryToGetCastOperator(raw,type),castOperator)?castOperator(raw):isObject?Bridge.box(raw,System.Boolean,System.Boolean.toString):def;else if(raw===!0)if(type===System.Boolean)return!0;else if(type===System.Int64)return System.Int64(1);else if(type===System.UInt64)return System.UInt64(1);else if(type===System.Decimal)return System.Decimal(1);else if(type===String.String)return"true";else if(type===System.DateTime)return System.DateTime.create$2(1,0);else if(type===System.DateTimeOffset)return System.DateTimeOffset.MinValue.$clone();else if(Bridge.Reflection.isEnum(type))return Bridge.unbox(System.Enum.parse(type,1));else{if(typeof def=="number")return def+1;if(castOperator=Newtonsoft.Json.JsonConvert.tryToGetCastOperator(raw,type),castOperator)return castOperator(raw);if(isObject)return Bridge.box(raw,System.Boolean,System.Boolean.toString);throw new System.ArgumentException(System.String.format("Could not cast or convert from {0} to {1}",Bridge.getTypeName(raw),Bridge.getTypeName(type)));}else if(typeof raw=="number"){if(type.$number&&!type.$is(raw)&&(type!==System.Decimal||!type.tryParse(raw,null,{}))&&(!System.Int64.is64BitType(type)||!type.tryParse(raw.toString(),{})))throw new Newtonsoft.Json.JsonException(System.String.format("Input string '{0}' is not a valid {1}",raw,Bridge.getTypeName(type)));if(type===System.Boolean)return raw!==0;else if(Bridge.Reflection.isEnum(type))return Bridge.unbox(System.Enum.parse(type,raw));else if(type===System.SByte)return raw|0;else if(type===System.Byte)return raw>>>0;else if(type===System.Int16)return raw|0;else if(type===System.UInt16)return raw>>>0;else if(type===System.Int32)return raw|0;else if(type===System.UInt32)return raw>>>0;else if(type===System.Int64)return System.Int64(raw);else if(type===System.UInt64)return System.UInt64(raw);else if(type===System.Single)return raw;else if(type===System.Double)return raw;else if(type===System.Decimal)return System.Decimal(raw);else if(type===System.Char)return raw|0;else if(type===System.String)return raw.toString();else if(type===System.DateTime)return System.DateTime.create$2(raw|0,0);else if(type===System.TimeSpan)return System.TimeSpan.fromTicks(raw);else if(type===System.DateTimeOffset)return new System.DateTimeOffset.$ctor5(System.Int64(raw|0),(new System.DateTimeOffset.ctor).Offset);else{if(castOperator=Newtonsoft.Json.JsonConvert.tryToGetCastOperator(raw,type),castOperator)return castOperator(raw);if(isObject)return Bridge.box(raw,Bridge.getType(raw));throw new System.ArgumentException(System.String.format("Could not cast or convert from {0} to {1}",Bridge.getTypeName(raw),Bridge.getTypeName(type)));}}else if(typeof raw=="string"){if(isDecimal=type===System.Decimal,isSpecial=isDecimal||System.Int64.is64BitType(type),isSpecial&&(isDecimal?!type.tryParse(raw,null,{}):!type.tryParse(raw,{})))throw new Newtonsoft.Json.JsonException(System.String.format("Input string '{0}' is not a valid {1}",raw,Bridge.getTypeName(type)));if(isFloat=type==System.Double||type==System.Single,!isSpecial&&type.$number&&(isFloat?!type.tryParse(raw,null,{}):!type.tryParse(raw,{})))throw new Newtonsoft.Json.JsonException(System.String.format("Could not convert {0} to {1}: {2}",Bridge.getTypeName(raw),Bridge.getTypeName(type),raw));if(type===Function||type==System.Type)return Bridge.Reflection.getType(raw);else if(type===System.Globalization.CultureInfo)return new System.Globalization.CultureInfo(raw);else if(type===System.Uri)return new System.Uri(raw);else if(type===System.Guid)return System.Guid.Parse(raw);else if(type===System.Boolean)return(parsed={v:!1},!System.String.isNullOrWhiteSpace(raw)&&System.Boolean.tryParse(raw,parsed))?parsed.v:!1;else if(type===System.SByte)return raw|0;else if(type===System.Byte)return raw>>>0;else if(type===System.Int16)return raw|0;else if(type===System.UInt16)return raw>>>0;else if(type===System.Int32)return raw|0;else if(type===System.UInt32)return raw>>>0;else if(type===System.Int64)return System.Int64(raw);else if(type===System.UInt64)return System.UInt64(raw);else if(type===System.Single)return parseFloat(raw);else if(type===System.Double)return parseFloat(raw);else if(type===System.Decimal)try{return System.Decimal(raw)}catch(ex){return System.Decimal(0)}else if(type===System.Char)return raw.length===0?0:raw.charCodeAt(0);else if(type===System.String)return field?raw:JSON.parse(raw);else if(type===System.TimeSpan)return System.TimeSpan.parse(raw[0]=='"'?JSON.parse(raw):raw);else if(type===System.DateTime){var isUtc=System.String.endsWith(raw,"Z"),format="yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFF"+(isUtc?"'Z'":"K"),d=System.DateTime.parseExact(raw,format,null,!0,!0);return d=d!=null?d:System.DateTime.parse(raw,undefined,!0),isUtc&&d.kind!==1&&(d=System.DateTime.specifyKind(d,1)),d}else if(type===System.DateTimeOffset){var isUtc=System.String.endsWith(raw,"Z"),format="yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFF"+(isUtc?"'Z'":"K"),d=System.DateTime.parseExact(raw,format,null,!0,!0);return d=d!=null?d:System.DateTime.parse(raw,undefined,!0),isUtc&&d.kind!==1&&(d=System.DateTime.specifyKind(d,1)),new System.DateTimeOffset.$ctor1(d)}else if(Bridge.Reflection.isEnum(type))return Bridge.unbox(System.Enum.parse(type,raw));else if(type===System.Array.type(System.Byte,1))return System.Convert.fromBase64String(raw);else{if(castOperator=Newtonsoft.Json.JsonConvert.tryToGetCastOperator(raw,type),castOperator)return castOperator(raw);if(isObject)return raw;throw new System.ArgumentException(System.String.format("Could not cast or convert from {0} to {1}",Bridge.getTypeName(raw),Bridge.getTypeName(type)));}}else if(typeof raw=="object")if(def!==null&&type.$kind!=="struct")return def;else if(Bridge.isArray(null,type)){if(typeName=raw.$type,typeName!=null&&(type=Newtonsoft.Json.JsonConvert.BindToType(settings,typeName,type),raw=raw.$values),raw.length===undefined)return[];for(arr=[],System.Array.type(type.$elementType,type.$rank||1,arr),i=0;i<raw.length;i++)arr[i]=Newtonsoft.Json.JsonConvert.DeserializeObject(raw[i],type.$elementType,settings,!0);return arr}else if(Bridge.Reflection.isAssignableFrom(System.Collections.IList,type)){if(typeName=raw.$type,typeName!=null&&(type=Newtonsoft.Json.JsonConvert.BindToType(settings,typeName,type),raw=raw.$values),typeElement=System.Collections.Generic.List$1.getElementType(type)||System.Object,list=instance?{value:instance}:Newtonsoft.Json.JsonConvert.createInstance(type,raw,settings),list&&list.$list)return list.value;if(list=list.value,raw.length===undefined)return list;for(i=0;i<raw.length;i++)list.add(Newtonsoft.Json.JsonConvert.DeserializeObject(raw[i],typeElement,settings,!0));return list}else if(Bridge.Reflection.isAssignableFrom(System.Collections.IDictionary,type)){var typesGeneric=System.Collections.Generic.Dictionary$2.getTypeParameters(type),typeKey=typesGeneric[0]||System.Object,typeValue=typesGeneric[1]||System.Object,names,typeName=raw.$type,handling=!1;if(typeName!=null&&(type=Newtonsoft.Json.JsonConvert.BindToType(settings,typeName,type),handling=!0),dictionary=instance?{value:instance}:Newtonsoft.Json.JsonConvert.createInstance(type,raw,settings),dictionary&&dictionary.$list)return dictionary.value;names=dictionary.names||[];dictionary=dictionary.value;for(each in raw)raw.hasOwnProperty(each)&&(!handling||each!=="$type")&&names.indexOf(each)<0&&dictionary.add(Newtonsoft.Json.JsonConvert.DeserializeObject(each,typeKey,settings,!0),Newtonsoft.Json.JsonConvert.DeserializeObject(raw[each],typeValue,settings,!0));return dictionary}else{if(typeName=raw.$type,typeName!=null&&(type=Newtonsoft.Json.JsonConvert.BindToType(settings,typeName,type)),!Bridge.getMetadata(type))return Bridge.merge(isObject?{}:instance||Bridge.createInstance(type),raw);if(o=instance?{value:instance,names:i_names,"default":!0}:Newtonsoft.Json.JsonConvert.createInstance(type,raw,settings),names=o.names||[],isDefCtor=o.default,o=o.value,methods=Bridge.Reflection.getMembers(type,8,54),methods.length>0)for(midx=0;midx<methods.length;midx++)System.Attribute.isDefined(methods[midx],System.Runtime.Serialization.OnDeserializingAttribute,!1)&&Bridge.Reflection.midel(methods[midx],o)(null);for(camelCase=settings&&Bridge.is(settings.ContractResolver,Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver),fields=Newtonsoft.Json.JsonConvert.getMembers(type,4),i=0;i<fields.length;i++)(cfg=fields[i],f=cfg.member,mname=cfg.attr&&cfg.attr.PropertyName||(camelCase?f.n.charAt(0).toLowerCase()+f.n.substr(1):f.n),names.indexOf(mname)>-1)||(value=raw[mname],value===undefined&&(value=Newtonsoft.Json.JsonConvert.getValue(raw,mname)),result=Newtonsoft.Json.JsonConvert.preRawProcess(cfg,raw,value,settings),value=result.value,value!==undefined&&(currentValue=Bridge.Reflection.fieldAccess(f,o),objectCreationHandling=Newtonsoft.Json.ObjectCreationHandling.Auto,finst=undefined,cfg.attr&&cfg.attr._objectCreationHandling!=null?objectCreationHandling=cfg.attr._objectCreationHandling:settings._objectCreationHandling!=null&&(objectCreationHandling=settings._objectCreationHandling),Newtonsoft.Json.JsonConvert.needReuse(objectCreationHandling,currentValue,f.rt,isDefCtor)&&(finst=Bridge.unbox(currentValue,!0)),cfg.attr&&(typeNameHandling=cfg.attr._typeNameHandling),typeNameHandling!=null&&(oldTypeNameHandling=settings._typeNameHandling,settings._typeNameHandling=typeNameHandling),svalue=Newtonsoft.Json.JsonConvert.DeserializeObject(value,f.rt,settings,!0,finst),typeNameHandling!=null&&(settings._typeNameHandling=oldTypeNameHandling),result=Newtonsoft.Json.JsonConvert.preProcess(cfg,o,svalue,settings),result!==!1&&finst===undefined&&Bridge.Reflection.fieldAccess(f,o,result.value)));for(properties=Newtonsoft.Json.JsonConvert.getMembers(type,16),i=0;i<properties.length;i++)(cfg=properties[i],p=cfg.member,mname=cfg.attr&&cfg.attr.PropertyName||(camelCase?p.n.charAt(0).toLowerCase()+p.n.substr(1):p.n),names.indexOf(mname)>-1)||(value=raw[mname],value===undefined&&(value=Newtonsoft.Json.JsonConvert.getValue(raw,mname)),result=Newtonsoft.Json.JsonConvert.preRawProcess(cfg,raw,value,settings),value=result.value,value!==undefined&&(finst=undefined,p.g&&(currentValue=Bridge.Reflection.midel(p.g,o)(),objectCreationHandling=Newtonsoft.Json.ObjectCreationHandling.Auto,cfg.attr&&cfg.attr._objectCreationHandling!=null?objectCreationHandling=cfg.attr._objectCreationHandling:settings._objectCreationHandling!=null&&(objectCreationHandling=settings._objectCreationHandling),Newtonsoft.Json.JsonConvert.needReuse(objectCreationHandling,currentValue,p.rt,isDefCtor)&&(finst=Bridge.unbox(currentValue,!0))),cfg.attr&&(typeNameHandling=cfg.attr._typeNameHandling),typeNameHandling!=null&&(oldTypeNameHandling=settings._typeNameHandling,settings._typeNameHandling=typeNameHandling),svalue=Newtonsoft.Json.JsonConvert.DeserializeObject(value,p.rt,settings,!0,finst),typeNameHandling!=null&&(settings._typeNameHandling=oldTypeNameHandling),result=Newtonsoft.Json.JsonConvert.preProcess(cfg,o,svalue,settings),result!==!1&&finst===undefined&&(p.s?Bridge.Reflection.midel(p.s,o)(result.value):type.$kind==="anonymous"&&(o[p.n]=result.value))));if(methods.length>0)for(midx=0;midx<methods.length;midx++)System.Attribute.isDefined(methods[midx],System.Runtime.Serialization.OnDeserializedAttribute,!1)&&Bridge.Reflection.midel(methods[midx],o)(null);return o}}}}});Newtonsoft.Json.$cache=[]});
|