{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/monaco-editor/esm/vs/base/common/arrays.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/cancellation.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/errors.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/event.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/hash.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/iterator.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/linkedList.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/path.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/platform.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/process.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/strings.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/types.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/uint.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/uri.js","webpack:///./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/core/position.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/core/range.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/core/token.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js","webpack:///./node_modules/monaco-editor/esm/vs/editor/editor.worker.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/edit.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageService.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/configuration.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonCompletion.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDefinition.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDocumentSymbols.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonFolding.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonHover.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSelectionRanges.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonValidation.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/colors.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/json.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-textdocument/lib/esm/main.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-uri/index.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/json.worker.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/jsonWorker.js","webpack:///./node_modules/process/browser.js","webpack:///(webpack)/buildin/global.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACO;AACP,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA;AACA,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;;;;;;;;;;;;AC1PA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC4C;AAC5C;AACA;AACA,YAAY,YAAY,sBAAsB,EAAE;AAChD,CAAC;AACM;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+CAAK;AACtC,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,CAAC,8CAA8C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iDAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7GA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC6C;AACL;AACjC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,yDAAU;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D,4BAA4B,2DAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,yDAAU;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,yDAAU;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,yDAAU;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,yDAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,yDAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,4CAA4C;AAChF;AACA;AACA;AACA;AACA;AACA,qDAAqD,gCAAgC;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,yDAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,gCAAgC;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,yDAAU;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtyBA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,aAAa,gBAAgB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA,8CAA8C,KAAK;AACnD;AACA;AACA;AACA;AACA;AACO;AACP;AACA,2CAA2C,KAAK;AAChD;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1FA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACgD;AACiC;AACpC;AACtC;AACP;AACA,uBAAuB,wDAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,SAAS,4BAA4B,EAAE;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,wEAAkB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,2CAA2C;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,2CAA2C;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,UAAU,6CAA6C,cAAc,8CAA8C,SAAS;AACzJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,yDAAU;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6DAAe;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,yDAAU;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oEAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AACtB;AACP;AACA;AACA;AACA,+BAA+B,yDAAU;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB,IAAI;AACJ;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,kCAAkC,wDAAU;AAC5C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7kBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACwC;AACxC;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACO;AACP;AACA,sCAAsC,YAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2DAAuB;AACvC;AACA;AACA,wBAAwB,0DAAsB;AAC9C;AACA,oCAAoC,4DAAwB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,0DAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;;;;;;;;;;;;;AC9P5D;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB,iBAAiB,EAAE,EAAE;AACtE;AACA;AACA,CAAC,4BAA4B;;;;;;;;;;;;;AC9E7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,KAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACM;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AAC9B;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,kBAAkB,kEAAe;AACjC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;;;;;;;;;;;;;AC1PA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACO;AACP;AACA,qEAAqE,kBAAkB;AACvF;AACA;AACA;AACO;AACP;AACA;AACO;AACP,QAAQ,qDAAQ;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,4BAA4B,sCAAsC;AAClE;AACO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,YAAY,EAAE,EAAE;AACjD;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,eAAe;AACf;;;;;;;;;;;;;AClMA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,yBAAyB;AAC7D;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3HA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACwC;AACxC,4BAA4B;AAC5B,4BAA4B;AAC5B,4BAA4B;AAC5B,6BAA6B;AAC7B,oBAAoB;AACpB,8BAA8B;AAC9B,+BAA+B;AAC/B,sBAAsB;AACtB,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,KAAK,IAAI,KAAK,GAAG,WAAW,WAAW,SAAS;AAC1E,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,UAAU;AACzD;AACA;AACA;AACA;AACA;AACA,8BAA8B,UAAU,EAAE,6BAA6B;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB,EAAE,qBAAqB;AACxD;AACA;AACA;AACA,wCAAwC,IAAI,EAAE,KAAK,OAAO,IAAI,EAAE,IAAI,EAAE,KAAK;AAC3E;AACO;AACP;AACA;AACA;AACA;AACA;AACA,6CAA6C,SAAS;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+CAAW;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+CAAW,KAAK,eAAe,MAAM,+CAAW;AACvE;AACA;AACA;AACA;AACA;AACA,8BAA8B,eAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,UAAU,IAAI,oBAAoB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,oBAAoB,IAAI,aAAa;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe,IAAI,aAAa;AAC/C,eAAe,eAAe,EAAE,aAAa;AAC7C,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,UAAU,IAAI,iBAAiB;AACzE;AACA;AACA;AACA,4CAA4C,UAAU,IAAI,oBAAoB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,KAAK;AAC1C;AACA,+BAA+B,OAAO,IAAI,KAAK,OAAO,OAAO,EAAE,KAAK;AACpE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,IAAI;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,yBAAyB;AACvD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,IAAI,EAAE,6BAA6B;AACzD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,sBAAsB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,aAAa;AAC1C;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,YAAY;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,YAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,YAAY;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,cAAc;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,iBAAiB;AACjB;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,6CAA6C,8BAA8B;AAC3E,oDAAoD,+CAAW;AAC/D;AACA;AACA;AACA;AACA;AACA,8BAA8B,KAAK,GAAG,aAAa;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,aAAa;AACpC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,KAAK;AACrC,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,IAAI;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,IAAI,EAAE,kCAAkC;AAC1D,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,QAAQ;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,QAAQ;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,QAAQ;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACO,mBAAmB,oDAAgB;AACnC,iBAAiB,oDAAgB;AACjC,kBAAkB,oDAAgB;AAClC,iBAAiB,oDAAgB;AACjC,kBAAkB,oDAAgB;AAClC,iBAAiB,oDAAgB;AACjC,aAAa,oDAAgB;;;;;;;;;;;;;ACl2CpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACA;AACA;AACA;AACP,4FAA4F;AACrF;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iCAAiC,6BAA6B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACM;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACjHA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACqE;AACrE;AACA,WAAW,YAAY,EAAE;AACzB;AACA,oBAAoB,QAAQ,sDAAS,aAAa,wDAAW,sBAAsB,EAAE;AACrF,wBAAwB,QAAQ,iEAAY,WAAW;AACvD,CAAC;AACM;AACA;AACA;;;;;;;;;;;;;;ACbP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,4BAA4B,OAAO;AACnC;AACA;AACA;AACA;AACA,wBAAwB,MAAM;AAC9B;AACA;AACA,8BAA8B,EAAE;AAChC;AACA,iCAAiC,EAAE;AACnC;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,kCAAkC;AAClC,kCAAkC;AAClC,mCAAmC;AACnC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACO;AACP,+BAA+B,EAAE;AACjC;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,mCAAmC,EAAE;AACrC;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,yDAAyD;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,qCAAqC,SAAS;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,UAAU,gCAAgC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP,UAAU,gCAAgC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO,kDAAkD;AACzD;AACA;AACA;AACO;AACP;AACA;AACO;AACP,qCAAqC,SAAS;AAC9C;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,kBAAkB,sBAAsB,kBAAkB;AAC1D;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5uBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA,6DAA6D,KAAK;AAClE;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACO;AACP;AACA;AACA,0EAA0E,WAAW;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;;;;;;;;;;;;AC1IA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrBA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC0C;AACP;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,0BAA0B,cAAc,YAAY,SAAS,aAAa,UAAU,gBAAgB,aAAa,EAAE;AAC5K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,YAAY;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,2CAA2C;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAS;AACrB,+BAA+B,8CAAW;AAC1C;AACA;AACA,sBAAsB,8CAAW;AACjC;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sDAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,qBAAqB,cAAc,EAAE,SAAS;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sDAAS;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2CAA2C;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+BAA+B,GAAG,eAAe,EAAE;AAC9E;AACA;AACA;AACA;AACA;AACA,0BAA0B,+BAA+B,GAAG,eAAe,EAAE;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1kBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC8D;AACjB;AACN;AACF;AACrC;AACA;AACO;AACP,SAAS,kDAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,2BAA2B,iFAA8B;AACzD;AACA;AACA;AACA;AACA;AACA,qBAAqB,iFAA8B;AACnD,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2BAA2B,mBAAmB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,iCAAiC,wDAAU;AAClD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,2DAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2DAAuB;AAC/C,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,2DAAuB;AACjD;AACA;AACA;AACA,mCAAmC,2DAAuB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2DAAuB;AAC/C,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;;;;;;;;;;;;AClRA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACuD;AACvD;AACA;AACA;AACO;AACP;AACA,2BAA2B,oEAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA,oBAAoB,oEAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClDA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrIA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACyC;AACzC;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvWA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACyC;AACN;AACnC;AACA;AACA;AACA;AACO,wBAAwB,+CAAK;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5HA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzBA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC4D;AACD;AAC3D;AACA;AACA,yBAAyB,iEAAO;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,YAAY;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,mBAAmB;AACvD;AACA;AACA;AACA,uCAAuC,iBAAiB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,YAAY;AACnE;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+IAA+I;AAC/I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,YAAY;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,SAAS;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,+EAA+B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,8EAA8B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpYA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC+C;AACuB;AAC/D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,0DAAQ;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA,mCAAmC,iFAAiB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7GA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACO,gDAAgD,EAAE,IAAI;AAC7D;AACA;AACA;AACA;AACA;AACA,wDAAwD,IAAI,MAAM;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACqE;AAC9D;AACP;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gFAAmB;AAC7C;AACA,uBAAuB,yCAAyC;AAChE;AACA;AACA,+CAA+C;AAC/C,uBAAuB,uCAAuC;AAC9D;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,gBAAgB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvQA;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B,sBAAsB;AACtB,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,4BAA4B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,2BAA2B,+DAA+D,gBAAgB,EAAE,EAAE;AAC9G;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,qFAAqF;AACpH;AACA,KAAK;AACL;AAC2D;AACI;AACJ;AACT;AACH;AACN;AACc;AAC0B;AACC;AAC1B;AACyB;AACX;AACf;AACvD;AACA;AACA;AACA,0BAA0B,yEAAe;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,0EAAa,kBAAkB,sFAAyB;AACjF;AACA,uBAAuB,oDAAK;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA,yBAAyB,yDAAyD;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,kBAAkB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,+DAA+D;AAC7G,4CAA4C,2DAA2D;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,0DAAQ;AACrB;AACA;AACA,aAAa,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,uDAAG;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kEAAY;AACjD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,2BAA2B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wEAAS;AAC7B;AACA,2BAA2B,oDAAK;AAChC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,sBAAsB,mBAAmB;AACzC;AACA;AACA;AACA,oBAAoB,oDAAK;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA,gCAAgC,4EAAU;AAC1C,kDAAkD,oDAAK;AACvD;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iCAAiC,qEAAqE,EAAE;AACrI;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2EAAY;AAC/B,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,4BAA4B;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,+DAA+D;AACpH;AACA;AACA;AACA;AACA,yBAAyB,6FAAmB;AAC5C;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wEAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wEAAuB;AAC1D;AACA;AACA;AACA,mDAAmD,gCAAgC;AACnF;AACA;AACA;AACA;AACA,eAAe;AACf,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,IAAI,gEAAO,UAAU,0FAAmB;AACxC;;;;;;;;;;;;;ACzeA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC+E;AACvB;AACI;AACV;AACH;AACN;AACQ;AACR;AACe;AACjD;AACP;AACA,eAAe,yEAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,iCAAiC,oFAAuB;AACxD,iBAAiB,6DAAO;AACxB,iBAAiB,2DAAuB;AACxC;AACA,kBAAkB,0DAAQ;AAC1B,eAAe,oDAAK;AACpB,mBAAmB,4DAAS;AAC5B,4BAA4B,sEAAkC;AAC9D,wBAAwB,kEAA8B;AACtD,mBAAmB,6DAAyB;AAC5C,aAAa,uDAAG;AAChB,eAAe,oDAAK;AACpB;AACA;;;;;;;;;;;;;ACvCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oDAAoD;AAC9C;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oEAAoE;AAC9D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AAC1C;AACP;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,CAAC,sDAAsD;AACvD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0EAA0E;AAC3E;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AACjD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sDAAsD;AACvD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4DAA4D;AACtD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kDAAkD;AACnD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA,yCAAyC;AACzC,4CAA4C;AAC5C;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA,yCAAyC;AACzC,4CAA4C;AAC5C;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0BAA0B;AACpB;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AAClC;AACP;AACA;AACA;AACA,CAAC,8BAA8B;AAC/B;AACA;AACA;AACO;AACP;AACA;AACA;AACA,CAAC,0CAA0C;AAC3C;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AAC3C;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0EAA0E;AAC3E;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AACxC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sDAAsD;AAChD;AACP;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AAChC;AACP;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA,CAAC,kDAAkD;AACnD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AAC1C;AACP;AACA;AACA;AACA;AACA,CAAC,4DAA4D;AAC7D;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA,CAAC,8BAA8B;AAC/B;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sEAAsE;AACvE;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sDAAsD;AACvD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,wDAAwD;AACzD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;;;;;;;;;;;;;ACvyBzC;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACwD;AACjD;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qEAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qEAAQ;AACxB,gBAAgB,qEAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,qEAAQ;AAC7B,cAAc,qEAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qEAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtIA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC2E;AACE;AAC7E;AACO;AACP;AACA;AACA;AACA;AACA,6BAA6B,sFAAkB;AAC/C;AACA,KAAK,gBAAgB,yFAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AAC+B;AACgB;AACrD;AACP;AACA;AACO;AACP;AACA;AACA;AACA,eAAe,4DAAS;AACxB;AACA;AACA;AACA;AACA,iBAAiB,qEAAkB;AACnC;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,qCAAqC,iGAAiG;AACtI;AACA;AACA,uBAAuB,qEAAkB;AACzC;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,oEAAoE;AACjH;AACA;AACA;AACA,6CAA6C,mFAAmF;AAChI;AACA;AACA;AACA,mCAAmC;AACnC,0BAA0B;AAC1B;AACA;AACA,gHAAgH,4BAA4B,EAAE;AAC9I;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD,6BAA6B,wDAAK;AAClC;AACA;AACA,wCAAwC,wDAAK;AAC7C;AACA;AACA;AACA,gBAAgB,yDAAM,WAAW,qCAAqC;AACtE;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,4EAA4E;AACzF;AACO;AACP;AACA;AACO;AACP;AACA;;;;;;;;;;;;;ACzLA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACgC;AACtC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iEAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,sEAAsE;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;;;;;;;;;;;;ACjMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACgC;AAC7C;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACO;AACP,sBAAsB;AACtB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2CAA2C;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,4BAA4B,aAAa;AACzC,6BAA6B,gCAAgC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,yBAAyB,+CAA+C;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,4BAA4B,aAAa;AACzC,6BAA6B,gCAAgC;AAC7D,yBAAyB,0EAA0E;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kFAAkF;AACvH,SAAS;AACT;AACA,qCAAqC,oFAAoF;AACzH,yCAAyC,qFAAqF;AAC9H,SAAS;AACT;AACA,oDAAoD;AACpD;AACA;AACA;AACA,SAAS;AACT;AACA,qCAAqC,iFAAiF;AACtH,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,qBAAqB,gGAAgG;AACrH;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,yBAAyB,+CAA+C;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mCAAmC,oBAAoB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,gBAAgB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,gDAAgD,gBAAgB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,uCAAuC,2BAA2B;AAClE;AACA;AACA;AACA;AACA;AACO;AACP,uCAAuC,2BAA2B;AAClE;AACA;AACA;AACA,2BAA2B,qDAAqD;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,6BAA6B,gCAAgC;AAC7D,mBAAmB,iEAAa;AAChC;AACA,4CAA4C,6IAA6I,EAAE,gBAAgB,aAAa;AACxN;AACA;AACA,+CAA+C,kJAAkJ,EAAE,gBAAgB,aAAa;AAChO;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,qBAAqB;AAC7D,mCAAmC,gBAAgB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,mBAAmB,iEAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjnBA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACb;AACA;AACA;AACA;AACO;AACP,kCAAkC,sBAAsB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kCAAkC,YAAY,EAAE;AAChD;AACA,+BAA+B,cAAc,EAAE;AAC/C,oCAAoC,cAAc,EAAE;AACpD,qCAAqC,oBAAoB,EAAE;AAC3D,qCAAqC,0BAA0B,EAAE;AACjE,wCAAwC,wBAAwB,EAAE;AAClE,6CAA6C,+CAA+C,EAAE;AAC9F,oCAAoC,kBAAkB,EAAE;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1WA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACiC;AACP;AACM;AACF;AAC3C;AACA;AACA;AACA;AACO,oBAAoB,8DAAqB;AAChD;AACA;AACA;AACO,kBAAkB,2DAAkB;AAC3C;AACA;AACA;AACA;AACO,YAAY,qDAAY;AAC/B;AACA;AACA;AACO,gBAAgB,yDAAgB;AACvC;AACA;AACA;AACO,yBAAyB,kEAAyB;AACzD;AACA;AACA;AACO,uBAAuB,gEAAuB;AACrD;AACA;AACA;AACO,kBAAkB,2DAAkB;AAC3C;AACA;AACA;AACO,mBAAmB,4DAAmB;AAC7C;AACA;AACA;AACO,YAAY,qDAAY;AAC/B;AACA;AACA;AACA;AACA;AACO,oBAAoB,6DAAoB;AACxC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,sDAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,yDAAgB;AAC3B;AACA;AACA;AACA;AACO;AACP,kCAAkC,QAAQ;AAC1C,eAAe,uDAAc;AAC7B;AACA;AACA;;;;;;;;;;;;;ACnHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC8D;AACV;AACU;AACU;AACK;AACX;AACE;AACP;AACU;AACR;AACN;AACK;AACvB;AAChC;AACP;AACA,gCAAgC,gFAAiB;AACjD,6CAA6C,8EAAmB;AAChE,6BAA6B,0EAAc;AAC3C,wBAAwB,gEAAS;AACjC,kCAAkC,oFAAmB;AACrD,6BAA6B,0EAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT,qCAAqC,gDAAgD,EAAE;AACvF;AACA,gDAAgD,QAAQ,mEAAS,YAAY,wBAAwB,EAAE,EAAE;AACzG,uDAAuD,QAAQ,6EAAe,oBAAoB,EAAE;AACpG;AACA;AACA;AACA;AACA;AACA,2CAA2C,wEAAwE,4BAA4B,gBAAgB,EAAE,EAAE,EAAE,EAAE,EAAE;AACzK;AACA;AACA;AACA,0BAA0B,yEAAgB;AAC1C,4BAA4B,mFAAkB;AAC9C,wBAAwB,2EAAc;AACtC;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,2BAA2B;AAC3B,mBAAmB,oEAAU;AAC7B,uBAAuB,+DAAQ,SAAS,4DAAK;AAC7C,aAAa;AACb;AACA;AACA;;;;;;;;;;;;;AChEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACiZ;AAC5T;AAC4R;AACjX;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AACxB;AACP;AACA;AACA;AACA;AACA;AACA,0CAA0C,+EAAU,WAAW,+EAAU;AACzE;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;;;;;;;;;;;;;AC3CjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,uDAAuD;AACpF;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACkD;AACoC;AACI;AACrC;AACtD,eAAe,wEAAqB;AACpC;AACA,kBAAkB,2IAA2I,IAAI,cAAc,EAAE,EAAE,IAAI,KAAK;AAC5L,kBAAkB,uGAAuG,EAAE,mJAAmJ;AAC9Q,aAAa,8FAA8F,EAAE,+CAA+C;AAC5J,aAAa,kMAAkM;AAC/M,cAAc,+GAA+G,yBAAyB,6BAA6B,IAAI,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,gCAAgC,GAAG;AAC9P;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,+GAA+G,+BAA+B;AAC9I;AACA;AACA,CAAC;AACsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC0B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC6B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AAC2B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC4B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC4B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AAC8B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AAC4B;AACtB;AACP,QAAQ,mEAAS;AACjB,0BAA0B,IAAI,UAAU;AACxC;AACA;AACA;AACO;AACP;AACA;AACA;AACA,CAAC,8BAA8B;AAC/B;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B,WAAW,EAAE;AACvC;AACA;AACA,KAAK;AACL,2DAA2D;AAC3D,4DAA4D;AAC5D,6DAA6D,aAAa;AAC1E,wDAAwD,aAAa;AACrE;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,iCAAiC;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,gBAAgB;AAChE;AACA,mCAAmC,+DAAS;AAC5C,mGAAmG,EAAE,sCAAsC,0BAA0B,EAAE;AACvK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC2B;AACrB;AACP,iCAAiC,kBAAkB;AACnD;AACA;AACO;AACP,WAAW,kEAAiB;AAC5B;AACO;AACP,WAAW,iEAAgB;AAC3B;AACO;AACP,uCAAuC,2BAA2B;AAClE;AACA;AACA;AACA;AACA,sCAAsC,mBAAmB;AACzD,kCAAkC,eAAe;AACjD;AACA;AACA;AACA;AACA;AACA,2CAA2C,2BAA2B;AACtE;AACA,mBAAmB,sEAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,2DAAK;AACjC,uBAAuB,gEAAU;AACjC,aAAa;AACb;AACA;AACA;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACuB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,6BAA6B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,2HAA2H,EAAE;AAC7H,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,gHAAgH,EAAE;AAClH,iBAAiB;AACjB;AACA;AACA;AACA,+CAA+C,gBAAgB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD;AACA,iBAAiB;AACjB;AACA,6DAA6D,gBAAgB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,4BAA4B;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iCAAiC;AAChE,8BAA8B,wEAAkB;AAChD;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA,oBAAoB,gEAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,0BAA0B,+DAAS;AACnC,mHAAmH,EAAE,kCAAkC,0BAA0B,EAAE;AACnL,iBAAiB;AACjB;AACA;AACA,YAAY,mEAAS;AACrB;AACA,iBAAiB,gEAAM;AACvB;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,0BAA0B,+DAAS;AACnC,6FAA6F,EAAE;AAC/F,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yDAAyD;AACpF,0BAA0B,wEAAkB;AAC5C;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kEAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,uFAAuF,EAAE;AACzF,iBAAiB;AACjB;AACA;AACA;AACA,gBAAgB,kEAAQ;AACxB;AACA;AACA,gBAAgB,mEAAS;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB,mEAAS;AAC1B;AACA;AACA;AACA;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,uGAAuG,EAAE;AACzG,aAAa;AACb;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,uGAAuG,EAAE;AACzG,aAAa;AACb;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,oFAAoF,EAAE;AACtF,aAAa;AACb;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,oFAAoF,EAAE;AACtF,aAAa;AACb;AACA;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,qGAAqG,EAAE;AACvG,aAAa;AACb;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,oGAAoG,EAAE;AACtG,aAAa;AACb;AACA,YAAY,kEAAQ;AACpB;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,qJAAqJ,EAAE;AACvJ,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,2CAA2C;AACtF,0CAA0C,wEAAkB;AAC5D,kJAAkJ,EAAE;AACpJ,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,2CAA2C;AAClF,sCAAsC,wEAAkB;AACxD;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2BAA2B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,uBAAuB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,2CAA2C;AAC9E,kCAAkC,wEAAkB;AACpD,6HAA6H,EAAE;AAC/H,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,gBAAgB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD;AACA,iBAAiB;AACjB;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,yFAAyF,EAAE;AAC3F,aAAa;AACb;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,0FAA0F,EAAE;AAC5F,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA;AACA,8CAA8C,iDAAiD,IAAI;AACnG;AACA;AACA,kCAAkC,wEAAkB;AACpD,4FAA4F,EAAE;AAC9F,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,gBAAgB;AACjF;AACA;AACA;AACA;AACA;AACA,wBAAwB,mEAAS;AACjC;AACA;AACA;AACA,2CAA2C,2EAA2E;AACtH,0CAA0C,wEAAkB;AAC5D,kHAAkH,EAAE;AACpH,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,gBAAgB;AACxF;AACA;AACA,qEAAqE,gBAAgB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,mEAAS;AACzC;AACA;AACA;AACA,mDAAmD,2EAA2E;AAC9H,kDAAkD,wEAAkB;AACpE,0HAA0H,EAAE;AAC5H,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,qCAAqC;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,qCAAqC;AACtH;AACA;AACA;AACA;AACA;AACA,uCAAuC,2EAA2E;AAClH,sCAAsC,wEAAkB;AACxD,8GAA8G,EAAE;AAChH,yBAAyB;AACzB;AACA;AACA;AACA;AACA,YAAY,kEAAQ;AACpB;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,mGAAmG,EAAE;AACrG,iBAAiB;AACjB;AACA;AACA,YAAY,kEAAQ;AACpB;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,kHAAkH,EAAE;AACpH,iBAAiB;AACjB;AACA;AACA;AACA,mEAAmE,gBAAgB;AACnF;AACA;AACA;AACA;AACA;AACA,qEAAqE,2BAA2B;AAChG;AACA;AACA;AACA,+CAA+C,2CAA2C;AAC1F,8CAA8C,wEAAkB;AAChE,mHAAmH,EAAE,uBAAuB,EAAE;AAC9I,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,kBAAkB,mEAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,2DAAK;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,YAAY,wEAAkB,OAAO;AACvE;AACA,wBAAwB,2DAAK;AAC7B,0BAA0B,gEAAU;AACpC;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD,wCAAwC,qBAAqB;AAC7D,mCAAmC,gBAAgB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,+DAAS;AACnG;AACA;AACA,kGAAkG,+DAAS;AAC3G;AACA;AACA,uFAAuF,+DAAS;AAChG;AACA;AACA,yFAAyF,+DAAS;AAClG;AACA;AACA,uFAAuF,+DAAS;AAChG;AACA;AACA,0HAA0H,+DAAS;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,wEAAwE,+DAAS;AACjF;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,mFAAmF,+DAAS;AAC5F;AACA;AACA;AACA;AACA;AACA,oEAAoE,+DAAS;AAC7E;AACA;AACA;AACA,uEAAuE,+DAAS;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iGAAiG,+DAAS;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,+DAAS;AACxG;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF,+DAAS,+EAA+E,wEAAkB;AAC7L;AACA,uFAAuF,+DAAS,+EAA+E,wEAAkB;AACjM;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,gEAAgE,+DAAS;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,+DAAS;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,8EAA8E,+DAAS;AACvF;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,mFAAmF,+DAAS;AAC5F;AACA;AACA;AACA;AACA;AACA,oEAAoE,+DAAS;AAC7E;AACA;AACA;AACA,0EAA0E,+DAAS;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6FAA6F,+DAAS;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kEAAQ;AAC7B,6FAA6F,+DAAS;AACtG;AACA;AACA;AACA;AACA,yFAAyF,+DAAS;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F,+DAAS;AACrG;AACA;AACA,8EAA8E,+DAAS;AACvF;AACA;AACA;AACA;;;;;;;;;;;;;ACjtCA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACsD;AACtD,eAAe,wEAAqB;AAC7B;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,yBAAyB,6CAA6C;AACtE,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,8BAA8B,6CAA6C;AAC3E,8BAA8B,qDAAqD;AACnF;AACA;AACA;AACA,iBAAiB;AACjB,oCAAoC,cAAc;AAClD;AACA;AACA,yBAAyB,cAAc;AACvC,yBAAyB;AACzB;AACA;AACA,iBAAiB;AACjB,6BAA6B,6CAA6C;AAC1E,6BAA6B,qDAAqD;AAClF;AACA;AACA;AACA,iBAAiB;AACjB,6BAA6B,cAAc;AAC3C,kCAAkC,6CAA6C;AAC/E,kCAAkC,qDAAqD;AACvF,6BAA6B,sCAAsC;AACnE,yCAAyC,cAAc;AACvD;AACA;AACA,6CAA6C,cAAc;AAC3D;AACA,iBAAiB;AACjB;AACA;AACA,6CAA6C,cAAc;AAC3D;AACA,iBAAiB;AACjB;AACA;AACA,6CAA6C,cAAc;AAC3D,sCAAsC,oBAAoB;AAC1D;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C,6BAA6B;AAC7B;AACA;AACA,iBAAiB;AACjB,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,yBAAyB,sCAAsC;AAC/D;AACA;AACA,sCAAsC,sCAAsC;AAC5E;AACA;AACA;AACA;AACA,iBAAiB;AACjB,2BAA2B,mBAAmB;AAC9C,qCAAqC,mBAAmB;AACxD,oCAAoC,mBAAmB;AACvD,uBAAuB,cAAc;AACrC,yBAAyB,cAAc;AACvC,yBAAyB,cAAc;AACvC,0BAA0B,sCAAsC;AAChE,0BAA0B,sCAAsC;AAChE,0BAA0B,sCAAsC;AAChE,wBAAwB;AACxB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjhBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACkD;AACC;AACA;AACJ;AACC;AAC4E;AACtE;AACtD,eAAe,wEAAqB;AACpC,oCAAoC;AACpC;AACA;AACA;AACA,uCAAuC,oBAAoB;AAC3D,4CAA4C,8BAA8B;AAC1E,4CAA4C,yBAAyB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,2DAAK;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,2DAAK;AAClC;AACA,6CAA6C,uCAAuC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,8DAAQ;AACtD;AACA;AACA,0EAA0E,wEAAkB;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,oEAAc;AAClE;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iEAAkB;AACnD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,wEAAkB;AAChD;AACA;AACA,0CAA0C,sEAAgB;AAC1D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wEAAkB;AACxD;AACA;AACA,kDAAkD,sEAAgB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,kEAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,yDAAyD,6BAA6B;AACtF;AACA,kCAAkC,wEAAkB;AACpD;AACA;AACA,8CAA8C,sEAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,kEAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,uCAAuC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,wEAAkB;AAC5C;AACA;AACA,sCAAsC,sEAAgB;AACtD;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,sBAAsB,wEAAkB;AACxC;AACA;AACA,kCAAkC,sEAAgB;AAClD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD,kCAAkC,sEAAgB;AAClD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,kCAAkC,sEAAgB;AAClD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iCAAiC,8DAAe;AAChD;AACA;AACA;AACA;AACA,sCAAsC,sEAAgB;AACtD,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,+BAA+B;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,gBAAgB;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,iEAAkB;AACvD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,6EAA6E,EAAE;AAClI;AACA;AACA,mDAAmD,6EAA6E,EAAE;AAClI;AACA;AACA,mDAAmD,6EAA6E,EAAE;AAClI;AACA;AACA;AACA;AACA;AACA,oCAAoC,gBAAgB;AACpD;AACA,YAAY,mEAAS;AACrB;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sEAAgB;AAClD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sEAAgB;AACtD,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mEAAS;AAC7B;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sEAAgB;AACtD;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mEAAS;AACrB;AACA;AACA;AACA;AACA,kCAAkC,sEAAgB;AAClD;AACA,aAAa;AACb;AACA;AACA,wDAAwD,YAAY;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sEAAgB;AACtD;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,0CAA0C,mEAAS;AACnD;AACA;AACA;AACA;AACA,uCAAuC,wBAAwB,EAAE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,gEAAgE;AAChE,kCAAkC,sEAAgB;AAClD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sEAAgB;AAClD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sEAAgB;AAC9C;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sEAAgB;AAC9C;AACA,SAAS;AACT;AACA;AACA;AACA,qFAAqF,gDAAgD,EAAE;AACvI,+CAA+C;AAC/C,kBAAkB,wEAAkB;AACpC;AACA;AACA;AACA,8BAA8B,sEAAgB;AAC9C,SAAS,EAAE,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,QAAQ,KAAK;AAC/D;AACA;AACA;AACA,kCAAkC,QAAQ,KAAK;AAC/C;AACA;AACA,oCAAoC,aAAa,qB;AACjD;AACA;AACA;AACA,wBAAwB;AACxB,qBAAqB,GAAG;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sEAAe;AAC9B;AACA;AACA;AACA;AACA;AACA,8BAA8B,OAAO;AACrC;AACA;AACA;AACA;AACA,+EAA+E;AAC/E,4EAA4E;AAC5E,2BAA2B,uBAAuB;AAClD;AACA;AACA,0BAA0B,gCAAgC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wEAAkB;AACrC;AACA;AACA,kCAAkC,wEAAkB;AACpD,kCAAkC,wEAAkB;AACpD,oCAAoC,wEAAkB;AACtD,4BAA4B,wEAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mEAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mEAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,GAAG;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,IAAI;AACvC;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,IAAI;AAC1C;AACA;AACA;AACA;AACA;AACA,sBAAsB,mEAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mEAAkB;AACxC;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mEAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gEAAU;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,mEAAS;AACtB;AACA,qMAAqM,gEAAU;AAC/M;AACA;AACA;AACA;AACA,aAAa,mEAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACyB;;;;;;;;;;;;;ACh6B1B;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACgD;AACzC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2DAAK;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,6CAA6C,EAAE;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACkD;AACH;AACG;AAC8B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,YAAY,iCAAiC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,0DAAgB;AAChG;AACA;AACA,iDAAiD,gBAAgB;AACjE;AACA;AACA,8DAA8D,gBAAgB;AAC9E;AACA;AACA,+CAA+C,8DAAQ;AACvD,+CAA+C,OAAO,kEAAmB,4BAA4B,gEAAU,+BAA+B;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,2CAA2C;AACjF;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,8DAAQ;AACnD;AACA,yCAAyC,iIAAiI;AAC1K,0CAA0C,qDAAqD;AAC/F;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,YAAY,iCAAiC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,0DAAgB;AAChG;AACA;AACA,iDAAiD,gBAAgB;AACjE;AACA;AACA,8DAA8D,gBAAgB;AAC9E;AACA;AACA;AACA;AACA,+CAA+C,OAAO,kEAAmB,4BAA4B,gEAAU,yDAAyD;AACxK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA,0CAA0C,sCAAsC;AAChF;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA,0CAA0C,2CAA2C;AACrF;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gEAAU;AACjC;AACA,uBAAuB,gEAAU;AACjC;AACA,uBAAuB,gEAAU;AACjC;AACA,uBAAuB,gEAAU;AACjC;AACA,uBAAuB,gEAAU;AACjC;AACA,uBAAuB,gEAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,+BAA+B;AACpG;AACA;AACA;AACA;AACA,wCAAwC,qEAAY,CAAC,kEAAmB;AACxE;AACA;AACA,6CAA6C,6BAA6B;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,yBAAyB,8DAAQ,wCAAwC;AAC9F;AACA;AACA;AACA,CAAC;AAC8B;AAC/B;AACA,WAAW,2DAAK;AAChB;;;;;;;;;;;;;ACnQA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC2D;AACU;AAC9D;AACP;AACA;AACA;AACA;AACA,kBAAkB,2EAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,8DAAQ;AAClE;AACA;AACA;AACA,kCAAkC,+CAA+C,sEAAgB,UAAU;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,qCAAqC,uCAAuC,sEAAgB;AAC5F;AACA;AACA;AACA;AACA,2DAA2D,sEAAgB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,6BAA6B;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxHA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACkD;AACF;AAChD;AACA;AACA,uCAAuC,oBAAoB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,2DAAK;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,iEAAkB;AACzC,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA,4DAA4D,iCAAiC,EAAE;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,kEAAmB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACoB;AACrB;AACA;AACA,2EAA2E;AAC3E,oCAAoC,wBAAwB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC/GA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACmD;AACH;AACD;AACG;AACI;AACtD,eAAe,wEAAqB;AACpC;AACA;AACA;AACA;AACA;AACA,iDAAiD,uBAAuB;AACxE;AACA;AACA;AACA;AACA;AACA,oDAAoD,6EAAmC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gCAAgC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,gCAAgC,aAAa;AAC7C;AACA;AACA;AACA;AACA,CAAC;AAC2B;AAC5B;AACA;AACA,gCAAgC,aAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,8DAAe;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,gBAAgB;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACyB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,wDAAG;AAC5B;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,+BAA+B,EAAE;AACrG;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,kCAAkC;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,gBAAgB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uGAAuG,EAAE;AACzG,+DAA+D;AAC/D;AACA;AACA;AACA,oGAAoG,EAAE;AACtG,8CAA8C;AAC9C;AACA;AACA;AACA,4BAA4B,2DAAU;AACtC,qHAAqH,EAAE,2BAA2B,EAAE;AACpJ;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,0DAAgB;AAChC;AACA;AACA,0CAA0C,oEAAoE,EAAE,KAAK,EAAE;AACvH,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,EAAE,SAAS,EAAE;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gHAAgH,EAAE,KAAK,EAAE;AACzH;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA,qDAAqD,uBAAuB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA,+CAA+C,oBAAoB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA,mDAAmD,sBAAsB;AACzE;AACA;AACA,yDAAyD,qBAAqB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,kDAAkD,EAAE;AAC3I;AACA;AACA;AACA;AACA,iFAAiF,wFAAwF,EAAE;AAC3K;AACA;AACA;AACA,mCAAmC,kEAAmB;AACtD,oCAAoC,4DAAkB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,gBAAgB;AAC3E;AACA;AACA,sDAAsD,gBAAgB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,UAAU,iBAAiB,EAAE,EAAE;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF;AACjF,mGAAmG,oBAAoB,EAAE;AACzH,aAAa;AACb;AACA;AACA;AACA,2FAA2F,oBAAoB,EAAE;AACjH;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AAC4B;AAC7B;AACA;AACA;AACA;AACA,eAAe,wDAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,wDAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjgBA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACgE;AACL;AACpD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,YAAY;AACvD,sBAAsB,oEAAc;AACpC;AACA;AACA,sBAAsB,oEAAc,QAAQ,2DAAK;AACjD;AACA;AACA;AACA;AACA,eAAe,2DAAK;AACpB;AACA,kBAAkB,2EAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5DA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC0D;AACiC;AACrC;AACN;AAChD,eAAe,wEAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,wEAAkB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mHAAmH,wEAAkB;AACrI;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,2DAAK;AACzC,mCAAmC,gEAAU,iCAAiC,wEAAkB,UAAU,+DAAS;AACnH;AACA;AACA,oCAAoC,2DAAK;AACzC,mCAAmC,gEAAU,iCAAiC,wEAAkB,UAAU,+DAAS;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,gBAAgB;AAC5E;AACA,+BAA+B,+DAAS;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gEAAU,uCAAuC,+DAAS;AACzF,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,mEAAmE,sEAAgB,gBAAgB;AACnG;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACyB;AAC1B;AACA;AACA;AACA,YAAY,mEAAS;AACrB;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA,oBAAoB,mEAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mEAAS;AACrB;AACA;AACA;AACA,YAAY,mEAAS,0CAA0C;AAC/D;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA,oBAAoB,mEAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wEAAkB;AAC/C,+BAA+B,wEAAkB;AACjD;AACA;AACA;AACA;;;;;;;;;;;;;AC/IA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpEA;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,2BAA2B;AAC3B,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;;;;;;;;;;;;;AChEA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,mCAAmC,EAAE;AACrC;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3CA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,uBAAuB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,SAAS;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA,mGAAmG,SAAS;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACM;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,qDAAqD,2BAA2B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;;;;;;;;;;;;;AC5QA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACb;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oEAAoE;AACrE;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AACjD;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0BAA0B;AAC3B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS,iCAAiC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AACtC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC0B;AAC3B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wDAAwD;AACzD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0EAA0E;AAC3E;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AACjD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,CAAC,wCAAwC;AACzC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,CAAC,wCAAwC;AAClC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,wBAAwB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AAC9B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,6CAA6C,IAAI;AACjF;AACA;AACA,CAAC,oDAAoD;AACrD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oDAAoD;AACrD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sDAAsD;AACvD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AACxB;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AACxC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AACzC;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AACzC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AACxC;AACP;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AAClC;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gBAAgB;;;;;;;;;;;;;ACt/CjB;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACb,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,uDAAuD;AACpF;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,iJAAiJ;AAC1M;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iBAAiB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,YAAY;AAClF;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iBAAiB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sBAAsB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACc;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,sCAAsC,sBAAsB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;AACA;AACA;AACA;AACA;AACA,6EAA6E;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,0CAA0C,EAAE;AACrG;;;;;;;;;;;;;;ACloBA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACwD;AACX;AAC7C;AACA;AACA,IAAI,mEAAiB;AACrB,mBAAmB,yDAAU;AAC7B,KAAK;AACL;;;;;;;;;;;;;ACXA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,2BAA2B,+DAA+D,gBAAgB,EAAE,EAAE;AAC9G;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,qFAAqF;AACpH;AACA,KAAK;AACL;AACA,mBAAmB,SAAI,IAAI,SAAI;AAC/B,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;AAC0F;AACxC;AAClD;AACA;AACA;AACA,oDAAoD,wBAAwB,EAAE;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2GAA8B;AAC9D;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,2CAA2C,sBAAsB;AACjE;AACA;AACA,uBAAuB,qGAAwB;AAC/C;AACA;AACA;AACA;AACA;AACA,CAAC;AACqB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6DAAG;AACrB;AACA,yBAAyB,6BAA6B;AACtD;AACA;AACA;AACA;AACA;AACA,qCAAqC,qBAAqB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,cAAc,6DAAG;AACjB;AACA,qCAAqC,qBAAqB;AAC1D;AACA;AACA;AACA,qBAAqB,6BAA6B;AAClD;AACO;AACP;AACA;;;;;;;;;;;;AChPA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;ACvLtC;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C","file":"json.worker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/monaco-editor/esm/vs/language/json/json.worker.js\");\n","/**\n * Returns the last element of an array.\n * @param array The array.\n * @param n Which element from the end (default is zero).\n */\nexport function tail(array, n = 0) {\n return array[array.length - (1 + n)];\n}\nexport function tail2(arr) {\n if (arr.length === 0) {\n throw new Error('Invalid tail call');\n }\n return [arr.slice(0, arr.length - 1), arr[arr.length - 1]];\n}\nexport function equals(one, other, itemEquals = (a, b) => a === b) {\n if (one === other) {\n return true;\n }\n if (!one || !other) {\n return false;\n }\n if (one.length !== other.length) {\n return false;\n }\n for (let i = 0, len = one.length; i < len; i++) {\n if (!itemEquals(one[i], other[i])) {\n return false;\n }\n }\n return true;\n}\nexport function binarySearch(array, key, comparator) {\n let low = 0, high = array.length - 1;\n while (low <= high) {\n const mid = ((low + high) / 2) | 0;\n const comp = comparator(array[mid], key);\n if (comp < 0) {\n low = mid + 1;\n }\n else if (comp > 0) {\n high = mid - 1;\n }\n else {\n return mid;\n }\n }\n return -(low + 1);\n}\n/**\n * Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false\n * are located before all elements where p(x) is true.\n * @returns the least x for which p(x) is true or array.length if no element fullfills the given function.\n */\nexport function findFirstInSorted(array, p) {\n let low = 0, high = array.length;\n if (high === 0) {\n return 0; // no children\n }\n while (low < high) {\n const mid = Math.floor((low + high) / 2);\n if (p(array[mid])) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n return low;\n}\n/**\n * Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort`\n * so only use this when actually needing stable sort.\n */\nexport function mergeSort(data, compare) {\n _sort(data, compare, 0, data.length - 1, []);\n return data;\n}\nfunction _merge(a, compare, lo, mid, hi, aux) {\n let leftIdx = lo, rightIdx = mid + 1;\n for (let i = lo; i <= hi; i++) {\n aux[i] = a[i];\n }\n for (let i = lo; i <= hi; i++) {\n if (leftIdx > mid) {\n // left side consumed\n a[i] = aux[rightIdx++];\n }\n else if (rightIdx > hi) {\n // right side consumed\n a[i] = aux[leftIdx++];\n }\n else if (compare(aux[rightIdx], aux[leftIdx]) < 0) {\n // right element is less -> comes first\n a[i] = aux[rightIdx++];\n }\n else {\n // left element comes first (less or equal)\n a[i] = aux[leftIdx++];\n }\n }\n}\nfunction _sort(a, compare, lo, hi, aux) {\n if (hi <= lo) {\n return;\n }\n const mid = lo + ((hi - lo) / 2) | 0;\n _sort(a, compare, lo, mid, aux);\n _sort(a, compare, mid + 1, hi, aux);\n if (compare(a[mid], a[mid + 1]) <= 0) {\n // left and right are sorted and if the last-left element is less\n // or equals than the first-right element there is nothing else\n // to do\n return;\n }\n _merge(a, compare, lo, mid, hi, aux);\n}\nexport function groupBy(data, compare) {\n const result = [];\n let currentGroup = undefined;\n for (const element of mergeSort(data.slice(0), compare)) {\n if (!currentGroup || compare(currentGroup[0], element) !== 0) {\n currentGroup = [element];\n result.push(currentGroup);\n }\n else {\n currentGroup.push(element);\n }\n }\n return result;\n}\n/**\n * @returns New array with all falsy values removed. The original array IS NOT modified.\n */\nexport function coalesce(array) {\n return array.filter(e => !!e);\n}\n/**\n * @returns false if the provided object is an array and not empty.\n */\nexport function isFalsyOrEmpty(obj) {\n return !Array.isArray(obj) || obj.length === 0;\n}\nexport function isNonEmptyArray(obj) {\n return Array.isArray(obj) && obj.length > 0;\n}\n/**\n * Removes duplicates from the given array. The optional keyFn allows to specify\n * how elements are checked for equalness by returning a unique string for each.\n */\nexport function distinct(array, keyFn) {\n if (!keyFn) {\n return array.filter((element, position) => {\n return array.indexOf(element) === position;\n });\n }\n const seen = Object.create(null);\n return array.filter((elem) => {\n const key = keyFn(elem);\n if (seen[key]) {\n return false;\n }\n seen[key] = true;\n return true;\n });\n}\nexport function distinctES6(array) {\n const seen = new Set();\n return array.filter(element => {\n if (seen.has(element)) {\n return false;\n }\n seen.add(element);\n return true;\n });\n}\n/**\n * @deprecated ES6: use `Array.findIndex`\n */\nexport function firstIndex(array, fn) {\n for (let i = 0; i < array.length; i++) {\n const element = array[i];\n if (fn(element)) {\n return i;\n }\n }\n return -1;\n}\nexport function first(array, fn, notFoundValue = undefined) {\n const index = firstIndex(array, fn);\n return index < 0 ? notFoundValue : array[index];\n}\nexport function firstOrDefault(array, notFoundValue) {\n return array.length > 0 ? array[0] : notFoundValue;\n}\nexport function flatten(arr) {\n return [].concat(...arr);\n}\nexport function range(arg, to) {\n let from = typeof to === 'number' ? arg : 0;\n if (typeof to === 'number') {\n from = arg;\n }\n else {\n from = 0;\n to = arg;\n }\n const result = [];\n if (from <= to) {\n for (let i = from; i < to; i++) {\n result.push(i);\n }\n }\n else {\n for (let i = from; i > to; i--) {\n result.push(i);\n }\n }\n return result;\n}\n/**\n * Insert `insertArr` inside `target` at `insertIndex`.\n * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array\n */\nexport function arrayInsert(target, insertIndex, insertArr) {\n const before = target.slice(0, insertIndex);\n const after = target.slice(insertIndex);\n return before.concat(insertArr, after);\n}\n/**\n * Pushes an element to the start of the array, if found.\n */\nexport function pushToStart(arr, value) {\n const index = arr.indexOf(value);\n if (index > -1) {\n arr.splice(index, 1);\n arr.unshift(value);\n }\n}\n/**\n * Pushes an element to the end of the array, if found.\n */\nexport function pushToEnd(arr, value) {\n const index = arr.indexOf(value);\n if (index > -1) {\n arr.splice(index, 1);\n arr.push(value);\n }\n}\nexport function asArray(x) {\n return Array.isArray(x) ? x : [x];\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Emitter, Event } from './event.js';\nconst shortcutEvent = Object.freeze(function (callback, context) {\n const handle = setTimeout(callback.bind(context), 0);\n return { dispose() { clearTimeout(handle); } };\n});\nexport var CancellationToken;\n(function (CancellationToken) {\n function isCancellationToken(thing) {\n if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) {\n return true;\n }\n if (thing instanceof MutableToken) {\n return true;\n }\n if (!thing || typeof thing !== 'object') {\n return false;\n }\n return typeof thing.isCancellationRequested === 'boolean'\n && typeof thing.onCancellationRequested === 'function';\n }\n CancellationToken.isCancellationToken = isCancellationToken;\n CancellationToken.None = Object.freeze({\n isCancellationRequested: false,\n onCancellationRequested: Event.None\n });\n CancellationToken.Cancelled = Object.freeze({\n isCancellationRequested: true,\n onCancellationRequested: shortcutEvent\n });\n})(CancellationToken || (CancellationToken = {}));\nclass MutableToken {\n constructor() {\n this._isCancelled = false;\n this._emitter = null;\n }\n cancel() {\n if (!this._isCancelled) {\n this._isCancelled = true;\n if (this._emitter) {\n this._emitter.fire(undefined);\n this.dispose();\n }\n }\n }\n get isCancellationRequested() {\n return this._isCancelled;\n }\n get onCancellationRequested() {\n if (this._isCancelled) {\n return shortcutEvent;\n }\n if (!this._emitter) {\n this._emitter = new Emitter();\n }\n return this._emitter.event;\n }\n dispose() {\n if (this._emitter) {\n this._emitter.dispose();\n this._emitter = null;\n }\n }\n}\nexport class CancellationTokenSource {\n constructor(parent) {\n this._token = undefined;\n this._parentListener = undefined;\n this._parentListener = parent && parent.onCancellationRequested(this.cancel, this);\n }\n get token() {\n if (!this._token) {\n // be lazy and create the token only when\n // actually needed\n this._token = new MutableToken();\n }\n return this._token;\n }\n cancel() {\n if (!this._token) {\n // save an object by returning the default\n // cancelled token when cancellation happens\n // before someone asks for the token\n this._token = CancellationToken.Cancelled;\n }\n else if (this._token instanceof MutableToken) {\n // actually cancel\n this._token.cancel();\n }\n }\n dispose(cancel = false) {\n if (cancel) {\n this.cancel();\n }\n if (this._parentListener) {\n this._parentListener.dispose();\n }\n if (!this._token) {\n // ensure to initialize with an empty token if we had none\n this._token = CancellationToken.None;\n }\n else if (this._token instanceof MutableToken) {\n // actually dispose\n this._token.dispose();\n }\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { DiffChange } from './diffChange.js';\nimport { stringHash } from '../hash.js';\nexport class StringDiffSequence {\n constructor(source) {\n this.source = source;\n }\n getElements() {\n const source = this.source;\n const characters = new Int32Array(source.length);\n for (let i = 0, len = source.length; i < len; i++) {\n characters[i] = source.charCodeAt(i);\n }\n return characters;\n }\n}\nexport function stringDiff(original, modified, pretty) {\n return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes;\n}\n//\n// The code below has been ported from a C# implementation in VS\n//\nexport class Debug {\n static Assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n }\n}\nexport class MyArray {\n /**\n * Copies a range of elements from an Array starting at the specified source index and pastes\n * them to another Array starting at the specified destination index. The length and the indexes\n * are specified as 64-bit integers.\n * sourceArray:\n *\t\tThe Array that contains the data to copy.\n * sourceIndex:\n *\t\tA 64-bit integer that represents the index in the sourceArray at which copying begins.\n * destinationArray:\n *\t\tThe Array that receives the data.\n * destinationIndex:\n *\t\tA 64-bit integer that represents the index in the destinationArray at which storing begins.\n * length:\n *\t\tA 64-bit integer that represents the number of elements to copy.\n */\n static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {\n for (let i = 0; i < length; i++) {\n destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\n }\n }\n static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {\n for (let i = 0; i < length; i++) {\n destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\n }\n }\n}\n/**\n * A utility class which helps to create the set of DiffChanges from\n * a difference operation. This class accepts original DiffElements and\n * modified DiffElements that are involved in a particular change. The\n * MarktNextChange() method can be called to mark the separation between\n * distinct changes. At the end, the Changes property can be called to retrieve\n * the constructed changes.\n */\nclass DiffChangeHelper {\n /**\n * Constructs a new DiffChangeHelper for the given DiffSequences.\n */\n constructor() {\n this.m_changes = [];\n this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;\n this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;\n this.m_originalCount = 0;\n this.m_modifiedCount = 0;\n }\n /**\n * Marks the beginning of the next change in the set of differences.\n */\n MarkNextChange() {\n // Only add to the list if there is something to add\n if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n // Add the new change to our list\n this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount));\n }\n // Reset for the next change\n this.m_originalCount = 0;\n this.m_modifiedCount = 0;\n this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;\n this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;\n }\n /**\n * Adds the original element at the given position to the elements\n * affected by the current change. The modified index gives context\n * to the change position with respect to the original sequence.\n * @param originalIndex The index of the original element to add.\n * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence.\n */\n AddOriginalElement(originalIndex, modifiedIndex) {\n // The 'true' start index is the smallest of the ones we've seen\n this.m_originalStart = Math.min(this.m_originalStart, originalIndex);\n this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\n this.m_originalCount++;\n }\n /**\n * Adds the modified element at the given position to the elements\n * affected by the current change. The original index gives context\n * to the change position with respect to the modified sequence.\n * @param originalIndex The index of the original element that provides corresponding position in the original sequence.\n * @param modifiedIndex The index of the modified element to add.\n */\n AddModifiedElement(originalIndex, modifiedIndex) {\n // The 'true' start index is the smallest of the ones we've seen\n this.m_originalStart = Math.min(this.m_originalStart, originalIndex);\n this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\n this.m_modifiedCount++;\n }\n /**\n * Retrieves all of the changes marked by the class.\n */\n getChanges() {\n if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n // Finish up on whatever is left\n this.MarkNextChange();\n }\n return this.m_changes;\n }\n /**\n * Retrieves all of the changes marked by the class in the reverse order\n */\n getReverseChanges() {\n if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n // Finish up on whatever is left\n this.MarkNextChange();\n }\n this.m_changes.reverse();\n return this.m_changes;\n }\n}\n/**\n * An implementation of the difference algorithm described in\n * \"An O(ND) Difference Algorithm and its variations\" by Eugene W. Myers\n */\nexport class LcsDiff {\n /**\n * Constructs the DiffFinder\n */\n constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) {\n this.ContinueProcessingPredicate = continueProcessingPredicate;\n const [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence);\n const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence);\n this._hasStrings = (originalHasStrings && modifiedHasStrings);\n this._originalStringElements = originalStringElements;\n this._originalElementsOrHash = originalElementsOrHash;\n this._modifiedStringElements = modifiedStringElements;\n this._modifiedElementsOrHash = modifiedElementsOrHash;\n this.m_forwardHistory = [];\n this.m_reverseHistory = [];\n }\n static _isStringArray(arr) {\n return (arr.length > 0 && typeof arr[0] === 'string');\n }\n static _getElements(sequence) {\n const elements = sequence.getElements();\n if (LcsDiff._isStringArray(elements)) {\n const hashes = new Int32Array(elements.length);\n for (let i = 0, len = elements.length; i < len; i++) {\n hashes[i] = stringHash(elements[i], 0);\n }\n return [elements, hashes, true];\n }\n if (elements instanceof Int32Array) {\n return [[], elements, false];\n }\n return [[], new Int32Array(elements), false];\n }\n ElementsAreEqual(originalIndex, newIndex) {\n if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) {\n return false;\n }\n return (this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true);\n }\n OriginalElementsAreEqual(index1, index2) {\n if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) {\n return false;\n }\n return (this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true);\n }\n ModifiedElementsAreEqual(index1, index2) {\n if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) {\n return false;\n }\n return (this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true);\n }\n ComputeDiff(pretty) {\n return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty);\n }\n /**\n * Computes the differences between the original and modified input\n * sequences on the bounded range.\n * @returns An array of the differences between the two input sequences.\n */\n _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) {\n const quitEarlyArr = [false];\n let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);\n if (pretty) {\n // We have to clean up the computed diff to be more intuitive\n // but it turns out this cannot be done correctly until the entire set\n // of diffs have been computed\n changes = this.PrettifyChanges(changes);\n }\n return {\n quitEarly: quitEarlyArr[0],\n changes: changes\n };\n }\n /**\n * Private helper method which computes the differences on the bounded range\n * recursively.\n * @returns An array of the differences between the two input sequences.\n */\n ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) {\n quitEarlyArr[0] = false;\n // Find the start of the differences\n while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {\n originalStart++;\n modifiedStart++;\n }\n // Find the end of the differences\n while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {\n originalEnd--;\n modifiedEnd--;\n }\n // In the special case where we either have all insertions or all deletions or the sequences are identical\n if (originalStart > originalEnd || modifiedStart > modifiedEnd) {\n let changes;\n if (modifiedStart <= modifiedEnd) {\n Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\n // All insertions\n changes = [\n new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)\n ];\n }\n else if (originalStart <= originalEnd) {\n Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\n // All deletions\n changes = [\n new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0)\n ];\n }\n else {\n Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\n Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\n // Identical sequences - No differences\n changes = [];\n }\n return changes;\n }\n // This problem can be solved using the Divide-And-Conquer technique.\n const midOriginalArr = [0];\n const midModifiedArr = [0];\n const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);\n const midOriginal = midOriginalArr[0];\n const midModified = midModifiedArr[0];\n if (result !== null) {\n // Result is not-null when there was enough memory to compute the changes while\n // searching for the recursion point\n return result;\n }\n else if (!quitEarlyArr[0]) {\n // We can break the problem down recursively by finding the changes in the\n // First Half: (originalStart, modifiedStart) to (midOriginal, midModified)\n // Second Half: (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd)\n // NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point\n const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);\n let rightChanges = [];\n if (!quitEarlyArr[0]) {\n rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);\n }\n else {\n // We did't have time to finish the first half, so we don't have time to compute this half.\n // Consider the entire rest of the sequence different.\n rightChanges = [\n new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)\n ];\n }\n return this.ConcatenateChanges(leftChanges, rightChanges);\n }\n // If we hit here, we quit early, and so can't return anything meaningful\n return [\n new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)\n ];\n }\n WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) {\n let forwardChanges = null;\n let reverseChanges = null;\n // First, walk backward through the forward diagonals history\n let changeHelper = new DiffChangeHelper();\n let diagonalMin = diagonalForwardStart;\n let diagonalMax = diagonalForwardEnd;\n let diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset;\n let lastOriginalIndex = -1073741824 /* MIN_SAFE_SMALL_INTEGER */;\n let historyIndex = this.m_forwardHistory.length - 1;\n do {\n // Get the diagonal index from the relative diagonal number\n const diagonal = diagonalRelative + diagonalForwardBase;\n // Figure out where we came from\n if (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\n // Vertical line (the element is an insert)\n originalIndex = forwardPoints[diagonal + 1];\n modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\n if (originalIndex < lastOriginalIndex) {\n changeHelper.MarkNextChange();\n }\n lastOriginalIndex = originalIndex;\n changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);\n diagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration\n }\n else {\n // Horizontal line (the element is a deletion)\n originalIndex = forwardPoints[diagonal - 1] + 1;\n modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\n if (originalIndex < lastOriginalIndex) {\n changeHelper.MarkNextChange();\n }\n lastOriginalIndex = originalIndex - 1;\n changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);\n diagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration\n }\n if (historyIndex >= 0) {\n forwardPoints = this.m_forwardHistory[historyIndex];\n diagonalForwardBase = forwardPoints[0]; //We stored this in the first spot\n diagonalMin = 1;\n diagonalMax = forwardPoints.length - 1;\n }\n } while (--historyIndex >= -1);\n // Ironically, we get the forward changes as the reverse of the\n // order we added them since we technically added them backwards\n forwardChanges = changeHelper.getReverseChanges();\n if (quitEarlyArr[0]) {\n // TODO: Calculate a partial from the reverse diagonals.\n // For now, just assume everything after the midOriginal/midModified point is a diff\n let originalStartPoint = midOriginalArr[0] + 1;\n let modifiedStartPoint = midModifiedArr[0] + 1;\n if (forwardChanges !== null && forwardChanges.length > 0) {\n const lastForwardChange = forwardChanges[forwardChanges.length - 1];\n originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());\n modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());\n }\n reverseChanges = [\n new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)\n ];\n }\n else {\n // Now walk backward through the reverse diagonals history\n changeHelper = new DiffChangeHelper();\n diagonalMin = diagonalReverseStart;\n diagonalMax = diagonalReverseEnd;\n diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset;\n lastOriginalIndex = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;\n historyIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;\n do {\n // Get the diagonal index from the relative diagonal number\n const diagonal = diagonalRelative + diagonalReverseBase;\n // Figure out where we came from\n if (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\n // Horizontal line (the element is a deletion))\n originalIndex = reversePoints[diagonal + 1] - 1;\n modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\n if (originalIndex > lastOriginalIndex) {\n changeHelper.MarkNextChange();\n }\n lastOriginalIndex = originalIndex + 1;\n changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);\n diagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration\n }\n else {\n // Vertical line (the element is an insertion)\n originalIndex = reversePoints[diagonal - 1];\n modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\n if (originalIndex > lastOriginalIndex) {\n changeHelper.MarkNextChange();\n }\n lastOriginalIndex = originalIndex;\n changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);\n diagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration\n }\n if (historyIndex >= 0) {\n reversePoints = this.m_reverseHistory[historyIndex];\n diagonalReverseBase = reversePoints[0]; //We stored this in the first spot\n diagonalMin = 1;\n diagonalMax = reversePoints.length - 1;\n }\n } while (--historyIndex >= -1);\n // There are cases where the reverse history will find diffs that\n // are correct, but not intuitive, so we need shift them.\n reverseChanges = changeHelper.getChanges();\n }\n return this.ConcatenateChanges(forwardChanges, reverseChanges);\n }\n /**\n * Given the range to compute the diff on, this method finds the point:\n * (midOriginal, midModified)\n * that exists in the middle of the LCS of the two sequences and\n * is the point at which the LCS problem may be broken down recursively.\n * This method will try to keep the LCS trace in memory. If the LCS recursion\n * point is calculated and the full trace is available in memory, then this method\n * will return the change list.\n * @param originalStart The start bound of the original sequence range\n * @param originalEnd The end bound of the original sequence range\n * @param modifiedStart The start bound of the modified sequence range\n * @param modifiedEnd The end bound of the modified sequence range\n * @param midOriginal The middle point of the original sequence range\n * @param midModified The middle point of the modified sequence range\n * @returns The diff changes, if available, otherwise null\n */\n ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) {\n let originalIndex = 0, modifiedIndex = 0;\n let diagonalForwardStart = 0, diagonalForwardEnd = 0;\n let diagonalReverseStart = 0, diagonalReverseEnd = 0;\n // To traverse the edit graph and produce the proper LCS, our actual\n // start position is just outside the given boundary\n originalStart--;\n modifiedStart--;\n // We set these up to make the compiler happy, but they will\n // be replaced before we return with the actual recursion point\n midOriginalArr[0] = 0;\n midModifiedArr[0] = 0;\n // Clear out the history\n this.m_forwardHistory = [];\n this.m_reverseHistory = [];\n // Each cell in the two arrays corresponds to a diagonal in the edit graph.\n // The integer value in the cell represents the originalIndex of the furthest\n // reaching point found so far that ends in that diagonal.\n // The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number.\n const maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart);\n const numDiagonals = maxDifferences + 1;\n const forwardPoints = new Int32Array(numDiagonals);\n const reversePoints = new Int32Array(numDiagonals);\n // diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart)\n // diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd)\n const diagonalForwardBase = (modifiedEnd - modifiedStart);\n const diagonalReverseBase = (originalEnd - originalStart);\n // diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\n // diagonal number (relative to diagonalForwardBase)\n // diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\n // diagonal number (relative to diagonalReverseBase)\n const diagonalForwardOffset = (originalStart - modifiedStart);\n const diagonalReverseOffset = (originalEnd - modifiedEnd);\n // delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers\n // relative to the start diagonal with diagonal numbers relative to the end diagonal.\n // The Even/Oddn-ness of this delta is important for determining when we should check for overlap\n const delta = diagonalReverseBase - diagonalForwardBase;\n const deltaIsEven = (delta % 2 === 0);\n // Here we set up the start and end points as the furthest points found so far\n // in both the forward and reverse directions, respectively\n forwardPoints[diagonalForwardBase] = originalStart;\n reversePoints[diagonalReverseBase] = originalEnd;\n // Remember if we quit early, and thus need to do a best-effort result instead of a real result.\n quitEarlyArr[0] = false;\n // A couple of points:\n // --With this method, we iterate on the number of differences between the two sequences.\n // The more differences there actually are, the longer this will take.\n // --Also, as the number of differences increases, we have to search on diagonals further\n // away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse).\n // --We extend on even diagonals (relative to the reference diagonal) only when numDifferences\n // is even and odd diagonals only when numDifferences is odd.\n for (let numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) {\n let furthestOriginalIndex = 0;\n let furthestModifiedIndex = 0;\n // Run the algorithm in the forward direction\n diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\n diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\n for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {\n // STEP 1: We extend the furthest reaching point in the present diagonal\n // by looking at the diagonals above and below and picking the one whose point\n // is further away from the start point (originalStart, modifiedStart)\n if (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\n originalIndex = forwardPoints[diagonal + 1];\n }\n else {\n originalIndex = forwardPoints[diagonal - 1] + 1;\n }\n modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;\n // Save the current originalIndex so we can test for false overlap in step 3\n const tempOriginalIndex = originalIndex;\n // STEP 2: We can continue to extend the furthest reaching point in the present diagonal\n // so long as the elements are equal.\n while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {\n originalIndex++;\n modifiedIndex++;\n }\n forwardPoints[diagonal] = originalIndex;\n if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {\n furthestOriginalIndex = originalIndex;\n furthestModifiedIndex = modifiedIndex;\n }\n // STEP 3: If delta is odd (overlap first happens on forward when delta is odd)\n // and diagonal is in the range of reverse diagonals computed for numDifferences-1\n // (the previous iteration; we haven't computed reverse diagonals for numDifferences yet)\n // then check for overlap.\n if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) {\n if (originalIndex >= reversePoints[diagonal]) {\n midOriginalArr[0] = originalIndex;\n midModifiedArr[0] = modifiedIndex;\n if (tempOriginalIndex <= reversePoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) {\n // BINGO! We overlapped, and we have the full trace in memory!\n return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\n }\n else {\n // Either false overlap, or we didn't have enough memory for the full trace\n // Just return the recursion point\n return null;\n }\n }\n }\n }\n // Check to see if we should be quitting early, before moving on to the next iteration.\n const matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;\n if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {\n // We can't finish, so skip ahead to generating a result from what we have.\n quitEarlyArr[0] = true;\n // Use the furthest distance we got in the forward direction.\n midOriginalArr[0] = furthestOriginalIndex;\n midModifiedArr[0] = furthestModifiedIndex;\n if (matchLengthOfLongest > 0 && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) {\n // Enough of the history is in memory to walk it backwards\n return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\n }\n else {\n // We didn't actually remember enough of the history.\n //Since we are quiting the diff early, we need to shift back the originalStart and modified start\n //back into the boundary limits since we decremented their value above beyond the boundary limit.\n originalStart++;\n modifiedStart++;\n return [\n new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)\n ];\n }\n }\n // Run the algorithm in the reverse direction\n diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\n diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\n for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {\n // STEP 1: We extend the furthest reaching point in the present diagonal\n // by looking at the diagonals above and below and picking the one whose point\n // is further away from the start point (originalEnd, modifiedEnd)\n if (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\n originalIndex = reversePoints[diagonal + 1] - 1;\n }\n else {\n originalIndex = reversePoints[diagonal - 1];\n }\n modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;\n // Save the current originalIndex so we can test for false overlap\n const tempOriginalIndex = originalIndex;\n // STEP 2: We can continue to extend the furthest reaching point in the present diagonal\n // as long as the elements are equal.\n while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {\n originalIndex--;\n modifiedIndex--;\n }\n reversePoints[diagonal] = originalIndex;\n // STEP 4: If delta is even (overlap first happens on reverse when delta is even)\n // and diagonal is in the range of forward diagonals computed for numDifferences\n // then check for overlap.\n if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {\n if (originalIndex <= forwardPoints[diagonal]) {\n midOriginalArr[0] = originalIndex;\n midModifiedArr[0] = modifiedIndex;\n if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) {\n // BINGO! We overlapped, and we have the full trace in memory!\n return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\n }\n else {\n // Either false overlap, or we didn't have enough memory for the full trace\n // Just return the recursion point\n return null;\n }\n }\n }\n }\n // Save current vectors to history before the next iteration\n if (numDifferences <= 1447 /* MaxDifferencesHistory */) {\n // We are allocating space for one extra int, which we fill with\n // the index of the diagonal base index\n let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2);\n temp[0] = diagonalForwardBase - diagonalForwardStart + 1;\n MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);\n this.m_forwardHistory.push(temp);\n temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2);\n temp[0] = diagonalReverseBase - diagonalReverseStart + 1;\n MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);\n this.m_reverseHistory.push(temp);\n }\n }\n // If we got here, then we have the full trace in history. We just have to convert it to a change list\n // NOTE: This part is a bit messy\n return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\n }\n /**\n * Shifts the given changes to provide a more intuitive diff.\n * While the first element in a diff matches the first element after the diff,\n * we shift the diff down.\n *\n * @param changes The list of changes to shift\n * @returns The shifted changes\n */\n PrettifyChanges(changes) {\n // Shift all the changes down first\n for (let i = 0; i < changes.length; i++) {\n const change = changes[i];\n const originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length;\n const modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length;\n const checkOriginal = change.originalLength > 0;\n const checkModified = change.modifiedLength > 0;\n while (change.originalStart + change.originalLength < originalStop &&\n change.modifiedStart + change.modifiedLength < modifiedStop &&\n (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) &&\n (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) {\n change.originalStart++;\n change.modifiedStart++;\n }\n let mergedChangeArr = [null];\n if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {\n changes[i] = mergedChangeArr[0];\n changes.splice(i + 1, 1);\n i--;\n continue;\n }\n }\n // Shift changes back up until we hit empty or whitespace-only lines\n for (let i = changes.length - 1; i >= 0; i--) {\n const change = changes[i];\n let originalStop = 0;\n let modifiedStop = 0;\n if (i > 0) {\n const prevChange = changes[i - 1];\n if (prevChange.originalLength > 0) {\n originalStop = prevChange.originalStart + prevChange.originalLength;\n }\n if (prevChange.modifiedLength > 0) {\n modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;\n }\n }\n const checkOriginal = change.originalLength > 0;\n const checkModified = change.modifiedLength > 0;\n let bestDelta = 0;\n let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);\n for (let delta = 1;; delta++) {\n const originalStart = change.originalStart - delta;\n const modifiedStart = change.modifiedStart - delta;\n if (originalStart < originalStop || modifiedStart < modifiedStop) {\n break;\n }\n if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {\n break;\n }\n if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {\n break;\n }\n const score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength);\n if (score > bestScore) {\n bestScore = score;\n bestDelta = delta;\n }\n }\n change.originalStart -= bestDelta;\n change.modifiedStart -= bestDelta;\n }\n return changes;\n }\n _OriginalIsBoundary(index) {\n if (index <= 0 || index >= this._originalElementsOrHash.length - 1) {\n return true;\n }\n return (this._hasStrings && /^\\s*$/.test(this._originalStringElements[index]));\n }\n _OriginalRegionIsBoundary(originalStart, originalLength) {\n if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {\n return true;\n }\n if (originalLength > 0) {\n const originalEnd = originalStart + originalLength;\n if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {\n return true;\n }\n }\n return false;\n }\n _ModifiedIsBoundary(index) {\n if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) {\n return true;\n }\n return (this._hasStrings && /^\\s*$/.test(this._modifiedStringElements[index]));\n }\n _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) {\n if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {\n return true;\n }\n if (modifiedLength > 0) {\n const modifiedEnd = modifiedStart + modifiedLength;\n if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {\n return true;\n }\n }\n return false;\n }\n _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) {\n const originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0);\n const modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0);\n return (originalScore + modifiedScore);\n }\n /**\n * Concatenates the two input DiffChange lists and returns the resulting\n * list.\n * @param The left changes\n * @param The right changes\n * @returns The concatenated list\n */\n ConcatenateChanges(left, right) {\n let mergedChangeArr = [];\n if (left.length === 0 || right.length === 0) {\n return (right.length > 0) ? right : left;\n }\n else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {\n // Since we break the problem down recursively, it is possible that we\n // might recurse in the middle of a change thereby splitting it into\n // two changes. Here in the combining stage, we detect and fuse those\n // changes back together\n const result = new Array(left.length + right.length - 1);\n MyArray.Copy(left, 0, result, 0, left.length - 1);\n result[left.length - 1] = mergedChangeArr[0];\n MyArray.Copy(right, 1, result, left.length, right.length - 1);\n return result;\n }\n else {\n const result = new Array(left.length + right.length);\n MyArray.Copy(left, 0, result, 0, left.length);\n MyArray.Copy(right, 0, result, left.length, right.length);\n return result;\n }\n }\n /**\n * Returns true if the two changes overlap and can be merged into a single\n * change\n * @param left The left change\n * @param right The right change\n * @param mergedChange The merged change if the two overlap, null otherwise\n * @returns True if the two changes overlap\n */\n ChangesOverlap(left, right, mergedChangeArr) {\n Debug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change');\n Debug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change');\n if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\n const originalStart = left.originalStart;\n let originalLength = left.originalLength;\n const modifiedStart = left.modifiedStart;\n let modifiedLength = left.modifiedLength;\n if (left.originalStart + left.originalLength >= right.originalStart) {\n originalLength = right.originalStart + right.originalLength - left.originalStart;\n }\n if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\n modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;\n }\n mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength);\n return true;\n }\n else {\n mergedChangeArr[0] = null;\n return false;\n }\n }\n /**\n * Helper method used to clip a diagonal index to the range of valid\n * diagonals. This also decides whether or not the diagonal index,\n * if it exceeds the boundary, should be clipped to the boundary or clipped\n * one inside the boundary depending on the Even/Odd status of the boundary\n * and numDifferences.\n * @param diagonal The index of the diagonal to clip.\n * @param numDifferences The current number of differences being iterated upon.\n * @param diagonalBaseIndex The base reference diagonal.\n * @param numDiagonals The total number of diagonals.\n * @returns The clipped diagonal index.\n */\n ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) {\n if (diagonal >= 0 && diagonal < numDiagonals) {\n // Nothing to clip, its in range\n return diagonal;\n }\n // diagonalsBelow: The number of diagonals below the reference diagonal\n // diagonalsAbove: The number of diagonals above the reference diagonal\n const diagonalsBelow = diagonalBaseIndex;\n const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;\n const diffEven = (numDifferences % 2 === 0);\n if (diagonal < 0) {\n const lowerBoundEven = (diagonalsBelow % 2 === 0);\n return (diffEven === lowerBoundEven) ? 0 : 1;\n }\n else {\n const upperBoundEven = (diagonalsAbove % 2 === 0);\n return (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2;\n }\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Represents information about a specific difference between two sequences.\n */\nexport class DiffChange {\n /**\n * Constructs a new DiffChange with the given sequence information\n * and content.\n */\n constructor(originalStart, originalLength, modifiedStart, modifiedLength) {\n //Debug.Assert(originalLength > 0 || modifiedLength > 0, \"originalLength and modifiedLength cannot both be <= 0\");\n this.originalStart = originalStart;\n this.originalLength = originalLength;\n this.modifiedStart = modifiedStart;\n this.modifiedLength = modifiedLength;\n }\n /**\n * The end point (exclusive) of the change in the original sequence.\n */\n getOriginalEnd() {\n return this.originalStart + this.originalLength;\n }\n /**\n * The end point (exclusive) of the change in the modified sequence.\n */\n getModifiedEnd() {\n return this.modifiedStart + this.modifiedLength;\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// Avoid circular dependency on EventEmitter by implementing a subset of the interface.\nexport class ErrorHandler {\n constructor() {\n this.listeners = [];\n this.unexpectedErrorHandler = function (e) {\n setTimeout(() => {\n if (e.stack) {\n throw new Error(e.message + '\\n\\n' + e.stack);\n }\n throw e;\n }, 0);\n };\n }\n emit(e) {\n this.listeners.forEach((listener) => {\n listener(e);\n });\n }\n onUnexpectedError(e) {\n this.unexpectedErrorHandler(e);\n this.emit(e);\n }\n // For external errors, we don't want the listeners to be called\n onUnexpectedExternalError(e) {\n this.unexpectedErrorHandler(e);\n }\n}\nexport const errorHandler = new ErrorHandler();\nexport function onUnexpectedError(e) {\n // ignore errors from cancelled promises\n if (!isPromiseCanceledError(e)) {\n errorHandler.onUnexpectedError(e);\n }\n return undefined;\n}\nexport function onUnexpectedExternalError(e) {\n // ignore errors from cancelled promises\n if (!isPromiseCanceledError(e)) {\n errorHandler.onUnexpectedExternalError(e);\n }\n return undefined;\n}\nexport function transformErrorForSerialization(error) {\n if (error instanceof Error) {\n let { name, message } = error;\n const stack = error.stacktrace || error.stack;\n return {\n $isError: true,\n name,\n message,\n stack\n };\n }\n // return as is\n return error;\n}\nconst canceledName = 'Canceled';\n/**\n * Checks if the given error is a promise in canceled state\n */\nexport function isPromiseCanceledError(error) {\n return error instanceof Error && error.name === canceledName && error.message === canceledName;\n}\n/**\n * Returns an error that signals cancellation.\n */\nexport function canceled() {\n const error = new Error(canceledName);\n error.name = error.message;\n return error;\n}\nexport function illegalArgument(name) {\n if (name) {\n return new Error(`Illegal argument: ${name}`);\n }\n else {\n return new Error('Illegal argument');\n }\n}\nexport function illegalState(name) {\n if (name) {\n return new Error(`Illegal state: ${name}`);\n }\n else {\n return new Error('Illegal state');\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { onUnexpectedError } from './errors.js';\nimport { Disposable, combinedDisposable, DisposableStore } from './lifecycle.js';\nimport { LinkedList } from './linkedList.js';\nexport var Event;\n(function (Event) {\n Event.None = () => Disposable.None;\n /**\n * Given an event, returns another event which only fires once.\n */\n function once(event) {\n return (listener, thisArgs = null, disposables) => {\n // we need this, in case the event fires during the listener call\n let didFire = false;\n let result;\n result = event(e => {\n if (didFire) {\n return;\n }\n else if (result) {\n result.dispose();\n }\n else {\n didFire = true;\n }\n return listener.call(thisArgs, e);\n }, null, disposables);\n if (didFire) {\n result.dispose();\n }\n return result;\n };\n }\n Event.once = once;\n /**\n * Given an event and a `map` function, returns another event which maps each element\n * through the mapping function.\n */\n function map(event, map) {\n return snapshot((listener, thisArgs = null, disposables) => event(i => listener.call(thisArgs, map(i)), null, disposables));\n }\n Event.map = map;\n /**\n * Given an event and an `each` function, returns another identical event and calls\n * the `each` function per each element.\n */\n function forEach(event, each) {\n return snapshot((listener, thisArgs = null, disposables) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables));\n }\n Event.forEach = forEach;\n function filter(event, filter) {\n return snapshot((listener, thisArgs = null, disposables) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables));\n }\n Event.filter = filter;\n /**\n * Given an event, returns the same event but typed as `Event`.\n */\n function signal(event) {\n return event;\n }\n Event.signal = signal;\n function any(...events) {\n return (listener, thisArgs = null, disposables) => combinedDisposable(...events.map(event => event(e => listener.call(thisArgs, e), null, disposables)));\n }\n Event.any = any;\n /**\n * Given an event and a `merge` function, returns another event which maps each element\n * and the cumulative result through the `merge` function. Similar to `map`, but with memory.\n */\n function reduce(event, merge, initial) {\n let output = initial;\n return map(event, e => {\n output = merge(output, e);\n return output;\n });\n }\n Event.reduce = reduce;\n /**\n * Given a chain of event processing functions (filter, map, etc), each\n * function will be invoked per event & per listener. Snapshotting an event\n * chain allows each function to be invoked just once per event.\n */\n function snapshot(event) {\n let listener;\n const emitter = new Emitter({\n onFirstListenerAdd() {\n listener = event(emitter.fire, emitter);\n },\n onLastListenerRemove() {\n listener.dispose();\n }\n });\n return emitter.event;\n }\n Event.snapshot = snapshot;\n function debounce(event, merge, delay = 100, leading = false, leakWarningThreshold) {\n let subscription;\n let output = undefined;\n let handle = undefined;\n let numDebouncedCalls = 0;\n const emitter = new Emitter({\n leakWarningThreshold,\n onFirstListenerAdd() {\n subscription = event(cur => {\n numDebouncedCalls++;\n output = merge(output, cur);\n if (leading && !handle) {\n emitter.fire(output);\n output = undefined;\n }\n clearTimeout(handle);\n handle = setTimeout(() => {\n const _output = output;\n output = undefined;\n handle = undefined;\n if (!leading || numDebouncedCalls > 1) {\n emitter.fire(_output);\n }\n numDebouncedCalls = 0;\n }, delay);\n });\n },\n onLastListenerRemove() {\n subscription.dispose();\n }\n });\n return emitter.event;\n }\n Event.debounce = debounce;\n /**\n * Given an event, it returns another event which fires only once and as soon as\n * the input event emits. The event data is the number of millis it took for the\n * event to fire.\n */\n function stopwatch(event) {\n const start = new Date().getTime();\n return map(once(event), _ => new Date().getTime() - start);\n }\n Event.stopwatch = stopwatch;\n /**\n * Given an event, it returns another event which fires only when the event\n * element changes.\n */\n function latch(event) {\n let firstCall = true;\n let cache;\n return filter(event, value => {\n const shouldEmit = firstCall || value !== cache;\n firstCall = false;\n cache = value;\n return shouldEmit;\n });\n }\n Event.latch = latch;\n /**\n * Buffers the provided event until a first listener comes\n * along, at which point fire all the events at once and\n * pipe the event from then on.\n *\n * ```typescript\n * const emitter = new Emitter();\n * const event = emitter.event;\n * const bufferedEvent = buffer(event);\n *\n * emitter.fire(1);\n * emitter.fire(2);\n * emitter.fire(3);\n * // nothing...\n *\n * const listener = bufferedEvent(num => console.log(num));\n * // 1, 2, 3\n *\n * emitter.fire(4);\n * // 4\n * ```\n */\n function buffer(event, nextTick = false, _buffer = []) {\n let buffer = _buffer.slice();\n let listener = event(e => {\n if (buffer) {\n buffer.push(e);\n }\n else {\n emitter.fire(e);\n }\n });\n const flush = () => {\n if (buffer) {\n buffer.forEach(e => emitter.fire(e));\n }\n buffer = null;\n };\n const emitter = new Emitter({\n onFirstListenerAdd() {\n if (!listener) {\n listener = event(e => emitter.fire(e));\n }\n },\n onFirstListenerDidAdd() {\n if (buffer) {\n if (nextTick) {\n setTimeout(flush);\n }\n else {\n flush();\n }\n }\n },\n onLastListenerRemove() {\n if (listener) {\n listener.dispose();\n }\n listener = null;\n }\n });\n return emitter.event;\n }\n Event.buffer = buffer;\n class ChainableEvent {\n constructor(event) {\n this.event = event;\n }\n map(fn) {\n return new ChainableEvent(map(this.event, fn));\n }\n forEach(fn) {\n return new ChainableEvent(forEach(this.event, fn));\n }\n filter(fn) {\n return new ChainableEvent(filter(this.event, fn));\n }\n reduce(merge, initial) {\n return new ChainableEvent(reduce(this.event, merge, initial));\n }\n latch() {\n return new ChainableEvent(latch(this.event));\n }\n debounce(merge, delay = 100, leading = false, leakWarningThreshold) {\n return new ChainableEvent(debounce(this.event, merge, delay, leading, leakWarningThreshold));\n }\n on(listener, thisArgs, disposables) {\n return this.event(listener, thisArgs, disposables);\n }\n once(listener, thisArgs, disposables) {\n return once(this.event)(listener, thisArgs, disposables);\n }\n }\n function chain(event) {\n return new ChainableEvent(event);\n }\n Event.chain = chain;\n function fromNodeEventEmitter(emitter, eventName, map = id => id) {\n const fn = (...args) => result.fire(map(...args));\n const onFirstListenerAdd = () => emitter.on(eventName, fn);\n const onLastListenerRemove = () => emitter.removeListener(eventName, fn);\n const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove });\n return result.event;\n }\n Event.fromNodeEventEmitter = fromNodeEventEmitter;\n function fromDOMEventEmitter(emitter, eventName, map = id => id) {\n const fn = (...args) => result.fire(map(...args));\n const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn);\n const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn);\n const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove });\n return result.event;\n }\n Event.fromDOMEventEmitter = fromDOMEventEmitter;\n function fromPromise(promise) {\n const emitter = new Emitter();\n let shouldEmit = false;\n promise\n .then(undefined, () => null)\n .then(() => {\n if (!shouldEmit) {\n setTimeout(() => emitter.fire(undefined), 0);\n }\n else {\n emitter.fire(undefined);\n }\n });\n shouldEmit = true;\n return emitter.event;\n }\n Event.fromPromise = fromPromise;\n function toPromise(event) {\n return new Promise(c => once(event)(c));\n }\n Event.toPromise = toPromise;\n})(Event || (Event = {}));\nlet _globalLeakWarningThreshold = -1;\nclass LeakageMonitor {\n constructor(customThreshold, name = Math.random().toString(18).slice(2, 5)) {\n this.customThreshold = customThreshold;\n this.name = name;\n this._warnCountdown = 0;\n }\n dispose() {\n if (this._stacks) {\n this._stacks.clear();\n }\n }\n check(listenerCount) {\n let threshold = _globalLeakWarningThreshold;\n if (typeof this.customThreshold === 'number') {\n threshold = this.customThreshold;\n }\n if (threshold <= 0 || listenerCount < threshold) {\n return undefined;\n }\n if (!this._stacks) {\n this._stacks = new Map();\n }\n const stack = new Error().stack.split('\\n').slice(3).join('\\n');\n const count = (this._stacks.get(stack) || 0);\n this._stacks.set(stack, count + 1);\n this._warnCountdown -= 1;\n if (this._warnCountdown <= 0) {\n // only warn on first exceed and then every time the limit\n // is exceeded by 50% again\n this._warnCountdown = threshold * 0.5;\n // find most frequent listener and print warning\n let topStack;\n let topCount = 0;\n for (const [stack, count] of this._stacks) {\n if (!topStack || topCount < count) {\n topStack = stack;\n topCount = count;\n }\n }\n console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`);\n console.warn(topStack);\n }\n return () => {\n const count = (this._stacks.get(stack) || 0);\n this._stacks.set(stack, count - 1);\n };\n }\n}\n/**\n * The Emitter can be used to expose an Event to the public\n * to fire it from the insides.\n * Sample:\n class Document {\n\n private readonly _onDidChange = new Emitter<(value:string)=>any>();\n\n public onDidChange = this._onDidChange.event;\n\n // getter-style\n // get onDidChange(): Event<(value:string)=>any> {\n // \treturn this._onDidChange.event;\n // }\n\n private _doIt() {\n //...\n this._onDidChange.fire(value);\n }\n }\n */\nexport class Emitter {\n constructor(options) {\n this._disposed = false;\n this._options = options;\n this._leakageMon = _globalLeakWarningThreshold > 0\n ? new LeakageMonitor(this._options && this._options.leakWarningThreshold)\n : undefined;\n }\n /**\n * For the public to allow to subscribe\n * to events from this Emitter\n */\n get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._listeners) {\n this._listeners = new LinkedList();\n }\n const firstListener = this._listeners.isEmpty();\n if (firstListener && this._options && this._options.onFirstListenerAdd) {\n this._options.onFirstListenerAdd(this);\n }\n const remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]);\n if (firstListener && this._options && this._options.onFirstListenerDidAdd) {\n this._options.onFirstListenerDidAdd(this);\n }\n if (this._options && this._options.onListenerDidAdd) {\n this._options.onListenerDidAdd(this, listener, thisArgs);\n }\n // check and record this emitter for potential leakage\n let removeMonitor;\n if (this._leakageMon) {\n removeMonitor = this._leakageMon.check(this._listeners.size);\n }\n let result;\n result = {\n dispose: () => {\n if (removeMonitor) {\n removeMonitor();\n }\n result.dispose = Emitter._noop;\n if (!this._disposed) {\n remove();\n if (this._options && this._options.onLastListenerRemove) {\n const hasListeners = (this._listeners && !this._listeners.isEmpty());\n if (!hasListeners) {\n this._options.onLastListenerRemove(this);\n }\n }\n }\n }\n };\n if (disposables instanceof DisposableStore) {\n disposables.add(result);\n }\n else if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }\n /**\n * To be kept private to fire an event to\n * subscribers\n */\n fire(event) {\n if (this._listeners) {\n // put all [listener,event]-pairs into delivery queue\n // then emit all event. an inner/nested event might be\n // the driver of this\n if (!this._deliveryQueue) {\n this._deliveryQueue = new LinkedList();\n }\n for (let listener of this._listeners) {\n this._deliveryQueue.push([listener, event]);\n }\n while (this._deliveryQueue.size > 0) {\n const [listener, event] = this._deliveryQueue.shift();\n try {\n if (typeof listener === 'function') {\n listener.call(undefined, event);\n }\n else {\n listener[0].call(listener[1], event);\n }\n }\n catch (e) {\n onUnexpectedError(e);\n }\n }\n }\n }\n dispose() {\n if (this._listeners) {\n this._listeners.clear();\n }\n if (this._deliveryQueue) {\n this._deliveryQueue.clear();\n }\n if (this._leakageMon) {\n this._leakageMon.dispose();\n }\n this._disposed = true;\n }\n}\nEmitter._noop = function () { };\nexport class PauseableEmitter extends Emitter {\n constructor(options) {\n super(options);\n this._isPaused = 0;\n this._eventQueue = new LinkedList();\n this._mergeFn = options && options.merge;\n }\n pause() {\n this._isPaused++;\n }\n resume() {\n if (this._isPaused !== 0 && --this._isPaused === 0) {\n if (this._mergeFn) {\n // use the merge function to create a single composite\n // event. make a copy in case firing pauses this emitter\n const events = this._eventQueue.toArray();\n this._eventQueue.clear();\n super.fire(this._mergeFn(events));\n }\n else {\n // no merging, fire each event individually and test\n // that this emitter isn't paused halfway through\n while (!this._isPaused && this._eventQueue.size !== 0) {\n super.fire(this._eventQueue.shift());\n }\n }\n }\n }\n fire(event) {\n if (this._listeners) {\n if (this._isPaused !== 0) {\n this._eventQueue.push(event);\n }\n else {\n super.fire(event);\n }\n }\n }\n}\n/**\n * The EventBufferer is useful in situations in which you want\n * to delay firing your events during some code.\n * You can wrap that code and be sure that the event will not\n * be fired during that wrap.\n *\n * ```\n * const emitter: Emitter;\n * const delayer = new EventDelayer();\n * const delayedEvent = delayer.wrapEvent(emitter.event);\n *\n * delayedEvent(console.log);\n *\n * delayer.bufferEvents(() => {\n * emitter.fire(); // event will not be fired yet\n * });\n *\n * // event will only be fired at this point\n * ```\n */\nexport class EventBufferer {\n constructor() {\n this.buffers = [];\n }\n wrapEvent(event) {\n return (listener, thisArgs, disposables) => {\n return event(i => {\n const buffer = this.buffers[this.buffers.length - 1];\n if (buffer) {\n buffer.push(() => listener.call(thisArgs, i));\n }\n else {\n listener.call(thisArgs, i);\n }\n }, undefined, disposables);\n };\n }\n bufferEvents(fn) {\n const buffer = [];\n this.buffers.push(buffer);\n const r = fn();\n this.buffers.pop();\n buffer.forEach(flush => flush());\n return r;\n }\n}\n/**\n * A Relay is an event forwarder which functions as a replugabble event pipe.\n * Once created, you can connect an input event to it and it will simply forward\n * events from that input event through its own `event` property. The `input`\n * can be changed at any point in time.\n */\nexport class Relay {\n constructor() {\n this.listening = false;\n this.inputEvent = Event.None;\n this.inputEventListener = Disposable.None;\n this.emitter = new Emitter({\n onFirstListenerDidAdd: () => {\n this.listening = true;\n this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);\n },\n onLastListenerRemove: () => {\n this.listening = false;\n this.inputEventListener.dispose();\n }\n });\n this.event = this.emitter.event;\n }\n set input(event) {\n this.inputEvent = event;\n if (this.listening) {\n this.inputEventListener.dispose();\n this.inputEventListener = event(this.emitter.fire, this.emitter);\n }\n }\n dispose() {\n this.inputEventListener.dispose();\n this.emitter.dispose();\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as strings from './strings.js';\n/**\n * Return a hash value for an object.\n */\nexport function hash(obj) {\n return doHash(obj, 0);\n}\nexport function doHash(obj, hashVal) {\n switch (typeof obj) {\n case 'object':\n if (obj === null) {\n return numberHash(349, hashVal);\n }\n else if (Array.isArray(obj)) {\n return arrayHash(obj, hashVal);\n }\n return objectHash(obj, hashVal);\n case 'string':\n return stringHash(obj, hashVal);\n case 'boolean':\n return booleanHash(obj, hashVal);\n case 'number':\n return numberHash(obj, hashVal);\n case 'undefined':\n return numberHash(937, hashVal);\n default:\n return numberHash(617, hashVal);\n }\n}\nfunction numberHash(val, initialHashVal) {\n return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32\n}\nfunction booleanHash(b, initialHashVal) {\n return numberHash(b ? 433 : 863, initialHashVal);\n}\nexport function stringHash(s, hashVal) {\n hashVal = numberHash(149417, hashVal);\n for (let i = 0, length = s.length; i < length; i++) {\n hashVal = numberHash(s.charCodeAt(i), hashVal);\n }\n return hashVal;\n}\nfunction arrayHash(arr, initialHashVal) {\n initialHashVal = numberHash(104579, initialHashVal);\n return arr.reduce((hashVal, item) => doHash(item, hashVal), initialHashVal);\n}\nfunction objectHash(obj, initialHashVal) {\n initialHashVal = numberHash(181387, initialHashVal);\n return Object.keys(obj).sort().reduce((hashVal, key) => {\n hashVal = stringHash(key, hashVal);\n return doHash(obj[key], hashVal);\n }, initialHashVal);\n}\nfunction leftRotate(value, bits, totalBits = 32) {\n // delta + bits = totalBits\n const delta = totalBits - bits;\n // All ones, expect `delta` zeros aligned to the right\n const mask = ~((1 << delta) - 1);\n // Join (value left-shifted `bits` bits) with (masked value right-shifted `delta` bits)\n return ((value << bits) | ((mask & value) >>> delta)) >>> 0;\n}\nfunction fill(dest, index = 0, count = dest.byteLength, value = 0) {\n for (let i = 0; i < count; i++) {\n dest[index + i] = value;\n }\n}\nfunction leftPad(value, length, char = '0') {\n while (value.length < length) {\n value = char + value;\n }\n return value;\n}\nfunction toHexString(value, bitsize = 32) {\n return leftPad((value >>> 0).toString(16), bitsize / 4);\n}\n/**\n * A SHA1 implementation that works with strings and does not allocate.\n */\nexport class StringSHA1 {\n constructor() {\n this._h0 = 0x67452301;\n this._h1 = 0xEFCDAB89;\n this._h2 = 0x98BADCFE;\n this._h3 = 0x10325476;\n this._h4 = 0xC3D2E1F0;\n this._buff = new Uint8Array(64 /* BLOCK_SIZE */ + 3 /* to fit any utf-8 */);\n this._buffDV = new DataView(this._buff.buffer);\n this._buffLen = 0;\n this._totalLen = 0;\n this._leftoverHighSurrogate = 0;\n this._finished = false;\n }\n update(str) {\n const strLen = str.length;\n if (strLen === 0) {\n return;\n }\n const buff = this._buff;\n let buffLen = this._buffLen;\n let leftoverHighSurrogate = this._leftoverHighSurrogate;\n let charCode;\n let offset;\n if (leftoverHighSurrogate !== 0) {\n charCode = leftoverHighSurrogate;\n offset = -1;\n leftoverHighSurrogate = 0;\n }\n else {\n charCode = str.charCodeAt(0);\n offset = 0;\n }\n while (true) {\n let codePoint = charCode;\n if (strings.isHighSurrogate(charCode)) {\n if (offset + 1 < strLen) {\n const nextCharCode = str.charCodeAt(offset + 1);\n if (strings.isLowSurrogate(nextCharCode)) {\n offset++;\n codePoint = strings.computeCodePoint(charCode, nextCharCode);\n }\n else {\n // illegal => unicode replacement character\n codePoint = 65533 /* UNICODE_REPLACEMENT */;\n }\n }\n else {\n // last character is a surrogate pair\n leftoverHighSurrogate = charCode;\n break;\n }\n }\n else if (strings.isLowSurrogate(charCode)) {\n // illegal => unicode replacement character\n codePoint = 65533 /* UNICODE_REPLACEMENT */;\n }\n buffLen = this._push(buff, buffLen, codePoint);\n offset++;\n if (offset < strLen) {\n charCode = str.charCodeAt(offset);\n }\n else {\n break;\n }\n }\n this._buffLen = buffLen;\n this._leftoverHighSurrogate = leftoverHighSurrogate;\n }\n _push(buff, buffLen, codePoint) {\n if (codePoint < 0x0080) {\n buff[buffLen++] = codePoint;\n }\n else if (codePoint < 0x0800) {\n buff[buffLen++] = 0b11000000 | ((codePoint & 0b00000000000000000000011111000000) >>> 6);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\n }\n else if (codePoint < 0x10000) {\n buff[buffLen++] = 0b11100000 | ((codePoint & 0b00000000000000001111000000000000) >>> 12);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\n }\n else {\n buff[buffLen++] = 0b11110000 | ((codePoint & 0b00000000000111000000000000000000) >>> 18);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000111111000000000000) >>> 12);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\n }\n if (buffLen >= 64 /* BLOCK_SIZE */) {\n this._step();\n buffLen -= 64 /* BLOCK_SIZE */;\n this._totalLen += 64 /* BLOCK_SIZE */;\n // take last 3 in case of UTF8 overflow\n buff[0] = buff[64 /* BLOCK_SIZE */ + 0];\n buff[1] = buff[64 /* BLOCK_SIZE */ + 1];\n buff[2] = buff[64 /* BLOCK_SIZE */ + 2];\n }\n return buffLen;\n }\n digest() {\n if (!this._finished) {\n this._finished = true;\n if (this._leftoverHighSurrogate) {\n // illegal => unicode replacement character\n this._leftoverHighSurrogate = 0;\n this._buffLen = this._push(this._buff, this._buffLen, 65533 /* UNICODE_REPLACEMENT */);\n }\n this._totalLen += this._buffLen;\n this._wrapUp();\n }\n return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4);\n }\n _wrapUp() {\n this._buff[this._buffLen++] = 0x80;\n fill(this._buff, this._buffLen);\n if (this._buffLen > 56) {\n this._step();\n fill(this._buff);\n }\n // this will fit because the mantissa can cover up to 52 bits\n const ml = 8 * this._totalLen;\n this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false);\n this._buffDV.setUint32(60, ml % 4294967296, false);\n this._step();\n }\n _step() {\n const bigBlock32 = StringSHA1._bigBlock32;\n const data = this._buffDV;\n for (let j = 0; j < 64 /* 16*4 */; j += 4) {\n bigBlock32.setUint32(j, data.getUint32(j, false), false);\n }\n for (let j = 64; j < 320 /* 80*4 */; j += 4) {\n bigBlock32.setUint32(j, leftRotate((bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false)), 1), false);\n }\n let a = this._h0;\n let b = this._h1;\n let c = this._h2;\n let d = this._h3;\n let e = this._h4;\n let f, k;\n let temp;\n for (let j = 0; j < 80; j++) {\n if (j < 20) {\n f = (b & c) | ((~b) & d);\n k = 0x5A827999;\n }\n else if (j < 40) {\n f = b ^ c ^ d;\n k = 0x6ED9EBA1;\n }\n else if (j < 60) {\n f = (b & c) | (b & d) | (c & d);\n k = 0x8F1BBCDC;\n }\n else {\n f = b ^ c ^ d;\n k = 0xCA62C1D6;\n }\n temp = (leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false)) & 0xffffffff;\n e = d;\n d = c;\n c = leftRotate(b, 30);\n b = a;\n a = temp;\n }\n this._h0 = (this._h0 + a) & 0xffffffff;\n this._h1 = (this._h1 + b) & 0xffffffff;\n this._h2 = (this._h2 + c) & 0xffffffff;\n this._h3 = (this._h3 + d) & 0xffffffff;\n this._h4 = (this._h4 + e) & 0xffffffff;\n }\n}\nStringSHA1._bigBlock32 = new DataView(new ArrayBuffer(320)); // 80 * 4 = 320\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport var Iterable;\n(function (Iterable) {\n function is(thing) {\n return thing && typeof thing === 'object' && typeof thing[Symbol.iterator] === 'function';\n }\n Iterable.is = is;\n const _empty = Object.freeze([]);\n function empty() {\n return _empty;\n }\n Iterable.empty = empty;\n function* single(element) {\n yield element;\n }\n Iterable.single = single;\n function from(iterable) {\n return iterable || _empty;\n }\n Iterable.from = from;\n function first(iterable) {\n return iterable[Symbol.iterator]().next().value;\n }\n Iterable.first = first;\n function some(iterable, predicate) {\n for (const element of iterable) {\n if (predicate(element)) {\n return true;\n }\n }\n return false;\n }\n Iterable.some = some;\n function* filter(iterable, predicate) {\n for (const element of iterable) {\n if (predicate(element)) {\n yield element;\n }\n }\n }\n Iterable.filter = filter;\n function* map(iterable, fn) {\n for (const element of iterable) {\n yield fn(element);\n }\n }\n Iterable.map = map;\n function* concat(...iterables) {\n for (const iterable of iterables) {\n for (const element of iterable) {\n yield element;\n }\n }\n }\n Iterable.concat = concat;\n /**\n * Consumes `atMost` elements from iterable and returns the consumed elements,\n * and an iterable for the rest of the elements.\n */\n function consume(iterable, atMost = Number.POSITIVE_INFINITY) {\n const consumed = [];\n if (atMost === 0) {\n return [consumed, iterable];\n }\n const iterator = iterable[Symbol.iterator]();\n for (let i = 0; i < atMost; i++) {\n const next = iterator.next();\n if (next.done) {\n return [consumed, Iterable.empty()];\n }\n consumed.push(next.value);\n }\n return [consumed, { [Symbol.iterator]() { return iterator; } }];\n }\n Iterable.consume = consume;\n})(Iterable || (Iterable = {}));\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { illegalArgument } from './errors.js';\nclass KeyCodeStrMap {\n constructor() {\n this._keyCodeToStr = [];\n this._strToKeyCode = Object.create(null);\n }\n define(keyCode, str) {\n this._keyCodeToStr[keyCode] = str;\n this._strToKeyCode[str.toLowerCase()] = keyCode;\n }\n keyCodeToStr(keyCode) {\n return this._keyCodeToStr[keyCode];\n }\n strToKeyCode(str) {\n return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */;\n }\n}\nconst uiMap = new KeyCodeStrMap();\nconst userSettingsUSMap = new KeyCodeStrMap();\nconst userSettingsGeneralMap = new KeyCodeStrMap();\n(function () {\n function define(keyCode, uiLabel, usUserSettingsLabel = uiLabel, generalUserSettingsLabel = usUserSettingsLabel) {\n uiMap.define(keyCode, uiLabel);\n userSettingsUSMap.define(keyCode, usUserSettingsLabel);\n userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel);\n }\n define(0 /* Unknown */, 'unknown');\n define(1 /* Backspace */, 'Backspace');\n define(2 /* Tab */, 'Tab');\n define(3 /* Enter */, 'Enter');\n define(4 /* Shift */, 'Shift');\n define(5 /* Ctrl */, 'Ctrl');\n define(6 /* Alt */, 'Alt');\n define(7 /* PauseBreak */, 'PauseBreak');\n define(8 /* CapsLock */, 'CapsLock');\n define(9 /* Escape */, 'Escape');\n define(10 /* Space */, 'Space');\n define(11 /* PageUp */, 'PageUp');\n define(12 /* PageDown */, 'PageDown');\n define(13 /* End */, 'End');\n define(14 /* Home */, 'Home');\n define(15 /* LeftArrow */, 'LeftArrow', 'Left');\n define(16 /* UpArrow */, 'UpArrow', 'Up');\n define(17 /* RightArrow */, 'RightArrow', 'Right');\n define(18 /* DownArrow */, 'DownArrow', 'Down');\n define(19 /* Insert */, 'Insert');\n define(20 /* Delete */, 'Delete');\n define(21 /* KEY_0 */, '0');\n define(22 /* KEY_1 */, '1');\n define(23 /* KEY_2 */, '2');\n define(24 /* KEY_3 */, '3');\n define(25 /* KEY_4 */, '4');\n define(26 /* KEY_5 */, '5');\n define(27 /* KEY_6 */, '6');\n define(28 /* KEY_7 */, '7');\n define(29 /* KEY_8 */, '8');\n define(30 /* KEY_9 */, '9');\n define(31 /* KEY_A */, 'A');\n define(32 /* KEY_B */, 'B');\n define(33 /* KEY_C */, 'C');\n define(34 /* KEY_D */, 'D');\n define(35 /* KEY_E */, 'E');\n define(36 /* KEY_F */, 'F');\n define(37 /* KEY_G */, 'G');\n define(38 /* KEY_H */, 'H');\n define(39 /* KEY_I */, 'I');\n define(40 /* KEY_J */, 'J');\n define(41 /* KEY_K */, 'K');\n define(42 /* KEY_L */, 'L');\n define(43 /* KEY_M */, 'M');\n define(44 /* KEY_N */, 'N');\n define(45 /* KEY_O */, 'O');\n define(46 /* KEY_P */, 'P');\n define(47 /* KEY_Q */, 'Q');\n define(48 /* KEY_R */, 'R');\n define(49 /* KEY_S */, 'S');\n define(50 /* KEY_T */, 'T');\n define(51 /* KEY_U */, 'U');\n define(52 /* KEY_V */, 'V');\n define(53 /* KEY_W */, 'W');\n define(54 /* KEY_X */, 'X');\n define(55 /* KEY_Y */, 'Y');\n define(56 /* KEY_Z */, 'Z');\n define(57 /* Meta */, 'Meta');\n define(58 /* ContextMenu */, 'ContextMenu');\n define(59 /* F1 */, 'F1');\n define(60 /* F2 */, 'F2');\n define(61 /* F3 */, 'F3');\n define(62 /* F4 */, 'F4');\n define(63 /* F5 */, 'F5');\n define(64 /* F6 */, 'F6');\n define(65 /* F7 */, 'F7');\n define(66 /* F8 */, 'F8');\n define(67 /* F9 */, 'F9');\n define(68 /* F10 */, 'F10');\n define(69 /* F11 */, 'F11');\n define(70 /* F12 */, 'F12');\n define(71 /* F13 */, 'F13');\n define(72 /* F14 */, 'F14');\n define(73 /* F15 */, 'F15');\n define(74 /* F16 */, 'F16');\n define(75 /* F17 */, 'F17');\n define(76 /* F18 */, 'F18');\n define(77 /* F19 */, 'F19');\n define(78 /* NumLock */, 'NumLock');\n define(79 /* ScrollLock */, 'ScrollLock');\n define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1');\n define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS');\n define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA');\n define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS');\n define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD');\n define(85 /* US_SLASH */, '/', '/', 'OEM_2');\n define(86 /* US_BACKTICK */, '`', '`', 'OEM_3');\n define(110 /* ABNT_C1 */, 'ABNT_C1');\n define(111 /* ABNT_C2 */, 'ABNT_C2');\n define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4');\n define(88 /* US_BACKSLASH */, '\\\\', '\\\\', 'OEM_5');\n define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6');\n define(90 /* US_QUOTE */, '\\'', '\\'', 'OEM_7');\n define(91 /* OEM_8 */, 'OEM_8');\n define(92 /* OEM_102 */, 'OEM_102');\n define(93 /* NUMPAD_0 */, 'NumPad0');\n define(94 /* NUMPAD_1 */, 'NumPad1');\n define(95 /* NUMPAD_2 */, 'NumPad2');\n define(96 /* NUMPAD_3 */, 'NumPad3');\n define(97 /* NUMPAD_4 */, 'NumPad4');\n define(98 /* NUMPAD_5 */, 'NumPad5');\n define(99 /* NUMPAD_6 */, 'NumPad6');\n define(100 /* NUMPAD_7 */, 'NumPad7');\n define(101 /* NUMPAD_8 */, 'NumPad8');\n define(102 /* NUMPAD_9 */, 'NumPad9');\n define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply');\n define(104 /* NUMPAD_ADD */, 'NumPad_Add');\n define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator');\n define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract');\n define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal');\n define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide');\n})();\nexport var KeyCodeUtils;\n(function (KeyCodeUtils) {\n function toString(keyCode) {\n return uiMap.keyCodeToStr(keyCode);\n }\n KeyCodeUtils.toString = toString;\n function fromString(key) {\n return uiMap.strToKeyCode(key);\n }\n KeyCodeUtils.fromString = fromString;\n function toUserSettingsUS(keyCode) {\n return userSettingsUSMap.keyCodeToStr(keyCode);\n }\n KeyCodeUtils.toUserSettingsUS = toUserSettingsUS;\n function toUserSettingsGeneral(keyCode) {\n return userSettingsGeneralMap.keyCodeToStr(keyCode);\n }\n KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral;\n function fromUserSettings(key) {\n return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);\n }\n KeyCodeUtils.fromUserSettings = fromUserSettings;\n})(KeyCodeUtils || (KeyCodeUtils = {}));\nexport function KeyChord(firstPart, secondPart) {\n const chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0;\n return (firstPart | chordPart) >>> 0;\n}\nexport function createKeybinding(keybinding, OS) {\n if (keybinding === 0) {\n return null;\n }\n const firstPart = (keybinding & 0x0000FFFF) >>> 0;\n const chordPart = (keybinding & 0xFFFF0000) >>> 16;\n if (chordPart !== 0) {\n return new ChordKeybinding([\n createSimpleKeybinding(firstPart, OS),\n createSimpleKeybinding(chordPart, OS)\n ]);\n }\n return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]);\n}\nexport function createSimpleKeybinding(keybinding, OS) {\n const ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false);\n const winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false);\n const ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd);\n const shiftKey = (keybinding & 1024 /* Shift */ ? true : false);\n const altKey = (keybinding & 512 /* Alt */ ? true : false);\n const metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl);\n const keyCode = (keybinding & 255 /* KeyCode */);\n return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode);\n}\nexport class SimpleKeybinding {\n constructor(ctrlKey, shiftKey, altKey, metaKey, keyCode) {\n this.ctrlKey = ctrlKey;\n this.shiftKey = shiftKey;\n this.altKey = altKey;\n this.metaKey = metaKey;\n this.keyCode = keyCode;\n }\n equals(other) {\n return (this.ctrlKey === other.ctrlKey\n && this.shiftKey === other.shiftKey\n && this.altKey === other.altKey\n && this.metaKey === other.metaKey\n && this.keyCode === other.keyCode);\n }\n isModifierKey() {\n return (this.keyCode === 0 /* Unknown */\n || this.keyCode === 5 /* Ctrl */\n || this.keyCode === 57 /* Meta */\n || this.keyCode === 6 /* Alt */\n || this.keyCode === 4 /* Shift */);\n }\n toChord() {\n return new ChordKeybinding([this]);\n }\n /**\n * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n */\n isDuplicateModifierCase() {\n return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */)\n || (this.shiftKey && this.keyCode === 4 /* Shift */)\n || (this.altKey && this.keyCode === 6 /* Alt */)\n || (this.metaKey && this.keyCode === 57 /* Meta */));\n }\n}\nexport class ChordKeybinding {\n constructor(parts) {\n if (parts.length === 0) {\n throw illegalArgument(`parts`);\n }\n this.parts = parts;\n }\n}\nexport class ResolvedKeybindingPart {\n constructor(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) {\n this.ctrlKey = ctrlKey;\n this.shiftKey = shiftKey;\n this.altKey = altKey;\n this.metaKey = metaKey;\n this.keyLabel = kbLabel;\n this.keyAriaLabel = kbAriaLabel;\n }\n}\n/**\n * A resolved keybinding. Can be a simple keybinding or a chord keybinding.\n */\nexport class ResolvedKeybinding {\n}\n","import { Iterable } from './iterator.js';\n/**\n * Enables logging of potentially leaked disposables.\n *\n * A disposable is considered leaked if it is not disposed or not registered as the child of\n * another disposable. This tracking is very simple an only works for classes that either\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\n */\nconst TRACK_DISPOSABLES = false;\nconst __is_disposable_tracked__ = '__is_disposable_tracked__';\nfunction markTracked(x) {\n if (!TRACK_DISPOSABLES) {\n return;\n }\n if (x && x !== Disposable.None) {\n try {\n x[__is_disposable_tracked__] = true;\n }\n catch (_a) {\n // noop\n }\n }\n}\nfunction trackDisposable(x) {\n if (!TRACK_DISPOSABLES) {\n return x;\n }\n const stack = new Error('Potentially leaked disposable').stack;\n setTimeout(() => {\n if (!x[__is_disposable_tracked__]) {\n console.log(stack);\n }\n }, 3000);\n return x;\n}\nexport class MultiDisposeError extends Error {\n constructor(errors) {\n super(`Encounter errors while disposing of store. Errors: [${errors.join(', ')}]`);\n this.errors = errors;\n }\n}\nexport function isDisposable(thing) {\n return typeof thing.dispose === 'function' && thing.dispose.length === 0;\n}\nexport function dispose(arg) {\n if (Iterable.is(arg)) {\n let errors = [];\n for (const d of arg) {\n if (d) {\n markTracked(d);\n try {\n d.dispose();\n }\n catch (e) {\n errors.push(e);\n }\n }\n }\n if (errors.length === 1) {\n throw errors[0];\n }\n else if (errors.length > 1) {\n throw new MultiDisposeError(errors);\n }\n return Array.isArray(arg) ? [] : arg;\n }\n else if (arg) {\n markTracked(arg);\n arg.dispose();\n return arg;\n }\n}\nexport function combinedDisposable(...disposables) {\n disposables.forEach(markTracked);\n return trackDisposable({ dispose: () => dispose(disposables) });\n}\nexport function toDisposable(fn) {\n const self = trackDisposable({\n dispose: () => {\n markTracked(self);\n fn();\n }\n });\n return self;\n}\nexport class DisposableStore {\n constructor() {\n this._toDispose = new Set();\n this._isDisposed = false;\n }\n /**\n * Dispose of all registered disposables and mark this object as disposed.\n *\n * Any future disposables added to this object will be disposed of on `add`.\n */\n dispose() {\n if (this._isDisposed) {\n return;\n }\n markTracked(this);\n this._isDisposed = true;\n this.clear();\n }\n /**\n * Dispose of all registered disposables but do not mark this object as disposed.\n */\n clear() {\n try {\n dispose(this._toDispose.values());\n }\n finally {\n this._toDispose.clear();\n }\n }\n add(t) {\n if (!t) {\n return t;\n }\n if (t === this) {\n throw new Error('Cannot register a disposable on itself!');\n }\n markTracked(t);\n if (this._isDisposed) {\n if (!DisposableStore.DISABLE_DISPOSED_WARNING) {\n console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);\n }\n }\n else {\n this._toDispose.add(t);\n }\n return t;\n }\n}\nDisposableStore.DISABLE_DISPOSED_WARNING = false;\nexport class Disposable {\n constructor() {\n this._store = new DisposableStore();\n trackDisposable(this);\n }\n dispose() {\n markTracked(this);\n this._store.dispose();\n }\n _register(t) {\n if (t === this) {\n throw new Error('Cannot register a disposable on itself!');\n }\n return this._store.add(t);\n }\n}\nDisposable.None = Object.freeze({ dispose() { } });\n/**\n * Manages the lifecycle of a disposable value that may be changed.\n *\n * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\n */\nexport class MutableDisposable {\n constructor() {\n this._isDisposed = false;\n trackDisposable(this);\n }\n get value() {\n return this._isDisposed ? undefined : this._value;\n }\n set value(value) {\n if (this._isDisposed || value === this._value) {\n return;\n }\n if (this._value) {\n this._value.dispose();\n }\n if (value) {\n markTracked(value);\n }\n this._value = value;\n }\n clear() {\n this.value = undefined;\n }\n dispose() {\n this._isDisposed = true;\n markTracked(this);\n if (this._value) {\n this._value.dispose();\n }\n this._value = undefined;\n }\n}\nexport class ImmortalReference {\n constructor(object) {\n this.object = object;\n }\n dispose() { }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nclass Node {\n constructor(element) {\n this.element = element;\n this.next = Node.Undefined;\n this.prev = Node.Undefined;\n }\n}\nNode.Undefined = new Node(undefined);\nexport class LinkedList {\n constructor() {\n this._first = Node.Undefined;\n this._last = Node.Undefined;\n this._size = 0;\n }\n get size() {\n return this._size;\n }\n isEmpty() {\n return this._first === Node.Undefined;\n }\n clear() {\n this._first = Node.Undefined;\n this._last = Node.Undefined;\n this._size = 0;\n }\n unshift(element) {\n return this._insert(element, false);\n }\n push(element) {\n return this._insert(element, true);\n }\n _insert(element, atTheEnd) {\n const newNode = new Node(element);\n if (this._first === Node.Undefined) {\n this._first = newNode;\n this._last = newNode;\n }\n else if (atTheEnd) {\n // push\n const oldLast = this._last;\n this._last = newNode;\n newNode.prev = oldLast;\n oldLast.next = newNode;\n }\n else {\n // unshift\n const oldFirst = this._first;\n this._first = newNode;\n newNode.next = oldFirst;\n oldFirst.prev = newNode;\n }\n this._size += 1;\n let didRemove = false;\n return () => {\n if (!didRemove) {\n didRemove = true;\n this._remove(newNode);\n }\n };\n }\n shift() {\n if (this._first === Node.Undefined) {\n return undefined;\n }\n else {\n const res = this._first.element;\n this._remove(this._first);\n return res;\n }\n }\n pop() {\n if (this._last === Node.Undefined) {\n return undefined;\n }\n else {\n const res = this._last.element;\n this._remove(this._last);\n return res;\n }\n }\n _remove(node) {\n if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {\n // middle\n const anchor = node.prev;\n anchor.next = node.next;\n node.next.prev = anchor;\n }\n else if (node.prev === Node.Undefined && node.next === Node.Undefined) {\n // only node\n this._first = Node.Undefined;\n this._last = Node.Undefined;\n }\n else if (node.next === Node.Undefined) {\n // last\n this._last = this._last.prev;\n this._last.next = Node.Undefined;\n }\n else if (node.prev === Node.Undefined) {\n // first\n this._first = this._first.next;\n this._first.prev = Node.Undefined;\n }\n // done\n this._size -= 1;\n }\n *[Symbol.iterator]() {\n let node = this._first;\n while (node !== Node.Undefined) {\n yield node.element;\n node = node.next;\n }\n }\n toArray() {\n const result = [];\n for (let node = this._first; node !== Node.Undefined; node = node.next) {\n result.push(node.element);\n }\n return result;\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// NOTE: VSCode's copy of nodejs path library to be usable in common (non-node) namespace\n// Copied from: https://github.com/nodejs/node/blob/v12.8.1/lib/path.js\n/**\n * Copyright Joyent, Inc. and other Node contributors.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to permit\n * persons to whom the Software is furnished to do so, subject to the\n * following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n * USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nimport * as process from './process.js';\nconst CHAR_UPPERCASE_A = 65; /* A */\nconst CHAR_LOWERCASE_A = 97; /* a */\nconst CHAR_UPPERCASE_Z = 90; /* Z */\nconst CHAR_LOWERCASE_Z = 122; /* z */\nconst CHAR_DOT = 46; /* . */\nconst CHAR_FORWARD_SLASH = 47; /* / */\nconst CHAR_BACKWARD_SLASH = 92; /* \\ */\nconst CHAR_COLON = 58; /* : */\nconst CHAR_QUESTION_MARK = 63; /* ? */\nclass ErrorInvalidArgType extends Error {\n constructor(name, expected, actual) {\n // determiner: 'must be' or 'must not be'\n let determiner;\n if (typeof expected === 'string' && expected.indexOf('not ') === 0) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n }\n else {\n determiner = 'must be';\n }\n const type = name.indexOf('.') !== -1 ? 'property' : 'argument';\n let msg = `The \"${name}\" ${type} ${determiner} of type ${expected}`;\n msg += `. Received type ${typeof actual}`;\n super(msg);\n this.code = 'ERR_INVALID_ARG_TYPE';\n }\n}\nfunction validateString(value, name) {\n if (typeof value !== 'string') {\n throw new ErrorInvalidArgType(name, 'string', value);\n }\n}\nfunction isPathSeparator(code) {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n}\nfunction isPosixPathSeparator(code) {\n return code === CHAR_FORWARD_SLASH;\n}\nfunction isWindowsDeviceRoot(code) {\n return code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z ||\n code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z;\n}\n// Resolves . and .. elements in a path with directory names\nfunction normalizeString(path, allowAboveRoot, separator, isPathSeparator) {\n let res = '';\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let code = 0;\n for (let i = 0; i <= path.length; ++i) {\n if (i < path.length) {\n code = path.charCodeAt(i);\n }\n else if (isPathSeparator(code)) {\n break;\n }\n else {\n code = CHAR_FORWARD_SLASH;\n }\n if (isPathSeparator(code)) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n }\n else if (dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 ||\n res.charCodeAt(res.length - 1) !== CHAR_DOT ||\n res.charCodeAt(res.length - 2) !== CHAR_DOT) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(separator);\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n }\n else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n else if (res.length !== 0) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n res += res.length > 0 ? `${separator}..` : '..';\n lastSegmentLength = 2;\n }\n }\n else {\n if (res.length > 0) {\n res += `${separator}${path.slice(lastSlash + 1, i)}`;\n }\n else {\n res = path.slice(lastSlash + 1, i);\n }\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n }\n else if (code === CHAR_DOT && dots !== -1) {\n ++dots;\n }\n else {\n dots = -1;\n }\n }\n return res;\n}\nfunction _format(sep, pathObject) {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new ErrorInvalidArgType('pathObject', 'Object', pathObject);\n }\n const dir = pathObject.dir || pathObject.root;\n const base = pathObject.base ||\n `${pathObject.name || ''}${pathObject.ext || ''}`;\n if (!dir) {\n return base;\n }\n return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep}${base}`;\n}\nexport const win32 = {\n // path.resolve([from ...], to)\n resolve(...pathSegments) {\n let resolvedDevice = '';\n let resolvedTail = '';\n let resolvedAbsolute = false;\n for (let i = pathSegments.length - 1; i >= -1; i--) {\n let path;\n if (i >= 0) {\n path = pathSegments[i];\n validateString(path, 'path');\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n }\n else if (resolvedDevice.length === 0) {\n path = process.cwd();\n }\n else {\n // Windows has the concept of drive-specific current working\n // directories. If we've resolved a drive letter but not yet an\n // absolute path, get cwd for that drive, or the process cwd if\n // the drive cwd is not available. We're sure the device is not\n // a UNC path at this points, because UNC paths are always absolute.\n path = process.env[`=${resolvedDevice}`] || process.cwd();\n // Verify that a cwd was found and that it actually points\n // to our drive. If not, default to the drive's root.\n if (path === undefined ||\n path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&\n path.charCodeAt(2) === CHAR_BACKWARD_SLASH) {\n path = `${resolvedDevice}\\\\`;\n }\n }\n const len = path.length;\n let rootEnd = 0;\n let device = '';\n let isAbsolute = false;\n const code = path.charCodeAt(0);\n // Try to match a root\n if (len === 1) {\n if (isPathSeparator(code)) {\n // `path` contains just a path separator\n rootEnd = 1;\n isAbsolute = true;\n }\n }\n else if (isPathSeparator(code)) {\n // Possible UNC root\n // If we started with a separator, we know we at least have an\n // absolute path of some kind (UNC or otherwise)\n isAbsolute = true;\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n const firstPart = path.slice(last, j);\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j < len && isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j === len || j !== last) {\n // We matched a UNC root\n device = `\\\\\\\\${firstPart}\\\\${path.slice(last, j)}`;\n rootEnd = j;\n }\n }\n }\n }\n else {\n rootEnd = 1;\n }\n }\n else if (isWindowsDeviceRoot(code) &&\n path.charCodeAt(1) === CHAR_COLON) {\n // Possible device root\n device = path.slice(0, 2);\n rootEnd = 2;\n if (len > 2 && isPathSeparator(path.charCodeAt(2))) {\n // Treat separator following drive name as an absolute path\n // indicator\n isAbsolute = true;\n rootEnd = 3;\n }\n }\n if (device.length > 0) {\n if (resolvedDevice.length > 0) {\n if (device.toLowerCase() !== resolvedDevice.toLowerCase()) {\n // This path points to another device so it is not applicable\n continue;\n }\n }\n else {\n resolvedDevice = device;\n }\n }\n if (resolvedAbsolute) {\n if (resolvedDevice.length > 0) {\n break;\n }\n }\n else {\n resolvedTail = `${path.slice(rootEnd)}\\\\${resolvedTail}`;\n resolvedAbsolute = isAbsolute;\n if (isAbsolute && resolvedDevice.length > 0) {\n break;\n }\n }\n }\n // At this point the path should be resolved to a full absolute path,\n // but handle relative paths to be safe (might happen when process.cwd()\n // fails)\n // Normalize the tail path\n resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\\\', isPathSeparator);\n return resolvedAbsolute ?\n `${resolvedDevice}\\\\${resolvedTail}` :\n `${resolvedDevice}${resolvedTail}` || '.';\n },\n normalize(path) {\n validateString(path, 'path');\n const len = path.length;\n if (len === 0) {\n return '.';\n }\n let rootEnd = 0;\n let device;\n let isAbsolute = false;\n const code = path.charCodeAt(0);\n // Try to match a root\n if (len === 1) {\n // `path` contains just a single char, exit early to avoid\n // unnecessary work\n return isPosixPathSeparator(code) ? '\\\\' : path;\n }\n if (isPathSeparator(code)) {\n // Possible UNC root\n // If we started with a separator, we know we at least have an absolute\n // path of some kind (UNC or otherwise)\n isAbsolute = true;\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n const firstPart = path.slice(last, j);\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j < len && isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j === len) {\n // We matched a UNC root only\n // Return the normalized version of the UNC root since there\n // is nothing left to process\n return `\\\\\\\\${firstPart}\\\\${path.slice(last)}\\\\`;\n }\n if (j !== last) {\n // We matched a UNC root with leftovers\n device = `\\\\\\\\${firstPart}\\\\${path.slice(last, j)}`;\n rootEnd = j;\n }\n }\n }\n }\n else {\n rootEnd = 1;\n }\n }\n else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n // Possible device root\n device = path.slice(0, 2);\n rootEnd = 2;\n if (len > 2 && isPathSeparator(path.charCodeAt(2))) {\n // Treat separator following drive name as an absolute path\n // indicator\n isAbsolute = true;\n rootEnd = 3;\n }\n }\n let tail = rootEnd < len ?\n normalizeString(path.slice(rootEnd), !isAbsolute, '\\\\', isPathSeparator) :\n '';\n if (tail.length === 0 && !isAbsolute) {\n tail = '.';\n }\n if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {\n tail += '\\\\';\n }\n if (device === undefined) {\n return isAbsolute ? `\\\\${tail}` : tail;\n }\n return isAbsolute ? `${device}\\\\${tail}` : `${device}${tail}`;\n },\n isAbsolute(path) {\n validateString(path, 'path');\n const len = path.length;\n if (len === 0) {\n return false;\n }\n const code = path.charCodeAt(0);\n return isPathSeparator(code) ||\n // Possible device root\n len > 2 &&\n isWindowsDeviceRoot(code) &&\n path.charCodeAt(1) === CHAR_COLON &&\n isPathSeparator(path.charCodeAt(2));\n },\n join(...paths) {\n if (paths.length === 0) {\n return '.';\n }\n let joined;\n let firstPart;\n for (let i = 0; i < paths.length; ++i) {\n const arg = paths[i];\n validateString(arg, 'path');\n if (arg.length > 0) {\n if (joined === undefined) {\n joined = firstPart = arg;\n }\n else {\n joined += `\\\\${arg}`;\n }\n }\n }\n if (joined === undefined) {\n return '.';\n }\n // Make sure that the joined path doesn't start with two slashes, because\n // normalize() will mistake it for an UNC path then.\n //\n // This step is skipped when it is very clear that the user actually\n // intended to point at an UNC path. This is assumed when the first\n // non-empty string arguments starts with exactly two slashes followed by\n // at least one more non-slash character.\n //\n // Note that for normalize() to treat a path as an UNC path it needs to\n // have at least 2 components, so we don't filter for that here.\n // This means that the user can use join to construct UNC paths from\n // a server name and a share name; for example:\n // path.join('//server', 'share') -> '\\\\\\\\server\\\\share\\\\')\n let needsReplace = true;\n let slashCount = 0;\n if (typeof firstPart === 'string' && isPathSeparator(firstPart.charCodeAt(0))) {\n ++slashCount;\n const firstLen = firstPart.length;\n if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) {\n ++slashCount;\n if (firstLen > 2) {\n if (isPathSeparator(firstPart.charCodeAt(2))) {\n ++slashCount;\n }\n else {\n // We matched a UNC path in the first part\n needsReplace = false;\n }\n }\n }\n }\n if (needsReplace) {\n // Find any more consecutive slashes we need to replace\n while (slashCount < joined.length &&\n isPathSeparator(joined.charCodeAt(slashCount))) {\n slashCount++;\n }\n // Replace the slashes if needed\n if (slashCount >= 2) {\n joined = `\\\\${joined.slice(slashCount)}`;\n }\n }\n return win32.normalize(joined);\n },\n // It will solve the relative path from `from` to `to`, for instance:\n // from = 'C:\\\\orandea\\\\test\\\\aaa'\n // to = 'C:\\\\orandea\\\\impl\\\\bbb'\n // The output of the function should be: '..\\\\..\\\\impl\\\\bbb'\n relative(from, to) {\n validateString(from, 'from');\n validateString(to, 'to');\n if (from === to) {\n return '';\n }\n const fromOrig = win32.resolve(from);\n const toOrig = win32.resolve(to);\n if (fromOrig === toOrig) {\n return '';\n }\n from = fromOrig.toLowerCase();\n to = toOrig.toLowerCase();\n if (from === to) {\n return '';\n }\n // Trim any leading backslashes\n let fromStart = 0;\n while (fromStart < from.length &&\n from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) {\n fromStart++;\n }\n // Trim trailing backslashes (applicable to UNC paths only)\n let fromEnd = from.length;\n while (fromEnd - 1 > fromStart &&\n from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) {\n fromEnd--;\n }\n const fromLen = fromEnd - fromStart;\n // Trim any leading backslashes\n let toStart = 0;\n while (toStart < to.length &&\n to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\n toStart++;\n }\n // Trim trailing backslashes (applicable to UNC paths only)\n let toEnd = to.length;\n while (toEnd - 1 > toStart &&\n to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) {\n toEnd--;\n }\n const toLen = toEnd - toStart;\n // Compare paths to find the longest common path from root\n const length = fromLen < toLen ? fromLen : toLen;\n let lastCommonSep = -1;\n let i = 0;\n for (; i < length; i++) {\n const fromCode = from.charCodeAt(fromStart + i);\n if (fromCode !== to.charCodeAt(toStart + i)) {\n break;\n }\n else if (fromCode === CHAR_BACKWARD_SLASH) {\n lastCommonSep = i;\n }\n }\n // We found a mismatch before the first common path separator was seen, so\n // return the original `to`.\n if (i !== length) {\n if (lastCommonSep === -1) {\n return toOrig;\n }\n }\n else {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo\\\\bar\\\\baz'\n return toOrig.slice(toStart + i + 1);\n }\n if (i === 2) {\n // We get here if `from` is the device root.\n // For example: from='C:\\\\'; to='C:\\\\foo'\n return toOrig.slice(toStart + i);\n }\n }\n if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo'\n lastCommonSep = i;\n }\n else if (i === 2) {\n // We get here if `to` is the device root.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\'\n lastCommonSep = 3;\n }\n }\n if (lastCommonSep === -1) {\n lastCommonSep = 0;\n }\n }\n let out = '';\n // Generate the relative path based on the path difference between `to` and\n // `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {\n out += out.length === 0 ? '..' : '\\\\..';\n }\n }\n toStart += lastCommonSep;\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0) {\n return `${out}${toOrig.slice(toStart, toEnd)}`;\n }\n if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\n ++toStart;\n }\n return toOrig.slice(toStart, toEnd);\n },\n toNamespacedPath(path) {\n // Note: this will *probably* throw somewhere.\n if (typeof path !== 'string') {\n return path;\n }\n if (path.length === 0) {\n return '';\n }\n const resolvedPath = win32.resolve(path);\n if (resolvedPath.length <= 2) {\n return path;\n }\n if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {\n // Possible UNC root\n if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {\n const code = resolvedPath.charCodeAt(2);\n if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {\n // Matched non-long UNC root, convert the path to a long UNC path\n return `\\\\\\\\?\\\\UNC\\\\${resolvedPath.slice(2)}`;\n }\n }\n }\n else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) &&\n resolvedPath.charCodeAt(1) === CHAR_COLON &&\n resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {\n // Matched device root, convert the path to a long UNC path\n return `\\\\\\\\?\\\\${resolvedPath}`;\n }\n return path;\n },\n dirname(path) {\n validateString(path, 'path');\n const len = path.length;\n if (len === 0) {\n return '.';\n }\n let rootEnd = -1;\n let offset = 0;\n const code = path.charCodeAt(0);\n if (len === 1) {\n // `path` contains just a path separator, exit early to avoid\n // unnecessary work or a dot.\n return isPathSeparator(code) ? path : '.';\n }\n // Try to match a root\n if (isPathSeparator(code)) {\n // Possible UNC root\n rootEnd = offset = 1;\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j < len && isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j === len) {\n // We matched a UNC root only\n return path;\n }\n if (j !== last) {\n // We matched a UNC root with leftovers\n // Offset by 1 to include the separator after the UNC root to\n // treat it as a \"normal root\" on top of a (UNC) root\n rootEnd = offset = j + 1;\n }\n }\n }\n }\n // Possible device root\n }\n else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2;\n offset = rootEnd;\n }\n let end = -1;\n let matchedSlash = true;\n for (let i = len - 1; i >= offset; --i) {\n if (isPathSeparator(path.charCodeAt(i))) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n }\n else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n if (end === -1) {\n if (rootEnd === -1) {\n return '.';\n }\n end = rootEnd;\n }\n return path.slice(0, end);\n },\n basename(path, ext) {\n if (ext !== undefined) {\n validateString(ext, 'ext');\n }\n validateString(path, 'path');\n let start = 0;\n let end = -1;\n let matchedSlash = true;\n let i;\n // Check for a drive letter prefix so as not to mistake the following\n // path separator as an extra separator at the end of the path that can be\n // disregarded\n if (path.length >= 2 &&\n isWindowsDeviceRoot(path.charCodeAt(0)) &&\n path.charCodeAt(1) === CHAR_COLON) {\n start = 2;\n }\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext === path) {\n return '';\n }\n let extIdx = ext.length - 1;\n let firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= start; --i) {\n const code = path.charCodeAt(i);\n if (isPathSeparator(code)) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n }\n else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n }\n else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n if (start === end) {\n end = firstNonSlashEnd;\n }\n else if (end === -1) {\n end = path.length;\n }\n return path.slice(start, end);\n }\n for (i = path.length - 1; i >= start; --i) {\n if (isPathSeparator(path.charCodeAt(i))) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n }\n else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n if (end === -1) {\n return '';\n }\n return path.slice(start, end);\n },\n extname(path) {\n validateString(path, 'path');\n let start = 0;\n let startDot = -1;\n let startPart = 0;\n let end = -1;\n let matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n let preDotState = 0;\n // Check for a drive letter prefix so as not to mistake the following\n // path separator as an extra separator at the end of the path that can be\n // disregarded\n if (path.length >= 2 &&\n path.charCodeAt(1) === CHAR_COLON &&\n isWindowsDeviceRoot(path.charCodeAt(0))) {\n start = startPart = 2;\n }\n for (let i = path.length - 1; i >= start; --i) {\n const code = path.charCodeAt(i);\n if (isPathSeparator(code)) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === CHAR_DOT) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) {\n startDot = i;\n }\n else if (preDotState !== 1) {\n preDotState = 1;\n }\n }\n else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (startDot === -1 ||\n end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n (preDotState === 1 &&\n startDot === end - 1 &&\n startDot === startPart + 1)) {\n return '';\n }\n return path.slice(startDot, end);\n },\n format: _format.bind(null, '\\\\'),\n parse(path) {\n validateString(path, 'path');\n const ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) {\n return ret;\n }\n const len = path.length;\n let rootEnd = 0;\n let code = path.charCodeAt(0);\n if (len === 1) {\n if (isPathSeparator(code)) {\n // `path` contains just a path separator, exit early to avoid\n // unnecessary work\n ret.root = ret.dir = path;\n return ret;\n }\n ret.base = ret.name = path;\n return ret;\n }\n // Try to match a root\n if (isPathSeparator(code)) {\n // Possible UNC root\n rootEnd = 1;\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j < len && isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j === len) {\n // We matched a UNC root only\n rootEnd = j;\n }\n else if (j !== last) {\n // We matched a UNC root with leftovers\n rootEnd = j + 1;\n }\n }\n }\n }\n }\n else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n // Possible device root\n if (len <= 2) {\n // `path` contains just a drive root, exit early to avoid\n // unnecessary work\n ret.root = ret.dir = path;\n return ret;\n }\n rootEnd = 2;\n if (isPathSeparator(path.charCodeAt(2))) {\n if (len === 3) {\n // `path` contains just a drive root, exit early to avoid\n // unnecessary work\n ret.root = ret.dir = path;\n return ret;\n }\n rootEnd = 3;\n }\n }\n if (rootEnd > 0) {\n ret.root = path.slice(0, rootEnd);\n }\n let startDot = -1;\n let startPart = rootEnd;\n let end = -1;\n let matchedSlash = true;\n let i = path.length - 1;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n let preDotState = 0;\n // Get non-dir info\n for (; i >= rootEnd; --i) {\n code = path.charCodeAt(i);\n if (isPathSeparator(code)) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === CHAR_DOT) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) {\n startDot = i;\n }\n else if (preDotState !== 1) {\n preDotState = 1;\n }\n }\n else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (end !== -1) {\n if (startDot === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n (preDotState === 1 &&\n startDot === end - 1 &&\n startDot === startPart + 1)) {\n ret.base = ret.name = path.slice(startPart, end);\n }\n else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n ret.ext = path.slice(startDot, end);\n }\n }\n // If the directory is the root, use the entire root as the `dir` including\n // the trailing slash if any (`C:\\abc` -> `C:\\`). Otherwise, strip out the\n // trailing slash (`C:\\abc\\def` -> `C:\\abc`).\n if (startPart > 0 && startPart !== rootEnd) {\n ret.dir = path.slice(0, startPart - 1);\n }\n else {\n ret.dir = ret.root;\n }\n return ret;\n },\n sep: '\\\\',\n delimiter: ';',\n win32: null,\n posix: null\n};\nexport const posix = {\n // path.resolve([from ...], to)\n resolve(...pathSegments) {\n let resolvedPath = '';\n let resolvedAbsolute = false;\n for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n const path = i >= 0 ? pathSegments[i] : process.cwd();\n validateString(path, 'path');\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n resolvedPath = `${path}/${resolvedPath}`;\n resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, '/', isPosixPathSeparator);\n if (resolvedAbsolute) {\n return `/${resolvedPath}`;\n }\n return resolvedPath.length > 0 ? resolvedPath : '.';\n },\n normalize(path) {\n validateString(path, 'path');\n if (path.length === 0) {\n return '.';\n }\n const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH;\n // Normalize the path\n path = normalizeString(path, !isAbsolute, '/', isPosixPathSeparator);\n if (path.length === 0) {\n if (isAbsolute) {\n return '/';\n }\n return trailingSeparator ? './' : '.';\n }\n if (trailingSeparator) {\n path += '/';\n }\n return isAbsolute ? `/${path}` : path;\n },\n isAbsolute(path) {\n validateString(path, 'path');\n return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n },\n join(...paths) {\n if (paths.length === 0) {\n return '.';\n }\n let joined;\n for (let i = 0; i < paths.length; ++i) {\n const arg = paths[i];\n validateString(arg, 'path');\n if (arg.length > 0) {\n if (joined === undefined) {\n joined = arg;\n }\n else {\n joined += `/${arg}`;\n }\n }\n }\n if (joined === undefined) {\n return '.';\n }\n return posix.normalize(joined);\n },\n relative(from, to) {\n validateString(from, 'from');\n validateString(to, 'to');\n if (from === to) {\n return '';\n }\n // Trim leading forward slashes.\n from = posix.resolve(from);\n to = posix.resolve(to);\n if (from === to) {\n return '';\n }\n const fromStart = 1;\n const fromEnd = from.length;\n const fromLen = fromEnd - fromStart;\n const toStart = 1;\n const toLen = to.length - toStart;\n // Compare paths to find the longest common path from root\n const length = (fromLen < toLen ? fromLen : toLen);\n let lastCommonSep = -1;\n let i = 0;\n for (; i < length; i++) {\n const fromCode = from.charCodeAt(fromStart + i);\n if (fromCode !== to.charCodeAt(toStart + i)) {\n break;\n }\n else if (fromCode === CHAR_FORWARD_SLASH) {\n lastCommonSep = i;\n }\n }\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='/foo/bar'; to='/foo/bar/baz'\n return to.slice(toStart + i + 1);\n }\n if (i === 0) {\n // We get here if `from` is the root\n // For example: from='/'; to='/foo'\n return to.slice(toStart + i);\n }\n }\n else if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='/foo/bar/baz'; to='/foo/bar'\n lastCommonSep = i;\n }\n else if (i === 0) {\n // We get here if `to` is the root.\n // For example: from='/foo/bar'; to='/'\n lastCommonSep = 0;\n }\n }\n }\n let out = '';\n // Generate the relative path based on the path difference between `to`\n // and `from`.\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n out += out.length === 0 ? '..' : '/..';\n }\n }\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts.\n return `${out}${to.slice(toStart + lastCommonSep)}`;\n },\n toNamespacedPath(path) {\n // Non-op on posix systems\n return path;\n },\n dirname(path) {\n validateString(path, 'path');\n if (path.length === 0) {\n return '.';\n }\n const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n let end = -1;\n let matchedSlash = true;\n for (let i = path.length - 1; i >= 1; --i) {\n if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n }\n else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n if (end === -1) {\n return hasRoot ? '/' : '.';\n }\n if (hasRoot && end === 1) {\n return '//';\n }\n return path.slice(0, end);\n },\n basename(path, ext) {\n if (ext !== undefined) {\n validateString(ext, 'ext');\n }\n validateString(path, 'path');\n let start = 0;\n let end = -1;\n let matchedSlash = true;\n let i;\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext === path) {\n return '';\n }\n let extIdx = ext.length - 1;\n let firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n const code = path.charCodeAt(i);\n if (code === CHAR_FORWARD_SLASH) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n }\n else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n }\n else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n if (start === end) {\n end = firstNonSlashEnd;\n }\n else if (end === -1) {\n end = path.length;\n }\n return path.slice(start, end);\n }\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n }\n else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n if (end === -1) {\n return '';\n }\n return path.slice(start, end);\n },\n extname(path) {\n validateString(path, 'path');\n let startDot = -1;\n let startPart = 0;\n let end = -1;\n let matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n let preDotState = 0;\n for (let i = path.length - 1; i >= 0; --i) {\n const code = path.charCodeAt(i);\n if (code === CHAR_FORWARD_SLASH) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === CHAR_DOT) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) {\n startDot = i;\n }\n else if (preDotState !== 1) {\n preDotState = 1;\n }\n }\n else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (startDot === -1 ||\n end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n (preDotState === 1 &&\n startDot === end - 1 &&\n startDot === startPart + 1)) {\n return '';\n }\n return path.slice(startDot, end);\n },\n format: _format.bind(null, '/'),\n parse(path) {\n validateString(path, 'path');\n const ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) {\n return ret;\n }\n const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n let start;\n if (isAbsolute) {\n ret.root = '/';\n start = 1;\n }\n else {\n start = 0;\n }\n let startDot = -1;\n let startPart = 0;\n let end = -1;\n let matchedSlash = true;\n let i = path.length - 1;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n let preDotState = 0;\n // Get non-dir info\n for (; i >= start; --i) {\n const code = path.charCodeAt(i);\n if (code === CHAR_FORWARD_SLASH) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === CHAR_DOT) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) {\n startDot = i;\n }\n else if (preDotState !== 1) {\n preDotState = 1;\n }\n }\n else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (end !== -1) {\n const start = startPart === 0 && isAbsolute ? 1 : startPart;\n if (startDot === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n (preDotState === 1 &&\n startDot === end - 1 &&\n startDot === startPart + 1)) {\n ret.base = ret.name = path.slice(start, end);\n }\n else {\n ret.name = path.slice(start, startDot);\n ret.base = path.slice(start, end);\n ret.ext = path.slice(startDot, end);\n }\n }\n if (startPart > 0) {\n ret.dir = path.slice(0, startPart - 1);\n }\n else if (isAbsolute) {\n ret.dir = '/';\n }\n return ret;\n },\n sep: '/',\n delimiter: ':',\n win32: null,\n posix: null\n};\nposix.win32 = win32.win32 = win32;\nposix.posix = win32.posix = posix;\nexport const normalize = (process.platform === 'win32' ? win32.normalize : posix.normalize);\nexport const resolve = (process.platform === 'win32' ? win32.resolve : posix.resolve);\nexport const relative = (process.platform === 'win32' ? win32.relative : posix.relative);\nexport const dirname = (process.platform === 'win32' ? win32.dirname : posix.dirname);\nexport const basename = (process.platform === 'win32' ? win32.basename : posix.basename);\nexport const extname = (process.platform === 'win32' ? win32.extname : posix.extname);\nexport const sep = (process.platform === 'win32' ? win32.sep : posix.sep);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nconst LANGUAGE_DEFAULT = 'en';\nlet _isWindows = false;\nlet _isMacintosh = false;\nlet _isLinux = false;\nlet _isNative = false;\nlet _isWeb = false;\nlet _isIOS = false;\nlet _locale = undefined;\nlet _language = LANGUAGE_DEFAULT;\nlet _translationsConfigFile = undefined;\nlet _userAgent = undefined;\nconst isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer');\n// OS detection\nif (typeof navigator === 'object' && !isElectronRenderer) {\n _userAgent = navigator.userAgent;\n _isWindows = _userAgent.indexOf('Windows') >= 0;\n _isMacintosh = _userAgent.indexOf('Macintosh') >= 0;\n _isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;\n _isLinux = _userAgent.indexOf('Linux') >= 0;\n _isWeb = true;\n _locale = navigator.language;\n _language = _locale;\n}\nelse if (typeof process === 'object') {\n _isWindows = (process.platform === 'win32');\n _isMacintosh = (process.platform === 'darwin');\n _isLinux = (process.platform === 'linux');\n _locale = LANGUAGE_DEFAULT;\n _language = LANGUAGE_DEFAULT;\n const rawNlsConfig = process.env['VSCODE_NLS_CONFIG'];\n if (rawNlsConfig) {\n try {\n const nlsConfig = JSON.parse(rawNlsConfig);\n const resolved = nlsConfig.availableLanguages['*'];\n _locale = nlsConfig.locale;\n // VSCode's default language is 'en'\n _language = resolved ? resolved : LANGUAGE_DEFAULT;\n _translationsConfigFile = nlsConfig._translationsConfigFile;\n }\n catch (e) {\n }\n }\n _isNative = true;\n}\nlet _platform = 0 /* Web */;\nif (_isMacintosh) {\n _platform = 1 /* Mac */;\n}\nelse if (_isWindows) {\n _platform = 3 /* Windows */;\n}\nelse if (_isLinux) {\n _platform = 2 /* Linux */;\n}\nexport const isWindows = _isWindows;\nexport const isMacintosh = _isMacintosh;\nexport const isLinux = _isLinux;\nexport const isNative = _isNative;\nexport const isWeb = _isWeb;\nexport const isIOS = _isIOS;\nconst _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {});\nexport const globals = _globals;\nexport const setImmediate = (function defineSetImmediate() {\n if (globals.setImmediate) {\n return globals.setImmediate.bind(globals);\n }\n if (typeof globals.postMessage === 'function' && !globals.importScripts) {\n let pending = [];\n globals.addEventListener('message', (e) => {\n if (e.data && e.data.vscodeSetImmediateId) {\n for (let i = 0, len = pending.length; i < len; i++) {\n const candidate = pending[i];\n if (candidate.id === e.data.vscodeSetImmediateId) {\n pending.splice(i, 1);\n candidate.callback();\n return;\n }\n }\n }\n });\n let lastId = 0;\n return (callback) => {\n const myId = ++lastId;\n pending.push({\n id: myId,\n callback: callback\n });\n globals.postMessage({ vscodeSetImmediateId: myId }, '*');\n };\n }\n if (typeof process !== 'undefined' && typeof process.nextTick === 'function') {\n return process.nextTick.bind(process);\n }\n const _promise = Promise.resolve();\n return (callback) => _promise.then(callback);\n})();\nexport const OS = (_isMacintosh || _isIOS ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */));\nlet _isLittleEndian = true;\nlet _isLittleEndianComputed = false;\nexport function isLittleEndian() {\n if (!_isLittleEndianComputed) {\n _isLittleEndianComputed = true;\n const test = new Uint8Array(2);\n test[0] = 1;\n test[1] = 2;\n const view = new Uint16Array(test.buffer);\n _isLittleEndian = (view[0] === (2 << 8) + 1);\n }\n return _isLittleEndian;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { isWindows, isMacintosh, setImmediate } from './platform.js';\nconst safeProcess = (typeof process === 'undefined') ? {\n cwd() { return '/'; },\n env: Object.create(null),\n get platform() { return isWindows ? 'win32' : isMacintosh ? 'darwin' : 'linux'; },\n nextTick(callback) { return setImmediate(callback); }\n} : process;\nexport const cwd = safeProcess.cwd;\nexport const env = safeProcess.env;\nexport const platform = safeProcess.platform;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport function isFalsyOrWhitespace(str) {\n if (!str || typeof str !== 'string') {\n return true;\n }\n return str.trim().length === 0;\n}\n/**\n * @deprecated ES6: use `String.padStart`\n */\nexport function pad(n, l, char = '0') {\n const str = '' + n;\n const r = [str];\n for (let i = str.length; i < l; i++) {\n r.push(char);\n }\n return r.reverse().join('');\n}\nconst _formatRegexp = /{(\\d+)}/g;\n/**\n * Helper to produce a string with a variable number of arguments. Insert variable segments\n * into the string using the {n} notation where N is the index of the argument following the string.\n * @param value string to which formatting is applied\n * @param args replacements for {n}-entries\n */\nexport function format(value, ...args) {\n if (args.length === 0) {\n return value;\n }\n return value.replace(_formatRegexp, function (match, group) {\n const idx = parseInt(group, 10);\n return isNaN(idx) || idx < 0 || idx >= args.length ?\n match :\n args[idx];\n });\n}\n/**\n * Converts HTML characters inside the string to use entities instead. Makes the string safe from\n * being used e.g. in HTMLElement.innerHTML.\n */\nexport function escape(html) {\n return html.replace(/[<>&]/g, function (match) {\n switch (match) {\n case '<': return '<';\n case '>': return '>';\n case '&': return '&';\n default: return match;\n }\n });\n}\n/**\n * Escapes regular expression characters in a given string\n */\nexport function escapeRegExpCharacters(value) {\n return value.replace(/[\\\\\\{\\}\\*\\+\\?\\|\\^\\$\\.\\[\\]\\(\\)]/g, '\\\\$&');\n}\n/**\n * Removes all occurrences of needle from the beginning and end of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim (default is a blank)\n */\nexport function trim(haystack, needle = ' ') {\n const trimmed = ltrim(haystack, needle);\n return rtrim(trimmed, needle);\n}\n/**\n * Removes all occurrences of needle from the beginning of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim\n */\nexport function ltrim(haystack, needle) {\n if (!haystack || !needle) {\n return haystack;\n }\n const needleLen = needle.length;\n if (needleLen === 0 || haystack.length === 0) {\n return haystack;\n }\n let offset = 0;\n while (haystack.indexOf(needle, offset) === offset) {\n offset = offset + needleLen;\n }\n return haystack.substring(offset);\n}\n/**\n * Removes all occurrences of needle from the end of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim\n */\nexport function rtrim(haystack, needle) {\n if (!haystack || !needle) {\n return haystack;\n }\n const needleLen = needle.length, haystackLen = haystack.length;\n if (needleLen === 0 || haystackLen === 0) {\n return haystack;\n }\n let offset = haystackLen, idx = -1;\n while (true) {\n idx = haystack.lastIndexOf(needle, offset - 1);\n if (idx === -1 || idx + needleLen !== offset) {\n break;\n }\n if (idx === 0) {\n return '';\n }\n offset = idx;\n }\n return haystack.substring(0, offset);\n}\nexport function convertSimple2RegExpPattern(pattern) {\n return pattern.replace(/[\\-\\\\\\{\\}\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, '\\\\$&').replace(/[\\*]/g, '.*');\n}\nexport function stripWildcards(pattern) {\n return pattern.replace(/\\*/g, '');\n}\n/**\n * @deprecated ES6: use `String.startsWith`\n */\nexport function startsWith(haystack, needle) {\n if (haystack.length < needle.length) {\n return false;\n }\n if (haystack === needle) {\n return true;\n }\n for (let i = 0; i < needle.length; i++) {\n if (haystack[i] !== needle[i]) {\n return false;\n }\n }\n return true;\n}\n/**\n * @deprecated ES6: use `String.endsWith`\n */\nexport function endsWith(haystack, needle) {\n const diff = haystack.length - needle.length;\n if (diff > 0) {\n return haystack.indexOf(needle, diff) === diff;\n }\n else if (diff === 0) {\n return haystack === needle;\n }\n else {\n return false;\n }\n}\nexport function createRegExp(searchString, isRegex, options = {}) {\n if (!searchString) {\n throw new Error('Cannot create regex from empty string');\n }\n if (!isRegex) {\n searchString = escapeRegExpCharacters(searchString);\n }\n if (options.wholeWord) {\n if (!/\\B/.test(searchString.charAt(0))) {\n searchString = '\\\\b' + searchString;\n }\n if (!/\\B/.test(searchString.charAt(searchString.length - 1))) {\n searchString = searchString + '\\\\b';\n }\n }\n let modifiers = '';\n if (options.global) {\n modifiers += 'g';\n }\n if (!options.matchCase) {\n modifiers += 'i';\n }\n if (options.multiline) {\n modifiers += 'm';\n }\n if (options.unicode) {\n modifiers += 'u';\n }\n return new RegExp(searchString, modifiers);\n}\nexport function regExpLeadsToEndlessLoop(regexp) {\n // Exit early if it's one of these special cases which are meant to match\n // against an empty string\n if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\\\s*$') {\n return false;\n }\n // We check against an empty string. If the regular expression doesn't advance\n // (e.g. ends in an endless loop) it will match an empty string.\n const match = regexp.exec('');\n return !!(match && regexp.lastIndex === 0);\n}\nexport function regExpFlags(regexp) {\n return (regexp.global ? 'g' : '')\n + (regexp.ignoreCase ? 'i' : '')\n + (regexp.multiline ? 'm' : '')\n + (regexp /* standalone editor compilation */.unicode ? 'u' : '');\n}\n/**\n * Returns first index of the string that is not whitespace.\n * If string is empty or contains only whitespaces, returns -1\n */\nexport function firstNonWhitespaceIndex(str) {\n for (let i = 0, len = str.length; i < len; i++) {\n const chCode = str.charCodeAt(i);\n if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {\n return i;\n }\n }\n return -1;\n}\n/**\n * Returns the leading whitespace of the string.\n * If the string contains only whitespaces, returns entire string\n */\nexport function getLeadingWhitespace(str, start = 0, end = str.length) {\n for (let i = start; i < end; i++) {\n const chCode = str.charCodeAt(i);\n if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {\n return str.substring(start, i);\n }\n }\n return str.substring(start, end);\n}\n/**\n * Returns last index of the string that is not whitespace.\n * If string is empty or contains only whitespaces, returns -1\n */\nexport function lastNonWhitespaceIndex(str, startIndex = str.length - 1) {\n for (let i = startIndex; i >= 0; i--) {\n const chCode = str.charCodeAt(i);\n if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {\n return i;\n }\n }\n return -1;\n}\nexport function compare(a, b) {\n if (a < b) {\n return -1;\n }\n else if (a > b) {\n return 1;\n }\n else {\n return 0;\n }\n}\nexport function compareSubstring(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) {\n for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {\n let codeA = a.charCodeAt(aStart);\n let codeB = b.charCodeAt(bStart);\n if (codeA < codeB) {\n return -1;\n }\n else if (codeA > codeB) {\n return 1;\n }\n }\n const aLen = aEnd - aStart;\n const bLen = bEnd - bStart;\n if (aLen < bLen) {\n return -1;\n }\n else if (aLen > bLen) {\n return 1;\n }\n return 0;\n}\nexport function compareIgnoreCase(a, b) {\n return compareSubstringIgnoreCase(a, b, 0, a.length, 0, b.length);\n}\nexport function compareSubstringIgnoreCase(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) {\n for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {\n let codeA = a.charCodeAt(aStart);\n let codeB = b.charCodeAt(bStart);\n if (codeA === codeB) {\n // equal\n continue;\n }\n const diff = codeA - codeB;\n if (diff === 32 && isUpperAsciiLetter(codeB)) { //codeB =[65-90] && codeA =[97-122]\n continue;\n }\n else if (diff === -32 && isUpperAsciiLetter(codeA)) { //codeB =[97-122] && codeA =[65-90]\n continue;\n }\n if (isLowerAsciiLetter(codeA) && isLowerAsciiLetter(codeB)) {\n //\n return diff;\n }\n else {\n return compareSubstring(a.toLowerCase(), b.toLowerCase(), aStart, aEnd, bStart, bEnd);\n }\n }\n const aLen = aEnd - aStart;\n const bLen = bEnd - bStart;\n if (aLen < bLen) {\n return -1;\n }\n else if (aLen > bLen) {\n return 1;\n }\n return 0;\n}\nexport function isLowerAsciiLetter(code) {\n return code >= 97 /* a */ && code <= 122 /* z */;\n}\nexport function isUpperAsciiLetter(code) {\n return code >= 65 /* A */ && code <= 90 /* Z */;\n}\nfunction isAsciiLetter(code) {\n return isLowerAsciiLetter(code) || isUpperAsciiLetter(code);\n}\nexport function equalsIgnoreCase(a, b) {\n return a.length === b.length && doEqualsIgnoreCase(a, b);\n}\nfunction doEqualsIgnoreCase(a, b, stopAt = a.length) {\n for (let i = 0; i < stopAt; i++) {\n const codeA = a.charCodeAt(i);\n const codeB = b.charCodeAt(i);\n if (codeA === codeB) {\n continue;\n }\n // a-z A-Z\n if (isAsciiLetter(codeA) && isAsciiLetter(codeB)) {\n const diff = Math.abs(codeA - codeB);\n if (diff !== 0 && diff !== 32) {\n return false;\n }\n }\n // Any other charcode\n else {\n if (String.fromCharCode(codeA).toLowerCase() !== String.fromCharCode(codeB).toLowerCase()) {\n return false;\n }\n }\n }\n return true;\n}\nexport function startsWithIgnoreCase(str, candidate) {\n const candidateLength = candidate.length;\n if (candidate.length > str.length) {\n return false;\n }\n return doEqualsIgnoreCase(str, candidate, candidateLength);\n}\n/**\n * @returns the length of the common prefix of the two strings.\n */\nexport function commonPrefixLength(a, b) {\n let i, len = Math.min(a.length, b.length);\n for (i = 0; i < len; i++) {\n if (a.charCodeAt(i) !== b.charCodeAt(i)) {\n return i;\n }\n }\n return len;\n}\n/**\n * @returns the length of the common suffix of the two strings.\n */\nexport function commonSuffixLength(a, b) {\n let i, len = Math.min(a.length, b.length);\n const aLastIndex = a.length - 1;\n const bLastIndex = b.length - 1;\n for (i = 0; i < len; i++) {\n if (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) {\n return i;\n }\n }\n return len;\n}\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nexport function isHighSurrogate(charCode) {\n return (0xD800 <= charCode && charCode <= 0xDBFF);\n}\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nexport function isLowSurrogate(charCode) {\n return (0xDC00 <= charCode && charCode <= 0xDFFF);\n}\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nexport function computeCodePoint(highSurrogate, lowSurrogate) {\n return ((highSurrogate - 0xD800) << 10) + (lowSurrogate - 0xDC00) + 0x10000;\n}\n/**\n * get the code point that begins at offset `offset`\n */\nexport function getNextCodePoint(str, len, offset) {\n const charCode = str.charCodeAt(offset);\n if (isHighSurrogate(charCode) && offset + 1 < len) {\n const nextCharCode = str.charCodeAt(offset + 1);\n if (isLowSurrogate(nextCharCode)) {\n return computeCodePoint(charCode, nextCharCode);\n }\n }\n return charCode;\n}\n/**\n * get the code point that ends right before offset `offset`\n */\nfunction getPrevCodePoint(str, offset) {\n const charCode = str.charCodeAt(offset - 1);\n if (isLowSurrogate(charCode) && offset > 1) {\n const prevCharCode = str.charCodeAt(offset - 2);\n if (isHighSurrogate(prevCharCode)) {\n return computeCodePoint(prevCharCode, charCode);\n }\n }\n return charCode;\n}\nexport function nextCharLength(str, offset) {\n const graphemeBreakTree = GraphemeBreakTree.getInstance();\n const initialOffset = offset;\n const len = str.length;\n const initialCodePoint = getNextCodePoint(str, len, offset);\n offset += (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\n let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);\n while (offset < len) {\n const nextCodePoint = getNextCodePoint(str, len, offset);\n const nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(nextCodePoint);\n if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) {\n break;\n }\n offset += (nextCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\n graphemeBreakType = nextGraphemeBreakType;\n }\n return (offset - initialOffset);\n}\nexport function prevCharLength(str, offset) {\n const graphemeBreakTree = GraphemeBreakTree.getInstance();\n const initialOffset = offset;\n const initialCodePoint = getPrevCodePoint(str, offset);\n offset -= (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\n let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);\n while (offset > 0) {\n const prevCodePoint = getPrevCodePoint(str, offset);\n const prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(prevCodePoint);\n if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) {\n break;\n }\n offset -= (prevCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\n graphemeBreakType = prevGraphemeBreakType;\n }\n return (initialOffset - offset);\n}\n/**\n * A manual decoding of a UTF8 string.\n * Use only in environments which do not offer native conversion methods!\n */\nexport function decodeUTF8(buffer) {\n // https://en.wikipedia.org/wiki/UTF-8\n const len = buffer.byteLength;\n const result = [];\n let offset = 0;\n while (offset < len) {\n const v0 = buffer[offset];\n let codePoint;\n if (v0 >= 0b11110000 && offset + 3 < len) {\n // 4 bytes\n codePoint = ((((buffer[offset++] & 0b00000111) << 18) >>> 0)\n | (((buffer[offset++] & 0b00111111) << 12) >>> 0)\n | (((buffer[offset++] & 0b00111111) << 6) >>> 0)\n | (((buffer[offset++] & 0b00111111) << 0) >>> 0));\n }\n else if (v0 >= 0b11100000 && offset + 2 < len) {\n // 3 bytes\n codePoint = ((((buffer[offset++] & 0b00001111) << 12) >>> 0)\n | (((buffer[offset++] & 0b00111111) << 6) >>> 0)\n | (((buffer[offset++] & 0b00111111) << 0) >>> 0));\n }\n else if (v0 >= 0b11000000 && offset + 1 < len) {\n // 2 bytes\n codePoint = ((((buffer[offset++] & 0b00011111) << 6) >>> 0)\n | (((buffer[offset++] & 0b00111111) << 0) >>> 0));\n }\n else {\n // 1 byte\n codePoint = buffer[offset++];\n }\n if ((codePoint >= 0 && codePoint <= 0xD7FF) || (codePoint >= 0xE000 && codePoint <= 0xFFFF)) {\n // Basic Multilingual Plane\n result.push(String.fromCharCode(codePoint));\n }\n else if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n // Supplementary Planes\n const uPrime = codePoint - 0x10000;\n const w1 = 0xD800 + ((uPrime & 0b11111111110000000000) >>> 10);\n const w2 = 0xDC00 + ((uPrime & 0b00000000001111111111) >>> 0);\n result.push(String.fromCharCode(w1));\n result.push(String.fromCharCode(w2));\n }\n else {\n // illegal code point\n result.push(String.fromCharCode(0xFFFD));\n }\n }\n return result.join('');\n}\n/**\n * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-rtl-test.js\n */\nconst CONTAINS_RTL = /(?:[\\u05BE\\u05C0\\u05C3\\u05C6\\u05D0-\\u05F4\\u0608\\u060B\\u060D\\u061B-\\u064A\\u066D-\\u066F\\u0671-\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1-\\u07EA\\u07F4\\u07F5\\u07FA-\\u0815\\u081A\\u0824\\u0828\\u0830-\\u0858\\u085E-\\u08BD\\u200F\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFD3D\\uFD50-\\uFDFC\\uFE70-\\uFEFC]|\\uD802[\\uDC00-\\uDD1B\\uDD20-\\uDE00\\uDE10-\\uDE33\\uDE40-\\uDEE4\\uDEEB-\\uDF35\\uDF40-\\uDFFF]|\\uD803[\\uDC00-\\uDCFF]|\\uD83A[\\uDC00-\\uDCCF\\uDD00-\\uDD43\\uDD50-\\uDFFF]|\\uD83B[\\uDC00-\\uDEBB])/;\n/**\n * Returns true if `str` contains any Unicode character that is classified as \"R\" or \"AL\".\n */\nexport function containsRTL(str) {\n return CONTAINS_RTL.test(str);\n}\n/**\n * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js\n */\nconst CONTAINS_EMOJI = /(?:[\\u231A\\u231B\\u23F0\\u23F3\\u2600-\\u27BF\\u2B50\\u2B55]|\\uD83C[\\uDDE6-\\uDDFF\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDE4F\\uDE80-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD00-\\uDDFF\\uDE70-\\uDE73\\uDE78-\\uDE82\\uDE90-\\uDE95])/;\nexport function containsEmoji(str) {\n return CONTAINS_EMOJI.test(str);\n}\nconst IS_BASIC_ASCII = /^[\\t\\n\\r\\x20-\\x7E]*$/;\n/**\n * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \\n, \\r, \\t\n */\nexport function isBasicASCII(str) {\n return IS_BASIC_ASCII.test(str);\n}\nexport const UNUSUAL_LINE_TERMINATORS = /[\\u2028\\u2029]/; // LINE SEPARATOR (LS) or PARAGRAPH SEPARATOR (PS)\n/**\n * Returns true if `str` contains unusual line terminators, like LS or PS\n */\nexport function containsUnusualLineTerminators(str) {\n return UNUSUAL_LINE_TERMINATORS.test(str);\n}\nexport function containsFullWidthCharacter(str) {\n for (let i = 0, len = str.length; i < len; i++) {\n if (isFullWidthCharacter(str.charCodeAt(i))) {\n return true;\n }\n }\n return false;\n}\nexport function isFullWidthCharacter(charCode) {\n // Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns\n // http://jrgraphix.net/research/unicode_blocks.php\n // 2E80 — 2EFF CJK Radicals Supplement\n // 2F00 — 2FDF Kangxi Radicals\n // 2FF0 — 2FFF Ideographic Description Characters\n // 3000 — 303F CJK Symbols and Punctuation\n // 3040 — 309F Hiragana\n // 30A0 — 30FF Katakana\n // 3100 — 312F Bopomofo\n // 3130 — 318F Hangul Compatibility Jamo\n // 3190 — 319F Kanbun\n // 31A0 — 31BF Bopomofo Extended\n // 31F0 — 31FF Katakana Phonetic Extensions\n // 3200 — 32FF Enclosed CJK Letters and Months\n // 3300 — 33FF CJK Compatibility\n // 3400 — 4DBF CJK Unified Ideographs Extension A\n // 4DC0 — 4DFF Yijing Hexagram Symbols\n // 4E00 — 9FFF CJK Unified Ideographs\n // A000 — A48F Yi Syllables\n // A490 — A4CF Yi Radicals\n // AC00 — D7AF Hangul Syllables\n // [IGNORE] D800 — DB7F High Surrogates\n // [IGNORE] DB80 — DBFF High Private Use Surrogates\n // [IGNORE] DC00 — DFFF Low Surrogates\n // [IGNORE] E000 — F8FF Private Use Area\n // F900 — FAFF CJK Compatibility Ideographs\n // [IGNORE] FB00 — FB4F Alphabetic Presentation Forms\n // [IGNORE] FB50 — FDFF Arabic Presentation Forms-A\n // [IGNORE] FE00 — FE0F Variation Selectors\n // [IGNORE] FE20 — FE2F Combining Half Marks\n // [IGNORE] FE30 — FE4F CJK Compatibility Forms\n // [IGNORE] FE50 — FE6F Small Form Variants\n // [IGNORE] FE70 — FEFF Arabic Presentation Forms-B\n // FF00 — FFEF Halfwidth and Fullwidth Forms\n // [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms]\n // of which FF01 - FF5E fullwidth ASCII of 21 to 7E\n // [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul\n // [IGNORE] FFF0 — FFFF Specials\n charCode = +charCode; // @perf\n return ((charCode >= 0x2E80 && charCode <= 0xD7AF)\n || (charCode >= 0xF900 && charCode <= 0xFAFF)\n || (charCode >= 0xFF01 && charCode <= 0xFF5E));\n}\n/**\n * A fast function (therefore imprecise) to check if code points are emojis.\n * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js\n */\nexport function isEmojiImprecise(x) {\n return ((x >= 0x1F1E6 && x <= 0x1F1FF) || (x >= 9728 && x <= 10175) || (x >= 127744 && x <= 128591)\n || (x >= 128640 && x <= 128764) || (x >= 128992 && x <= 129003) || (x >= 129280 && x <= 129535)\n || (x >= 129648 && x <= 129651) || (x >= 129656 && x <= 129666) || (x >= 129680 && x <= 129685));\n}\n// -- UTF-8 BOM\nexport const UTF8_BOM_CHARACTER = String.fromCharCode(65279 /* UTF8_BOM */);\nexport function startsWithUTF8BOM(str) {\n return !!(str && str.length > 0 && str.charCodeAt(0) === 65279 /* UTF8_BOM */);\n}\nexport function containsUppercaseCharacter(target, ignoreEscapedChars = false) {\n if (!target) {\n return false;\n }\n if (ignoreEscapedChars) {\n target = target.replace(/\\\\./g, '');\n }\n return target.toLowerCase() !== target;\n}\n/**\n * Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc.\n */\nexport function singleLetterHash(n) {\n const LETTERS_CNT = (90 /* Z */ - 65 /* A */ + 1);\n n = n % (2 * LETTERS_CNT);\n if (n < LETTERS_CNT) {\n return String.fromCharCode(97 /* a */ + n);\n }\n return String.fromCharCode(65 /* A */ + n - LETTERS_CNT);\n}\n//#region Unicode Grapheme Break\nexport function getGraphemeBreakType(codePoint) {\n const graphemeBreakTree = GraphemeBreakTree.getInstance();\n return graphemeBreakTree.getGraphemeBreakType(codePoint);\n}\nexport function breakBetweenGraphemeBreakType(breakTypeA, breakTypeB) {\n // http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules\n // !!! Let's make the common case a bit faster\n if (breakTypeA === 0 /* Other */) {\n // see https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest-13.0.0d10.html#table\n return (breakTypeB !== 5 /* Extend */ && breakTypeB !== 7 /* SpacingMark */);\n }\n // Do not break between a CR and LF. Otherwise, break before and after controls.\n // GB3 CR × LF\n // GB4 (Control | CR | LF) ÷\n // GB5 ÷ (Control | CR | LF)\n if (breakTypeA === 2 /* CR */) {\n if (breakTypeB === 3 /* LF */) {\n return false; // GB3\n }\n }\n if (breakTypeA === 4 /* Control */ || breakTypeA === 2 /* CR */ || breakTypeA === 3 /* LF */) {\n return true; // GB4\n }\n if (breakTypeB === 4 /* Control */ || breakTypeB === 2 /* CR */ || breakTypeB === 3 /* LF */) {\n return true; // GB5\n }\n // Do not break Hangul syllable sequences.\n // GB6 L × (L | V | LV | LVT)\n // GB7 (LV | V) × (V | T)\n // GB8 (LVT | T) × T\n if (breakTypeA === 8 /* L */) {\n if (breakTypeB === 8 /* L */ || breakTypeB === 9 /* V */ || breakTypeB === 11 /* LV */ || breakTypeB === 12 /* LVT */) {\n return false; // GB6\n }\n }\n if (breakTypeA === 11 /* LV */ || breakTypeA === 9 /* V */) {\n if (breakTypeB === 9 /* V */ || breakTypeB === 10 /* T */) {\n return false; // GB7\n }\n }\n if (breakTypeA === 12 /* LVT */ || breakTypeA === 10 /* T */) {\n if (breakTypeB === 10 /* T */) {\n return false; // GB8\n }\n }\n // Do not break before extending characters or ZWJ.\n // GB9 × (Extend | ZWJ)\n if (breakTypeB === 5 /* Extend */ || breakTypeB === 13 /* ZWJ */) {\n return false; // GB9\n }\n // The GB9a and GB9b rules only apply to extended grapheme clusters:\n // Do not break before SpacingMarks, or after Prepend characters.\n // GB9a × SpacingMark\n // GB9b Prepend ×\n if (breakTypeB === 7 /* SpacingMark */) {\n return false; // GB9a\n }\n if (breakTypeA === 1 /* Prepend */) {\n return false; // GB9b\n }\n // Do not break within emoji modifier sequences or emoji zwj sequences.\n // GB11 \\p{Extended_Pictographic} Extend* ZWJ × \\p{Extended_Pictographic}\n if (breakTypeA === 13 /* ZWJ */ && breakTypeB === 14 /* Extended_Pictographic */) {\n // Note: we are not implementing the rule entirely here to avoid introducing states\n return false; // GB11\n }\n // GB12 sot (RI RI)* RI × RI\n // GB13 [^RI] (RI RI)* RI × RI\n if (breakTypeA === 6 /* Regional_Indicator */ && breakTypeB === 6 /* Regional_Indicator */) {\n // Note: we are not implementing the rule entirely here to avoid introducing states\n return false; // GB12 & GB13\n }\n // GB999 Any ÷ Any\n return true;\n}\nclass GraphemeBreakTree {\n constructor() {\n this._data = getGraphemeBreakRawData();\n }\n static getInstance() {\n if (!GraphemeBreakTree._INSTANCE) {\n GraphemeBreakTree._INSTANCE = new GraphemeBreakTree();\n }\n return GraphemeBreakTree._INSTANCE;\n }\n getGraphemeBreakType(codePoint) {\n // !!! Let's make 7bit ASCII a bit faster: 0..31\n if (codePoint < 32) {\n if (codePoint === 10 /* LineFeed */) {\n return 3 /* LF */;\n }\n if (codePoint === 13 /* CarriageReturn */) {\n return 2 /* CR */;\n }\n return 4 /* Control */;\n }\n // !!! Let's make 7bit ASCII a bit faster: 32..126\n if (codePoint < 127) {\n return 0 /* Other */;\n }\n const data = this._data;\n const nodeCount = data.length / 3;\n let nodeIndex = 1;\n while (nodeIndex <= nodeCount) {\n if (codePoint < data[3 * nodeIndex]) {\n // go left\n nodeIndex = 2 * nodeIndex;\n }\n else if (codePoint > data[3 * nodeIndex + 1]) {\n // go right\n nodeIndex = 2 * nodeIndex + 1;\n }\n else {\n // hit\n return data[3 * nodeIndex + 2];\n }\n }\n return 0 /* Other */;\n }\n}\nGraphemeBreakTree._INSTANCE = null;\nfunction getGraphemeBreakRawData() {\n // generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-grapheme-break.js\n return JSON.parse('[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]');\n}\n//#endregion\n","/**\n * @returns whether the provided parameter is a JavaScript Array or not.\n */\nexport function isArray(array) {\n return Array.isArray(array);\n}\n/**\n * @returns whether the provided parameter is a JavaScript String or not.\n */\nexport function isString(str) {\n return (typeof str === 'string');\n}\n/**\n *\n * @returns whether the provided parameter is of type `object` but **not**\n *\t`null`, an `array`, a `regexp`, nor a `date`.\n */\nexport function isObject(obj) {\n // The method can't do a type cast since there are type (like strings) which\n // are subclasses of any put not positvely matched by the function. Hence type\n // narrowing results in wrong results.\n return typeof obj === 'object'\n && obj !== null\n && !Array.isArray(obj)\n && !(obj instanceof RegExp)\n && !(obj instanceof Date);\n}\n/**\n * In **contrast** to just checking `typeof` this will return `false` for `NaN`.\n * @returns whether the provided parameter is a JavaScript Number or not.\n */\nexport function isNumber(obj) {\n return (typeof obj === 'number' && !isNaN(obj));\n}\n/**\n * @returns whether the provided parameter is a JavaScript Boolean or not.\n */\nexport function isBoolean(obj) {\n return (obj === true || obj === false);\n}\n/**\n * @returns whether the provided parameter is undefined.\n */\nexport function isUndefined(obj) {\n return (typeof obj === 'undefined');\n}\n/**\n * @returns whether the provided parameter is undefined or null.\n */\nexport function isUndefinedOrNull(obj) {\n return (isUndefined(obj) || obj === null);\n}\nexport function assertType(condition, type) {\n if (!condition) {\n throw new Error(type ? `Unexpected type, expected '${type}'` : 'Unexpected type');\n }\n}\n/**\n * Asserts that the argument passed in is neither undefined nor null.\n */\nexport function assertIsDefined(arg) {\n if (isUndefinedOrNull(arg)) {\n throw new Error('Assertion Failed: argument is undefined or null');\n }\n return arg;\n}\n/**\n * @returns whether the provided parameter is a JavaScript Function or not.\n */\nexport function isFunction(obj) {\n return (typeof obj === 'function');\n}\nexport function validateConstraints(args, constraints) {\n const len = Math.min(args.length, constraints.length);\n for (let i = 0; i < len; i++) {\n validateConstraint(args[i], constraints[i]);\n }\n}\nexport function validateConstraint(arg, constraint) {\n if (isString(constraint)) {\n if (typeof arg !== constraint) {\n throw new Error(`argument does not match constraint: typeof ${constraint}`);\n }\n }\n else if (isFunction(constraint)) {\n try {\n if (arg instanceof constraint) {\n return;\n }\n }\n catch (_a) {\n // ignore\n }\n if (!isUndefinedOrNull(arg) && arg.constructor === constraint) {\n return;\n }\n if (constraint.length === 1 && constraint.call(undefined, arg) === true) {\n return;\n }\n throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`);\n }\n}\nexport function getAllPropertyNames(obj) {\n let res = [];\n let proto = Object.getPrototypeOf(obj);\n while (Object.prototype !== proto) {\n res = res.concat(Object.getOwnPropertyNames(proto));\n proto = Object.getPrototypeOf(proto);\n }\n return res;\n}\nexport function getAllMethodNames(obj) {\n const methods = [];\n for (const prop of getAllPropertyNames(obj)) {\n if (typeof obj[prop] === 'function') {\n methods.push(prop);\n }\n }\n return methods;\n}\nexport function createProxyObject(methodNames, invoke) {\n const createProxyMethod = (method) => {\n return function () {\n const args = Array.prototype.slice.call(arguments, 0);\n return invoke(method, args);\n };\n };\n let result = {};\n for (const methodName of methodNames) {\n result[methodName] = createProxyMethod(methodName);\n }\n return result;\n}\n/**\n * Converts null to undefined, passes all other values through.\n */\nexport function withNullAsUndefined(x) {\n return x === null ? undefined : x;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport function toUint8(v) {\n if (v < 0) {\n return 0;\n }\n if (v > 255 /* MAX_UINT_8 */) {\n return 255 /* MAX_UINT_8 */;\n }\n return v | 0;\n}\nexport function toUint32(v) {\n if (v < 0) {\n return 0;\n }\n if (v > 4294967295 /* MAX_UINT_32 */) {\n return 4294967295 /* MAX_UINT_32 */;\n }\n return v | 0;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { isWindows } from './platform.js';\nimport * as paths from './path.js';\nconst _schemePattern = /^\\w[\\w\\d+.-]*$/;\nconst _singleSlashStart = /^\\//;\nconst _doubleSlashStart = /^\\/\\//;\nfunction _validateUri(ret, _strict) {\n // scheme, must be set\n if (!ret.scheme && _strict) {\n throw new Error(`[UriError]: Scheme is missing: {scheme: \"\", authority: \"${ret.authority}\", path: \"${ret.path}\", query: \"${ret.query}\", fragment: \"${ret.fragment}\"}`);\n }\n // scheme, https://tools.ietf.org/html/rfc3986#section-3.1\n // ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n if (ret.scheme && !_schemePattern.test(ret.scheme)) {\n throw new Error('[UriError]: Scheme contains illegal characters.');\n }\n // path, http://tools.ietf.org/html/rfc3986#section-3.3\n // If a URI contains an authority component, then the path component\n // must either be empty or begin with a slash (\"/\") character. If a URI\n // does not contain an authority component, then the path cannot begin\n // with two slash characters (\"//\").\n if (ret.path) {\n if (ret.authority) {\n if (!_singleSlashStart.test(ret.path)) {\n throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character');\n }\n }\n else {\n if (_doubleSlashStart.test(ret.path)) {\n throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")');\n }\n }\n }\n}\n// for a while we allowed uris *without* schemes and this is the migration\n// for them, e.g. an uri without scheme and without strict-mode warns and falls\n// back to the file-scheme. that should cause the least carnage and still be a\n// clear warning\nfunction _schemeFix(scheme, _strict) {\n if (!scheme && !_strict) {\n return 'file';\n }\n return scheme;\n}\n// implements a bit of https://tools.ietf.org/html/rfc3986#section-5\nfunction _referenceResolution(scheme, path) {\n // the slash-character is our 'default base' as we don't\n // support constructing URIs relative to other URIs. This\n // also means that we alter and potentially break paths.\n // see https://tools.ietf.org/html/rfc3986#section-5.1.4\n switch (scheme) {\n case 'https':\n case 'http':\n case 'file':\n if (!path) {\n path = _slash;\n }\n else if (path[0] !== _slash) {\n path = _slash + path;\n }\n break;\n }\n return path;\n}\nconst _empty = '';\nconst _slash = '/';\nconst _regexp = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\n/**\n * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.\n * This class is a simple parser which creates the basic component parts\n * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation\n * and encoding.\n *\n * ```txt\n * foo://example.com:8042/over/there?name=ferret#nose\n * \\_/ \\______________/\\_________/ \\_________/ \\__/\n * | | | | |\n * scheme authority path query fragment\n * | _____________________|__\n * / \\ / \\\n * urn:example:animal:ferret:nose\n * ```\n */\nexport class URI {\n /**\n * @internal\n */\n constructor(schemeOrData, authority, path, query, fragment, _strict = false) {\n if (typeof schemeOrData === 'object') {\n this.scheme = schemeOrData.scheme || _empty;\n this.authority = schemeOrData.authority || _empty;\n this.path = schemeOrData.path || _empty;\n this.query = schemeOrData.query || _empty;\n this.fragment = schemeOrData.fragment || _empty;\n // no validation because it's this URI\n // that creates uri components.\n // _validateUri(this);\n }\n else {\n this.scheme = _schemeFix(schemeOrData, _strict);\n this.authority = authority || _empty;\n this.path = _referenceResolution(this.scheme, path || _empty);\n this.query = query || _empty;\n this.fragment = fragment || _empty;\n _validateUri(this, _strict);\n }\n }\n static isUri(thing) {\n if (thing instanceof URI) {\n return true;\n }\n if (!thing) {\n return false;\n }\n return typeof thing.authority === 'string'\n && typeof thing.fragment === 'string'\n && typeof thing.path === 'string'\n && typeof thing.query === 'string'\n && typeof thing.scheme === 'string'\n && typeof thing.fsPath === 'function'\n && typeof thing.with === 'function'\n && typeof thing.toString === 'function';\n }\n // ---- filesystem path -----------------------\n /**\n * Returns a string representing the corresponding file system path of this URI.\n * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the\n * platform specific path separator.\n *\n * * Will *not* validate the path for invalid characters and semantics.\n * * Will *not* look at the scheme of this URI.\n * * The result shall *not* be used for display purposes but for accessing a file on disk.\n *\n *\n * The *difference* to `URI#path` is the use of the platform specific separator and the handling\n * of UNC paths. See the below sample of a file-uri with an authority (UNC path).\n *\n * ```ts\n const u = URI.parse('file://server/c$/folder/file.txt')\n u.authority === 'server'\n u.path === '/shares/c$/file.txt'\n u.fsPath === '\\\\server\\c$\\folder\\file.txt'\n ```\n *\n * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,\n * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working\n * with URIs that represent files on disk (`file` scheme).\n */\n get fsPath() {\n // if (this.scheme !== 'file') {\n // \tconsole.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);\n // }\n return uriToFsPath(this, false);\n }\n // ---- modify to new -------------------------\n with(change) {\n if (!change) {\n return this;\n }\n let { scheme, authority, path, query, fragment } = change;\n if (scheme === undefined) {\n scheme = this.scheme;\n }\n else if (scheme === null) {\n scheme = _empty;\n }\n if (authority === undefined) {\n authority = this.authority;\n }\n else if (authority === null) {\n authority = _empty;\n }\n if (path === undefined) {\n path = this.path;\n }\n else if (path === null) {\n path = _empty;\n }\n if (query === undefined) {\n query = this.query;\n }\n else if (query === null) {\n query = _empty;\n }\n if (fragment === undefined) {\n fragment = this.fragment;\n }\n else if (fragment === null) {\n fragment = _empty;\n }\n if (scheme === this.scheme\n && authority === this.authority\n && path === this.path\n && query === this.query\n && fragment === this.fragment) {\n return this;\n }\n return new Uri(scheme, authority, path, query, fragment);\n }\n // ---- parse & validate ------------------------\n /**\n * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`,\n * `file:///usr/home`, or `scheme:with/path`.\n *\n * @param value A string which represents an URI (see `URI#toString`).\n */\n static parse(value, _strict = false) {\n const match = _regexp.exec(value);\n if (!match) {\n return new Uri(_empty, _empty, _empty, _empty, _empty);\n }\n return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);\n }\n /**\n * Creates a new URI from a file system path, e.g. `c:\\my\\files`,\n * `/usr/home`, or `\\\\server\\share\\some\\path`.\n *\n * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument\n * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**\n * `URI.parse('file://' + path)` because the path might contain characters that are\n * interpreted (# and ?). See the following sample:\n * ```ts\n const good = URI.file('/coding/c#/project1');\n good.scheme === 'file';\n good.path === '/coding/c#/project1';\n good.fragment === '';\n const bad = URI.parse('file://' + '/coding/c#/project1');\n bad.scheme === 'file';\n bad.path === '/coding/c'; // path is now broken\n bad.fragment === '/project1';\n ```\n *\n * @param path A file system path (see `URI#fsPath`)\n */\n static file(path) {\n let authority = _empty;\n // normalize to fwd-slashes on windows,\n // on other systems bwd-slashes are valid\n // filename character, eg /f\\oo/ba\\r.txt\n if (isWindows) {\n path = path.replace(/\\\\/g, _slash);\n }\n // check for authority as used in UNC shares\n // or use the path as given\n if (path[0] === _slash && path[1] === _slash) {\n const idx = path.indexOf(_slash, 2);\n if (idx === -1) {\n authority = path.substring(2);\n path = _slash;\n }\n else {\n authority = path.substring(2, idx);\n path = path.substring(idx) || _slash;\n }\n }\n return new Uri('file', authority, path, _empty, _empty);\n }\n static from(components) {\n return new Uri(components.scheme, components.authority, components.path, components.query, components.fragment);\n }\n /**\n * Join a URI path with path fragments and normalizes the resulting path.\n *\n * @param uri The input URI.\n * @param pathFragment The path fragment to add to the URI path.\n * @returns The resulting URI.\n */\n static joinPath(uri, ...pathFragment) {\n if (!uri.path) {\n throw new Error(`[UriError]: cannot call joinPaths on URI without path`);\n }\n let newPath;\n if (isWindows && uri.scheme === 'file') {\n newPath = URI.file(paths.win32.join(uriToFsPath(uri, true), ...pathFragment)).path;\n }\n else {\n newPath = paths.posix.join(uri.path, ...pathFragment);\n }\n return uri.with({ path: newPath });\n }\n // ---- printing/externalize ---------------------------\n /**\n * Creates a string representation for this URI. It's guaranteed that calling\n * `URI.parse` with the result of this function creates an URI which is equal\n * to this URI.\n *\n * * The result shall *not* be used for display purposes but for externalization or transport.\n * * The result will be encoded using the percentage encoding and encoding happens mostly\n * ignore the scheme-specific encoding rules.\n *\n * @param skipEncoding Do not encode the result, default is `false`\n */\n toString(skipEncoding = false) {\n return _asFormatted(this, skipEncoding);\n }\n toJSON() {\n return this;\n }\n static revive(data) {\n if (!data) {\n return data;\n }\n else if (data instanceof URI) {\n return data;\n }\n else {\n const result = new Uri(data);\n result._formatted = data.external;\n result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null;\n return result;\n }\n }\n}\nconst _pathSepMarker = isWindows ? 1 : undefined;\n// This class exists so that URI is compatibile with vscode.Uri (API).\nclass Uri extends URI {\n constructor() {\n super(...arguments);\n this._formatted = null;\n this._fsPath = null;\n }\n get fsPath() {\n if (!this._fsPath) {\n this._fsPath = uriToFsPath(this, false);\n }\n return this._fsPath;\n }\n toString(skipEncoding = false) {\n if (!skipEncoding) {\n if (!this._formatted) {\n this._formatted = _asFormatted(this, false);\n }\n return this._formatted;\n }\n else {\n // we don't cache that\n return _asFormatted(this, true);\n }\n }\n toJSON() {\n const res = {\n $mid: 1\n };\n // cached state\n if (this._fsPath) {\n res.fsPath = this._fsPath;\n res._sep = _pathSepMarker;\n }\n if (this._formatted) {\n res.external = this._formatted;\n }\n // uri components\n if (this.path) {\n res.path = this.path;\n }\n if (this.scheme) {\n res.scheme = this.scheme;\n }\n if (this.authority) {\n res.authority = this.authority;\n }\n if (this.query) {\n res.query = this.query;\n }\n if (this.fragment) {\n res.fragment = this.fragment;\n }\n return res;\n }\n}\n// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2\nconst encodeTable = {\n [58 /* Colon */]: '%3A',\n [47 /* Slash */]: '%2F',\n [63 /* QuestionMark */]: '%3F',\n [35 /* Hash */]: '%23',\n [91 /* OpenSquareBracket */]: '%5B',\n [93 /* CloseSquareBracket */]: '%5D',\n [64 /* AtSign */]: '%40',\n [33 /* ExclamationMark */]: '%21',\n [36 /* DollarSign */]: '%24',\n [38 /* Ampersand */]: '%26',\n [39 /* SingleQuote */]: '%27',\n [40 /* OpenParen */]: '%28',\n [41 /* CloseParen */]: '%29',\n [42 /* Asterisk */]: '%2A',\n [43 /* Plus */]: '%2B',\n [44 /* Comma */]: '%2C',\n [59 /* Semicolon */]: '%3B',\n [61 /* Equals */]: '%3D',\n [32 /* Space */]: '%20',\n};\nfunction encodeURIComponentFast(uriComponent, allowSlash) {\n let res = undefined;\n let nativeEncodePos = -1;\n for (let pos = 0; pos < uriComponent.length; pos++) {\n const code = uriComponent.charCodeAt(pos);\n // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3\n if ((code >= 97 /* a */ && code <= 122 /* z */)\n || (code >= 65 /* A */ && code <= 90 /* Z */)\n || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */)\n || code === 45 /* Dash */\n || code === 46 /* Period */\n || code === 95 /* Underline */\n || code === 126 /* Tilde */\n || (allowSlash && code === 47 /* Slash */)) {\n // check if we are delaying native encode\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n nativeEncodePos = -1;\n }\n // check if we write into a new string (by default we try to return the param)\n if (res !== undefined) {\n res += uriComponent.charAt(pos);\n }\n }\n else {\n // encoding needed, we need to allocate a new string\n if (res === undefined) {\n res = uriComponent.substr(0, pos);\n }\n // check with default table first\n const escaped = encodeTable[code];\n if (escaped !== undefined) {\n // check if we are delaying native encode\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n nativeEncodePos = -1;\n }\n // append escaped variant to result\n res += escaped;\n }\n else if (nativeEncodePos === -1) {\n // use native encode only when needed\n nativeEncodePos = pos;\n }\n }\n }\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos));\n }\n return res !== undefined ? res : uriComponent;\n}\nfunction encodeURIComponentMinimal(path) {\n let res = undefined;\n for (let pos = 0; pos < path.length; pos++) {\n const code = path.charCodeAt(pos);\n if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) {\n if (res === undefined) {\n res = path.substr(0, pos);\n }\n res += encodeTable[code];\n }\n else {\n if (res !== undefined) {\n res += path[pos];\n }\n }\n }\n return res !== undefined ? res : path;\n}\n/**\n * Compute `fsPath` for the given uri\n */\nexport function uriToFsPath(uri, keepDriveLetterCasing) {\n let value;\n if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\n // unc path: file://shares/c$/far/boo\n value = `//${uri.authority}${uri.path}`;\n }\n else if (uri.path.charCodeAt(0) === 47 /* Slash */\n && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)\n && uri.path.charCodeAt(2) === 58 /* Colon */) {\n if (!keepDriveLetterCasing) {\n // windows drive letter: file:///c:/far/boo\n value = uri.path[1].toLowerCase() + uri.path.substr(2);\n }\n else {\n value = uri.path.substr(1);\n }\n }\n else {\n // other path\n value = uri.path;\n }\n if (isWindows) {\n value = value.replace(/\\//g, '\\\\');\n }\n return value;\n}\n/**\n * Create the external version of a uri\n */\nfunction _asFormatted(uri, skipEncoding) {\n const encoder = !skipEncoding\n ? encodeURIComponentFast\n : encodeURIComponentMinimal;\n let res = '';\n let { scheme, authority, path, query, fragment } = uri;\n if (scheme) {\n res += scheme;\n res += ':';\n }\n if (authority || scheme === 'file') {\n res += _slash;\n res += _slash;\n }\n if (authority) {\n let idx = authority.indexOf('@');\n if (idx !== -1) {\n // @\n const userinfo = authority.substr(0, idx);\n authority = authority.substr(idx + 1);\n idx = userinfo.indexOf(':');\n if (idx === -1) {\n res += encoder(userinfo, false);\n }\n else {\n // :@\n res += encoder(userinfo.substr(0, idx), false);\n res += ':';\n res += encoder(userinfo.substr(idx + 1), false);\n }\n res += '@';\n }\n authority = authority.toLowerCase();\n idx = authority.indexOf(':');\n if (idx === -1) {\n res += encoder(authority, false);\n }\n else {\n // :\n res += encoder(authority.substr(0, idx), false);\n res += authority.substr(idx);\n }\n }\n if (path) {\n // lower-case windows drive letters in /C:/fff or C:/fff\n if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) {\n const code = path.charCodeAt(1);\n if (code >= 65 /* A */ && code <= 90 /* Z */) {\n path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; // \"/c:\".length === 3\n }\n }\n else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) {\n const code = path.charCodeAt(0);\n if (code >= 65 /* A */ && code <= 90 /* Z */) {\n path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; // \"/c:\".length === 3\n }\n }\n // encode the rest of the path\n res += encoder(path, true);\n }\n if (query) {\n res += '?';\n res += encoder(query, false);\n }\n if (fragment) {\n res += '#';\n res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;\n }\n return res;\n}\n// --- decode\nfunction decodeURIComponentGraceful(str) {\n try {\n return decodeURIComponent(str);\n }\n catch (_a) {\n if (str.length > 3) {\n return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));\n }\n else {\n return str;\n }\n }\n}\nconst _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;\nfunction percentDecode(str) {\n if (!str.match(_rEncodedAsHex)) {\n return str;\n }\n return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match));\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { transformErrorForSerialization } from '../errors.js';\nimport { Disposable } from '../lifecycle.js';\nimport { isWeb } from '../platform.js';\nimport * as types from '../types.js';\nconst INITIALIZE = '$initialize';\nlet webWorkerWarningLogged = false;\nexport function logOnceWebWorkerWarning(err) {\n if (!isWeb) {\n // running tests\n return;\n }\n if (!webWorkerWarningLogged) {\n webWorkerWarningLogged = true;\n console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq');\n }\n console.warn(err.message);\n}\nclass SimpleWorkerProtocol {\n constructor(handler) {\n this._workerId = -1;\n this._handler = handler;\n this._lastSentReq = 0;\n this._pendingReplies = Object.create(null);\n }\n setWorkerId(workerId) {\n this._workerId = workerId;\n }\n sendMessage(method, args) {\n let req = String(++this._lastSentReq);\n return new Promise((resolve, reject) => {\n this._pendingReplies[req] = {\n resolve: resolve,\n reject: reject\n };\n this._send({\n vsWorker: this._workerId,\n req: req,\n method: method,\n args: args\n });\n });\n }\n handleMessage(message) {\n if (!message || !message.vsWorker) {\n return;\n }\n if (this._workerId !== -1 && message.vsWorker !== this._workerId) {\n return;\n }\n this._handleMessage(message);\n }\n _handleMessage(msg) {\n if (msg.seq) {\n let replyMessage = msg;\n if (!this._pendingReplies[replyMessage.seq]) {\n console.warn('Got reply to unknown seq');\n return;\n }\n let reply = this._pendingReplies[replyMessage.seq];\n delete this._pendingReplies[replyMessage.seq];\n if (replyMessage.err) {\n let err = replyMessage.err;\n if (replyMessage.err.$isError) {\n err = new Error();\n err.name = replyMessage.err.name;\n err.message = replyMessage.err.message;\n err.stack = replyMessage.err.stack;\n }\n reply.reject(err);\n return;\n }\n reply.resolve(replyMessage.res);\n return;\n }\n let requestMessage = msg;\n let req = requestMessage.req;\n let result = this._handler.handleMessage(requestMessage.method, requestMessage.args);\n result.then((r) => {\n this._send({\n vsWorker: this._workerId,\n seq: req,\n res: r,\n err: undefined\n });\n }, (e) => {\n if (e.detail instanceof Error) {\n // Loading errors have a detail property that points to the actual error\n e.detail = transformErrorForSerialization(e.detail);\n }\n this._send({\n vsWorker: this._workerId,\n seq: req,\n res: undefined,\n err: transformErrorForSerialization(e)\n });\n });\n }\n _send(msg) {\n let transfer = [];\n if (msg.req) {\n const m = msg;\n for (let i = 0; i < m.args.length; i++) {\n if (m.args[i] instanceof ArrayBuffer) {\n transfer.push(m.args[i]);\n }\n }\n }\n else {\n const m = msg;\n if (m.res instanceof ArrayBuffer) {\n transfer.push(m.res);\n }\n }\n this._handler.sendMessage(msg, transfer);\n }\n}\n/**\n * Main thread side\n */\nexport class SimpleWorkerClient extends Disposable {\n constructor(workerFactory, moduleId, host) {\n super();\n let lazyProxyReject = null;\n this._worker = this._register(workerFactory.create('vs/base/common/worker/simpleWorker', (msg) => {\n this._protocol.handleMessage(msg);\n }, (err) => {\n // in Firefox, web workers fail lazily :(\n // we will reject the proxy\n if (lazyProxyReject) {\n lazyProxyReject(err);\n }\n }));\n this._protocol = new SimpleWorkerProtocol({\n sendMessage: (msg, transfer) => {\n this._worker.postMessage(msg, transfer);\n },\n handleMessage: (method, args) => {\n if (typeof host[method] !== 'function') {\n return Promise.reject(new Error('Missing method ' + method + ' on main thread host.'));\n }\n try {\n return Promise.resolve(host[method].apply(host, args));\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n });\n this._protocol.setWorkerId(this._worker.getId());\n // Gather loader configuration\n let loaderConfiguration = null;\n if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') {\n // Get the configuration from the Monaco AMD Loader\n loaderConfiguration = self.require.getConfig();\n }\n else if (typeof self.requirejs !== 'undefined') {\n // Get the configuration from requirejs\n loaderConfiguration = self.requirejs.s.contexts._.config;\n }\n const hostMethods = types.getAllMethodNames(host);\n // Send initialize message\n this._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [\n this._worker.getId(),\n JSON.parse(JSON.stringify(loaderConfiguration)),\n moduleId,\n hostMethods,\n ]);\n // Create proxy to loaded code\n const proxyMethodRequest = (method, args) => {\n return this._request(method, args);\n };\n this._lazyProxy = new Promise((resolve, reject) => {\n lazyProxyReject = reject;\n this._onModuleLoaded.then((availableMethods) => {\n resolve(types.createProxyObject(availableMethods, proxyMethodRequest));\n }, (e) => {\n reject(e);\n this._onError('Worker failed to load ' + moduleId, e);\n });\n });\n }\n getProxyObject() {\n return this._lazyProxy;\n }\n _request(method, args) {\n return new Promise((resolve, reject) => {\n this._onModuleLoaded.then(() => {\n this._protocol.sendMessage(method, args).then(resolve, reject);\n }, reject);\n });\n }\n _onError(message, error) {\n console.error(message);\n console.info(error);\n }\n}\n/**\n * Worker side\n */\nexport class SimpleWorkerServer {\n constructor(postMessage, requestHandlerFactory) {\n this._requestHandlerFactory = requestHandlerFactory;\n this._requestHandler = null;\n this._protocol = new SimpleWorkerProtocol({\n sendMessage: (msg, transfer) => {\n postMessage(msg, transfer);\n },\n handleMessage: (method, args) => this._handleMessage(method, args)\n });\n }\n onmessage(msg) {\n this._protocol.handleMessage(msg);\n }\n _handleMessage(method, args) {\n if (method === INITIALIZE) {\n return this.initialize(args[0], args[1], args[2], args[3]);\n }\n if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') {\n return Promise.reject(new Error('Missing requestHandler or method: ' + method));\n }\n try {\n return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args));\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n initialize(workerId, loaderConfig, moduleId, hostMethods) {\n this._protocol.setWorkerId(workerId);\n const proxyMethodRequest = (method, args) => {\n return this._protocol.sendMessage(method, args);\n };\n const hostProxy = types.createProxyObject(hostMethods, proxyMethodRequest);\n if (this._requestHandlerFactory) {\n // static request handler\n this._requestHandler = this._requestHandlerFactory(hostProxy);\n return Promise.resolve(types.getAllMethodNames(this._requestHandler));\n }\n if (loaderConfig) {\n // Remove 'baseUrl', handling it is beyond scope for now\n if (typeof loaderConfig.baseUrl !== 'undefined') {\n delete loaderConfig['baseUrl'];\n }\n if (typeof loaderConfig.paths !== 'undefined') {\n if (typeof loaderConfig.paths.vs !== 'undefined') {\n delete loaderConfig.paths['vs'];\n }\n }\n // Since this is in a web worker, enable catching errors\n loaderConfig.catchError = true;\n self.require.config(loaderConfig);\n }\n return new Promise((resolve, reject) => {\n // Use the global require to be sure to get the global config\n self.require([moduleId], (module) => {\n this._requestHandler = module.create(hostProxy);\n if (!this._requestHandler) {\n reject(new Error(`No RequestHandler!`));\n return;\n }\n resolve(types.getAllMethodNames(this._requestHandler));\n }, reject);\n });\n }\n}\n/**\n * Called on the worker side\n */\nexport function create(postMessage) {\n return new SimpleWorkerServer(postMessage, null);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { toUint8 } from '../../../base/common/uint.js';\n/**\n * A fast character classifier that uses a compact array for ASCII values.\n */\nexport class CharacterClassifier {\n constructor(_defaultValue) {\n let defaultValue = toUint8(_defaultValue);\n this._defaultValue = defaultValue;\n this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue);\n this._map = new Map();\n }\n static _createAsciiMap(defaultValue) {\n let asciiMap = new Uint8Array(256);\n for (let i = 0; i < 256; i++) {\n asciiMap[i] = defaultValue;\n }\n return asciiMap;\n }\n set(charCode, _value) {\n let value = toUint8(_value);\n if (charCode >= 0 && charCode < 256) {\n this._asciiMap[charCode] = value;\n }\n else {\n this._map.set(charCode, value);\n }\n }\n get(charCode) {\n if (charCode >= 0 && charCode < 256) {\n return this._asciiMap[charCode];\n }\n else {\n return (this._map.get(charCode) || this._defaultValue);\n }\n }\n}\nexport class CharacterSet {\n constructor() {\n this._actual = new CharacterClassifier(0 /* False */);\n }\n add(charCode) {\n this._actual.set(charCode, 1 /* True */);\n }\n has(charCode) {\n return (this._actual.get(charCode) === 1 /* True */);\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * A position in the editor.\n */\nexport class Position {\n constructor(lineNumber, column) {\n this.lineNumber = lineNumber;\n this.column = column;\n }\n /**\n * Create a new position from this position.\n *\n * @param newLineNumber new line number\n * @param newColumn new column\n */\n with(newLineNumber = this.lineNumber, newColumn = this.column) {\n if (newLineNumber === this.lineNumber && newColumn === this.column) {\n return this;\n }\n else {\n return new Position(newLineNumber, newColumn);\n }\n }\n /**\n * Derive a new position from this position.\n *\n * @param deltaLineNumber line number delta\n * @param deltaColumn column delta\n */\n delta(deltaLineNumber = 0, deltaColumn = 0) {\n return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn);\n }\n /**\n * Test if this position equals other position\n */\n equals(other) {\n return Position.equals(this, other);\n }\n /**\n * Test if position `a` equals position `b`\n */\n static equals(a, b) {\n if (!a && !b) {\n return true;\n }\n return (!!a &&\n !!b &&\n a.lineNumber === b.lineNumber &&\n a.column === b.column);\n }\n /**\n * Test if this position is before other position.\n * If the two positions are equal, the result will be false.\n */\n isBefore(other) {\n return Position.isBefore(this, other);\n }\n /**\n * Test if position `a` is before position `b`.\n * If the two positions are equal, the result will be false.\n */\n static isBefore(a, b) {\n if (a.lineNumber < b.lineNumber) {\n return true;\n }\n if (b.lineNumber < a.lineNumber) {\n return false;\n }\n return a.column < b.column;\n }\n /**\n * Test if this position is before other position.\n * If the two positions are equal, the result will be true.\n */\n isBeforeOrEqual(other) {\n return Position.isBeforeOrEqual(this, other);\n }\n /**\n * Test if position `a` is before position `b`.\n * If the two positions are equal, the result will be true.\n */\n static isBeforeOrEqual(a, b) {\n if (a.lineNumber < b.lineNumber) {\n return true;\n }\n if (b.lineNumber < a.lineNumber) {\n return false;\n }\n return a.column <= b.column;\n }\n /**\n * A function that compares positions, useful for sorting\n */\n static compare(a, b) {\n let aLineNumber = a.lineNumber | 0;\n let bLineNumber = b.lineNumber | 0;\n if (aLineNumber === bLineNumber) {\n let aColumn = a.column | 0;\n let bColumn = b.column | 0;\n return aColumn - bColumn;\n }\n return aLineNumber - bLineNumber;\n }\n /**\n * Clone this position.\n */\n clone() {\n return new Position(this.lineNumber, this.column);\n }\n /**\n * Convert to a human-readable representation.\n */\n toString() {\n return '(' + this.lineNumber + ',' + this.column + ')';\n }\n // ---\n /**\n * Create a `Position` from an `IPosition`.\n */\n static lift(pos) {\n return new Position(pos.lineNumber, pos.column);\n }\n /**\n * Test if `obj` is an `IPosition`.\n */\n static isIPosition(obj) {\n return (obj\n && (typeof obj.lineNumber === 'number')\n && (typeof obj.column === 'number'));\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Position } from './position.js';\n/**\n * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)\n */\nexport class Range {\n constructor(startLineNumber, startColumn, endLineNumber, endColumn) {\n if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) {\n this.startLineNumber = endLineNumber;\n this.startColumn = endColumn;\n this.endLineNumber = startLineNumber;\n this.endColumn = startColumn;\n }\n else {\n this.startLineNumber = startLineNumber;\n this.startColumn = startColumn;\n this.endLineNumber = endLineNumber;\n this.endColumn = endColumn;\n }\n }\n /**\n * Test if this range is empty.\n */\n isEmpty() {\n return Range.isEmpty(this);\n }\n /**\n * Test if `range` is empty.\n */\n static isEmpty(range) {\n return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn);\n }\n /**\n * Test if position is in this range. If the position is at the edges, will return true.\n */\n containsPosition(position) {\n return Range.containsPosition(this, position);\n }\n /**\n * Test if `position` is in `range`. If the position is at the edges, will return true.\n */\n static containsPosition(range, position) {\n if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {\n return false;\n }\n if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) {\n return false;\n }\n if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) {\n return false;\n }\n return true;\n }\n /**\n * Test if range is in this range. If the range is equal to this range, will return true.\n */\n containsRange(range) {\n return Range.containsRange(this, range);\n }\n /**\n * Test if `otherRange` is in `range`. If the ranges are equal, will return true.\n */\n static containsRange(range, otherRange) {\n if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\n return false;\n }\n if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\n return false;\n }\n if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) {\n return false;\n }\n if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) {\n return false;\n }\n return true;\n }\n /**\n * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.\n */\n strictContainsRange(range) {\n return Range.strictContainsRange(this, range);\n }\n /**\n * Test if `otherRange` is strinctly in `range` (must start after, and end before). If the ranges are equal, will return false.\n */\n static strictContainsRange(range, otherRange) {\n if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\n return false;\n }\n if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\n return false;\n }\n if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) {\n return false;\n }\n if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) {\n return false;\n }\n return true;\n }\n /**\n * A reunion of the two ranges.\n * The smallest position will be used as the start point, and the largest one as the end point.\n */\n plusRange(range) {\n return Range.plusRange(this, range);\n }\n /**\n * A reunion of the two ranges.\n * The smallest position will be used as the start point, and the largest one as the end point.\n */\n static plusRange(a, b) {\n let startLineNumber;\n let startColumn;\n let endLineNumber;\n let endColumn;\n if (b.startLineNumber < a.startLineNumber) {\n startLineNumber = b.startLineNumber;\n startColumn = b.startColumn;\n }\n else if (b.startLineNumber === a.startLineNumber) {\n startLineNumber = b.startLineNumber;\n startColumn = Math.min(b.startColumn, a.startColumn);\n }\n else {\n startLineNumber = a.startLineNumber;\n startColumn = a.startColumn;\n }\n if (b.endLineNumber > a.endLineNumber) {\n endLineNumber = b.endLineNumber;\n endColumn = b.endColumn;\n }\n else if (b.endLineNumber === a.endLineNumber) {\n endLineNumber = b.endLineNumber;\n endColumn = Math.max(b.endColumn, a.endColumn);\n }\n else {\n endLineNumber = a.endLineNumber;\n endColumn = a.endColumn;\n }\n return new Range(startLineNumber, startColumn, endLineNumber, endColumn);\n }\n /**\n * A intersection of the two ranges.\n */\n intersectRanges(range) {\n return Range.intersectRanges(this, range);\n }\n /**\n * A intersection of the two ranges.\n */\n static intersectRanges(a, b) {\n let resultStartLineNumber = a.startLineNumber;\n let resultStartColumn = a.startColumn;\n let resultEndLineNumber = a.endLineNumber;\n let resultEndColumn = a.endColumn;\n let otherStartLineNumber = b.startLineNumber;\n let otherStartColumn = b.startColumn;\n let otherEndLineNumber = b.endLineNumber;\n let otherEndColumn = b.endColumn;\n if (resultStartLineNumber < otherStartLineNumber) {\n resultStartLineNumber = otherStartLineNumber;\n resultStartColumn = otherStartColumn;\n }\n else if (resultStartLineNumber === otherStartLineNumber) {\n resultStartColumn = Math.max(resultStartColumn, otherStartColumn);\n }\n if (resultEndLineNumber > otherEndLineNumber) {\n resultEndLineNumber = otherEndLineNumber;\n resultEndColumn = otherEndColumn;\n }\n else if (resultEndLineNumber === otherEndLineNumber) {\n resultEndColumn = Math.min(resultEndColumn, otherEndColumn);\n }\n // Check if selection is now empty\n if (resultStartLineNumber > resultEndLineNumber) {\n return null;\n }\n if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) {\n return null;\n }\n return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn);\n }\n /**\n * Test if this range equals other.\n */\n equalsRange(other) {\n return Range.equalsRange(this, other);\n }\n /**\n * Test if range `a` equals `b`.\n */\n static equalsRange(a, b) {\n return (!!a &&\n !!b &&\n a.startLineNumber === b.startLineNumber &&\n a.startColumn === b.startColumn &&\n a.endLineNumber === b.endLineNumber &&\n a.endColumn === b.endColumn);\n }\n /**\n * Return the end position (which will be after or equal to the start position)\n */\n getEndPosition() {\n return Range.getEndPosition(this);\n }\n /**\n * Return the end position (which will be after or equal to the start position)\n */\n static getEndPosition(range) {\n return new Position(range.endLineNumber, range.endColumn);\n }\n /**\n * Return the start position (which will be before or equal to the end position)\n */\n getStartPosition() {\n return Range.getStartPosition(this);\n }\n /**\n * Return the start position (which will be before or equal to the end position)\n */\n static getStartPosition(range) {\n return new Position(range.startLineNumber, range.startColumn);\n }\n /**\n * Transform to a user presentable string representation.\n */\n toString() {\n return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']';\n }\n /**\n * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.\n */\n setEndPosition(endLineNumber, endColumn) {\n return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\n }\n /**\n * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.\n */\n setStartPosition(startLineNumber, startColumn) {\n return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\n }\n /**\n * Create a new empty range using this range's start position.\n */\n collapseToStart() {\n return Range.collapseToStart(this);\n }\n /**\n * Create a new empty range using this range's start position.\n */\n static collapseToStart(range) {\n return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);\n }\n // ---\n static fromPositions(start, end = start) {\n return new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n }\n static lift(range) {\n if (!range) {\n return null;\n }\n return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\n }\n /**\n * Test if `obj` is an `IRange`.\n */\n static isIRange(obj) {\n return (obj\n && (typeof obj.startLineNumber === 'number')\n && (typeof obj.startColumn === 'number')\n && (typeof obj.endLineNumber === 'number')\n && (typeof obj.endColumn === 'number'));\n }\n /**\n * Test if the two ranges are touching in any way.\n */\n static areIntersectingOrTouching(a, b) {\n // Check if `a` is before `b`\n if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) {\n return false;\n }\n // Check if `b` is before `a`\n if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) {\n return false;\n }\n // These ranges must intersect\n return true;\n }\n /**\n * Test if the two ranges are intersecting. If the ranges are touching it returns true.\n */\n static areIntersecting(a, b) {\n // Check if `a` is before `b`\n if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) {\n return false;\n }\n // Check if `b` is before `a`\n if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) {\n return false;\n }\n // These ranges must intersect\n return true;\n }\n /**\n * A function that compares ranges, useful for sorting ranges\n * It will first compare ranges on the startPosition and then on the endPosition\n */\n static compareRangesUsingStarts(a, b) {\n if (a && b) {\n const aStartLineNumber = a.startLineNumber | 0;\n const bStartLineNumber = b.startLineNumber | 0;\n if (aStartLineNumber === bStartLineNumber) {\n const aStartColumn = a.startColumn | 0;\n const bStartColumn = b.startColumn | 0;\n if (aStartColumn === bStartColumn) {\n const aEndLineNumber = a.endLineNumber | 0;\n const bEndLineNumber = b.endLineNumber | 0;\n if (aEndLineNumber === bEndLineNumber) {\n const aEndColumn = a.endColumn | 0;\n const bEndColumn = b.endColumn | 0;\n return aEndColumn - bEndColumn;\n }\n return aEndLineNumber - bEndLineNumber;\n }\n return aStartColumn - bStartColumn;\n }\n return aStartLineNumber - bStartLineNumber;\n }\n const aExists = (a ? 1 : 0);\n const bExists = (b ? 1 : 0);\n return aExists - bExists;\n }\n /**\n * A function that compares ranges, useful for sorting ranges\n * It will first compare ranges on the endPosition and then on the startPosition\n */\n static compareRangesUsingEnds(a, b) {\n if (a.endLineNumber === b.endLineNumber) {\n if (a.endColumn === b.endColumn) {\n if (a.startLineNumber === b.startLineNumber) {\n return a.startColumn - b.startColumn;\n }\n return a.startLineNumber - b.startLineNumber;\n }\n return a.endColumn - b.endColumn;\n }\n return a.endLineNumber - b.endLineNumber;\n }\n /**\n * Test if the range spans multiple lines.\n */\n static spansMultipleLines(range) {\n return range.endLineNumber > range.startLineNumber;\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Position } from './position.js';\nimport { Range } from './range.js';\n/**\n * A selection in the editor.\n * The selection is a range that has an orientation.\n */\nexport class Selection extends Range {\n constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) {\n super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn);\n this.selectionStartLineNumber = selectionStartLineNumber;\n this.selectionStartColumn = selectionStartColumn;\n this.positionLineNumber = positionLineNumber;\n this.positionColumn = positionColumn;\n }\n /**\n * Transform to a human-readable representation.\n */\n toString() {\n return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']';\n }\n /**\n * Test if equals other selection.\n */\n equalsSelection(other) {\n return (Selection.selectionsEqual(this, other));\n }\n /**\n * Test if the two selections are equal.\n */\n static selectionsEqual(a, b) {\n return (a.selectionStartLineNumber === b.selectionStartLineNumber &&\n a.selectionStartColumn === b.selectionStartColumn &&\n a.positionLineNumber === b.positionLineNumber &&\n a.positionColumn === b.positionColumn);\n }\n /**\n * Get directions (LTR or RTL).\n */\n getDirection() {\n if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) {\n return 0 /* LTR */;\n }\n return 1 /* RTL */;\n }\n /**\n * Create a new selection with a different `positionLineNumber` and `positionColumn`.\n */\n setEndPosition(endLineNumber, endColumn) {\n if (this.getDirection() === 0 /* LTR */) {\n return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\n }\n return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn);\n }\n /**\n * Get the position at `positionLineNumber` and `positionColumn`.\n */\n getPosition() {\n return new Position(this.positionLineNumber, this.positionColumn);\n }\n /**\n * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.\n */\n setStartPosition(startLineNumber, startColumn) {\n if (this.getDirection() === 0 /* LTR */) {\n return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\n }\n return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn);\n }\n // ----\n /**\n * Create a `Selection` from one or two positions\n */\n static fromPositions(start, end = start) {\n return new Selection(start.lineNumber, start.column, end.lineNumber, end.column);\n }\n /**\n * Create a `Selection` from an `ISelection`.\n */\n static liftSelection(sel) {\n return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);\n }\n /**\n * `a` equals `b`.\n */\n static selectionsArrEqual(a, b) {\n if (a && !b || !a && b) {\n return false;\n }\n if (!a && !b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0, len = a.length; i < len; i++) {\n if (!this.selectionsEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n /**\n * Test if `obj` is an `ISelection`.\n */\n static isISelection(obj) {\n return (obj\n && (typeof obj.selectionStartLineNumber === 'number')\n && (typeof obj.selectionStartColumn === 'number')\n && (typeof obj.positionLineNumber === 'number')\n && (typeof obj.positionColumn === 'number'));\n }\n /**\n * Create with a direction.\n */\n static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) {\n if (direction === 0 /* LTR */) {\n return new Selection(startLineNumber, startColumn, endLineNumber, endColumn);\n }\n return new Selection(endLineNumber, endColumn, startLineNumber, startColumn);\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class Token {\n constructor(offset, type, language) {\n this.offset = offset | 0; // @perf\n this.type = type;\n this.language = language;\n }\n toString() {\n return '(' + this.offset + ', ' + this.type + ')';\n }\n}\nexport class TokenizationResult {\n constructor(tokens, endState) {\n this.tokens = tokens;\n this.endState = endState;\n }\n}\nexport class TokenizationResult2 {\n constructor(tokens, endState) {\n this.tokens = tokens;\n this.endState = endState;\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { LcsDiff } from '../../../base/common/diff/diff.js';\nimport * as strings from '../../../base/common/strings.js';\nconst MINIMUM_MATCHING_CHARACTER_LENGTH = 3;\nfunction computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) {\n const diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);\n return diffAlgo.ComputeDiff(pretty);\n}\nclass LineSequence {\n constructor(lines) {\n const startColumns = [];\n const endColumns = [];\n for (let i = 0, length = lines.length; i < length; i++) {\n startColumns[i] = getFirstNonBlankColumn(lines[i], 1);\n endColumns[i] = getLastNonBlankColumn(lines[i], 1);\n }\n this.lines = lines;\n this._startColumns = startColumns;\n this._endColumns = endColumns;\n }\n getElements() {\n const elements = [];\n for (let i = 0, len = this.lines.length; i < len; i++) {\n elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);\n }\n return elements;\n }\n getStartLineNumber(i) {\n return i + 1;\n }\n getEndLineNumber(i) {\n return i + 1;\n }\n createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) {\n const charCodes = [];\n const lineNumbers = [];\n const columns = [];\n let len = 0;\n for (let index = startIndex; index <= endIndex; index++) {\n const lineContent = this.lines[index];\n const startColumn = (shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1);\n const endColumn = (shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1);\n for (let col = startColumn; col < endColumn; col++) {\n charCodes[len] = lineContent.charCodeAt(col - 1);\n lineNumbers[len] = index + 1;\n columns[len] = col;\n len++;\n }\n }\n return new CharSequence(charCodes, lineNumbers, columns);\n }\n}\nclass CharSequence {\n constructor(charCodes, lineNumbers, columns) {\n this._charCodes = charCodes;\n this._lineNumbers = lineNumbers;\n this._columns = columns;\n }\n getElements() {\n return this._charCodes;\n }\n getStartLineNumber(i) {\n return this._lineNumbers[i];\n }\n getStartColumn(i) {\n return this._columns[i];\n }\n getEndLineNumber(i) {\n return this._lineNumbers[i];\n }\n getEndColumn(i) {\n return this._columns[i] + 1;\n }\n}\nclass CharChange {\n constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) {\n this.originalStartLineNumber = originalStartLineNumber;\n this.originalStartColumn = originalStartColumn;\n this.originalEndLineNumber = originalEndLineNumber;\n this.originalEndColumn = originalEndColumn;\n this.modifiedStartLineNumber = modifiedStartLineNumber;\n this.modifiedStartColumn = modifiedStartColumn;\n this.modifiedEndLineNumber = modifiedEndLineNumber;\n this.modifiedEndColumn = modifiedEndColumn;\n }\n static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) {\n let originalStartLineNumber;\n let originalStartColumn;\n let originalEndLineNumber;\n let originalEndColumn;\n let modifiedStartLineNumber;\n let modifiedStartColumn;\n let modifiedEndLineNumber;\n let modifiedEndColumn;\n if (diffChange.originalLength === 0) {\n originalStartLineNumber = 0;\n originalStartColumn = 0;\n originalEndLineNumber = 0;\n originalEndColumn = 0;\n }\n else {\n originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);\n originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);\n originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\n originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);\n }\n if (diffChange.modifiedLength === 0) {\n modifiedStartLineNumber = 0;\n modifiedStartColumn = 0;\n modifiedEndLineNumber = 0;\n modifiedEndColumn = 0;\n }\n else {\n modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);\n modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);\n modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n }\n return new CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn);\n }\n}\nfunction postProcessCharChanges(rawChanges) {\n if (rawChanges.length <= 1) {\n return rawChanges;\n }\n const result = [rawChanges[0]];\n let prevChange = result[0];\n for (let i = 1, len = rawChanges.length; i < len; i++) {\n const currChange = rawChanges[i];\n const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);\n const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);\n // Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true\n const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);\n if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {\n // Merge the current change into the previous one\n prevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart;\n prevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart;\n }\n else {\n // Add the current change\n result.push(currChange);\n prevChange = currChange;\n }\n }\n return result;\n}\nclass LineChange {\n constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) {\n this.originalStartLineNumber = originalStartLineNumber;\n this.originalEndLineNumber = originalEndLineNumber;\n this.modifiedStartLineNumber = modifiedStartLineNumber;\n this.modifiedEndLineNumber = modifiedEndLineNumber;\n this.charChanges = charChanges;\n }\n static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) {\n let originalStartLineNumber;\n let originalEndLineNumber;\n let modifiedStartLineNumber;\n let modifiedEndLineNumber;\n let charChanges = undefined;\n if (diffChange.originalLength === 0) {\n originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;\n originalEndLineNumber = 0;\n }\n else {\n originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);\n originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\n }\n if (diffChange.modifiedLength === 0) {\n modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;\n modifiedEndLineNumber = 0;\n }\n else {\n modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);\n modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n }\n if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) {\n // Compute character changes for diff chunks of at most 20 lines...\n const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);\n const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);\n let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes;\n if (shouldPostProcessCharChanges) {\n rawChanges = postProcessCharChanges(rawChanges);\n }\n charChanges = [];\n for (let i = 0, length = rawChanges.length; i < length; i++) {\n charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));\n }\n }\n return new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);\n }\n}\nexport class DiffComputer {\n constructor(originalLines, modifiedLines, opts) {\n this.shouldComputeCharChanges = opts.shouldComputeCharChanges;\n this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;\n this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;\n this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;\n this.originalLines = originalLines;\n this.modifiedLines = modifiedLines;\n this.original = new LineSequence(originalLines);\n this.modified = new LineSequence(modifiedLines);\n this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);\n this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes...\n }\n computeDiff() {\n if (this.original.lines.length === 1 && this.original.lines[0].length === 0) {\n // empty original => fast path\n return {\n quitEarly: false,\n changes: [{\n originalStartLineNumber: 1,\n originalEndLineNumber: 1,\n modifiedStartLineNumber: 1,\n modifiedEndLineNumber: this.modified.lines.length,\n charChanges: [{\n modifiedEndColumn: 0,\n modifiedEndLineNumber: 0,\n modifiedStartColumn: 0,\n modifiedStartLineNumber: 0,\n originalEndColumn: 0,\n originalEndLineNumber: 0,\n originalStartColumn: 0,\n originalStartLineNumber: 0\n }]\n }]\n };\n }\n if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {\n // empty modified => fast path\n return {\n quitEarly: false,\n changes: [{\n originalStartLineNumber: 1,\n originalEndLineNumber: this.original.lines.length,\n modifiedStartLineNumber: 1,\n modifiedEndLineNumber: 1,\n charChanges: [{\n modifiedEndColumn: 0,\n modifiedEndLineNumber: 0,\n modifiedStartColumn: 0,\n modifiedStartLineNumber: 0,\n originalEndColumn: 0,\n originalEndLineNumber: 0,\n originalStartColumn: 0,\n originalStartLineNumber: 0\n }]\n }]\n };\n }\n const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);\n const rawChanges = diffResult.changes;\n const quitEarly = diffResult.quitEarly;\n // The diff is always computed with ignoring trim whitespace\n // This ensures we get the prettiest diff\n if (this.shouldIgnoreTrimWhitespace) {\n const lineChanges = [];\n for (let i = 0, length = rawChanges.length; i < length; i++) {\n lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\n }\n return {\n quitEarly: quitEarly,\n changes: lineChanges\n };\n }\n // Need to post-process and introduce changes where the trim whitespace is different\n // Note that we are looping starting at -1 to also cover the lines before the first change\n const result = [];\n let originalLineIndex = 0;\n let modifiedLineIndex = 0;\n for (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) {\n const nextChange = (i + 1 < len ? rawChanges[i + 1] : null);\n const originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length);\n const modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length);\n while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {\n const originalLine = this.originalLines[originalLineIndex];\n const modifiedLine = this.modifiedLines[modifiedLineIndex];\n if (originalLine !== modifiedLine) {\n // These lines differ only in trim whitespace\n // Check the leading whitespace\n {\n let originalStartColumn = getFirstNonBlankColumn(originalLine, 1);\n let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1);\n while (originalStartColumn > 1 && modifiedStartColumn > 1) {\n const originalChar = originalLine.charCodeAt(originalStartColumn - 2);\n const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);\n if (originalChar !== modifiedChar) {\n break;\n }\n originalStartColumn--;\n modifiedStartColumn--;\n }\n if (originalStartColumn > 1 || modifiedStartColumn > 1) {\n this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn);\n }\n }\n // Check the trailing whitespace\n {\n let originalEndColumn = getLastNonBlankColumn(originalLine, 1);\n let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1);\n const originalMaxColumn = originalLine.length + 1;\n const modifiedMaxColumn = modifiedLine.length + 1;\n while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {\n const originalChar = originalLine.charCodeAt(originalEndColumn - 1);\n const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);\n if (originalChar !== modifiedChar) {\n break;\n }\n originalEndColumn++;\n modifiedEndColumn++;\n }\n if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {\n this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn);\n }\n }\n }\n originalLineIndex++;\n modifiedLineIndex++;\n }\n if (nextChange) {\n // Emit the actual change\n result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\n originalLineIndex += nextChange.originalLength;\n modifiedLineIndex += nextChange.modifiedLength;\n }\n }\n return {\n quitEarly: quitEarly,\n changes: result\n };\n }\n _pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {\n if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {\n // Merged into previous\n return;\n }\n let charChanges = undefined;\n if (this.shouldComputeCharChanges) {\n charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)];\n }\n result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges));\n }\n _mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {\n const len = result.length;\n if (len === 0) {\n return false;\n }\n const prevChange = result[len - 1];\n if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {\n // Don't merge with inserts/deletes\n return false;\n }\n if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {\n prevChange.originalEndLineNumber = originalLineNumber;\n prevChange.modifiedEndLineNumber = modifiedLineNumber;\n if (this.shouldComputeCharChanges && prevChange.charChanges) {\n prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn));\n }\n return true;\n }\n return false;\n }\n}\nfunction getFirstNonBlankColumn(txt, defaultValue) {\n const r = strings.firstNonWhitespaceIndex(txt);\n if (r === -1) {\n return defaultValue;\n }\n return r + 1;\n}\nfunction getLastNonBlankColumn(txt, defaultValue) {\n const r = strings.lastNonWhitespaceIndex(txt);\n if (r === -1) {\n return defaultValue;\n }\n return r + 2;\n}\nfunction createContinueProcessingPredicate(maximumRuntime) {\n if (maximumRuntime === 0) {\n return () => true;\n }\n const startTime = Date.now();\n return () => {\n return Date.now() - startTime < maximumRuntime;\n };\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Position } from '../core/position.js';\nimport { PrefixSumComputer } from '../viewModel/prefixSumComputer.js';\nexport class MirrorTextModel {\n constructor(uri, lines, eol, versionId) {\n this._uri = uri;\n this._lines = lines;\n this._eol = eol;\n this._versionId = versionId;\n this._lineStarts = null;\n this._cachedTextValue = null;\n }\n dispose() {\n this._lines.length = 0;\n }\n getText() {\n if (this._cachedTextValue === null) {\n this._cachedTextValue = this._lines.join(this._eol);\n }\n return this._cachedTextValue;\n }\n onEvents(e) {\n if (e.eol && e.eol !== this._eol) {\n this._eol = e.eol;\n this._lineStarts = null;\n }\n // Update my lines\n const changes = e.changes;\n for (const change of changes) {\n this._acceptDeleteRange(change.range);\n this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text);\n }\n this._versionId = e.versionId;\n this._cachedTextValue = null;\n }\n _ensureLineStarts() {\n if (!this._lineStarts) {\n const eolLength = this._eol.length;\n const linesLength = this._lines.length;\n const lineStartValues = new Uint32Array(linesLength);\n for (let i = 0; i < linesLength; i++) {\n lineStartValues[i] = this._lines[i].length + eolLength;\n }\n this._lineStarts = new PrefixSumComputer(lineStartValues);\n }\n }\n /**\n * All changes to a line's text go through this method\n */\n _setLineText(lineIndex, newValue) {\n this._lines[lineIndex] = newValue;\n if (this._lineStarts) {\n // update prefix sum\n this._lineStarts.changeValue(lineIndex, this._lines[lineIndex].length + this._eol.length);\n }\n }\n _acceptDeleteRange(range) {\n if (range.startLineNumber === range.endLineNumber) {\n if (range.startColumn === range.endColumn) {\n // Nothing to delete\n return;\n }\n // Delete text on the affected line\n this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\n + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1));\n return;\n }\n // Take remaining text on last line and append it to remaining text on first line\n this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\n + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1));\n // Delete middle lines\n this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n if (this._lineStarts) {\n // update prefix sum\n this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n }\n }\n _acceptInsertText(position, insertText) {\n if (insertText.length === 0) {\n // Nothing to insert\n return;\n }\n let insertLines = insertText.split(/\\r\\n|\\r|\\n/);\n if (insertLines.length === 1) {\n // Inserting text on one line\n this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1)\n + insertLines[0]\n + this._lines[position.lineNumber - 1].substring(position.column - 1));\n return;\n }\n // Append overflowing text from first line to the end of text to insert\n insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1);\n // Delete overflowing text from first line and insert text on first line\n this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1)\n + insertLines[0]);\n // Insert new lines & store lengths\n let newLengths = new Uint32Array(insertLines.length - 1);\n for (let i = 1; i < insertLines.length; i++) {\n this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]);\n newLengths[i - 1] = insertLines[i].length + this._eol.length;\n }\n if (this._lineStarts) {\n // update prefix sum\n this._lineStarts.insertValues(position.lineNumber, newLengths);\n }\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?';\n/**\n * Create a word definition regular expression based on default word separators.\n * Optionally provide allowed separators that should be included in words.\n *\n * The default would look like this:\n * /(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)/g\n */\nfunction createWordRegExp(allowInWords = '') {\n let source = '(-?\\\\d*\\\\.\\\\d\\\\w*)|([^';\n for (const sep of USUAL_WORD_SEPARATORS) {\n if (allowInWords.indexOf(sep) >= 0) {\n continue;\n }\n source += '\\\\' + sep;\n }\n source += '\\\\s]+)';\n return new RegExp(source, 'g');\n}\n// catches numbers (including floating numbers) in the first group, and alphanum in the second\nexport const DEFAULT_WORD_REGEXP = createWordRegExp();\nexport function ensureValidWordDefinition(wordDefinition) {\n let result = DEFAULT_WORD_REGEXP;\n if (wordDefinition && (wordDefinition instanceof RegExp)) {\n if (!wordDefinition.global) {\n let flags = 'g';\n if (wordDefinition.ignoreCase) {\n flags += 'i';\n }\n if (wordDefinition.multiline) {\n flags += 'm';\n }\n if (wordDefinition.unicode) {\n flags += 'u';\n }\n result = new RegExp(wordDefinition.source, flags);\n }\n else {\n result = wordDefinition;\n }\n }\n result.lastIndex = 0;\n return result;\n}\nconst _defaultConfig = {\n maxLen: 1000,\n windowSize: 15,\n timeBudget: 150\n};\nexport function getWordAtText(column, wordDefinition, text, textOffset, config = _defaultConfig) {\n if (text.length > config.maxLen) {\n // don't throw strings that long at the regexp\n // but use a sub-string in which a word must occur\n let start = column - config.maxLen / 2;\n if (start < 0) {\n textOffset += column;\n start = 0;\n }\n else {\n textOffset += start;\n }\n text = text.substring(start, column + config.maxLen / 2);\n return getWordAtText(column, wordDefinition, text, textOffset, config);\n }\n const t1 = Date.now();\n const pos = column - 1 - textOffset;\n let prevRegexIndex = -1;\n let match = null;\n for (let i = 1;; i++) {\n // check time budget\n if (Date.now() - t1 >= config.timeBudget) {\n // break;\n }\n // reset the index at which the regexp should start matching, also know where it\n // should stop so that subsequent search don't repeat previous searches\n const regexIndex = pos - config.windowSize * i;\n wordDefinition.lastIndex = Math.max(0, regexIndex);\n const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex);\n if (!thisMatch && match) {\n // stop: we have something\n break;\n }\n match = thisMatch;\n // stop: searched at start\n if (regexIndex <= 0) {\n break;\n }\n prevRegexIndex = regexIndex;\n }\n if (match) {\n let result = {\n word: match[0],\n startColumn: textOffset + 1 + match.index,\n endColumn: textOffset + 1 + match.index + match[0].length\n };\n wordDefinition.lastIndex = 0;\n return result;\n }\n return null;\n}\nfunction _findRegexMatchEnclosingPosition(wordDefinition, text, pos, stopPos) {\n let match;\n while (match = wordDefinition.exec(text)) {\n const matchIndex = match.index || 0;\n if (matchIndex <= pos && wordDefinition.lastIndex >= pos) {\n return match;\n }\n else if (stopPos > 0 && matchIndex > stopPos) {\n return null;\n }\n }\n return null;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { CharacterClassifier } from '../core/characterClassifier.js';\nexport class Uint8Matrix {\n constructor(rows, cols, defaultValue) {\n const data = new Uint8Array(rows * cols);\n for (let i = 0, len = rows * cols; i < len; i++) {\n data[i] = defaultValue;\n }\n this._data = data;\n this.rows = rows;\n this.cols = cols;\n }\n get(row, col) {\n return this._data[row * this.cols + col];\n }\n set(row, col, value) {\n this._data[row * this.cols + col] = value;\n }\n}\nexport class StateMachine {\n constructor(edges) {\n let maxCharCode = 0;\n let maxState = 0 /* Invalid */;\n for (let i = 0, len = edges.length; i < len; i++) {\n let [from, chCode, to] = edges[i];\n if (chCode > maxCharCode) {\n maxCharCode = chCode;\n }\n if (from > maxState) {\n maxState = from;\n }\n if (to > maxState) {\n maxState = to;\n }\n }\n maxCharCode++;\n maxState++;\n let states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */);\n for (let i = 0, len = edges.length; i < len; i++) {\n let [from, chCode, to] = edges[i];\n states.set(from, chCode, to);\n }\n this._states = states;\n this._maxCharCode = maxCharCode;\n }\n nextState(currentState, chCode) {\n if (chCode < 0 || chCode >= this._maxCharCode) {\n return 0 /* Invalid */;\n }\n return this._states.get(currentState, chCode);\n }\n}\n// State machine for http:// or https:// or file://\nlet _stateMachine = null;\nfunction getStateMachine() {\n if (_stateMachine === null) {\n _stateMachine = new StateMachine([\n [1 /* Start */, 104 /* h */, 2 /* H */],\n [1 /* Start */, 72 /* H */, 2 /* H */],\n [1 /* Start */, 102 /* f */, 6 /* F */],\n [1 /* Start */, 70 /* F */, 6 /* F */],\n [2 /* H */, 116 /* t */, 3 /* HT */],\n [2 /* H */, 84 /* T */, 3 /* HT */],\n [3 /* HT */, 116 /* t */, 4 /* HTT */],\n [3 /* HT */, 84 /* T */, 4 /* HTT */],\n [4 /* HTT */, 112 /* p */, 5 /* HTTP */],\n [4 /* HTT */, 80 /* P */, 5 /* HTTP */],\n [5 /* HTTP */, 115 /* s */, 9 /* BeforeColon */],\n [5 /* HTTP */, 83 /* S */, 9 /* BeforeColon */],\n [5 /* HTTP */, 58 /* Colon */, 10 /* AfterColon */],\n [6 /* F */, 105 /* i */, 7 /* FI */],\n [6 /* F */, 73 /* I */, 7 /* FI */],\n [7 /* FI */, 108 /* l */, 8 /* FIL */],\n [7 /* FI */, 76 /* L */, 8 /* FIL */],\n [8 /* FIL */, 101 /* e */, 9 /* BeforeColon */],\n [8 /* FIL */, 69 /* E */, 9 /* BeforeColon */],\n [9 /* BeforeColon */, 58 /* Colon */, 10 /* AfterColon */],\n [10 /* AfterColon */, 47 /* Slash */, 11 /* AlmostThere */],\n [11 /* AlmostThere */, 47 /* Slash */, 12 /* End */],\n ]);\n }\n return _stateMachine;\n}\nlet _classifier = null;\nfunction getClassifier() {\n if (_classifier === null) {\n _classifier = new CharacterClassifier(0 /* None */);\n const FORCE_TERMINATION_CHARACTERS = ' \\t<>\\'\\\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…';\n for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) {\n _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */);\n }\n const CANNOT_END_WITH_CHARACTERS = '.,;';\n for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) {\n _classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), 2 /* CannotEndIn */);\n }\n }\n return _classifier;\n}\nexport class LinkComputer {\n static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) {\n // Do not allow to end link in certain characters...\n let lastIncludedCharIndex = linkEndIndex - 1;\n do {\n const chCode = line.charCodeAt(lastIncludedCharIndex);\n const chClass = classifier.get(chCode);\n if (chClass !== 2 /* CannotEndIn */) {\n break;\n }\n lastIncludedCharIndex--;\n } while (lastIncludedCharIndex > linkBeginIndex);\n // Handle links enclosed in parens, square brackets and curlys.\n if (linkBeginIndex > 0) {\n const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1);\n const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex);\n if ((charCodeBeforeLink === 40 /* OpenParen */ && lastCharCodeInLink === 41 /* CloseParen */)\n || (charCodeBeforeLink === 91 /* OpenSquareBracket */ && lastCharCodeInLink === 93 /* CloseSquareBracket */)\n || (charCodeBeforeLink === 123 /* OpenCurlyBrace */ && lastCharCodeInLink === 125 /* CloseCurlyBrace */)) {\n // Do not end in ) if ( is before the link start\n // Do not end in ] if [ is before the link start\n // Do not end in } if { is before the link start\n lastIncludedCharIndex--;\n }\n }\n return {\n range: {\n startLineNumber: lineNumber,\n startColumn: linkBeginIndex + 1,\n endLineNumber: lineNumber,\n endColumn: lastIncludedCharIndex + 2\n },\n url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1)\n };\n }\n static computeLinks(model, stateMachine = getStateMachine()) {\n const classifier = getClassifier();\n let result = [];\n for (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) {\n const line = model.getLineContent(i);\n const len = line.length;\n let j = 0;\n let linkBeginIndex = 0;\n let linkBeginChCode = 0;\n let state = 1 /* Start */;\n let hasOpenParens = false;\n let hasOpenSquareBracket = false;\n let inSquareBrackets = false;\n let hasOpenCurlyBracket = false;\n while (j < len) {\n let resetStateMachine = false;\n const chCode = line.charCodeAt(j);\n if (state === 13 /* Accept */) {\n let chClass;\n switch (chCode) {\n case 40 /* OpenParen */:\n hasOpenParens = true;\n chClass = 0 /* None */;\n break;\n case 41 /* CloseParen */:\n chClass = (hasOpenParens ? 0 /* None */ : 1 /* ForceTermination */);\n break;\n case 91 /* OpenSquareBracket */:\n inSquareBrackets = true;\n hasOpenSquareBracket = true;\n chClass = 0 /* None */;\n break;\n case 93 /* CloseSquareBracket */:\n inSquareBrackets = false;\n chClass = (hasOpenSquareBracket ? 0 /* None */ : 1 /* ForceTermination */);\n break;\n case 123 /* OpenCurlyBrace */:\n hasOpenCurlyBracket = true;\n chClass = 0 /* None */;\n break;\n case 125 /* CloseCurlyBrace */:\n chClass = (hasOpenCurlyBracket ? 0 /* None */ : 1 /* ForceTermination */);\n break;\n /* The following three rules make it that ' or \" or ` are allowed inside links if the link began with a different one */\n case 39 /* SingleQuote */:\n chClass = (linkBeginChCode === 34 /* DoubleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */;\n break;\n case 34 /* DoubleQuote */:\n chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */;\n break;\n case 96 /* BackTick */:\n chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 34 /* DoubleQuote */) ? 0 /* None */ : 1 /* ForceTermination */;\n break;\n case 42 /* Asterisk */:\n // `*` terminates a link if the link began with `*`\n chClass = (linkBeginChCode === 42 /* Asterisk */) ? 1 /* ForceTermination */ : 0 /* None */;\n break;\n case 124 /* Pipe */:\n // `|` terminates a link if the link began with `|`\n chClass = (linkBeginChCode === 124 /* Pipe */) ? 1 /* ForceTermination */ : 0 /* None */;\n break;\n case 32 /* Space */:\n // ` ` allow space in between [ and ]\n chClass = (inSquareBrackets ? 0 /* None */ : 1 /* ForceTermination */);\n break;\n default:\n chClass = classifier.get(chCode);\n }\n // Check if character terminates link\n if (chClass === 1 /* ForceTermination */) {\n result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j));\n resetStateMachine = true;\n }\n }\n else if (state === 12 /* End */) {\n let chClass;\n if (chCode === 91 /* OpenSquareBracket */) {\n // Allow for the authority part to contain ipv6 addresses which contain [ and ]\n hasOpenSquareBracket = true;\n chClass = 0 /* None */;\n }\n else {\n chClass = classifier.get(chCode);\n }\n // Check if character terminates link\n if (chClass === 1 /* ForceTermination */) {\n resetStateMachine = true;\n }\n else {\n state = 13 /* Accept */;\n }\n }\n else {\n state = stateMachine.nextState(state, chCode);\n if (state === 0 /* Invalid */) {\n resetStateMachine = true;\n }\n }\n if (resetStateMachine) {\n state = 1 /* Start */;\n hasOpenParens = false;\n hasOpenSquareBracket = false;\n hasOpenCurlyBracket = false;\n // Record where the link started\n linkBeginIndex = j + 1;\n linkBeginChCode = chCode;\n }\n j++;\n }\n if (state === 13 /* Accept */) {\n result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len));\n }\n }\n return result;\n }\n}\n/**\n * Returns an array of all links contains in the provided\n * document. *Note* that this operation is computational\n * expensive and should not run in the UI thread.\n */\nexport function computeLinks(model) {\n if (!model || typeof model.getLineCount !== 'function' || typeof model.getLineContent !== 'function') {\n // Unknown caller!\n return [];\n }\n return LinkComputer.computeLinks(model);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class BasicInplaceReplace {\n constructor() {\n this._defaultValueSet = [\n ['true', 'false'],\n ['True', 'False'],\n ['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'],\n ['public', 'protected', 'private'],\n ];\n }\n navigateValueSet(range1, text1, range2, text2, up) {\n if (range1 && text1) {\n let result = this.doNavigateValueSet(text1, up);\n if (result) {\n return {\n range: range1,\n value: result\n };\n }\n }\n if (range2 && text2) {\n let result = this.doNavigateValueSet(text2, up);\n if (result) {\n return {\n range: range2,\n value: result\n };\n }\n }\n return null;\n }\n doNavigateValueSet(text, up) {\n let numberResult = this.numberReplace(text, up);\n if (numberResult !== null) {\n return numberResult;\n }\n return this.textReplace(text, up);\n }\n numberReplace(value, up) {\n let precision = Math.pow(10, value.length - (value.lastIndexOf('.') + 1));\n let n1 = Number(value);\n let n2 = parseFloat(value);\n if (!isNaN(n1) && !isNaN(n2) && n1 === n2) {\n if (n1 === 0 && !up) {\n return null; // don't do negative\n //\t\t\t} else if(n1 === 9 && up) {\n //\t\t\t\treturn null; // don't insert 10 into a number\n }\n else {\n n1 = Math.floor(n1 * precision);\n n1 += up ? precision : -precision;\n return String(n1 / precision);\n }\n }\n return null;\n }\n textReplace(value, up) {\n return this.valueSetsReplace(this._defaultValueSet, value, up);\n }\n valueSetsReplace(valueSets, value, up) {\n let result = null;\n for (let i = 0, len = valueSets.length; result === null && i < len; i++) {\n result = this.valueSetReplace(valueSets[i], value, up);\n }\n return result;\n }\n valueSetReplace(valueSet, value, up) {\n let idx = valueSet.indexOf(value);\n if (idx >= 0) {\n idx += up ? +1 : -1;\n if (idx < 0) {\n idx = valueSet.length - 1;\n }\n else {\n idx %= valueSet.length;\n }\n return valueSet[idx];\n }\n return null;\n }\n}\nBasicInplaceReplace.INSTANCE = new BasicInplaceReplace();\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { mergeSort } from '../../../base/common/arrays.js';\nimport { stringDiff } from '../../../base/common/diff/diff.js';\nimport { globals } from '../../../base/common/platform.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { Position } from '../core/position.js';\nimport { Range } from '../core/range.js';\nimport { DiffComputer } from '../diff/diffComputer.js';\nimport { MirrorTextModel as BaseMirrorModel } from '../model/mirrorTextModel.js';\nimport { ensureValidWordDefinition, getWordAtText } from '../model/wordHelper.js';\nimport { computeLinks } from '../modes/linkComputer.js';\nimport { BasicInplaceReplace } from '../modes/supports/inplaceReplaceSupport.js';\nimport { createMonacoBaseAPI } from '../standalone/standaloneBase.js';\nimport * as types from '../../../base/common/types.js';\n/**\n * @internal\n */\nclass MirrorModel extends BaseMirrorModel {\n get uri() {\n return this._uri;\n }\n get version() {\n return this._versionId;\n }\n get eol() {\n return this._eol;\n }\n getValue() {\n return this.getText();\n }\n getLinesContent() {\n return this._lines.slice(0);\n }\n getLineCount() {\n return this._lines.length;\n }\n getLineContent(lineNumber) {\n return this._lines[lineNumber - 1];\n }\n getWordAtPosition(position, wordDefinition) {\n let wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0);\n if (wordAtText) {\n return new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn);\n }\n return null;\n }\n words(wordDefinition) {\n const lines = this._lines;\n const wordenize = this._wordenize.bind(this);\n let lineNumber = 0;\n let lineText = '';\n let wordRangesIdx = 0;\n let wordRanges = [];\n return {\n *[Symbol.iterator]() {\n while (true) {\n if (wordRangesIdx < wordRanges.length) {\n const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);\n wordRangesIdx += 1;\n yield value;\n }\n else {\n if (lineNumber < lines.length) {\n lineText = lines[lineNumber];\n wordRanges = wordenize(lineText, wordDefinition);\n wordRangesIdx = 0;\n lineNumber += 1;\n }\n else {\n break;\n }\n }\n }\n }\n };\n }\n getLineWords(lineNumber, wordDefinition) {\n let content = this._lines[lineNumber - 1];\n let ranges = this._wordenize(content, wordDefinition);\n let words = [];\n for (const range of ranges) {\n words.push({\n word: content.substring(range.start, range.end),\n startColumn: range.start + 1,\n endColumn: range.end + 1\n });\n }\n return words;\n }\n _wordenize(content, wordDefinition) {\n const result = [];\n let match;\n wordDefinition.lastIndex = 0; // reset lastIndex just to be sure\n while (match = wordDefinition.exec(content)) {\n if (match[0].length === 0) {\n // it did match the empty string\n break;\n }\n result.push({ start: match.index, end: match.index + match[0].length });\n }\n return result;\n }\n getValueInRange(range) {\n range = this._validateRange(range);\n if (range.startLineNumber === range.endLineNumber) {\n return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1);\n }\n let lineEnding = this._eol;\n let startLineIndex = range.startLineNumber - 1;\n let endLineIndex = range.endLineNumber - 1;\n let resultLines = [];\n resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1));\n for (let i = startLineIndex + 1; i < endLineIndex; i++) {\n resultLines.push(this._lines[i]);\n }\n resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1));\n return resultLines.join(lineEnding);\n }\n offsetAt(position) {\n position = this._validatePosition(position);\n this._ensureLineStarts();\n return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1);\n }\n positionAt(offset) {\n offset = Math.floor(offset);\n offset = Math.max(0, offset);\n this._ensureLineStarts();\n let out = this._lineStarts.getIndexOf(offset);\n let lineLength = this._lines[out.index].length;\n // Ensure we return a valid position\n return {\n lineNumber: 1 + out.index,\n column: 1 + Math.min(out.remainder, lineLength)\n };\n }\n _validateRange(range) {\n const start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn });\n const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn });\n if (start.lineNumber !== range.startLineNumber\n || start.column !== range.startColumn\n || end.lineNumber !== range.endLineNumber\n || end.column !== range.endColumn) {\n return {\n startLineNumber: start.lineNumber,\n startColumn: start.column,\n endLineNumber: end.lineNumber,\n endColumn: end.column\n };\n }\n return range;\n }\n _validatePosition(position) {\n if (!Position.isIPosition(position)) {\n throw new Error('bad position');\n }\n let { lineNumber, column } = position;\n let hasChanged = false;\n if (lineNumber < 1) {\n lineNumber = 1;\n column = 1;\n hasChanged = true;\n }\n else if (lineNumber > this._lines.length) {\n lineNumber = this._lines.length;\n column = this._lines[lineNumber - 1].length + 1;\n hasChanged = true;\n }\n else {\n let maxCharacter = this._lines[lineNumber - 1].length + 1;\n if (column < 1) {\n column = 1;\n hasChanged = true;\n }\n else if (column > maxCharacter) {\n column = maxCharacter;\n hasChanged = true;\n }\n }\n if (!hasChanged) {\n return position;\n }\n else {\n return { lineNumber, column };\n }\n }\n}\n/**\n * @internal\n */\nexport class EditorSimpleWorker {\n constructor(host, foreignModuleFactory) {\n this._host = host;\n this._models = Object.create(null);\n this._foreignModuleFactory = foreignModuleFactory;\n this._foreignModule = null;\n }\n dispose() {\n this._models = Object.create(null);\n }\n _getModel(uri) {\n return this._models[uri];\n }\n _getModels() {\n let all = [];\n Object.keys(this._models).forEach((key) => all.push(this._models[key]));\n return all;\n }\n acceptNewModel(data) {\n this._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId);\n }\n acceptModelChanged(strURL, e) {\n if (!this._models[strURL]) {\n return;\n }\n let model = this._models[strURL];\n model.onEvents(e);\n }\n acceptRemovedModel(strURL) {\n if (!this._models[strURL]) {\n return;\n }\n delete this._models[strURL];\n }\n // ---- BEGIN diff --------------------------------------------------------------------------\n computeDiff(originalUrl, modifiedUrl, ignoreTrimWhitespace, maxComputationTime) {\n return __awaiter(this, void 0, void 0, function* () {\n const original = this._getModel(originalUrl);\n const modified = this._getModel(modifiedUrl);\n if (!original || !modified) {\n return null;\n }\n const originalLines = original.getLinesContent();\n const modifiedLines = modified.getLinesContent();\n const diffComputer = new DiffComputer(originalLines, modifiedLines, {\n shouldComputeCharChanges: true,\n shouldPostProcessCharChanges: true,\n shouldIgnoreTrimWhitespace: ignoreTrimWhitespace,\n shouldMakePrettyDiff: true,\n maxComputationTime: maxComputationTime\n });\n const diffResult = diffComputer.computeDiff();\n const identical = (diffResult.changes.length > 0 ? false : this._modelsAreIdentical(original, modified));\n return {\n quitEarly: diffResult.quitEarly,\n identical: identical,\n changes: diffResult.changes\n };\n });\n }\n _modelsAreIdentical(original, modified) {\n const originalLineCount = original.getLineCount();\n const modifiedLineCount = modified.getLineCount();\n if (originalLineCount !== modifiedLineCount) {\n return false;\n }\n for (let line = 1; line <= originalLineCount; line++) {\n const originalLine = original.getLineContent(line);\n const modifiedLine = modified.getLineContent(line);\n if (originalLine !== modifiedLine) {\n return false;\n }\n }\n return true;\n }\n computeMoreMinimalEdits(modelUrl, edits) {\n return __awaiter(this, void 0, void 0, function* () {\n const model = this._getModel(modelUrl);\n if (!model) {\n return edits;\n }\n const result = [];\n let lastEol = undefined;\n edits = mergeSort(edits, (a, b) => {\n if (a.range && b.range) {\n return Range.compareRangesUsingStarts(a.range, b.range);\n }\n // eol only changes should go to the end\n let aRng = a.range ? 0 : 1;\n let bRng = b.range ? 0 : 1;\n return aRng - bRng;\n });\n for (let { range, text, eol } of edits) {\n if (typeof eol === 'number') {\n lastEol = eol;\n }\n if (Range.isEmpty(range) && !text) {\n // empty change\n continue;\n }\n const original = model.getValueInRange(range);\n text = text.replace(/\\r\\n|\\n|\\r/g, model.eol);\n if (original === text) {\n // noop\n continue;\n }\n // make sure diff won't take too long\n if (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) {\n result.push({ range, text });\n continue;\n }\n // compute diff between original and edit.text\n const changes = stringDiff(original, text, false);\n const editOffset = model.offsetAt(Range.lift(range).getStartPosition());\n for (const change of changes) {\n const start = model.positionAt(editOffset + change.originalStart);\n const end = model.positionAt(editOffset + change.originalStart + change.originalLength);\n const newEdit = {\n text: text.substr(change.modifiedStart, change.modifiedLength),\n range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column }\n };\n if (model.getValueInRange(newEdit.range) !== newEdit.text) {\n result.push(newEdit);\n }\n }\n }\n if (typeof lastEol === 'number') {\n result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } });\n }\n return result;\n });\n }\n // ---- END minimal edits ---------------------------------------------------------------\n computeLinks(modelUrl) {\n return __awaiter(this, void 0, void 0, function* () {\n let model = this._getModel(modelUrl);\n if (!model) {\n return null;\n }\n return computeLinks(model);\n });\n }\n textualSuggest(modelUrl, position, wordDef, wordDefFlags) {\n return __awaiter(this, void 0, void 0, function* () {\n const model = this._getModel(modelUrl);\n if (!model) {\n return null;\n }\n const words = [];\n const seen = new Set();\n const wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n const wordAt = model.getWordAtPosition(position, wordDefRegExp);\n if (wordAt) {\n seen.add(model.getValueInRange(wordAt));\n }\n for (let word of model.words(wordDefRegExp)) {\n if (seen.has(word)) {\n continue;\n }\n seen.add(word);\n if (!isNaN(Number(word))) {\n continue;\n }\n words.push(word);\n if (seen.size > EditorSimpleWorker._suggestionsLimit) {\n break;\n }\n }\n return words;\n });\n }\n // ---- END suggest --------------------------------------------------------------------------\n //#region -- word ranges --\n computeWordRanges(modelUrl, range, wordDef, wordDefFlags) {\n return __awaiter(this, void 0, void 0, function* () {\n let model = this._getModel(modelUrl);\n if (!model) {\n return Object.create(null);\n }\n const wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n const result = Object.create(null);\n for (let line = range.startLineNumber; line < range.endLineNumber; line++) {\n let words = model.getLineWords(line, wordDefRegExp);\n for (const word of words) {\n if (!isNaN(Number(word.word))) {\n continue;\n }\n let array = result[word.word];\n if (!array) {\n array = [];\n result[word.word] = array;\n }\n array.push({\n startLineNumber: line,\n startColumn: word.startColumn,\n endLineNumber: line,\n endColumn: word.endColumn\n });\n }\n }\n return result;\n });\n }\n //#endregion\n navigateValueSet(modelUrl, range, up, wordDef, wordDefFlags) {\n return __awaiter(this, void 0, void 0, function* () {\n let model = this._getModel(modelUrl);\n if (!model) {\n return null;\n }\n let wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n if (range.startColumn === range.endColumn) {\n range = {\n startLineNumber: range.startLineNumber,\n startColumn: range.startColumn,\n endLineNumber: range.endLineNumber,\n endColumn: range.endColumn + 1\n };\n }\n let selectionText = model.getValueInRange(range);\n let wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp);\n if (!wordRange) {\n return null;\n }\n let word = model.getValueInRange(wordRange);\n let result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);\n return result;\n });\n }\n // ---- BEGIN foreign module support --------------------------------------------------------------------------\n loadForeignModule(moduleId, createData, foreignHostMethods) {\n const proxyMethodRequest = (method, args) => {\n return this._host.fhr(method, args);\n };\n const foreignHost = types.createProxyObject(foreignHostMethods, proxyMethodRequest);\n let ctx = {\n host: foreignHost,\n getMirrorModels: () => {\n return this._getModels();\n }\n };\n if (this._foreignModuleFactory) {\n this._foreignModule = this._foreignModuleFactory(ctx, createData);\n // static foreing module\n return Promise.resolve(types.getAllMethodNames(this._foreignModule));\n }\n // ESM-comment-begin\n // \t\treturn new Promise((resolve, reject) => {\n // \t\t\trequire([moduleId], (foreignModule: { create: IForeignModuleFactory }) => {\n // \t\t\t\tthis._foreignModule = foreignModule.create(ctx, createData);\n // \n // \t\t\t\tresolve(types.getAllMethodNames(this._foreignModule));\n // \n // \t\t\t}, reject);\n // \t\t});\n // ESM-comment-end\n // ESM-uncomment-begin\n return Promise.reject(new Error(`Unexpected usage`));\n // ESM-uncomment-end\n }\n // foreign method request\n fmr(method, args) {\n if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') {\n return Promise.reject(new Error('Missing requestHandler or method: ' + method));\n }\n try {\n return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args));\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n}\n// ---- END diff --------------------------------------------------------------------------\n// ---- BEGIN minimal edits ---------------------------------------------------------------\nEditorSimpleWorker._diffLimit = 100000;\n// ---- BEGIN suggest --------------------------------------------------------------------------\nEditorSimpleWorker._suggestionsLimit = 10000;\n/**\n * Called on the worker side\n * @internal\n */\nexport function create(host) {\n return new EditorSimpleWorker(host, null);\n}\nif (typeof importScripts === 'function') {\n // Running in a web worker\n globals.monaco = createMonacoBaseAPI();\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { CancellationTokenSource } from '../../../base/common/cancellation.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { KeyChord } from '../../../base/common/keyCodes.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { Position } from '../core/position.js';\nimport { Range } from '../core/range.js';\nimport { Selection } from '../core/selection.js';\nimport { Token } from '../core/token.js';\nimport * as standaloneEnums from './standaloneEnums.js';\nexport class KeyMod {\n static chord(firstPart, secondPart) {\n return KeyChord(firstPart, secondPart);\n }\n}\nKeyMod.CtrlCmd = 2048 /* CtrlCmd */;\nKeyMod.Shift = 1024 /* Shift */;\nKeyMod.Alt = 512 /* Alt */;\nKeyMod.WinCtrl = 256 /* WinCtrl */;\nexport function createMonacoBaseAPI() {\n return {\n editor: undefined,\n languages: undefined,\n CancellationTokenSource: CancellationTokenSource,\n Emitter: Emitter,\n KeyCode: standaloneEnums.KeyCode,\n KeyMod: KeyMod,\n Position: Position,\n Range: Range,\n Selection: Selection,\n SelectionDirection: standaloneEnums.SelectionDirection,\n MarkerSeverity: standaloneEnums.MarkerSeverity,\n MarkerTag: standaloneEnums.MarkerTag,\n Uri: URI,\n Token: Token\n };\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.\nexport var AccessibilitySupport;\n(function (AccessibilitySupport) {\n /**\n * This should be the browser case where it is not known if a screen reader is attached or no.\n */\n AccessibilitySupport[AccessibilitySupport[\"Unknown\"] = 0] = \"Unknown\";\n AccessibilitySupport[AccessibilitySupport[\"Disabled\"] = 1] = \"Disabled\";\n AccessibilitySupport[AccessibilitySupport[\"Enabled\"] = 2] = \"Enabled\";\n})(AccessibilitySupport || (AccessibilitySupport = {}));\nexport var CompletionItemInsertTextRule;\n(function (CompletionItemInsertTextRule) {\n /**\n * Adjust whitespace/indentation of multiline insert texts to\n * match the current line indentation.\n */\n CompletionItemInsertTextRule[CompletionItemInsertTextRule[\"KeepWhitespace\"] = 1] = \"KeepWhitespace\";\n /**\n * `insertText` is a snippet.\n */\n CompletionItemInsertTextRule[CompletionItemInsertTextRule[\"InsertAsSnippet\"] = 4] = \"InsertAsSnippet\";\n})(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {}));\nexport var CompletionItemKind;\n(function (CompletionItemKind) {\n CompletionItemKind[CompletionItemKind[\"Method\"] = 0] = \"Method\";\n CompletionItemKind[CompletionItemKind[\"Function\"] = 1] = \"Function\";\n CompletionItemKind[CompletionItemKind[\"Constructor\"] = 2] = \"Constructor\";\n CompletionItemKind[CompletionItemKind[\"Field\"] = 3] = \"Field\";\n CompletionItemKind[CompletionItemKind[\"Variable\"] = 4] = \"Variable\";\n CompletionItemKind[CompletionItemKind[\"Class\"] = 5] = \"Class\";\n CompletionItemKind[CompletionItemKind[\"Struct\"] = 6] = \"Struct\";\n CompletionItemKind[CompletionItemKind[\"Interface\"] = 7] = \"Interface\";\n CompletionItemKind[CompletionItemKind[\"Module\"] = 8] = \"Module\";\n CompletionItemKind[CompletionItemKind[\"Property\"] = 9] = \"Property\";\n CompletionItemKind[CompletionItemKind[\"Event\"] = 10] = \"Event\";\n CompletionItemKind[CompletionItemKind[\"Operator\"] = 11] = \"Operator\";\n CompletionItemKind[CompletionItemKind[\"Unit\"] = 12] = \"Unit\";\n CompletionItemKind[CompletionItemKind[\"Value\"] = 13] = \"Value\";\n CompletionItemKind[CompletionItemKind[\"Constant\"] = 14] = \"Constant\";\n CompletionItemKind[CompletionItemKind[\"Enum\"] = 15] = \"Enum\";\n CompletionItemKind[CompletionItemKind[\"EnumMember\"] = 16] = \"EnumMember\";\n CompletionItemKind[CompletionItemKind[\"Keyword\"] = 17] = \"Keyword\";\n CompletionItemKind[CompletionItemKind[\"Text\"] = 18] = \"Text\";\n CompletionItemKind[CompletionItemKind[\"Color\"] = 19] = \"Color\";\n CompletionItemKind[CompletionItemKind[\"File\"] = 20] = \"File\";\n CompletionItemKind[CompletionItemKind[\"Reference\"] = 21] = \"Reference\";\n CompletionItemKind[CompletionItemKind[\"Customcolor\"] = 22] = \"Customcolor\";\n CompletionItemKind[CompletionItemKind[\"Folder\"] = 23] = \"Folder\";\n CompletionItemKind[CompletionItemKind[\"TypeParameter\"] = 24] = \"TypeParameter\";\n CompletionItemKind[CompletionItemKind[\"User\"] = 25] = \"User\";\n CompletionItemKind[CompletionItemKind[\"Issue\"] = 26] = \"Issue\";\n CompletionItemKind[CompletionItemKind[\"Snippet\"] = 27] = \"Snippet\";\n})(CompletionItemKind || (CompletionItemKind = {}));\nexport var CompletionItemTag;\n(function (CompletionItemTag) {\n CompletionItemTag[CompletionItemTag[\"Deprecated\"] = 1] = \"Deprecated\";\n})(CompletionItemTag || (CompletionItemTag = {}));\n/**\n * How a suggest provider was triggered.\n */\nexport var CompletionTriggerKind;\n(function (CompletionTriggerKind) {\n CompletionTriggerKind[CompletionTriggerKind[\"Invoke\"] = 0] = \"Invoke\";\n CompletionTriggerKind[CompletionTriggerKind[\"TriggerCharacter\"] = 1] = \"TriggerCharacter\";\n CompletionTriggerKind[CompletionTriggerKind[\"TriggerForIncompleteCompletions\"] = 2] = \"TriggerForIncompleteCompletions\";\n})(CompletionTriggerKind || (CompletionTriggerKind = {}));\n/**\n * A positioning preference for rendering content widgets.\n */\nexport var ContentWidgetPositionPreference;\n(function (ContentWidgetPositionPreference) {\n /**\n * Place the content widget exactly at a position\n */\n ContentWidgetPositionPreference[ContentWidgetPositionPreference[\"EXACT\"] = 0] = \"EXACT\";\n /**\n * Place the content widget above a position\n */\n ContentWidgetPositionPreference[ContentWidgetPositionPreference[\"ABOVE\"] = 1] = \"ABOVE\";\n /**\n * Place the content widget below a position\n */\n ContentWidgetPositionPreference[ContentWidgetPositionPreference[\"BELOW\"] = 2] = \"BELOW\";\n})(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {}));\n/**\n * Describes the reason the cursor has changed its position.\n */\nexport var CursorChangeReason;\n(function (CursorChangeReason) {\n /**\n * Unknown or not set.\n */\n CursorChangeReason[CursorChangeReason[\"NotSet\"] = 0] = \"NotSet\";\n /**\n * A `model.setValue()` was called.\n */\n CursorChangeReason[CursorChangeReason[\"ContentFlush\"] = 1] = \"ContentFlush\";\n /**\n * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers.\n */\n CursorChangeReason[CursorChangeReason[\"RecoverFromMarkers\"] = 2] = \"RecoverFromMarkers\";\n /**\n * There was an explicit user gesture.\n */\n CursorChangeReason[CursorChangeReason[\"Explicit\"] = 3] = \"Explicit\";\n /**\n * There was a Paste.\n */\n CursorChangeReason[CursorChangeReason[\"Paste\"] = 4] = \"Paste\";\n /**\n * There was an Undo.\n */\n CursorChangeReason[CursorChangeReason[\"Undo\"] = 5] = \"Undo\";\n /**\n * There was a Redo.\n */\n CursorChangeReason[CursorChangeReason[\"Redo\"] = 6] = \"Redo\";\n})(CursorChangeReason || (CursorChangeReason = {}));\n/**\n * The default end of line to use when instantiating models.\n */\nexport var DefaultEndOfLine;\n(function (DefaultEndOfLine) {\n /**\n * Use line feed (\\n) as the end of line character.\n */\n DefaultEndOfLine[DefaultEndOfLine[\"LF\"] = 1] = \"LF\";\n /**\n * Use carriage return and line feed (\\r\\n) as the end of line character.\n */\n DefaultEndOfLine[DefaultEndOfLine[\"CRLF\"] = 2] = \"CRLF\";\n})(DefaultEndOfLine || (DefaultEndOfLine = {}));\n/**\n * A document highlight kind.\n */\nexport var DocumentHighlightKind;\n(function (DocumentHighlightKind) {\n /**\n * A textual occurrence.\n */\n DocumentHighlightKind[DocumentHighlightKind[\"Text\"] = 0] = \"Text\";\n /**\n * Read-access of a symbol, like reading a variable.\n */\n DocumentHighlightKind[DocumentHighlightKind[\"Read\"] = 1] = \"Read\";\n /**\n * Write-access of a symbol, like writing to a variable.\n */\n DocumentHighlightKind[DocumentHighlightKind[\"Write\"] = 2] = \"Write\";\n})(DocumentHighlightKind || (DocumentHighlightKind = {}));\n/**\n * Configuration options for auto indentation in the editor\n */\nexport var EditorAutoIndentStrategy;\n(function (EditorAutoIndentStrategy) {\n EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"None\"] = 0] = \"None\";\n EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Keep\"] = 1] = \"Keep\";\n EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Brackets\"] = 2] = \"Brackets\";\n EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Advanced\"] = 3] = \"Advanced\";\n EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Full\"] = 4] = \"Full\";\n})(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {}));\nexport var EditorOption;\n(function (EditorOption) {\n EditorOption[EditorOption[\"acceptSuggestionOnCommitCharacter\"] = 0] = \"acceptSuggestionOnCommitCharacter\";\n EditorOption[EditorOption[\"acceptSuggestionOnEnter\"] = 1] = \"acceptSuggestionOnEnter\";\n EditorOption[EditorOption[\"accessibilitySupport\"] = 2] = \"accessibilitySupport\";\n EditorOption[EditorOption[\"accessibilityPageSize\"] = 3] = \"accessibilityPageSize\";\n EditorOption[EditorOption[\"ariaLabel\"] = 4] = \"ariaLabel\";\n EditorOption[EditorOption[\"autoClosingBrackets\"] = 5] = \"autoClosingBrackets\";\n EditorOption[EditorOption[\"autoClosingOvertype\"] = 6] = \"autoClosingOvertype\";\n EditorOption[EditorOption[\"autoClosingQuotes\"] = 7] = \"autoClosingQuotes\";\n EditorOption[EditorOption[\"autoIndent\"] = 8] = \"autoIndent\";\n EditorOption[EditorOption[\"automaticLayout\"] = 9] = \"automaticLayout\";\n EditorOption[EditorOption[\"autoSurround\"] = 10] = \"autoSurround\";\n EditorOption[EditorOption[\"codeLens\"] = 11] = \"codeLens\";\n EditorOption[EditorOption[\"colorDecorators\"] = 12] = \"colorDecorators\";\n EditorOption[EditorOption[\"columnSelection\"] = 13] = \"columnSelection\";\n EditorOption[EditorOption[\"comments\"] = 14] = \"comments\";\n EditorOption[EditorOption[\"contextmenu\"] = 15] = \"contextmenu\";\n EditorOption[EditorOption[\"copyWithSyntaxHighlighting\"] = 16] = \"copyWithSyntaxHighlighting\";\n EditorOption[EditorOption[\"cursorBlinking\"] = 17] = \"cursorBlinking\";\n EditorOption[EditorOption[\"cursorSmoothCaretAnimation\"] = 18] = \"cursorSmoothCaretAnimation\";\n EditorOption[EditorOption[\"cursorStyle\"] = 19] = \"cursorStyle\";\n EditorOption[EditorOption[\"cursorSurroundingLines\"] = 20] = \"cursorSurroundingLines\";\n EditorOption[EditorOption[\"cursorSurroundingLinesStyle\"] = 21] = \"cursorSurroundingLinesStyle\";\n EditorOption[EditorOption[\"cursorWidth\"] = 22] = \"cursorWidth\";\n EditorOption[EditorOption[\"disableLayerHinting\"] = 23] = \"disableLayerHinting\";\n EditorOption[EditorOption[\"disableMonospaceOptimizations\"] = 24] = \"disableMonospaceOptimizations\";\n EditorOption[EditorOption[\"dragAndDrop\"] = 25] = \"dragAndDrop\";\n EditorOption[EditorOption[\"emptySelectionClipboard\"] = 26] = \"emptySelectionClipboard\";\n EditorOption[EditorOption[\"extraEditorClassName\"] = 27] = \"extraEditorClassName\";\n EditorOption[EditorOption[\"fastScrollSensitivity\"] = 28] = \"fastScrollSensitivity\";\n EditorOption[EditorOption[\"find\"] = 29] = \"find\";\n EditorOption[EditorOption[\"fixedOverflowWidgets\"] = 30] = \"fixedOverflowWidgets\";\n EditorOption[EditorOption[\"folding\"] = 31] = \"folding\";\n EditorOption[EditorOption[\"foldingStrategy\"] = 32] = \"foldingStrategy\";\n EditorOption[EditorOption[\"foldingHighlight\"] = 33] = \"foldingHighlight\";\n EditorOption[EditorOption[\"unfoldOnClickAfterEndOfLine\"] = 34] = \"unfoldOnClickAfterEndOfLine\";\n EditorOption[EditorOption[\"fontFamily\"] = 35] = \"fontFamily\";\n EditorOption[EditorOption[\"fontInfo\"] = 36] = \"fontInfo\";\n EditorOption[EditorOption[\"fontLigatures\"] = 37] = \"fontLigatures\";\n EditorOption[EditorOption[\"fontSize\"] = 38] = \"fontSize\";\n EditorOption[EditorOption[\"fontWeight\"] = 39] = \"fontWeight\";\n EditorOption[EditorOption[\"formatOnPaste\"] = 40] = \"formatOnPaste\";\n EditorOption[EditorOption[\"formatOnType\"] = 41] = \"formatOnType\";\n EditorOption[EditorOption[\"glyphMargin\"] = 42] = \"glyphMargin\";\n EditorOption[EditorOption[\"gotoLocation\"] = 43] = \"gotoLocation\";\n EditorOption[EditorOption[\"hideCursorInOverviewRuler\"] = 44] = \"hideCursorInOverviewRuler\";\n EditorOption[EditorOption[\"highlightActiveIndentGuide\"] = 45] = \"highlightActiveIndentGuide\";\n EditorOption[EditorOption[\"hover\"] = 46] = \"hover\";\n EditorOption[EditorOption[\"inDiffEditor\"] = 47] = \"inDiffEditor\";\n EditorOption[EditorOption[\"letterSpacing\"] = 48] = \"letterSpacing\";\n EditorOption[EditorOption[\"lightbulb\"] = 49] = \"lightbulb\";\n EditorOption[EditorOption[\"lineDecorationsWidth\"] = 50] = \"lineDecorationsWidth\";\n EditorOption[EditorOption[\"lineHeight\"] = 51] = \"lineHeight\";\n EditorOption[EditorOption[\"lineNumbers\"] = 52] = \"lineNumbers\";\n EditorOption[EditorOption[\"lineNumbersMinChars\"] = 53] = \"lineNumbersMinChars\";\n EditorOption[EditorOption[\"links\"] = 54] = \"links\";\n EditorOption[EditorOption[\"matchBrackets\"] = 55] = \"matchBrackets\";\n EditorOption[EditorOption[\"minimap\"] = 56] = \"minimap\";\n EditorOption[EditorOption[\"mouseStyle\"] = 57] = \"mouseStyle\";\n EditorOption[EditorOption[\"mouseWheelScrollSensitivity\"] = 58] = \"mouseWheelScrollSensitivity\";\n EditorOption[EditorOption[\"mouseWheelZoom\"] = 59] = \"mouseWheelZoom\";\n EditorOption[EditorOption[\"multiCursorMergeOverlapping\"] = 60] = \"multiCursorMergeOverlapping\";\n EditorOption[EditorOption[\"multiCursorModifier\"] = 61] = \"multiCursorModifier\";\n EditorOption[EditorOption[\"multiCursorPaste\"] = 62] = \"multiCursorPaste\";\n EditorOption[EditorOption[\"occurrencesHighlight\"] = 63] = \"occurrencesHighlight\";\n EditorOption[EditorOption[\"overviewRulerBorder\"] = 64] = \"overviewRulerBorder\";\n EditorOption[EditorOption[\"overviewRulerLanes\"] = 65] = \"overviewRulerLanes\";\n EditorOption[EditorOption[\"padding\"] = 66] = \"padding\";\n EditorOption[EditorOption[\"parameterHints\"] = 67] = \"parameterHints\";\n EditorOption[EditorOption[\"peekWidgetDefaultFocus\"] = 68] = \"peekWidgetDefaultFocus\";\n EditorOption[EditorOption[\"definitionLinkOpensInPeek\"] = 69] = \"definitionLinkOpensInPeek\";\n EditorOption[EditorOption[\"quickSuggestions\"] = 70] = \"quickSuggestions\";\n EditorOption[EditorOption[\"quickSuggestionsDelay\"] = 71] = \"quickSuggestionsDelay\";\n EditorOption[EditorOption[\"readOnly\"] = 72] = \"readOnly\";\n EditorOption[EditorOption[\"renameOnType\"] = 73] = \"renameOnType\";\n EditorOption[EditorOption[\"renderControlCharacters\"] = 74] = \"renderControlCharacters\";\n EditorOption[EditorOption[\"renderIndentGuides\"] = 75] = \"renderIndentGuides\";\n EditorOption[EditorOption[\"renderFinalNewline\"] = 76] = \"renderFinalNewline\";\n EditorOption[EditorOption[\"renderLineHighlight\"] = 77] = \"renderLineHighlight\";\n EditorOption[EditorOption[\"renderLineHighlightOnlyWhenFocus\"] = 78] = \"renderLineHighlightOnlyWhenFocus\";\n EditorOption[EditorOption[\"renderValidationDecorations\"] = 79] = \"renderValidationDecorations\";\n EditorOption[EditorOption[\"renderWhitespace\"] = 80] = \"renderWhitespace\";\n EditorOption[EditorOption[\"revealHorizontalRightPadding\"] = 81] = \"revealHorizontalRightPadding\";\n EditorOption[EditorOption[\"roundedSelection\"] = 82] = \"roundedSelection\";\n EditorOption[EditorOption[\"rulers\"] = 83] = \"rulers\";\n EditorOption[EditorOption[\"scrollbar\"] = 84] = \"scrollbar\";\n EditorOption[EditorOption[\"scrollBeyondLastColumn\"] = 85] = \"scrollBeyondLastColumn\";\n EditorOption[EditorOption[\"scrollBeyondLastLine\"] = 86] = \"scrollBeyondLastLine\";\n EditorOption[EditorOption[\"scrollPredominantAxis\"] = 87] = \"scrollPredominantAxis\";\n EditorOption[EditorOption[\"selectionClipboard\"] = 88] = \"selectionClipboard\";\n EditorOption[EditorOption[\"selectionHighlight\"] = 89] = \"selectionHighlight\";\n EditorOption[EditorOption[\"selectOnLineNumbers\"] = 90] = \"selectOnLineNumbers\";\n EditorOption[EditorOption[\"showFoldingControls\"] = 91] = \"showFoldingControls\";\n EditorOption[EditorOption[\"showUnused\"] = 92] = \"showUnused\";\n EditorOption[EditorOption[\"snippetSuggestions\"] = 93] = \"snippetSuggestions\";\n EditorOption[EditorOption[\"smoothScrolling\"] = 94] = \"smoothScrolling\";\n EditorOption[EditorOption[\"stopRenderingLineAfter\"] = 95] = \"stopRenderingLineAfter\";\n EditorOption[EditorOption[\"suggest\"] = 96] = \"suggest\";\n EditorOption[EditorOption[\"suggestFontSize\"] = 97] = \"suggestFontSize\";\n EditorOption[EditorOption[\"suggestLineHeight\"] = 98] = \"suggestLineHeight\";\n EditorOption[EditorOption[\"suggestOnTriggerCharacters\"] = 99] = \"suggestOnTriggerCharacters\";\n EditorOption[EditorOption[\"suggestSelection\"] = 100] = \"suggestSelection\";\n EditorOption[EditorOption[\"tabCompletion\"] = 101] = \"tabCompletion\";\n EditorOption[EditorOption[\"tabIndex\"] = 102] = \"tabIndex\";\n EditorOption[EditorOption[\"unusualLineTerminators\"] = 103] = \"unusualLineTerminators\";\n EditorOption[EditorOption[\"useTabStops\"] = 104] = \"useTabStops\";\n EditorOption[EditorOption[\"wordSeparators\"] = 105] = \"wordSeparators\";\n EditorOption[EditorOption[\"wordWrap\"] = 106] = \"wordWrap\";\n EditorOption[EditorOption[\"wordWrapBreakAfterCharacters\"] = 107] = \"wordWrapBreakAfterCharacters\";\n EditorOption[EditorOption[\"wordWrapBreakBeforeCharacters\"] = 108] = \"wordWrapBreakBeforeCharacters\";\n EditorOption[EditorOption[\"wordWrapColumn\"] = 109] = \"wordWrapColumn\";\n EditorOption[EditorOption[\"wordWrapMinified\"] = 110] = \"wordWrapMinified\";\n EditorOption[EditorOption[\"wrappingIndent\"] = 111] = \"wrappingIndent\";\n EditorOption[EditorOption[\"wrappingStrategy\"] = 112] = \"wrappingStrategy\";\n EditorOption[EditorOption[\"showDeprecated\"] = 113] = \"showDeprecated\";\n EditorOption[EditorOption[\"editorClassName\"] = 114] = \"editorClassName\";\n EditorOption[EditorOption[\"pixelRatio\"] = 115] = \"pixelRatio\";\n EditorOption[EditorOption[\"tabFocusMode\"] = 116] = \"tabFocusMode\";\n EditorOption[EditorOption[\"layoutInfo\"] = 117] = \"layoutInfo\";\n EditorOption[EditorOption[\"wrappingInfo\"] = 118] = \"wrappingInfo\";\n})(EditorOption || (EditorOption = {}));\n/**\n * End of line character preference.\n */\nexport var EndOfLinePreference;\n(function (EndOfLinePreference) {\n /**\n * Use the end of line character identified in the text buffer.\n */\n EndOfLinePreference[EndOfLinePreference[\"TextDefined\"] = 0] = \"TextDefined\";\n /**\n * Use line feed (\\n) as the end of line character.\n */\n EndOfLinePreference[EndOfLinePreference[\"LF\"] = 1] = \"LF\";\n /**\n * Use carriage return and line feed (\\r\\n) as the end of line character.\n */\n EndOfLinePreference[EndOfLinePreference[\"CRLF\"] = 2] = \"CRLF\";\n})(EndOfLinePreference || (EndOfLinePreference = {}));\n/**\n * End of line character preference.\n */\nexport var EndOfLineSequence;\n(function (EndOfLineSequence) {\n /**\n * Use line feed (\\n) as the end of line character.\n */\n EndOfLineSequence[EndOfLineSequence[\"LF\"] = 0] = \"LF\";\n /**\n * Use carriage return and line feed (\\r\\n) as the end of line character.\n */\n EndOfLineSequence[EndOfLineSequence[\"CRLF\"] = 1] = \"CRLF\";\n})(EndOfLineSequence || (EndOfLineSequence = {}));\n/**\n * Describes what to do with the indentation when pressing Enter.\n */\nexport var IndentAction;\n(function (IndentAction) {\n /**\n * Insert new line and copy the previous line's indentation.\n */\n IndentAction[IndentAction[\"None\"] = 0] = \"None\";\n /**\n * Insert new line and indent once (relative to the previous line's indentation).\n */\n IndentAction[IndentAction[\"Indent\"] = 1] = \"Indent\";\n /**\n * Insert two new lines:\n * - the first one indented which will hold the cursor\n * - the second one at the same indentation level\n */\n IndentAction[IndentAction[\"IndentOutdent\"] = 2] = \"IndentOutdent\";\n /**\n * Insert new line and outdent once (relative to the previous line's indentation).\n */\n IndentAction[IndentAction[\"Outdent\"] = 3] = \"Outdent\";\n})(IndentAction || (IndentAction = {}));\n/**\n * Virtual Key Codes, the value does not hold any inherent meaning.\n * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\n * But these are \"more general\", as they should work across browsers & OS`s.\n */\nexport var KeyCode;\n(function (KeyCode) {\n /**\n * Placed first to cover the 0 value of the enum.\n */\n KeyCode[KeyCode[\"Unknown\"] = 0] = \"Unknown\";\n KeyCode[KeyCode[\"Backspace\"] = 1] = \"Backspace\";\n KeyCode[KeyCode[\"Tab\"] = 2] = \"Tab\";\n KeyCode[KeyCode[\"Enter\"] = 3] = \"Enter\";\n KeyCode[KeyCode[\"Shift\"] = 4] = \"Shift\";\n KeyCode[KeyCode[\"Ctrl\"] = 5] = \"Ctrl\";\n KeyCode[KeyCode[\"Alt\"] = 6] = \"Alt\";\n KeyCode[KeyCode[\"PauseBreak\"] = 7] = \"PauseBreak\";\n KeyCode[KeyCode[\"CapsLock\"] = 8] = \"CapsLock\";\n KeyCode[KeyCode[\"Escape\"] = 9] = \"Escape\";\n KeyCode[KeyCode[\"Space\"] = 10] = \"Space\";\n KeyCode[KeyCode[\"PageUp\"] = 11] = \"PageUp\";\n KeyCode[KeyCode[\"PageDown\"] = 12] = \"PageDown\";\n KeyCode[KeyCode[\"End\"] = 13] = \"End\";\n KeyCode[KeyCode[\"Home\"] = 14] = \"Home\";\n KeyCode[KeyCode[\"LeftArrow\"] = 15] = \"LeftArrow\";\n KeyCode[KeyCode[\"UpArrow\"] = 16] = \"UpArrow\";\n KeyCode[KeyCode[\"RightArrow\"] = 17] = \"RightArrow\";\n KeyCode[KeyCode[\"DownArrow\"] = 18] = \"DownArrow\";\n KeyCode[KeyCode[\"Insert\"] = 19] = \"Insert\";\n KeyCode[KeyCode[\"Delete\"] = 20] = \"Delete\";\n KeyCode[KeyCode[\"KEY_0\"] = 21] = \"KEY_0\";\n KeyCode[KeyCode[\"KEY_1\"] = 22] = \"KEY_1\";\n KeyCode[KeyCode[\"KEY_2\"] = 23] = \"KEY_2\";\n KeyCode[KeyCode[\"KEY_3\"] = 24] = \"KEY_3\";\n KeyCode[KeyCode[\"KEY_4\"] = 25] = \"KEY_4\";\n KeyCode[KeyCode[\"KEY_5\"] = 26] = \"KEY_5\";\n KeyCode[KeyCode[\"KEY_6\"] = 27] = \"KEY_6\";\n KeyCode[KeyCode[\"KEY_7\"] = 28] = \"KEY_7\";\n KeyCode[KeyCode[\"KEY_8\"] = 29] = \"KEY_8\";\n KeyCode[KeyCode[\"KEY_9\"] = 30] = \"KEY_9\";\n KeyCode[KeyCode[\"KEY_A\"] = 31] = \"KEY_A\";\n KeyCode[KeyCode[\"KEY_B\"] = 32] = \"KEY_B\";\n KeyCode[KeyCode[\"KEY_C\"] = 33] = \"KEY_C\";\n KeyCode[KeyCode[\"KEY_D\"] = 34] = \"KEY_D\";\n KeyCode[KeyCode[\"KEY_E\"] = 35] = \"KEY_E\";\n KeyCode[KeyCode[\"KEY_F\"] = 36] = \"KEY_F\";\n KeyCode[KeyCode[\"KEY_G\"] = 37] = \"KEY_G\";\n KeyCode[KeyCode[\"KEY_H\"] = 38] = \"KEY_H\";\n KeyCode[KeyCode[\"KEY_I\"] = 39] = \"KEY_I\";\n KeyCode[KeyCode[\"KEY_J\"] = 40] = \"KEY_J\";\n KeyCode[KeyCode[\"KEY_K\"] = 41] = \"KEY_K\";\n KeyCode[KeyCode[\"KEY_L\"] = 42] = \"KEY_L\";\n KeyCode[KeyCode[\"KEY_M\"] = 43] = \"KEY_M\";\n KeyCode[KeyCode[\"KEY_N\"] = 44] = \"KEY_N\";\n KeyCode[KeyCode[\"KEY_O\"] = 45] = \"KEY_O\";\n KeyCode[KeyCode[\"KEY_P\"] = 46] = \"KEY_P\";\n KeyCode[KeyCode[\"KEY_Q\"] = 47] = \"KEY_Q\";\n KeyCode[KeyCode[\"KEY_R\"] = 48] = \"KEY_R\";\n KeyCode[KeyCode[\"KEY_S\"] = 49] = \"KEY_S\";\n KeyCode[KeyCode[\"KEY_T\"] = 50] = \"KEY_T\";\n KeyCode[KeyCode[\"KEY_U\"] = 51] = \"KEY_U\";\n KeyCode[KeyCode[\"KEY_V\"] = 52] = \"KEY_V\";\n KeyCode[KeyCode[\"KEY_W\"] = 53] = \"KEY_W\";\n KeyCode[KeyCode[\"KEY_X\"] = 54] = \"KEY_X\";\n KeyCode[KeyCode[\"KEY_Y\"] = 55] = \"KEY_Y\";\n KeyCode[KeyCode[\"KEY_Z\"] = 56] = \"KEY_Z\";\n KeyCode[KeyCode[\"Meta\"] = 57] = \"Meta\";\n KeyCode[KeyCode[\"ContextMenu\"] = 58] = \"ContextMenu\";\n KeyCode[KeyCode[\"F1\"] = 59] = \"F1\";\n KeyCode[KeyCode[\"F2\"] = 60] = \"F2\";\n KeyCode[KeyCode[\"F3\"] = 61] = \"F3\";\n KeyCode[KeyCode[\"F4\"] = 62] = \"F4\";\n KeyCode[KeyCode[\"F5\"] = 63] = \"F5\";\n KeyCode[KeyCode[\"F6\"] = 64] = \"F6\";\n KeyCode[KeyCode[\"F7\"] = 65] = \"F7\";\n KeyCode[KeyCode[\"F8\"] = 66] = \"F8\";\n KeyCode[KeyCode[\"F9\"] = 67] = \"F9\";\n KeyCode[KeyCode[\"F10\"] = 68] = \"F10\";\n KeyCode[KeyCode[\"F11\"] = 69] = \"F11\";\n KeyCode[KeyCode[\"F12\"] = 70] = \"F12\";\n KeyCode[KeyCode[\"F13\"] = 71] = \"F13\";\n KeyCode[KeyCode[\"F14\"] = 72] = \"F14\";\n KeyCode[KeyCode[\"F15\"] = 73] = \"F15\";\n KeyCode[KeyCode[\"F16\"] = 74] = \"F16\";\n KeyCode[KeyCode[\"F17\"] = 75] = \"F17\";\n KeyCode[KeyCode[\"F18\"] = 76] = \"F18\";\n KeyCode[KeyCode[\"F19\"] = 77] = \"F19\";\n KeyCode[KeyCode[\"NumLock\"] = 78] = \"NumLock\";\n KeyCode[KeyCode[\"ScrollLock\"] = 79] = \"ScrollLock\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the ';:' key\n */\n KeyCode[KeyCode[\"US_SEMICOLON\"] = 80] = \"US_SEMICOLON\";\n /**\n * For any country/region, the '+' key\n * For the US standard keyboard, the '=+' key\n */\n KeyCode[KeyCode[\"US_EQUAL\"] = 81] = \"US_EQUAL\";\n /**\n * For any country/region, the ',' key\n * For the US standard keyboard, the ',<' key\n */\n KeyCode[KeyCode[\"US_COMMA\"] = 82] = \"US_COMMA\";\n /**\n * For any country/region, the '-' key\n * For the US standard keyboard, the '-_' key\n */\n KeyCode[KeyCode[\"US_MINUS\"] = 83] = \"US_MINUS\";\n /**\n * For any country/region, the '.' key\n * For the US standard keyboard, the '.>' key\n */\n KeyCode[KeyCode[\"US_DOT\"] = 84] = \"US_DOT\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the '/?' key\n */\n KeyCode[KeyCode[\"US_SLASH\"] = 85] = \"US_SLASH\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the '`~' key\n */\n KeyCode[KeyCode[\"US_BACKTICK\"] = 86] = \"US_BACKTICK\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the '[{' key\n */\n KeyCode[KeyCode[\"US_OPEN_SQUARE_BRACKET\"] = 87] = \"US_OPEN_SQUARE_BRACKET\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the '\\|' key\n */\n KeyCode[KeyCode[\"US_BACKSLASH\"] = 88] = \"US_BACKSLASH\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the ']}' key\n */\n KeyCode[KeyCode[\"US_CLOSE_SQUARE_BRACKET\"] = 89] = \"US_CLOSE_SQUARE_BRACKET\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the ''\"' key\n */\n KeyCode[KeyCode[\"US_QUOTE\"] = 90] = \"US_QUOTE\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n */\n KeyCode[KeyCode[\"OEM_8\"] = 91] = \"OEM_8\";\n /**\n * Either the angle bracket key or the backslash key on the RT 102-key keyboard.\n */\n KeyCode[KeyCode[\"OEM_102\"] = 92] = \"OEM_102\";\n KeyCode[KeyCode[\"NUMPAD_0\"] = 93] = \"NUMPAD_0\";\n KeyCode[KeyCode[\"NUMPAD_1\"] = 94] = \"NUMPAD_1\";\n KeyCode[KeyCode[\"NUMPAD_2\"] = 95] = \"NUMPAD_2\";\n KeyCode[KeyCode[\"NUMPAD_3\"] = 96] = \"NUMPAD_3\";\n KeyCode[KeyCode[\"NUMPAD_4\"] = 97] = \"NUMPAD_4\";\n KeyCode[KeyCode[\"NUMPAD_5\"] = 98] = \"NUMPAD_5\";\n KeyCode[KeyCode[\"NUMPAD_6\"] = 99] = \"NUMPAD_6\";\n KeyCode[KeyCode[\"NUMPAD_7\"] = 100] = \"NUMPAD_7\";\n KeyCode[KeyCode[\"NUMPAD_8\"] = 101] = \"NUMPAD_8\";\n KeyCode[KeyCode[\"NUMPAD_9\"] = 102] = \"NUMPAD_9\";\n KeyCode[KeyCode[\"NUMPAD_MULTIPLY\"] = 103] = \"NUMPAD_MULTIPLY\";\n KeyCode[KeyCode[\"NUMPAD_ADD\"] = 104] = \"NUMPAD_ADD\";\n KeyCode[KeyCode[\"NUMPAD_SEPARATOR\"] = 105] = \"NUMPAD_SEPARATOR\";\n KeyCode[KeyCode[\"NUMPAD_SUBTRACT\"] = 106] = \"NUMPAD_SUBTRACT\";\n KeyCode[KeyCode[\"NUMPAD_DECIMAL\"] = 107] = \"NUMPAD_DECIMAL\";\n KeyCode[KeyCode[\"NUMPAD_DIVIDE\"] = 108] = \"NUMPAD_DIVIDE\";\n /**\n * Cover all key codes when IME is processing input.\n */\n KeyCode[KeyCode[\"KEY_IN_COMPOSITION\"] = 109] = \"KEY_IN_COMPOSITION\";\n KeyCode[KeyCode[\"ABNT_C1\"] = 110] = \"ABNT_C1\";\n KeyCode[KeyCode[\"ABNT_C2\"] = 111] = \"ABNT_C2\";\n /**\n * Placed last to cover the length of the enum.\n * Please do not depend on this value!\n */\n KeyCode[KeyCode[\"MAX_VALUE\"] = 112] = \"MAX_VALUE\";\n})(KeyCode || (KeyCode = {}));\nexport var MarkerSeverity;\n(function (MarkerSeverity) {\n MarkerSeverity[MarkerSeverity[\"Hint\"] = 1] = \"Hint\";\n MarkerSeverity[MarkerSeverity[\"Info\"] = 2] = \"Info\";\n MarkerSeverity[MarkerSeverity[\"Warning\"] = 4] = \"Warning\";\n MarkerSeverity[MarkerSeverity[\"Error\"] = 8] = \"Error\";\n})(MarkerSeverity || (MarkerSeverity = {}));\nexport var MarkerTag;\n(function (MarkerTag) {\n MarkerTag[MarkerTag[\"Unnecessary\"] = 1] = \"Unnecessary\";\n MarkerTag[MarkerTag[\"Deprecated\"] = 2] = \"Deprecated\";\n})(MarkerTag || (MarkerTag = {}));\n/**\n * Position in the minimap to render the decoration.\n */\nexport var MinimapPosition;\n(function (MinimapPosition) {\n MinimapPosition[MinimapPosition[\"Inline\"] = 1] = \"Inline\";\n MinimapPosition[MinimapPosition[\"Gutter\"] = 2] = \"Gutter\";\n})(MinimapPosition || (MinimapPosition = {}));\n/**\n * Type of hit element with the mouse in the editor.\n */\nexport var MouseTargetType;\n(function (MouseTargetType) {\n /**\n * Mouse is on top of an unknown element.\n */\n MouseTargetType[MouseTargetType[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /**\n * Mouse is on top of the textarea used for input.\n */\n MouseTargetType[MouseTargetType[\"TEXTAREA\"] = 1] = \"TEXTAREA\";\n /**\n * Mouse is on top of the glyph margin\n */\n MouseTargetType[MouseTargetType[\"GUTTER_GLYPH_MARGIN\"] = 2] = \"GUTTER_GLYPH_MARGIN\";\n /**\n * Mouse is on top of the line numbers\n */\n MouseTargetType[MouseTargetType[\"GUTTER_LINE_NUMBERS\"] = 3] = \"GUTTER_LINE_NUMBERS\";\n /**\n * Mouse is on top of the line decorations\n */\n MouseTargetType[MouseTargetType[\"GUTTER_LINE_DECORATIONS\"] = 4] = \"GUTTER_LINE_DECORATIONS\";\n /**\n * Mouse is on top of the whitespace left in the gutter by a view zone.\n */\n MouseTargetType[MouseTargetType[\"GUTTER_VIEW_ZONE\"] = 5] = \"GUTTER_VIEW_ZONE\";\n /**\n * Mouse is on top of text in the content.\n */\n MouseTargetType[MouseTargetType[\"CONTENT_TEXT\"] = 6] = \"CONTENT_TEXT\";\n /**\n * Mouse is on top of empty space in the content (e.g. after line text or below last line)\n */\n MouseTargetType[MouseTargetType[\"CONTENT_EMPTY\"] = 7] = \"CONTENT_EMPTY\";\n /**\n * Mouse is on top of a view zone in the content.\n */\n MouseTargetType[MouseTargetType[\"CONTENT_VIEW_ZONE\"] = 8] = \"CONTENT_VIEW_ZONE\";\n /**\n * Mouse is on top of a content widget.\n */\n MouseTargetType[MouseTargetType[\"CONTENT_WIDGET\"] = 9] = \"CONTENT_WIDGET\";\n /**\n * Mouse is on top of the decorations overview ruler.\n */\n MouseTargetType[MouseTargetType[\"OVERVIEW_RULER\"] = 10] = \"OVERVIEW_RULER\";\n /**\n * Mouse is on top of a scrollbar.\n */\n MouseTargetType[MouseTargetType[\"SCROLLBAR\"] = 11] = \"SCROLLBAR\";\n /**\n * Mouse is on top of an overlay widget.\n */\n MouseTargetType[MouseTargetType[\"OVERLAY_WIDGET\"] = 12] = \"OVERLAY_WIDGET\";\n /**\n * Mouse is outside of the editor.\n */\n MouseTargetType[MouseTargetType[\"OUTSIDE_EDITOR\"] = 13] = \"OUTSIDE_EDITOR\";\n})(MouseTargetType || (MouseTargetType = {}));\n/**\n * A positioning preference for rendering overlay widgets.\n */\nexport var OverlayWidgetPositionPreference;\n(function (OverlayWidgetPositionPreference) {\n /**\n * Position the overlay widget in the top right corner\n */\n OverlayWidgetPositionPreference[OverlayWidgetPositionPreference[\"TOP_RIGHT_CORNER\"] = 0] = \"TOP_RIGHT_CORNER\";\n /**\n * Position the overlay widget in the bottom right corner\n */\n OverlayWidgetPositionPreference[OverlayWidgetPositionPreference[\"BOTTOM_RIGHT_CORNER\"] = 1] = \"BOTTOM_RIGHT_CORNER\";\n /**\n * Position the overlay widget in the top center\n */\n OverlayWidgetPositionPreference[OverlayWidgetPositionPreference[\"TOP_CENTER\"] = 2] = \"TOP_CENTER\";\n})(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {}));\n/**\n * Vertical Lane in the overview ruler of the editor.\n */\nexport var OverviewRulerLane;\n(function (OverviewRulerLane) {\n OverviewRulerLane[OverviewRulerLane[\"Left\"] = 1] = \"Left\";\n OverviewRulerLane[OverviewRulerLane[\"Center\"] = 2] = \"Center\";\n OverviewRulerLane[OverviewRulerLane[\"Right\"] = 4] = \"Right\";\n OverviewRulerLane[OverviewRulerLane[\"Full\"] = 7] = \"Full\";\n})(OverviewRulerLane || (OverviewRulerLane = {}));\nexport var RenderLineNumbersType;\n(function (RenderLineNumbersType) {\n RenderLineNumbersType[RenderLineNumbersType[\"Off\"] = 0] = \"Off\";\n RenderLineNumbersType[RenderLineNumbersType[\"On\"] = 1] = \"On\";\n RenderLineNumbersType[RenderLineNumbersType[\"Relative\"] = 2] = \"Relative\";\n RenderLineNumbersType[RenderLineNumbersType[\"Interval\"] = 3] = \"Interval\";\n RenderLineNumbersType[RenderLineNumbersType[\"Custom\"] = 4] = \"Custom\";\n})(RenderLineNumbersType || (RenderLineNumbersType = {}));\nexport var RenderMinimap;\n(function (RenderMinimap) {\n RenderMinimap[RenderMinimap[\"None\"] = 0] = \"None\";\n RenderMinimap[RenderMinimap[\"Text\"] = 1] = \"Text\";\n RenderMinimap[RenderMinimap[\"Blocks\"] = 2] = \"Blocks\";\n})(RenderMinimap || (RenderMinimap = {}));\nexport var ScrollType;\n(function (ScrollType) {\n ScrollType[ScrollType[\"Smooth\"] = 0] = \"Smooth\";\n ScrollType[ScrollType[\"Immediate\"] = 1] = \"Immediate\";\n})(ScrollType || (ScrollType = {}));\nexport var ScrollbarVisibility;\n(function (ScrollbarVisibility) {\n ScrollbarVisibility[ScrollbarVisibility[\"Auto\"] = 1] = \"Auto\";\n ScrollbarVisibility[ScrollbarVisibility[\"Hidden\"] = 2] = \"Hidden\";\n ScrollbarVisibility[ScrollbarVisibility[\"Visible\"] = 3] = \"Visible\";\n})(ScrollbarVisibility || (ScrollbarVisibility = {}));\n/**\n * The direction of a selection.\n */\nexport var SelectionDirection;\n(function (SelectionDirection) {\n /**\n * The selection starts above where it ends.\n */\n SelectionDirection[SelectionDirection[\"LTR\"] = 0] = \"LTR\";\n /**\n * The selection starts below where it ends.\n */\n SelectionDirection[SelectionDirection[\"RTL\"] = 1] = \"RTL\";\n})(SelectionDirection || (SelectionDirection = {}));\nexport var SignatureHelpTriggerKind;\n(function (SignatureHelpTriggerKind) {\n SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"Invoke\"] = 1] = \"Invoke\";\n SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"TriggerCharacter\"] = 2] = \"TriggerCharacter\";\n SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"ContentChange\"] = 3] = \"ContentChange\";\n})(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {}));\n/**\n * A symbol kind.\n */\nexport var SymbolKind;\n(function (SymbolKind) {\n SymbolKind[SymbolKind[\"File\"] = 0] = \"File\";\n SymbolKind[SymbolKind[\"Module\"] = 1] = \"Module\";\n SymbolKind[SymbolKind[\"Namespace\"] = 2] = \"Namespace\";\n SymbolKind[SymbolKind[\"Package\"] = 3] = \"Package\";\n SymbolKind[SymbolKind[\"Class\"] = 4] = \"Class\";\n SymbolKind[SymbolKind[\"Method\"] = 5] = \"Method\";\n SymbolKind[SymbolKind[\"Property\"] = 6] = \"Property\";\n SymbolKind[SymbolKind[\"Field\"] = 7] = \"Field\";\n SymbolKind[SymbolKind[\"Constructor\"] = 8] = \"Constructor\";\n SymbolKind[SymbolKind[\"Enum\"] = 9] = \"Enum\";\n SymbolKind[SymbolKind[\"Interface\"] = 10] = \"Interface\";\n SymbolKind[SymbolKind[\"Function\"] = 11] = \"Function\";\n SymbolKind[SymbolKind[\"Variable\"] = 12] = \"Variable\";\n SymbolKind[SymbolKind[\"Constant\"] = 13] = \"Constant\";\n SymbolKind[SymbolKind[\"String\"] = 14] = \"String\";\n SymbolKind[SymbolKind[\"Number\"] = 15] = \"Number\";\n SymbolKind[SymbolKind[\"Boolean\"] = 16] = \"Boolean\";\n SymbolKind[SymbolKind[\"Array\"] = 17] = \"Array\";\n SymbolKind[SymbolKind[\"Object\"] = 18] = \"Object\";\n SymbolKind[SymbolKind[\"Key\"] = 19] = \"Key\";\n SymbolKind[SymbolKind[\"Null\"] = 20] = \"Null\";\n SymbolKind[SymbolKind[\"EnumMember\"] = 21] = \"EnumMember\";\n SymbolKind[SymbolKind[\"Struct\"] = 22] = \"Struct\";\n SymbolKind[SymbolKind[\"Event\"] = 23] = \"Event\";\n SymbolKind[SymbolKind[\"Operator\"] = 24] = \"Operator\";\n SymbolKind[SymbolKind[\"TypeParameter\"] = 25] = \"TypeParameter\";\n})(SymbolKind || (SymbolKind = {}));\nexport var SymbolTag;\n(function (SymbolTag) {\n SymbolTag[SymbolTag[\"Deprecated\"] = 1] = \"Deprecated\";\n})(SymbolTag || (SymbolTag = {}));\n/**\n * The kind of animation in which the editor's cursor should be rendered.\n */\nexport var TextEditorCursorBlinkingStyle;\n(function (TextEditorCursorBlinkingStyle) {\n /**\n * Hidden\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Hidden\"] = 0] = \"Hidden\";\n /**\n * Blinking\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Blink\"] = 1] = \"Blink\";\n /**\n * Blinking with smooth fading\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Smooth\"] = 2] = \"Smooth\";\n /**\n * Blinking with prolonged filled state and smooth fading\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Phase\"] = 3] = \"Phase\";\n /**\n * Expand collapse animation on the y axis\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Expand\"] = 4] = \"Expand\";\n /**\n * No-Blinking\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Solid\"] = 5] = \"Solid\";\n})(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {}));\n/**\n * The style in which the editor's cursor should be rendered.\n */\nexport var TextEditorCursorStyle;\n(function (TextEditorCursorStyle) {\n /**\n * As a vertical line (sitting between two characters).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"Line\"] = 1] = \"Line\";\n /**\n * As a block (sitting on top of a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"Block\"] = 2] = \"Block\";\n /**\n * As a horizontal line (sitting under a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"Underline\"] = 3] = \"Underline\";\n /**\n * As a thin vertical line (sitting between two characters).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"LineThin\"] = 4] = \"LineThin\";\n /**\n * As an outlined block (sitting on top of a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"BlockOutline\"] = 5] = \"BlockOutline\";\n /**\n * As a thin horizontal line (sitting under a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"UnderlineThin\"] = 6] = \"UnderlineThin\";\n})(TextEditorCursorStyle || (TextEditorCursorStyle = {}));\n/**\n * Describes the behavior of decorations when typing/editing near their edges.\n * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`\n */\nexport var TrackedRangeStickiness;\n(function (TrackedRangeStickiness) {\n TrackedRangeStickiness[TrackedRangeStickiness[\"AlwaysGrowsWhenTypingAtEdges\"] = 0] = \"AlwaysGrowsWhenTypingAtEdges\";\n TrackedRangeStickiness[TrackedRangeStickiness[\"NeverGrowsWhenTypingAtEdges\"] = 1] = \"NeverGrowsWhenTypingAtEdges\";\n TrackedRangeStickiness[TrackedRangeStickiness[\"GrowsOnlyWhenTypingBefore\"] = 2] = \"GrowsOnlyWhenTypingBefore\";\n TrackedRangeStickiness[TrackedRangeStickiness[\"GrowsOnlyWhenTypingAfter\"] = 3] = \"GrowsOnlyWhenTypingAfter\";\n})(TrackedRangeStickiness || (TrackedRangeStickiness = {}));\n/**\n * Describes how to indent wrapped lines.\n */\nexport var WrappingIndent;\n(function (WrappingIndent) {\n /**\n * No indentation => wrapped lines begin at column 1.\n */\n WrappingIndent[WrappingIndent[\"None\"] = 0] = \"None\";\n /**\n * Same => wrapped lines get the same indentation as the parent.\n */\n WrappingIndent[WrappingIndent[\"Same\"] = 1] = \"Same\";\n /**\n * Indent => wrapped lines get +1 indentation toward the parent.\n */\n WrappingIndent[WrappingIndent[\"Indent\"] = 2] = \"Indent\";\n /**\n * DeepIndent => wrapped lines get +2 indentation toward the parent.\n */\n WrappingIndent[WrappingIndent[\"DeepIndent\"] = 3] = \"DeepIndent\";\n})(WrappingIndent || (WrappingIndent = {}));\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { toUint32 } from '../../../base/common/uint.js';\nexport class PrefixSumIndexOfResult {\n constructor(index, remainder) {\n this.index = index;\n this.remainder = remainder;\n }\n}\nexport class PrefixSumComputer {\n constructor(values) {\n this.values = values;\n this.prefixSum = new Uint32Array(values.length);\n this.prefixSumValidIndex = new Int32Array(1);\n this.prefixSumValidIndex[0] = -1;\n }\n insertValues(insertIndex, insertValues) {\n insertIndex = toUint32(insertIndex);\n const oldValues = this.values;\n const oldPrefixSum = this.prefixSum;\n const insertValuesLen = insertValues.length;\n if (insertValuesLen === 0) {\n return false;\n }\n this.values = new Uint32Array(oldValues.length + insertValuesLen);\n this.values.set(oldValues.subarray(0, insertIndex), 0);\n this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);\n this.values.set(insertValues, insertIndex);\n if (insertIndex - 1 < this.prefixSumValidIndex[0]) {\n this.prefixSumValidIndex[0] = insertIndex - 1;\n }\n this.prefixSum = new Uint32Array(this.values.length);\n if (this.prefixSumValidIndex[0] >= 0) {\n this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\n }\n return true;\n }\n changeValue(index, value) {\n index = toUint32(index);\n value = toUint32(value);\n if (this.values[index] === value) {\n return false;\n }\n this.values[index] = value;\n if (index - 1 < this.prefixSumValidIndex[0]) {\n this.prefixSumValidIndex[0] = index - 1;\n }\n return true;\n }\n removeValues(startIndex, cnt) {\n startIndex = toUint32(startIndex);\n cnt = toUint32(cnt);\n const oldValues = this.values;\n const oldPrefixSum = this.prefixSum;\n if (startIndex >= oldValues.length) {\n return false;\n }\n let maxCnt = oldValues.length - startIndex;\n if (cnt >= maxCnt) {\n cnt = maxCnt;\n }\n if (cnt === 0) {\n return false;\n }\n this.values = new Uint32Array(oldValues.length - cnt);\n this.values.set(oldValues.subarray(0, startIndex), 0);\n this.values.set(oldValues.subarray(startIndex + cnt), startIndex);\n this.prefixSum = new Uint32Array(this.values.length);\n if (startIndex - 1 < this.prefixSumValidIndex[0]) {\n this.prefixSumValidIndex[0] = startIndex - 1;\n }\n if (this.prefixSumValidIndex[0] >= 0) {\n this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\n }\n return true;\n }\n getTotalValue() {\n if (this.values.length === 0) {\n return 0;\n }\n return this._getAccumulatedValue(this.values.length - 1);\n }\n getAccumulatedValue(index) {\n if (index < 0) {\n return 0;\n }\n index = toUint32(index);\n return this._getAccumulatedValue(index);\n }\n _getAccumulatedValue(index) {\n if (index <= this.prefixSumValidIndex[0]) {\n return this.prefixSum[index];\n }\n let startIndex = this.prefixSumValidIndex[0] + 1;\n if (startIndex === 0) {\n this.prefixSum[0] = this.values[0];\n startIndex++;\n }\n if (index >= this.values.length) {\n index = this.values.length - 1;\n }\n for (let i = startIndex; i <= index; i++) {\n this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];\n }\n this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);\n return this.prefixSum[index];\n }\n getIndexOf(accumulatedValue) {\n accumulatedValue = Math.floor(accumulatedValue); //@perf\n // Compute all sums (to get a fully valid prefixSum)\n this.getTotalValue();\n let low = 0;\n let high = this.values.length - 1;\n let mid = 0;\n let midStop = 0;\n let midStart = 0;\n while (low <= high) {\n mid = low + ((high - low) / 2) | 0;\n midStop = this.prefixSum[mid];\n midStart = midStop - this.values[mid];\n if (accumulatedValue < midStart) {\n high = mid - 1;\n }\n else if (accumulatedValue >= midStop) {\n low = mid + 1;\n }\n else {\n break;\n }\n }\n return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart);\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { SimpleWorkerServer } from '../base/common/worker/simpleWorker.js';\nimport { EditorSimpleWorker } from './common/services/editorSimpleWorker.js';\nlet initialized = false;\nexport function initialize(foreignModule) {\n if (initialized) {\n return;\n }\n initialized = true;\n const simpleWorker = new SimpleWorkerServer((msg) => {\n self.postMessage(msg);\n }, (host) => new EditorSimpleWorker(host, foreignModule));\n self.onmessage = (e) => {\n simpleWorker.onmessage(e.data);\n };\n}\nself.onmessage = (e) => {\n // Ignore first message in this case and initialize if not yet initialized\n if (!initialized) {\n initialize(null);\n }\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n'use strict';\nimport { format, isEOL } from './format.js';\nimport { parseTree, findNodeAtLocation } from './parser.js';\nexport function removeProperty(text, path, options) {\n return setProperty(text, path, void 0, options);\n}\nexport function setProperty(text, originalPath, value, options) {\n var _a;\n var path = originalPath.slice();\n var errors = [];\n var root = parseTree(text, errors);\n var parent = void 0;\n var lastSegment = void 0;\n while (path.length > 0) {\n lastSegment = path.pop();\n parent = findNodeAtLocation(root, path);\n if (parent === void 0 && value !== void 0) {\n if (typeof lastSegment === 'string') {\n value = (_a = {}, _a[lastSegment] = value, _a);\n }\n else {\n value = [value];\n }\n }\n else {\n break;\n }\n }\n if (!parent) {\n // empty document\n if (value === void 0) { // delete\n throw new Error('Can not delete in empty document');\n }\n return withFormatting(text, { offset: root ? root.offset : 0, length: root ? root.length : 0, content: JSON.stringify(value) }, options);\n }\n else if (parent.type === 'object' && typeof lastSegment === 'string' && Array.isArray(parent.children)) {\n var existing = findNodeAtLocation(parent, [lastSegment]);\n if (existing !== void 0) {\n if (value === void 0) { // delete\n if (!existing.parent) {\n throw new Error('Malformed AST');\n }\n var propertyIndex = parent.children.indexOf(existing.parent);\n var removeBegin = void 0;\n var removeEnd = existing.parent.offset + existing.parent.length;\n if (propertyIndex > 0) {\n // remove the comma of the previous node\n var previous = parent.children[propertyIndex - 1];\n removeBegin = previous.offset + previous.length;\n }\n else {\n removeBegin = parent.offset + 1;\n if (parent.children.length > 1) {\n // remove the comma of the next node\n var next = parent.children[1];\n removeEnd = next.offset;\n }\n }\n return withFormatting(text, { offset: removeBegin, length: removeEnd - removeBegin, content: '' }, options);\n }\n else {\n // set value of existing property\n return withFormatting(text, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, options);\n }\n }\n else {\n if (value === void 0) { // delete\n return []; // property does not exist, nothing to do\n }\n var newProperty = JSON.stringify(lastSegment) + \": \" + JSON.stringify(value);\n var index = options.getInsertionIndex ? options.getInsertionIndex(parent.children.map(function (p) { return p.children[0].value; })) : parent.children.length;\n var edit = void 0;\n if (index > 0) {\n var previous = parent.children[index - 1];\n edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty };\n }\n else if (parent.children.length === 0) {\n edit = { offset: parent.offset + 1, length: 0, content: newProperty };\n }\n else {\n edit = { offset: parent.offset + 1, length: 0, content: newProperty + ',' };\n }\n return withFormatting(text, edit, options);\n }\n }\n else if (parent.type === 'array' && typeof lastSegment === 'number' && Array.isArray(parent.children)) {\n var insertIndex = lastSegment;\n if (insertIndex === -1) {\n // Insert\n var newProperty = \"\" + JSON.stringify(value);\n var edit = void 0;\n if (parent.children.length === 0) {\n edit = { offset: parent.offset + 1, length: 0, content: newProperty };\n }\n else {\n var previous = parent.children[parent.children.length - 1];\n edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty };\n }\n return withFormatting(text, edit, options);\n }\n else if (value === void 0 && parent.children.length >= 0) {\n // Removal\n var removalIndex = lastSegment;\n var toRemove = parent.children[removalIndex];\n var edit = void 0;\n if (parent.children.length === 1) {\n // only item\n edit = { offset: parent.offset + 1, length: parent.length - 2, content: '' };\n }\n else if (parent.children.length - 1 === removalIndex) {\n // last item\n var previous = parent.children[removalIndex - 1];\n var offset = previous.offset + previous.length;\n var parentEndOffset = parent.offset + parent.length;\n edit = { offset: offset, length: parentEndOffset - 2 - offset, content: '' };\n }\n else {\n edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: '' };\n }\n return withFormatting(text, edit, options);\n }\n else if (value !== void 0) {\n var edit = void 0;\n var newProperty = \"\" + JSON.stringify(value);\n if (!options.isArrayInsertion && parent.children.length > lastSegment) {\n var toModify = parent.children[lastSegment];\n edit = { offset: toModify.offset, length: toModify.length, content: newProperty };\n }\n else if (parent.children.length === 0 || lastSegment === 0) {\n edit = { offset: parent.offset + 1, length: 0, content: parent.children.length === 0 ? newProperty : newProperty + ',' };\n }\n else {\n var index = lastSegment > parent.children.length ? parent.children.length : lastSegment;\n var previous = parent.children[index - 1];\n edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty };\n }\n return withFormatting(text, edit, options);\n }\n else {\n throw new Error(\"Can not \" + (value === void 0 ? 'remove' : (options.isArrayInsertion ? 'insert' : 'modify')) + \" Array index \" + insertIndex + \" as length is not sufficient\");\n }\n }\n else {\n throw new Error(\"Can not add \" + (typeof lastSegment !== 'number' ? 'index' : 'property') + \" to parent of type \" + parent.type);\n }\n}\nfunction withFormatting(text, edit, options) {\n if (!options.formattingOptions) {\n return [edit];\n }\n // apply the edit\n var newText = applyEdit(text, edit);\n // format the new text\n var begin = edit.offset;\n var end = edit.offset + edit.content.length;\n if (edit.length === 0 || edit.content.length === 0) { // insert or remove\n while (begin > 0 && !isEOL(newText, begin - 1)) {\n begin--;\n }\n while (end < newText.length && !isEOL(newText, end)) {\n end++;\n }\n }\n var edits = format(newText, { offset: begin, length: end - begin }, options.formattingOptions);\n // apply the formatting edits and track the begin and end offsets of the changes\n for (var i = edits.length - 1; i >= 0; i--) {\n var edit_1 = edits[i];\n newText = applyEdit(newText, edit_1);\n begin = Math.min(begin, edit_1.offset);\n end = Math.max(end, edit_1.offset + edit_1.length);\n end += edit_1.content.length - edit_1.length;\n }\n // create a single edit with all changes\n var editLength = text.length - (newText.length - end) - begin;\n return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }];\n}\nexport function applyEdit(text, edit) {\n return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length);\n}\nexport function isWS(text, offset) {\n return '\\r\\n \\t'.indexOf(text.charAt(offset)) !== -1;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n'use strict';\nimport { createScanner } from './scanner.js';\nexport function format(documentText, range, options) {\n var initialIndentLevel;\n var formatText;\n var formatTextStart;\n var rangeStart;\n var rangeEnd;\n if (range) {\n rangeStart = range.offset;\n rangeEnd = rangeStart + range.length;\n formatTextStart = rangeStart;\n while (formatTextStart > 0 && !isEOL(documentText, formatTextStart - 1)) {\n formatTextStart--;\n }\n var endOffset = rangeEnd;\n while (endOffset < documentText.length && !isEOL(documentText, endOffset)) {\n endOffset++;\n }\n formatText = documentText.substring(formatTextStart, endOffset);\n initialIndentLevel = computeIndentLevel(formatText, options);\n }\n else {\n formatText = documentText;\n initialIndentLevel = 0;\n formatTextStart = 0;\n rangeStart = 0;\n rangeEnd = documentText.length;\n }\n var eol = getEOL(options, documentText);\n var lineBreak = false;\n var indentLevel = 0;\n var indentValue;\n if (options.insertSpaces) {\n indentValue = repeat(' ', options.tabSize || 4);\n }\n else {\n indentValue = '\\t';\n }\n var scanner = createScanner(formatText, false);\n var hasError = false;\n function newLineAndIndent() {\n return eol + repeat(indentValue, initialIndentLevel + indentLevel);\n }\n function scanNext() {\n var token = scanner.scan();\n lineBreak = false;\n while (token === 15 /* Trivia */ || token === 14 /* LineBreakTrivia */) {\n lineBreak = lineBreak || (token === 14 /* LineBreakTrivia */);\n token = scanner.scan();\n }\n hasError = token === 16 /* Unknown */ || scanner.getTokenError() !== 0 /* None */;\n return token;\n }\n var editOperations = [];\n function addEdit(text, startOffset, endOffset) {\n if (!hasError && startOffset < rangeEnd && endOffset > rangeStart && documentText.substring(startOffset, endOffset) !== text) {\n editOperations.push({ offset: startOffset, length: endOffset - startOffset, content: text });\n }\n }\n var firstToken = scanNext();\n if (firstToken !== 17 /* EOF */) {\n var firstTokenStart = scanner.getTokenOffset() + formatTextStart;\n var initialIndent = repeat(indentValue, initialIndentLevel);\n addEdit(initialIndent, formatTextStart, firstTokenStart);\n }\n while (firstToken !== 17 /* EOF */) {\n var firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;\n var secondToken = scanNext();\n var replaceContent = '';\n while (!lineBreak && (secondToken === 12 /* LineCommentTrivia */ || secondToken === 13 /* BlockCommentTrivia */)) {\n // comments on the same line: keep them on the same line, but ignore them otherwise\n var commentTokenStart = scanner.getTokenOffset() + formatTextStart;\n addEdit(' ', firstTokenEnd, commentTokenStart);\n firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;\n replaceContent = secondToken === 12 /* LineCommentTrivia */ ? newLineAndIndent() : '';\n secondToken = scanNext();\n }\n if (secondToken === 2 /* CloseBraceToken */) {\n if (firstToken !== 1 /* OpenBraceToken */) {\n indentLevel--;\n replaceContent = newLineAndIndent();\n }\n }\n else if (secondToken === 4 /* CloseBracketToken */) {\n if (firstToken !== 3 /* OpenBracketToken */) {\n indentLevel--;\n replaceContent = newLineAndIndent();\n }\n }\n else {\n switch (firstToken) {\n case 3 /* OpenBracketToken */:\n case 1 /* OpenBraceToken */:\n indentLevel++;\n replaceContent = newLineAndIndent();\n break;\n case 5 /* CommaToken */:\n case 12 /* LineCommentTrivia */:\n replaceContent = newLineAndIndent();\n break;\n case 13 /* BlockCommentTrivia */:\n if (lineBreak) {\n replaceContent = newLineAndIndent();\n }\n else {\n // symbol following comment on the same line: keep on same line, separate with ' '\n replaceContent = ' ';\n }\n break;\n case 6 /* ColonToken */:\n replaceContent = ' ';\n break;\n case 10 /* StringLiteral */:\n if (secondToken === 6 /* ColonToken */) {\n replaceContent = '';\n break;\n }\n // fall through\n case 7 /* NullKeyword */:\n case 8 /* TrueKeyword */:\n case 9 /* FalseKeyword */:\n case 11 /* NumericLiteral */:\n case 2 /* CloseBraceToken */:\n case 4 /* CloseBracketToken */:\n if (secondToken === 12 /* LineCommentTrivia */ || secondToken === 13 /* BlockCommentTrivia */) {\n replaceContent = ' ';\n }\n else if (secondToken !== 5 /* CommaToken */ && secondToken !== 17 /* EOF */) {\n hasError = true;\n }\n break;\n case 16 /* Unknown */:\n hasError = true;\n break;\n }\n if (lineBreak && (secondToken === 12 /* LineCommentTrivia */ || secondToken === 13 /* BlockCommentTrivia */)) {\n replaceContent = newLineAndIndent();\n }\n }\n var secondTokenStart = scanner.getTokenOffset() + formatTextStart;\n addEdit(replaceContent, firstTokenEnd, secondTokenStart);\n firstToken = secondToken;\n }\n return editOperations;\n}\nfunction repeat(s, count) {\n var result = '';\n for (var i = 0; i < count; i++) {\n result += s;\n }\n return result;\n}\nfunction computeIndentLevel(content, options) {\n var i = 0;\n var nChars = 0;\n var tabSize = options.tabSize || 4;\n while (i < content.length) {\n var ch = content.charAt(i);\n if (ch === ' ') {\n nChars++;\n }\n else if (ch === '\\t') {\n nChars += tabSize;\n }\n else {\n break;\n }\n i++;\n }\n return Math.floor(nChars / tabSize);\n}\nfunction getEOL(options, text) {\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch === '\\r') {\n if (i + 1 < text.length && text.charAt(i + 1) === '\\n') {\n return '\\r\\n';\n }\n return '\\r';\n }\n else if (ch === '\\n') {\n return '\\n';\n }\n }\n return (options && options.eol) || '\\n';\n}\nexport function isEOL(text, offset) {\n return '\\r\\n'.indexOf(text.charAt(offset)) !== -1;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n'use strict';\nimport { createScanner } from './scanner.js';\nvar ParseOptions;\n(function (ParseOptions) {\n ParseOptions.DEFAULT = {\n allowTrailingComma: false\n };\n})(ParseOptions || (ParseOptions = {}));\n/**\n * For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.\n */\nexport function getLocation(text, position) {\n var segments = []; // strings or numbers\n var earlyReturnException = new Object();\n var previousNode = undefined;\n var previousNodeInst = {\n value: {},\n offset: 0,\n length: 0,\n type: 'object',\n parent: undefined\n };\n var isAtPropertyKey = false;\n function setPreviousNode(value, offset, length, type) {\n previousNodeInst.value = value;\n previousNodeInst.offset = offset;\n previousNodeInst.length = length;\n previousNodeInst.type = type;\n previousNodeInst.colonOffset = undefined;\n previousNode = previousNodeInst;\n }\n try {\n visit(text, {\n onObjectBegin: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = undefined;\n isAtPropertyKey = position > offset;\n segments.push(''); // push a placeholder (will be replaced)\n },\n onObjectProperty: function (name, offset, length) {\n if (position < offset) {\n throw earlyReturnException;\n }\n setPreviousNode(name, offset, length, 'property');\n segments[segments.length - 1] = name;\n if (position <= offset + length) {\n throw earlyReturnException;\n }\n },\n onObjectEnd: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = undefined;\n segments.pop();\n },\n onArrayBegin: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = undefined;\n segments.push(0);\n },\n onArrayEnd: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = undefined;\n segments.pop();\n },\n onLiteralValue: function (value, offset, length) {\n if (position < offset) {\n throw earlyReturnException;\n }\n setPreviousNode(value, offset, length, getNodeType(value));\n if (position <= offset + length) {\n throw earlyReturnException;\n }\n },\n onSeparator: function (sep, offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n if (sep === ':' && previousNode && previousNode.type === 'property') {\n previousNode.colonOffset = offset;\n isAtPropertyKey = false;\n previousNode = undefined;\n }\n else if (sep === ',') {\n var last = segments[segments.length - 1];\n if (typeof last === 'number') {\n segments[segments.length - 1] = last + 1;\n }\n else {\n isAtPropertyKey = true;\n segments[segments.length - 1] = '';\n }\n previousNode = undefined;\n }\n }\n });\n }\n catch (e) {\n if (e !== earlyReturnException) {\n throw e;\n }\n }\n return {\n path: segments,\n previousNode: previousNode,\n isAtPropertyKey: isAtPropertyKey,\n matches: function (pattern) {\n var k = 0;\n for (var i = 0; k < pattern.length && i < segments.length; i++) {\n if (pattern[k] === segments[i] || pattern[k] === '*') {\n k++;\n }\n else if (pattern[k] !== '**') {\n return false;\n }\n }\n return k === pattern.length;\n }\n };\n}\n/**\n * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n * Therefore always check the errors list to find out if the input was valid.\n */\nexport function parse(text, errors, options) {\n if (errors === void 0) { errors = []; }\n if (options === void 0) { options = ParseOptions.DEFAULT; }\n var currentProperty = null;\n var currentParent = [];\n var previousParents = [];\n function onValue(value) {\n if (Array.isArray(currentParent)) {\n currentParent.push(value);\n }\n else if (currentProperty !== null) {\n currentParent[currentProperty] = value;\n }\n }\n var visitor = {\n onObjectBegin: function () {\n var object = {};\n onValue(object);\n previousParents.push(currentParent);\n currentParent = object;\n currentProperty = null;\n },\n onObjectProperty: function (name) {\n currentProperty = name;\n },\n onObjectEnd: function () {\n currentParent = previousParents.pop();\n },\n onArrayBegin: function () {\n var array = [];\n onValue(array);\n previousParents.push(currentParent);\n currentParent = array;\n currentProperty = null;\n },\n onArrayEnd: function () {\n currentParent = previousParents.pop();\n },\n onLiteralValue: onValue,\n onError: function (error, offset, length) {\n errors.push({ error: error, offset: offset, length: length });\n }\n };\n visit(text, visitor, options);\n return currentParent[0];\n}\n/**\n * Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n */\nexport function parseTree(text, errors, options) {\n if (errors === void 0) { errors = []; }\n if (options === void 0) { options = ParseOptions.DEFAULT; }\n var currentParent = { type: 'array', offset: -1, length: -1, children: [], parent: undefined }; // artificial root\n function ensurePropertyComplete(endOffset) {\n if (currentParent.type === 'property') {\n currentParent.length = endOffset - currentParent.offset;\n currentParent = currentParent.parent;\n }\n }\n function onValue(valueNode) {\n currentParent.children.push(valueNode);\n return valueNode;\n }\n var visitor = {\n onObjectBegin: function (offset) {\n currentParent = onValue({ type: 'object', offset: offset, length: -1, parent: currentParent, children: [] });\n },\n onObjectProperty: function (name, offset, length) {\n currentParent = onValue({ type: 'property', offset: offset, length: -1, parent: currentParent, children: [] });\n currentParent.children.push({ type: 'string', value: name, offset: offset, length: length, parent: currentParent });\n },\n onObjectEnd: function (offset, length) {\n ensurePropertyComplete(offset + length); // in case of a missing value for a property: make sure property is complete\n currentParent.length = offset + length - currentParent.offset;\n currentParent = currentParent.parent;\n ensurePropertyComplete(offset + length);\n },\n onArrayBegin: function (offset, length) {\n currentParent = onValue({ type: 'array', offset: offset, length: -1, parent: currentParent, children: [] });\n },\n onArrayEnd: function (offset, length) {\n currentParent.length = offset + length - currentParent.offset;\n currentParent = currentParent.parent;\n ensurePropertyComplete(offset + length);\n },\n onLiteralValue: function (value, offset, length) {\n onValue({ type: getNodeType(value), offset: offset, length: length, parent: currentParent, value: value });\n ensurePropertyComplete(offset + length);\n },\n onSeparator: function (sep, offset, length) {\n if (currentParent.type === 'property') {\n if (sep === ':') {\n currentParent.colonOffset = offset;\n }\n else if (sep === ',') {\n ensurePropertyComplete(offset);\n }\n }\n },\n onError: function (error, offset, length) {\n errors.push({ error: error, offset: offset, length: length });\n }\n };\n visit(text, visitor, options);\n var result = currentParent.children[0];\n if (result) {\n delete result.parent;\n }\n return result;\n}\n/**\n * Finds the node at the given path in a JSON DOM.\n */\nexport function findNodeAtLocation(root, path) {\n if (!root) {\n return undefined;\n }\n var node = root;\n for (var _i = 0, path_1 = path; _i < path_1.length; _i++) {\n var segment = path_1[_i];\n if (typeof segment === 'string') {\n if (node.type !== 'object' || !Array.isArray(node.children)) {\n return undefined;\n }\n var found = false;\n for (var _a = 0, _b = node.children; _a < _b.length; _a++) {\n var propertyNode = _b[_a];\n if (Array.isArray(propertyNode.children) && propertyNode.children[0].value === segment) {\n node = propertyNode.children[1];\n found = true;\n break;\n }\n }\n if (!found) {\n return undefined;\n }\n }\n else {\n var index = segment;\n if (node.type !== 'array' || index < 0 || !Array.isArray(node.children) || index >= node.children.length) {\n return undefined;\n }\n node = node.children[index];\n }\n }\n return node;\n}\n/**\n * Gets the JSON path of the given JSON DOM node\n */\nexport function getNodePath(node) {\n if (!node.parent || !node.parent.children) {\n return [];\n }\n var path = getNodePath(node.parent);\n if (node.parent.type === 'property') {\n var key = node.parent.children[0].value;\n path.push(key);\n }\n else if (node.parent.type === 'array') {\n var index = node.parent.children.indexOf(node);\n if (index !== -1) {\n path.push(index);\n }\n }\n return path;\n}\n/**\n * Evaluates the JavaScript object of the given JSON DOM node\n */\nexport function getNodeValue(node) {\n switch (node.type) {\n case 'array':\n return node.children.map(getNodeValue);\n case 'object':\n var obj = Object.create(null);\n for (var _i = 0, _a = node.children; _i < _a.length; _i++) {\n var prop = _a[_i];\n var valueNode = prop.children[1];\n if (valueNode) {\n obj[prop.children[0].value] = getNodeValue(valueNode);\n }\n }\n return obj;\n case 'null':\n case 'string':\n case 'number':\n case 'boolean':\n return node.value;\n default:\n return undefined;\n }\n}\nexport function contains(node, offset, includeRightBound) {\n if (includeRightBound === void 0) { includeRightBound = false; }\n return (offset >= node.offset && offset < (node.offset + node.length)) || includeRightBound && (offset === (node.offset + node.length));\n}\n/**\n * Finds the most inner node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.\n */\nexport function findNodeAtOffset(node, offset, includeRightBound) {\n if (includeRightBound === void 0) { includeRightBound = false; }\n if (contains(node, offset, includeRightBound)) {\n var children = node.children;\n if (Array.isArray(children)) {\n for (var i = 0; i < children.length && children[i].offset <= offset; i++) {\n var item = findNodeAtOffset(children[i], offset, includeRightBound);\n if (item) {\n return item;\n }\n }\n }\n return node;\n }\n return undefined;\n}\n/**\n * Parses the given text and invokes the visitor functions for each object, array and literal reached.\n */\nexport function visit(text, visitor, options) {\n if (options === void 0) { options = ParseOptions.DEFAULT; }\n var _scanner = createScanner(text, false);\n function toNoArgVisit(visitFunction) {\n return visitFunction ? function () { return visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); } : function () { return true; };\n }\n function toOneArgVisit(visitFunction) {\n return visitFunction ? function (arg) { return visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); } : function () { return true; };\n }\n var onObjectBegin = toNoArgVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisit(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisit(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisit(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);\n var disallowComments = options && options.disallowComments;\n var allowTrailingComma = options && options.allowTrailingComma;\n function scanNext() {\n while (true) {\n var token = _scanner.scan();\n switch (_scanner.getTokenError()) {\n case 4 /* InvalidUnicode */:\n handleError(14 /* InvalidUnicode */);\n break;\n case 5 /* InvalidEscapeCharacter */:\n handleError(15 /* InvalidEscapeCharacter */);\n break;\n case 3 /* UnexpectedEndOfNumber */:\n handleError(13 /* UnexpectedEndOfNumber */);\n break;\n case 1 /* UnexpectedEndOfComment */:\n if (!disallowComments) {\n handleError(11 /* UnexpectedEndOfComment */);\n }\n break;\n case 2 /* UnexpectedEndOfString */:\n handleError(12 /* UnexpectedEndOfString */);\n break;\n case 6 /* InvalidCharacter */:\n handleError(16 /* InvalidCharacter */);\n break;\n }\n switch (token) {\n case 12 /* LineCommentTrivia */:\n case 13 /* BlockCommentTrivia */:\n if (disallowComments) {\n handleError(10 /* InvalidCommentToken */);\n }\n else {\n onComment();\n }\n break;\n case 16 /* Unknown */:\n handleError(1 /* InvalidSymbol */);\n break;\n case 15 /* Trivia */:\n case 14 /* LineBreakTrivia */:\n break;\n default:\n return token;\n }\n }\n }\n function handleError(error, skipUntilAfter, skipUntil) {\n if (skipUntilAfter === void 0) { skipUntilAfter = []; }\n if (skipUntil === void 0) { skipUntil = []; }\n onError(error);\n if (skipUntilAfter.length + skipUntil.length > 0) {\n var token = _scanner.getToken();\n while (token !== 17 /* EOF */) {\n if (skipUntilAfter.indexOf(token) !== -1) {\n scanNext();\n break;\n }\n else if (skipUntil.indexOf(token) !== -1) {\n break;\n }\n token = scanNext();\n }\n }\n }\n function parseString(isValue) {\n var value = _scanner.getTokenValue();\n if (isValue) {\n onLiteralValue(value);\n }\n else {\n onObjectProperty(value);\n }\n scanNext();\n return true;\n }\n function parseLiteral() {\n switch (_scanner.getToken()) {\n case 11 /* NumericLiteral */:\n var value = 0;\n try {\n value = JSON.parse(_scanner.getTokenValue());\n if (typeof value !== 'number') {\n handleError(2 /* InvalidNumberFormat */);\n value = 0;\n }\n }\n catch (e) {\n handleError(2 /* InvalidNumberFormat */);\n }\n onLiteralValue(value);\n break;\n case 7 /* NullKeyword */:\n onLiteralValue(null);\n break;\n case 8 /* TrueKeyword */:\n onLiteralValue(true);\n break;\n case 9 /* FalseKeyword */:\n onLiteralValue(false);\n break;\n default:\n return false;\n }\n scanNext();\n return true;\n }\n function parseProperty() {\n if (_scanner.getToken() !== 10 /* StringLiteral */) {\n handleError(3 /* PropertyNameExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n return false;\n }\n parseString(false);\n if (_scanner.getToken() === 6 /* ColonToken */) {\n onSeparator(':');\n scanNext(); // consume colon\n if (!parseValue()) {\n handleError(4 /* ValueExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n }\n }\n else {\n handleError(5 /* ColonExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n }\n return true;\n }\n function parseObject() {\n onObjectBegin();\n scanNext(); // consume open brace\n var needsComma = false;\n while (_scanner.getToken() !== 2 /* CloseBraceToken */ && _scanner.getToken() !== 17 /* EOF */) {\n if (_scanner.getToken() === 5 /* CommaToken */) {\n if (!needsComma) {\n handleError(4 /* ValueExpected */, [], []);\n }\n onSeparator(',');\n scanNext(); // consume comma\n if (_scanner.getToken() === 2 /* CloseBraceToken */ && allowTrailingComma) {\n break;\n }\n }\n else if (needsComma) {\n handleError(6 /* CommaExpected */, [], []);\n }\n if (!parseProperty()) {\n handleError(4 /* ValueExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n }\n needsComma = true;\n }\n onObjectEnd();\n if (_scanner.getToken() !== 2 /* CloseBraceToken */) {\n handleError(7 /* CloseBraceExpected */, [2 /* CloseBraceToken */], []);\n }\n else {\n scanNext(); // consume close brace\n }\n return true;\n }\n function parseArray() {\n onArrayBegin();\n scanNext(); // consume open bracket\n var needsComma = false;\n while (_scanner.getToken() !== 4 /* CloseBracketToken */ && _scanner.getToken() !== 17 /* EOF */) {\n if (_scanner.getToken() === 5 /* CommaToken */) {\n if (!needsComma) {\n handleError(4 /* ValueExpected */, [], []);\n }\n onSeparator(',');\n scanNext(); // consume comma\n if (_scanner.getToken() === 4 /* CloseBracketToken */ && allowTrailingComma) {\n break;\n }\n }\n else if (needsComma) {\n handleError(6 /* CommaExpected */, [], []);\n }\n if (!parseValue()) {\n handleError(4 /* ValueExpected */, [], [4 /* CloseBracketToken */, 5 /* CommaToken */]);\n }\n needsComma = true;\n }\n onArrayEnd();\n if (_scanner.getToken() !== 4 /* CloseBracketToken */) {\n handleError(8 /* CloseBracketExpected */, [4 /* CloseBracketToken */], []);\n }\n else {\n scanNext(); // consume close bracket\n }\n return true;\n }\n function parseValue() {\n switch (_scanner.getToken()) {\n case 3 /* OpenBracketToken */:\n return parseArray();\n case 1 /* OpenBraceToken */:\n return parseObject();\n case 10 /* StringLiteral */:\n return parseString(true);\n default:\n return parseLiteral();\n }\n }\n scanNext();\n if (_scanner.getToken() === 17 /* EOF */) {\n if (options.allowEmptyContent) {\n return true;\n }\n handleError(4 /* ValueExpected */, [], []);\n return false;\n }\n if (!parseValue()) {\n handleError(4 /* ValueExpected */, [], []);\n return false;\n }\n if (_scanner.getToken() !== 17 /* EOF */) {\n handleError(9 /* EndOfFileExpected */, [], []);\n }\n return true;\n}\n/**\n * Takes JSON with JavaScript-style comments and remove\n * them. Optionally replaces every none-newline character\n * of comments with a replaceCharacter\n */\nexport function stripComments(text, replaceCh) {\n var _scanner = createScanner(text), parts = [], kind, offset = 0, pos;\n do {\n pos = _scanner.getPosition();\n kind = _scanner.scan();\n switch (kind) {\n case 12 /* LineCommentTrivia */:\n case 13 /* BlockCommentTrivia */:\n case 17 /* EOF */:\n if (offset !== pos) {\n parts.push(text.substring(offset, pos));\n }\n if (replaceCh !== undefined) {\n parts.push(_scanner.getTokenValue().replace(/[^\\r\\n]/g, replaceCh));\n }\n offset = _scanner.getPosition();\n break;\n }\n } while (kind !== 17 /* EOF */);\n return parts.join('');\n}\nexport function getNodeType(value) {\n switch (typeof value) {\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n case 'object': {\n if (!value) {\n return 'null';\n }\n else if (Array.isArray(value)) {\n return 'array';\n }\n return 'object';\n }\n default: return 'null';\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n'use strict';\n/**\n * Creates a JSON scanner on the given text.\n * If ignoreTrivia is set, whitespaces or comments are ignored.\n */\nexport function createScanner(text, ignoreTrivia) {\n if (ignoreTrivia === void 0) { ignoreTrivia = false; }\n var len = text.length;\n var pos = 0, value = '', tokenOffset = 0, token = 16 /* Unknown */, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0 /* None */;\n function scanHexDigits(count, exact) {\n var digits = 0;\n var value = 0;\n while (digits < count || !exact) {\n var ch = text.charCodeAt(pos);\n if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) {\n value = value * 16 + ch - 48 /* _0 */;\n }\n else if (ch >= 65 /* A */ && ch <= 70 /* F */) {\n value = value * 16 + ch - 65 /* A */ + 10;\n }\n else if (ch >= 97 /* a */ && ch <= 102 /* f */) {\n value = value * 16 + ch - 97 /* a */ + 10;\n }\n else {\n break;\n }\n pos++;\n digits++;\n }\n if (digits < count) {\n value = -1;\n }\n return value;\n }\n function setPosition(newPosition) {\n pos = newPosition;\n value = '';\n tokenOffset = 0;\n token = 16 /* Unknown */;\n scanError = 0 /* None */;\n }\n function scanNumber() {\n var start = pos;\n if (text.charCodeAt(pos) === 48 /* _0 */) {\n pos++;\n }\n else {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n }\n if (pos < text.length && text.charCodeAt(pos) === 46 /* dot */) {\n pos++;\n if (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n }\n else {\n scanError = 3 /* UnexpectedEndOfNumber */;\n return text.substring(start, pos);\n }\n }\n var end = pos;\n if (pos < text.length && (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */)) {\n pos++;\n if (pos < text.length && text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) {\n pos++;\n }\n if (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n end = pos;\n }\n else {\n scanError = 3 /* UnexpectedEndOfNumber */;\n }\n }\n return text.substring(start, end);\n }\n function scanString() {\n var result = '', start = pos;\n while (true) {\n if (pos >= len) {\n result += text.substring(start, pos);\n scanError = 2 /* UnexpectedEndOfString */;\n break;\n }\n var ch = text.charCodeAt(pos);\n if (ch === 34 /* doubleQuote */) {\n result += text.substring(start, pos);\n pos++;\n break;\n }\n if (ch === 92 /* backslash */) {\n result += text.substring(start, pos);\n pos++;\n if (pos >= len) {\n scanError = 2 /* UnexpectedEndOfString */;\n break;\n }\n var ch2 = text.charCodeAt(pos++);\n switch (ch2) {\n case 34 /* doubleQuote */:\n result += '\\\"';\n break;\n case 92 /* backslash */:\n result += '\\\\';\n break;\n case 47 /* slash */:\n result += '/';\n break;\n case 98 /* b */:\n result += '\\b';\n break;\n case 102 /* f */:\n result += '\\f';\n break;\n case 110 /* n */:\n result += '\\n';\n break;\n case 114 /* r */:\n result += '\\r';\n break;\n case 116 /* t */:\n result += '\\t';\n break;\n case 117 /* u */:\n var ch3 = scanHexDigits(4, true);\n if (ch3 >= 0) {\n result += String.fromCharCode(ch3);\n }\n else {\n scanError = 4 /* InvalidUnicode */;\n }\n break;\n default:\n scanError = 5 /* InvalidEscapeCharacter */;\n }\n start = pos;\n continue;\n }\n if (ch >= 0 && ch <= 0x1f) {\n if (isLineBreak(ch)) {\n result += text.substring(start, pos);\n scanError = 2 /* UnexpectedEndOfString */;\n break;\n }\n else {\n scanError = 6 /* InvalidCharacter */;\n // mark as error but continue with string\n }\n }\n pos++;\n }\n return result;\n }\n function scanNext() {\n value = '';\n scanError = 0 /* None */;\n tokenOffset = pos;\n lineStartOffset = lineNumber;\n prevTokenLineStartOffset = tokenLineStartOffset;\n if (pos >= len) {\n // at the end\n tokenOffset = len;\n return token = 17 /* EOF */;\n }\n var code = text.charCodeAt(pos);\n // trivia: whitespace\n if (isWhiteSpace(code)) {\n do {\n pos++;\n value += String.fromCharCode(code);\n code = text.charCodeAt(pos);\n } while (isWhiteSpace(code));\n return token = 15 /* Trivia */;\n }\n // trivia: newlines\n if (isLineBreak(code)) {\n pos++;\n value += String.fromCharCode(code);\n if (code === 13 /* carriageReturn */ && text.charCodeAt(pos) === 10 /* lineFeed */) {\n pos++;\n value += '\\n';\n }\n lineNumber++;\n tokenLineStartOffset = pos;\n return token = 14 /* LineBreakTrivia */;\n }\n switch (code) {\n // tokens: []{}:,\n case 123 /* openBrace */:\n pos++;\n return token = 1 /* OpenBraceToken */;\n case 125 /* closeBrace */:\n pos++;\n return token = 2 /* CloseBraceToken */;\n case 91 /* openBracket */:\n pos++;\n return token = 3 /* OpenBracketToken */;\n case 93 /* closeBracket */:\n pos++;\n return token = 4 /* CloseBracketToken */;\n case 58 /* colon */:\n pos++;\n return token = 6 /* ColonToken */;\n case 44 /* comma */:\n pos++;\n return token = 5 /* CommaToken */;\n // strings\n case 34 /* doubleQuote */:\n pos++;\n value = scanString();\n return token = 10 /* StringLiteral */;\n // comments\n case 47 /* slash */:\n var start = pos - 1;\n // Single-line comment\n if (text.charCodeAt(pos + 1) === 47 /* slash */) {\n pos += 2;\n while (pos < len) {\n if (isLineBreak(text.charCodeAt(pos))) {\n break;\n }\n pos++;\n }\n value = text.substring(start, pos);\n return token = 12 /* LineCommentTrivia */;\n }\n // Multi-line comment\n if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {\n pos += 2;\n var safeLength = len - 1; // For lookahead.\n var commentClosed = false;\n while (pos < safeLength) {\n var ch = text.charCodeAt(pos);\n if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) {\n pos += 2;\n commentClosed = true;\n break;\n }\n pos++;\n if (isLineBreak(ch)) {\n if (ch === 13 /* carriageReturn */ && text.charCodeAt(pos) === 10 /* lineFeed */) {\n pos++;\n }\n lineNumber++;\n tokenLineStartOffset = pos;\n }\n }\n if (!commentClosed) {\n pos++;\n scanError = 1 /* UnexpectedEndOfComment */;\n }\n value = text.substring(start, pos);\n return token = 13 /* BlockCommentTrivia */;\n }\n // just a single slash\n value += String.fromCharCode(code);\n pos++;\n return token = 16 /* Unknown */;\n // numbers\n case 45 /* minus */:\n value += String.fromCharCode(code);\n pos++;\n if (pos === len || !isDigit(text.charCodeAt(pos))) {\n return token = 16 /* Unknown */;\n }\n // found a minus, followed by a number so\n // we fall through to proceed with scanning\n // numbers\n case 48 /* _0 */:\n case 49 /* _1 */:\n case 50 /* _2 */:\n case 51 /* _3 */:\n case 52 /* _4 */:\n case 53 /* _5 */:\n case 54 /* _6 */:\n case 55 /* _7 */:\n case 56 /* _8 */:\n case 57 /* _9 */:\n value += scanNumber();\n return token = 11 /* NumericLiteral */;\n // literals and unknown symbols\n default:\n // is a literal? Read the full word.\n while (pos < len && isUnknownContentCharacter(code)) {\n pos++;\n code = text.charCodeAt(pos);\n }\n if (tokenOffset !== pos) {\n value = text.substring(tokenOffset, pos);\n // keywords: true, false, null\n switch (value) {\n case 'true': return token = 8 /* TrueKeyword */;\n case 'false': return token = 9 /* FalseKeyword */;\n case 'null': return token = 7 /* NullKeyword */;\n }\n return token = 16 /* Unknown */;\n }\n // some\n value += String.fromCharCode(code);\n pos++;\n return token = 16 /* Unknown */;\n }\n }\n function isUnknownContentCharacter(code) {\n if (isWhiteSpace(code) || isLineBreak(code)) {\n return false;\n }\n switch (code) {\n case 125 /* closeBrace */:\n case 93 /* closeBracket */:\n case 123 /* openBrace */:\n case 91 /* openBracket */:\n case 34 /* doubleQuote */:\n case 58 /* colon */:\n case 44 /* comma */:\n case 47 /* slash */:\n return false;\n }\n return true;\n }\n function scanNextNonTrivia() {\n var result;\n do {\n result = scanNext();\n } while (result >= 12 /* LineCommentTrivia */ && result <= 15 /* Trivia */);\n return result;\n }\n return {\n setPosition: setPosition,\n getPosition: function () { return pos; },\n scan: ignoreTrivia ? scanNextNonTrivia : scanNext,\n getToken: function () { return token; },\n getTokenValue: function () { return value; },\n getTokenOffset: function () { return tokenOffset; },\n getTokenLength: function () { return pos - tokenOffset; },\n getTokenStartLine: function () { return lineStartOffset; },\n getTokenStartCharacter: function () { return tokenOffset - prevTokenLineStartOffset; },\n getTokenError: function () { return scanError; },\n };\n}\nfunction isWhiteSpace(ch) {\n return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ ||\n ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ ||\n ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */;\n}\nfunction isLineBreak(ch) {\n return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */;\n}\nfunction isDigit(ch) {\n return ch >= 48 /* _0 */ && ch <= 57 /* _9 */;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n'use strict';\nimport * as formatter from './impl/format.js';\nimport * as edit from './impl/edit.js';\nimport * as scanner from './impl/scanner.js';\nimport * as parser from './impl/parser.js';\n/**\n * Creates a JSON scanner on the given text.\n * If ignoreTrivia is set, whitespaces or comments are ignored.\n */\nexport var createScanner = scanner.createScanner;\n/**\n * For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.\n */\nexport var getLocation = parser.getLocation;\n/**\n * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n * Therefore, always check the errors list to find out if the input was valid.\n */\nexport var parse = parser.parse;\n/**\n * Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n */\nexport var parseTree = parser.parseTree;\n/**\n * Finds the node at the given path in a JSON DOM.\n */\nexport var findNodeAtLocation = parser.findNodeAtLocation;\n/**\n * Finds the innermost node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.\n */\nexport var findNodeAtOffset = parser.findNodeAtOffset;\n/**\n * Gets the JSON path of the given JSON DOM node\n */\nexport var getNodePath = parser.getNodePath;\n/**\n * Evaluates the JavaScript object of the given JSON DOM node\n */\nexport var getNodeValue = parser.getNodeValue;\n/**\n * Parses the given text and invokes the visitor functions for each object, array and literal reached.\n */\nexport var visit = parser.visit;\n/**\n * Takes JSON with JavaScript-style comments and remove\n * them. Optionally replaces every none-newline character\n * of comments with a replaceCharacter\n */\nexport var stripComments = parser.stripComments;\nexport function printParseErrorCode(code) {\n switch (code) {\n case 1 /* InvalidSymbol */: return 'InvalidSymbol';\n case 2 /* InvalidNumberFormat */: return 'InvalidNumberFormat';\n case 3 /* PropertyNameExpected */: return 'PropertyNameExpected';\n case 4 /* ValueExpected */: return 'ValueExpected';\n case 5 /* ColonExpected */: return 'ColonExpected';\n case 6 /* CommaExpected */: return 'CommaExpected';\n case 7 /* CloseBraceExpected */: return 'CloseBraceExpected';\n case 8 /* CloseBracketExpected */: return 'CloseBracketExpected';\n case 9 /* EndOfFileExpected */: return 'EndOfFileExpected';\n case 10 /* InvalidCommentToken */: return 'InvalidCommentToken';\n case 11 /* UnexpectedEndOfComment */: return 'UnexpectedEndOfComment';\n case 12 /* UnexpectedEndOfString */: return 'UnexpectedEndOfString';\n case 13 /* UnexpectedEndOfNumber */: return 'UnexpectedEndOfNumber';\n case 14 /* InvalidUnicode */: return 'InvalidUnicode';\n case 15 /* InvalidEscapeCharacter */: return 'InvalidEscapeCharacter';\n case 16 /* InvalidCharacter */: return 'InvalidCharacter';\n }\n return '';\n}\n/**\n * Computes the edits needed to format a JSON document.\n *\n * @param documentText The input text\n * @param range The range to format or `undefined` to format the full content\n * @param options The formatting options\n * @returns A list of edit operations describing the formatting changes to the original document. Edits can be either inserts, replacements or\n * removals of text segments. All offsets refer to the original state of the document. No two edits must change or remove the same range of\n * text in the original document. However, multiple edits can have\n * the same offset, for example multiple inserts, or an insert followed by a remove or replace. The order in the array defines which edit is applied first.\n * To apply edits to an input, you can use `applyEdits`.\n */\nexport function format(documentText, range, options) {\n return formatter.format(documentText, range, options);\n}\n/**\n * Computes the edits needed to modify a value in the JSON document.\n *\n * @param documentText The input text\n * @param path The path of the value to change. The path represents either to the document root, a property or an array item.\n * If the path points to an non-existing property or item, it will be created.\n * @param value The new value for the specified property or item. If the value is undefined,\n * the property or item will be removed.\n * @param options Options\n * @returns A list of edit operations describing the formatting changes to the original document. Edits can be either inserts, replacements or\n * removals of text segments. All offsets refer to the original state of the document. No two edits must change or remove the same range of\n * text in the original document. However, multiple edits can have\n * the same offset, for example multiple inserts, or an insert followed by a remove or replace. The order in the array defines which edit is applied first.\n * To apply edits to an input, you can use `applyEdits`.\n */\nexport function modify(text, path, value, options) {\n return edit.setProperty(text, path, value, options);\n}\n/**\n * Applies edits to a input string.\n */\nexport function applyEdits(text, edits) {\n for (var i = edits.length - 1; i >= 0; i--) {\n text = edit.applyEdit(text, edits[i]);\n }\n return text;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { JSONCompletion } from './services/jsonCompletion.js';\nimport { JSONHover } from './services/jsonHover.js';\nimport { JSONValidation } from './services/jsonValidation.js';\nimport { JSONDocumentSymbols } from './services/jsonDocumentSymbols.js';\nimport { parse as parseJSON, newJSONDocument } from './parser/jsonParser.js';\nimport { schemaContributions } from './services/configuration.js';\nimport { JSONSchemaService } from './services/jsonSchemaService.js';\nimport { getFoldingRanges } from './services/jsonFolding.js';\nimport { getSelectionRanges } from './services/jsonSelectionRanges.js';\nimport { format as formatJSON } from '../jsonc-parser/main.js';\nimport { Range, TextEdit } from './jsonLanguageTypes.js';\nimport { findDefinition } from './services/jsonDefinition.js';\nexport * from './jsonLanguageTypes.js';\nexport function getLanguageService(params) {\n var promise = params.promiseConstructor || Promise;\n var jsonSchemaService = new JSONSchemaService(params.schemaRequestService, params.workspaceContext, promise);\n jsonSchemaService.setSchemaContributions(schemaContributions);\n var jsonCompletion = new JSONCompletion(jsonSchemaService, params.contributions, promise, params.clientCapabilities);\n var jsonHover = new JSONHover(jsonSchemaService, params.contributions, promise);\n var jsonDocumentSymbols = new JSONDocumentSymbols(jsonSchemaService);\n var jsonValidation = new JSONValidation(jsonSchemaService, promise);\n return {\n configure: function (settings) {\n jsonSchemaService.clearExternalSchemas();\n if (settings.schemas) {\n settings.schemas.forEach(function (settings) {\n jsonSchemaService.registerExternalSchema(settings.uri, settings.fileMatch, settings.schema);\n });\n }\n jsonValidation.configure(settings);\n },\n resetSchema: function (uri) { return jsonSchemaService.onResourceChange(uri); },\n doValidation: jsonValidation.doValidation.bind(jsonValidation),\n parseJSONDocument: function (document) { return parseJSON(document, { collectComments: true }); },\n newJSONDocument: function (root, diagnostics) { return newJSONDocument(root, diagnostics); },\n getMatchingSchemas: jsonSchemaService.getMatchingSchemas.bind(jsonSchemaService),\n doResolve: jsonCompletion.doResolve.bind(jsonCompletion),\n doComplete: jsonCompletion.doComplete.bind(jsonCompletion),\n findDocumentSymbols: jsonDocumentSymbols.findDocumentSymbols.bind(jsonDocumentSymbols),\n findDocumentSymbols2: jsonDocumentSymbols.findDocumentSymbols2.bind(jsonDocumentSymbols),\n findColorSymbols: function (d, s) { return jsonDocumentSymbols.findDocumentColors(d, s).then(function (s) { return s.map(function (s) { return s.range; }); }); },\n findDocumentColors: jsonDocumentSymbols.findDocumentColors.bind(jsonDocumentSymbols),\n getColorPresentations: jsonDocumentSymbols.getColorPresentations.bind(jsonDocumentSymbols),\n doHover: jsonHover.doHover.bind(jsonHover),\n getFoldingRanges: getFoldingRanges,\n getSelectionRanges: getSelectionRanges,\n findDefinition: findDefinition,\n format: function (d, r, o) {\n var range = undefined;\n if (r) {\n var offset = d.offsetAt(r.start);\n var length = d.offsetAt(r.end) - offset;\n range = { offset: offset, length: length };\n }\n var options = { tabSize: o ? o.tabSize : 4, insertSpaces: o ? o.insertSpaces : true, eol: '\\n' };\n return formatJSON(d.getText(), range, options).map(function (e) {\n return TextEdit.replace(Range.create(d.positionAt(e.offset), d.positionAt(e.offset + e.length)), e.content);\n });\n }\n };\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Range, TextEdit, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, MarkupKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, Position, InsertTextFormat, MarkupContent, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, FormattingOptions } from '../vscode-languageserver-types/main.js';\nimport { TextDocument } from '../vscode-languageserver-textdocument/lib/esm/main.js';\nexport { TextDocument, Range, TextEdit, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, Position, InsertTextFormat, MarkupContent, MarkupKind, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, FormattingOptions };\n/**\n * Error codes used by diagnostics\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n ErrorCode[ErrorCode[\"Undefined\"] = 0] = \"Undefined\";\n ErrorCode[ErrorCode[\"EnumValueMismatch\"] = 1] = \"EnumValueMismatch\";\n ErrorCode[ErrorCode[\"UnexpectedEndOfComment\"] = 257] = \"UnexpectedEndOfComment\";\n ErrorCode[ErrorCode[\"UnexpectedEndOfString\"] = 258] = \"UnexpectedEndOfString\";\n ErrorCode[ErrorCode[\"UnexpectedEndOfNumber\"] = 259] = \"UnexpectedEndOfNumber\";\n ErrorCode[ErrorCode[\"InvalidUnicode\"] = 260] = \"InvalidUnicode\";\n ErrorCode[ErrorCode[\"InvalidEscapeCharacter\"] = 261] = \"InvalidEscapeCharacter\";\n ErrorCode[ErrorCode[\"InvalidCharacter\"] = 262] = \"InvalidCharacter\";\n ErrorCode[ErrorCode[\"PropertyExpected\"] = 513] = \"PropertyExpected\";\n ErrorCode[ErrorCode[\"CommaExpected\"] = 514] = \"CommaExpected\";\n ErrorCode[ErrorCode[\"ColonExpected\"] = 515] = \"ColonExpected\";\n ErrorCode[ErrorCode[\"ValueExpected\"] = 516] = \"ValueExpected\";\n ErrorCode[ErrorCode[\"CommaOrCloseBacketExpected\"] = 517] = \"CommaOrCloseBacketExpected\";\n ErrorCode[ErrorCode[\"CommaOrCloseBraceExpected\"] = 518] = \"CommaOrCloseBraceExpected\";\n ErrorCode[ErrorCode[\"TrailingComma\"] = 519] = \"TrailingComma\";\n ErrorCode[ErrorCode[\"DuplicateKey\"] = 520] = \"DuplicateKey\";\n ErrorCode[ErrorCode[\"CommentNotPermitted\"] = 521] = \"CommentNotPermitted\";\n ErrorCode[ErrorCode[\"SchemaResolveError\"] = 768] = \"SchemaResolveError\";\n})(ErrorCode || (ErrorCode = {}));\nexport var ClientCapabilities;\n(function (ClientCapabilities) {\n ClientCapabilities.LATEST = {\n textDocument: {\n completion: {\n completionItem: {\n documentationFormat: [MarkupKind.Markdown, MarkupKind.PlainText],\n commitCharactersSupport: true\n }\n }\n }\n };\n})(ClientCapabilities || (ClientCapabilities = {}));\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as Json from '../../jsonc-parser/main.js';\nimport { isNumber, equals, isBoolean, isString, isDefined } from '../utils/objects.js';\nimport { ErrorCode, Diagnostic, DiagnosticSeverity, Range } from '../jsonLanguageTypes.js';\nimport * as nls from '../../../fillers/vscode-nls.js';\nvar localize = nls.loadMessageBundle();\nvar formats = {\n 'color-hex': { errorMessage: localize('colorHexFormatWarning', 'Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.'), pattern: /^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/ },\n 'date-time': { errorMessage: localize('dateTimeFormatWarning', 'String is not a RFC3339 date-time.'), pattern: /^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i },\n 'date': { errorMessage: localize('dateFormatWarning', 'String is not a RFC3339 date.'), pattern: /^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i },\n 'time': { errorMessage: localize('timeFormatWarning', 'String is not a RFC3339 time.'), pattern: /^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i },\n 'email': { errorMessage: localize('emailFormatWarning', 'String is not an e-mail address.'), pattern: /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/ }\n};\nvar ASTNodeImpl = /** @class */ (function () {\n function ASTNodeImpl(parent, offset, length) {\n if (length === void 0) { length = 0; }\n this.offset = offset;\n this.length = length;\n this.parent = parent;\n }\n Object.defineProperty(ASTNodeImpl.prototype, \"children\", {\n get: function () {\n return [];\n },\n enumerable: false,\n configurable: true\n });\n ASTNodeImpl.prototype.toString = function () {\n return 'type: ' + this.type + ' (' + this.offset + '/' + this.length + ')' + (this.parent ? ' parent: {' + this.parent.toString() + '}' : '');\n };\n return ASTNodeImpl;\n}());\nexport { ASTNodeImpl };\nvar NullASTNodeImpl = /** @class */ (function (_super) {\n __extends(NullASTNodeImpl, _super);\n function NullASTNodeImpl(parent, offset) {\n var _this = _super.call(this, parent, offset) || this;\n _this.type = 'null';\n _this.value = null;\n return _this;\n }\n return NullASTNodeImpl;\n}(ASTNodeImpl));\nexport { NullASTNodeImpl };\nvar BooleanASTNodeImpl = /** @class */ (function (_super) {\n __extends(BooleanASTNodeImpl, _super);\n function BooleanASTNodeImpl(parent, boolValue, offset) {\n var _this = _super.call(this, parent, offset) || this;\n _this.type = 'boolean';\n _this.value = boolValue;\n return _this;\n }\n return BooleanASTNodeImpl;\n}(ASTNodeImpl));\nexport { BooleanASTNodeImpl };\nvar ArrayASTNodeImpl = /** @class */ (function (_super) {\n __extends(ArrayASTNodeImpl, _super);\n function ArrayASTNodeImpl(parent, offset) {\n var _this = _super.call(this, parent, offset) || this;\n _this.type = 'array';\n _this.items = [];\n return _this;\n }\n Object.defineProperty(ArrayASTNodeImpl.prototype, \"children\", {\n get: function () {\n return this.items;\n },\n enumerable: false,\n configurable: true\n });\n return ArrayASTNodeImpl;\n}(ASTNodeImpl));\nexport { ArrayASTNodeImpl };\nvar NumberASTNodeImpl = /** @class */ (function (_super) {\n __extends(NumberASTNodeImpl, _super);\n function NumberASTNodeImpl(parent, offset) {\n var _this = _super.call(this, parent, offset) || this;\n _this.type = 'number';\n _this.isInteger = true;\n _this.value = Number.NaN;\n return _this;\n }\n return NumberASTNodeImpl;\n}(ASTNodeImpl));\nexport { NumberASTNodeImpl };\nvar StringASTNodeImpl = /** @class */ (function (_super) {\n __extends(StringASTNodeImpl, _super);\n function StringASTNodeImpl(parent, offset, length) {\n var _this = _super.call(this, parent, offset, length) || this;\n _this.type = 'string';\n _this.value = '';\n return _this;\n }\n return StringASTNodeImpl;\n}(ASTNodeImpl));\nexport { StringASTNodeImpl };\nvar PropertyASTNodeImpl = /** @class */ (function (_super) {\n __extends(PropertyASTNodeImpl, _super);\n function PropertyASTNodeImpl(parent, offset, keyNode) {\n var _this = _super.call(this, parent, offset) || this;\n _this.type = 'property';\n _this.colonOffset = -1;\n _this.keyNode = keyNode;\n return _this;\n }\n Object.defineProperty(PropertyASTNodeImpl.prototype, \"children\", {\n get: function () {\n return this.valueNode ? [this.keyNode, this.valueNode] : [this.keyNode];\n },\n enumerable: false,\n configurable: true\n });\n return PropertyASTNodeImpl;\n}(ASTNodeImpl));\nexport { PropertyASTNodeImpl };\nvar ObjectASTNodeImpl = /** @class */ (function (_super) {\n __extends(ObjectASTNodeImpl, _super);\n function ObjectASTNodeImpl(parent, offset) {\n var _this = _super.call(this, parent, offset) || this;\n _this.type = 'object';\n _this.properties = [];\n return _this;\n }\n Object.defineProperty(ObjectASTNodeImpl.prototype, \"children\", {\n get: function () {\n return this.properties;\n },\n enumerable: false,\n configurable: true\n });\n return ObjectASTNodeImpl;\n}(ASTNodeImpl));\nexport { ObjectASTNodeImpl };\nexport function asSchema(schema) {\n if (isBoolean(schema)) {\n return schema ? {} : { \"not\": {} };\n }\n return schema;\n}\nexport var EnumMatch;\n(function (EnumMatch) {\n EnumMatch[EnumMatch[\"Key\"] = 0] = \"Key\";\n EnumMatch[EnumMatch[\"Enum\"] = 1] = \"Enum\";\n})(EnumMatch || (EnumMatch = {}));\nvar SchemaCollector = /** @class */ (function () {\n function SchemaCollector(focusOffset, exclude) {\n if (focusOffset === void 0) { focusOffset = -1; }\n this.focusOffset = focusOffset;\n this.exclude = exclude;\n this.schemas = [];\n }\n SchemaCollector.prototype.add = function (schema) {\n this.schemas.push(schema);\n };\n SchemaCollector.prototype.merge = function (other) {\n Array.prototype.push.apply(this.schemas, other.schemas);\n };\n SchemaCollector.prototype.include = function (node) {\n return (this.focusOffset === -1 || contains(node, this.focusOffset)) && (node !== this.exclude);\n };\n SchemaCollector.prototype.newSub = function () {\n return new SchemaCollector(-1, this.exclude);\n };\n return SchemaCollector;\n}());\nvar NoOpSchemaCollector = /** @class */ (function () {\n function NoOpSchemaCollector() {\n }\n Object.defineProperty(NoOpSchemaCollector.prototype, \"schemas\", {\n get: function () { return []; },\n enumerable: false,\n configurable: true\n });\n NoOpSchemaCollector.prototype.add = function (schema) { };\n NoOpSchemaCollector.prototype.merge = function (other) { };\n NoOpSchemaCollector.prototype.include = function (node) { return true; };\n NoOpSchemaCollector.prototype.newSub = function () { return this; };\n NoOpSchemaCollector.instance = new NoOpSchemaCollector();\n return NoOpSchemaCollector;\n}());\nvar ValidationResult = /** @class */ (function () {\n function ValidationResult() {\n this.problems = [];\n this.propertiesMatches = 0;\n this.propertiesValueMatches = 0;\n this.primaryValueMatches = 0;\n this.enumValueMatch = false;\n this.enumValues = undefined;\n }\n ValidationResult.prototype.hasProblems = function () {\n return !!this.problems.length;\n };\n ValidationResult.prototype.mergeAll = function (validationResults) {\n for (var _i = 0, validationResults_1 = validationResults; _i < validationResults_1.length; _i++) {\n var validationResult = validationResults_1[_i];\n this.merge(validationResult);\n }\n };\n ValidationResult.prototype.merge = function (validationResult) {\n this.problems = this.problems.concat(validationResult.problems);\n };\n ValidationResult.prototype.mergeEnumValues = function (validationResult) {\n if (!this.enumValueMatch && !validationResult.enumValueMatch && this.enumValues && validationResult.enumValues) {\n this.enumValues = this.enumValues.concat(validationResult.enumValues);\n for (var _i = 0, _a = this.problems; _i < _a.length; _i++) {\n var error = _a[_i];\n if (error.code === ErrorCode.EnumValueMismatch) {\n error.message = localize('enumWarning', 'Value is not accepted. Valid values: {0}.', this.enumValues.map(function (v) { return JSON.stringify(v); }).join(', '));\n }\n }\n }\n };\n ValidationResult.prototype.mergePropertyMatch = function (propertyValidationResult) {\n this.merge(propertyValidationResult);\n this.propertiesMatches++;\n if (propertyValidationResult.enumValueMatch || !propertyValidationResult.hasProblems() && propertyValidationResult.propertiesMatches) {\n this.propertiesValueMatches++;\n }\n if (propertyValidationResult.enumValueMatch && propertyValidationResult.enumValues && propertyValidationResult.enumValues.length === 1) {\n this.primaryValueMatches++;\n }\n };\n ValidationResult.prototype.compare = function (other) {\n var hasProblems = this.hasProblems();\n if (hasProblems !== other.hasProblems()) {\n return hasProblems ? -1 : 1;\n }\n if (this.enumValueMatch !== other.enumValueMatch) {\n return other.enumValueMatch ? -1 : 1;\n }\n if (this.primaryValueMatches !== other.primaryValueMatches) {\n return this.primaryValueMatches - other.primaryValueMatches;\n }\n if (this.propertiesValueMatches !== other.propertiesValueMatches) {\n return this.propertiesValueMatches - other.propertiesValueMatches;\n }\n return this.propertiesMatches - other.propertiesMatches;\n };\n return ValidationResult;\n}());\nexport { ValidationResult };\nexport function newJSONDocument(root, diagnostics) {\n if (diagnostics === void 0) { diagnostics = []; }\n return new JSONDocument(root, diagnostics, []);\n}\nexport function getNodeValue(node) {\n return Json.getNodeValue(node);\n}\nexport function getNodePath(node) {\n return Json.getNodePath(node);\n}\nexport function contains(node, offset, includeRightBound) {\n if (includeRightBound === void 0) { includeRightBound = false; }\n return offset >= node.offset && offset < (node.offset + node.length) || includeRightBound && offset === (node.offset + node.length);\n}\nvar JSONDocument = /** @class */ (function () {\n function JSONDocument(root, syntaxErrors, comments) {\n if (syntaxErrors === void 0) { syntaxErrors = []; }\n if (comments === void 0) { comments = []; }\n this.root = root;\n this.syntaxErrors = syntaxErrors;\n this.comments = comments;\n }\n JSONDocument.prototype.getNodeFromOffset = function (offset, includeRightBound) {\n if (includeRightBound === void 0) { includeRightBound = false; }\n if (this.root) {\n return Json.findNodeAtOffset(this.root, offset, includeRightBound);\n }\n return undefined;\n };\n JSONDocument.prototype.visit = function (visitor) {\n if (this.root) {\n var doVisit_1 = function (node) {\n var ctn = visitor(node);\n var children = node.children;\n if (Array.isArray(children)) {\n for (var i = 0; i < children.length && ctn; i++) {\n ctn = doVisit_1(children[i]);\n }\n }\n return ctn;\n };\n doVisit_1(this.root);\n }\n };\n JSONDocument.prototype.validate = function (textDocument, schema) {\n if (this.root && schema) {\n var validationResult = new ValidationResult();\n validate(this.root, schema, validationResult, NoOpSchemaCollector.instance);\n return validationResult.problems.map(function (p) {\n var range = Range.create(textDocument.positionAt(p.location.offset), textDocument.positionAt(p.location.offset + p.location.length));\n return Diagnostic.create(range, p.message, p.severity, p.code);\n });\n }\n return undefined;\n };\n JSONDocument.prototype.getMatchingSchemas = function (schema, focusOffset, exclude) {\n if (focusOffset === void 0) { focusOffset = -1; }\n var matchingSchemas = new SchemaCollector(focusOffset, exclude);\n if (this.root && schema) {\n validate(this.root, schema, new ValidationResult(), matchingSchemas);\n }\n return matchingSchemas.schemas;\n };\n return JSONDocument;\n}());\nexport { JSONDocument };\nfunction validate(n, schema, validationResult, matchingSchemas) {\n if (!n || !matchingSchemas.include(n)) {\n return;\n }\n var node = n;\n switch (node.type) {\n case 'object':\n _validateObjectNode(node, schema, validationResult, matchingSchemas);\n break;\n case 'array':\n _validateArrayNode(node, schema, validationResult, matchingSchemas);\n break;\n case 'string':\n _validateStringNode(node, schema, validationResult, matchingSchemas);\n break;\n case 'number':\n _validateNumberNode(node, schema, validationResult, matchingSchemas);\n break;\n case 'property':\n return validate(node.valueNode, schema, validationResult, matchingSchemas);\n }\n _validateNode();\n matchingSchemas.add({ node: node, schema: schema });\n function _validateNode() {\n function matchesType(type) {\n return node.type === type || (type === 'integer' && node.type === 'number' && node.isInteger);\n }\n if (Array.isArray(schema.type)) {\n if (!schema.type.some(matchesType)) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: schema.errorMessage || localize('typeArrayMismatchWarning', 'Incorrect type. Expected one of {0}.', schema.type.join(', '))\n });\n }\n }\n else if (schema.type) {\n if (!matchesType(schema.type)) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: schema.errorMessage || localize('typeMismatchWarning', 'Incorrect type. Expected \"{0}\".', schema.type)\n });\n }\n }\n if (Array.isArray(schema.allOf)) {\n for (var _i = 0, _a = schema.allOf; _i < _a.length; _i++) {\n var subSchemaRef = _a[_i];\n validate(node, asSchema(subSchemaRef), validationResult, matchingSchemas);\n }\n }\n var notSchema = asSchema(schema.not);\n if (notSchema) {\n var subValidationResult = new ValidationResult();\n var subMatchingSchemas = matchingSchemas.newSub();\n validate(node, notSchema, subValidationResult, subMatchingSchemas);\n if (!subValidationResult.hasProblems()) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('notSchemaWarning', \"Matches a schema that is not allowed.\")\n });\n }\n for (var _b = 0, _c = subMatchingSchemas.schemas; _b < _c.length; _b++) {\n var ms = _c[_b];\n ms.inverted = !ms.inverted;\n matchingSchemas.add(ms);\n }\n }\n var testAlternatives = function (alternatives, maxOneMatch) {\n var matches = [];\n // remember the best match that is used for error messages\n var bestMatch = undefined;\n for (var _i = 0, alternatives_1 = alternatives; _i < alternatives_1.length; _i++) {\n var subSchemaRef = alternatives_1[_i];\n var subSchema = asSchema(subSchemaRef);\n var subValidationResult = new ValidationResult();\n var subMatchingSchemas = matchingSchemas.newSub();\n validate(node, subSchema, subValidationResult, subMatchingSchemas);\n if (!subValidationResult.hasProblems()) {\n matches.push(subSchema);\n }\n if (!bestMatch) {\n bestMatch = { schema: subSchema, validationResult: subValidationResult, matchingSchemas: subMatchingSchemas };\n }\n else {\n if (!maxOneMatch && !subValidationResult.hasProblems() && !bestMatch.validationResult.hasProblems()) {\n // no errors, both are equally good matches\n bestMatch.matchingSchemas.merge(subMatchingSchemas);\n bestMatch.validationResult.propertiesMatches += subValidationResult.propertiesMatches;\n bestMatch.validationResult.propertiesValueMatches += subValidationResult.propertiesValueMatches;\n }\n else {\n var compareResult = subValidationResult.compare(bestMatch.validationResult);\n if (compareResult > 0) {\n // our node is the best matching so far\n bestMatch = { schema: subSchema, validationResult: subValidationResult, matchingSchemas: subMatchingSchemas };\n }\n else if (compareResult === 0) {\n // there's already a best matching but we are as good\n bestMatch.matchingSchemas.merge(subMatchingSchemas);\n bestMatch.validationResult.mergeEnumValues(subValidationResult);\n }\n }\n }\n }\n if (matches.length > 1 && maxOneMatch) {\n validationResult.problems.push({\n location: { offset: node.offset, length: 1 },\n severity: DiagnosticSeverity.Warning,\n message: localize('oneOfWarning', \"Matches multiple schemas when only one must validate.\")\n });\n }\n if (bestMatch) {\n validationResult.merge(bestMatch.validationResult);\n validationResult.propertiesMatches += bestMatch.validationResult.propertiesMatches;\n validationResult.propertiesValueMatches += bestMatch.validationResult.propertiesValueMatches;\n matchingSchemas.merge(bestMatch.matchingSchemas);\n }\n return matches.length;\n };\n if (Array.isArray(schema.anyOf)) {\n testAlternatives(schema.anyOf, false);\n }\n if (Array.isArray(schema.oneOf)) {\n testAlternatives(schema.oneOf, true);\n }\n var testBranch = function (schema) {\n var subValidationResult = new ValidationResult();\n var subMatchingSchemas = matchingSchemas.newSub();\n validate(node, asSchema(schema), subValidationResult, subMatchingSchemas);\n validationResult.merge(subValidationResult);\n validationResult.propertiesMatches += subValidationResult.propertiesMatches;\n validationResult.propertiesValueMatches += subValidationResult.propertiesValueMatches;\n matchingSchemas.merge(subMatchingSchemas);\n };\n var testCondition = function (ifSchema, thenSchema, elseSchema) {\n var subSchema = asSchema(ifSchema);\n var subValidationResult = new ValidationResult();\n var subMatchingSchemas = matchingSchemas.newSub();\n validate(node, subSchema, subValidationResult, subMatchingSchemas);\n matchingSchemas.merge(subMatchingSchemas);\n if (!subValidationResult.hasProblems()) {\n if (thenSchema) {\n testBranch(thenSchema);\n }\n }\n else if (elseSchema) {\n testBranch(elseSchema);\n }\n };\n var ifSchema = asSchema(schema.if);\n if (ifSchema) {\n testCondition(ifSchema, asSchema(schema.then), asSchema(schema.else));\n }\n if (Array.isArray(schema.enum)) {\n var val = getNodeValue(node);\n var enumValueMatch = false;\n for (var _d = 0, _e = schema.enum; _d < _e.length; _d++) {\n var e = _e[_d];\n if (equals(val, e)) {\n enumValueMatch = true;\n break;\n }\n }\n validationResult.enumValues = schema.enum;\n validationResult.enumValueMatch = enumValueMatch;\n if (!enumValueMatch) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n code: ErrorCode.EnumValueMismatch,\n message: schema.errorMessage || localize('enumWarning', 'Value is not accepted. Valid values: {0}.', schema.enum.map(function (v) { return JSON.stringify(v); }).join(', '))\n });\n }\n }\n if (isDefined(schema.const)) {\n var val = getNodeValue(node);\n if (!equals(val, schema.const)) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n code: ErrorCode.EnumValueMismatch,\n message: schema.errorMessage || localize('constWarning', 'Value must be {0}.', JSON.stringify(schema.const))\n });\n validationResult.enumValueMatch = false;\n }\n else {\n validationResult.enumValueMatch = true;\n }\n validationResult.enumValues = [schema.const];\n }\n if (schema.deprecationMessage && node.parent) {\n validationResult.problems.push({\n location: { offset: node.parent.offset, length: node.parent.length },\n severity: DiagnosticSeverity.Warning,\n message: schema.deprecationMessage\n });\n }\n }\n function _validateNumberNode(node, schema, validationResult, matchingSchemas) {\n var val = node.value;\n function normalizeFloats(float) {\n var _a;\n var parts = /^(-?\\d+)(?:\\.(\\d+))?(?:e([-+]\\d+))?$/.exec(float.toString());\n return parts && {\n value: Number(parts[1] + (parts[2] || '')),\n multiplier: (((_a = parts[2]) === null || _a === void 0 ? void 0 : _a.length) || 0) - (parseInt(parts[3]) || 0)\n };\n }\n ;\n if (isNumber(schema.multipleOf)) {\n var remainder = -1;\n if (Number.isInteger(schema.multipleOf)) {\n remainder = val % schema.multipleOf;\n }\n else {\n var normMultipleOf = normalizeFloats(schema.multipleOf);\n var normValue = normalizeFloats(val);\n if (normMultipleOf && normValue) {\n var multiplier = Math.pow(10, Math.abs(normValue.multiplier - normMultipleOf.multiplier));\n if (normValue.multiplier < normMultipleOf.multiplier) {\n normValue.value *= multiplier;\n }\n else {\n normMultipleOf.value *= multiplier;\n }\n remainder = normValue.value % normMultipleOf.value;\n }\n }\n if (remainder !== 0) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('multipleOfWarning', 'Value is not divisible by {0}.', schema.multipleOf)\n });\n }\n }\n function getExclusiveLimit(limit, exclusive) {\n if (isNumber(exclusive)) {\n return exclusive;\n }\n if (isBoolean(exclusive) && exclusive) {\n return limit;\n }\n return undefined;\n }\n function getLimit(limit, exclusive) {\n if (!isBoolean(exclusive) || !exclusive) {\n return limit;\n }\n return undefined;\n }\n var exclusiveMinimum = getExclusiveLimit(schema.minimum, schema.exclusiveMinimum);\n if (isNumber(exclusiveMinimum) && val <= exclusiveMinimum) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('exclusiveMinimumWarning', 'Value is below the exclusive minimum of {0}.', exclusiveMinimum)\n });\n }\n var exclusiveMaximum = getExclusiveLimit(schema.maximum, schema.exclusiveMaximum);\n if (isNumber(exclusiveMaximum) && val >= exclusiveMaximum) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('exclusiveMaximumWarning', 'Value is above the exclusive maximum of {0}.', exclusiveMaximum)\n });\n }\n var minimum = getLimit(schema.minimum, schema.exclusiveMinimum);\n if (isNumber(minimum) && val < minimum) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('minimumWarning', 'Value is below the minimum of {0}.', minimum)\n });\n }\n var maximum = getLimit(schema.maximum, schema.exclusiveMaximum);\n if (isNumber(maximum) && val > maximum) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('maximumWarning', 'Value is above the maximum of {0}.', maximum)\n });\n }\n }\n function _validateStringNode(node, schema, validationResult, matchingSchemas) {\n if (isNumber(schema.minLength) && node.value.length < schema.minLength) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('minLengthWarning', 'String is shorter than the minimum length of {0}.', schema.minLength)\n });\n }\n if (isNumber(schema.maxLength) && node.value.length > schema.maxLength) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('maxLengthWarning', 'String is longer than the maximum length of {0}.', schema.maxLength)\n });\n }\n if (isString(schema.pattern)) {\n var regex = new RegExp(schema.pattern);\n if (!regex.test(node.value)) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: schema.patternErrorMessage || schema.errorMessage || localize('patternWarning', 'String does not match the pattern of \"{0}\".', schema.pattern)\n });\n }\n }\n if (schema.format) {\n switch (schema.format) {\n case 'uri':\n case 'uri-reference':\n {\n var errorMessage = void 0;\n if (!node.value) {\n errorMessage = localize('uriEmpty', 'URI expected.');\n }\n else {\n var match = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/.exec(node.value);\n if (!match) {\n errorMessage = localize('uriMissing', 'URI is expected.');\n }\n else if (!match[2] && schema.format === 'uri') {\n errorMessage = localize('uriSchemeMissing', 'URI with a scheme is expected.');\n }\n }\n if (errorMessage) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: schema.patternErrorMessage || schema.errorMessage || localize('uriFormatWarning', 'String is not a URI: {0}', errorMessage)\n });\n }\n }\n break;\n case 'color-hex':\n case 'date-time':\n case 'date':\n case 'time':\n case 'email':\n var format = formats[schema.format];\n if (!node.value || !format.pattern.exec(node.value)) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: schema.patternErrorMessage || schema.errorMessage || format.errorMessage\n });\n }\n default:\n }\n }\n }\n function _validateArrayNode(node, schema, validationResult, matchingSchemas) {\n if (Array.isArray(schema.items)) {\n var subSchemas = schema.items;\n for (var index = 0; index < subSchemas.length; index++) {\n var subSchemaRef = subSchemas[index];\n var subSchema = asSchema(subSchemaRef);\n var itemValidationResult = new ValidationResult();\n var item = node.items[index];\n if (item) {\n validate(item, subSchema, itemValidationResult, matchingSchemas);\n validationResult.mergePropertyMatch(itemValidationResult);\n }\n else if (node.items.length >= subSchemas.length) {\n validationResult.propertiesValueMatches++;\n }\n }\n if (node.items.length > subSchemas.length) {\n if (typeof schema.additionalItems === 'object') {\n for (var i = subSchemas.length; i < node.items.length; i++) {\n var itemValidationResult = new ValidationResult();\n validate(node.items[i], schema.additionalItems, itemValidationResult, matchingSchemas);\n validationResult.mergePropertyMatch(itemValidationResult);\n }\n }\n else if (schema.additionalItems === false) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('additionalItemsWarning', 'Array has too many items according to schema. Expected {0} or fewer.', subSchemas.length)\n });\n }\n }\n }\n else {\n var itemSchema = asSchema(schema.items);\n if (itemSchema) {\n for (var _i = 0, _a = node.items; _i < _a.length; _i++) {\n var item = _a[_i];\n var itemValidationResult = new ValidationResult();\n validate(item, itemSchema, itemValidationResult, matchingSchemas);\n validationResult.mergePropertyMatch(itemValidationResult);\n }\n }\n }\n var containsSchema = asSchema(schema.contains);\n if (containsSchema) {\n var doesContain = node.items.some(function (item) {\n var itemValidationResult = new ValidationResult();\n validate(item, containsSchema, itemValidationResult, NoOpSchemaCollector.instance);\n return !itemValidationResult.hasProblems();\n });\n if (!doesContain) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: schema.errorMessage || localize('requiredItemMissingWarning', 'Array does not contain required item.')\n });\n }\n }\n if (isNumber(schema.minItems) && node.items.length < schema.minItems) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('minItemsWarning', 'Array has too few items. Expected {0} or more.', schema.minItems)\n });\n }\n if (isNumber(schema.maxItems) && node.items.length > schema.maxItems) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('maxItemsWarning', 'Array has too many items. Expected {0} or fewer.', schema.maxItems)\n });\n }\n if (schema.uniqueItems === true) {\n var values_1 = getNodeValue(node);\n var duplicates = values_1.some(function (value, index) {\n return index !== values_1.lastIndexOf(value);\n });\n if (duplicates) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('uniqueItemsWarning', 'Array has duplicate items.')\n });\n }\n }\n }\n function _validateObjectNode(node, schema, validationResult, matchingSchemas) {\n var seenKeys = Object.create(null);\n var unprocessedProperties = [];\n for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {\n var propertyNode = _a[_i];\n var key = propertyNode.keyNode.value;\n seenKeys[key] = propertyNode.valueNode;\n unprocessedProperties.push(key);\n }\n if (Array.isArray(schema.required)) {\n for (var _b = 0, _c = schema.required; _b < _c.length; _b++) {\n var propertyName = _c[_b];\n if (!seenKeys[propertyName]) {\n var keyNode = node.parent && node.parent.type === 'property' && node.parent.keyNode;\n var location = keyNode ? { offset: keyNode.offset, length: keyNode.length } : { offset: node.offset, length: 1 };\n validationResult.problems.push({\n location: location,\n severity: DiagnosticSeverity.Warning,\n message: localize('MissingRequiredPropWarning', 'Missing property \"{0}\".', propertyName)\n });\n }\n }\n }\n var propertyProcessed = function (prop) {\n var index = unprocessedProperties.indexOf(prop);\n while (index >= 0) {\n unprocessedProperties.splice(index, 1);\n index = unprocessedProperties.indexOf(prop);\n }\n };\n if (schema.properties) {\n for (var _d = 0, _e = Object.keys(schema.properties); _d < _e.length; _d++) {\n var propertyName = _e[_d];\n propertyProcessed(propertyName);\n var propertySchema = schema.properties[propertyName];\n var child = seenKeys[propertyName];\n if (child) {\n if (isBoolean(propertySchema)) {\n if (!propertySchema) {\n var propertyNode = child.parent;\n validationResult.problems.push({\n location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },\n severity: DiagnosticSeverity.Warning,\n message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)\n });\n }\n else {\n validationResult.propertiesMatches++;\n validationResult.propertiesValueMatches++;\n }\n }\n else {\n var propertyValidationResult = new ValidationResult();\n validate(child, propertySchema, propertyValidationResult, matchingSchemas);\n validationResult.mergePropertyMatch(propertyValidationResult);\n }\n }\n }\n }\n if (schema.patternProperties) {\n for (var _f = 0, _g = Object.keys(schema.patternProperties); _f < _g.length; _f++) {\n var propertyPattern = _g[_f];\n var regex = new RegExp(propertyPattern);\n for (var _h = 0, _j = unprocessedProperties.slice(0); _h < _j.length; _h++) {\n var propertyName = _j[_h];\n if (regex.test(propertyName)) {\n propertyProcessed(propertyName);\n var child = seenKeys[propertyName];\n if (child) {\n var propertySchema = schema.patternProperties[propertyPattern];\n if (isBoolean(propertySchema)) {\n if (!propertySchema) {\n var propertyNode = child.parent;\n validationResult.problems.push({\n location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },\n severity: DiagnosticSeverity.Warning,\n message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)\n });\n }\n else {\n validationResult.propertiesMatches++;\n validationResult.propertiesValueMatches++;\n }\n }\n else {\n var propertyValidationResult = new ValidationResult();\n validate(child, propertySchema, propertyValidationResult, matchingSchemas);\n validationResult.mergePropertyMatch(propertyValidationResult);\n }\n }\n }\n }\n }\n }\n if (typeof schema.additionalProperties === 'object') {\n for (var _k = 0, unprocessedProperties_1 = unprocessedProperties; _k < unprocessedProperties_1.length; _k++) {\n var propertyName = unprocessedProperties_1[_k];\n var child = seenKeys[propertyName];\n if (child) {\n var propertyValidationResult = new ValidationResult();\n validate(child, schema.additionalProperties, propertyValidationResult, matchingSchemas);\n validationResult.mergePropertyMatch(propertyValidationResult);\n }\n }\n }\n else if (schema.additionalProperties === false) {\n if (unprocessedProperties.length > 0) {\n for (var _l = 0, unprocessedProperties_2 = unprocessedProperties; _l < unprocessedProperties_2.length; _l++) {\n var propertyName = unprocessedProperties_2[_l];\n var child = seenKeys[propertyName];\n if (child) {\n var propertyNode = child.parent;\n validationResult.problems.push({\n location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },\n severity: DiagnosticSeverity.Warning,\n message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)\n });\n }\n }\n }\n }\n if (isNumber(schema.maxProperties)) {\n if (node.properties.length > schema.maxProperties) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('MaxPropWarning', 'Object has more properties than limit of {0}.', schema.maxProperties)\n });\n }\n }\n if (isNumber(schema.minProperties)) {\n if (node.properties.length < schema.minProperties) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('MinPropWarning', 'Object has fewer properties than the required number of {0}', schema.minProperties)\n });\n }\n }\n if (schema.dependencies) {\n for (var _m = 0, _o = Object.keys(schema.dependencies); _m < _o.length; _m++) {\n var key = _o[_m];\n var prop = seenKeys[key];\n if (prop) {\n var propertyDep = schema.dependencies[key];\n if (Array.isArray(propertyDep)) {\n for (var _p = 0, propertyDep_1 = propertyDep; _p < propertyDep_1.length; _p++) {\n var requiredProp = propertyDep_1[_p];\n if (!seenKeys[requiredProp]) {\n validationResult.problems.push({\n location: { offset: node.offset, length: node.length },\n severity: DiagnosticSeverity.Warning,\n message: localize('RequiredDependentPropWarning', 'Object is missing property {0} required by property {1}.', requiredProp, key)\n });\n }\n else {\n validationResult.propertiesValueMatches++;\n }\n }\n }\n else {\n var propertySchema = asSchema(propertyDep);\n if (propertySchema) {\n var propertyValidationResult = new ValidationResult();\n validate(node, propertySchema, propertyValidationResult, matchingSchemas);\n validationResult.mergePropertyMatch(propertyValidationResult);\n }\n }\n }\n }\n }\n var propertyNames = asSchema(schema.propertyNames);\n if (propertyNames) {\n for (var _q = 0, _r = node.properties; _q < _r.length; _q++) {\n var f = _r[_q];\n var key = f.keyNode;\n if (key) {\n validate(key, propertyNames, validationResult, NoOpSchemaCollector.instance);\n }\n }\n }\n }\n}\nexport function parse(textDocument, config) {\n var problems = [];\n var lastProblemOffset = -1;\n var text = textDocument.getText();\n var scanner = Json.createScanner(text, false);\n var commentRanges = config && config.collectComments ? [] : undefined;\n function _scanNext() {\n while (true) {\n var token_1 = scanner.scan();\n _checkScanError();\n switch (token_1) {\n case 12 /* LineCommentTrivia */:\n case 13 /* BlockCommentTrivia */:\n if (Array.isArray(commentRanges)) {\n commentRanges.push(Range.create(textDocument.positionAt(scanner.getTokenOffset()), textDocument.positionAt(scanner.getTokenOffset() + scanner.getTokenLength())));\n }\n break;\n case 15 /* Trivia */:\n case 14 /* LineBreakTrivia */:\n break;\n default:\n return token_1;\n }\n }\n }\n function _accept(token) {\n if (scanner.getToken() === token) {\n _scanNext();\n return true;\n }\n return false;\n }\n function _errorAtRange(message, code, startOffset, endOffset, severity) {\n if (severity === void 0) { severity = DiagnosticSeverity.Error; }\n if (problems.length === 0 || startOffset !== lastProblemOffset) {\n var range = Range.create(textDocument.positionAt(startOffset), textDocument.positionAt(endOffset));\n problems.push(Diagnostic.create(range, message, severity, code, textDocument.languageId));\n lastProblemOffset = startOffset;\n }\n }\n function _error(message, code, node, skipUntilAfter, skipUntil) {\n if (node === void 0) { node = undefined; }\n if (skipUntilAfter === void 0) { skipUntilAfter = []; }\n if (skipUntil === void 0) { skipUntil = []; }\n var start = scanner.getTokenOffset();\n var end = scanner.getTokenOffset() + scanner.getTokenLength();\n if (start === end && start > 0) {\n start--;\n while (start > 0 && /\\s/.test(text.charAt(start))) {\n start--;\n }\n end = start + 1;\n }\n _errorAtRange(message, code, start, end);\n if (node) {\n _finalize(node, false);\n }\n if (skipUntilAfter.length + skipUntil.length > 0) {\n var token_2 = scanner.getToken();\n while (token_2 !== 17 /* EOF */) {\n if (skipUntilAfter.indexOf(token_2) !== -1) {\n _scanNext();\n break;\n }\n else if (skipUntil.indexOf(token_2) !== -1) {\n break;\n }\n token_2 = _scanNext();\n }\n }\n return node;\n }\n function _checkScanError() {\n switch (scanner.getTokenError()) {\n case 4 /* InvalidUnicode */:\n _error(localize('InvalidUnicode', 'Invalid unicode sequence in string.'), ErrorCode.InvalidUnicode);\n return true;\n case 5 /* InvalidEscapeCharacter */:\n _error(localize('InvalidEscapeCharacter', 'Invalid escape character in string.'), ErrorCode.InvalidEscapeCharacter);\n return true;\n case 3 /* UnexpectedEndOfNumber */:\n _error(localize('UnexpectedEndOfNumber', 'Unexpected end of number.'), ErrorCode.UnexpectedEndOfNumber);\n return true;\n case 1 /* UnexpectedEndOfComment */:\n _error(localize('UnexpectedEndOfComment', 'Unexpected end of comment.'), ErrorCode.UnexpectedEndOfComment);\n return true;\n case 2 /* UnexpectedEndOfString */:\n _error(localize('UnexpectedEndOfString', 'Unexpected end of string.'), ErrorCode.UnexpectedEndOfString);\n return true;\n case 6 /* InvalidCharacter */:\n _error(localize('InvalidCharacter', 'Invalid characters in string. Control characters must be escaped.'), ErrorCode.InvalidCharacter);\n return true;\n }\n return false;\n }\n function _finalize(node, scanNext) {\n node.length = scanner.getTokenOffset() + scanner.getTokenLength() - node.offset;\n if (scanNext) {\n _scanNext();\n }\n return node;\n }\n function _parseArray(parent) {\n if (scanner.getToken() !== 3 /* OpenBracketToken */) {\n return undefined;\n }\n var node = new ArrayASTNodeImpl(parent, scanner.getTokenOffset());\n _scanNext(); // consume OpenBracketToken\n var count = 0;\n var needsComma = false;\n while (scanner.getToken() !== 4 /* CloseBracketToken */ && scanner.getToken() !== 17 /* EOF */) {\n if (scanner.getToken() === 5 /* CommaToken */) {\n if (!needsComma) {\n _error(localize('ValueExpected', 'Value expected'), ErrorCode.ValueExpected);\n }\n var commaOffset = scanner.getTokenOffset();\n _scanNext(); // consume comma\n if (scanner.getToken() === 4 /* CloseBracketToken */) {\n if (needsComma) {\n _errorAtRange(localize('TrailingComma', 'Trailing comma'), ErrorCode.TrailingComma, commaOffset, commaOffset + 1);\n }\n continue;\n }\n }\n else if (needsComma) {\n _error(localize('ExpectedComma', 'Expected comma'), ErrorCode.CommaExpected);\n }\n var item = _parseValue(node);\n if (!item) {\n _error(localize('PropertyExpected', 'Value expected'), ErrorCode.ValueExpected, undefined, [], [4 /* CloseBracketToken */, 5 /* CommaToken */]);\n }\n else {\n node.items.push(item);\n }\n needsComma = true;\n }\n if (scanner.getToken() !== 4 /* CloseBracketToken */) {\n return _error(localize('ExpectedCloseBracket', 'Expected comma or closing bracket'), ErrorCode.CommaOrCloseBacketExpected, node);\n }\n return _finalize(node, true);\n }\n var keyPlaceholder = new StringASTNodeImpl(undefined, 0, 0);\n function _parseProperty(parent, keysSeen) {\n var node = new PropertyASTNodeImpl(parent, scanner.getTokenOffset(), keyPlaceholder);\n var key = _parseString(node);\n if (!key) {\n if (scanner.getToken() === 16 /* Unknown */) {\n // give a more helpful error message\n _error(localize('DoubleQuotesExpected', 'Property keys must be doublequoted'), ErrorCode.Undefined);\n var keyNode = new StringASTNodeImpl(node, scanner.getTokenOffset(), scanner.getTokenLength());\n keyNode.value = scanner.getTokenValue();\n key = keyNode;\n _scanNext(); // consume Unknown\n }\n else {\n return undefined;\n }\n }\n node.keyNode = key;\n var seen = keysSeen[key.value];\n if (seen) {\n _errorAtRange(localize('DuplicateKeyWarning', \"Duplicate object key\"), ErrorCode.DuplicateKey, node.keyNode.offset, node.keyNode.offset + node.keyNode.length, DiagnosticSeverity.Warning);\n if (typeof seen === 'object') {\n _errorAtRange(localize('DuplicateKeyWarning', \"Duplicate object key\"), ErrorCode.DuplicateKey, seen.keyNode.offset, seen.keyNode.offset + seen.keyNode.length, DiagnosticSeverity.Warning);\n }\n keysSeen[key.value] = true; // if the same key is duplicate again, avoid duplicate error reporting\n }\n else {\n keysSeen[key.value] = node;\n }\n if (scanner.getToken() === 6 /* ColonToken */) {\n node.colonOffset = scanner.getTokenOffset();\n _scanNext(); // consume ColonToken\n }\n else {\n _error(localize('ColonExpected', 'Colon expected'), ErrorCode.ColonExpected);\n if (scanner.getToken() === 10 /* StringLiteral */ && textDocument.positionAt(key.offset + key.length).line < textDocument.positionAt(scanner.getTokenOffset()).line) {\n node.length = key.length;\n return node;\n }\n }\n var value = _parseValue(node);\n if (!value) {\n return _error(localize('ValueExpected', 'Value expected'), ErrorCode.ValueExpected, node, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n }\n node.valueNode = value;\n node.length = value.offset + value.length - node.offset;\n return node;\n }\n function _parseObject(parent) {\n if (scanner.getToken() !== 1 /* OpenBraceToken */) {\n return undefined;\n }\n var node = new ObjectASTNodeImpl(parent, scanner.getTokenOffset());\n var keysSeen = Object.create(null);\n _scanNext(); // consume OpenBraceToken\n var needsComma = false;\n while (scanner.getToken() !== 2 /* CloseBraceToken */ && scanner.getToken() !== 17 /* EOF */) {\n if (scanner.getToken() === 5 /* CommaToken */) {\n if (!needsComma) {\n _error(localize('PropertyExpected', 'Property expected'), ErrorCode.PropertyExpected);\n }\n var commaOffset = scanner.getTokenOffset();\n _scanNext(); // consume comma\n if (scanner.getToken() === 2 /* CloseBraceToken */) {\n if (needsComma) {\n _errorAtRange(localize('TrailingComma', 'Trailing comma'), ErrorCode.TrailingComma, commaOffset, commaOffset + 1);\n }\n continue;\n }\n }\n else if (needsComma) {\n _error(localize('ExpectedComma', 'Expected comma'), ErrorCode.CommaExpected);\n }\n var property = _parseProperty(node, keysSeen);\n if (!property) {\n _error(localize('PropertyExpected', 'Property expected'), ErrorCode.PropertyExpected, undefined, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n }\n else {\n node.properties.push(property);\n }\n needsComma = true;\n }\n if (scanner.getToken() !== 2 /* CloseBraceToken */) {\n return _error(localize('ExpectedCloseBrace', 'Expected comma or closing brace'), ErrorCode.CommaOrCloseBraceExpected, node);\n }\n return _finalize(node, true);\n }\n function _parseString(parent) {\n if (scanner.getToken() !== 10 /* StringLiteral */) {\n return undefined;\n }\n var node = new StringASTNodeImpl(parent, scanner.getTokenOffset());\n node.value = scanner.getTokenValue();\n return _finalize(node, true);\n }\n function _parseNumber(parent) {\n if (scanner.getToken() !== 11 /* NumericLiteral */) {\n return undefined;\n }\n var node = new NumberASTNodeImpl(parent, scanner.getTokenOffset());\n if (scanner.getTokenError() === 0 /* None */) {\n var tokenValue = scanner.getTokenValue();\n try {\n var numberValue = JSON.parse(tokenValue);\n if (!isNumber(numberValue)) {\n return _error(localize('InvalidNumberFormat', 'Invalid number format.'), ErrorCode.Undefined, node);\n }\n node.value = numberValue;\n }\n catch (e) {\n return _error(localize('InvalidNumberFormat', 'Invalid number format.'), ErrorCode.Undefined, node);\n }\n node.isInteger = tokenValue.indexOf('.') === -1;\n }\n return _finalize(node, true);\n }\n function _parseLiteral(parent) {\n var node;\n switch (scanner.getToken()) {\n case 7 /* NullKeyword */:\n return _finalize(new NullASTNodeImpl(parent, scanner.getTokenOffset()), true);\n case 8 /* TrueKeyword */:\n return _finalize(new BooleanASTNodeImpl(parent, true, scanner.getTokenOffset()), true);\n case 9 /* FalseKeyword */:\n return _finalize(new BooleanASTNodeImpl(parent, false, scanner.getTokenOffset()), true);\n default:\n return undefined;\n }\n }\n function _parseValue(parent) {\n return _parseArray(parent) || _parseObject(parent) || _parseString(parent) || _parseNumber(parent) || _parseLiteral(parent);\n }\n var _root = undefined;\n var token = _scanNext();\n if (token !== 17 /* EOF */) {\n _root = _parseValue(_root);\n if (!_root) {\n _error(localize('Invalid symbol', 'Expected a JSON object, array or literal.'), ErrorCode.Undefined);\n }\n else if (scanner.getToken() !== 17 /* EOF */) {\n _error(localize('End of file expected', 'End of file expected.'), ErrorCode.Undefined);\n }\n }\n return new JSONDocument(_root, problems, commentRanges);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as nls from '../../../fillers/vscode-nls.js';\nvar localize = nls.loadMessageBundle();\nexport var schemaContributions = {\n schemaAssociations: [],\n schemas: {\n // refer to the latest schema\n 'http://json-schema.org/schema#': {\n $ref: 'http://json-schema.org/draft-07/schema#'\n },\n // bundle the schema-schema to include (localized) descriptions\n 'http://json-schema.org/draft-04/schema#': {\n 'title': localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'),\n '$schema': 'http://json-schema.org/draft-04/schema#',\n 'definitions': {\n 'schemaArray': {\n 'type': 'array',\n 'minItems': 1,\n 'items': {\n '$ref': '#'\n }\n },\n 'positiveInteger': {\n 'type': 'integer',\n 'minimum': 0\n },\n 'positiveIntegerDefault0': {\n 'allOf': [\n {\n '$ref': '#/definitions/positiveInteger'\n },\n {\n 'default': 0\n }\n ]\n },\n 'simpleTypes': {\n 'type': 'string',\n 'enum': [\n 'array',\n 'boolean',\n 'integer',\n 'null',\n 'number',\n 'object',\n 'string'\n ]\n },\n 'stringArray': {\n 'type': 'array',\n 'items': {\n 'type': 'string'\n },\n 'minItems': 1,\n 'uniqueItems': true\n }\n },\n 'type': 'object',\n 'properties': {\n 'id': {\n 'type': 'string',\n 'format': 'uri'\n },\n '$schema': {\n 'type': 'string',\n 'format': 'uri'\n },\n 'title': {\n 'type': 'string'\n },\n 'description': {\n 'type': 'string'\n },\n 'default': {},\n 'multipleOf': {\n 'type': 'number',\n 'minimum': 0,\n 'exclusiveMinimum': true\n },\n 'maximum': {\n 'type': 'number'\n },\n 'exclusiveMaximum': {\n 'type': 'boolean',\n 'default': false\n },\n 'minimum': {\n 'type': 'number'\n },\n 'exclusiveMinimum': {\n 'type': 'boolean',\n 'default': false\n },\n 'maxLength': {\n 'allOf': [\n {\n '$ref': '#/definitions/positiveInteger'\n }\n ]\n },\n 'minLength': {\n 'allOf': [\n {\n '$ref': '#/definitions/positiveIntegerDefault0'\n }\n ]\n },\n 'pattern': {\n 'type': 'string',\n 'format': 'regex'\n },\n 'additionalItems': {\n 'anyOf': [\n {\n 'type': 'boolean'\n },\n {\n '$ref': '#'\n }\n ],\n 'default': {}\n },\n 'items': {\n 'anyOf': [\n {\n '$ref': '#'\n },\n {\n '$ref': '#/definitions/schemaArray'\n }\n ],\n 'default': {}\n },\n 'maxItems': {\n 'allOf': [\n {\n '$ref': '#/definitions/positiveInteger'\n }\n ]\n },\n 'minItems': {\n 'allOf': [\n {\n '$ref': '#/definitions/positiveIntegerDefault0'\n }\n ]\n },\n 'uniqueItems': {\n 'type': 'boolean',\n 'default': false\n },\n 'maxProperties': {\n 'allOf': [\n {\n '$ref': '#/definitions/positiveInteger'\n }\n ]\n },\n 'minProperties': {\n 'allOf': [\n {\n '$ref': '#/definitions/positiveIntegerDefault0'\n }\n ]\n },\n 'required': {\n 'allOf': [\n {\n '$ref': '#/definitions/stringArray'\n }\n ]\n },\n 'additionalProperties': {\n 'anyOf': [\n {\n 'type': 'boolean'\n },\n {\n '$ref': '#'\n }\n ],\n 'default': {}\n },\n 'definitions': {\n 'type': 'object',\n 'additionalProperties': {\n '$ref': '#'\n },\n 'default': {}\n },\n 'properties': {\n 'type': 'object',\n 'additionalProperties': {\n '$ref': '#'\n },\n 'default': {}\n },\n 'patternProperties': {\n 'type': 'object',\n 'additionalProperties': {\n '$ref': '#'\n },\n 'default': {}\n },\n 'dependencies': {\n 'type': 'object',\n 'additionalProperties': {\n 'anyOf': [\n {\n '$ref': '#'\n },\n {\n '$ref': '#/definitions/stringArray'\n }\n ]\n }\n },\n 'enum': {\n 'type': 'array',\n 'minItems': 1,\n 'uniqueItems': true\n },\n 'type': {\n 'anyOf': [\n {\n '$ref': '#/definitions/simpleTypes'\n },\n {\n 'type': 'array',\n 'items': {\n '$ref': '#/definitions/simpleTypes'\n },\n 'minItems': 1,\n 'uniqueItems': true\n }\n ]\n },\n 'format': {\n 'anyOf': [\n {\n 'type': 'string',\n 'enum': [\n 'date-time',\n 'uri',\n 'email',\n 'hostname',\n 'ipv4',\n 'ipv6',\n 'regex'\n ]\n },\n {\n 'type': 'string'\n }\n ]\n },\n 'allOf': {\n 'allOf': [\n {\n '$ref': '#/definitions/schemaArray'\n }\n ]\n },\n 'anyOf': {\n 'allOf': [\n {\n '$ref': '#/definitions/schemaArray'\n }\n ]\n },\n 'oneOf': {\n 'allOf': [\n {\n '$ref': '#/definitions/schemaArray'\n }\n ]\n },\n 'not': {\n 'allOf': [\n {\n '$ref': '#'\n }\n ]\n }\n },\n 'dependencies': {\n 'exclusiveMaximum': [\n 'maximum'\n ],\n 'exclusiveMinimum': [\n 'minimum'\n ]\n },\n 'default': {}\n },\n 'http://json-schema.org/draft-07/schema#': {\n 'title': localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'),\n 'definitions': {\n 'schemaArray': {\n 'type': 'array',\n 'minItems': 1,\n 'items': { '$ref': '#' }\n },\n 'nonNegativeInteger': {\n 'type': 'integer',\n 'minimum': 0\n },\n 'nonNegativeIntegerDefault0': {\n 'allOf': [\n { '$ref': '#/definitions/nonNegativeInteger' },\n { 'default': 0 }\n ]\n },\n 'simpleTypes': {\n 'enum': [\n 'array',\n 'boolean',\n 'integer',\n 'null',\n 'number',\n 'object',\n 'string'\n ]\n },\n 'stringArray': {\n 'type': 'array',\n 'items': { 'type': 'string' },\n 'uniqueItems': true,\n 'default': []\n }\n },\n 'type': ['object', 'boolean'],\n 'properties': {\n '$id': {\n 'type': 'string',\n 'format': 'uri-reference'\n },\n '$schema': {\n 'type': 'string',\n 'format': 'uri'\n },\n '$ref': {\n 'type': 'string',\n 'format': 'uri-reference'\n },\n '$comment': {\n 'type': 'string'\n },\n 'title': {\n 'type': 'string'\n },\n 'description': {\n 'type': 'string'\n },\n 'default': true,\n 'readOnly': {\n 'type': 'boolean',\n 'default': false\n },\n 'examples': {\n 'type': 'array',\n 'items': true\n },\n 'multipleOf': {\n 'type': 'number',\n 'exclusiveMinimum': 0\n },\n 'maximum': {\n 'type': 'number'\n },\n 'exclusiveMaximum': {\n 'type': 'number'\n },\n 'minimum': {\n 'type': 'number'\n },\n 'exclusiveMinimum': {\n 'type': 'number'\n },\n 'maxLength': { '$ref': '#/definitions/nonNegativeInteger' },\n 'minLength': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },\n 'pattern': {\n 'type': 'string',\n 'format': 'regex'\n },\n 'additionalItems': { '$ref': '#' },\n 'items': {\n 'anyOf': [\n { '$ref': '#' },\n { '$ref': '#/definitions/schemaArray' }\n ],\n 'default': true\n },\n 'maxItems': { '$ref': '#/definitions/nonNegativeInteger' },\n 'minItems': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },\n 'uniqueItems': {\n 'type': 'boolean',\n 'default': false\n },\n 'contains': { '$ref': '#' },\n 'maxProperties': { '$ref': '#/definitions/nonNegativeInteger' },\n 'minProperties': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },\n 'required': { '$ref': '#/definitions/stringArray' },\n 'additionalProperties': { '$ref': '#' },\n 'definitions': {\n 'type': 'object',\n 'additionalProperties': { '$ref': '#' },\n 'default': {}\n },\n 'properties': {\n 'type': 'object',\n 'additionalProperties': { '$ref': '#' },\n 'default': {}\n },\n 'patternProperties': {\n 'type': 'object',\n 'additionalProperties': { '$ref': '#' },\n 'propertyNames': { 'format': 'regex' },\n 'default': {}\n },\n 'dependencies': {\n 'type': 'object',\n 'additionalProperties': {\n 'anyOf': [\n { '$ref': '#' },\n { '$ref': '#/definitions/stringArray' }\n ]\n }\n },\n 'propertyNames': { '$ref': '#' },\n 'const': true,\n 'enum': {\n 'type': 'array',\n 'items': true,\n 'minItems': 1,\n 'uniqueItems': true\n },\n 'type': {\n 'anyOf': [\n { '$ref': '#/definitions/simpleTypes' },\n {\n 'type': 'array',\n 'items': { '$ref': '#/definitions/simpleTypes' },\n 'minItems': 1,\n 'uniqueItems': true\n }\n ]\n },\n 'format': { 'type': 'string' },\n 'contentMediaType': { 'type': 'string' },\n 'contentEncoding': { 'type': 'string' },\n 'if': { '$ref': '#' },\n 'then': { '$ref': '#' },\n 'else': { '$ref': '#' },\n 'allOf': { '$ref': '#/definitions/schemaArray' },\n 'anyOf': { '$ref': '#/definitions/schemaArray' },\n 'oneOf': { '$ref': '#/definitions/schemaArray' },\n 'not': { '$ref': '#' }\n },\n 'default': true\n }\n }\n};\nvar descriptions = {\n id: localize('schema.json.id', \"A unique identifier for the schema.\"),\n $schema: localize('schema.json.$schema', \"The schema to verify this document against.\"),\n title: localize('schema.json.title', \"A descriptive title of the element.\"),\n description: localize('schema.json.description', \"A long description of the element. Used in hover menus and suggestions.\"),\n default: localize('schema.json.default', \"A default value. Used by suggestions.\"),\n multipleOf: localize('schema.json.multipleOf', \"A number that should cleanly divide the current value (i.e. have no remainder).\"),\n maximum: localize('schema.json.maximum', \"The maximum numerical value, inclusive by default.\"),\n exclusiveMaximum: localize('schema.json.exclusiveMaximum', \"Makes the maximum property exclusive.\"),\n minimum: localize('schema.json.minimum', \"The minimum numerical value, inclusive by default.\"),\n exclusiveMinimum: localize('schema.json.exclusiveMininum', \"Makes the minimum property exclusive.\"),\n maxLength: localize('schema.json.maxLength', \"The maximum length of a string.\"),\n minLength: localize('schema.json.minLength', \"The minimum length of a string.\"),\n pattern: localize('schema.json.pattern', \"A regular expression to match the string against. It is not implicitly anchored.\"),\n additionalItems: localize('schema.json.additionalItems', \"For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail.\"),\n items: localize('schema.json.items', \"For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on.\"),\n maxItems: localize('schema.json.maxItems', \"The maximum number of items that can be inside an array. Inclusive.\"),\n minItems: localize('schema.json.minItems', \"The minimum number of items that can be inside an array. Inclusive.\"),\n uniqueItems: localize('schema.json.uniqueItems', \"If all of the items in the array must be unique. Defaults to false.\"),\n maxProperties: localize('schema.json.maxProperties', \"The maximum number of properties an object can have. Inclusive.\"),\n minProperties: localize('schema.json.minProperties', \"The minimum number of properties an object can have. Inclusive.\"),\n required: localize('schema.json.required', \"An array of strings that lists the names of all properties required on this object.\"),\n additionalProperties: localize('schema.json.additionalProperties', \"Either a schema or a boolean. If a schema, then used to validate all properties not matched by 'properties' or 'patternProperties'. If false, then any properties not matched by either will cause this schema to fail.\"),\n definitions: localize('schema.json.definitions', \"Not used for validation. Place subschemas here that you wish to reference inline with $ref.\"),\n properties: localize('schema.json.properties', \"A map of property names to schemas for each property.\"),\n patternProperties: localize('schema.json.patternProperties', \"A map of regular expressions on property names to schemas for matching properties.\"),\n dependencies: localize('schema.json.dependencies', \"A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object.\"),\n enum: localize('schema.json.enum', \"The set of literal values that are valid.\"),\n type: localize('schema.json.type', \"Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types.\"),\n format: localize('schema.json.format', \"Describes the format expected for the value.\"),\n allOf: localize('schema.json.allOf', \"An array of schemas, all of which must match.\"),\n anyOf: localize('schema.json.anyOf', \"An array of schemas, where at least one must match.\"),\n oneOf: localize('schema.json.oneOf', \"An array of schemas, exactly one of which must match.\"),\n not: localize('schema.json.not', \"A schema which must not match.\"),\n $id: localize('schema.json.$id', \"A unique identifier for the schema.\"),\n $ref: localize('schema.json.$ref', \"Reference a definition hosted on any location.\"),\n $comment: localize('schema.json.$comment', \"Comments from schema authors to readers or maintainers of the schema.\"),\n readOnly: localize('schema.json.readOnly', \"Indicates that the value of the instance is managed exclusively by the owning authority.\"),\n examples: localize('schema.json.examples', \"Sample JSON values associated with a particular schema, for the purpose of illustrating usage.\"),\n contains: localize('schema.json.contains', \"An array instance is valid against \\\"contains\\\" if at least one of its elements is valid against the given schema.\"),\n propertyNames: localize('schema.json.propertyNames', \"If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema.\"),\n const: localize('schema.json.const', \"An instance validates successfully against this keyword if its value is equal to the value of the keyword.\"),\n contentMediaType: localize('schema.json.contentMediaType', \"Describes the media type of a string property.\"),\n contentEncoding: localize('schema.json.contentEncoding', \"Describes the content encoding of a string property.\"),\n if: localize('schema.json.if', \"The validation outcome of the \\\"if\\\" subschema controls which of the \\\"then\\\" or \\\"else\\\" keywords are evaluated.\"),\n then: localize('schema.json.then', \"The \\\"if\\\" subschema is used for validation when the \\\"if\\\" subschema succeeds.\"),\n else: localize('schema.json.else', \"The \\\"else\\\" subschema is used for validation when the \\\"if\\\" subschema fails.\")\n};\nfor (var schemaName in schemaContributions.schemas) {\n var schema = schemaContributions.schemas[schemaName];\n for (var property in schema.properties) {\n var propertyObject = schema.properties[property];\n if (typeof propertyObject === 'boolean') {\n propertyObject = schema.properties[property] = {};\n }\n var description = descriptions[property];\n if (description) {\n propertyObject['description'] = description;\n }\n else {\n console.log(property + \": localize('schema.json.\" + property + \"', \\\"\\\")\");\n }\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as Parser from '../parser/jsonParser.js';\nimport * as Json from '../../jsonc-parser/main.js';\nimport { stringifyObject } from '../utils/json.js';\nimport { endsWith } from '../utils/strings.js';\nimport { isDefined } from '../utils/objects.js';\nimport { CompletionItem, CompletionItemKind, Range, TextEdit, InsertTextFormat, MarkupKind } from '../jsonLanguageTypes.js';\nimport * as nls from '../../../fillers/vscode-nls.js';\nvar localize = nls.loadMessageBundle();\nvar valueCommitCharacters = [',', '}', ']'];\nvar propertyCommitCharacters = [':'];\nvar JSONCompletion = /** @class */ (function () {\n function JSONCompletion(schemaService, contributions, promiseConstructor, clientCapabilities) {\n if (contributions === void 0) { contributions = []; }\n if (promiseConstructor === void 0) { promiseConstructor = Promise; }\n if (clientCapabilities === void 0) { clientCapabilities = {}; }\n this.schemaService = schemaService;\n this.contributions = contributions;\n this.promiseConstructor = promiseConstructor;\n this.clientCapabilities = clientCapabilities;\n }\n JSONCompletion.prototype.doResolve = function (item) {\n for (var i = this.contributions.length - 1; i >= 0; i--) {\n var resolveCompletion = this.contributions[i].resolveCompletion;\n if (resolveCompletion) {\n var resolver = resolveCompletion(item);\n if (resolver) {\n return resolver;\n }\n }\n }\n return this.promiseConstructor.resolve(item);\n };\n JSONCompletion.prototype.doComplete = function (document, position, doc) {\n var _this = this;\n var result = {\n items: [],\n isIncomplete: false\n };\n var text = document.getText();\n var offset = document.offsetAt(position);\n var node = doc.getNodeFromOffset(offset, true);\n if (this.isInComment(document, node ? node.offset : 0, offset)) {\n return Promise.resolve(result);\n }\n if (node && (offset === node.offset + node.length) && offset > 0) {\n var ch = text[offset - 1];\n if (node.type === 'object' && ch === '}' || node.type === 'array' && ch === ']') {\n // after ] or }\n node = node.parent;\n }\n }\n var currentWord = this.getCurrentWord(document, offset);\n var overwriteRange;\n if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) {\n overwriteRange = Range.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length));\n }\n else {\n var overwriteStart = offset - currentWord.length;\n if (overwriteStart > 0 && text[overwriteStart - 1] === '\"') {\n overwriteStart--;\n }\n overwriteRange = Range.create(document.positionAt(overwriteStart), position);\n }\n var supportsCommitCharacters = false; //this.doesSupportsCommitCharacters(); disabled for now, waiting for new API: https://github.com/microsoft/vscode/issues/42544\n var proposed = {};\n var collector = {\n add: function (suggestion) {\n var label = suggestion.label;\n var existing = proposed[label];\n if (!existing) {\n label = label.replace(/[\\n]/g, '↵');\n if (label.length > 60) {\n var shortendedLabel = label.substr(0, 57).trim() + '...';\n if (!proposed[shortendedLabel]) {\n label = shortendedLabel;\n }\n }\n if (overwriteRange && suggestion.insertText !== undefined) {\n suggestion.textEdit = TextEdit.replace(overwriteRange, suggestion.insertText);\n }\n if (supportsCommitCharacters) {\n suggestion.commitCharacters = suggestion.kind === CompletionItemKind.Property ? propertyCommitCharacters : valueCommitCharacters;\n }\n suggestion.label = label;\n proposed[label] = suggestion;\n result.items.push(suggestion);\n }\n else if (!existing.documentation) {\n existing.documentation = suggestion.documentation;\n }\n },\n setAsIncomplete: function () {\n result.isIncomplete = true;\n },\n error: function (message) {\n console.error(message);\n },\n log: function (message) {\n console.log(message);\n },\n getNumberOfProposals: function () {\n return result.items.length;\n }\n };\n return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) {\n var collectionPromises = [];\n var addValue = true;\n var currentKey = '';\n var currentProperty = undefined;\n if (node) {\n if (node.type === 'string') {\n var parent = node.parent;\n if (parent && parent.type === 'property' && parent.keyNode === node) {\n addValue = !parent.valueNode;\n currentProperty = parent;\n currentKey = text.substr(node.offset + 1, node.length - 2);\n if (parent) {\n node = parent.parent;\n }\n }\n }\n }\n // proposals for properties\n if (node && node.type === 'object') {\n // don't suggest keys when the cursor is just before the opening curly brace\n if (node.offset === offset) {\n return result;\n }\n // don't suggest properties that are already present\n var properties = node.properties;\n properties.forEach(function (p) {\n if (!currentProperty || currentProperty !== p) {\n proposed[p.keyNode.value] = CompletionItem.create('__');\n }\n });\n var separatorAfter_1 = '';\n if (addValue) {\n separatorAfter_1 = _this.evaluateSeparatorAfter(document, document.offsetAt(overwriteRange.end));\n }\n if (schema) {\n // property proposals with schema\n _this.getPropertyCompletions(schema, doc, node, addValue, separatorAfter_1, collector);\n }\n else {\n // property proposals without schema\n _this.getSchemaLessPropertyCompletions(doc, node, currentKey, collector);\n }\n var location_1 = Parser.getNodePath(node);\n _this.contributions.forEach(function (contribution) {\n var collectPromise = contribution.collectPropertyCompletions(document.uri, location_1, currentWord, addValue, separatorAfter_1 === '', collector);\n if (collectPromise) {\n collectionPromises.push(collectPromise);\n }\n });\n if ((!schema && currentWord.length > 0 && text.charAt(offset - currentWord.length - 1) !== '\"')) {\n collector.add({\n kind: CompletionItemKind.Property,\n label: _this.getLabelForValue(currentWord),\n insertText: _this.getInsertTextForProperty(currentWord, undefined, false, separatorAfter_1),\n insertTextFormat: InsertTextFormat.Snippet, documentation: '',\n });\n collector.setAsIncomplete();\n }\n }\n // proposals for values\n var types = {};\n if (schema) {\n // value proposals with schema\n _this.getValueCompletions(schema, doc, node, offset, document, collector, types);\n }\n else {\n // value proposals without schema\n _this.getSchemaLessValueCompletions(doc, node, offset, document, collector);\n }\n if (_this.contributions.length > 0) {\n _this.getContributedValueCompletions(doc, node, offset, document, collector, collectionPromises);\n }\n return _this.promiseConstructor.all(collectionPromises).then(function () {\n if (collector.getNumberOfProposals() === 0) {\n var offsetForSeparator = offset;\n if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) {\n offsetForSeparator = node.offset + node.length;\n }\n var separatorAfter = _this.evaluateSeparatorAfter(document, offsetForSeparator);\n _this.addFillerValueCompletions(types, separatorAfter, collector);\n }\n return result;\n });\n });\n };\n JSONCompletion.prototype.getPropertyCompletions = function (schema, doc, node, addValue, separatorAfter, collector) {\n var _this = this;\n var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset);\n matchingSchemas.forEach(function (s) {\n if (s.node === node && !s.inverted) {\n var schemaProperties_1 = s.schema.properties;\n if (schemaProperties_1) {\n Object.keys(schemaProperties_1).forEach(function (key) {\n var propertySchema = schemaProperties_1[key];\n if (typeof propertySchema === 'object' && !propertySchema.deprecationMessage && !propertySchema.doNotSuggest) {\n var proposal = {\n kind: CompletionItemKind.Property,\n label: key,\n insertText: _this.getInsertTextForProperty(key, propertySchema, addValue, separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet,\n filterText: _this.getFilterTextForValue(key),\n documentation: _this.fromMarkup(propertySchema.markdownDescription) || propertySchema.description || '',\n };\n if (propertySchema.suggestSortText !== undefined) {\n proposal.sortText = propertySchema.suggestSortText;\n }\n if (proposal.insertText && endsWith(proposal.insertText, \"$1\" + separatorAfter)) {\n proposal.command = {\n title: 'Suggest',\n command: 'editor.action.triggerSuggest'\n };\n }\n collector.add(proposal);\n }\n });\n }\n var schemaPropertyNames_1 = s.schema.propertyNames;\n if (typeof schemaPropertyNames_1 === 'object' && !schemaPropertyNames_1.deprecationMessage && !schemaPropertyNames_1.doNotSuggest) {\n var propertyNameCompletionItem = function (name, enumDescription) {\n if (enumDescription === void 0) { enumDescription = undefined; }\n var proposal = {\n kind: CompletionItemKind.Property,\n label: name,\n insertText: _this.getInsertTextForProperty(name, undefined, addValue, separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet,\n filterText: _this.getFilterTextForValue(name),\n documentation: enumDescription || _this.fromMarkup(schemaPropertyNames_1.markdownDescription) || schemaPropertyNames_1.description || '',\n };\n if (schemaPropertyNames_1.suggestSortText !== undefined) {\n proposal.sortText = schemaPropertyNames_1.suggestSortText;\n }\n if (proposal.insertText && endsWith(proposal.insertText, \"$1\" + separatorAfter)) {\n proposal.command = {\n title: 'Suggest',\n command: 'editor.action.triggerSuggest'\n };\n }\n collector.add(proposal);\n };\n if (schemaPropertyNames_1.enum) {\n for (var i = 0; i < schemaPropertyNames_1.enum.length; i++) {\n var enumDescription = undefined;\n if (schemaPropertyNames_1.markdownEnumDescriptions && i < schemaPropertyNames_1.markdownEnumDescriptions.length) {\n enumDescription = _this.fromMarkup(schemaPropertyNames_1.markdownEnumDescriptions[i]);\n }\n else if (schemaPropertyNames_1.enumDescriptions && i < schemaPropertyNames_1.enumDescriptions.length) {\n enumDescription = schemaPropertyNames_1.enumDescriptions[i];\n }\n propertyNameCompletionItem(schemaPropertyNames_1.enum[i], enumDescription);\n }\n }\n if (schemaPropertyNames_1.const) {\n propertyNameCompletionItem(schemaPropertyNames_1.const);\n }\n }\n }\n });\n };\n JSONCompletion.prototype.getSchemaLessPropertyCompletions = function (doc, node, currentKey, collector) {\n var _this = this;\n var collectCompletionsForSimilarObject = function (obj) {\n obj.properties.forEach(function (p) {\n var key = p.keyNode.value;\n collector.add({\n kind: CompletionItemKind.Property,\n label: key,\n insertText: _this.getInsertTextForValue(key, ''),\n insertTextFormat: InsertTextFormat.Snippet,\n filterText: _this.getFilterTextForValue(key),\n documentation: ''\n });\n });\n };\n if (node.parent) {\n if (node.parent.type === 'property') {\n // if the object is a property value, check the tree for other objects that hang under a property of the same name\n var parentKey_1 = node.parent.keyNode.value;\n doc.visit(function (n) {\n if (n.type === 'property' && n !== node.parent && n.keyNode.value === parentKey_1 && n.valueNode && n.valueNode.type === 'object') {\n collectCompletionsForSimilarObject(n.valueNode);\n }\n return true;\n });\n }\n else if (node.parent.type === 'array') {\n // if the object is in an array, use all other array elements as similar objects\n node.parent.items.forEach(function (n) {\n if (n.type === 'object' && n !== node) {\n collectCompletionsForSimilarObject(n);\n }\n });\n }\n }\n else if (node.type === 'object') {\n collector.add({\n kind: CompletionItemKind.Property,\n label: '$schema',\n insertText: this.getInsertTextForProperty('$schema', undefined, true, ''),\n insertTextFormat: InsertTextFormat.Snippet, documentation: '',\n filterText: this.getFilterTextForValue(\"$schema\")\n });\n }\n };\n JSONCompletion.prototype.getSchemaLessValueCompletions = function (doc, node, offset, document, collector) {\n var _this = this;\n var offsetForSeparator = offset;\n if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) {\n offsetForSeparator = node.offset + node.length;\n node = node.parent;\n }\n if (!node) {\n collector.add({\n kind: this.getSuggestionKind('object'),\n label: 'Empty object',\n insertText: this.getInsertTextForValue({}, ''),\n insertTextFormat: InsertTextFormat.Snippet,\n documentation: ''\n });\n collector.add({\n kind: this.getSuggestionKind('array'),\n label: 'Empty array',\n insertText: this.getInsertTextForValue([], ''),\n insertTextFormat: InsertTextFormat.Snippet,\n documentation: ''\n });\n return;\n }\n var separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator);\n var collectSuggestionsForValues = function (value) {\n if (value.parent && !Parser.contains(value.parent, offset, true)) {\n collector.add({\n kind: _this.getSuggestionKind(value.type),\n label: _this.getLabelTextForMatchingNode(value, document),\n insertText: _this.getInsertTextForMatchingNode(value, document, separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet, documentation: ''\n });\n }\n if (value.type === 'boolean') {\n _this.addBooleanValueCompletion(!value.value, separatorAfter, collector);\n }\n };\n if (node.type === 'property') {\n if (offset > (node.colonOffset || 0)) {\n var valueNode = node.valueNode;\n if (valueNode && (offset > (valueNode.offset + valueNode.length) || valueNode.type === 'object' || valueNode.type === 'array')) {\n return;\n }\n // suggest values at the same key\n var parentKey_2 = node.keyNode.value;\n doc.visit(function (n) {\n if (n.type === 'property' && n.keyNode.value === parentKey_2 && n.valueNode) {\n collectSuggestionsForValues(n.valueNode);\n }\n return true;\n });\n if (parentKey_2 === '$schema' && node.parent && !node.parent.parent) {\n this.addDollarSchemaCompletions(separatorAfter, collector);\n }\n }\n }\n if (node.type === 'array') {\n if (node.parent && node.parent.type === 'property') {\n // suggest items of an array at the same key\n var parentKey_3 = node.parent.keyNode.value;\n doc.visit(function (n) {\n if (n.type === 'property' && n.keyNode.value === parentKey_3 && n.valueNode && n.valueNode.type === 'array') {\n n.valueNode.items.forEach(collectSuggestionsForValues);\n }\n return true;\n });\n }\n else {\n // suggest items in the same array\n node.items.forEach(collectSuggestionsForValues);\n }\n }\n };\n JSONCompletion.prototype.getValueCompletions = function (schema, doc, node, offset, document, collector, types) {\n var offsetForSeparator = offset;\n var parentKey = undefined;\n var valueNode = undefined;\n if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) {\n offsetForSeparator = node.offset + node.length;\n valueNode = node;\n node = node.parent;\n }\n if (!node) {\n this.addSchemaValueCompletions(schema.schema, '', collector, types);\n return;\n }\n if ((node.type === 'property') && offset > (node.colonOffset || 0)) {\n var valueNode_1 = node.valueNode;\n if (valueNode_1 && offset > (valueNode_1.offset + valueNode_1.length)) {\n return; // we are past the value node\n }\n parentKey = node.keyNode.value;\n node = node.parent;\n }\n if (node && (parentKey !== undefined || node.type === 'array')) {\n var separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator);\n var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset, valueNode);\n for (var _i = 0, matchingSchemas_1 = matchingSchemas; _i < matchingSchemas_1.length; _i++) {\n var s = matchingSchemas_1[_i];\n if (s.node === node && !s.inverted && s.schema) {\n if (node.type === 'array' && s.schema.items) {\n if (Array.isArray(s.schema.items)) {\n var index = this.findItemAtOffset(node, document, offset);\n if (index < s.schema.items.length) {\n this.addSchemaValueCompletions(s.schema.items[index], separatorAfter, collector, types);\n }\n }\n else {\n this.addSchemaValueCompletions(s.schema.items, separatorAfter, collector, types);\n }\n }\n if (parentKey !== undefined) {\n var propertyMatched = false;\n if (s.schema.properties) {\n var propertySchema = s.schema.properties[parentKey];\n if (propertySchema) {\n propertyMatched = true;\n this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types);\n }\n }\n if (s.schema.patternProperties && !propertyMatched) {\n for (var _a = 0, _b = Object.keys(s.schema.patternProperties); _a < _b.length; _a++) {\n var pattern = _b[_a];\n var regex = new RegExp(pattern);\n if (regex.test(parentKey)) {\n propertyMatched = true;\n var propertySchema = s.schema.patternProperties[pattern];\n this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types);\n }\n }\n }\n if (s.schema.additionalProperties && !propertyMatched) {\n var propertySchema = s.schema.additionalProperties;\n this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types);\n }\n }\n }\n }\n if (parentKey === '$schema' && !node.parent) {\n this.addDollarSchemaCompletions(separatorAfter, collector);\n }\n if (types['boolean']) {\n this.addBooleanValueCompletion(true, separatorAfter, collector);\n this.addBooleanValueCompletion(false, separatorAfter, collector);\n }\n if (types['null']) {\n this.addNullValueCompletion(separatorAfter, collector);\n }\n }\n };\n JSONCompletion.prototype.getContributedValueCompletions = function (doc, node, offset, document, collector, collectionPromises) {\n if (!node) {\n this.contributions.forEach(function (contribution) {\n var collectPromise = contribution.collectDefaultCompletions(document.uri, collector);\n if (collectPromise) {\n collectionPromises.push(collectPromise);\n }\n });\n }\n else {\n if (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null') {\n node = node.parent;\n }\n if (node && (node.type === 'property') && offset > (node.colonOffset || 0)) {\n var parentKey_4 = node.keyNode.value;\n var valueNode = node.valueNode;\n if ((!valueNode || offset <= (valueNode.offset + valueNode.length)) && node.parent) {\n var location_2 = Parser.getNodePath(node.parent);\n this.contributions.forEach(function (contribution) {\n var collectPromise = contribution.collectValueCompletions(document.uri, location_2, parentKey_4, collector);\n if (collectPromise) {\n collectionPromises.push(collectPromise);\n }\n });\n }\n }\n }\n };\n JSONCompletion.prototype.addSchemaValueCompletions = function (schema, separatorAfter, collector, types) {\n var _this = this;\n if (typeof schema === 'object') {\n this.addEnumValueCompletions(schema, separatorAfter, collector);\n this.addDefaultValueCompletions(schema, separatorAfter, collector);\n this.collectTypes(schema, types);\n if (Array.isArray(schema.allOf)) {\n schema.allOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); });\n }\n if (Array.isArray(schema.anyOf)) {\n schema.anyOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); });\n }\n if (Array.isArray(schema.oneOf)) {\n schema.oneOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); });\n }\n }\n };\n JSONCompletion.prototype.addDefaultValueCompletions = function (schema, separatorAfter, collector, arrayDepth) {\n var _this = this;\n if (arrayDepth === void 0) { arrayDepth = 0; }\n var hasProposals = false;\n if (isDefined(schema.default)) {\n var type = schema.type;\n var value = schema.default;\n for (var i = arrayDepth; i > 0; i--) {\n value = [value];\n type = 'array';\n }\n collector.add({\n kind: this.getSuggestionKind(type),\n label: this.getLabelForValue(value),\n insertText: this.getInsertTextForValue(value, separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet,\n detail: localize('json.suggest.default', 'Default value')\n });\n hasProposals = true;\n }\n if (Array.isArray(schema.examples)) {\n schema.examples.forEach(function (example) {\n var type = schema.type;\n var value = example;\n for (var i = arrayDepth; i > 0; i--) {\n value = [value];\n type = 'array';\n }\n collector.add({\n kind: _this.getSuggestionKind(type),\n label: _this.getLabelForValue(value),\n insertText: _this.getInsertTextForValue(value, separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet\n });\n hasProposals = true;\n });\n }\n if (Array.isArray(schema.defaultSnippets)) {\n schema.defaultSnippets.forEach(function (s) {\n var type = schema.type;\n var value = s.body;\n var label = s.label;\n var insertText;\n var filterText;\n if (isDefined(value)) {\n var type_1 = schema.type;\n for (var i = arrayDepth; i > 0; i--) {\n value = [value];\n type_1 = 'array';\n }\n insertText = _this.getInsertTextForSnippetValue(value, separatorAfter);\n filterText = _this.getFilterTextForSnippetValue(value);\n label = label || _this.getLabelForSnippetValue(value);\n }\n else if (typeof s.bodyText === 'string') {\n var prefix = '', suffix = '', indent = '';\n for (var i = arrayDepth; i > 0; i--) {\n prefix = prefix + indent + '[\\n';\n suffix = suffix + '\\n' + indent + ']';\n indent += '\\t';\n type = 'array';\n }\n insertText = prefix + indent + s.bodyText.split('\\n').join('\\n' + indent) + suffix + separatorAfter;\n label = label || insertText,\n filterText = insertText.replace(/[\\n]/g, ''); // remove new lines\n }\n else {\n return;\n }\n collector.add({\n kind: _this.getSuggestionKind(type),\n label: label,\n documentation: _this.fromMarkup(s.markdownDescription) || s.description,\n insertText: insertText,\n insertTextFormat: InsertTextFormat.Snippet,\n filterText: filterText\n });\n hasProposals = true;\n });\n }\n if (!hasProposals && typeof schema.items === 'object' && !Array.isArray(schema.items) && arrayDepth < 5 /* beware of recursion */) {\n this.addDefaultValueCompletions(schema.items, separatorAfter, collector, arrayDepth + 1);\n }\n };\n JSONCompletion.prototype.addEnumValueCompletions = function (schema, separatorAfter, collector) {\n if (isDefined(schema.const)) {\n collector.add({\n kind: this.getSuggestionKind(schema.type),\n label: this.getLabelForValue(schema.const),\n insertText: this.getInsertTextForValue(schema.const, separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet,\n documentation: this.fromMarkup(schema.markdownDescription) || schema.description\n });\n }\n if (Array.isArray(schema.enum)) {\n for (var i = 0, length = schema.enum.length; i < length; i++) {\n var enm = schema.enum[i];\n var documentation = this.fromMarkup(schema.markdownDescription) || schema.description;\n if (schema.markdownEnumDescriptions && i < schema.markdownEnumDescriptions.length && this.doesSupportMarkdown()) {\n documentation = this.fromMarkup(schema.markdownEnumDescriptions[i]);\n }\n else if (schema.enumDescriptions && i < schema.enumDescriptions.length) {\n documentation = schema.enumDescriptions[i];\n }\n collector.add({\n kind: this.getSuggestionKind(schema.type),\n label: this.getLabelForValue(enm),\n insertText: this.getInsertTextForValue(enm, separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet,\n documentation: documentation\n });\n }\n }\n };\n JSONCompletion.prototype.collectTypes = function (schema, types) {\n if (Array.isArray(schema.enum) || isDefined(schema.const)) {\n return;\n }\n var type = schema.type;\n if (Array.isArray(type)) {\n type.forEach(function (t) { return types[t] = true; });\n }\n else if (type) {\n types[type] = true;\n }\n };\n JSONCompletion.prototype.addFillerValueCompletions = function (types, separatorAfter, collector) {\n if (types['object']) {\n collector.add({\n kind: this.getSuggestionKind('object'),\n label: '{}',\n insertText: this.getInsertTextForGuessedValue({}, separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet,\n detail: localize('defaults.object', 'New object'),\n documentation: ''\n });\n }\n if (types['array']) {\n collector.add({\n kind: this.getSuggestionKind('array'),\n label: '[]',\n insertText: this.getInsertTextForGuessedValue([], separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet,\n detail: localize('defaults.array', 'New array'),\n documentation: ''\n });\n }\n };\n JSONCompletion.prototype.addBooleanValueCompletion = function (value, separatorAfter, collector) {\n collector.add({\n kind: this.getSuggestionKind('boolean'),\n label: value ? 'true' : 'false',\n insertText: this.getInsertTextForValue(value, separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet,\n documentation: ''\n });\n };\n JSONCompletion.prototype.addNullValueCompletion = function (separatorAfter, collector) {\n collector.add({\n kind: this.getSuggestionKind('null'),\n label: 'null',\n insertText: 'null' + separatorAfter,\n insertTextFormat: InsertTextFormat.Snippet,\n documentation: ''\n });\n };\n JSONCompletion.prototype.addDollarSchemaCompletions = function (separatorAfter, collector) {\n var _this = this;\n var schemaIds = this.schemaService.getRegisteredSchemaIds(function (schema) { return schema === 'http' || schema === 'https'; });\n schemaIds.forEach(function (schemaId) { return collector.add({\n kind: CompletionItemKind.Module,\n label: _this.getLabelForValue(schemaId),\n filterText: _this.getFilterTextForValue(schemaId),\n insertText: _this.getInsertTextForValue(schemaId, separatorAfter),\n insertTextFormat: InsertTextFormat.Snippet, documentation: ''\n }); });\n };\n JSONCompletion.prototype.getLabelForValue = function (value) {\n return JSON.stringify(value);\n };\n JSONCompletion.prototype.getFilterTextForValue = function (value) {\n return JSON.stringify(value);\n };\n JSONCompletion.prototype.getFilterTextForSnippetValue = function (value) {\n return JSON.stringify(value).replace(/\\$\\{\\d+:([^}]+)\\}|\\$\\d+/g, '$1');\n };\n JSONCompletion.prototype.getLabelForSnippetValue = function (value) {\n var label = JSON.stringify(value);\n return label.replace(/\\$\\{\\d+:([^}]+)\\}|\\$\\d+/g, '$1');\n };\n JSONCompletion.prototype.getInsertTextForPlainText = function (text) {\n return text.replace(/[\\\\\\$\\}]/g, '\\\\$&'); // escape $, \\ and } \n };\n JSONCompletion.prototype.getInsertTextForValue = function (value, separatorAfter) {\n var text = JSON.stringify(value, null, '\\t');\n if (text === '{}') {\n return '{$1}' + separatorAfter;\n }\n else if (text === '[]') {\n return '[$1]' + separatorAfter;\n }\n return this.getInsertTextForPlainText(text + separatorAfter);\n };\n JSONCompletion.prototype.getInsertTextForSnippetValue = function (value, separatorAfter) {\n var replacer = function (value) {\n if (typeof value === 'string') {\n if (value[0] === '^') {\n return value.substr(1);\n }\n }\n return JSON.stringify(value);\n };\n return stringifyObject(value, '', replacer) + separatorAfter;\n };\n JSONCompletion.prototype.getInsertTextForGuessedValue = function (value, separatorAfter) {\n switch (typeof value) {\n case 'object':\n if (value === null) {\n return '${1:null}' + separatorAfter;\n }\n return this.getInsertTextForValue(value, separatorAfter);\n case 'string':\n var snippetValue = JSON.stringify(value);\n snippetValue = snippetValue.substr(1, snippetValue.length - 2); // remove quotes\n snippetValue = this.getInsertTextForPlainText(snippetValue); // escape \\ and }\n return '\"${1:' + snippetValue + '}\"' + separatorAfter;\n case 'number':\n case 'boolean':\n return '${1:' + JSON.stringify(value) + '}' + separatorAfter;\n }\n return this.getInsertTextForValue(value, separatorAfter);\n };\n JSONCompletion.prototype.getSuggestionKind = function (type) {\n if (Array.isArray(type)) {\n var array = type;\n type = array.length > 0 ? array[0] : undefined;\n }\n if (!type) {\n return CompletionItemKind.Value;\n }\n switch (type) {\n case 'string': return CompletionItemKind.Value;\n case 'object': return CompletionItemKind.Module;\n case 'property': return CompletionItemKind.Property;\n default: return CompletionItemKind.Value;\n }\n };\n JSONCompletion.prototype.getLabelTextForMatchingNode = function (node, document) {\n switch (node.type) {\n case 'array':\n return '[]';\n case 'object':\n return '{}';\n default:\n var content = document.getText().substr(node.offset, node.length);\n return content;\n }\n };\n JSONCompletion.prototype.getInsertTextForMatchingNode = function (node, document, separatorAfter) {\n switch (node.type) {\n case 'array':\n return this.getInsertTextForValue([], separatorAfter);\n case 'object':\n return this.getInsertTextForValue({}, separatorAfter);\n default:\n var content = document.getText().substr(node.offset, node.length) + separatorAfter;\n return this.getInsertTextForPlainText(content);\n }\n };\n JSONCompletion.prototype.getInsertTextForProperty = function (key, propertySchema, addValue, separatorAfter) {\n var propertyText = this.getInsertTextForValue(key, '');\n if (!addValue) {\n return propertyText;\n }\n var resultText = propertyText + ': ';\n var value;\n var nValueProposals = 0;\n if (propertySchema) {\n if (Array.isArray(propertySchema.defaultSnippets)) {\n if (propertySchema.defaultSnippets.length === 1) {\n var body = propertySchema.defaultSnippets[0].body;\n if (isDefined(body)) {\n value = this.getInsertTextForSnippetValue(body, '');\n }\n }\n nValueProposals += propertySchema.defaultSnippets.length;\n }\n if (propertySchema.enum) {\n if (!value && propertySchema.enum.length === 1) {\n value = this.getInsertTextForGuessedValue(propertySchema.enum[0], '');\n }\n nValueProposals += propertySchema.enum.length;\n }\n if (isDefined(propertySchema.default)) {\n if (!value) {\n value = this.getInsertTextForGuessedValue(propertySchema.default, '');\n }\n nValueProposals++;\n }\n if (Array.isArray(propertySchema.examples) && propertySchema.examples.length) {\n if (!value) {\n value = this.getInsertTextForGuessedValue(propertySchema.examples[0], '');\n }\n nValueProposals += propertySchema.examples.length;\n }\n if (nValueProposals === 0) {\n var type = Array.isArray(propertySchema.type) ? propertySchema.type[0] : propertySchema.type;\n if (!type) {\n if (propertySchema.properties) {\n type = 'object';\n }\n else if (propertySchema.items) {\n type = 'array';\n }\n }\n switch (type) {\n case 'boolean':\n value = '$1';\n break;\n case 'string':\n value = '\"$1\"';\n break;\n case 'object':\n value = '{$1}';\n break;\n case 'array':\n value = '[$1]';\n break;\n case 'number':\n case 'integer':\n value = '${1:0}';\n break;\n case 'null':\n value = '${1:null}';\n break;\n default:\n return propertyText;\n }\n }\n }\n if (!value || nValueProposals > 1) {\n value = '$1';\n }\n return resultText + value + separatorAfter;\n };\n JSONCompletion.prototype.getCurrentWord = function (document, offset) {\n var i = offset - 1;\n var text = document.getText();\n while (i >= 0 && ' \\t\\n\\r\\v\":{[,]}'.indexOf(text.charAt(i)) === -1) {\n i--;\n }\n return text.substring(i + 1, offset);\n };\n JSONCompletion.prototype.evaluateSeparatorAfter = function (document, offset) {\n var scanner = Json.createScanner(document.getText(), true);\n scanner.setPosition(offset);\n var token = scanner.scan();\n switch (token) {\n case 5 /* CommaToken */:\n case 2 /* CloseBraceToken */:\n case 4 /* CloseBracketToken */:\n case 17 /* EOF */:\n return '';\n default:\n return ',';\n }\n };\n JSONCompletion.prototype.findItemAtOffset = function (node, document, offset) {\n var scanner = Json.createScanner(document.getText(), true);\n var children = node.items;\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n if (offset > child.offset + child.length) {\n scanner.setPosition(child.offset + child.length);\n var token = scanner.scan();\n if (token === 5 /* CommaToken */ && offset >= scanner.getTokenOffset() + scanner.getTokenLength()) {\n return i + 1;\n }\n return i;\n }\n else if (offset >= child.offset) {\n return i;\n }\n }\n return 0;\n };\n JSONCompletion.prototype.isInComment = function (document, start, offset) {\n var scanner = Json.createScanner(document.getText(), false);\n scanner.setPosition(start);\n var token = scanner.scan();\n while (token !== 17 /* EOF */ && (scanner.getTokenOffset() + scanner.getTokenLength() < offset)) {\n token = scanner.scan();\n }\n return (token === 12 /* LineCommentTrivia */ || token === 13 /* BlockCommentTrivia */) && scanner.getTokenOffset() <= offset;\n };\n JSONCompletion.prototype.fromMarkup = function (markupString) {\n if (markupString && this.doesSupportMarkdown()) {\n return {\n kind: MarkupKind.Markdown,\n value: markupString\n };\n }\n return undefined;\n };\n JSONCompletion.prototype.doesSupportMarkdown = function () {\n if (!isDefined(this.supportsMarkdown)) {\n var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion;\n this.supportsMarkdown = completion && completion.completionItem && Array.isArray(completion.completionItem.documentationFormat) && completion.completionItem.documentationFormat.indexOf(MarkupKind.Markdown) !== -1;\n }\n return this.supportsMarkdown;\n };\n JSONCompletion.prototype.doesSupportsCommitCharacters = function () {\n if (!isDefined(this.supportsCommitCharacters)) {\n var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion;\n this.supportsCommitCharacters = completion && completion.completionItem && !!completion.completionItem.commitCharactersSupport;\n }\n return this.supportsCommitCharacters;\n };\n return JSONCompletion;\n}());\nexport { JSONCompletion };\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Range } from '../jsonLanguageTypes.js';\nexport function findDefinition(document, position, doc) {\n var offset = document.offsetAt(position);\n var node = doc.getNodeFromOffset(offset, true);\n if (!node || !isRef(node)) {\n return Promise.resolve([]);\n }\n var propertyNode = node.parent;\n var valueNode = propertyNode.valueNode;\n var path = valueNode.value;\n var targetNode = findTargetNode(doc, path);\n if (!targetNode) {\n return Promise.resolve([]);\n }\n var definition = {\n targetUri: document.uri,\n originSelectionRange: createRange(document, valueNode),\n targetRange: createRange(document, targetNode),\n targetSelectionRange: createRange(document, targetNode)\n };\n return Promise.resolve([definition]);\n}\nfunction createRange(document, node) {\n return Range.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length));\n}\nfunction isRef(node) {\n return node.type === 'string' &&\n node.parent &&\n node.parent.type === 'property' &&\n node.parent.valueNode === node &&\n node.parent.keyNode.value === \"$ref\" ||\n false;\n}\nfunction findTargetNode(doc, path) {\n var tokens = parseJSONPointer(path);\n if (!tokens) {\n return null;\n }\n return findNode(tokens, doc.root);\n}\nfunction findNode(pointer, node) {\n if (!node) {\n return null;\n }\n if (pointer.length === 0) {\n return node;\n }\n var token = pointer.shift();\n if (node && node.type === 'object') {\n var propertyNode = node.properties.find(function (propertyNode) { return propertyNode.keyNode.value === token; });\n if (!propertyNode) {\n return null;\n }\n return findNode(pointer, propertyNode.valueNode);\n }\n else if (node && node.type === 'array') {\n if (token.match(/^(0|[1-9][0-9]*)$/)) {\n var index = Number.parseInt(token);\n var arrayItem = node.items[index];\n if (!arrayItem) {\n return null;\n }\n return findNode(pointer, arrayItem);\n }\n }\n return null;\n}\nfunction parseJSONPointer(path) {\n if (path === \"#\") {\n return [];\n }\n if (path[0] !== '#' || path[1] !== '/') {\n return null;\n }\n return path.substring(2).split(/\\//).map(unescape);\n}\nfunction unescape(str) {\n return str.replace(/~1/g, '/').replace(/~0/g, '~');\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as Parser from '../parser/jsonParser.js';\nimport * as Strings from '../utils/strings.js';\nimport { colorFromHex } from '../utils/colors.js';\nimport { Range, TextEdit, SymbolKind, Location } from \"../jsonLanguageTypes.js\";\nvar JSONDocumentSymbols = /** @class */ (function () {\n function JSONDocumentSymbols(schemaService) {\n this.schemaService = schemaService;\n }\n JSONDocumentSymbols.prototype.findDocumentSymbols = function (document, doc, context) {\n var _this = this;\n if (context === void 0) { context = { resultLimit: Number.MAX_VALUE }; }\n var root = doc.root;\n if (!root) {\n return [];\n }\n var limit = context.resultLimit || Number.MAX_VALUE;\n // special handling for key bindings\n var resourceString = document.uri;\n if ((resourceString === 'vscode://defaultsettings/keybindings.json') || Strings.endsWith(resourceString.toLowerCase(), '/user/keybindings.json')) {\n if (root.type === 'array') {\n var result_1 = [];\n for (var _i = 0, _a = root.items; _i < _a.length; _i++) {\n var item = _a[_i];\n if (item.type === 'object') {\n for (var _b = 0, _c = item.properties; _b < _c.length; _b++) {\n var property = _c[_b];\n if (property.keyNode.value === 'key' && property.valueNode) {\n var location = Location.create(document.uri, getRange(document, item));\n result_1.push({ name: Parser.getNodeValue(property.valueNode), kind: SymbolKind.Function, location: location });\n limit--;\n if (limit <= 0) {\n if (context && context.onResultLimitExceeded) {\n context.onResultLimitExceeded(resourceString);\n }\n return result_1;\n }\n }\n }\n }\n }\n return result_1;\n }\n }\n var toVisit = [\n { node: root, containerName: '' }\n ];\n var nextToVisit = 0;\n var limitExceeded = false;\n var result = [];\n var collectOutlineEntries = function (node, containerName) {\n if (node.type === 'array') {\n node.items.forEach(function (node) {\n if (node) {\n toVisit.push({ node: node, containerName: containerName });\n }\n });\n }\n else if (node.type === 'object') {\n node.properties.forEach(function (property) {\n var valueNode = property.valueNode;\n if (valueNode) {\n if (limit > 0) {\n limit--;\n var location = Location.create(document.uri, getRange(document, property));\n var childContainerName = containerName ? containerName + '.' + property.keyNode.value : property.keyNode.value;\n result.push({ name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), location: location, containerName: containerName });\n toVisit.push({ node: valueNode, containerName: childContainerName });\n }\n else {\n limitExceeded = true;\n }\n }\n });\n }\n };\n // breath first traversal\n while (nextToVisit < toVisit.length) {\n var next = toVisit[nextToVisit++];\n collectOutlineEntries(next.node, next.containerName);\n }\n if (limitExceeded && context && context.onResultLimitExceeded) {\n context.onResultLimitExceeded(resourceString);\n }\n return result;\n };\n JSONDocumentSymbols.prototype.findDocumentSymbols2 = function (document, doc, context) {\n var _this = this;\n if (context === void 0) { context = { resultLimit: Number.MAX_VALUE }; }\n var root = doc.root;\n if (!root) {\n return [];\n }\n var limit = context.resultLimit || Number.MAX_VALUE;\n // special handling for key bindings\n var resourceString = document.uri;\n if ((resourceString === 'vscode://defaultsettings/keybindings.json') || Strings.endsWith(resourceString.toLowerCase(), '/user/keybindings.json')) {\n if (root.type === 'array') {\n var result_2 = [];\n for (var _i = 0, _a = root.items; _i < _a.length; _i++) {\n var item = _a[_i];\n if (item.type === 'object') {\n for (var _b = 0, _c = item.properties; _b < _c.length; _b++) {\n var property = _c[_b];\n if (property.keyNode.value === 'key' && property.valueNode) {\n var range = getRange(document, item);\n var selectionRange = getRange(document, property.keyNode);\n result_2.push({ name: Parser.getNodeValue(property.valueNode), kind: SymbolKind.Function, range: range, selectionRange: selectionRange });\n limit--;\n if (limit <= 0) {\n if (context && context.onResultLimitExceeded) {\n context.onResultLimitExceeded(resourceString);\n }\n return result_2;\n }\n }\n }\n }\n }\n return result_2;\n }\n }\n var result = [];\n var toVisit = [\n { node: root, result: result }\n ];\n var nextToVisit = 0;\n var limitExceeded = false;\n var collectOutlineEntries = function (node, result) {\n if (node.type === 'array') {\n node.items.forEach(function (node, index) {\n if (node) {\n if (limit > 0) {\n limit--;\n var range = getRange(document, node);\n var selectionRange = range;\n var name = String(index);\n var symbol = { name: name, kind: _this.getSymbolKind(node.type), range: range, selectionRange: selectionRange, children: [] };\n result.push(symbol);\n toVisit.push({ result: symbol.children, node: node });\n }\n else {\n limitExceeded = true;\n }\n }\n });\n }\n else if (node.type === 'object') {\n node.properties.forEach(function (property) {\n var valueNode = property.valueNode;\n if (valueNode) {\n if (limit > 0) {\n limit--;\n var range = getRange(document, property);\n var selectionRange = getRange(document, property.keyNode);\n var symbol = { name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), range: range, selectionRange: selectionRange, children: [] };\n result.push(symbol);\n toVisit.push({ result: symbol.children, node: valueNode });\n }\n else {\n limitExceeded = true;\n }\n }\n });\n }\n };\n // breath first traversal\n while (nextToVisit < toVisit.length) {\n var next = toVisit[nextToVisit++];\n collectOutlineEntries(next.node, next.result);\n }\n if (limitExceeded && context && context.onResultLimitExceeded) {\n context.onResultLimitExceeded(resourceString);\n }\n return result;\n };\n JSONDocumentSymbols.prototype.getSymbolKind = function (nodeType) {\n switch (nodeType) {\n case 'object':\n return SymbolKind.Module;\n case 'string':\n return SymbolKind.String;\n case 'number':\n return SymbolKind.Number;\n case 'array':\n return SymbolKind.Array;\n case 'boolean':\n return SymbolKind.Boolean;\n default: // 'null'\n return SymbolKind.Variable;\n }\n };\n JSONDocumentSymbols.prototype.getKeyLabel = function (property) {\n var name = property.keyNode.value;\n if (name) {\n name = name.replace(/[\\n]/g, '↵');\n }\n if (name && name.trim()) {\n return name;\n }\n return \"\\\"\" + name + \"\\\"\";\n };\n JSONDocumentSymbols.prototype.findDocumentColors = function (document, doc, context) {\n return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) {\n var result = [];\n if (schema) {\n var limit = context && typeof context.resultLimit === 'number' ? context.resultLimit : Number.MAX_VALUE;\n var matchingSchemas = doc.getMatchingSchemas(schema.schema);\n var visitedNode = {};\n for (var _i = 0, matchingSchemas_1 = matchingSchemas; _i < matchingSchemas_1.length; _i++) {\n var s = matchingSchemas_1[_i];\n if (!s.inverted && s.schema && (s.schema.format === 'color' || s.schema.format === 'color-hex') && s.node && s.node.type === 'string') {\n var nodeId = String(s.node.offset);\n if (!visitedNode[nodeId]) {\n var color = colorFromHex(Parser.getNodeValue(s.node));\n if (color) {\n var range = getRange(document, s.node);\n result.push({ color: color, range: range });\n }\n visitedNode[nodeId] = true;\n limit--;\n if (limit <= 0) {\n if (context && context.onResultLimitExceeded) {\n context.onResultLimitExceeded(document.uri);\n }\n return result;\n }\n }\n }\n }\n }\n return result;\n });\n };\n JSONDocumentSymbols.prototype.getColorPresentations = function (document, doc, color, range) {\n var result = [];\n var red256 = Math.round(color.red * 255), green256 = Math.round(color.green * 255), blue256 = Math.round(color.blue * 255);\n function toTwoDigitHex(n) {\n var r = n.toString(16);\n return r.length !== 2 ? '0' + r : r;\n }\n var label;\n if (color.alpha === 1) {\n label = \"#\" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256);\n }\n else {\n label = \"#\" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256) + toTwoDigitHex(Math.round(color.alpha * 255));\n }\n result.push({ label: label, textEdit: TextEdit.replace(range, JSON.stringify(label)) });\n return result;\n };\n return JSONDocumentSymbols;\n}());\nexport { JSONDocumentSymbols };\nfunction getRange(document, node) {\n return Range.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length));\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createScanner } from '../../jsonc-parser/main.js';\nimport { FoldingRangeKind, Position } from '../jsonLanguageTypes.js';\nexport function getFoldingRanges(document, context) {\n var ranges = [];\n var nestingLevels = [];\n var stack = [];\n var prevStart = -1;\n var scanner = createScanner(document.getText(), false);\n var token = scanner.scan();\n function addRange(range) {\n ranges.push(range);\n nestingLevels.push(stack.length);\n }\n while (token !== 17 /* EOF */) {\n switch (token) {\n case 1 /* OpenBraceToken */:\n case 3 /* OpenBracketToken */: {\n var startLine = document.positionAt(scanner.getTokenOffset()).line;\n var range = { startLine: startLine, endLine: startLine, kind: token === 1 /* OpenBraceToken */ ? 'object' : 'array' };\n stack.push(range);\n break;\n }\n case 2 /* CloseBraceToken */:\n case 4 /* CloseBracketToken */: {\n var kind = token === 2 /* CloseBraceToken */ ? 'object' : 'array';\n if (stack.length > 0 && stack[stack.length - 1].kind === kind) {\n var range = stack.pop();\n var line = document.positionAt(scanner.getTokenOffset()).line;\n if (range && line > range.startLine + 1 && prevStart !== range.startLine) {\n range.endLine = line - 1;\n addRange(range);\n prevStart = range.startLine;\n }\n }\n break;\n }\n case 13 /* BlockCommentTrivia */: {\n var startLine = document.positionAt(scanner.getTokenOffset()).line;\n var endLine = document.positionAt(scanner.getTokenOffset() + scanner.getTokenLength()).line;\n if (scanner.getTokenError() === 1 /* UnexpectedEndOfComment */ && startLine + 1 < document.lineCount) {\n scanner.setPosition(document.offsetAt(Position.create(startLine + 1, 0)));\n }\n else {\n if (startLine < endLine) {\n addRange({ startLine: startLine, endLine: endLine, kind: FoldingRangeKind.Comment });\n prevStart = startLine;\n }\n }\n break;\n }\n case 12 /* LineCommentTrivia */: {\n var text = document.getText().substr(scanner.getTokenOffset(), scanner.getTokenLength());\n var m = text.match(/^\\/\\/\\s*#(region\\b)|(endregion\\b)/);\n if (m) {\n var line = document.positionAt(scanner.getTokenOffset()).line;\n if (m[1]) { // start pattern match\n var range = { startLine: line, endLine: line, kind: FoldingRangeKind.Region };\n stack.push(range);\n }\n else {\n var i = stack.length - 1;\n while (i >= 0 && stack[i].kind !== FoldingRangeKind.Region) {\n i--;\n }\n if (i >= 0) {\n var range = stack[i];\n stack.length = i;\n if (line > range.startLine && prevStart !== range.startLine) {\n range.endLine = line;\n addRange(range);\n prevStart = range.startLine;\n }\n }\n }\n }\n break;\n }\n }\n token = scanner.scan();\n }\n var rangeLimit = context && context.rangeLimit;\n if (typeof rangeLimit !== 'number' || ranges.length <= rangeLimit) {\n return ranges;\n }\n if (context && context.onRangeLimitExceeded) {\n context.onRangeLimitExceeded(document.uri);\n }\n var counts = [];\n for (var _i = 0, nestingLevels_1 = nestingLevels; _i < nestingLevels_1.length; _i++) {\n var level = nestingLevels_1[_i];\n if (level < 30) {\n counts[level] = (counts[level] || 0) + 1;\n }\n }\n var entries = 0;\n var maxLevel = 0;\n for (var i = 0; i < counts.length; i++) {\n var n = counts[i];\n if (n) {\n if (n + entries > rangeLimit) {\n maxLevel = i;\n break;\n }\n entries += n;\n }\n }\n var result = [];\n for (var i = 0; i < ranges.length; i++) {\n var level = nestingLevels[i];\n if (typeof level === 'number') {\n if (level < maxLevel || (level === maxLevel && entries++ < rangeLimit)) {\n result.push(ranges[i]);\n }\n }\n }\n return result;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as Parser from '../parser/jsonParser.js';\nimport { Range } from '../jsonLanguageTypes.js';\nvar JSONHover = /** @class */ (function () {\n function JSONHover(schemaService, contributions, promiseConstructor) {\n if (contributions === void 0) { contributions = []; }\n this.schemaService = schemaService;\n this.contributions = contributions;\n this.promise = promiseConstructor || Promise;\n }\n JSONHover.prototype.doHover = function (document, position, doc) {\n var offset = document.offsetAt(position);\n var node = doc.getNodeFromOffset(offset);\n if (!node || (node.type === 'object' || node.type === 'array') && offset > node.offset + 1 && offset < node.offset + node.length - 1) {\n return this.promise.resolve(null);\n }\n var hoverRangeNode = node;\n // use the property description when hovering over an object key\n if (node.type === 'string') {\n var parent = node.parent;\n if (parent && parent.type === 'property' && parent.keyNode === node) {\n node = parent.valueNode;\n if (!node) {\n return this.promise.resolve(null);\n }\n }\n }\n var hoverRange = Range.create(document.positionAt(hoverRangeNode.offset), document.positionAt(hoverRangeNode.offset + hoverRangeNode.length));\n var createHover = function (contents) {\n var result = {\n contents: contents,\n range: hoverRange\n };\n return result;\n };\n var location = Parser.getNodePath(node);\n for (var i = this.contributions.length - 1; i >= 0; i--) {\n var contribution = this.contributions[i];\n var promise = contribution.getInfoContribution(document.uri, location);\n if (promise) {\n return promise.then(function (htmlContent) { return createHover(htmlContent); });\n }\n }\n return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) {\n if (schema && node) {\n var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset);\n var title_1 = undefined;\n var markdownDescription_1 = undefined;\n var markdownEnumValueDescription_1 = undefined, enumValue_1 = undefined;\n matchingSchemas.every(function (s) {\n if (s.node === node && !s.inverted && s.schema) {\n title_1 = title_1 || s.schema.title;\n markdownDescription_1 = markdownDescription_1 || s.schema.markdownDescription || toMarkdown(s.schema.description);\n if (s.schema.enum) {\n var idx = s.schema.enum.indexOf(Parser.getNodeValue(node));\n if (s.schema.markdownEnumDescriptions) {\n markdownEnumValueDescription_1 = s.schema.markdownEnumDescriptions[idx];\n }\n else if (s.schema.enumDescriptions) {\n markdownEnumValueDescription_1 = toMarkdown(s.schema.enumDescriptions[idx]);\n }\n if (markdownEnumValueDescription_1) {\n enumValue_1 = s.schema.enum[idx];\n if (typeof enumValue_1 !== 'string') {\n enumValue_1 = JSON.stringify(enumValue_1);\n }\n }\n }\n }\n return true;\n });\n var result = '';\n if (title_1) {\n result = toMarkdown(title_1);\n }\n if (markdownDescription_1) {\n if (result.length > 0) {\n result += \"\\n\\n\";\n }\n result += markdownDescription_1;\n }\n if (markdownEnumValueDescription_1) {\n if (result.length > 0) {\n result += \"\\n\\n\";\n }\n result += \"`\" + toMarkdownCodeBlock(enumValue_1) + \"`: \" + markdownEnumValueDescription_1;\n }\n return createHover([result]);\n }\n return null;\n });\n };\n return JSONHover;\n}());\nexport { JSONHover };\nfunction toMarkdown(plain) {\n if (plain) {\n var res = plain.replace(/([^\\n\\r])(\\r?\\n)([^\\n\\r])/gm, '$1\\n\\n$3'); // single new lines to \\n\\n (Markdown paragraph)\n return res.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, \"\\\\$&\"); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n }\n return undefined;\n}\nfunction toMarkdownCodeBlock(content) {\n // see https://daringfireball.net/projects/markdown/syntax#precode\n if (content.indexOf('`') !== -1) {\n return '`` ' + content + ' ``';\n }\n return content;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as Json from '../../jsonc-parser/main.js';\nimport { URI } from '../../vscode-uri/index.js';\nimport * as Strings from '../utils/strings.js';\nimport * as Parser from '../parser/jsonParser.js';\nimport * as nls from '../../../fillers/vscode-nls.js';\nvar localize = nls.loadMessageBundle();\nvar FilePatternAssociation = /** @class */ (function () {\n function FilePatternAssociation(pattern, uris) {\n this.patternRegExps = [];\n this.isInclude = [];\n try {\n for (var _i = 0, pattern_1 = pattern; _i < pattern_1.length; _i++) {\n var p = pattern_1[_i];\n var include = p[0] !== '!';\n if (!include) {\n p = p.substring(1);\n }\n this.patternRegExps.push(new RegExp(Strings.convertSimple2RegExpPattern(p) + '$'));\n this.isInclude.push(include);\n }\n this.uris = uris;\n }\n catch (e) {\n // invalid pattern\n this.patternRegExps.length = 0;\n this.isInclude.length = 0;\n this.uris = [];\n }\n }\n FilePatternAssociation.prototype.matchesPattern = function (fileName) {\n var match = false;\n for (var i = 0; i < this.patternRegExps.length; i++) {\n var regExp = this.patternRegExps[i];\n if (regExp.test(fileName)) {\n match = this.isInclude[i];\n }\n }\n return match;\n };\n FilePatternAssociation.prototype.getURIs = function () {\n return this.uris;\n };\n return FilePatternAssociation;\n}());\nvar SchemaHandle = /** @class */ (function () {\n function SchemaHandle(service, url, unresolvedSchemaContent) {\n this.service = service;\n this.url = url;\n this.dependencies = {};\n if (unresolvedSchemaContent) {\n this.unresolvedSchema = this.service.promise.resolve(new UnresolvedSchema(unresolvedSchemaContent));\n }\n }\n SchemaHandle.prototype.getUnresolvedSchema = function () {\n if (!this.unresolvedSchema) {\n this.unresolvedSchema = this.service.loadSchema(this.url);\n }\n return this.unresolvedSchema;\n };\n SchemaHandle.prototype.getResolvedSchema = function () {\n var _this = this;\n if (!this.resolvedSchema) {\n this.resolvedSchema = this.getUnresolvedSchema().then(function (unresolved) {\n return _this.service.resolveSchemaContent(unresolved, _this.url, _this.dependencies);\n });\n }\n return this.resolvedSchema;\n };\n SchemaHandle.prototype.clearSchema = function () {\n this.resolvedSchema = undefined;\n this.unresolvedSchema = undefined;\n this.dependencies = {};\n };\n return SchemaHandle;\n}());\nvar UnresolvedSchema = /** @class */ (function () {\n function UnresolvedSchema(schema, errors) {\n if (errors === void 0) { errors = []; }\n this.schema = schema;\n this.errors = errors;\n }\n return UnresolvedSchema;\n}());\nexport { UnresolvedSchema };\nvar ResolvedSchema = /** @class */ (function () {\n function ResolvedSchema(schema, errors) {\n if (errors === void 0) { errors = []; }\n this.schema = schema;\n this.errors = errors;\n }\n ResolvedSchema.prototype.getSection = function (path) {\n var schemaRef = this.getSectionRecursive(path, this.schema);\n if (schemaRef) {\n return Parser.asSchema(schemaRef);\n }\n return undefined;\n };\n ResolvedSchema.prototype.getSectionRecursive = function (path, schema) {\n if (!schema || typeof schema === 'boolean' || path.length === 0) {\n return schema;\n }\n var next = path.shift();\n if (schema.properties && typeof schema.properties[next]) {\n return this.getSectionRecursive(path, schema.properties[next]);\n }\n else if (schema.patternProperties) {\n for (var _i = 0, _a = Object.keys(schema.patternProperties); _i < _a.length; _i++) {\n var pattern = _a[_i];\n var regex = new RegExp(pattern);\n if (regex.test(next)) {\n return this.getSectionRecursive(path, schema.patternProperties[pattern]);\n }\n }\n }\n else if (typeof schema.additionalProperties === 'object') {\n return this.getSectionRecursive(path, schema.additionalProperties);\n }\n else if (next.match('[0-9]+')) {\n if (Array.isArray(schema.items)) {\n var index = parseInt(next, 10);\n if (!isNaN(index) && schema.items[index]) {\n return this.getSectionRecursive(path, schema.items[index]);\n }\n }\n else if (schema.items) {\n return this.getSectionRecursive(path, schema.items);\n }\n }\n return undefined;\n };\n return ResolvedSchema;\n}());\nexport { ResolvedSchema };\nvar JSONSchemaService = /** @class */ (function () {\n function JSONSchemaService(requestService, contextService, promiseConstructor) {\n this.contextService = contextService;\n this.requestService = requestService;\n this.promiseConstructor = promiseConstructor || Promise;\n this.callOnDispose = [];\n this.contributionSchemas = {};\n this.contributionAssociations = [];\n this.schemasById = {};\n this.filePatternAssociations = [];\n this.registeredSchemasIds = {};\n }\n JSONSchemaService.prototype.getRegisteredSchemaIds = function (filter) {\n return Object.keys(this.registeredSchemasIds).filter(function (id) {\n var scheme = URI.parse(id).scheme;\n return scheme !== 'schemaservice' && (!filter || filter(scheme));\n });\n };\n Object.defineProperty(JSONSchemaService.prototype, \"promise\", {\n get: function () {\n return this.promiseConstructor;\n },\n enumerable: false,\n configurable: true\n });\n JSONSchemaService.prototype.dispose = function () {\n while (this.callOnDispose.length > 0) {\n this.callOnDispose.pop()();\n }\n };\n JSONSchemaService.prototype.onResourceChange = function (uri) {\n var _this = this;\n var hasChanges = false;\n uri = normalizeId(uri);\n var toWalk = [uri];\n var all = Object.keys(this.schemasById).map(function (key) { return _this.schemasById[key]; });\n while (toWalk.length) {\n var curr = toWalk.pop();\n for (var i = 0; i < all.length; i++) {\n var handle = all[i];\n if (handle && (handle.url === curr || handle.dependencies[curr])) {\n if (handle.url !== curr) {\n toWalk.push(handle.url);\n }\n handle.clearSchema();\n all[i] = undefined;\n hasChanges = true;\n }\n }\n }\n return hasChanges;\n };\n JSONSchemaService.prototype.setSchemaContributions = function (schemaContributions) {\n if (schemaContributions.schemas) {\n var schemas = schemaContributions.schemas;\n for (var id in schemas) {\n var normalizedId = normalizeId(id);\n this.contributionSchemas[normalizedId] = this.addSchemaHandle(normalizedId, schemas[id]);\n }\n }\n if (Array.isArray(schemaContributions.schemaAssociations)) {\n var schemaAssociations = schemaContributions.schemaAssociations;\n for (var _i = 0, schemaAssociations_1 = schemaAssociations; _i < schemaAssociations_1.length; _i++) {\n var schemaAssociation = schemaAssociations_1[_i];\n var uris = schemaAssociation.uris.map(normalizeId);\n var association = this.addFilePatternAssociation(schemaAssociation.pattern, uris);\n this.contributionAssociations.push(association);\n }\n }\n };\n JSONSchemaService.prototype.addSchemaHandle = function (id, unresolvedSchemaContent) {\n var schemaHandle = new SchemaHandle(this, id, unresolvedSchemaContent);\n this.schemasById[id] = schemaHandle;\n return schemaHandle;\n };\n JSONSchemaService.prototype.getOrAddSchemaHandle = function (id, unresolvedSchemaContent) {\n return this.schemasById[id] || this.addSchemaHandle(id, unresolvedSchemaContent);\n };\n JSONSchemaService.prototype.addFilePatternAssociation = function (pattern, uris) {\n var fpa = new FilePatternAssociation(pattern, uris);\n this.filePatternAssociations.push(fpa);\n return fpa;\n };\n JSONSchemaService.prototype.registerExternalSchema = function (uri, filePatterns, unresolvedSchemaContent) {\n var id = normalizeId(uri);\n this.registeredSchemasIds[id] = true;\n this.cachedSchemaForResource = undefined;\n if (filePatterns) {\n this.addFilePatternAssociation(filePatterns, [uri]);\n }\n return unresolvedSchemaContent ? this.addSchemaHandle(id, unresolvedSchemaContent) : this.getOrAddSchemaHandle(id);\n };\n JSONSchemaService.prototype.clearExternalSchemas = function () {\n this.schemasById = {};\n this.filePatternAssociations = [];\n this.registeredSchemasIds = {};\n this.cachedSchemaForResource = undefined;\n for (var id in this.contributionSchemas) {\n this.schemasById[id] = this.contributionSchemas[id];\n this.registeredSchemasIds[id] = true;\n }\n for (var _i = 0, _a = this.contributionAssociations; _i < _a.length; _i++) {\n var contributionAssociation = _a[_i];\n this.filePatternAssociations.push(contributionAssociation);\n }\n };\n JSONSchemaService.prototype.getResolvedSchema = function (schemaId) {\n var id = normalizeId(schemaId);\n var schemaHandle = this.schemasById[id];\n if (schemaHandle) {\n return schemaHandle.getResolvedSchema();\n }\n return this.promise.resolve(undefined);\n };\n JSONSchemaService.prototype.loadSchema = function (url) {\n if (!this.requestService) {\n var errorMessage = localize('json.schema.norequestservice', 'Unable to load schema from \\'{0}\\'. No schema request service available', toDisplayString(url));\n return this.promise.resolve(new UnresolvedSchema({}, [errorMessage]));\n }\n return this.requestService(url).then(function (content) {\n if (!content) {\n var errorMessage = localize('json.schema.nocontent', 'Unable to load schema from \\'{0}\\': No content.', toDisplayString(url));\n return new UnresolvedSchema({}, [errorMessage]);\n }\n var schemaContent = {};\n var jsonErrors = [];\n schemaContent = Json.parse(content, jsonErrors);\n var errors = jsonErrors.length ? [localize('json.schema.invalidFormat', 'Unable to parse content from \\'{0}\\': Parse error at offset {1}.', toDisplayString(url), jsonErrors[0].offset)] : [];\n return new UnresolvedSchema(schemaContent, errors);\n }, function (error) {\n var errorMessage = error.toString();\n var errorSplit = error.toString().split('Error: ');\n if (errorSplit.length > 1) {\n // more concise error message, URL and context are attached by caller anyways\n errorMessage = errorSplit[1];\n }\n if (Strings.endsWith(errorMessage, '.')) {\n errorMessage = errorMessage.substr(0, errorMessage.length - 1);\n }\n return new UnresolvedSchema({}, [localize('json.schema.nocontent', 'Unable to load schema from \\'{0}\\': {1}.', toDisplayString(url), errorMessage)]);\n });\n };\n JSONSchemaService.prototype.resolveSchemaContent = function (schemaToResolve, schemaURL, dependencies) {\n var _this = this;\n var resolveErrors = schemaToResolve.errors.slice(0);\n var schema = schemaToResolve.schema;\n if (schema.$schema) {\n var id = normalizeId(schema.$schema);\n if (id === 'http://json-schema.org/draft-03/schema') {\n return this.promise.resolve(new ResolvedSchema({}, [localize('json.schema.draft03.notsupported', \"Draft-03 schemas are not supported.\")]));\n }\n else if (id === 'https://json-schema.org/draft/2019-09/schema') {\n resolveErrors.push(localize('json.schema.draft201909.notsupported', \"Draft 2019-09 schemas are not yet fully supported.\"));\n }\n }\n var contextService = this.contextService;\n var findSection = function (schema, path) {\n if (!path) {\n return schema;\n }\n var current = schema;\n if (path[0] === '/') {\n path = path.substr(1);\n }\n path.split('/').some(function (part) {\n current = current[part];\n return !current;\n });\n return current;\n };\n var merge = function (target, sourceRoot, sourceURI, refSegment) {\n var path = refSegment ? decodeURIComponent(refSegment) : undefined;\n var section = findSection(sourceRoot, path);\n if (section) {\n for (var key in section) {\n if (section.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = section[key];\n }\n }\n }\n else {\n resolveErrors.push(localize('json.schema.invalidref', '$ref \\'{0}\\' in \\'{1}\\' can not be resolved.', path, sourceURI));\n }\n };\n var resolveExternalLink = function (node, uri, refSegment, parentSchemaURL, parentSchemaDependencies) {\n if (contextService && !/^\\w+:\\/\\/.*/.test(uri)) {\n uri = contextService.resolveRelativePath(uri, parentSchemaURL);\n }\n uri = normalizeId(uri);\n var referencedHandle = _this.getOrAddSchemaHandle(uri);\n return referencedHandle.getUnresolvedSchema().then(function (unresolvedSchema) {\n parentSchemaDependencies[uri] = true;\n if (unresolvedSchema.errors.length) {\n var loc = refSegment ? uri + '#' + refSegment : uri;\n resolveErrors.push(localize('json.schema.problemloadingref', 'Problems loading reference \\'{0}\\': {1}', loc, unresolvedSchema.errors[0]));\n }\n merge(node, unresolvedSchema.schema, uri, refSegment);\n return resolveRefs(node, unresolvedSchema.schema, uri, referencedHandle.dependencies);\n });\n };\n var resolveRefs = function (node, parentSchema, parentSchemaURL, parentSchemaDependencies) {\n if (!node || typeof node !== 'object') {\n return Promise.resolve(null);\n }\n var toWalk = [node];\n var seen = [];\n var openPromises = [];\n var collectEntries = function () {\n var entries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n entries[_i] = arguments[_i];\n }\n for (var _a = 0, entries_1 = entries; _a < entries_1.length; _a++) {\n var entry = entries_1[_a];\n if (typeof entry === 'object') {\n toWalk.push(entry);\n }\n }\n };\n var collectMapEntries = function () {\n var maps = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n maps[_i] = arguments[_i];\n }\n for (var _a = 0, maps_1 = maps; _a < maps_1.length; _a++) {\n var map = maps_1[_a];\n if (typeof map === 'object') {\n for (var k in map) {\n var key = k;\n var entry = map[key];\n if (typeof entry === 'object') {\n toWalk.push(entry);\n }\n }\n }\n }\n };\n var collectArrayEntries = function () {\n var arrays = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n arrays[_i] = arguments[_i];\n }\n for (var _a = 0, arrays_1 = arrays; _a < arrays_1.length; _a++) {\n var array = arrays_1[_a];\n if (Array.isArray(array)) {\n for (var _b = 0, array_1 = array; _b < array_1.length; _b++) {\n var entry = array_1[_b];\n if (typeof entry === 'object') {\n toWalk.push(entry);\n }\n }\n }\n }\n };\n var handleRef = function (next) {\n var seenRefs = [];\n while (next.$ref) {\n var ref = next.$ref;\n var segments = ref.split('#', 2);\n delete next.$ref;\n if (segments[0].length > 0) {\n openPromises.push(resolveExternalLink(next, segments[0], segments[1], parentSchemaURL, parentSchemaDependencies));\n return;\n }\n else {\n if (seenRefs.indexOf(ref) === -1) {\n merge(next, parentSchema, parentSchemaURL, segments[1]); // can set next.$ref again, use seenRefs to avoid circle\n seenRefs.push(ref);\n }\n }\n }\n collectEntries(next.items, next.additionalItems, next.additionalProperties, next.not, next.contains, next.propertyNames, next.if, next.then, next.else);\n collectMapEntries(next.definitions, next.properties, next.patternProperties, next.dependencies);\n collectArrayEntries(next.anyOf, next.allOf, next.oneOf, next.items);\n };\n while (toWalk.length) {\n var next = toWalk.pop();\n if (seen.indexOf(next) >= 0) {\n continue;\n }\n seen.push(next);\n handleRef(next);\n }\n return _this.promise.all(openPromises);\n };\n return resolveRefs(schema, schema, schemaURL, dependencies).then(function (_) { return new ResolvedSchema(schema, resolveErrors); });\n };\n JSONSchemaService.prototype.getSchemaForResource = function (resource, document) {\n // first use $schema if present\n if (document && document.root && document.root.type === 'object') {\n var schemaProperties = document.root.properties.filter(function (p) { return (p.keyNode.value === '$schema') && p.valueNode && p.valueNode.type === 'string'; });\n if (schemaProperties.length > 0) {\n var valueNode = schemaProperties[0].valueNode;\n if (valueNode && valueNode.type === 'string') {\n var schemeId = Parser.getNodeValue(valueNode);\n if (schemeId && Strings.startsWith(schemeId, '.') && this.contextService) {\n schemeId = this.contextService.resolveRelativePath(schemeId, resource);\n }\n if (schemeId) {\n var id = normalizeId(schemeId);\n return this.getOrAddSchemaHandle(id).getResolvedSchema();\n }\n }\n }\n }\n if (this.cachedSchemaForResource && this.cachedSchemaForResource.resource === resource) {\n return this.cachedSchemaForResource.resolvedSchema;\n }\n var seen = Object.create(null);\n var schemas = [];\n for (var _i = 0, _a = this.filePatternAssociations; _i < _a.length; _i++) {\n var entry = _a[_i];\n if (entry.matchesPattern(resource)) {\n for (var _b = 0, _c = entry.getURIs(); _b < _c.length; _b++) {\n var schemaId = _c[_b];\n if (!seen[schemaId]) {\n schemas.push(schemaId);\n seen[schemaId] = true;\n }\n }\n }\n }\n var resolvedSchema = schemas.length > 0 ? this.createCombinedSchema(resource, schemas).getResolvedSchema() : this.promise.resolve(undefined);\n this.cachedSchemaForResource = { resource: resource, resolvedSchema: resolvedSchema };\n return resolvedSchema;\n };\n JSONSchemaService.prototype.createCombinedSchema = function (resource, schemaIds) {\n if (schemaIds.length === 1) {\n return this.getOrAddSchemaHandle(schemaIds[0]);\n }\n else {\n var combinedSchemaId = 'schemaservice://combinedSchema/' + encodeURIComponent(resource);\n var combinedSchema = {\n allOf: schemaIds.map(function (schemaId) { return ({ $ref: schemaId }); })\n };\n return this.addSchemaHandle(combinedSchemaId, combinedSchema);\n }\n };\n JSONSchemaService.prototype.getMatchingSchemas = function (document, jsonDocument, schema) {\n if (schema) {\n var id = schema.id || ('schemaservice://untitled/matchingSchemas/' + idCounter++);\n return this.resolveSchemaContent(new UnresolvedSchema(schema), id, {}).then(function (resolvedSchema) {\n return jsonDocument.getMatchingSchemas(resolvedSchema.schema).filter(function (s) { return !s.inverted; });\n });\n }\n return this.getSchemaForResource(document.uri, jsonDocument).then(function (schema) {\n if (schema) {\n return jsonDocument.getMatchingSchemas(schema.schema).filter(function (s) { return !s.inverted; });\n }\n return [];\n });\n };\n return JSONSchemaService;\n}());\nexport { JSONSchemaService };\nvar idCounter = 0;\nfunction normalizeId(id) {\n // remove trailing '#', normalize drive capitalization\n try {\n return URI.parse(id).toString();\n }\n catch (e) {\n return id;\n }\n}\nfunction toDisplayString(url) {\n try {\n var uri = URI.parse(url);\n if (uri.scheme === 'file') {\n return uri.fsPath;\n }\n }\n catch (e) {\n // ignore\n }\n return url;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Range, SelectionRange } from '../jsonLanguageTypes.js';\nimport { createScanner } from '../../jsonc-parser/main.js';\nexport function getSelectionRanges(document, positions, doc) {\n function getSelectionRange(position) {\n var offset = document.offsetAt(position);\n var node = doc.getNodeFromOffset(offset, true);\n var result = [];\n while (node) {\n switch (node.type) {\n case 'string':\n case 'object':\n case 'array':\n // range without \", [ or {\n var cStart = node.offset + 1, cEnd = node.offset + node.length - 1;\n if (cStart < cEnd && offset >= cStart && offset <= cEnd) {\n result.push(newRange(cStart, cEnd));\n }\n result.push(newRange(node.offset, node.offset + node.length));\n break;\n case 'number':\n case 'boolean':\n case 'null':\n case 'property':\n result.push(newRange(node.offset, node.offset + node.length));\n break;\n }\n if (node.type === 'property' || node.parent && node.parent.type === 'array') {\n var afterCommaOffset = getOffsetAfterNextToken(node.offset + node.length, 5 /* CommaToken */);\n if (afterCommaOffset !== -1) {\n result.push(newRange(node.offset, afterCommaOffset));\n }\n }\n node = node.parent;\n }\n var current = undefined;\n for (var index = result.length - 1; index >= 0; index--) {\n current = SelectionRange.create(result[index], current);\n }\n if (!current) {\n current = SelectionRange.create(Range.create(position, position));\n }\n return current;\n }\n function newRange(start, end) {\n return Range.create(document.positionAt(start), document.positionAt(end));\n }\n var scanner = createScanner(document.getText(), true);\n function getOffsetAfterNextToken(offset, expectedToken) {\n scanner.setPosition(offset);\n var token = scanner.scan();\n if (token === expectedToken) {\n return scanner.getTokenOffset() + scanner.getTokenLength();\n }\n return -1;\n }\n return positions.map(getSelectionRange);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { UnresolvedSchema } from './jsonSchemaService.js';\nimport { ErrorCode, Diagnostic, DiagnosticSeverity, Range } from '../jsonLanguageTypes.js';\nimport * as nls from '../../../fillers/vscode-nls.js';\nimport { isBoolean } from '../utils/objects.js';\nvar localize = nls.loadMessageBundle();\nvar JSONValidation = /** @class */ (function () {\n function JSONValidation(jsonSchemaService, promiseConstructor) {\n this.jsonSchemaService = jsonSchemaService;\n this.promise = promiseConstructor;\n this.validationEnabled = true;\n }\n JSONValidation.prototype.configure = function (raw) {\n if (raw) {\n this.validationEnabled = raw.validate;\n this.commentSeverity = raw.allowComments ? undefined : DiagnosticSeverity.Error;\n }\n };\n JSONValidation.prototype.doValidation = function (textDocument, jsonDocument, documentSettings, schema) {\n var _this = this;\n if (!this.validationEnabled) {\n return this.promise.resolve([]);\n }\n var diagnostics = [];\n var added = {};\n var addProblem = function (problem) {\n // remove duplicated messages\n var signature = problem.range.start.line + ' ' + problem.range.start.character + ' ' + problem.message;\n if (!added[signature]) {\n added[signature] = true;\n diagnostics.push(problem);\n }\n };\n var getDiagnostics = function (schema) {\n var trailingCommaSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.trailingCommas) : DiagnosticSeverity.Error;\n var commentSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.comments) : _this.commentSeverity;\n if (schema) {\n if (schema.errors.length && jsonDocument.root) {\n var astRoot = jsonDocument.root;\n var property = astRoot.type === 'object' ? astRoot.properties[0] : undefined;\n if (property && property.keyNode.value === '$schema') {\n var node = property.valueNode || property;\n var range = Range.create(textDocument.positionAt(node.offset), textDocument.positionAt(node.offset + node.length));\n addProblem(Diagnostic.create(range, schema.errors[0], DiagnosticSeverity.Warning, ErrorCode.SchemaResolveError));\n }\n else {\n var range = Range.create(textDocument.positionAt(astRoot.offset), textDocument.positionAt(astRoot.offset + 1));\n addProblem(Diagnostic.create(range, schema.errors[0], DiagnosticSeverity.Warning, ErrorCode.SchemaResolveError));\n }\n }\n else {\n var semanticErrors = jsonDocument.validate(textDocument, schema.schema);\n if (semanticErrors) {\n semanticErrors.forEach(addProblem);\n }\n }\n if (schemaAllowsComments(schema.schema)) {\n commentSeverity = undefined;\n }\n if (schemaAllowsTrailingCommas(schema.schema)) {\n trailingCommaSeverity = undefined;\n }\n }\n for (var _i = 0, _a = jsonDocument.syntaxErrors; _i < _a.length; _i++) {\n var p = _a[_i];\n if (p.code === ErrorCode.TrailingComma) {\n if (typeof trailingCommaSeverity !== 'number') {\n continue;\n }\n p.severity = trailingCommaSeverity;\n }\n addProblem(p);\n }\n if (typeof commentSeverity === 'number') {\n var message_1 = localize('InvalidCommentToken', 'Comments are not permitted in JSON.');\n jsonDocument.comments.forEach(function (c) {\n addProblem(Diagnostic.create(c, message_1, commentSeverity, ErrorCode.CommentNotPermitted));\n });\n }\n return diagnostics;\n };\n if (schema) {\n var id = schema.id || ('schemaservice://untitled/' + idCounter++);\n return this.jsonSchemaService.resolveSchemaContent(new UnresolvedSchema(schema), id, {}).then(function (resolvedSchema) {\n return getDiagnostics(resolvedSchema);\n });\n }\n return this.jsonSchemaService.getSchemaForResource(textDocument.uri, jsonDocument).then(function (schema) {\n return getDiagnostics(schema);\n });\n };\n return JSONValidation;\n}());\nexport { JSONValidation };\nvar idCounter = 0;\nfunction schemaAllowsComments(schemaRef) {\n if (schemaRef && typeof schemaRef === 'object') {\n if (isBoolean(schemaRef.allowComments)) {\n return schemaRef.allowComments;\n }\n if (schemaRef.allOf) {\n for (var _i = 0, _a = schemaRef.allOf; _i < _a.length; _i++) {\n var schema = _a[_i];\n var allow = schemaAllowsComments(schema);\n if (isBoolean(allow)) {\n return allow;\n }\n }\n }\n }\n return undefined;\n}\nfunction schemaAllowsTrailingCommas(schemaRef) {\n if (schemaRef && typeof schemaRef === 'object') {\n if (isBoolean(schemaRef.allowTrailingCommas)) {\n return schemaRef.allowTrailingCommas;\n }\n var deprSchemaRef = schemaRef;\n if (isBoolean(deprSchemaRef['allowsTrailingCommas'])) { // deprecated\n return deprSchemaRef['allowsTrailingCommas'];\n }\n if (schemaRef.allOf) {\n for (var _i = 0, _a = schemaRef.allOf; _i < _a.length; _i++) {\n var schema = _a[_i];\n var allow = schemaAllowsTrailingCommas(schema);\n if (isBoolean(allow)) {\n return allow;\n }\n }\n }\n }\n return undefined;\n}\nfunction toDiagnosticSeverity(severityLevel) {\n switch (severityLevel) {\n case 'error': return DiagnosticSeverity.Error;\n case 'warning': return DiagnosticSeverity.Warning;\n case 'ignore': return undefined;\n }\n return undefined;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar Digit0 = 48;\nvar Digit9 = 57;\nvar A = 65;\nvar a = 97;\nvar f = 102;\nexport function hexDigit(charCode) {\n if (charCode < Digit0) {\n return 0;\n }\n if (charCode <= Digit9) {\n return charCode - Digit0;\n }\n if (charCode < a) {\n charCode += (a - A);\n }\n if (charCode >= a && charCode <= f) {\n return charCode - a + 10;\n }\n return 0;\n}\nexport function colorFromHex(text) {\n if (text[0] !== '#') {\n return undefined;\n }\n switch (text.length) {\n case 4:\n return {\n red: (hexDigit(text.charCodeAt(1)) * 0x11) / 255.0,\n green: (hexDigit(text.charCodeAt(2)) * 0x11) / 255.0,\n blue: (hexDigit(text.charCodeAt(3)) * 0x11) / 255.0,\n alpha: 1\n };\n case 5:\n return {\n red: (hexDigit(text.charCodeAt(1)) * 0x11) / 255.0,\n green: (hexDigit(text.charCodeAt(2)) * 0x11) / 255.0,\n blue: (hexDigit(text.charCodeAt(3)) * 0x11) / 255.0,\n alpha: (hexDigit(text.charCodeAt(4)) * 0x11) / 255.0,\n };\n case 7:\n return {\n red: (hexDigit(text.charCodeAt(1)) * 0x10 + hexDigit(text.charCodeAt(2))) / 255.0,\n green: (hexDigit(text.charCodeAt(3)) * 0x10 + hexDigit(text.charCodeAt(4))) / 255.0,\n blue: (hexDigit(text.charCodeAt(5)) * 0x10 + hexDigit(text.charCodeAt(6))) / 255.0,\n alpha: 1\n };\n case 9:\n return {\n red: (hexDigit(text.charCodeAt(1)) * 0x10 + hexDigit(text.charCodeAt(2))) / 255.0,\n green: (hexDigit(text.charCodeAt(3)) * 0x10 + hexDigit(text.charCodeAt(4))) / 255.0,\n blue: (hexDigit(text.charCodeAt(5)) * 0x10 + hexDigit(text.charCodeAt(6))) / 255.0,\n alpha: (hexDigit(text.charCodeAt(7)) * 0x10 + hexDigit(text.charCodeAt(8))) / 255.0\n };\n }\n return undefined;\n}\nexport function colorFrom256RGB(red, green, blue, alpha) {\n if (alpha === void 0) { alpha = 1.0; }\n return {\n red: red / 255.0,\n green: green / 255.0,\n blue: blue / 255.0,\n alpha: alpha\n };\n}\n","/*---------------------------------------------------------------------------------------------\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License. See License.txt in the project root for license information.\n*--------------------------------------------------------------------------------------------*/\nexport function stringifyObject(obj, indent, stringifyLiteral) {\n if (obj !== null && typeof obj === 'object') {\n var newIndent = indent + '\\t';\n if (Array.isArray(obj)) {\n if (obj.length === 0) {\n return '[]';\n }\n var result = '[\\n';\n for (var i = 0; i < obj.length; i++) {\n result += newIndent + stringifyObject(obj[i], newIndent, stringifyLiteral);\n if (i < obj.length - 1) {\n result += ',';\n }\n result += '\\n';\n }\n result += indent + ']';\n return result;\n }\n else {\n var keys = Object.keys(obj);\n if (keys.length === 0) {\n return '{}';\n }\n var result = '{\\n';\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n result += newIndent + JSON.stringify(key) + ': ' + stringifyObject(obj[key], newIndent, stringifyLiteral);\n if (i < keys.length - 1) {\n result += ',';\n }\n result += '\\n';\n }\n result += indent + '}';\n return result;\n }\n }\n return stringifyLiteral(obj);\n}\n","/*---------------------------------------------------------------------------------------------\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License. See License.txt in the project root for license information.\n*--------------------------------------------------------------------------------------------*/\nexport function equals(one, other) {\n if (one === other) {\n return true;\n }\n if (one === null || one === undefined || other === null || other === undefined) {\n return false;\n }\n if (typeof one !== typeof other) {\n return false;\n }\n if (typeof one !== 'object') {\n return false;\n }\n if ((Array.isArray(one)) !== (Array.isArray(other))) {\n return false;\n }\n var i, key;\n if (Array.isArray(one)) {\n if (one.length !== other.length) {\n return false;\n }\n for (i = 0; i < one.length; i++) {\n if (!equals(one[i], other[i])) {\n return false;\n }\n }\n }\n else {\n var oneKeys = [];\n for (key in one) {\n oneKeys.push(key);\n }\n oneKeys.sort();\n var otherKeys = [];\n for (key in other) {\n otherKeys.push(key);\n }\n otherKeys.sort();\n if (!equals(oneKeys, otherKeys)) {\n return false;\n }\n for (i = 0; i < oneKeys.length; i++) {\n if (!equals(one[oneKeys[i]], other[oneKeys[i]])) {\n return false;\n }\n }\n }\n return true;\n}\nexport function isNumber(val) {\n return typeof val === 'number';\n}\nexport function isDefined(val) {\n return typeof val !== 'undefined';\n}\nexport function isBoolean(val) {\n return typeof val === 'boolean';\n}\nexport function isString(val) {\n return typeof val === 'string';\n}\n","/*---------------------------------------------------------------------------------------------\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License. See License.txt in the project root for license information.\n*--------------------------------------------------------------------------------------------*/\nexport function startsWith(haystack, needle) {\n if (haystack.length < needle.length) {\n return false;\n }\n for (var i = 0; i < needle.length; i++) {\n if (haystack[i] !== needle[i]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Determines if haystack ends with needle.\n */\nexport function endsWith(haystack, needle) {\n var diff = haystack.length - needle.length;\n if (diff > 0) {\n return haystack.lastIndexOf(needle) === diff;\n }\n else if (diff === 0) {\n return haystack === needle;\n }\n else {\n return false;\n }\n}\nexport function convertSimple2RegExpPattern(pattern) {\n return pattern.replace(/[\\-\\\\\\{\\}\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, '\\\\$&').replace(/[\\*]/g, '.*');\n}\nexport function repeat(value, count) {\n var s = '';\n while (count > 0) {\n if ((count & 1) === 1) {\n s += value;\n }\n value += value;\n count = count >>> 1;\n }\n return s;\n}\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nvar FullTextDocument = /** @class */ (function () {\n function FullTextDocument(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = undefined;\n }\n Object.defineProperty(FullTextDocument.prototype, \"uri\", {\n get: function () {\n return this._uri;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"languageId\", {\n get: function () {\n return this._languageId;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"version\", {\n get: function () {\n return this._version;\n },\n enumerable: true,\n configurable: true\n });\n FullTextDocument.prototype.getText = function (range) {\n if (range) {\n var start = this.offsetAt(range.start);\n var end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n };\n FullTextDocument.prototype.update = function (changes, version) {\n for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) {\n var change = changes_1[_i];\n if (FullTextDocument.isIncremental(change)) {\n // makes sure start is before end\n var range = getWellformedRange(change.range);\n // update content\n var startOffset = this.offsetAt(range.start);\n var endOffset = this.offsetAt(range.end);\n this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length);\n // update the offsets\n var startLine = Math.max(range.start.line, 0);\n var endLine = Math.max(range.end.line, 0);\n var lineOffsets = this._lineOffsets;\n var addedLineOffsets = computeLineOffsets(change.text, false, startOffset);\n if (endLine - startLine === addedLineOffsets.length) {\n for (var i = 0, len = addedLineOffsets.length; i < len; i++) {\n lineOffsets[i + startLine + 1] = addedLineOffsets[i];\n }\n }\n else {\n if (addedLineOffsets.length < 10000) {\n lineOffsets.splice.apply(lineOffsets, [startLine + 1, endLine - startLine].concat(addedLineOffsets));\n }\n else { // avoid too many arguments for splice\n this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1));\n }\n }\n var diff = change.text.length - (endOffset - startOffset);\n if (diff !== 0) {\n for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) {\n lineOffsets[i] = lineOffsets[i] + diff;\n }\n }\n }\n else if (FullTextDocument.isFull(change)) {\n this._content = change.text;\n this._lineOffsets = undefined;\n }\n else {\n throw new Error('Unknown change event received');\n }\n }\n this._version = version;\n };\n FullTextDocument.prototype.getLineOffsets = function () {\n if (this._lineOffsets === undefined) {\n this._lineOffsets = computeLineOffsets(this._content, true);\n }\n return this._lineOffsets;\n };\n FullTextDocument.prototype.positionAt = function (offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n var lineOffsets = this.getLineOffsets();\n var low = 0, high = lineOffsets.length;\n if (high === 0) {\n return { line: 0, character: offset };\n }\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n // low is the least x for which the line offset is larger than the current offset\n // or array.length if no line offset is larger than the current offset\n var line = low - 1;\n return { line: line, character: offset - lineOffsets[line] };\n };\n FullTextDocument.prototype.offsetAt = function (position) {\n var lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n }\n else if (position.line < 0) {\n return 0;\n }\n var lineOffset = lineOffsets[position.line];\n var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\n };\n Object.defineProperty(FullTextDocument.prototype, \"lineCount\", {\n get: function () {\n return this.getLineOffsets().length;\n },\n enumerable: true,\n configurable: true\n });\n FullTextDocument.isIncremental = function (event) {\n var candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range !== undefined &&\n (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number');\n };\n FullTextDocument.isFull = function (event) {\n var candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;\n };\n return FullTextDocument;\n}());\nexport var TextDocument;\n(function (TextDocument) {\n /**\n * Creates a new text document.\n *\n * @param uri The document's uri.\n * @param languageId The document's language Id.\n * @param version The document's initial version number.\n * @param content The document's content.\n */\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument.create = create;\n /**\n * Updates a TextDocument by modifing its content.\n *\n * @param document the document to update. Only documents created by TextDocument.create are valid inputs.\n * @param changes the changes to apply to the document.\n * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter.\n *\n */\n function update(document, changes, version) {\n if (document instanceof FullTextDocument) {\n document.update(changes, version);\n return document;\n }\n else {\n throw new Error('TextDocument.update: document must be created by TextDocument.create');\n }\n }\n TextDocument.update = update;\n function applyEdits(document, edits) {\n var text = document.getText();\n var sortedEdits = mergeSort(edits.map(getWellformedEdit), function (a, b) {\n var diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n var lastModifiedOffset = 0;\n var spans = [];\n for (var _i = 0, sortedEdits_1 = sortedEdits; _i < sortedEdits_1.length; _i++) {\n var e = sortedEdits_1[_i];\n var startOffset = document.offsetAt(e.range.start);\n if (startOffset < lastModifiedOffset) {\n throw new Error('Overlapping edit');\n }\n else if (startOffset > lastModifiedOffset) {\n spans.push(text.substring(lastModifiedOffset, startOffset));\n }\n if (e.newText.length) {\n spans.push(e.newText);\n }\n lastModifiedOffset = document.offsetAt(e.range.end);\n }\n spans.push(text.substr(lastModifiedOffset));\n return spans.join('');\n }\n TextDocument.applyEdits = applyEdits;\n})(TextDocument || (TextDocument = {}));\nfunction mergeSort(data, compare) {\n if (data.length <= 1) {\n // sorted\n return data;\n }\n var p = (data.length / 2) | 0;\n var left = data.slice(0, p);\n var right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n var leftIdx = 0;\n var rightIdx = 0;\n var i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n var ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n // smaller_equal -> take left to preserve order\n data[i++] = left[leftIdx++];\n }\n else {\n // greater -> take right\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n}\nfunction computeLineOffsets(text, isAtLineStart, textOffset) {\n if (textOffset === void 0) { textOffset = 0; }\n var result = isAtLineStart ? [textOffset] : [];\n for (var i = 0; i < text.length; i++) {\n var ch = text.charCodeAt(i);\n if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) {\n if (ch === 13 /* CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* LineFeed */) {\n i++;\n }\n result.push(textOffset + i + 1);\n }\n }\n return result;\n}\nfunction getWellformedRange(range) {\n var start = range.start;\n var end = range.end;\n if (start.line > end.line || (start.line === end.line && start.character > end.character)) {\n return { start: end, end: start };\n }\n return range;\n}\nfunction getWellformedEdit(textEdit) {\n var range = getWellformedRange(textEdit.range);\n if (range !== textEdit.range) {\n return { newText: textEdit.newText, range: range };\n }\n return textEdit;\n}\n","/* --------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n * ------------------------------------------------------------------------------------------ */\r\n'use strict';\r\n/**\r\n * The Position namespace provides helper functions to work with\r\n * [Position](#Position) literals.\r\n */\r\nexport var Position;\r\n(function (Position) {\r\n /**\r\n * Creates a new Position literal from the given line and character.\r\n * @param line The position's line.\r\n * @param character The position's character.\r\n */\r\n function create(line, character) {\r\n return { line: line, character: character };\r\n }\r\n Position.create = create;\r\n /**\r\n * Checks whether the given liternal conforms to the [Position](#Position) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }\r\n Position.is = is;\r\n})(Position || (Position = {}));\r\n/**\r\n * The Range namespace provides helper functions to work with\r\n * [Range](#Range) literals.\r\n */\r\nexport var Range;\r\n(function (Range) {\r\n function create(one, two, three, four) {\r\n if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) {\r\n return { start: Position.create(one, two), end: Position.create(three, four) };\r\n }\r\n else if (Position.is(one) && Position.is(two)) {\r\n return { start: one, end: two };\r\n }\r\n else {\r\n throw new Error(\"Range#create called with invalid arguments[\" + one + \", \" + two + \", \" + three + \", \" + four + \"]\");\r\n }\r\n }\r\n Range.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [Range](#Range) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }\r\n Range.is = is;\r\n})(Range || (Range = {}));\r\n/**\r\n * The Location namespace provides helper functions to work with\r\n * [Location](#Location) literals.\r\n */\r\nexport var Location;\r\n(function (Location) {\r\n /**\r\n * Creates a Location literal.\r\n * @param uri The location's uri.\r\n * @param range The location's range.\r\n */\r\n function create(uri, range) {\r\n return { uri: uri, range: range };\r\n }\r\n Location.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [Location](#Location) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\r\n }\r\n Location.is = is;\r\n})(Location || (Location = {}));\r\n/**\r\n * The LocationLink namespace provides helper functions to work with\r\n * [LocationLink](#LocationLink) literals.\r\n */\r\nexport var LocationLink;\r\n(function (LocationLink) {\r\n /**\r\n * Creates a LocationLink literal.\r\n * @param targetUri The definition's uri.\r\n * @param targetRange The full range of the definition.\r\n * @param targetSelectionRange The span of the symbol definition at the target.\r\n * @param originSelectionRange The span of the symbol being defined in the originating source file.\r\n */\r\n function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\r\n return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\r\n }\r\n LocationLink.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\r\n && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))\r\n && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\r\n }\r\n LocationLink.is = is;\r\n})(LocationLink || (LocationLink = {}));\r\n/**\r\n * The Color namespace provides helper functions to work with\r\n * [Color](#Color) literals.\r\n */\r\nexport var Color;\r\n(function (Color) {\r\n /**\r\n * Creates a new Color literal.\r\n */\r\n function create(red, green, blue, alpha) {\r\n return {\r\n red: red,\r\n green: green,\r\n blue: blue,\r\n alpha: alpha,\r\n };\r\n }\r\n Color.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [Color](#Color) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.number(candidate.red)\r\n && Is.number(candidate.green)\r\n && Is.number(candidate.blue)\r\n && Is.number(candidate.alpha);\r\n }\r\n Color.is = is;\r\n})(Color || (Color = {}));\r\n/**\r\n * The ColorInformation namespace provides helper functions to work with\r\n * [ColorInformation](#ColorInformation) literals.\r\n */\r\nexport var ColorInformation;\r\n(function (ColorInformation) {\r\n /**\r\n * Creates a new ColorInformation literal.\r\n */\r\n function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }\r\n ColorInformation.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Range.is(candidate.range) && Color.is(candidate.color);\r\n }\r\n ColorInformation.is = is;\r\n})(ColorInformation || (ColorInformation = {}));\r\n/**\r\n * The Color namespace provides helper functions to work with\r\n * [ColorPresentation](#ColorPresentation) literals.\r\n */\r\nexport var ColorPresentation;\r\n(function (ColorPresentation) {\r\n /**\r\n * Creates a new ColorInformation literal.\r\n */\r\n function create(label, textEdit, additionalTextEdits) {\r\n return {\r\n label: label,\r\n textEdit: textEdit,\r\n additionalTextEdits: additionalTextEdits,\r\n };\r\n }\r\n ColorPresentation.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.string(candidate.label)\r\n && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\r\n && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\r\n }\r\n ColorPresentation.is = is;\r\n})(ColorPresentation || (ColorPresentation = {}));\r\n/**\r\n * Enum of known range kinds\r\n */\r\nexport var FoldingRangeKind;\r\n(function (FoldingRangeKind) {\r\n /**\r\n * Folding range for a comment\r\n */\r\n FoldingRangeKind[\"Comment\"] = \"comment\";\r\n /**\r\n * Folding range for a imports or includes\r\n */\r\n FoldingRangeKind[\"Imports\"] = \"imports\";\r\n /**\r\n * Folding range for a region (e.g. `#region`)\r\n */\r\n FoldingRangeKind[\"Region\"] = \"region\";\r\n})(FoldingRangeKind || (FoldingRangeKind = {}));\r\n/**\r\n * The folding range namespace provides helper functions to work with\r\n * [FoldingRange](#FoldingRange) literals.\r\n */\r\nexport var FoldingRange;\r\n(function (FoldingRange) {\r\n /**\r\n * Creates a new FoldingRange literal.\r\n */\r\n function create(startLine, endLine, startCharacter, endCharacter, kind) {\r\n var result = {\r\n startLine: startLine,\r\n endLine: endLine\r\n };\r\n if (Is.defined(startCharacter)) {\r\n result.startCharacter = startCharacter;\r\n }\r\n if (Is.defined(endCharacter)) {\r\n result.endCharacter = endCharacter;\r\n }\r\n if (Is.defined(kind)) {\r\n result.kind = kind;\r\n }\r\n return result;\r\n }\r\n FoldingRange.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.number(candidate.startLine) && Is.number(candidate.startLine)\r\n && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter))\r\n && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter))\r\n && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\r\n }\r\n FoldingRange.is = is;\r\n})(FoldingRange || (FoldingRange = {}));\r\n/**\r\n * The DiagnosticRelatedInformation namespace provides helper functions to work with\r\n * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.\r\n */\r\nexport var DiagnosticRelatedInformation;\r\n(function (DiagnosticRelatedInformation) {\r\n /**\r\n * Creates a new DiagnosticRelatedInformation literal.\r\n */\r\n function create(location, message) {\r\n return {\r\n location: location,\r\n message: message\r\n };\r\n }\r\n DiagnosticRelatedInformation.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\r\n }\r\n DiagnosticRelatedInformation.is = is;\r\n})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));\r\n/**\r\n * The diagnostic's severity.\r\n */\r\nexport var DiagnosticSeverity;\r\n(function (DiagnosticSeverity) {\r\n /**\r\n * Reports an error.\r\n */\r\n DiagnosticSeverity.Error = 1;\r\n /**\r\n * Reports a warning.\r\n */\r\n DiagnosticSeverity.Warning = 2;\r\n /**\r\n * Reports an information.\r\n */\r\n DiagnosticSeverity.Information = 3;\r\n /**\r\n * Reports a hint.\r\n */\r\n DiagnosticSeverity.Hint = 4;\r\n})(DiagnosticSeverity || (DiagnosticSeverity = {}));\r\n/**\r\n * The diagnostic tags.\r\n *\r\n * @since 3.15.0\r\n */\r\nexport var DiagnosticTag;\r\n(function (DiagnosticTag) {\r\n /**\r\n * Unused or unnecessary code.\r\n *\r\n * Clients are allowed to render diagnostics with this tag faded out instead of having\r\n * an error squiggle.\r\n */\r\n DiagnosticTag.Unnecessary = 1;\r\n /**\r\n * Deprecated or obsolete code.\r\n *\r\n * Clients are allowed to rendered diagnostics with this tag strike through.\r\n */\r\n DiagnosticTag.Deprecated = 2;\r\n})(DiagnosticTag || (DiagnosticTag = {}));\r\n/**\r\n * The Diagnostic namespace provides helper functions to work with\r\n * [Diagnostic](#Diagnostic) literals.\r\n */\r\nexport var Diagnostic;\r\n(function (Diagnostic) {\r\n /**\r\n * Creates a new Diagnostic literal.\r\n */\r\n function create(range, message, severity, code, source, relatedInformation) {\r\n var result = { range: range, message: message };\r\n if (Is.defined(severity)) {\r\n result.severity = severity;\r\n }\r\n if (Is.defined(code)) {\r\n result.code = code;\r\n }\r\n if (Is.defined(source)) {\r\n result.source = source;\r\n }\r\n if (Is.defined(relatedInformation)) {\r\n result.relatedInformation = relatedInformation;\r\n }\r\n return result;\r\n }\r\n Diagnostic.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate)\r\n && Range.is(candidate.range)\r\n && Is.string(candidate.message)\r\n && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\r\n && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\r\n && (Is.string(candidate.source) || Is.undefined(candidate.source))\r\n && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\r\n }\r\n Diagnostic.is = is;\r\n})(Diagnostic || (Diagnostic = {}));\r\n/**\r\n * The Command namespace provides helper functions to work with\r\n * [Command](#Command) literals.\r\n */\r\nexport var Command;\r\n(function (Command) {\r\n /**\r\n * Creates a new Command literal.\r\n */\r\n function create(title, command) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n var result = { title: title, command: command };\r\n if (Is.defined(args) && args.length > 0) {\r\n result.arguments = args;\r\n }\r\n return result;\r\n }\r\n Command.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [Command](#Command) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\r\n }\r\n Command.is = is;\r\n})(Command || (Command = {}));\r\n/**\r\n * The TextEdit namespace provides helper function to create replace,\r\n * insert and delete edits more easily.\r\n */\r\nexport var TextEdit;\r\n(function (TextEdit) {\r\n /**\r\n * Creates a replace text edit.\r\n * @param range The range of text to be replaced.\r\n * @param newText The new text.\r\n */\r\n function replace(range, newText) {\r\n return { range: range, newText: newText };\r\n }\r\n TextEdit.replace = replace;\r\n /**\r\n * Creates a insert text edit.\r\n * @param position The position to insert the text at.\r\n * @param newText The text to be inserted.\r\n */\r\n function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }\r\n TextEdit.insert = insert;\r\n /**\r\n * Creates a delete text edit.\r\n * @param range The range of text to be deleted.\r\n */\r\n function del(range) {\r\n return { range: range, newText: '' };\r\n }\r\n TextEdit.del = del;\r\n function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate)\r\n && Is.string(candidate.newText)\r\n && Range.is(candidate.range);\r\n }\r\n TextEdit.is = is;\r\n})(TextEdit || (TextEdit = {}));\r\n/**\r\n * The TextDocumentEdit namespace provides helper function to create\r\n * an edit that manipulates a text document.\r\n */\r\nexport var TextDocumentEdit;\r\n(function (TextDocumentEdit) {\r\n /**\r\n * Creates a new `TextDocumentEdit`\r\n */\r\n function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }\r\n TextDocumentEdit.create = create;\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate)\r\n && VersionedTextDocumentIdentifier.is(candidate.textDocument)\r\n && Array.isArray(candidate.edits);\r\n }\r\n TextDocumentEdit.is = is;\r\n})(TextDocumentEdit || (TextDocumentEdit = {}));\r\nexport var CreateFile;\r\n(function (CreateFile) {\r\n function create(uri, options) {\r\n var result = {\r\n kind: 'create',\r\n uri: uri\r\n };\r\n if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\r\n result.options = options;\r\n }\r\n return result;\r\n }\r\n CreateFile.create = create;\r\n function is(value) {\r\n var candidate = value;\r\n return candidate && candidate.kind === 'create' && Is.string(candidate.uri) &&\r\n (candidate.options === void 0 ||\r\n ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));\r\n }\r\n CreateFile.is = is;\r\n})(CreateFile || (CreateFile = {}));\r\nexport var RenameFile;\r\n(function (RenameFile) {\r\n function create(oldUri, newUri, options) {\r\n var result = {\r\n kind: 'rename',\r\n oldUri: oldUri,\r\n newUri: newUri\r\n };\r\n if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\r\n result.options = options;\r\n }\r\n return result;\r\n }\r\n RenameFile.create = create;\r\n function is(value) {\r\n var candidate = value;\r\n return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) &&\r\n (candidate.options === void 0 ||\r\n ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));\r\n }\r\n RenameFile.is = is;\r\n})(RenameFile || (RenameFile = {}));\r\nexport var DeleteFile;\r\n(function (DeleteFile) {\r\n function create(uri, options) {\r\n var result = {\r\n kind: 'delete',\r\n uri: uri\r\n };\r\n if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {\r\n result.options = options;\r\n }\r\n return result;\r\n }\r\n DeleteFile.create = create;\r\n function is(value) {\r\n var candidate = value;\r\n return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) &&\r\n (candidate.options === void 0 ||\r\n ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))));\r\n }\r\n DeleteFile.is = is;\r\n})(DeleteFile || (DeleteFile = {}));\r\nexport var WorkspaceEdit;\r\n(function (WorkspaceEdit) {\r\n function is(value) {\r\n var candidate = value;\r\n return candidate &&\r\n (candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&\r\n (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) {\r\n if (Is.string(change.kind)) {\r\n return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\r\n }\r\n else {\r\n return TextDocumentEdit.is(change);\r\n }\r\n }));\r\n }\r\n WorkspaceEdit.is = is;\r\n})(WorkspaceEdit || (WorkspaceEdit = {}));\r\nvar TextEditChangeImpl = /** @class */ (function () {\r\n function TextEditChangeImpl(edits) {\r\n this.edits = edits;\r\n }\r\n TextEditChangeImpl.prototype.insert = function (position, newText) {\r\n this.edits.push(TextEdit.insert(position, newText));\r\n };\r\n TextEditChangeImpl.prototype.replace = function (range, newText) {\r\n this.edits.push(TextEdit.replace(range, newText));\r\n };\r\n TextEditChangeImpl.prototype.delete = function (range) {\r\n this.edits.push(TextEdit.del(range));\r\n };\r\n TextEditChangeImpl.prototype.add = function (edit) {\r\n this.edits.push(edit);\r\n };\r\n TextEditChangeImpl.prototype.all = function () {\r\n return this.edits;\r\n };\r\n TextEditChangeImpl.prototype.clear = function () {\r\n this.edits.splice(0, this.edits.length);\r\n };\r\n return TextEditChangeImpl;\r\n}());\r\n/**\r\n * A workspace change helps constructing changes to a workspace.\r\n */\r\nvar WorkspaceChange = /** @class */ (function () {\r\n function WorkspaceChange(workspaceEdit) {\r\n var _this = this;\r\n this._textEditChanges = Object.create(null);\r\n if (workspaceEdit) {\r\n this._workspaceEdit = workspaceEdit;\r\n if (workspaceEdit.documentChanges) {\r\n workspaceEdit.documentChanges.forEach(function (change) {\r\n if (TextDocumentEdit.is(change)) {\r\n var textEditChange = new TextEditChangeImpl(change.edits);\r\n _this._textEditChanges[change.textDocument.uri] = textEditChange;\r\n }\r\n });\r\n }\r\n else if (workspaceEdit.changes) {\r\n Object.keys(workspaceEdit.changes).forEach(function (key) {\r\n var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\r\n _this._textEditChanges[key] = textEditChange;\r\n });\r\n }\r\n }\r\n }\r\n Object.defineProperty(WorkspaceChange.prototype, \"edit\", {\r\n /**\r\n * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal\r\n * use to be returned from a workspace edit operation like rename.\r\n */\r\n get: function () {\r\n return this._workspaceEdit;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n WorkspaceChange.prototype.getTextEditChange = function (key) {\r\n if (VersionedTextDocumentIdentifier.is(key)) {\r\n if (!this._workspaceEdit) {\r\n this._workspaceEdit = {\r\n documentChanges: []\r\n };\r\n }\r\n if (!this._workspaceEdit.documentChanges) {\r\n throw new Error('Workspace edit is not configured for document changes.');\r\n }\r\n var textDocument = key;\r\n var result = this._textEditChanges[textDocument.uri];\r\n if (!result) {\r\n var edits = [];\r\n var textDocumentEdit = {\r\n textDocument: textDocument,\r\n edits: edits\r\n };\r\n this._workspaceEdit.documentChanges.push(textDocumentEdit);\r\n result = new TextEditChangeImpl(edits);\r\n this._textEditChanges[textDocument.uri] = result;\r\n }\r\n return result;\r\n }\r\n else {\r\n if (!this._workspaceEdit) {\r\n this._workspaceEdit = {\r\n changes: Object.create(null)\r\n };\r\n }\r\n if (!this._workspaceEdit.changes) {\r\n throw new Error('Workspace edit is not configured for normal text edit changes.');\r\n }\r\n var result = this._textEditChanges[key];\r\n if (!result) {\r\n var edits = [];\r\n this._workspaceEdit.changes[key] = edits;\r\n result = new TextEditChangeImpl(edits);\r\n this._textEditChanges[key] = result;\r\n }\r\n return result;\r\n }\r\n };\r\n WorkspaceChange.prototype.createFile = function (uri, options) {\r\n this.checkDocumentChanges();\r\n this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options));\r\n };\r\n WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) {\r\n this.checkDocumentChanges();\r\n this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options));\r\n };\r\n WorkspaceChange.prototype.deleteFile = function (uri, options) {\r\n this.checkDocumentChanges();\r\n this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options));\r\n };\r\n WorkspaceChange.prototype.checkDocumentChanges = function () {\r\n if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) {\r\n throw new Error('Workspace edit is not configured for document changes.');\r\n }\r\n };\r\n return WorkspaceChange;\r\n}());\r\nexport { WorkspaceChange };\r\n/**\r\n * The TextDocumentIdentifier namespace provides helper functions to work with\r\n * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.\r\n */\r\nexport var TextDocumentIdentifier;\r\n(function (TextDocumentIdentifier) {\r\n /**\r\n * Creates a new TextDocumentIdentifier literal.\r\n * @param uri The document's uri.\r\n */\r\n function create(uri) {\r\n return { uri: uri };\r\n }\r\n TextDocumentIdentifier.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri);\r\n }\r\n TextDocumentIdentifier.is = is;\r\n})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));\r\n/**\r\n * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\r\n * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.\r\n */\r\nexport var VersionedTextDocumentIdentifier;\r\n(function (VersionedTextDocumentIdentifier) {\r\n /**\r\n * Creates a new VersionedTextDocumentIdentifier literal.\r\n * @param uri The document's uri.\r\n * @param uri The document's text.\r\n */\r\n function create(uri, version) {\r\n return { uri: uri, version: version };\r\n }\r\n VersionedTextDocumentIdentifier.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));\r\n }\r\n VersionedTextDocumentIdentifier.is = is;\r\n})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));\r\n/**\r\n * The TextDocumentItem namespace provides helper functions to work with\r\n * [TextDocumentItem](#TextDocumentItem) literals.\r\n */\r\nexport var TextDocumentItem;\r\n(function (TextDocumentItem) {\r\n /**\r\n * Creates a new TextDocumentItem literal.\r\n * @param uri The document's uri.\r\n * @param languageId The document's language identifier.\r\n * @param version The document's version number.\r\n * @param text The document's text.\r\n */\r\n function create(uri, languageId, version, text) {\r\n return { uri: uri, languageId: languageId, version: version, text: text };\r\n }\r\n TextDocumentItem.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text);\r\n }\r\n TextDocumentItem.is = is;\r\n})(TextDocumentItem || (TextDocumentItem = {}));\r\n/**\r\n * Describes the content type that a client supports in various\r\n * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\r\n *\r\n * Please note that `MarkupKinds` must not start with a `$`. This kinds\r\n * are reserved for internal usage.\r\n */\r\nexport var MarkupKind;\r\n(function (MarkupKind) {\r\n /**\r\n * Plain text is supported as a content format\r\n */\r\n MarkupKind.PlainText = 'plaintext';\r\n /**\r\n * Markdown is supported as a content format\r\n */\r\n MarkupKind.Markdown = 'markdown';\r\n})(MarkupKind || (MarkupKind = {}));\r\n(function (MarkupKind) {\r\n /**\r\n * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\r\n }\r\n MarkupKind.is = is;\r\n})(MarkupKind || (MarkupKind = {}));\r\nexport var MarkupContent;\r\n(function (MarkupContent) {\r\n /**\r\n * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n }\r\n MarkupContent.is = is;\r\n})(MarkupContent || (MarkupContent = {}));\r\n/**\r\n * The kind of a completion entry.\r\n */\r\nexport var CompletionItemKind;\r\n(function (CompletionItemKind) {\r\n CompletionItemKind.Text = 1;\r\n CompletionItemKind.Method = 2;\r\n CompletionItemKind.Function = 3;\r\n CompletionItemKind.Constructor = 4;\r\n CompletionItemKind.Field = 5;\r\n CompletionItemKind.Variable = 6;\r\n CompletionItemKind.Class = 7;\r\n CompletionItemKind.Interface = 8;\r\n CompletionItemKind.Module = 9;\r\n CompletionItemKind.Property = 10;\r\n CompletionItemKind.Unit = 11;\r\n CompletionItemKind.Value = 12;\r\n CompletionItemKind.Enum = 13;\r\n CompletionItemKind.Keyword = 14;\r\n CompletionItemKind.Snippet = 15;\r\n CompletionItemKind.Color = 16;\r\n CompletionItemKind.File = 17;\r\n CompletionItemKind.Reference = 18;\r\n CompletionItemKind.Folder = 19;\r\n CompletionItemKind.EnumMember = 20;\r\n CompletionItemKind.Constant = 21;\r\n CompletionItemKind.Struct = 22;\r\n CompletionItemKind.Event = 23;\r\n CompletionItemKind.Operator = 24;\r\n CompletionItemKind.TypeParameter = 25;\r\n})(CompletionItemKind || (CompletionItemKind = {}));\r\n/**\r\n * Defines whether the insert text in a completion item should be interpreted as\r\n * plain text or a snippet.\r\n */\r\nexport var InsertTextFormat;\r\n(function (InsertTextFormat) {\r\n /**\r\n * The primary text to be inserted is treated as a plain string.\r\n */\r\n InsertTextFormat.PlainText = 1;\r\n /**\r\n * The primary text to be inserted is treated as a snippet.\r\n *\r\n * A snippet can define tab stops and placeholders with `$1`, `$2`\r\n * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\r\n * the end of the snippet. Placeholders with equal identifiers are linked,\r\n * that is typing in one will update others too.\r\n *\r\n * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md\r\n */\r\n InsertTextFormat.Snippet = 2;\r\n})(InsertTextFormat || (InsertTextFormat = {}));\r\n/**\r\n * Completion item tags are extra annotations that tweak the rendering of a completion\r\n * item.\r\n *\r\n * @since 3.15.0\r\n */\r\nexport var CompletionItemTag;\r\n(function (CompletionItemTag) {\r\n /**\r\n * Render a completion as obsolete, usually using a strike-out.\r\n */\r\n CompletionItemTag.Deprecated = 1;\r\n})(CompletionItemTag || (CompletionItemTag = {}));\r\n/**\r\n * The CompletionItem namespace provides functions to deal with\r\n * completion items.\r\n */\r\nexport var CompletionItem;\r\n(function (CompletionItem) {\r\n /**\r\n * Create a completion item and seed it with a label.\r\n * @param label The completion item's label\r\n */\r\n function create(label) {\r\n return { label: label };\r\n }\r\n CompletionItem.create = create;\r\n})(CompletionItem || (CompletionItem = {}));\r\n/**\r\n * The CompletionList namespace provides functions to deal with\r\n * completion lists.\r\n */\r\nexport var CompletionList;\r\n(function (CompletionList) {\r\n /**\r\n * Creates a new completion list.\r\n *\r\n * @param items The completion items.\r\n * @param isIncomplete The list is not complete.\r\n */\r\n function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }\r\n CompletionList.create = create;\r\n})(CompletionList || (CompletionList = {}));\r\nexport var MarkedString;\r\n(function (MarkedString) {\r\n /**\r\n * Creates a marked string from plain text.\r\n *\r\n * @param plainText The plain text.\r\n */\r\n function fromPlainText(plainText) {\r\n return plainText.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\r\n }\r\n MarkedString.fromPlainText = fromPlainText;\r\n /**\r\n * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r\n }\r\n MarkedString.is = is;\r\n})(MarkedString || (MarkedString = {}));\r\nexport var Hover;\r\n(function (Hover) {\r\n /**\r\n * Checks whether the given value conforms to the [Hover](#Hover) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\r\n MarkedString.is(candidate.contents) ||\r\n Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));\r\n }\r\n Hover.is = is;\r\n})(Hover || (Hover = {}));\r\n/**\r\n * The ParameterInformation namespace provides helper functions to work with\r\n * [ParameterInformation](#ParameterInformation) literals.\r\n */\r\nexport var ParameterInformation;\r\n(function (ParameterInformation) {\r\n /**\r\n * Creates a new parameter information literal.\r\n *\r\n * @param label A label string.\r\n * @param documentation A doc string.\r\n */\r\n function create(label, documentation) {\r\n return documentation ? { label: label, documentation: documentation } : { label: label };\r\n }\r\n ParameterInformation.create = create;\r\n})(ParameterInformation || (ParameterInformation = {}));\r\n/**\r\n * The SignatureInformation namespace provides helper functions to work with\r\n * [SignatureInformation](#SignatureInformation) literals.\r\n */\r\nexport var SignatureInformation;\r\n(function (SignatureInformation) {\r\n function create(label, documentation) {\r\n var parameters = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n parameters[_i - 2] = arguments[_i];\r\n }\r\n var result = { label: label };\r\n if (Is.defined(documentation)) {\r\n result.documentation = documentation;\r\n }\r\n if (Is.defined(parameters)) {\r\n result.parameters = parameters;\r\n }\r\n else {\r\n result.parameters = [];\r\n }\r\n return result;\r\n }\r\n SignatureInformation.create = create;\r\n})(SignatureInformation || (SignatureInformation = {}));\r\n/**\r\n * A document highlight kind.\r\n */\r\nexport var DocumentHighlightKind;\r\n(function (DocumentHighlightKind) {\r\n /**\r\n * A textual occurrence.\r\n */\r\n DocumentHighlightKind.Text = 1;\r\n /**\r\n * Read-access of a symbol, like reading a variable.\r\n */\r\n DocumentHighlightKind.Read = 2;\r\n /**\r\n * Write-access of a symbol, like writing to a variable.\r\n */\r\n DocumentHighlightKind.Write = 3;\r\n})(DocumentHighlightKind || (DocumentHighlightKind = {}));\r\n/**\r\n * DocumentHighlight namespace to provide helper functions to work with\r\n * [DocumentHighlight](#DocumentHighlight) literals.\r\n */\r\nexport var DocumentHighlight;\r\n(function (DocumentHighlight) {\r\n /**\r\n * Create a DocumentHighlight object.\r\n * @param range The range the highlight applies to.\r\n */\r\n function create(range, kind) {\r\n var result = { range: range };\r\n if (Is.number(kind)) {\r\n result.kind = kind;\r\n }\r\n return result;\r\n }\r\n DocumentHighlight.create = create;\r\n})(DocumentHighlight || (DocumentHighlight = {}));\r\n/**\r\n * A symbol kind.\r\n */\r\nexport var SymbolKind;\r\n(function (SymbolKind) {\r\n SymbolKind.File = 1;\r\n SymbolKind.Module = 2;\r\n SymbolKind.Namespace = 3;\r\n SymbolKind.Package = 4;\r\n SymbolKind.Class = 5;\r\n SymbolKind.Method = 6;\r\n SymbolKind.Property = 7;\r\n SymbolKind.Field = 8;\r\n SymbolKind.Constructor = 9;\r\n SymbolKind.Enum = 10;\r\n SymbolKind.Interface = 11;\r\n SymbolKind.Function = 12;\r\n SymbolKind.Variable = 13;\r\n SymbolKind.Constant = 14;\r\n SymbolKind.String = 15;\r\n SymbolKind.Number = 16;\r\n SymbolKind.Boolean = 17;\r\n SymbolKind.Array = 18;\r\n SymbolKind.Object = 19;\r\n SymbolKind.Key = 20;\r\n SymbolKind.Null = 21;\r\n SymbolKind.EnumMember = 22;\r\n SymbolKind.Struct = 23;\r\n SymbolKind.Event = 24;\r\n SymbolKind.Operator = 25;\r\n SymbolKind.TypeParameter = 26;\r\n})(SymbolKind || (SymbolKind = {}));\r\n/**\r\n * Symbol tags are extra annotations that tweak the rendering of a symbol.\r\n * @since 3.15\r\n */\r\nexport var SymbolTag;\r\n(function (SymbolTag) {\r\n /**\r\n * Render a symbol as obsolete, usually using a strike-out.\r\n */\r\n SymbolTag.Deprecated = 1;\r\n})(SymbolTag || (SymbolTag = {}));\r\nexport var SymbolInformation;\r\n(function (SymbolInformation) {\r\n /**\r\n * Creates a new symbol information literal.\r\n *\r\n * @param name The name of the symbol.\r\n * @param kind The kind of the symbol.\r\n * @param range The range of the location of the symbol.\r\n * @param uri The resource of the location of symbol, defaults to the current document.\r\n * @param containerName The name of the symbol containing the symbol.\r\n */\r\n function create(name, kind, range, uri, containerName) {\r\n var result = {\r\n name: name,\r\n kind: kind,\r\n location: { uri: uri, range: range }\r\n };\r\n if (containerName) {\r\n result.containerName = containerName;\r\n }\r\n return result;\r\n }\r\n SymbolInformation.create = create;\r\n})(SymbolInformation || (SymbolInformation = {}));\r\nexport var DocumentSymbol;\r\n(function (DocumentSymbol) {\r\n /**\r\n * Creates a new symbol information literal.\r\n *\r\n * @param name The name of the symbol.\r\n * @param detail The detail of the symbol.\r\n * @param kind The kind of the symbol.\r\n * @param range The range of the symbol.\r\n * @param selectionRange The selectionRange of the symbol.\r\n * @param children Children of the symbol.\r\n */\r\n function create(name, detail, kind, range, selectionRange, children) {\r\n var result = {\r\n name: name,\r\n detail: detail,\r\n kind: kind,\r\n range: range,\r\n selectionRange: selectionRange\r\n };\r\n if (children !== void 0) {\r\n result.children = children;\r\n }\r\n return result;\r\n }\r\n DocumentSymbol.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return candidate &&\r\n Is.string(candidate.name) && Is.number(candidate.kind) &&\r\n Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\r\n (candidate.detail === void 0 || Is.string(candidate.detail)) &&\r\n (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) &&\r\n (candidate.children === void 0 || Array.isArray(candidate.children));\r\n }\r\n DocumentSymbol.is = is;\r\n})(DocumentSymbol || (DocumentSymbol = {}));\r\n/**\r\n * A set of predefined code action kinds\r\n */\r\nexport var CodeActionKind;\r\n(function (CodeActionKind) {\r\n /**\r\n * Empty kind.\r\n */\r\n CodeActionKind.Empty = '';\r\n /**\r\n * Base kind for quickfix actions: 'quickfix'\r\n */\r\n CodeActionKind.QuickFix = 'quickfix';\r\n /**\r\n * Base kind for refactoring actions: 'refactor'\r\n */\r\n CodeActionKind.Refactor = 'refactor';\r\n /**\r\n * Base kind for refactoring extraction actions: 'refactor.extract'\r\n *\r\n * Example extract actions:\r\n *\r\n * - Extract method\r\n * - Extract function\r\n * - Extract variable\r\n * - Extract interface from class\r\n * - ...\r\n */\r\n CodeActionKind.RefactorExtract = 'refactor.extract';\r\n /**\r\n * Base kind for refactoring inline actions: 'refactor.inline'\r\n *\r\n * Example inline actions:\r\n *\r\n * - Inline function\r\n * - Inline variable\r\n * - Inline constant\r\n * - ...\r\n */\r\n CodeActionKind.RefactorInline = 'refactor.inline';\r\n /**\r\n * Base kind for refactoring rewrite actions: 'refactor.rewrite'\r\n *\r\n * Example rewrite actions:\r\n *\r\n * - Convert JavaScript function to class\r\n * - Add or remove parameter\r\n * - Encapsulate field\r\n * - Make method static\r\n * - Move method to base class\r\n * - ...\r\n */\r\n CodeActionKind.RefactorRewrite = 'refactor.rewrite';\r\n /**\r\n * Base kind for source actions: `source`\r\n *\r\n * Source code actions apply to the entire file.\r\n */\r\n CodeActionKind.Source = 'source';\r\n /**\r\n * Base kind for an organize imports source action: `source.organizeImports`\r\n */\r\n CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\r\n /**\r\n * Base kind for auto-fix source actions: `source.fixAll`.\r\n *\r\n * Fix all actions automatically fix errors that have a clear fix that do not require user input.\r\n * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\r\n *\r\n * @since 3.15.0\r\n */\r\n CodeActionKind.SourceFixAll = 'source.fixAll';\r\n})(CodeActionKind || (CodeActionKind = {}));\r\n/**\r\n * The CodeActionContext namespace provides helper functions to work with\r\n * [CodeActionContext](#CodeActionContext) literals.\r\n */\r\nexport var CodeActionContext;\r\n(function (CodeActionContext) {\r\n /**\r\n * Creates a new CodeActionContext literal.\r\n */\r\n function create(diagnostics, only) {\r\n var result = { diagnostics: diagnostics };\r\n if (only !== void 0 && only !== null) {\r\n result.only = only;\r\n }\r\n return result;\r\n }\r\n CodeActionContext.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r\n }\r\n CodeActionContext.is = is;\r\n})(CodeActionContext || (CodeActionContext = {}));\r\nexport var CodeAction;\r\n(function (CodeAction) {\r\n function create(title, commandOrEdit, kind) {\r\n var result = { title: title };\r\n if (Command.is(commandOrEdit)) {\r\n result.command = commandOrEdit;\r\n }\r\n else {\r\n result.edit = commandOrEdit;\r\n }\r\n if (kind !== void 0) {\r\n result.kind = kind;\r\n }\r\n return result;\r\n }\r\n CodeAction.create = create;\r\n function is(value) {\r\n var candidate = value;\r\n return candidate && Is.string(candidate.title) &&\r\n (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\r\n (candidate.kind === void 0 || Is.string(candidate.kind)) &&\r\n (candidate.edit !== void 0 || candidate.command !== void 0) &&\r\n (candidate.command === void 0 || Command.is(candidate.command)) &&\r\n (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) &&\r\n (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));\r\n }\r\n CodeAction.is = is;\r\n})(CodeAction || (CodeAction = {}));\r\n/**\r\n * The CodeLens namespace provides helper functions to work with\r\n * [CodeLens](#CodeLens) literals.\r\n */\r\nexport var CodeLens;\r\n(function (CodeLens) {\r\n /**\r\n * Creates a new CodeLens literal.\r\n */\r\n function create(range, data) {\r\n var result = { range: range };\r\n if (Is.defined(data)) {\r\n result.data = data;\r\n }\r\n return result;\r\n }\r\n CodeLens.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\r\n }\r\n CodeLens.is = is;\r\n})(CodeLens || (CodeLens = {}));\r\n/**\r\n * The FormattingOptions namespace provides helper functions to work with\r\n * [FormattingOptions](#FormattingOptions) literals.\r\n */\r\nexport var FormattingOptions;\r\n(function (FormattingOptions) {\r\n /**\r\n * Creates a new FormattingOptions literal.\r\n */\r\n function create(tabSize, insertSpaces) {\r\n return { tabSize: tabSize, insertSpaces: insertSpaces };\r\n }\r\n FormattingOptions.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\r\n }\r\n FormattingOptions.is = is;\r\n})(FormattingOptions || (FormattingOptions = {}));\r\n/**\r\n * The DocumentLink namespace provides helper functions to work with\r\n * [DocumentLink](#DocumentLink) literals.\r\n */\r\nexport var DocumentLink;\r\n(function (DocumentLink) {\r\n /**\r\n * Creates a new DocumentLink literal.\r\n */\r\n function create(range, target, data) {\r\n return { range: range, target: target, data: data };\r\n }\r\n DocumentLink.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\r\n }\r\n DocumentLink.is = is;\r\n})(DocumentLink || (DocumentLink = {}));\r\n/**\r\n * The SelectionRange namespace provides helper function to work with\r\n * SelectionRange literals.\r\n */\r\nexport var SelectionRange;\r\n(function (SelectionRange) {\r\n /**\r\n * Creates a new SelectionRange\r\n * @param range the range.\r\n * @param parent an optional parent.\r\n */\r\n function create(range, parent) {\r\n return { range: range, parent: parent };\r\n }\r\n SelectionRange.create = create;\r\n function is(value) {\r\n var candidate = value;\r\n return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\r\n }\r\n SelectionRange.is = is;\r\n})(SelectionRange || (SelectionRange = {}));\r\nexport var EOL = ['\\n', '\\r\\n', '\\r'];\r\n/**\r\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\r\n */\r\nexport var TextDocument;\r\n(function (TextDocument) {\r\n /**\r\n * Creates a new ITextDocument literal from the given uri and content.\r\n * @param uri The document's uri.\r\n * @param languageId The document's language Id.\r\n * @param content The document's content.\r\n */\r\n function create(uri, languageId, version, content) {\r\n return new FullTextDocument(uri, languageId, version, content);\r\n }\r\n TextDocument.create = create;\r\n /**\r\n * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.\r\n */\r\n function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }\r\n TextDocument.is = is;\r\n function applyEdits(document, edits) {\r\n var text = document.getText();\r\n var sortedEdits = mergeSort(edits, function (a, b) {\r\n var diff = a.range.start.line - b.range.start.line;\r\n if (diff === 0) {\r\n return a.range.start.character - b.range.start.character;\r\n }\r\n return diff;\r\n });\r\n var lastModifiedOffset = text.length;\r\n for (var i = sortedEdits.length - 1; i >= 0; i--) {\r\n var e = sortedEdits[i];\r\n var startOffset = document.offsetAt(e.range.start);\r\n var endOffset = document.offsetAt(e.range.end);\r\n if (endOffset <= lastModifiedOffset) {\r\n text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\r\n }\r\n else {\r\n throw new Error('Overlapping edit');\r\n }\r\n lastModifiedOffset = startOffset;\r\n }\r\n return text;\r\n }\r\n TextDocument.applyEdits = applyEdits;\r\n function mergeSort(data, compare) {\r\n if (data.length <= 1) {\r\n // sorted\r\n return data;\r\n }\r\n var p = (data.length / 2) | 0;\r\n var left = data.slice(0, p);\r\n var right = data.slice(p);\r\n mergeSort(left, compare);\r\n mergeSort(right, compare);\r\n var leftIdx = 0;\r\n var rightIdx = 0;\r\n var i = 0;\r\n while (leftIdx < left.length && rightIdx < right.length) {\r\n var ret = compare(left[leftIdx], right[rightIdx]);\r\n if (ret <= 0) {\r\n // smaller_equal -> take left to preserve order\r\n data[i++] = left[leftIdx++];\r\n }\r\n else {\r\n // greater -> take right\r\n data[i++] = right[rightIdx++];\r\n }\r\n }\r\n while (leftIdx < left.length) {\r\n data[i++] = left[leftIdx++];\r\n }\r\n while (rightIdx < right.length) {\r\n data[i++] = right[rightIdx++];\r\n }\r\n return data;\r\n }\r\n})(TextDocument || (TextDocument = {}));\r\nvar FullTextDocument = /** @class */ (function () {\r\n function FullTextDocument(uri, languageId, version, content) {\r\n this._uri = uri;\r\n this._languageId = languageId;\r\n this._version = version;\r\n this._content = content;\r\n this._lineOffsets = undefined;\r\n }\r\n Object.defineProperty(FullTextDocument.prototype, \"uri\", {\r\n get: function () {\r\n return this._uri;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FullTextDocument.prototype, \"languageId\", {\r\n get: function () {\r\n return this._languageId;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FullTextDocument.prototype, \"version\", {\r\n get: function () {\r\n return this._version;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n FullTextDocument.prototype.getText = function (range) {\r\n if (range) {\r\n var start = this.offsetAt(range.start);\r\n var end = this.offsetAt(range.end);\r\n return this._content.substring(start, end);\r\n }\r\n return this._content;\r\n };\r\n FullTextDocument.prototype.update = function (event, version) {\r\n this._content = event.text;\r\n this._version = version;\r\n this._lineOffsets = undefined;\r\n };\r\n FullTextDocument.prototype.getLineOffsets = function () {\r\n if (this._lineOffsets === undefined) {\r\n var lineOffsets = [];\r\n var text = this._content;\r\n var isLineStart = true;\r\n for (var i = 0; i < text.length; i++) {\r\n if (isLineStart) {\r\n lineOffsets.push(i);\r\n isLineStart = false;\r\n }\r\n var ch = text.charAt(i);\r\n isLineStart = (ch === '\\r' || ch === '\\n');\r\n if (ch === '\\r' && i + 1 < text.length && text.charAt(i + 1) === '\\n') {\r\n i++;\r\n }\r\n }\r\n if (isLineStart && text.length > 0) {\r\n lineOffsets.push(text.length);\r\n }\r\n this._lineOffsets = lineOffsets;\r\n }\r\n return this._lineOffsets;\r\n };\r\n FullTextDocument.prototype.positionAt = function (offset) {\r\n offset = Math.max(Math.min(offset, this._content.length), 0);\r\n var lineOffsets = this.getLineOffsets();\r\n var low = 0, high = lineOffsets.length;\r\n if (high === 0) {\r\n return Position.create(0, offset);\r\n }\r\n while (low < high) {\r\n var mid = Math.floor((low + high) / 2);\r\n if (lineOffsets[mid] > offset) {\r\n high = mid;\r\n }\r\n else {\r\n low = mid + 1;\r\n }\r\n }\r\n // low is the least x for which the line offset is larger than the current offset\r\n // or array.length if no line offset is larger than the current offset\r\n var line = low - 1;\r\n return Position.create(line, offset - lineOffsets[line]);\r\n };\r\n FullTextDocument.prototype.offsetAt = function (position) {\r\n var lineOffsets = this.getLineOffsets();\r\n if (position.line >= lineOffsets.length) {\r\n return this._content.length;\r\n }\r\n else if (position.line < 0) {\r\n return 0;\r\n }\r\n var lineOffset = lineOffsets[position.line];\r\n var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\r\n return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\r\n };\r\n Object.defineProperty(FullTextDocument.prototype, \"lineCount\", {\r\n get: function () {\r\n return this.getLineOffsets().length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return FullTextDocument;\r\n}());\r\nvar Is;\r\n(function (Is) {\r\n var toString = Object.prototype.toString;\r\n function defined(value) {\r\n return typeof value !== 'undefined';\r\n }\r\n Is.defined = defined;\r\n function undefined(value) {\r\n return typeof value === 'undefined';\r\n }\r\n Is.undefined = undefined;\r\n function boolean(value) {\r\n return value === true || value === false;\r\n }\r\n Is.boolean = boolean;\r\n function string(value) {\r\n return toString.call(value) === '[object String]';\r\n }\r\n Is.string = string;\r\n function number(value) {\r\n return toString.call(value) === '[object Number]';\r\n }\r\n Is.number = number;\r\n function func(value) {\r\n return toString.call(value) === '[object Function]';\r\n }\r\n Is.func = func;\r\n function objectLiteral(value) {\r\n // Strictly speaking class instances pass this check as well. Since the LSP\r\n // doesn't use classes we ignore this for now. If we do we need to add something\r\n // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\r\n return value !== null && typeof value === 'object';\r\n }\r\n Is.objectLiteral = objectLiteral;\r\n function typedArray(value, check) {\r\n return Array.isArray(value) && value.every(check);\r\n }\r\n Is.typedArray = typedArray;\r\n})(Is || (Is = {}));\r\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n'use strict';\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar _a;\nvar isWindows;\nif (typeof process === 'object') {\n isWindows = process.platform === 'win32';\n}\nelse if (typeof navigator === 'object') {\n var userAgent = navigator.userAgent;\n isWindows = userAgent.indexOf('Windows') >= 0;\n}\nfunction isHighSurrogate(charCode) {\n return (0xD800 <= charCode && charCode <= 0xDBFF);\n}\nfunction isLowSurrogate(charCode) {\n return (0xDC00 <= charCode && charCode <= 0xDFFF);\n}\nfunction isLowerAsciiHex(code) {\n return code >= 97 /* a */ && code <= 102 /* f */;\n}\nfunction isLowerAsciiLetter(code) {\n return code >= 97 /* a */ && code <= 122 /* z */;\n}\nfunction isUpperAsciiLetter(code) {\n return code >= 65 /* A */ && code <= 90 /* Z */;\n}\nfunction isAsciiLetter(code) {\n return isLowerAsciiLetter(code) || isUpperAsciiLetter(code);\n}\n//#endregion\nvar _schemePattern = /^\\w[\\w\\d+.-]*$/;\nvar _singleSlashStart = /^\\//;\nvar _doubleSlashStart = /^\\/\\//;\nfunction _validateUri(ret, _strict) {\n // scheme, must be set\n if (!ret.scheme && _strict) {\n throw new Error(\"[UriError]: Scheme is missing: {scheme: \\\"\\\", authority: \\\"\" + ret.authority + \"\\\", path: \\\"\" + ret.path + \"\\\", query: \\\"\" + ret.query + \"\\\", fragment: \\\"\" + ret.fragment + \"\\\"}\");\n }\n // scheme, https://tools.ietf.org/html/rfc3986#section-3.1\n // ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n if (ret.scheme && !_schemePattern.test(ret.scheme)) {\n throw new Error('[UriError]: Scheme contains illegal characters.');\n }\n // path, http://tools.ietf.org/html/rfc3986#section-3.3\n // If a URI contains an authority component, then the path component\n // must either be empty or begin with a slash (\"/\") character. If a URI\n // does not contain an authority component, then the path cannot begin\n // with two slash characters (\"//\").\n if (ret.path) {\n if (ret.authority) {\n if (!_singleSlashStart.test(ret.path)) {\n throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character');\n }\n }\n else {\n if (_doubleSlashStart.test(ret.path)) {\n throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")');\n }\n }\n }\n}\n// for a while we allowed uris *without* schemes and this is the migration\n// for them, e.g. an uri without scheme and without strict-mode warns and falls\n// back to the file-scheme. that should cause the least carnage and still be a\n// clear warning\nfunction _schemeFix(scheme, _strict) {\n if (!scheme && !_strict) {\n return 'file';\n }\n return scheme;\n}\n// implements a bit of https://tools.ietf.org/html/rfc3986#section-5\nfunction _referenceResolution(scheme, path) {\n // the slash-character is our 'default base' as we don't\n // support constructing URIs relative to other URIs. This\n // also means that we alter and potentially break paths.\n // see https://tools.ietf.org/html/rfc3986#section-5.1.4\n switch (scheme) {\n case 'https':\n case 'http':\n case 'file':\n if (!path) {\n path = _slash;\n }\n else if (path[0] !== _slash) {\n path = _slash + path;\n }\n break;\n }\n return path;\n}\nvar _empty = '';\nvar _slash = '/';\nvar _regexp = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\n/**\n * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.\n * This class is a simple parser which creates the basic component parts\n * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation\n * and encoding.\n *\n * ```txt\n * foo://example.com:8042/over/there?name=ferret#nose\n * \\_/ \\______________/\\_________/ \\_________/ \\__/\n * | | | | |\n * scheme authority path query fragment\n * | _____________________|__\n * / \\ / \\\n * urn:example:animal:ferret:nose\n * ```\n */\nvar URI = /** @class */ (function () {\n /**\n * @internal\n */\n function URI(schemeOrData, authority, path, query, fragment, _strict) {\n if (_strict === void 0) { _strict = false; }\n if (typeof schemeOrData === 'object') {\n this.scheme = schemeOrData.scheme || _empty;\n this.authority = schemeOrData.authority || _empty;\n this.path = schemeOrData.path || _empty;\n this.query = schemeOrData.query || _empty;\n this.fragment = schemeOrData.fragment || _empty;\n // no validation because it's this URI\n // that creates uri components.\n // _validateUri(this);\n }\n else {\n this.scheme = _schemeFix(schemeOrData, _strict);\n this.authority = authority || _empty;\n this.path = _referenceResolution(this.scheme, path || _empty);\n this.query = query || _empty;\n this.fragment = fragment || _empty;\n _validateUri(this, _strict);\n }\n }\n URI.isUri = function (thing) {\n if (thing instanceof URI) {\n return true;\n }\n if (!thing) {\n return false;\n }\n return typeof thing.authority === 'string'\n && typeof thing.fragment === 'string'\n && typeof thing.path === 'string'\n && typeof thing.query === 'string'\n && typeof thing.scheme === 'string'\n && typeof thing.fsPath === 'function'\n && typeof thing.with === 'function'\n && typeof thing.toString === 'function';\n };\n Object.defineProperty(URI.prototype, \"fsPath\", {\n // ---- filesystem path -----------------------\n /**\n * Returns a string representing the corresponding file system path of this URI.\n * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the\n * platform specific path separator.\n *\n * * Will *not* validate the path for invalid characters and semantics.\n * * Will *not* look at the scheme of this URI.\n * * The result shall *not* be used for display purposes but for accessing a file on disk.\n *\n *\n * The *difference* to `URI#path` is the use of the platform specific separator and the handling\n * of UNC paths. See the below sample of a file-uri with an authority (UNC path).\n *\n * ```ts\n const u = URI.parse('file://server/c$/folder/file.txt')\n u.authority === 'server'\n u.path === '/shares/c$/file.txt'\n u.fsPath === '\\\\server\\c$\\folder\\file.txt'\n ```\n *\n * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,\n * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working\n * with URIs that represent files on disk (`file` scheme).\n */\n get: function () {\n // if (this.scheme !== 'file') {\n // \tconsole.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);\n // }\n return uriToFsPath(this, false);\n },\n enumerable: true,\n configurable: true\n });\n // ---- modify to new -------------------------\n URI.prototype.with = function (change) {\n if (!change) {\n return this;\n }\n var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment;\n if (scheme === undefined) {\n scheme = this.scheme;\n }\n else if (scheme === null) {\n scheme = _empty;\n }\n if (authority === undefined) {\n authority = this.authority;\n }\n else if (authority === null) {\n authority = _empty;\n }\n if (path === undefined) {\n path = this.path;\n }\n else if (path === null) {\n path = _empty;\n }\n if (query === undefined) {\n query = this.query;\n }\n else if (query === null) {\n query = _empty;\n }\n if (fragment === undefined) {\n fragment = this.fragment;\n }\n else if (fragment === null) {\n fragment = _empty;\n }\n if (scheme === this.scheme\n && authority === this.authority\n && path === this.path\n && query === this.query\n && fragment === this.fragment) {\n return this;\n }\n return new _URI(scheme, authority, path, query, fragment);\n };\n // ---- parse & validate ------------------------\n /**\n * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`,\n * `file:///usr/home`, or `scheme:with/path`.\n *\n * @param value A string which represents an URI (see `URI#toString`).\n */\n URI.parse = function (value, _strict) {\n if (_strict === void 0) { _strict = false; }\n var match = _regexp.exec(value);\n if (!match) {\n return new _URI(_empty, _empty, _empty, _empty, _empty);\n }\n return new _URI(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);\n };\n /**\n * Creates a new URI from a file system path, e.g. `c:\\my\\files`,\n * `/usr/home`, or `\\\\server\\share\\some\\path`.\n *\n * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument\n * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**\n * `URI.parse('file://' + path)` because the path might contain characters that are\n * interpreted (# and ?). See the following sample:\n * ```ts\n const good = URI.file('/coding/c#/project1');\n good.scheme === 'file';\n good.path === '/coding/c#/project1';\n good.fragment === '';\n const bad = URI.parse('file://' + '/coding/c#/project1');\n bad.scheme === 'file';\n bad.path === '/coding/c'; // path is now broken\n bad.fragment === '/project1';\n ```\n *\n * @param path A file system path (see `URI#fsPath`)\n */\n URI.file = function (path) {\n var authority = _empty;\n // normalize to fwd-slashes on windows,\n // on other systems bwd-slashes are valid\n // filename character, eg /f\\oo/ba\\r.txt\n if (isWindows) {\n path = path.replace(/\\\\/g, _slash);\n }\n // check for authority as used in UNC shares\n // or use the path as given\n if (path[0] === _slash && path[1] === _slash) {\n var idx = path.indexOf(_slash, 2);\n if (idx === -1) {\n authority = path.substring(2);\n path = _slash;\n }\n else {\n authority = path.substring(2, idx);\n path = path.substring(idx) || _slash;\n }\n }\n return new _URI('file', authority, path, _empty, _empty);\n };\n URI.from = function (components) {\n return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment);\n };\n // /**\n // * Join a URI path with path fragments and normalizes the resulting path.\n // *\n // * @param uri The input URI.\n // * @param pathFragment The path fragment to add to the URI path.\n // * @returns The resulting URI.\n // */\n // static joinPath(uri: URI, ...pathFragment: string[]): URI {\n // \tif (!uri.path) {\n // \t\tthrow new Error(`[UriError]: cannot call joinPaths on URI without path`);\n // \t}\n // \tlet newPath: string;\n // \tif (isWindows && uri.scheme === 'file') {\n // \t\tnewPath = URI.file(paths.win32.join(uriToFsPath(uri, true), ...pathFragment)).path;\n // \t} else {\n // \t\tnewPath = paths.posix.join(uri.path, ...pathFragment);\n // \t}\n // \treturn uri.with({ path: newPath });\n // }\n // ---- printing/externalize ---------------------------\n /**\n * Creates a string representation for this URI. It's guaranteed that calling\n * `URI.parse` with the result of this function creates an URI which is equal\n * to this URI.\n *\n * * The result shall *not* be used for display purposes but for externalization or transport.\n * * The result will be encoded using the percentage encoding and encoding happens mostly\n * ignore the scheme-specific encoding rules.\n *\n * @param skipEncoding Do not encode the result, default is `false`\n */\n URI.prototype.toString = function (skipEncoding) {\n if (skipEncoding === void 0) { skipEncoding = false; }\n return _asFormatted(this, skipEncoding);\n };\n URI.prototype.toJSON = function () {\n return this;\n };\n URI.revive = function (data) {\n if (!data) {\n return data;\n }\n else if (data instanceof URI) {\n return data;\n }\n else {\n var result = new _URI(data);\n result._formatted = data.external;\n result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null;\n return result;\n }\n };\n return URI;\n}());\nexport { URI };\nvar _pathSepMarker = isWindows ? 1 : undefined;\n// eslint-disable-next-line @typescript-eslint/class-name-casing\nvar _URI = /** @class */ (function (_super) {\n __extends(_URI, _super);\n function _URI() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._formatted = null;\n _this._fsPath = null;\n return _this;\n }\n Object.defineProperty(_URI.prototype, \"fsPath\", {\n get: function () {\n if (!this._fsPath) {\n this._fsPath = uriToFsPath(this, false);\n }\n return this._fsPath;\n },\n enumerable: true,\n configurable: true\n });\n _URI.prototype.toString = function (skipEncoding) {\n if (skipEncoding === void 0) { skipEncoding = false; }\n if (!skipEncoding) {\n if (!this._formatted) {\n this._formatted = _asFormatted(this, false);\n }\n return this._formatted;\n }\n else {\n // we don't cache that\n return _asFormatted(this, true);\n }\n };\n _URI.prototype.toJSON = function () {\n var res = {\n $mid: 1\n };\n // cached state\n if (this._fsPath) {\n res.fsPath = this._fsPath;\n res._sep = _pathSepMarker;\n }\n if (this._formatted) {\n res.external = this._formatted;\n }\n // uri components\n if (this.path) {\n res.path = this.path;\n }\n if (this.scheme) {\n res.scheme = this.scheme;\n }\n if (this.authority) {\n res.authority = this.authority;\n }\n if (this.query) {\n res.query = this.query;\n }\n if (this.fragment) {\n res.fragment = this.fragment;\n }\n return res;\n };\n return _URI;\n}(URI));\n// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2\nvar encodeTable = (_a = {},\n _a[58 /* Colon */] = '%3A',\n _a[47 /* Slash */] = '%2F',\n _a[63 /* QuestionMark */] = '%3F',\n _a[35 /* Hash */] = '%23',\n _a[91 /* OpenSquareBracket */] = '%5B',\n _a[93 /* CloseSquareBracket */] = '%5D',\n _a[64 /* AtSign */] = '%40',\n _a[33 /* ExclamationMark */] = '%21',\n _a[36 /* DollarSign */] = '%24',\n _a[38 /* Ampersand */] = '%26',\n _a[39 /* SingleQuote */] = '%27',\n _a[40 /* OpenParen */] = '%28',\n _a[41 /* CloseParen */] = '%29',\n _a[42 /* Asterisk */] = '%2A',\n _a[43 /* Plus */] = '%2B',\n _a[44 /* Comma */] = '%2C',\n _a[59 /* Semicolon */] = '%3B',\n _a[61 /* Equals */] = '%3D',\n _a[32 /* Space */] = '%20',\n _a);\nfunction encodeURIComponentFast(uriComponent, allowSlash) {\n var res = undefined;\n var nativeEncodePos = -1;\n for (var pos = 0; pos < uriComponent.length; pos++) {\n var code = uriComponent.charCodeAt(pos);\n // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3\n if ((code >= 97 /* a */ && code <= 122 /* z */)\n || (code >= 65 /* A */ && code <= 90 /* Z */)\n || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */)\n || code === 45 /* Dash */\n || code === 46 /* Period */\n || code === 95 /* Underline */\n || code === 126 /* Tilde */\n || (allowSlash && code === 47 /* Slash */)) {\n // check if we are delaying native encode\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n nativeEncodePos = -1;\n }\n // check if we write into a new string (by default we try to return the param)\n if (res !== undefined) {\n res += uriComponent.charAt(pos);\n }\n }\n else {\n // encoding needed, we need to allocate a new string\n if (res === undefined) {\n res = uriComponent.substr(0, pos);\n }\n // check with default table first\n var escaped = encodeTable[code];\n if (escaped !== undefined) {\n // check if we are delaying native encode\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n nativeEncodePos = -1;\n }\n // append escaped variant to result\n res += escaped;\n }\n else if (nativeEncodePos === -1) {\n // use native encode only when needed\n nativeEncodePos = pos;\n }\n }\n }\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos));\n }\n return res !== undefined ? res : uriComponent;\n}\nfunction encodeURIComponentMinimal(path) {\n var res = undefined;\n for (var pos = 0; pos < path.length; pos++) {\n var code = path.charCodeAt(pos);\n if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) {\n if (res === undefined) {\n res = path.substr(0, pos);\n }\n res += encodeTable[code];\n }\n else {\n if (res !== undefined) {\n res += path[pos];\n }\n }\n }\n return res !== undefined ? res : path;\n}\n/**\n * Compute `fsPath` for the given uri\n */\nexport function uriToFsPath(uri, keepDriveLetterCasing) {\n var value;\n if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\n // unc path: file://shares/c$/far/boo\n value = \"//\" + uri.authority + uri.path;\n }\n else if (uri.path.charCodeAt(0) === 47 /* Slash */\n && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)\n && uri.path.charCodeAt(2) === 58 /* Colon */) {\n if (!keepDriveLetterCasing) {\n // windows drive letter: file:///c:/far/boo\n value = uri.path[1].toLowerCase() + uri.path.substr(2);\n }\n else {\n value = uri.path.substr(1);\n }\n }\n else {\n // other path\n value = uri.path;\n }\n if (isWindows) {\n value = value.replace(/\\//g, '\\\\');\n }\n return value;\n}\n/**\n * Create the external version of a uri\n */\nfunction _asFormatted(uri, skipEncoding) {\n var encoder = !skipEncoding\n ? encodeURIComponentFast\n : encodeURIComponentMinimal;\n var res = '';\n var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;\n if (scheme) {\n res += scheme;\n res += ':';\n }\n if (authority || scheme === 'file') {\n res += _slash;\n res += _slash;\n }\n if (authority) {\n var idx = authority.indexOf('@');\n if (idx !== -1) {\n // @\n var userinfo = authority.substr(0, idx);\n authority = authority.substr(idx + 1);\n idx = userinfo.indexOf(':');\n if (idx === -1) {\n res += encoder(userinfo, false);\n }\n else {\n // :@\n res += encoder(userinfo.substr(0, idx), false);\n res += ':';\n res += encoder(userinfo.substr(idx + 1), false);\n }\n res += '@';\n }\n authority = authority.toLowerCase();\n idx = authority.indexOf(':');\n if (idx === -1) {\n res += encoder(authority, false);\n }\n else {\n // :\n res += encoder(authority.substr(0, idx), false);\n res += authority.substr(idx);\n }\n }\n if (path) {\n // lower-case windows drive letters in /C:/fff or C:/fff\n if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) {\n var code = path.charCodeAt(1);\n if (code >= 65 /* A */ && code <= 90 /* Z */) {\n path = \"/\" + String.fromCharCode(code + 32) + \":\" + path.substr(3); // \"/c:\".length === 3\n }\n }\n else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) {\n var code = path.charCodeAt(0);\n if (code >= 65 /* A */ && code <= 90 /* Z */) {\n path = String.fromCharCode(code + 32) + \":\" + path.substr(2); // \"/c:\".length === 3\n }\n }\n // encode the rest of the path\n res += encoder(path, true);\n }\n if (query) {\n res += '?';\n res += encoder(query, false);\n }\n if (fragment) {\n res += '#';\n res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;\n }\n return res;\n}\n// --- decode\nfunction decodeURIComponentGraceful(str) {\n try {\n return decodeURIComponent(str);\n }\n catch (_a) {\n if (str.length > 3) {\n return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));\n }\n else {\n return str;\n }\n }\n}\nvar _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;\nfunction percentDecode(str) {\n if (!str.match(_rEncodedAsHex)) {\n return str;\n }\n return str.replace(_rEncodedAsHex, function (match) { return decodeURIComponentGraceful(match); });\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction format(message, args) {\n var result;\n if (args.length === 0) {\n result = message;\n }\n else {\n result = message.replace(/\\{(\\d+)\\}/g, function (match, rest) {\n var index = rest[0];\n return typeof args[index] !== 'undefined' ? args[index] : match;\n });\n }\n return result;\n}\nfunction localize(key, message) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n return format(message, args);\n}\nexport function loadMessageBundle(file) {\n return localize;\n}\nexport function config(opt) {\n return loadMessageBundle;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as worker from '../../editor/editor.worker.js';\nimport { JSONWorker } from './jsonWorker.js';\nself.onmessage = function () {\n // ignore the first message\n worker.initialize(function (ctx, createData) {\n return new JSONWorker(ctx, createData);\n });\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport * as jsonService from './_deps/vscode-json-languageservice/jsonLanguageService.js';\nimport { URI } from './_deps/vscode-uri/index.js';\nvar defaultSchemaRequestService;\nif (typeof fetch !== 'undefined') {\n defaultSchemaRequestService = function (url) {\n return fetch(url).then(function (response) { return response.text(); });\n };\n}\nvar JSONWorker = /** @class */ (function () {\n function JSONWorker(ctx, createData) {\n this._ctx = ctx;\n this._languageSettings = createData.languageSettings;\n this._languageId = createData.languageId;\n this._languageService = jsonService.getLanguageService({\n workspaceContext: {\n resolveRelativePath: function (relativePath, resource) {\n var base = resource.substr(0, resource.lastIndexOf('/') + 1);\n return resolvePath(base, relativePath);\n }\n },\n schemaRequestService: createData.enableSchemaRequest && defaultSchemaRequestService\n });\n this._languageService.configure(this._languageSettings);\n }\n JSONWorker.prototype.doValidation = function (uri) {\n return __awaiter(this, void 0, void 0, function () {\n var document, jsonDocument;\n return __generator(this, function (_a) {\n document = this._getTextDocument(uri);\n if (document) {\n jsonDocument = this._languageService.parseJSONDocument(document);\n return [2 /*return*/, this._languageService.doValidation(document, jsonDocument)];\n }\n return [2 /*return*/, Promise.resolve([])];\n });\n });\n };\n JSONWorker.prototype.doComplete = function (uri, position) {\n return __awaiter(this, void 0, void 0, function () {\n var document, jsonDocument;\n return __generator(this, function (_a) {\n document = this._getTextDocument(uri);\n jsonDocument = this._languageService.parseJSONDocument(document);\n return [2 /*return*/, this._languageService.doComplete(document, position, jsonDocument)];\n });\n });\n };\n JSONWorker.prototype.doResolve = function (item) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this._languageService.doResolve(item)];\n });\n });\n };\n JSONWorker.prototype.doHover = function (uri, position) {\n return __awaiter(this, void 0, void 0, function () {\n var document, jsonDocument;\n return __generator(this, function (_a) {\n document = this._getTextDocument(uri);\n jsonDocument = this._languageService.parseJSONDocument(document);\n return [2 /*return*/, this._languageService.doHover(document, position, jsonDocument)];\n });\n });\n };\n JSONWorker.prototype.format = function (uri, range, options) {\n return __awaiter(this, void 0, void 0, function () {\n var document, textEdits;\n return __generator(this, function (_a) {\n document = this._getTextDocument(uri);\n textEdits = this._languageService.format(document, range, options);\n return [2 /*return*/, Promise.resolve(textEdits)];\n });\n });\n };\n JSONWorker.prototype.resetSchema = function (uri) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, Promise.resolve(this._languageService.resetSchema(uri))];\n });\n });\n };\n JSONWorker.prototype.findDocumentSymbols = function (uri) {\n return __awaiter(this, void 0, void 0, function () {\n var document, jsonDocument, symbols;\n return __generator(this, function (_a) {\n document = this._getTextDocument(uri);\n jsonDocument = this._languageService.parseJSONDocument(document);\n symbols = this._languageService.findDocumentSymbols(document, jsonDocument);\n return [2 /*return*/, Promise.resolve(symbols)];\n });\n });\n };\n JSONWorker.prototype.findDocumentColors = function (uri) {\n return __awaiter(this, void 0, void 0, function () {\n var document, jsonDocument, colorSymbols;\n return __generator(this, function (_a) {\n document = this._getTextDocument(uri);\n jsonDocument = this._languageService.parseJSONDocument(document);\n colorSymbols = this._languageService.findDocumentColors(document, jsonDocument);\n return [2 /*return*/, Promise.resolve(colorSymbols)];\n });\n });\n };\n JSONWorker.prototype.getColorPresentations = function (uri, color, range) {\n return __awaiter(this, void 0, void 0, function () {\n var document, jsonDocument, colorPresentations;\n return __generator(this, function (_a) {\n document = this._getTextDocument(uri);\n jsonDocument = this._languageService.parseJSONDocument(document);\n colorPresentations = this._languageService.getColorPresentations(document, jsonDocument, color, range);\n return [2 /*return*/, Promise.resolve(colorPresentations)];\n });\n });\n };\n JSONWorker.prototype.getFoldingRanges = function (uri, context) {\n return __awaiter(this, void 0, void 0, function () {\n var document, ranges;\n return __generator(this, function (_a) {\n document = this._getTextDocument(uri);\n ranges = this._languageService.getFoldingRanges(document, context);\n return [2 /*return*/, Promise.resolve(ranges)];\n });\n });\n };\n JSONWorker.prototype.getSelectionRanges = function (uri, positions) {\n return __awaiter(this, void 0, void 0, function () {\n var document, jsonDocument, ranges;\n return __generator(this, function (_a) {\n document = this._getTextDocument(uri);\n jsonDocument = this._languageService.parseJSONDocument(document);\n ranges = this._languageService.getSelectionRanges(document, positions, jsonDocument);\n return [2 /*return*/, Promise.resolve(ranges)];\n });\n });\n };\n JSONWorker.prototype._getTextDocument = function (uri) {\n var models = this._ctx.getMirrorModels();\n for (var _i = 0, models_1 = models; _i < models_1.length; _i++) {\n var model = models_1[_i];\n if (model.uri.toString() === uri) {\n return jsonService.TextDocument.create(uri, this._languageId, model.version, model.getValue());\n }\n }\n return null;\n };\n return JSONWorker;\n}());\nexport { JSONWorker };\n// URI path utilities, will (hopefully) move to vscode-uri\nvar Slash = '/'.charCodeAt(0);\nvar Dot = '.'.charCodeAt(0);\nfunction isAbsolutePath(path) {\n return path.charCodeAt(0) === Slash;\n}\nfunction resolvePath(uriString, path) {\n if (isAbsolutePath(path)) {\n var uri = URI.parse(uriString);\n var parts = path.split('/');\n return uri.with({ path: normalizePath(parts) }).toString();\n }\n return joinPath(uriString, path);\n}\nfunction normalizePath(parts) {\n var newParts = [];\n for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {\n var part = parts_1[_i];\n if (part.length === 0 || (part.length === 1 && part.charCodeAt(0) === Dot)) {\n // ignore\n }\n else if (part.length === 2 && part.charCodeAt(0) === Dot && part.charCodeAt(1) === Dot) {\n newParts.pop();\n }\n else {\n newParts.push(part);\n }\n }\n if (parts.length > 1 && parts[parts.length - 1].length === 0) {\n newParts.push('');\n }\n var res = newParts.join('/');\n if (parts[0].length === 0) {\n res = '/' + res;\n }\n return res;\n}\nfunction joinPath(uriString) {\n var paths = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n paths[_i - 1] = arguments[_i];\n }\n var uri = URI.parse(uriString);\n var parts = uri.path.split('/');\n for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) {\n var path = paths_1[_a];\n parts.push.apply(parts, path.split('/'));\n }\n return uri.with({ path: normalizePath(parts) }).toString();\n}\nexport function create(ctx, createData) {\n return new JSONWorker(ctx, createData);\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n"],"sourceRoot":""}