workerMain.js.map 671 KB

1
  1. {"version":3,"sources":["fake","vs/loader.js","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/arrays.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/diff/diffChange.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/errors.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/functional.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/hash.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/diff/diff.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/iterator.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/keyCodes.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/lifecycle.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/linkedList.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/event.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/cancellation.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/platform.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/strings.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/types.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/uint.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/uri.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/common/worker/simpleWorker.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/core/characterClassifier.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/core/position.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/core/range.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/core/selection.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/core/token.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/diff/diffComputer.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/model/wordHelper.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/modes/linkComputer.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/modes/supports/inplaceReplaceSupport.ts","vs/editor/common/standalone/promise-polyfill/polyfill.js","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/standalone/standaloneEnums.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/standalone/standaloneBase.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/viewModel/prefixSumComputer.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/model/mirrorTextModel.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/editor/common/services/editorSimpleWorker.ts","file:///C:/Alex/src/vscode-stable/out-editor-src/vs/base/worker/workerMain.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;IC5wDA;;;;OAIG;IACH,SAAgB,IAAI,CAAI,KAAmB,EAAE,CAAa;QAAb,kBAAA,EAAA,KAAa;QACzD,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IAFD,oBAEC;IAED,SAAgB,KAAK,CAAI,GAAQ;QAChC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;SACrC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;I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ACZ,GAAG,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;iBAC1B;qBAAM;oBACN,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC;iBACvB;gBACD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;aACrB;YACD,OAAO,IAAI,CAAC;QACb,CAAC;QAvFsB,4BAAQ,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAwF7D,0BAAC;KA1FD,AA0FC,IAAA;IA1FY,kDAAmB;;;ACRhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnSA;;;gGAGgG;;;;IAEhG,kDAAkD;IAGlD,IAAY,oBAOX;IAPD,WAAY,oBAAoB;QAC/B;;WAEG;QACH,qEAAW,CAAA;QACX,uEAAY,CAAA;QACZ,qEAAW,CAAA;IACZ,CAAC,EAPW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAO/B;IAED,IAAY,4BAUX;IAVD,WAAY,4BAA4B;QACvC;;;WAGG;QACH,mGAAkB,CAAA;QAClB;;WAEG;QACH,qGAAmB,CAAA;IACpB,CAAC,EAVW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAUvC;IAED,IAAY,kBA2BX;IA3BD,WAAY,kBAAkB;QAC7B,+DAAU,CAAA;QACV,mEAAY,CAAA;QACZ,yEAAe,CAAA;QACf,6DAAS,CAAA;QACT,mEAAY,CAAA;QACZ,6DAAS,CAAA;QACT,+DAAU,CAAA;QACV,qEAAa,CAAA;QACb,+DAAU,CAAA;QACV,mEAAY,CAAA;QACZ,8DAAU,CAAA;QACV,oEAAa,CAAA;QACb,4DAAS,CAAA;QACT,8DAAU,CAAA;QACV,oEAAa,CAAA;QACb,4DAAS,CAAA;QACT,wEAAe,CAAA;QACf,kEAAY,CAA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AC;QACd,OAAO,EAAE,aAAa;QACtB,UAAU,EAAE,IAAI;KAChB,CAAC,CAAC;IAEH,IAAI,QAAQ,GAAG,UAAU,QAAgB;QACxC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE;YAC/B,UAAU,CAAC;gBACV,IAAI,cAAc,GAAG,EAAE,CAAC,MAAM,CAAC,UAAC,GAAQ,EAAE,QAAyB;oBAC5D,IAAK,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;gBACxC,CAAC,EAAE,IAAI,CAAC,CAAC;gBAET,IAAI,CAAC,SAAS,GAAG,UAAC,CAAe,IAAK,OAAA,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAhC,CAAgC,CAAC;gBACvE,OAAO,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;oBACtC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAG,CAAC,CAAC;iBAC7C;YACF,CAAC,EAAE,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,cAAc,GAAG,IAAI,CAAC;IAC1B,IAAI,mBAAmB,GAAmB,EAAE,CAAC;IAC7C,IAAI,CAAC,SAAS,GAAG,UAAC,OAAqB;QACtC,IAAI,CAAC,cAAc,EAAE;YACpB,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClC,OAAO;SACP;QAED,cAAc,GAAG,KAAK,CAAC;QACvB,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,CAAC;AACH,CAAC,CAAC,EAAE,CAAC;;AnC7CL","file":"workerMain.js","sourcesContent":["}).call(this);","/*---------------------------------------------------------------------------------------------\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 * 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 *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n * Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *--------------------------------------------------------------------------------------------*/\nvar _amdLoaderGlobal = this;\nvar _commonjsGlobal = typeof global === 'object' ? global : {};\nvar AMDLoader;\n(function (AMDLoader) {\n AMDLoader.global = _amdLoaderGlobal;\n var Environment = /** @class */ (function () {\n function Environment() {\n this._detected = false;\n this._isWindows = false;\n this._isNode = false;\n this._isElectronRenderer = false;\n this._isWebWorker = false;\n }\n Object.defineProperty(Environment.prototype, \"isWindows\", {\n get: function () {\n this._detect();\n return this._isWindows;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Environment.prototype, \"isNode\", {\n get: function () {\n this._detect();\n return this._isNode;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Environment.prototype, \"isElectronRenderer\", {\n get: function () {\n this._detect();\n return this._isElectronRenderer;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Environment.prototype, \"isWebWorker\", {\n get: function () {\n this._detect();\n return this._isWebWorker;\n },\n enumerable: true,\n configurable: true\n });\n Environment.prototype._detect = function () {\n if (this._detected) {\n return;\n }\n this._detected = true;\n this._isWindows = Environment._isWindows();\n this._isNode = (typeof module !== 'undefined' && !!module.exports);\n this._isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer');\n this._isWebWorker = (typeof AMDLoader.global.importScripts === 'function');\n };\n Environment._isWindows = function () {\n if (typeof navigator !== 'undefined') {\n if (navigator.userAgent && navigator.userAgent.indexOf('Windows') >= 0) {\n return true;\n }\n }\n if (typeof process !== 'undefined') {\n return (process.platform === 'win32');\n }\n return false;\n };\n return Environment;\n }());\n AMDLoader.Environment = Environment;\n})(AMDLoader || (AMDLoader = {}));\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 AMDLoader;\n(function (AMDLoader) {\n var LoaderEvent = /** @class */ (function () {\n function LoaderEvent(type, detail, timestamp) {\n this.type = type;\n this.detail = detail;\n this.timestamp = timestamp;\n }\n return LoaderEvent;\n }());\n AMDLoader.LoaderEvent = LoaderEvent;\n var LoaderEventRecorder = /** @class */ (function () {\n function LoaderEventRecorder(loaderAvailableTimestamp) {\n this._events = [new LoaderEvent(1 /* LoaderAvailable */, '', loaderAvailableTimestamp)];\n }\n LoaderEventRecorder.prototype.record = function (type, detail) {\n this._events.push(new LoaderEvent(type, detail, AMDLoader.Utilities.getHighPerformanceTimestamp()));\n };\n LoaderEventRecorder.prototype.getEvents = function () {\n return this._events;\n };\n return LoaderEventRecorder;\n }());\n AMDLoader.LoaderEventRecorder = LoaderEventRecorder;\n var NullLoaderEventRecorder = /** @class */ (function () {\n function NullLoaderEventRecorder() {\n }\n NullLoaderEventRecorder.prototype.record = function (type, detail) {\n // Nothing to do\n };\n NullLoaderEventRecorder.prototype.getEvents = function () {\n return [];\n };\n NullLoaderEventRecorder.INSTANCE = new NullLoaderEventRecorder();\n return NullLoaderEventRecorder;\n }());\n AMDLoader.NullLoaderEventRecorder = NullLoaderEventRecorder;\n})(AMDLoader || (AMDLoader = {}));\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 AMDLoader;\n(function (AMDLoader) {\n var Utilities = /** @class */ (function () {\n function Utilities() {\n }\n /**\n * This method does not take care of / vs \\\n */\n Utilities.fileUriToFilePath = function (isWindows, uri) {\n uri = decodeURI(uri).replace(/%23/g, '#');\n if (isWindows) {\n if (/^file:\\/\\/\\//.test(uri)) {\n // This is a URI without a hostname => return only the path segment\n return uri.substr(8);\n }\n if (/^file:\\/\\//.test(uri)) {\n return uri.substr(5);\n }\n }\n else {\n if (/^file:\\/\\//.test(uri)) {\n return uri.substr(7);\n }\n }\n // Not sure...\n return uri;\n };\n Utilities.startsWith = function (haystack, needle) {\n return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle;\n };\n Utilities.endsWith = function (haystack, needle) {\n return haystack.length >= needle.length && haystack.substr(haystack.length - needle.length) === needle;\n };\n // only check for \"?\" before \"#\" to ensure that there is a real Query-String\n Utilities.containsQueryString = function (url) {\n return /^[^\\#]*\\?/gi.test(url);\n };\n /**\n * Does `url` start with http:// or https:// or file:// or / ?\n */\n Utilities.isAbsolutePath = function (url) {\n return /^((http:\\/\\/)|(https:\\/\\/)|(file:\\/\\/)|(\\/))/.test(url);\n };\n Utilities.forEachProperty = function (obj, callback) {\n if (obj) {\n var key = void 0;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n callback(key, obj[key]);\n }\n }\n }\n };\n Utilities.isEmpty = function (obj) {\n var isEmpty = true;\n Utilities.forEachProperty(obj, function () {\n isEmpty = false;\n });\n return isEmpty;\n };\n Utilities.recursiveClone = function (obj) {\n if (!obj || typeof obj !== 'object') {\n return obj;\n }\n var result = Array.isArray(obj) ? [] : {};\n Utilities.forEachProperty(obj, function (key, value) {\n if (value && typeof value === 'object') {\n result[key] = Utilities.recursiveClone(value);\n }\n else {\n result[key] = value;\n }\n });\n return result;\n };\n Utilities.generateAnonymousModule = function () {\n return '===anonymous' + (Utilities.NEXT_ANONYMOUS_ID++) + '===';\n };\n Utilities.isAnonymousModule = function (id) {\n return Utilities.startsWith(id, '===anonymous');\n };\n Utilities.getHighPerformanceTimestamp = function () {\n if (!this.PERFORMANCE_NOW_PROBED) {\n this.PERFORMANCE_NOW_PROBED = true;\n this.HAS_PERFORMANCE_NOW = (AMDLoader.global.performance && typeof AMDLoader.global.performance.now === 'function');\n }\n return (this.HAS_PERFORMANCE_NOW ? AMDLoader.global.performance.now() : Date.now());\n };\n Utilities.NEXT_ANONYMOUS_ID = 1;\n Utilities.PERFORMANCE_NOW_PROBED = false;\n Utilities.HAS_PERFORMANCE_NOW = false;\n return Utilities;\n }());\n AMDLoader.Utilities = Utilities;\n})(AMDLoader || (AMDLoader = {}));\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 AMDLoader;\n(function (AMDLoader) {\n function ensureError(err) {\n if (err instanceof Error) {\n return err;\n }\n var result = new Error(err.message || String(err) || 'Unknown Error');\n if (err.stack) {\n result.stack = err.stack;\n }\n return result;\n }\n AMDLoader.ensureError = ensureError;\n ;\n var ConfigurationOptionsUtil = /** @class */ (function () {\n function ConfigurationOptionsUtil() {\n }\n /**\n * Ensure configuration options make sense\n */\n ConfigurationOptionsUtil.validateConfigurationOptions = function (options) {\n function defaultOnError(err) {\n if (err.phase === 'loading') {\n console.error('Loading \"' + err.moduleId + '\" failed');\n console.error(err);\n console.error('Here are the modules that depend on it:');\n console.error(err.neededBy);\n return;\n }\n if (err.phase === 'factory') {\n console.error('The factory method of \"' + err.moduleId + '\" has thrown an exception');\n console.error(err);\n return;\n }\n }\n options = options || {};\n if (typeof options.baseUrl !== 'string') {\n options.baseUrl = '';\n }\n if (typeof options.isBuild !== 'boolean') {\n options.isBuild = false;\n }\n if (typeof options.paths !== 'object') {\n options.paths = {};\n }\n if (typeof options.config !== 'object') {\n options.config = {};\n }\n if (typeof options.catchError === 'undefined') {\n options.catchError = false;\n }\n if (typeof options.recordStats === 'undefined') {\n options.recordStats = false;\n }\n if (typeof options.urlArgs !== 'string') {\n options.urlArgs = '';\n }\n if (typeof options.onError !== 'function') {\n options.onError = defaultOnError;\n }\n if (!Array.isArray(options.ignoreDuplicateModules)) {\n options.ignoreDuplicateModules = [];\n }\n if (options.baseUrl.length > 0) {\n if (!AMDLoader.Utilities.endsWith(options.baseUrl, '/')) {\n options.baseUrl += '/';\n }\n }\n if (typeof options.cspNonce !== 'string') {\n options.cspNonce = '';\n }\n if (!Array.isArray(options.nodeModules)) {\n options.nodeModules = [];\n }\n if (options.nodeCachedData && typeof options.nodeCachedData === 'object') {\n if (typeof options.nodeCachedData.seed !== 'string') {\n options.nodeCachedData.seed = 'seed';\n }\n if (typeof options.nodeCachedData.writeDelay !== 'number' || options.nodeCachedData.writeDelay < 0) {\n options.nodeCachedData.writeDelay = 1000 * 7;\n }\n if (!options.nodeCachedData.path || typeof options.nodeCachedData.path !== 'string') {\n var err = ensureError(new Error('INVALID cached data configuration, \\'path\\' MUST be set'));\n err.phase = 'configuration';\n options.onError(err);\n options.nodeCachedData = undefined;\n }\n }\n return options;\n };\n ConfigurationOptionsUtil.mergeConfigurationOptions = function (overwrite, base) {\n if (overwrite === void 0) { overwrite = null; }\n if (base === void 0) { base = null; }\n var result = AMDLoader.Utilities.recursiveClone(base || {});\n // Merge known properties and overwrite the unknown ones\n AMDLoader.Utilities.forEachProperty(overwrite, function (key, value) {\n if (key === 'ignoreDuplicateModules' && typeof result.ignoreDuplicateModules !== 'undefined') {\n result.ignoreDuplicateModules = result.ignoreDuplicateModules.concat(value);\n }\n else if (key === 'paths' && typeof result.paths !== 'undefined') {\n AMDLoader.Utilities.forEachProperty(value, function (key2, value2) { return result.paths[key2] = value2; });\n }\n else if (key === 'config' && typeof result.config !== 'undefined') {\n AMDLoader.Utilities.forEachProperty(value, function (key2, value2) { return result.config[key2] = value2; });\n }\n else {\n result[key] = AMDLoader.Utilities.recursiveClone(value);\n }\n });\n return ConfigurationOptionsUtil.validateConfigurationOptions(result);\n };\n return ConfigurationOptionsUtil;\n }());\n AMDLoader.ConfigurationOptionsUtil = ConfigurationOptionsUtil;\n var Configuration = /** @class */ (function () {\n function Configuration(env, options) {\n this._env = env;\n this.options = ConfigurationOptionsUtil.mergeConfigurationOptions(options);\n this._createIgnoreDuplicateModulesMap();\n this._createNodeModulesMap();\n this._createSortedPathsRules();\n if (this.options.baseUrl === '') {\n if (this.options.nodeRequire && this.options.nodeRequire.main && this.options.nodeRequire.main.filename && this._env.isNode) {\n var nodeMain = this.options.nodeRequire.main.filename;\n var dirnameIndex = Math.max(nodeMain.lastIndexOf('/'), nodeMain.lastIndexOf('\\\\'));\n this.options.baseUrl = nodeMain.substring(0, dirnameIndex + 1);\n }\n if (this.options.nodeMain && this._env.isNode) {\n var nodeMain = this.options.nodeMain;\n var dirnameIndex = Math.max(nodeMain.lastIndexOf('/'), nodeMain.lastIndexOf('\\\\'));\n this.options.baseUrl = nodeMain.substring(0, dirnameIndex + 1);\n }\n }\n }\n Configuration.prototype._createIgnoreDuplicateModulesMap = function () {\n // Build a map out of the ignoreDuplicateModules array\n this.ignoreDuplicateModulesMap = {};\n for (var i = 0; i < this.options.ignoreDuplicateModules.length; i++) {\n this.ignoreDuplicateModulesMap[this.options.ignoreDuplicateModules[i]] = true;\n }\n };\n Configuration.prototype._createNodeModulesMap = function () {\n // Build a map out of nodeModules array\n this.nodeModulesMap = Object.create(null);\n for (var _i = 0, _a = this.options.nodeModules; _i < _a.length; _i++) {\n var nodeModule = _a[_i];\n this.nodeModulesMap[nodeModule] = true;\n }\n };\n Configuration.prototype._createSortedPathsRules = function () {\n var _this = this;\n // Create an array our of the paths rules, sorted descending by length to\n // result in a more specific -> less specific order\n this.sortedPathsRules = [];\n AMDLoader.Utilities.forEachProperty(this.options.paths, function (from, to) {\n if (!Array.isArray(to)) {\n _this.sortedPathsRules.push({\n from: from,\n to: [to]\n });\n }\n else {\n _this.sortedPathsRules.push({\n from: from,\n to: to\n });\n }\n });\n this.sortedPathsRules.sort(function (a, b) {\n return b.from.length - a.from.length;\n });\n };\n /**\n * Clone current configuration and overwrite options selectively.\n * @param options The selective options to overwrite with.\n * @result A new configuration\n */\n Configuration.prototype.cloneAndMerge = function (options) {\n return new Configuration(this._env, ConfigurationOptionsUtil.mergeConfigurationOptions(options, this.options));\n };\n /**\n * Get current options bag. Useful for passing it forward to plugins.\n */\n Configuration.prototype.getOptionsLiteral = function () {\n return this.options;\n };\n Configuration.prototype._applyPaths = function (moduleId) {\n var pathRule;\n for (var i = 0, len = this.sortedPathsRules.length; i < len; i++) {\n pathRule = this.sortedPathsRules[i];\n if (AMDLoader.Utilities.startsWith(moduleId, pathRule.from)) {\n var result = [];\n for (var j = 0, lenJ = pathRule.to.length; j < lenJ; j++) {\n result.push(pathRule.to[j] + moduleId.substr(pathRule.from.length));\n }\n return result;\n }\n }\n return [moduleId];\n };\n Configuration.prototype._addUrlArgsToUrl = function (url) {\n if (AMDLoader.Utilities.containsQueryString(url)) {\n return url + '&' + this.options.urlArgs;\n }\n else {\n return url + '?' + this.options.urlArgs;\n }\n };\n Configuration.prototype._addUrlArgsIfNecessaryToUrl = function (url) {\n if (this.options.urlArgs) {\n return this._addUrlArgsToUrl(url);\n }\n return url;\n };\n Configuration.prototype._addUrlArgsIfNecessaryToUrls = function (urls) {\n if (this.options.urlArgs) {\n for (var i = 0, len = urls.length; i < len; i++) {\n urls[i] = this._addUrlArgsToUrl(urls[i]);\n }\n }\n return urls;\n };\n /**\n * Transform a module id to a location. Appends .js to module ids\n */\n Configuration.prototype.moduleIdToPaths = function (moduleId) {\n if (this.nodeModulesMap[moduleId] === true) {\n // This is a node module...\n if (this.isBuild()) {\n // ...and we are at build time, drop it\n return ['empty:'];\n }\n else {\n // ...and at runtime we create a `shortcut`-path\n return ['node|' + moduleId];\n }\n }\n var result = moduleId;\n var results;\n if (!AMDLoader.Utilities.endsWith(result, '.js') && !AMDLoader.Utilities.isAbsolutePath(result)) {\n results = this._applyPaths(result);\n for (var i = 0, len = results.length; i < len; i++) {\n if (this.isBuild() && results[i] === 'empty:') {\n continue;\n }\n if (!AMDLoader.Utilities.isAbsolutePath(results[i])) {\n results[i] = this.options.baseUrl + results[i];\n }\n if (!AMDLoader.Utilities.endsWith(results[i], '.js') && !AMDLoader.Utilities.containsQueryString(results[i])) {\n results[i] = results[i] + '.js';\n }\n }\n }\n else {\n if (!AMDLoader.Utilities.endsWith(result, '.js') && !AMDLoader.Utilities.containsQueryString(result)) {\n result = result + '.js';\n }\n results = [result];\n }\n return this._addUrlArgsIfNecessaryToUrls(results);\n };\n /**\n * Transform a module id or url to a location.\n */\n Configuration.prototype.requireToUrl = function (url) {\n var result = url;\n if (!AMDLoader.Utilities.isAbsolutePath(result)) {\n result = this._applyPaths(result)[0];\n if (!AMDLoader.Utilities.isAbsolutePath(result)) {\n result = this.options.baseUrl + result;\n }\n }\n return this._addUrlArgsIfNecessaryToUrl(result);\n };\n /**\n * Flag to indicate if current execution is as part of a build.\n */\n Configuration.prototype.isBuild = function () {\n return this.options.isBuild;\n };\n /**\n * Test if module `moduleId` is expected to be defined multiple times\n */\n Configuration.prototype.isDuplicateMessageIgnoredFor = function (moduleId) {\n return this.ignoreDuplicateModulesMap.hasOwnProperty(moduleId);\n };\n /**\n * Get the configuration settings for the provided module id\n */\n Configuration.prototype.getConfigForModule = function (moduleId) {\n if (this.options.config) {\n return this.options.config[moduleId];\n }\n };\n /**\n * Should errors be caught when executing module factories?\n */\n Configuration.prototype.shouldCatchError = function () {\n return this.options.catchError;\n };\n /**\n * Should statistics be recorded?\n */\n Configuration.prototype.shouldRecordStats = function () {\n return this.options.recordStats;\n };\n /**\n * Forward an error to the error handler.\n */\n Configuration.prototype.onError = function (err) {\n this.options.onError(err);\n };\n return Configuration;\n }());\n AMDLoader.Configuration = Configuration;\n})(AMDLoader || (AMDLoader = {}));\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 AMDLoader;\n(function (AMDLoader) {\n /**\n * Load `scriptSrc` only once (avoid multiple <script> tags)\n */\n var OnlyOnceScriptLoader = /** @class */ (function () {\n function OnlyOnceScriptLoader(env) {\n this._env = env;\n this._scriptLoader = null;\n this._callbackMap = {};\n }\n OnlyOnceScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) {\n var _this = this;\n if (!this._scriptLoader) {\n this._scriptLoader = (this._env.isWebWorker\n ? new WorkerScriptLoader()\n : this._env.isNode\n ? new NodeScriptLoader(this._env)\n : new BrowserScriptLoader());\n }\n var scriptCallbacks = {\n callback: callback,\n errorback: errorback\n };\n if (this._callbackMap.hasOwnProperty(scriptSrc)) {\n this._callbackMap[scriptSrc].push(scriptCallbacks);\n return;\n }\n this._callbackMap[scriptSrc] = [scriptCallbacks];\n this._scriptLoader.load(moduleManager, scriptSrc, function () { return _this.triggerCallback(scriptSrc); }, function (err) { return _this.triggerErrorback(scriptSrc, err); });\n };\n OnlyOnceScriptLoader.prototype.triggerCallback = function (scriptSrc) {\n var scriptCallbacks = this._callbackMap[scriptSrc];\n delete this._callbackMap[scriptSrc];\n for (var i = 0; i < scriptCallbacks.length; i++) {\n scriptCallbacks[i].callback();\n }\n };\n OnlyOnceScriptLoader.prototype.triggerErrorback = function (scriptSrc, err) {\n var scriptCallbacks = this._callbackMap[scriptSrc];\n delete this._callbackMap[scriptSrc];\n for (var i = 0; i < scriptCallbacks.length; i++) {\n scriptCallbacks[i].errorback(err);\n }\n };\n return OnlyOnceScriptLoader;\n }());\n var BrowserScriptLoader = /** @class */ (function () {\n function BrowserScriptLoader() {\n }\n /**\n * Attach load / error listeners to a script element and remove them when either one has fired.\n * Implemented for browssers supporting HTML5 standard 'load' and 'error' events.\n */\n BrowserScriptLoader.prototype.attachListeners = function (script, callback, errorback) {\n var unbind = function () {\n script.removeEventListener('load', loadEventListener);\n script.removeEventListener('error', errorEventListener);\n };\n var loadEventListener = function (e) {\n unbind();\n callback();\n };\n var errorEventListener = function (e) {\n unbind();\n errorback(e);\n };\n script.addEventListener('load', loadEventListener);\n script.addEventListener('error', errorEventListener);\n };\n BrowserScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) {\n var script = document.createElement('script');\n script.setAttribute('async', 'async');\n script.setAttribute('type', 'text/javascript');\n this.attachListeners(script, callback, errorback);\n script.setAttribute('src', scriptSrc);\n // Propagate CSP nonce to dynamically created script tag.\n var cspNonce = moduleManager.getConfig().getOptionsLiteral().cspNonce;\n if (cspNonce) {\n script.setAttribute('nonce', cspNonce);\n }\n document.getElementsByTagName('head')[0].appendChild(script);\n };\n return BrowserScriptLoader;\n }());\n var WorkerScriptLoader = /** @class */ (function () {\n function WorkerScriptLoader() {\n }\n WorkerScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) {\n try {\n importScripts(scriptSrc);\n callback();\n }\n catch (e) {\n errorback(e);\n }\n };\n return WorkerScriptLoader;\n }());\n var NodeScriptLoader = /** @class */ (function () {\n function NodeScriptLoader(env) {\n this._env = env;\n this._didInitialize = false;\n this._didPatchNodeRequire = false;\n }\n NodeScriptLoader.prototype._init = function (nodeRequire) {\n if (this._didInitialize) {\n return;\n }\n this._didInitialize = true;\n // capture node modules\n this._fs = nodeRequire('fs');\n this._vm = nodeRequire('vm');\n this._path = nodeRequire('path');\n this._crypto = nodeRequire('crypto');\n };\n // patch require-function of nodejs such that we can manually create a script\n // from cached data. this is done by overriding the `Module._compile` function\n NodeScriptLoader.prototype._initNodeRequire = function (nodeRequire, moduleManager) {\n // It is important to check for `nodeCachedData` first and then set `_didPatchNodeRequire`.\n // That's because `nodeCachedData` is set _after_ calling this for the first time...\n var nodeCachedData = moduleManager.getConfig().getOptionsLiteral().nodeCachedData;\n if (!nodeCachedData) {\n return;\n }\n if (this._didPatchNodeRequire) {\n return;\n }\n this._didPatchNodeRequire = true;\n var that = this;\n var Module = nodeRequire('module');\n function makeRequireFunction(mod) {\n var Module = mod.constructor;\n var require = function require(path) {\n try {\n return mod.require(path);\n }\n finally {\n // nothing\n }\n };\n require.resolve = function resolve(request) {\n return Module._resolveFilename(request, mod);\n };\n require.main = process.mainModule;\n require.extensions = Module._extensions;\n require.cache = Module._cache;\n return require;\n }\n Module.prototype._compile = function (content, filename) {\n // remove shebang and create wrapper function\n var scriptSource = Module.wrap(content.replace(/^#!.*/, ''));\n // create script\n var recorder = moduleManager.getRecorder();\n var cachedDataPath = that._getCachedDataPath(nodeCachedData, filename);\n var options = { filename: filename };\n var hashData;\n try {\n var data = that._fs.readFileSync(cachedDataPath);\n hashData = data.slice(0, 16);\n options.cachedData = data.slice(16);\n recorder.record(60 /* CachedDataFound */, cachedDataPath);\n }\n catch (_e) {\n recorder.record(61 /* CachedDataMissed */, cachedDataPath);\n }\n var script = new that._vm.Script(scriptSource, options);\n var compileWrapper = script.runInThisContext(options);\n // run script\n var dirname = that._path.dirname(filename);\n var require = makeRequireFunction(this);\n var args = [this.exports, require, this, filename, dirname, process, _commonjsGlobal, Buffer];\n var result = compileWrapper.apply(this.exports, args);\n // cached data aftermath\n that._handleCachedData(script, scriptSource, cachedDataPath, !options.cachedData, moduleManager);\n that._verifyCachedData(script, scriptSource, cachedDataPath, hashData, moduleManager);\n return result;\n };\n };\n NodeScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) {\n var _this = this;\n var opts = moduleManager.getConfig().getOptionsLiteral();\n var nodeRequire = (opts.nodeRequire || AMDLoader.global.nodeRequire);\n var nodeInstrumenter = (opts.nodeInstrumenter || function (c) { return c; });\n this._init(nodeRequire);\n this._initNodeRequire(nodeRequire, moduleManager);\n var recorder = moduleManager.getRecorder();\n if (/^node\\|/.test(scriptSrc)) {\n var pieces = scriptSrc.split('|');\n var moduleExports_1 = null;\n try {\n moduleExports_1 = nodeRequire(pieces[1]);\n }\n catch (err) {\n errorback(err);\n return;\n }\n moduleManager.enqueueDefineAnonymousModule([], function () { return moduleExports_1; });\n callback();\n }\n else {\n scriptSrc = AMDLoader.Utilities.fileUriToFilePath(this._env.isWindows, scriptSrc);\n var normalizedScriptSrc_1 = this._path.normalize(scriptSrc);\n var vmScriptPathOrUri_1 = this._getElectronRendererScriptPathOrUri(normalizedScriptSrc_1);\n var wantsCachedData_1 = Boolean(opts.nodeCachedData);\n var cachedDataPath_1 = wantsCachedData_1 ? this._getCachedDataPath(opts.nodeCachedData, scriptSrc) : undefined;\n this._readSourceAndCachedData(normalizedScriptSrc_1, cachedDataPath_1, recorder, function (err, data, cachedData, hashData) {\n if (err) {\n errorback(err);\n return;\n }\n var scriptSource;\n if (data.charCodeAt(0) === NodeScriptLoader._BOM) {\n scriptSource = NodeScriptLoader._PREFIX + data.substring(1) + NodeScriptLoader._SUFFIX;\n }\n else {\n scriptSource = NodeScriptLoader._PREFIX + data + NodeScriptLoader._SUFFIX;\n }\n scriptSource = nodeInstrumenter(scriptSource, normalizedScriptSrc_1);\n var scriptOpts = { filename: vmScriptPathOrUri_1, cachedData: cachedData };\n var script = _this._createAndEvalScript(moduleManager, scriptSource, scriptOpts, callback, errorback);\n _this._handleCachedData(script, scriptSource, cachedDataPath_1, wantsCachedData_1 && !cachedData, moduleManager);\n _this._verifyCachedData(script, scriptSource, cachedDataPath_1, hashData, moduleManager);\n });\n }\n };\n NodeScriptLoader.prototype._createAndEvalScript = function (moduleManager, contents, options, callback, errorback) {\n var recorder = moduleManager.getRecorder();\n recorder.record(31 /* NodeBeginEvaluatingScript */, options.filename);\n var script = new this._vm.Script(contents, options);\n var ret = script.runInThisContext(options);\n var globalDefineFunc = moduleManager.getGlobalAMDDefineFunc();\n var receivedDefineCall = false;\n var localDefineFunc = function () {\n receivedDefineCall = true;\n return globalDefineFunc.apply(null, arguments);\n };\n localDefineFunc.amd = globalDefineFunc.amd;\n ret.call(AMDLoader.global, moduleManager.getGlobalAMDRequireFunc(), localDefineFunc, options.filename, this._path.dirname(options.filename));\n recorder.record(32 /* NodeEndEvaluatingScript */, options.filename);\n if (receivedDefineCall) {\n callback();\n }\n else {\n errorback(new Error(\"Didn't receive define call in \" + options.filename + \"!\"));\n }\n return script;\n };\n NodeScriptLoader.prototype._getElectronRendererScriptPathOrUri = function (path) {\n if (!this._env.isElectronRenderer) {\n return path;\n }\n var driveLetterMatch = path.match(/^([a-z])\\:(.*)/i);\n if (driveLetterMatch) {\n // windows\n return \"file:///\" + (driveLetterMatch[1].toUpperCase() + ':' + driveLetterMatch[2]).replace(/\\\\/g, '/');\n }\n else {\n // nix\n return \"file://\" + path;\n }\n };\n NodeScriptLoader.prototype._getCachedDataPath = function (config, filename) {\n var hash = this._crypto.createHash('md5').update(filename, 'utf8').update(config.seed, 'utf8').digest('hex');\n var basename = this._path.basename(filename).replace(/\\.js$/, '');\n return this._path.join(config.path, basename + \"-\" + hash + \".code\");\n };\n NodeScriptLoader.prototype._handleCachedData = function (script, scriptSource, cachedDataPath, createCachedData, moduleManager) {\n var _this = this;\n if (script.cachedDataRejected) {\n // cached data got rejected -> delete and re-create\n this._fs.unlink(cachedDataPath, function (err) {\n moduleManager.getRecorder().record(62 /* CachedDataRejected */, cachedDataPath);\n _this._createAndWriteCachedData(script, scriptSource, cachedDataPath, moduleManager);\n if (err) {\n moduleManager.getConfig().onError(err);\n }\n });\n }\n else if (createCachedData) {\n // no cached data, but wanted\n this._createAndWriteCachedData(script, scriptSource, cachedDataPath, moduleManager);\n }\n };\n // Cached data format: | SOURCE_HASH | V8_CACHED_DATA |\n // -SOURCE_HASH is the md5 hash of the JS source (always 16 bytes)\n // -V8_CACHED_DATA is what v8 produces\n NodeScriptLoader.prototype._createAndWriteCachedData = function (script, scriptSource, cachedDataPath, moduleManager) {\n var _this = this;\n var timeout = Math.ceil(moduleManager.getConfig().getOptionsLiteral().nodeCachedData.writeDelay * (1 + Math.random()));\n var lastSize = -1;\n var iteration = 0;\n var hashData = undefined;\n var createLoop = function () {\n setTimeout(function () {\n if (!hashData) {\n hashData = _this._crypto.createHash('md5').update(scriptSource, 'utf8').digest();\n }\n var cachedData = script.createCachedData();\n if (cachedData.length === 0 || cachedData.length === lastSize || iteration >= 5) {\n return;\n }\n lastSize = cachedData.length;\n _this._fs.writeFile(cachedDataPath, Buffer.concat([hashData, cachedData]), function (err) {\n if (err) {\n moduleManager.getConfig().onError(err);\n }\n moduleManager.getRecorder().record(63 /* CachedDataCreated */, cachedDataPath);\n createLoop();\n });\n }, timeout * (Math.pow(4, iteration++)));\n };\n // with some delay (`timeout`) create cached data\n // and repeat that (with backoff delay) until the\n // data seems to be not changing anymore\n createLoop();\n };\n NodeScriptLoader.prototype._readSourceAndCachedData = function (sourcePath, cachedDataPath, recorder, callback) {\n if (!cachedDataPath) {\n // no cached data case\n this._fs.readFile(sourcePath, { encoding: 'utf8' }, callback);\n }\n else {\n // cached data case: read both files in parallel\n var source_1 = undefined;\n var cachedData_1 = undefined;\n var hashData_1 = undefined;\n var steps_1 = 2;\n var step_1 = function (err) {\n if (err) {\n callback(err);\n }\n else if (--steps_1 === 0) {\n callback(undefined, source_1, cachedData_1, hashData_1);\n }\n };\n this._fs.readFile(sourcePath, { encoding: 'utf8' }, function (err, data) {\n source_1 = data;\n step_1(err);\n });\n this._fs.readFile(cachedDataPath, function (err, data) {\n if (!err && data && data.length > 0) {\n hashData_1 = data.slice(0, 16);\n cachedData_1 = data.slice(16);\n recorder.record(60 /* CachedDataFound */, cachedDataPath);\n }\n else {\n recorder.record(61 /* CachedDataMissed */, cachedDataPath);\n }\n step_1(); // ignored: cached data is optional\n });\n }\n };\n NodeScriptLoader.prototype._verifyCachedData = function (script, scriptSource, cachedDataPath, hashData, moduleManager) {\n var _this = this;\n if (!hashData) {\n // nothing to do\n return;\n }\n if (script.cachedDataRejected) {\n // invalid anyways\n return;\n }\n setTimeout(function () {\n // check source hash - the contract is that file paths change when file content\n // change (e.g use the commit or version id as cache path). this check is\n // for violations of this contract.\n var hashDataNow = _this._crypto.createHash('md5').update(scriptSource, 'utf8').digest();\n if (!hashData.equals(hashDataNow)) {\n moduleManager.getConfig().onError(new Error(\"FAILED TO VERIFY CACHED DATA, deleting stale '\" + cachedDataPath + \"' now, but a RESTART IS REQUIRED\"));\n _this._fs.unlink(cachedDataPath, function (err) { return moduleManager.getConfig().onError(err); });\n }\n }, Math.ceil(5000 * (1 + Math.random())));\n };\n NodeScriptLoader._BOM = 0xFEFF;\n NodeScriptLoader._PREFIX = '(function (require, define, __filename, __dirname) { ';\n NodeScriptLoader._SUFFIX = '\\n});';\n return NodeScriptLoader;\n }());\n function createScriptLoader(env) {\n return new OnlyOnceScriptLoader(env);\n }\n AMDLoader.createScriptLoader = createScriptLoader;\n})(AMDLoader || (AMDLoader = {}));\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 AMDLoader;\n(function (AMDLoader) {\n // ------------------------------------------------------------------------\n // ModuleIdResolver\n var ModuleIdResolver = /** @class */ (function () {\n function ModuleIdResolver(fromModuleId) {\n var lastSlash = fromModuleId.lastIndexOf('/');\n if (lastSlash !== -1) {\n this.fromModulePath = fromModuleId.substr(0, lastSlash + 1);\n }\n else {\n this.fromModulePath = '';\n }\n }\n /**\n * Normalize 'a/../name' to 'name', etc.\n */\n ModuleIdResolver._normalizeModuleId = function (moduleId) {\n var r = moduleId, pattern;\n // replace /./ => /\n pattern = /\\/\\.\\//;\n while (pattern.test(r)) {\n r = r.replace(pattern, '/');\n }\n // replace ^./ => nothing\n r = r.replace(/^\\.\\//g, '');\n // replace /aa/../ => / (BUT IGNORE /../../)\n pattern = /\\/(([^\\/])|([^\\/][^\\/\\.])|([^\\/\\.][^\\/])|([^\\/][^\\/][^\\/]+))\\/\\.\\.\\//;\n while (pattern.test(r)) {\n r = r.replace(pattern, '/');\n }\n // replace ^aa/../ => nothing (BUT IGNORE ../../)\n r = r.replace(/^(([^\\/])|([^\\/][^\\/\\.])|([^\\/\\.][^\\/])|([^\\/][^\\/][^\\/]+))\\/\\.\\.\\//, '');\n return r;\n };\n /**\n * Resolve relative module ids\n */\n ModuleIdResolver.prototype.resolveModule = function (moduleId) {\n var result = moduleId;\n if (!AMDLoader.Utilities.isAbsolutePath(result)) {\n if (AMDLoader.Utilities.startsWith(result, './') || AMDLoader.Utilities.startsWith(result, '../')) {\n result = ModuleIdResolver._normalizeModuleId(this.fromModulePath + result);\n }\n }\n return result;\n };\n ModuleIdResolver.ROOT = new ModuleIdResolver('');\n return ModuleIdResolver;\n }());\n AMDLoader.ModuleIdResolver = ModuleIdResolver;\n // ------------------------------------------------------------------------\n // Module\n var Module = /** @class */ (function () {\n function Module(id, strId, dependencies, callback, errorback, moduleIdResolver) {\n this.id = id;\n this.strId = strId;\n this.dependencies = dependencies;\n this._callback = callback;\n this._errorback = errorback;\n this.moduleIdResolver = moduleIdResolver;\n this.exports = {};\n this.error = null;\n this.exportsPassedIn = false;\n this.unresolvedDependenciesCount = this.dependencies.length;\n this._isComplete = false;\n }\n Module._safeInvokeFunction = function (callback, args) {\n try {\n return {\n returnedValue: callback.apply(AMDLoader.global, args),\n producedError: null\n };\n }\n catch (e) {\n return {\n returnedValue: null,\n producedError: e\n };\n }\n };\n Module._invokeFactory = function (config, strModuleId, callback, dependenciesValues) {\n if (config.isBuild() && !AMDLoader.Utilities.isAnonymousModule(strModuleId)) {\n return {\n returnedValue: null,\n producedError: null\n };\n }\n if (config.shouldCatchError()) {\n return this._safeInvokeFunction(callback, dependenciesValues);\n }\n return {\n returnedValue: callback.apply(AMDLoader.global, dependenciesValues),\n producedError: null\n };\n };\n Module.prototype.complete = function (recorder, config, dependenciesValues) {\n this._isComplete = true;\n var producedError = null;\n if (this._callback) {\n if (typeof this._callback === 'function') {\n recorder.record(21 /* BeginInvokeFactory */, this.strId);\n var r = Module._invokeFactory(config, this.strId, this._callback, dependenciesValues);\n producedError = r.producedError;\n recorder.record(22 /* EndInvokeFactory */, this.strId);\n if (!producedError && typeof r.returnedValue !== 'undefined' && (!this.exportsPassedIn || AMDLoader.Utilities.isEmpty(this.exports))) {\n this.exports = r.returnedValue;\n }\n }\n else {\n this.exports = this._callback;\n }\n }\n if (producedError) {\n var err = AMDLoader.ensureError(producedError);\n err.phase = 'factory';\n err.moduleId = this.strId;\n this.error = err;\n config.onError(err);\n }\n this.dependencies = null;\n this._callback = null;\n this._errorback = null;\n this.moduleIdResolver = null;\n };\n /**\n * One of the direct dependencies or a transitive dependency has failed to load.\n */\n Module.prototype.onDependencyError = function (err) {\n this._isComplete = true;\n this.error = err;\n if (this._errorback) {\n this._errorback(err);\n return true;\n }\n return false;\n };\n /**\n * Is the current module complete?\n */\n Module.prototype.isComplete = function () {\n return this._isComplete;\n };\n return Module;\n }());\n AMDLoader.Module = Module;\n var ModuleIdProvider = /** @class */ (function () {\n function ModuleIdProvider() {\n this._nextId = 0;\n this._strModuleIdToIntModuleId = new Map();\n this._intModuleIdToStrModuleId = [];\n // Ensure values 0, 1, 2 are assigned accordingly with ModuleId\n this.getModuleId('exports');\n this.getModuleId('module');\n this.getModuleId('require');\n }\n ModuleIdProvider.prototype.getMaxModuleId = function () {\n return this._nextId;\n };\n ModuleIdProvider.prototype.getModuleId = function (strModuleId) {\n var id = this._strModuleIdToIntModuleId.get(strModuleId);\n if (typeof id === 'undefined') {\n id = this._nextId++;\n this._strModuleIdToIntModuleId.set(strModuleId, id);\n this._intModuleIdToStrModuleId[id] = strModuleId;\n }\n return id;\n };\n ModuleIdProvider.prototype.getStrModuleId = function (moduleId) {\n return this._intModuleIdToStrModuleId[moduleId];\n };\n return ModuleIdProvider;\n }());\n var RegularDependency = /** @class */ (function () {\n function RegularDependency(id) {\n this.id = id;\n }\n RegularDependency.EXPORTS = new RegularDependency(0 /* EXPORTS */);\n RegularDependency.MODULE = new RegularDependency(1 /* MODULE */);\n RegularDependency.REQUIRE = new RegularDependency(2 /* REQUIRE */);\n return RegularDependency;\n }());\n AMDLoader.RegularDependency = RegularDependency;\n var PluginDependency = /** @class */ (function () {\n function PluginDependency(id, pluginId, pluginParam) {\n this.id = id;\n this.pluginId = pluginId;\n this.pluginParam = pluginParam;\n }\n return PluginDependency;\n }());\n AMDLoader.PluginDependency = PluginDependency;\n var ModuleManager = /** @class */ (function () {\n function ModuleManager(env, scriptLoader, defineFunc, requireFunc, loaderAvailableTimestamp) {\n if (loaderAvailableTimestamp === void 0) { loaderAvailableTimestamp = 0; }\n this._env = env;\n this._scriptLoader = scriptLoader;\n this._loaderAvailableTimestamp = loaderAvailableTimestamp;\n this._defineFunc = defineFunc;\n this._requireFunc = requireFunc;\n this._moduleIdProvider = new ModuleIdProvider();\n this._config = new AMDLoader.Configuration(this._env);\n this._modules2 = [];\n this._knownModules2 = [];\n this._inverseDependencies2 = [];\n this._inversePluginDependencies2 = new Map();\n this._currentAnnonymousDefineCall = null;\n this._recorder = null;\n this._buildInfoPath = [];\n this._buildInfoDefineStack = [];\n this._buildInfoDependencies = [];\n }\n ModuleManager.prototype.reset = function () {\n return new ModuleManager(this._env, this._scriptLoader, this._defineFunc, this._requireFunc, this._loaderAvailableTimestamp);\n };\n ModuleManager.prototype.getGlobalAMDDefineFunc = function () {\n return this._defineFunc;\n };\n ModuleManager.prototype.getGlobalAMDRequireFunc = function () {\n return this._requireFunc;\n };\n ModuleManager._findRelevantLocationInStack = function (needle, stack) {\n var normalize = function (str) { return str.replace(/\\\\/g, '/'); };\n var normalizedPath = normalize(needle);\n var stackPieces = stack.split(/\\n/);\n for (var i = 0; i < stackPieces.length; i++) {\n var m = stackPieces[i].match(/(.*):(\\d+):(\\d+)\\)?$/);\n if (m) {\n var stackPath = m[1];\n var stackLine = m[2];\n var stackColumn = m[3];\n var trimPathOffset = Math.max(stackPath.lastIndexOf(' ') + 1, stackPath.lastIndexOf('(') + 1);\n stackPath = stackPath.substr(trimPathOffset);\n stackPath = normalize(stackPath);\n if (stackPath === normalizedPath) {\n var r = {\n line: parseInt(stackLine, 10),\n col: parseInt(stackColumn, 10)\n };\n if (r.line === 1) {\n r.col -= '(function (require, define, __filename, __dirname) { '.length;\n }\n return r;\n }\n }\n }\n throw new Error('Could not correlate define call site for needle ' + needle);\n };\n ModuleManager.prototype.getBuildInfo = function () {\n if (!this._config.isBuild()) {\n return null;\n }\n var result = [], resultLen = 0;\n for (var i = 0, len = this._modules2.length; i < len; i++) {\n var m = this._modules2[i];\n if (!m) {\n continue;\n }\n var location_1 = this._buildInfoPath[m.id] || null;\n var defineStack = this._buildInfoDefineStack[m.id] || null;\n var dependencies = this._buildInfoDependencies[m.id];\n result[resultLen++] = {\n id: m.strId,\n path: location_1,\n defineLocation: (location_1 && defineStack ? ModuleManager._findRelevantLocationInStack(location_1, defineStack) : null),\n dependencies: dependencies,\n shim: null,\n exports: m.exports\n };\n }\n return result;\n };\n ModuleManager.prototype.getRecorder = function () {\n if (!this._recorder) {\n if (this._config.shouldRecordStats()) {\n this._recorder = new AMDLoader.LoaderEventRecorder(this._loaderAvailableTimestamp);\n }\n else {\n this._recorder = AMDLoader.NullLoaderEventRecorder.INSTANCE;\n }\n }\n return this._recorder;\n };\n ModuleManager.prototype.getLoaderEvents = function () {\n return this.getRecorder().getEvents();\n };\n /**\n * Defines an anonymous module (without an id). Its name will be resolved as we receive a callback from the scriptLoader.\n * @param dependecies @see defineModule\n * @param callback @see defineModule\n */\n ModuleManager.prototype.enqueueDefineAnonymousModule = function (dependencies, callback) {\n if (this._currentAnnonymousDefineCall !== null) {\n throw new Error('Can only have one anonymous define call per script file');\n }\n var stack = null;\n if (this._config.isBuild()) {\n stack = new Error('StackLocation').stack || null;\n }\n this._currentAnnonymousDefineCall = {\n stack: stack,\n dependencies: dependencies,\n callback: callback\n };\n };\n /**\n * Creates a module and stores it in _modules. The manager will immediately begin resolving its dependencies.\n * @param strModuleId An unique and absolute id of the module. This must not collide with another module's id\n * @param dependencies An array with the dependencies of the module. Special keys are: \"require\", \"exports\" and \"module\"\n * @param callback if callback is a function, it will be called with the resolved dependencies. if callback is an object, it will be considered as the exports of the module.\n */\n ModuleManager.prototype.defineModule = function (strModuleId, dependencies, callback, errorback, stack, moduleIdResolver) {\n var _this = this;\n if (moduleIdResolver === void 0) { moduleIdResolver = new ModuleIdResolver(strModuleId); }\n var moduleId = this._moduleIdProvider.getModuleId(strModuleId);\n if (this._modules2[moduleId]) {\n if (!this._config.isDuplicateMessageIgnoredFor(strModuleId)) {\n console.warn('Duplicate definition of module \\'' + strModuleId + '\\'');\n }\n // Super important! Completely ignore duplicate module definition\n return;\n }\n var m = new Module(moduleId, strModuleId, this._normalizeDependencies(dependencies, moduleIdResolver), callback, errorback, moduleIdResolver);\n this._modules2[moduleId] = m;\n if (this._config.isBuild()) {\n this._buildInfoDefineStack[moduleId] = stack;\n this._buildInfoDependencies[moduleId] = (m.dependencies || []).map(function (dep) { return _this._moduleIdProvider.getStrModuleId(dep.id); });\n }\n // Resolving of dependencies is immediate (not in a timeout). If there's a need to support a packer that concatenates in an\n // unordered manner, in order to finish processing the file, execute the following method in a timeout\n this._resolve(m);\n };\n ModuleManager.prototype._normalizeDependency = function (dependency, moduleIdResolver) {\n if (dependency === 'exports') {\n return RegularDependency.EXPORTS;\n }\n if (dependency === 'module') {\n return RegularDependency.MODULE;\n }\n if (dependency === 'require') {\n return RegularDependency.REQUIRE;\n }\n // Normalize dependency and then request it from the manager\n var bangIndex = dependency.indexOf('!');\n if (bangIndex >= 0) {\n var strPluginId = moduleIdResolver.resolveModule(dependency.substr(0, bangIndex));\n var pluginParam = moduleIdResolver.resolveModule(dependency.substr(bangIndex + 1));\n var dependencyId = this._moduleIdProvider.getModuleId(strPluginId + '!' + pluginParam);\n var pluginId = this._moduleIdProvider.getModuleId(strPluginId);\n return new PluginDependency(dependencyId, pluginId, pluginParam);\n }\n return new RegularDependency(this._moduleIdProvider.getModuleId(moduleIdResolver.resolveModule(dependency)));\n };\n ModuleManager.prototype._normalizeDependencies = function (dependencies, moduleIdResolver) {\n var result = [], resultLen = 0;\n for (var i = 0, len = dependencies.length; i < len; i++) {\n result[resultLen++] = this._normalizeDependency(dependencies[i], moduleIdResolver);\n }\n return result;\n };\n ModuleManager.prototype._relativeRequire = function (moduleIdResolver, dependencies, callback, errorback) {\n if (typeof dependencies === 'string') {\n return this.synchronousRequire(dependencies, moduleIdResolver);\n }\n this.defineModule(AMDLoader.Utilities.generateAnonymousModule(), dependencies, callback, errorback, null, moduleIdResolver);\n };\n /**\n * Require synchronously a module by its absolute id. If the module is not loaded, an exception will be thrown.\n * @param id The unique and absolute id of the required module\n * @return The exports of module 'id'\n */\n ModuleManager.prototype.synchronousRequire = function (_strModuleId, moduleIdResolver) {\n if (moduleIdResolver === void 0) { moduleIdResolver = new ModuleIdResolver(_strModuleId); }\n var dependency = this._normalizeDependency(_strModuleId, moduleIdResolver);\n var m = this._modules2[dependency.id];\n if (!m) {\n throw new Error('Check dependency list! Synchronous require cannot resolve module \\'' + _strModuleId + '\\'. This is the first mention of this module!');\n }\n if (!m.isComplete()) {\n throw new Error('Check dependency list! Synchronous require cannot resolve module \\'' + _strModuleId + '\\'. This module has not been resolved completely yet.');\n }\n if (m.error) {\n throw m.error;\n }\n return m.exports;\n };\n ModuleManager.prototype.configure = function (params, shouldOverwrite) {\n var oldShouldRecordStats = this._config.shouldRecordStats();\n if (shouldOverwrite) {\n this._config = new AMDLoader.Configuration(this._env, params);\n }\n else {\n this._config = this._config.cloneAndMerge(params);\n }\n if (this._config.shouldRecordStats() && !oldShouldRecordStats) {\n this._recorder = null;\n }\n };\n ModuleManager.prototype.getConfig = function () {\n return this._config;\n };\n /**\n * Callback from the scriptLoader when a module has been loaded.\n * This means its code is available and has been executed.\n */\n ModuleManager.prototype._onLoad = function (moduleId) {\n if (this._currentAnnonymousDefineCall !== null) {\n var defineCall = this._currentAnnonymousDefineCall;\n this._currentAnnonymousDefineCall = null;\n // Hit an anonymous define call\n this.defineModule(this._moduleIdProvider.getStrModuleId(moduleId), defineCall.dependencies, defineCall.callback, null, defineCall.stack);\n }\n };\n ModuleManager.prototype._createLoadError = function (moduleId, _err) {\n var _this = this;\n var strModuleId = this._moduleIdProvider.getStrModuleId(moduleId);\n var neededBy = (this._inverseDependencies2[moduleId] || []).map(function (intModuleId) { return _this._moduleIdProvider.getStrModuleId(intModuleId); });\n var err = AMDLoader.ensureError(_err);\n err.phase = 'loading';\n err.moduleId = strModuleId;\n err.neededBy = neededBy;\n return err;\n };\n /**\n * Callback from the scriptLoader when a module hasn't been loaded.\n * This means that the script was not found (e.g. 404) or there was an error in the script.\n */\n ModuleManager.prototype._onLoadError = function (moduleId, err) {\n var error = this._createLoadError(moduleId, err);\n if (!this._modules2[moduleId]) {\n this._modules2[moduleId] = new Module(moduleId, this._moduleIdProvider.getStrModuleId(moduleId), [], function () { }, function () { }, null);\n }\n // Find any 'local' error handlers, walk the entire chain of inverse dependencies if necessary.\n var seenModuleId = [];\n for (var i = 0, len = this._moduleIdProvider.getMaxModuleId(); i < len; i++) {\n seenModuleId[i] = false;\n }\n var someoneNotified = false;\n var queue = [];\n queue.push(moduleId);\n seenModuleId[moduleId] = true;\n while (queue.length > 0) {\n var queueElement = queue.shift();\n var m = this._modules2[queueElement];\n if (m) {\n someoneNotified = m.onDependencyError(error) || someoneNotified;\n }\n var inverseDeps = this._inverseDependencies2[queueElement];\n if (inverseDeps) {\n for (var i = 0, len = inverseDeps.length; i < len; i++) {\n var inverseDep = inverseDeps[i];\n if (!seenModuleId[inverseDep]) {\n queue.push(inverseDep);\n seenModuleId[inverseDep] = true;\n }\n }\n }\n }\n if (!someoneNotified) {\n this._config.onError(error);\n }\n };\n /**\n * Walks (recursively) the dependencies of 'from' in search of 'to'.\n * Returns true if there is such a path or false otherwise.\n * @param from Module id to start at\n * @param to Module id to look for\n */\n ModuleManager.prototype._hasDependencyPath = function (fromId, toId) {\n var from = this._modules2[fromId];\n if (!from) {\n return false;\n }\n var inQueue = [];\n for (var i = 0, len = this._moduleIdProvider.getMaxModuleId(); i < len; i++) {\n inQueue[i] = false;\n }\n var queue = [];\n // Insert 'from' in queue\n queue.push(from);\n inQueue[fromId] = true;\n while (queue.length > 0) {\n // Pop first inserted element of queue\n var element = queue.shift();\n var dependencies = element.dependencies;\n if (dependencies) {\n // Walk the element's dependencies\n for (var i = 0, len = dependencies.length; i < len; i++) {\n var dependency = dependencies[i];\n if (dependency.id === toId) {\n // There is a path to 'to'\n return true;\n }\n var dependencyModule = this._modules2[dependency.id];\n if (dependencyModule && !inQueue[dependency.id]) {\n // Insert 'dependency' in queue\n inQueue[dependency.id] = true;\n queue.push(dependencyModule);\n }\n }\n }\n }\n // There is no path to 'to'\n return false;\n };\n /**\n * Walks (recursively) the dependencies of 'from' in search of 'to'.\n * Returns cycle as array.\n * @param from Module id to start at\n * @param to Module id to look for\n */\n ModuleManager.prototype._findCyclePath = function (fromId, toId, depth) {\n if (fromId === toId || depth === 50) {\n return [fromId];\n }\n var from = this._modules2[fromId];\n if (!from) {\n return null;\n }\n // Walk the element's dependencies\n var dependencies = from.dependencies;\n if (dependencies) {\n for (var i = 0, len = dependencies.length; i < len; i++) {\n var path = this._findCyclePath(dependencies[i].id, toId, depth + 1);\n if (path !== null) {\n path.push(fromId);\n return path;\n }\n }\n }\n return null;\n };\n /**\n * Create the local 'require' that is passed into modules\n */\n ModuleManager.prototype._createRequire = function (moduleIdResolver) {\n var _this = this;\n var result = (function (dependencies, callback, errorback) {\n return _this._relativeRequire(moduleIdResolver, dependencies, callback, errorback);\n });\n result.toUrl = function (id) {\n return _this._config.requireToUrl(moduleIdResolver.resolveModule(id));\n };\n result.getStats = function () {\n return _this.getLoaderEvents();\n };\n result.__$__nodeRequire = AMDLoader.global.nodeRequire;\n return result;\n };\n ModuleManager.prototype._loadModule = function (moduleId) {\n var _this = this;\n if (this._modules2[moduleId] || this._knownModules2[moduleId]) {\n // known module\n return;\n }\n this._knownModules2[moduleId] = true;\n var strModuleId = this._moduleIdProvider.getStrModuleId(moduleId);\n var paths = this._config.moduleIdToPaths(strModuleId);\n var scopedPackageRegex = /^@[^\\/]+\\/[^\\/]+$/; // matches @scope/package-name\n if (this._env.isNode && (strModuleId.indexOf('/') === -1 || scopedPackageRegex.test(strModuleId))) {\n paths.push('node|' + strModuleId);\n }\n var lastPathIndex = -1;\n var loadNextPath = function (err) {\n lastPathIndex++;\n if (lastPathIndex >= paths.length) {\n // No more paths to try\n _this._onLoadError(moduleId, err);\n }\n else {\n var currentPath_1 = paths[lastPathIndex];\n var recorder_1 = _this.getRecorder();\n if (_this._config.isBuild() && currentPath_1 === 'empty:') {\n _this._buildInfoPath[moduleId] = currentPath_1;\n _this.defineModule(_this._moduleIdProvider.getStrModuleId(moduleId), [], null, null, null);\n _this._onLoad(moduleId);\n return;\n }\n recorder_1.record(10 /* BeginLoadingScript */, currentPath_1);\n _this._scriptLoader.load(_this, currentPath_1, function () {\n if (_this._config.isBuild()) {\n _this._buildInfoPath[moduleId] = currentPath_1;\n }\n recorder_1.record(11 /* EndLoadingScriptOK */, currentPath_1);\n _this._onLoad(moduleId);\n }, function (err) {\n recorder_1.record(12 /* EndLoadingScriptError */, currentPath_1);\n loadNextPath(err);\n });\n }\n };\n loadNextPath(null);\n };\n /**\n * Resolve a plugin dependency with the plugin loaded & complete\n * @param module The module that has this dependency\n * @param pluginDependency The semi-normalized dependency that appears in the module. e.g. 'vs/css!./mycssfile'. Only the plugin part (before !) is normalized\n * @param plugin The plugin (what the plugin exports)\n */\n ModuleManager.prototype._loadPluginDependency = function (plugin, pluginDependency) {\n var _this = this;\n if (this._modules2[pluginDependency.id] || this._knownModules2[pluginDependency.id]) {\n // known module\n return;\n }\n this._knownModules2[pluginDependency.id] = true;\n // Delegate the loading of the resource to the plugin\n var load = (function (value) {\n _this.defineModule(_this._moduleIdProvider.getStrModuleId(pluginDependency.id), [], value, null, null);\n });\n load.error = function (err) {\n _this._config.onError(_this._createLoadError(pluginDependency.id, err));\n };\n plugin.load(pluginDependency.pluginParam, this._createRequire(ModuleIdResolver.ROOT), load, this._config.getOptionsLiteral());\n };\n /**\n * Examine the dependencies of module 'module' and resolve them as needed.\n */\n ModuleManager.prototype._resolve = function (module) {\n var _this = this;\n var dependencies = module.dependencies;\n if (dependencies) {\n for (var i = 0, len = dependencies.length; i < len; i++) {\n var dependency = dependencies[i];\n if (dependency === RegularDependency.EXPORTS) {\n module.exportsPassedIn = true;\n module.unresolvedDependenciesCount--;\n continue;\n }\n if (dependency === RegularDependency.MODULE) {\n module.unresolvedDependenciesCount--;\n continue;\n }\n if (dependency === RegularDependency.REQUIRE) {\n module.unresolvedDependenciesCount--;\n continue;\n }\n var dependencyModule = this._modules2[dependency.id];\n if (dependencyModule && dependencyModule.isComplete()) {\n if (dependencyModule.error) {\n module.onDependencyError(dependencyModule.error);\n return;\n }\n module.unresolvedDependenciesCount--;\n continue;\n }\n if (this._hasDependencyPath(dependency.id, module.id)) {\n console.warn('There is a dependency cycle between \\'' + this._moduleIdProvider.getStrModuleId(dependency.id) + '\\' and \\'' + this._moduleIdProvider.getStrModuleId(module.id) + '\\'. The cyclic path follows:');\n var cyclePath = this._findCyclePath(dependency.id, module.id, 0) || [];\n cyclePath.reverse();\n cyclePath.push(dependency.id);\n console.warn(cyclePath.map(function (id) { return _this._moduleIdProvider.getStrModuleId(id); }).join(' => \\n'));\n // Break the cycle\n module.unresolvedDependenciesCount--;\n continue;\n }\n // record inverse dependency\n this._inverseDependencies2[dependency.id] = this._inverseDependencies2[dependency.id] || [];\n this._inverseDependencies2[dependency.id].push(module.id);\n if (dependency instanceof PluginDependency) {\n var plugin = this._modules2[dependency.pluginId];\n if (plugin && plugin.isComplete()) {\n this._loadPluginDependency(plugin.exports, dependency);\n continue;\n }\n // Record dependency for when the plugin gets loaded\n var inversePluginDeps = this._inversePluginDependencies2.get(dependency.pluginId);\n if (!inversePluginDeps) {\n inversePluginDeps = [];\n this._inversePluginDependencies2.set(dependency.pluginId, inversePluginDeps);\n }\n inversePluginDeps.push(dependency);\n this._loadModule(dependency.pluginId);\n continue;\n }\n this._loadModule(dependency.id);\n }\n }\n if (module.unresolvedDependenciesCount === 0) {\n this._onModuleComplete(module);\n }\n };\n ModuleManager.prototype._onModuleComplete = function (module) {\n var _this = this;\n var recorder = this.getRecorder();\n if (module.isComplete()) {\n // already done\n return;\n }\n var dependencies = module.dependencies;\n var dependenciesValues = [];\n if (dependencies) {\n for (var i = 0, len = dependencies.length; i < len; i++) {\n var dependency = dependencies[i];\n if (dependency === RegularDependency.EXPORTS) {\n dependenciesValues[i] = module.exports;\n continue;\n }\n if (dependency === RegularDependency.MODULE) {\n dependenciesValues[i] = {\n id: module.strId,\n config: function () {\n return _this._config.getConfigForModule(module.strId);\n }\n };\n continue;\n }\n if (dependency === RegularDependency.REQUIRE) {\n dependenciesValues[i] = this._createRequire(module.moduleIdResolver);\n continue;\n }\n var dependencyModule = this._modules2[dependency.id];\n if (dependencyModule) {\n dependenciesValues[i] = dependencyModule.exports;\n continue;\n }\n dependenciesValues[i] = null;\n }\n }\n module.complete(recorder, this._config, dependenciesValues);\n // Fetch and clear inverse dependencies\n var inverseDeps = this._inverseDependencies2[module.id];\n this._inverseDependencies2[module.id] = null;\n if (inverseDeps) {\n // Resolve one inverse dependency at a time, always\n // on the lookout for a completed module.\n for (var i = 0, len = inverseDeps.length; i < len; i++) {\n var inverseDependencyId = inverseDeps[i];\n var inverseDependency = this._modules2[inverseDependencyId];\n inverseDependency.unresolvedDependenciesCount--;\n if (inverseDependency.unresolvedDependenciesCount === 0) {\n this._onModuleComplete(inverseDependency);\n }\n }\n }\n var inversePluginDeps = this._inversePluginDependencies2.get(module.id);\n if (inversePluginDeps) {\n // This module is used as a plugin at least once\n // Fetch and clear these inverse plugin dependencies\n this._inversePluginDependencies2.delete(module.id);\n // Resolve plugin dependencies one at a time\n for (var i = 0, len = inversePluginDeps.length; i < len; i++) {\n this._loadPluginDependency(module.exports, inversePluginDeps[i]);\n }\n }\n };\n return ModuleManager;\n }());\n AMDLoader.ModuleManager = ModuleManager;\n})(AMDLoader || (AMDLoader = {}));\nvar define;\nvar AMDLoader;\n(function (AMDLoader) {\n var env = new AMDLoader.Environment();\n var moduleManager = null;\n var DefineFunc = function (id, dependencies, callback) {\n if (typeof id !== 'string') {\n callback = dependencies;\n dependencies = id;\n id = null;\n }\n if (typeof dependencies !== 'object' || !Array.isArray(dependencies)) {\n callback = dependencies;\n dependencies = null;\n }\n if (!dependencies) {\n dependencies = ['require', 'exports', 'module'];\n }\n if (id) {\n moduleManager.defineModule(id, dependencies, callback, null, null);\n }\n else {\n moduleManager.enqueueDefineAnonymousModule(dependencies, callback);\n }\n };\n DefineFunc.amd = {\n jQuery: true\n };\n var _requireFunc_config = function (params, shouldOverwrite) {\n if (shouldOverwrite === void 0) { shouldOverwrite = false; }\n moduleManager.configure(params, shouldOverwrite);\n };\n var RequireFunc = function () {\n if (arguments.length === 1) {\n if ((arguments[0] instanceof Object) && !Array.isArray(arguments[0])) {\n _requireFunc_config(arguments[0]);\n return;\n }\n if (typeof arguments[0] === 'string') {\n return moduleManager.synchronousRequire(arguments[0]);\n }\n }\n if (arguments.length === 2 || arguments.length === 3) {\n if (Array.isArray(arguments[0])) {\n moduleManager.defineModule(AMDLoader.Utilities.generateAnonymousModule(), arguments[0], arguments[1], arguments[2], null);\n return;\n }\n }\n throw new Error('Unrecognized require call');\n };\n RequireFunc.config = _requireFunc_config;\n RequireFunc.getConfig = function () {\n return moduleManager.getConfig().getOptionsLiteral();\n };\n RequireFunc.reset = function () {\n moduleManager = moduleManager.reset();\n };\n RequireFunc.getBuildInfo = function () {\n return moduleManager.getBuildInfo();\n };\n RequireFunc.getStats = function () {\n return moduleManager.getLoaderEvents();\n };\n RequireFunc.define = function () {\n return DefineFunc.apply(null, arguments);\n };\n function init() {\n if (typeof AMDLoader.global.require !== 'undefined' || typeof require !== 'undefined') {\n var _nodeRequire_1 = (AMDLoader.global.require || require);\n if (typeof _nodeRequire_1 === 'function' && typeof _nodeRequire_1.resolve === 'function') {\n // re-expose node's require function\n var nodeRequire = function (what) {\n moduleManager.getRecorder().record(33 /* NodeBeginNativeRequire */, what);\n try {\n return _nodeRequire_1(what);\n }\n finally {\n moduleManager.getRecorder().record(34 /* NodeEndNativeRequire */, what);\n }\n };\n AMDLoader.global.nodeRequire = nodeRequire;\n RequireFunc.nodeRequire = nodeRequire;\n RequireFunc.__$__nodeRequire = nodeRequire;\n }\n }\n if (env.isNode && !env.isElectronRenderer) {\n module.exports = RequireFunc;\n require = RequireFunc;\n }\n else {\n if (!env.isElectronRenderer) {\n AMDLoader.global.define = DefineFunc;\n }\n AMDLoader.global.require = RequireFunc;\n }\n }\n AMDLoader.init = init;\n if (typeof AMDLoader.global.define !== 'function' || !AMDLoader.global.define.amd) {\n moduleManager = new AMDLoader.ModuleManager(env, AMDLoader.createScriptLoader(env), DefineFunc, RequireFunc, AMDLoader.Utilities.getHighPerformanceTimestamp());\n // The global variable require can configure the loader\n if (typeof AMDLoader.global.require !== 'undefined' && typeof AMDLoader.global.require !== 'function') {\n RequireFunc.config(AMDLoader.global.require);\n }\n // This define is for the local closure defined in node in the case that the loader is concatenated\n define = function () {\n return DefineFunc.apply(null, arguments);\n };\n define.amd = DefineFunc.amd;\n if (typeof doNotInitLoader === 'undefined') {\n init();\n }\n }\n})(AMDLoader || (AMDLoader = {}));\n","\r\n\r\n/**\r\n * Returns the last element of an array.\r\n * @param array The array.\r\n * @param n Which element from the end (default is zero).\r\n */\r\nexport function tail<T>(array: ArrayLike<T>, n: number = 0): T {\r\n\treturn array[array.length - (1 + n)];\r\n}\r\n\r\nexport function tail2<T>(arr: T[]): [T[], T] {\r\n\tif (arr.length === 0) {\r\n\t\tthrow new Error('Invalid tail call');\r\n\t}\r\n\r\n\treturn [arr.slice(0, arr.length - 1), arr[arr.length - 1]];\r\n}\r\n\r\nexport function equals<T>(one: ReadonlyArray<T> | undefined, other: ReadonlyArray<T> | undefined, itemEquals: (a: T, b: T) => boolean = (a, b) => a === b): boolean {\r\n\tif (one === other) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\tif (!one || !other) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (one.length !== other.length) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfor (let i = 0, len = one.length; i < len; i++) {\r\n\t\tif (!itemEquals(one[i], other[i])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\nexport function binarySearch<T>(array: ReadonlyArray<T>, key: T, comparator: (op1: T, op2: T) => number): number {\r\n\tlet low = 0,\r\n\t\thigh = array.length - 1;\r\n\r\n\twhile (low <= high) {\r\n\t\tconst mid = ((low + high) / 2) | 0;\r\n\t\tconst comp = comparator(array[mid], key);\r\n\t\tif (comp < 0) {\r\n\t\t\tlow = mid + 1;\r\n\t\t} else if (comp > 0) {\r\n\t\t\thigh = mid - 1;\r\n\t\t} else {\r\n\t\t\treturn mid;\r\n\t\t}\r\n\t}\r\n\treturn -(low + 1);\r\n}\r\n\r\n/**\r\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\r\n * are located before all elements where p(x) is true.\r\n * @returns the least x for which p(x) is true or array.length if no element fullfills the given function.\r\n */\r\nexport function findFirstInSorted<T>(array: ReadonlyArray<T>, p: (x: T) => boolean): number {\r\n\tlet low = 0, high = array.length;\r\n\tif (high === 0) {\r\n\t\treturn 0; // no children\r\n\t}\r\n\twhile (low < high) {\r\n\t\tconst mid = Math.floor((low + high) / 2);\r\n\t\tif (p(array[mid])) {\r\n\t\t\thigh = mid;\r\n\t\t} else {\r\n\t\t\tlow = mid + 1;\r\n\t\t}\r\n\t}\r\n\treturn low;\r\n}\r\n\r\ntype Compare<T> = (a: T, b: T) => number;\r\n\r\n/**\r\n * Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort`\r\n * so only use this when actually needing stable sort.\r\n */\r\nexport function mergeSort<T>(data: T[], compare: Compare<T>): T[] {\r\n\t_sort(data, compare, 0, data.length - 1, []);\r\n\treturn data;\r\n}\r\n\r\nfunction _merge<T>(a: T[], compare: Compare<T>, lo: number, mid: number, hi: number, aux: T[]): void {\r\n\tlet leftIdx = lo, rightIdx = mid + 1;\r\n\tfor (let i = lo; i <= hi; i++) {\r\n\t\taux[i] = a[i];\r\n\t}\r\n\tfor (let i = lo; i <= hi; i++) {\r\n\t\tif (leftIdx > mid) {\r\n\t\t\t// left side consumed\r\n\t\t\ta[i] = aux[rightIdx++];\r\n\t\t} else if (rightIdx > hi) {\r\n\t\t\t// right side consumed\r\n\t\t\ta[i] = aux[leftIdx++];\r\n\t\t} else if (compare(aux[rightIdx], aux[leftIdx]) < 0) {\r\n\t\t\t// right element is less -> comes first\r\n\t\t\ta[i] = aux[rightIdx++];\r\n\t\t} else {\r\n\t\t\t// left element comes first (less or equal)\r\n\t\t\ta[i] = aux[leftIdx++];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction _sort<T>(a: T[], compare: Compare<T>, lo: number, hi: number, aux: T[]) {\r\n\tif (hi <= lo) {\r\n\t\treturn;\r\n\t}\r\n\tconst mid = lo + ((hi - lo) / 2) | 0;\r\n\t_sort(a, compare, lo, mid, aux);\r\n\t_sort(a, compare, mid + 1, hi, aux);\r\n\tif (compare(a[mid], a[mid + 1]) <= 0) {\r\n\t\t// left and right are sorted and if the last-left element is less\r\n\t\t// or equals than the first-right element there is nothing else\r\n\t\t// to do\r\n\t\treturn;\r\n\t}\r\n\t_merge(a, compare, lo, mid, hi, aux);\r\n}\r\n\r\n\r\nexport function groupBy<T>(data: ReadonlyArray<T>, compare: (a: T, b: T) => number): T[][] {\r\n\tconst result: T[][] = [];\r\n\tlet currentGroup: T[] | undefined = undefined;\r\n\tfor (const element of mergeSort(data.slice(0), compare)) {\r\n\t\tif (!currentGroup || compare(currentGroup[0], element) !== 0) {\r\n\t\t\tcurrentGroup = [element];\r\n\t\t\tresult.push(currentGroup);\r\n\t\t} else {\r\n\t\t\tcurrentGroup.push(element);\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}\r\n\r\n/**\r\n * @returns New array with all falsy values removed. The original array IS NOT modified.\r\n */\r\nexport function coalesce<T>(array: ReadonlyArray<T | undefined | null>): T[] {\r\n\treturn <T[]>array.filter(e => !!e);\r\n}\r\n\r\n/**\r\n * @returns false if the provided object is an array and not empty.\r\n */\r\nexport function isFalsyOrEmpty(obj: any): boolean {\r\n\treturn !Array.isArray(obj) || obj.length === 0;\r\n}\r\n\r\n/**\r\n * @returns True if the provided object is an array and has at least one element.\r\n */\r\nexport function isNonEmptyArray<T>(obj: T[] | undefined | null): obj is T[];\r\nexport function isNonEmptyArray<T>(obj: readonly T[] | undefined | null): obj is readonly T[];\r\nexport function isNonEmptyArray<T>(obj: T[] | readonly T[] | undefined | null): obj is T[] | readonly T[] {\r\n\treturn Array.isArray(obj) && obj.length > 0;\r\n}\r\n\r\n/**\r\n * Removes duplicates from the given array. The optional keyFn allows to specify\r\n * how elements are checked for equalness by returning a unique string for each.\r\n */\r\nexport function distinct<T>(array: ReadonlyArray<T>, keyFn?: (t: T) => string): T[] {\r\n\tif (!keyFn) {\r\n\t\treturn array.filter((element, position) => {\r\n\t\t\treturn array.indexOf(element) === position;\r\n\t\t});\r\n\t}\r\n\r\n\tconst seen: { [key: string]: boolean; } = Object.create(null);\r\n\treturn array.filter((elem) => {\r\n\t\tconst key = keyFn(elem);\r\n\t\tif (seen[key]) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tseen[key] = true;\r\n\r\n\t\treturn true;\r\n\t});\r\n}\r\n\r\nexport function distinctES6<T>(array: ReadonlyArray<T>): T[] {\r\n\tconst seen = new Set<T>();\r\n\treturn array.filter(element => {\r\n\t\tif (seen.has(element)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tseen.add(element);\r\n\t\treturn true;\r\n\t});\r\n}\r\n\r\nexport function fromSet<T>(set: Set<T>): T[] {\r\n\tconst result: T[] = [];\r\n\tset.forEach(o => result.push(o));\r\n\treturn result;\r\n}\r\n\r\nexport function firstIndex<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean): number {\r\n\tfor (let i = 0; i < array.length; i++) {\r\n\t\tconst element = array[i];\r\n\r\n\t\tif (fn(element)) {\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n\r\n\treturn -1;\r\n}\r\n\r\nexport function first<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean, notFoundValue: T): T;\r\nexport function first<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean): T | undefined;\r\nexport function first<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean, notFoundValue: T | undefined = undefined): T | undefined {\r\n\tconst index = firstIndex(array, fn);\r\n\treturn index < 0 ? notFoundValue : array[index];\r\n}\r\n\r\nexport function firstOrDefault<T, NotFound = T>(array: ReadonlyArray<T>, notFoundValue: NotFound): T | NotFound;\r\nexport function firstOrDefault<T>(array: ReadonlyArray<T>): T | undefined;\r\nexport function firstOrDefault<T, NotFound = T>(array: ReadonlyArray<T>, notFoundValue?: NotFound): T | NotFound | undefined {\r\n\treturn array.length > 0 ? array[0] : notFoundValue;\r\n}\r\n\r\nexport function flatten<T>(arr: T[][]): T[] {\r\n\treturn (<T[]>[]).concat(...arr);\r\n}\r\n\r\nexport function range(to: number): number[];\r\nexport function range(from: number, to: number): number[];\r\nexport function range(arg: number, to?: number): number[] {\r\n\tlet from = typeof to === 'number' ? arg : 0;\r\n\r\n\tif (typeof to === 'number') {\r\n\t\tfrom = arg;\r\n\t} else {\r\n\t\tfrom = 0;\r\n\t\tto = arg;\r\n\t}\r\n\r\n\tconst result: number[] = [];\r\n\r\n\tif (from <= to) {\r\n\t\tfor (let i = from; i < to; i++) {\r\n\t\t\tresult.push(i);\r\n\t\t}\r\n\t} else {\r\n\t\tfor (let i = from; i > to; i--) {\r\n\t\t\tresult.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\n/**\r\n * Insert `insertArr` inside `target` at `insertIndex`.\r\n * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array\r\n */\r\nexport function arrayInsert<T>(target: T[], insertIndex: number, insertArr: T[]): T[] {\r\n\tconst before = target.slice(0, insertIndex);\r\n\tconst after = target.slice(insertIndex);\r\n\treturn before.concat(insertArr, after);\r\n}\r\n\r\n/**\r\n * Pushes an element to the start of the array, if found.\r\n */\r\nexport function pushToStart<T>(arr: T[], value: T): void {\r\n\tconst index = arr.indexOf(value);\r\n\r\n\tif (index > -1) {\r\n\t\tarr.splice(index, 1);\r\n\t\tarr.unshift(value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Pushes an element to the end of the array, if found.\r\n */\r\nexport function pushToEnd<T>(arr: T[], value: T): void {\r\n\tconst index = arr.indexOf(value);\r\n\r\n\tif (index > -1) {\r\n\t\tarr.splice(index, 1);\r\n\t\tarr.push(value);\r\n\t}\r\n}\r\n\r\nexport function find<T>(arr: ArrayLike<T>, predicate: (value: T, index: number, arr: ArrayLike<T>) => any): T | undefined {\r\n\tfor (let i = 0; i < arr.length; i++) {\r\n\t\tconst element = arr[i];\r\n\t\tif (predicate(element, i, arr)) {\r\n\t\t\treturn element;\r\n\t\t}\r\n\t}\r\n\r\n\treturn undefined;\r\n}\r\n\r\nexport function asArray<T>(x: T | T[]): T[] {\r\n\treturn Array.isArray(x) ? x : [x];\r\n}\r\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\r\n/**\r\n * Represents information about a specific difference between two sequences.\r\n */\r\nexport class DiffChange {\r\n\r\n\t/**\r\n\t * The position of the first element in the original sequence which\r\n\t * this change affects.\r\n\t */\r\n\tpublic originalStart: number;\r\n\r\n\t/**\r\n\t * The number of elements from the original sequence which were\r\n\t * affected.\r\n\t */\r\n\tpublic originalLength: number;\r\n\r\n\t/**\r\n\t * The position of the first element in the modified sequence which\r\n\t * this change affects.\r\n\t */\r\n\tpublic modifiedStart: number;\r\n\r\n\t/**\r\n\t * The number of elements from the modified sequence which were\r\n\t * affected (added).\r\n\t */\r\n\tpublic modifiedLength: number;\r\n\r\n\t/**\r\n\t * Constructs a new DiffChange with the given sequence information\r\n\t * and content.\r\n\t */\r\n\tconstructor(originalStart: number, originalLength: number, modifiedStart: number, modifiedLength: number) {\r\n\t\t//Debug.Assert(originalLength > 0 || modifiedLength > 0, \"originalLength and modifiedLength cannot both be <= 0\");\r\n\t\tthis.originalStart = originalStart;\r\n\t\tthis.originalLength = originalLength;\r\n\t\tthis.modifiedStart = modifiedStart;\r\n\t\tthis.modifiedLength = modifiedLength;\r\n\t}\r\n\r\n\t/**\r\n\t * The end point (exclusive) of the change in the original sequence.\r\n\t */\r\n\tpublic getOriginalEnd() {\r\n\t\treturn this.originalStart + this.originalLength;\r\n\t}\r\n\r\n\t/**\r\n\t * The end point (exclusive) of the change in the modified sequence.\r\n\t */\r\n\tpublic getModifiedEnd() {\r\n\t\treturn this.modifiedStart + this.modifiedLength;\r\n\t}\r\n}\r\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\r\nexport interface ErrorListenerCallback {\r\n\t(error: any): void;\r\n}\r\n\r\n// Avoid circular dependency on EventEmitter by implementing a subset of the interface.\r\nexport class ErrorHandler {\r\n\tprivate unexpectedErrorHandler: (e: any) => void;\r\n\tprivate listeners: ErrorListenerCallback[];\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.listeners = [];\r\n\r\n\t\tthis.unexpectedErrorHandler = function (e: any) {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tif (e.stack) {\r\n\t\t\t\t\tthrow new Error(e.message + '\\n\\n' + e.stack);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthrow e;\r\n\t\t\t}, 0);\r\n\t\t};\r\n\t}\r\n\r\n\tprivate emit(e: any): void {\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistener(e);\r\n\t\t});\r\n\t}\r\n\r\n\tonUnexpectedError(e: any): void {\r\n\t\tthis.unexpectedErrorHandler(e);\r\n\t\tthis.emit(e);\r\n\t}\r\n\r\n\t// For external errors, we don't want the listeners to be called\r\n\tonUnexpectedExternalError(e: any): void {\r\n\t\tthis.unexpectedErrorHandler(e);\r\n\t}\r\n}\r\n\r\nexport const errorHandler = new ErrorHandler();\r\n\r\nexport function onUnexpectedError(e: any): undefined {\r\n\t// ignore errors from cancelled promises\r\n\tif (!isPromiseCanceledError(e)) {\r\n\t\terrorHandler.onUnexpectedError(e);\r\n\t}\r\n\treturn undefined;\r\n}\r\n\r\nexport function onUnexpectedExternalError(e: any): undefined {\r\n\t// ignore errors from cancelled promises\r\n\tif (!isPromiseCanceledError(e)) {\r\n\t\terrorHandler.onUnexpectedExternalError(e);\r\n\t}\r\n\treturn undefined;\r\n}\r\n\r\nexport interface SerializedError {\r\n}\r\n\r\nexport function transformErrorForSerialization(error: Error): SerializedError;\r\nexport function transformErrorForSerialization(error: any): any;\r\nexport function transformErrorForSerialization(error: any): any {\r\n\tif (error instanceof Error) {\r\n\t\tlet { name, message } = error;\r\n\t\tconst stack: string = (<any>error).stacktrace || (<any>error).stack;\r\n\t\treturn {\r\n\t\t\t$isError: true,\r\n\t\t\tname,\r\n\t\t\tmessage,\r\n\t\t\tstack\r\n\t\t};\r\n\t}\r\n\r\n\t// return as is\r\n\treturn error;\r\n}\r\n\r\nconst canceledName = 'Canceled';\r\n\r\n/**\r\n * Checks if the given error is a promise in canceled state\r\n */\r\nexport function isPromiseCanceledError(error: any): boolean {\r\n\treturn error instanceof Error && error.name === canceledName && error.message === canceledName;\r\n}\r\n\r\n/**\r\n * Returns an error that signals cancellation.\r\n */\r\nexport function canceled(): Error {\r\n\tconst error = new Error(canceledName);\r\n\terror.name = error.message;\r\n\treturn error;\r\n}\r\n\r\nexport function illegalArgument(name?: string): Error {\r\n\tif (name) {\r\n\t\treturn new Error(`Illegal argument: ${name}`);\r\n\t} else {\r\n\t\treturn new Error('Illegal argument');\r\n\t}\r\n}\r\n\r\nexport function illegalState(name?: string): Error {\r\n\tif (name) {\r\n\t\treturn new Error(`Illegal state: ${name}`);\r\n\t} else {\r\n\t\treturn new Error('Illegal state');\r\n\t}\r\n}\r\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\r\nexport function once<T extends Function>(this: any, fn: T): T {\r\n\tconst _this = this;\r\n\tlet didCall = false;\r\n\tlet result: any;\r\n\r\n\treturn function () {\r\n\t\tif (didCall) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\tdidCall = true;\r\n\t\tresult = fn.apply(_this, arguments);\r\n\r\n\t\treturn result;\r\n\t} as any as T;\r\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\r\n/**\r\n * Return a hash value for an object.\r\n */\r\nexport function hash(obj: any, hashVal = 0): number {\r\n\tswitch (typeof obj) {\r\n\t\tcase 'object':\r\n\t\t\tif (obj === null) {\r\n\t\t\t\treturn numberHash(349, hashVal);\r\n\t\t\t} else if (Array.isArray(obj)) {\r\n\t\t\t\treturn arrayHash(obj, hashVal);\r\n\t\t\t}\r\n\t\t\treturn objectHash(obj, hashVal);\r\n\t\tcase 'string':\r\n\t\t\treturn stringHash(obj, hashVal);\r\n\t\tcase 'boolean':\r\n\t\t\treturn booleanHash(obj, hashVal);\r\n\t\tcase 'number':\r\n\t\t\treturn numberHash(obj, hashVal);\r\n\t\tcase 'undefined':\r\n\t\t\treturn numberHash(0, 937);\r\n\t\tdefault:\r\n\t\t\treturn numberHash(0, 617);\r\n\t}\r\n}\r\n\r\nfunction numberHash(val: number, initialHashVal: number): number {\r\n\treturn (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32\r\n}\r\n\r\nfunction booleanHash(b: boolean, initialHashVal: number): number {\r\n\treturn numberHash(b ? 433 : 863, initialHashVal);\r\n}\r\n\r\nexport function stringHash(s: string, hashVal: number) {\r\n\thashVal = numberHash(149417, hashVal);\r\n\tfor (let i = 0, length = s.length; i < length; i++) {\r\n\t\thashVal = numberHash(s.charCodeAt(i), hashVal);\r\n\t}\r\n\treturn hashVal;\r\n}\r\n\r\nfunction arrayHash(arr: any[], initialHashVal: number): number {\r\n\tinitialHashVal = numberHash(104579, initialHashVal);\r\n\treturn arr.reduce((hashVal, item) => hash(item, hashVal), initialHashVal);\r\n}\r\n\r\nfunction objectHash(obj: any, initialHashVal: number): number {\r\n\tinitialHashVal = numberHash(181387, initialHashVal);\r\n\treturn Object.keys(obj).sort().reduce((hashVal, key) => {\r\n\t\thashVal = stringHash(key, hashVal);\r\n\t\treturn hash(obj[key], hashVal);\r\n\t}, initialHashVal);\r\n}\r\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\r\nimport { DiffChange } from 'vs/base/common/diff/diffChange';\r\nimport { stringHash } from 'vs/base/common/hash';\r\nimport { Constants } from 'vs/base/common/uint';\r\n\r\nexport class StringDiffSequence implements ISequence {\r\n\r\n\tconstructor(private source: string) { }\r\n\r\n\tgetElements(): Int32Array | number[] | string[] {\r\n\t\tconst source = this.source;\r\n\t\tconst characters = new Int32Array(source.length);\r\n\t\tfor (let i = 0, len = source.length; i < len; i++) {\r\n\t\t\tcharacters[i] = source.charCodeAt(i);\r\n\t\t}\r\n\t\treturn characters;\r\n\t}\r\n}\r\n\r\nexport function stringDiff(original: string, modified: string, pretty: boolean): IDiffChange[] {\r\n\treturn new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes;\r\n}\r\n\r\nexport interface ISequence {\r\n\tgetElements(): Int32Array | number[] | string[];\r\n}\r\n\r\nexport interface IDiffChange {\r\n\t/**\r\n\t * The position of the first element in the original sequence which\r\n\t * this change affects.\r\n\t */\r\n\toriginalStart: number;\r\n\r\n\t/**\r\n\t * The number of elements from the original sequence which were\r\n\t * affected.\r\n\t */\r\n\toriginalLength: number;\r\n\r\n\t/**\r\n\t * The position of the first element in the modified sequence which\r\n\t * this change affects.\r\n\t */\r\n\tmodifiedStart: number;\r\n\r\n\t/**\r\n\t * The number of elements from the modified sequence which were\r\n\t * affected (added).\r\n\t */\r\n\tmodifiedLength: number;\r\n}\r\n\r\nexport interface IContinueProcessingPredicate {\r\n\t(furthestOriginalIndex: number, matchLengthOfLongest: number): boolean;\r\n}\r\n\r\nexport interface IDiffResult {\r\n\tquitEarly: boolean;\r\n\tchanges: IDiffChange[];\r\n}\r\n\r\n//\r\n// The code below has been ported from a C# implementation in VS\r\n//\r\n\r\nexport class Debug {\r\n\r\n\tpublic static Assert(condition: boolean, message: string): void {\r\n\t\tif (!condition) {\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport class MyArray {\r\n\t/**\r\n\t * Copies a range of elements from an Array starting at the specified source index and pastes\r\n\t * them to another Array starting at the specified destination index. The length and the indexes\r\n\t * are specified as 64-bit integers.\r\n\t * sourceArray:\r\n\t *\t\tThe Array that contains the data to copy.\r\n\t * sourceIndex:\r\n\t *\t\tA 64-bit integer that represents the index in the sourceArray at which copying begins.\r\n\t * destinationArray:\r\n\t *\t\tThe Array that receives the data.\r\n\t * destinationIndex:\r\n\t *\t\tA 64-bit integer that represents the index in the destinationArray at which storing begins.\r\n\t * length:\r\n\t *\t\tA 64-bit integer that represents the number of elements to copy.\r\n\t */\r\n\tpublic static Copy(sourceArray: any[], sourceIndex: number, destinationArray: any[], destinationIndex: number, length: number) {\r\n\t\tfor (let i = 0; i < length; i++) {\r\n\t\t\tdestinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\r\n\t\t}\r\n\t}\r\n\tpublic static Copy2(sourceArray: Int32Array, sourceIndex: number, destinationArray: Int32Array, destinationIndex: number, length: number) {\r\n\t\tfor (let i = 0; i < length; i++) {\r\n\t\t\tdestinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\r\n\t\t}\r\n\t}\r\n}\r\n\r\n//*****************************************************************************\r\n// LcsDiff.cs\r\n//\r\n// An implementation of the difference algorithm described in\r\n// \"An O(ND) Difference Algorithm and its variations\" by Eugene W. Myers\r\n//\r\n// Copyright (C) 2008 Microsoft Corporation @minifier_do_not_preserve\r\n//*****************************************************************************\r\n\r\n// Our total memory usage for storing history is (worst-case):\r\n// 2 * [(MaxDifferencesHistory + 1) * (MaxDifferencesHistory + 1) - 1] * sizeof(int)\r\n// 2 * [1448*1448 - 1] * 4 = 16773624 = 16MB\r\nconst enum LocalConstants {\r\n\tMaxDifferencesHistory = 1447\r\n}\r\n\r\n/**\r\n * A utility class which helps to create the set of DiffChanges from\r\n * a difference operation. This class accepts original DiffElements and\r\n * modified DiffElements that are involved in a particular change. The\r\n * MarktNextChange() method can be called to mark the separation between\r\n * distinct changes. At the end, the Changes property can be called to retrieve\r\n * the constructed changes.\r\n */\r\nclass DiffChangeHelper {\r\n\r\n\tprivate m_changes: DiffChange[];\r\n\tprivate m_originalStart: number;\r\n\tprivate m_modifiedStart: number;\r\n\tprivate m_originalCount: number;\r\n\tprivate m_modifiedCount: number;\r\n\r\n\t/**\r\n\t * Constructs a new DiffChangeHelper for the given DiffSequences.\r\n\t */\r\n\tconstructor() {\r\n\t\tthis.m_changes = [];\r\n\t\tthis.m_originalStart = Constants.MAX_SAFE_SMALL_INTEGER;\r\n\t\tthis.m_modifiedStart = Constants.MAX_SAFE_SMALL_INTEGER;\r\n\t\tthis.m_originalCount = 0;\r\n\t\tthis.m_modifiedCount = 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Marks the beginning of the next change in the set of differences.\r\n\t */\r\n\tpublic MarkNextChange(): void {\r\n\t\t// Only add to the list if there is something to add\r\n\t\tif (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\r\n\t\t\t// Add the new change to our list\r\n\t\t\tthis.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount,\r\n\t\t\t\tthis.m_modifiedStart, this.m_modifiedCount));\r\n\t\t}\r\n\r\n\t\t// Reset for the next change\r\n\t\tthis.m_originalCount = 0;\r\n\t\tthis.m_modifiedCount = 0;\r\n\t\tthis.m_originalStart = Constants.MAX_SAFE_SMALL_INTEGER;\r\n\t\tthis.m_modifiedStart = Constants.MAX_SAFE_SMALL_INTEGER;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds the original element at the given position to the elements\r\n\t * affected by the current change. The modified index gives context\r\n\t * to the change position with respect to the original sequence.\r\n\t * @param originalIndex The index of the original element to add.\r\n\t * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence.\r\n\t */\r\n\tpublic AddOriginalElement(originalIndex: number, modifiedIndex: number) {\r\n\t\t// The 'true' start index is the smallest of the ones we've seen\r\n\t\tthis.m_originalStart = Math.min(this.m_originalStart, originalIndex);\r\n\t\tthis.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\r\n\r\n\t\tthis.m_originalCount++;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds the modified element at the given position to the elements\r\n\t * affected by the current change. The original index gives context\r\n\t * to the change position with respect to the modified sequence.\r\n\t * @param originalIndex The index of the original element that provides corresponding position in the original sequence.\r\n\t * @param modifiedIndex The index of the modified element to add.\r\n\t */\r\n\tpublic AddModifiedElement(originalIndex: number, modifiedIndex: number): void {\r\n\t\t// The 'true' start index is the smallest of the ones we've seen\r\n\t\tthis.m_originalStart = Math.min(this.m_originalStart, originalIndex);\r\n\t\tthis.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\r\n\r\n\t\tthis.m_modifiedCount++;\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves all of the changes marked by the class.\r\n\t */\r\n\tpublic getChanges(): DiffChange[] {\r\n\t\tif (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\r\n\t\t\t// Finish up on whatever is left\r\n\t\t\tthis.MarkNextChange();\r\n\t\t}\r\n\r\n\t\treturn this.m_changes;\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves all of the changes marked by the class in the reverse order\r\n\t */\r\n\tpublic getReverseChanges(): DiffChange[] {\r\n\t\tif (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\r\n\t\t\t// Finish up on whatever is left\r\n\t\t\tthis.MarkNextChange();\r\n\t\t}\r\n\r\n\t\tthis.m_changes.reverse();\r\n\t\treturn this.m_changes;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * An implementation of the difference algorithm described in\r\n * \"An O(ND) Difference Algorithm and its variations\" by Eugene W. Myers\r\n */\r\nexport class LcsDiff {\r\n\r\n\tprivate readonly ContinueProcessingPredicate: IContinueProcessingPredicate | null;\r\n\r\n\tprivate readonly _hasStrings: boolean;\r\n\tprivate readonly _originalStringElements: string[];\r\n\tprivate readonly _originalElementsOrHash: Int32Array;\r\n\tprivate readonly _modifiedStringElements: string[];\r\n\tprivate readonly _modifiedElementsOrHash: Int32Array;\r\n\r\n\tprivate m_forwardHistory: Int32Array[];\r\n\tprivate m_reverseHistory: Int32Array[];\r\n\r\n\t/**\r\n\t * Constructs the DiffFinder\r\n\t */\r\n\tconstructor(originalSequence: ISequence, modifiedSequence: ISequence, continueProcessingPredicate: IContinueProcessingPredicate | null = null) {\r\n\t\tthis.ContinueProcessingPredicate = continueProcessingPredicate;\r\n\r\n\t\tconst [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence);\r\n\t\tconst [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence);\r\n\r\n\t\tthis._hasStrings = (originalHasStrings && modifiedHasStrings);\r\n\t\tthis._originalStringElements = originalStringElements;\r\n\t\tthis._originalElementsOrHash = originalElementsOrHash;\r\n\t\tthis._modifiedStringElements = modifiedStringElements;\r\n\t\tthis._modifiedElementsOrHash = modifiedElementsOrHash;\r\n\r\n\t\tthis.m_forwardHistory = [];\r\n\t\tthis.m_reverseHistory = [];\r\n\t}\r\n\r\n\tprivate static _isStringArray(arr: Int32Array | number[] | string[]): arr is string[] {\r\n\t\treturn (arr.length > 0 && typeof arr[0] === 'string');\r\n\t}\r\n\r\n\tprivate static _getElements(sequence: ISequence): [string[], Int32Array, boolean] {\r\n\t\tconst elements = sequence.getElements();\r\n\r\n\t\tif (LcsDiff._isStringArray(elements)) {\r\n\t\t\tconst hashes = new Int32Array(elements.length);\r\n\t\t\tfor (let i = 0, len = elements.length; i < len; i++) {\r\n\t\t\t\thashes[i] = stringHash(elements[i], 0);\r\n\t\t\t}\r\n\t\t\treturn [elements, hashes, true];\r\n\t\t}\r\n\r\n\t\tif (elements instanceof Int32Array) {\r\n\t\t\treturn [[], elements, false];\r\n\t\t}\r\n\r\n\t\treturn [[], new Int32Array(elements), false];\r\n\t}\r\n\r\n\tprivate ElementsAreEqual(originalIndex: number, newIndex: number): boolean {\r\n\t\tif (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn (this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true);\r\n\t}\r\n\r\n\tprivate OriginalElementsAreEqual(index1: number, index2: number): boolean {\r\n\t\tif (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn (this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true);\r\n\t}\r\n\r\n\tprivate ModifiedElementsAreEqual(index1: number, index2: number): boolean {\r\n\t\tif (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn (this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true);\r\n\t}\r\n\r\n\tpublic ComputeDiff(pretty: boolean): IDiffResult {\r\n\t\treturn this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty);\r\n\t}\r\n\r\n\t/**\r\n\t * Computes the differences between the original and modified input\r\n\t * sequences on the bounded range.\r\n\t * @returns An array of the differences between the two input sequences.\r\n\t */\r\n\tprivate _ComputeDiff(originalStart: number, originalEnd: number, modifiedStart: number, modifiedEnd: number, pretty: boolean): IDiffResult {\r\n\t\tconst quitEarlyArr = [false];\r\n\t\tlet changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);\r\n\r\n\t\tif (pretty) {\r\n\t\t\t// We have to clean up the computed diff to be more intuitive\r\n\t\t\t// but it turns out this cannot be done correctly until the entire set\r\n\t\t\t// of diffs have been computed\r\n\t\t\tchanges = this.PrettifyChanges(changes);\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tquitEarly: quitEarlyArr[0],\r\n\t\t\tchanges: changes\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Private helper method which computes the differences on the bounded range\r\n\t * recursively.\r\n\t * @returns An array of the differences between the two input sequences.\r\n\t */\r\n\tprivate ComputeDiffRecursive(originalStart: number, originalEnd: number, modifiedStart: number, modifiedEnd: number, quitEarlyArr: boolean[]): DiffChange[] {\r\n\t\tquitEarlyArr[0] = false;\r\n\r\n\t\t// Find the start of the differences\r\n\t\twhile (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {\r\n\t\t\toriginalStart++;\r\n\t\t\tmodifiedStart++;\r\n\t\t}\r\n\r\n\t\t// Find the end of the differences\r\n\t\twhile (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {\r\n\t\t\toriginalEnd--;\r\n\t\t\tmodifiedEnd--;\r\n\t\t}\r\n\r\n\t\t// In the special case where we either have all insertions or all deletions or the sequences are identical\r\n\t\tif (originalStart > originalEnd || modifiedStart > modifiedEnd) {\r\n\t\t\tlet changes: DiffChange[];\r\n\r\n\t\t\tif (modifiedStart <= modifiedEnd) {\r\n\t\t\t\tDebug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\r\n\r\n\t\t\t\t// All insertions\r\n\t\t\t\tchanges = [\r\n\t\t\t\t\tnew DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)\r\n\t\t\t\t];\r\n\t\t\t} else if (originalStart <= originalEnd) {\r\n\t\t\t\tDebug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\r\n\r\n\t\t\t\t// All deletions\r\n\t\t\t\tchanges = [\r\n\t\t\t\t\tnew DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0)\r\n\t\t\t\t];\r\n\t\t\t} else {\r\n\t\t\t\tDebug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\r\n\t\t\t\tDebug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\r\n\r\n\t\t\t\t// Identical sequences - No differences\r\n\t\t\t\tchanges = [];\r\n\t\t\t}\r\n\r\n\t\t\treturn changes;\r\n\t\t}\r\n\r\n\t\t// This problem can be solved using the Divide-And-Conquer technique.\r\n\t\tconst midOriginalArr = [0];\r\n\t\tconst midModifiedArr = [0];\r\n\t\tconst result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);\r\n\r\n\t\tconst midOriginal = midOriginalArr[0];\r\n\t\tconst midModified = midModifiedArr[0];\r\n\r\n\t\tif (result !== null) {\r\n\t\t\t// Result is not-null when there was enough memory to compute the changes while\r\n\t\t\t// searching for the recursion point\r\n\t\t\treturn result;\r\n\t\t} else if (!quitEarlyArr[0]) {\r\n\t\t\t// We can break the problem down recursively by finding the changes in the\r\n\t\t\t// First Half: (originalStart, modifiedStart) to (midOriginal, midModified)\r\n\t\t\t// Second Half: (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd)\r\n\t\t\t// NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point\r\n\r\n\t\t\tconst leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);\r\n\t\t\tlet rightChanges: DiffChange[] = [];\r\n\r\n\t\t\tif (!quitEarlyArr[0]) {\r\n\t\t\t\trightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);\r\n\t\t\t} else {\r\n\t\t\t\t// We did't have time to finish the first half, so we don't have time to compute this half.\r\n\t\t\t\t// Consider the entire rest of the sequence different.\r\n\t\t\t\trightChanges = [\r\n\t\t\t\t\tnew DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)\r\n\t\t\t\t];\r\n\t\t\t}\r\n\r\n\t\t\treturn this.ConcatenateChanges(leftChanges, rightChanges);\r\n\t\t}\r\n\r\n\t\t// If we hit here, we quit early, and so can't return anything meaningful\r\n\t\treturn [\r\n\t\t\tnew DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)\r\n\t\t];\r\n\t}\r\n\r\n\tprivate WALKTRACE(diagonalForwardBase: number, diagonalForwardStart: number, diagonalForwardEnd: number, diagonalForwardOffset: number,\r\n\t\tdiagonalReverseBase: number, diagonalReverseStart: number, diagonalReverseEnd: number, diagonalReverseOffset: number,\r\n\t\tforwardPoints: Int32Array, reversePoints: Int32Array,\r\n\t\toriginalIndex: number, originalEnd: number, midOriginalArr: number[],\r\n\t\tmodifiedIndex: number, modifiedEnd: number, midModifiedArr: number[],\r\n\t\tdeltaIsEven: boolean, quitEarlyArr: boolean[]\r\n\t): DiffChange[] {\r\n\t\tlet forwardChanges: DiffChange[] | null = null;\r\n\t\tlet reverseChanges: DiffChange[] | null = null;\r\n\r\n\t\t// First, walk backward through the forward diagonals history\r\n\t\tlet changeHelper = new DiffChangeHelper();\r\n\t\tlet diagonalMin = diagonalForwardStart;\r\n\t\tlet diagonalMax = diagonalForwardEnd;\r\n\t\tlet diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset;\r\n\t\tlet lastOriginalIndex = Constants.MIN_SAFE_SMALL_INTEGER;\r\n\t\tlet historyIndex = this.m_forwardHistory.length - 1;\r\n\r\n\t\tdo {\r\n\t\t\t// Get the diagonal index from the relative diagonal number\r\n\t\t\tconst diagonal = diagonalRelative + diagonalForwardBase;\r\n\r\n\t\t\t// Figure out where we came from\r\n\t\t\tif (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\r\n\t\t\t\t// Vertical line (the element is an insert)\r\n\t\t\t\toriginalIndex = forwardPoints[diagonal + 1];\r\n\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\r\n\t\t\t\tif (originalIndex < lastOriginalIndex) {\r\n\t\t\t\t\tchangeHelper.MarkNextChange();\r\n\t\t\t\t}\r\n\t\t\t\tlastOriginalIndex = originalIndex;\r\n\t\t\t\tchangeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);\r\n\t\t\t\tdiagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration\r\n\t\t\t} else {\r\n\t\t\t\t// Horizontal line (the element is a deletion)\r\n\t\t\t\toriginalIndex = forwardPoints[diagonal - 1] + 1;\r\n\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\r\n\t\t\t\tif (originalIndex < lastOriginalIndex) {\r\n\t\t\t\t\tchangeHelper.MarkNextChange();\r\n\t\t\t\t}\r\n\t\t\t\tlastOriginalIndex = originalIndex - 1;\r\n\t\t\t\tchangeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);\r\n\t\t\t\tdiagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration\r\n\t\t\t}\r\n\r\n\t\t\tif (historyIndex >= 0) {\r\n\t\t\t\tforwardPoints = this.m_forwardHistory[historyIndex];\r\n\t\t\t\tdiagonalForwardBase = forwardPoints[0]; //We stored this in the first spot\r\n\t\t\t\tdiagonalMin = 1;\r\n\t\t\t\tdiagonalMax = forwardPoints.length - 1;\r\n\t\t\t}\r\n\t\t} while (--historyIndex >= -1);\r\n\r\n\t\t// Ironically, we get the forward changes as the reverse of the\r\n\t\t// order we added them since we technically added them backwards\r\n\t\tforwardChanges = changeHelper.getReverseChanges();\r\n\r\n\t\tif (quitEarlyArr[0]) {\r\n\t\t\t// TODO: Calculate a partial from the reverse diagonals.\r\n\t\t\t// For now, just assume everything after the midOriginal/midModified point is a diff\r\n\r\n\t\t\tlet originalStartPoint = midOriginalArr[0] + 1;\r\n\t\t\tlet modifiedStartPoint = midModifiedArr[0] + 1;\r\n\r\n\t\t\tif (forwardChanges !== null && forwardChanges.length > 0) {\r\n\t\t\t\tconst lastForwardChange = forwardChanges[forwardChanges.length - 1];\r\n\t\t\t\toriginalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());\r\n\t\t\t\tmodifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());\r\n\t\t\t}\r\n\r\n\t\t\treverseChanges = [\r\n\t\t\t\tnew DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1,\r\n\t\t\t\t\tmodifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)\r\n\t\t\t];\r\n\t\t} else {\r\n\t\t\t// Now walk backward through the reverse diagonals history\r\n\t\t\tchangeHelper = new DiffChangeHelper();\r\n\t\t\tdiagonalMin = diagonalReverseStart;\r\n\t\t\tdiagonalMax = diagonalReverseEnd;\r\n\t\t\tdiagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset;\r\n\t\t\tlastOriginalIndex = Constants.MAX_SAFE_SMALL_INTEGER;\r\n\t\t\thistoryIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;\r\n\r\n\t\t\tdo {\r\n\t\t\t\t// Get the diagonal index from the relative diagonal number\r\n\t\t\t\tconst diagonal = diagonalRelative + diagonalReverseBase;\r\n\r\n\t\t\t\t// Figure out where we came from\r\n\t\t\t\tif (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\r\n\t\t\t\t\t// Horizontal line (the element is a deletion))\r\n\t\t\t\t\toriginalIndex = reversePoints[diagonal + 1] - 1;\r\n\t\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\r\n\t\t\t\t\tif (originalIndex > lastOriginalIndex) {\r\n\t\t\t\t\t\tchangeHelper.MarkNextChange();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlastOriginalIndex = originalIndex + 1;\r\n\t\t\t\t\tchangeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);\r\n\t\t\t\t\tdiagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Vertical line (the element is an insertion)\r\n\t\t\t\t\toriginalIndex = reversePoints[diagonal - 1];\r\n\t\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\r\n\t\t\t\t\tif (originalIndex > lastOriginalIndex) {\r\n\t\t\t\t\t\tchangeHelper.MarkNextChange();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlastOriginalIndex = originalIndex;\r\n\t\t\t\t\tchangeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);\r\n\t\t\t\t\tdiagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (historyIndex >= 0) {\r\n\t\t\t\t\treversePoints = this.m_reverseHistory[historyIndex];\r\n\t\t\t\t\tdiagonalReverseBase = reversePoints[0]; //We stored this in the first spot\r\n\t\t\t\t\tdiagonalMin = 1;\r\n\t\t\t\t\tdiagonalMax = reversePoints.length - 1;\r\n\t\t\t\t}\r\n\t\t\t} while (--historyIndex >= -1);\r\n\r\n\t\t\t// There are cases where the reverse history will find diffs that\r\n\t\t\t// are correct, but not intuitive, so we need shift them.\r\n\t\t\treverseChanges = changeHelper.getChanges();\r\n\t\t}\r\n\r\n\t\treturn this.ConcatenateChanges(forwardChanges, reverseChanges);\r\n\t}\r\n\r\n\t/**\r\n\t * Given the range to compute the diff on, this method finds the point:\r\n\t * (midOriginal, midModified)\r\n\t * that exists in the middle of the LCS of the two sequences and\r\n\t * is the point at which the LCS problem may be broken down recursively.\r\n\t * This method will try to keep the LCS trace in memory. If the LCS recursion\r\n\t * point is calculated and the full trace is available in memory, then this method\r\n\t * will return the change list.\r\n\t * @param originalStart The start bound of the original sequence range\r\n\t * @param originalEnd The end bound of the original sequence range\r\n\t * @param modifiedStart The start bound of the modified sequence range\r\n\t * @param modifiedEnd The end bound of the modified sequence range\r\n\t * @param midOriginal The middle point of the original sequence range\r\n\t * @param midModified The middle point of the modified sequence range\r\n\t * @returns The diff changes, if available, otherwise null\r\n\t */\r\n\tprivate ComputeRecursionPoint(originalStart: number, originalEnd: number, modifiedStart: number, modifiedEnd: number, midOriginalArr: number[], midModifiedArr: number[], quitEarlyArr: boolean[]) {\r\n\t\tlet originalIndex = 0, modifiedIndex = 0;\r\n\t\tlet diagonalForwardStart = 0, diagonalForwardEnd = 0;\r\n\t\tlet diagonalReverseStart = 0, diagonalReverseEnd = 0;\r\n\r\n\t\t// To traverse the edit graph and produce the proper LCS, our actual\r\n\t\t// start position is just outside the given boundary\r\n\t\toriginalStart--;\r\n\t\tmodifiedStart--;\r\n\r\n\t\t// We set these up to make the compiler happy, but they will\r\n\t\t// be replaced before we return with the actual recursion point\r\n\t\tmidOriginalArr[0] = 0;\r\n\t\tmidModifiedArr[0] = 0;\r\n\r\n\t\t// Clear out the history\r\n\t\tthis.m_forwardHistory = [];\r\n\t\tthis.m_reverseHistory = [];\r\n\r\n\t\t// Each cell in the two arrays corresponds to a diagonal in the edit graph.\r\n\t\t// The integer value in the cell represents the originalIndex of the furthest\r\n\t\t// reaching point found so far that ends in that diagonal.\r\n\t\t// The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number.\r\n\t\tconst maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart);\r\n\t\tconst numDiagonals = maxDifferences + 1;\r\n\t\tconst forwardPoints = new Int32Array(numDiagonals);\r\n\t\tconst reversePoints = new Int32Array(numDiagonals);\r\n\t\t// diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart)\r\n\t\t// diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd)\r\n\t\tconst diagonalForwardBase = (modifiedEnd - modifiedStart);\r\n\t\tconst diagonalReverseBase = (originalEnd - originalStart);\r\n\t\t// diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\r\n\t\t// diagonal number (relative to diagonalForwardBase)\r\n\t\t// diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\r\n\t\t// diagonal number (relative to diagonalReverseBase)\r\n\t\tconst diagonalForwardOffset = (originalStart - modifiedStart);\r\n\t\tconst diagonalReverseOffset = (originalEnd - modifiedEnd);\r\n\r\n\t\t// delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers\r\n\t\t// relative to the start diagonal with diagonal numbers relative to the end diagonal.\r\n\t\t// The Even/Oddn-ness of this delta is important for determining when we should check for overlap\r\n\t\tconst delta = diagonalReverseBase - diagonalForwardBase;\r\n\t\tconst deltaIsEven = (delta % 2 === 0);\r\n\r\n\t\t// Here we set up the start and end points as the furthest points found so far\r\n\t\t// in both the forward and reverse directions, respectively\r\n\t\tforwardPoints[diagonalForwardBase] = originalStart;\r\n\t\treversePoints[diagonalReverseBase] = originalEnd;\r\n\r\n\t\t// Remember if we quit early, and thus need to do a best-effort result instead of a real result.\r\n\t\tquitEarlyArr[0] = false;\r\n\r\n\r\n\r\n\t\t// A couple of points:\r\n\t\t// --With this method, we iterate on the number of differences between the two sequences.\r\n\t\t// The more differences there actually are, the longer this will take.\r\n\t\t// --Also, as the number of differences increases, we have to search on diagonals further\r\n\t\t// away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse).\r\n\t\t// --We extend on even diagonals (relative to the reference diagonal) only when numDifferences\r\n\t\t// is even and odd diagonals only when numDifferences is odd.\r\n\t\tfor (let numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) {\r\n\t\t\tlet furthestOriginalIndex = 0;\r\n\t\t\tlet furthestModifiedIndex = 0;\r\n\r\n\t\t\t// Run the algorithm in the forward direction\r\n\t\t\tdiagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\r\n\t\t\tdiagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\r\n\t\t\tfor (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {\r\n\t\t\t\t// STEP 1: We extend the furthest reaching point in the present diagonal\r\n\t\t\t\t// by looking at the diagonals above and below and picking the one whose point\r\n\t\t\t\t// is further away from the start point (originalStart, modifiedStart)\r\n\t\t\t\tif (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\r\n\t\t\t\t\toriginalIndex = forwardPoints[diagonal + 1];\r\n\t\t\t\t} else {\r\n\t\t\t\t\toriginalIndex = forwardPoints[diagonal - 1] + 1;\r\n\t\t\t\t}\r\n\t\t\t\tmodifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;\r\n\r\n\t\t\t\t// Save the current originalIndex so we can test for false overlap in step 3\r\n\t\t\t\tconst tempOriginalIndex = originalIndex;\r\n\r\n\t\t\t\t// STEP 2: We can continue to extend the furthest reaching point in the present diagonal\r\n\t\t\t\t// so long as the elements are equal.\r\n\t\t\t\twhile (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {\r\n\t\t\t\t\toriginalIndex++;\r\n\t\t\t\t\tmodifiedIndex++;\r\n\t\t\t\t}\r\n\t\t\t\tforwardPoints[diagonal] = originalIndex;\r\n\r\n\t\t\t\tif (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {\r\n\t\t\t\t\tfurthestOriginalIndex = originalIndex;\r\n\t\t\t\t\tfurthestModifiedIndex = modifiedIndex;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// STEP 3: If delta is odd (overlap first happens on forward when delta is odd)\r\n\t\t\t\t// and diagonal is in the range of reverse diagonals computed for numDifferences-1\r\n\t\t\t\t// (the previous iteration; we haven't computed reverse diagonals for numDifferences yet)\r\n\t\t\t\t// then check for overlap.\r\n\t\t\t\tif (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) {\r\n\t\t\t\t\tif (originalIndex >= reversePoints[diagonal]) {\r\n\t\t\t\t\t\tmidOriginalArr[0] = originalIndex;\r\n\t\t\t\t\t\tmidModifiedArr[0] = modifiedIndex;\r\n\r\n\t\t\t\t\t\tif (tempOriginalIndex <= reversePoints[diagonal] && LocalConstants.MaxDifferencesHistory > 0 && numDifferences <= (LocalConstants.MaxDifferencesHistory + 1)) {\r\n\t\t\t\t\t\t\t// BINGO! We overlapped, and we have the full trace in memory!\r\n\t\t\t\t\t\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\r\n\t\t\t\t\t\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\r\n\t\t\t\t\t\t\t\tforwardPoints, reversePoints,\r\n\t\t\t\t\t\t\t\toriginalIndex, originalEnd, midOriginalArr,\r\n\t\t\t\t\t\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\r\n\t\t\t\t\t\t\t\tdeltaIsEven, quitEarlyArr\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Either false overlap, or we didn't have enough memory for the full trace\r\n\t\t\t\t\t\t\t// Just return the recursion point\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Check to see if we should be quitting early, before moving on to the next iteration.\r\n\t\t\tconst matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;\r\n\r\n\t\t\tif (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {\r\n\t\t\t\t// We can't finish, so skip ahead to generating a result from what we have.\r\n\t\t\t\tquitEarlyArr[0] = true;\r\n\r\n\t\t\t\t// Use the furthest distance we got in the forward direction.\r\n\t\t\t\tmidOriginalArr[0] = furthestOriginalIndex;\r\n\t\t\t\tmidModifiedArr[0] = furthestModifiedIndex;\r\n\r\n\t\t\t\tif (matchLengthOfLongest > 0 && LocalConstants.MaxDifferencesHistory > 0 && numDifferences <= (LocalConstants.MaxDifferencesHistory + 1)) {\r\n\t\t\t\t\t// Enough of the history is in memory to walk it backwards\r\n\t\t\t\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\r\n\t\t\t\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\r\n\t\t\t\t\t\tforwardPoints, reversePoints,\r\n\t\t\t\t\t\toriginalIndex, originalEnd, midOriginalArr,\r\n\t\t\t\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\r\n\t\t\t\t\t\tdeltaIsEven, quitEarlyArr\r\n\t\t\t\t\t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// We didn't actually remember enough of the history.\r\n\r\n\t\t\t\t\t//Since we are quiting the diff early, we need to shift back the originalStart and modified start\r\n\t\t\t\t\t//back into the boundary limits since we decremented their value above beyond the boundary limit.\r\n\t\t\t\t\toriginalStart++;\r\n\t\t\t\t\tmodifiedStart++;\r\n\r\n\t\t\t\t\treturn [\r\n\t\t\t\t\t\tnew DiffChange(originalStart, originalEnd - originalStart + 1,\r\n\t\t\t\t\t\t\tmodifiedStart, modifiedEnd - modifiedStart + 1)\r\n\t\t\t\t\t];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Run the algorithm in the reverse direction\r\n\t\t\tdiagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\r\n\t\t\tdiagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\r\n\t\t\tfor (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {\r\n\t\t\t\t// STEP 1: We extend the furthest reaching point in the present diagonal\r\n\t\t\t\t// by looking at the diagonals above and below and picking the one whose point\r\n\t\t\t\t// is further away from the start point (originalEnd, modifiedEnd)\r\n\t\t\t\tif (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\r\n\t\t\t\t\toriginalIndex = reversePoints[diagonal + 1] - 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\toriginalIndex = reversePoints[diagonal - 1];\r\n\t\t\t\t}\r\n\t\t\t\tmodifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;\r\n\r\n\t\t\t\t// Save the current originalIndex so we can test for false overlap\r\n\t\t\t\tconst tempOriginalIndex = originalIndex;\r\n\r\n\t\t\t\t// STEP 2: We can continue to extend the furthest reaching point in the present diagonal\r\n\t\t\t\t// as long as the elements are equal.\r\n\t\t\t\twhile (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {\r\n\t\t\t\t\toriginalIndex--;\r\n\t\t\t\t\tmodifiedIndex--;\r\n\t\t\t\t}\r\n\t\t\t\treversePoints[diagonal] = originalIndex;\r\n\r\n\t\t\t\t// STEP 4: If delta is even (overlap first happens on reverse when delta is even)\r\n\t\t\t\t// and diagonal is in the range of forward diagonals computed for numDifferences\r\n\t\t\t\t// then check for overlap.\r\n\t\t\t\tif (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {\r\n\t\t\t\t\tif (originalIndex <= forwardPoints[diagonal]) {\r\n\t\t\t\t\t\tmidOriginalArr[0] = originalIndex;\r\n\t\t\t\t\t\tmidModifiedArr[0] = modifiedIndex;\r\n\r\n\t\t\t\t\t\tif (tempOriginalIndex >= forwardPoints[diagonal] && LocalConstants.MaxDifferencesHistory > 0 && numDifferences <= (LocalConstants.MaxDifferencesHistory + 1)) {\r\n\t\t\t\t\t\t\t// BINGO! We overlapped, and we have the full trace in memory!\r\n\t\t\t\t\t\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\r\n\t\t\t\t\t\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\r\n\t\t\t\t\t\t\t\tforwardPoints, reversePoints,\r\n\t\t\t\t\t\t\t\toriginalIndex, originalEnd, midOriginalArr,\r\n\t\t\t\t\t\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\r\n\t\t\t\t\t\t\t\tdeltaIsEven, quitEarlyArr\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Either false overlap, or we didn't have enough memory for the full trace\r\n\t\t\t\t\t\t\t// Just return the recursion point\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Save current vectors to history before the next iteration\r\n\t\t\tif (numDifferences <= LocalConstants.MaxDifferencesHistory) {\r\n\t\t\t\t// We are allocating space for one extra int, which we fill with\r\n\t\t\t\t// the index of the diagonal base index\r\n\t\t\t\tlet temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2);\r\n\t\t\t\ttemp[0] = diagonalForwardBase - diagonalForwardStart + 1;\r\n\t\t\t\tMyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);\r\n\t\t\t\tthis.m_forwardHistory.push(temp);\r\n\r\n\t\t\t\ttemp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2);\r\n\t\t\t\ttemp[0] = diagonalReverseBase - diagonalReverseStart + 1;\r\n\t\t\t\tMyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);\r\n\t\t\t\tthis.m_reverseHistory.push(temp);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// If we got here, then we have the full trace in history. We just have to convert it to a change list\r\n\t\t// NOTE: This part is a bit messy\r\n\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\r\n\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\r\n\t\t\tforwardPoints, reversePoints,\r\n\t\t\toriginalIndex, originalEnd, midOriginalArr,\r\n\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\r\n\t\t\tdeltaIsEven, quitEarlyArr\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Shifts the given changes to provide a more intuitive diff.\r\n\t * While the first element in a diff matches the first element after the diff,\r\n\t * we shift the diff down.\r\n\t *\r\n\t * @param changes The list of changes to shift\r\n\t * @returns The shifted changes\r\n\t */\r\n\tprivate PrettifyChanges(changes: DiffChange[]): DiffChange[] {\r\n\r\n\t\t// Shift all the changes down first\r\n\t\tfor (let i = 0; i < changes.length; i++) {\r\n\t\t\tconst change = changes[i];\r\n\t\t\tconst originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length;\r\n\t\t\tconst modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length;\r\n\t\t\tconst checkOriginal = change.originalLength > 0;\r\n\t\t\tconst checkModified = change.modifiedLength > 0;\r\n\r\n\t\t\twhile (change.originalStart + change.originalLength < originalStop &&\r\n\t\t\t\tchange.modifiedStart + change.modifiedLength < modifiedStop &&\r\n\t\t\t\t(!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) &&\r\n\t\t\t\t(!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) {\r\n\t\t\t\tchange.originalStart++;\r\n\t\t\t\tchange.modifiedStart++;\r\n\t\t\t}\r\n\r\n\t\t\tlet mergedChangeArr: Array<DiffChange | null> = [null];\r\n\t\t\tif (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {\r\n\t\t\t\tchanges[i] = mergedChangeArr[0]!;\r\n\t\t\t\tchanges.splice(i + 1, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Shift changes back up until we hit empty or whitespace-only lines\r\n\t\tfor (let i = changes.length - 1; i >= 0; i--) {\r\n\t\t\tconst change = changes[i];\r\n\r\n\t\t\tlet originalStop = 0;\r\n\t\t\tlet modifiedStop = 0;\r\n\t\t\tif (i > 0) {\r\n\t\t\t\tconst prevChange = changes[i - 1];\r\n\t\t\t\tif (prevChange.originalLength > 0) {\r\n\t\t\t\t\toriginalStop = prevChange.originalStart + prevChange.originalLength;\r\n\t\t\t\t}\r\n\t\t\t\tif (prevChange.modifiedLength > 0) {\r\n\t\t\t\t\tmodifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst checkOriginal = change.originalLength > 0;\r\n\t\t\tconst checkModified = change.modifiedLength > 0;\r\n\r\n\t\t\tlet bestDelta = 0;\r\n\t\t\tlet bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);\r\n\r\n\t\t\tfor (let delta = 1; ; delta++) {\r\n\t\t\t\tconst originalStart = change.originalStart - delta;\r\n\t\t\t\tconst modifiedStart = change.modifiedStart - delta;\r\n\r\n\t\t\t\tif (originalStart < originalStop || modifiedStart < modifiedStop) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength);\r\n\r\n\t\t\t\tif (score > bestScore) {\r\n\t\t\t\t\tbestScore = score;\r\n\t\t\t\t\tbestDelta = delta;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tchange.originalStart -= bestDelta;\r\n\t\t\tchange.modifiedStart -= bestDelta;\r\n\t\t}\r\n\r\n\t\treturn changes;\r\n\t}\r\n\r\n\tprivate _OriginalIsBoundary(index: number): boolean {\r\n\t\tif (index <= 0 || index >= this._originalElementsOrHash.length - 1) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn (this._hasStrings && /^\\s*$/.test(this._originalStringElements[index]));\r\n\t}\r\n\r\n\tprivate _OriginalRegionIsBoundary(originalStart: number, originalLength: number): boolean {\r\n\t\tif (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (originalLength > 0) {\r\n\t\t\tconst originalEnd = originalStart + originalLength;\r\n\t\t\tif (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tprivate _ModifiedIsBoundary(index: number): boolean {\r\n\t\tif (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn (this._hasStrings && /^\\s*$/.test(this._modifiedStringElements[index]));\r\n\t}\r\n\r\n\tprivate _ModifiedRegionIsBoundary(modifiedStart: number, modifiedLength: number): boolean {\r\n\t\tif (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (modifiedLength > 0) {\r\n\t\t\tconst modifiedEnd = modifiedStart + modifiedLength;\r\n\t\t\tif (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tprivate _boundaryScore(originalStart: number, originalLength: number, modifiedStart: number, modifiedLength: number): number {\r\n\t\tconst originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0);\r\n\t\tconst modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0);\r\n\t\treturn (originalScore + modifiedScore);\r\n\t}\r\n\r\n\t/**\r\n\t * Concatenates the two input DiffChange lists and returns the resulting\r\n\t * list.\r\n\t * @param The left changes\r\n\t * @param The right changes\r\n\t * @returns The concatenated list\r\n\t */\r\n\tprivate ConcatenateChanges(left: DiffChange[], right: DiffChange[]): DiffChange[] {\r\n\t\tlet mergedChangeArr: DiffChange[] = [];\r\n\r\n\t\tif (left.length === 0 || right.length === 0) {\r\n\t\t\treturn (right.length > 0) ? right : left;\r\n\t\t} else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {\r\n\t\t\t// Since we break the problem down recursively, it is possible that we\r\n\t\t\t// might recurse in the middle of a change thereby splitting it into\r\n\t\t\t// two changes. Here in the combining stage, we detect and fuse those\r\n\t\t\t// changes back together\r\n\t\t\tconst result = new Array<DiffChange>(left.length + right.length - 1);\r\n\t\t\tMyArray.Copy(left, 0, result, 0, left.length - 1);\r\n\t\t\tresult[left.length - 1] = mergedChangeArr[0];\r\n\t\t\tMyArray.Copy(right, 1, result, left.length, right.length - 1);\r\n\r\n\t\t\treturn result;\r\n\t\t} else {\r\n\t\t\tconst result = new Array<DiffChange>(left.length + right.length);\r\n\t\t\tMyArray.Copy(left, 0, result, 0, left.length);\r\n\t\t\tMyArray.Copy(right, 0, result, left.length, right.length);\r\n\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns true if the two changes overlap and can be merged into a single\r\n\t * change\r\n\t * @param left The left change\r\n\t * @param right The right change\r\n\t * @param mergedChange The merged change if the two overlap, null otherwise\r\n\t * @returns True if the two changes overlap\r\n\t */\r\n\tprivate ChangesOverlap(left: DiffChange, right: DiffChange, mergedChangeArr: Array<DiffChange | null>): boolean {\r\n\t\tDebug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change');\r\n\t\tDebug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change');\r\n\r\n\t\tif (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\r\n\t\t\tconst originalStart = left.originalStart;\r\n\t\t\tlet originalLength = left.originalLength;\r\n\t\t\tconst modifiedStart = left.modifiedStart;\r\n\t\t\tlet modifiedLength = left.modifiedLength;\r\n\r\n\t\t\tif (left.originalStart + left.originalLength >= right.originalStart) {\r\n\t\t\t\toriginalLength = right.originalStart + right.originalLength - left.originalStart;\r\n\t\t\t}\r\n\t\t\tif (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\r\n\t\t\t\tmodifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;\r\n\t\t\t}\r\n\r\n\t\t\tmergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tmergedChangeArr[0] = null;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Helper method used to clip a diagonal index to the range of valid\r\n\t * diagonals. This also decides whether or not the diagonal index,\r\n\t * if it exceeds the boundary, should be clipped to the boundary or clipped\r\n\t * one inside the boundary depending on the Even/Odd status of the boundary\r\n\t * and numDifferences.\r\n\t * @param diagonal The index of the diagonal to clip.\r\n\t * @param numDifferences The current number of differences being iterated upon.\r\n\t * @param diagonalBaseIndex The base reference diagonal.\r\n\t * @param numDiagonals The total number of diagonals.\r\n\t * @returns The clipped diagonal index.\r\n\t */\r\n\tprivate ClipDiagonalBound(diagonal: number, numDifferences: number, diagonalBaseIndex: number, numDiagonals: number): number {\r\n\t\tif (diagonal >= 0 && diagonal < numDiagonals) {\r\n\t\t\t// Nothing to clip, its in range\r\n\t\t\treturn diagonal;\r\n\t\t}\r\n\r\n\t\t// diagonalsBelow: The number of diagonals below the reference diagonal\r\n\t\t// diagonalsAbove: The number of diagonals above the reference diagonal\r\n\t\tconst diagonalsBelow = diagonalBaseIndex;\r\n\t\tconst diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;\r\n\t\tconst diffEven = (numDifferences % 2 === 0);\r\n\r\n\t\tif (diagonal < 0) {\r\n\t\t\tconst lowerBoundEven = (diagonalsBelow % 2 === 0);\r\n\t\t\treturn (diffEven === lowerBoundEven) ? 0 : 1;\r\n\t\t} else {\r\n\t\t\tconst upperBoundEven = (diagonalsAbove % 2 === 0);\r\n\t\t\treturn (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2;\r\n\t\t}\r\n\t}\r\n}\r\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\r\nexport interface IteratorDefinedResult<T> {\r\n\treadonly done: false;\r\n\treadonly value: T;\r\n}\r\nexport interface IteratorUndefinedResult {\r\n\treadonly done: true;\r\n\treadonly value: undefined;\r\n}\r\nexport const FIN: IteratorUndefinedResult = { done: true, value: undefined };\r\nexport type IteratorResult<T> = IteratorDefinedResult<T> | IteratorUndefinedResult;\r\n\r\nexport interface Iterator<T> {\r\n\tnext(): IteratorResult<T>;\r\n}\r\n\r\ninterface NativeIteratorYieldResult<TYield> {\r\n\tdone?: false;\r\n\tvalue: TYield;\r\n}\r\n\r\ninterface NativeIteratorReturnResult<TReturn> {\r\n\tdone: true;\r\n}\r\n\r\ntype NativeIteratorResult<T, TReturn = any> = NativeIteratorYieldResult<T> | NativeIteratorReturnResult<TReturn>;\r\n\r\nexport interface NativeIterator<T> {\r\n\tnext(): NativeIteratorResult<T>;\r\n}\r\n\r\nexport module Iterator {\r\n\tconst _empty: Iterator<any> = {\r\n\t\tnext() {\r\n\t\t\treturn FIN;\r\n\t\t}\r\n\t};\r\n\r\n\texport function empty<T>(): Iterator<T> {\r\n\t\treturn _empty;\r\n\t}\r\n\r\n\texport function single<T>(value: T): Iterator<T> {\r\n\t\tlet done = false;\r\n\r\n\t\treturn {\r\n\t\t\tnext(): IteratorResult<T> {\r\n\t\t\t\tif (done) {\r\n\t\t\t\t\treturn FIN;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdone = true;\r\n\t\t\t\treturn { done: false, value };\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\texport function fromArray<T>(array: ReadonlyArray<T>, index = 0, length = array.length): Iterator<T> {\r\n\t\treturn {\r\n\t\t\tnext(): IteratorResult<T> {\r\n\t\t\t\tif (index >= length) {\r\n\t\t\t\t\treturn FIN;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn { done: false, value: array[index++] };\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\texport function fromNativeIterator<T>(it: NativeIterator<T>): Iterator<T> {\r\n\t\treturn {\r\n\t\t\tnext(): IteratorResult<T> {\r\n\t\t\t\tconst result = it.next();\r\n\r\n\t\t\t\tif (result.done) {\r\n\t\t\t\t\treturn FIN;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn { done: false, value: result.value };\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\texport function from<T>(elements: Iterator<T> | T[] | undefined): Iterator<T> {\r\n\t\tif (!elements) {\r\n\t\t\treturn Iterator.empty();\r\n\t\t} else if (Array.isArray(elements)) {\r\n\t\t\treturn Iterator.fromArray(elements);\r\n\t\t} else {\r\n\t\t\treturn elements;\r\n\t\t}\r\n\t}\r\n\r\n\texport function map<T, R>(iterator: Iterator<T>, fn: (t: T) => R): Iterator<R> {\r\n\t\treturn {\r\n\t\t\tnext() {\r\n\t\t\t\tconst element = iterator.next();\r\n\t\t\t\tif (element.done) {\r\n\t\t\t\t\treturn FIN;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn { done: false, value: fn(element.value) };\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\texport function filter<T>(iterator: Iterator<T>, fn: (t: T) => boolean): Iterator<T> {\r\n\t\treturn {\r\n\t\t\tnext() {\r\n\t\t\t\twhile (true) {\r\n\t\t\t\t\tconst element = iterator.next();\r\n\t\t\t\t\tif (element.done) {\r\n\t\t\t\t\t\treturn FIN;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (fn(element.value)) {\r\n\t\t\t\t\t\treturn { done: false, value: element.value };\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\texport function forEach<T>(iterator: Iterator<T>, fn: (t: T) => void): void {\r\n\t\tfor (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n\t\t\tfn(next.value);\r\n\t\t}\r\n\t}\r\n\r\n\texport function collect<T>(iterator: Iterator<T>, atMost: number = Number.POSITIVE_INFINITY): T[] {\r\n\t\tconst result: T[] = [];\r\n\r\n\t\tif (atMost === 0) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\tlet i = 0;\r\n\r\n\t\tfor (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n\t\t\tresult.push(next.value);\r\n\r\n\t\t\tif (++i >= atMost) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\texport function concat<T>(...iterators: Iterator<T>[]): Iterator<T> {\r\n\t\tlet i = 0;\r\n\r\n\t\treturn {\r\n\t\t\tnext() {\r\n\t\t\t\tif (i >= iterators.length) {\r\n\t\t\t\t\treturn FIN;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst iterator = iterators[i];\r\n\t\t\t\tconst result = iterator.next();\r\n\r\n\t\t\t\tif (result.done) {\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\treturn this.next();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\texport function chain<T>(iterator: Iterator<T>): ChainableIterator<T> {\r\n\t\treturn new ChainableIterator(iterator);\r\n\t}\r\n}\r\n\r\nexport class ChainableIterator<T> implements Iterator<T> {\r\n\r\n\tconstructor(private it: Iterator<T>) { }\r\n\r\n\tnext(): IteratorResult<T> { return this.it.next(); }\r\n}\r\n\r\nexport type ISequence<T> = Iterator<T> | T[];\r\n\r\nexport function getSequenceIterator<T>(arg: ISequence<T> | undefined): Iterator<T> {\r\n\tif (Array.isArray(arg)) {\r\n\t\treturn Iterator.fromArray(arg);\r\n\t} else if (!arg) {\r\n\t\treturn Iterator.empty();\r\n\t} else {\r\n\t\treturn arg;\r\n\t}\r\n}\r\n\r\nexport interface INextIterator<T> {\r\n\tnext(): T | null;\r\n}\r\n\r\nexport class ArrayIterator<T> implements INextIterator<T> {\r\n\r\n\tprivate readonly items: readonly T[];\r\n\tprotected start: number;\r\n\tprotected end: number;\r\n\tprotected index: number;\r\n\r\n\tconstructor(items: readonly T[], start: number = 0, end: number = items.length, index = start - 1) {\r\n\t\tthis.items = items;\r\n\t\tthis.start = start;\r\n\t\tthis.end = end;\r\n\t\tthis.index = index;\r\n\t}\r\n\r\n\tpublic first(): T | null {\r\n\t\tthis.index = this.start;\r\n\t\treturn this.current();\r\n\t}\r\n\r\n\tpublic next(): T | null {\r\n\t\tthis.index = Math.min(this.index + 1, this.end);\r\n\t\treturn this.current();\r\n\t}\r\n\r\n\tprotected current(): T | null {\r\n\t\tif (this.index === this.start - 1 || this.index === this.end) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn this.items[this.index];\r\n\t}\r\n}\r\n\r\nexport class ArrayNavigator<T> extends ArrayIterator<T> implements INavigator<T> {\r\n\r\n\tconstructor(items: readonly T[], start: number = 0, end: number = items.length, index = start - 1) {\r\n\t\tsuper(items, start, end, index);\r\n\t}\r\n\r\n\tpublic current(): T | null {\r\n\t\treturn super.current();\r\n\t}\r\n\r\n\tpublic previous(): T | null {\r\n\t\tthis.index = Math.max(this.index - 1, this.start - 1);\r\n\t\treturn this.current();\r\n\t}\r\n\r\n\tpublic first(): T | null {\r\n\t\tthis.index = this.start;\r\n\t\treturn this.current();\r\n\t}\r\n\r\n\tpublic last(): T | null {\r\n\t\tthis.index = this.end - 1;\r\n\t\treturn this.current();\r\n\t}\r\n\r\n\tpublic parent(): T | null {\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nexport class MappedIterator<T, R> implements INextIterator<R> {\r\n\r\n\tconstructor(protected iterator: INextIterator<T>, protected fn: (item: T | null) => R) {\r\n\t\t// noop\r\n\t}\r\n\r\n\tnext() { return this.fn(this.iterator.next()); }\r\n}\r\n\r\nexport interface INavigator<T> extends INextIterator<T> {\r\n\tprevious(): T | null;\r\n\tparent(): T | null;\r\n\tfirst(): T | null;\r\n\tlast(): T | null;\r\n\tnext(): T | null;\r\n}\r\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\r\nimport { OperatingSystem } from 'vs/base/common/platform';\r\nimport { illegalArgument } from 'vs/base/common/errors';\r\n\r\n/**\r\n * Virtual Key Codes, the value does not hold any inherent meaning.\r\n * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\r\n * But these are \"more general\", as they should work across browsers & OS`s.\r\n */\r\nexport const enum KeyCode {\r\n\t/**\r\n\t * Placed first to cover the 0 value of the enum.\r\n\t */\r\n\tUnknown = 0,\r\n\r\n\tBackspace = 1,\r\n\tTab = 2,\r\n\tEnter = 3,\r\n\tShift = 4,\r\n\tCtrl = 5,\r\n\tAlt = 6,\r\n\tPauseBreak = 7,\r\n\tCapsLock = 8,\r\n\tEscape = 9,\r\n\tSpace = 10,\r\n\tPageUp = 11,\r\n\tPageDown = 12,\r\n\tEnd = 13,\r\n\tHome = 14,\r\n\tLeftArrow = 15,\r\n\tUpArrow = 16,\r\n\tRightArrow = 17,\r\n\tDownArrow = 18,\r\n\tInsert = 19,\r\n\tDelete = 20,\r\n\r\n\tKEY_0 = 21,\r\n\tKEY_1 = 22,\r\n\tKEY_2 = 23,\r\n\tKEY_3 = 24,\r\n\tKEY_4 = 25,\r\n\tKEY_5 = 26,\r\n\tKEY_6 = 27,\r\n\tKEY_7 = 28,\r\n\tKEY_8 = 29,\r\n\tKEY_9 = 30,\r\n\r\n\tKEY_A = 31,\r\n\tKEY_B = 32,\r\n\tKEY_C = 33,\r\n\tKEY_D = 34,\r\n\tKEY_E = 35,\r\n\tKEY_F = 36,\r\n\tKEY_G = 37,\r\n\tKEY_H = 38,\r\n\tKEY_I = 39,\r\n\tKEY_J = 40,\r\n\tKEY_K = 41,\r\n\tKEY_L = 42,\r\n\tKEY_M = 43,\r\n\tKEY_N = 44,\r\n\tKEY_O = 45,\r\n\tKEY_P = 46,\r\n\tKEY_Q = 47,\r\n\tKEY_R = 48,\r\n\tKEY_S = 49,\r\n\tKEY_T = 50,\r\n\tKEY_U = 51,\r\n\tKEY_V = 52,\r\n\tKEY_W = 53,\r\n\tKEY_X = 54,\r\n\tKEY_Y = 55,\r\n\tKEY_Z = 56,\r\n\r\n\tMeta = 57,\r\n\tContextMenu = 58,\r\n\r\n\tF1 = 59,\r\n\tF2 = 60,\r\n\tF3 = 61,\r\n\tF4 = 62,\r\n\tF5 = 63,\r\n\tF6 = 64,\r\n\tF7 = 65,\r\n\tF8 = 66,\r\n\tF9 = 67,\r\n\tF10 = 68,\r\n\tF11 = 69,\r\n\tF12 = 70,\r\n\tF13 = 71,\r\n\tF14 = 72,\r\n\tF15 = 73,\r\n\tF16 = 74,\r\n\tF17 = 75,\r\n\tF18 = 76,\r\n\tF19 = 77,\r\n\r\n\tNumLock = 78,\r\n\tScrollLock = 79,\r\n\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the ';:' key\r\n\t */\r\n\tUS_SEMICOLON = 80,\r\n\t/**\r\n\t * For any country/region, the '+' key\r\n\t * For the US standard keyboard, the '=+' key\r\n\t */\r\n\tUS_EQUAL = 81,\r\n\t/**\r\n\t * For any country/region, the ',' key\r\n\t * For the US standard keyboard, the ',<' key\r\n\t */\r\n\tUS_COMMA = 82,\r\n\t/**\r\n\t * For any country/region, the '-' key\r\n\t * For the US standard keyboard, the '-_' key\r\n\t */\r\n\tUS_MINUS = 83,\r\n\t/**\r\n\t * For any country/region, the '.' key\r\n\t * For the US standard keyboard, the '.>' key\r\n\t */\r\n\tUS_DOT = 84,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the '/?' key\r\n\t */\r\n\tUS_SLASH = 85,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the '`~' key\r\n\t */\r\n\tUS_BACKTICK = 86,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the '[{' key\r\n\t */\r\n\tUS_OPEN_SQUARE_BRACKET = 87,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the '\\|' key\r\n\t */\r\n\tUS_BACKSLASH = 88,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the ']}' key\r\n\t */\r\n\tUS_CLOSE_SQUARE_BRACKET = 89,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the ''\"' key\r\n\t */\r\n\tUS_QUOTE = 90,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t */\r\n\tOEM_8 = 91,\r\n\t/**\r\n\t * Either the angle bracket key or the backslash key on the RT 102-key keyboard.\r\n\t */\r\n\tOEM_102 = 92,\r\n\r\n\tNUMPAD_0 = 93, // VK_NUMPAD0, 0x60, Numeric keypad 0 key\r\n\tNUMPAD_1 = 94, // VK_NUMPAD1, 0x61, Numeric keypad 1 key\r\n\tNUMPAD_2 = 95, // VK_NUMPAD2, 0x62, Numeric keypad 2 key\r\n\tNUMPAD_3 = 96, // VK_NUMPAD3, 0x63, Numeric keypad 3 key\r\n\tNUMPAD_4 = 97, // VK_NUMPAD4, 0x64, Numeric keypad 4 key\r\n\tNUMPAD_5 = 98, // VK_NUMPAD5, 0x65, Numeric keypad 5 key\r\n\tNUMPAD_6 = 99, // VK_NUMPAD6, 0x66, Numeric keypad 6 key\r\n\tNUMPAD_7 = 100, // VK_NUMPAD7, 0x67, Numeric keypad 7 key\r\n\tNUMPAD_8 = 101, // VK_NUMPAD8, 0x68, Numeric keypad 8 key\r\n\tNUMPAD_9 = 102, // VK_NUMPAD9, 0x69, Numeric keypad 9 key\r\n\r\n\tNUMPAD_MULTIPLY = 103,\t// VK_MULTIPLY, 0x6A, Multiply key\r\n\tNUMPAD_ADD = 104,\t\t// VK_ADD, 0x6B, Add key\r\n\tNUMPAD_SEPARATOR = 105,\t// VK_SEPARATOR, 0x6C, Separator key\r\n\tNUMPAD_SUBTRACT = 106,\t// VK_SUBTRACT, 0x6D, Subtract key\r\n\tNUMPAD_DECIMAL = 107,\t// VK_DECIMAL, 0x6E, Decimal key\r\n\tNUMPAD_DIVIDE = 108,\t// VK_DIVIDE, 0x6F,\r\n\r\n\t/**\r\n\t * Cover all key codes when IME is processing input.\r\n\t */\r\n\tKEY_IN_COMPOSITION = 109,\r\n\r\n\tABNT_C1 = 110, // Brazilian (ABNT) Keyboard\r\n\tABNT_C2 = 111, // Brazilian (ABNT) Keyboard\r\n\r\n\t/**\r\n\t * Placed last to cover the length of the enum.\r\n\t * Please do not depend on this value!\r\n\t */\r\n\tMAX_VALUE\r\n}\r\n\r\nclass KeyCodeStrMap {\r\n\r\n\tprivate _keyCodeToStr: string[];\r\n\tprivate _strToKeyCode: { [str: string]: KeyCode; };\r\n\r\n\tconstructor() {\r\n\t\tthis._keyCodeToStr = [];\r\n\t\tthis._strToKeyCode = Object.create(null);\r\n\t}\r\n\r\n\tdefine(keyCode: KeyCode, str: string): void {\r\n\t\tthis._keyCodeToStr[keyCode] = str;\r\n\t\tthis._strToKeyCode[str.toLowerCase()] = keyCode;\r\n\t}\r\n\r\n\tkeyCodeToStr(keyCode: KeyCode): string {\r\n\t\treturn this._keyCodeToStr[keyCode];\r\n\t}\r\n\r\n\tstrToKeyCode(str: string): KeyCode {\r\n\t\treturn this._strToKeyCode[str.toLowerCase()] || KeyCode.Unknown;\r\n\t}\r\n}\r\n\r\nconst uiMap = new KeyCodeStrMap();\r\nconst userSettingsUSMap = new KeyCodeStrMap();\r\nconst userSettingsGeneralMap = new KeyCodeStrMap();\r\n\r\n(function () {\r\n\r\n\tfunction define(keyCode: KeyCode, uiLabel: string, usUserSettingsLabel: string = uiLabel, generalUserSettingsLabel: string = usUserSettingsLabel): void {\r\n\t\tuiMap.define(keyCode, uiLabel);\r\n\t\tuserSettingsUSMap.define(keyCode, usUserSettingsLabel);\r\n\t\tuserSettingsGeneralMap.define(keyCode, generalUserSettingsLabel);\r\n\t}\r\n\r\n\tdefine(KeyCode.Unknown, 'unknown');\r\n\r\n\tdefine(KeyCode.Backspace, 'Backspace');\r\n\tdefine(KeyCode.Tab, 'Tab');\r\n\tdefine(KeyCode.Enter, 'Enter');\r\n\tdefine(KeyCode.Shift, 'Shift');\r\n\tdefine(KeyCode.Ctrl, 'Ctrl');\r\n\tdefine(KeyCode.Alt, 'Alt');\r\n\tdefine(KeyCode.PauseBreak, 'PauseBreak');\r\n\tdefine(KeyCode.CapsLock, 'CapsLock');\r\n\tdefine(KeyCode.Escape, 'Escape');\r\n\tdefine(KeyCode.Space, 'Space');\r\n\tdefine(KeyCode.PageUp, 'PageUp');\r\n\tdefine(KeyCode.PageDown, 'PageDown');\r\n\tdefine(KeyCode.End, 'End');\r\n\tdefine(KeyCode.Home, 'Home');\r\n\r\n\tdefine(KeyCode.LeftArrow, 'LeftArrow', 'Left');\r\n\tdefine(KeyCode.UpArrow, 'UpArrow', 'Up');\r\n\tdefine(KeyCode.RightArrow, 'RightArrow', 'Right');\r\n\tdefine(KeyCode.DownArrow, 'DownArrow', 'Down');\r\n\tdefine(KeyCode.Insert, 'Insert');\r\n\tdefine(KeyCode.Delete, 'Delete');\r\n\r\n\tdefine(KeyCode.KEY_0, '0');\r\n\tdefine(KeyCode.KEY_1, '1');\r\n\tdefine(KeyCode.KEY_2, '2');\r\n\tdefine(KeyCode.KEY_3, '3');\r\n\tdefine(KeyCode.KEY_4, '4');\r\n\tdefine(KeyCode.KEY_5, '5');\r\n\tdefine(KeyCode.KEY_6, '6');\r\n\tdefine(KeyCode.KEY_7, '7');\r\n\tdefine(KeyCode.KEY_8, '8');\r\n\tdefine(KeyCode.KEY_9, '9');\r\n\r\n\tdefine(KeyCode.KEY_A, 'A');\r\n\tdefine(KeyCode.KEY_B, 'B');\r\n\tdefine(KeyCode.KEY_C, 'C');\r\n\tdefine(KeyCode.KEY_D, 'D');\r\n\tdefine(KeyCode.KEY_E, 'E');\r\n\tdefine(KeyCode.KEY_F, 'F');\r\n\tdefine(KeyCode.KEY_G, 'G');\r\n\tdefine(KeyCode.KEY_H, 'H');\r\n\tdefine(KeyCode.KEY_I, 'I');\r\n\tdefine(KeyCode.KEY_J, 'J');\r\n\tdefine(KeyCode.KEY_K, 'K');\r\n\tdefine(KeyCode.KEY_L, 'L');\r\n\tdefine(KeyCode.KEY_M, 'M');\r\n\tdefine(KeyCode.KEY_N, 'N');\r\n\tdefine(KeyCode.KEY_O, 'O');\r\n\tdefine(KeyCode.KEY_P, 'P');\r\n\tdefine(KeyCode.KEY_Q, 'Q');\r\n\tdefine(KeyCode.KEY_R, 'R');\r\n\tdefine(KeyCode.KEY_S, 'S');\r\n\tdefine(KeyCode.KEY_T, 'T');\r\n\tdefine(KeyCode.KEY_U, 'U');\r\n\tdefine(KeyCode.KEY_V, 'V');\r\n\tdefine(KeyCode.KEY_W, 'W');\r\n\tdefine(KeyCode.KEY_X, 'X');\r\n\tdefine(KeyCode.KEY_Y, 'Y');\r\n\tdefine(KeyCode.KEY_Z, 'Z');\r\n\r\n\tdefine(KeyCode.Meta, 'Meta');\r\n\tdefine(KeyCode.ContextMenu, 'ContextMenu');\r\n\r\n\tdefine(KeyCode.F1, 'F1');\r\n\tdefine(KeyCode.F2, 'F2');\r\n\tdefine(KeyCode.F3, 'F3');\r\n\tdefine(KeyCode.F4, 'F4');\r\n\tdefine(KeyCode.F5, 'F5');\r\n\tdefine(KeyCode.F6, 'F6');\r\n\tdefine(KeyCode.F7, 'F7');\r\n\tdefine(KeyCode.F8, 'F8');\r\n\tdefine(KeyCode.F9, 'F9');\r\n\tdefine(KeyCode.F10, 'F10');\r\n\tdefine(KeyCode.F11, 'F11');\r\n\tdefine(KeyCode.F12, 'F12');\r\n\tdefine(KeyCode.F13, 'F13');\r\n\tdefine(KeyCode.F14, 'F14');\r\n\tdefine(KeyCode.F15, 'F15');\r\n\tdefine(KeyCode.F16, 'F16');\r\n\tdefine(KeyCode.F17, 'F17');\r\n\tdefine(KeyCode.F18, 'F18');\r\n\tdefine(KeyCode.F19, 'F19');\r\n\r\n\tdefine(KeyCode.NumLock, 'NumLock');\r\n\tdefine(KeyCode.ScrollLock, 'ScrollLock');\r\n\r\n\tdefine(KeyCode.US_SEMICOLON, ';', ';', 'OEM_1');\r\n\tdefine(KeyCode.US_EQUAL, '=', '=', 'OEM_PLUS');\r\n\tdefine(KeyCode.US_COMMA, ',', ',', 'OEM_COMMA');\r\n\tdefine(KeyCode.US_MINUS, '-', '-', 'OEM_MINUS');\r\n\tdefine(KeyCode.US_DOT, '.', '.', 'OEM_PERIOD');\r\n\tdefine(KeyCode.US_SLASH, '/', '/', 'OEM_2');\r\n\tdefine(KeyCode.US_BACKTICK, '`', '`', 'OEM_3');\r\n\tdefine(KeyCode.ABNT_C1, 'ABNT_C1');\r\n\tdefine(KeyCode.ABNT_C2, 'ABNT_C2');\r\n\tdefine(KeyCode.US_OPEN_SQUARE_BRACKET, '[', '[', 'OEM_4');\r\n\tdefine(KeyCode.US_BACKSLASH, '\\\\', '\\\\', 'OEM_5');\r\n\tdefine(KeyCode.US_CLOSE_SQUARE_BRACKET, ']', ']', 'OEM_6');\r\n\tdefine(KeyCode.US_QUOTE, '\\'', '\\'', 'OEM_7');\r\n\tdefine(KeyCode.OEM_8, 'OEM_8');\r\n\tdefine(KeyCode.OEM_102, 'OEM_102');\r\n\r\n\tdefine(KeyCode.NUMPAD_0, 'NumPad0');\r\n\tdefine(KeyCode.NUMPAD_1, 'NumPad1');\r\n\tdefine(KeyCode.NUMPAD_2, 'NumPad2');\r\n\tdefine(KeyCode.NUMPAD_3, 'NumPad3');\r\n\tdefine(KeyCode.NUMPAD_4, 'NumPad4');\r\n\tdefine(KeyCode.NUMPAD_5, 'NumPad5');\r\n\tdefine(KeyCode.NUMPAD_6, 'NumPad6');\r\n\tdefine(KeyCode.NUMPAD_7, 'NumPad7');\r\n\tdefine(KeyCode.NUMPAD_8, 'NumPad8');\r\n\tdefine(KeyCode.NUMPAD_9, 'NumPad9');\r\n\r\n\tdefine(KeyCode.NUMPAD_MULTIPLY, 'NumPad_Multiply');\r\n\tdefine(KeyCode.NUMPAD_ADD, 'NumPad_Add');\r\n\tdefine(KeyCode.NUMPAD_SEPARATOR, 'NumPad_Separator');\r\n\tdefine(KeyCode.NUMPAD_SUBTRACT, 'NumPad_Subtract');\r\n\tdefine(KeyCode.NUMPAD_DECIMAL, 'NumPad_Decimal');\r\n\tdefine(KeyCode.NUMPAD_DIVIDE, 'NumPad_Divide');\r\n\r\n})();\r\n\r\nexport namespace KeyCodeUtils {\r\n\texport function toString(keyCode: KeyCode): string {\r\n\t\treturn uiMap.keyCodeToStr(keyCode);\r\n\t}\r\n\texport function fromString(key: string): KeyCode {\r\n\t\treturn uiMap.strToKeyCode(key);\r\n\t}\r\n\r\n\texport function toUserSettingsUS(keyCode: KeyCode): string {\r\n\t\treturn userSettingsUSMap.keyCodeToStr(keyCode);\r\n\t}\r\n\texport function toUserSettingsGeneral(keyCode: KeyCode): string {\r\n\t\treturn userSettingsGeneralMap.keyCodeToStr(keyCode);\r\n\t}\r\n\texport function fromUserSettings(key: string): KeyCode {\r\n\t\treturn userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);\r\n\t}\r\n}\r\n\r\n/**\r\n * Binary encoding strategy:\r\n * ```\r\n * 1111 11\r\n * 5432 1098 7654 3210\r\n * ---- CSAW KKKK KKKK\r\n * C = bit 11 = ctrlCmd flag\r\n * S = bit 10 = shift flag\r\n * A = bit 9 = alt flag\r\n * W = bit 8 = winCtrl flag\r\n * K = bits 0-7 = key code\r\n * ```\r\n */\r\nconst enum BinaryKeybindingsMask {\r\n\tCtrlCmd = (1 << 11) >>> 0,\r\n\tShift = (1 << 10) >>> 0,\r\n\tAlt = (1 << 9) >>> 0,\r\n\tWinCtrl = (1 << 8) >>> 0,\r\n\tKeyCode = 0x000000FF\r\n}\r\n\r\nexport const enum KeyMod {\r\n\tCtrlCmd = (1 << 11) >>> 0,\r\n\tShift = (1 << 10) >>> 0,\r\n\tAlt = (1 << 9) >>> 0,\r\n\tWinCtrl = (1 << 8) >>> 0,\r\n}\r\n\r\nexport function KeyChord(firstPart: number, secondPart: number): number {\r\n\tconst chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0;\r\n\treturn (firstPart | chordPart) >>> 0;\r\n}\r\n\r\nexport function createKeybinding(keybinding: number, OS: OperatingSystem): Keybinding | null {\r\n\tif (keybinding === 0) {\r\n\t\treturn null;\r\n\t}\r\n\tconst firstPart = (keybinding & 0x0000FFFF) >>> 0;\r\n\tconst chordPart = (keybinding & 0xFFFF0000) >>> 16;\r\n\tif (chordPart !== 0) {\r\n\t\treturn new ChordKeybinding([\r\n\t\t\tcreateSimpleKeybinding(firstPart, OS),\r\n\t\t\tcreateSimpleKeybinding(chordPart, OS)\r\n\t\t]);\r\n\t}\r\n\treturn new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]);\r\n}\r\n\r\nexport function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): SimpleKeybinding {\r\n\r\n\tconst ctrlCmd = (keybinding & BinaryKeybindingsMask.CtrlCmd ? true : false);\r\n\tconst winCtrl = (keybinding & BinaryKeybindingsMask.WinCtrl ? true : false);\r\n\r\n\tconst ctrlKey = (OS === OperatingSystem.Macintosh ? winCtrl : ctrlCmd);\r\n\tconst shiftKey = (keybinding & BinaryKeybindingsMask.Shift ? true : false);\r\n\tconst altKey = (keybinding & BinaryKeybindingsMask.Alt ? true : false);\r\n\tconst metaKey = (OS === OperatingSystem.Macintosh ? ctrlCmd : winCtrl);\r\n\tconst keyCode = (keybinding & BinaryKeybindingsMask.KeyCode);\r\n\r\n\treturn new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode);\r\n}\r\n\r\nexport class SimpleKeybinding {\r\n\tpublic readonly ctrlKey: boolean;\r\n\tpublic readonly shiftKey: boolean;\r\n\tpublic readonly altKey: boolean;\r\n\tpublic readonly metaKey: boolean;\r\n\tpublic readonly keyCode: KeyCode;\r\n\r\n\tconstructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, keyCode: KeyCode) {\r\n\t\tthis.ctrlKey = ctrlKey;\r\n\t\tthis.shiftKey = shiftKey;\r\n\t\tthis.altKey = altKey;\r\n\t\tthis.metaKey = metaKey;\r\n\t\tthis.keyCode = keyCode;\r\n\t}\r\n\r\n\tpublic equals(other: SimpleKeybinding): boolean {\r\n\t\treturn (\r\n\t\t\tthis.ctrlKey === other.ctrlKey\r\n\t\t\t&& this.shiftKey === other.shiftKey\r\n\t\t\t&& this.altKey === other.altKey\r\n\t\t\t&& this.metaKey === other.metaKey\r\n\t\t\t&& this.keyCode === other.keyCode\r\n\t\t);\r\n\t}\r\n\r\n\tpublic isModifierKey(): boolean {\r\n\t\treturn (\r\n\t\t\tthis.keyCode === KeyCode.Unknown\r\n\t\t\t|| this.keyCode === KeyCode.Ctrl\r\n\t\t\t|| this.keyCode === KeyCode.Meta\r\n\t\t\t|| this.keyCode === KeyCode.Alt\r\n\t\t\t|| this.keyCode === KeyCode.Shift\r\n\t\t);\r\n\t}\r\n\r\n\tpublic toChord(): ChordKeybinding {\r\n\t\treturn new ChordKeybinding([this]);\r\n\t}\r\n\r\n\t/**\r\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\r\n\t */\r\n\tpublic isDuplicateModifierCase(): boolean {\r\n\t\treturn (\r\n\t\t\t(this.ctrlKey && this.keyCode === KeyCode.Ctrl)\r\n\t\t\t|| (this.shiftKey && this.keyCode === KeyCode.Shift)\r\n\t\t\t|| (this.altKey && this.keyCode === KeyCode.Alt)\r\n\t\t\t|| (this.metaKey && this.keyCode === KeyCode.Meta)\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport class ChordKeybinding {\r\n\tpublic readonly parts: SimpleKeybinding[];\r\n\r\n\tconstructor(parts: SimpleKeybinding[]) {\r\n\t\tif (parts.length === 0) {\r\n\t\t\tthrow illegalArgument(`parts`);\r\n\t\t}\r\n\t\tthis.parts = parts;\r\n\t}\r\n\r\n\tpublic equals(other: ChordKeybinding | null): boolean {\r\n\t\tif (other === null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (this.parts.length !== other.parts.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor (let i = 0; i < this.parts.length; i++) {\r\n\t\t\tif (!this.parts[i].equals(other.parts[i])) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n}\r\n\r\nexport type Keybinding = ChordKeybinding;\r\n\r\nexport class ResolvedKeybindingPart {\r\n\treadonly ctrlKey: boolean;\r\n\treadonly shiftKey: boolean;\r\n\treadonly altKey: boolean;\r\n\treadonly metaKey: boolean;\r\n\r\n\treadonly keyLabel: string | null;\r\n\treadonly keyAriaLabel: string | null;\r\n\r\n\tconstructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, kbLabel: string | null, kbAriaLabel: string | null) {\r\n\t\tthis.ctrlKey = ctrlKey;\r\n\t\tthis.shiftKey = shiftKey;\r\n\t\tthis.altKey = altKey;\r\n\t\tthis.metaKey = metaKey;\r\n\t\tthis.keyLabel = kbLabel;\r\n\t\tthis.keyAriaLabel = kbAriaLabel;\r\n\t}\r\n}\r\n\r\n/**\r\n * A resolved keybinding. Can be a simple keybinding or a chord keybinding.\r\n */\r\nexport abstract class ResolvedKeybinding {\r\n\t/**\r\n\t * This prints the binding in a format suitable for displaying in the UI.\r\n\t */\r\n\tpublic abstract getLabel(): string | null;\r\n\t/**\r\n\t * This prints the binding in a format suitable for ARIA.\r\n\t */\r\n\tpublic abstract getAriaLabel(): string | null;\r\n\r\n\t/**\r\n\t * Is the binding a chord?\r\n\t */\r\n\tpublic abstract isChord(): boolean;\r\n\r\n\t/**\r\n\t * Returns the parts that comprise of the keybinding.\r\n\t * Simple keybindings return one element.\r\n\t */\r\n\tpublic abstract getParts(): ResolvedKeybindingPart[];\r\n\r\n\t/**\r\n\t * Returns the parts that should be used for dispatching.\r\n\t */\r\n\tpublic abstract getDispatchParts(): (string | null)[];\r\n}\r\n","\r\n\r\n/**\r\n * Enables logging of potentially leaked disposables.\r\n *\r\n * A disposable is considered leaked if it is not disposed or not registered as the child of\r\n * another disposable. This tracking is very simple an only works for classes that either\r\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\r\n */\r\nconst TRACK_DISPOSABLES = false;\r\n\r\nconst __is_disposable_tracked__ = '__is_disposable_tracked__';\r\n\r\nfunction markTracked<T extends IDisposable>(x: T): void {\r\n\tif (!TRACK_DISPOSABLES) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (x && x !== Disposable.None) {\r\n\t\ttry {\r\n\t\t\t(x as any)[__is_disposable_tracked__] = true;\r\n\t\t} catch {\r\n\t\t\t// noop\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction trackDisposable<T extends IDisposable>(x: T): T {\r\n\tif (!TRACK_DISPOSABLES) {\r\n\t\treturn x;\r\n\t}\r\n\r\n\tconst stack = new Error('Potentially leaked disposable').stack!;\r\n\tsetTimeout(() => {\r\n\t\tif (!(x as any)[__is_disposable_tracked__]) {\r\n\t\t\tconsole.log(stack);\r\n\t\t}\r\n\t}, 3000);\r\n\treturn x;\r\n}\r\n\r\nexport interface IDisposable {\r\n\tdispose(): void;\r\n}\r\n\r\nexport function isDisposable<E extends object>(thing: E): thing is E & IDisposable {\r\n\treturn typeof (<IDisposable><any>thing).dispose === 'function'\r\n\t\t&& (<IDisposable><any>thing).dispose.length === 0;\r\n}\r\n\r\nexport function dispose<T extends IDisposable>(disposable: T): T;\r\nexport function dispose<T extends IDisposable>(disposable: T | undefined): T | undefined;\r\nexport function dispose<T extends IDisposable>(disposables: Array<T>): Array<T>;\r\nexport function dispose<T extends IDisposable>(disposables: ReadonlyArray<T>): ReadonlyArray<T>;\r\nexport function dispose<T extends IDisposable>(disposables: T | T[] | undefined): T | T[] | undefined {\r\n\tif (Array.isArray(disposables)) {\r\n\t\tdisposables.forEach(d => {\r\n\t\t\tif (d) {\r\n\t\t\t\tmarkTracked(d);\r\n\t\t\t\td.dispose();\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn [];\r\n\t} else if (disposables) {\r\n\t\tmarkTracked(disposables);\r\n\t\tdisposables.dispose();\r\n\t\treturn disposables;\r\n\t} else {\r\n\t\treturn undefined;\r\n\t}\r\n}\r\n\r\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\r\n\tdisposables.forEach(markTracked);\r\n\treturn trackDisposable({ dispose: () => dispose(disposables) });\r\n}\r\n\r\nexport function toDisposable(fn: () => void): IDisposable {\r\n\tconst self = trackDisposable({\r\n\t\tdispose: () => {\r\n\t\t\tmarkTracked(self);\r\n\t\t\tfn();\r\n\t\t}\r\n\t});\r\n\treturn self;\r\n}\r\n\r\nexport class DisposableStore implements IDisposable {\r\n\tprivate _toDispose = new Set<IDisposable>();\r\n\tprivate _isDisposed = false;\r\n\r\n\t/**\r\n\t * Dispose of all registered disposables and mark this object as disposed.\r\n\t *\r\n\t * Any future disposables added to this object will be disposed of on `add`.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (this._isDisposed) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmarkTracked(this);\r\n\t\tthis._isDisposed = true;\r\n\t\tthis.clear();\r\n\t}\r\n\r\n\t/**\r\n\t * Dispose of all registered disposables but do not mark this object as disposed.\r\n\t */\r\n\tpublic clear(): void {\r\n\t\tthis._toDispose.forEach(item => item.dispose());\r\n\t\tthis._toDispose.clear();\r\n\t}\r\n\r\n\tpublic add<T extends IDisposable>(t: T): T {\r\n\t\tif (!t) {\r\n\t\t\treturn t;\r\n\t\t}\r\n\t\tif ((t as any as DisposableStore) === this) {\r\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\r\n\t\t}\r\n\r\n\t\tmarkTracked(t);\r\n\t\tif (this._isDisposed) {\r\n\t\t\tconsole.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);\r\n\t\t} else {\r\n\t\t\tthis._toDispose.add(t);\r\n\t\t}\r\n\r\n\t\treturn t;\r\n\t}\r\n}\r\n\r\nexport abstract class Disposable implements IDisposable {\r\n\r\n\tstatic readonly None = Object.freeze<IDisposable>({ dispose() { } });\r\n\r\n\tprivate readonly _store = new DisposableStore();\r\n\r\n\tconstructor() {\r\n\t\ttrackDisposable(this);\r\n\t}\r\n\r\n\tpublic dispose(): void {\r\n\t\tmarkTracked(this);\r\n\r\n\t\tthis._store.dispose();\r\n\t}\r\n\r\n\tprotected _register<T extends IDisposable>(t: T): T {\r\n\t\tif ((t as any as Disposable) === this) {\r\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\r\n\t\t}\r\n\t\treturn this._store.add(t);\r\n\t}\r\n}\r\n\r\n/**\r\n * Manages the lifecycle of a disposable value that may be changed.\r\n *\r\n * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can\r\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\r\n */\r\nexport class MutableDisposable<T extends IDisposable> implements IDisposable {\r\n\tprivate _value?: T;\r\n\tprivate _isDisposed = false;\r\n\r\n\tconstructor() {\r\n\t\ttrackDisposable(this);\r\n\t}\r\n\r\n\tget value(): T | undefined {\r\n\t\treturn this._isDisposed ? undefined : this._value;\r\n\t}\r\n\r\n\tset value(value: T | undefined) {\r\n\t\tif (this._isDisposed || value === this._value) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this._value) {\r\n\t\t\tthis._value.dispose();\r\n\t\t}\r\n\t\tif (value) {\r\n\t\t\tmarkTracked(value);\r\n\t\t}\r\n\t\tthis._value = value;\r\n\t}\r\n\r\n\tclear() {\r\n\t\tthis.value = undefined;\r\n\t}\r\n\r\n\tdispose(): void {\r\n\t\tthis._isDisposed = true;\r\n\t\tmarkTracked(this);\r\n\t\tif (this._value) {\r\n\t\t\tthis._value.dispose();\r\n\t\t}\r\n\t\tthis._value = undefined;\r\n\t}\r\n}\r\n\r\nexport interface IReference<T> extends IDisposable {\r\n\treadonly object: T;\r\n}\r\n\r\nexport class ImmortalReference<T> implements IReference<T> {\r\n\tconstructor(public object: T) { }\r\n\tdispose(): void { /* noop */ }\r\n}\r\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\r\nimport { Iterator, IteratorResult, FIN } from 'vs/base/common/iterator';\r\n\r\nclass Node<E> {\r\n\r\n\tstatic readonly Undefined = new Node<any>(undefined);\r\n\r\n\telement: E;\r\n\tnext: Node<E>;\r\n\tprev: Node<E>;\r\n\r\n\tconstructor(element: E) {\r\n\t\tthis.element = element;\r\n\t\tthis.next = Node.Undefined;\r\n\t\tthis.prev = Node.Undefined;\r\n\t}\r\n}\r\n\r\nexport class LinkedList<E> {\r\n\r\n\tprivate _first: Node<E> = Node.Undefined;\r\n\tprivate _last: Node<E> = Node.Undefined;\r\n\tprivate _size: number = 0;\r\n\r\n\tget size(): number {\r\n\t\treturn this._size;\r\n\t}\r\n\r\n\tisEmpty(): boolean {\r\n\t\treturn this._first === Node.Undefined;\r\n\t}\r\n\r\n\tclear(): void {\r\n\t\tthis._first = Node.Undefined;\r\n\t\tthis._last = Node.Undefined;\r\n\t\tthis._size = 0;\r\n\t}\r\n\r\n\tunshift(element: E): () => void {\r\n\t\treturn this._insert(element, false);\r\n\t}\r\n\r\n\tpush(element: E): () => void {\r\n\t\treturn this._insert(element, true);\r\n\t}\r\n\r\n\tprivate _insert(element: E, atTheEnd: boolean): () => void {\r\n\t\tconst newNode = new Node(element);\r\n\t\tif (this._first === Node.Undefined) {\r\n\t\t\tthis._first = newNode;\r\n\t\t\tthis._last = newNode;\r\n\r\n\t\t} else if (atTheEnd) {\r\n\t\t\t// push\r\n\t\t\tconst oldLast = this._last!;\r\n\t\t\tthis._last = newNode;\r\n\t\t\tnewNode.prev = oldLast;\r\n\t\t\toldLast.next = newNode;\r\n\r\n\t\t} else {\r\n\t\t\t// unshift\r\n\t\t\tconst oldFirst = this._first;\r\n\t\t\tthis._first = newNode;\r\n\t\t\tnewNode.next = oldFirst;\r\n\t\t\toldFirst.prev = newNode;\r\n\t\t}\r\n\t\tthis._size += 1;\r\n\r\n\t\tlet didRemove = false;\r\n\t\treturn () => {\r\n\t\t\tif (!didRemove) {\r\n\t\t\t\tdidRemove = true;\r\n\t\t\t\tthis._remove(newNode);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tshift(): E | undefined {\r\n\t\tif (this._first === Node.Undefined) {\r\n\t\t\treturn undefined;\r\n\t\t} else {\r\n\t\t\tconst res = this._first.element;\r\n\t\t\tthis._remove(this._first);\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}\r\n\r\n\tpop(): E | undefined {\r\n\t\tif (this._last === Node.Undefined) {\r\n\t\t\treturn undefined;\r\n\t\t} else {\r\n\t\t\tconst res = this._last.element;\r\n\t\t\tthis._remove(this._last);\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _remove(node: Node<E>): void {\r\n\t\tif (node.prev !== Node.Undefined && node.next !== Node.Undefined) {\r\n\t\t\t// middle\r\n\t\t\tconst anchor = node.prev;\r\n\t\t\tanchor.next = node.next;\r\n\t\t\tnode.next.prev = anchor;\r\n\r\n\t\t} else if (node.prev === Node.Undefined && node.next === Node.Undefined) {\r\n\t\t\t// only node\r\n\t\t\tthis._first = Node.Undefined;\r\n\t\t\tthis._last = Node.Undefined;\r\n\r\n\t\t} else if (node.next === Node.Undefined) {\r\n\t\t\t// last\r\n\t\t\tthis._last = this._last!.prev!;\r\n\t\t\tthis._last.next = Node.Undefined;\r\n\r\n\t\t} else if (node.prev === Node.Undefined) {\r\n\t\t\t// first\r\n\t\t\tthis._first = this._first!.next!;\r\n\t\t\tthis._first.prev = Node.Undefined;\r\n\t\t}\r\n\r\n\t\t// done\r\n\t\tthis._size -= 1;\r\n\t}\r\n\r\n\titerator(): Iterator<E> {\r\n\t\tlet element: { done: false; value: E; };\r\n\t\tlet node = this._first;\r\n\t\treturn {\r\n\t\t\tnext(): IteratorResult<E> {\r\n\t\t\t\tif (node === Node.Undefined) {\r\n\t\t\t\t\treturn FIN;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!element) {\r\n\t\t\t\t\telement = { done: false, value: node.element };\r\n\t\t\t\t} else {\r\n\t\t\t\t\telement.value = node.element;\r\n\t\t\t\t}\r\n\t\t\t\tnode = node.next;\r\n\t\t\t\treturn element;\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\ttoArray(): E[] {\r\n\t\tconst result: E[] = [];\r\n\t\tfor (let node = this._first; node !== Node.Undefined; node = node.next) {\r\n\t\t\tresult.push(node.element);\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n}\r\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\r\nimport { onUnexpectedError } from 'vs/base/common/errors';\r\nimport { once as onceFn } from 'vs/base/common/functional';\r\nimport { Disposable, IDisposable, toDisposable, combinedDisposable, DisposableStore } from 'vs/base/common/lifecycle';\r\nimport { LinkedList } from 'vs/base/common/linkedList';\r\n\r\n/**\r\n * To an event a function with one or zero parameters\r\n * can be subscribed. The event is the subscriber function itself.\r\n */\r\nexport interface Event<T> {\r\n\t(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;\r\n}\r\n\r\nexport namespace Event {\r\n\texport const None: Event<any> = () => Disposable.None;\r\n\r\n\t/**\r\n\t * Given an event, returns another event which only fires once.\r\n\t */\r\n\texport function once<T>(event: Event<T>): Event<T> {\r\n\t\treturn (listener, thisArgs = null, disposables?) => {\r\n\t\t\t// we need this, in case the event fires during the listener call\r\n\t\t\tlet didFire = false;\r\n\t\t\tlet result: IDisposable;\r\n\t\t\tresult = event(e => {\r\n\t\t\t\tif (didFire) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t} else if (result) {\r\n\t\t\t\t\tresult.dispose();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdidFire = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn listener.call(thisArgs, e);\r\n\t\t\t}, null, disposables);\r\n\r\n\t\t\tif (didFire) {\r\n\t\t\t\tresult.dispose();\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Given an event and a `map` function, returns another event which maps each element\r\n\t * through the mapping function.\r\n\t */\r\n\texport function map<I, O>(event: Event<I>, map: (i: I) => O): Event<O> {\r\n\t\treturn snapshot((listener, thisArgs = null, disposables?) => event(i => listener.call(thisArgs, map(i)), null, disposables));\r\n\t}\r\n\r\n\t/**\r\n\t * Given an event and an `each` function, returns another identical event and calls\r\n\t * the `each` function per each element.\r\n\t */\r\n\texport function forEach<I>(event: Event<I>, each: (i: I) => void): Event<I> {\r\n\t\treturn snapshot((listener, thisArgs = null, disposables?) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables));\r\n\t}\r\n\r\n\t/**\r\n\t * Given an event and a `filter` function, returns another event which emits those\r\n\t * elements for which the `filter` function returns `true`.\r\n\t */\r\n\texport function filter<T>(event: Event<T>, filter: (e: T) => boolean): Event<T>;\r\n\texport function filter<T, R>(event: Event<T | R>, filter: (e: T | R) => e is R): Event<R>;\r\n\texport function filter<T>(event: Event<T>, filter: (e: T) => boolean): Event<T> {\r\n\t\treturn snapshot((listener, thisArgs = null, disposables?) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables));\r\n\t}\r\n\r\n\t/**\r\n\t * Given an event, returns the same event but typed as `Event<void>`.\r\n\t */\r\n\texport function signal<T>(event: Event<T>): Event<void> {\r\n\t\treturn event as Event<any> as Event<void>;\r\n\t}\r\n\r\n\t/**\r\n\t * Given a collection of events, returns a single event which emits\r\n\t * whenever any of the provided events emit.\r\n\t */\r\n\texport function any<T>(...events: Event<T>[]): Event<T> {\r\n\t\treturn (listener, thisArgs = null, disposables?) => combinedDisposable(...events.map(event => event(e => listener.call(thisArgs, e), null, disposables)));\r\n\t}\r\n\r\n\t/**\r\n\t * Given an event and a `merge` function, returns another event which maps each element\r\n\t * and the cumulative result through the `merge` function. Similar to `map`, but with memory.\r\n\t */\r\n\texport function reduce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, initial?: O): Event<O> {\r\n\t\tlet output: O | undefined = initial;\r\n\r\n\t\treturn map<I, O>(event, e => {\r\n\t\t\toutput = merge(output, e);\r\n\t\t\treturn output;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Given a chain of event processing functions (filter, map, etc), each\r\n\t * function will be invoked per event & per listener. Snapshotting an event\r\n\t * chain allows each function to be invoked just once per event.\r\n\t */\r\n\texport function snapshot<T>(event: Event<T>): Event<T> {\r\n\t\tlet listener: IDisposable;\r\n\t\tconst emitter = new Emitter<T>({\r\n\t\t\tonFirstListenerAdd() {\r\n\t\t\t\tlistener = event(emitter.fire, emitter);\r\n\t\t\t},\r\n\t\t\tonLastListenerRemove() {\r\n\t\t\t\tlistener.dispose();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn emitter.event;\r\n\t}\r\n\r\n\t/**\r\n\t * Debounces the provided event, given a `merge` function.\r\n\t *\r\n\t * @param event The input event.\r\n\t * @param merge The reducing function.\r\n\t * @param delay The debouncing delay in millis.\r\n\t * @param leading Whether the event should fire in the leading phase of the timeout.\r\n\t * @param leakWarningThreshold The leak warning threshold override.\r\n\t */\r\n\texport function debounce<T>(event: Event<T>, merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, leakWarningThreshold?: number): Event<T>;\r\n\texport function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay?: number, leading?: boolean, leakWarningThreshold?: number): Event<O>;\r\n\texport function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay: number = 100, leading = false, leakWarningThreshold?: number): Event<O> {\r\n\r\n\t\tlet subscription: IDisposable;\r\n\t\tlet output: O | undefined = undefined;\r\n\t\tlet handle: any = undefined;\r\n\t\tlet numDebouncedCalls = 0;\r\n\r\n\t\tconst emitter = new Emitter<O>({\r\n\t\t\tleakWarningThreshold,\r\n\t\t\tonFirstListenerAdd() {\r\n\t\t\t\tsubscription = event(cur => {\r\n\t\t\t\t\tnumDebouncedCalls++;\r\n\t\t\t\t\toutput = merge(output, cur);\r\n\r\n\t\t\t\t\tif (leading && !handle) {\r\n\t\t\t\t\t\temitter.fire(output);\r\n\t\t\t\t\t\toutput = undefined;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tclearTimeout(handle);\r\n\t\t\t\t\thandle = setTimeout(() => {\r\n\t\t\t\t\t\tconst _output = output;\r\n\t\t\t\t\t\toutput = undefined;\r\n\t\t\t\t\t\thandle = undefined;\r\n\t\t\t\t\t\tif (!leading || numDebouncedCalls > 1) {\r\n\t\t\t\t\t\t\temitter.fire(_output!);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tnumDebouncedCalls = 0;\r\n\t\t\t\t\t}, delay);\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\tonLastListenerRemove() {\r\n\t\t\t\tsubscription.dispose();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn emitter.event;\r\n\t}\r\n\r\n\t/**\r\n\t * Given an event, it returns another event which fires only once and as soon as\r\n\t * the input event emits. The event data is the number of millis it took for the\r\n\t * event to fire.\r\n\t */\r\n\texport function stopwatch<T>(event: Event<T>): Event<number> {\r\n\t\tconst start = new Date().getTime();\r\n\t\treturn map(once(event), _ => new Date().getTime() - start);\r\n\t}\r\n\r\n\t/**\r\n\t * Given an event, it returns another event which fires only when the event\r\n\t * element changes.\r\n\t */\r\n\texport function latch<T>(event: Event<T>): Event<T> {\r\n\t\tlet firstCall = true;\r\n\t\tlet cache: T;\r\n\r\n\t\treturn filter(event, value => {\r\n\t\t\tconst shouldEmit = firstCall || value !== cache;\r\n\t\t\tfirstCall = false;\r\n\t\t\tcache = value;\r\n\t\t\treturn shouldEmit;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Buffers the provided event until a first listener comes\r\n\t * along, at which point fire all the events at once and\r\n\t * pipe the event from then on.\r\n\t *\r\n\t * ```typescript\r\n\t * const emitter = new Emitter<number>();\r\n\t * const event = emitter.event;\r\n\t * const bufferedEvent = buffer(event);\r\n\t *\r\n\t * emitter.fire(1);\r\n\t * emitter.fire(2);\r\n\t * emitter.fire(3);\r\n\t * // nothing...\r\n\t *\r\n\t * const listener = bufferedEvent(num => console.log(num));\r\n\t * // 1, 2, 3\r\n\t *\r\n\t * emitter.fire(4);\r\n\t * // 4\r\n\t * ```\r\n\t */\r\n\texport function buffer<T>(event: Event<T>, nextTick = false, _buffer: T[] = []): Event<T> {\r\n\t\tlet buffer: T[] | null = _buffer.slice();\r\n\r\n\t\tlet listener: IDisposable | null = event(e => {\r\n\t\t\tif (buffer) {\r\n\t\t\t\tbuffer.push(e);\r\n\t\t\t} else {\r\n\t\t\t\temitter.fire(e);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst flush = () => {\r\n\t\t\tif (buffer) {\r\n\t\t\t\tbuffer.forEach(e => emitter.fire(e));\r\n\t\t\t}\r\n\t\t\tbuffer = null;\r\n\t\t};\r\n\r\n\t\tconst emitter = new Emitter<T>({\r\n\t\t\tonFirstListenerAdd() {\r\n\t\t\t\tif (!listener) {\r\n\t\t\t\t\tlistener = event(e => emitter.fire(e));\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tonFirstListenerDidAdd() {\r\n\t\t\t\tif (buffer) {\r\n\t\t\t\t\tif (nextTick) {\r\n\t\t\t\t\t\tsetTimeout(flush);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tflush();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tonLastListenerRemove() {\r\n\t\t\t\tif (listener) {\r\n\t\t\t\t\tlistener.dispose();\r\n\t\t\t\t}\r\n\t\t\t\tlistener = null;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn emitter.event;\r\n\t}\r\n\r\n\texport interface IChainableEvent<T> {\r\n\t\tevent: Event<T>;\r\n\t\tmap<O>(fn: (i: T) => O): IChainableEvent<O>;\r\n\t\tforEach(fn: (i: T) => void): IChainableEvent<T>;\r\n\t\tfilter(fn: (e: T) => boolean): IChainableEvent<T>;\r\n\t\treduce<R>(merge: (last: R | undefined, event: T) => R, initial?: R): IChainableEvent<R>;\r\n\t\tlatch(): IChainableEvent<T>;\r\n\t\tdebounce(merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, leakWarningThreshold?: number): IChainableEvent<T>;\r\n\t\tdebounce<R>(merge: (last: R | undefined, event: T) => R, delay?: number, leading?: boolean, leakWarningThreshold?: number): IChainableEvent<R>;\r\n\t\ton(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;\r\n\t\tonce(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): IDisposable;\r\n\t}\r\n\r\n\tclass ChainableEvent<T> implements IChainableEvent<T> {\r\n\r\n\t\tconstructor(readonly event: Event<T>) { }\r\n\r\n\t\tmap<O>(fn: (i: T) => O): IChainableEvent<O> {\r\n\t\t\treturn new ChainableEvent(map(this.event, fn));\r\n\t\t}\r\n\r\n\t\tforEach(fn: (i: T) => void): IChainableEvent<T> {\r\n\t\t\treturn new ChainableEvent(forEach(this.event, fn));\r\n\t\t}\r\n\r\n\t\tfilter(fn: (e: T) => boolean): IChainableEvent<T> {\r\n\t\t\treturn new ChainableEvent(filter(this.event, fn));\r\n\t\t}\r\n\r\n\t\treduce<R>(merge: (last: R | undefined, event: T) => R, initial?: R): IChainableEvent<R> {\r\n\t\t\treturn new ChainableEvent(reduce(this.event, merge, initial));\r\n\t\t}\r\n\r\n\t\tlatch(): IChainableEvent<T> {\r\n\t\t\treturn new ChainableEvent(latch(this.event));\r\n\t\t}\r\n\r\n\t\tdebounce(merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, leakWarningThreshold?: number): IChainableEvent<T>;\r\n\t\tdebounce<R>(merge: (last: R | undefined, event: T) => R, delay?: number, leading?: boolean, leakWarningThreshold?: number): IChainableEvent<R>;\r\n\t\tdebounce<R>(merge: (last: R | undefined, event: T) => R, delay: number = 100, leading = false, leakWarningThreshold?: number): IChainableEvent<R> {\r\n\t\t\treturn new ChainableEvent(debounce(this.event, merge, delay, leading, leakWarningThreshold));\r\n\t\t}\r\n\r\n\t\ton(listener: (e: T) => any, thisArgs: any, disposables: IDisposable[] | DisposableStore) {\r\n\t\t\treturn this.event(listener, thisArgs, disposables);\r\n\t\t}\r\n\r\n\t\tonce(listener: (e: T) => any, thisArgs: any, disposables: IDisposable[]) {\r\n\t\t\treturn once(this.event)(listener, thisArgs, disposables);\r\n\t\t}\r\n\t}\r\n\r\n\texport function chain<T>(event: Event<T>): IChainableEvent<T> {\r\n\t\treturn new ChainableEvent(event);\r\n\t}\r\n\r\n\texport interface NodeEventEmitter {\r\n\t\ton(event: string | symbol, listener: Function): this;\r\n\t\tremoveListener(event: string | symbol, listener: Function): this;\r\n\t}\r\n\r\n\texport function fromNodeEventEmitter<T>(emitter: NodeEventEmitter, eventName: string, map: (...args: any[]) => T = id => id): Event<T> {\r\n\t\tconst fn = (...args: any[]) => result.fire(map(...args));\r\n\t\tconst onFirstListenerAdd = () => emitter.on(eventName, fn);\r\n\t\tconst onLastListenerRemove = () => emitter.removeListener(eventName, fn);\r\n\t\tconst result = new Emitter<T>({ onFirstListenerAdd, onLastListenerRemove });\r\n\r\n\t\treturn result.event;\r\n\t}\r\n\r\n\texport interface DOMEventEmitter {\r\n\t\taddEventListener(event: string | symbol, listener: Function): void;\r\n\t\tremoveEventListener(event: string | symbol, listener: Function): void;\r\n\t}\r\n\r\n\texport function fromDOMEventEmitter<T>(emitter: DOMEventEmitter, eventName: string, map: (...args: any[]) => T = id => id): Event<T> {\r\n\t\tconst fn = (...args: any[]) => result.fire(map(...args));\r\n\t\tconst onFirstListenerAdd = () => emitter.addEventListener(eventName, fn);\r\n\t\tconst onLastListenerRemove = () => emitter.removeEventListener(eventName, fn);\r\n\t\tconst result = new Emitter<T>({ onFirstListenerAdd, onLastListenerRemove });\r\n\r\n\t\treturn result.event;\r\n\t}\r\n\r\n\texport function fromPromise<T = any>(promise: Promise<T>): Event<undefined> {\r\n\t\tconst emitter = new Emitter<undefined>();\r\n\t\tlet shouldEmit = false;\r\n\r\n\t\tpromise\r\n\t\t\t.then(undefined, () => null)\r\n\t\t\t.then(() => {\r\n\t\t\t\tif (!shouldEmit) {\r\n\t\t\t\t\tsetTimeout(() => emitter.fire(undefined), 0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\temitter.fire(undefined);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\tshouldEmit = true;\r\n\t\treturn emitter.event;\r\n\t}\r\n\r\n\texport function toPromise<T>(event: Event<T>): Promise<T> {\r\n\t\treturn new Promise(c => once(event)(c));\r\n\t}\r\n}\r\n\r\ntype Listener<T> = [(e: T) => void, any] | ((e: T) => void);\r\n\r\nexport interface EmitterOptions {\r\n\tonFirstListenerAdd?: Function;\r\n\tonFirstListenerDidAdd?: Function;\r\n\tonListenerDidAdd?: Function;\r\n\tonLastListenerRemove?: Function;\r\n\tleakWarningThreshold?: number;\r\n}\r\n\r\nlet _globalLeakWarningThreshold = -1;\r\n\r\nclass LeakageMonitor {\r\n\r\n\tprivate _stacks: Map<string, number> | undefined;\r\n\tprivate _warnCountdown: number = 0;\r\n\r\n\tconstructor(\r\n\t\treadonly customThreshold?: number,\r\n\t\treadonly name: string = Math.random().toString(18).slice(2, 5),\r\n\t) { }\r\n\r\n\tdispose(): void {\r\n\t\tif (this._stacks) {\r\n\t\t\tthis._stacks.clear();\r\n\t\t}\r\n\t}\r\n\r\n\tcheck(listenerCount: number): undefined | (() => void) {\r\n\r\n\t\tlet threshold = _globalLeakWarningThreshold;\r\n\t\tif (typeof this.customThreshold === 'number') {\r\n\t\t\tthreshold = this.customThreshold;\r\n\t\t}\r\n\r\n\t\tif (threshold <= 0 || listenerCount < threshold) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\tif (!this._stacks) {\r\n\t\t\tthis._stacks = new Map();\r\n\t\t}\r\n\t\tconst stack = new Error().stack!.split('\\n').slice(3).join('\\n');\r\n\t\tconst count = (this._stacks.get(stack) || 0);\r\n\t\tthis._stacks.set(stack, count + 1);\r\n\t\tthis._warnCountdown -= 1;\r\n\r\n\t\tif (this._warnCountdown <= 0) {\r\n\t\t\t// only warn on first exceed and then every time the limit\r\n\t\t\t// is exceeded by 50% again\r\n\t\t\tthis._warnCountdown = threshold * 0.5;\r\n\r\n\t\t\t// find most frequent listener and print warning\r\n\t\t\tlet topStack: string;\r\n\t\t\tlet topCount: number = 0;\r\n\t\t\tthis._stacks.forEach((count, stack) => {\r\n\t\t\t\tif (!topStack || topCount < count) {\r\n\t\t\t\t\ttopStack = stack;\r\n\t\t\t\t\ttopCount = count;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tconsole.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`);\r\n\t\t\tconsole.warn(topStack!);\r\n\t\t}\r\n\r\n\t\treturn () => {\r\n\t\t\tconst count = (this._stacks!.get(stack) || 0);\r\n\t\t\tthis._stacks!.set(stack, count - 1);\r\n\t\t};\r\n\t}\r\n}\r\n\r\n/**\r\n * The Emitter can be used to expose an Event to the public\r\n * to fire it from the insides.\r\n * Sample:\r\n\tclass Document {\r\n\r\n\t\tprivate readonly _onDidChange = new Emitter<(value:string)=>any>();\r\n\r\n\t\tpublic onDidChange = this._onDidChange.event;\r\n\r\n\t\t// getter-style\r\n\t\t// get onDidChange(): Event<(value:string)=>any> {\r\n\t\t// \treturn this._onDidChange.event;\r\n\t\t// }\r\n\r\n\t\tprivate _doIt() {\r\n\t\t\t//...\r\n\t\t\tthis._onDidChange.fire(value);\r\n\t\t}\r\n\t}\r\n */\r\nexport class Emitter<T> {\r\n\r\n\tprivate static readonly _noop = function () { };\r\n\r\n\tprivate readonly _options?: EmitterOptions;\r\n\tprivate readonly _leakageMon?: LeakageMonitor;\r\n\tprivate _disposed: boolean = false;\r\n\tprivate _event?: Event<T>;\r\n\tprivate _deliveryQueue?: LinkedList<[Listener<T>, T]>;\r\n\tprotected _listeners?: LinkedList<Listener<T>>;\r\n\r\n\tconstructor(options?: EmitterOptions) {\r\n\t\tthis._options = options;\r\n\t\tthis._leakageMon = _globalLeakWarningThreshold > 0\r\n\t\t\t? new LeakageMonitor(this._options && this._options.leakWarningThreshold)\r\n\t\t\t: undefined;\r\n\t}\r\n\r\n\t/**\r\n\t * For the public to allow to subscribe\r\n\t * to events from this Emitter\r\n\t */\r\n\tget event(): Event<T> {\r\n\t\tif (!this._event) {\r\n\t\t\tthis._event = (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\r\n\t\t\t\tif (!this._listeners) {\r\n\t\t\t\t\tthis._listeners = new LinkedList();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst firstListener = this._listeners.isEmpty();\r\n\r\n\t\t\t\tif (firstListener && this._options && this._options.onFirstListenerAdd) {\r\n\t\t\t\t\tthis._options.onFirstListenerAdd(this);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]);\r\n\r\n\t\t\t\tif (firstListener && this._options && this._options.onFirstListenerDidAdd) {\r\n\t\t\t\t\tthis._options.onFirstListenerDidAdd(this);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._options && this._options.onListenerDidAdd) {\r\n\t\t\t\t\tthis._options.onListenerDidAdd(this, listener, thisArgs);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// check and record this emitter for potential leakage\r\n\t\t\t\tlet removeMonitor: (() => void) | undefined;\r\n\t\t\t\tif (this._leakageMon) {\r\n\t\t\t\t\tremoveMonitor = this._leakageMon.check(this._listeners.size);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet result: IDisposable;\r\n\t\t\t\tresult = {\r\n\t\t\t\t\tdispose: () => {\r\n\t\t\t\t\t\tif (removeMonitor) {\r\n\t\t\t\t\t\t\tremoveMonitor();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tresult.dispose = Emitter._noop;\r\n\t\t\t\t\t\tif (!this._disposed) {\r\n\t\t\t\t\t\t\tremove();\r\n\t\t\t\t\t\t\tif (this._options && this._options.onLastListenerRemove) {\r\n\t\t\t\t\t\t\t\tconst hasListeners = (this._listeners && !this._listeners.isEmpty());\r\n\t\t\t\t\t\t\t\tif (!hasListeners) {\r\n\t\t\t\t\t\t\t\t\tthis._options.onLastListenerRemove(this);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\tif (disposables instanceof DisposableStore) {\r\n\t\t\t\t\tdisposables.add(result);\r\n\t\t\t\t} else if (Array.isArray(disposables)) {\r\n\t\t\t\t\tdisposables.push(result);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn this._event;\r\n\t}\r\n\r\n\t/**\r\n\t * To be kept private to fire an event to\r\n\t * subscribers\r\n\t */\r\n\tfire(event: T): void {\r\n\t\tif (this._listeners) {\r\n\t\t\t// put all [listener,event]-pairs into delivery queue\r\n\t\t\t// then emit all event. an inner/nested event might be\r\n\t\t\t// the driver of this\r\n\r\n\t\t\tif (!this._deliveryQueue) {\r\n\t\t\t\tthis._deliveryQueue = new LinkedList();\r\n\t\t\t}\r\n\r\n\t\t\tfor (let iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) {\r\n\t\t\t\tthis._deliveryQueue.push([e.value, event]);\r\n\t\t\t}\r\n\r\n\t\t\twhile (this._deliveryQueue.size > 0) {\r\n\t\t\t\tconst [listener, event] = this._deliveryQueue.shift()!;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (typeof listener === 'function') {\r\n\t\t\t\t\t\tlistener.call(undefined, event);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tlistener[0].call(listener[1], event);\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tonUnexpectedError(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdispose() {\r\n\t\tif (this._listeners) {\r\n\t\t\tthis._listeners.clear();\r\n\t\t}\r\n\t\tif (this._deliveryQueue) {\r\n\t\t\tthis._deliveryQueue.clear();\r\n\t\t}\r\n\t\tif (this._leakageMon) {\r\n\t\t\tthis._leakageMon.dispose();\r\n\t\t}\r\n\t\tthis._disposed = true;\r\n\t}\r\n}\r\n\r\nexport class PauseableEmitter<T> extends Emitter<T> {\r\n\r\n\tprivate _isPaused = 0;\r\n\tprivate _eventQueue = new LinkedList<T>();\r\n\tprivate _mergeFn?: (input: T[]) => T;\r\n\r\n\tconstructor(options?: EmitterOptions & { merge?: (input: T[]) => T }) {\r\n\t\tsuper(options);\r\n\t\tthis._mergeFn = options && options.merge;\r\n\t}\r\n\r\n\tpause(): void {\r\n\t\tthis._isPaused++;\r\n\t}\r\n\r\n\tresume(): void {\r\n\t\tif (this._isPaused !== 0 && --this._isPaused === 0) {\r\n\t\t\tif (this._mergeFn) {\r\n\t\t\t\t// use the merge function to create a single composite\r\n\t\t\t\t// event. make a copy in case firing pauses this emitter\r\n\t\t\t\tconst events = this._eventQueue.toArray();\r\n\t\t\t\tthis._eventQueue.clear();\r\n\t\t\t\tsuper.fire(this._mergeFn(events));\r\n\r\n\t\t\t} else {\r\n\t\t\t\t// no merging, fire each event individually and test\r\n\t\t\t\t// that this emitter isn't paused halfway through\r\n\t\t\t\twhile (!this._isPaused && this._eventQueue.size !== 0) {\r\n\t\t\t\t\tsuper.fire(this._eventQueue.shift()!);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfire(event: T): void {\r\n\t\tif (this._listeners) {\r\n\t\t\tif (this._isPaused !== 0) {\r\n\t\t\t\tthis._eventQueue.push(event);\r\n\t\t\t} else {\r\n\t\t\t\tsuper.fire(event);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport class EventMultiplexer<T> implements IDisposable {\r\n\r\n\tprivate readonly emitter: Emitter<T>;\r\n\tprivate hasListeners = false;\r\n\tprivate events: { event: Event<T>; listener: IDisposable | null; }[] = [];\r\n\r\n\tconstructor() {\r\n\t\tthis.emitter = new Emitter<T>({\r\n\t\t\tonFirstListenerAdd: () => this.onFirstListenerAdd(),\r\n\t\t\tonLastListenerRemove: () => this.onLastListenerRemove()\r\n\t\t});\r\n\t}\r\n\r\n\tget event(): Event<T> {\r\n\t\treturn this.emitter.event;\r\n\t}\r\n\r\n\tadd(event: Event<T>): IDisposable {\r\n\t\tconst e = { event: event, listener: null };\r\n\t\tthis.events.push(e);\r\n\r\n\t\tif (this.hasListeners) {\r\n\t\t\tthis.hook(e);\r\n\t\t}\r\n\r\n\t\tconst dispose = () => {\r\n\t\t\tif (this.hasListeners) {\r\n\t\t\t\tthis.unhook(e);\r\n\t\t\t}\r\n\r\n\t\t\tconst idx = this.events.indexOf(e);\r\n\t\t\tthis.events.splice(idx, 1);\r\n\t\t};\r\n\r\n\t\treturn toDisposable(onceFn(dispose));\r\n\t}\r\n\r\n\tprivate onFirstListenerAdd(): void {\r\n\t\tthis.hasListeners = true;\r\n\t\tthis.events.forEach(e => this.hook(e));\r\n\t}\r\n\r\n\tprivate onLastListenerRemove(): void {\r\n\t\tthis.hasListeners = false;\r\n\t\tthis.events.forEach(e => this.unhook(e));\r\n\t}\r\n\r\n\tprivate hook(e: { event: Event<T>; listener: IDisposable | null; }): void {\r\n\t\te.listener = e.event(r => this.emitter.fire(r));\r\n\t}\r\n\r\n\tprivate unhook(e: { event: Event<T>; listener: IDisposable | null; }): void {\r\n\t\tif (e.listener) {\r\n\t\t\te.listener.dispose();\r\n\t\t}\r\n\t\te.listener = null;\r\n\t}\r\n\r\n\tdispose(): void {\r\n\t\tthis.emitter.dispose();\r\n\t}\r\n}\r\n\r\n/**\r\n * The EventBufferer is useful in situations in which you want\r\n * to delay firing your events during some code.\r\n * You can wrap that code and be sure that the event will not\r\n * be fired during that wrap.\r\n *\r\n * ```\r\n * const emitter: Emitter;\r\n * const delayer = new EventDelayer();\r\n * const delayedEvent = delayer.wrapEvent(emitter.event);\r\n *\r\n * delayedEvent(console.log);\r\n *\r\n * delayer.bufferEvents(() => {\r\n * emitter.fire(); // event will not be fired yet\r\n * });\r\n *\r\n * // event will only be fired at this point\r\n * ```\r\n */\r\nexport class EventBufferer {\r\n\r\n\tprivate buffers: Function[][] = [];\r\n\r\n\twrapEvent<T>(event: Event<T>): Event<T> {\r\n\t\treturn (listener, thisArgs?, disposables?) => {\r\n\t\t\treturn event(i => {\r\n\t\t\t\tconst buffer = this.buffers[this.buffers.length - 1];\r\n\r\n\t\t\t\tif (buffer) {\r\n\t\t\t\t\tbuffer.push(() => listener.call(thisArgs, i));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlistener.call(thisArgs, i);\r\n\t\t\t\t}\r\n\t\t\t}, undefined, disposables);\r\n\t\t};\r\n\t}\r\n\r\n\tbufferEvents<R = void>(fn: () => R): R {\r\n\t\tconst buffer: Array<() => R> = [];\r\n\t\tthis.buffers.push(buffer);\r\n\t\tconst r = fn();\r\n\t\tthis.buffers.pop();\r\n\t\tbuffer.forEach(flush => flush());\r\n\t\treturn r;\r\n\t}\r\n}\r\n\r\n/**\r\n * A Relay is an event forwarder which functions as a replugabble event pipe.\r\n * Once created, you can connect an input event to it and it will simply forward\r\n * events from that input event through its own `event` property. The `input`\r\n * can be changed at any point in time.\r\n */\r\nexport class Relay<T> implements IDisposable {\r\n\r\n\tprivate listening = false;\r\n\tprivate inputEvent: Event<T> = Event.None;\r\n\tprivate inputEventListener: IDisposable = Disposable.None;\r\n\r\n\tprivate readonly emitter = new Emitter<T>({\r\n\t\tonFirstListenerDidAdd: () => {\r\n\t\t\tthis.listening = true;\r\n\t\t\tthis.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);\r\n\t\t},\r\n\t\tonLastListenerRemove: () => {\r\n\t\t\tthis.listening = false;\r\n\t\t\tthis.inputEventListener.dispose();\r\n\t\t}\r\n\t});\r\n\r\n\treadonly event: Event<T> = this.emitter.event;\r\n\r\n\tset input(event: Event<T>) {\r\n\t\tthis.inputEvent = event;\r\n\r\n\t\tif (this.listening) {\r\n\t\t\tthis.inputEventListener.dispose();\r\n\t\t\tthis.inputEventListener = event(this.emitter.fire, this.emitter);\r\n\t\t}\r\n\t}\r\n\r\n\tdispose() {\r\n\t\tthis.inputEventListener.dispose();\r\n\t\tthis.emitter.dispose();\r\n\t}\r\n}\r\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\r\nimport { Emitter, Event } from 'vs/base/common/event';\r\nimport { IDisposable } from 'vs/base/common/lifecycle';\r\n\r\nexport interface CancellationToken {\r\n\treadonly isCancellationRequested: boolean;\r\n\t/**\r\n\t * An event emitted when cancellation is requested\r\n\t * @event\r\n\t */\r\n\treadonly onCancellationRequested: Event<any>;\r\n}\r\n\r\nconst shortcutEvent = Object.freeze(function (callback, context?): IDisposable {\r\n\tconst handle = setTimeout(callback.bind(context), 0);\r\n\treturn { dispose() { clearTimeout(handle); } };\r\n} as Event<any>);\r\n\r\nexport namespace CancellationToken {\r\n\r\n\texport function isCancellationToken(thing: any): thing is CancellationToken {\r\n\t\tif (thing === CancellationToken.None || thing === CancellationToken.Cancelled) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (thing instanceof MutableToken) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (!thing || typeof thing !== 'object') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn typeof (thing as CancellationToken).isCancellationRequested === 'boolean'\r\n\t\t\t&& typeof (thing as CancellationToken).onCancellationRequested === 'function';\r\n\t}\r\n\r\n\r\n\texport const None: CancellationToken = Object.freeze({\r\n\t\tisCancellationRequested: false,\r\n\t\tonCancellationRequested: Event.None\r\n\t});\r\n\r\n\texport const Cancelled: CancellationToken = Object.freeze({\r\n\t\tisCancellationRequested: true,\r\n\t\tonCancellationRequested: shortcutEvent\r\n\t});\r\n}\r\n\r\nclass MutableToken implements CancellationToken {\r\n\r\n\tprivate _isCancelled: boolean = false;\r\n\tprivate _emitter: Emitter<any> | null = null;\r\n\r\n\tpublic cancel() {\r\n\t\tif (!this._isCancelled) {\r\n\t\t\tthis._isCancelled = true;\r\n\t\t\tif (this._emitter) {\r\n\t\t\t\tthis._emitter.fire(undefined);\r\n\t\t\t\tthis.dispose();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tget isCancellationRequested(): boolean {\r\n\t\treturn this._isCancelled;\r\n\t}\r\n\r\n\tget onCancellationRequested(): Event<any> {\r\n\t\tif (this._isCancelled) {\r\n\t\t\treturn shortcutEvent;\r\n\t\t}\r\n\t\tif (!this._emitter) {\r\n\t\t\tthis._emitter = new Emitter<any>();\r\n\t\t}\r\n\t\treturn this._emitter.event;\r\n\t}\r\n\r\n\tpublic dispose(): void {\r\n\t\tif (this._emitter) {\r\n\t\t\tthis._emitter.dispose();\r\n\t\t\tthis._emitter = null;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport class CancellationTokenSource {\r\n\r\n\tprivate _token?: CancellationToken = undefined;\r\n\tprivate _parentListener?: IDisposable = undefined;\r\n\r\n\tconstructor(parent?: CancellationToken) {\r\n\t\tthis._parentListener = parent && parent.onCancellationRequested(this.cancel, this);\r\n\t}\r\n\r\n\tget token(): CancellationToken {\r\n\t\tif (!this._token) {\r\n\t\t\t// be lazy and create the token only when\r\n\t\t\t// actually needed\r\n\t\t\tthis._token = new MutableToken();\r\n\t\t}\r\n\t\treturn this._token;\r\n\t}\r\n\r\n\tcancel(): void {\r\n\t\tif (!this._token) {\r\n\t\t\t// save an object by returning the default\r\n\t\t\t// cancelled token when cancellation happens\r\n\t\t\t// before someone asks for the token\r\n\t\t\tthis._token = CancellationToken.Cancelled;\r\n\r\n\t\t} else if (this._token instanceof MutableToken) {\r\n\t\t\t// actually cancel\r\n\t\t\tthis._token.cancel();\r\n\t\t}\r\n\t}\r\n\r\n\tdispose(cancel: boolean = false): void {\r\n\t\tif (cancel) {\r\n\t\t\tthis.cancel();\r\n\t\t}\r\n\t\tif (this._parentListener) {\r\n\t\t\tthis._parentListener.dispose();\r\n\t\t}\r\n\t\tif (!this._token) {\r\n\t\t\t// ensure to initialize with an empty token if we had none\r\n\t\t\tthis._token = CancellationToken.None;\r\n\r\n\t\t} else if (this._token instanceof MutableToken) {\r\n\t\t\t// actually dispose\r\n\t\t\tthis._token.dispose();\r\n\t\t}\r\n\t}\r\n}\r\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\r\nconst LANGUAGE_DEFAULT = 'en';\r\n\r\nlet _isWindows = false;\r\nlet _isMacintosh = false;\r\nlet _isLinux = false;\r\nlet _isNative = false;\r\nlet _isWeb = false;\r\nlet _isIOS = false;\r\nlet _locale: string | undefined = undefined;\r\nlet _language: string = LANGUAGE_DEFAULT;\r\nlet _translationsConfigFile: string | undefined = undefined;\r\nlet _userAgent: string | undefined = undefined;\r\n\r\ninterface NLSConfig {\r\n\tlocale: string;\r\n\tavailableLanguages: { [key: string]: string; };\r\n\t_translationsConfigFile: string;\r\n}\r\n\r\nexport interface IProcessEnvironment {\r\n\t[key: string]: string;\r\n}\r\n\r\ninterface INodeProcess {\r\n\tplatform: string;\r\n\tenv: IProcessEnvironment;\r\n\tnextTick: Function;\r\n\tversions?: {\r\n\t\telectron?: string;\r\n\t};\r\n\ttype?: string;\r\n}\r\ndeclare const process: INodeProcess;\r\ndeclare const global: any;\r\n\r\ninterface INavigator {\r\n\tuserAgent: string;\r\n\tlanguage: string;\r\n\tmaxTouchPoints?: number;\r\n}\r\ndeclare const navigator: INavigator;\r\ndeclare const self: any;\r\n\r\nconst isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer');\r\n\r\n// OS detection\r\nif (typeof navigator === 'object' && !isElectronRenderer) {\r\n\t_userAgent = navigator.userAgent;\r\n\t_isWindows = _userAgent.indexOf('Windows') >= 0;\r\n\t_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;\r\n\t_isIOS = _userAgent.indexOf('Macintosh') >= 0 && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;\r\n\t_isLinux = _userAgent.indexOf('Linux') >= 0;\r\n\t_isWeb = true;\r\n\t_locale = navigator.language;\r\n\t_language = _locale;\r\n} else if (typeof process === 'object') {\r\n\t_isWindows = (process.platform === 'win32');\r\n\t_isMacintosh = (process.platform === 'darwin');\r\n\t_isLinux = (process.platform === 'linux');\r\n\t_locale = LANGUAGE_DEFAULT;\r\n\t_language = LANGUAGE_DEFAULT;\r\n\tconst rawNlsConfig = process.env['VSCODE_NLS_CONFIG'];\r\n\tif (rawNlsConfig) {\r\n\t\ttry {\r\n\t\t\tconst nlsConfig: NLSConfig = JSON.parse(rawNlsConfig);\r\n\t\t\tconst resolved = nlsConfig.availableLanguages['*'];\r\n\t\t\t_locale = nlsConfig.locale;\r\n\t\t\t// VSCode's default language is 'en'\r\n\t\t\t_language = resolved ? resolved : LANGUAGE_DEFAULT;\r\n\t\t\t_translationsConfigFile = nlsConfig._translationsConfigFile;\r\n\t\t} catch (e) {\r\n\t\t}\r\n\t}\r\n\t_isNative = true;\r\n}\r\n\r\nexport const enum Platform {\r\n\tWeb,\r\n\tMac,\r\n\tLinux,\r\n\tWindows\r\n}\r\n\r\nlet _platform: Platform = Platform.Web;\r\nif (_isMacintosh) {\r\n\t_platform = Platform.Mac;\r\n} else if (_isWindows) {\r\n\t_platform = Platform.Windows;\r\n} else if (_isLinux) {\r\n\t_platform = Platform.Linux;\r\n}\r\n\r\nexport const isWindows = _isWindows;\r\nexport const isMacintosh = _isMacintosh;\r\nexport const isLinux = _isLinux;\r\nexport const isNative = _isNative;\r\nexport const isWeb = _isWeb;\r\nexport const isIOS = _isIOS;\r\n\r\nconst _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {} as any);\r\nexport const globals: any = _globals;\r\n\r\ninterface ISetImmediate {\r\n\t(callback: (...args: any[]) => void): void;\r\n}\r\n\r\nexport const setImmediate: ISetImmediate = (function defineSetImmediate() {\r\n\tif (globals.setImmediate) {\r\n\t\treturn globals.setImmediate.bind(globals);\r\n\t}\r\n\tif (typeof globals.postMessage === 'function' && !globals.importScripts) {\r\n\t\tinterface IQueueElement {\r\n\t\t\tid: number;\r\n\t\t\tcallback: () => void;\r\n\t\t}\r\n\t\tlet pending: IQueueElement[] = [];\r\n\t\tglobals.addEventListener('message', (e: MessageEvent) => {\r\n\t\t\tif (e.data && e.data.vscodeSetImmediateId) {\r\n\t\t\t\tfor (let i = 0, len = pending.length; i < len; i++) {\r\n\t\t\t\t\tconst candidate = pending[i];\r\n\t\t\t\t\tif (candidate.id === e.data.vscodeSetImmediateId) {\r\n\t\t\t\t\t\tpending.splice(i, 1);\r\n\t\t\t\t\t\tcandidate.callback();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tlet lastId = 0;\r\n\t\treturn (callback: () => void) => {\r\n\t\t\tconst myId = ++lastId;\r\n\t\t\tpending.push({\r\n\t\t\t\tid: myId,\r\n\t\t\t\tcallback: callback\r\n\t\t\t});\r\n\t\t\tglobals.postMessage({ vscodeSetImmediateId: myId }, '*');\r\n\t\t};\r\n\t}\r\n\tif (typeof process !== 'undefined' && typeof process.nextTick === 'function') {\r\n\t\treturn process.nextTick.bind(process);\r\n\t}\r\n\tconst _promise = Promise.resolve();\r\n\treturn (callback: (...args: any[]) => void) => _promise.then(callback);\r\n})();\r\n\r\nexport const enum OperatingSystem {\r\n\tWindows = 1,\r\n\tMacintosh = 2,\r\n\tLinux = 3\r\n}\r\nexport const OS = (_isMacintosh ? OperatingSystem.Macintosh : (_isWindows ? OperatingSystem.Windows : OperatingSystem.Linux));\r\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\r\nimport { CharCode } from 'vs/base/common/charCode';\r\nimport { Constants } from 'vs/base/common/uint';\r\n\r\nexport function isFalsyOrWhitespace(str: string | undefined): boolean {\r\n\tif (!str || typeof str !== 'string') {\r\n\t\treturn true;\r\n\t}\r\n\treturn str.trim().length === 0;\r\n}\r\n\r\n/**\r\n * @returns the provided number with the given number of preceding zeros.\r\n */\r\nexport function pad(n: number, l: number, char: string = '0'): string {\r\n\tconst str = '' + n;\r\n\tconst r = [str];\r\n\r\n\tfor (let i = str.length; i < l; i++) {\r\n\t\tr.push(char);\r\n\t}\r\n\r\n\treturn r.reverse().join('');\r\n}\r\n\r\nconst _formatRegexp = /{(\\d+)}/g;\r\n\r\n/**\r\n * Helper to produce a string with a variable number of arguments. Insert variable segments\r\n * into the string using the {n} notation where N is the index of the argument following the string.\r\n * @param value string to which formatting is applied\r\n * @param args replacements for {n}-entries\r\n */\r\nexport function format(value: string, ...args: any[]): string {\r\n\tif (args.length === 0) {\r\n\t\treturn value;\r\n\t}\r\n\treturn value.replace(_formatRegexp, function (match, group) {\r\n\t\tconst idx = parseInt(group, 10);\r\n\t\treturn isNaN(idx) || idx < 0 || idx >= args.length ?\r\n\t\t\tmatch :\r\n\t\t\targs[idx];\r\n\t});\r\n}\r\n\r\n/**\r\n * Converts HTML characters inside the string to use entities instead. Makes the string safe from\r\n * being used e.g. in HTMLElement.innerHTML.\r\n */\r\nexport function escape(html: string): string {\r\n\treturn html.replace(/[<>&]/g, function (match) {\r\n\t\tswitch (match) {\r\n\t\t\tcase '<': return '&lt;';\r\n\t\t\tcase '>': return '&gt;';\r\n\t\t\tcase '&': return '&amp;';\r\n\t\t\tdefault: return match;\r\n\t\t}\r\n\t});\r\n}\r\n\r\n/**\r\n * Escapes regular expression characters in a given string\r\n */\r\nexport function escapeRegExpCharacters(value: string): string {\r\n\treturn value.replace(/[\\\\\\{\\}\\*\\+\\?\\|\\^\\$\\.\\[\\]\\(\\)]/g, '\\\\$&');\r\n}\r\n\r\n/**\r\n * Removes all occurrences of needle from the beginning and end of haystack.\r\n * @param haystack string to trim\r\n * @param needle the thing to trim (default is a blank)\r\n */\r\nexport function trim(haystack: string, needle: string = ' '): string {\r\n\tconst trimmed = ltrim(haystack, needle);\r\n\treturn rtrim(trimmed, needle);\r\n}\r\n\r\n/**\r\n * Removes all occurrences of needle from the beginning of haystack.\r\n * @param haystack string to trim\r\n * @param needle the thing to trim\r\n */\r\nexport function ltrim(haystack: string, needle: string): string {\r\n\tif (!haystack || !needle) {\r\n\t\treturn haystack;\r\n\t}\r\n\r\n\tconst needleLen = needle.length;\r\n\tif (needleLen === 0 || haystack.length === 0) {\r\n\t\treturn haystack;\r\n\t}\r\n\r\n\tlet offset = 0;\r\n\r\n\twhile (haystack.indexOf(needle, offset) === offset) {\r\n\t\toffset = offset + needleLen;\r\n\t}\r\n\treturn haystack.substring(offset);\r\n}\r\n\r\n/**\r\n * Removes all occurrences of needle from the end of haystack.\r\n * @param haystack string to trim\r\n * @param needle the thing to trim\r\n */\r\nexport function rtrim(haystack: string, needle: string): string {\r\n\tif (!haystack || !needle) {\r\n\t\treturn haystack;\r\n\t}\r\n\r\n\tconst needleLen = needle.length,\r\n\t\thaystackLen = haystack.length;\r\n\r\n\tif (needleLen === 0 || haystackLen === 0) {\r\n\t\treturn haystack;\r\n\t}\r\n\r\n\tlet offset = haystackLen,\r\n\t\tidx = -1;\r\n\r\n\twhile (true) {\r\n\t\tidx = haystack.lastIndexOf(needle, offset - 1);\r\n\t\tif (idx === -1 || idx + needleLen !== offset) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tif (idx === 0) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\toffset = idx;\r\n\t}\r\n\r\n\treturn haystack.substring(0, offset);\r\n}\r\n\r\nexport function convertSimple2RegExpPattern(pattern: string): string {\r\n\treturn pattern.replace(/[\\-\\\\\\{\\}\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, '\\\\$&').replace(/[\\*]/g, '.*');\r\n}\r\n\r\n/**\r\n * Determines if haystack starts with needle.\r\n */\r\nexport function startsWith(haystack: string, needle: string): boolean {\r\n\tif (haystack.length < needle.length) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (haystack === needle) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\tfor (let i = 0; i < needle.length; i++) {\r\n\t\tif (haystack[i] !== needle[i]) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n/**\r\n * Determines if haystack ends with needle.\r\n */\r\nexport function endsWith(haystack: string, needle: string): boolean {\r\n\tconst diff = haystack.length - needle.length;\r\n\tif (diff > 0) {\r\n\t\treturn haystack.indexOf(needle, diff) === diff;\r\n\t} else if (diff === 0) {\r\n\t\treturn haystack === needle;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nexport interface RegExpOptions {\r\n\tmatchCase?: boolean;\r\n\twholeWord?: boolean;\r\n\tmultiline?: boolean;\r\n\tglobal?: boolean;\r\n\tunicode?: boolean;\r\n}\r\n\r\nexport function createRegExp(searchString: string, isRegex: boolean, options: RegExpOptions = {}): RegExp {\r\n\tif (!searchString) {\r\n\t\tthrow new Error('Cannot create regex from empty string');\r\n\t}\r\n\tif (!isRegex) {\r\n\t\tsearchString = escapeRegExpCharacters(searchString);\r\n\t}\r\n\tif (options.wholeWord) {\r\n\t\tif (!/\\B/.test(searchString.charAt(0))) {\r\n\t\t\tsearchString = '\\\\b' + searchString;\r\n\t\t}\r\n\t\tif (!/\\B/.test(searchString.charAt(searchString.length - 1))) {\r\n\t\t\tsearchString = searchString + '\\\\b';\r\n\t\t}\r\n\t}\r\n\tlet modifiers = '';\r\n\tif (options.global) {\r\n\t\tmodifiers += 'g';\r\n\t}\r\n\tif (!options.matchCase) {\r\n\t\tmodifiers += 'i';\r\n\t}\r\n\tif (options.multiline) {\r\n\t\tmodifiers += 'm';\r\n\t}\r\n\tif (options.unicode) {\r\n\t\tmodifiers += 'u';\r\n\t}\r\n\r\n\treturn new RegExp(searchString, modifiers);\r\n}\r\n\r\nexport function regExpLeadsToEndlessLoop(regexp: RegExp): boolean {\r\n\t// Exit early if it's one of these special cases which are meant to match\r\n\t// against an empty string\r\n\tif (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\\\s*$') {\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// We check against an empty string. If the regular expression doesn't advance\r\n\t// (e.g. ends in an endless loop) it will match an empty string.\r\n\tconst match = regexp.exec('');\r\n\treturn !!(match && regexp.lastIndex === 0);\r\n}\r\n\r\nexport function regExpFlags(regexp: RegExp): string {\r\n\treturn (regexp.global ? 'g' : '')\r\n\t\t+ (regexp.ignoreCase ? 'i' : '')\r\n\t\t+ (regexp.multiline ? 'm' : '')\r\n\t\t+ ((regexp as any).unicode ? 'u' : '');\r\n}\r\n\r\n/**\r\n * Returns first index of the string that is not whitespace.\r\n * If string is empty or contains only whitespaces, returns -1\r\n */\r\nexport function firstNonWhitespaceIndex(str: string): number {\r\n\tfor (let i = 0, len = str.length; i < len; i++) {\r\n\t\tconst chCode = str.charCodeAt(i);\r\n\t\tif (chCode !== CharCode.Space && chCode !== CharCode.Tab) {\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n}\r\n\r\n/**\r\n * Returns the leading whitespace of the string.\r\n * If the string contains only whitespaces, returns entire string\r\n */\r\nexport function getLeadingWhitespace(str: string, start: number = 0, end: number = str.length): string {\r\n\tfor (let i = start; i < end; i++) {\r\n\t\tconst chCode = str.charCodeAt(i);\r\n\t\tif (chCode !== CharCode.Space && chCode !== CharCode.Tab) {\r\n\t\t\treturn str.substring(start, i);\r\n\t\t}\r\n\t}\r\n\treturn str.substring(start, end);\r\n}\r\n\r\n/**\r\n * Returns last index of the string that is not whitespace.\r\n * If string is empty or contains only whitespaces, returns -1\r\n */\r\nexport function lastNonWhitespaceIndex(str: string, startIndex: number = str.length - 1): number {\r\n\tfor (let i = startIndex; i >= 0; i--) {\r\n\t\tconst chCode = str.charCodeAt(i);\r\n\t\tif (chCode !== CharCode.Space && chCode !== CharCode.Tab) {\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n}\r\n\r\nexport function compare(a: string, b: string): number {\r\n\tif (a < b) {\r\n\t\treturn -1;\r\n\t} else if (a > b) {\r\n\t\treturn 1;\r\n\t} else {\r\n\t\treturn 0;\r\n\t}\r\n}\r\n\r\nexport function compareIgnoreCase(a: string, b: string): number {\r\n\tconst len = Math.min(a.length, b.length);\r\n\tfor (let i = 0; i < len; i++) {\r\n\t\tlet codeA = a.charCodeAt(i);\r\n\t\tlet codeB = b.charCodeAt(i);\r\n\r\n\t\tif (codeA === codeB) {\r\n\t\t\t// equal\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (isUpperAsciiLetter(codeA)) {\r\n\t\t\tcodeA += 32;\r\n\t\t}\r\n\r\n\t\tif (isUpperAsciiLetter(codeB)) {\r\n\t\t\tcodeB += 32;\r\n\t\t}\r\n\r\n\t\tconst diff = codeA - codeB;\r\n\r\n\t\tif (diff === 0) {\r\n\t\t\t// equal -> ignoreCase\r\n\t\t\tcontinue;\r\n\r\n\t\t} else if (isLowerAsciiLetter(codeA) && isLowerAsciiLetter(codeB)) {\r\n\t\t\t//\r\n\t\t\treturn diff;\r\n\r\n\t\t} else {\r\n\t\t\treturn compare(a.toLowerCase(), b.toLowerCase());\r\n\t\t}\r\n\t}\r\n\r\n\tif (a.length < b.length) {\r\n\t\treturn -1;\r\n\t} else if (a.length > b.length) {\r\n\t\treturn 1;\r\n\t} else {\r\n\t\treturn 0;\r\n\t}\r\n}\r\n\r\nexport function isLowerAsciiLetter(code: number): boolean {\r\n\treturn code >= CharCode.a && code <= CharCode.z;\r\n}\r\n\r\nexport function isUpperAsciiLetter(code: number): boolean {\r\n\treturn code >= CharCode.A && code <= CharCode.Z;\r\n}\r\n\r\nfunction isAsciiLetter(code: number): boolean {\r\n\treturn isLowerAsciiLetter(code) || isUpperAsciiLetter(code);\r\n}\r\n\r\nexport function equalsIgnoreCase(a: string, b: string): boolean {\r\n\treturn a.length === b.length && doEqualsIgnoreCase(a, b);\r\n}\r\n\r\nfunction doEqualsIgnoreCase(a: string, b: string, stopAt = a.length): boolean {\r\n\tfor (let i = 0; i < stopAt; i++) {\r\n\t\tconst codeA = a.charCodeAt(i);\r\n\t\tconst codeB = b.charCodeAt(i);\r\n\r\n\t\tif (codeA === codeB) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// a-z A-Z\r\n\t\tif (isAsciiLetter(codeA) && isAsciiLetter(codeB)) {\r\n\t\t\tconst diff = Math.abs(codeA - codeB);\r\n\t\t\tif (diff !== 0 && diff !== 32) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Any other charcode\r\n\t\telse {\r\n\t\t\tif (String.fromCharCode(codeA).toLowerCase() !== String.fromCharCode(codeB).toLowerCase()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\nexport function startsWithIgnoreCase(str: string, candidate: string): boolean {\r\n\tconst candidateLength = candidate.length;\r\n\tif (candidate.length > str.length) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn doEqualsIgnoreCase(str, candidate, candidateLength);\r\n}\r\n\r\n/**\r\n * @returns the length of the common prefix of the two strings.\r\n */\r\nexport function commonPrefixLength(a: string, b: string): number {\r\n\r\n\tlet i: number,\r\n\t\tlen = Math.min(a.length, b.length);\r\n\r\n\tfor (i = 0; i < len; i++) {\r\n\t\tif (a.charCodeAt(i) !== b.charCodeAt(i)) {\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n\r\n\treturn len;\r\n}\r\n\r\n/**\r\n * @returns the length of the common suffix of the two strings.\r\n */\r\nexport function commonSuffixLength(a: string, b: string): number {\r\n\r\n\tlet i: number,\r\n\t\tlen = Math.min(a.length, b.length);\r\n\r\n\tconst aLastIndex = a.length - 1;\r\n\tconst bLastIndex = b.length - 1;\r\n\r\n\tfor (i = 0; i < len; i++) {\r\n\t\tif (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) {\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n\r\n\treturn len;\r\n}\r\n\r\n// --- unicode\r\n// http://en.wikipedia.org/wiki/Surrogate_pair\r\n// Returns the code point starting at a specified index in a string\r\n// Code points U+0000 to U+D7FF and U+E000 to U+FFFF are represented on a single character\r\n// Code points U+10000 to U+10FFFF are represented on two consecutive characters\r\n//export function getUnicodePoint(str:string, index:number, len:number):number {\r\n//\tconst chrCode = str.charCodeAt(index);\r\n//\tif (0xD800 <= chrCode && chrCode <= 0xDBFF && index + 1 < len) {\r\n//\t\tconst nextChrCode = str.charCodeAt(index + 1);\r\n//\t\tif (0xDC00 <= nextChrCode && nextChrCode <= 0xDFFF) {\r\n//\t\t\treturn (chrCode - 0xD800) << 10 + (nextChrCode - 0xDC00) + 0x10000;\r\n//\t\t}\r\n//\t}\r\n//\treturn chrCode;\r\n//}\r\nexport function isHighSurrogate(charCode: number): boolean {\r\n\treturn (0xD800 <= charCode && charCode <= 0xDBFF);\r\n}\r\n\r\nexport function isLowSurrogate(charCode: number): boolean {\r\n\treturn (0xDC00 <= charCode && charCode <= 0xDFFF);\r\n}\r\n\r\n/**\r\n * get the code point that begins at offset `offset`\r\n */\r\nexport function getNextCodePoint(str: string, len: number, offset: number): number {\r\n\tconst charCode = str.charCodeAt(offset);\r\n\tif (isHighSurrogate(charCode) && offset + 1 < len) {\r\n\t\tconst nextCharCode = str.charCodeAt(offset + 1);\r\n\t\tif (isLowSurrogate(nextCharCode)) {\r\n\t\t\treturn ((charCode - 0xD800) << 10) + (nextCharCode - 0xDC00) + 0x10000;\r\n\t\t}\r\n\t}\r\n\treturn charCode;\r\n}\r\n\r\n/**\r\n * get the code point that ends right before offset `offset`\r\n */\r\nfunction getPrevCodePoint(str: string, offset: number): number {\r\n\tconst charCode = str.charCodeAt(offset - 1);\r\n\tif (isLowSurrogate(charCode) && offset > 1) {\r\n\t\tconst prevCharCode = str.charCodeAt(offset - 2);\r\n\t\tif (isHighSurrogate(prevCharCode)) {\r\n\t\t\treturn ((prevCharCode - 0xD800) << 10) + (charCode - 0xDC00) + 0x10000;\r\n\t\t}\r\n\t}\r\n\treturn charCode;\r\n}\r\n\r\nexport function nextCharLength(str: string, offset: number): number {\r\n\tconst graphemeBreakTree = GraphemeBreakTree.getInstance();\r\n\tconst initialOffset = offset;\r\n\tconst len = str.length;\r\n\r\n\tconst initialCodePoint = getNextCodePoint(str, len, offset);\r\n\toffset += (initialCodePoint >= Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN ? 2 : 1);\r\n\r\n\tlet graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);\r\n\twhile (offset < len) {\r\n\t\tconst nextCodePoint = getNextCodePoint(str, len, offset);\r\n\t\tconst nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(nextCodePoint);\r\n\t\tif (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\toffset += (nextCodePoint >= Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN ? 2 : 1);\r\n\t\tgraphemeBreakType = nextGraphemeBreakType;\r\n\t}\r\n\r\n\treturn (offset - initialOffset);\r\n}\r\n\r\nexport function prevCharLength(str: string, offset: number): number {\r\n\tconst graphemeBreakTree = GraphemeBreakTree.getInstance();\r\n\tconst initialOffset = offset;\r\n\r\n\tconst initialCodePoint = getPrevCodePoint(str, offset);\r\n\toffset -= (initialCodePoint >= Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN ? 2 : 1);\r\n\r\n\tlet graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);\r\n\twhile (offset > 0) {\r\n\t\tconst prevCodePoint = getPrevCodePoint(str, offset);\r\n\t\tconst prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(prevCodePoint);\r\n\t\tif (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\toffset -= (prevCodePoint >= Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN ? 2 : 1);\r\n\t\tgraphemeBreakType = prevGraphemeBreakType;\r\n\t}\r\n\r\n\treturn (initialOffset - offset);\r\n}\r\n\r\n/**\r\n * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-rtl-test.js\r\n */\r\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])/;\r\n\r\n/**\r\n * Returns true if `str` contains any Unicode character that is classified as \"R\" or \"AL\".\r\n */\r\nexport function containsRTL(str: string): boolean {\r\n\treturn CONTAINS_RTL.test(str);\r\n}\r\n\r\n/**\r\n * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js\r\n */\r\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])/;\r\n\r\nexport function containsEmoji(str: string): boolean {\r\n\treturn CONTAINS_EMOJI.test(str);\r\n}\r\n\r\nconst IS_BASIC_ASCII = /^[\\t\\n\\r\\x20-\\x7E]*$/;\r\n/**\r\n * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \\n, \\r, \\t\r\n */\r\nexport function isBasicASCII(str: string): boolean {\r\n\treturn IS_BASIC_ASCII.test(str);\r\n}\r\n\r\nexport function containsFullWidthCharacter(str: string): boolean {\r\n\tfor (let i = 0, len = str.length; i < len; i++) {\r\n\t\tif (isFullWidthCharacter(str.charCodeAt(i))) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nexport function isFullWidthCharacter(charCode: number): boolean {\r\n\t// Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns\r\n\t// http://jrgraphix.net/research/unicode_blocks.php\r\n\t// 2E80 — 2EFF CJK Radicals Supplement\r\n\t// 2F00 — 2FDF Kangxi Radicals\r\n\t// 2FF0 — 2FFF Ideographic Description Characters\r\n\t// 3000 — 303F CJK Symbols and Punctuation\r\n\t// 3040 — 309F Hiragana\r\n\t// 30A0 — 30FF Katakana\r\n\t// 3100 — 312F Bopomofo\r\n\t// 3130 — 318F Hangul Compatibility Jamo\r\n\t// 3190 — 319F Kanbun\r\n\t// 31A0 — 31BF Bopomofo Extended\r\n\t// 31F0 — 31FF Katakana Phonetic Extensions\r\n\t// 3200 — 32FF Enclosed CJK Letters and Months\r\n\t// 3300 — 33FF CJK Compatibility\r\n\t// 3400 — 4DBF CJK Unified Ideographs Extension A\r\n\t// 4DC0 — 4DFF Yijing Hexagram Symbols\r\n\t// 4E00 — 9FFF CJK Unified Ideographs\r\n\t// A000 — A48F Yi Syllables\r\n\t// A490 — A4CF Yi Radicals\r\n\t// AC00 — D7AF Hangul Syllables\r\n\t// [IGNORE] D800 — DB7F High Surrogates\r\n\t// [IGNORE] DB80 — DBFF High Private Use Surrogates\r\n\t// [IGNORE] DC00 — DFFF Low Surrogates\r\n\t// [IGNORE] E000 — F8FF Private Use Area\r\n\t// F900 — FAFF CJK Compatibility Ideographs\r\n\t// [IGNORE] FB00 — FB4F Alphabetic Presentation Forms\r\n\t// [IGNORE] FB50 — FDFF Arabic Presentation Forms-A\r\n\t// [IGNORE] FE00 — FE0F Variation Selectors\r\n\t// [IGNORE] FE20 — FE2F Combining Half Marks\r\n\t// [IGNORE] FE30 — FE4F CJK Compatibility Forms\r\n\t// [IGNORE] FE50 — FE6F Small Form Variants\r\n\t// [IGNORE] FE70 — FEFF Arabic Presentation Forms-B\r\n\t// FF00 — FFEF Halfwidth and Fullwidth Forms\r\n\t// [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms]\r\n\t// of which FF01 - FF5E fullwidth ASCII of 21 to 7E\r\n\t// [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul\r\n\t// [IGNORE] FFF0 — FFFF Specials\r\n\tcharCode = +charCode; // @perf\r\n\treturn (\r\n\t\t(charCode >= 0x2E80 && charCode <= 0xD7AF)\r\n\t\t|| (charCode >= 0xF900 && charCode <= 0xFAFF)\r\n\t\t|| (charCode >= 0xFF01 && charCode <= 0xFF5E)\r\n\t);\r\n}\r\n\r\n/**\r\n * A fast function (therefore imprecise) to check if code points are emojis.\r\n * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js\r\n */\r\nexport function isEmojiImprecise(x: number): boolean {\r\n\treturn (\r\n\t\t(x >= 0x1F1E6 && x <= 0x1F1FF) || (x >= 9728 && x <= 10175) || (x >= 127744 && x <= 128591)\r\n\t\t|| (x >= 128640 && x <= 128764) || (x >= 128992 && x <= 129003) || (x >= 129280 && x <= 129535)\r\n\t\t|| (x >= 129648 && x <= 129651) || (x >= 129656 && x <= 129666) || (x >= 129680 && x <= 129685)\r\n\t);\r\n}\r\n\r\n\r\n// -- UTF-8 BOM\r\n\r\nexport const UTF8_BOM_CHARACTER = String.fromCharCode(CharCode.UTF8_BOM);\r\n\r\nexport function startsWithUTF8BOM(str: string): boolean {\r\n\treturn !!(str && str.length > 0 && str.charCodeAt(0) === CharCode.UTF8_BOM);\r\n}\r\n\r\nexport function safeBtoa(str: string): string {\r\n\treturn btoa(encodeURIComponent(str)); // we use encodeURIComponent because btoa fails for non Latin 1 values\r\n}\r\n\r\nexport function repeat(s: string, count: number): string {\r\n\tlet result = '';\r\n\tfor (let i = 0; i < count; i++) {\r\n\t\tresult += s;\r\n\t}\r\n\treturn result;\r\n}\r\n\r\nexport function containsUppercaseCharacter(target: string, ignoreEscapedChars = false): boolean {\r\n\tif (!target) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (ignoreEscapedChars) {\r\n\t\ttarget = target.replace(/\\\\./g, '');\r\n\t}\r\n\r\n\treturn target.toLowerCase() !== target;\r\n}\r\n\r\n/**\r\n * Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc.\r\n */\r\nexport function singleLetterHash(n: number): string {\r\n\tconst LETTERS_CNT = (CharCode.Z - CharCode.A + 1);\r\n\r\n\tn = n % (2 * LETTERS_CNT);\r\n\r\n\tif (n < LETTERS_CNT) {\r\n\t\treturn String.fromCharCode(CharCode.a + n);\r\n\t}\r\n\r\n\treturn String.fromCharCode(CharCode.A + n - LETTERS_CNT);\r\n}\r\n\r\n//#region Unicode Grapheme Break\r\n\r\nexport function getGraphemeBreakType(codePoint: number): GraphemeBreakType {\r\n\tconst graphemeBreakTree = GraphemeBreakTree.getInstance();\r\n\treturn graphemeBreakTree.getGraphemeBreakType(codePoint);\r\n}\r\n\r\nexport function breakBetweenGraphemeBreakType(breakTypeA: GraphemeBreakType, breakTypeB: GraphemeBreakType): boolean {\r\n\t// http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules\r\n\r\n\t// !!! Let's make the common case a bit faster\r\n\tif (breakTypeA === GraphemeBreakType.Other) {\r\n\t\t// see https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest-13.0.0d10.html#table\r\n\t\treturn (breakTypeB !== GraphemeBreakType.Extend && breakTypeB !== GraphemeBreakType.SpacingMark);\r\n\t}\r\n\r\n\t// Do not break between a CR and LF. Otherwise, break before and after controls.\r\n\t// GB3 CR × LF\r\n\t// GB4 (Control | CR | LF) ÷\r\n\t// GB5 ÷ (Control | CR | LF)\r\n\tif (breakTypeA === GraphemeBreakType.CR) {\r\n\t\tif (breakTypeB === GraphemeBreakType.LF) {\r\n\t\t\treturn false; // GB3\r\n\t\t}\r\n\t}\r\n\tif (breakTypeA === GraphemeBreakType.Control || breakTypeA === GraphemeBreakType.CR || breakTypeA === GraphemeBreakType.LF) {\r\n\t\treturn true; // GB4\r\n\t}\r\n\tif (breakTypeB === GraphemeBreakType.Control || breakTypeB === GraphemeBreakType.CR || breakTypeB === GraphemeBreakType.LF) {\r\n\t\treturn true; // GB5\r\n\t}\r\n\r\n\t// Do not break Hangul syllable sequences.\r\n\t// GB6 L × (L | V | LV | LVT)\r\n\t// GB7 (LV | V) × (V | T)\r\n\t// GB8 (LVT | T) × T\r\n\tif (breakTypeA === GraphemeBreakType.L) {\r\n\t\tif (breakTypeB === GraphemeBreakType.L || breakTypeB === GraphemeBreakType.V || breakTypeB === GraphemeBreakType.LV || breakTypeB === GraphemeBreakType.LVT) {\r\n\t\t\treturn false; // GB6\r\n\t\t}\r\n\t}\r\n\tif (breakTypeA === GraphemeBreakType.LV || breakTypeA === GraphemeBreakType.V) {\r\n\t\tif (breakTypeB === GraphemeBreakType.V || breakTypeB === GraphemeBreakType.T) {\r\n\t\t\treturn false; // GB7\r\n\t\t}\r\n\t}\r\n\tif (breakTypeA === GraphemeBreakType.LVT || breakTypeA === GraphemeBreakType.T) {\r\n\t\tif (breakTypeB === GraphemeBreakType.T) {\r\n\t\t\treturn false; // GB8\r\n\t\t}\r\n\t}\r\n\r\n\t// Do not break before extending characters or ZWJ.\r\n\t// GB9 × (Extend | ZWJ)\r\n\tif (breakTypeB === GraphemeBreakType.Extend || breakTypeB === GraphemeBreakType.ZWJ) {\r\n\t\treturn false; // GB9\r\n\t}\r\n\r\n\t// The GB9a and GB9b rules only apply to extended grapheme clusters:\r\n\t// Do not break before SpacingMarks, or after Prepend characters.\r\n\t// GB9a × SpacingMark\r\n\t// GB9b Prepend ×\r\n\tif (breakTypeB === GraphemeBreakType.SpacingMark) {\r\n\t\treturn false; // GB9a\r\n\t}\r\n\tif (breakTypeA === GraphemeBreakType.Prepend) {\r\n\t\treturn false; // GB9b\r\n\t}\r\n\r\n\t// Do not break within emoji modifier sequences or emoji zwj sequences.\r\n\t// GB11 \\p{Extended_Pictographic} Extend* ZWJ × \\p{Extended_Pictographic}\r\n\tif (breakTypeA === GraphemeBreakType.ZWJ && breakTypeB === GraphemeBreakType.Extended_Pictographic) {\r\n\t\t// Note: we are not implementing the rule entirely here to avoid introducing states\r\n\t\treturn false; // GB11\r\n\t}\r\n\r\n\t// GB12 sot (RI RI)* RI × RI\r\n\t// GB13 [^RI] (RI RI)* RI × RI\r\n\tif (breakTypeA === GraphemeBreakType.Regional_Indicator && breakTypeB === GraphemeBreakType.Regional_Indicator) {\r\n\t\t// Note: we are not implementing the rule entirely here to avoid introducing states\r\n\t\treturn false; // GB12 & GB13\r\n\t}\r\n\r\n\t// GB999 Any ÷ Any\r\n\treturn true;\r\n}\r\n\r\nexport const enum GraphemeBreakType {\r\n\tOther = 0,\r\n\tPrepend = 1,\r\n\tCR = 2,\r\n\tLF = 3,\r\n\tControl = 4,\r\n\tExtend = 5,\r\n\tRegional_Indicator = 6,\r\n\tSpacingMark = 7,\r\n\tL = 8,\r\n\tV = 9,\r\n\tT = 10,\r\n\tLV = 11,\r\n\tLVT = 12,\r\n\tZWJ = 13,\r\n\tExtended_Pictographic = 14\r\n}\r\n\r\nclass GraphemeBreakTree {\r\n\r\n\tprivate static _INSTANCE: GraphemeBreakTree | null = null;\r\n\tpublic static getInstance(): GraphemeBreakTree {\r\n\t\tif (!GraphemeBreakTree._INSTANCE) {\r\n\t\t\tGraphemeBreakTree._INSTANCE = new GraphemeBreakTree();\r\n\t\t}\r\n\t\treturn GraphemeBreakTree._INSTANCE;\r\n\t}\r\n\r\n\tprivate readonly _data: number[];\r\n\r\n\tconstructor() {\r\n\t\tthis._data = getGraphemeBreakRawData();\r\n\t}\r\n\r\n\tpublic getGraphemeBreakType(codePoint: number): GraphemeBreakType {\r\n\t\t// !!! Let's make 7bit ASCII a bit faster: 0..31\r\n\t\tif (codePoint < 32) {\r\n\t\t\tif (codePoint === CharCode.LineFeed) {\r\n\t\t\t\treturn GraphemeBreakType.LF;\r\n\t\t\t}\r\n\t\t\tif (codePoint === CharCode.CarriageReturn) {\r\n\t\t\t\treturn GraphemeBreakType.CR;\r\n\t\t\t}\r\n\t\t\treturn GraphemeBreakType.Control;\r\n\t\t}\r\n\t\t// !!! Let's make 7bit ASCII a bit faster: 32..126\r\n\t\tif (codePoint < 127) {\r\n\t\t\treturn GraphemeBreakType.Other;\r\n\t\t}\r\n\r\n\t\tconst data = this._data;\r\n\t\tconst nodeCount = data.length / 3;\r\n\t\tlet nodeIndex = 1;\r\n\t\twhile (nodeIndex <= nodeCount) {\r\n\t\t\tif (codePoint < data[3 * nodeIndex]) {\r\n\t\t\t\t// go left\r\n\t\t\t\tnodeIndex = 2 * nodeIndex;\r\n\t\t\t} else if (codePoint > data[3 * nodeIndex + 1]) {\r\n\t\t\t\t// go right\r\n\t\t\t\tnodeIndex = 2 * nodeIndex + 1;\r\n\t\t\t} else {\r\n\t\t\t\t// hit\r\n\t\t\t\treturn data[3 * nodeIndex + 2];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn GraphemeBreakType.Other;\r\n\t}\r\n}\r\n\r\nfunction getGraphemeBreakRawData(): number[] {\r\n\t// generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-grapheme-break.js\r\n\treturn 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]');\r\n}\r\n\r\n//#endregion\r\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\r\nconst _typeof = {\r\n\tnumber: 'number',\r\n\tstring: 'string',\r\n\tundefined: 'undefined',\r\n\tobject: 'object',\r\n\tfunction: 'function'\r\n};\r\n\r\n/**\r\n * @returns whether the provided parameter is a JavaScript Array or not.\r\n */\r\nexport function isArray(array: any): array is any[] {\r\n\tif (Array.isArray) {\r\n\t\treturn Array.isArray(array);\r\n\t}\r\n\r\n\tif (array && typeof (array.length) === _typeof.number && array.constructor === Array) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}\r\n\r\n/**\r\n * @returns whether the provided parameter is a JavaScript String or not.\r\n */\r\nexport function isString(str: any): str is string {\r\n\tif (typeof (str) === _typeof.string || str instanceof String) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}\r\n\r\n/**\r\n *\r\n * @returns whether the provided parameter is of type `object` but **not**\r\n *\t`null`, an `array`, a `regexp`, nor a `date`.\r\n */\r\nexport function isObject(obj: any): obj is Object {\r\n\t// The method can't do a type cast since there are type (like strings) which\r\n\t// are subclasses of any put not positvely matched by the function. Hence type\r\n\t// narrowing results in wrong results.\r\n\treturn typeof obj === _typeof.object\r\n\t\t&& obj !== null\r\n\t\t&& !Array.isArray(obj)\r\n\t\t&& !(obj instanceof RegExp)\r\n\t\t&& !(obj instanceof Date);\r\n}\r\n\r\n/**\r\n * In **contrast** to just checking `typeof` this will return `false` for `NaN`.\r\n * @returns whether the provided parameter is a JavaScript Number or not.\r\n */\r\nexport function isNumber(obj: any): obj is number {\r\n\tif ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}\r\n\r\n/**\r\n * @returns whether the provided parameter is a JavaScript Boolean or not.\r\n */\r\nexport function isBoolean(obj: any): obj is boolean {\r\n\treturn obj === true || obj === false;\r\n}\r\n\r\n/**\r\n * @returns whether the provided parameter is undefined.\r\n */\r\nexport function isUndefined(obj: any): obj is undefined {\r\n\treturn typeof (obj) === _typeof.undefined;\r\n}\r\n\r\n/**\r\n * @returns whether the provided parameter is undefined or null.\r\n */\r\nexport function isUndefinedOrNull(obj: any): obj is undefined | null {\r\n\treturn isUndefined(obj) || obj === null;\r\n}\r\n\r\n\r\nexport function assertType(condition: any, type?: string): asserts condition {\r\n\tif (!condition) {\r\n\t\tthrow new Error(type ? `Unexpected type, expected '${type}'` : 'Unexpected type');\r\n\t}\r\n}\r\n\r\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\r\n\r\n/**\r\n * @returns whether the provided parameter is an empty JavaScript Object or not.\r\n */\r\nexport function isEmptyObject(obj: any): obj is any {\r\n\tif (!isObject(obj)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfor (let key in obj) {\r\n\t\tif (hasOwnProperty.call(obj, key)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n/**\r\n * @returns whether the provided parameter is a JavaScript Function or not.\r\n */\r\nexport function isFunction(obj: any): obj is Function {\r\n\treturn typeof obj === _typeof.function;\r\n}\r\n\r\nexport type TypeConstraint = string | Function;\r\n\r\nexport function validateConstraints(args: any[], constraints: Array<TypeConstraint | undefined>): void {\r\n\tconst len = Math.min(args.length, constraints.length);\r\n\tfor (let i = 0; i < len; i++) {\r\n\t\tvalidateConstraint(args[i], constraints[i]);\r\n\t}\r\n}\r\n\r\nexport function validateConstraint(arg: any, constraint: TypeConstraint | undefined): void {\r\n\r\n\tif (isString(constraint)) {\r\n\t\tif (typeof arg !== constraint) {\r\n\t\t\tthrow new Error(`argument does not match constraint: typeof ${constraint}`);\r\n\t\t}\r\n\t} else if (isFunction(constraint)) {\r\n\t\ttry {\r\n\t\t\tif (arg instanceof constraint) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t} catch{\r\n\t\t\t// ignore\r\n\t\t}\r\n\t\tif (!isUndefinedOrNull(arg) && arg.constructor === constraint) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (constraint.length === 1 && constraint.call(undefined, arg) === true) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthrow new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`);\r\n\t}\r\n}\r\n\r\nexport function getAllPropertyNames(obj: object): string[] {\r\n\tlet res: string[] = [];\r\n\tlet proto = Object.getPrototypeOf(obj);\r\n\twhile (Object.prototype !== proto) {\r\n\t\tres = res.concat(Object.getOwnPropertyNames(proto));\r\n\t\tproto = Object.getPrototypeOf(proto);\r\n\t}\r\n\treturn res;\r\n}\r\n\r\nexport function getAllMethodNames(obj: object): string[] {\r\n\tconst methods: string[] = [];\r\n\tfor (const prop of getAllPropertyNames(obj)) {\r\n\t\tif (typeof (obj as any)[prop] === 'function') {\r\n\t\t\tmethods.push(prop);\r\n\t\t}\r\n\t}\r\n\treturn methods;\r\n}\r\n\r\nexport function createProxyObject<T extends object>(methodNames: string[], invoke: (method: string, args: any[]) => any): T {\r\n\tconst createProxyMethod = (method: string): () => any => {\r\n\t\treturn function () {\r\n\t\t\tconst args = Array.prototype.slice.call(arguments, 0);\r\n\t\t\treturn invoke(method, args);\r\n\t\t};\r\n\t};\r\n\r\n\tlet result = {} as T;\r\n\tfor (const methodName of methodNames) {\r\n\t\t(<any>result)[methodName] = createProxyMethod(methodName);\r\n\t}\r\n\treturn result;\r\n}\r\n\r\n/**\r\n * Converts null to undefined, passes all other values through.\r\n */\r\nexport function withNullAsUndefined<T>(x: T | null): T | undefined {\r\n\treturn x === null ? undefined : x;\r\n}\r\n\r\n/**\r\n * Converts undefined to null, passes all other values through.\r\n */\r\nexport function withUndefinedAsNull<T>(x: T | undefined): T | null {\r\n\treturn typeof x === 'undefined' ? null : x;\r\n}\r\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\r\nexport const enum Constants {\r\n\t/**\r\n\t * MAX SMI (SMall Integer) as defined in v8.\r\n\t * one bit is lost for boxing/unboxing flag.\r\n\t * one bit is lost for sign flag.\r\n\t * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values\r\n\t */\r\n\tMAX_SAFE_SMALL_INTEGER = 1 << 30,\r\n\r\n\t/**\r\n\t * MIN SMI (SMall Integer) as defined in v8.\r\n\t * one bit is lost for boxing/unboxing flag.\r\n\t * one bit is lost for sign flag.\r\n\t * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values\r\n\t */\r\n\tMIN_SAFE_SMALL_INTEGER = -(1 << 30),\r\n\r\n\t/**\r\n\t * Max unsigned integer that fits on 8 bits.\r\n\t */\r\n\tMAX_UINT_8 = 255, // 2^8 - 1\r\n\r\n\t/**\r\n\t * Max unsigned integer that fits on 16 bits.\r\n\t */\r\n\tMAX_UINT_16 = 65535, // 2^16 - 1\r\n\r\n\t/**\r\n\t * Max unsigned integer that fits on 32 bits.\r\n\t */\r\n\tMAX_UINT_32 = 4294967295, // 2^32 - 1\r\n\r\n\tUNICODE_SUPPLEMENTARY_PLANE_BEGIN = 0x010000\r\n}\r\n\r\nexport function toUint8(v: number): number {\r\n\tif (v < 0) {\r\n\t\treturn 0;\r\n\t}\r\n\tif (v > Constants.MAX_UINT_8) {\r\n\t\treturn Constants.MAX_UINT_8;\r\n\t}\r\n\treturn v | 0;\r\n}\r\n\r\nexport function toUint32(v: number): number {\r\n\tif (v < 0) {\r\n\t\treturn 0;\r\n\t}\r\n\tif (v > Constants.MAX_UINT_32) {\r\n\t\treturn Constants.MAX_UINT_32;\r\n\t}\r\n\treturn v | 0;\r\n}\r\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\r\nimport { isWindows } from 'vs/base/common/platform';\r\nimport { CharCode } from 'vs/base/common/charCode';\r\n\r\nconst _schemePattern = /^\\w[\\w\\d+.-]*$/;\r\nconst _singleSlashStart = /^\\//;\r\nconst _doubleSlashStart = /^\\/\\//;\r\n\r\nfunction _validateUri(ret: URI, _strict?: boolean): void {\r\n\r\n\t// scheme, must be set\r\n\tif (!ret.scheme && _strict) {\r\n\t\tthrow new Error(`[UriError]: Scheme is missing: {scheme: \"\", authority: \"${ret.authority}\", path: \"${ret.path}\", query: \"${ret.query}\", fragment: \"${ret.fragment}\"}`);\r\n\t}\r\n\r\n\t// scheme, https://tools.ietf.org/html/rfc3986#section-3.1\r\n\t// ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\r\n\tif (ret.scheme && !_schemePattern.test(ret.scheme)) {\r\n\t\tthrow new Error('[UriError]: Scheme contains illegal characters.');\r\n\t}\r\n\r\n\t// path, http://tools.ietf.org/html/rfc3986#section-3.3\r\n\t// If a URI contains an authority component, then the path component\r\n\t// must either be empty or begin with a slash (\"/\") character. If a URI\r\n\t// does not contain an authority component, then the path cannot begin\r\n\t// with two slash characters (\"//\").\r\n\tif (ret.path) {\r\n\t\tif (ret.authority) {\r\n\t\t\tif (!_singleSlashStart.test(ret.path)) {\r\n\t\t\t\tthrow new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (_doubleSlashStart.test(ret.path)) {\r\n\t\t\t\tthrow new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// for a while we allowed uris *without* schemes and this is the migration\r\n// for them, e.g. an uri without scheme and without strict-mode warns and falls\r\n// back to the file-scheme. that should cause the least carnage and still be a\r\n// clear warning\r\nfunction _schemeFix(scheme: string, _strict: boolean): string {\r\n\tif (!scheme && !_strict) {\r\n\t\treturn 'file';\r\n\t}\r\n\treturn scheme;\r\n}\r\n\r\n// implements a bit of https://tools.ietf.org/html/rfc3986#section-5\r\nfunction _referenceResolution(scheme: string, path: string): string {\r\n\r\n\t// the slash-character is our 'default base' as we don't\r\n\t// support constructing URIs relative to other URIs. This\r\n\t// also means that we alter and potentially break paths.\r\n\t// see https://tools.ietf.org/html/rfc3986#section-5.1.4\r\n\tswitch (scheme) {\r\n\t\tcase 'https':\r\n\t\tcase 'http':\r\n\t\tcase 'file':\r\n\t\t\tif (!path) {\r\n\t\t\t\tpath = _slash;\r\n\t\t\t} else if (path[0] !== _slash) {\r\n\t\t\t\tpath = _slash + path;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\treturn path;\r\n}\r\n\r\nconst _empty = '';\r\nconst _slash = '/';\r\nconst _regexp = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\r\n\r\n/**\r\n * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.\r\n * This class is a simple parser which creates the basic component parts\r\n * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation\r\n * and encoding.\r\n *\r\n * foo://example.com:8042/over/there?name=ferret#nose\r\n * \\_/ \\______________/\\_________/ \\_________/ \\__/\r\n * | | | | |\r\n * scheme authority path query fragment\r\n * | _____________________|__\r\n * / \\ / \\\r\n * urn:example:animal:ferret:nose\r\n */\r\nexport class URI implements UriComponents {\r\n\r\n\tstatic isUri(thing: any): thing is URI {\r\n\t\tif (thing instanceof URI) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (!thing) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn typeof (<URI>thing).authority === 'string'\r\n\t\t\t&& typeof (<URI>thing).fragment === 'string'\r\n\t\t\t&& typeof (<URI>thing).path === 'string'\r\n\t\t\t&& typeof (<URI>thing).query === 'string'\r\n\t\t\t&& typeof (<URI>thing).scheme === 'string'\r\n\t\t\t&& typeof (<URI>thing).fsPath === 'function'\r\n\t\t\t&& typeof (<URI>thing).with === 'function'\r\n\t\t\t&& typeof (<URI>thing).toString === 'function';\r\n\t}\r\n\r\n\t/**\r\n\t * scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'.\r\n\t * The part before the first colon.\r\n\t */\r\n\treadonly scheme: string;\r\n\r\n\t/**\r\n\t * authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'.\r\n\t * The part between the first double slashes and the next slash.\r\n\t */\r\n\treadonly authority: string;\r\n\r\n\t/**\r\n\t * path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'.\r\n\t */\r\n\treadonly path: string;\r\n\r\n\t/**\r\n\t * query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'.\r\n\t */\r\n\treadonly query: string;\r\n\r\n\t/**\r\n\t * fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'.\r\n\t */\r\n\treadonly fragment: string;\r\n\r\n\t/**\r\n\t * @internal\r\n\t */\r\n\tprotected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string, _strict?: boolean);\r\n\r\n\t/**\r\n\t * @internal\r\n\t */\r\n\tprotected constructor(components: UriComponents);\r\n\r\n\t/**\r\n\t * @internal\r\n\t */\r\n\tprotected constructor(schemeOrData: string | UriComponents, authority?: string, path?: string, query?: string, fragment?: string, _strict: boolean = false) {\r\n\r\n\t\tif (typeof schemeOrData === 'object') {\r\n\t\t\tthis.scheme = schemeOrData.scheme || _empty;\r\n\t\t\tthis.authority = schemeOrData.authority || _empty;\r\n\t\t\tthis.path = schemeOrData.path || _empty;\r\n\t\t\tthis.query = schemeOrData.query || _empty;\r\n\t\t\tthis.fragment = schemeOrData.fragment || _empty;\r\n\t\t\t// no validation because it's this URI\r\n\t\t\t// that creates uri components.\r\n\t\t\t// _validateUri(this);\r\n\t\t} else {\r\n\t\t\tthis.scheme = _schemeFix(schemeOrData, _strict);\r\n\t\t\tthis.authority = authority || _empty;\r\n\t\t\tthis.path = _referenceResolution(this.scheme, path || _empty);\r\n\t\t\tthis.query = query || _empty;\r\n\t\t\tthis.fragment = fragment || _empty;\r\n\r\n\t\t\t_validateUri(this, _strict);\r\n\t\t}\r\n\t}\r\n\r\n\t// ---- filesystem path -----------------------\r\n\r\n\t/**\r\n\t * Returns a string representing the corresponding file system path of this URI.\r\n\t * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the\r\n\t * platform specific path separator.\r\n\t *\r\n\t * * Will *not* validate the path for invalid characters and semantics.\r\n\t * * Will *not* look at the scheme of this URI.\r\n\t * * The result shall *not* be used for display purposes but for accessing a file on disk.\r\n\t *\r\n\t *\r\n\t * The *difference* to `URI#path` is the use of the platform specific separator and the handling\r\n\t * of UNC paths. See the below sample of a file-uri with an authority (UNC path).\r\n\t *\r\n\t * ```ts\r\n\t\tconst u = URI.parse('file://server/c$/folder/file.txt')\r\n\t\tu.authority === 'server'\r\n\t\tu.path === '/shares/c$/file.txt'\r\n\t\tu.fsPath === '\\\\server\\c$\\folder\\file.txt'\r\n\t```\r\n\t *\r\n\t * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,\r\n\t * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working\r\n\t * with URIs that represent files on disk (`file` scheme).\r\n\t */\r\n\tget fsPath(): string {\r\n\t\t// if (this.scheme !== 'file') {\r\n\t\t// \tconsole.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);\r\n\t\t// }\r\n\t\treturn _makeFsPath(this);\r\n\t}\r\n\r\n\t// ---- modify to new -------------------------\r\n\r\n\twith(change: { scheme?: string; authority?: string | null; path?: string | null; query?: string | null; fragment?: string | null }): URI {\r\n\r\n\t\tif (!change) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tlet { scheme, authority, path, query, fragment } = change;\r\n\t\tif (scheme === undefined) {\r\n\t\t\tscheme = this.scheme;\r\n\t\t} else if (scheme === null) {\r\n\t\t\tscheme = _empty;\r\n\t\t}\r\n\t\tif (authority === undefined) {\r\n\t\t\tauthority = this.authority;\r\n\t\t} else if (authority === null) {\r\n\t\t\tauthority = _empty;\r\n\t\t}\r\n\t\tif (path === undefined) {\r\n\t\t\tpath = this.path;\r\n\t\t} else if (path === null) {\r\n\t\t\tpath = _empty;\r\n\t\t}\r\n\t\tif (query === undefined) {\r\n\t\t\tquery = this.query;\r\n\t\t} else if (query === null) {\r\n\t\t\tquery = _empty;\r\n\t\t}\r\n\t\tif (fragment === undefined) {\r\n\t\t\tfragment = this.fragment;\r\n\t\t} else if (fragment === null) {\r\n\t\t\tfragment = _empty;\r\n\t\t}\r\n\r\n\t\tif (scheme === this.scheme\r\n\t\t\t&& authority === this.authority\r\n\t\t\t&& path === this.path\r\n\t\t\t&& query === this.query\r\n\t\t\t&& fragment === this.fragment) {\r\n\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\treturn new _URI(scheme, authority, path, query, fragment);\r\n\t}\r\n\r\n\t// ---- parse & validate ------------------------\r\n\r\n\t/**\r\n\t * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`,\r\n\t * `file:///usr/home`, or `scheme:with/path`.\r\n\t *\r\n\t * @param value A string which represents an URI (see `URI#toString`).\r\n\t */\r\n\tstatic parse(value: string, _strict: boolean = false): URI {\r\n\t\tconst match = _regexp.exec(value);\r\n\t\tif (!match) {\r\n\t\t\treturn new _URI(_empty, _empty, _empty, _empty, _empty);\r\n\t\t}\r\n\t\treturn new _URI(\r\n\t\t\tmatch[2] || _empty,\r\n\t\t\tpercentDecode(match[4] || _empty),\r\n\t\t\tpercentDecode(match[5] || _empty),\r\n\t\t\tpercentDecode(match[7] || _empty),\r\n\t\t\tpercentDecode(match[9] || _empty),\r\n\t\t\t_strict\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a new URI from a file system path, e.g. `c:\\my\\files`,\r\n\t * `/usr/home`, or `\\\\server\\share\\some\\path`.\r\n\t *\r\n\t * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument\r\n\t * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**\r\n\t * `URI.parse('file://' + path)` because the path might contain characters that are\r\n\t * interpreted (# and ?). See the following sample:\r\n\t * ```ts\r\n\tconst good = URI.file('/coding/c#/project1');\r\n\tgood.scheme === 'file';\r\n\tgood.path === '/coding/c#/project1';\r\n\tgood.fragment === '';\r\n\tconst bad = URI.parse('file://' + '/coding/c#/project1');\r\n\tbad.scheme === 'file';\r\n\tbad.path === '/coding/c'; // path is now broken\r\n\tbad.fragment === '/project1';\r\n\t```\r\n\t *\r\n\t * @param path A file system path (see `URI#fsPath`)\r\n\t */\r\n\tstatic file(path: string): URI {\r\n\r\n\t\tlet authority = _empty;\r\n\r\n\t\t// normalize to fwd-slashes on windows,\r\n\t\t// on other systems bwd-slashes are valid\r\n\t\t// filename character, eg /f\\oo/ba\\r.txt\r\n\t\tif (isWindows) {\r\n\t\t\tpath = path.replace(/\\\\/g, _slash);\r\n\t\t}\r\n\r\n\t\t// check for authority as used in UNC shares\r\n\t\t// or use the path as given\r\n\t\tif (path[0] === _slash && path[1] === _slash) {\r\n\t\t\tconst idx = path.indexOf(_slash, 2);\r\n\t\t\tif (idx === -1) {\r\n\t\t\t\tauthority = path.substring(2);\r\n\t\t\t\tpath = _slash;\r\n\t\t\t} else {\r\n\t\t\t\tauthority = path.substring(2, idx);\r\n\t\t\t\tpath = path.substring(idx) || _slash;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn new _URI('file', authority, path, _empty, _empty);\r\n\t}\r\n\r\n\tstatic from(components: { scheme: string; authority?: string; path?: string; query?: string; fragment?: string }): URI {\r\n\t\treturn new _URI(\r\n\t\t\tcomponents.scheme,\r\n\t\t\tcomponents.authority,\r\n\t\t\tcomponents.path,\r\n\t\t\tcomponents.query,\r\n\t\t\tcomponents.fragment,\r\n\t\t);\r\n\t}\r\n\r\n\t// ---- printing/externalize ---------------------------\r\n\r\n\t/**\r\n\t * Creates a string representation for this URI. It's guaranteed that calling\r\n\t * `URI.parse` with the result of this function creates an URI which is equal\r\n\t * to this URI.\r\n\t *\r\n\t * * The result shall *not* be used for display purposes but for externalization or transport.\r\n\t * * The result will be encoded using the percentage encoding and encoding happens mostly\r\n\t * ignore the scheme-specific encoding rules.\r\n\t *\r\n\t * @param skipEncoding Do not encode the result, default is `false`\r\n\t */\r\n\ttoString(skipEncoding: boolean = false): string {\r\n\t\treturn _asFormatted(this, skipEncoding);\r\n\t}\r\n\r\n\ttoJSON(): UriComponents {\r\n\t\treturn this;\r\n\t}\r\n\r\n\tstatic revive(data: UriComponents | URI): URI;\r\n\tstatic revive(data: UriComponents | URI | undefined): URI | undefined;\r\n\tstatic revive(data: UriComponents | URI | null): URI | null;\r\n\tstatic revive(data: UriComponents | URI | undefined | null): URI | undefined | null;\r\n\tstatic revive(data: UriComponents | URI | undefined | null): URI | undefined | null {\r\n\t\tif (!data) {\r\n\t\t\treturn data;\r\n\t\t} else if (data instanceof URI) {\r\n\t\t\treturn data;\r\n\t\t} else {\r\n\t\t\tconst result = new _URI(data);\r\n\t\t\tresult._formatted = (<UriState>data).external;\r\n\t\t\tresult._fsPath = (<UriState>data)._sep === _pathSepMarker ? (<UriState>data).fsPath : null;\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport interface UriComponents {\r\n\tscheme: string;\r\n\tauthority: string;\r\n\tpath: string;\r\n\tquery: string;\r\n\tfragment: string;\r\n}\r\n\r\ninterface UriState extends UriComponents {\r\n\t$mid: number;\r\n\texternal: string;\r\n\tfsPath: string;\r\n\t_sep: 1 | undefined;\r\n}\r\n\r\nconst _pathSepMarker = isWindows ? 1 : undefined;\r\n\r\n// eslint-disable-next-line @typescript-eslint/class-name-casing\r\nclass _URI extends URI {\r\n\r\n\t_formatted: string | null = null;\r\n\t_fsPath: string | null = null;\r\n\r\n\tget fsPath(): string {\r\n\t\tif (!this._fsPath) {\r\n\t\t\tthis._fsPath = _makeFsPath(this);\r\n\t\t}\r\n\t\treturn this._fsPath;\r\n\t}\r\n\r\n\ttoString(skipEncoding: boolean = false): string {\r\n\t\tif (!skipEncoding) {\r\n\t\t\tif (!this._formatted) {\r\n\t\t\t\tthis._formatted = _asFormatted(this, false);\r\n\t\t\t}\r\n\t\t\treturn this._formatted;\r\n\t\t} else {\r\n\t\t\t// we don't cache that\r\n\t\t\treturn _asFormatted(this, true);\r\n\t\t}\r\n\t}\r\n\r\n\ttoJSON(): UriComponents {\r\n\t\tconst res = <UriState>{\r\n\t\t\t$mid: 1\r\n\t\t};\r\n\t\t// cached state\r\n\t\tif (this._fsPath) {\r\n\t\t\tres.fsPath = this._fsPath;\r\n\t\t\tres._sep = _pathSepMarker;\r\n\t\t}\r\n\t\tif (this._formatted) {\r\n\t\t\tres.external = this._formatted;\r\n\t\t}\r\n\t\t// uri components\r\n\t\tif (this.path) {\r\n\t\t\tres.path = this.path;\r\n\t\t}\r\n\t\tif (this.scheme) {\r\n\t\t\tres.scheme = this.scheme;\r\n\t\t}\r\n\t\tif (this.authority) {\r\n\t\t\tres.authority = this.authority;\r\n\t\t}\r\n\t\tif (this.query) {\r\n\t\t\tres.query = this.query;\r\n\t\t}\r\n\t\tif (this.fragment) {\r\n\t\t\tres.fragment = this.fragment;\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n}\r\n\r\n// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2\r\nconst encodeTable: { [ch: number]: string } = {\r\n\t[CharCode.Colon]: '%3A', // gen-delims\r\n\t[CharCode.Slash]: '%2F',\r\n\t[CharCode.QuestionMark]: '%3F',\r\n\t[CharCode.Hash]: '%23',\r\n\t[CharCode.OpenSquareBracket]: '%5B',\r\n\t[CharCode.CloseSquareBracket]: '%5D',\r\n\t[CharCode.AtSign]: '%40',\r\n\r\n\t[CharCode.ExclamationMark]: '%21', // sub-delims\r\n\t[CharCode.DollarSign]: '%24',\r\n\t[CharCode.Ampersand]: '%26',\r\n\t[CharCode.SingleQuote]: '%27',\r\n\t[CharCode.OpenParen]: '%28',\r\n\t[CharCode.CloseParen]: '%29',\r\n\t[CharCode.Asterisk]: '%2A',\r\n\t[CharCode.Plus]: '%2B',\r\n\t[CharCode.Comma]: '%2C',\r\n\t[CharCode.Semicolon]: '%3B',\r\n\t[CharCode.Equals]: '%3D',\r\n\r\n\t[CharCode.Space]: '%20',\r\n};\r\n\r\nfunction encodeURIComponentFast(uriComponent: string, allowSlash: boolean): string {\r\n\tlet res: string | undefined = undefined;\r\n\tlet nativeEncodePos = -1;\r\n\r\n\tfor (let pos = 0; pos < uriComponent.length; pos++) {\r\n\t\tconst code = uriComponent.charCodeAt(pos);\r\n\r\n\t\t// unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3\r\n\t\tif (\r\n\t\t\t(code >= CharCode.a && code <= CharCode.z)\r\n\t\t\t|| (code >= CharCode.A && code <= CharCode.Z)\r\n\t\t\t|| (code >= CharCode.Digit0 && code <= CharCode.Digit9)\r\n\t\t\t|| code === CharCode.Dash\r\n\t\t\t|| code === CharCode.Period\r\n\t\t\t|| code === CharCode.Underline\r\n\t\t\t|| code === CharCode.Tilde\r\n\t\t\t|| (allowSlash && code === CharCode.Slash)\r\n\t\t) {\r\n\t\t\t// check if we are delaying native encode\r\n\t\t\tif (nativeEncodePos !== -1) {\r\n\t\t\t\tres += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\r\n\t\t\t\tnativeEncodePos = -1;\r\n\t\t\t}\r\n\t\t\t// check if we write into a new string (by default we try to return the param)\r\n\t\t\tif (res !== undefined) {\r\n\t\t\t\tres += uriComponent.charAt(pos);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// encoding needed, we need to allocate a new string\r\n\t\t\tif (res === undefined) {\r\n\t\t\t\tres = uriComponent.substr(0, pos);\r\n\t\t\t}\r\n\r\n\t\t\t// check with default table first\r\n\t\t\tconst escaped = encodeTable[code];\r\n\t\t\tif (escaped !== undefined) {\r\n\r\n\t\t\t\t// check if we are delaying native encode\r\n\t\t\t\tif (nativeEncodePos !== -1) {\r\n\t\t\t\t\tres += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\r\n\t\t\t\t\tnativeEncodePos = -1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// append escaped variant to result\r\n\t\t\t\tres += escaped;\r\n\r\n\t\t\t} else if (nativeEncodePos === -1) {\r\n\t\t\t\t// use native encode only when needed\r\n\t\t\t\tnativeEncodePos = pos;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (nativeEncodePos !== -1) {\r\n\t\tres += encodeURIComponent(uriComponent.substring(nativeEncodePos));\r\n\t}\r\n\r\n\treturn res !== undefined ? res : uriComponent;\r\n}\r\n\r\nfunction encodeURIComponentMinimal(path: string): string {\r\n\tlet res: string | undefined = undefined;\r\n\tfor (let pos = 0; pos < path.length; pos++) {\r\n\t\tconst code = path.charCodeAt(pos);\r\n\t\tif (code === CharCode.Hash || code === CharCode.QuestionMark) {\r\n\t\t\tif (res === undefined) {\r\n\t\t\t\tres = path.substr(0, pos);\r\n\t\t\t}\r\n\t\t\tres += encodeTable[code];\r\n\t\t} else {\r\n\t\t\tif (res !== undefined) {\r\n\t\t\t\tres += path[pos];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn res !== undefined ? res : path;\r\n}\r\n\r\n/**\r\n * Compute `fsPath` for the given uri\r\n */\r\nfunction _makeFsPath(uri: URI): string {\r\n\r\n\tlet value: string;\r\n\tif (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\r\n\t\t// unc path: file://shares/c$/far/boo\r\n\t\tvalue = `//${uri.authority}${uri.path}`;\r\n\t} else if (\r\n\t\turi.path.charCodeAt(0) === CharCode.Slash\r\n\t\t&& (uri.path.charCodeAt(1) >= CharCode.A && uri.path.charCodeAt(1) <= CharCode.Z || uri.path.charCodeAt(1) >= CharCode.a && uri.path.charCodeAt(1) <= CharCode.z)\r\n\t\t&& uri.path.charCodeAt(2) === CharCode.Colon\r\n\t) {\r\n\t\t// windows drive letter: file:///c:/far/boo\r\n\t\tvalue = uri.path[1].toLowerCase() + uri.path.substr(2);\r\n\t} else {\r\n\t\t// other path\r\n\t\tvalue = uri.path;\r\n\t}\r\n\tif (isWindows) {\r\n\t\tvalue = value.replace(/\\//g, '\\\\');\r\n\t}\r\n\treturn value;\r\n}\r\n\r\n/**\r\n * Create the external version of a uri\r\n */\r\nfunction _asFormatted(uri: URI, skipEncoding: boolean): string {\r\n\r\n\tconst encoder = !skipEncoding\r\n\t\t? encodeURIComponentFast\r\n\t\t: encodeURIComponentMinimal;\r\n\r\n\tlet res = '';\r\n\tlet { scheme, authority, path, query, fragment } = uri;\r\n\tif (scheme) {\r\n\t\tres += scheme;\r\n\t\tres += ':';\r\n\t}\r\n\tif (authority || scheme === 'file') {\r\n\t\tres += _slash;\r\n\t\tres += _slash;\r\n\t}\r\n\tif (authority) {\r\n\t\tlet idx = authority.indexOf('@');\r\n\t\tif (idx !== -1) {\r\n\t\t\t// <user>@<auth>\r\n\t\t\tconst userinfo = authority.substr(0, idx);\r\n\t\t\tauthority = authority.substr(idx + 1);\r\n\t\t\tidx = userinfo.indexOf(':');\r\n\t\t\tif (idx === -1) {\r\n\t\t\t\tres += encoder(userinfo, false);\r\n\t\t\t} else {\r\n\t\t\t\t// <user>:<pass>@<auth>\r\n\t\t\t\tres += encoder(userinfo.substr(0, idx), false);\r\n\t\t\t\tres += ':';\r\n\t\t\t\tres += encoder(userinfo.substr(idx + 1), false);\r\n\t\t\t}\r\n\t\t\tres += '@';\r\n\t\t}\r\n\t\tauthority = authority.toLowerCase();\r\n\t\tidx = authority.indexOf(':');\r\n\t\tif (idx === -1) {\r\n\t\t\tres += encoder(authority, false);\r\n\t\t} else {\r\n\t\t\t// <auth>:<port>\r\n\t\t\tres += encoder(authority.substr(0, idx), false);\r\n\t\t\tres += authority.substr(idx);\r\n\t\t}\r\n\t}\r\n\tif (path) {\r\n\t\t// lower-case windows drive letters in /C:/fff or C:/fff\r\n\t\tif (path.length >= 3 && path.charCodeAt(0) === CharCode.Slash && path.charCodeAt(2) === CharCode.Colon) {\r\n\t\t\tconst code = path.charCodeAt(1);\r\n\t\t\tif (code >= CharCode.A && code <= CharCode.Z) {\r\n\t\t\t\tpath = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; // \"/c:\".length === 3\r\n\t\t\t}\r\n\t\t} else if (path.length >= 2 && path.charCodeAt(1) === CharCode.Colon) {\r\n\t\t\tconst code = path.charCodeAt(0);\r\n\t\t\tif (code >= CharCode.A && code <= CharCode.Z) {\r\n\t\t\t\tpath = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; // \"/c:\".length === 3\r\n\t\t\t}\r\n\t\t}\r\n\t\t// encode the rest of the path\r\n\t\tres += encoder(path, true);\r\n\t}\r\n\tif (query) {\r\n\t\tres += '?';\r\n\t\tres += encoder(query, false);\r\n\t}\r\n\tif (fragment) {\r\n\t\tres += '#';\r\n\t\tres += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;\r\n\t}\r\n\treturn res;\r\n}\r\n\r\n// --- decode\r\n\r\nfunction decodeURIComponentGraceful(str: string): string {\r\n\ttry {\r\n\t\treturn decodeURIComponent(str);\r\n\t} catch {\r\n\t\tif (str.length > 3) {\r\n\t\t\treturn str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));\r\n\t\t} else {\r\n\t\t\treturn str;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nconst _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;\r\n\r\nfunction percentDecode(str: string): string {\r\n\tif (!str.match(_rEncodedAsHex)) {\r\n\t\treturn str;\r\n\t}\r\n\treturn str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match));\r\n}\r\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\r\nimport { transformErrorForSerialization } from 'vs/base/common/errors';\r\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\r\nimport { isWeb } from 'vs/base/common/platform';\r\nimport * as types from 'vs/base/common/types';\r\n\r\nconst INITIALIZE = '$initialize';\r\n\r\nexport interface IWorker extends IDisposable {\r\n\tgetId(): number;\r\n\tpostMessage(message: any, transfer: ArrayBuffer[]): void;\r\n}\r\n\r\nexport interface IWorkerCallback {\r\n\t(message: any): void;\r\n}\r\n\r\nexport interface IWorkerFactory {\r\n\tcreate(moduleId: string, callback: IWorkerCallback, onErrorCallback: (err: any) => void): IWorker;\r\n}\r\n\r\nlet webWorkerWarningLogged = false;\r\nexport function logOnceWebWorkerWarning(err: any): void {\r\n\tif (!isWeb) {\r\n\t\t// running tests\r\n\t\treturn;\r\n\t}\r\n\tif (!webWorkerWarningLogged) {\r\n\t\twebWorkerWarningLogged = true;\r\n\t\tconsole.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');\r\n\t}\r\n\tconsole.warn(err.message);\r\n}\r\n\r\ninterface IMessage {\r\n\tvsWorker: number;\r\n\treq?: string;\r\n\tseq?: string;\r\n}\r\n\r\ninterface IRequestMessage extends IMessage {\r\n\treq: string;\r\n\tmethod: string;\r\n\targs: any[];\r\n}\r\n\r\ninterface IReplyMessage extends IMessage {\r\n\tseq: string;\r\n\terr: any;\r\n\tres: any;\r\n}\r\n\r\ninterface IMessageReply {\r\n\tresolve: (value?: any) => void;\r\n\treject: (error?: any) => void;\r\n}\r\n\r\ninterface IMessageHandler {\r\n\tsendMessage(msg: any, transfer?: ArrayBuffer[]): void;\r\n\thandleMessage(method: string, args: any[]): Promise<any>;\r\n}\r\n\r\nclass SimpleWorkerProtocol {\r\n\r\n\tprivate _workerId: number;\r\n\tprivate _lastSentReq: number;\r\n\tprivate _pendingReplies: { [req: string]: IMessageReply; };\r\n\tprivate _handler: IMessageHandler;\r\n\r\n\tconstructor(handler: IMessageHandler) {\r\n\t\tthis._workerId = -1;\r\n\t\tthis._handler = handler;\r\n\t\tthis._lastSentReq = 0;\r\n\t\tthis._pendingReplies = Object.create(null);\r\n\t}\r\n\r\n\tpublic setWorkerId(workerId: number): void {\r\n\t\tthis._workerId = workerId;\r\n\t}\r\n\r\n\tpublic sendMessage(method: string, args: any[]): Promise<any> {\r\n\t\tlet req = String(++this._lastSentReq);\r\n\t\treturn new Promise<any>((resolve, reject) => {\r\n\t\t\tthis._pendingReplies[req] = {\r\n\t\t\t\tresolve: resolve,\r\n\t\t\t\treject: reject\r\n\t\t\t};\r\n\t\t\tthis._send({\r\n\t\t\t\tvsWorker: this._workerId,\r\n\t\t\t\treq: req,\r\n\t\t\t\tmethod: method,\r\n\t\t\t\targs: args\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tpublic handleMessage(message: IMessage): void {\r\n\t\tif (!message || !message.vsWorker) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (this._workerId !== -1 && message.vsWorker !== this._workerId) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._handleMessage(message);\r\n\t}\r\n\r\n\tprivate _handleMessage(msg: IMessage): void {\r\n\t\tif (msg.seq) {\r\n\t\t\tlet replyMessage = <IReplyMessage>msg;\r\n\t\t\tif (!this._pendingReplies[replyMessage.seq]) {\r\n\t\t\t\tconsole.warn('Got reply to unknown seq');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tlet reply = this._pendingReplies[replyMessage.seq];\r\n\t\t\tdelete this._pendingReplies[replyMessage.seq];\r\n\r\n\t\t\tif (replyMessage.err) {\r\n\t\t\t\tlet err = replyMessage.err;\r\n\t\t\t\tif (replyMessage.err.$isError) {\r\n\t\t\t\t\terr = new Error();\r\n\t\t\t\t\terr.name = replyMessage.err.name;\r\n\t\t\t\t\terr.message = replyMessage.err.message;\r\n\t\t\t\t\terr.stack = replyMessage.err.stack;\r\n\t\t\t\t}\r\n\t\t\t\treply.reject(err);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\treply.resolve(replyMessage.res);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet requestMessage = <IRequestMessage>msg;\r\n\t\tlet req = requestMessage.req;\r\n\t\tlet result = this._handler.handleMessage(requestMessage.method, requestMessage.args);\r\n\t\tresult.then((r) => {\r\n\t\t\tthis._send({\r\n\t\t\t\tvsWorker: this._workerId,\r\n\t\t\t\tseq: req,\r\n\t\t\t\tres: r,\r\n\t\t\t\terr: undefined\r\n\t\t\t});\r\n\t\t}, (e) => {\r\n\t\t\tif (e.detail instanceof Error) {\r\n\t\t\t\t// Loading errors have a detail property that points to the actual error\r\n\t\t\t\te.detail = transformErrorForSerialization(e.detail);\r\n\t\t\t}\r\n\t\t\tthis._send({\r\n\t\t\t\tvsWorker: this._workerId,\r\n\t\t\t\tseq: req,\r\n\t\t\t\tres: undefined,\r\n\t\t\t\terr: transformErrorForSerialization(e)\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _send(msg: IRequestMessage | IReplyMessage): void {\r\n\t\tlet transfer: ArrayBuffer[] = [];\r\n\t\tif (msg.req) {\r\n\t\t\tconst m = <IRequestMessage>msg;\r\n\t\t\tfor (let i = 0; i < m.args.length; i++) {\r\n\t\t\t\tif (m.args[i] instanceof ArrayBuffer) {\r\n\t\t\t\t\ttransfer.push(m.args[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst m = <IReplyMessage>msg;\r\n\t\t\tif (m.res instanceof ArrayBuffer) {\r\n\t\t\t\ttransfer.push(m.res);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis._handler.sendMessage(msg, transfer);\r\n\t}\r\n}\r\n\r\nexport interface IWorkerClient<W> {\r\n\tgetProxyObject(): Promise<W>;\r\n\tdispose(): void;\r\n}\r\n\r\n/**\r\n * Main thread side\r\n */\r\nexport class SimpleWorkerClient<W extends object, H extends object> extends Disposable implements IWorkerClient<W> {\r\n\r\n\tprivate readonly _worker: IWorker;\r\n\tprivate readonly _onModuleLoaded: Promise<string[]>;\r\n\tprivate readonly _protocol: SimpleWorkerProtocol;\r\n\tprivate readonly _lazyProxy: Promise<W>;\r\n\r\n\tconstructor(workerFactory: IWorkerFactory, moduleId: string, host: H) {\r\n\t\tsuper();\r\n\r\n\t\tlet lazyProxyReject: ((err: any) => void) | null = null;\r\n\r\n\t\tthis._worker = this._register(workerFactory.create(\r\n\t\t\t'vs/base/common/worker/simpleWorker',\r\n\t\t\t(msg: any) => {\r\n\t\t\t\tthis._protocol.handleMessage(msg);\r\n\t\t\t},\r\n\t\t\t(err: any) => {\r\n\t\t\t\t// in Firefox, web workers fail lazily :(\r\n\t\t\t\t// we will reject the proxy\r\n\t\t\t\tif (lazyProxyReject) {\r\n\t\t\t\t\tlazyProxyReject(err);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t));\r\n\r\n\t\tthis._protocol = new SimpleWorkerProtocol({\r\n\t\t\tsendMessage: (msg: any, transfer: ArrayBuffer[]): void => {\r\n\t\t\t\tthis._worker.postMessage(msg, transfer);\r\n\t\t\t},\r\n\t\t\thandleMessage: (method: string, args: any[]): Promise<any> => {\r\n\t\t\t\tif (typeof (host as any)[method] !== 'function') {\r\n\t\t\t\t\treturn Promise.reject(new Error('Missing method ' + method + ' on main thread host.'));\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\treturn Promise.resolve((host as any)[method].apply(host, args));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\treturn Promise.reject(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis._protocol.setWorkerId(this._worker.getId());\r\n\r\n\t\t// Gather loader configuration\r\n\t\tlet loaderConfiguration: any = null;\r\n\t\tif (typeof (<any>self).require !== 'undefined' && typeof (<any>self).require.getConfig === 'function') {\r\n\t\t\t// Get the configuration from the Monaco AMD Loader\r\n\t\t\tloaderConfiguration = (<any>self).require.getConfig();\r\n\t\t} else if (typeof (<any>self).requirejs !== 'undefined') {\r\n\t\t\t// Get the configuration from requirejs\r\n\t\t\tloaderConfiguration = (<any>self).requirejs.s.contexts._.config;\r\n\t\t}\r\n\r\n\t\tconst hostMethods = types.getAllMethodNames(host);\r\n\r\n\t\t// Send initialize message\r\n\t\tthis._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [\r\n\t\t\tthis._worker.getId(),\r\n\t\t\tJSON.parse(JSON.stringify(loaderConfiguration)),\r\n\t\t\tmoduleId,\r\n\t\t\thostMethods,\r\n\t\t]);\r\n\r\n\t\t// Create proxy to loaded code\r\n\t\tconst proxyMethodRequest = (method: string, args: any[]): Promise<any> => {\r\n\t\t\treturn this._request(method, args);\r\n\t\t};\r\n\r\n\t\tthis._lazyProxy = new Promise<W>((resolve, reject) => {\r\n\t\t\tlazyProxyReject = reject;\r\n\t\t\tthis._onModuleLoaded.then((availableMethods: string[]) => {\r\n\t\t\t\tresolve(types.createProxyObject<W>(availableMethods, proxyMethodRequest));\r\n\t\t\t}, (e) => {\r\n\t\t\t\treject(e);\r\n\t\t\t\tthis._onError('Worker failed to load ' + moduleId, e);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tpublic getProxyObject(): Promise<W> {\r\n\t\treturn this._lazyProxy;\r\n\t}\r\n\r\n\tprivate _request(method: string, args: any[]): Promise<any> {\r\n\t\treturn new Promise<any>((resolve, reject) => {\r\n\t\t\tthis._onModuleLoaded.then(() => {\r\n\t\t\t\tthis._protocol.sendMessage(method, args).then(resolve, reject);\r\n\t\t\t}, reject);\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _onError(message: string, error?: any): void {\r\n\t\tconsole.error(message);\r\n\t\tconsole.info(error);\r\n\t}\r\n}\r\n\r\nexport interface IRequestHandler {\r\n\t_requestHandlerBrand: any;\r\n\t[prop: string]: any;\r\n}\r\n\r\nexport interface IRequestHandlerFactory<H> {\r\n\t(host: H): IRequestHandler;\r\n}\r\n\r\n/**\r\n * Worker side\r\n */\r\nexport class SimpleWorkerServer<H extends object> {\r\n\r\n\tprivate _requestHandlerFactory: IRequestHandlerFactory<H> | null;\r\n\tprivate _requestHandler: IRequestHandler | null;\r\n\tprivate _protocol: SimpleWorkerProtocol;\r\n\r\n\tconstructor(postMessage: (msg: any, transfer?: ArrayBuffer[]) => void, requestHandlerFactory: IRequestHandlerFactory<H> | null) {\r\n\t\tthis._requestHandlerFactory = requestHandlerFactory;\r\n\t\tthis._requestHandler = null;\r\n\t\tthis._protocol = new SimpleWorkerProtocol({\r\n\t\t\tsendMessage: (msg: any, transfer: ArrayBuffer[]): void => {\r\n\t\t\t\tpostMessage(msg, transfer);\r\n\t\t\t},\r\n\t\t\thandleMessage: (method: string, args: any[]): Promise<any> => this._handleMessage(method, args)\r\n\t\t});\r\n\t}\r\n\r\n\tpublic onmessage(msg: any): void {\r\n\t\tthis._protocol.handleMessage(msg);\r\n\t}\r\n\r\n\tprivate _handleMessage(method: string, args: any[]): Promise<any> {\r\n\t\tif (method === INITIALIZE) {\r\n\t\t\treturn this.initialize(<number>args[0], <any>args[1], <string>args[2], <string[]>args[3]);\r\n\t\t}\r\n\r\n\t\tif (!this._requestHandler || typeof this._requestHandler[method] !== 'function') {\r\n\t\t\treturn Promise.reject(new Error('Missing requestHandler or method: ' + method));\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\treturn Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args));\r\n\t\t} catch (e) {\r\n\t\t\treturn Promise.reject(e);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate initialize(workerId: number, loaderConfig: any, moduleId: string, hostMethods: string[]): Promise<string[]> {\r\n\t\tthis._protocol.setWorkerId(workerId);\r\n\r\n\t\tconst proxyMethodRequest = (method: string, args: any[]): Promise<any> => {\r\n\t\t\treturn this._protocol.sendMessage(method, args);\r\n\t\t};\r\n\r\n\t\tconst hostProxy = types.createProxyObject<H>(hostMethods, proxyMethodRequest);\r\n\r\n\t\tif (this._requestHandlerFactory) {\r\n\t\t\t// static request handler\r\n\t\t\tthis._requestHandler = this._requestHandlerFactory(hostProxy);\r\n\t\t\treturn Promise.resolve(types.getAllMethodNames(this._requestHandler));\r\n\t\t}\r\n\r\n\t\tif (loaderConfig) {\r\n\t\t\t// Remove 'baseUrl', handling it is beyond scope for now\r\n\t\t\tif (typeof loaderConfig.baseUrl !== 'undefined') {\r\n\t\t\t\tdelete loaderConfig['baseUrl'];\r\n\t\t\t}\r\n\t\t\tif (typeof loaderConfig.paths !== 'undefined') {\r\n\t\t\t\tif (typeof loaderConfig.paths.vs !== 'undefined') {\r\n\t\t\t\t\tdelete loaderConfig.paths['vs'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Since this is in a web worker, enable catching errors\r\n\t\t\tloaderConfig.catchError = true;\r\n\t\t\t(<any>self).require.config(loaderConfig);\r\n\t\t}\r\n\r\n\t\treturn new Promise<string[]>((resolve, reject) => {\r\n\t\t\t// Use the global require to be sure to get the global config\r\n\t\t\t(<any>self).require([moduleId], (module: { create: IRequestHandlerFactory<H> }) => {\r\n\t\t\t\tthis._requestHandler = module.create(hostProxy);\r\n\r\n\t\t\t\tif (!this._requestHandler) {\r\n\t\t\t\t\treject(new Error(`No RequestHandler!`));\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve(types.getAllMethodNames(this._requestHandler));\r\n\t\t\t}, reject);\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Called on the worker side\r\n */\r\nexport function create(postMessage: (msg: string) => void): SimpleWorkerServer<any> {\r\n\treturn new SimpleWorkerServer(postMessage, null);\r\n}\r\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\r\nimport { toUint8 } from 'vs/base/common/uint';\r\n\r\n/**\r\n * A fast character classifier that uses a compact array for ASCII values.\r\n */\r\nexport class CharacterClassifier<T extends number> {\r\n\t/**\r\n\t * Maintain a compact (fully initialized ASCII map for quickly classifying ASCII characters - used more often in code).\r\n\t */\r\n\tprotected _asciiMap: Uint8Array;\r\n\r\n\t/**\r\n\t * The entire map (sparse array).\r\n\t */\r\n\tprotected _map: Map<number, number>;\r\n\r\n\tprotected _defaultValue: number;\r\n\r\n\tconstructor(_defaultValue: T) {\r\n\t\tlet defaultValue = toUint8(_defaultValue);\r\n\r\n\t\tthis._defaultValue = defaultValue;\r\n\t\tthis._asciiMap = CharacterClassifier._createAsciiMap(defaultValue);\r\n\t\tthis._map = new Map<number, number>();\r\n\t}\r\n\r\n\tprivate static _createAsciiMap(defaultValue: number): Uint8Array {\r\n\t\tlet asciiMap: Uint8Array = new Uint8Array(256);\r\n\t\tfor (let i = 0; i < 256; i++) {\r\n\t\t\tasciiMap[i] = defaultValue;\r\n\t\t}\r\n\t\treturn asciiMap;\r\n\t}\r\n\r\n\tpublic set(charCode: number, _value: T): void {\r\n\t\tlet value = toUint8(_value);\r\n\r\n\t\tif (charCode >= 0 && charCode < 256) {\r\n\t\t\tthis._asciiMap[charCode] = value;\r\n\t\t} else {\r\n\t\t\tthis._map.set(charCode, value);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic get(charCode: number): T {\r\n\t\tif (charCode >= 0 && charCode < 256) {\r\n\t\t\treturn <T>this._asciiMap[charCode];\r\n\t\t} else {\r\n\t\t\treturn <T>(this._map.get(charCode) || this._defaultValue);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nconst enum Boolean {\r\n\tFalse = 0,\r\n\tTrue = 1\r\n}\r\n\r\nexport class CharacterSet {\r\n\r\n\tprivate readonly _actual: CharacterClassifier<Boolean>;\r\n\r\n\tconstructor() {\r\n\t\tthis._actual = new CharacterClassifier<Boolean>(Boolean.False);\r\n\t}\r\n\r\n\tpublic add(charCode: number): void {\r\n\t\tthis._actual.set(charCode, Boolean.True);\r\n\t}\r\n\r\n\tpublic has(charCode: number): boolean {\r\n\t\treturn (this._actual.get(charCode) === Boolean.True);\r\n\t}\r\n}\r\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\r\n/**\r\n * A position in the editor. This interface is suitable for serialization.\r\n */\r\nexport interface IPosition {\r\n\t/**\r\n\t * line number (starts at 1)\r\n\t */\r\n\treadonly lineNumber: number;\r\n\t/**\r\n\t * column (the first character in a line is between column 1 and column 2)\r\n\t */\r\n\treadonly column: number;\r\n}\r\n\r\n/**\r\n * A position in the editor.\r\n */\r\nexport class Position {\r\n\t/**\r\n\t * line number (starts at 1)\r\n\t */\r\n\tpublic readonly lineNumber: number;\r\n\t/**\r\n\t * column (the first character in a line is between column 1 and column 2)\r\n\t */\r\n\tpublic readonly column: number;\r\n\r\n\tconstructor(lineNumber: number, column: number) {\r\n\t\tthis.lineNumber = lineNumber;\r\n\t\tthis.column = column;\r\n\t}\r\n\r\n\t/**\r\n\t * Create a new position from this position.\r\n\t *\r\n\t * @param newLineNumber new line number\r\n\t * @param newColumn new column\r\n\t */\r\n\twith(newLineNumber: number = this.lineNumber, newColumn: number = this.column): Position {\r\n\t\tif (newLineNumber === this.lineNumber && newColumn === this.column) {\r\n\t\t\treturn this;\r\n\t\t} else {\r\n\t\t\treturn new Position(newLineNumber, newColumn);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Derive a new position from this position.\r\n\t *\r\n\t * @param deltaLineNumber line number delta\r\n\t * @param deltaColumn column delta\r\n\t */\r\n\tdelta(deltaLineNumber: number = 0, deltaColumn: number = 0): Position {\r\n\t\treturn this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if this position equals other position\r\n\t */\r\n\tpublic equals(other: IPosition): boolean {\r\n\t\treturn Position.equals(this, other);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if position `a` equals position `b`\r\n\t */\r\n\tpublic static equals(a: IPosition | null, b: IPosition | null): boolean {\r\n\t\tif (!a && !b) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t!!a &&\r\n\t\t\t!!b &&\r\n\t\t\ta.lineNumber === b.lineNumber &&\r\n\t\t\ta.column === b.column\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if this position is before other position.\r\n\t * If the two positions are equal, the result will be false.\r\n\t */\r\n\tpublic isBefore(other: IPosition): boolean {\r\n\t\treturn Position.isBefore(this, other);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if position `a` is before position `b`.\r\n\t * If the two positions are equal, the result will be false.\r\n\t */\r\n\tpublic static isBefore(a: IPosition, b: IPosition): boolean {\r\n\t\tif (a.lineNumber < b.lineNumber) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (b.lineNumber < a.lineNumber) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn a.column < b.column;\r\n\t}\r\n\r\n\t/**\r\n\t * Test if this position is before other position.\r\n\t * If the two positions are equal, the result will be true.\r\n\t */\r\n\tpublic isBeforeOrEqual(other: IPosition): boolean {\r\n\t\treturn Position.isBeforeOrEqual(this, other);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if position `a` is before position `b`.\r\n\t * If the two positions are equal, the result will be true.\r\n\t */\r\n\tpublic static isBeforeOrEqual(a: IPosition, b: IPosition): boolean {\r\n\t\tif (a.lineNumber < b.lineNumber) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (b.lineNumber < a.lineNumber) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn a.column <= b.column;\r\n\t}\r\n\r\n\t/**\r\n\t * A function that compares positions, useful for sorting\r\n\t */\r\n\tpublic static compare(a: IPosition, b: IPosition): number {\r\n\t\tlet aLineNumber = a.lineNumber | 0;\r\n\t\tlet bLineNumber = b.lineNumber | 0;\r\n\r\n\t\tif (aLineNumber === bLineNumber) {\r\n\t\t\tlet aColumn = a.column | 0;\r\n\t\t\tlet bColumn = b.column | 0;\r\n\t\t\treturn aColumn - bColumn;\r\n\t\t}\r\n\r\n\t\treturn aLineNumber - bLineNumber;\r\n\t}\r\n\r\n\t/**\r\n\t * Clone this position.\r\n\t */\r\n\tpublic clone(): Position {\r\n\t\treturn new Position(this.lineNumber, this.column);\r\n\t}\r\n\r\n\t/**\r\n\t * Convert to a human-readable representation.\r\n\t */\r\n\tpublic toString(): string {\r\n\t\treturn '(' + this.lineNumber + ',' + this.column + ')';\r\n\t}\r\n\r\n\t// ---\r\n\r\n\t/**\r\n\t * Create a `Position` from an `IPosition`.\r\n\t */\r\n\tpublic static lift(pos: IPosition): Position {\r\n\t\treturn new Position(pos.lineNumber, pos.column);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if `obj` is an `IPosition`.\r\n\t */\r\n\tpublic static isIPosition(obj: any): obj is IPosition {\r\n\t\treturn (\r\n\t\t\tobj\r\n\t\t\t&& (typeof obj.lineNumber === 'number')\r\n\t\t\t&& (typeof obj.column === 'number')\r\n\t\t);\r\n\t}\r\n}\r\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\r\nimport { IPosition, Position } from 'vs/editor/common/core/position';\r\n\r\n/**\r\n * A range in the editor. This interface is suitable for serialization.\r\n */\r\nexport interface IRange {\r\n\t/**\r\n\t * Line number on which the range starts (starts at 1).\r\n\t */\r\n\treadonly startLineNumber: number;\r\n\t/**\r\n\t * Column on which the range starts in line `startLineNumber` (starts at 1).\r\n\t */\r\n\treadonly startColumn: number;\r\n\t/**\r\n\t * Line number on which the range ends.\r\n\t */\r\n\treadonly endLineNumber: number;\r\n\t/**\r\n\t * Column on which the range ends in line `endLineNumber`.\r\n\t */\r\n\treadonly endColumn: number;\r\n}\r\n\r\n/**\r\n * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)\r\n */\r\nexport class Range {\r\n\r\n\t/**\r\n\t * Line number on which the range starts (starts at 1).\r\n\t */\r\n\tpublic readonly startLineNumber: number;\r\n\t/**\r\n\t * Column on which the range starts in line `startLineNumber` (starts at 1).\r\n\t */\r\n\tpublic readonly startColumn: number;\r\n\t/**\r\n\t * Line number on which the range ends.\r\n\t */\r\n\tpublic readonly endLineNumber: number;\r\n\t/**\r\n\t * Column on which the range ends in line `endLineNumber`.\r\n\t */\r\n\tpublic readonly endColumn: number;\r\n\r\n\tconstructor(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number) {\r\n\t\tif ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) {\r\n\t\t\tthis.startLineNumber = endLineNumber;\r\n\t\t\tthis.startColumn = endColumn;\r\n\t\t\tthis.endLineNumber = startLineNumber;\r\n\t\t\tthis.endColumn = startColumn;\r\n\t\t} else {\r\n\t\t\tthis.startLineNumber = startLineNumber;\r\n\t\t\tthis.startColumn = startColumn;\r\n\t\t\tthis.endLineNumber = endLineNumber;\r\n\t\t\tthis.endColumn = endColumn;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Test if this range is empty.\r\n\t */\r\n\tpublic isEmpty(): boolean {\r\n\t\treturn Range.isEmpty(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if `range` is empty.\r\n\t */\r\n\tpublic static isEmpty(range: IRange): boolean {\r\n\t\treturn (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if position is in this range. If the position is at the edges, will return true.\r\n\t */\r\n\tpublic containsPosition(position: IPosition): boolean {\r\n\t\treturn Range.containsPosition(this, position);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if `position` is in `range`. If the position is at the edges, will return true.\r\n\t */\r\n\tpublic static containsPosition(range: IRange, position: IPosition): boolean {\r\n\t\tif (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (position.lineNumber === range.startLineNumber && position.column < range.startColumn) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (position.lineNumber === range.endLineNumber && position.column > range.endColumn) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Test if range is in this range. If the range is equal to this range, will return true.\r\n\t */\r\n\tpublic containsRange(range: IRange): boolean {\r\n\t\treturn Range.containsRange(this, range);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if `otherRange` is in `range`. If the ranges are equal, will return true.\r\n\t */\r\n\tpublic static containsRange(range: IRange, otherRange: IRange): boolean {\r\n\t\tif (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.\r\n\t */\r\n\tpublic strictContainsRange(range: IRange): boolean {\r\n\t\treturn Range.strictContainsRange(this, range);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if `otherRange` is strinctly in `range` (must start after, and end before). If the ranges are equal, will return false.\r\n\t */\r\n\tpublic static strictContainsRange(range: IRange, otherRange: IRange): boolean {\r\n\t\tif (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * A reunion of the two ranges.\r\n\t * The smallest position will be used as the start point, and the largest one as the end point.\r\n\t */\r\n\tpublic plusRange(range: IRange): Range {\r\n\t\treturn Range.plusRange(this, range);\r\n\t}\r\n\r\n\t/**\r\n\t * A reunion of the two ranges.\r\n\t * The smallest position will be used as the start point, and the largest one as the end point.\r\n\t */\r\n\tpublic static plusRange(a: IRange, b: IRange): Range {\r\n\t\tlet startLineNumber: number;\r\n\t\tlet startColumn: number;\r\n\t\tlet endLineNumber: number;\r\n\t\tlet endColumn: number;\r\n\r\n\t\tif (b.startLineNumber < a.startLineNumber) {\r\n\t\t\tstartLineNumber = b.startLineNumber;\r\n\t\t\tstartColumn = b.startColumn;\r\n\t\t} else if (b.startLineNumber === a.startLineNumber) {\r\n\t\t\tstartLineNumber = b.startLineNumber;\r\n\t\t\tstartColumn = Math.min(b.startColumn, a.startColumn);\r\n\t\t} else {\r\n\t\t\tstartLineNumber = a.startLineNumber;\r\n\t\t\tstartColumn = a.startColumn;\r\n\t\t}\r\n\r\n\t\tif (b.endLineNumber > a.endLineNumber) {\r\n\t\t\tendLineNumber = b.endLineNumber;\r\n\t\t\tendColumn = b.endColumn;\r\n\t\t} else if (b.endLineNumber === a.endLineNumber) {\r\n\t\t\tendLineNumber = b.endLineNumber;\r\n\t\t\tendColumn = Math.max(b.endColumn, a.endColumn);\r\n\t\t} else {\r\n\t\t\tendLineNumber = a.endLineNumber;\r\n\t\t\tendColumn = a.endColumn;\r\n\t\t}\r\n\r\n\t\treturn new Range(startLineNumber, startColumn, endLineNumber, endColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * A intersection of the two ranges.\r\n\t */\r\n\tpublic intersectRanges(range: IRange): Range | null {\r\n\t\treturn Range.intersectRanges(this, range);\r\n\t}\r\n\r\n\t/**\r\n\t * A intersection of the two ranges.\r\n\t */\r\n\tpublic static intersectRanges(a: IRange, b: IRange): Range | null {\r\n\t\tlet resultStartLineNumber = a.startLineNumber;\r\n\t\tlet resultStartColumn = a.startColumn;\r\n\t\tlet resultEndLineNumber = a.endLineNumber;\r\n\t\tlet resultEndColumn = a.endColumn;\r\n\t\tlet otherStartLineNumber = b.startLineNumber;\r\n\t\tlet otherStartColumn = b.startColumn;\r\n\t\tlet otherEndLineNumber = b.endLineNumber;\r\n\t\tlet otherEndColumn = b.endColumn;\r\n\r\n\t\tif (resultStartLineNumber < otherStartLineNumber) {\r\n\t\t\tresultStartLineNumber = otherStartLineNumber;\r\n\t\t\tresultStartColumn = otherStartColumn;\r\n\t\t} else if (resultStartLineNumber === otherStartLineNumber) {\r\n\t\t\tresultStartColumn = Math.max(resultStartColumn, otherStartColumn);\r\n\t\t}\r\n\r\n\t\tif (resultEndLineNumber > otherEndLineNumber) {\r\n\t\t\tresultEndLineNumber = otherEndLineNumber;\r\n\t\t\tresultEndColumn = otherEndColumn;\r\n\t\t} else if (resultEndLineNumber === otherEndLineNumber) {\r\n\t\t\tresultEndColumn = Math.min(resultEndColumn, otherEndColumn);\r\n\t\t}\r\n\r\n\t\t// Check if selection is now empty\r\n\t\tif (resultStartLineNumber > resultEndLineNumber) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tif (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if this range equals other.\r\n\t */\r\n\tpublic equalsRange(other: IRange | null): boolean {\r\n\t\treturn Range.equalsRange(this, other);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if range `a` equals `b`.\r\n\t */\r\n\tpublic static equalsRange(a: IRange | null, b: IRange | null): boolean {\r\n\t\treturn (\r\n\t\t\t!!a &&\r\n\t\t\t!!b &&\r\n\t\t\ta.startLineNumber === b.startLineNumber &&\r\n\t\t\ta.startColumn === b.startColumn &&\r\n\t\t\ta.endLineNumber === b.endLineNumber &&\r\n\t\t\ta.endColumn === b.endColumn\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Return the end position (which will be after or equal to the start position)\r\n\t */\r\n\tpublic getEndPosition(): Position {\r\n\t\treturn new Position(this.endLineNumber, this.endColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * Return the start position (which will be before or equal to the end position)\r\n\t */\r\n\tpublic getStartPosition(): Position {\r\n\t\treturn new Position(this.startLineNumber, this.startColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * Transform to a user presentable string representation.\r\n\t */\r\n\tpublic toString(): string {\r\n\t\treturn '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']';\r\n\t}\r\n\r\n\t/**\r\n\t * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.\r\n\t */\r\n\tpublic setEndPosition(endLineNumber: number, endColumn: number): Range {\r\n\t\treturn new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.\r\n\t */\r\n\tpublic setStartPosition(startLineNumber: number, startColumn: number): Range {\r\n\t\treturn new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * Create a new empty range using this range's start position.\r\n\t */\r\n\tpublic collapseToStart(): Range {\r\n\t\treturn Range.collapseToStart(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Create a new empty range using this range's start position.\r\n\t */\r\n\tpublic static collapseToStart(range: IRange): Range {\r\n\t\treturn new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);\r\n\t}\r\n\r\n\t// ---\r\n\r\n\tpublic static fromPositions(start: IPosition, end: IPosition = start): Range {\r\n\t\treturn new Range(start.lineNumber, start.column, end.lineNumber, end.column);\r\n\t}\r\n\r\n\t/**\r\n\t * Create a `Range` from an `IRange`.\r\n\t */\r\n\tpublic static lift(range: undefined | null): null;\r\n\tpublic static lift(range: IRange): Range;\r\n\tpublic static lift(range: IRange | undefined | null): Range | null {\r\n\t\tif (!range) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if `obj` is an `IRange`.\r\n\t */\r\n\tpublic static isIRange(obj: any): obj is IRange {\r\n\t\treturn (\r\n\t\t\tobj\r\n\t\t\t&& (typeof obj.startLineNumber === 'number')\r\n\t\t\t&& (typeof obj.startColumn === 'number')\r\n\t\t\t&& (typeof obj.endLineNumber === 'number')\r\n\t\t\t&& (typeof obj.endColumn === 'number')\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if the two ranges are touching in any way.\r\n\t */\r\n\tpublic static areIntersectingOrTouching(a: IRange, b: IRange): boolean {\r\n\t\t// Check if `a` is before `b`\r\n\t\tif (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Check if `b` is before `a`\r\n\t\tif (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// These ranges must intersect\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Test if the two ranges are intersecting. If the ranges are touching it returns true.\r\n\t */\r\n\tpublic static areIntersecting(a: IRange, b: IRange): boolean {\r\n\t\t// Check if `a` is before `b`\r\n\t\tif (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Check if `b` is before `a`\r\n\t\tif (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// These ranges must intersect\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * A function that compares ranges, useful for sorting ranges\r\n\t * It will first compare ranges on the startPosition and then on the endPosition\r\n\t */\r\n\tpublic static compareRangesUsingStarts(a: IRange | null | undefined, b: IRange | null | undefined): number {\r\n\t\tif (a && b) {\r\n\t\t\tconst aStartLineNumber = a.startLineNumber | 0;\r\n\t\t\tconst bStartLineNumber = b.startLineNumber | 0;\r\n\r\n\t\t\tif (aStartLineNumber === bStartLineNumber) {\r\n\t\t\t\tconst aStartColumn = a.startColumn | 0;\r\n\t\t\t\tconst bStartColumn = b.startColumn | 0;\r\n\r\n\t\t\t\tif (aStartColumn === bStartColumn) {\r\n\t\t\t\t\tconst aEndLineNumber = a.endLineNumber | 0;\r\n\t\t\t\t\tconst bEndLineNumber = b.endLineNumber | 0;\r\n\r\n\t\t\t\t\tif (aEndLineNumber === bEndLineNumber) {\r\n\t\t\t\t\t\tconst aEndColumn = a.endColumn | 0;\r\n\t\t\t\t\t\tconst bEndColumn = b.endColumn | 0;\r\n\t\t\t\t\t\treturn aEndColumn - bEndColumn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn aEndLineNumber - bEndLineNumber;\r\n\t\t\t\t}\r\n\t\t\t\treturn aStartColumn - bStartColumn;\r\n\t\t\t}\r\n\t\t\treturn aStartLineNumber - bStartLineNumber;\r\n\t\t}\r\n\t\tconst aExists = (a ? 1 : 0);\r\n\t\tconst bExists = (b ? 1 : 0);\r\n\t\treturn aExists - bExists;\r\n\t}\r\n\r\n\t/**\r\n\t * A function that compares ranges, useful for sorting ranges\r\n\t * It will first compare ranges on the endPosition and then on the startPosition\r\n\t */\r\n\tpublic static compareRangesUsingEnds(a: IRange, b: IRange): number {\r\n\t\tif (a.endLineNumber === b.endLineNumber) {\r\n\t\t\tif (a.endColumn === b.endColumn) {\r\n\t\t\t\tif (a.startLineNumber === b.startLineNumber) {\r\n\t\t\t\t\treturn a.startColumn - b.startColumn;\r\n\t\t\t\t}\r\n\t\t\t\treturn a.startLineNumber - b.startLineNumber;\r\n\t\t\t}\r\n\t\t\treturn a.endColumn - b.endColumn;\r\n\t\t}\r\n\t\treturn a.endLineNumber - b.endLineNumber;\r\n\t}\r\n\r\n\t/**\r\n\t * Test if the range spans multiple lines.\r\n\t */\r\n\tpublic static spansMultipleLines(range: IRange): boolean {\r\n\t\treturn range.endLineNumber > range.startLineNumber;\r\n\t}\r\n}\r\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\r\nimport { IPosition, Position } from 'vs/editor/common/core/position';\r\nimport { Range } from 'vs/editor/common/core/range';\r\n\r\n/**\r\n * A selection in the editor.\r\n * The selection is a range that has an orientation.\r\n */\r\nexport interface ISelection {\r\n\t/**\r\n\t * The line number on which the selection has started.\r\n\t */\r\n\treadonly selectionStartLineNumber: number;\r\n\t/**\r\n\t * The column on `selectionStartLineNumber` where the selection has started.\r\n\t */\r\n\treadonly selectionStartColumn: number;\r\n\t/**\r\n\t * The line number on which the selection has ended.\r\n\t */\r\n\treadonly positionLineNumber: number;\r\n\t/**\r\n\t * The column on `positionLineNumber` where the selection has ended.\r\n\t */\r\n\treadonly positionColumn: number;\r\n}\r\n\r\n/**\r\n * The direction of a selection.\r\n */\r\nexport const enum SelectionDirection {\r\n\t/**\r\n\t * The selection starts above where it ends.\r\n\t */\r\n\tLTR,\r\n\t/**\r\n\t * The selection starts below where it ends.\r\n\t */\r\n\tRTL\r\n}\r\n\r\n/**\r\n * A selection in the editor.\r\n * The selection is a range that has an orientation.\r\n */\r\nexport class Selection extends Range {\r\n\t/**\r\n\t * The line number on which the selection has started.\r\n\t */\r\n\tpublic readonly selectionStartLineNumber: number;\r\n\t/**\r\n\t * The column on `selectionStartLineNumber` where the selection has started.\r\n\t */\r\n\tpublic readonly selectionStartColumn: number;\r\n\t/**\r\n\t * The line number on which the selection has ended.\r\n\t */\r\n\tpublic readonly positionLineNumber: number;\r\n\t/**\r\n\t * The column on `positionLineNumber` where the selection has ended.\r\n\t */\r\n\tpublic readonly positionColumn: number;\r\n\r\n\tconstructor(selectionStartLineNumber: number, selectionStartColumn: number, positionLineNumber: number, positionColumn: number) {\r\n\t\tsuper(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn);\r\n\t\tthis.selectionStartLineNumber = selectionStartLineNumber;\r\n\t\tthis.selectionStartColumn = selectionStartColumn;\r\n\t\tthis.positionLineNumber = positionLineNumber;\r\n\t\tthis.positionColumn = positionColumn;\r\n\t}\r\n\r\n\t/**\r\n\t * Transform to a human-readable representation.\r\n\t */\r\n\tpublic toString(): string {\r\n\t\treturn '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']';\r\n\t}\r\n\r\n\t/**\r\n\t * Test if equals other selection.\r\n\t */\r\n\tpublic equalsSelection(other: ISelection): boolean {\r\n\t\treturn (\r\n\t\t\tSelection.selectionsEqual(this, other)\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Test if the two selections are equal.\r\n\t */\r\n\tpublic static selectionsEqual(a: ISelection, b: ISelection): boolean {\r\n\t\treturn (\r\n\t\t\ta.selectionStartLineNumber === b.selectionStartLineNumber &&\r\n\t\t\ta.selectionStartColumn === b.selectionStartColumn &&\r\n\t\t\ta.positionLineNumber === b.positionLineNumber &&\r\n\t\t\ta.positionColumn === b.positionColumn\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Get directions (LTR or RTL).\r\n\t */\r\n\tpublic getDirection(): SelectionDirection {\r\n\t\tif (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) {\r\n\t\t\treturn SelectionDirection.LTR;\r\n\t\t}\r\n\t\treturn SelectionDirection.RTL;\r\n\t}\r\n\r\n\t/**\r\n\t * Create a new selection with a different `positionLineNumber` and `positionColumn`.\r\n\t */\r\n\tpublic setEndPosition(endLineNumber: number, endColumn: number): Selection {\r\n\t\tif (this.getDirection() === SelectionDirection.LTR) {\r\n\t\t\treturn new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\r\n\t\t}\r\n\t\treturn new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * Get the position at `positionLineNumber` and `positionColumn`.\r\n\t */\r\n\tpublic getPosition(): Position {\r\n\t\treturn new Position(this.positionLineNumber, this.positionColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.\r\n\t */\r\n\tpublic setStartPosition(startLineNumber: number, startColumn: number): Selection {\r\n\t\tif (this.getDirection() === SelectionDirection.LTR) {\r\n\t\t\treturn new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\r\n\t\t}\r\n\t\treturn new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn);\r\n\t}\r\n\r\n\t// ----\r\n\r\n\t/**\r\n\t * Create a `Selection` from one or two positions\r\n\t */\r\n\tpublic static fromPositions(start: IPosition, end: IPosition = start): Selection {\r\n\t\treturn new Selection(start.lineNumber, start.column, end.lineNumber, end.column);\r\n\t}\r\n\r\n\t/**\r\n\t * Create a `Selection` from an `ISelection`.\r\n\t */\r\n\tpublic static liftSelection(sel: ISelection): Selection {\r\n\t\treturn new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);\r\n\t}\r\n\r\n\t/**\r\n\t * `a` equals `b`.\r\n\t */\r\n\tpublic static selectionsArrEqual(a: ISelection[], b: ISelection[]): boolean {\r\n\t\tif (a && !b || !a && b) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!a && !b) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (a.length !== b.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor (let i = 0, len = a.length; i < len; i++) {\r\n\t\t\tif (!this.selectionsEqual(a[i], b[i])) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Test if `obj` is an `ISelection`.\r\n\t */\r\n\tpublic static isISelection(obj: any): obj is ISelection {\r\n\t\treturn (\r\n\t\t\tobj\r\n\t\t\t&& (typeof obj.selectionStartLineNumber === 'number')\r\n\t\t\t&& (typeof obj.selectionStartColumn === 'number')\r\n\t\t\t&& (typeof obj.positionLineNumber === 'number')\r\n\t\t\t&& (typeof obj.positionColumn === 'number')\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Create with a direction.\r\n\t */\r\n\tpublic static createWithDirection(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number, direction: SelectionDirection): Selection {\r\n\r\n\t\tif (direction === SelectionDirection.LTR) {\r\n\t\t\treturn new Selection(startLineNumber, startColumn, endLineNumber, endColumn);\r\n\t\t}\r\n\r\n\t\treturn new Selection(endLineNumber, endColumn, startLineNumber, startColumn);\r\n\t}\r\n}\r\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\r\nimport { IState } from 'vs/editor/common/modes';\r\n\r\nexport class Token {\r\n\t_tokenBrand: void;\r\n\r\n\tpublic readonly offset: number;\r\n\tpublic readonly type: string;\r\n\tpublic readonly language: string;\r\n\r\n\tconstructor(offset: number, type: string, language: string) {\r\n\t\tthis.offset = offset | 0;// @perf\r\n\t\tthis.type = type;\r\n\t\tthis.language = language;\r\n\t}\r\n\r\n\tpublic toString(): string {\r\n\t\treturn '(' + this.offset + ', ' + this.type + ')';\r\n\t}\r\n}\r\n\r\nexport class TokenizationResult {\r\n\t_tokenizationResultBrand: void;\r\n\r\n\tpublic readonly tokens: Token[];\r\n\tpublic readonly endState: IState;\r\n\r\n\tconstructor(tokens: Token[], endState: IState) {\r\n\t\tthis.tokens = tokens;\r\n\t\tthis.endState = endState;\r\n\t}\r\n}\r\n\r\nexport class TokenizationResult2 {\r\n\t_tokenizationResult2Brand: void;\r\n\r\n\t/**\r\n\t * The tokens in binary format. Each token occupies two array indices. For token i:\r\n\t * - at offset 2*i => startIndex\r\n\t * - at offset 2*i + 1 => metadata\r\n\t *\r\n\t */\r\n\tpublic readonly tokens: Uint32Array;\r\n\tpublic readonly endState: IState;\r\n\r\n\tconstructor(tokens: Uint32Array, endState: IState) {\r\n\t\tthis.tokens = tokens;\r\n\t\tthis.endState = endState;\r\n\t}\r\n}\r\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\r\nimport { IDiffChange, ISequence, LcsDiff, IDiffResult } from 'vs/base/common/diff/diff';\r\nimport * as strings from 'vs/base/common/strings';\r\nimport { ICharChange, ILineChange } from 'vs/editor/common/editorCommon';\r\n\r\nconst MINIMUM_MATCHING_CHARACTER_LENGTH = 3;\r\n\r\nexport interface IDiffComputerResult {\r\n\tquitEarly: boolean;\r\n\tchanges: ILineChange[];\r\n}\r\n\r\nfunction computeDiff(originalSequence: ISequence, modifiedSequence: ISequence, continueProcessingPredicate: () => boolean, pretty: boolean): IDiffResult {\r\n\tconst diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);\r\n\treturn diffAlgo.ComputeDiff(pretty);\r\n}\r\n\r\nclass LineSequence implements ISequence {\r\n\r\n\tpublic readonly lines: string[];\r\n\tprivate readonly _startColumns: number[];\r\n\tprivate readonly _endColumns: number[];\r\n\r\n\tconstructor(lines: string[]) {\r\n\t\tconst startColumns: number[] = [];\r\n\t\tconst endColumns: number[] = [];\r\n\t\tfor (let i = 0, length = lines.length; i < length; i++) {\r\n\t\t\tstartColumns[i] = getFirstNonBlankColumn(lines[i], 1);\r\n\t\t\tendColumns[i] = getLastNonBlankColumn(lines[i], 1);\r\n\t\t}\r\n\t\tthis.lines = lines;\r\n\t\tthis._startColumns = startColumns;\r\n\t\tthis._endColumns = endColumns;\r\n\t}\r\n\r\n\tpublic getElements(): Int32Array | number[] | string[] {\r\n\t\tconst elements: string[] = [];\r\n\t\tfor (let i = 0, len = this.lines.length; i < len; i++) {\r\n\t\t\telements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);\r\n\t\t}\r\n\t\treturn elements;\r\n\t}\r\n\r\n\tpublic getStartLineNumber(i: number): number {\r\n\t\treturn i + 1;\r\n\t}\r\n\r\n\tpublic getEndLineNumber(i: number): number {\r\n\t\treturn i + 1;\r\n\t}\r\n\r\n\tpublic createCharSequence(shouldIgnoreTrimWhitespace: boolean, startIndex: number, endIndex: number): CharSequence {\r\n\t\tconst charCodes: number[] = [];\r\n\t\tconst lineNumbers: number[] = [];\r\n\t\tconst columns: number[] = [];\r\n\t\tlet len = 0;\r\n\t\tfor (let index = startIndex; index <= endIndex; index++) {\r\n\t\t\tconst lineContent = this.lines[index];\r\n\t\t\tconst startColumn = (shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1);\r\n\t\t\tconst endColumn = (shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1);\r\n\t\t\tfor (let col = startColumn; col < endColumn; col++) {\r\n\t\t\t\tcharCodes[len] = lineContent.charCodeAt(col - 1);\r\n\t\t\t\tlineNumbers[len] = index + 1;\r\n\t\t\t\tcolumns[len] = col;\r\n\t\t\t\tlen++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new CharSequence(charCodes, lineNumbers, columns);\r\n\t}\r\n}\r\n\r\nclass CharSequence implements ISequence {\r\n\r\n\tprivate readonly _charCodes: number[];\r\n\tprivate readonly _lineNumbers: number[];\r\n\tprivate readonly _columns: number[];\r\n\r\n\tconstructor(charCodes: number[], lineNumbers: number[], columns: number[]) {\r\n\t\tthis._charCodes = charCodes;\r\n\t\tthis._lineNumbers = lineNumbers;\r\n\t\tthis._columns = columns;\r\n\t}\r\n\r\n\tpublic getElements(): Int32Array | number[] | string[] {\r\n\t\treturn this._charCodes;\r\n\t}\r\n\r\n\tpublic getStartLineNumber(i: number): number {\r\n\t\treturn this._lineNumbers[i];\r\n\t}\r\n\r\n\tpublic getStartColumn(i: number): number {\r\n\t\treturn this._columns[i];\r\n\t}\r\n\r\n\tpublic getEndLineNumber(i: number): number {\r\n\t\treturn this._lineNumbers[i];\r\n\t}\r\n\r\n\tpublic getEndColumn(i: number): number {\r\n\t\treturn this._columns[i] + 1;\r\n\t}\r\n}\r\n\r\nclass CharChange implements ICharChange {\r\n\r\n\tpublic originalStartLineNumber: number;\r\n\tpublic originalStartColumn: number;\r\n\tpublic originalEndLineNumber: number;\r\n\tpublic originalEndColumn: number;\r\n\r\n\tpublic modifiedStartLineNumber: number;\r\n\tpublic modifiedStartColumn: number;\r\n\tpublic modifiedEndLineNumber: number;\r\n\tpublic modifiedEndColumn: number;\r\n\r\n\tconstructor(\r\n\t\toriginalStartLineNumber: number,\r\n\t\toriginalStartColumn: number,\r\n\t\toriginalEndLineNumber: number,\r\n\t\toriginalEndColumn: number,\r\n\t\tmodifiedStartLineNumber: number,\r\n\t\tmodifiedStartColumn: number,\r\n\t\tmodifiedEndLineNumber: number,\r\n\t\tmodifiedEndColumn: number\r\n\t) {\r\n\t\tthis.originalStartLineNumber = originalStartLineNumber;\r\n\t\tthis.originalStartColumn = originalStartColumn;\r\n\t\tthis.originalEndLineNumber = originalEndLineNumber;\r\n\t\tthis.originalEndColumn = originalEndColumn;\r\n\t\tthis.modifiedStartLineNumber = modifiedStartLineNumber;\r\n\t\tthis.modifiedStartColumn = modifiedStartColumn;\r\n\t\tthis.modifiedEndLineNumber = modifiedEndLineNumber;\r\n\t\tthis.modifiedEndColumn = modifiedEndColumn;\r\n\t}\r\n\r\n\tpublic static createFromDiffChange(diffChange: IDiffChange, originalCharSequence: CharSequence, modifiedCharSequence: CharSequence): CharChange {\r\n\t\tlet originalStartLineNumber: number;\r\n\t\tlet originalStartColumn: number;\r\n\t\tlet originalEndLineNumber: number;\r\n\t\tlet originalEndColumn: number;\r\n\t\tlet modifiedStartLineNumber: number;\r\n\t\tlet modifiedStartColumn: number;\r\n\t\tlet modifiedEndLineNumber: number;\r\n\t\tlet modifiedEndColumn: number;\r\n\r\n\t\tif (diffChange.originalLength === 0) {\r\n\t\t\toriginalStartLineNumber = 0;\r\n\t\t\toriginalStartColumn = 0;\r\n\t\t\toriginalEndLineNumber = 0;\r\n\t\t\toriginalEndColumn = 0;\r\n\t\t} else {\r\n\t\t\toriginalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);\r\n\t\t\toriginalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);\r\n\t\t\toriginalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\r\n\t\t\toriginalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);\r\n\t\t}\r\n\r\n\t\tif (diffChange.modifiedLength === 0) {\r\n\t\t\tmodifiedStartLineNumber = 0;\r\n\t\t\tmodifiedStartColumn = 0;\r\n\t\t\tmodifiedEndLineNumber = 0;\r\n\t\t\tmodifiedEndColumn = 0;\r\n\t\t} else {\r\n\t\t\tmodifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);\r\n\t\t\tmodifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);\r\n\t\t\tmodifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\r\n\t\t\tmodifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);\r\n\t\t}\r\n\r\n\t\treturn new CharChange(\r\n\t\t\toriginalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn,\r\n\t\t\tmodifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn,\r\n\t\t);\r\n\t}\r\n}\r\n\r\nfunction postProcessCharChanges(rawChanges: IDiffChange[]): IDiffChange[] {\r\n\tif (rawChanges.length <= 1) {\r\n\t\treturn rawChanges;\r\n\t}\r\n\r\n\tconst result = [rawChanges[0]];\r\n\tlet prevChange = result[0];\r\n\r\n\tfor (let i = 1, len = rawChanges.length; i < len; i++) {\r\n\t\tconst currChange = rawChanges[i];\r\n\r\n\t\tconst originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);\r\n\t\tconst modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);\r\n\t\t// Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true\r\n\t\tconst matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);\r\n\r\n\t\tif (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {\r\n\t\t\t// Merge the current change into the previous one\r\n\t\t\tprevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart;\r\n\t\t\tprevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart;\r\n\t\t} else {\r\n\t\t\t// Add the current change\r\n\t\t\tresult.push(currChange);\r\n\t\t\tprevChange = currChange;\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nclass LineChange implements ILineChange {\r\n\tpublic originalStartLineNumber: number;\r\n\tpublic originalEndLineNumber: number;\r\n\tpublic modifiedStartLineNumber: number;\r\n\tpublic modifiedEndLineNumber: number;\r\n\tpublic charChanges: CharChange[] | undefined;\r\n\r\n\tconstructor(\r\n\t\toriginalStartLineNumber: number,\r\n\t\toriginalEndLineNumber: number,\r\n\t\tmodifiedStartLineNumber: number,\r\n\t\tmodifiedEndLineNumber: number,\r\n\t\tcharChanges: CharChange[] | undefined\r\n\t) {\r\n\t\tthis.originalStartLineNumber = originalStartLineNumber;\r\n\t\tthis.originalEndLineNumber = originalEndLineNumber;\r\n\t\tthis.modifiedStartLineNumber = modifiedStartLineNumber;\r\n\t\tthis.modifiedEndLineNumber = modifiedEndLineNumber;\r\n\t\tthis.charChanges = charChanges;\r\n\t}\r\n\r\n\tpublic static createFromDiffResult(shouldIgnoreTrimWhitespace: boolean, diffChange: IDiffChange, originalLineSequence: LineSequence, modifiedLineSequence: LineSequence, continueCharDiff: () => boolean, shouldComputeCharChanges: boolean, shouldPostProcessCharChanges: boolean): LineChange {\r\n\t\tlet originalStartLineNumber: number;\r\n\t\tlet originalEndLineNumber: number;\r\n\t\tlet modifiedStartLineNumber: number;\r\n\t\tlet modifiedEndLineNumber: number;\r\n\t\tlet charChanges: CharChange[] | undefined = undefined;\r\n\r\n\t\tif (diffChange.originalLength === 0) {\r\n\t\t\toriginalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;\r\n\t\t\toriginalEndLineNumber = 0;\r\n\t\t} else {\r\n\t\t\toriginalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);\r\n\t\t\toriginalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\r\n\t\t}\r\n\r\n\t\tif (diffChange.modifiedLength === 0) {\r\n\t\t\tmodifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;\r\n\t\t\tmodifiedEndLineNumber = 0;\r\n\t\t} else {\r\n\t\t\tmodifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);\r\n\t\t\tmodifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\r\n\t\t}\r\n\r\n\t\tif (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) {\r\n\t\t\t// Compute character changes for diff chunks of at most 20 lines...\r\n\t\t\tconst originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);\r\n\t\t\tconst modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);\r\n\r\n\t\t\tlet rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes;\r\n\r\n\t\t\tif (shouldPostProcessCharChanges) {\r\n\t\t\t\trawChanges = postProcessCharChanges(rawChanges);\r\n\t\t\t}\r\n\r\n\t\t\tcharChanges = [];\r\n\t\t\tfor (let i = 0, length = rawChanges.length; i < length; i++) {\r\n\t\t\t\tcharChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);\r\n\t}\r\n}\r\n\r\nexport interface IDiffComputerOpts {\r\n\tshouldComputeCharChanges: boolean;\r\n\tshouldPostProcessCharChanges: boolean;\r\n\tshouldIgnoreTrimWhitespace: boolean;\r\n\tshouldMakePrettyDiff: boolean;\r\n\tmaxComputationTime: number;\r\n}\r\n\r\nexport class DiffComputer {\r\n\r\n\tprivate readonly shouldComputeCharChanges: boolean;\r\n\tprivate readonly shouldPostProcessCharChanges: boolean;\r\n\tprivate readonly shouldIgnoreTrimWhitespace: boolean;\r\n\tprivate readonly shouldMakePrettyDiff: boolean;\r\n\tprivate readonly originalLines: string[];\r\n\tprivate readonly modifiedLines: string[];\r\n\tprivate readonly original: LineSequence;\r\n\tprivate readonly modified: LineSequence;\r\n\tprivate readonly continueLineDiff: () => boolean;\r\n\tprivate readonly continueCharDiff: () => boolean;\r\n\r\n\tconstructor(originalLines: string[], modifiedLines: string[], opts: IDiffComputerOpts) {\r\n\t\tthis.shouldComputeCharChanges = opts.shouldComputeCharChanges;\r\n\t\tthis.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;\r\n\t\tthis.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;\r\n\t\tthis.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;\r\n\t\tthis.originalLines = originalLines;\r\n\t\tthis.modifiedLines = modifiedLines;\r\n\t\tthis.original = new LineSequence(originalLines);\r\n\t\tthis.modified = new LineSequence(modifiedLines);\r\n\r\n\t\tthis.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);\r\n\t\tthis.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes...\r\n\t}\r\n\r\n\tpublic computeDiff(): IDiffComputerResult {\r\n\r\n\t\tif (this.original.lines.length === 1 && this.original.lines[0].length === 0) {\r\n\t\t\t// empty original => fast path\r\n\t\t\treturn {\r\n\t\t\t\tquitEarly: false,\r\n\t\t\t\tchanges: [{\r\n\t\t\t\t\toriginalStartLineNumber: 1,\r\n\t\t\t\t\toriginalEndLineNumber: 1,\r\n\t\t\t\t\tmodifiedStartLineNumber: 1,\r\n\t\t\t\t\tmodifiedEndLineNumber: this.modified.lines.length,\r\n\t\t\t\t\tcharChanges: [{\r\n\t\t\t\t\t\tmodifiedEndColumn: 0,\r\n\t\t\t\t\t\tmodifiedEndLineNumber: 0,\r\n\t\t\t\t\t\tmodifiedStartColumn: 0,\r\n\t\t\t\t\t\tmodifiedStartLineNumber: 0,\r\n\t\t\t\t\t\toriginalEndColumn: 0,\r\n\t\t\t\t\t\toriginalEndLineNumber: 0,\r\n\t\t\t\t\t\toriginalStartColumn: 0,\r\n\t\t\t\t\t\toriginalStartLineNumber: 0\r\n\t\t\t\t\t}]\r\n\t\t\t\t}]\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tif (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {\r\n\t\t\t// empty modified => fast path\r\n\t\t\treturn {\r\n\t\t\t\tquitEarly: false,\r\n\t\t\t\tchanges: [{\r\n\t\t\t\t\toriginalStartLineNumber: 1,\r\n\t\t\t\t\toriginalEndLineNumber: this.original.lines.length,\r\n\t\t\t\t\tmodifiedStartLineNumber: 1,\r\n\t\t\t\t\tmodifiedEndLineNumber: 1,\r\n\t\t\t\t\tcharChanges: [{\r\n\t\t\t\t\t\tmodifiedEndColumn: 0,\r\n\t\t\t\t\t\tmodifiedEndLineNumber: 0,\r\n\t\t\t\t\t\tmodifiedStartColumn: 0,\r\n\t\t\t\t\t\tmodifiedStartLineNumber: 0,\r\n\t\t\t\t\t\toriginalEndColumn: 0,\r\n\t\t\t\t\t\toriginalEndLineNumber: 0,\r\n\t\t\t\t\t\toriginalStartColumn: 0,\r\n\t\t\t\t\t\toriginalStartLineNumber: 0\r\n\t\t\t\t\t}]\r\n\t\t\t\t}]\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tconst diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);\r\n\t\tconst rawChanges = diffResult.changes;\r\n\t\tconst quitEarly = diffResult.quitEarly;\r\n\r\n\t\t// The diff is always computed with ignoring trim whitespace\r\n\t\t// This ensures we get the prettiest diff\r\n\r\n\t\tif (this.shouldIgnoreTrimWhitespace) {\r\n\t\t\tconst lineChanges: LineChange[] = [];\r\n\t\t\tfor (let i = 0, length = rawChanges.length; i < length; i++) {\r\n\t\t\t\tlineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\r\n\t\t\t}\r\n\t\t\treturn {\r\n\t\t\t\tquitEarly: quitEarly,\r\n\t\t\t\tchanges: lineChanges\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\t// Need to post-process and introduce changes where the trim whitespace is different\r\n\t\t// Note that we are looping starting at -1 to also cover the lines before the first change\r\n\t\tconst result: LineChange[] = [];\r\n\r\n\t\tlet originalLineIndex = 0;\r\n\t\tlet modifiedLineIndex = 0;\r\n\t\tfor (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) {\r\n\t\t\tconst nextChange = (i + 1 < len ? rawChanges[i + 1] : null);\r\n\t\t\tconst originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length);\r\n\t\t\tconst modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length);\r\n\r\n\t\t\twhile (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {\r\n\t\t\t\tconst originalLine = this.originalLines[originalLineIndex];\r\n\t\t\t\tconst modifiedLine = this.modifiedLines[modifiedLineIndex];\r\n\r\n\t\t\t\tif (originalLine !== modifiedLine) {\r\n\t\t\t\t\t// These lines differ only in trim whitespace\r\n\r\n\t\t\t\t\t// Check the leading whitespace\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlet originalStartColumn = getFirstNonBlankColumn(originalLine, 1);\r\n\t\t\t\t\t\tlet modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1);\r\n\t\t\t\t\t\twhile (originalStartColumn > 1 && modifiedStartColumn > 1) {\r\n\t\t\t\t\t\t\tconst originalChar = originalLine.charCodeAt(originalStartColumn - 2);\r\n\t\t\t\t\t\t\tconst modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);\r\n\t\t\t\t\t\t\tif (originalChar !== modifiedChar) {\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\toriginalStartColumn--;\r\n\t\t\t\t\t\t\tmodifiedStartColumn--;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (originalStartColumn > 1 || modifiedStartColumn > 1) {\r\n\t\t\t\t\t\t\tthis._pushTrimWhitespaceCharChange(result,\r\n\t\t\t\t\t\t\t\toriginalLineIndex + 1, 1, originalStartColumn,\r\n\t\t\t\t\t\t\t\tmodifiedLineIndex + 1, 1, modifiedStartColumn\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Check the trailing whitespace\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlet originalEndColumn = getLastNonBlankColumn(originalLine, 1);\r\n\t\t\t\t\t\tlet modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1);\r\n\t\t\t\t\t\tconst originalMaxColumn = originalLine.length + 1;\r\n\t\t\t\t\t\tconst modifiedMaxColumn = modifiedLine.length + 1;\r\n\t\t\t\t\t\twhile (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {\r\n\t\t\t\t\t\t\tconst originalChar = originalLine.charCodeAt(originalEndColumn - 1);\r\n\t\t\t\t\t\t\tconst modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);\r\n\t\t\t\t\t\t\tif (originalChar !== modifiedChar) {\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\toriginalEndColumn++;\r\n\t\t\t\t\t\t\tmodifiedEndColumn++;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {\r\n\t\t\t\t\t\t\tthis._pushTrimWhitespaceCharChange(result,\r\n\t\t\t\t\t\t\t\toriginalLineIndex + 1, originalEndColumn, originalMaxColumn,\r\n\t\t\t\t\t\t\t\tmodifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\toriginalLineIndex++;\r\n\t\t\t\tmodifiedLineIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif (nextChange) {\r\n\t\t\t\t// Emit the actual change\r\n\t\t\t\tresult.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\r\n\r\n\t\t\t\toriginalLineIndex += nextChange.originalLength;\r\n\t\t\t\tmodifiedLineIndex += nextChange.modifiedLength;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tquitEarly: quitEarly,\r\n\t\t\tchanges: result\r\n\t\t};\r\n\t}\r\n\r\n\tprivate _pushTrimWhitespaceCharChange(\r\n\t\tresult: LineChange[],\r\n\t\toriginalLineNumber: number, originalStartColumn: number, originalEndColumn: number,\r\n\t\tmodifiedLineNumber: number, modifiedStartColumn: number, modifiedEndColumn: number\r\n\t): void {\r\n\t\tif (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {\r\n\t\t\t// Merged into previous\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet charChanges: CharChange[] | undefined = undefined;\r\n\t\tif (this.shouldComputeCharChanges) {\r\n\t\t\tcharChanges = [new CharChange(\r\n\t\t\t\toriginalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn,\r\n\t\t\t\tmodifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn\r\n\t\t\t)];\r\n\t\t}\r\n\t\tresult.push(new LineChange(\r\n\t\t\toriginalLineNumber, originalLineNumber,\r\n\t\t\tmodifiedLineNumber, modifiedLineNumber,\r\n\t\t\tcharChanges\r\n\t\t));\r\n\t}\r\n\r\n\tprivate _mergeTrimWhitespaceCharChange(\r\n\t\tresult: LineChange[],\r\n\t\toriginalLineNumber: number, originalStartColumn: number, originalEndColumn: number,\r\n\t\tmodifiedLineNumber: number, modifiedStartColumn: number, modifiedEndColumn: number\r\n\t): boolean {\r\n\t\tconst len = result.length;\r\n\t\tif (len === 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst prevChange = result[len - 1];\r\n\r\n\t\tif (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {\r\n\t\t\t// Don't merge with inserts/deletes\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {\r\n\t\t\tprevChange.originalEndLineNumber = originalLineNumber;\r\n\t\t\tprevChange.modifiedEndLineNumber = modifiedLineNumber;\r\n\t\t\tif (this.shouldComputeCharChanges && prevChange.charChanges) {\r\n\t\t\t\tprevChange.charChanges.push(new CharChange(\r\n\t\t\t\t\toriginalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn,\r\n\t\t\t\t\tmodifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction getFirstNonBlankColumn(txt: string, defaultValue: number): number {\r\n\tconst r = strings.firstNonWhitespaceIndex(txt);\r\n\tif (r === -1) {\r\n\t\treturn defaultValue;\r\n\t}\r\n\treturn r + 1;\r\n}\r\n\r\nfunction getLastNonBlankColumn(txt: string, defaultValue: number): number {\r\n\tconst r = strings.lastNonWhitespaceIndex(txt);\r\n\tif (r === -1) {\r\n\t\treturn defaultValue;\r\n\t}\r\n\treturn r + 2;\r\n}\r\n\r\nfunction createContinueProcessingPredicate(maximumRuntime: number): () => boolean {\r\n\tif (maximumRuntime === 0) {\r\n\t\treturn () => true;\r\n\t}\r\n\r\n\tconst startTime = Date.now();\r\n\treturn () => {\r\n\t\treturn Date.now() - startTime < maximumRuntime;\r\n\t};\r\n}\r\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\r\nimport { IWordAtPosition } from 'vs/editor/common/model';\r\n\r\nexport const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?';\r\n\r\n/**\r\n * Create a word definition regular expression based on default word separators.\r\n * Optionally provide allowed separators that should be included in words.\r\n *\r\n * The default would look like this:\r\n * /(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)/g\r\n */\r\nfunction createWordRegExp(allowInWords: string = ''): RegExp {\r\n\tlet source = '(-?\\\\d*\\\\.\\\\d\\\\w*)|([^';\r\n\tfor (const sep of USUAL_WORD_SEPARATORS) {\r\n\t\tif (allowInWords.indexOf(sep) >= 0) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tsource += '\\\\' + sep;\r\n\t}\r\n\tsource += '\\\\s]+)';\r\n\treturn new RegExp(source, 'g');\r\n}\r\n\r\n// catches numbers (including floating numbers) in the first group, and alphanum in the second\r\nexport const DEFAULT_WORD_REGEXP = createWordRegExp();\r\n\r\nexport function ensureValidWordDefinition(wordDefinition?: RegExp | null): RegExp {\r\n\tlet result: RegExp = DEFAULT_WORD_REGEXP;\r\n\r\n\tif (wordDefinition && (wordDefinition instanceof RegExp)) {\r\n\t\tif (!wordDefinition.global) {\r\n\t\t\tlet flags = 'g';\r\n\t\t\tif (wordDefinition.ignoreCase) {\r\n\t\t\t\tflags += 'i';\r\n\t\t\t}\r\n\t\t\tif (wordDefinition.multiline) {\r\n\t\t\t\tflags += 'm';\r\n\t\t\t}\r\n\t\t\tif ((wordDefinition as any).unicode) {\r\n\t\t\t\tflags += 'u';\r\n\t\t\t}\r\n\t\t\tresult = new RegExp(wordDefinition.source, flags);\r\n\t\t} else {\r\n\t\t\tresult = wordDefinition;\r\n\t\t}\r\n\t}\r\n\r\n\tresult.lastIndex = 0;\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction getWordAtPosFast(column: number, wordDefinition: RegExp, text: string, textOffset: number): IWordAtPosition | null {\r\n\t// find whitespace enclosed text around column and match from there\r\n\r\n\tlet pos = column - 1 - textOffset;\r\n\tlet start = text.lastIndexOf(' ', pos - 1) + 1;\r\n\r\n\twordDefinition.lastIndex = start;\r\n\tlet match: RegExpMatchArray | null;\r\n\twhile (match = wordDefinition.exec(text)) {\r\n\t\tconst matchIndex = match.index || 0;\r\n\t\tif (matchIndex <= pos && wordDefinition.lastIndex >= pos) {\r\n\t\t\treturn {\r\n\t\t\t\tword: match[0],\r\n\t\t\t\tstartColumn: textOffset + 1 + matchIndex,\r\n\t\t\t\tendColumn: textOffset + 1 + wordDefinition.lastIndex\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\treturn null;\r\n}\r\n\r\n\r\nfunction getWordAtPosSlow(column: number, wordDefinition: RegExp, text: string, textOffset: number): IWordAtPosition | null {\r\n\t// matches all words starting at the beginning\r\n\t// of the input until it finds a match that encloses\r\n\t// the desired column. slow but correct\r\n\r\n\tlet pos = column - 1 - textOffset;\r\n\twordDefinition.lastIndex = 0;\r\n\r\n\tlet match: RegExpMatchArray | null;\r\n\twhile (match = wordDefinition.exec(text)) {\r\n\t\tconst matchIndex = match.index || 0;\r\n\t\tif (matchIndex > pos) {\r\n\t\t\t// |nW -> matched only after the pos\r\n\t\t\treturn null;\r\n\r\n\t\t} else if (wordDefinition.lastIndex >= pos) {\r\n\t\t\t// W|W -> match encloses pos\r\n\t\t\treturn {\r\n\t\t\t\tword: match[0],\r\n\t\t\t\tstartColumn: textOffset + 1 + matchIndex,\r\n\t\t\t\tendColumn: textOffset + 1 + wordDefinition.lastIndex\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\treturn null;\r\n}\r\n\r\nexport function getWordAtText(column: number, wordDefinition: RegExp, text: string, textOffset: number): IWordAtPosition | null {\r\n\r\n\t// if `words` can contain whitespace character we have to use the slow variant\r\n\t// otherwise we use the fast variant of finding a word\r\n\twordDefinition.lastIndex = 0;\r\n\tlet match = wordDefinition.exec(text);\r\n\tif (!match) {\r\n\t\treturn null;\r\n\t}\r\n\t// todo@joh the `match` could already be the (first) word\r\n\tconst ret = match[0].indexOf(' ') >= 0\r\n\t\t// did match a word which contains a space character -> use slow word find\r\n\t\t? getWordAtPosSlow(column, wordDefinition, text, textOffset)\r\n\t\t// sane word definition -> use fast word find\r\n\t\t: getWordAtPosFast(column, wordDefinition, text, textOffset);\r\n\r\n\t// both (getWordAtPosFast and getWordAtPosSlow) leave the wordDefinition-RegExp\r\n\t// in an undefined state and to not confuse other users of the wordDefinition\r\n\t// we reset the lastIndex\r\n\twordDefinition.lastIndex = 0;\r\n\r\n\treturn ret;\r\n}\r\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\r\nimport { CharCode } from 'vs/base/common/charCode';\r\nimport { CharacterClassifier } from 'vs/editor/common/core/characterClassifier';\r\nimport { ILink } from 'vs/editor/common/modes';\r\n\r\nexport interface ILinkComputerTarget {\r\n\tgetLineCount(): number;\r\n\tgetLineContent(lineNumber: number): string;\r\n}\r\n\r\nexport const enum State {\r\n\tInvalid = 0,\r\n\tStart = 1,\r\n\tH = 2,\r\n\tHT = 3,\r\n\tHTT = 4,\r\n\tHTTP = 5,\r\n\tF = 6,\r\n\tFI = 7,\r\n\tFIL = 8,\r\n\tBeforeColon = 9,\r\n\tAfterColon = 10,\r\n\tAlmostThere = 11,\r\n\tEnd = 12,\r\n\tAccept = 13,\r\n\tLastKnownState = 14 // marker, custom states may follow\r\n}\r\n\r\nexport type Edge = [State, number, State];\r\n\r\nexport class Uint8Matrix {\r\n\r\n\tprivate readonly _data: Uint8Array;\r\n\tpublic readonly rows: number;\r\n\tpublic readonly cols: number;\r\n\r\n\tconstructor(rows: number, cols: number, defaultValue: number) {\r\n\t\tconst data = new Uint8Array(rows * cols);\r\n\t\tfor (let i = 0, len = rows * cols; i < len; i++) {\r\n\t\t\tdata[i] = defaultValue;\r\n\t\t}\r\n\r\n\t\tthis._data = data;\r\n\t\tthis.rows = rows;\r\n\t\tthis.cols = cols;\r\n\t}\r\n\r\n\tpublic get(row: number, col: number): number {\r\n\t\treturn this._data[row * this.cols + col];\r\n\t}\r\n\r\n\tpublic set(row: number, col: number, value: number): void {\r\n\t\tthis._data[row * this.cols + col] = value;\r\n\t}\r\n}\r\n\r\nexport class StateMachine {\r\n\r\n\tprivate readonly _states: Uint8Matrix;\r\n\tprivate readonly _maxCharCode: number;\r\n\r\n\tconstructor(edges: Edge[]) {\r\n\t\tlet maxCharCode = 0;\r\n\t\tlet maxState = State.Invalid;\r\n\t\tfor (let i = 0, len = edges.length; i < len; i++) {\r\n\t\t\tlet [from, chCode, to] = edges[i];\r\n\t\t\tif (chCode > maxCharCode) {\r\n\t\t\t\tmaxCharCode = chCode;\r\n\t\t\t}\r\n\t\t\tif (from > maxState) {\r\n\t\t\t\tmaxState = from;\r\n\t\t\t}\r\n\t\t\tif (to > maxState) {\r\n\t\t\t\tmaxState = to;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tmaxCharCode++;\r\n\t\tmaxState++;\r\n\r\n\t\tlet states = new Uint8Matrix(maxState, maxCharCode, State.Invalid);\r\n\t\tfor (let i = 0, len = edges.length; i < len; i++) {\r\n\t\t\tlet [from, chCode, to] = edges[i];\r\n\t\t\tstates.set(from, chCode, to);\r\n\t\t}\r\n\r\n\t\tthis._states = states;\r\n\t\tthis._maxCharCode = maxCharCode;\r\n\t}\r\n\r\n\tpublic nextState(currentState: State, chCode: number): State {\r\n\t\tif (chCode < 0 || chCode >= this._maxCharCode) {\r\n\t\t\treturn State.Invalid;\r\n\t\t}\r\n\t\treturn this._states.get(currentState, chCode);\r\n\t}\r\n}\r\n\r\n// State machine for http:// or https:// or file://\r\nlet _stateMachine: StateMachine | null = null;\r\nfunction getStateMachine(): StateMachine {\r\n\tif (_stateMachine === null) {\r\n\t\t_stateMachine = new StateMachine([\r\n\t\t\t[State.Start, CharCode.h, State.H],\r\n\t\t\t[State.Start, CharCode.H, State.H],\r\n\t\t\t[State.Start, CharCode.f, State.F],\r\n\t\t\t[State.Start, CharCode.F, State.F],\r\n\r\n\t\t\t[State.H, CharCode.t, State.HT],\r\n\t\t\t[State.H, CharCode.T, State.HT],\r\n\r\n\t\t\t[State.HT, CharCode.t, State.HTT],\r\n\t\t\t[State.HT, CharCode.T, State.HTT],\r\n\r\n\t\t\t[State.HTT, CharCode.p, State.HTTP],\r\n\t\t\t[State.HTT, CharCode.P, State.HTTP],\r\n\r\n\t\t\t[State.HTTP, CharCode.s, State.BeforeColon],\r\n\t\t\t[State.HTTP, CharCode.S, State.BeforeColon],\r\n\t\t\t[State.HTTP, CharCode.Colon, State.AfterColon],\r\n\r\n\t\t\t[State.F, CharCode.i, State.FI],\r\n\t\t\t[State.F, CharCode.I, State.FI],\r\n\r\n\t\t\t[State.FI, CharCode.l, State.FIL],\r\n\t\t\t[State.FI, CharCode.L, State.FIL],\r\n\r\n\t\t\t[State.FIL, CharCode.e, State.BeforeColon],\r\n\t\t\t[State.FIL, CharCode.E, State.BeforeColon],\r\n\r\n\t\t\t[State.BeforeColon, CharCode.Colon, State.AfterColon],\r\n\r\n\t\t\t[State.AfterColon, CharCode.Slash, State.AlmostThere],\r\n\r\n\t\t\t[State.AlmostThere, CharCode.Slash, State.End],\r\n\t\t]);\r\n\t}\r\n\treturn _stateMachine;\r\n}\r\n\r\n\r\nconst enum CharacterClass {\r\n\tNone = 0,\r\n\tForceTermination = 1,\r\n\tCannotEndIn = 2\r\n}\r\n\r\nlet _classifier: CharacterClassifier<CharacterClass> | null = null;\r\nfunction getClassifier(): CharacterClassifier<CharacterClass> {\r\n\tif (_classifier === null) {\r\n\t\t_classifier = new CharacterClassifier<CharacterClass>(CharacterClass.None);\r\n\r\n\t\tconst FORCE_TERMINATION_CHARACTERS = ' \\t<>\\'\\\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…';\r\n\t\tfor (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) {\r\n\t\t\t_classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), CharacterClass.ForceTermination);\r\n\t\t}\r\n\r\n\t\tconst CANNOT_END_WITH_CHARACTERS = '.,;';\r\n\t\tfor (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) {\r\n\t\t\t_classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), CharacterClass.CannotEndIn);\r\n\t\t}\r\n\t}\r\n\treturn _classifier;\r\n}\r\n\r\nexport class LinkComputer {\r\n\r\n\tprivate static _createLink(classifier: CharacterClassifier<CharacterClass>, line: string, lineNumber: number, linkBeginIndex: number, linkEndIndex: number): ILink {\r\n\t\t// Do not allow to end link in certain characters...\r\n\t\tlet lastIncludedCharIndex = linkEndIndex - 1;\r\n\t\tdo {\r\n\t\t\tconst chCode = line.charCodeAt(lastIncludedCharIndex);\r\n\t\t\tconst chClass = classifier.get(chCode);\r\n\t\t\tif (chClass !== CharacterClass.CannotEndIn) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tlastIncludedCharIndex--;\r\n\t\t} while (lastIncludedCharIndex > linkBeginIndex);\r\n\r\n\t\t// Handle links enclosed in parens, square brackets and curlys.\r\n\t\tif (linkBeginIndex > 0) {\r\n\t\t\tconst charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1);\r\n\t\t\tconst lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex);\r\n\r\n\t\t\tif (\r\n\t\t\t\t(charCodeBeforeLink === CharCode.OpenParen && lastCharCodeInLink === CharCode.CloseParen)\r\n\t\t\t\t|| (charCodeBeforeLink === CharCode.OpenSquareBracket && lastCharCodeInLink === CharCode.CloseSquareBracket)\r\n\t\t\t\t|| (charCodeBeforeLink === CharCode.OpenCurlyBrace && lastCharCodeInLink === CharCode.CloseCurlyBrace)\r\n\t\t\t) {\r\n\t\t\t\t// Do not end in ) if ( is before the link start\r\n\t\t\t\t// Do not end in ] if [ is before the link start\r\n\t\t\t\t// Do not end in } if { is before the link start\r\n\t\t\t\tlastIncludedCharIndex--;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\trange: {\r\n\t\t\t\tstartLineNumber: lineNumber,\r\n\t\t\t\tstartColumn: linkBeginIndex + 1,\r\n\t\t\t\tendLineNumber: lineNumber,\r\n\t\t\t\tendColumn: lastIncludedCharIndex + 2\r\n\t\t\t},\r\n\t\t\turl: line.substring(linkBeginIndex, lastIncludedCharIndex + 1)\r\n\t\t};\r\n\t}\r\n\r\n\tpublic static computeLinks(model: ILinkComputerTarget, stateMachine: StateMachine = getStateMachine()): ILink[] {\r\n\t\tconst classifier = getClassifier();\r\n\r\n\t\tlet result: ILink[] = [];\r\n\t\tfor (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) {\r\n\t\t\tconst line = model.getLineContent(i);\r\n\t\t\tconst len = line.length;\r\n\r\n\t\t\tlet j = 0;\r\n\t\t\tlet linkBeginIndex = 0;\r\n\t\t\tlet linkBeginChCode = 0;\r\n\t\t\tlet state = State.Start;\r\n\t\t\tlet hasOpenParens = false;\r\n\t\t\tlet hasOpenSquareBracket = false;\r\n\t\t\tlet hasOpenCurlyBracket = false;\r\n\r\n\t\t\twhile (j < len) {\r\n\r\n\t\t\t\tlet resetStateMachine = false;\r\n\t\t\t\tconst chCode = line.charCodeAt(j);\r\n\r\n\t\t\t\tif (state === State.Accept) {\r\n\t\t\t\t\tlet chClass: CharacterClass;\r\n\t\t\t\t\tswitch (chCode) {\r\n\t\t\t\t\t\tcase CharCode.OpenParen:\r\n\t\t\t\t\t\t\thasOpenParens = true;\r\n\t\t\t\t\t\t\tchClass = CharacterClass.None;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CharCode.CloseParen:\r\n\t\t\t\t\t\t\tchClass = (hasOpenParens ? CharacterClass.None : CharacterClass.ForceTermination);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CharCode.OpenSquareBracket:\r\n\t\t\t\t\t\t\thasOpenSquareBracket = true;\r\n\t\t\t\t\t\t\tchClass = CharacterClass.None;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CharCode.CloseSquareBracket:\r\n\t\t\t\t\t\t\tchClass = (hasOpenSquareBracket ? CharacterClass.None : CharacterClass.ForceTermination);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CharCode.OpenCurlyBrace:\r\n\t\t\t\t\t\t\thasOpenCurlyBracket = true;\r\n\t\t\t\t\t\t\tchClass = CharacterClass.None;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CharCode.CloseCurlyBrace:\r\n\t\t\t\t\t\t\tchClass = (hasOpenCurlyBracket ? CharacterClass.None : CharacterClass.ForceTermination);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t/* The following three rules make it that ' or \" or ` are allowed inside links if the link began with a different one */\r\n\t\t\t\t\t\tcase CharCode.SingleQuote:\r\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.DoubleQuote || linkBeginChCode === CharCode.BackTick) ? CharacterClass.None : CharacterClass.ForceTermination;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CharCode.DoubleQuote:\r\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.SingleQuote || linkBeginChCode === CharCode.BackTick) ? CharacterClass.None : CharacterClass.ForceTermination;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CharCode.BackTick:\r\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.SingleQuote || linkBeginChCode === CharCode.DoubleQuote) ? CharacterClass.None : CharacterClass.ForceTermination;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CharCode.Asterisk:\r\n\t\t\t\t\t\t\t// `*` terminates a link if the link began with `*`\r\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.Asterisk) ? CharacterClass.ForceTermination : CharacterClass.None;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CharCode.Pipe:\r\n\t\t\t\t\t\t\t// `|` terminates a link if the link began with `|`\r\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.Pipe) ? CharacterClass.ForceTermination : CharacterClass.None;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tchClass = classifier.get(chCode);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Check if character terminates link\r\n\t\t\t\t\tif (chClass === CharacterClass.ForceTermination) {\r\n\t\t\t\t\t\tresult.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j));\r\n\t\t\t\t\t\tresetStateMachine = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (state === State.End) {\r\n\r\n\t\t\t\t\tlet chClass: CharacterClass;\r\n\t\t\t\t\tif (chCode === CharCode.OpenSquareBracket) {\r\n\t\t\t\t\t\t// Allow for the authority part to contain ipv6 addresses which contain [ and ]\r\n\t\t\t\t\t\thasOpenSquareBracket = true;\r\n\t\t\t\t\t\tchClass = CharacterClass.None;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tchClass = classifier.get(chCode);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Check if character terminates link\r\n\t\t\t\t\tif (chClass === CharacterClass.ForceTermination) {\r\n\t\t\t\t\t\tresetStateMachine = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstate = State.Accept;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstate = stateMachine.nextState(state, chCode);\r\n\t\t\t\t\tif (state === State.Invalid) {\r\n\t\t\t\t\t\tresetStateMachine = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (resetStateMachine) {\r\n\t\t\t\t\tstate = State.Start;\r\n\t\t\t\t\thasOpenParens = false;\r\n\t\t\t\t\thasOpenSquareBracket = false;\r\n\t\t\t\t\thasOpenCurlyBracket = false;\r\n\r\n\t\t\t\t\t// Record where the link started\r\n\t\t\t\t\tlinkBeginIndex = j + 1;\r\n\t\t\t\t\tlinkBeginChCode = chCode;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\r\n\t\t\tif (state === State.Accept) {\r\n\t\t\t\tresult.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len));\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns an array of all links contains in the provided\r\n * document. *Note* that this operation is computational\r\n * expensive and should not run in the UI thread.\r\n */\r\nexport function computeLinks(model: ILinkComputerTarget | null): ILink[] {\r\n\tif (!model || typeof model.getLineCount !== 'function' || typeof model.getLineContent !== 'function') {\r\n\t\t// Unknown caller!\r\n\t\treturn [];\r\n\t}\r\n\treturn LinkComputer.computeLinks(model);\r\n}\r\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\r\nimport { IRange } from 'vs/editor/common/core/range';\r\nimport { IInplaceReplaceSupportResult } from 'vs/editor/common/modes';\r\n\r\nexport class BasicInplaceReplace {\r\n\r\n\tpublic static readonly INSTANCE = new BasicInplaceReplace();\r\n\r\n\tpublic navigateValueSet(range1: IRange, text1: string, range2: IRange, text2: string | null, up: boolean): IInplaceReplaceSupportResult | null {\r\n\r\n\t\tif (range1 && text1) {\r\n\t\t\tlet result = this.doNavigateValueSet(text1, up);\r\n\t\t\tif (result) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\trange: range1,\r\n\t\t\t\t\tvalue: result\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (range2 && text2) {\r\n\t\t\tlet result = this.doNavigateValueSet(text2, up);\r\n\t\t\tif (result) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\trange: range2,\r\n\t\t\t\t\tvalue: result\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tprivate doNavigateValueSet(text: string, up: boolean): string | null {\r\n\t\tlet numberResult = this.numberReplace(text, up);\r\n\t\tif (numberResult !== null) {\r\n\t\t\treturn numberResult;\r\n\t\t}\r\n\t\treturn this.textReplace(text, up);\r\n\t}\r\n\r\n\tprivate numberReplace(value: string, up: boolean): string | null {\r\n\t\tlet precision = Math.pow(10, value.length - (value.lastIndexOf('.') + 1));\r\n\t\tlet n1 = Number(value);\r\n\t\tlet n2 = parseFloat(value);\r\n\r\n\t\tif (!isNaN(n1) && !isNaN(n2) && n1 === n2) {\r\n\r\n\t\t\tif (n1 === 0 && !up) {\r\n\t\t\t\treturn null; // don't do negative\r\n\t\t\t\t//\t\t\t} else if(n1 === 9 && up) {\r\n\t\t\t\t//\t\t\t\treturn null; // don't insert 10 into a number\r\n\t\t\t} else {\r\n\t\t\t\tn1 = Math.floor(n1 * precision);\r\n\t\t\t\tn1 += up ? precision : -precision;\r\n\t\t\t\treturn String(n1 / precision);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tprivate readonly _defaultValueSet: string[][] = [\r\n\t\t['true', 'false'],\r\n\t\t['True', 'False'],\r\n\t\t['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'],\r\n\t\t['public', 'protected', 'private'],\r\n\t];\r\n\r\n\tprivate textReplace(value: string, up: boolean): string | null {\r\n\t\treturn this.valueSetsReplace(this._defaultValueSet, value, up);\r\n\t}\r\n\r\n\tprivate valueSetsReplace(valueSets: string[][], value: string, up: boolean): string | null {\r\n\t\tlet result: string | null = null;\r\n\t\tfor (let i = 0, len = valueSets.length; result === null && i < len; i++) {\r\n\t\t\tresult = this.valueSetReplace(valueSets[i], value, up);\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tprivate valueSetReplace(valueSet: string[], value: string, up: boolean): string | null {\r\n\t\tlet idx = valueSet.indexOf(value);\r\n\t\tif (idx >= 0) {\r\n\t\t\tidx += up ? +1 : -1;\r\n\t\t\tif (idx < 0) {\r\n\t\t\t\tidx = valueSet.length - 1;\r\n\t\t\t} else {\r\n\t\t\t\tidx %= valueSet.length;\r\n\t\t\t}\r\n\t\t\treturn valueSet[idx];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n}\r\n","/*!\nCopyright (c) 2014 Taylor Hakes\nCopyright (c) 2014 Forbes Lindesay\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n\t\ttypeof define === 'function' && define.amd ? define(\"vs/editor/common/standalone/promise-polyfill/polyfill\", factory) :\n\t\t\t(factory());\n}(this, (function () {\n\t'use strict';\n\n\t/**\n\t * @this {Promise}\n\t */\n\tfunction finallyConstructor(callback) {\n\t\tvar constructor = this.constructor;\n\t\treturn this.then(\n\t\t\tfunction (value) {\n\t\t\t\treturn constructor.resolve(callback()).then(function () {\n\t\t\t\t\treturn value;\n\t\t\t\t});\n\t\t\t},\n\t\t\tfunction (reason) {\n\t\t\t\treturn constructor.resolve(callback()).then(function () {\n\t\t\t\t\treturn constructor.reject(reason);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\n\t// Store setTimeout reference so promise-polyfill will be unaffected by\n\t// other code modifying setTimeout (like sinon.useFakeTimers())\n\tvar setTimeoutFunc = setTimeout;\n\n\tfunction noop() { }\n\n\t// Polyfill for Function.prototype.bind\n\tfunction bind(fn, thisArg) {\n\t\treturn function () {\n\t\t\tfn.apply(thisArg, arguments);\n\t\t};\n\t}\n\n\t/**\n\t * @constructor\n\t * @param {Function} fn\n\t */\n\tfunction Promise(fn) {\n\t\tif (!(this instanceof Promise))\n\t\t\tthrow new TypeError('Promises must be constructed via new');\n\t\tif (typeof fn !== 'function') throw new TypeError('not a function');\n\t\t/** @type {!number} */\n\t\tthis._state = 0;\n\t\t/** @type {!boolean} */\n\t\tthis._handled = false;\n\t\t/** @type {Promise|undefined} */\n\t\tthis._value = undefined;\n\t\t/** @type {!Array<!Function>} */\n\t\tthis._deferreds = [];\n\n\t\tdoResolve(fn, this);\n\t}\n\n\tfunction handle(self, deferred) {\n\t\twhile (self._state === 3) {\n\t\t\tself = self._value;\n\t\t}\n\t\tif (self._state === 0) {\n\t\t\tself._deferreds.push(deferred);\n\t\t\treturn;\n\t\t}\n\t\tself._handled = true;\n\t\tPromise._immediateFn(function () {\n\t\t\tvar cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n\t\t\tif (cb === null) {\n\t\t\t\t(self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar ret;\n\t\t\ttry {\n\t\t\t\tret = cb(self._value);\n\t\t\t} catch (e) {\n\t\t\t\treject(deferred.promise, e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolve(deferred.promise, ret);\n\t\t});\n\t}\n\n\tfunction resolve(self, newValue) {\n\t\ttry {\n\t\t\t// Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n\t\t\tif (newValue === self)\n\t\t\t\tthrow new TypeError('A promise cannot be resolved with itself.');\n\t\t\tif (\n\t\t\t\tnewValue &&\n\t\t\t\t(typeof newValue === 'object' || typeof newValue === 'function')\n\t\t\t) {\n\t\t\t\tvar then = newValue.then;\n\t\t\t\tif (newValue instanceof Promise) {\n\t\t\t\t\tself._state = 3;\n\t\t\t\t\tself._value = newValue;\n\t\t\t\t\tfinale(self);\n\t\t\t\t\treturn;\n\t\t\t\t} else if (typeof then === 'function') {\n\t\t\t\t\tdoResolve(bind(then, newValue), self);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tself._state = 1;\n\t\t\tself._value = newValue;\n\t\t\tfinale(self);\n\t\t} catch (e) {\n\t\t\treject(self, e);\n\t\t}\n\t}\n\n\tfunction reject(self, newValue) {\n\t\tself._state = 2;\n\t\tself._value = newValue;\n\t\tfinale(self);\n\t}\n\n\tfunction finale(self) {\n\t\tif (self._state === 2 && self._deferreds.length === 0) {\n\t\t\tPromise._immediateFn(function () {\n\t\t\t\tif (!self._handled) {\n\t\t\t\t\tPromise._unhandledRejectionFn(self._value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfor (var i = 0, len = self._deferreds.length; i < len; i++) {\n\t\t\thandle(self, self._deferreds[i]);\n\t\t}\n\t\tself._deferreds = null;\n\t}\n\n\t/**\n\t * @constructor\n\t */\n\tfunction Handler(onFulfilled, onRejected, promise) {\n\t\tthis.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n\t\tthis.onRejected = typeof onRejected === 'function' ? onRejected : null;\n\t\tthis.promise = promise;\n\t}\n\n\t/**\n\t * Take a potentially misbehaving resolver function and make sure\n\t * onFulfilled and onRejected are only called once.\n\t *\n\t * Makes no guarantees about asynchrony.\n\t */\n\tfunction doResolve(fn, self) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(\n\t\t\t\tfunction (value) {\n\t\t\t\t\tif (done) return;\n\t\t\t\t\tdone = true;\n\t\t\t\t\tresolve(self, value);\n\t\t\t\t},\n\t\t\t\tfunction (reason) {\n\t\t\t\t\tif (done) return;\n\t\t\t\t\tdone = true;\n\t\t\t\t\treject(self, reason);\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (ex) {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\treject(self, ex);\n\t\t}\n\t}\n\n\tPromise.prototype['catch'] = function (onRejected) {\n\t\treturn this.then(null, onRejected);\n\t};\n\n\tPromise.prototype.then = function (onFulfilled, onRejected) {\n\t\t// @ts-ignore\n\t\tvar prom = new this.constructor(noop);\n\n\t\thandle(this, new Handler(onFulfilled, onRejected, prom));\n\t\treturn prom;\n\t};\n\n\tPromise.prototype['finally'] = finallyConstructor;\n\n\tPromise.all = function (arr) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tif (!arr || typeof arr.length === 'undefined')\n\t\t\t\tthrow new TypeError('Promise.all accepts an array');\n\t\t\tvar args = Array.prototype.slice.call(arr);\n\t\t\tif (args.length === 0) return resolve([]);\n\t\t\tvar remaining = args.length;\n\n\t\t\tfunction res(i, val) {\n\t\t\t\ttry {\n\t\t\t\t\tif (val && (typeof val === 'object' || typeof val === 'function')) {\n\t\t\t\t\t\tvar then = val.then;\n\t\t\t\t\t\tif (typeof then === 'function') {\n\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\tval,\n\t\t\t\t\t\t\t\tfunction (val) {\n\t\t\t\t\t\t\t\t\tres(i, val);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\treject\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\targs[i] = val;\n\t\t\t\t\tif (--remaining === 0) {\n\t\t\t\t\t\tresolve(args);\n\t\t\t\t\t}\n\t\t\t\t} catch (ex) {\n\t\t\t\t\treject(ex);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < args.length; i++) {\n\t\t\t\tres(i, args[i]);\n\t\t\t}\n\t\t});\n\t};\n\n\tPromise.resolve = function (value) {\n\t\tif (value && typeof value === 'object' && value.constructor === Promise) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn new Promise(function (resolve) {\n\t\t\tresolve(value);\n\t\t});\n\t};\n\n\tPromise.reject = function (value) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\treject(value);\n\t\t});\n\t};\n\n\tPromise.race = function (values) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tfor (var i = 0, len = values.length; i < len; i++) {\n\t\t\t\tvalues[i].then(resolve, reject);\n\t\t\t}\n\t\t});\n\t};\n\n\t// Use polyfill for setImmediate for performance gains\n\tPromise._immediateFn =\n\t\t(typeof setImmediate === 'function' &&\n\t\t\tfunction (fn) {\n\t\t\t\tsetImmediate(fn);\n\t\t\t}) ||\n\t\tfunction (fn) {\n\t\t\tsetTimeoutFunc(fn, 0);\n\t\t};\n\n\tPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n\t\tif (typeof console !== 'undefined' && console) {\n\t\t\tconsole.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n\t\t}\n\t};\n\n\t/** @suppress {undefinedVars} */\n\tvar globalNS = (function () {\n\t\t// the only reliable means to get the global object is\n\t\t// `Function('return this')()`\n\t\t// However, this causes CSP violations in Chrome apps.\n\t\tif (typeof self !== 'undefined') {\n\t\t\treturn self;\n\t\t}\n\t\tif (typeof window !== 'undefined') {\n\t\t\treturn window;\n\t\t}\n\t\tif (typeof global !== 'undefined') {\n\t\t\treturn global;\n\t\t}\n\t\tthrow new Error('unable to locate global object');\n\t})();\n\n\tif (!('Promise' in globalNS)) {\n\t\tglobalNS['Promise'] = Promise;\n\t} else if (!globalNS.Promise.prototype['finally']) {\n\t\tglobalNS.Promise.prototype['finally'] = finallyConstructor;\n\t}\n\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\r\n// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.\r\n\r\n\r\nexport enum AccessibilitySupport {\r\n\t/**\r\n\t * This should be the browser case where it is not known if a screen reader is attached or no.\r\n\t */\r\n\tUnknown = 0,\r\n\tDisabled = 1,\r\n\tEnabled = 2\r\n}\r\n\r\nexport enum CompletionItemInsertTextRule {\r\n\t/**\r\n\t * Adjust whitespace/indentation of multiline insert texts to\r\n\t * match the current line indentation.\r\n\t */\r\n\tKeepWhitespace = 1,\r\n\t/**\r\n\t * `insertText` is a snippet.\r\n\t */\r\n\tInsertAsSnippet = 4\r\n}\r\n\r\nexport enum CompletionItemKind {\r\n\tMethod = 0,\r\n\tFunction = 1,\r\n\tConstructor = 2,\r\n\tField = 3,\r\n\tVariable = 4,\r\n\tClass = 5,\r\n\tStruct = 6,\r\n\tInterface = 7,\r\n\tModule = 8,\r\n\tProperty = 9,\r\n\tEvent = 10,\r\n\tOperator = 11,\r\n\tUnit = 12,\r\n\tValue = 13,\r\n\tConstant = 14,\r\n\tEnum = 15,\r\n\tEnumMember = 16,\r\n\tKeyword = 17,\r\n\tText = 18,\r\n\tColor = 19,\r\n\tFile = 20,\r\n\tReference = 21,\r\n\tCustomcolor = 22,\r\n\tFolder = 23,\r\n\tTypeParameter = 24,\r\n\tSnippet = 25\r\n}\r\n\r\nexport enum CompletionItemTag {\r\n\tDeprecated = 1\r\n}\r\n\r\n/**\r\n * How a suggest provider was triggered.\r\n */\r\nexport enum CompletionTriggerKind {\r\n\tInvoke = 0,\r\n\tTriggerCharacter = 1,\r\n\tTriggerForIncompleteCompletions = 2\r\n}\r\n\r\n/**\r\n * A positioning preference for rendering content widgets.\r\n */\r\nexport enum ContentWidgetPositionPreference {\r\n\t/**\r\n\t * Place the content widget exactly at a position\r\n\t */\r\n\tEXACT = 0,\r\n\t/**\r\n\t * Place the content widget above a position\r\n\t */\r\n\tABOVE = 1,\r\n\t/**\r\n\t * Place the content widget below a position\r\n\t */\r\n\tBELOW = 2\r\n}\r\n\r\n/**\r\n * Describes the reason the cursor has changed its position.\r\n */\r\nexport enum CursorChangeReason {\r\n\t/**\r\n\t * Unknown or not set.\r\n\t */\r\n\tNotSet = 0,\r\n\t/**\r\n\t * A `model.setValue()` was called.\r\n\t */\r\n\tContentFlush = 1,\r\n\t/**\r\n\t * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers.\r\n\t */\r\n\tRecoverFromMarkers = 2,\r\n\t/**\r\n\t * There was an explicit user gesture.\r\n\t */\r\n\tExplicit = 3,\r\n\t/**\r\n\t * There was a Paste.\r\n\t */\r\n\tPaste = 4,\r\n\t/**\r\n\t * There was an Undo.\r\n\t */\r\n\tUndo = 5,\r\n\t/**\r\n\t * There was a Redo.\r\n\t */\r\n\tRedo = 6\r\n}\r\n\r\n/**\r\n * The default end of line to use when instantiating models.\r\n */\r\nexport enum DefaultEndOfLine {\r\n\t/**\r\n\t * Use line feed (\\n) as the end of line character.\r\n\t */\r\n\tLF = 1,\r\n\t/**\r\n\t * Use carriage return and line feed (\\r\\n) as the end of line character.\r\n\t */\r\n\tCRLF = 2\r\n}\r\n\r\n/**\r\n * A document highlight kind.\r\n */\r\nexport enum DocumentHighlightKind {\r\n\t/**\r\n\t * A textual occurrence.\r\n\t */\r\n\tText = 0,\r\n\t/**\r\n\t * Read-access of a symbol, like reading a variable.\r\n\t */\r\n\tRead = 1,\r\n\t/**\r\n\t * Write-access of a symbol, like writing to a variable.\r\n\t */\r\n\tWrite = 2\r\n}\r\n\r\n/**\r\n * Configuration options for auto indentation in the editor\r\n */\r\nexport enum EditorAutoIndentStrategy {\r\n\tNone = 0,\r\n\tKeep = 1,\r\n\tBrackets = 2,\r\n\tAdvanced = 3,\r\n\tFull = 4\r\n}\r\n\r\nexport enum EditorOption {\r\n\tacceptSuggestionOnCommitCharacter = 0,\r\n\tacceptSuggestionOnEnter = 1,\r\n\taccessibilitySupport = 2,\r\n\taccessibilityPageSize = 3,\r\n\tariaLabel = 4,\r\n\tautoClosingBrackets = 5,\r\n\tautoClosingOvertype = 6,\r\n\tautoClosingQuotes = 7,\r\n\tautoIndent = 8,\r\n\tautomaticLayout = 9,\r\n\tautoSurround = 10,\r\n\tcodeLens = 11,\r\n\tcolorDecorators = 12,\r\n\tcomments = 13,\r\n\tcontextmenu = 14,\r\n\tcopyWithSyntaxHighlighting = 15,\r\n\tcursorBlinking = 16,\r\n\tcursorSmoothCaretAnimation = 17,\r\n\tcursorStyle = 18,\r\n\tcursorSurroundingLines = 19,\r\n\tcursorSurroundingLinesStyle = 20,\r\n\tcursorWidth = 21,\r\n\tdisableLayerHinting = 22,\r\n\tdisableMonospaceOptimizations = 23,\r\n\tdragAndDrop = 24,\r\n\temptySelectionClipboard = 25,\r\n\textraEditorClassName = 26,\r\n\tfastScrollSensitivity = 27,\r\n\tfind = 28,\r\n\tfixedOverflowWidgets = 29,\r\n\tfolding = 30,\r\n\tfoldingStrategy = 31,\r\n\tfoldingHighlight = 32,\r\n\tfontFamily = 33,\r\n\tfontInfo = 34,\r\n\tfontLigatures = 35,\r\n\tfontSize = 36,\r\n\tfontWeight = 37,\r\n\tformatOnPaste = 38,\r\n\tformatOnType = 39,\r\n\tglyphMargin = 40,\r\n\tgotoLocation = 41,\r\n\thideCursorInOverviewRuler = 42,\r\n\thighlightActiveIndentGuide = 43,\r\n\thover = 44,\r\n\tinDiffEditor = 45,\r\n\tletterSpacing = 46,\r\n\tlightbulb = 47,\r\n\tlineDecorationsWidth = 48,\r\n\tlineHeight = 49,\r\n\tlineNumbers = 50,\r\n\tlineNumbersMinChars = 51,\r\n\tlinks = 52,\r\n\tmatchBrackets = 53,\r\n\tminimap = 54,\r\n\tmouseStyle = 55,\r\n\tmouseWheelScrollSensitivity = 56,\r\n\tmouseWheelZoom = 57,\r\n\tmultiCursorMergeOverlapping = 58,\r\n\tmultiCursorModifier = 59,\r\n\tmultiCursorPaste = 60,\r\n\toccurrencesHighlight = 61,\r\n\toverviewRulerBorder = 62,\r\n\toverviewRulerLanes = 63,\r\n\tparameterHints = 64,\r\n\tpeekWidgetDefaultFocus = 65,\r\n\tquickSuggestions = 66,\r\n\tquickSuggestionsDelay = 67,\r\n\treadOnly = 68,\r\n\trenderControlCharacters = 69,\r\n\trenderIndentGuides = 70,\r\n\trenderFinalNewline = 71,\r\n\trenderLineHighlight = 72,\r\n\trenderValidationDecorations = 73,\r\n\trenderWhitespace = 74,\r\n\trevealHorizontalRightPadding = 75,\r\n\troundedSelection = 76,\r\n\trulers = 77,\r\n\tscrollbar = 78,\r\n\tscrollBeyondLastColumn = 79,\r\n\tscrollBeyondLastLine = 80,\r\n\tselectionClipboard = 81,\r\n\tselectionHighlight = 82,\r\n\tselectOnLineNumbers = 83,\r\n\tshowFoldingControls = 84,\r\n\tshowUnused = 85,\r\n\tsnippetSuggestions = 86,\r\n\tsmoothScrolling = 87,\r\n\tstopRenderingLineAfter = 88,\r\n\tsuggest = 89,\r\n\tsuggestFontSize = 90,\r\n\tsuggestLineHeight = 91,\r\n\tsuggestOnTriggerCharacters = 92,\r\n\tsuggestSelection = 93,\r\n\ttabCompletion = 94,\r\n\tuseTabStops = 95,\r\n\twordSeparators = 96,\r\n\twordWrap = 97,\r\n\twordWrapBreakAfterCharacters = 98,\r\n\twordWrapBreakBeforeCharacters = 99,\r\n\twordWrapColumn = 100,\r\n\twordWrapMinified = 101,\r\n\twrappingIndent = 102,\r\n\twrappingStrategy = 103,\r\n\teditorClassName = 104,\r\n\tpixelRatio = 105,\r\n\ttabFocusMode = 106,\r\n\tlayoutInfo = 107,\r\n\twrappingInfo = 108\r\n}\r\n\r\n/**\r\n * End of line character preference.\r\n */\r\nexport enum EndOfLinePreference {\r\n\t/**\r\n\t * Use the end of line character identified in the text buffer.\r\n\t */\r\n\tTextDefined = 0,\r\n\t/**\r\n\t * Use line feed (\\n) as the end of line character.\r\n\t */\r\n\tLF = 1,\r\n\t/**\r\n\t * Use carriage return and line feed (\\r\\n) as the end of line character.\r\n\t */\r\n\tCRLF = 2\r\n}\r\n\r\n/**\r\n * End of line character preference.\r\n */\r\nexport enum EndOfLineSequence {\r\n\t/**\r\n\t * Use line feed (\\n) as the end of line character.\r\n\t */\r\n\tLF = 0,\r\n\t/**\r\n\t * Use carriage return and line feed (\\r\\n) as the end of line character.\r\n\t */\r\n\tCRLF = 1\r\n}\r\n\r\n/**\r\n * Describes what to do with the indentation when pressing Enter.\r\n */\r\nexport enum IndentAction {\r\n\t/**\r\n\t * Insert new line and copy the previous line's indentation.\r\n\t */\r\n\tNone = 0,\r\n\t/**\r\n\t * Insert new line and indent once (relative to the previous line's indentation).\r\n\t */\r\n\tIndent = 1,\r\n\t/**\r\n\t * Insert two new lines:\r\n\t * - the first one indented which will hold the cursor\r\n\t * - the second one at the same indentation level\r\n\t */\r\n\tIndentOutdent = 2,\r\n\t/**\r\n\t * Insert new line and outdent once (relative to the previous line's indentation).\r\n\t */\r\n\tOutdent = 3\r\n}\r\n\r\n/**\r\n * Virtual Key Codes, the value does not hold any inherent meaning.\r\n * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\r\n * But these are \"more general\", as they should work across browsers & OS`s.\r\n */\r\nexport enum KeyCode {\r\n\t/**\r\n\t * Placed first to cover the 0 value of the enum.\r\n\t */\r\n\tUnknown = 0,\r\n\tBackspace = 1,\r\n\tTab = 2,\r\n\tEnter = 3,\r\n\tShift = 4,\r\n\tCtrl = 5,\r\n\tAlt = 6,\r\n\tPauseBreak = 7,\r\n\tCapsLock = 8,\r\n\tEscape = 9,\r\n\tSpace = 10,\r\n\tPageUp = 11,\r\n\tPageDown = 12,\r\n\tEnd = 13,\r\n\tHome = 14,\r\n\tLeftArrow = 15,\r\n\tUpArrow = 16,\r\n\tRightArrow = 17,\r\n\tDownArrow = 18,\r\n\tInsert = 19,\r\n\tDelete = 20,\r\n\tKEY_0 = 21,\r\n\tKEY_1 = 22,\r\n\tKEY_2 = 23,\r\n\tKEY_3 = 24,\r\n\tKEY_4 = 25,\r\n\tKEY_5 = 26,\r\n\tKEY_6 = 27,\r\n\tKEY_7 = 28,\r\n\tKEY_8 = 29,\r\n\tKEY_9 = 30,\r\n\tKEY_A = 31,\r\n\tKEY_B = 32,\r\n\tKEY_C = 33,\r\n\tKEY_D = 34,\r\n\tKEY_E = 35,\r\n\tKEY_F = 36,\r\n\tKEY_G = 37,\r\n\tKEY_H = 38,\r\n\tKEY_I = 39,\r\n\tKEY_J = 40,\r\n\tKEY_K = 41,\r\n\tKEY_L = 42,\r\n\tKEY_M = 43,\r\n\tKEY_N = 44,\r\n\tKEY_O = 45,\r\n\tKEY_P = 46,\r\n\tKEY_Q = 47,\r\n\tKEY_R = 48,\r\n\tKEY_S = 49,\r\n\tKEY_T = 50,\r\n\tKEY_U = 51,\r\n\tKEY_V = 52,\r\n\tKEY_W = 53,\r\n\tKEY_X = 54,\r\n\tKEY_Y = 55,\r\n\tKEY_Z = 56,\r\n\tMeta = 57,\r\n\tContextMenu = 58,\r\n\tF1 = 59,\r\n\tF2 = 60,\r\n\tF3 = 61,\r\n\tF4 = 62,\r\n\tF5 = 63,\r\n\tF6 = 64,\r\n\tF7 = 65,\r\n\tF8 = 66,\r\n\tF9 = 67,\r\n\tF10 = 68,\r\n\tF11 = 69,\r\n\tF12 = 70,\r\n\tF13 = 71,\r\n\tF14 = 72,\r\n\tF15 = 73,\r\n\tF16 = 74,\r\n\tF17 = 75,\r\n\tF18 = 76,\r\n\tF19 = 77,\r\n\tNumLock = 78,\r\n\tScrollLock = 79,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the ';:' key\r\n\t */\r\n\tUS_SEMICOLON = 80,\r\n\t/**\r\n\t * For any country/region, the '+' key\r\n\t * For the US standard keyboard, the '=+' key\r\n\t */\r\n\tUS_EQUAL = 81,\r\n\t/**\r\n\t * For any country/region, the ',' key\r\n\t * For the US standard keyboard, the ',<' key\r\n\t */\r\n\tUS_COMMA = 82,\r\n\t/**\r\n\t * For any country/region, the '-' key\r\n\t * For the US standard keyboard, the '-_' key\r\n\t */\r\n\tUS_MINUS = 83,\r\n\t/**\r\n\t * For any country/region, the '.' key\r\n\t * For the US standard keyboard, the '.>' key\r\n\t */\r\n\tUS_DOT = 84,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the '/?' key\r\n\t */\r\n\tUS_SLASH = 85,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the '`~' key\r\n\t */\r\n\tUS_BACKTICK = 86,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the '[{' key\r\n\t */\r\n\tUS_OPEN_SQUARE_BRACKET = 87,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the '\\|' key\r\n\t */\r\n\tUS_BACKSLASH = 88,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the ']}' key\r\n\t */\r\n\tUS_CLOSE_SQUARE_BRACKET = 89,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t * For the US standard keyboard, the ''\"' key\r\n\t */\r\n\tUS_QUOTE = 90,\r\n\t/**\r\n\t * Used for miscellaneous characters; it can vary by keyboard.\r\n\t */\r\n\tOEM_8 = 91,\r\n\t/**\r\n\t * Either the angle bracket key or the backslash key on the RT 102-key keyboard.\r\n\t */\r\n\tOEM_102 = 92,\r\n\tNUMPAD_0 = 93,\r\n\tNUMPAD_1 = 94,\r\n\tNUMPAD_2 = 95,\r\n\tNUMPAD_3 = 96,\r\n\tNUMPAD_4 = 97,\r\n\tNUMPAD_5 = 98,\r\n\tNUMPAD_6 = 99,\r\n\tNUMPAD_7 = 100,\r\n\tNUMPAD_8 = 101,\r\n\tNUMPAD_9 = 102,\r\n\tNUMPAD_MULTIPLY = 103,\r\n\tNUMPAD_ADD = 104,\r\n\tNUMPAD_SEPARATOR = 105,\r\n\tNUMPAD_SUBTRACT = 106,\r\n\tNUMPAD_DECIMAL = 107,\r\n\tNUMPAD_DIVIDE = 108,\r\n\t/**\r\n\t * Cover all key codes when IME is processing input.\r\n\t */\r\n\tKEY_IN_COMPOSITION = 109,\r\n\tABNT_C1 = 110,\r\n\tABNT_C2 = 111,\r\n\t/**\r\n\t * Placed last to cover the length of the enum.\r\n\t * Please do not depend on this value!\r\n\t */\r\n\tMAX_VALUE = 112\r\n}\r\n\r\nexport enum MarkerSeverity {\r\n\tHint = 1,\r\n\tInfo = 2,\r\n\tWarning = 4,\r\n\tError = 8\r\n}\r\n\r\nexport enum MarkerTag {\r\n\tUnnecessary = 1,\r\n\tDeprecated = 2\r\n}\r\n\r\n/**\r\n * Position in the minimap to render the decoration.\r\n */\r\nexport enum MinimapPosition {\r\n\tInline = 1,\r\n\tGutter = 2\r\n}\r\n\r\n/**\r\n * Type of hit element with the mouse in the editor.\r\n */\r\nexport enum MouseTargetType {\r\n\t/**\r\n\t * Mouse is on top of an unknown element.\r\n\t */\r\n\tUNKNOWN = 0,\r\n\t/**\r\n\t * Mouse is on top of the textarea used for input.\r\n\t */\r\n\tTEXTAREA = 1,\r\n\t/**\r\n\t * Mouse is on top of the glyph margin\r\n\t */\r\n\tGUTTER_GLYPH_MARGIN = 2,\r\n\t/**\r\n\t * Mouse is on top of the line numbers\r\n\t */\r\n\tGUTTER_LINE_NUMBERS = 3,\r\n\t/**\r\n\t * Mouse is on top of the line decorations\r\n\t */\r\n\tGUTTER_LINE_DECORATIONS = 4,\r\n\t/**\r\n\t * Mouse is on top of the whitespace left in the gutter by a view zone.\r\n\t */\r\n\tGUTTER_VIEW_ZONE = 5,\r\n\t/**\r\n\t * Mouse is on top of text in the content.\r\n\t */\r\n\tCONTENT_TEXT = 6,\r\n\t/**\r\n\t * Mouse is on top of empty space in the content (e.g. after line text or below last line)\r\n\t */\r\n\tCONTENT_EMPTY = 7,\r\n\t/**\r\n\t * Mouse is on top of a view zone in the content.\r\n\t */\r\n\tCONTENT_VIEW_ZONE = 8,\r\n\t/**\r\n\t * Mouse is on top of a content widget.\r\n\t */\r\n\tCONTENT_WIDGET = 9,\r\n\t/**\r\n\t * Mouse is on top of the decorations overview ruler.\r\n\t */\r\n\tOVERVIEW_RULER = 10,\r\n\t/**\r\n\t * Mouse is on top of a scrollbar.\r\n\t */\r\n\tSCROLLBAR = 11,\r\n\t/**\r\n\t * Mouse is on top of an overlay widget.\r\n\t */\r\n\tOVERLAY_WIDGET = 12,\r\n\t/**\r\n\t * Mouse is outside of the editor.\r\n\t */\r\n\tOUTSIDE_EDITOR = 13\r\n}\r\n\r\n/**\r\n * A positioning preference for rendering overlay widgets.\r\n */\r\nexport enum OverlayWidgetPositionPreference {\r\n\t/**\r\n\t * Position the overlay widget in the top right corner\r\n\t */\r\n\tTOP_RIGHT_CORNER = 0,\r\n\t/**\r\n\t * Position the overlay widget in the bottom right corner\r\n\t */\r\n\tBOTTOM_RIGHT_CORNER = 1,\r\n\t/**\r\n\t * Position the overlay widget in the top center\r\n\t */\r\n\tTOP_CENTER = 2\r\n}\r\n\r\n/**\r\n * Vertical Lane in the overview ruler of the editor.\r\n */\r\nexport enum OverviewRulerLane {\r\n\tLeft = 1,\r\n\tCenter = 2,\r\n\tRight = 4,\r\n\tFull = 7\r\n}\r\n\r\nexport enum RenderLineNumbersType {\r\n\tOff = 0,\r\n\tOn = 1,\r\n\tRelative = 2,\r\n\tInterval = 3,\r\n\tCustom = 4\r\n}\r\n\r\nexport enum RenderMinimap {\r\n\tNone = 0,\r\n\tText = 1,\r\n\tBlocks = 2\r\n}\r\n\r\nexport enum ScrollType {\r\n\tSmooth = 0,\r\n\tImmediate = 1\r\n}\r\n\r\nexport enum ScrollbarVisibility {\r\n\tAuto = 1,\r\n\tHidden = 2,\r\n\tVisible = 3\r\n}\r\n\r\n/**\r\n * The direction of a selection.\r\n */\r\nexport enum SelectionDirection {\r\n\t/**\r\n\t * The selection starts above where it ends.\r\n\t */\r\n\tLTR = 0,\r\n\t/**\r\n\t * The selection starts below where it ends.\r\n\t */\r\n\tRTL = 1\r\n}\r\n\r\nexport enum SignatureHelpTriggerKind {\r\n\tInvoke = 1,\r\n\tTriggerCharacter = 2,\r\n\tContentChange = 3\r\n}\r\n\r\n/**\r\n * A symbol kind.\r\n */\r\nexport enum SymbolKind {\r\n\tFile = 0,\r\n\tModule = 1,\r\n\tNamespace = 2,\r\n\tPackage = 3,\r\n\tClass = 4,\r\n\tMethod = 5,\r\n\tProperty = 6,\r\n\tField = 7,\r\n\tConstructor = 8,\r\n\tEnum = 9,\r\n\tInterface = 10,\r\n\tFunction = 11,\r\n\tVariable = 12,\r\n\tConstant = 13,\r\n\tString = 14,\r\n\tNumber = 15,\r\n\tBoolean = 16,\r\n\tArray = 17,\r\n\tObject = 18,\r\n\tKey = 19,\r\n\tNull = 20,\r\n\tEnumMember = 21,\r\n\tStruct = 22,\r\n\tEvent = 23,\r\n\tOperator = 24,\r\n\tTypeParameter = 25\r\n}\r\n\r\nexport enum SymbolTag {\r\n\tDeprecated = 1\r\n}\r\n\r\n/**\r\n * The kind of animation in which the editor's cursor should be rendered.\r\n */\r\nexport enum TextEditorCursorBlinkingStyle {\r\n\t/**\r\n\t * Hidden\r\n\t */\r\n\tHidden = 0,\r\n\t/**\r\n\t * Blinking\r\n\t */\r\n\tBlink = 1,\r\n\t/**\r\n\t * Blinking with smooth fading\r\n\t */\r\n\tSmooth = 2,\r\n\t/**\r\n\t * Blinking with prolonged filled state and smooth fading\r\n\t */\r\n\tPhase = 3,\r\n\t/**\r\n\t * Expand collapse animation on the y axis\r\n\t */\r\n\tExpand = 4,\r\n\t/**\r\n\t * No-Blinking\r\n\t */\r\n\tSolid = 5\r\n}\r\n\r\n/**\r\n * The style in which the editor's cursor should be rendered.\r\n */\r\nexport enum TextEditorCursorStyle {\r\n\t/**\r\n\t * As a vertical line (sitting between two characters).\r\n\t */\r\n\tLine = 1,\r\n\t/**\r\n\t * As a block (sitting on top of a character).\r\n\t */\r\n\tBlock = 2,\r\n\t/**\r\n\t * As a horizontal line (sitting under a character).\r\n\t */\r\n\tUnderline = 3,\r\n\t/**\r\n\t * As a thin vertical line (sitting between two characters).\r\n\t */\r\n\tLineThin = 4,\r\n\t/**\r\n\t * As an outlined block (sitting on top of a character).\r\n\t */\r\n\tBlockOutline = 5,\r\n\t/**\r\n\t * As a thin horizontal line (sitting under a character).\r\n\t */\r\n\tUnderlineThin = 6\r\n}\r\n\r\n/**\r\n * Describes the behavior of decorations when typing/editing near their edges.\r\n * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`\r\n */\r\nexport enum TrackedRangeStickiness {\r\n\tAlwaysGrowsWhenTypingAtEdges = 0,\r\n\tNeverGrowsWhenTypingAtEdges = 1,\r\n\tGrowsOnlyWhenTypingBefore = 2,\r\n\tGrowsOnlyWhenTypingAfter = 3\r\n}\r\n\r\n/**\r\n * Describes how to indent wrapped lines.\r\n */\r\nexport enum WrappingIndent {\r\n\t/**\r\n\t * No indentation => wrapped lines begin at column 1.\r\n\t */\r\n\tNone = 0,\r\n\t/**\r\n\t * Same => wrapped lines get the same indentation as the parent.\r\n\t */\r\n\tSame = 1,\r\n\t/**\r\n\t * Indent => wrapped lines get +1 indentation toward the parent.\r\n\t */\r\n\tIndent = 2,\r\n\t/**\r\n\t * DeepIndent => wrapped lines get +2 indentation toward the parent.\r\n\t */\r\n\tDeepIndent = 3\r\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\r\nimport 'vs/editor/common/standalone/promise-polyfill/polyfill';\r\nimport { CancellationTokenSource } from 'vs/base/common/cancellation';\r\nimport { Emitter } from 'vs/base/common/event';\r\nimport { KeyChord, KeyMod as ConstKeyMod } from 'vs/base/common/keyCodes';\r\nimport { URI } from 'vs/base/common/uri';\r\nimport { Position } from 'vs/editor/common/core/position';\r\nimport { Range } from 'vs/editor/common/core/range';\r\nimport { Selection } from 'vs/editor/common/core/selection';\r\nimport { Token } from 'vs/editor/common/core/token';\r\nimport * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums';\r\n\r\nexport class KeyMod {\r\n\tpublic static readonly CtrlCmd: number = ConstKeyMod.CtrlCmd;\r\n\tpublic static readonly Shift: number = ConstKeyMod.Shift;\r\n\tpublic static readonly Alt: number = ConstKeyMod.Alt;\r\n\tpublic static readonly WinCtrl: number = ConstKeyMod.WinCtrl;\r\n\r\n\tpublic static chord(firstPart: number, secondPart: number): number {\r\n\t\treturn KeyChord(firstPart, secondPart);\r\n\t}\r\n}\r\n\r\nexport function createMonacoBaseAPI(): typeof monaco {\r\n\treturn {\r\n\t\teditor: undefined!, // undefined override expected here\r\n\t\tlanguages: undefined!, // undefined override expected here\r\n\t\tCancellationTokenSource: CancellationTokenSource,\r\n\t\tEmitter: Emitter,\r\n\t\tKeyCode: standaloneEnums.KeyCode,\r\n\t\tKeyMod: KeyMod,\r\n\t\tPosition: Position,\r\n\t\tRange: Range,\r\n\t\tSelection: <any>Selection,\r\n\t\tSelectionDirection: standaloneEnums.SelectionDirection,\r\n\t\tMarkerSeverity: standaloneEnums.MarkerSeverity,\r\n\t\tMarkerTag: standaloneEnums.MarkerTag,\r\n\t\tUri: <any>URI,\r\n\t\tToken: Token\r\n\t};\r\n}\r\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\r\nimport { toUint32 } from 'vs/base/common/uint';\r\n\r\nexport class PrefixSumIndexOfResult {\r\n\t_prefixSumIndexOfResultBrand: void;\r\n\r\n\tindex: number;\r\n\tremainder: number;\r\n\r\n\tconstructor(index: number, remainder: number) {\r\n\t\tthis.index = index;\r\n\t\tthis.remainder = remainder;\r\n\t}\r\n}\r\n\r\nexport class PrefixSumComputer {\r\n\r\n\t/**\r\n\t * values[i] is the value at index i\r\n\t */\r\n\tprivate values: Uint32Array;\r\n\r\n\t/**\r\n\t * prefixSum[i] = SUM(heights[j]), 0 <= j <= i\r\n\t */\r\n\tprivate prefixSum: Uint32Array;\r\n\r\n\t/**\r\n\t * prefixSum[i], 0 <= i <= prefixSumValidIndex can be trusted\r\n\t */\r\n\tprivate readonly prefixSumValidIndex: Int32Array;\r\n\r\n\tconstructor(values: Uint32Array) {\r\n\t\tthis.values = values;\r\n\t\tthis.prefixSum = new Uint32Array(values.length);\r\n\t\tthis.prefixSumValidIndex = new Int32Array(1);\r\n\t\tthis.prefixSumValidIndex[0] = -1;\r\n\t}\r\n\r\n\tpublic insertValues(insertIndex: number, insertValues: Uint32Array): boolean {\r\n\t\tinsertIndex = toUint32(insertIndex);\r\n\t\tconst oldValues = this.values;\r\n\t\tconst oldPrefixSum = this.prefixSum;\r\n\t\tconst insertValuesLen = insertValues.length;\r\n\r\n\t\tif (insertValuesLen === 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tthis.values = new Uint32Array(oldValues.length + insertValuesLen);\r\n\t\tthis.values.set(oldValues.subarray(0, insertIndex), 0);\r\n\t\tthis.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);\r\n\t\tthis.values.set(insertValues, insertIndex);\r\n\r\n\t\tif (insertIndex - 1 < this.prefixSumValidIndex[0]) {\r\n\t\t\tthis.prefixSumValidIndex[0] = insertIndex - 1;\r\n\t\t}\r\n\r\n\t\tthis.prefixSum = new Uint32Array(this.values.length);\r\n\t\tif (this.prefixSumValidIndex[0] >= 0) {\r\n\t\t\tthis.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\tpublic changeValue(index: number, value: number): boolean {\r\n\t\tindex = toUint32(index);\r\n\t\tvalue = toUint32(value);\r\n\r\n\t\tif (this.values[index] === value) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tthis.values[index] = value;\r\n\t\tif (index - 1 < this.prefixSumValidIndex[0]) {\r\n\t\t\tthis.prefixSumValidIndex[0] = index - 1;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\tpublic removeValues(startIndex: number, cnt: number): boolean {\r\n\t\tstartIndex = toUint32(startIndex);\r\n\t\tcnt = toUint32(cnt);\r\n\r\n\t\tconst oldValues = this.values;\r\n\t\tconst oldPrefixSum = this.prefixSum;\r\n\r\n\t\tif (startIndex >= oldValues.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tlet maxCnt = oldValues.length - startIndex;\r\n\t\tif (cnt >= maxCnt) {\r\n\t\t\tcnt = maxCnt;\r\n\t\t}\r\n\r\n\t\tif (cnt === 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tthis.values = new Uint32Array(oldValues.length - cnt);\r\n\t\tthis.values.set(oldValues.subarray(0, startIndex), 0);\r\n\t\tthis.values.set(oldValues.subarray(startIndex + cnt), startIndex);\r\n\r\n\t\tthis.prefixSum = new Uint32Array(this.values.length);\r\n\t\tif (startIndex - 1 < this.prefixSumValidIndex[0]) {\r\n\t\t\tthis.prefixSumValidIndex[0] = startIndex - 1;\r\n\t\t}\r\n\t\tif (this.prefixSumValidIndex[0] >= 0) {\r\n\t\t\tthis.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\tpublic getTotalValue(): number {\r\n\t\tif (this.values.length === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn this._getAccumulatedValue(this.values.length - 1);\r\n\t}\r\n\r\n\tpublic getAccumulatedValue(index: number): number {\r\n\t\tif (index < 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tindex = toUint32(index);\r\n\t\treturn this._getAccumulatedValue(index);\r\n\t}\r\n\r\n\tprivate _getAccumulatedValue(index: number): number {\r\n\t\tif (index <= this.prefixSumValidIndex[0]) {\r\n\t\t\treturn this.prefixSum[index];\r\n\t\t}\r\n\r\n\t\tlet startIndex = this.prefixSumValidIndex[0] + 1;\r\n\t\tif (startIndex === 0) {\r\n\t\t\tthis.prefixSum[0] = this.values[0];\r\n\t\t\tstartIndex++;\r\n\t\t}\r\n\r\n\t\tif (index >= this.values.length) {\r\n\t\t\tindex = this.values.length - 1;\r\n\t\t}\r\n\r\n\t\tfor (let i = startIndex; i <= index; i++) {\r\n\t\t\tthis.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];\r\n\t\t}\r\n\t\tthis.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);\r\n\t\treturn this.prefixSum[index];\r\n\t}\r\n\r\n\tpublic getIndexOf(accumulatedValue: number): PrefixSumIndexOfResult {\r\n\t\taccumulatedValue = Math.floor(accumulatedValue); //@perf\r\n\r\n\t\t// Compute all sums (to get a fully valid prefixSum)\r\n\t\tthis.getTotalValue();\r\n\r\n\t\tlet low = 0;\r\n\t\tlet high = this.values.length - 1;\r\n\t\tlet mid = 0;\r\n\t\tlet midStop = 0;\r\n\t\tlet midStart = 0;\r\n\r\n\t\twhile (low <= high) {\r\n\t\t\tmid = low + ((high - low) / 2) | 0;\r\n\r\n\t\t\tmidStop = this.prefixSum[mid];\r\n\t\t\tmidStart = midStop - this.values[mid];\r\n\r\n\t\t\tif (accumulatedValue < midStart) {\r\n\t\t\t\thigh = mid - 1;\r\n\t\t\t} else if (accumulatedValue >= midStop) {\r\n\t\t\t\tlow = mid + 1;\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn new PrefixSumIndexOfResult(mid, accumulatedValue - midStart);\r\n\t}\r\n}\r\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\r\nimport { URI } from 'vs/base/common/uri';\r\nimport { Position } from 'vs/editor/common/core/position';\r\nimport { IRange } from 'vs/editor/common/core/range';\r\nimport { IModelContentChange } from 'vs/editor/common/model/textModelEvents';\r\nimport { PrefixSumComputer } from 'vs/editor/common/viewModel/prefixSumComputer';\r\n\r\nexport interface IModelChangedEvent {\r\n\t/**\r\n\t * The actual changes.\r\n\t */\r\n\treadonly changes: IModelContentChange[];\r\n\t/**\r\n\t * The (new) end-of-line character.\r\n\t */\r\n\treadonly eol: string;\r\n\t/**\r\n\t * The new version id the model has transitioned to.\r\n\t */\r\n\treadonly versionId: number;\r\n}\r\n\r\nexport class MirrorTextModel {\r\n\r\n\tprotected _uri: URI;\r\n\tprotected _lines: string[];\r\n\tprotected _eol: string;\r\n\tprotected _versionId: number;\r\n\tprotected _lineStarts: PrefixSumComputer | null;\r\n\r\n\tconstructor(uri: URI, lines: string[], eol: string, versionId: number) {\r\n\t\tthis._uri = uri;\r\n\t\tthis._lines = lines;\r\n\t\tthis._eol = eol;\r\n\t\tthis._versionId = versionId;\r\n\t\tthis._lineStarts = null;\r\n\t}\r\n\r\n\tdispose(): void {\r\n\t\tthis._lines.length = 0;\r\n\t}\r\n\r\n\tgetText(): string {\r\n\t\treturn this._lines.join(this._eol);\r\n\t}\r\n\r\n\tonEvents(e: IModelChangedEvent): void {\r\n\t\tif (e.eol && e.eol !== this._eol) {\r\n\t\t\tthis._eol = e.eol;\r\n\t\t\tthis._lineStarts = null;\r\n\t\t}\r\n\r\n\t\t// Update my lines\r\n\t\tconst changes = e.changes;\r\n\t\tfor (const change of changes) {\r\n\t\t\tthis._acceptDeleteRange(change.range);\r\n\t\t\tthis._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text);\r\n\t\t}\r\n\r\n\t\tthis._versionId = e.versionId;\r\n\t}\r\n\r\n\tprotected _ensureLineStarts(): void {\r\n\t\tif (!this._lineStarts) {\r\n\t\t\tconst eolLength = this._eol.length;\r\n\t\t\tconst linesLength = this._lines.length;\r\n\t\t\tconst lineStartValues = new Uint32Array(linesLength);\r\n\t\t\tfor (let i = 0; i < linesLength; i++) {\r\n\t\t\t\tlineStartValues[i] = this._lines[i].length + eolLength;\r\n\t\t\t}\r\n\t\t\tthis._lineStarts = new PrefixSumComputer(lineStartValues);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * All changes to a line's text go through this method\r\n\t */\r\n\tprivate _setLineText(lineIndex: number, newValue: string): void {\r\n\t\tthis._lines[lineIndex] = newValue;\r\n\t\tif (this._lineStarts) {\r\n\t\t\t// update prefix sum\r\n\t\t\tthis._lineStarts.changeValue(lineIndex, this._lines[lineIndex].length + this._eol.length);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _acceptDeleteRange(range: IRange): void {\r\n\r\n\t\tif (range.startLineNumber === range.endLineNumber) {\r\n\t\t\tif (range.startColumn === range.endColumn) {\r\n\t\t\t\t// Nothing to delete\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t// Delete text on the affected line\r\n\t\t\tthis._setLineText(range.startLineNumber - 1,\r\n\t\t\t\tthis._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\r\n\t\t\t\t+ this._lines[range.startLineNumber - 1].substring(range.endColumn - 1)\r\n\t\t\t);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Take remaining text on last line and append it to remaining text on first line\r\n\t\tthis._setLineText(range.startLineNumber - 1,\r\n\t\t\tthis._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\r\n\t\t\t+ this._lines[range.endLineNumber - 1].substring(range.endColumn - 1)\r\n\t\t);\r\n\r\n\t\t// Delete middle lines\r\n\t\tthis._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber);\r\n\t\tif (this._lineStarts) {\r\n\t\t\t// update prefix sum\r\n\t\t\tthis._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _acceptInsertText(position: Position, insertText: string): void {\r\n\t\tif (insertText.length === 0) {\r\n\t\t\t// Nothing to insert\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlet insertLines = insertText.split(/\\r\\n|\\r|\\n/);\r\n\t\tif (insertLines.length === 1) {\r\n\t\t\t// Inserting text on one line\r\n\t\t\tthis._setLineText(position.lineNumber - 1,\r\n\t\t\t\tthis._lines[position.lineNumber - 1].substring(0, position.column - 1)\r\n\t\t\t\t+ insertLines[0]\r\n\t\t\t\t+ this._lines[position.lineNumber - 1].substring(position.column - 1)\r\n\t\t\t);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Append overflowing text from first line to the end of text to insert\r\n\t\tinsertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1);\r\n\r\n\t\t// Delete overflowing text from first line and insert text on first line\r\n\t\tthis._setLineText(position.lineNumber - 1,\r\n\t\t\tthis._lines[position.lineNumber - 1].substring(0, position.column - 1)\r\n\t\t\t+ insertLines[0]\r\n\t\t);\r\n\r\n\t\t// Insert new lines & store lengths\r\n\t\tlet newLengths = new Uint32Array(insertLines.length - 1);\r\n\t\tfor (let i = 1; i < insertLines.length; i++) {\r\n\t\t\tthis._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]);\r\n\t\t\tnewLengths[i - 1] = insertLines[i].length + this._eol.length;\r\n\t\t}\r\n\r\n\t\tif (this._lineStarts) {\r\n\t\t\t// update prefix sum\r\n\t\t\tthis._lineStarts.insertValues(position.lineNumber, newLengths);\r\n\t\t}\r\n\t}\r\n}\r\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\r\nimport { mergeSort } from 'vs/base/common/arrays';\r\nimport { stringDiff } from 'vs/base/common/diff/diff';\r\nimport { FIN, Iterator, IteratorResult } from 'vs/base/common/iterator';\r\nimport { IDisposable } from 'vs/base/common/lifecycle';\r\nimport { globals } from 'vs/base/common/platform';\r\nimport { URI } from 'vs/base/common/uri';\r\nimport { IRequestHandler } from 'vs/base/common/worker/simpleWorker';\r\nimport { IPosition, Position } from 'vs/editor/common/core/position';\r\nimport { IRange, Range } from 'vs/editor/common/core/range';\r\nimport { DiffComputer } from 'vs/editor/common/diff/diffComputer';\r\nimport { EndOfLineSequence, IWordAtPosition } from 'vs/editor/common/model';\r\nimport { IModelChangedEvent, MirrorTextModel as BaseMirrorModel } from 'vs/editor/common/model/mirrorTextModel';\r\nimport { ensureValidWordDefinition, getWordAtText } from 'vs/editor/common/model/wordHelper';\r\nimport { IInplaceReplaceSupportResult, ILink, TextEdit } from 'vs/editor/common/modes';\r\nimport { ILinkComputerTarget, computeLinks } from 'vs/editor/common/modes/linkComputer';\r\nimport { BasicInplaceReplace } from 'vs/editor/common/modes/supports/inplaceReplaceSupport';\r\nimport { IDiffComputationResult } from 'vs/editor/common/services/editorWorkerService';\r\nimport { createMonacoBaseAPI } from 'vs/editor/common/standalone/standaloneBase';\r\nimport * as types from 'vs/base/common/types';\r\nimport { EditorWorkerHost } from 'vs/editor/common/services/editorWorkerServiceImpl';\r\n\r\nexport interface IMirrorModel {\r\n\treadonly uri: URI;\r\n\treadonly version: number;\r\n\tgetValue(): string;\r\n}\r\n\r\nexport interface IWorkerContext<H = undefined> {\r\n\t/**\r\n\t * A proxy to the main thread host object.\r\n\t */\r\n\thost: H;\r\n\t/**\r\n\t * Get all available mirror models in this worker.\r\n\t */\r\n\tgetMirrorModels(): IMirrorModel[];\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface IRawModelData {\r\n\turl: string;\r\n\tversionId: number;\r\n\tlines: string[];\r\n\tEOL: string;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface ICommonModel extends ILinkComputerTarget, IMirrorModel {\r\n\teol: string;\r\n\r\n\tgetLinesContent(): string[];\r\n\tgetLineCount(): number;\r\n\tgetLineContent(lineNumber: number): string;\r\n\tgetLineWords(lineNumber: number, wordDefinition: RegExp): IWordAtPosition[];\r\n\tcreateWordIterator(wordDefinition: RegExp): Iterator<string>;\r\n\tgetValueInRange(range: IRange): string;\r\n\tgetWordAtPosition(position: IPosition, wordDefinition: RegExp): Range | null;\r\n\toffsetAt(position: IPosition): number;\r\n\tpositionAt(offset: number): IPosition;\r\n}\r\n\r\n/**\r\n * Range of a word inside a model.\r\n * @internal\r\n */\r\ninterface IWordRange {\r\n\t/**\r\n\t * The index where the word starts.\r\n\t */\r\n\treadonly start: number;\r\n\t/**\r\n\t * The index where the word ends.\r\n\t */\r\n\treadonly end: number;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nclass MirrorModel extends BaseMirrorModel implements ICommonModel {\r\n\r\n\tpublic get uri(): URI {\r\n\t\treturn this._uri;\r\n\t}\r\n\r\n\tpublic get version(): number {\r\n\t\treturn this._versionId;\r\n\t}\r\n\r\n\tpublic get eol(): string {\r\n\t\treturn this._eol;\r\n\t}\r\n\r\n\tpublic getValue(): string {\r\n\t\treturn this.getText();\r\n\t}\r\n\r\n\tpublic getLinesContent(): string[] {\r\n\t\treturn this._lines.slice(0);\r\n\t}\r\n\r\n\tpublic getLineCount(): number {\r\n\t\treturn this._lines.length;\r\n\t}\r\n\r\n\tpublic getLineContent(lineNumber: number): string {\r\n\t\treturn this._lines[lineNumber - 1];\r\n\t}\r\n\r\n\tpublic getWordAtPosition(position: IPosition, wordDefinition: RegExp): Range | null {\r\n\r\n\t\tlet wordAtText = getWordAtText(\r\n\t\t\tposition.column,\r\n\t\t\tensureValidWordDefinition(wordDefinition),\r\n\t\t\tthis._lines[position.lineNumber - 1],\r\n\t\t\t0\r\n\t\t);\r\n\r\n\t\tif (wordAtText) {\r\n\t\t\treturn new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn);\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tpublic createWordIterator(wordDefinition: RegExp): Iterator<string> {\r\n\t\tlet obj: { done: false; value: string; };\r\n\t\tlet lineNumber = 0;\r\n\t\tlet lineText: string;\r\n\t\tlet wordRangesIdx = 0;\r\n\t\tlet wordRanges: IWordRange[] = [];\r\n\t\tlet next = (): IteratorResult<string> => {\r\n\r\n\t\t\tif (wordRangesIdx < wordRanges.length) {\r\n\t\t\t\tconst value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);\r\n\t\t\t\twordRangesIdx += 1;\r\n\t\t\t\tif (!obj) {\r\n\t\t\t\t\tobj = { done: false, value: value };\r\n\t\t\t\t} else {\r\n\t\t\t\t\tobj.value = value;\r\n\t\t\t\t}\r\n\t\t\t\treturn obj;\r\n\r\n\t\t\t} else if (lineNumber >= this._lines.length) {\r\n\t\t\t\treturn FIN;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tlineText = this._lines[lineNumber];\r\n\t\t\t\twordRanges = this._wordenize(lineText, wordDefinition);\r\n\t\t\t\twordRangesIdx = 0;\r\n\t\t\t\tlineNumber += 1;\r\n\t\t\t\treturn next();\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn { next };\r\n\t}\r\n\r\n\tpublic getLineWords(lineNumber: number, wordDefinition: RegExp): IWordAtPosition[] {\r\n\t\tlet content = this._lines[lineNumber - 1];\r\n\t\tlet ranges = this._wordenize(content, wordDefinition);\r\n\t\tlet words: IWordAtPosition[] = [];\r\n\t\tfor (const range of ranges) {\r\n\t\t\twords.push({\r\n\t\t\t\tword: content.substring(range.start, range.end),\r\n\t\t\t\tstartColumn: range.start + 1,\r\n\t\t\t\tendColumn: range.end + 1\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn words;\r\n\t}\r\n\r\n\tprivate _wordenize(content: string, wordDefinition: RegExp): IWordRange[] {\r\n\t\tconst result: IWordRange[] = [];\r\n\t\tlet match: RegExpExecArray | null;\r\n\r\n\t\twordDefinition.lastIndex = 0; // reset lastIndex just to be sure\r\n\r\n\t\twhile (match = wordDefinition.exec(content)) {\r\n\t\t\tif (match[0].length === 0) {\r\n\t\t\t\t// it did match the empty string\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tresult.push({ start: match.index, end: match.index + match[0].length });\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tpublic getValueInRange(range: IRange): string {\r\n\t\trange = this._validateRange(range);\r\n\r\n\t\tif (range.startLineNumber === range.endLineNumber) {\r\n\t\t\treturn this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1);\r\n\t\t}\r\n\r\n\t\tlet lineEnding = this._eol;\r\n\t\tlet startLineIndex = range.startLineNumber - 1;\r\n\t\tlet endLineIndex = range.endLineNumber - 1;\r\n\t\tlet resultLines: string[] = [];\r\n\r\n\t\tresultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1));\r\n\t\tfor (let i = startLineIndex + 1; i < endLineIndex; i++) {\r\n\t\t\tresultLines.push(this._lines[i]);\r\n\t\t}\r\n\t\tresultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1));\r\n\r\n\t\treturn resultLines.join(lineEnding);\r\n\t}\r\n\r\n\tpublic offsetAt(position: IPosition): number {\r\n\t\tposition = this._validatePosition(position);\r\n\t\tthis._ensureLineStarts();\r\n\t\treturn this._lineStarts!.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1);\r\n\t}\r\n\r\n\tpublic positionAt(offset: number): IPosition {\r\n\t\toffset = Math.floor(offset);\r\n\t\toffset = Math.max(0, offset);\r\n\r\n\t\tthis._ensureLineStarts();\r\n\t\tlet out = this._lineStarts!.getIndexOf(offset);\r\n\t\tlet lineLength = this._lines[out.index].length;\r\n\r\n\t\t// Ensure we return a valid position\r\n\t\treturn {\r\n\t\t\tlineNumber: 1 + out.index,\r\n\t\t\tcolumn: 1 + Math.min(out.remainder, lineLength)\r\n\t\t};\r\n\t}\r\n\r\n\tprivate _validateRange(range: IRange): IRange {\r\n\r\n\t\tconst start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn });\r\n\t\tconst end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn });\r\n\r\n\t\tif (start.lineNumber !== range.startLineNumber\r\n\t\t\t|| start.column !== range.startColumn\r\n\t\t\t|| end.lineNumber !== range.endLineNumber\r\n\t\t\t|| end.column !== range.endColumn) {\r\n\r\n\t\t\treturn {\r\n\t\t\t\tstartLineNumber: start.lineNumber,\r\n\t\t\t\tstartColumn: start.column,\r\n\t\t\t\tendLineNumber: end.lineNumber,\r\n\t\t\t\tendColumn: end.column\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn range;\r\n\t}\r\n\r\n\tprivate _validatePosition(position: IPosition): IPosition {\r\n\t\tif (!Position.isIPosition(position)) {\r\n\t\t\tthrow new Error('bad position');\r\n\t\t}\r\n\t\tlet { lineNumber, column } = position;\r\n\t\tlet hasChanged = false;\r\n\r\n\t\tif (lineNumber < 1) {\r\n\t\t\tlineNumber = 1;\r\n\t\t\tcolumn = 1;\r\n\t\t\thasChanged = true;\r\n\r\n\t\t} else if (lineNumber > this._lines.length) {\r\n\t\t\tlineNumber = this._lines.length;\r\n\t\t\tcolumn = this._lines[lineNumber - 1].length + 1;\r\n\t\t\thasChanged = true;\r\n\r\n\t\t} else {\r\n\t\t\tlet maxCharacter = this._lines[lineNumber - 1].length + 1;\r\n\t\t\tif (column < 1) {\r\n\t\t\t\tcolumn = 1;\r\n\t\t\t\thasChanged = true;\r\n\t\t\t}\r\n\t\t\telse if (column > maxCharacter) {\r\n\t\t\t\tcolumn = maxCharacter;\r\n\t\t\t\thasChanged = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!hasChanged) {\r\n\t\t\treturn position;\r\n\t\t} else {\r\n\t\t\treturn { lineNumber, column };\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface IForeignModuleFactory {\r\n\t(ctx: IWorkerContext, createData: any): any;\r\n}\r\n\r\ndeclare const require: any;\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class EditorSimpleWorker implements IRequestHandler, IDisposable {\r\n\t_requestHandlerBrand: any;\r\n\r\n\tprivate readonly _host: EditorWorkerHost;\r\n\tprivate _models: { [uri: string]: MirrorModel; };\r\n\tprivate readonly _foreignModuleFactory: IForeignModuleFactory | null;\r\n\tprivate _foreignModule: any;\r\n\r\n\tconstructor(host: EditorWorkerHost, foreignModuleFactory: IForeignModuleFactory | null) {\r\n\t\tthis._host = host;\r\n\t\tthis._models = Object.create(null);\r\n\t\tthis._foreignModuleFactory = foreignModuleFactory;\r\n\t\tthis._foreignModule = null;\r\n\t}\r\n\r\n\tpublic dispose(): void {\r\n\t\tthis._models = Object.create(null);\r\n\t}\r\n\r\n\tprotected _getModel(uri: string): ICommonModel {\r\n\t\treturn this._models[uri];\r\n\t}\r\n\r\n\tprivate _getModels(): ICommonModel[] {\r\n\t\tlet all: MirrorModel[] = [];\r\n\t\tObject.keys(this._models).forEach((key) => all.push(this._models[key]));\r\n\t\treturn all;\r\n\t}\r\n\r\n\tpublic acceptNewModel(data: IRawModelData): void {\r\n\t\tthis._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId);\r\n\t}\r\n\r\n\tpublic acceptModelChanged(strURL: string, e: IModelChangedEvent): void {\r\n\t\tif (!this._models[strURL]) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlet model = this._models[strURL];\r\n\t\tmodel.onEvents(e);\r\n\t}\r\n\r\n\tpublic acceptRemovedModel(strURL: string): void {\r\n\t\tif (!this._models[strURL]) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tdelete this._models[strURL];\r\n\t}\r\n\r\n\t// ---- BEGIN diff --------------------------------------------------------------------------\r\n\r\n\tpublic async computeDiff(originalUrl: string, modifiedUrl: string, ignoreTrimWhitespace: boolean, maxComputationTime: number): Promise<IDiffComputationResult | null> {\r\n\t\tconst original = this._getModel(originalUrl);\r\n\t\tconst modified = this._getModel(modifiedUrl);\r\n\t\tif (!original || !modified) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst originalLines = original.getLinesContent();\r\n\t\tconst modifiedLines = modified.getLinesContent();\r\n\t\tconst diffComputer = new DiffComputer(originalLines, modifiedLines, {\r\n\t\t\tshouldComputeCharChanges: true,\r\n\t\t\tshouldPostProcessCharChanges: true,\r\n\t\t\tshouldIgnoreTrimWhitespace: ignoreTrimWhitespace,\r\n\t\t\tshouldMakePrettyDiff: true,\r\n\t\t\tmaxComputationTime: maxComputationTime\r\n\t\t});\r\n\r\n\t\tconst diffResult = diffComputer.computeDiff();\r\n\t\tconst identical = (diffResult.changes.length > 0 ? false : this._modelsAreIdentical(original, modified));\r\n\t\treturn {\r\n\t\t\tquitEarly: diffResult.quitEarly,\r\n\t\t\tidentical: identical,\r\n\t\t\tchanges: diffResult.changes\r\n\t\t};\r\n\t}\r\n\r\n\tprivate _modelsAreIdentical(original: ICommonModel, modified: ICommonModel): boolean {\r\n\t\tconst originalLineCount = original.getLineCount();\r\n\t\tconst modifiedLineCount = modified.getLineCount();\r\n\t\tif (originalLineCount !== modifiedLineCount) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor (let line = 1; line <= originalLineCount; line++) {\r\n\t\t\tconst originalLine = original.getLineContent(line);\r\n\t\t\tconst modifiedLine = modified.getLineContent(line);\r\n\t\t\tif (originalLine !== modifiedLine) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// ---- END diff --------------------------------------------------------------------------\r\n\r\n\r\n\t// ---- BEGIN minimal edits ---------------------------------------------------------------\r\n\r\n\tprivate static readonly _diffLimit = 100000;\r\n\r\n\tpublic async computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[]): Promise<TextEdit[]> {\r\n\t\tconst model = this._getModel(modelUrl);\r\n\t\tif (!model) {\r\n\t\t\treturn edits;\r\n\t\t}\r\n\r\n\t\tconst result: TextEdit[] = [];\r\n\t\tlet lastEol: EndOfLineSequence | undefined = undefined;\r\n\r\n\t\tedits = mergeSort(edits, (a, b) => {\r\n\t\t\tif (a.range && b.range) {\r\n\t\t\t\treturn Range.compareRangesUsingStarts(a.range, b.range);\r\n\t\t\t}\r\n\t\t\t// eol only changes should go to the end\r\n\t\t\tlet aRng = a.range ? 0 : 1;\r\n\t\t\tlet bRng = b.range ? 0 : 1;\r\n\t\t\treturn aRng - bRng;\r\n\t\t});\r\n\r\n\t\tfor (let { range, text, eol } of edits) {\r\n\r\n\t\t\tif (typeof eol === 'number') {\r\n\t\t\t\tlastEol = eol;\r\n\t\t\t}\r\n\r\n\t\t\tif (Range.isEmpty(range) && !text) {\r\n\t\t\t\t// empty change\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tconst original = model.getValueInRange(range);\r\n\t\t\ttext = text.replace(/\\r\\n|\\n|\\r/g, model.eol);\r\n\r\n\t\t\tif (original === text) {\r\n\t\t\t\t// noop\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// make sure diff won't take too long\r\n\t\t\tif (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) {\r\n\t\t\t\tresult.push({ range, text });\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// compute diff between original and edit.text\r\n\t\t\tconst changes = stringDiff(original, text, false);\r\n\t\t\tconst editOffset = model.offsetAt(Range.lift(range).getStartPosition());\r\n\r\n\t\t\tfor (const change of changes) {\r\n\t\t\t\tconst start = model.positionAt(editOffset + change.originalStart);\r\n\t\t\t\tconst end = model.positionAt(editOffset + change.originalStart + change.originalLength);\r\n\t\t\t\tconst newEdit: TextEdit = {\r\n\t\t\t\t\ttext: text.substr(change.modifiedStart, change.modifiedLength),\r\n\t\t\t\t\trange: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column }\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif (model.getValueInRange(newEdit.range) !== newEdit.text) {\r\n\t\t\t\t\tresult.push(newEdit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (typeof lastEol === 'number') {\r\n\t\t\tresult.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } });\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t// ---- END minimal edits ---------------------------------------------------------------\r\n\r\n\tpublic async computeLinks(modelUrl: string): Promise<ILink[] | null> {\r\n\t\tlet model = this._getModel(modelUrl);\r\n\t\tif (!model) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn computeLinks(model);\r\n\t}\r\n\r\n\t// ---- BEGIN suggest --------------------------------------------------------------------------\r\n\r\n\tprivate static readonly _suggestionsLimit = 10000;\r\n\r\n\tpublic async textualSuggest(modelUrl: string, position: IPosition, wordDef: string, wordDefFlags: string): Promise<string[] | null> {\r\n\t\tconst model = this._getModel(modelUrl);\r\n\t\tif (!model) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\r\n\t\tconst words: string[] = [];\r\n\t\tconst seen = new Set<string>();\r\n\t\tconst wordDefRegExp = new RegExp(wordDef, wordDefFlags);\r\n\r\n\t\tconst wordAt = model.getWordAtPosition(position, wordDefRegExp);\r\n\t\tif (wordAt) {\r\n\t\t\tseen.add(model.getValueInRange(wordAt));\r\n\t\t}\r\n\r\n\t\tfor (\r\n\t\t\tlet iter = model.createWordIterator(wordDefRegExp), e = iter.next();\r\n\t\t\t!e.done && seen.size <= EditorSimpleWorker._suggestionsLimit;\r\n\t\t\te = iter.next()\r\n\t\t) {\r\n\t\t\tconst word = e.value;\r\n\t\t\tif (seen.has(word)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tseen.add(word);\r\n\t\t\tif (!isNaN(Number(word))) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\twords.push(word);\r\n\t\t}\r\n\t\treturn words;\r\n\t}\r\n\r\n\r\n\t// ---- END suggest --------------------------------------------------------------------------\r\n\r\n\t//#region -- word ranges --\r\n\r\n\tpublic async computeWordRanges(modelUrl: string, range: IRange, wordDef: string, wordDefFlags: string): Promise<{ [word: string]: IRange[] }> {\r\n\t\tlet model = this._getModel(modelUrl);\r\n\t\tif (!model) {\r\n\t\t\treturn Object.create(null);\r\n\t\t}\r\n\t\tconst wordDefRegExp = new RegExp(wordDef, wordDefFlags);\r\n\t\tconst result: { [word: string]: IRange[] } = Object.create(null);\r\n\t\tfor (let line = range.startLineNumber; line < range.endLineNumber; line++) {\r\n\t\t\tlet words = model.getLineWords(line, wordDefRegExp);\r\n\t\t\tfor (const word of words) {\r\n\t\t\t\tif (!isNaN(Number(word.word))) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tlet array = result[word.word];\r\n\t\t\t\tif (!array) {\r\n\t\t\t\t\tarray = [];\r\n\t\t\t\t\tresult[word.word] = array;\r\n\t\t\t\t}\r\n\t\t\t\tarray.push({\r\n\t\t\t\t\tstartLineNumber: line,\r\n\t\t\t\t\tstartColumn: word.startColumn,\r\n\t\t\t\t\tendLineNumber: line,\r\n\t\t\t\t\tendColumn: word.endColumn\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\t//#endregion\r\n\r\n\tpublic async navigateValueSet(modelUrl: string, range: IRange, up: boolean, wordDef: string, wordDefFlags: string): Promise<IInplaceReplaceSupportResult | null> {\r\n\t\tlet model = this._getModel(modelUrl);\r\n\t\tif (!model) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tlet wordDefRegExp = new RegExp(wordDef, wordDefFlags);\r\n\r\n\t\tif (range.startColumn === range.endColumn) {\r\n\t\t\trange = {\r\n\t\t\t\tstartLineNumber: range.startLineNumber,\r\n\t\t\t\tstartColumn: range.startColumn,\r\n\t\t\t\tendLineNumber: range.endLineNumber,\r\n\t\t\t\tendColumn: range.endColumn + 1\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tlet selectionText = model.getValueInRange(range);\r\n\r\n\t\tlet wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp);\r\n\t\tif (!wordRange) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tlet word = model.getValueInRange(wordRange);\r\n\t\tlet result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);\r\n\t\treturn result;\r\n\t}\r\n\r\n\t// ---- BEGIN foreign module support --------------------------------------------------------------------------\r\n\r\n\tpublic loadForeignModule(moduleId: string, createData: any, foreignHostMethods: string[]): Promise<string[]> {\r\n\t\tconst proxyMethodRequest = (method: string, args: any[]): Promise<any> => {\r\n\t\t\treturn this._host.fhr(method, args);\r\n\t\t};\r\n\r\n\t\tconst foreignHost = types.createProxyObject(foreignHostMethods, proxyMethodRequest);\r\n\r\n\t\tlet ctx: IWorkerContext<any> = {\r\n\t\t\thost: foreignHost,\r\n\t\t\tgetMirrorModels: (): IMirrorModel[] => {\r\n\t\t\t\treturn this._getModels();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif (this._foreignModuleFactory) {\r\n\t\t\tthis._foreignModule = this._foreignModuleFactory(ctx, createData);\r\n\t\t\t// static foreing module\r\n\t\t\treturn Promise.resolve(types.getAllMethodNames(this._foreignModule));\r\n\t\t}\r\n\t\t// ESM-comment-begin\r\n\t\treturn new Promise<any>((resolve, reject) => {\r\n\t\t\trequire([moduleId], (foreignModule: { create: IForeignModuleFactory }) => {\r\n\t\t\t\tthis._foreignModule = foreignModule.create(ctx, createData);\r\n\r\n\t\t\t\tresolve(types.getAllMethodNames(this._foreignModule));\r\n\r\n\t\t\t}, reject);\r\n\t\t});\r\n\t\t// ESM-comment-end\r\n\r\n\t\t// ESM-uncomment-begin\r\n\t\t// return Promise.reject(new Error(`Unexpected usage`));\r\n\t\t// ESM-uncomment-end\r\n\t}\r\n\r\n\t// foreign method request\r\n\tpublic fmr(method: string, args: any[]): Promise<any> {\r\n\t\tif (!this._foreignModule || typeof this._foreignModule[method] !== 'function') {\r\n\t\t\treturn Promise.reject(new Error('Missing requestHandler or method: ' + method));\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\treturn Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args));\r\n\t\t} catch (e) {\r\n\t\t\treturn Promise.reject(e);\r\n\t\t}\r\n\t}\r\n\r\n\t// ---- END foreign module support --------------------------------------------------------------------------\r\n}\r\n\r\n/**\r\n * Called on the worker side\r\n * @internal\r\n */\r\nexport function create(host: EditorWorkerHost): IRequestHandler {\r\n\treturn new EditorSimpleWorker(host, null);\r\n}\r\n\r\n// This is only available in a Web Worker\r\ndeclare function importScripts(...urls: string[]): void;\r\n\r\nif (typeof importScripts === 'function') {\r\n\t// Running in a web worker\r\n\tglobals.monaco = createMonacoBaseAPI();\r\n}\r\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\r\n(function () {\r\n\r\n\tlet MonacoEnvironment = (<any>self).MonacoEnvironment;\r\n\tlet monacoBaseUrl = MonacoEnvironment && MonacoEnvironment.baseUrl ? MonacoEnvironment.baseUrl : '../../../';\r\n\r\n\tif (typeof (<any>self).define !== 'function' || !(<any>self).define.amd) {\r\n\t\timportScripts(monacoBaseUrl + 'vs/loader.js');\r\n\t}\r\n\r\n\trequire.config({\r\n\t\tbaseUrl: monacoBaseUrl,\r\n\t\tcatchError: true\r\n\t});\r\n\r\n\tlet loadCode = function (moduleId: string) {\r\n\t\trequire([moduleId], function (ws) {\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tlet messageHandler = ws.create((msg: any, transfer?: Transferable[]) => {\r\n\t\t\t\t\t(<any>self).postMessage(msg, transfer);\r\n\t\t\t\t}, null);\r\n\r\n\t\t\t\tself.onmessage = (e: MessageEvent) => messageHandler.onmessage(e.data);\r\n\t\t\t\twhile (beforeReadyMessages.length > 0) {\r\n\t\t\t\t\tself.onmessage(beforeReadyMessages.shift()!);\r\n\t\t\t\t}\r\n\t\t\t}, 0);\r\n\t\t});\r\n\t};\r\n\r\n\tlet isFirstMessage = true;\r\n\tlet beforeReadyMessages: MessageEvent[] = [];\r\n\tself.onmessage = (message: MessageEvent) => {\r\n\t\tif (!isFirstMessage) {\r\n\t\t\tbeforeReadyMessages.push(message);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tisFirstMessage = false;\r\n\t\tloadCode(message.data);\r\n\t};\r\n})();\r\n"]}