@jupyterlite/pyodide-kernel 0.4.0-rc.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../node_modules/@lumino/algorithm/src/array.ts", "../../../node_modules/@lumino/algorithm/src/chain.ts", "../../../node_modules/@lumino/algorithm/src/empty.ts", "../../../node_modules/@lumino/algorithm/src/enumerate.ts", "../../../node_modules/@lumino/algorithm/src/filter.ts", "../../../node_modules/@lumino/algorithm/src/find.ts", "../../../node_modules/@lumino/algorithm/src/iter.ts", "../../../node_modules/@lumino/algorithm/src/map.ts", "../../../node_modules/@lumino/algorithm/src/range.ts", "../../../node_modules/@lumino/algorithm/src/reduce.ts", "../../../node_modules/@lumino/algorithm/src/repeat.ts", "../../../node_modules/@lumino/algorithm/src/retro.ts", "../../../node_modules/@lumino/algorithm/src/sort.ts", "../../../node_modules/@lumino/algorithm/src/stride.ts", "../../../node_modules/@lumino/algorithm/src/string.ts", "../../../node_modules/@lumino/algorithm/src/take.ts", "../../../node_modules/@lumino/algorithm/src/zip.ts", "../../../node_modules/@lumino/coreutils/src/json.ts", "../../../node_modules/@lumino/coreutils/src/mime.ts", "../../../node_modules/@lumino/coreutils/src/promise.ts", "../../../node_modules/@lumino/coreutils/src/token.ts", "../../../node_modules/@lumino/coreutils/src/random.ts", "../../../node_modules/@lumino/coreutils/src/random.browser.ts", "../../../node_modules/@lumino/coreutils/src/uuid.ts", "../../../node_modules/@lumino/coreutils/src/uuid.browser.ts", "../../../node_modules/@lumino/signaling/src/index.ts", "../../../node_modules/@jupyterlab/coreutils/src/activitymonitor.ts", "../../../node_modules/@jupyterlab/coreutils/src/lru.ts", "../../../node_modules/@jupyterlab/coreutils/src/markdowncodeblocks.ts", "../../../node_modules/minimist/index.js", "../../../node_modules/path-browserify/index.js", "../../../node_modules/requires-port/index.js", "../../../node_modules/querystringify/index.js", "../../../node_modules/url-parse/index.js", "../../../node_modules/@jupyterlab/coreutils/src/url.ts", "../../../node_modules/@jupyterlab/coreutils/src/pageconfig.ts", "../../../node_modules/@jupyterlab/coreutils/src/path.ts", "../../../node_modules/@jupyterlab/coreutils/src/signal.ts", "../../../node_modules/@jupyterlab/coreutils/src/text.ts", "../../../node_modules/@jupyterlab/coreutils/src/time.ts", "../../../node_modules/@jupyterlab/coreutils/src/index.ts", "../../../node_modules/mime/Mime.js", "../../../node_modules/mime/types/standard.js", "../../../node_modules/mime/types/other.js", "../../../node_modules/mime/index.js", "../../../node_modules/@jupyterlite/contents/src/tokens.ts", "../../../node_modules/@jupyterlite/contents/src/contents.ts", "../../../node_modules/@jupyterlite/contents/src/emscripten.ts", "../../../node_modules/@jupyterlite/contents/src/drivefs.ts", "../../../node_modules/@jupyterlite/contents/src/drivecontents.ts", "../../../node_modules/@jupyterlite/contents/src/broadcast.ts", "../../../node_modules/@jupyterlite/contents/src/index.ts", "../../../node_modules/proxy-target/esm/types.js", "../../../node_modules/coincident/esm/channel.js", "../../../node_modules/proxy-target/esm/traps.js", "../../../node_modules/coincident/esm/bridge.js", "../../../node_modules/coincident/esm/index.js", "../src/coincident.worker.ts", "../src/worker.ts"],
4
- "sourcesContent": ["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * The namespace for array-specific algorithms.\n */\nexport namespace ArrayExt {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n export function firstIndexOf<T>(\n array: ArrayLike<T>,\n value: T,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let span: number;\n if (stop < start) {\n span = stop + 1 + (n - start);\n } else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n export function lastIndexOf<T>(\n array: ArrayLike<T>,\n value: T,\n start = -1,\n stop = 0\n ): number {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let span: number;\n if (start < stop) {\n span = start + 1 + (n - stop);\n } else {\n span = start - stop + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n export function findFirstIndex<T>(\n array: ArrayLike<T>,\n fn: (value: T, index: number) => boolean,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let span: number;\n if (stop < start) {\n span = stop + 1 + (n - start);\n } else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n export function findLastIndex<T>(\n array: ArrayLike<T>,\n fn: (value: T, index: number) => boolean,\n start = -1,\n stop = 0\n ): number {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let d: number;\n if (start < stop) {\n d = start + 1 + (n - stop);\n } else {\n d = start - stop + 1;\n }\n for (let i = 0; i < d; ++i) {\n let j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n export function findFirstValue<T>(\n array: ArrayLike<T>,\n fn: (value: T, index: number) => boolean,\n start = 0,\n stop = -1\n ): T | undefined {\n let index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n export function findLastValue<T>(\n array: ArrayLike<T>,\n fn: (value: T, index: number) => boolean,\n start = -1,\n stop = 0\n ): T | undefined {\n let index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n export function lowerBound<T, U>(\n array: ArrayLike<T>,\n value: U,\n fn: (element: T, value: U) => number,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n } else {\n span = half;\n }\n }\n return begin;\n }\n\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n export function upperBound<T, U>(\n array: ArrayLike<T>,\n value: U,\n fn: (element: T, value: U) => number,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n } else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n export function shallowEqual<T>(\n a: ArrayLike<T>,\n b: ArrayLike<T>,\n fn?: (a: T, b: T) => boolean\n ): boolean {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n\n // Compare each element for equality.\n for (let i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n\n // The array are shallowly equal.\n return true;\n }\n\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n export function slice<T>(\n array: ArrayLike<T>,\n options: slice.IOptions = {}\n ): T[] {\n // Extract the options.\n let { start, stop, step } = options;\n\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n\n // Look up the length of the array.\n let n = array.length;\n\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n } else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n } else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n } else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n } else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n\n // Compute the slice length.\n let length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n } else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n } else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n\n // Compute the sliced result.\n let result: T[] = [];\n for (let i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n\n // Return the result.\n return result;\n }\n\n /**\n * The namespace for the `slice` function statics.\n */\n export namespace slice {\n /**\n * The options for the `slice` function.\n */\n export interface IOptions {\n /**\n * The starting index of the slice, inclusive.\n *\n * Negative values are taken as an offset from the end\n * of the array.\n *\n * The default is `0` if `step > 0` else `n - 1`.\n */\n start?: number;\n\n /**\n * The stopping index of the slice, exclusive.\n *\n * Negative values are taken as an offset from the end\n * of the array.\n *\n * The default is `n` if `step > 0` else `-n - 1`.\n */\n stop?: number;\n\n /**\n * The step value for the slice.\n *\n * This must not be `0`.\n *\n * The default is `1`.\n */\n step?: number;\n }\n }\n\n /**\n * An array-like object which supports item assignment.\n */\n export type MutableArrayLike<T> = {\n readonly length: number;\n [index: number]: T;\n };\n\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n export function move<T>(\n array: MutableArrayLike<T>,\n fromIndex: number,\n toIndex: number\n ): void {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n } else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n } else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n let value = array[fromIndex];\n let d = fromIndex < toIndex ? 1 : -1;\n for (let i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n export function reverse<T>(\n array: MutableArrayLike<T>,\n start = 0,\n stop = -1\n ): void {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n let a = array[start];\n let b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n export function rotate<T>(\n array: MutableArrayLike<T>,\n delta: number,\n start = 0,\n stop = -1\n ): void {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n let length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n } else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n let pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n export function fill<T>(\n array: MutableArrayLike<T>,\n value: T,\n start = 0,\n stop = -1\n ): void {\n let n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let span: number;\n if (stop < start) {\n span = stop + 1 + (n - start);\n } else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n export function insert<T>(array: Array<T>, index: number, value: T): void {\n let n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n } else {\n index = Math.min(index, n);\n }\n for (let i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n export function removeAt<T>(array: Array<T>, index: number): T | undefined {\n let n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n let value = array[index];\n for (let i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n export function removeFirstOf<T>(\n array: Array<T>,\n value: T,\n start = 0,\n stop = -1\n ): number {\n let index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n export function removeLastOf<T>(\n array: Array<T>,\n value: T,\n start = -1,\n stop = 0\n ): number {\n let index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n export function removeAllOf<T>(\n array: Array<T>,\n value: T,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && array[i] === value) {\n count++;\n } else if (\n stop < start &&\n (i <= stop || i >= start) &&\n array[i] === value\n ) {\n count++;\n } else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n export function removeFirstWhere<T>(\n array: Array<T>,\n fn: (value: T, index: number) => boolean,\n start = 0,\n stop = -1\n ): { index: number; value: T | undefined } {\n let value: T | undefined;\n let index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n export function removeLastWhere<T>(\n array: Array<T>,\n fn: (value: T, index: number) => boolean,\n start = -1,\n stop = 0\n ): { index: number; value: T | undefined } {\n let value: T | undefined;\n let index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n export function removeAllWhere<T>(\n array: Array<T>,\n fn: (value: T, index: number) => boolean,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {\n count++;\n } else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n } else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Chain together several iterables.\n *\n * @deprecated\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * Array.from(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nexport function* chain<T>(...objects: Iterable<T>[]): IterableIterator<T> {\n for (const object of objects) {\n yield* object;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty } from '@lumino/algorithm';\n *\n * let stream = empty<number>();\n *\n * Array.from(stream); // []\n * ```\n */\n// eslint-disable-next-line require-yield\nexport function* empty<T>(): IterableIterator<T> {\n return;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * Array.from(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nexport function* enumerate<T>(\n object: Iterable<T>,\n start = 0\n): IterableIterator<[number, T]> {\n for (const value of object) {\n yield [start++, value];\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nexport function* filter<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean\n): IterableIterator<T> {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n yield value;\n }\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nexport function find<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean\n): T | undefined {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nexport function findIndex<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean\n): number {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nexport function min<T>(\n object: Iterable<T>,\n fn: (first: T, second: T) => number\n): T | undefined {\n let result: T | undefined = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nexport function max<T>(\n object: Iterable<T>,\n fn: (first: T, second: T) => number\n): T | undefined {\n let result: T | undefined = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nexport function minmax<T>(\n object: Iterable<T>,\n fn: (first: T, second: T) => number\n): [T, T] | undefined {\n let empty = true;\n let vmin: T;\n let vmax: T;\n for (const value of object) {\n if (empty) {\n vmin = value;\n vmax = value;\n empty = false;\n } else if (fn(value, vmin!) < 0) {\n vmin = value;\n } else if (fn(value, vmax!) > 0) {\n vmax = value;\n }\n }\n return empty ? undefined : [vmin!, vmax!];\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Create an array from an iterable of values.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { toArray } from '@lumino/algorithm';\n *\n * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nexport function toArray<T>(object: Iterable<T>): T[] {\n return Array.from(object);\n}\n\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nexport function toObject<T>(object: Iterable<[string, T]>): {\n [key: string]: T;\n} {\n const result: { [key: string]: T } = {};\n for (const [key, value] of object) {\n result[key] = value;\n }\n return result;\n}\n\n/**\n * Invoke a function for each value in an iterable.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nexport function each<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean | void\n): void {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return;\n }\n }\n}\n\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nexport function every<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean\n): boolean {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nexport function some<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean\n): boolean {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nexport function* map<T, U>(\n object: Iterable<T>,\n fn: (value: T, index: number) => U\n): IterableIterator<U> {\n let index = 0;\n for (const value of object) {\n yield fn(value, index++);\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n *\n * #### Example\n * ```typescript\n * import { range } from '@lumino/algorithm';\n *\n * let stream = range(2, 4);\n *\n * Array.from(stream); // [2, 3]\n * ```\n */\nexport function* range(\n start: number,\n stop?: number,\n step?: number\n): IterableIterator<number> {\n if (stop === undefined) {\n stop = start;\n start = 0;\n step = 1;\n } else if (step === undefined) {\n step = 1;\n }\n const length = Private.rangeLength(start, stop, step);\n for (let index = 0; index < length; index++) {\n yield start + step * index;\n }\n}\n\n/**\n * The namespace for the module implementation details.\n */\nnamespace Private {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n export function rangeLength(\n start: number,\n stop: number,\n step: number\n ): number {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Summarize all values in an iterable using a reducer function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The reducer function to invoke for each value.\n *\n * @param initial - The initial value to start accumulation.\n *\n * @returns The final accumulated value.\n *\n * #### Notes\n * The `reduce` function follows the conventions of `Array#reduce`.\n *\n * If the iterator is empty, an initial value is required. That value\n * will be used as the return value. If no initial value is provided,\n * an error will be thrown.\n *\n * If the iterator contains a single item and no initial value is\n * provided, the single item is used as the return value.\n *\n * Otherwise, the reducer is invoked for each element in the iterable.\n * If an initial value is not provided, the first element will be used\n * as the initial accumulated value.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { reduce } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5];\n *\n * let sum = reduce(data, (a, value) => a + value); // 15\n * ```\n */\nexport function reduce<T>(\n object: Iterable<T>,\n fn: (accumulator: T, value: T, index: number) => T\n): T;\nexport function reduce<T, U>(\n object: Iterable<T>,\n fn: (accumulator: U, value: T, index: number) => U,\n initial: U\n): U;\nexport function reduce<T>(\n object: Iterable<T>,\n fn: (accumulator: any, value: T, index: number) => any,\n initial?: unknown\n): any {\n // Setup the iterator and fetch the first value.\n const it = object[Symbol.iterator]();\n let index = 0;\n let first = it.next();\n\n // An empty iterator and no initial value is an error.\n if (first.done && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n\n // If the iterator is empty, return the initial value.\n if (first.done) {\n return initial;\n }\n\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n let second = it.next();\n if (second.done && initial === undefined) {\n return first.value;\n }\n\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second.done) {\n return fn(initial, first.value, index++);\n }\n\n // Setup the initial accumlated value.\n let accumulator: any;\n if (initial === undefined) {\n accumulator = fn(first.value, second.value, index++);\n } else {\n accumulator = fn(fn(initial, first.value, index++), second.value, index++);\n }\n\n // Iterate the rest of the values, updating the accumulator.\n let next: IteratorResult<T>;\n while (!(next = it.next()).done) {\n accumulator = fn(accumulator, next.value, index++);\n }\n\n // Return the final accumulated value.\n return accumulator;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @deprecated\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * Array.from(stream); // [7, 7, 7]\n * ```\n */\nexport function* repeat<T>(value: T, count: number): IterableIterator<T> {\n while (0 < count--) {\n yield value;\n }\n}\n\n/**\n * Create an iterator which yields a value a single time.\n *\n * @deprecated\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * Array.from(stream); // [7]\n * ```\n */\nexport function* once<T>(value: T): IterableIterator<T> {\n yield value;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * An object which can produce a reverse iterator over its values.\n */\nexport interface IRetroable<T> {\n /**\n * Get a reverse iterator over the object's values.\n *\n * @returns An iterator which yields the object's values in reverse.\n */\n retro(): IterableIterator<T>;\n}\n\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * Array.from(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nexport function* retro<T>(\n object: IRetroable<T> | ArrayLike<T>\n): IterableIterator<T> {\n if (typeof (object as IRetroable<T>).retro === 'function') {\n yield* (object as IRetroable<T>).retro();\n } else {\n for (let index = (object as ArrayLike<T>).length - 1; index > -1; index--) {\n yield (object as ArrayLike<T>)[index];\n }\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nexport function topologicSort<T>(edges: Iterable<[T, T]>): T[] {\n // Setup the shared sorting state.\n let sorted: T[] = [];\n let visited = new Set<T>();\n let graph = new Map<T, T[]>();\n\n // Add the edges to the graph.\n for (const edge of edges) {\n addEdge(edge);\n }\n\n // Visit each node in the graph.\n for (const [k] of graph) {\n visit(k);\n }\n\n // Return the sorted results.\n return sorted;\n\n // Add an edge to the graph.\n function addEdge(edge: [T, T]): void {\n let [fromNode, toNode] = edge;\n let children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n } else {\n graph.set(toNode, [fromNode]);\n }\n }\n\n // Recursively visit the node.\n function visit(node: T): void {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n let children = graph.get(node);\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n sorted.push(node);\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * Array.from(stream); // [1, 3, 5];\n * ```\n */\nexport function* stride<T>(\n object: Iterable<T>,\n step: number\n): IterableIterator<T> {\n let count = 0;\n for (const value of object) {\n if (0 === count++ % step) {\n yield value;\n }\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * The namespace for string-specific algorithms.\n */\nexport namespace StringExt {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n export function findIndices(\n source: string,\n query: string,\n start = 0\n ): number[] | null {\n let indices = new Array<number>(query.length);\n for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n\n /**\n * The result of a string match function.\n */\n export interface IMatchResult {\n /**\n * A score which indicates the strength of the match.\n *\n * The documentation of a given match function should specify\n * whether a lower or higher score is a stronger match.\n */\n score: number;\n\n /**\n * The indices of the matched characters in the source text.\n *\n * The indices will appear in increasing order.\n */\n indices: number[];\n }\n\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n export function matchSumOfSquares(\n source: string,\n query: string,\n start = 0\n ): IMatchResult | null {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i] - start;\n score += j * j;\n }\n return { score, indices };\n }\n\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n export function matchSumOfDeltas(\n source: string,\n query: string,\n start = 0\n ): IMatchResult | null {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n let last = start - 1;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score, indices };\n }\n\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n export function highlight<T>(\n source: string,\n indices: ReadonlyArray<number>,\n fn: (chunk: string) => T\n ): Array<string | T> {\n // Set up the result array.\n let result: Array<string | T> = [];\n\n // Set up the counter variables.\n let k = 0;\n let last = 0;\n let n = indices.length;\n\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n let i = indices[k];\n let j = indices[k];\n\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n\n // Update the last visited index.\n last = j + 1;\n }\n\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n\n // Return the highlighted result.\n return result;\n }\n\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n export function cmp(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n *\n * #### Example\n * ```typescript\n * import { take } from '@lumino/algorithm';\n *\n * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);\n *\n * Array.from(stream); // [5, 4, 3]\n * ```\n */\nexport function* take<T>(\n object: Iterable<T>,\n count: number\n): IterableIterator<T> {\n if (count < 1) {\n return;\n }\n const it = object[Symbol.iterator]();\n let item: IteratorResult<T>;\n while (0 < count-- && !(item = it.next()).done) {\n yield item.value;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nimport { every } from './iter';\n\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * Array.from(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nexport function* zip<T>(...objects: Iterable<T>[]): IterableIterator<T[]> {\n const iters = objects.map(obj => obj[Symbol.iterator]());\n let tuple = iters.map(it => it.next());\n for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {\n yield tuple.map(item => item.value);\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * A type alias for a JSON primitive.\n */\nexport type JSONPrimitive = boolean | number | string | null;\n\n/**\n * A type alias for a JSON value.\n */\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray;\n\n/**\n * A type definition for a JSON object.\n */\nexport interface JSONObject {\n [key: string]: JSONValue;\n}\n\n/**\n * A type definition for a JSON array.\n */\nexport interface JSONArray extends Array<JSONValue> {}\n\n/**\n * A type definition for a readonly JSON object.\n */\nexport interface ReadonlyJSONObject {\n readonly [key: string]: ReadonlyJSONValue;\n}\n\n/**\n * A type definition for a readonly JSON array.\n */\nexport interface ReadonlyJSONArray extends ReadonlyArray<ReadonlyJSONValue> {}\n\n/**\n * A type alias for a readonly JSON value.\n */\nexport type ReadonlyJSONValue =\n | JSONPrimitive\n | ReadonlyJSONObject\n | ReadonlyJSONArray;\n\n/**\n * A type alias for a partial JSON value.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport type PartialJSONValue =\n | JSONPrimitive\n | PartialJSONObject\n | PartialJSONArray;\n\n/**\n * A type definition for a partial JSON object.\n *\n * Note: Partial here means that the JSON object attributes can be `undefined`.\n */\nexport interface PartialJSONObject {\n [key: string]: PartialJSONValue | undefined;\n}\n\n/**\n * A type definition for a partial JSON array.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport interface PartialJSONArray extends Array<PartialJSONValue> {}\n\n/**\n * A type definition for a readonly partial JSON object.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport interface ReadonlyPartialJSONObject {\n readonly [key: string]: ReadonlyPartialJSONValue | undefined;\n}\n\n/**\n * A type definition for a readonly partial JSON array.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport interface ReadonlyPartialJSONArray\n extends ReadonlyArray<ReadonlyPartialJSONValue> {}\n\n/**\n * A type alias for a readonly partial JSON value.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport type ReadonlyPartialJSONValue =\n | JSONPrimitive\n | ReadonlyPartialJSONObject\n | ReadonlyPartialJSONArray;\n\n/**\n * The namespace for JSON-specific functions.\n */\nexport namespace JSONExt {\n /**\n * A shared frozen empty JSONObject\n */\n export const emptyObject = Object.freeze({}) as ReadonlyJSONObject;\n\n /**\n * A shared frozen empty JSONArray\n */\n export const emptyArray = Object.freeze([]) as ReadonlyJSONArray;\n\n /**\n * Test whether a JSON value is a primitive.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a primitive,`false` otherwise.\n */\n export function isPrimitive(\n value: ReadonlyPartialJSONValue\n ): value is JSONPrimitive {\n return (\n value === null ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n typeof value === 'string'\n );\n }\n\n /**\n * Test whether a JSON value is an array.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a an array, `false` otherwise.\n */\n export function isArray(value: JSONValue): value is JSONArray;\n export function isArray(value: ReadonlyJSONValue): value is ReadonlyJSONArray;\n export function isArray(value: PartialJSONValue): value is PartialJSONArray;\n export function isArray(\n value: ReadonlyPartialJSONValue\n ): value is ReadonlyPartialJSONArray;\n export function isArray(value: ReadonlyPartialJSONValue): boolean {\n return Array.isArray(value);\n }\n\n /**\n * Test whether a JSON value is an object.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a an object, `false` otherwise.\n */\n export function isObject(value: JSONValue): value is JSONObject;\n export function isObject(\n value: ReadonlyJSONValue\n ): value is ReadonlyJSONObject;\n export function isObject(value: PartialJSONValue): value is PartialJSONObject;\n export function isObject(\n value: ReadonlyPartialJSONValue\n ): value is ReadonlyPartialJSONObject;\n export function isObject(value: ReadonlyPartialJSONValue): boolean {\n return !isPrimitive(value) && !isArray(value);\n }\n\n /**\n * Compare two JSON values for deep equality.\n *\n * @param first - The first JSON value of interest.\n *\n * @param second - The second JSON value of interest.\n *\n * @returns `true` if the values are equivalent, `false` otherwise.\n */\n export function deepEqual(\n first: ReadonlyPartialJSONValue,\n second: ReadonlyPartialJSONValue\n ): boolean {\n // Check referential and primitive equality first.\n if (first === second) {\n return true;\n }\n\n // If one is a primitive, the `===` check ruled out the other.\n if (isPrimitive(first) || isPrimitive(second)) {\n return false;\n }\n\n // Test whether they are arrays.\n let a1 = isArray(first);\n let a2 = isArray(second);\n\n // Bail if the types are different.\n if (a1 !== a2) {\n return false;\n }\n\n // If they are both arrays, compare them.\n if (a1 && a2) {\n return deepArrayEqual(\n first as ReadonlyPartialJSONArray,\n second as ReadonlyPartialJSONArray\n );\n }\n\n // At this point, they must both be objects.\n return deepObjectEqual(\n first as ReadonlyPartialJSONObject,\n second as ReadonlyPartialJSONObject\n );\n }\n\n /**\n * Create a deep copy of a JSON value.\n *\n * @param value - The JSON value to copy.\n *\n * @returns A deep copy of the given JSON value.\n */\n export function deepCopy<T extends ReadonlyPartialJSONValue>(value: T): T {\n // Do nothing for primitive values.\n if (isPrimitive(value)) {\n return value;\n }\n\n // Deep copy an array.\n if (isArray(value)) {\n return deepArrayCopy(value);\n }\n\n // Deep copy an object.\n return deepObjectCopy(value);\n }\n\n /**\n * Compare two JSON arrays for deep equality.\n */\n function deepArrayEqual(\n first: ReadonlyPartialJSONArray,\n second: ReadonlyPartialJSONArray\n ): boolean {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n\n // Test the arrays for equal length.\n if (first.length !== second.length) {\n return false;\n }\n\n // Compare the values for equality.\n for (let i = 0, n = first.length; i < n; ++i) {\n if (!deepEqual(first[i], second[i])) {\n return false;\n }\n }\n\n // At this point, the arrays are equal.\n return true;\n }\n\n /**\n * Compare two JSON objects for deep equality.\n */\n function deepObjectEqual(\n first: ReadonlyPartialJSONObject,\n second: ReadonlyPartialJSONObject\n ): boolean {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n\n // Check for the first object's keys in the second object.\n for (let key in first) {\n if (first[key] !== undefined && !(key in second)) {\n return false;\n }\n }\n\n // Check for the second object's keys in the first object.\n for (let key in second) {\n if (second[key] !== undefined && !(key in first)) {\n return false;\n }\n }\n\n // Compare the values for equality.\n for (let key in first) {\n // Get the values.\n let firstValue = first[key];\n let secondValue = second[key];\n\n // If both are undefined, ignore the key.\n if (firstValue === undefined && secondValue === undefined) {\n continue;\n }\n\n // If only one value is undefined, the objects are not equal.\n if (firstValue === undefined || secondValue === undefined) {\n return false;\n }\n\n // Compare the values.\n if (!deepEqual(firstValue, secondValue)) {\n return false;\n }\n }\n\n // At this point, the objects are equal.\n return true;\n }\n\n /**\n * Create a deep copy of a JSON array.\n */\n function deepArrayCopy(value: any): any {\n let result = new Array<any>(value.length);\n for (let i = 0, n = value.length; i < n; ++i) {\n result[i] = deepCopy(value[i]);\n }\n return result;\n }\n\n /**\n * Create a deep copy of a JSON object.\n */\n function deepObjectCopy(value: any): any {\n let result: any = {};\n for (let key in value) {\n // Ignore undefined values.\n let subvalue = value[key];\n if (subvalue === undefined) {\n continue;\n }\n result[key] = deepCopy(subvalue);\n }\n return result;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * An object which stores MIME data for general application use.\n *\n * #### Notes\n * This class does not attempt to enforce \"correctness\" of MIME types\n * and their associated data. Since this class is designed to transfer\n * arbitrary data and objects within the same application, it assumes\n * that the user provides correct and accurate data.\n */\nexport class MimeData {\n /**\n * Get an array of the MIME types contained within the dataset.\n *\n * @returns A new array of the MIME types, in order of insertion.\n */\n types(): string[] {\n return this._types.slice();\n }\n\n /**\n * Test whether the dataset has an entry for the given type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns `true` if the dataset contains a value for the given\n * MIME type, `false` otherwise.\n */\n hasData(mime: string): boolean {\n return this._types.indexOf(mime) !== -1;\n }\n\n /**\n * Get the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns The value for the given MIME type, or `undefined` if\n * the dataset does not contain a value for the type.\n */\n getData(mime: string): any | undefined {\n let i = this._types.indexOf(mime);\n return i !== -1 ? this._values[i] : undefined;\n }\n\n /**\n * Set the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @param data - The data value for the given MIME type.\n *\n * #### Notes\n * This will overwrite any previous entry for the MIME type.\n */\n setData(mime: string, data: unknown): void {\n this.clearData(mime);\n this._types.push(mime);\n this._values.push(data);\n }\n\n /**\n * Remove the data entry for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * #### Notes\n * This is a no-op if there is no entry for the given MIME type.\n */\n clearData(mime: string): void {\n let i = this._types.indexOf(mime);\n if (i !== -1) {\n this._types.splice(i, 1);\n this._values.splice(i, 1);\n }\n }\n\n /**\n * Remove all data entries from the dataset.\n */\n clear(): void {\n this._types.length = 0;\n this._values.length = 0;\n }\n\n private _types: string[] = [];\n private _values: any[] = [];\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * A class which wraps a promise into a delegate object.\n *\n * #### Notes\n * This class is useful when the logic to resolve or reject a promise\n * cannot be defined at the point where the promise is created.\n */\nexport class PromiseDelegate<T> {\n /**\n * Construct a new promise delegate.\n */\n constructor() {\n this.promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n /**\n * The promise wrapped by the delegate.\n */\n readonly promise: Promise<T>;\n\n /**\n * Resolve the wrapped promise with the given value.\n *\n * @param value - The value to use for resolving the promise.\n */\n resolve(value: T | PromiseLike<T>): void {\n let resolve = this._resolve;\n resolve(value);\n }\n\n /**\n * Reject the wrapped promise with the given value.\n *\n * @reason - The reason for rejecting the promise.\n */\n reject(reason: unknown): void {\n let reject = this._reject;\n reject(reason);\n }\n\n private _resolve: (value: T | PromiseLike<T>) => void;\n private _reject: (reason: any) => void;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * A runtime object which captures compile-time type information.\n *\n * #### Notes\n * A token captures the compile-time type of an interface or class in\n * an object which can be used at runtime in a type-safe fashion.\n */\nexport class Token<T> {\n /**\n * Construct a new token.\n *\n * @param name - A human readable name for the token.\n * @param description - Token purpose description for documentation.\n */\n constructor(name: string, description?: string) {\n this.name = name;\n this.description = description ?? '';\n this._tokenStructuralPropertyT = null!;\n }\n\n /**\n * Token purpose description.\n */\n readonly description?: string; // FIXME remove `?` for the next major version\n\n /**\n * The human readable name for the token.\n *\n * #### Notes\n * This can be useful for debugging and logging.\n */\n readonly name: string;\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n private _tokenStructuralPropertyT: T;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n// Fallback\nexport function fallbackRandomValues(buffer: Uint8Array): void {\n let value = 0;\n for (let i = 0, n = buffer.length; i < n; ++i) {\n if (i % 4 === 0) {\n value = (Math.random() * 0xffffffff) >>> 0;\n }\n buffer[i] = value & 0xff;\n value >>>= 8;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\nimport { fallbackRandomValues } from './random';\n\n// Declare ambient variables for `window` and `require` to avoid a\n// hard dependency on both. This package must run on node.\ndeclare let window: any;\n\n/**\n * The namespace for random number related functionality.\n */\nexport namespace Random {\n /**\n * A function which generates random bytes.\n *\n * @param buffer - The `Uint8Array` to fill with random bytes.\n *\n * #### Notes\n * A cryptographically strong random number generator will be used if\n * available. Otherwise, `Math.random` will be used as a fallback for\n * randomness.\n *\n * The following RNGs are supported, listed in order of precedence:\n * - `window.crypto.getRandomValues`\n * - `window.msCrypto.getRandomValues`\n * - `require('crypto').randomFillSync\n * - `require('crypto').randomBytes\n * - `Math.random`\n */\n export const getRandomValues = (() => {\n // Look up the crypto module if available.\n const crypto: any =\n (typeof window !== 'undefined' && (window.crypto || window.msCrypto)) ||\n null;\n\n // Modern browsers and IE 11\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return function getRandomValues(buffer: Uint8Array): void {\n return crypto.getRandomValues(buffer);\n };\n }\n\n // Fallback\n return fallbackRandomValues;\n })();\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A function which creates a function that generates UUID v4 identifiers.\n *\n * @returns A new function that creates a UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\nexport function uuid4Factory(\n getRandomValues: (bytes: Uint8Array) => void\n): () => string {\n // Create a 16 byte array to hold the random values.\n const bytes = new Uint8Array(16);\n\n // Create a look up table from bytes to hex strings.\n const lut = new Array<string>(256);\n\n // Pad the single character hex digits with a leading zero.\n for (let i = 0; i < 16; ++i) {\n lut[i] = '0' + i.toString(16);\n }\n\n // Populate the rest of the hex digits.\n for (let i = 16; i < 256; ++i) {\n lut[i] = i.toString(16);\n }\n\n // Return a function which generates the UUID.\n return function uuid4(): string {\n // Get a new batch of random values.\n getRandomValues(bytes);\n\n // Set the UUID version number to 4.\n bytes[6] = 0x40 | (bytes[6] & 0x0f);\n\n // Set the clock sequence bit to the RFC spec.\n bytes[8] = 0x80 | (bytes[8] & 0x3f);\n\n // Assemble the UUID string.\n return (\n lut[bytes[0]] +\n lut[bytes[1]] +\n lut[bytes[2]] +\n lut[bytes[3]] +\n '-' +\n lut[bytes[4]] +\n lut[bytes[5]] +\n '-' +\n lut[bytes[6]] +\n lut[bytes[7]] +\n '-' +\n lut[bytes[8]] +\n lut[bytes[9]] +\n '-' +\n lut[bytes[10]] +\n lut[bytes[11]] +\n lut[bytes[12]] +\n lut[bytes[13]] +\n lut[bytes[14]] +\n lut[bytes[15]]\n );\n };\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nimport { Random } from './random.browser';\nimport { uuid4Factory } from './uuid';\n\n/**\n * The namespace for UUID related functionality.\n */\nexport namespace UUID {\n /**\n * A function which generates UUID v4 identifiers.\n *\n * @returns A new UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\n export const uuid4 = uuid4Factory(Random.getRandomValues);\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module signaling\n */\nimport { ArrayExt, find } from '@lumino/algorithm';\nimport { PromiseDelegate } from '@lumino/coreutils';\n\n/**\n * A type alias for a slot function.\n *\n * @param sender - The object emitting the signal.\n *\n * @param args - The args object emitted with the signal.\n *\n * #### Notes\n * A slot is invoked when a signal to which it is connected is emitted.\n */\nexport type Slot<T, U> = (sender: T, args: U) => void;\n\n/**\n * An object used for type-safe inter-object communication.\n *\n * #### Notes\n * Signals provide a type-safe implementation of the publish-subscribe\n * pattern. An object (publisher) declares which signals it will emit,\n * and consumers connect callbacks (subscribers) to those signals. The\n * subscribers are invoked whenever the publisher emits the signal.\n */\nexport interface ISignal<T, U> {\n /**\n * Connect a slot to the signal.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n *\n * #### Notes\n * Slots are invoked in the order in which they are connected.\n *\n * Signal connections are unique. If a connection already exists for\n * the given `slot` and `thisArg`, this method returns `false`.\n *\n * A newly connected slot will not be invoked until the next time the\n * signal is emitted, even if the slot is connected while the signal\n * is dispatching.\n */\n connect(slot: Slot<T, U>, thisArg?: any): boolean;\n\n /**\n * Disconnect a slot from the signal.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n *\n * #### Notes\n * If no connection exists for the given `slot` and `thisArg`, this\n * method returns `false`.\n *\n * A disconnected slot will no longer be invoked, even if the slot\n * is disconnected while the signal is dispatching.\n */\n disconnect(slot: Slot<T, U>, thisArg?: any): boolean;\n}\n\n/**\n * An object that is both a signal and an async iterable.\n */\nexport interface IStream<T, U> extends ISignal<T, U>, AsyncIterable<U> {}\n\n/**\n * A concrete implementation of `ISignal`.\n *\n * #### Example\n * ```typescript\n * import { ISignal, Signal } from '@lumino/signaling';\n *\n * class SomeClass {\n *\n * constructor(name: string) {\n * this.name = name;\n * }\n *\n * readonly name: string;\n *\n * get valueChanged: ISignal<this, number> {\n * return this._valueChanged;\n * }\n *\n * get value(): number {\n * return this._value;\n * }\n *\n * set value(value: number) {\n * if (value === this._value) {\n * return;\n * }\n * this._value = value;\n * this._valueChanged.emit(value);\n * }\n *\n * private _value = 0;\n * private _valueChanged = new Signal<this, number>(this);\n * }\n *\n * function logger(sender: SomeClass, value: number): void {\n * console.log(sender.name, value);\n * }\n *\n * let m1 = new SomeClass('foo');\n * let m2 = new SomeClass('bar');\n *\n * m1.valueChanged.connect(logger);\n * m2.valueChanged.connect(logger);\n *\n * m1.value = 42; // logs: foo 42\n * m2.value = 17; // logs: bar 17\n * ```\n */\nexport class Signal<T, U> implements ISignal<T, U> {\n /**\n * Construct a new signal.\n *\n * @param sender - The sender which owns the signal.\n */\n constructor(sender: T) {\n this.sender = sender;\n }\n\n /**\n * The sender which owns the signal.\n */\n readonly sender: T;\n\n /**\n * Connect a slot to the signal.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n connect(slot: Slot<T, U>, thisArg?: unknown): boolean {\n return Private.connect(this, slot, thisArg);\n }\n\n /**\n * Disconnect a slot from the signal.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n disconnect(slot: Slot<T, U>, thisArg?: unknown): boolean {\n return Private.disconnect(this, slot, thisArg);\n }\n\n /**\n * Emit the signal and invoke the connected slots.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n emit(args: U): void {\n Private.emit(this, args);\n }\n}\n\n/**\n * The namespace for the `Signal` class statics.\n */\nexport namespace Signal {\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n export function disconnectBetween(sender: unknown, receiver: unknown): void {\n Private.disconnectBetween(sender, receiver);\n }\n\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n export function disconnectSender(sender: unknown): void {\n Private.disconnectSender(sender);\n }\n\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n export function disconnectReceiver(receiver: unknown): void {\n Private.disconnectReceiver(receiver);\n }\n\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n export function disconnectAll(object: unknown): void {\n Private.disconnectAll(object);\n }\n\n /**\n * Clear all signal data associated with the given object.\n *\n * @param object - The object for which the data should be cleared.\n *\n * #### Notes\n * This removes all signal connections and any other signal data\n * associated with the object.\n */\n export function clearData(object: unknown): void {\n Private.disconnectAll(object);\n }\n\n /**\n * A type alias for the exception handler function.\n */\n export type ExceptionHandler = (err: Error) => void;\n\n /**\n * Get the signal exception handler.\n *\n * @returns The current exception handler.\n *\n * #### Notes\n * The default exception handler is `console.error`.\n */\n export function getExceptionHandler(): ExceptionHandler {\n return Private.exceptionHandler;\n }\n\n /**\n * Set the signal exception handler.\n *\n * @param handler - The function to use as the exception handler.\n *\n * @returns The old exception handler.\n *\n * #### Notes\n * The exception handler is invoked when a slot throws an exception.\n */\n export function setExceptionHandler(\n handler: ExceptionHandler\n ): ExceptionHandler {\n let old = Private.exceptionHandler;\n Private.exceptionHandler = handler;\n return old;\n }\n}\n\n/**\n * A concrete implementation of `IStream`.\n *\n * #### Example\n * ```typescript\n * import { IStream, Stream } from '@lumino/signaling';\n *\n * class SomeClass {\n *\n * constructor(name: string) {\n * this.name = name;\n * }\n *\n * readonly name: string;\n *\n * get pings(): IStream<this, string> {\n * return this._pings;\n * }\n *\n * ping(value: string) {\n * this._pings.emit(value);\n * }\n *\n * private _pings = new Stream<this, string>(this);\n * }\n *\n * let m1 = new SomeClass('foo');\n *\n * m1.pings.connect((_, value: string) => {\n * console.log('connect', value);\n * });\n *\n * void (async () => {\n * for await (const ping of m1.pings) {\n * console.log('iterator', ping);\n * }\n * })();\n *\n * m1.ping('alpha'); // logs: connect alpha\n * // logs: iterator alpha\n * m1.ping('beta'); // logs: connect beta\n * // logs: iterator beta\n * ```\n */\nexport class Stream<T, U> extends Signal<T, U> implements IStream<T, U> {\n /**\n * Return an async iterator that yields every emission.\n */\n async *[Symbol.asyncIterator](): AsyncIterableIterator<U> {\n let pending = this._pending;\n while (true) {\n try {\n const { args, next } = await pending.promise;\n pending = next;\n yield args;\n } catch (_) {\n return; // Any promise rejection stops the iterator.\n }\n }\n }\n\n /**\n * Emit the signal, invoke the connected slots, and yield the emission.\n *\n * @param args - The args to pass to the connected slots.\n */\n emit(args: U): void {\n const pending = this._pending;\n const next = (this._pending = new PromiseDelegate());\n pending.resolve({ args, next });\n super.emit(args);\n }\n\n /**\n * Stop the stream's async iteration.\n */\n stop(): void {\n this._pending.promise.catch(() => undefined);\n this._pending.reject('stop');\n this._pending = new PromiseDelegate();\n }\n\n private _pending: Private.Pending<U> = new PromiseDelegate();\n}\n\n/**\n * The namespace for the module implementation details.\n */\nnamespace Private {\n /**\n * A pending promise in a promise chain underlying a stream.\n */\n export type Pending<U> = PromiseDelegate<{ args: U; next: Pending<U> }>;\n\n /**\n * The signal exception handler function.\n */\n export let exceptionHandler: Signal.ExceptionHandler = (err: Error) => {\n console.error(err);\n };\n\n /**\n * Connect a slot to a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n export function connect<T, U>(\n signal: Signal<T, U>,\n slot: Slot<T, U>,\n thisArg?: unknown\n ): boolean {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n\n // Ensure the sender's array of receivers is created.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers) {\n receivers = [];\n receiversForSender.set(signal.sender, receivers);\n }\n\n // Bail if a matching connection already exists.\n if (findConnection(receivers, signal, slot, thisArg)) {\n return false;\n }\n\n // Choose the best object for the receiver.\n let receiver = thisArg || slot;\n\n // Ensure the receiver's array of senders is created.\n let senders = sendersForReceiver.get(receiver);\n if (!senders) {\n senders = [];\n sendersForReceiver.set(receiver, senders);\n }\n\n // Create a new connection and add it to the end of each array.\n let connection = { signal, slot, thisArg };\n receivers.push(connection);\n senders.push(connection);\n\n // Indicate a successful connection.\n return true;\n }\n\n /**\n * Disconnect a slot from a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n export function disconnect<T, U>(\n signal: Signal<T, U>,\n slot: Slot<T, U>,\n thisArg?: unknown\n ): boolean {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n\n // Lookup the list of receivers, and bail if none exist.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return false;\n }\n\n // Bail if no matching connection exits.\n let connection = findConnection(receivers, signal, slot, thisArg);\n if (!connection) {\n return false;\n }\n\n // Choose the best object for the receiver.\n let receiver = thisArg || slot;\n\n // Lookup the array of senders, which is now known to exist.\n let senders = sendersForReceiver.get(receiver)!;\n\n // Clear the connection and schedule cleanup of the arrays.\n connection.signal = null;\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n\n // Indicate a successful disconnection.\n return true;\n }\n\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n */\n export function disconnectBetween(sender: unknown, receiver: unknown): void {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n\n // If there are no senders, there is nothing to do.\n let senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n\n // Clear each connection between the sender and receiver.\n for (const connection of senders) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n continue;\n }\n\n // Clear the connection if it matches the sender.\n if (connection.signal.sender === sender) {\n connection.signal = null;\n }\n }\n\n // Schedule a cleanup of the senders and receivers.\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n }\n\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n export function disconnectSender(sender: unknown): void {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n\n // Clear each receiver connection.\n for (const connection of receivers) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n continue;\n }\n\n // Choose the best object for the receiver.\n let receiver = connection.thisArg || connection.slot;\n\n // Clear the connection.\n connection.signal = null;\n\n // Cleanup the array of senders, which is now known to exist.\n scheduleCleanup(sendersForReceiver.get(receiver)!);\n }\n\n // Schedule a cleanup of the receivers.\n scheduleCleanup(receivers);\n }\n\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n */\n export function disconnectReceiver(receiver: unknown): void {\n // If there are no senders, there is nothing to do.\n let senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n\n // Clear each sender connection.\n for (const connection of senders) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n continue;\n }\n\n // Lookup the sender for the connection.\n let sender = connection.signal.sender;\n\n // Clear the connection.\n connection.signal = null;\n\n // Cleanup the array of receivers, which is now known to exist.\n scheduleCleanup(receiversForSender.get(sender)!);\n }\n\n // Schedule a cleanup of the list of senders.\n scheduleCleanup(senders);\n }\n\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n */\n export function disconnectAll(object: unknown): void {\n // Remove all connections where the given object is the sender.\n disconnectSender(object);\n // Remove all connections where the given object is the receiver.\n disconnectReceiver(object);\n }\n\n /**\n * Emit a signal and invoke its connected slots.\n *\n * @param signal - The signal of interest.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n export function emit<T, U>(signal: Signal<T, U>, args: U): void {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n\n // Invoke the slots for connections with a matching signal.\n // Any connections added during emission are not invoked.\n for (let i = 0, n = receivers.length; i < n; ++i) {\n let connection = receivers[i];\n if (connection.signal === signal) {\n invokeSlot(connection, args);\n }\n }\n }\n\n /**\n * An object which holds connection data.\n */\n interface IConnection {\n /**\n * The signal for the connection.\n *\n * A `null` signal indicates a cleared connection.\n */\n signal: Signal<any, any> | null;\n\n /**\n * The slot connected to the signal.\n */\n readonly slot: Slot<any, any>;\n\n /**\n * The `this` context for the slot.\n */\n readonly thisArg: any;\n }\n\n /**\n * A weak mapping of sender to array of receiver connections.\n */\n const receiversForSender = new WeakMap<any, IConnection[]>();\n\n /**\n * A weak mapping of receiver to array of sender connections.\n */\n const sendersForReceiver = new WeakMap<any, IConnection[]>();\n\n /**\n * A set of connection arrays which are pending cleanup.\n */\n const dirtySet = new Set<IConnection[]>();\n\n /**\n * A function to schedule an event loop callback.\n */\n const schedule = (() => {\n let ok = typeof requestAnimationFrame === 'function';\n return ok ? requestAnimationFrame : setImmediate;\n })();\n\n /**\n * Find a connection which matches the given parameters.\n */\n function findConnection(\n connections: IConnection[],\n signal: Signal<any, any>,\n slot: Slot<any, any>,\n thisArg: any\n ): IConnection | undefined {\n return find(\n connections,\n connection =>\n connection.signal === signal &&\n connection.slot === slot &&\n connection.thisArg === thisArg\n );\n }\n\n /**\n * Invoke a slot with the given parameters.\n *\n * The connection is assumed to be valid.\n *\n * Exceptions in the slot will be caught and logged.\n */\n function invokeSlot(connection: IConnection, args: any): void {\n let { signal, slot, thisArg } = connection;\n try {\n slot.call(thisArg, signal!.sender, args);\n } catch (err) {\n exceptionHandler(err);\n }\n }\n\n /**\n * Schedule a cleanup of a connection array.\n *\n * This will add the array to the dirty set and schedule a deferred\n * cleanup of the array contents. On cleanup, any connection with a\n * `null` signal will be removed from the array.\n */\n function scheduleCleanup(array: IConnection[]): void {\n if (dirtySet.size === 0) {\n schedule(cleanupDirtySet);\n }\n dirtySet.add(array);\n }\n\n /**\n * Cleanup the connection lists in the dirty set.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupDirtySet(): void {\n dirtySet.forEach(cleanupConnections);\n dirtySet.clear();\n }\n\n /**\n * Cleanup the dirty connections in a connections array.\n *\n * This will remove any connection with a `null` signal.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupConnections(connections: IConnection[]): void {\n ArrayExt.removeAllWhere(connections, isDeadConnection);\n }\n\n /**\n * Test whether a connection is dead.\n *\n * A dead connection has a `null` signal.\n */\n function isDeadConnection(connection: IConnection): boolean {\n return connection.signal === null;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { IDisposable } from '@lumino/disposable';\nimport { ISignal, Signal } from '@lumino/signaling';\n\n/**\n * A class that monitors activity on a signal.\n */\nexport class ActivityMonitor<Sender, Args> implements IDisposable {\n /**\n * Construct a new activity monitor.\n */\n constructor(options: ActivityMonitor.IOptions<Sender, Args>) {\n options.signal.connect(this._onSignalFired, this);\n this._timeout = options.timeout || 1000;\n }\n\n /**\n * A signal emitted when activity has ceased.\n */\n get activityStopped(): ISignal<\n this,\n ActivityMonitor.IArguments<Sender, Args>\n > {\n return this._activityStopped;\n }\n\n /**\n * The timeout associated with the monitor, in milliseconds.\n */\n get timeout(): number {\n return this._timeout;\n }\n set timeout(value: number) {\n this._timeout = value;\n }\n\n /**\n * Test whether the monitor has been disposed.\n *\n * #### Notes\n * This is a read-only property.\n */\n get isDisposed(): boolean {\n return this._isDisposed;\n }\n\n /**\n * Dispose of the resources used by the activity monitor.\n */\n dispose(): void {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n Signal.clearData(this);\n }\n\n /**\n * A signal handler for the monitored signal.\n */\n private _onSignalFired(sender: Sender, args: Args): void {\n clearTimeout(this._timer);\n this._sender = sender;\n this._args = args;\n this._timer = setTimeout(() => {\n this._activityStopped.emit({\n sender: this._sender,\n args: this._args\n });\n }, this._timeout);\n }\n\n private _timer: any = -1;\n private _timeout = -1;\n private _sender: Sender;\n private _args: Args;\n private _isDisposed = false;\n private _activityStopped = new Signal<\n this,\n ActivityMonitor.IArguments<Sender, Args>\n >(this);\n}\n\n/**\n * The namespace for `ActivityMonitor` statics.\n */\nexport namespace ActivityMonitor {\n /**\n * The options used to construct a new `ActivityMonitor`.\n */\n export interface IOptions<Sender, Args> {\n /**\n * The signal to monitor.\n */\n signal: ISignal<Sender, Args>;\n\n /**\n * The activity timeout in milliseconds.\n *\n * The default is 1 second.\n */\n timeout?: number;\n }\n\n /**\n * The argument object for an activity timeout.\n *\n */\n export interface IArguments<Sender, Args> {\n /**\n * The most recent sender object.\n */\n sender: Sender;\n\n /**\n * The most recent argument object.\n */\n args: Args;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nconst DEFAULT_MAX_SIZE = 128;\n\n/** A least-recently-used cache. */\nexport class LruCache<T, U> {\n protected _map = new Map<T, U>();\n protected _maxSize: number;\n\n constructor(options: LruCache.IOptions = {}) {\n this._maxSize = options?.maxSize || DEFAULT_MAX_SIZE;\n }\n\n /**\n * Return the current size of the cache.\n */\n get size() {\n return this._map.size;\n }\n\n /**\n * Clear the values in the cache.\n */\n clear() {\n this._map.clear();\n }\n\n /**\n * Get a value (or null) from the cache, pushing the item to the front of the cache.\n */\n get(key: T): U | null {\n const item = this._map.get(key) || null;\n if (item != null) {\n this._map.delete(key);\n this._map.set(key, item);\n }\n return item;\n }\n\n /**\n * Set a value in the cache, potentially evicting an old item.\n */\n set(key: T, value: U): void {\n if (this._map.size >= this._maxSize) {\n this._map.delete(this._map.keys().next().value);\n }\n this._map.set(key, value);\n }\n}\n\nexport namespace LruCache {\n export interface IOptions {\n maxSize?: number | null;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/**\n * The namespace for code block functions which help\n * in extract code from markdown text\n */\nexport namespace MarkdownCodeBlocks {\n export const CODE_BLOCK_MARKER = '```';\n const markdownExtensions: string[] = [\n '.markdown',\n '.mdown',\n '.mkdn',\n '.md',\n '.mkd',\n '.mdwn',\n '.mdtxt',\n '.mdtext',\n '.text',\n '.txt',\n '.Rmd'\n ];\n\n export class MarkdownCodeBlock {\n startLine: number;\n endLine: number;\n code: string;\n constructor(startLine: number) {\n this.startLine = startLine;\n this.code = '';\n this.endLine = -1;\n }\n }\n\n /**\n * Check whether the given file extension is a markdown extension\n * @param extension - A file extension\n *\n * @returns true/false depending on whether this is a supported markdown extension\n */\n export function isMarkdown(extension: string): boolean {\n return markdownExtensions.indexOf(extension) > -1;\n }\n\n /**\n * Construct all code snippets from current text\n * (this could be potentially optimized if we can cache and detect differences)\n * @param text - A string to parse codeblocks from\n *\n * @returns An array of MarkdownCodeBlocks.\n */\n export function findMarkdownCodeBlocks(text: string): MarkdownCodeBlock[] {\n if (!text || text === '') {\n return [];\n }\n\n const lines = text.split('\\n');\n const codeBlocks: MarkdownCodeBlock[] = [];\n let currentBlock = null;\n for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n const line = lines[lineIndex];\n const lineContainsMarker = line.indexOf(CODE_BLOCK_MARKER) === 0;\n const constructingBlock = currentBlock != null;\n // Skip this line if it is not part of any code block and doesn't contain a marker.\n if (!lineContainsMarker && !constructingBlock) {\n continue;\n }\n\n // Check if we are already constructing a code block.\n if (!constructingBlock) {\n // Start constructing a new code block.\n currentBlock = new MarkdownCodeBlock(lineIndex);\n\n // Check whether this is a single line code block of the form ```a = 10```.\n const firstIndex = line.indexOf(CODE_BLOCK_MARKER);\n const lastIndex = line.lastIndexOf(CODE_BLOCK_MARKER);\n const isSingleLine = firstIndex !== lastIndex;\n if (isSingleLine) {\n currentBlock.code = line.substring(\n firstIndex + CODE_BLOCK_MARKER.length,\n lastIndex\n );\n currentBlock.endLine = lineIndex;\n codeBlocks.push(currentBlock);\n currentBlock = null;\n }\n } else if (currentBlock) {\n if (lineContainsMarker) {\n // End of block, finish it up.\n currentBlock.endLine = lineIndex - 1;\n codeBlocks.push(currentBlock);\n currentBlock = null;\n } else {\n // Append the current line.\n currentBlock.code += line + '\\n';\n }\n }\n }\n return codeBlocks;\n }\n}\n", "'use strict';\n\nfunction hasKey(obj, keys) {\n\tvar o = obj;\n\tkeys.slice(0, -1).forEach(function (key) {\n\t\to = o[key] || {};\n\t});\n\n\tvar key = keys[keys.length - 1];\n\treturn key in o;\n}\n\nfunction isNumber(x) {\n\tif (typeof x === 'number') { return true; }\n\tif ((/^0x[0-9a-f]+$/i).test(x)) { return true; }\n\treturn (/^[-+]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(e[-+]?\\d+)?$/).test(x);\n}\n\nfunction isConstructorOrProto(obj, key) {\n\treturn (key === 'constructor' && typeof obj[key] === 'function') || key === '__proto__';\n}\n\nmodule.exports = function (args, opts) {\n\tif (!opts) { opts = {}; }\n\n\tvar flags = {\n\t\tbools: {},\n\t\tstrings: {},\n\t\tunknownFn: null,\n\t};\n\n\tif (typeof opts.unknown === 'function') {\n\t\tflags.unknownFn = opts.unknown;\n\t}\n\n\tif (typeof opts.boolean === 'boolean' && opts.boolean) {\n\t\tflags.allBools = true;\n\t} else {\n\t\t[].concat(opts.boolean).filter(Boolean).forEach(function (key) {\n\t\t\tflags.bools[key] = true;\n\t\t});\n\t}\n\n\tvar aliases = {};\n\n\tfunction aliasIsBoolean(key) {\n\t\treturn aliases[key].some(function (x) {\n\t\t\treturn flags.bools[x];\n\t\t});\n\t}\n\n\tObject.keys(opts.alias || {}).forEach(function (key) {\n\t\taliases[key] = [].concat(opts.alias[key]);\n\t\taliases[key].forEach(function (x) {\n\t\t\taliases[x] = [key].concat(aliases[key].filter(function (y) {\n\t\t\t\treturn x !== y;\n\t\t\t}));\n\t\t});\n\t});\n\n\t[].concat(opts.string).filter(Boolean).forEach(function (key) {\n\t\tflags.strings[key] = true;\n\t\tif (aliases[key]) {\n\t\t\t[].concat(aliases[key]).forEach(function (k) {\n\t\t\t\tflags.strings[k] = true;\n\t\t\t});\n\t\t}\n\t});\n\n\tvar defaults = opts.default || {};\n\n\tvar argv = { _: [] };\n\n\tfunction argDefined(key, arg) {\n\t\treturn (flags.allBools && (/^--[^=]+$/).test(arg))\n\t\t\t|| flags.strings[key]\n\t\t\t|| flags.bools[key]\n\t\t\t|| aliases[key];\n\t}\n\n\tfunction setKey(obj, keys, value) {\n\t\tvar o = obj;\n\t\tfor (var i = 0; i < keys.length - 1; i++) {\n\t\t\tvar key = keys[i];\n\t\t\tif (isConstructorOrProto(o, key)) { return; }\n\t\t\tif (o[key] === undefined) { o[key] = {}; }\n\t\t\tif (\n\t\t\t\to[key] === Object.prototype\n\t\t\t\t|| o[key] === Number.prototype\n\t\t\t\t|| o[key] === String.prototype\n\t\t\t) {\n\t\t\t\to[key] = {};\n\t\t\t}\n\t\t\tif (o[key] === Array.prototype) { o[key] = []; }\n\t\t\to = o[key];\n\t\t}\n\n\t\tvar lastKey = keys[keys.length - 1];\n\t\tif (isConstructorOrProto(o, lastKey)) { return; }\n\t\tif (\n\t\t\to === Object.prototype\n\t\t\t|| o === Number.prototype\n\t\t\t|| o === String.prototype\n\t\t) {\n\t\t\to = {};\n\t\t}\n\t\tif (o === Array.prototype) { o = []; }\n\t\tif (o[lastKey] === undefined || flags.bools[lastKey] || typeof o[lastKey] === 'boolean') {\n\t\t\to[lastKey] = value;\n\t\t} else if (Array.isArray(o[lastKey])) {\n\t\t\to[lastKey].push(value);\n\t\t} else {\n\t\t\to[lastKey] = [o[lastKey], value];\n\t\t}\n\t}\n\n\tfunction setArg(key, val, arg) {\n\t\tif (arg && flags.unknownFn && !argDefined(key, arg)) {\n\t\t\tif (flags.unknownFn(arg) === false) { return; }\n\t\t}\n\n\t\tvar value = !flags.strings[key] && isNumber(val)\n\t\t\t? Number(val)\n\t\t\t: val;\n\t\tsetKey(argv, key.split('.'), value);\n\n\t\t(aliases[key] || []).forEach(function (x) {\n\t\t\tsetKey(argv, x.split('.'), value);\n\t\t});\n\t}\n\n\tObject.keys(flags.bools).forEach(function (key) {\n\t\tsetArg(key, defaults[key] === undefined ? false : defaults[key]);\n\t});\n\n\tvar notFlags = [];\n\n\tif (args.indexOf('--') !== -1) {\n\t\tnotFlags = args.slice(args.indexOf('--') + 1);\n\t\targs = args.slice(0, args.indexOf('--'));\n\t}\n\n\tfor (var i = 0; i < args.length; i++) {\n\t\tvar arg = args[i];\n\t\tvar key;\n\t\tvar next;\n\n\t\tif ((/^--.+=/).test(arg)) {\n\t\t\t// Using [\\s\\S] instead of . because js doesn't support the\n\t\t\t// 'dotall' regex modifier. See:\n\t\t\t// http://stackoverflow.com/a/1068308/13216\n\t\t\tvar m = arg.match(/^--([^=]+)=([\\s\\S]*)$/);\n\t\t\tkey = m[1];\n\t\t\tvar value = m[2];\n\t\t\tif (flags.bools[key]) {\n\t\t\t\tvalue = value !== 'false';\n\t\t\t}\n\t\t\tsetArg(key, value, arg);\n\t\t} else if ((/^--no-.+/).test(arg)) {\n\t\t\tkey = arg.match(/^--no-(.+)/)[1];\n\t\t\tsetArg(key, false, arg);\n\t\t} else if ((/^--.+/).test(arg)) {\n\t\t\tkey = arg.match(/^--(.+)/)[1];\n\t\t\tnext = args[i + 1];\n\t\t\tif (\n\t\t\t\tnext !== undefined\n\t\t\t\t&& !(/^(-|--)[^-]/).test(next)\n\t\t\t\t&& !flags.bools[key]\n\t\t\t\t&& !flags.allBools\n\t\t\t\t&& (aliases[key] ? !aliasIsBoolean(key) : true)\n\t\t\t) {\n\t\t\t\tsetArg(key, next, arg);\n\t\t\t\ti += 1;\n\t\t\t} else if ((/^(true|false)$/).test(next)) {\n\t\t\t\tsetArg(key, next === 'true', arg);\n\t\t\t\ti += 1;\n\t\t\t} else {\n\t\t\t\tsetArg(key, flags.strings[key] ? '' : true, arg);\n\t\t\t}\n\t\t} else if ((/^-[^-]+/).test(arg)) {\n\t\t\tvar letters = arg.slice(1, -1).split('');\n\n\t\t\tvar broken = false;\n\t\t\tfor (var j = 0; j < letters.length; j++) {\n\t\t\t\tnext = arg.slice(j + 2);\n\n\t\t\t\tif (next === '-') {\n\t\t\t\t\tsetArg(letters[j], next, arg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ((/[A-Za-z]/).test(letters[j]) && next[0] === '=') {\n\t\t\t\t\tsetArg(letters[j], next.slice(1), arg);\n\t\t\t\t\tbroken = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(/[A-Za-z]/).test(letters[j])\n\t\t\t\t\t&& (/-?\\d+(\\.\\d*)?(e-?\\d+)?$/).test(next)\n\t\t\t\t) {\n\t\t\t\t\tsetArg(letters[j], next, arg);\n\t\t\t\t\tbroken = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (letters[j + 1] && letters[j + 1].match(/\\W/)) {\n\t\t\t\t\tsetArg(letters[j], arg.slice(j + 2), arg);\n\t\t\t\t\tbroken = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tsetArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tkey = arg.slice(-1)[0];\n\t\t\tif (!broken && key !== '-') {\n\t\t\t\tif (\n\t\t\t\t\targs[i + 1]\n\t\t\t\t\t&& !(/^(-|--)[^-]/).test(args[i + 1])\n\t\t\t\t\t&& !flags.bools[key]\n\t\t\t\t\t&& (aliases[key] ? !aliasIsBoolean(key) : true)\n\t\t\t\t) {\n\t\t\t\t\tsetArg(key, args[i + 1], arg);\n\t\t\t\t\ti += 1;\n\t\t\t\t} else if (args[i + 1] && (/^(true|false)$/).test(args[i + 1])) {\n\t\t\t\t\tsetArg(key, args[i + 1] === 'true', arg);\n\t\t\t\t\ti += 1;\n\t\t\t\t} else {\n\t\t\t\t\tsetArg(key, flags.strings[key] ? '' : true, arg);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!flags.unknownFn || flags.unknownFn(arg) !== false) {\n\t\t\t\targv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));\n\t\t\t}\n\t\t\tif (opts.stopEarly) {\n\t\t\t\targv._.push.apply(argv._, args.slice(i + 1));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tObject.keys(defaults).forEach(function (k) {\n\t\tif (!hasKey(argv, k.split('.'))) {\n\t\t\tsetKey(argv, k.split('.'), defaults[k]);\n\n\t\t\t(aliases[k] || []).forEach(function (x) {\n\t\t\t\tsetKey(argv, x.split('.'), defaults[k]);\n\t\t\t});\n\t\t}\n\t});\n\n\tif (opts['--']) {\n\t\targv['--'] = notFlags.slice();\n\t} else {\n\t\tnotFlags.forEach(function (k) {\n\t\t\targv._.push(k);\n\t\t});\n\t}\n\n\treturn argv;\n};\n", "// 'path' module extracted from Node.js v8.11.1 (only the posix part)\n// transplited with Babel\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}\n\n// Resolves . and .. elements in a path with directory names\nfunction normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n\nfunction _format(sep, pathObject) {\n var dir = pathObject.dir || pathObject.root;\n var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');\n if (!dir) {\n return base;\n }\n if (dir === pathObject.root) {\n return dir + base;\n }\n return dir + sep + base;\n}\n\nvar posix = {\n // path.resolve([from ...], to)\n resolve: function resolve() {\n var resolvedPath = '';\n var resolvedAbsolute = false;\n var cwd;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path;\n if (i >= 0)\n path = arguments[i];\n else {\n if (cwd === undefined)\n cwd = process.cwd();\n path = cwd;\n }\n\n assertPath(path);\n\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);\n\n if (resolvedAbsolute) {\n if (resolvedPath.length > 0)\n return '/' + resolvedPath;\n else\n return '/';\n } else if (resolvedPath.length > 0) {\n return resolvedPath;\n } else {\n return '.';\n }\n },\n\n normalize: function normalize(path) {\n assertPath(path);\n\n if (path.length === 0) return '.';\n\n var isAbsolute = path.charCodeAt(0) === 47 /*/*/;\n var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;\n\n // Normalize the path\n path = normalizeStringPosix(path, !isAbsolute);\n\n if (path.length === 0 && !isAbsolute) path = '.';\n if (path.length > 0 && trailingSeparator) path += '/';\n\n if (isAbsolute) return '/' + path;\n return path;\n },\n\n isAbsolute: function isAbsolute(path) {\n assertPath(path);\n return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;\n },\n\n join: function join() {\n if (arguments.length === 0)\n return '.';\n var joined;\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n assertPath(arg);\n if (arg.length > 0) {\n if (joined === undefined)\n joined = arg;\n else\n joined += '/' + arg;\n }\n }\n if (joined === undefined)\n return '.';\n return posix.normalize(joined);\n },\n\n relative: function relative(from, to) {\n assertPath(from);\n assertPath(to);\n\n if (from === to) return '';\n\n from = posix.resolve(from);\n to = posix.resolve(to);\n\n if (from === to) return '';\n\n // Trim any leading backslashes\n var fromStart = 1;\n for (; fromStart < from.length; ++fromStart) {\n if (from.charCodeAt(fromStart) !== 47 /*/*/)\n break;\n }\n var fromEnd = from.length;\n var fromLen = fromEnd - fromStart;\n\n // Trim any leading backslashes\n var toStart = 1;\n for (; toStart < to.length; ++toStart) {\n if (to.charCodeAt(toStart) !== 47 /*/*/)\n break;\n }\n var toEnd = to.length;\n var toLen = toEnd - toStart;\n\n // Compare paths to find the longest common path from root\n var length = fromLen < toLen ? fromLen : toLen;\n var lastCommonSep = -1;\n var i = 0;\n for (; i <= length; ++i) {\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === 47 /*/*/) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='/foo/bar'; to='/foo/bar/baz'\n return to.slice(toStart + i + 1);\n } else if (i === 0) {\n // We get here if `from` is the root\n // For example: from='/'; to='/foo'\n return to.slice(toStart + i);\n }\n } else if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === 47 /*/*/) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='/foo/bar/baz'; to='/foo/bar'\n lastCommonSep = i;\n } else if (i === 0) {\n // We get here if `to` is the root.\n // For example: from='/foo'; to='/'\n lastCommonSep = 0;\n }\n }\n break;\n }\n var fromCode = from.charCodeAt(fromStart + i);\n var toCode = to.charCodeAt(toStart + i);\n if (fromCode !== toCode)\n break;\n else if (fromCode === 47 /*/*/)\n lastCommonSep = i;\n }\n\n var out = '';\n // Generate the relative path based on the path difference between `to`\n // and `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {\n if (out.length === 0)\n out += '..';\n else\n out += '/..';\n }\n }\n\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0)\n return out + to.slice(toStart + lastCommonSep);\n else {\n toStart += lastCommonSep;\n if (to.charCodeAt(toStart) === 47 /*/*/)\n ++toStart;\n return to.slice(toStart);\n }\n },\n\n _makeLong: function _makeLong(path) {\n return path;\n },\n\n dirname: function dirname(path) {\n assertPath(path);\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) return '//';\n return path.slice(0, end);\n },\n\n basename: function basename(path, ext) {\n if (ext !== undefined && typeof ext !== 'string') throw new TypeError('\"ext\" argument must be a string');\n assertPath(path);\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext.length === path.length && ext === path) return '';\n var extIdx = ext.length - 1;\n var firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n\n if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;\n return path.slice(start, end);\n } else {\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n }\n },\n\n extname: function extname(path) {\n assertPath(path);\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n },\n\n format: function format(pathObject) {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new TypeError('The \"pathObject\" argument must be of type Object. Received type ' + typeof pathObject);\n }\n return _format('/', pathObject);\n },\n\n parse: function parse(path) {\n assertPath(path);\n\n var ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) return ret;\n var code = path.charCodeAt(0);\n var isAbsolute = code === 47 /*/*/;\n var start;\n if (isAbsolute) {\n ret.root = '/';\n start = 1;\n } else {\n start = 0;\n }\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n var i = path.length - 1;\n\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n\n // Get non-dir info\n for (; i >= start; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n if (end !== -1) {\n if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);\n }\n } else {\n if (startPart === 0 && isAbsolute) {\n ret.name = path.slice(1, startDot);\n ret.base = path.slice(1, end);\n } else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n }\n ret.ext = path.slice(startDot, end);\n }\n\n if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';\n\n return ret;\n },\n\n sep: '/',\n delimiter: ':',\n win32: null,\n posix: null\n};\n\nposix.posix = posix;\n\nmodule.exports = posix;\n", "'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) return false;\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n", "'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g\n , result = {}\n , part;\n\n while (part = parser.exec(query)) {\n var key = decode(part[1])\n , value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) continue;\n result[key] = value;\n }\n\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n\n var pairs = []\n , value\n , key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) prefix = '?';\n\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) continue;\n pairs.push(key +'='+ value);\n }\n }\n\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nexports.stringify = querystringify;\nexports.parse = querystring;\n", "'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , controlOrWhitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n , CRHTLF = /[\\n\\r\\t]/g\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , port = /:\\d+$/\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/;\n\n/**\n * Remove control characters and whitespace from the beginning of a string.\n *\n * @param {Object|String} str String to trim.\n * @returns {String} A new string representing `str` stripped of control\n * characters and whitespace from its beginning.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(controlOrWhitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d*)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@'\n ? address.lastIndexOf(parse)\n : address.indexOf(parse);\n\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n\n if (url.auth) {\n index = url.auth.indexOf(':');\n\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password))\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (port.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n\n case 'auth':\n var index = value.indexOf(':');\n\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , host = url.host\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result =\n protocol +\n ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n } else if (url.password) {\n result += ':'+ url.password;\n result += '@';\n } else if (\n url.protocol !== 'file:' &&\n isSpecial(url.protocol) &&\n !host &&\n url.pathname !== '/'\n ) {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {\n host += ':';\n }\n\n result += host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { PartialJSONObject } from '@lumino/coreutils';\nimport { posix } from 'path';\nimport urlparse from 'url-parse';\n\n/**\n * The namespace for URL-related functions.\n */\nexport namespace URLExt {\n /**\n * Parse a url into a URL object.\n *\n * @param url - The URL string to parse.\n *\n * @returns A URL object.\n */\n export function parse(url: string): IUrl {\n if (typeof document !== 'undefined' && document) {\n const a = document.createElement('a');\n a.href = url;\n return a;\n }\n return urlparse(url);\n }\n\n /**\n * Parse URL and retrieve hostname\n *\n * @param url - The URL string to parse\n *\n * @returns a hostname string value\n */\n export function getHostName(url: string): string {\n return urlparse(url).hostname;\n }\n /**\n * Normalize a url.\n */\n export function normalize(url: string): string;\n export function normalize(url: undefined): undefined;\n export function normalize(url: string | undefined): string | undefined;\n export function normalize(url: string | undefined): string | undefined {\n return url && parse(url).toString();\n }\n\n /**\n * Join a sequence of url components and normalizes as in node `path.join`.\n *\n * @param parts - The url components.\n *\n * @returns the joined url.\n */\n export function join(...parts: string[]): string {\n let u = urlparse(parts[0], {});\n // Schema-less URL can be only parsed as relative to a base URL\n // see https://github.com/unshiftio/url-parse/issues/219#issuecomment-1002219326\n const isSchemaLess = u.protocol === '' && u.slashes;\n if (isSchemaLess) {\n u = urlparse(parts[0], 'https:' + parts[0]);\n }\n const prefix = `${isSchemaLess ? '' : u.protocol}${u.slashes ? '//' : ''}${\n u.auth\n }${u.auth ? '@' : ''}${u.host}`;\n // If there was a prefix, then the first path must start at the root.\n const path = posix.join(\n `${!!prefix && u.pathname[0] !== '/' ? '/' : ''}${u.pathname}`,\n ...parts.slice(1)\n );\n return `${prefix}${path === '.' ? '' : path}`;\n }\n\n /**\n * Encode the components of a multi-segment url.\n *\n * @param url - The url to encode.\n *\n * @returns the encoded url.\n *\n * #### Notes\n * Preserves the `'/'` separators.\n * Should not include the base url, since all parts are escaped.\n */\n export function encodeParts(url: string): string {\n return join(...url.split('/').map(encodeURIComponent));\n }\n\n /**\n * Return a serialized object string suitable for a query.\n *\n * @param value The source object.\n *\n * @returns an encoded url query.\n *\n * #### Notes\n * Modified version of [stackoverflow](http://stackoverflow.com/a/30707423).\n */\n export function objectToQueryString(value: PartialJSONObject): string {\n const keys = Object.keys(value).filter(key => key.length > 0);\n\n if (!keys.length) {\n return '';\n }\n\n return (\n '?' +\n keys\n .map(key => {\n const content = encodeURIComponent(String(value[key]));\n\n return key + (content ? '=' + content : '');\n })\n .join('&')\n );\n }\n\n /**\n * Return a parsed object that represents the values in a query string.\n */\n export function queryStringToObject(value: string): {\n [key: string]: string | undefined;\n } {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce(\n (acc, val) => {\n const [key, value] = val.split('=');\n\n if (key.length > 0) {\n acc[key] = decodeURIComponent(value || '');\n }\n\n return acc;\n },\n {} as { [key: string]: string }\n );\n }\n\n /**\n * Test whether the url is a local url.\n *\n * @param allowRoot - Whether the paths starting at Unix-style filesystem root (`/`) are permitted.\n *\n * #### Notes\n * This function returns `false` for any fully qualified url, including\n * `data:`, `file:`, and `//` protocol URLs.\n */\n export function isLocal(url: string, allowRoot: boolean = false): boolean {\n const { protocol } = parse(url);\n\n return (\n (!protocol || url.toLowerCase().indexOf(protocol) !== 0) &&\n (allowRoot ? url.indexOf('//') !== 0 : url.indexOf('/') !== 0)\n );\n }\n\n /**\n * The interface for a URL object\n */\n export interface IUrl {\n /**\n * The full URL string that was parsed with both the protocol and host\n * components converted to lower-case.\n */\n href: string;\n\n /**\n * Identifies the URL's lower-cased protocol scheme.\n */\n protocol: string;\n\n /**\n * The full lower-cased host portion of the URL, including the port if\n * specified.\n */\n host: string;\n\n /**\n * The lower-cased host name portion of the host component without the\n * port included.\n */\n hostname: string;\n\n /**\n * The numeric port portion of the host component.\n */\n port: string;\n\n /**\n * The entire path section of the URL.\n */\n pathname: string;\n\n /**\n * The \"fragment\" portion of the URL including the leading ASCII hash\n * `(#)` character\n */\n hash: string;\n\n /**\n * The search element, including leading question mark (`'?'`), if any,\n * of the URL.\n */\n search?: string;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { JSONExt } from '@lumino/coreutils';\nimport minimist from 'minimist';\nimport { URLExt } from './url';\n\n/**\n * Declare stubs for the node variables.\n */\ndeclare let process: any;\ndeclare let require: any;\n\n/**\n * The namespace for `PageConfig` functions.\n */\nexport namespace PageConfig {\n /**\n * Get global configuration data for the Jupyter application.\n *\n * @param name - The name of the configuration option.\n *\n * @returns The config value or an empty string if not found.\n *\n * #### Notes\n * All values are treated as strings.\n * For browser based applications, it is assumed that the page HTML\n * includes a script tag with the id `jupyter-config-data` containing the\n * configuration as valid JSON. In order to support the classic Notebook,\n * we fall back on checking for `body` data of the given `name`.\n *\n * For node applications, it is assumed that the process was launched\n * with a `--jupyter-config-data` option pointing to a JSON settings\n * file.\n */\n export function getOption(name: string): string {\n if (configData) {\n return configData[name] || getBodyData(name);\n }\n configData = Object.create(null);\n let found = false;\n\n // Use script tag if available.\n if (typeof document !== 'undefined' && document) {\n const el = document.getElementById('jupyter-config-data');\n\n if (el) {\n configData = JSON.parse(el.textContent || '') as {\n [key: string]: string;\n };\n found = true;\n }\n }\n // Otherwise use CLI if given.\n if (!found && typeof process !== 'undefined' && process.argv) {\n try {\n const cli = minimist(process.argv.slice(2));\n const path: any = require('path');\n let fullPath = '';\n if ('jupyter-config-data' in cli) {\n fullPath = path.resolve(cli['jupyter-config-data']);\n } else if ('JUPYTER_CONFIG_DATA' in process.env) {\n fullPath = path.resolve(process.env['JUPYTER_CONFIG_DATA']);\n }\n if (fullPath) {\n // Force Webpack to ignore this require.\n // eslint-disable-next-line\n configData = eval('require')(fullPath) as { [key: string]: string };\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n if (!JSONExt.isObject(configData)) {\n configData = Object.create(null);\n } else {\n for (const key in configData) {\n // PageConfig expects strings\n if (typeof configData[key] !== 'string') {\n configData[key] = JSON.stringify(configData[key]);\n }\n }\n }\n return configData![name] || getBodyData(name);\n }\n\n /**\n * Set global configuration data for the Jupyter application.\n *\n * @param name - The name of the configuration option.\n * @param value - The value to set the option to.\n *\n * @returns The last config value or an empty string if it doesn't exist.\n */\n export function setOption(name: string, value: string): string {\n const last = getOption(name);\n\n configData![name] = value;\n return last;\n }\n\n /**\n * Get the base url for a Jupyter application, or the base url of the page.\n */\n export function getBaseUrl(): string {\n return URLExt.normalize(getOption('baseUrl') || '/');\n }\n\n /**\n * Get the tree url for a JupyterLab application.\n */\n export function getTreeUrl(): string {\n return URLExt.join(getBaseUrl(), getOption('treeUrl'));\n }\n\n /**\n * Get the base url for sharing links (usually baseUrl)\n */\n export function getShareUrl(): string {\n return URLExt.normalize(getOption('shareUrl') || getBaseUrl());\n }\n\n /**\n * Get the tree url for shareable links.\n * Usually the same as treeUrl,\n * but overrideable e.g. when sharing with JupyterHub.\n */\n export function getTreeShareUrl(): string {\n return URLExt.normalize(URLExt.join(getShareUrl(), getOption('treeUrl')));\n }\n\n /**\n * Create a new URL given an optional mode and tree path.\n *\n * This is used to create URLS when the mode or tree path change as the user\n * changes mode or the current document in the main area. If fields in\n * options are omitted, the value in PageConfig will be used.\n *\n * @param options - IGetUrlOptions for the new path.\n */\n export function getUrl(options: IGetUrlOptions): string {\n let path = options.toShare ? getShareUrl() : getBaseUrl();\n const mode = options.mode ?? getOption('mode');\n const workspace = options.workspace ?? getOption('workspace');\n const labOrDoc = mode === 'single-document' ? 'doc' : 'lab';\n path = URLExt.join(path, labOrDoc);\n if (workspace !== defaultWorkspace) {\n path = URLExt.join(\n path,\n 'workspaces',\n encodeURIComponent(getOption('workspace') ?? defaultWorkspace)\n );\n }\n const treePath = options.treePath ?? getOption('treePath');\n if (treePath) {\n path = URLExt.join(path, 'tree', URLExt.encodeParts(treePath));\n }\n return path;\n }\n\n export const defaultWorkspace: string = 'default';\n\n /**\n * Options for getUrl\n */\n\n export interface IGetUrlOptions {\n /**\n * The optional mode as a string 'single-document' or 'multiple-document'. If\n * the mode argument is missing, it will be provided from the PageConfig.\n */\n mode?: string;\n\n /**\n * The optional workspace as a string. If this argument is missing, the value will\n * be pulled from PageConfig. To use the default workspace (no /workspaces/<name>\n * URL segment will be included) pass the string PageConfig.defaultWorkspace.\n */\n workspace?: string;\n\n /**\n * Whether the url is meant to be shared or not; default false.\n */\n toShare?: boolean;\n\n /**\n * The optional tree path as as string. If treePath is not provided it will be\n * provided from the PageConfig. If an empty string, the resulting path will not\n * contain a tree portion.\n */\n treePath?: string;\n }\n\n /**\n * Get the base websocket url for a Jupyter application, or an empty string.\n */\n export function getWsUrl(baseUrl?: string): string {\n let wsUrl = getOption('wsUrl');\n if (!wsUrl) {\n baseUrl = baseUrl ? URLExt.normalize(baseUrl) : getBaseUrl();\n if (baseUrl.indexOf('http') !== 0) {\n return '';\n }\n wsUrl = 'ws' + baseUrl.slice(4);\n }\n return URLExt.normalize(wsUrl);\n }\n\n /**\n * Returns the URL converting this notebook to a certain\n * format with nbconvert.\n */\n export function getNBConvertURL({\n path,\n format,\n download\n }: {\n path: string;\n format: string;\n download: boolean;\n }): string {\n const notebookPath = URLExt.encodeParts(path);\n const url = URLExt.join(getBaseUrl(), 'nbconvert', format, notebookPath);\n if (download) {\n return url + '?download=true';\n }\n return url;\n }\n\n /**\n * Get the authorization token for a Jupyter application.\n */\n export function getToken(): string {\n return getOption('token') || getBodyData('jupyterApiToken');\n }\n\n /**\n * Get the Notebook version info [major, minor, patch].\n */\n export function getNotebookVersion(): [number, number, number] {\n const notebookVersion = getOption('notebookVersion');\n if (notebookVersion === '') {\n return [0, 0, 0];\n }\n return JSON.parse(notebookVersion);\n }\n\n /**\n * Private page config data for the Jupyter application.\n */\n let configData: { [key: string]: string } | null = null;\n\n /**\n * Get a url-encoded item from `body.data` and decode it\n * We should never have any encoded URLs anywhere else in code\n * until we are building an actual request.\n */\n function getBodyData(key: string): string {\n if (typeof document === 'undefined' || !document.body) {\n return '';\n }\n const val = document.body.dataset[key];\n if (typeof val === 'undefined') {\n return '';\n }\n return decodeURIComponent(val);\n }\n\n /**\n * The namespace for page config `Extension` functions.\n */\n export namespace Extension {\n /**\n * Populate an array from page config.\n *\n * @param key - The page config key (e.g., `deferredExtensions`).\n *\n * #### Notes\n * This is intended for `deferredExtensions` and `disabledExtensions`.\n */\n function populate(key: string): string[] {\n try {\n const raw = getOption(key);\n if (raw) {\n return JSON.parse(raw);\n }\n } catch (error) {\n console.warn(`Unable to parse ${key}.`, error);\n }\n return [];\n }\n\n /**\n * The collection of deferred extensions in page config.\n */\n export const deferred = populate('deferredExtensions');\n\n /**\n * The collection of disabled extensions in page config.\n */\n export const disabled = populate('disabledExtensions');\n\n /**\n * Returns whether a plugin is deferred.\n *\n * @param id - The plugin ID.\n */\n export function isDeferred(id: string): boolean {\n // Check for either a full plugin id match or an extension\n // name match.\n const separatorIndex = id.indexOf(':');\n let extName = '';\n if (separatorIndex !== -1) {\n extName = id.slice(0, separatorIndex);\n }\n return deferred.some(val => val === id || (extName && val === extName));\n }\n\n /**\n * Returns whether a plugin is disabled.\n *\n * @param id - The plugin ID.\n */\n export function isDisabled(id: string): boolean {\n // Check for either a full plugin id match or an extension\n // name match.\n const separatorIndex = id.indexOf(':');\n let extName = '';\n if (separatorIndex !== -1) {\n extName = id.slice(0, separatorIndex);\n }\n return disabled.some(val => val === id || (extName && val === extName));\n }\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { posix } from 'path';\n\n/**\n * The namespace for path-related functions.\n *\n * Note that Jupyter server paths do not start with a leading slash.\n */\nexport namespace PathExt {\n /**\n * Join all arguments together and normalize the resulting path.\n * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.\n *\n * @param paths - The string paths to join.\n */\n export function join(...paths: string[]): string {\n const path = posix.join(...paths);\n return path === '.' ? '' : removeSlash(path);\n }\n\n /**\n * Join all arguments together and normalize the resulting path and preserve the leading slash.\n *\n * @param paths - The string paths to join.\n */\n export function joinWithLeadingSlash(...paths: string[]): string {\n const path = posix.join(...paths);\n return path === '.' ? '' : path;\n }\n\n /**\n * Return the last portion of a path. Similar to the Unix basename command.\n * Often used to extract the file name from a fully qualified path.\n *\n * @param path - The path to evaluate.\n *\n * @param ext - An extension to remove from the result.\n */\n export function basename(path: string, ext?: string): string {\n return posix.basename(path, ext);\n }\n\n /**\n * Get the directory name of a path, similar to the Unix dirname command.\n * When an empty path is given, returns the root path.\n *\n * @param path - The file path.\n */\n export function dirname(path: string): string {\n const dir = removeSlash(posix.dirname(path));\n return dir === '.' ? '' : dir;\n }\n\n /**\n * Get the extension of the path.\n *\n * @param path - The file path.\n *\n * @returns the extension of the file.\n *\n * #### Notes\n * The extension is the string from the last occurrence of the `.`\n * character to end of string in the last portion of the path, inclusive.\n * If there is no `.` in the last portion of the path, or if the first\n * character of the basename of path [[basename]] is `.`, then an\n * empty string is returned.\n */\n export function extname(path: string): string {\n return posix.extname(path);\n }\n\n /**\n * Normalize a string path, reducing '..' and '.' parts.\n * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.\n * When an empty path is given, returns the root path.\n *\n * @param path - The string path to normalize.\n */\n export function normalize(path: string): string {\n if (path === '') {\n return '';\n }\n return removeSlash(posix.normalize(path));\n }\n\n /**\n * Resolve a sequence of paths or path segments into an absolute path.\n * The root path in the application has no leading slash, so it is removed.\n *\n * @param parts - The paths to join.\n *\n * #### Notes\n * The right-most parameter is considered \\{to\\}. Other parameters are considered an array of \\{from\\}.\n *\n * Starting from leftmost \\{from\\} parameter, resolves \\{to\\} to an absolute path.\n *\n * If \\{to\\} isn't already absolute, \\{from\\} arguments are prepended in right to left order, until an absolute path is found. If after using all \\{from\\} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.\n */\n export function resolve(...parts: string[]): string {\n return removeSlash(posix.resolve(...parts));\n }\n\n /**\n * Solve the relative path from \\{from\\} to \\{to\\}.\n *\n * @param from - The source path.\n *\n * @param to - The target path.\n *\n * #### Notes\n * If from and to each resolve to the same path (after calling\n * path.resolve() on each), a zero-length string is returned.\n * If a zero-length string is passed as from or to, `/`\n * will be used instead of the zero-length strings.\n */\n export function relative(from: string, to: string): string {\n return removeSlash(posix.relative(from, to));\n }\n\n /**\n * Normalize a file extension to be of the type `'.foo'`.\n *\n * @param extension - the file extension.\n *\n * #### Notes\n * Adds a leading dot if not present and converts to lower case.\n */\n export function normalizeExtension(extension: string): string {\n if (extension.length > 0 && extension.indexOf('.') !== 0) {\n extension = `.${extension}`;\n }\n return extension;\n }\n\n /**\n * Remove the leading slash from a path.\n *\n * @param path the path from which to remove a leading slash.\n */\n export function removeSlash(path: string): string {\n if (path.indexOf('/') === 0) {\n path = path.slice(1);\n }\n return path;\n }\n}\n", "/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\nimport { PromiseDelegate } from '@lumino/coreutils';\nimport { ISignal } from '@lumino/signaling';\n\n/**\n * Convert a signal into a promise for the first emitted value.\n *\n * @param signal - The signal we are listening to.\n * @param timeout - Timeout to wait for signal in ms (not timeout if not defined or 0)\n *\n * @returns a Promise that resolves with a `(sender, args)` pair.\n */\nexport function signalToPromise<T, U>(\n signal: ISignal<T, U>,\n timeout?: number\n): Promise<[T, U]> {\n const waitForSignal = new PromiseDelegate<[T, U]>();\n\n function cleanup() {\n signal.disconnect(slot);\n }\n\n function slot(sender: T, args: U) {\n cleanup();\n waitForSignal.resolve([sender, args]);\n }\n signal.connect(slot);\n\n if ((timeout ?? 0) > 0) {\n setTimeout(() => {\n cleanup();\n waitForSignal.reject(`Signal not emitted within ${timeout} ms.`);\n }, timeout);\n }\n return waitForSignal.promise;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/**\n * The namespace for text-related functions.\n */\nexport namespace Text {\n // javascript stores text as utf16 and string indices use \"code units\",\n // which stores high-codepoint characters as \"surrogate pairs\",\n // which occupy two indices in the javascript string.\n // We need to translate cursor_pos in the Jupyter protocol (in characters)\n // to js offset (with surrogate pairs taking two spots).\n\n const HAS_SURROGATES: boolean = '\uD835\uDC1A'.length > 1;\n\n /**\n * Convert a javascript string index into a unicode character offset\n *\n * @param jsIdx - The javascript string index (counting surrogate pairs)\n *\n * @param text - The text in which the offset is calculated\n *\n * @returns The unicode character offset\n */\n export function jsIndexToCharIndex(jsIdx: number, text: string): number {\n if (HAS_SURROGATES) {\n // not using surrogates, nothing to do\n return jsIdx;\n }\n let charIdx = jsIdx;\n for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {\n const charCode = text.charCodeAt(i);\n // check for surrogate pair\n if (charCode >= 0xd800 && charCode <= 0xdbff) {\n const nextCharCode = text.charCodeAt(i + 1);\n if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {\n charIdx--;\n i++;\n }\n }\n }\n return charIdx;\n }\n\n /**\n * Convert a unicode character offset to a javascript string index.\n *\n * @param charIdx - The index in unicode characters\n *\n * @param text - The text in which the offset is calculated\n *\n * @returns The js-native index\n */\n export function charIndexToJsIndex(charIdx: number, text: string): number {\n if (HAS_SURROGATES) {\n // not using surrogates, nothing to do\n return charIdx;\n }\n let jsIdx = charIdx;\n for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {\n const charCode = text.charCodeAt(i);\n // check for surrogate pair\n if (charCode >= 0xd800 && charCode <= 0xdbff) {\n const nextCharCode = text.charCodeAt(i + 1);\n if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {\n jsIdx++;\n i++;\n }\n }\n }\n return jsIdx;\n }\n\n /**\n * Given a 'snake-case', 'snake_case', 'snake:case', or\n * 'snake case' string, will return the camel case version: 'snakeCase'.\n *\n * @param str the snake-case input string.\n *\n * @param upper default = false. If true, the first letter of the\n * returned string will be capitalized.\n *\n * @returns the camel case version of the input string.\n */\n export function camelCase(str: string, upper: boolean = false): string {\n return str.replace(/^(\\w)|[\\s-_:]+(\\w)/g, function (match, p1, p2) {\n if (p2) {\n return p2.toUpperCase();\n } else {\n return upper ? p1.toUpperCase() : p1.toLowerCase();\n }\n });\n }\n\n /**\n * Given a string, title case the words in the string.\n *\n * @param str the string to title case.\n *\n * @returns the same string, but with each word capitalized.\n */\n export function titleCase(str: string): string {\n return (str || '')\n .toLowerCase()\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/**\n * A list of time units with their associated value in milliseconds.\n */\nconst UNITS: { name: Intl.RelativeTimeFormatUnit; milliseconds: number }[] = [\n { name: 'years', milliseconds: 365 * 24 * 60 * 60 * 1000 },\n { name: 'months', milliseconds: 30 * 24 * 60 * 60 * 1000 },\n { name: 'days', milliseconds: 24 * 60 * 60 * 1000 },\n { name: 'hours', milliseconds: 60 * 60 * 1000 },\n { name: 'minutes', milliseconds: 60 * 1000 },\n { name: 'seconds', milliseconds: 1000 }\n];\n\n/**\n * The namespace for date functions.\n */\nexport namespace Time {\n // Intl.RelativeTimeFormatStyle contains these, but it requires `ES2020.Intl`.\n // We currently compile to an `ES2018` target.\n export type HumanStyle = 'long' | 'short' | 'narrow';\n\n /**\n * Convert a timestring to a human readable string (e.g. 'two minutes ago').\n *\n * @param value - The date timestring or date object.\n *\n * @returns A formatted date.\n */\n export function formatHuman(\n value: string | Date,\n format: HumanStyle = 'long'\n ): string {\n const lang = document.documentElement.lang || 'en';\n const formatter = new Intl.RelativeTimeFormat(lang, {\n numeric: 'auto',\n style: format\n });\n const delta = new Date(value).getTime() - Date.now();\n for (let unit of UNITS) {\n const amount = Math.ceil(delta / unit.milliseconds);\n if (amount === 0) {\n continue;\n }\n return formatter.format(amount, unit.name);\n }\n return formatter.format(0, 'seconds');\n }\n\n /**\n * Convenient helper to convert a timestring to a date format.\n *\n * @param value - The date timestring or date object.\n *\n * @returns A formatted date.\n */\n export function format(value: string | Date): string {\n const lang = document.documentElement.lang || 'en';\n const formatter = new Intl.DateTimeFormat(lang, {\n dateStyle: 'short',\n timeStyle: 'short'\n });\n return formatter.format(new Date(value));\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module coreutils\n */\n\nexport * from './activitymonitor';\nexport * from './interfaces';\nexport * from './lru';\nexport * from './markdowncodeblocks';\nexport * from './pageconfig';\nexport * from './path';\nexport * from './signal';\nexport * from './text';\nexport * from './time';\nexport * from './url';\n", "'use strict';\n\n/**\n * @param typeMap [Object] Map of MIME type -> Array[extensions]\n * @param ...\n */\nfunction Mime() {\n this._types = Object.create(null);\n this._extensions = Object.create(null);\n\n for (let i = 0; i < arguments.length; i++) {\n this.define(arguments[i]);\n }\n\n this.define = this.define.bind(this);\n this.getType = this.getType.bind(this);\n this.getExtension = this.getExtension.bind(this);\n}\n\n/**\n * Define mimetype -> extension mappings. Each key is a mime-type that maps\n * to an array of extensions associated with the type. The first extension is\n * used as the default extension for the type.\n *\n * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});\n *\n * If a type declares an extension that has already been defined, an error will\n * be thrown. To suppress this error and force the extension to be associated\n * with the new type, pass `force`=true. Alternatively, you may prefix the\n * extension with \"*\" to map the type to extension, without mapping the\n * extension to the type.\n *\n * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']});\n *\n *\n * @param map (Object) type definitions\n * @param force (Boolean) if true, force overriding of existing definitions\n */\nMime.prototype.define = function(typeMap, force) {\n for (let type in typeMap) {\n let extensions = typeMap[type].map(function(t) {\n return t.toLowerCase();\n });\n type = type.toLowerCase();\n\n for (let i = 0; i < extensions.length; i++) {\n const ext = extensions[i];\n\n // '*' prefix = not the preferred type for this extension. So fixup the\n // extension, and skip it.\n if (ext[0] === '*') {\n continue;\n }\n\n if (!force && (ext in this._types)) {\n throw new Error(\n 'Attempt to change mapping for \"' + ext +\n '\" extension from \"' + this._types[ext] + '\" to \"' + type +\n '\". Pass `force=true` to allow this, otherwise remove \"' + ext +\n '\" from the list of extensions for \"' + type + '\".'\n );\n }\n\n this._types[ext] = type;\n }\n\n // Use first extension as default\n if (force || !this._extensions[type]) {\n const ext = extensions[0];\n this._extensions[type] = (ext[0] !== '*') ? ext : ext.substr(1);\n }\n }\n};\n\n/**\n * Lookup a mime type based on extension\n */\nMime.prototype.getType = function(path) {\n path = String(path);\n let last = path.replace(/^.*[/\\\\]/, '').toLowerCase();\n let ext = last.replace(/^.*\\./, '').toLowerCase();\n\n let hasPath = last.length < path.length;\n let hasDot = ext.length < last.length - 1;\n\n return (hasDot || !hasPath) && this._types[ext] || null;\n};\n\n/**\n * Return file extension associated with a mime type\n */\nMime.prototype.getExtension = function(type) {\n type = /^\\s*([^;\\s]*)/.test(type) && RegExp.$1;\n return type && this._extensions[type.toLowerCase()] || null;\n};\n\nmodule.exports = Mime;\n", "module.exports = {\"application/andrew-inset\":[\"ez\"],\"application/applixware\":[\"aw\"],\"application/atom+xml\":[\"atom\"],\"application/atomcat+xml\":[\"atomcat\"],\"application/atomdeleted+xml\":[\"atomdeleted\"],\"application/atomsvc+xml\":[\"atomsvc\"],\"application/atsc-dwd+xml\":[\"dwd\"],\"application/atsc-held+xml\":[\"held\"],\"application/atsc-rsat+xml\":[\"rsat\"],\"application/bdoc\":[\"bdoc\"],\"application/calendar+xml\":[\"xcs\"],\"application/ccxml+xml\":[\"ccxml\"],\"application/cdfx+xml\":[\"cdfx\"],\"application/cdmi-capability\":[\"cdmia\"],\"application/cdmi-container\":[\"cdmic\"],\"application/cdmi-domain\":[\"cdmid\"],\"application/cdmi-object\":[\"cdmio\"],\"application/cdmi-queue\":[\"cdmiq\"],\"application/cu-seeme\":[\"cu\"],\"application/dash+xml\":[\"mpd\"],\"application/davmount+xml\":[\"davmount\"],\"application/docbook+xml\":[\"dbk\"],\"application/dssc+der\":[\"dssc\"],\"application/dssc+xml\":[\"xdssc\"],\"application/ecmascript\":[\"es\",\"ecma\"],\"application/emma+xml\":[\"emma\"],\"application/emotionml+xml\":[\"emotionml\"],\"application/epub+zip\":[\"epub\"],\"application/exi\":[\"exi\"],\"application/express\":[\"exp\"],\"application/fdt+xml\":[\"fdt\"],\"application/font-tdpfr\":[\"pfr\"],\"application/geo+json\":[\"geojson\"],\"application/gml+xml\":[\"gml\"],\"application/gpx+xml\":[\"gpx\"],\"application/gxf\":[\"gxf\"],\"application/gzip\":[\"gz\"],\"application/hjson\":[\"hjson\"],\"application/hyperstudio\":[\"stk\"],\"application/inkml+xml\":[\"ink\",\"inkml\"],\"application/ipfix\":[\"ipfix\"],\"application/its+xml\":[\"its\"],\"application/java-archive\":[\"jar\",\"war\",\"ear\"],\"application/java-serialized-object\":[\"ser\"],\"application/java-vm\":[\"class\"],\"application/javascript\":[\"js\",\"mjs\"],\"application/json\":[\"json\",\"map\"],\"application/json5\":[\"json5\"],\"application/jsonml+json\":[\"jsonml\"],\"application/ld+json\":[\"jsonld\"],\"application/lgr+xml\":[\"lgr\"],\"application/lost+xml\":[\"lostxml\"],\"application/mac-binhex40\":[\"hqx\"],\"application/mac-compactpro\":[\"cpt\"],\"application/mads+xml\":[\"mads\"],\"application/manifest+json\":[\"webmanifest\"],\"application/marc\":[\"mrc\"],\"application/marcxml+xml\":[\"mrcx\"],\"application/mathematica\":[\"ma\",\"nb\",\"mb\"],\"application/mathml+xml\":[\"mathml\"],\"application/mbox\":[\"mbox\"],\"application/mediaservercontrol+xml\":[\"mscml\"],\"application/metalink+xml\":[\"metalink\"],\"application/metalink4+xml\":[\"meta4\"],\"application/mets+xml\":[\"mets\"],\"application/mmt-aei+xml\":[\"maei\"],\"application/mmt-usd+xml\":[\"musd\"],\"application/mods+xml\":[\"mods\"],\"application/mp21\":[\"m21\",\"mp21\"],\"application/mp4\":[\"mp4s\",\"m4p\"],\"application/msword\":[\"doc\",\"dot\"],\"application/mxf\":[\"mxf\"],\"application/n-quads\":[\"nq\"],\"application/n-triples\":[\"nt\"],\"application/node\":[\"cjs\"],\"application/octet-stream\":[\"bin\",\"dms\",\"lrf\",\"mar\",\"so\",\"dist\",\"distz\",\"pkg\",\"bpk\",\"dump\",\"elc\",\"deploy\",\"exe\",\"dll\",\"deb\",\"dmg\",\"iso\",\"img\",\"msi\",\"msp\",\"msm\",\"buffer\"],\"application/oda\":[\"oda\"],\"application/oebps-package+xml\":[\"opf\"],\"application/ogg\":[\"ogx\"],\"application/omdoc+xml\":[\"omdoc\"],\"application/onenote\":[\"onetoc\",\"onetoc2\",\"onetmp\",\"onepkg\"],\"application/oxps\":[\"oxps\"],\"application/p2p-overlay+xml\":[\"relo\"],\"application/patch-ops-error+xml\":[\"xer\"],\"application/pdf\":[\"pdf\"],\"application/pgp-encrypted\":[\"pgp\"],\"application/pgp-signature\":[\"asc\",\"sig\"],\"application/pics-rules\":[\"prf\"],\"application/pkcs10\":[\"p10\"],\"application/pkcs7-mime\":[\"p7m\",\"p7c\"],\"application/pkcs7-signature\":[\"p7s\"],\"application/pkcs8\":[\"p8\"],\"application/pkix-attr-cert\":[\"ac\"],\"application/pkix-cert\":[\"cer\"],\"application/pkix-crl\":[\"crl\"],\"application/pkix-pkipath\":[\"pkipath\"],\"application/pkixcmp\":[\"pki\"],\"application/pls+xml\":[\"pls\"],\"application/postscript\":[\"ai\",\"eps\",\"ps\"],\"application/provenance+xml\":[\"provx\"],\"application/pskc+xml\":[\"pskcxml\"],\"application/raml+yaml\":[\"raml\"],\"application/rdf+xml\":[\"rdf\",\"owl\"],\"application/reginfo+xml\":[\"rif\"],\"application/relax-ng-compact-syntax\":[\"rnc\"],\"application/resource-lists+xml\":[\"rl\"],\"application/resource-lists-diff+xml\":[\"rld\"],\"application/rls-services+xml\":[\"rs\"],\"application/route-apd+xml\":[\"rapd\"],\"application/route-s-tsid+xml\":[\"sls\"],\"application/route-usd+xml\":[\"rusd\"],\"application/rpki-ghostbusters\":[\"gbr\"],\"application/rpki-manifest\":[\"mft\"],\"application/rpki-roa\":[\"roa\"],\"application/rsd+xml\":[\"rsd\"],\"application/rss+xml\":[\"rss\"],\"application/rtf\":[\"rtf\"],\"application/sbml+xml\":[\"sbml\"],\"application/scvp-cv-request\":[\"scq\"],\"application/scvp-cv-response\":[\"scs\"],\"application/scvp-vp-request\":[\"spq\"],\"application/scvp-vp-response\":[\"spp\"],\"application/sdp\":[\"sdp\"],\"application/senml+xml\":[\"senmlx\"],\"application/sensml+xml\":[\"sensmlx\"],\"application/set-payment-initiation\":[\"setpay\"],\"application/set-registration-initiation\":[\"setreg\"],\"application/shf+xml\":[\"shf\"],\"application/sieve\":[\"siv\",\"sieve\"],\"application/smil+xml\":[\"smi\",\"smil\"],\"application/sparql-query\":[\"rq\"],\"application/sparql-results+xml\":[\"srx\"],\"application/srgs\":[\"gram\"],\"application/srgs+xml\":[\"grxml\"],\"application/sru+xml\":[\"sru\"],\"application/ssdl+xml\":[\"ssdl\"],\"application/ssml+xml\":[\"ssml\"],\"application/swid+xml\":[\"swidtag\"],\"application/tei+xml\":[\"tei\",\"teicorpus\"],\"application/thraud+xml\":[\"tfi\"],\"application/timestamped-data\":[\"tsd\"],\"application/toml\":[\"toml\"],\"application/trig\":[\"trig\"],\"application/ttml+xml\":[\"ttml\"],\"application/ubjson\":[\"ubj\"],\"application/urc-ressheet+xml\":[\"rsheet\"],\"application/urc-targetdesc+xml\":[\"td\"],\"application/voicexml+xml\":[\"vxml\"],\"application/wasm\":[\"wasm\"],\"application/widget\":[\"wgt\"],\"application/winhlp\":[\"hlp\"],\"application/wsdl+xml\":[\"wsdl\"],\"application/wspolicy+xml\":[\"wspolicy\"],\"application/xaml+xml\":[\"xaml\"],\"application/xcap-att+xml\":[\"xav\"],\"application/xcap-caps+xml\":[\"xca\"],\"application/xcap-diff+xml\":[\"xdf\"],\"application/xcap-el+xml\":[\"xel\"],\"application/xcap-ns+xml\":[\"xns\"],\"application/xenc+xml\":[\"xenc\"],\"application/xhtml+xml\":[\"xhtml\",\"xht\"],\"application/xliff+xml\":[\"xlf\"],\"application/xml\":[\"xml\",\"xsl\",\"xsd\",\"rng\"],\"application/xml-dtd\":[\"dtd\"],\"application/xop+xml\":[\"xop\"],\"application/xproc+xml\":[\"xpl\"],\"application/xslt+xml\":[\"*xsl\",\"xslt\"],\"application/xspf+xml\":[\"xspf\"],\"application/xv+xml\":[\"mxml\",\"xhvml\",\"xvml\",\"xvm\"],\"application/yang\":[\"yang\"],\"application/yin+xml\":[\"yin\"],\"application/zip\":[\"zip\"],\"audio/3gpp\":[\"*3gpp\"],\"audio/adpcm\":[\"adp\"],\"audio/amr\":[\"amr\"],\"audio/basic\":[\"au\",\"snd\"],\"audio/midi\":[\"mid\",\"midi\",\"kar\",\"rmi\"],\"audio/mobile-xmf\":[\"mxmf\"],\"audio/mp3\":[\"*mp3\"],\"audio/mp4\":[\"m4a\",\"mp4a\"],\"audio/mpeg\":[\"mpga\",\"mp2\",\"mp2a\",\"mp3\",\"m2a\",\"m3a\"],\"audio/ogg\":[\"oga\",\"ogg\",\"spx\",\"opus\"],\"audio/s3m\":[\"s3m\"],\"audio/silk\":[\"sil\"],\"audio/wav\":[\"wav\"],\"audio/wave\":[\"*wav\"],\"audio/webm\":[\"weba\"],\"audio/xm\":[\"xm\"],\"font/collection\":[\"ttc\"],\"font/otf\":[\"otf\"],\"font/ttf\":[\"ttf\"],\"font/woff\":[\"woff\"],\"font/woff2\":[\"woff2\"],\"image/aces\":[\"exr\"],\"image/apng\":[\"apng\"],\"image/avif\":[\"avif\"],\"image/bmp\":[\"bmp\"],\"image/cgm\":[\"cgm\"],\"image/dicom-rle\":[\"drle\"],\"image/emf\":[\"emf\"],\"image/fits\":[\"fits\"],\"image/g3fax\":[\"g3\"],\"image/gif\":[\"gif\"],\"image/heic\":[\"heic\"],\"image/heic-sequence\":[\"heics\"],\"image/heif\":[\"heif\"],\"image/heif-sequence\":[\"heifs\"],\"image/hej2k\":[\"hej2\"],\"image/hsj2\":[\"hsj2\"],\"image/ief\":[\"ief\"],\"image/jls\":[\"jls\"],\"image/jp2\":[\"jp2\",\"jpg2\"],\"image/jpeg\":[\"jpeg\",\"jpg\",\"jpe\"],\"image/jph\":[\"jph\"],\"image/jphc\":[\"jhc\"],\"image/jpm\":[\"jpm\"],\"image/jpx\":[\"jpx\",\"jpf\"],\"image/jxr\":[\"jxr\"],\"image/jxra\":[\"jxra\"],\"image/jxrs\":[\"jxrs\"],\"image/jxs\":[\"jxs\"],\"image/jxsc\":[\"jxsc\"],\"image/jxsi\":[\"jxsi\"],\"image/jxss\":[\"jxss\"],\"image/ktx\":[\"ktx\"],\"image/ktx2\":[\"ktx2\"],\"image/png\":[\"png\"],\"image/sgi\":[\"sgi\"],\"image/svg+xml\":[\"svg\",\"svgz\"],\"image/t38\":[\"t38\"],\"image/tiff\":[\"tif\",\"tiff\"],\"image/tiff-fx\":[\"tfx\"],\"image/webp\":[\"webp\"],\"image/wmf\":[\"wmf\"],\"message/disposition-notification\":[\"disposition-notification\"],\"message/global\":[\"u8msg\"],\"message/global-delivery-status\":[\"u8dsn\"],\"message/global-disposition-notification\":[\"u8mdn\"],\"message/global-headers\":[\"u8hdr\"],\"message/rfc822\":[\"eml\",\"mime\"],\"model/3mf\":[\"3mf\"],\"model/gltf+json\":[\"gltf\"],\"model/gltf-binary\":[\"glb\"],\"model/iges\":[\"igs\",\"iges\"],\"model/mesh\":[\"msh\",\"mesh\",\"silo\"],\"model/mtl\":[\"mtl\"],\"model/obj\":[\"obj\"],\"model/step+xml\":[\"stpx\"],\"model/step+zip\":[\"stpz\"],\"model/step-xml+zip\":[\"stpxz\"],\"model/stl\":[\"stl\"],\"model/vrml\":[\"wrl\",\"vrml\"],\"model/x3d+binary\":[\"*x3db\",\"x3dbz\"],\"model/x3d+fastinfoset\":[\"x3db\"],\"model/x3d+vrml\":[\"*x3dv\",\"x3dvz\"],\"model/x3d+xml\":[\"x3d\",\"x3dz\"],\"model/x3d-vrml\":[\"x3dv\"],\"text/cache-manifest\":[\"appcache\",\"manifest\"],\"text/calendar\":[\"ics\",\"ifb\"],\"text/coffeescript\":[\"coffee\",\"litcoffee\"],\"text/css\":[\"css\"],\"text/csv\":[\"csv\"],\"text/html\":[\"html\",\"htm\",\"shtml\"],\"text/jade\":[\"jade\"],\"text/jsx\":[\"jsx\"],\"text/less\":[\"less\"],\"text/markdown\":[\"markdown\",\"md\"],\"text/mathml\":[\"mml\"],\"text/mdx\":[\"mdx\"],\"text/n3\":[\"n3\"],\"text/plain\":[\"txt\",\"text\",\"conf\",\"def\",\"list\",\"log\",\"in\",\"ini\"],\"text/richtext\":[\"rtx\"],\"text/rtf\":[\"*rtf\"],\"text/sgml\":[\"sgml\",\"sgm\"],\"text/shex\":[\"shex\"],\"text/slim\":[\"slim\",\"slm\"],\"text/spdx\":[\"spdx\"],\"text/stylus\":[\"stylus\",\"styl\"],\"text/tab-separated-values\":[\"tsv\"],\"text/troff\":[\"t\",\"tr\",\"roff\",\"man\",\"me\",\"ms\"],\"text/turtle\":[\"ttl\"],\"text/uri-list\":[\"uri\",\"uris\",\"urls\"],\"text/vcard\":[\"vcard\"],\"text/vtt\":[\"vtt\"],\"text/xml\":[\"*xml\"],\"text/yaml\":[\"yaml\",\"yml\"],\"video/3gpp\":[\"3gp\",\"3gpp\"],\"video/3gpp2\":[\"3g2\"],\"video/h261\":[\"h261\"],\"video/h263\":[\"h263\"],\"video/h264\":[\"h264\"],\"video/iso.segment\":[\"m4s\"],\"video/jpeg\":[\"jpgv\"],\"video/jpm\":[\"*jpm\",\"jpgm\"],\"video/mj2\":[\"mj2\",\"mjp2\"],\"video/mp2t\":[\"ts\"],\"video/mp4\":[\"mp4\",\"mp4v\",\"mpg4\"],\"video/mpeg\":[\"mpeg\",\"mpg\",\"mpe\",\"m1v\",\"m2v\"],\"video/ogg\":[\"ogv\"],\"video/quicktime\":[\"qt\",\"mov\"],\"video/webm\":[\"webm\"]};", "module.exports = {\"application/prs.cww\":[\"cww\"],\"application/vnd.1000minds.decision-model+xml\":[\"1km\"],\"application/vnd.3gpp.pic-bw-large\":[\"plb\"],\"application/vnd.3gpp.pic-bw-small\":[\"psb\"],\"application/vnd.3gpp.pic-bw-var\":[\"pvb\"],\"application/vnd.3gpp2.tcap\":[\"tcap\"],\"application/vnd.3m.post-it-notes\":[\"pwn\"],\"application/vnd.accpac.simply.aso\":[\"aso\"],\"application/vnd.accpac.simply.imp\":[\"imp\"],\"application/vnd.acucobol\":[\"acu\"],\"application/vnd.acucorp\":[\"atc\",\"acutc\"],\"application/vnd.adobe.air-application-installer-package+zip\":[\"air\"],\"application/vnd.adobe.formscentral.fcdt\":[\"fcdt\"],\"application/vnd.adobe.fxp\":[\"fxp\",\"fxpl\"],\"application/vnd.adobe.xdp+xml\":[\"xdp\"],\"application/vnd.adobe.xfdf\":[\"xfdf\"],\"application/vnd.ahead.space\":[\"ahead\"],\"application/vnd.airzip.filesecure.azf\":[\"azf\"],\"application/vnd.airzip.filesecure.azs\":[\"azs\"],\"application/vnd.amazon.ebook\":[\"azw\"],\"application/vnd.americandynamics.acc\":[\"acc\"],\"application/vnd.amiga.ami\":[\"ami\"],\"application/vnd.android.package-archive\":[\"apk\"],\"application/vnd.anser-web-certificate-issue-initiation\":[\"cii\"],\"application/vnd.anser-web-funds-transfer-initiation\":[\"fti\"],\"application/vnd.antix.game-component\":[\"atx\"],\"application/vnd.apple.installer+xml\":[\"mpkg\"],\"application/vnd.apple.keynote\":[\"key\"],\"application/vnd.apple.mpegurl\":[\"m3u8\"],\"application/vnd.apple.numbers\":[\"numbers\"],\"application/vnd.apple.pages\":[\"pages\"],\"application/vnd.apple.pkpass\":[\"pkpass\"],\"application/vnd.aristanetworks.swi\":[\"swi\"],\"application/vnd.astraea-software.iota\":[\"iota\"],\"application/vnd.audiograph\":[\"aep\"],\"application/vnd.balsamiq.bmml+xml\":[\"bmml\"],\"application/vnd.blueice.multipass\":[\"mpm\"],\"application/vnd.bmi\":[\"bmi\"],\"application/vnd.businessobjects\":[\"rep\"],\"application/vnd.chemdraw+xml\":[\"cdxml\"],\"application/vnd.chipnuts.karaoke-mmd\":[\"mmd\"],\"application/vnd.cinderella\":[\"cdy\"],\"application/vnd.citationstyles.style+xml\":[\"csl\"],\"application/vnd.claymore\":[\"cla\"],\"application/vnd.cloanto.rp9\":[\"rp9\"],\"application/vnd.clonk.c4group\":[\"c4g\",\"c4d\",\"c4f\",\"c4p\",\"c4u\"],\"application/vnd.cluetrust.cartomobile-config\":[\"c11amc\"],\"application/vnd.cluetrust.cartomobile-config-pkg\":[\"c11amz\"],\"application/vnd.commonspace\":[\"csp\"],\"application/vnd.contact.cmsg\":[\"cdbcmsg\"],\"application/vnd.cosmocaller\":[\"cmc\"],\"application/vnd.crick.clicker\":[\"clkx\"],\"application/vnd.crick.clicker.keyboard\":[\"clkk\"],\"application/vnd.crick.clicker.palette\":[\"clkp\"],\"application/vnd.crick.clicker.template\":[\"clkt\"],\"application/vnd.crick.clicker.wordbank\":[\"clkw\"],\"application/vnd.criticaltools.wbs+xml\":[\"wbs\"],\"application/vnd.ctc-posml\":[\"pml\"],\"application/vnd.cups-ppd\":[\"ppd\"],\"application/vnd.curl.car\":[\"car\"],\"application/vnd.curl.pcurl\":[\"pcurl\"],\"application/vnd.dart\":[\"dart\"],\"application/vnd.data-vision.rdz\":[\"rdz\"],\"application/vnd.dbf\":[\"dbf\"],\"application/vnd.dece.data\":[\"uvf\",\"uvvf\",\"uvd\",\"uvvd\"],\"application/vnd.dece.ttml+xml\":[\"uvt\",\"uvvt\"],\"application/vnd.dece.unspecified\":[\"uvx\",\"uvvx\"],\"application/vnd.dece.zip\":[\"uvz\",\"uvvz\"],\"application/vnd.denovo.fcselayout-link\":[\"fe_launch\"],\"application/vnd.dna\":[\"dna\"],\"application/vnd.dolby.mlp\":[\"mlp\"],\"application/vnd.dpgraph\":[\"dpg\"],\"application/vnd.dreamfactory\":[\"dfac\"],\"application/vnd.ds-keypoint\":[\"kpxx\"],\"application/vnd.dvb.ait\":[\"ait\"],\"application/vnd.dvb.service\":[\"svc\"],\"application/vnd.dynageo\":[\"geo\"],\"application/vnd.ecowin.chart\":[\"mag\"],\"application/vnd.enliven\":[\"nml\"],\"application/vnd.epson.esf\":[\"esf\"],\"application/vnd.epson.msf\":[\"msf\"],\"application/vnd.epson.quickanime\":[\"qam\"],\"application/vnd.epson.salt\":[\"slt\"],\"application/vnd.epson.ssf\":[\"ssf\"],\"application/vnd.eszigno3+xml\":[\"es3\",\"et3\"],\"application/vnd.ezpix-album\":[\"ez2\"],\"application/vnd.ezpix-package\":[\"ez3\"],\"application/vnd.fdf\":[\"fdf\"],\"application/vnd.fdsn.mseed\":[\"mseed\"],\"application/vnd.fdsn.seed\":[\"seed\",\"dataless\"],\"application/vnd.flographit\":[\"gph\"],\"application/vnd.fluxtime.clip\":[\"ftc\"],\"application/vnd.framemaker\":[\"fm\",\"frame\",\"maker\",\"book\"],\"application/vnd.frogans.fnc\":[\"fnc\"],\"application/vnd.frogans.ltf\":[\"ltf\"],\"application/vnd.fsc.weblaunch\":[\"fsc\"],\"application/vnd.fujitsu.oasys\":[\"oas\"],\"application/vnd.fujitsu.oasys2\":[\"oa2\"],\"application/vnd.fujitsu.oasys3\":[\"oa3\"],\"application/vnd.fujitsu.oasysgp\":[\"fg5\"],\"application/vnd.fujitsu.oasysprs\":[\"bh2\"],\"application/vnd.fujixerox.ddd\":[\"ddd\"],\"application/vnd.fujixerox.docuworks\":[\"xdw\"],\"application/vnd.fujixerox.docuworks.binder\":[\"xbd\"],\"application/vnd.fuzzysheet\":[\"fzs\"],\"application/vnd.genomatix.tuxedo\":[\"txd\"],\"application/vnd.geogebra.file\":[\"ggb\"],\"application/vnd.geogebra.tool\":[\"ggt\"],\"application/vnd.geometry-explorer\":[\"gex\",\"gre\"],\"application/vnd.geonext\":[\"gxt\"],\"application/vnd.geoplan\":[\"g2w\"],\"application/vnd.geospace\":[\"g3w\"],\"application/vnd.gmx\":[\"gmx\"],\"application/vnd.google-apps.document\":[\"gdoc\"],\"application/vnd.google-apps.presentation\":[\"gslides\"],\"application/vnd.google-apps.spreadsheet\":[\"gsheet\"],\"application/vnd.google-earth.kml+xml\":[\"kml\"],\"application/vnd.google-earth.kmz\":[\"kmz\"],\"application/vnd.grafeq\":[\"gqf\",\"gqs\"],\"application/vnd.groove-account\":[\"gac\"],\"application/vnd.groove-help\":[\"ghf\"],\"application/vnd.groove-identity-message\":[\"gim\"],\"application/vnd.groove-injector\":[\"grv\"],\"application/vnd.groove-tool-message\":[\"gtm\"],\"application/vnd.groove-tool-template\":[\"tpl\"],\"application/vnd.groove-vcard\":[\"vcg\"],\"application/vnd.hal+xml\":[\"hal\"],\"application/vnd.handheld-entertainment+xml\":[\"zmm\"],\"application/vnd.hbci\":[\"hbci\"],\"application/vnd.hhe.lesson-player\":[\"les\"],\"application/vnd.hp-hpgl\":[\"hpgl\"],\"application/vnd.hp-hpid\":[\"hpid\"],\"application/vnd.hp-hps\":[\"hps\"],\"application/vnd.hp-jlyt\":[\"jlt\"],\"application/vnd.hp-pcl\":[\"pcl\"],\"application/vnd.hp-pclxl\":[\"pclxl\"],\"application/vnd.hydrostatix.sof-data\":[\"sfd-hdstx\"],\"application/vnd.ibm.minipay\":[\"mpy\"],\"application/vnd.ibm.modcap\":[\"afp\",\"listafp\",\"list3820\"],\"application/vnd.ibm.rights-management\":[\"irm\"],\"application/vnd.ibm.secure-container\":[\"sc\"],\"application/vnd.iccprofile\":[\"icc\",\"icm\"],\"application/vnd.igloader\":[\"igl\"],\"application/vnd.immervision-ivp\":[\"ivp\"],\"application/vnd.immervision-ivu\":[\"ivu\"],\"application/vnd.insors.igm\":[\"igm\"],\"application/vnd.intercon.formnet\":[\"xpw\",\"xpx\"],\"application/vnd.intergeo\":[\"i2g\"],\"application/vnd.intu.qbo\":[\"qbo\"],\"application/vnd.intu.qfx\":[\"qfx\"],\"application/vnd.ipunplugged.rcprofile\":[\"rcprofile\"],\"application/vnd.irepository.package+xml\":[\"irp\"],\"application/vnd.is-xpr\":[\"xpr\"],\"application/vnd.isac.fcs\":[\"fcs\"],\"application/vnd.jam\":[\"jam\"],\"application/vnd.jcp.javame.midlet-rms\":[\"rms\"],\"application/vnd.jisp\":[\"jisp\"],\"application/vnd.joost.joda-archive\":[\"joda\"],\"application/vnd.kahootz\":[\"ktz\",\"ktr\"],\"application/vnd.kde.karbon\":[\"karbon\"],\"application/vnd.kde.kchart\":[\"chrt\"],\"application/vnd.kde.kformula\":[\"kfo\"],\"application/vnd.kde.kivio\":[\"flw\"],\"application/vnd.kde.kontour\":[\"kon\"],\"application/vnd.kde.kpresenter\":[\"kpr\",\"kpt\"],\"application/vnd.kde.kspread\":[\"ksp\"],\"application/vnd.kde.kword\":[\"kwd\",\"kwt\"],\"application/vnd.kenameaapp\":[\"htke\"],\"application/vnd.kidspiration\":[\"kia\"],\"application/vnd.kinar\":[\"kne\",\"knp\"],\"application/vnd.koan\":[\"skp\",\"skd\",\"skt\",\"skm\"],\"application/vnd.kodak-descriptor\":[\"sse\"],\"application/vnd.las.las+xml\":[\"lasxml\"],\"application/vnd.llamagraphics.life-balance.desktop\":[\"lbd\"],\"application/vnd.llamagraphics.life-balance.exchange+xml\":[\"lbe\"],\"application/vnd.lotus-1-2-3\":[\"123\"],\"application/vnd.lotus-approach\":[\"apr\"],\"application/vnd.lotus-freelance\":[\"pre\"],\"application/vnd.lotus-notes\":[\"nsf\"],\"application/vnd.lotus-organizer\":[\"org\"],\"application/vnd.lotus-screencam\":[\"scm\"],\"application/vnd.lotus-wordpro\":[\"lwp\"],\"application/vnd.macports.portpkg\":[\"portpkg\"],\"application/vnd.mapbox-vector-tile\":[\"mvt\"],\"application/vnd.mcd\":[\"mcd\"],\"application/vnd.medcalcdata\":[\"mc1\"],\"application/vnd.mediastation.cdkey\":[\"cdkey\"],\"application/vnd.mfer\":[\"mwf\"],\"application/vnd.mfmp\":[\"mfm\"],\"application/vnd.micrografx.flo\":[\"flo\"],\"application/vnd.micrografx.igx\":[\"igx\"],\"application/vnd.mif\":[\"mif\"],\"application/vnd.mobius.daf\":[\"daf\"],\"application/vnd.mobius.dis\":[\"dis\"],\"application/vnd.mobius.mbk\":[\"mbk\"],\"application/vnd.mobius.mqy\":[\"mqy\"],\"application/vnd.mobius.msl\":[\"msl\"],\"application/vnd.mobius.plc\":[\"plc\"],\"application/vnd.mobius.txf\":[\"txf\"],\"application/vnd.mophun.application\":[\"mpn\"],\"application/vnd.mophun.certificate\":[\"mpc\"],\"application/vnd.mozilla.xul+xml\":[\"xul\"],\"application/vnd.ms-artgalry\":[\"cil\"],\"application/vnd.ms-cab-compressed\":[\"cab\"],\"application/vnd.ms-excel\":[\"xls\",\"xlm\",\"xla\",\"xlc\",\"xlt\",\"xlw\"],\"application/vnd.ms-excel.addin.macroenabled.12\":[\"xlam\"],\"application/vnd.ms-excel.sheet.binary.macroenabled.12\":[\"xlsb\"],\"application/vnd.ms-excel.sheet.macroenabled.12\":[\"xlsm\"],\"application/vnd.ms-excel.template.macroenabled.12\":[\"xltm\"],\"application/vnd.ms-fontobject\":[\"eot\"],\"application/vnd.ms-htmlhelp\":[\"chm\"],\"application/vnd.ms-ims\":[\"ims\"],\"application/vnd.ms-lrm\":[\"lrm\"],\"application/vnd.ms-officetheme\":[\"thmx\"],\"application/vnd.ms-outlook\":[\"msg\"],\"application/vnd.ms-pki.seccat\":[\"cat\"],\"application/vnd.ms-pki.stl\":[\"*stl\"],\"application/vnd.ms-powerpoint\":[\"ppt\",\"pps\",\"pot\"],\"application/vnd.ms-powerpoint.addin.macroenabled.12\":[\"ppam\"],\"application/vnd.ms-powerpoint.presentation.macroenabled.12\":[\"pptm\"],\"application/vnd.ms-powerpoint.slide.macroenabled.12\":[\"sldm\"],\"application/vnd.ms-powerpoint.slideshow.macroenabled.12\":[\"ppsm\"],\"application/vnd.ms-powerpoint.template.macroenabled.12\":[\"potm\"],\"application/vnd.ms-project\":[\"mpp\",\"mpt\"],\"application/vnd.ms-word.document.macroenabled.12\":[\"docm\"],\"application/vnd.ms-word.template.macroenabled.12\":[\"dotm\"],\"application/vnd.ms-works\":[\"wps\",\"wks\",\"wcm\",\"wdb\"],\"application/vnd.ms-wpl\":[\"wpl\"],\"application/vnd.ms-xpsdocument\":[\"xps\"],\"application/vnd.mseq\":[\"mseq\"],\"application/vnd.musician\":[\"mus\"],\"application/vnd.muvee.style\":[\"msty\"],\"application/vnd.mynfc\":[\"taglet\"],\"application/vnd.neurolanguage.nlu\":[\"nlu\"],\"application/vnd.nitf\":[\"ntf\",\"nitf\"],\"application/vnd.noblenet-directory\":[\"nnd\"],\"application/vnd.noblenet-sealer\":[\"nns\"],\"application/vnd.noblenet-web\":[\"nnw\"],\"application/vnd.nokia.n-gage.ac+xml\":[\"*ac\"],\"application/vnd.nokia.n-gage.data\":[\"ngdat\"],\"application/vnd.nokia.n-gage.symbian.install\":[\"n-gage\"],\"application/vnd.nokia.radio-preset\":[\"rpst\"],\"application/vnd.nokia.radio-presets\":[\"rpss\"],\"application/vnd.novadigm.edm\":[\"edm\"],\"application/vnd.novadigm.edx\":[\"edx\"],\"application/vnd.novadigm.ext\":[\"ext\"],\"application/vnd.oasis.opendocument.chart\":[\"odc\"],\"application/vnd.oasis.opendocument.chart-template\":[\"otc\"],\"application/vnd.oasis.opendocument.database\":[\"odb\"],\"application/vnd.oasis.opendocument.formula\":[\"odf\"],\"application/vnd.oasis.opendocument.formula-template\":[\"odft\"],\"application/vnd.oasis.opendocument.graphics\":[\"odg\"],\"application/vnd.oasis.opendocument.graphics-template\":[\"otg\"],\"application/vnd.oasis.opendocument.image\":[\"odi\"],\"application/vnd.oasis.opendocument.image-template\":[\"oti\"],\"application/vnd.oasis.opendocument.presentation\":[\"odp\"],\"application/vnd.oasis.opendocument.presentation-template\":[\"otp\"],\"application/vnd.oasis.opendocument.spreadsheet\":[\"ods\"],\"application/vnd.oasis.opendocument.spreadsheet-template\":[\"ots\"],\"application/vnd.oasis.opendocument.text\":[\"odt\"],\"application/vnd.oasis.opendocument.text-master\":[\"odm\"],\"application/vnd.oasis.opendocument.text-template\":[\"ott\"],\"application/vnd.oasis.opendocument.text-web\":[\"oth\"],\"application/vnd.olpc-sugar\":[\"xo\"],\"application/vnd.oma.dd2+xml\":[\"dd2\"],\"application/vnd.openblox.game+xml\":[\"obgx\"],\"application/vnd.openofficeorg.extension\":[\"oxt\"],\"application/vnd.openstreetmap.data+xml\":[\"osm\"],\"application/vnd.openxmlformats-officedocument.presentationml.presentation\":[\"pptx\"],\"application/vnd.openxmlformats-officedocument.presentationml.slide\":[\"sldx\"],\"application/vnd.openxmlformats-officedocument.presentationml.slideshow\":[\"ppsx\"],\"application/vnd.openxmlformats-officedocument.presentationml.template\":[\"potx\"],\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":[\"xlsx\"],\"application/vnd.openxmlformats-officedocument.spreadsheetml.template\":[\"xltx\"],\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":[\"docx\"],\"application/vnd.openxmlformats-officedocument.wordprocessingml.template\":[\"dotx\"],\"application/vnd.osgeo.mapguide.package\":[\"mgp\"],\"application/vnd.osgi.dp\":[\"dp\"],\"application/vnd.osgi.subsystem\":[\"esa\"],\"application/vnd.palm\":[\"pdb\",\"pqa\",\"oprc\"],\"application/vnd.pawaafile\":[\"paw\"],\"application/vnd.pg.format\":[\"str\"],\"application/vnd.pg.osasli\":[\"ei6\"],\"application/vnd.picsel\":[\"efif\"],\"application/vnd.pmi.widget\":[\"wg\"],\"application/vnd.pocketlearn\":[\"plf\"],\"application/vnd.powerbuilder6\":[\"pbd\"],\"application/vnd.previewsystems.box\":[\"box\"],\"application/vnd.proteus.magazine\":[\"mgz\"],\"application/vnd.publishare-delta-tree\":[\"qps\"],\"application/vnd.pvi.ptid1\":[\"ptid\"],\"application/vnd.quark.quarkxpress\":[\"qxd\",\"qxt\",\"qwd\",\"qwt\",\"qxl\",\"qxb\"],\"application/vnd.rar\":[\"rar\"],\"application/vnd.realvnc.bed\":[\"bed\"],\"application/vnd.recordare.musicxml\":[\"mxl\"],\"application/vnd.recordare.musicxml+xml\":[\"musicxml\"],\"application/vnd.rig.cryptonote\":[\"cryptonote\"],\"application/vnd.rim.cod\":[\"cod\"],\"application/vnd.rn-realmedia\":[\"rm\"],\"application/vnd.rn-realmedia-vbr\":[\"rmvb\"],\"application/vnd.route66.link66+xml\":[\"link66\"],\"application/vnd.sailingtracker.track\":[\"st\"],\"application/vnd.seemail\":[\"see\"],\"application/vnd.sema\":[\"sema\"],\"application/vnd.semd\":[\"semd\"],\"application/vnd.semf\":[\"semf\"],\"application/vnd.shana.informed.formdata\":[\"ifm\"],\"application/vnd.shana.informed.formtemplate\":[\"itp\"],\"application/vnd.shana.informed.interchange\":[\"iif\"],\"application/vnd.shana.informed.package\":[\"ipk\"],\"application/vnd.simtech-mindmapper\":[\"twd\",\"twds\"],\"application/vnd.smaf\":[\"mmf\"],\"application/vnd.smart.teacher\":[\"teacher\"],\"application/vnd.software602.filler.form+xml\":[\"fo\"],\"application/vnd.solent.sdkm+xml\":[\"sdkm\",\"sdkd\"],\"application/vnd.spotfire.dxp\":[\"dxp\"],\"application/vnd.spotfire.sfs\":[\"sfs\"],\"application/vnd.stardivision.calc\":[\"sdc\"],\"application/vnd.stardivision.draw\":[\"sda\"],\"application/vnd.stardivision.impress\":[\"sdd\"],\"application/vnd.stardivision.math\":[\"smf\"],\"application/vnd.stardivision.writer\":[\"sdw\",\"vor\"],\"application/vnd.stardivision.writer-global\":[\"sgl\"],\"application/vnd.stepmania.package\":[\"smzip\"],\"application/vnd.stepmania.stepchart\":[\"sm\"],\"application/vnd.sun.wadl+xml\":[\"wadl\"],\"application/vnd.sun.xml.calc\":[\"sxc\"],\"application/vnd.sun.xml.calc.template\":[\"stc\"],\"application/vnd.sun.xml.draw\":[\"sxd\"],\"application/vnd.sun.xml.draw.template\":[\"std\"],\"application/vnd.sun.xml.impress\":[\"sxi\"],\"application/vnd.sun.xml.impress.template\":[\"sti\"],\"application/vnd.sun.xml.math\":[\"sxm\"],\"application/vnd.sun.xml.writer\":[\"sxw\"],\"application/vnd.sun.xml.writer.global\":[\"sxg\"],\"application/vnd.sun.xml.writer.template\":[\"stw\"],\"application/vnd.sus-calendar\":[\"sus\",\"susp\"],\"application/vnd.svd\":[\"svd\"],\"application/vnd.symbian.install\":[\"sis\",\"sisx\"],\"application/vnd.syncml+xml\":[\"xsm\"],\"application/vnd.syncml.dm+wbxml\":[\"bdm\"],\"application/vnd.syncml.dm+xml\":[\"xdm\"],\"application/vnd.syncml.dmddf+xml\":[\"ddf\"],\"application/vnd.tao.intent-module-archive\":[\"tao\"],\"application/vnd.tcpdump.pcap\":[\"pcap\",\"cap\",\"dmp\"],\"application/vnd.tmobile-livetv\":[\"tmo\"],\"application/vnd.trid.tpt\":[\"tpt\"],\"application/vnd.triscape.mxs\":[\"mxs\"],\"application/vnd.trueapp\":[\"tra\"],\"application/vnd.ufdl\":[\"ufd\",\"ufdl\"],\"application/vnd.uiq.theme\":[\"utz\"],\"application/vnd.umajin\":[\"umj\"],\"application/vnd.unity\":[\"unityweb\"],\"application/vnd.uoml+xml\":[\"uoml\"],\"application/vnd.vcx\":[\"vcx\"],\"application/vnd.visio\":[\"vsd\",\"vst\",\"vss\",\"vsw\"],\"application/vnd.visionary\":[\"vis\"],\"application/vnd.vsf\":[\"vsf\"],\"application/vnd.wap.wbxml\":[\"wbxml\"],\"application/vnd.wap.wmlc\":[\"wmlc\"],\"application/vnd.wap.wmlscriptc\":[\"wmlsc\"],\"application/vnd.webturbo\":[\"wtb\"],\"application/vnd.wolfram.player\":[\"nbp\"],\"application/vnd.wordperfect\":[\"wpd\"],\"application/vnd.wqd\":[\"wqd\"],\"application/vnd.wt.stf\":[\"stf\"],\"application/vnd.xara\":[\"xar\"],\"application/vnd.xfdl\":[\"xfdl\"],\"application/vnd.yamaha.hv-dic\":[\"hvd\"],\"application/vnd.yamaha.hv-script\":[\"hvs\"],\"application/vnd.yamaha.hv-voice\":[\"hvp\"],\"application/vnd.yamaha.openscoreformat\":[\"osf\"],\"application/vnd.yamaha.openscoreformat.osfpvg+xml\":[\"osfpvg\"],\"application/vnd.yamaha.smaf-audio\":[\"saf\"],\"application/vnd.yamaha.smaf-phrase\":[\"spf\"],\"application/vnd.yellowriver-custom-menu\":[\"cmp\"],\"application/vnd.zul\":[\"zir\",\"zirz\"],\"application/vnd.zzazz.deck+xml\":[\"zaz\"],\"application/x-7z-compressed\":[\"7z\"],\"application/x-abiword\":[\"abw\"],\"application/x-ace-compressed\":[\"ace\"],\"application/x-apple-diskimage\":[\"*dmg\"],\"application/x-arj\":[\"arj\"],\"application/x-authorware-bin\":[\"aab\",\"x32\",\"u32\",\"vox\"],\"application/x-authorware-map\":[\"aam\"],\"application/x-authorware-seg\":[\"aas\"],\"application/x-bcpio\":[\"bcpio\"],\"application/x-bdoc\":[\"*bdoc\"],\"application/x-bittorrent\":[\"torrent\"],\"application/x-blorb\":[\"blb\",\"blorb\"],\"application/x-bzip\":[\"bz\"],\"application/x-bzip2\":[\"bz2\",\"boz\"],\"application/x-cbr\":[\"cbr\",\"cba\",\"cbt\",\"cbz\",\"cb7\"],\"application/x-cdlink\":[\"vcd\"],\"application/x-cfs-compressed\":[\"cfs\"],\"application/x-chat\":[\"chat\"],\"application/x-chess-pgn\":[\"pgn\"],\"application/x-chrome-extension\":[\"crx\"],\"application/x-cocoa\":[\"cco\"],\"application/x-conference\":[\"nsc\"],\"application/x-cpio\":[\"cpio\"],\"application/x-csh\":[\"csh\"],\"application/x-debian-package\":[\"*deb\",\"udeb\"],\"application/x-dgc-compressed\":[\"dgc\"],\"application/x-director\":[\"dir\",\"dcr\",\"dxr\",\"cst\",\"cct\",\"cxt\",\"w3d\",\"fgd\",\"swa\"],\"application/x-doom\":[\"wad\"],\"application/x-dtbncx+xml\":[\"ncx\"],\"application/x-dtbook+xml\":[\"dtb\"],\"application/x-dtbresource+xml\":[\"res\"],\"application/x-dvi\":[\"dvi\"],\"application/x-envoy\":[\"evy\"],\"application/x-eva\":[\"eva\"],\"application/x-font-bdf\":[\"bdf\"],\"application/x-font-ghostscript\":[\"gsf\"],\"application/x-font-linux-psf\":[\"psf\"],\"application/x-font-pcf\":[\"pcf\"],\"application/x-font-snf\":[\"snf\"],\"application/x-font-type1\":[\"pfa\",\"pfb\",\"pfm\",\"afm\"],\"application/x-freearc\":[\"arc\"],\"application/x-futuresplash\":[\"spl\"],\"application/x-gca-compressed\":[\"gca\"],\"application/x-glulx\":[\"ulx\"],\"application/x-gnumeric\":[\"gnumeric\"],\"application/x-gramps-xml\":[\"gramps\"],\"application/x-gtar\":[\"gtar\"],\"application/x-hdf\":[\"hdf\"],\"application/x-httpd-php\":[\"php\"],\"application/x-install-instructions\":[\"install\"],\"application/x-iso9660-image\":[\"*iso\"],\"application/x-iwork-keynote-sffkey\":[\"*key\"],\"application/x-iwork-numbers-sffnumbers\":[\"*numbers\"],\"application/x-iwork-pages-sffpages\":[\"*pages\"],\"application/x-java-archive-diff\":[\"jardiff\"],\"application/x-java-jnlp-file\":[\"jnlp\"],\"application/x-keepass2\":[\"kdbx\"],\"application/x-latex\":[\"latex\"],\"application/x-lua-bytecode\":[\"luac\"],\"application/x-lzh-compressed\":[\"lzh\",\"lha\"],\"application/x-makeself\":[\"run\"],\"application/x-mie\":[\"mie\"],\"application/x-mobipocket-ebook\":[\"prc\",\"mobi\"],\"application/x-ms-application\":[\"application\"],\"application/x-ms-shortcut\":[\"lnk\"],\"application/x-ms-wmd\":[\"wmd\"],\"application/x-ms-wmz\":[\"wmz\"],\"application/x-ms-xbap\":[\"xbap\"],\"application/x-msaccess\":[\"mdb\"],\"application/x-msbinder\":[\"obd\"],\"application/x-mscardfile\":[\"crd\"],\"application/x-msclip\":[\"clp\"],\"application/x-msdos-program\":[\"*exe\"],\"application/x-msdownload\":[\"*exe\",\"*dll\",\"com\",\"bat\",\"*msi\"],\"application/x-msmediaview\":[\"mvb\",\"m13\",\"m14\"],\"application/x-msmetafile\":[\"*wmf\",\"*wmz\",\"*emf\",\"emz\"],\"application/x-msmoney\":[\"mny\"],\"application/x-mspublisher\":[\"pub\"],\"application/x-msschedule\":[\"scd\"],\"application/x-msterminal\":[\"trm\"],\"application/x-mswrite\":[\"wri\"],\"application/x-netcdf\":[\"nc\",\"cdf\"],\"application/x-ns-proxy-autoconfig\":[\"pac\"],\"application/x-nzb\":[\"nzb\"],\"application/x-perl\":[\"pl\",\"pm\"],\"application/x-pilot\":[\"*prc\",\"*pdb\"],\"application/x-pkcs12\":[\"p12\",\"pfx\"],\"application/x-pkcs7-certificates\":[\"p7b\",\"spc\"],\"application/x-pkcs7-certreqresp\":[\"p7r\"],\"application/x-rar-compressed\":[\"*rar\"],\"application/x-redhat-package-manager\":[\"rpm\"],\"application/x-research-info-systems\":[\"ris\"],\"application/x-sea\":[\"sea\"],\"application/x-sh\":[\"sh\"],\"application/x-shar\":[\"shar\"],\"application/x-shockwave-flash\":[\"swf\"],\"application/x-silverlight-app\":[\"xap\"],\"application/x-sql\":[\"sql\"],\"application/x-stuffit\":[\"sit\"],\"application/x-stuffitx\":[\"sitx\"],\"application/x-subrip\":[\"srt\"],\"application/x-sv4cpio\":[\"sv4cpio\"],\"application/x-sv4crc\":[\"sv4crc\"],\"application/x-t3vm-image\":[\"t3\"],\"application/x-tads\":[\"gam\"],\"application/x-tar\":[\"tar\"],\"application/x-tcl\":[\"tcl\",\"tk\"],\"application/x-tex\":[\"tex\"],\"application/x-tex-tfm\":[\"tfm\"],\"application/x-texinfo\":[\"texinfo\",\"texi\"],\"application/x-tgif\":[\"*obj\"],\"application/x-ustar\":[\"ustar\"],\"application/x-virtualbox-hdd\":[\"hdd\"],\"application/x-virtualbox-ova\":[\"ova\"],\"application/x-virtualbox-ovf\":[\"ovf\"],\"application/x-virtualbox-vbox\":[\"vbox\"],\"application/x-virtualbox-vbox-extpack\":[\"vbox-extpack\"],\"application/x-virtualbox-vdi\":[\"vdi\"],\"application/x-virtualbox-vhd\":[\"vhd\"],\"application/x-virtualbox-vmdk\":[\"vmdk\"],\"application/x-wais-source\":[\"src\"],\"application/x-web-app-manifest+json\":[\"webapp\"],\"application/x-x509-ca-cert\":[\"der\",\"crt\",\"pem\"],\"application/x-xfig\":[\"fig\"],\"application/x-xliff+xml\":[\"*xlf\"],\"application/x-xpinstall\":[\"xpi\"],\"application/x-xz\":[\"xz\"],\"application/x-zmachine\":[\"z1\",\"z2\",\"z3\",\"z4\",\"z5\",\"z6\",\"z7\",\"z8\"],\"audio/vnd.dece.audio\":[\"uva\",\"uvva\"],\"audio/vnd.digital-winds\":[\"eol\"],\"audio/vnd.dra\":[\"dra\"],\"audio/vnd.dts\":[\"dts\"],\"audio/vnd.dts.hd\":[\"dtshd\"],\"audio/vnd.lucent.voice\":[\"lvp\"],\"audio/vnd.ms-playready.media.pya\":[\"pya\"],\"audio/vnd.nuera.ecelp4800\":[\"ecelp4800\"],\"audio/vnd.nuera.ecelp7470\":[\"ecelp7470\"],\"audio/vnd.nuera.ecelp9600\":[\"ecelp9600\"],\"audio/vnd.rip\":[\"rip\"],\"audio/x-aac\":[\"aac\"],\"audio/x-aiff\":[\"aif\",\"aiff\",\"aifc\"],\"audio/x-caf\":[\"caf\"],\"audio/x-flac\":[\"flac\"],\"audio/x-m4a\":[\"*m4a\"],\"audio/x-matroska\":[\"mka\"],\"audio/x-mpegurl\":[\"m3u\"],\"audio/x-ms-wax\":[\"wax\"],\"audio/x-ms-wma\":[\"wma\"],\"audio/x-pn-realaudio\":[\"ram\",\"ra\"],\"audio/x-pn-realaudio-plugin\":[\"rmp\"],\"audio/x-realaudio\":[\"*ra\"],\"audio/x-wav\":[\"*wav\"],\"chemical/x-cdx\":[\"cdx\"],\"chemical/x-cif\":[\"cif\"],\"chemical/x-cmdf\":[\"cmdf\"],\"chemical/x-cml\":[\"cml\"],\"chemical/x-csml\":[\"csml\"],\"chemical/x-xyz\":[\"xyz\"],\"image/prs.btif\":[\"btif\"],\"image/prs.pti\":[\"pti\"],\"image/vnd.adobe.photoshop\":[\"psd\"],\"image/vnd.airzip.accelerator.azv\":[\"azv\"],\"image/vnd.dece.graphic\":[\"uvi\",\"uvvi\",\"uvg\",\"uvvg\"],\"image/vnd.djvu\":[\"djvu\",\"djv\"],\"image/vnd.dvb.subtitle\":[\"*sub\"],\"image/vnd.dwg\":[\"dwg\"],\"image/vnd.dxf\":[\"dxf\"],\"image/vnd.fastbidsheet\":[\"fbs\"],\"image/vnd.fpx\":[\"fpx\"],\"image/vnd.fst\":[\"fst\"],\"image/vnd.fujixerox.edmics-mmr\":[\"mmr\"],\"image/vnd.fujixerox.edmics-rlc\":[\"rlc\"],\"image/vnd.microsoft.icon\":[\"ico\"],\"image/vnd.ms-dds\":[\"dds\"],\"image/vnd.ms-modi\":[\"mdi\"],\"image/vnd.ms-photo\":[\"wdp\"],\"image/vnd.net-fpx\":[\"npx\"],\"image/vnd.pco.b16\":[\"b16\"],\"image/vnd.tencent.tap\":[\"tap\"],\"image/vnd.valve.source.texture\":[\"vtf\"],\"image/vnd.wap.wbmp\":[\"wbmp\"],\"image/vnd.xiff\":[\"xif\"],\"image/vnd.zbrush.pcx\":[\"pcx\"],\"image/x-3ds\":[\"3ds\"],\"image/x-cmu-raster\":[\"ras\"],\"image/x-cmx\":[\"cmx\"],\"image/x-freehand\":[\"fh\",\"fhc\",\"fh4\",\"fh5\",\"fh7\"],\"image/x-icon\":[\"*ico\"],\"image/x-jng\":[\"jng\"],\"image/x-mrsid-image\":[\"sid\"],\"image/x-ms-bmp\":[\"*bmp\"],\"image/x-pcx\":[\"*pcx\"],\"image/x-pict\":[\"pic\",\"pct\"],\"image/x-portable-anymap\":[\"pnm\"],\"image/x-portable-bitmap\":[\"pbm\"],\"image/x-portable-graymap\":[\"pgm\"],\"image/x-portable-pixmap\":[\"ppm\"],\"image/x-rgb\":[\"rgb\"],\"image/x-tga\":[\"tga\"],\"image/x-xbitmap\":[\"xbm\"],\"image/x-xpixmap\":[\"xpm\"],\"image/x-xwindowdump\":[\"xwd\"],\"message/vnd.wfa.wsc\":[\"wsc\"],\"model/vnd.collada+xml\":[\"dae\"],\"model/vnd.dwf\":[\"dwf\"],\"model/vnd.gdl\":[\"gdl\"],\"model/vnd.gtw\":[\"gtw\"],\"model/vnd.mts\":[\"mts\"],\"model/vnd.opengex\":[\"ogex\"],\"model/vnd.parasolid.transmit.binary\":[\"x_b\"],\"model/vnd.parasolid.transmit.text\":[\"x_t\"],\"model/vnd.sap.vds\":[\"vds\"],\"model/vnd.usdz+zip\":[\"usdz\"],\"model/vnd.valve.source.compiled-map\":[\"bsp\"],\"model/vnd.vtu\":[\"vtu\"],\"text/prs.lines.tag\":[\"dsc\"],\"text/vnd.curl\":[\"curl\"],\"text/vnd.curl.dcurl\":[\"dcurl\"],\"text/vnd.curl.mcurl\":[\"mcurl\"],\"text/vnd.curl.scurl\":[\"scurl\"],\"text/vnd.dvb.subtitle\":[\"sub\"],\"text/vnd.fly\":[\"fly\"],\"text/vnd.fmi.flexstor\":[\"flx\"],\"text/vnd.graphviz\":[\"gv\"],\"text/vnd.in3d.3dml\":[\"3dml\"],\"text/vnd.in3d.spot\":[\"spot\"],\"text/vnd.sun.j2me.app-descriptor\":[\"jad\"],\"text/vnd.wap.wml\":[\"wml\"],\"text/vnd.wap.wmlscript\":[\"wmls\"],\"text/x-asm\":[\"s\",\"asm\"],\"text/x-c\":[\"c\",\"cc\",\"cxx\",\"cpp\",\"h\",\"hh\",\"dic\"],\"text/x-component\":[\"htc\"],\"text/x-fortran\":[\"f\",\"for\",\"f77\",\"f90\"],\"text/x-handlebars-template\":[\"hbs\"],\"text/x-java-source\":[\"java\"],\"text/x-lua\":[\"lua\"],\"text/x-markdown\":[\"mkd\"],\"text/x-nfo\":[\"nfo\"],\"text/x-opml\":[\"opml\"],\"text/x-org\":[\"*org\"],\"text/x-pascal\":[\"p\",\"pas\"],\"text/x-processing\":[\"pde\"],\"text/x-sass\":[\"sass\"],\"text/x-scss\":[\"scss\"],\"text/x-setext\":[\"etx\"],\"text/x-sfv\":[\"sfv\"],\"text/x-suse-ymp\":[\"ymp\"],\"text/x-uuencode\":[\"uu\"],\"text/x-vcalendar\":[\"vcs\"],\"text/x-vcard\":[\"vcf\"],\"video/vnd.dece.hd\":[\"uvh\",\"uvvh\"],\"video/vnd.dece.mobile\":[\"uvm\",\"uvvm\"],\"video/vnd.dece.pd\":[\"uvp\",\"uvvp\"],\"video/vnd.dece.sd\":[\"uvs\",\"uvvs\"],\"video/vnd.dece.video\":[\"uvv\",\"uvvv\"],\"video/vnd.dvb.file\":[\"dvb\"],\"video/vnd.fvt\":[\"fvt\"],\"video/vnd.mpegurl\":[\"mxu\",\"m4u\"],\"video/vnd.ms-playready.media.pyv\":[\"pyv\"],\"video/vnd.uvvu.mp4\":[\"uvu\",\"uvvu\"],\"video/vnd.vivo\":[\"viv\"],\"video/x-f4v\":[\"f4v\"],\"video/x-fli\":[\"fli\"],\"video/x-flv\":[\"flv\"],\"video/x-m4v\":[\"m4v\"],\"video/x-matroska\":[\"mkv\",\"mk3d\",\"mks\"],\"video/x-mng\":[\"mng\"],\"video/x-ms-asf\":[\"asf\",\"asx\"],\"video/x-ms-vob\":[\"vob\"],\"video/x-ms-wm\":[\"wm\"],\"video/x-ms-wmv\":[\"wmv\"],\"video/x-ms-wmx\":[\"wmx\"],\"video/x-ms-wvx\":[\"wvx\"],\"video/x-msvideo\":[\"avi\"],\"video/x-sgi-movie\":[\"movie\"],\"video/x-smv\":[\"smv\"],\"x-conference/x-cooltalk\":[\"ice\"]};", "'use strict';\n\nlet Mime = require('./Mime');\nmodule.exports = new Mime(require('./types/standard'), require('./types/other'));\n", "import { IDisposable } from '@lumino/disposable';\nimport { IRenderMime } from '@jupyterlab/rendermime-interfaces';\nimport { PageConfig } from '@jupyterlab/coreutils';\nimport mime from 'mime';\n\nimport { Contents as ServerContents } from '@jupyterlab/services';\n\nimport { Token } from '@lumino/coreutils';\n\n/**\n * The token for the settings service.\n */\nexport const IContents = new Token<IContents>('@jupyterlite/contents:IContents');\n\n/**\n * The interface for the contents service.\n */\nexport interface IContents {\n /**\n * A promise that resolves after the contents have been full initialized.\n */\n ready: Promise<void>;\n\n /**\n * Create a new untitled file or directory in the specified directory path.\n *\n * @param options: The options used to create the file.\n *\n * @returns A promise which resolves with the created file content when the file is created.\n */\n newUntitled(\n options?: ServerContents.ICreateOptions,\n ): Promise<ServerContents.IModel | null>;\n\n /**\n * Copy a file into a given directory.\n *\n * @param path - The original file path.\n * @param toDir - The destination directory path.\n *\n * @returns A promise which resolves with the new contents model when the\n * file is copied.\n *\n * #### Notes\n * The server will select the name of the copied file.\n */\n copy(path: string, toDir: string): Promise<ServerContents.IModel>;\n\n /**\n * Get a file or directory.\n *\n * @param path: The path to the file.\n * @param options: The options used to fetch the file.\n *\n * @returns A promise which resolves with the file content.\n */\n get(\n path: string,\n options?: ServerContents.IFetchOptions,\n ): Promise<ServerContents.IModel | null>;\n\n /**\n * Rename a file or directory.\n *\n * @param oldLocalPath - The original file path.\n * @param newLocalPath - The new file path.\n *\n * @returns A promise which resolves with the new file content model when the file is renamed.\n */\n rename(oldLocalPath: string, newLocalPath: string): Promise<ServerContents.IModel>;\n\n /**\n * Save a file.\n *\n * @param path - The desired file path.\n * @param options - Optional overrides to the model.\n *\n * @returns A promise which resolves with the file content model when the file is saved.\n */\n save(\n path: string,\n options?: Partial<ServerContents.IModel>,\n ): Promise<ServerContents.IModel | null>;\n\n /**\n * Delete a file.\n *\n * @param path - The path to the file.\n */\n delete(path: string): Promise<void>;\n\n /**\n * Create a checkpoint for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with the new checkpoint model when the\n * checkpoint is created.\n */\n createCheckpoint(path: string): Promise<ServerContents.ICheckpointModel>;\n\n /**\n * List available checkpoints for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with a list of checkpoint models for\n * the file.\n */\n listCheckpoints(path: string): Promise<ServerContents.ICheckpointModel[]>;\n\n /**\n * Restore a file to a known checkpoint state.\n *\n * @param path - The path of the file.\n * @param checkpointID - The id of the checkpoint to restore.\n *\n * @returns A promise which resolves when the checkpoint is restored.\n */\n restoreCheckpoint(path: string, checkpointID: string): Promise<void>;\n\n /**\n * Delete a checkpoint for a file.\n *\n * @param path - The path of the file.\n * @param checkpointID - The id of the checkpoint to delete.\n *\n * @returns A promise which resolves when the checkpoint is deleted.\n */\n deleteCheckpoint(path: string, checkpointID: string): Promise<void>;\n}\n\n/**\n * Commonly-used mimetypes\n */\nexport namespace MIME {\n export const JSON = 'application/json';\n export const PLAIN_TEXT = 'text/plain';\n export const OCTET_STREAM = 'octet/stream';\n}\n\n/**\n * A namespace for file constructs.\n */\nexport namespace FILE {\n /**\n * Build-time configured file types.\n */\n const TYPES: Record<string, Partial<IRenderMime.IFileType>> = JSON.parse(\n PageConfig.getOption('fileTypes') || '{}',\n );\n\n /**\n * Get a mimetype (or fallback).\n */\n export function getType(ext: string, defaultType: string | null = null): string {\n ext = ext.toLowerCase();\n for (const fileType of Object.values(TYPES)) {\n for (const fileExt of fileType.extensions || []) {\n if (fileExt === ext && fileType.mimeTypes && fileType.mimeTypes.length) {\n return fileType.mimeTypes[0];\n }\n }\n }\n\n return mime.getType(ext) || defaultType || MIME.OCTET_STREAM;\n }\n\n /**\n * Determine whether the given extension matches a given fileFormat.\n */\n export function hasFormat(\n ext: string,\n fileFormat: 'base64' | 'text' | 'json',\n ): boolean {\n ext = ext.toLowerCase();\n for (const fileType of Object.values(TYPES)) {\n if (fileType.fileFormat !== fileFormat) {\n continue;\n }\n for (const fileExt of fileType.extensions || []) {\n if (fileExt === ext) {\n return true;\n }\n }\n }\n return false;\n }\n}\n\n/**\n * The token for the BroadcastChannel broadcaster.\n */\nexport const IBroadcastChannelWrapper = new Token<IBroadcastChannelWrapper>(\n '@jupyterlite/contents:IBroadcastChannelWrapper',\n);\n\nexport interface IBroadcastChannelWrapper extends IDisposable {\n enable(): void;\n disable(): void;\n enabled: boolean;\n}\n", "import { PageConfig, URLExt } from '@jupyterlab/coreutils';\n\nimport { Contents as ServerContents } from '@jupyterlab/services';\n\nimport { INotebookContent } from '@jupyterlab/nbformat';\n\nimport { PathExt } from '@jupyterlab/coreutils';\n\nimport type localforage from 'localforage';\n\nimport { IContents, MIME, FILE } from './tokens';\nimport { PromiseDelegate } from '@lumino/coreutils';\n\nexport type IModel = ServerContents.IModel;\n\n/**\n * The name of the local storage.\n */\nconst DEFAULT_STORAGE_NAME = 'JupyterLite Storage';\n\n/**\n * The number of checkpoints to save.\n */\nconst N_CHECKPOINTS = 5;\n\n/**\n * A class to handle requests to /api/contents\n */\nexport class Contents implements IContents {\n /**\n * Construct a new localForage-powered contents provider\n */\n constructor(options: Contents.IOptions) {\n this._localforage = options.localforage;\n this._storageName = options.storageName || DEFAULT_STORAGE_NAME;\n this._storageDrivers = options.storageDrivers || null;\n this._ready = new PromiseDelegate();\n }\n\n /**\n * Finish any initialization after server has started and all extensions are applied.\n */\n async initialize() {\n await this.initStorage();\n this._ready.resolve(void 0);\n }\n\n /**\n * Initialize all storage instances\n */\n protected async initStorage(): Promise<void> {\n this._storage = this.createDefaultStorage();\n this._counters = this.createDefaultCounters();\n this._checkpoints = this.createDefaultCheckpoints();\n }\n\n /**\n * A promise that resolves once all storage is fully initialized.\n */\n get ready(): Promise<void> {\n return this._ready.promise;\n }\n\n /**\n * A lazy reference to the underlying storage.\n */\n protected get storage(): Promise<LocalForage> {\n return this.ready.then(() => this._storage as LocalForage);\n }\n\n /**\n * A lazy reference to the underlying counters.\n */\n protected get counters(): Promise<LocalForage> {\n return this.ready.then(() => this._counters as LocalForage);\n }\n\n /**\n * A lazy reference to the underlying checkpoints.\n */\n protected get checkpoints(): Promise<LocalForage> {\n return this.ready.then(() => this._checkpoints as LocalForage);\n }\n\n /**\n * Get default options for localForage instances\n */\n protected get defaultStorageOptions(): LocalForageOptions {\n const driver =\n this._storageDrivers && this._storageDrivers.length ? this._storageDrivers : null;\n return {\n version: 1,\n name: this._storageName,\n ...(driver ? { driver } : {}),\n };\n }\n\n /**\n * Initialize the default storage for contents.\n */\n protected createDefaultStorage(): LocalForage {\n return this._localforage.createInstance({\n description: 'Offline Storage for Notebooks and Files',\n storeName: 'files',\n ...this.defaultStorageOptions,\n });\n }\n\n /**\n * Initialize the default storage for counting file suffixes.\n */\n protected createDefaultCounters(): LocalForage {\n return this._localforage.createInstance({\n description: 'Store the current file suffix counters',\n storeName: 'counters',\n ...this.defaultStorageOptions,\n });\n }\n\n /**\n * Create the default checkpoint storage.\n */\n protected createDefaultCheckpoints(): LocalForage {\n return this._localforage.createInstance({\n description: 'Offline Storage for Checkpoints',\n storeName: 'checkpoints',\n ...this.defaultStorageOptions,\n });\n }\n\n /**\n * Create a new untitled file or directory in the specified directory path.\n *\n * @param options: The options used to create the file.\n *\n * @returns A promise which resolves with the created file content when the file is created.\n */\n async newUntitled(options?: ServerContents.ICreateOptions): Promise<IModel | null> {\n const path = options?.path ?? '';\n const type = options?.type ?? 'notebook';\n const created = new Date().toISOString();\n\n let dirname = PathExt.dirname(path);\n const basename = PathExt.basename(path);\n const extname = PathExt.extname(path);\n const item = await this.get(dirname);\n\n // handle the case of \"Save As\", where the path points to the new file\n // to create, e.g. subfolder/example-copy.ipynb\n let name = '';\n if (path && !extname && item) {\n // directory\n dirname = `${path}/`;\n name = '';\n } else if (dirname && basename) {\n // file in a subfolder\n dirname = `${dirname}/`;\n name = basename;\n } else {\n // file at the top level\n dirname = '';\n name = path;\n }\n\n let file: IModel;\n switch (type) {\n case 'directory': {\n const counter = await this._incrementCounter('directory');\n name = `Untitled Folder${counter || ''}`;\n file = {\n name,\n path: `${dirname}${name}`,\n last_modified: created,\n created,\n format: 'json',\n mimetype: '',\n content: null,\n size: 0,\n writable: true,\n type: 'directory',\n };\n break;\n }\n case 'notebook': {\n const counter = await this._incrementCounter('notebook');\n name = name || `Untitled${counter || ''}.ipynb`;\n file = {\n name,\n path: `${dirname}${name}`,\n last_modified: created,\n created,\n format: 'json',\n mimetype: MIME.JSON,\n content: Private.EMPTY_NB,\n size: JSON.stringify(Private.EMPTY_NB).length,\n writable: true,\n type: 'notebook',\n };\n break;\n }\n default: {\n const ext = options?.ext ?? '.txt';\n const counter = await this._incrementCounter('file');\n const mimetype = FILE.getType(ext) || MIME.OCTET_STREAM;\n\n let format: ServerContents.FileFormat;\n if (FILE.hasFormat(ext, 'text') || mimetype.indexOf('text') !== -1) {\n format = 'text';\n } else if (ext.indexOf('json') !== -1 || ext.indexOf('ipynb') !== -1) {\n format = 'json';\n } else {\n format = 'base64';\n }\n\n name = name || `untitled${counter || ''}${ext}`;\n file = {\n name,\n path: `${dirname}${name}`,\n last_modified: created,\n created,\n format,\n mimetype,\n content: '',\n size: 0,\n writable: true,\n type: 'file',\n };\n break;\n }\n }\n\n const key = file.path;\n await (await this.storage).setItem(key, file);\n return file;\n }\n\n /**\n * Copy a file into a given directory.\n *\n * @param path - The original file path.\n * @param toDir - The destination directory path.\n *\n * @returns A promise which resolves with the new contents model when the\n * file is copied.\n *\n * #### Notes\n * The server will select the name of the copied file.\n */\n async copy(path: string, toDir: string): Promise<IModel> {\n let name = PathExt.basename(path);\n toDir = toDir === '' ? '' : `${toDir.slice(1)}/`;\n // TODO: better handle naming collisions with existing files\n while (await this.get(`${toDir}${name}`, { content: true })) {\n const ext = PathExt.extname(name);\n const base = name.replace(ext, '');\n name = `${base} (copy)${ext}`;\n }\n const toPath = `${toDir}${name}`;\n let item = await this.get(path, { content: true });\n if (!item) {\n throw Error(`Could not find file with path ${path}`);\n }\n item = {\n ...item,\n name,\n path: toPath,\n };\n await (await this.storage).setItem(toPath, item);\n return item;\n }\n\n /**\n * Get a file or directory.\n *\n * @param path: The path to the file.\n * @param options: The options used to fetch the file.\n *\n * @returns A promise which resolves with the file content.\n */\n async get(\n path: string,\n options?: ServerContents.IFetchOptions,\n ): Promise<IModel | null> {\n // remove leading slash\n path = decodeURIComponent(path.replace(/^\\//, ''));\n\n if (path === '') {\n return await this._getFolder(path);\n }\n\n const storage = await this.storage;\n const item = await storage.getItem(path);\n const serverItem = await this._getServerContents(path, options);\n\n const model = (item || serverItem) as IModel | null;\n\n if (!model) {\n return null;\n }\n\n if (!options?.content) {\n return {\n size: 0,\n ...model,\n content: null,\n };\n }\n\n // for directories, find all files with the path as the prefix\n if (model.type === 'directory') {\n const contentMap = new Map<string, IModel>();\n await storage.iterate<IModel, void>((file, key) => {\n // use an additional slash to not include the directory itself\n if (key === `${path}/${file.name}`) {\n contentMap.set(file.name, file);\n }\n });\n\n const serverContents: IModel[] = serverItem\n ? serverItem.content\n : Array.from((await this._getServerDirectory(path)).values());\n for (const file of serverContents) {\n if (!contentMap.has(file.name)) {\n contentMap.set(file.name, file);\n }\n }\n\n const content = [...contentMap.values()];\n\n return {\n name: PathExt.basename(path),\n path,\n last_modified: model.last_modified,\n created: model.created,\n format: 'json',\n mimetype: MIME.JSON,\n content,\n size: 0,\n writable: true,\n type: 'directory',\n };\n }\n return model;\n }\n\n /**\n * Rename a file or directory.\n *\n * @param oldLocalPath - The original file path.\n * @param newLocalPath - The new file path.\n *\n * @returns A promise which resolves with the new file content model when the file is renamed.\n */\n async rename(oldLocalPath: string, newLocalPath: string): Promise<IModel> {\n const path = decodeURIComponent(oldLocalPath);\n const file = await this.get(path, { content: true });\n if (!file) {\n throw Error(`Could not find file with path ${path}`);\n }\n const modified = new Date().toISOString();\n const name = PathExt.basename(newLocalPath);\n const newFile = {\n ...file,\n name,\n path: newLocalPath,\n last_modified: modified,\n };\n const storage = await this.storage;\n await storage.setItem(newLocalPath, newFile);\n // remove the old file\n await storage.removeItem(path);\n // remove the corresponding checkpoint\n await (await this.checkpoints).removeItem(path);\n // if a directory, recurse through all children\n if (file.type === 'directory') {\n let child: IModel;\n for (child of file.content) {\n await this.rename(\n URLExt.join(oldLocalPath, child.name),\n URLExt.join(newLocalPath, child.name),\n );\n }\n }\n\n return newFile;\n }\n\n /**\n * Save a file.\n *\n * @param path - The desired file path.\n * @param options - Optional overrides to the model.\n *\n * @returns A promise which resolves with the file content model when the file is saved.\n */\n async save(path: string, options: Partial<IModel> = {}): Promise<IModel | null> {\n path = decodeURIComponent(path);\n\n // process the file if coming from an upload\n const ext = PathExt.extname(options.name ?? '');\n const chunk = options.chunk;\n\n // retrieve the content if it is a later chunk or the last one\n // the new content will then be appended to the existing one\n const chunked = chunk ? chunk > 1 || chunk === -1 : false;\n let item: IModel | null = await this.get(path, { content: chunked });\n\n if (!item) {\n item = await this.newUntitled({ path, ext, type: 'file' });\n }\n\n if (!item) {\n return null;\n }\n\n // keep a reference to the original content\n const originalContent = item.content;\n\n const modified = new Date().toISOString();\n // override with the new values\n item = {\n ...item,\n ...options,\n last_modified: modified,\n };\n\n if (options.content && options.format === 'base64') {\n const lastChunk = chunk ? chunk === -1 : true;\n\n if (ext === '.ipynb') {\n const content = this._handleChunk(options.content, originalContent, chunked);\n item = {\n ...item,\n content: lastChunk ? JSON.parse(content) : content,\n format: 'json',\n type: 'notebook',\n size: content.length,\n };\n } else if (FILE.hasFormat(ext, 'json')) {\n const content = this._handleChunk(options.content, originalContent, chunked);\n item = {\n ...item,\n content: lastChunk ? JSON.parse(content) : content,\n format: 'json',\n type: 'file',\n size: content.length,\n };\n } else if (FILE.hasFormat(ext, 'text')) {\n const content = this._handleChunk(options.content, originalContent, chunked);\n item = {\n ...item,\n content,\n format: 'text',\n type: 'file',\n size: content.length,\n };\n } else {\n const content = options.content;\n item = {\n ...item,\n content,\n size: atob(content).length,\n };\n }\n }\n\n await (await this.storage).setItem(path, item);\n return item;\n }\n\n /**\n * Delete a file from browser storage.\n *\n * Has no effect on server-backed files, which will re-appear with their\n * original timestamp.\n *\n * @param path - The path to the file.\n */\n async delete(path: string): Promise<void> {\n path = decodeURIComponent(path);\n const slashed = `${path}/`;\n const toDelete = (await (await this.storage).keys()).filter(\n (key) => key === path || key.startsWith(slashed),\n );\n await Promise.all(toDelete.map(this.forgetPath, this));\n }\n\n /**\n * Remove the localForage and checkpoints for a path.\n *\n * @param path - The path to the file\n */\n protected async forgetPath(path: string): Promise<void> {\n await Promise.all([\n (await this.storage).removeItem(path),\n (await this.checkpoints).removeItem(path),\n ]);\n }\n\n /**\n * Create a checkpoint for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with the new checkpoint model when the\n * checkpoint is created.\n */\n async createCheckpoint(path: string): Promise<ServerContents.ICheckpointModel> {\n const checkpoints = await this.checkpoints;\n path = decodeURIComponent(path);\n const item = await this.get(path, { content: true });\n if (!item) {\n throw Error(`Could not find file with path ${path}`);\n }\n const copies = (((await checkpoints.getItem(path)) as IModel[]) ?? []).filter(\n Boolean,\n );\n copies.push(item);\n // keep only a certain amount of checkpoints per file\n if (copies.length > N_CHECKPOINTS) {\n copies.splice(0, copies.length - N_CHECKPOINTS);\n }\n await checkpoints.setItem(path, copies);\n const id = `${copies.length - 1}`;\n return { id, last_modified: (item as IModel).last_modified };\n }\n\n /**\n * List available checkpoints for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with a list of checkpoint models for\n * the file.\n */\n async listCheckpoints(path: string): Promise<ServerContents.ICheckpointModel[]> {\n const copies: IModel[] = (await (await this.checkpoints).getItem(path)) || [];\n return copies.filter(Boolean).map(this.normalizeCheckpoint, this);\n }\n\n protected normalizeCheckpoint(\n model: IModel,\n id: number,\n ): ServerContents.ICheckpointModel {\n return { id: id.toString(), last_modified: model.last_modified };\n }\n\n /**\n * Restore a file to a known checkpoint state.\n *\n * @param path - The path of the file.\n * @param checkpointID - The id of the checkpoint to restore.\n *\n * @returns A promise which resolves when the checkpoint is restored.\n */\n async restoreCheckpoint(path: string, checkpointID: string): Promise<void> {\n path = decodeURIComponent(path);\n const copies = ((await (await this.checkpoints).getItem(path)) || []) as IModel[];\n const id = parseInt(checkpointID);\n const item = copies[id];\n await (await this.storage).setItem(path, item);\n }\n\n /**\n * Delete a checkpoint for a file.\n *\n * @param path - The path of the file.\n * @param checkpointID - The id of the checkpoint to delete.\n *\n * @returns A promise which resolves when the checkpoint is deleted.\n */\n async deleteCheckpoint(path: string, checkpointID: string): Promise<void> {\n path = decodeURIComponent(path);\n const copies = ((await (await this.checkpoints).getItem(path)) || []) as IModel[];\n const id = parseInt(checkpointID);\n copies.splice(id, 1);\n await (await this.checkpoints).setItem(path, copies);\n }\n\n /**\n * Handle a chunk of a file.\n * Decode and unescape a base64-encoded string.\n * @param content the content to process\n *\n * @returns the decoded string, appended to the original content if chunked\n * /\n */\n private _handleChunk(\n newContent: string,\n originalContent: string,\n chunked?: boolean,\n ): string {\n const escaped = decodeURIComponent(escape(atob(newContent)));\n const content = chunked ? originalContent + escaped : escaped;\n return content;\n }\n\n /**\n * retrieve the contents for this path from the union of local storage and\n * `api/contents/{path}/all.json`.\n *\n * @param path - The contents path to retrieve\n *\n * @returns A promise which resolves with a Map of contents, keyed by local file name\n */\n private async _getFolder(path: string): Promise<IModel | null> {\n const content = new Map<string, IModel>();\n const storage = await this.storage;\n await storage.iterate<IModel, void>((file, key) => {\n if (key.includes('/')) {\n return;\n }\n content.set(file.path, file);\n });\n\n // layer in contents that don't have local overwrites\n for (const file of (await this._getServerDirectory(path)).values()) {\n if (!content.has(file.path)) {\n content.set(file.path, file);\n }\n }\n\n if (path && content.size === 0) {\n return null;\n }\n\n return {\n name: '',\n path,\n last_modified: new Date(0).toISOString(),\n created: new Date(0).toISOString(),\n format: 'json',\n mimetype: MIME.JSON,\n content: Array.from(content.values()),\n size: 0,\n writable: true,\n type: 'directory',\n };\n }\n\n /**\n * Attempt to recover the model from `{:path}/__all__.json` file, fall back to\n * deriving the model (including content) off the file in `/files/`. Otherwise\n * return `null`.\n */\n private async _getServerContents(\n path: string,\n options?: ServerContents.IFetchOptions,\n ): Promise<IModel | null> {\n const name = PathExt.basename(path);\n const parentContents = await this._getServerDirectory(URLExt.join(path, '..'));\n let model = parentContents.get(name);\n if (!model) {\n return null;\n }\n model = model || {\n name,\n path,\n last_modified: new Date(0).toISOString(),\n created: new Date(0).toISOString(),\n format: 'text',\n mimetype: MIME.PLAIN_TEXT,\n type: 'file',\n writable: true,\n size: 0,\n content: '',\n };\n\n if (options?.content) {\n if (model.type === 'directory') {\n const serverContents = await this._getServerDirectory(path);\n model = { ...model, content: Array.from(serverContents.values()) };\n } else {\n const fileUrl = URLExt.join(PageConfig.getBaseUrl(), 'files', path);\n const response = await fetch(fileUrl);\n if (!response.ok) {\n return null;\n }\n const mimetype = model.mimetype || response.headers.get('Content-Type');\n const ext = PathExt.extname(name);\n\n if (\n model.type === 'notebook' ||\n FILE.hasFormat(ext, 'json') ||\n mimetype?.indexOf('json') !== -1 ||\n path.match(/\\.(ipynb|[^/]*json[^/]*)$/)\n ) {\n const contentText = await response.text();\n model = {\n ...model,\n content: JSON.parse(contentText),\n format: 'json',\n mimetype: model.mimetype || MIME.JSON,\n size: contentText.length,\n };\n } else if (FILE.hasFormat(ext, 'text') || mimetype.indexOf('text') !== -1) {\n const contentText = await response.text();\n model = {\n ...model,\n content: contentText,\n format: 'text',\n mimetype: mimetype || MIME.PLAIN_TEXT,\n size: contentText.length,\n };\n } else {\n const contentBytes = await response.arrayBuffer();\n const contentBuffer = new Uint8Array(contentBytes);\n model = {\n ...model,\n content: btoa(contentBuffer.reduce(this.reduceBytesToString, '')),\n format: 'base64',\n mimetype: mimetype || MIME.OCTET_STREAM,\n size: contentBuffer.length,\n };\n }\n }\n }\n\n return model;\n }\n\n /**\n * A reducer for turning arbitrary binary into a string\n */\n protected reduceBytesToString = (data: string, byte: number): string => {\n return data + String.fromCharCode(byte);\n };\n\n /**\n * retrieve the contents for this path from `__index__.json` in the appropriate\n * folder.\n *\n * @param newLocalPath - The new file path.\n *\n * @returns A promise which resolves with a Map of contents, keyed by local file name\n */\n private async _getServerDirectory(path: string): Promise<Map<string, IModel>> {\n const content = this._serverContents.get(path) || new Map();\n\n if (!this._serverContents.has(path)) {\n const apiURL = URLExt.join(\n PageConfig.getBaseUrl(),\n 'api/contents',\n path,\n 'all.json',\n );\n\n try {\n const response = await fetch(apiURL);\n const json = JSON.parse(await response.text());\n for (const file of json['content'] as IModel[]) {\n content.set(file.name, file);\n }\n } catch (err) {\n console.warn(\n `don't worry, about ${err}... nothing's broken. If there had been a\n file at ${apiURL}, you might see some more files.`,\n );\n }\n this._serverContents.set(path, content);\n }\n\n return content;\n }\n\n /**\n * Increment the counter for a given file type.\n * Used to avoid collisions when creating new untitled files.\n *\n * @param type The file type to increment the counter for.\n */\n private async _incrementCounter(type: ServerContents.ContentType): Promise<number> {\n const counters = await this.counters;\n const current = ((await counters.getItem(type)) as number) ?? -1;\n const counter = current + 1;\n await counters.setItem(type, counter);\n return counter;\n }\n\n private _serverContents = new Map<string, Map<string, IModel>>();\n private _storageName: string = DEFAULT_STORAGE_NAME;\n private _storageDrivers: string[] | null = null;\n private _ready: PromiseDelegate<void>;\n private _storage: LocalForage | undefined;\n private _counters: LocalForage | undefined;\n private _checkpoints: LocalForage | undefined;\n private _localforage: typeof localforage;\n}\n\n/**\n * A namespace for contents information.\n */\nexport namespace Contents {\n export interface IOptions {\n /**\n * The name of the storage instance on e.g. IndexedDB, localStorage\n */\n storageName?: string | null;\n storageDrivers?: string[] | null;\n localforage: typeof localforage;\n }\n}\n\n/**\n * A namespace for private data.\n */\nnamespace Private {\n /**\n * The content for an empty notebook.\n */\n export const EMPTY_NB: INotebookContent = {\n metadata: {\n orig_nbformat: 4,\n },\n nbformat_minor: 4,\n nbformat: 4,\n cells: [],\n };\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n// Types and implementation inspired from https://github.com/jvilk/BrowserFS\n// LICENSE: https://github.com/jvilk/BrowserFS/blob/8977a704ea469d05daf857e4818bef1f4f498326/LICENSE\n// And from https://github.com/gzuidhof/starboard-notebook\n\n// LICENSE: https://github.com/gzuidhof/starboard-notebook/blob/cd8d3fc30af4bd29cdd8f6b8c207df8138f5d5dd/LICENSE\n\n/**\n * Types for Emscripten primitives.\n *\n * Ideally, much more of these would be taken from `@types/emscripten`.\n */\n\n// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// <reference path=\"../../../node_modules/@types/emscripten/index.d.ts\" />\ntype EmscriptenFS = typeof FS;\n\nexport const DIR_MODE = 16895; // 040777\nexport const FILE_MODE = 33206; // 100666\nexport const SEEK_CUR = 1;\nexport const SEEK_END = 2;\n\nexport interface IStats {\n dev: number;\n ino?: number;\n mode?: number;\n nlink: number;\n uid: number;\n gid: number;\n rdev: number;\n size: number;\n blksize: number;\n blocks: number;\n atime: Date | string;\n mtime: Date | string;\n ctime: Date | string;\n timestamp?: number;\n}\n\nexport interface IEmscriptenFSNode {\n id: number;\n name: string;\n mode: number;\n parent: IEmscriptenFSNode;\n mount: { opts: { root: string } };\n stream_ops: IEmscriptenStreamOps;\n node_ops: IEmscriptenNodeOps;\n timestamp: number;\n}\n\nexport interface IEmscriptenStream {\n node: IEmscriptenFSNode;\n nfd: any;\n flags: string;\n position: number;\n}\n\nexport function instanceOfStream(\n nodeOrStream: IEmscriptenFSNode | IEmscriptenStream,\n): nodeOrStream is IEmscriptenStream {\n return 'node' in nodeOrStream;\n}\n\nexport interface IEmscriptenNodeOps {\n getattr(node: IEmscriptenFSNode | IEmscriptenStream): IStats;\n setattr(node: IEmscriptenFSNode | IEmscriptenStream, attr: IStats): void;\n lookup(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n name: string,\n ): IEmscriptenFSNode;\n mknod(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n name: string,\n mode: number,\n dev: number,\n ): IEmscriptenFSNode;\n rename(\n oldNode: IEmscriptenFSNode | IEmscriptenStream,\n newDir: IEmscriptenFSNode | IEmscriptenStream,\n newName: string,\n ): void;\n unlink(parent: IEmscriptenFSNode | IEmscriptenStream, name: string): void;\n rmdir(parent: IEmscriptenFSNode | IEmscriptenStream, name: string): void;\n readdir(node: IEmscriptenFSNode | IEmscriptenStream): string[];\n symlink(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n newName: string,\n oldPath: string,\n ): void;\n readlink(node: IEmscriptenFSNode | IEmscriptenStream): string;\n}\n\nexport interface IEmscriptenStreamOps {\n open(stream: IEmscriptenStream): void;\n close(stream: IEmscriptenStream): void;\n read(\n stream: IEmscriptenStream,\n buffer: Uint8Array,\n offset: number,\n length: number,\n position: number,\n ): number;\n write(\n stream: IEmscriptenStream,\n buffer: Uint8Array,\n offset: number,\n length: number,\n position: number,\n ): number;\n llseek(stream: IEmscriptenStream, offset: number, whence: number): number;\n}\n\n/**\n * The emscripten filesystem module API.\n */\nexport type FS = EmscriptenFS & {\n ErrnoError: any;\n createNode: (\n parent: IEmscriptenFSNode | null,\n name: string,\n mode: number,\n dev: number,\n ) => IEmscriptenFSNode;\n};\n\n/**\n * The emscripten filesystem error codes.\n */\nexport type ERRNO_CODES = any;\n\n/**\n * The emscripten FS Path API.\n */\nexport type PATH = {\n basename: (path: string) => string;\n dirname: (path: string) => string;\n join: (...parts: string[]) => string;\n join2: (l: string, r: string) => string;\n normalize: (path: string) => string;\n splitPath: (filename: string) => string;\n};\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n// Types and implementation inspired from https://github.com/jvilk/BrowserFS\n// LICENSE: https://github.com/jvilk/BrowserFS/blob/8977a704ea469d05daf857e4818bef1f4f498326/LICENSE\n// And from https://github.com/gzuidhof/starboard-notebook\n\n// LICENSE: https://github.com/gzuidhof/starboard-notebook/blob/cd8d3fc30af4bd29cdd8f6b8c207df8138f5d5dd/LICENSE\nimport { Contents } from '@jupyterlab/services';\n\nimport {\n FS,\n ERRNO_CODES,\n PATH,\n DIR_MODE,\n SEEK_CUR,\n SEEK_END,\n IEmscriptenStream,\n instanceOfStream,\n IEmscriptenStreamOps,\n IEmscriptenNodeOps,\n IEmscriptenFSNode,\n IStats,\n} from './emscripten';\n\nexport const DRIVE_SEPARATOR = ':';\nexport const DRIVE_API_PATH = '/api/drive.v1';\n\nexport const BLOCK_SIZE = 4096;\n\nconst encoder = new TextEncoder();\nconst decoder = new TextDecoder('utf-8');\n\nexport type TDriveMethod =\n | 'readdir'\n | 'rmdir'\n | 'rename'\n | 'getmode'\n | 'lookup'\n | 'mknod'\n | 'getattr'\n | 'get'\n | 'put';\n\n/**\n * Type of the data argument for the drive request, based on the request name\n */\nexport type TDriveData = {\n rename: {\n /**\n * The new path for the file\n */\n newPath: string;\n };\n mknod: {\n /**\n * The mode of the file to create\n */\n mode: number;\n };\n put: {\n /**\n * The file content to write\n */\n data: any;\n\n /**\n * The file content format\n */\n format: Contents.FileFormat;\n };\n};\n\n/**\n * Drive request\n */\nexport type TDriveRequest<T extends TDriveMethod> = {\n /**\n * The method of the request (rmdir, readdir etc)\n */\n method: T;\n\n /**\n * The expected receiver of the request\n */\n receiver?: 'broadcast.ts';\n\n /**\n * The path to the file/directory for which the request was sent\n */\n path: string;\n} & (T extends keyof TDriveData ? { data: TDriveData[T] } : object);\n\ntype TDriveResponses = {\n readdir: string[];\n rmdir: void;\n rename: void;\n getmode: number;\n lookup: DriveFS.ILookup;\n mknod: void;\n getattr: IStats;\n get:\n | {\n /**\n * The returned file content\n */\n content: any;\n\n /**\n * The content format\n */\n format: Contents.FileFormat;\n }\n | undefined;\n put: void;\n};\n\n/**\n * Drive response\n */\nexport type TDriveResponse<T extends TDriveMethod> = TDriveResponses[T];\n\n// Mapping flag -> do we need to overwrite the file upon closing it\nconst flagNeedsWrite: { [flag: number]: boolean } = {\n 0 /*O_RDONLY*/: false,\n 1 /*O_WRONLY*/: true,\n 2 /*O_RDWR*/: true,\n 64 /*O_CREAT*/: true,\n 65 /*O_WRONLY|O_CREAT*/: true,\n 66 /*O_RDWR|O_CREAT*/: true,\n 129 /*O_WRONLY|O_EXCL*/: true,\n 193 /*O_WRONLY|O_CREAT|O_EXCL*/: true,\n 514 /*O_RDWR|O_TRUNC*/: true,\n 577 /*O_WRONLY|O_CREAT|O_TRUNC*/: true,\n 578 /*O_CREAT|O_RDWR|O_TRUNC*/: true,\n 705 /*O_WRONLY|O_CREAT|O_EXCL|O_TRUNC*/: true,\n 706 /*O_RDWR|O_CREAT|O_EXCL|O_TRUNC*/: true,\n 1024 /*O_APPEND*/: true,\n 1025 /*O_WRONLY|O_APPEND*/: true,\n 1026 /*O_RDWR|O_APPEND*/: true,\n 1089 /*O_WRONLY|O_CREAT|O_APPEND*/: true,\n 1090 /*O_RDWR|O_CREAT|O_APPEND*/: true,\n 1153 /*O_WRONLY|O_EXCL|O_APPEND*/: true,\n 1154 /*O_RDWR|O_EXCL|O_APPEND*/: true,\n 1217 /*O_WRONLY|O_CREAT|O_EXCL|O_APPEND*/: true,\n 1218 /*O_RDWR|O_CREAT|O_EXCL|O_APPEND*/: true,\n 4096 /*O_RDONLY|O_DSYNC*/: true,\n 4098 /*O_RDWR|O_DSYNC*/: true,\n};\n\n/** Implementation-specifc extension of an open stream, adding the file. */\nexport interface IDriveStream extends IEmscriptenStream {\n file?: DriveFS.IFile;\n}\n\nexport class DriveFSEmscriptenStreamOps implements IEmscriptenStreamOps {\n private fs: DriveFS;\n\n constructor(fs: DriveFS) {\n this.fs = fs;\n }\n\n open(stream: IDriveStream): void {\n const path = this.fs.realPath(stream.node);\n if (this.fs.FS.isFile(stream.node.mode)) {\n stream.file = this.fs.API.get(path);\n }\n }\n\n close(stream: IDriveStream): void {\n if (!this.fs.FS.isFile(stream.node.mode) || !stream.file) {\n return;\n }\n\n const path = this.fs.realPath(stream.node);\n\n const flags = stream.flags;\n let parsedFlags = typeof flags === 'string' ? parseInt(flags, 10) : flags;\n parsedFlags &= 0x1fff;\n\n let needsWrite = true;\n if (parsedFlags in flagNeedsWrite) {\n needsWrite = flagNeedsWrite[parsedFlags];\n }\n\n if (needsWrite) {\n this.fs.API.put(path, stream.file);\n }\n\n stream.file = undefined;\n }\n\n read(\n stream: IDriveStream,\n buffer: Uint8Array,\n offset: number,\n length: number,\n position: number,\n ): number {\n if (\n length <= 0 ||\n stream.file === undefined ||\n position >= (stream.file.data.length || 0)\n ) {\n return 0;\n }\n\n const size = Math.min(stream.file.data.length - position, length);\n buffer.set(stream.file.data.subarray(position, position + size), offset);\n return size;\n }\n\n write(\n stream: IDriveStream,\n buffer: Uint8Array,\n offset: number,\n length: number,\n position: number,\n ): number {\n if (length <= 0 || stream.file === undefined) {\n return 0;\n }\n\n stream.node.timestamp = Date.now();\n\n if (position + length > (stream.file?.data.length || 0)) {\n const oldData = stream.file.data ? stream.file.data : new Uint8Array();\n stream.file.data = new Uint8Array(position + length);\n stream.file.data.set(oldData);\n }\n\n stream.file.data.set(buffer.subarray(offset, offset + length), position);\n\n return length;\n }\n\n llseek(stream: IDriveStream, offset: number, whence: number): number {\n let position = offset;\n if (whence === SEEK_CUR) {\n position += stream.position;\n } else if (whence === SEEK_END) {\n if (this.fs.FS.isFile(stream.node.mode)) {\n if (stream.file !== undefined) {\n position += stream.file.data.length;\n } else {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM);\n }\n }\n }\n\n if (position < 0) {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EINVAL);\n }\n\n return position;\n }\n}\n\nexport class DriveFSEmscriptenNodeOps implements IEmscriptenNodeOps {\n private fs: DriveFS;\n\n constructor(fs: DriveFS) {\n this.fs = fs;\n }\n\n protected node(\n nodeOrStream: IEmscriptenFSNode | IEmscriptenStream,\n ): IEmscriptenFSNode {\n if (instanceOfStream(nodeOrStream)) {\n return nodeOrStream.node;\n }\n return nodeOrStream;\n }\n\n getattr(value: IEmscriptenFSNode | IEmscriptenStream): IStats {\n const node = this.node(value);\n return {\n ...this.fs.API.getattr(this.fs.realPath(node)),\n mode: node.mode,\n ino: node.id,\n };\n }\n\n setattr(value: IEmscriptenFSNode | IEmscriptenStream, attr: IStats): void {\n const node = this.node(value);\n for (const [key, value] of Object.entries(attr)) {\n switch (key) {\n case 'mode':\n node.mode = value;\n break;\n case 'timestamp':\n node.timestamp = value;\n break;\n default:\n console.warn('setattr', key, 'of', value, 'on', node, 'not yet implemented');\n break;\n }\n }\n }\n\n lookup(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n name: string,\n ): IEmscriptenFSNode {\n const node = this.node(parent);\n const path = this.fs.PATH.join2(this.fs.realPath(node), name);\n const result = this.fs.API.lookup(path);\n if (!result.ok) {\n throw this.fs.FS.genericErrors[this.fs.ERRNO_CODES['ENOENT']];\n }\n return this.fs.createNode(node, name, result.mode!, 0);\n }\n\n mknod(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n name: string,\n mode: number,\n dev: number,\n ): IEmscriptenFSNode {\n const node = this.node(parent);\n const path = this.fs.PATH.join2(this.fs.realPath(node), name);\n this.fs.API.mknod(path, mode);\n return this.fs.createNode(node, name, mode, dev);\n }\n\n rename(\n value: IEmscriptenFSNode | IEmscriptenStream,\n newDir: IEmscriptenFSNode | IEmscriptenStream,\n newName: string,\n ): void {\n const oldNode = this.node(value);\n const newDirNode = this.node(newDir);\n this.fs.API.rename(\n oldNode.parent\n ? this.fs.PATH.join2(this.fs.realPath(oldNode.parent), oldNode.name)\n : oldNode.name,\n this.fs.PATH.join2(this.fs.realPath(newDirNode), newName),\n );\n\n // Updating the in-memory node\n oldNode.name = newName;\n oldNode.parent = newDirNode;\n }\n\n unlink(parent: IEmscriptenFSNode | IEmscriptenStream, name: string): void {\n this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(this.node(parent)), name));\n }\n\n rmdir(parent: IEmscriptenFSNode | IEmscriptenStream, name: string) {\n this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(this.node(parent)), name));\n }\n\n readdir(value: IEmscriptenFSNode | IEmscriptenStream): string[] {\n return this.fs.API.readdir(this.fs.realPath(this.node(value)));\n }\n\n symlink(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n newName: string,\n oldPath: string,\n ): void {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES['EPERM']);\n }\n\n readlink(node: IEmscriptenFSNode | IEmscriptenStream): string {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES['EPERM']);\n }\n}\n\n/**\n * ContentsAPI base class\n */\nexport abstract class ContentsAPI {\n constructor(driveName: string, mountpoint: string, FS: FS, ERRNO_CODES: ERRNO_CODES) {\n this._driveName = driveName;\n this._mountpoint = mountpoint;\n\n this.FS = FS;\n this.ERRNO_CODES = ERRNO_CODES;\n }\n\n lookup(path: string): DriveFS.ILookup {\n return this.request({ method: 'lookup', path: this.normalizePath(path) });\n }\n\n getmode(path: string): number {\n return this.request({ method: 'getmode', path: this.normalizePath(path) });\n }\n\n mknod(path: string, mode: number) {\n return this.request({\n method: 'mknod',\n path: this.normalizePath(path),\n data: { mode },\n });\n }\n\n rename(oldPath: string, newPath: string): void {\n return this.request({\n method: 'rename',\n path: this.normalizePath(oldPath),\n data: { newPath: this.normalizePath(newPath) },\n });\n }\n\n readdir(path: string): string[] {\n const dirlist = this.request({\n method: 'readdir',\n path: this.normalizePath(path),\n });\n dirlist.push('.');\n dirlist.push('..');\n return dirlist;\n }\n\n rmdir(path: string): void {\n return this.request({ method: 'rmdir', path: this.normalizePath(path) });\n }\n\n get(path: string): DriveFS.IFile {\n const response = this.request({\n method: 'get',\n path: this.normalizePath(path),\n });\n\n if (!response) {\n throw new this.FS.ErrnoError(this.ERRNO_CODES['ENOENT']);\n }\n\n const serializedContent = response.content;\n const format: 'json' | 'text' | 'base64' | null = response.format;\n\n switch (format) {\n case 'json':\n case 'text':\n return {\n data: encoder.encode(serializedContent),\n format,\n };\n case 'base64': {\n const binString = atob(serializedContent);\n const len = binString.length;\n const data = new Uint8Array(len);\n for (let i = 0; i < len; i++) {\n data[i] = binString.charCodeAt(i);\n }\n return {\n data,\n format,\n };\n }\n default:\n throw new this.FS.ErrnoError(this.ERRNO_CODES['ENOENT']);\n }\n }\n\n put(path: string, value: DriveFS.IFile) {\n switch (value.format) {\n case 'json':\n case 'text':\n return this.request({\n method: 'put',\n path: this.normalizePath(path),\n data: {\n format: value.format,\n data: decoder.decode(value.data),\n },\n });\n case 'base64': {\n let binary = '';\n for (let i = 0; i < value.data.byteLength; i++) {\n binary += String.fromCharCode(value.data[i]);\n }\n return this.request({\n method: 'put',\n path: this.normalizePath(path),\n data: {\n format: value.format,\n data: btoa(binary),\n },\n });\n }\n }\n }\n\n getattr(path: string): IStats {\n const stats = this.request({\n method: 'getattr',\n path: this.normalizePath(path),\n });\n // Turn datetimes into proper objects\n if (stats.atime) {\n stats.atime = new Date(stats.atime);\n }\n if (stats.mtime) {\n stats.mtime = new Date(stats.mtime);\n }\n if (stats.ctime) {\n stats.ctime = new Date(stats.ctime);\n }\n // ensure a non-undefined size (0 isn't great, though)\n stats.size = stats.size || 0;\n return stats;\n }\n\n /**\n * Normalize a Path by making it compliant for the content manager\n *\n * @param path: the path relatively to the Emscripten drive\n */\n normalizePath(path: string): string {\n // Remove mountpoint prefix\n if (path.startsWith(this._mountpoint)) {\n path = path.slice(this._mountpoint.length);\n }\n\n // Add JupyterLab drive name\n if (this._driveName) {\n path = `${this._driveName}${DRIVE_SEPARATOR}${path}`;\n }\n\n return path;\n }\n\n abstract request<T extends TDriveMethod>(data: TDriveRequest<T>): TDriveResponse<T>;\n\n private _driveName: string;\n private _mountpoint: string;\n\n protected FS: FS;\n protected ERRNO_CODES: ERRNO_CODES;\n}\n\n/**\n * An Emscripten-compatible synchronous Contents API using the service worker.\n */\nexport class ServiceWorkerContentsAPI extends ContentsAPI {\n constructor(\n baseUrl: string,\n driveName: string,\n mountpoint: string,\n FS: FS,\n ERRNO_CODES: ERRNO_CODES,\n ) {\n super(driveName, mountpoint, FS, ERRNO_CODES);\n\n this._baseUrl = baseUrl;\n }\n\n request<T extends TDriveMethod>(data: TDriveRequest<T>): TDriveResponse<T> {\n const xhr = new XMLHttpRequest();\n xhr.open('POST', encodeURI(this.endpoint), false);\n\n try {\n xhr.send(JSON.stringify(data));\n } catch (e) {\n console.error(e);\n }\n\n if (xhr.status >= 400) {\n throw new this.FS.ErrnoError(this.ERRNO_CODES['EINVAL']);\n }\n\n return JSON.parse(xhr.responseText);\n }\n\n /**\n * Get the api/drive endpoint\n */\n get endpoint(): string {\n return `${this._baseUrl}api/drive`;\n }\n\n private _baseUrl: string;\n}\n\nexport class DriveFS {\n FS: FS;\n API: ContentsAPI;\n PATH: PATH;\n ERRNO_CODES: ERRNO_CODES;\n driveName: string;\n\n constructor(options: DriveFS.IOptions) {\n this.FS = options.FS;\n this.PATH = options.PATH;\n this.ERRNO_CODES = options.ERRNO_CODES;\n this.API = this.createAPI(options);\n\n this.driveName = options.driveName;\n\n this.node_ops = new DriveFSEmscriptenNodeOps(this);\n this.stream_ops = new DriveFSEmscriptenStreamOps(this);\n }\n\n node_ops: IEmscriptenNodeOps;\n stream_ops: IEmscriptenStreamOps;\n\n /**\n * Create the ContentsAPI.\n *\n * This is supposed to be overwritten if needed.\n */\n createAPI(options: DriveFS.IOptions): ContentsAPI {\n return new ServiceWorkerContentsAPI(\n options.baseUrl,\n options.driveName,\n options.mountpoint,\n options.FS,\n options.ERRNO_CODES,\n );\n }\n\n mount(mount: any): IEmscriptenFSNode {\n return this.createNode(null, mount.mountpoint, DIR_MODE | 511, 0);\n }\n\n createNode(\n parent: IEmscriptenFSNode | null,\n name: string,\n mode: number,\n dev: number,\n ): IEmscriptenFSNode {\n const FS = this.FS;\n if (!FS.isDir(mode) && !FS.isFile(mode)) {\n throw new FS.ErrnoError(this.ERRNO_CODES['EINVAL']);\n }\n const node = FS.createNode(parent, name, mode, dev);\n node.node_ops = this.node_ops;\n node.stream_ops = this.stream_ops;\n return node;\n }\n\n getMode(path: string): number {\n return this.API.getmode(path);\n }\n\n realPath(node: IEmscriptenFSNode): string {\n const parts: string[] = [];\n let currentNode: IEmscriptenFSNode = node;\n\n parts.push(currentNode.name);\n while (currentNode.parent !== currentNode) {\n currentNode = currentNode.parent;\n parts.push(currentNode.name);\n }\n parts.reverse();\n\n return this.PATH.join.apply(null, parts);\n }\n}\n\n/**\n * A namespace for DriveFS configurations, etc.\n */\nexport namespace DriveFS {\n /**\n * A file representation;\n */\n export interface IFile {\n data: Uint8Array;\n format: 'json' | 'text' | 'base64';\n }\n\n /**\n * The response to a lookup request;\n */\n export interface ILookup {\n ok: boolean;\n mode?: number;\n }\n\n /**\n * Initialization options for a drive;\n */\n export interface IOptions {\n FS: FS;\n PATH: PATH;\n ERRNO_CODES: ERRNO_CODES;\n baseUrl: string;\n driveName: string;\n mountpoint: string;\n }\n}\n", "import { PathExt } from '@jupyterlab/coreutils';\nimport { Contents } from '@jupyterlab/services';\nimport { BLOCK_SIZE, TDriveMethod, TDriveRequest, TDriveResponse } from './drivefs';\nimport { DIR_MODE, FILE_MODE } from './emscripten';\n\nexport interface IDriveContentsProcessor {\n /**\n * Process a content request\n *\n * @param request the request\n */\n processDriveRequest<T extends TDriveMethod>(\n request: TDriveRequest<T>,\n ): Promise<TDriveResponse<T>>;\n\n /**\n * Process the request to read a directory content\n *\n * @param request the request\n */\n readdir(request: TDriveRequest<'readdir'>): Promise<TDriveResponse<'readdir'>>;\n\n /**\n * Process the request to remove a directory\n *\n * @param request the request\n */\n rmdir(request: TDriveRequest<'rmdir'>): Promise<TDriveResponse<'rmdir'>>;\n\n /**\n * Process the request to rename a file or directory\n *\n * @param request the request\n */\n rename(request: TDriveRequest<'rename'>): Promise<TDriveResponse<'rename'>>;\n\n /**\n * Process the request to get the node mode (file or directory)\n *\n * @param request the request\n */\n getmode(request: TDriveRequest<'getmode'>): Promise<TDriveResponse<'getmode'>>;\n\n /**\n * Process the request to check if a node exist\n *\n * @param request the request\n */\n lookup(request: TDriveRequest<'lookup'>): Promise<TDriveResponse<'lookup'>>;\n\n /**\n * Process the request to create a directory/file\n *\n * @param request the request\n */\n mknod(request: TDriveRequest<'mknod'>): Promise<TDriveResponse<'mknod'>>;\n\n /**\n * Process the request to get a node stats\n *\n * @param request the request\n */\n getattr(request: TDriveRequest<'getattr'>): Promise<TDriveResponse<'getattr'>>;\n\n /**\n * Process the request to get the content of a file\n *\n * @param request the request\n */\n get(request: TDriveRequest<'get'>): Promise<TDriveResponse<'get'>>;\n\n /**\n * Process the request to write the content of a file\n *\n * @param request the request\n */\n put(request: TDriveRequest<'put'>): Promise<TDriveResponse<'put'>>;\n}\n\n/**\n * Class for processing a drive request from the DriveFS.\n */\nexport class DriveContentsProcessor implements IDriveContentsProcessor {\n private contentsManager: Contents.IManager;\n\n constructor(options: DriveContentsProcessor.IOptions) {\n this.contentsManager = options.contentsManager;\n }\n\n async processDriveRequest<T extends TDriveMethod>(\n request: TDriveRequest<T>,\n ): Promise<TDriveResponse<T>> {\n switch (request.method) {\n case 'readdir':\n return this.readdir(request as TDriveRequest<'readdir'>) as Promise<\n TDriveResponse<T>\n >;\n case 'rmdir':\n return this.rmdir(request as TDriveRequest<'rmdir'>) as Promise<\n TDriveResponse<T>\n >;\n case 'rename':\n return this.rename(request as TDriveRequest<'rename'>) as Promise<\n TDriveResponse<T>\n >;\n case 'getmode':\n return this.getmode(request as TDriveRequest<'getmode'>) as Promise<\n TDriveResponse<T>\n >;\n case 'lookup':\n return this.lookup(request as TDriveRequest<'lookup'>) as Promise<\n TDriveResponse<T>\n >;\n case 'mknod':\n return this.mknod(request as TDriveRequest<'mknod'>) as Promise<\n TDriveResponse<T>\n >;\n case 'getattr':\n return this.getattr(request as TDriveRequest<'getattr'>) as Promise<\n TDriveResponse<T>\n >;\n case 'get':\n return this.get(request as TDriveRequest<'get'>) as Promise<TDriveResponse<T>>;\n case 'put':\n return this.put(request as TDriveRequest<'put'>) as Promise<TDriveResponse<T>>;\n }\n\n throw `Drive request ${request.method} does not exist.`;\n }\n\n async readdir(request: TDriveRequest<'readdir'>): Promise<TDriveResponse<'readdir'>> {\n const model = await this.contentsManager.get(request.path, { content: true });\n let response: string[] = [];\n if (model.type === 'directory' && model.content) {\n response = model.content.map((subcontent: Contents.IModel) => subcontent.name);\n }\n return response;\n }\n\n async rmdir(request: TDriveRequest<'rmdir'>): Promise<TDriveResponse<'rmdir'>> {\n await this.contentsManager.delete(request.path);\n }\n\n async rename(request: TDriveRequest<'rename'>): Promise<TDriveResponse<'rename'>> {\n await this.contentsManager.rename(request.path, request.data.newPath);\n }\n\n async getmode(request: TDriveRequest<'getmode'>): Promise<TDriveResponse<'getmode'>> {\n const model = await this.contentsManager.get(request.path);\n let response: number;\n if (model.type === 'directory') {\n response = DIR_MODE;\n } else {\n response = FILE_MODE;\n }\n return response;\n }\n\n async lookup(request: TDriveRequest<'lookup'>): Promise<TDriveResponse<'lookup'>> {\n let response: TDriveResponse<'lookup'>;\n\n try {\n const model = await this.contentsManager.get(request.path);\n response = {\n ok: true,\n mode: model.type === 'directory' ? DIR_MODE : FILE_MODE,\n };\n } catch (e) {\n response = { ok: false };\n }\n\n return response;\n }\n\n async mknod(request: TDriveRequest<'mknod'>): Promise<TDriveResponse<'mknod'>> {\n const model = await this.contentsManager.newUntitled({\n path: PathExt.dirname(request.path),\n type: request.data.mode === DIR_MODE ? 'directory' : 'file',\n ext: PathExt.extname(request.path),\n });\n await this.contentsManager.rename(model.path, request.path);\n }\n\n async getattr(request: TDriveRequest<'getattr'>): Promise<TDriveResponse<'getattr'>> {\n const model = await this.contentsManager.get(request.path);\n // create a default date for drives that send incomplete information\n // for nested foldes and files\n const defaultDate = new Date(0).toISOString();\n\n return {\n dev: 1,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n size: model.size || 0,\n blksize: BLOCK_SIZE,\n blocks: Math.ceil(model.size || 0 / BLOCK_SIZE),\n atime: model.last_modified || defaultDate, // TODO Get the proper atime?\n mtime: model.last_modified || defaultDate,\n ctime: model.created || defaultDate,\n timestamp: 0,\n };\n }\n\n async get(request: TDriveRequest<'get'>): Promise<TDriveResponse<'get'>> {\n const model = await this.contentsManager.get(request.path, { content: true });\n\n let response;\n\n if (model.type !== 'directory') {\n response = {\n content:\n model.format === 'json' ? JSON.stringify(model.content) : model.content,\n format: model.format,\n };\n }\n\n return response;\n }\n\n async put(request: TDriveRequest<'put'>): Promise<TDriveResponse<'put'>> {\n await this.contentsManager.save(request.path, {\n content:\n request.data.format === 'json'\n ? JSON.parse(request.data.data)\n : request.data.data,\n type: 'file',\n format: request.data.format as Contents.FileFormat,\n });\n }\n}\n\n/**\n * A namespace for DriveContentsProcessor configurations, etc.\n */\nexport namespace DriveContentsProcessor {\n /**\n * Initialization options for a drive;\n */\n export interface IOptions {\n contentsManager: Contents.IManager;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { Contents as ServerContents } from '@jupyterlab/services';\n\nimport { TDriveRequest, DRIVE_API_PATH, TDriveMethod } from './drivefs';\n\nimport { IBroadcastChannelWrapper } from './tokens';\nimport { IDriveContentsProcessor, DriveContentsProcessor } from './drivecontents';\n\n/** A broadcaster for the ServiceWorker */\nexport class BroadcastChannelWrapper implements IBroadcastChannelWrapper {\n public isDisposed = false;\n\n constructor(options: BroadcastChannelWrapper.IOptions) {\n this._contents = options.contents;\n this._driveContentsProcessor = new DriveContentsProcessor({\n contentsManager: this._contents,\n });\n }\n\n get enabled() {\n return this._enabled;\n }\n\n enable() {\n if (this._channel) {\n console.warn('BroadcastChannel already created and enabled');\n return;\n }\n this._channel = new BroadcastChannel(DRIVE_API_PATH);\n this._channel.addEventListener('message', this._onMessage);\n this._enabled = true;\n }\n\n disable() {\n if (this._channel) {\n this._channel.removeEventListener('message', this._onMessage);\n this._channel = null;\n }\n this._enabled = false;\n }\n\n /** Clean up the broadcaster. */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this.disable();\n this.isDisposed = true;\n }\n\n /** Handle a message received on the BroadcastChannel */\n protected _onMessage = async <T extends TDriveMethod>(\n event: MessageEvent<TDriveRequest<T>>,\n ): Promise<void> => {\n if (!this._channel) {\n return;\n }\n\n const request = event.data;\n const receiver = request?.receiver;\n if (receiver !== 'broadcast.ts') {\n // Message is not meant for us\n return;\n }\n\n const response = await this._driveContentsProcessor.processDriveRequest(request);\n\n this._channel.postMessage(response);\n };\n\n protected _channel: BroadcastChannel | null = null;\n protected _contents: ServerContents.IManager;\n protected _driveContentsProcessor: IDriveContentsProcessor;\n protected _enabled = false;\n}\n\n/** A namespace for */\nexport namespace BroadcastChannelWrapper {\n export interface IOptions {\n contents: ServerContents.IManager;\n }\n export type TBroadcastResponse = any;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nexport * from './contents';\nexport * from './drivefs';\nexport * from './tokens';\nexport * from './broadcast';\nexport * from './emscripten';\nexport * from './drivecontents';\n", "export const ARRAY = 'array';\nexport const BIGINT = 'bigint';\nexport const BOOLEAN = 'boolean';\nexport const FUNCTION = 'function';\nexport const NULL = 'null';\nexport const NUMBER = 'number';\nexport const OBJECT = 'object';\nexport const STRING = 'string';\nexport const SYMBOL = 'symbol';\nexport const UNDEFINED = 'undefined';\n", "// \u26A0\uFE0F AUTOMATICALLY GENERATED - DO NOT CHANGE\nexport const CHANNEL = '64e10b34-2bf7-4616-9668-f99de5aa046e';\n\nexport const MAIN = 'M' + CHANNEL;\nexport const THREAD = 'T' + CHANNEL;\n", "export const APPLY = 'apply';\nexport const CONSTRUCT = 'construct';\nexport const DEFINE_PROPERTY = 'defineProperty';\nexport const DELETE_PROPERTY = 'deleteProperty';\nexport const GET = 'get';\nexport const GET_OWN_PROPERTY_DESCRIPTOR = 'getOwnPropertyDescriptor';\nexport const GET_PROTOTYPE_OF = 'getPrototypeOf';\nexport const HAS = 'has';\nexport const IS_EXTENSIBLE = 'isExtensible';\nexport const OWN_KEYS = 'ownKeys';\nexport const PREVENT_EXTENSION = 'preventExtensions';\nexport const SET = 'set';\nexport const SET_PROTOTYPE_OF = 'setPrototypeOf';\n", "// The goal of this file is to normalize SAB\n// at least in main -> worker() use cases.\n// This still cannot possibly solve the sync\n// worker -> main() use case if SharedArrayBuffer\n// is not available or usable.\n\nimport {CHANNEL} from './channel.js';\n\nconst {isArray} = Array;\n\nlet {SharedArrayBuffer, window} = globalThis;\nlet {notify, wait, waitAsync} = Atomics;\nlet postPatched = null;\n\n// This is needed for some version of Firefox\nif (!waitAsync) {\n waitAsync = buffer => ({\n value: new Promise(onmessage => {\n // encodeURIComponent('onmessage=({data:b})=>(Atomics.wait(b,0),postMessage(0))')\n let w = new Worker('data:application/javascript,onmessage%3D(%7Bdata%3Ab%7D)%3D%3E(Atomics.wait(b%2C0)%2CpostMessage(0))');\n w.onmessage = onmessage;\n w.postMessage(buffer);\n })\n });\n}\n\n// Monkey-patch SharedArrayBuffer if needed\ntry {\n new SharedArrayBuffer(4);\n}\ncatch (_) {\n SharedArrayBuffer = ArrayBuffer;\n\n const ids = new WeakMap;\n // patch only main -> worker():async use case\n if (window) {\n const resolvers = new Map;\n const {prototype: {postMessage}} = Worker;\n\n const listener = event => {\n const details = event.data?.[CHANNEL];\n if (!isArray(details)) {\n event.stopImmediatePropagation();\n const { id, sb } = details;\n resolvers.get(id)(sb);\n }\n };\n\n postPatched = function (data, ...rest) {\n const details = data?.[CHANNEL];\n if (isArray(details)) {\n const [id, sb] = details;\n ids.set(sb, id);\n this.addEventListener('message', listener);\n }\n return postMessage.call(this, data, ...rest);\n };\n\n waitAsync = sb => ({\n value: new Promise(resolve => {\n resolvers.set(ids.get(sb), resolve);\n }).then(buff => {\n resolvers.delete(ids.get(sb));\n ids.delete(sb);\n for (let i = 0; i < buff.length; i++) sb[i] = buff[i];\n return 'ok';\n })\n });\n }\n else {\n const as = (id, sb) => ({[CHANNEL]: { id, sb }});\n\n notify = sb => {\n postMessage(as(ids.get(sb), sb));\n };\n\n addEventListener('message', event => {\n const details = event.data?.[CHANNEL];\n if (isArray(details)) {\n const [id, sb] = details;\n ids.set(sb, id);\n }\n });\n }\n}\n\nexport {SharedArrayBuffer, isArray, notify, postPatched, wait, waitAsync};\n", "/*! (c) Andrea Giammarchi - ISC */\n\nimport {FUNCTION} from 'proxy-target/types';\n\nimport {CHANNEL} from './channel.js';\nimport {GET, HAS, SET} from './shared/traps.js';\n\nimport {SharedArrayBuffer, isArray, notify, postPatched, wait, waitAsync} from './bridge.js';\n\n// just minifier friendly for Blob Workers' cases\nconst {Int32Array, Map, Uint16Array} = globalThis;\n\n// common constants / utilities for repeated operations\nconst {BYTES_PER_ELEMENT: I32_BYTES} = Int32Array;\nconst {BYTES_PER_ELEMENT: UI16_BYTES} = Uint16Array;\n\nconst waitInterrupt = (sb, delay, handler) => {\n while (wait(sb, 0, 0, delay) === 'timed-out')\n handler();\n};\n\n// retain buffers to transfer\nconst buffers = new WeakSet;\n\n// retain either main threads or workers global context\nconst context = new WeakMap;\n\nconst syncResult = {value: {then: fn => fn()}};\n\n// used to generate a unique `id` per each worker `postMessage` \"transaction\"\nlet uid = 0;\n\n/**\n * @typedef {Object} Interrupt used to sanity-check interrupts while waiting synchronously.\n * @prop {function} [handler] a callback invoked every `delay` milliseconds.\n * @prop {number} [delay=42] define `handler` invokes in terms of milliseconds.\n */\n\n/**\n * Create once a `Proxy` able to orchestrate synchronous `postMessage` out of the box.\n * @param {globalThis | Worker} self the context in which code should run\n * @param {{parse: (serialized: string) => any, stringify: (serializable: any) => string, transform?: (value:any) => any, interrupt?: () => void | Interrupt}} [JSON] an optional `JSON` like interface to `parse` or `stringify` content with extra `transform` ability.\n * @returns {ProxyHandler<globalThis> | ProxyHandler<Worker>}\n */\nconst coincident = (self, {parse = JSON.parse, stringify = JSON.stringify, transform, interrupt} = JSON) => {\n // create a Proxy once for the given context (globalThis or Worker instance)\n if (!context.has(self)) {\n // ensure no SAB gets a chance to pass through this call\n const sendMessage = postPatched || self.postMessage;\n // ensure the CHANNEL and data are posted correctly\n const post = (transfer, ...args) => sendMessage.call(self, {[CHANNEL]: args}, {transfer});\n\n const handler = typeof interrupt === FUNCTION ? interrupt : interrupt?.handler;\n const delay = interrupt?.delay || 42;\n const decoder = new TextDecoder('utf-16');\n\n // automatically uses sync wait (worker -> main)\n // or fallback to async wait (main -> worker)\n const waitFor = (isAsync, sb) => isAsync ?\n waitAsync(sb, 0) :\n ((handler ? waitInterrupt(sb, delay, handler) : wait(sb, 0)), syncResult);\n\n // prevent Harakiri https://github.com/WebReflection/coincident/issues/18\n let seppuku = false;\n\n context.set(self, new Proxy(new Map, {\n // there is very little point in checking prop in proxy for this very specific case\n // and I don't want to orchestrate a whole roundtrip neither, as stuff would fail\n // regardless if from Worker we access non existent Main callback, and vice-versa.\n // This is here mostly to guarantee that if such check is performed, at least the\n // get trap goes through and then it's up to developers guarantee they are accessing\n // stuff that actually exists elsewhere.\n [HAS]: (_, action) => typeof action === 'string' && !action.startsWith('_'),\n\n // worker related: get any utility that should be available on the main thread\n [GET]: (_, action) => action === 'then' ? null : ((...args) => {\n // transaction id\n const id = uid++;\n\n // first contact: just ask for how big the buffer should be\n // the value would be stored at index [1] while [0] is just control\n let sb = new Int32Array(new SharedArrayBuffer(I32_BYTES * 2));\n\n // if a transfer list has been passed, drop it from args\n let transfer = [];\n if (buffers.has(args.at(-1) || transfer))\n buffers.delete(transfer = args.pop());\n\n // ask for invoke with arguments and wait for it\n post(transfer, id, sb, action, transform ? args.map(transform) : args);\n\n // helps deciding how to wait for results\n const isAsync = self !== globalThis;\n\n // warn users about possible deadlock still allowing them\n // to explicitly `proxy.invoke().then(...)` without blocking\n let deadlock = 0;\n if (seppuku && isAsync)\n deadlock = setTimeout(console.warn, 1000, `\uD83D\uDC80\uD83D\uDD12 - Possible deadlock if proxy.${action}(...args) is awaited`);\n\n return waitFor(isAsync, sb).value.then(() => {\n clearTimeout(deadlock);\n\n // commit transaction using the returned / needed buffer length\n const length = sb[1];\n\n // filter undefined results\n if (!length) return;\n\n // calculate the needed ui16 bytes length to store the result string\n const bytes = UI16_BYTES * length;\n\n // round up to the next amount of bytes divided by 4 to allow i32 operations\n sb = new Int32Array(new SharedArrayBuffer(bytes + (bytes % I32_BYTES)));\n\n // ask for results and wait for it\n post([], id, sb);\n return waitFor(isAsync, sb).value.then(() => parse(\n decoder.decode(new Uint16Array(sb.buffer).slice(0, length)))\n );\n });\n }),\n\n // main thread related: react to any utility a worker is asking for\n [SET](actions, action, callback) {\n const type = typeof callback;\n if (type !== FUNCTION)\n throw new Error(`Unable to assign ${action} as ${type}`);\n // lazy event listener and logic handling, triggered once by setters actions\n if (!actions.size) {\n // maps results by `id` as they are asked for\n const results = new Map;\n // add the event listener once (first defined setter, all others work the same)\n self.addEventListener('message', async (event) => {\n // grub the very same library CHANNEL; ignore otherwise\n const details = event.data?.[CHANNEL];\n if (isArray(details)) {\n // if early enough, avoid leaking data to other listeners\n event.stopImmediatePropagation();\n const [id, sb, ...rest] = details;\n let error;\n // action available: it must be defined/known on the main thread\n if (rest.length) {\n const [action, args] = rest;\n if (actions.has(action)) {\n seppuku = true;\n try {\n // await for result either sync or async and serialize it\n const result = await actions.get(action)(...args);\n if (result !== void 0) {\n const serialized = stringify(transform ? transform(result) : result);\n // store the result for \"the very next\" event listener call\n results.set(id, serialized);\n // communicate the required SharedArrayBuffer length out of the\n // resulting serialized string\n sb[1] = serialized.length;\n }\n }\n catch (_) {\n error = _;\n }\n finally {\n seppuku = false;\n }\n }\n // unknown action should be notified as missing on the main thread\n else {\n error = new Error(`Unsupported action: ${action}`);\n }\n // unlock the wait lock later on\n sb[0] = 1;\n }\n // no action means: get results out of the well known `id`\n // wait lock automatically unlocked here as no `0` value would\n // possibly ever land at index `0`\n else {\n const result = results.get(id);\n results.delete(id);\n // populate the SharedArrayBuffer with utf-16 chars code\n for (let ui16a = new Uint16Array(sb.buffer), i = 0; i < result.length; i++)\n ui16a[i] = result.charCodeAt(i);\n }\n // release te worker waiting either the length or the result\n notify(sb, 0);\n if (error) throw error;\n }\n });\n }\n // store this action callback allowing the setter in the process\n return !!actions.set(action, callback);\n }\n }));\n }\n return context.get(self);\n};\n\ncoincident.transfer = (...args) => (buffers.add(args), args);\n\nexport default coincident;\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/**\n * A WebWorker entrypoint that uses coincident to handle postMessage details\n */\nimport coincident from 'coincident';\n\nimport {\n ContentsAPI,\n DriveFS,\n TDriveMethod,\n TDriveRequest,\n TDriveResponse,\n} from '@jupyterlite/contents';\n\nimport { IPyodideWorkerKernel } from './tokens';\n\nimport { PyodideRemoteKernel } from './worker';\n\nconst workerAPI = coincident(self) as IPyodideWorkerKernel;\n\n/**\n * An Emscripten-compatible synchronous Contents API using shared array buffers.\n */\nexport class SharedBufferContentsAPI extends ContentsAPI {\n request<T extends TDriveMethod>(data: TDriveRequest<T>): TDriveResponse<T> {\n return workerAPI.processDriveRequest(data);\n }\n}\n\n/**\n * A custom drive implementation which uses shared array buffers (via coincident) if available\n */\nclass PyodideDriveFS extends DriveFS {\n createAPI(options: DriveFS.IOptions): ContentsAPI {\n return new SharedBufferContentsAPI(\n options.driveName,\n options.mountpoint,\n options.FS,\n options.ERRNO_CODES,\n );\n }\n}\n\nexport class PyodideCoincidentKernel extends PyodideRemoteKernel {\n /**\n * Setup custom Emscripten FileSystem\n */\n protected async initFilesystem(\n options: IPyodideWorkerKernel.IOptions,\n ): Promise<void> {\n if (options.mountDrive) {\n const mountpoint = '/drive';\n const { FS, PATH, ERRNO_CODES } = this._pyodide;\n const { baseUrl } = options;\n\n const driveFS = new PyodideDriveFS({\n FS,\n PATH,\n ERRNO_CODES,\n baseUrl,\n driveName: this._driveName,\n mountpoint,\n });\n FS.mkdir(mountpoint);\n FS.mount(driveFS, {}, mountpoint);\n FS.chdir(mountpoint);\n this._driveFS = driveFS;\n }\n }\n}\n\nconst worker = new PyodideCoincidentKernel();\n\nconst sendWorkerMessage = workerAPI.processWorkerMessage.bind(workerAPI);\nworker.registerCallback(sendWorkerMessage);\n\nworkerAPI.initialize = worker.initialize.bind(worker);\nworkerAPI.execute = worker.execute.bind(worker);\nworkerAPI.complete = worker.complete.bind(worker);\nworkerAPI.inspect = worker.inspect.bind(worker);\nworkerAPI.isComplete = worker.isComplete.bind(worker);\nworkerAPI.commInfo = worker.commInfo.bind(worker);\nworkerAPI.commOpen = worker.commOpen.bind(worker);\nworkerAPI.commMsg = worker.commMsg.bind(worker);\nworkerAPI.commClose = worker.commClose.bind(worker);\nworkerAPI.inputReply = worker.inputReply.bind(worker);\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport type Pyodide from 'pyodide';\n\nimport type { DriveFS } from '@jupyterlite/contents';\n\nimport { KernelMessage } from '@jupyterlab/services';\n\nimport type { IPyodideWorkerKernel } from './tokens';\n\nexport class PyodideRemoteKernel {\n constructor() {\n this._initialized = new Promise((resolve, reject) => {\n this._initializer = { resolve, reject };\n });\n }\n\n /**\n * Accept the URLs from the host\n **/\n async initialize(options: IPyodideWorkerKernel.IOptions): Promise<void> {\n this._options = options;\n\n if (options.location.includes(':')) {\n const parts = options.location.split(':');\n this._driveName = parts[0];\n this._localPath = parts[1];\n } else {\n this._driveName = '';\n this._localPath = options.location;\n }\n\n await this.initRuntime(options);\n await this.initFilesystem(options);\n await this.initPackageManager(options);\n await this.initKernel(options);\n await this.initGlobals(options);\n this._initializer?.resolve();\n }\n\n protected async initRuntime(options: IPyodideWorkerKernel.IOptions): Promise<void> {\n const { pyodideUrl, indexUrl } = options;\n let loadPyodide: typeof Pyodide.loadPyodide;\n if (pyodideUrl.endsWith('.mjs')) {\n // note: this does not work at all in firefox\n const pyodideModule: typeof Pyodide = await import(\n /* webpackIgnore: true */ pyodideUrl\n );\n loadPyodide = pyodideModule.loadPyodide;\n } else {\n importScripts(pyodideUrl);\n loadPyodide = (self as any).loadPyodide;\n }\n this._pyodide = await loadPyodide({\n indexURL: indexUrl,\n ...options.loadPyodideOptions,\n });\n }\n\n protected async initPackageManager(\n options: IPyodideWorkerKernel.IOptions,\n ): Promise<void> {\n if (!this._options) {\n throw new Error('Uninitialized');\n }\n\n const { pipliteWheelUrl, disablePyPIFallback, pipliteUrls, loadPyodideOptions } =\n this._options;\n\n const preloaded = (loadPyodideOptions || {}).packages || [];\n\n if (!preloaded.includes('micropip')) {\n await this._pyodide.loadPackage(['micropip']);\n }\n\n if (!preloaded.includes('piplite')) {\n await this._pyodide.runPythonAsync(`\n import micropip\n await micropip.install('${pipliteWheelUrl}', keep_going=True)\n `);\n }\n\n // get piplite early enough to impact pyodide-kernel dependencies\n await this._pyodide.runPythonAsync(`\n import piplite.piplite\n piplite.piplite._PIPLITE_DISABLE_PYPI = ${disablePyPIFallback ? 'True' : 'False'}\n piplite.piplite._PIPLITE_URLS = ${JSON.stringify(pipliteUrls)}\n `);\n }\n\n protected async initKernel(options: IPyodideWorkerKernel.IOptions): Promise<void> {\n const preloaded = (options.loadPyodideOptions || {}).packages || [];\n\n const toLoad = ['ssl', 'sqlite3', 'ipykernel', 'comm', 'pyodide_kernel', 'ipython'];\n\n const scriptLines: string[] = [];\n\n // use piplite for packages that weren't pre-loaded\n for (const pkgName of toLoad) {\n if (!preloaded.includes(pkgName)) {\n scriptLines.push(`await piplite.install('${pkgName}', keep_going=True)`);\n }\n }\n\n // import the kernel\n scriptLines.push('import pyodide_kernel');\n\n // cd to the kernel location\n if (options.mountDrive && this._localPath) {\n scriptLines.push('import os', `os.chdir(\"${this._localPath}\")`);\n }\n\n // from this point forward, only use piplite (but not %pip)\n await this._pyodide.runPythonAsync(scriptLines.join('\\n'));\n }\n\n protected async initGlobals(options: IPyodideWorkerKernel.IOptions): Promise<void> {\n const { globals } = this._pyodide;\n this._kernel = globals.get('pyodide_kernel').kernel_instance.copy();\n this._stdout_stream = globals.get('pyodide_kernel').stdout_stream.copy();\n this._stderr_stream = globals.get('pyodide_kernel').stderr_stream.copy();\n this._interpreter = this._kernel.interpreter.copy();\n this._interpreter.send_comm = this.sendComm.bind(this);\n }\n\n /**\n * Setup custom Emscripten FileSystem\n */\n protected async initFilesystem(\n options: IPyodideWorkerKernel.IOptions,\n ): Promise<void> {\n if (options.mountDrive) {\n const mountpoint = '/drive';\n const { FS, PATH, ERRNO_CODES } = this._pyodide;\n const { baseUrl } = options;\n const { DriveFS } = await import('@jupyterlite/contents');\n\n const driveFS = new DriveFS({\n FS,\n PATH,\n ERRNO_CODES,\n baseUrl,\n driveName: this._driveName,\n mountpoint,\n });\n FS.mkdir(mountpoint);\n FS.mount(driveFS, {}, mountpoint);\n FS.chdir(mountpoint);\n this._driveFS = driveFS;\n }\n }\n\n /**\n * Recursively convert a Map to a JavaScript object\n * @param obj A Map, Array, or other object to convert\n */\n mapToObject(obj: any) {\n const out: any = obj instanceof Array ? [] : {};\n obj.forEach((value: any, key: string) => {\n out[key] =\n value instanceof Map || value instanceof Array\n ? this.mapToObject(value)\n : value;\n });\n return out;\n }\n\n /**\n * Format the response from the Pyodide evaluation.\n *\n * @param res The result object from the Pyodide evaluation\n */\n formatResult(res: any): any {\n if (!(res instanceof this._pyodide.ffi.PyProxy)) {\n return res;\n }\n // TODO: this is a bit brittle\n const m = res.toJs();\n const results = this.mapToObject(m);\n return results;\n }\n\n /**\n * Register the callback function to send messages from the worker back to the main thread.\n * @param callback the callback to register\n */\n registerCallback(callback: (msg: any) => void): void {\n this._sendWorkerMessage = callback;\n }\n\n /**\n * Makes sure pyodide is ready before continuing, and cache the parent message.\n */\n async setup(parent: any): Promise<void> {\n await this._initialized;\n this._kernel._parent_header = this._pyodide.toPy(parent);\n }\n\n /**\n * Execute code with the interpreter.\n *\n * @param content The incoming message with the code to execute.\n */\n async execute(content: any, parent: any) {\n await this.setup(parent);\n\n const publishExecutionResult = (\n prompt_count: any,\n data: any,\n metadata: any,\n ): void => {\n const bundle = {\n execution_count: prompt_count,\n data: this.formatResult(data),\n metadata: this.formatResult(metadata),\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'execute_result',\n });\n };\n\n const publishExecutionError = (ename: any, evalue: any, traceback: any): void => {\n const bundle = {\n ename: ename,\n evalue: evalue,\n traceback: traceback,\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'execute_error',\n });\n };\n\n const clearOutputCallback = (wait: boolean): void => {\n const bundle = {\n wait: this.formatResult(wait),\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'clear_output',\n });\n };\n\n const displayDataCallback = (data: any, metadata: any, transient: any): void => {\n const bundle = {\n data: this.formatResult(data),\n metadata: this.formatResult(metadata),\n transient: this.formatResult(transient),\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'display_data',\n });\n };\n\n const updateDisplayDataCallback = (\n data: any,\n metadata: any,\n transient: any,\n ): void => {\n const bundle = {\n data: this.formatResult(data),\n metadata: this.formatResult(metadata),\n transient: this.formatResult(transient),\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'update_display_data',\n });\n };\n\n const publishStreamCallback = (name: any, text: any): void => {\n const bundle = {\n name: this.formatResult(name),\n text: this.formatResult(text),\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'stream',\n });\n };\n\n this._stdout_stream.publish_stream_callback = publishStreamCallback;\n this._stderr_stream.publish_stream_callback = publishStreamCallback;\n this._interpreter.display_pub.clear_output_callback = clearOutputCallback;\n this._interpreter.display_pub.display_data_callback = displayDataCallback;\n this._interpreter.display_pub.update_display_data_callback =\n updateDisplayDataCallback;\n this._interpreter.displayhook.publish_execution_result = publishExecutionResult;\n this._interpreter.input = this.input.bind(this);\n this._interpreter.getpass = this.getpass.bind(this);\n\n const res = await this._kernel.run(content.code);\n const results = this.formatResult(res);\n\n if (results['status'] === 'error') {\n publishExecutionError(results['ename'], results['evalue'], results['traceback']);\n }\n\n return results;\n }\n\n /**\n * Complete the code submitted by a user.\n *\n * @param content The incoming message with the code to complete.\n */\n async complete(content: any, parent: any) {\n await this.setup(parent);\n\n const res = this._kernel.complete(content.code, content.cursor_pos);\n const results = this.formatResult(res);\n return results;\n }\n\n /**\n * Inspect the code submitted by a user.\n *\n * @param content The incoming message with the code to inspect.\n */\n async inspect(\n content: { code: string; cursor_pos: number; detail_level: 0 | 1 },\n parent: any,\n ) {\n await this.setup(parent);\n\n const res = this._kernel.inspect(\n content.code,\n content.cursor_pos,\n content.detail_level,\n );\n const results = this.formatResult(res);\n return results;\n }\n\n /**\n * Check code for completeness submitted by a user.\n *\n * @param content The incoming message with the code to check.\n */\n async isComplete(content: { code: string }, parent: any) {\n await this.setup(parent);\n\n const res = this._kernel.is_complete(content.code);\n const results = this.formatResult(res);\n return results;\n }\n\n /**\n * Respond to the commInfoRequest.\n *\n * @param content The incoming message with the comm target name.\n */\n async commInfo(\n content: any,\n parent: any,\n ): Promise<KernelMessage.ICommInfoReplyMsg['content']> {\n await this.setup(parent);\n\n const res = this._kernel.comm_info(content.target_name);\n const results = this.formatResult(res);\n\n return {\n comms: results,\n status: 'ok',\n };\n }\n\n /**\n * Respond to the commOpen.\n *\n * @param content The incoming message with the comm open.\n */\n async commOpen(content: any, parent: any) {\n await this.setup(parent);\n\n const res = this._kernel.comm_manager.comm_open(\n this._pyodide.toPy(null),\n this._pyodide.toPy(null),\n this._pyodide.toPy(content),\n );\n const results = this.formatResult(res);\n\n return results;\n }\n\n /**\n * Respond to the commMsg.\n *\n * @param content The incoming message with the comm msg.\n */\n async commMsg(content: any, parent: any) {\n await this.setup(parent);\n\n const res = this._kernel.comm_manager.comm_msg(\n this._pyodide.toPy(null),\n this._pyodide.toPy(null),\n this._pyodide.toPy(content),\n );\n const results = this.formatResult(res);\n\n return results;\n }\n\n /**\n * Respond to the commClose.\n *\n * @param content The incoming message with the comm close.\n */\n async commClose(content: any, parent: any) {\n await this.setup(parent);\n\n const res = this._kernel.comm_manager.comm_close(\n this._pyodide.toPy(null),\n this._pyodide.toPy(null),\n this._pyodide.toPy(content),\n );\n const results = this.formatResult(res);\n\n return results;\n }\n\n /**\n * Resolve the input request by getting back the reply from the main thread\n *\n * @param content The incoming message with the reply\n */\n async inputReply(content: any, parent: any) {\n await this.setup(parent);\n\n this._resolveInputReply(content);\n }\n\n /**\n * Send a input request to the front-end.\n *\n * @param prompt the text to show at the prompt\n * @param password Is the request for a password?\n */\n async sendInputRequest(prompt: string, password: boolean) {\n const content = {\n prompt,\n password,\n };\n\n this._sendWorkerMessage({\n type: 'input_request',\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n content,\n });\n }\n\n async getpass(prompt: string) {\n prompt = typeof prompt === 'undefined' ? '' : prompt;\n await this.sendInputRequest(prompt, true);\n const replyPromise = new Promise((resolve) => {\n this._resolveInputReply = resolve;\n });\n const result: any = await replyPromise;\n return result['value'];\n }\n\n async input(prompt: string) {\n prompt = typeof prompt === 'undefined' ? '' : prompt;\n await this.sendInputRequest(prompt, false);\n const replyPromise = new Promise((resolve) => {\n this._resolveInputReply = resolve;\n });\n const result: any = await replyPromise;\n return result['value'];\n }\n\n /**\n * Send a comm message to the front-end.\n *\n * @param type The type of the comm message.\n * @param content The content.\n * @param metadata The metadata.\n * @param ident The ident.\n * @param buffers The binary buffers.\n */\n async sendComm(type: string, content: any, metadata: any, ident: any, buffers: any) {\n this._sendWorkerMessage({\n type: type,\n content: this.formatResult(content),\n metadata: this.formatResult(metadata),\n ident: this.formatResult(ident),\n buffers: this.formatResult(buffers),\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n });\n }\n\n /**\n * Initialization options.\n */\n protected _options: IPyodideWorkerKernel.IOptions | null = null;\n /**\n * A promise that resolves when all initiaization is complete.\n */\n protected _initialized: Promise<void>;\n private _initializer: {\n reject: () => void;\n resolve: () => void;\n } | null = null;\n protected _pyodide: Pyodide.PyodideInterface = null as any;\n /** TODO: real typing */\n protected _localPath = '';\n protected _driveName = '';\n protected _kernel: any;\n protected _interpreter: any;\n protected _stdout_stream: any;\n protected _stderr_stream: any;\n protected _resolveInputReply: any;\n protected _driveFS: DriveFS | null = null;\n protected _sendWorkerMessage: (msg: any) => void = () => {};\n}\n"],
5
- "mappings": "k3BAaiBA,EAAAA,SAAAA,OAAjB,SAAiBA,EAAQ,CAyCvB,SAAgBC,EACdC,EACAC,EACAC,EAAQ,EACRC,EAAO,GAAE,CAET,IAAIC,EAAIJ,EAAM,OACd,GAAII,IAAM,EACR,MAAO,GAELF,EAAQ,EACVA,EA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,EAAG,MAAMD,CAAU,EACnB,KAAK,SAAWK,CAClB,CACF,CACF,EAEMC,EAAS,IAAIR,GAEbS,GAAoBjB,EAAU,qBAAqB,KAAKA,CAAS,EACvEgB,EAAO,iBAAiBC,EAAiB,EAEzCjB,EAAU,WAAagB,EAAO,WAAW,KAAKA,CAAM,EACpDhB,EAAU,QAAUgB,EAAO,QAAQ,KAAKA,CAAM,EAC9ChB,EAAU,SAAWgB,EAAO,SAAS,KAAKA,CAAM,EAChDhB,EAAU,QAAUgB,EAAO,QAAQ,KAAKA,CAAM,EAC9ChB,EAAU,WAAagB,EAAO,WAAW,KAAKA,CAAM,EACpDhB,EAAU,SAAWgB,EAAO,SAAS,KAAKA,CAAM,EAChDhB,EAAU,SAAWgB,EAAO,SAAS,KAAKA,CAAM,EAChDhB,EAAU,QAAUgB,EAAO,QAAQ,KAAKA,CAAM,EAC9ChB,EAAU,UAAYgB,EAAO,UAAU,KAAKA,CAAM,EAClDhB,EAAU,WAAagB,EAAO,WAAW,KAAKA,CAAM",
4
+ "sourcesContent": ["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * The namespace for array-specific algorithms.\n */\nexport namespace ArrayExt {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n export function firstIndexOf<T>(\n array: ArrayLike<T>,\n value: T,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let span: number;\n if (stop < start) {\n span = stop + 1 + (n - start);\n } else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n export function lastIndexOf<T>(\n array: ArrayLike<T>,\n value: T,\n start = -1,\n stop = 0\n ): number {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let span: number;\n if (start < stop) {\n span = start + 1 + (n - stop);\n } else {\n span = start - stop + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n export function findFirstIndex<T>(\n array: ArrayLike<T>,\n fn: (value: T, index: number) => boolean,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let span: number;\n if (stop < start) {\n span = stop + 1 + (n - start);\n } else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n export function findLastIndex<T>(\n array: ArrayLike<T>,\n fn: (value: T, index: number) => boolean,\n start = -1,\n stop = 0\n ): number {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let d: number;\n if (start < stop) {\n d = start + 1 + (n - stop);\n } else {\n d = start - stop + 1;\n }\n for (let i = 0; i < d; ++i) {\n let j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n export function findFirstValue<T>(\n array: ArrayLike<T>,\n fn: (value: T, index: number) => boolean,\n start = 0,\n stop = -1\n ): T | undefined {\n let index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n export function findLastValue<T>(\n array: ArrayLike<T>,\n fn: (value: T, index: number) => boolean,\n start = -1,\n stop = 0\n ): T | undefined {\n let index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n export function lowerBound<T, U>(\n array: ArrayLike<T>,\n value: U,\n fn: (element: T, value: U) => number,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n } else {\n span = half;\n }\n }\n return begin;\n }\n\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n export function upperBound<T, U>(\n array: ArrayLike<T>,\n value: U,\n fn: (element: T, value: U) => number,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n } else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n export function shallowEqual<T>(\n a: ArrayLike<T>,\n b: ArrayLike<T>,\n fn?: (a: T, b: T) => boolean\n ): boolean {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n\n // Compare each element for equality.\n for (let i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n\n // The array are shallowly equal.\n return true;\n }\n\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n export function slice<T>(\n array: ArrayLike<T>,\n options: slice.IOptions = {}\n ): T[] {\n // Extract the options.\n let { start, stop, step } = options;\n\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n\n // Look up the length of the array.\n let n = array.length;\n\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n } else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n } else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n } else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n } else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n\n // Compute the slice length.\n let length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n } else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n } else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n\n // Compute the sliced result.\n let result: T[] = [];\n for (let i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n\n // Return the result.\n return result;\n }\n\n /**\n * The namespace for the `slice` function statics.\n */\n export namespace slice {\n /**\n * The options for the `slice` function.\n */\n export interface IOptions {\n /**\n * The starting index of the slice, inclusive.\n *\n * Negative values are taken as an offset from the end\n * of the array.\n *\n * The default is `0` if `step > 0` else `n - 1`.\n */\n start?: number;\n\n /**\n * The stopping index of the slice, exclusive.\n *\n * Negative values are taken as an offset from the end\n * of the array.\n *\n * The default is `n` if `step > 0` else `-n - 1`.\n */\n stop?: number;\n\n /**\n * The step value for the slice.\n *\n * This must not be `0`.\n *\n * The default is `1`.\n */\n step?: number;\n }\n }\n\n /**\n * An array-like object which supports item assignment.\n */\n export type MutableArrayLike<T> = {\n readonly length: number;\n [index: number]: T;\n };\n\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n export function move<T>(\n array: MutableArrayLike<T>,\n fromIndex: number,\n toIndex: number\n ): void {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n } else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n } else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n let value = array[fromIndex];\n let d = fromIndex < toIndex ? 1 : -1;\n for (let i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n export function reverse<T>(\n array: MutableArrayLike<T>,\n start = 0,\n stop = -1\n ): void {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n let a = array[start];\n let b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n export function rotate<T>(\n array: MutableArrayLike<T>,\n delta: number,\n start = 0,\n stop = -1\n ): void {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n let length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n } else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n let pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n export function fill<T>(\n array: MutableArrayLike<T>,\n value: T,\n start = 0,\n stop = -1\n ): void {\n let n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let span: number;\n if (stop < start) {\n span = stop + 1 + (n - start);\n } else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n export function insert<T>(array: Array<T>, index: number, value: T): void {\n let n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n } else {\n index = Math.min(index, n);\n }\n for (let i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n export function removeAt<T>(array: Array<T>, index: number): T | undefined {\n let n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n let value = array[index];\n for (let i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n export function removeFirstOf<T>(\n array: Array<T>,\n value: T,\n start = 0,\n stop = -1\n ): number {\n let index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n export function removeLastOf<T>(\n array: Array<T>,\n value: T,\n start = -1,\n stop = 0\n ): number {\n let index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n export function removeAllOf<T>(\n array: Array<T>,\n value: T,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && array[i] === value) {\n count++;\n } else if (\n stop < start &&\n (i <= stop || i >= start) &&\n array[i] === value\n ) {\n count++;\n } else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n export function removeFirstWhere<T>(\n array: Array<T>,\n fn: (value: T, index: number) => boolean,\n start = 0,\n stop = -1\n ): { index: number; value: T | undefined } {\n let value: T | undefined;\n let index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n export function removeLastWhere<T>(\n array: Array<T>,\n fn: (value: T, index: number) => boolean,\n start = -1,\n stop = 0\n ): { index: number; value: T | undefined } {\n let value: T | undefined;\n let index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n export function removeAllWhere<T>(\n array: Array<T>,\n fn: (value: T, index: number) => boolean,\n start = 0,\n stop = -1\n ): number {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n } else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n } else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {\n count++;\n } else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n } else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Chain together several iterables.\n *\n * @deprecated\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * Array.from(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nexport function* chain<T>(...objects: Iterable<T>[]): IterableIterator<T> {\n for (const object of objects) {\n yield* object;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty } from '@lumino/algorithm';\n *\n * let stream = empty<number>();\n *\n * Array.from(stream); // []\n * ```\n */\n// eslint-disable-next-line require-yield\nexport function* empty<T>(): IterableIterator<T> {\n return;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * Array.from(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nexport function* enumerate<T>(\n object: Iterable<T>,\n start = 0\n): IterableIterator<[number, T]> {\n for (const value of object) {\n yield [start++, value];\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nexport function* filter<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean\n): IterableIterator<T> {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n yield value;\n }\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nexport function find<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean\n): T | undefined {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nexport function findIndex<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean\n): number {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nexport function min<T>(\n object: Iterable<T>,\n fn: (first: T, second: T) => number\n): T | undefined {\n let result: T | undefined = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nexport function max<T>(\n object: Iterable<T>,\n fn: (first: T, second: T) => number\n): T | undefined {\n let result: T | undefined = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nexport function minmax<T>(\n object: Iterable<T>,\n fn: (first: T, second: T) => number\n): [T, T] | undefined {\n let empty = true;\n let vmin: T;\n let vmax: T;\n for (const value of object) {\n if (empty) {\n vmin = value;\n vmax = value;\n empty = false;\n } else if (fn(value, vmin!) < 0) {\n vmin = value;\n } else if (fn(value, vmax!) > 0) {\n vmax = value;\n }\n }\n return empty ? undefined : [vmin!, vmax!];\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Create an array from an iterable of values.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { toArray } from '@lumino/algorithm';\n *\n * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nexport function toArray<T>(object: Iterable<T>): T[] {\n return Array.from(object);\n}\n\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nexport function toObject<T>(object: Iterable<[string, T]>): {\n [key: string]: T;\n} {\n const result: { [key: string]: T } = {};\n for (const [key, value] of object) {\n result[key] = value;\n }\n return result;\n}\n\n/**\n * Invoke a function for each value in an iterable.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nexport function each<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean | void\n): void {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return;\n }\n }\n}\n\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nexport function every<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean\n): boolean {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nexport function some<T>(\n object: Iterable<T>,\n fn: (value: T, index: number) => boolean\n): boolean {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nexport function* map<T, U>(\n object: Iterable<T>,\n fn: (value: T, index: number) => U\n): IterableIterator<U> {\n let index = 0;\n for (const value of object) {\n yield fn(value, index++);\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n *\n * #### Example\n * ```typescript\n * import { range } from '@lumino/algorithm';\n *\n * let stream = range(2, 4);\n *\n * Array.from(stream); // [2, 3]\n * ```\n */\nexport function* range(\n start: number,\n stop?: number,\n step?: number\n): IterableIterator<number> {\n if (stop === undefined) {\n stop = start;\n start = 0;\n step = 1;\n } else if (step === undefined) {\n step = 1;\n }\n const length = Private.rangeLength(start, stop, step);\n for (let index = 0; index < length; index++) {\n yield start + step * index;\n }\n}\n\n/**\n * The namespace for the module implementation details.\n */\nnamespace Private {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n export function rangeLength(\n start: number,\n stop: number,\n step: number\n ): number {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Summarize all values in an iterable using a reducer function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The reducer function to invoke for each value.\n *\n * @param initial - The initial value to start accumulation.\n *\n * @returns The final accumulated value.\n *\n * #### Notes\n * The `reduce` function follows the conventions of `Array#reduce`.\n *\n * If the iterator is empty, an initial value is required. That value\n * will be used as the return value. If no initial value is provided,\n * an error will be thrown.\n *\n * If the iterator contains a single item and no initial value is\n * provided, the single item is used as the return value.\n *\n * Otherwise, the reducer is invoked for each element in the iterable.\n * If an initial value is not provided, the first element will be used\n * as the initial accumulated value.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { reduce } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5];\n *\n * let sum = reduce(data, (a, value) => a + value); // 15\n * ```\n */\nexport function reduce<T>(\n object: Iterable<T>,\n fn: (accumulator: T, value: T, index: number) => T\n): T;\nexport function reduce<T, U>(\n object: Iterable<T>,\n fn: (accumulator: U, value: T, index: number) => U,\n initial: U\n): U;\nexport function reduce<T>(\n object: Iterable<T>,\n fn: (accumulator: any, value: T, index: number) => any,\n initial?: unknown\n): any {\n // Setup the iterator and fetch the first value.\n const it = object[Symbol.iterator]();\n let index = 0;\n let first = it.next();\n\n // An empty iterator and no initial value is an error.\n if (first.done && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n\n // If the iterator is empty, return the initial value.\n if (first.done) {\n return initial;\n }\n\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n let second = it.next();\n if (second.done && initial === undefined) {\n return first.value;\n }\n\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second.done) {\n return fn(initial, first.value, index++);\n }\n\n // Setup the initial accumlated value.\n let accumulator: any;\n if (initial === undefined) {\n accumulator = fn(first.value, second.value, index++);\n } else {\n accumulator = fn(fn(initial, first.value, index++), second.value, index++);\n }\n\n // Iterate the rest of the values, updating the accumulator.\n let next: IteratorResult<T>;\n while (!(next = it.next()).done) {\n accumulator = fn(accumulator, next.value, index++);\n }\n\n // Return the final accumulated value.\n return accumulator;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @deprecated\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * Array.from(stream); // [7, 7, 7]\n * ```\n */\nexport function* repeat<T>(value: T, count: number): IterableIterator<T> {\n while (0 < count--) {\n yield value;\n }\n}\n\n/**\n * Create an iterator which yields a value a single time.\n *\n * @deprecated\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * Array.from(stream); // [7]\n * ```\n */\nexport function* once<T>(value: T): IterableIterator<T> {\n yield value;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * An object which can produce a reverse iterator over its values.\n */\nexport interface IRetroable<T> {\n /**\n * Get a reverse iterator over the object's values.\n *\n * @returns An iterator which yields the object's values in reverse.\n */\n retro(): IterableIterator<T>;\n}\n\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * Array.from(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nexport function* retro<T>(\n object: IRetroable<T> | ArrayLike<T>\n): IterableIterator<T> {\n if (typeof (object as IRetroable<T>).retro === 'function') {\n yield* (object as IRetroable<T>).retro();\n } else {\n for (let index = (object as ArrayLike<T>).length - 1; index > -1; index--) {\n yield (object as ArrayLike<T>)[index];\n }\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nexport function topologicSort<T>(edges: Iterable<[T, T]>): T[] {\n // Setup the shared sorting state.\n let sorted: T[] = [];\n let visited = new Set<T>();\n let graph = new Map<T, T[]>();\n\n // Add the edges to the graph.\n for (const edge of edges) {\n addEdge(edge);\n }\n\n // Visit each node in the graph.\n for (const [k] of graph) {\n visit(k);\n }\n\n // Return the sorted results.\n return sorted;\n\n // Add an edge to the graph.\n function addEdge(edge: [T, T]): void {\n let [fromNode, toNode] = edge;\n let children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n } else {\n graph.set(toNode, [fromNode]);\n }\n }\n\n // Recursively visit the node.\n function visit(node: T): void {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n let children = graph.get(node);\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n sorted.push(node);\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * Array.from(stream); // [1, 3, 5];\n * ```\n */\nexport function* stride<T>(\n object: Iterable<T>,\n step: number\n): IterableIterator<T> {\n let count = 0;\n for (const value of object) {\n if (0 === count++ % step) {\n yield value;\n }\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * The namespace for string-specific algorithms.\n */\nexport namespace StringExt {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n export function findIndices(\n source: string,\n query: string,\n start = 0\n ): number[] | null {\n let indices = new Array<number>(query.length);\n for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n\n /**\n * The result of a string match function.\n */\n export interface IMatchResult {\n /**\n * A score which indicates the strength of the match.\n *\n * The documentation of a given match function should specify\n * whether a lower or higher score is a stronger match.\n */\n score: number;\n\n /**\n * The indices of the matched characters in the source text.\n *\n * The indices will appear in increasing order.\n */\n indices: number[];\n }\n\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n export function matchSumOfSquares(\n source: string,\n query: string,\n start = 0\n ): IMatchResult | null {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i] - start;\n score += j * j;\n }\n return { score, indices };\n }\n\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n export function matchSumOfDeltas(\n source: string,\n query: string,\n start = 0\n ): IMatchResult | null {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n let last = start - 1;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score, indices };\n }\n\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n export function highlight<T>(\n source: string,\n indices: ReadonlyArray<number>,\n fn: (chunk: string) => T\n ): Array<string | T> {\n // Set up the result array.\n let result: Array<string | T> = [];\n\n // Set up the counter variables.\n let k = 0;\n let last = 0;\n let n = indices.length;\n\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n let i = indices[k];\n let j = indices[k];\n\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n\n // Update the last visited index.\n last = j + 1;\n }\n\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n\n // Return the highlighted result.\n return result;\n }\n\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n export function cmp(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n *\n * #### Example\n * ```typescript\n * import { take } from '@lumino/algorithm';\n *\n * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);\n *\n * Array.from(stream); // [5, 4, 3]\n * ```\n */\nexport function* take<T>(\n object: Iterable<T>,\n count: number\n): IterableIterator<T> {\n if (count < 1) {\n return;\n }\n const it = object[Symbol.iterator]();\n let item: IteratorResult<T>;\n while (0 < count-- && !(item = it.next()).done) {\n yield item.value;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nimport { every } from './iter';\n\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * Array.from(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nexport function* zip<T>(...objects: Iterable<T>[]): IterableIterator<T[]> {\n const iters = objects.map(obj => obj[Symbol.iterator]());\n let tuple = iters.map(it => it.next());\n for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {\n yield tuple.map(item => item.value);\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * A type alias for a JSON primitive.\n */\nexport type JSONPrimitive = boolean | number | string | null;\n\n/**\n * A type alias for a JSON value.\n */\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray;\n\n/**\n * A type definition for a JSON object.\n */\nexport interface JSONObject {\n [key: string]: JSONValue;\n}\n\n/**\n * A type definition for a JSON array.\n */\nexport interface JSONArray extends Array<JSONValue> {}\n\n/**\n * A type definition for a readonly JSON object.\n */\nexport interface ReadonlyJSONObject {\n readonly [key: string]: ReadonlyJSONValue;\n}\n\n/**\n * A type definition for a readonly JSON array.\n */\nexport interface ReadonlyJSONArray extends ReadonlyArray<ReadonlyJSONValue> {}\n\n/**\n * A type alias for a readonly JSON value.\n */\nexport type ReadonlyJSONValue =\n | JSONPrimitive\n | ReadonlyJSONObject\n | ReadonlyJSONArray;\n\n/**\n * A type alias for a partial JSON value.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport type PartialJSONValue =\n | JSONPrimitive\n | PartialJSONObject\n | PartialJSONArray;\n\n/**\n * A type definition for a partial JSON object.\n *\n * Note: Partial here means that the JSON object attributes can be `undefined`.\n */\nexport interface PartialJSONObject {\n [key: string]: PartialJSONValue | undefined;\n}\n\n/**\n * A type definition for a partial JSON array.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport interface PartialJSONArray extends Array<PartialJSONValue> {}\n\n/**\n * A type definition for a readonly partial JSON object.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport interface ReadonlyPartialJSONObject {\n readonly [key: string]: ReadonlyPartialJSONValue | undefined;\n}\n\n/**\n * A type definition for a readonly partial JSON array.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport interface ReadonlyPartialJSONArray\n extends ReadonlyArray<ReadonlyPartialJSONValue> {}\n\n/**\n * A type alias for a readonly partial JSON value.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport type ReadonlyPartialJSONValue =\n | JSONPrimitive\n | ReadonlyPartialJSONObject\n | ReadonlyPartialJSONArray;\n\n/**\n * The namespace for JSON-specific functions.\n */\nexport namespace JSONExt {\n /**\n * A shared frozen empty JSONObject\n */\n export const emptyObject = Object.freeze({}) as ReadonlyJSONObject;\n\n /**\n * A shared frozen empty JSONArray\n */\n export const emptyArray = Object.freeze([]) as ReadonlyJSONArray;\n\n /**\n * Test whether a JSON value is a primitive.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a primitive,`false` otherwise.\n */\n export function isPrimitive(\n value: ReadonlyPartialJSONValue\n ): value is JSONPrimitive {\n return (\n value === null ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n typeof value === 'string'\n );\n }\n\n /**\n * Test whether a JSON value is an array.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a an array, `false` otherwise.\n */\n export function isArray(value: JSONValue): value is JSONArray;\n export function isArray(value: ReadonlyJSONValue): value is ReadonlyJSONArray;\n export function isArray(value: PartialJSONValue): value is PartialJSONArray;\n export function isArray(\n value: ReadonlyPartialJSONValue\n ): value is ReadonlyPartialJSONArray;\n export function isArray(value: ReadonlyPartialJSONValue): boolean {\n return Array.isArray(value);\n }\n\n /**\n * Test whether a JSON value is an object.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a an object, `false` otherwise.\n */\n export function isObject(value: JSONValue): value is JSONObject;\n export function isObject(\n value: ReadonlyJSONValue\n ): value is ReadonlyJSONObject;\n export function isObject(value: PartialJSONValue): value is PartialJSONObject;\n export function isObject(\n value: ReadonlyPartialJSONValue\n ): value is ReadonlyPartialJSONObject;\n export function isObject(value: ReadonlyPartialJSONValue): boolean {\n return !isPrimitive(value) && !isArray(value);\n }\n\n /**\n * Compare two JSON values for deep equality.\n *\n * @param first - The first JSON value of interest.\n *\n * @param second - The second JSON value of interest.\n *\n * @returns `true` if the values are equivalent, `false` otherwise.\n */\n export function deepEqual(\n first: ReadonlyPartialJSONValue,\n second: ReadonlyPartialJSONValue\n ): boolean {\n // Check referential and primitive equality first.\n if (first === second) {\n return true;\n }\n\n // If one is a primitive, the `===` check ruled out the other.\n if (isPrimitive(first) || isPrimitive(second)) {\n return false;\n }\n\n // Test whether they are arrays.\n let a1 = isArray(first);\n let a2 = isArray(second);\n\n // Bail if the types are different.\n if (a1 !== a2) {\n return false;\n }\n\n // If they are both arrays, compare them.\n if (a1 && a2) {\n return deepArrayEqual(\n first as ReadonlyPartialJSONArray,\n second as ReadonlyPartialJSONArray\n );\n }\n\n // At this point, they must both be objects.\n return deepObjectEqual(\n first as ReadonlyPartialJSONObject,\n second as ReadonlyPartialJSONObject\n );\n }\n\n /**\n * Create a deep copy of a JSON value.\n *\n * @param value - The JSON value to copy.\n *\n * @returns A deep copy of the given JSON value.\n */\n export function deepCopy<T extends ReadonlyPartialJSONValue>(value: T): T {\n // Do nothing for primitive values.\n if (isPrimitive(value)) {\n return value;\n }\n\n // Deep copy an array.\n if (isArray(value)) {\n return deepArrayCopy(value);\n }\n\n // Deep copy an object.\n return deepObjectCopy(value);\n }\n\n /**\n * Compare two JSON arrays for deep equality.\n */\n function deepArrayEqual(\n first: ReadonlyPartialJSONArray,\n second: ReadonlyPartialJSONArray\n ): boolean {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n\n // Test the arrays for equal length.\n if (first.length !== second.length) {\n return false;\n }\n\n // Compare the values for equality.\n for (let i = 0, n = first.length; i < n; ++i) {\n if (!deepEqual(first[i], second[i])) {\n return false;\n }\n }\n\n // At this point, the arrays are equal.\n return true;\n }\n\n /**\n * Compare two JSON objects for deep equality.\n */\n function deepObjectEqual(\n first: ReadonlyPartialJSONObject,\n second: ReadonlyPartialJSONObject\n ): boolean {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n\n // Check for the first object's keys in the second object.\n for (let key in first) {\n if (first[key] !== undefined && !(key in second)) {\n return false;\n }\n }\n\n // Check for the second object's keys in the first object.\n for (let key in second) {\n if (second[key] !== undefined && !(key in first)) {\n return false;\n }\n }\n\n // Compare the values for equality.\n for (let key in first) {\n // Get the values.\n let firstValue = first[key];\n let secondValue = second[key];\n\n // If both are undefined, ignore the key.\n if (firstValue === undefined && secondValue === undefined) {\n continue;\n }\n\n // If only one value is undefined, the objects are not equal.\n if (firstValue === undefined || secondValue === undefined) {\n return false;\n }\n\n // Compare the values.\n if (!deepEqual(firstValue, secondValue)) {\n return false;\n }\n }\n\n // At this point, the objects are equal.\n return true;\n }\n\n /**\n * Create a deep copy of a JSON array.\n */\n function deepArrayCopy(value: any): any {\n let result = new Array<any>(value.length);\n for (let i = 0, n = value.length; i < n; ++i) {\n result[i] = deepCopy(value[i]);\n }\n return result;\n }\n\n /**\n * Create a deep copy of a JSON object.\n */\n function deepObjectCopy(value: any): any {\n let result: any = {};\n for (let key in value) {\n // Ignore undefined values.\n let subvalue = value[key];\n if (subvalue === undefined) {\n continue;\n }\n result[key] = deepCopy(subvalue);\n }\n return result;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * An object which stores MIME data for general application use.\n *\n * #### Notes\n * This class does not attempt to enforce \"correctness\" of MIME types\n * and their associated data. Since this class is designed to transfer\n * arbitrary data and objects within the same application, it assumes\n * that the user provides correct and accurate data.\n */\nexport class MimeData {\n /**\n * Get an array of the MIME types contained within the dataset.\n *\n * @returns A new array of the MIME types, in order of insertion.\n */\n types(): string[] {\n return this._types.slice();\n }\n\n /**\n * Test whether the dataset has an entry for the given type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns `true` if the dataset contains a value for the given\n * MIME type, `false` otherwise.\n */\n hasData(mime: string): boolean {\n return this._types.indexOf(mime) !== -1;\n }\n\n /**\n * Get the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns The value for the given MIME type, or `undefined` if\n * the dataset does not contain a value for the type.\n */\n getData(mime: string): any | undefined {\n let i = this._types.indexOf(mime);\n return i !== -1 ? this._values[i] : undefined;\n }\n\n /**\n * Set the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @param data - The data value for the given MIME type.\n *\n * #### Notes\n * This will overwrite any previous entry for the MIME type.\n */\n setData(mime: string, data: unknown): void {\n this.clearData(mime);\n this._types.push(mime);\n this._values.push(data);\n }\n\n /**\n * Remove the data entry for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * #### Notes\n * This is a no-op if there is no entry for the given MIME type.\n */\n clearData(mime: string): void {\n let i = this._types.indexOf(mime);\n if (i !== -1) {\n this._types.splice(i, 1);\n this._values.splice(i, 1);\n }\n }\n\n /**\n * Remove all data entries from the dataset.\n */\n clear(): void {\n this._types.length = 0;\n this._values.length = 0;\n }\n\n private _types: string[] = [];\n private _values: any[] = [];\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * A class which wraps a promise into a delegate object.\n *\n * #### Notes\n * This class is useful when the logic to resolve or reject a promise\n * cannot be defined at the point where the promise is created.\n */\nexport class PromiseDelegate<T> {\n /**\n * Construct a new promise delegate.\n */\n constructor() {\n this.promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n /**\n * The promise wrapped by the delegate.\n */\n readonly promise: Promise<T>;\n\n /**\n * Resolve the wrapped promise with the given value.\n *\n * @param value - The value to use for resolving the promise.\n */\n resolve(value: T | PromiseLike<T>): void {\n let resolve = this._resolve;\n resolve(value);\n }\n\n /**\n * Reject the wrapped promise with the given value.\n *\n * @reason - The reason for rejecting the promise.\n */\n reject(reason: unknown): void {\n let reject = this._reject;\n reject(reason);\n }\n\n private _resolve: (value: T | PromiseLike<T>) => void;\n private _reject: (reason: any) => void;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * A runtime object which captures compile-time type information.\n *\n * #### Notes\n * A token captures the compile-time type of an interface or class in\n * an object which can be used at runtime in a type-safe fashion.\n */\nexport class Token<T> {\n /**\n * Construct a new token.\n *\n * @param name - A human readable name for the token.\n * @param description - Token purpose description for documentation.\n */\n constructor(name: string, description?: string) {\n this.name = name;\n this.description = description ?? '';\n this._tokenStructuralPropertyT = null!;\n }\n\n /**\n * Token purpose description.\n */\n readonly description?: string; // FIXME remove `?` for the next major version\n\n /**\n * The human readable name for the token.\n *\n * #### Notes\n * This can be useful for debugging and logging.\n */\n readonly name: string;\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n private _tokenStructuralPropertyT: T;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n// Fallback\nexport function fallbackRandomValues(buffer: Uint8Array): void {\n let value = 0;\n for (let i = 0, n = buffer.length; i < n; ++i) {\n if (i % 4 === 0) {\n value = (Math.random() * 0xffffffff) >>> 0;\n }\n buffer[i] = value & 0xff;\n value >>>= 8;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\nimport { fallbackRandomValues } from './random';\n\n// Declare ambient variables for `window` and `require` to avoid a\n// hard dependency on both. This package must run on node.\ndeclare let window: any;\n\n/**\n * The namespace for random number related functionality.\n */\nexport namespace Random {\n /**\n * A function which generates random bytes.\n *\n * @param buffer - The `Uint8Array` to fill with random bytes.\n *\n * #### Notes\n * A cryptographically strong random number generator will be used if\n * available. Otherwise, `Math.random` will be used as a fallback for\n * randomness.\n *\n * The following RNGs are supported, listed in order of precedence:\n * - `window.crypto.getRandomValues`\n * - `window.msCrypto.getRandomValues`\n * - `require('crypto').randomFillSync\n * - `require('crypto').randomBytes\n * - `Math.random`\n */\n export const getRandomValues = (() => {\n // Look up the crypto module if available.\n const crypto: any =\n (typeof window !== 'undefined' && (window.crypto || window.msCrypto)) ||\n null;\n\n // Modern browsers and IE 11\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return function getRandomValues(buffer: Uint8Array): void {\n return crypto.getRandomValues(buffer);\n };\n }\n\n // Fallback\n return fallbackRandomValues;\n })();\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A function which creates a function that generates UUID v4 identifiers.\n *\n * @returns A new function that creates a UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\nexport function uuid4Factory(\n getRandomValues: (bytes: Uint8Array) => void\n): () => string {\n // Create a 16 byte array to hold the random values.\n const bytes = new Uint8Array(16);\n\n // Create a look up table from bytes to hex strings.\n const lut = new Array<string>(256);\n\n // Pad the single character hex digits with a leading zero.\n for (let i = 0; i < 16; ++i) {\n lut[i] = '0' + i.toString(16);\n }\n\n // Populate the rest of the hex digits.\n for (let i = 16; i < 256; ++i) {\n lut[i] = i.toString(16);\n }\n\n // Return a function which generates the UUID.\n return function uuid4(): string {\n // Get a new batch of random values.\n getRandomValues(bytes);\n\n // Set the UUID version number to 4.\n bytes[6] = 0x40 | (bytes[6] & 0x0f);\n\n // Set the clock sequence bit to the RFC spec.\n bytes[8] = 0x80 | (bytes[8] & 0x3f);\n\n // Assemble the UUID string.\n return (\n lut[bytes[0]] +\n lut[bytes[1]] +\n lut[bytes[2]] +\n lut[bytes[3]] +\n '-' +\n lut[bytes[4]] +\n lut[bytes[5]] +\n '-' +\n lut[bytes[6]] +\n lut[bytes[7]] +\n '-' +\n lut[bytes[8]] +\n lut[bytes[9]] +\n '-' +\n lut[bytes[10]] +\n lut[bytes[11]] +\n lut[bytes[12]] +\n lut[bytes[13]] +\n lut[bytes[14]] +\n lut[bytes[15]]\n );\n };\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nimport { Random } from './random.browser';\nimport { uuid4Factory } from './uuid';\n\n/**\n * The namespace for UUID related functionality.\n */\nexport namespace UUID {\n /**\n * A function which generates UUID v4 identifiers.\n *\n * @returns A new UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\n export const uuid4 = uuid4Factory(Random.getRandomValues);\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module signaling\n */\nimport { ArrayExt, find } from '@lumino/algorithm';\nimport { PromiseDelegate } from '@lumino/coreutils';\n\n/**\n * A type alias for a slot function.\n *\n * @param sender - The object emitting the signal.\n *\n * @param args - The args object emitted with the signal.\n *\n * #### Notes\n * A slot is invoked when a signal to which it is connected is emitted.\n */\nexport type Slot<T, U> = (sender: T, args: U) => void;\n\n/**\n * An object used for type-safe inter-object communication.\n *\n * #### Notes\n * Signals provide a type-safe implementation of the publish-subscribe\n * pattern. An object (publisher) declares which signals it will emit,\n * and consumers connect callbacks (subscribers) to those signals. The\n * subscribers are invoked whenever the publisher emits the signal.\n */\nexport interface ISignal<T, U> {\n /**\n * Connect a slot to the signal.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n *\n * #### Notes\n * Slots are invoked in the order in which they are connected.\n *\n * Signal connections are unique. If a connection already exists for\n * the given `slot` and `thisArg`, this method returns `false`.\n *\n * A newly connected slot will not be invoked until the next time the\n * signal is emitted, even if the slot is connected while the signal\n * is dispatching.\n */\n connect(slot: Slot<T, U>, thisArg?: any): boolean;\n\n /**\n * Disconnect a slot from the signal.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n *\n * #### Notes\n * If no connection exists for the given `slot` and `thisArg`, this\n * method returns `false`.\n *\n * A disconnected slot will no longer be invoked, even if the slot\n * is disconnected while the signal is dispatching.\n */\n disconnect(slot: Slot<T, U>, thisArg?: any): boolean;\n}\n\n/**\n * An object that is both a signal and an async iterable.\n */\nexport interface IStream<T, U> extends ISignal<T, U>, AsyncIterable<U> {}\n\n/**\n * A concrete implementation of `ISignal`.\n *\n * #### Example\n * ```typescript\n * import { ISignal, Signal } from '@lumino/signaling';\n *\n * class SomeClass {\n *\n * constructor(name: string) {\n * this.name = name;\n * }\n *\n * readonly name: string;\n *\n * get valueChanged: ISignal<this, number> {\n * return this._valueChanged;\n * }\n *\n * get value(): number {\n * return this._value;\n * }\n *\n * set value(value: number) {\n * if (value === this._value) {\n * return;\n * }\n * this._value = value;\n * this._valueChanged.emit(value);\n * }\n *\n * private _value = 0;\n * private _valueChanged = new Signal<this, number>(this);\n * }\n *\n * function logger(sender: SomeClass, value: number): void {\n * console.log(sender.name, value);\n * }\n *\n * let m1 = new SomeClass('foo');\n * let m2 = new SomeClass('bar');\n *\n * m1.valueChanged.connect(logger);\n * m2.valueChanged.connect(logger);\n *\n * m1.value = 42; // logs: foo 42\n * m2.value = 17; // logs: bar 17\n * ```\n */\nexport class Signal<T, U> implements ISignal<T, U> {\n /**\n * Construct a new signal.\n *\n * @param sender - The sender which owns the signal.\n */\n constructor(sender: T) {\n this.sender = sender;\n }\n\n /**\n * The sender which owns the signal.\n */\n readonly sender: T;\n\n /**\n * Connect a slot to the signal.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n connect(slot: Slot<T, U>, thisArg?: unknown): boolean {\n return Private.connect(this, slot, thisArg);\n }\n\n /**\n * Disconnect a slot from the signal.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n disconnect(slot: Slot<T, U>, thisArg?: unknown): boolean {\n return Private.disconnect(this, slot, thisArg);\n }\n\n /**\n * Emit the signal and invoke the connected slots.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n emit(args: U): void {\n Private.emit(this, args);\n }\n}\n\n/**\n * The namespace for the `Signal` class statics.\n */\nexport namespace Signal {\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n export function disconnectBetween(sender: unknown, receiver: unknown): void {\n Private.disconnectBetween(sender, receiver);\n }\n\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n export function disconnectSender(sender: unknown): void {\n Private.disconnectSender(sender);\n }\n\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n export function disconnectReceiver(receiver: unknown): void {\n Private.disconnectReceiver(receiver);\n }\n\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n export function disconnectAll(object: unknown): void {\n Private.disconnectAll(object);\n }\n\n /**\n * Clear all signal data associated with the given object.\n *\n * @param object - The object for which the data should be cleared.\n *\n * #### Notes\n * This removes all signal connections and any other signal data\n * associated with the object.\n */\n export function clearData(object: unknown): void {\n Private.disconnectAll(object);\n }\n\n /**\n * A type alias for the exception handler function.\n */\n export type ExceptionHandler = (err: Error) => void;\n\n /**\n * Get the signal exception handler.\n *\n * @returns The current exception handler.\n *\n * #### Notes\n * The default exception handler is `console.error`.\n */\n export function getExceptionHandler(): ExceptionHandler {\n return Private.exceptionHandler;\n }\n\n /**\n * Set the signal exception handler.\n *\n * @param handler - The function to use as the exception handler.\n *\n * @returns The old exception handler.\n *\n * #### Notes\n * The exception handler is invoked when a slot throws an exception.\n */\n export function setExceptionHandler(\n handler: ExceptionHandler\n ): ExceptionHandler {\n let old = Private.exceptionHandler;\n Private.exceptionHandler = handler;\n return old;\n }\n}\n\n/**\n * A concrete implementation of `IStream`.\n *\n * #### Example\n * ```typescript\n * import { IStream, Stream } from '@lumino/signaling';\n *\n * class SomeClass {\n *\n * constructor(name: string) {\n * this.name = name;\n * }\n *\n * readonly name: string;\n *\n * get pings(): IStream<this, string> {\n * return this._pings;\n * }\n *\n * ping(value: string) {\n * this._pings.emit(value);\n * }\n *\n * private _pings = new Stream<this, string>(this);\n * }\n *\n * let m1 = new SomeClass('foo');\n *\n * m1.pings.connect((_, value: string) => {\n * console.log('connect', value);\n * });\n *\n * void (async () => {\n * for await (const ping of m1.pings) {\n * console.log('iterator', ping);\n * }\n * })();\n *\n * m1.ping('alpha'); // logs: connect alpha\n * // logs: iterator alpha\n * m1.ping('beta'); // logs: connect beta\n * // logs: iterator beta\n * ```\n */\nexport class Stream<T, U> extends Signal<T, U> implements IStream<T, U> {\n /**\n * Return an async iterator that yields every emission.\n */\n async *[Symbol.asyncIterator](): AsyncIterableIterator<U> {\n let pending = this._pending;\n while (true) {\n try {\n const { args, next } = await pending.promise;\n pending = next;\n yield args;\n } catch (_) {\n return; // Any promise rejection stops the iterator.\n }\n }\n }\n\n /**\n * Emit the signal, invoke the connected slots, and yield the emission.\n *\n * @param args - The args to pass to the connected slots.\n */\n emit(args: U): void {\n const pending = this._pending;\n const next = (this._pending = new PromiseDelegate());\n pending.resolve({ args, next });\n super.emit(args);\n }\n\n /**\n * Stop the stream's async iteration.\n */\n stop(): void {\n this._pending.promise.catch(() => undefined);\n this._pending.reject('stop');\n this._pending = new PromiseDelegate();\n }\n\n private _pending: Private.Pending<U> = new PromiseDelegate();\n}\n\n/**\n * The namespace for the module implementation details.\n */\nnamespace Private {\n /**\n * A pending promise in a promise chain underlying a stream.\n */\n export type Pending<U> = PromiseDelegate<{ args: U; next: Pending<U> }>;\n\n /**\n * The signal exception handler function.\n */\n export let exceptionHandler: Signal.ExceptionHandler = (err: Error) => {\n console.error(err);\n };\n\n /**\n * Connect a slot to a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n export function connect<T, U>(\n signal: Signal<T, U>,\n slot: Slot<T, U>,\n thisArg?: unknown\n ): boolean {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n\n // Ensure the sender's array of receivers is created.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers) {\n receivers = [];\n receiversForSender.set(signal.sender, receivers);\n }\n\n // Bail if a matching connection already exists.\n if (findConnection(receivers, signal, slot, thisArg)) {\n return false;\n }\n\n // Choose the best object for the receiver.\n let receiver = thisArg || slot;\n\n // Ensure the receiver's array of senders is created.\n let senders = sendersForReceiver.get(receiver);\n if (!senders) {\n senders = [];\n sendersForReceiver.set(receiver, senders);\n }\n\n // Create a new connection and add it to the end of each array.\n let connection = { signal, slot, thisArg };\n receivers.push(connection);\n senders.push(connection);\n\n // Indicate a successful connection.\n return true;\n }\n\n /**\n * Disconnect a slot from a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n export function disconnect<T, U>(\n signal: Signal<T, U>,\n slot: Slot<T, U>,\n thisArg?: unknown\n ): boolean {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n\n // Lookup the list of receivers, and bail if none exist.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return false;\n }\n\n // Bail if no matching connection exits.\n let connection = findConnection(receivers, signal, slot, thisArg);\n if (!connection) {\n return false;\n }\n\n // Choose the best object for the receiver.\n let receiver = thisArg || slot;\n\n // Lookup the array of senders, which is now known to exist.\n let senders = sendersForReceiver.get(receiver)!;\n\n // Clear the connection and schedule cleanup of the arrays.\n connection.signal = null;\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n\n // Indicate a successful disconnection.\n return true;\n }\n\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n */\n export function disconnectBetween(sender: unknown, receiver: unknown): void {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n\n // If there are no senders, there is nothing to do.\n let senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n\n // Clear each connection between the sender and receiver.\n for (const connection of senders) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n continue;\n }\n\n // Clear the connection if it matches the sender.\n if (connection.signal.sender === sender) {\n connection.signal = null;\n }\n }\n\n // Schedule a cleanup of the senders and receivers.\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n }\n\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n export function disconnectSender(sender: unknown): void {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n\n // Clear each receiver connection.\n for (const connection of receivers) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n continue;\n }\n\n // Choose the best object for the receiver.\n let receiver = connection.thisArg || connection.slot;\n\n // Clear the connection.\n connection.signal = null;\n\n // Cleanup the array of senders, which is now known to exist.\n scheduleCleanup(sendersForReceiver.get(receiver)!);\n }\n\n // Schedule a cleanup of the receivers.\n scheduleCleanup(receivers);\n }\n\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n */\n export function disconnectReceiver(receiver: unknown): void {\n // If there are no senders, there is nothing to do.\n let senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n\n // Clear each sender connection.\n for (const connection of senders) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n continue;\n }\n\n // Lookup the sender for the connection.\n let sender = connection.signal.sender;\n\n // Clear the connection.\n connection.signal = null;\n\n // Cleanup the array of receivers, which is now known to exist.\n scheduleCleanup(receiversForSender.get(sender)!);\n }\n\n // Schedule a cleanup of the list of senders.\n scheduleCleanup(senders);\n }\n\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n */\n export function disconnectAll(object: unknown): void {\n // Remove all connections where the given object is the sender.\n disconnectSender(object);\n // Remove all connections where the given object is the receiver.\n disconnectReceiver(object);\n }\n\n /**\n * Emit a signal and invoke its connected slots.\n *\n * @param signal - The signal of interest.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n export function emit<T, U>(signal: Signal<T, U>, args: U): void {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n\n // Invoke the slots for connections with a matching signal.\n // Any connections added during emission are not invoked.\n for (let i = 0, n = receivers.length; i < n; ++i) {\n let connection = receivers[i];\n if (connection.signal === signal) {\n invokeSlot(connection, args);\n }\n }\n }\n\n /**\n * An object which holds connection data.\n */\n interface IConnection {\n /**\n * The signal for the connection.\n *\n * A `null` signal indicates a cleared connection.\n */\n signal: Signal<any, any> | null;\n\n /**\n * The slot connected to the signal.\n */\n readonly slot: Slot<any, any>;\n\n /**\n * The `this` context for the slot.\n */\n readonly thisArg: any;\n }\n\n /**\n * A weak mapping of sender to array of receiver connections.\n */\n const receiversForSender = new WeakMap<any, IConnection[]>();\n\n /**\n * A weak mapping of receiver to array of sender connections.\n */\n const sendersForReceiver = new WeakMap<any, IConnection[]>();\n\n /**\n * A set of connection arrays which are pending cleanup.\n */\n const dirtySet = new Set<IConnection[]>();\n\n /**\n * A function to schedule an event loop callback.\n */\n const schedule = (() => {\n let ok = typeof requestAnimationFrame === 'function';\n return ok ? requestAnimationFrame : setImmediate;\n })();\n\n /**\n * Find a connection which matches the given parameters.\n */\n function findConnection(\n connections: IConnection[],\n signal: Signal<any, any>,\n slot: Slot<any, any>,\n thisArg: any\n ): IConnection | undefined {\n return find(\n connections,\n connection =>\n connection.signal === signal &&\n connection.slot === slot &&\n connection.thisArg === thisArg\n );\n }\n\n /**\n * Invoke a slot with the given parameters.\n *\n * The connection is assumed to be valid.\n *\n * Exceptions in the slot will be caught and logged.\n */\n function invokeSlot(connection: IConnection, args: any): void {\n let { signal, slot, thisArg } = connection;\n try {\n slot.call(thisArg, signal!.sender, args);\n } catch (err) {\n exceptionHandler(err);\n }\n }\n\n /**\n * Schedule a cleanup of a connection array.\n *\n * This will add the array to the dirty set and schedule a deferred\n * cleanup of the array contents. On cleanup, any connection with a\n * `null` signal will be removed from the array.\n */\n function scheduleCleanup(array: IConnection[]): void {\n if (dirtySet.size === 0) {\n schedule(cleanupDirtySet);\n }\n dirtySet.add(array);\n }\n\n /**\n * Cleanup the connection lists in the dirty set.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupDirtySet(): void {\n dirtySet.forEach(cleanupConnections);\n dirtySet.clear();\n }\n\n /**\n * Cleanup the dirty connections in a connections array.\n *\n * This will remove any connection with a `null` signal.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupConnections(connections: IConnection[]): void {\n ArrayExt.removeAllWhere(connections, isDeadConnection);\n }\n\n /**\n * Test whether a connection is dead.\n *\n * A dead connection has a `null` signal.\n */\n function isDeadConnection(connection: IConnection): boolean {\n return connection.signal === null;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { IDisposable } from '@lumino/disposable';\nimport { ISignal, Signal } from '@lumino/signaling';\n\n/**\n * A class that monitors activity on a signal.\n */\nexport class ActivityMonitor<Sender, Args> implements IDisposable {\n /**\n * Construct a new activity monitor.\n */\n constructor(options: ActivityMonitor.IOptions<Sender, Args>) {\n options.signal.connect(this._onSignalFired, this);\n this._timeout = options.timeout || 1000;\n }\n\n /**\n * A signal emitted when activity has ceased.\n */\n get activityStopped(): ISignal<\n this,\n ActivityMonitor.IArguments<Sender, Args>\n > {\n return this._activityStopped;\n }\n\n /**\n * The timeout associated with the monitor, in milliseconds.\n */\n get timeout(): number {\n return this._timeout;\n }\n set timeout(value: number) {\n this._timeout = value;\n }\n\n /**\n * Test whether the monitor has been disposed.\n *\n * #### Notes\n * This is a read-only property.\n */\n get isDisposed(): boolean {\n return this._isDisposed;\n }\n\n /**\n * Dispose of the resources used by the activity monitor.\n */\n dispose(): void {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n Signal.clearData(this);\n }\n\n /**\n * A signal handler for the monitored signal.\n */\n private _onSignalFired(sender: Sender, args: Args): void {\n clearTimeout(this._timer);\n this._sender = sender;\n this._args = args;\n this._timer = setTimeout(() => {\n this._activityStopped.emit({\n sender: this._sender,\n args: this._args\n });\n }, this._timeout);\n }\n\n private _timer: any = -1;\n private _timeout = -1;\n private _sender: Sender;\n private _args: Args;\n private _isDisposed = false;\n private _activityStopped = new Signal<\n this,\n ActivityMonitor.IArguments<Sender, Args>\n >(this);\n}\n\n/**\n * The namespace for `ActivityMonitor` statics.\n */\nexport namespace ActivityMonitor {\n /**\n * The options used to construct a new `ActivityMonitor`.\n */\n export interface IOptions<Sender, Args> {\n /**\n * The signal to monitor.\n */\n signal: ISignal<Sender, Args>;\n\n /**\n * The activity timeout in milliseconds.\n *\n * The default is 1 second.\n */\n timeout?: number;\n }\n\n /**\n * The argument object for an activity timeout.\n *\n */\n export interface IArguments<Sender, Args> {\n /**\n * The most recent sender object.\n */\n sender: Sender;\n\n /**\n * The most recent argument object.\n */\n args: Args;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nconst DEFAULT_MAX_SIZE = 128;\n\n/** A least-recently-used cache. */\nexport class LruCache<T, U> {\n protected _map = new Map<T, U>();\n protected _maxSize: number;\n\n constructor(options: LruCache.IOptions = {}) {\n this._maxSize = options?.maxSize || DEFAULT_MAX_SIZE;\n }\n\n /**\n * Return the current size of the cache.\n */\n get size() {\n return this._map.size;\n }\n\n /**\n * Clear the values in the cache.\n */\n clear() {\n this._map.clear();\n }\n\n /**\n * Get a value (or null) from the cache, pushing the item to the front of the cache.\n */\n get(key: T): U | null {\n const item = this._map.get(key) || null;\n if (item != null) {\n this._map.delete(key);\n this._map.set(key, item);\n }\n return item;\n }\n\n /**\n * Set a value in the cache, potentially evicting an old item.\n */\n set(key: T, value: U): void {\n if (this._map.size >= this._maxSize) {\n this._map.delete(this._map.keys().next().value);\n }\n this._map.set(key, value);\n }\n}\n\nexport namespace LruCache {\n export interface IOptions {\n maxSize?: number | null;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/**\n * The namespace for code block functions which help\n * in extract code from markdown text\n */\nexport namespace MarkdownCodeBlocks {\n export const CODE_BLOCK_MARKER = '```';\n const markdownExtensions: string[] = [\n '.markdown',\n '.mdown',\n '.mkdn',\n '.md',\n '.mkd',\n '.mdwn',\n '.mdtxt',\n '.mdtext',\n '.text',\n '.txt',\n '.Rmd'\n ];\n\n export class MarkdownCodeBlock {\n startLine: number;\n endLine: number;\n code: string;\n constructor(startLine: number) {\n this.startLine = startLine;\n this.code = '';\n this.endLine = -1;\n }\n }\n\n /**\n * Check whether the given file extension is a markdown extension\n * @param extension - A file extension\n *\n * @returns true/false depending on whether this is a supported markdown extension\n */\n export function isMarkdown(extension: string): boolean {\n return markdownExtensions.indexOf(extension) > -1;\n }\n\n /**\n * Construct all code snippets from current text\n * (this could be potentially optimized if we can cache and detect differences)\n * @param text - A string to parse codeblocks from\n *\n * @returns An array of MarkdownCodeBlocks.\n */\n export function findMarkdownCodeBlocks(text: string): MarkdownCodeBlock[] {\n if (!text || text === '') {\n return [];\n }\n\n const lines = text.split('\\n');\n const codeBlocks: MarkdownCodeBlock[] = [];\n let currentBlock = null;\n for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n const line = lines[lineIndex];\n const lineContainsMarker = line.indexOf(CODE_BLOCK_MARKER) === 0;\n const constructingBlock = currentBlock != null;\n // Skip this line if it is not part of any code block and doesn't contain a marker.\n if (!lineContainsMarker && !constructingBlock) {\n continue;\n }\n\n // Check if we are already constructing a code block.\n if (!constructingBlock) {\n // Start constructing a new code block.\n currentBlock = new MarkdownCodeBlock(lineIndex);\n\n // Check whether this is a single line code block of the form ```a = 10```.\n const firstIndex = line.indexOf(CODE_BLOCK_MARKER);\n const lastIndex = line.lastIndexOf(CODE_BLOCK_MARKER);\n const isSingleLine = firstIndex !== lastIndex;\n if (isSingleLine) {\n currentBlock.code = line.substring(\n firstIndex + CODE_BLOCK_MARKER.length,\n lastIndex\n );\n currentBlock.endLine = lineIndex;\n codeBlocks.push(currentBlock);\n currentBlock = null;\n }\n } else if (currentBlock) {\n if (lineContainsMarker) {\n // End of block, finish it up.\n currentBlock.endLine = lineIndex - 1;\n codeBlocks.push(currentBlock);\n currentBlock = null;\n } else {\n // Append the current line.\n currentBlock.code += line + '\\n';\n }\n }\n }\n return codeBlocks;\n }\n}\n", "'use strict';\n\nfunction hasKey(obj, keys) {\n\tvar o = obj;\n\tkeys.slice(0, -1).forEach(function (key) {\n\t\to = o[key] || {};\n\t});\n\n\tvar key = keys[keys.length - 1];\n\treturn key in o;\n}\n\nfunction isNumber(x) {\n\tif (typeof x === 'number') { return true; }\n\tif ((/^0x[0-9a-f]+$/i).test(x)) { return true; }\n\treturn (/^[-+]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(e[-+]?\\d+)?$/).test(x);\n}\n\nfunction isConstructorOrProto(obj, key) {\n\treturn (key === 'constructor' && typeof obj[key] === 'function') || key === '__proto__';\n}\n\nmodule.exports = function (args, opts) {\n\tif (!opts) { opts = {}; }\n\n\tvar flags = {\n\t\tbools: {},\n\t\tstrings: {},\n\t\tunknownFn: null,\n\t};\n\n\tif (typeof opts.unknown === 'function') {\n\t\tflags.unknownFn = opts.unknown;\n\t}\n\n\tif (typeof opts.boolean === 'boolean' && opts.boolean) {\n\t\tflags.allBools = true;\n\t} else {\n\t\t[].concat(opts.boolean).filter(Boolean).forEach(function (key) {\n\t\t\tflags.bools[key] = true;\n\t\t});\n\t}\n\n\tvar aliases = {};\n\n\tfunction aliasIsBoolean(key) {\n\t\treturn aliases[key].some(function (x) {\n\t\t\treturn flags.bools[x];\n\t\t});\n\t}\n\n\tObject.keys(opts.alias || {}).forEach(function (key) {\n\t\taliases[key] = [].concat(opts.alias[key]);\n\t\taliases[key].forEach(function (x) {\n\t\t\taliases[x] = [key].concat(aliases[key].filter(function (y) {\n\t\t\t\treturn x !== y;\n\t\t\t}));\n\t\t});\n\t});\n\n\t[].concat(opts.string).filter(Boolean).forEach(function (key) {\n\t\tflags.strings[key] = true;\n\t\tif (aliases[key]) {\n\t\t\t[].concat(aliases[key]).forEach(function (k) {\n\t\t\t\tflags.strings[k] = true;\n\t\t\t});\n\t\t}\n\t});\n\n\tvar defaults = opts.default || {};\n\n\tvar argv = { _: [] };\n\n\tfunction argDefined(key, arg) {\n\t\treturn (flags.allBools && (/^--[^=]+$/).test(arg))\n\t\t\t|| flags.strings[key]\n\t\t\t|| flags.bools[key]\n\t\t\t|| aliases[key];\n\t}\n\n\tfunction setKey(obj, keys, value) {\n\t\tvar o = obj;\n\t\tfor (var i = 0; i < keys.length - 1; i++) {\n\t\t\tvar key = keys[i];\n\t\t\tif (isConstructorOrProto(o, key)) { return; }\n\t\t\tif (o[key] === undefined) { o[key] = {}; }\n\t\t\tif (\n\t\t\t\to[key] === Object.prototype\n\t\t\t\t|| o[key] === Number.prototype\n\t\t\t\t|| o[key] === String.prototype\n\t\t\t) {\n\t\t\t\to[key] = {};\n\t\t\t}\n\t\t\tif (o[key] === Array.prototype) { o[key] = []; }\n\t\t\to = o[key];\n\t\t}\n\n\t\tvar lastKey = keys[keys.length - 1];\n\t\tif (isConstructorOrProto(o, lastKey)) { return; }\n\t\tif (\n\t\t\to === Object.prototype\n\t\t\t|| o === Number.prototype\n\t\t\t|| o === String.prototype\n\t\t) {\n\t\t\to = {};\n\t\t}\n\t\tif (o === Array.prototype) { o = []; }\n\t\tif (o[lastKey] === undefined || flags.bools[lastKey] || typeof o[lastKey] === 'boolean') {\n\t\t\to[lastKey] = value;\n\t\t} else if (Array.isArray(o[lastKey])) {\n\t\t\to[lastKey].push(value);\n\t\t} else {\n\t\t\to[lastKey] = [o[lastKey], value];\n\t\t}\n\t}\n\n\tfunction setArg(key, val, arg) {\n\t\tif (arg && flags.unknownFn && !argDefined(key, arg)) {\n\t\t\tif (flags.unknownFn(arg) === false) { return; }\n\t\t}\n\n\t\tvar value = !flags.strings[key] && isNumber(val)\n\t\t\t? Number(val)\n\t\t\t: val;\n\t\tsetKey(argv, key.split('.'), value);\n\n\t\t(aliases[key] || []).forEach(function (x) {\n\t\t\tsetKey(argv, x.split('.'), value);\n\t\t});\n\t}\n\n\tObject.keys(flags.bools).forEach(function (key) {\n\t\tsetArg(key, defaults[key] === undefined ? false : defaults[key]);\n\t});\n\n\tvar notFlags = [];\n\n\tif (args.indexOf('--') !== -1) {\n\t\tnotFlags = args.slice(args.indexOf('--') + 1);\n\t\targs = args.slice(0, args.indexOf('--'));\n\t}\n\n\tfor (var i = 0; i < args.length; i++) {\n\t\tvar arg = args[i];\n\t\tvar key;\n\t\tvar next;\n\n\t\tif ((/^--.+=/).test(arg)) {\n\t\t\t// Using [\\s\\S] instead of . because js doesn't support the\n\t\t\t// 'dotall' regex modifier. See:\n\t\t\t// http://stackoverflow.com/a/1068308/13216\n\t\t\tvar m = arg.match(/^--([^=]+)=([\\s\\S]*)$/);\n\t\t\tkey = m[1];\n\t\t\tvar value = m[2];\n\t\t\tif (flags.bools[key]) {\n\t\t\t\tvalue = value !== 'false';\n\t\t\t}\n\t\t\tsetArg(key, value, arg);\n\t\t} else if ((/^--no-.+/).test(arg)) {\n\t\t\tkey = arg.match(/^--no-(.+)/)[1];\n\t\t\tsetArg(key, false, arg);\n\t\t} else if ((/^--.+/).test(arg)) {\n\t\t\tkey = arg.match(/^--(.+)/)[1];\n\t\t\tnext = args[i + 1];\n\t\t\tif (\n\t\t\t\tnext !== undefined\n\t\t\t\t&& !(/^(-|--)[^-]/).test(next)\n\t\t\t\t&& !flags.bools[key]\n\t\t\t\t&& !flags.allBools\n\t\t\t\t&& (aliases[key] ? !aliasIsBoolean(key) : true)\n\t\t\t) {\n\t\t\t\tsetArg(key, next, arg);\n\t\t\t\ti += 1;\n\t\t\t} else if ((/^(true|false)$/).test(next)) {\n\t\t\t\tsetArg(key, next === 'true', arg);\n\t\t\t\ti += 1;\n\t\t\t} else {\n\t\t\t\tsetArg(key, flags.strings[key] ? '' : true, arg);\n\t\t\t}\n\t\t} else if ((/^-[^-]+/).test(arg)) {\n\t\t\tvar letters = arg.slice(1, -1).split('');\n\n\t\t\tvar broken = false;\n\t\t\tfor (var j = 0; j < letters.length; j++) {\n\t\t\t\tnext = arg.slice(j + 2);\n\n\t\t\t\tif (next === '-') {\n\t\t\t\t\tsetArg(letters[j], next, arg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ((/[A-Za-z]/).test(letters[j]) && next[0] === '=') {\n\t\t\t\t\tsetArg(letters[j], next.slice(1), arg);\n\t\t\t\t\tbroken = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(/[A-Za-z]/).test(letters[j])\n\t\t\t\t\t&& (/-?\\d+(\\.\\d*)?(e-?\\d+)?$/).test(next)\n\t\t\t\t) {\n\t\t\t\t\tsetArg(letters[j], next, arg);\n\t\t\t\t\tbroken = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (letters[j + 1] && letters[j + 1].match(/\\W/)) {\n\t\t\t\t\tsetArg(letters[j], arg.slice(j + 2), arg);\n\t\t\t\t\tbroken = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tsetArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tkey = arg.slice(-1)[0];\n\t\t\tif (!broken && key !== '-') {\n\t\t\t\tif (\n\t\t\t\t\targs[i + 1]\n\t\t\t\t\t&& !(/^(-|--)[^-]/).test(args[i + 1])\n\t\t\t\t\t&& !flags.bools[key]\n\t\t\t\t\t&& (aliases[key] ? !aliasIsBoolean(key) : true)\n\t\t\t\t) {\n\t\t\t\t\tsetArg(key, args[i + 1], arg);\n\t\t\t\t\ti += 1;\n\t\t\t\t} else if (args[i + 1] && (/^(true|false)$/).test(args[i + 1])) {\n\t\t\t\t\tsetArg(key, args[i + 1] === 'true', arg);\n\t\t\t\t\ti += 1;\n\t\t\t\t} else {\n\t\t\t\t\tsetArg(key, flags.strings[key] ? '' : true, arg);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!flags.unknownFn || flags.unknownFn(arg) !== false) {\n\t\t\t\targv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));\n\t\t\t}\n\t\t\tif (opts.stopEarly) {\n\t\t\t\targv._.push.apply(argv._, args.slice(i + 1));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tObject.keys(defaults).forEach(function (k) {\n\t\tif (!hasKey(argv, k.split('.'))) {\n\t\t\tsetKey(argv, k.split('.'), defaults[k]);\n\n\t\t\t(aliases[k] || []).forEach(function (x) {\n\t\t\t\tsetKey(argv, x.split('.'), defaults[k]);\n\t\t\t});\n\t\t}\n\t});\n\n\tif (opts['--']) {\n\t\targv['--'] = notFlags.slice();\n\t} else {\n\t\tnotFlags.forEach(function (k) {\n\t\t\targv._.push(k);\n\t\t});\n\t}\n\n\treturn argv;\n};\n", "// 'path' module extracted from Node.js v8.11.1 (only the posix part)\n// transplited with Babel\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}\n\n// Resolves . and .. elements in a path with directory names\nfunction normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n\nfunction _format(sep, pathObject) {\n var dir = pathObject.dir || pathObject.root;\n var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');\n if (!dir) {\n return base;\n }\n if (dir === pathObject.root) {\n return dir + base;\n }\n return dir + sep + base;\n}\n\nvar posix = {\n // path.resolve([from ...], to)\n resolve: function resolve() {\n var resolvedPath = '';\n var resolvedAbsolute = false;\n var cwd;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path;\n if (i >= 0)\n path = arguments[i];\n else {\n if (cwd === undefined)\n cwd = process.cwd();\n path = cwd;\n }\n\n assertPath(path);\n\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);\n\n if (resolvedAbsolute) {\n if (resolvedPath.length > 0)\n return '/' + resolvedPath;\n else\n return '/';\n } else if (resolvedPath.length > 0) {\n return resolvedPath;\n } else {\n return '.';\n }\n },\n\n normalize: function normalize(path) {\n assertPath(path);\n\n if (path.length === 0) return '.';\n\n var isAbsolute = path.charCodeAt(0) === 47 /*/*/;\n var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;\n\n // Normalize the path\n path = normalizeStringPosix(path, !isAbsolute);\n\n if (path.length === 0 && !isAbsolute) path = '.';\n if (path.length > 0 && trailingSeparator) path += '/';\n\n if (isAbsolute) return '/' + path;\n return path;\n },\n\n isAbsolute: function isAbsolute(path) {\n assertPath(path);\n return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;\n },\n\n join: function join() {\n if (arguments.length === 0)\n return '.';\n var joined;\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n assertPath(arg);\n if (arg.length > 0) {\n if (joined === undefined)\n joined = arg;\n else\n joined += '/' + arg;\n }\n }\n if (joined === undefined)\n return '.';\n return posix.normalize(joined);\n },\n\n relative: function relative(from, to) {\n assertPath(from);\n assertPath(to);\n\n if (from === to) return '';\n\n from = posix.resolve(from);\n to = posix.resolve(to);\n\n if (from === to) return '';\n\n // Trim any leading backslashes\n var fromStart = 1;\n for (; fromStart < from.length; ++fromStart) {\n if (from.charCodeAt(fromStart) !== 47 /*/*/)\n break;\n }\n var fromEnd = from.length;\n var fromLen = fromEnd - fromStart;\n\n // Trim any leading backslashes\n var toStart = 1;\n for (; toStart < to.length; ++toStart) {\n if (to.charCodeAt(toStart) !== 47 /*/*/)\n break;\n }\n var toEnd = to.length;\n var toLen = toEnd - toStart;\n\n // Compare paths to find the longest common path from root\n var length = fromLen < toLen ? fromLen : toLen;\n var lastCommonSep = -1;\n var i = 0;\n for (; i <= length; ++i) {\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === 47 /*/*/) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='/foo/bar'; to='/foo/bar/baz'\n return to.slice(toStart + i + 1);\n } else if (i === 0) {\n // We get here if `from` is the root\n // For example: from='/'; to='/foo'\n return to.slice(toStart + i);\n }\n } else if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === 47 /*/*/) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='/foo/bar/baz'; to='/foo/bar'\n lastCommonSep = i;\n } else if (i === 0) {\n // We get here if `to` is the root.\n // For example: from='/foo'; to='/'\n lastCommonSep = 0;\n }\n }\n break;\n }\n var fromCode = from.charCodeAt(fromStart + i);\n var toCode = to.charCodeAt(toStart + i);\n if (fromCode !== toCode)\n break;\n else if (fromCode === 47 /*/*/)\n lastCommonSep = i;\n }\n\n var out = '';\n // Generate the relative path based on the path difference between `to`\n // and `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {\n if (out.length === 0)\n out += '..';\n else\n out += '/..';\n }\n }\n\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0)\n return out + to.slice(toStart + lastCommonSep);\n else {\n toStart += lastCommonSep;\n if (to.charCodeAt(toStart) === 47 /*/*/)\n ++toStart;\n return to.slice(toStart);\n }\n },\n\n _makeLong: function _makeLong(path) {\n return path;\n },\n\n dirname: function dirname(path) {\n assertPath(path);\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) return '//';\n return path.slice(0, end);\n },\n\n basename: function basename(path, ext) {\n if (ext !== undefined && typeof ext !== 'string') throw new TypeError('\"ext\" argument must be a string');\n assertPath(path);\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext.length === path.length && ext === path) return '';\n var extIdx = ext.length - 1;\n var firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n\n if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;\n return path.slice(start, end);\n } else {\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n }\n },\n\n extname: function extname(path) {\n assertPath(path);\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n },\n\n format: function format(pathObject) {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new TypeError('The \"pathObject\" argument must be of type Object. Received type ' + typeof pathObject);\n }\n return _format('/', pathObject);\n },\n\n parse: function parse(path) {\n assertPath(path);\n\n var ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) return ret;\n var code = path.charCodeAt(0);\n var isAbsolute = code === 47 /*/*/;\n var start;\n if (isAbsolute) {\n ret.root = '/';\n start = 1;\n } else {\n start = 0;\n }\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n var i = path.length - 1;\n\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n\n // Get non-dir info\n for (; i >= start; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n if (end !== -1) {\n if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);\n }\n } else {\n if (startPart === 0 && isAbsolute) {\n ret.name = path.slice(1, startDot);\n ret.base = path.slice(1, end);\n } else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n }\n ret.ext = path.slice(startDot, end);\n }\n\n if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';\n\n return ret;\n },\n\n sep: '/',\n delimiter: ':',\n win32: null,\n posix: null\n};\n\nposix.posix = posix;\n\nmodule.exports = posix;\n", "'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) return false;\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n", "'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g\n , result = {}\n , part;\n\n while (part = parser.exec(query)) {\n var key = decode(part[1])\n , value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) continue;\n result[key] = value;\n }\n\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n\n var pairs = []\n , value\n , key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) prefix = '?';\n\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) continue;\n pairs.push(key +'='+ value);\n }\n }\n\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nexports.stringify = querystringify;\nexports.parse = querystring;\n", "'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , controlOrWhitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n , CRHTLF = /[\\n\\r\\t]/g\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , port = /:\\d+$/\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/;\n\n/**\n * Remove control characters and whitespace from the beginning of a string.\n *\n * @param {Object|String} str String to trim.\n * @returns {String} A new string representing `str` stripped of control\n * characters and whitespace from its beginning.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(controlOrWhitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d*)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@'\n ? address.lastIndexOf(parse)\n : address.indexOf(parse);\n\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n\n if (url.auth) {\n index = url.auth.indexOf(':');\n\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password))\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (port.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n\n case 'auth':\n var index = value.indexOf(':');\n\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , host = url.host\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result =\n protocol +\n ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n } else if (url.password) {\n result += ':'+ url.password;\n result += '@';\n } else if (\n url.protocol !== 'file:' &&\n isSpecial(url.protocol) &&\n !host &&\n url.pathname !== '/'\n ) {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {\n host += ':';\n }\n\n result += host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { PartialJSONObject } from '@lumino/coreutils';\nimport { posix } from 'path';\nimport urlparse from 'url-parse';\n\n/**\n * The namespace for URL-related functions.\n */\nexport namespace URLExt {\n /**\n * Parse a url into a URL object.\n *\n * @param url - The URL string to parse.\n *\n * @returns A URL object.\n */\n export function parse(url: string): IUrl {\n if (typeof document !== 'undefined' && document) {\n const a = document.createElement('a');\n a.href = url;\n return a;\n }\n return urlparse(url);\n }\n\n /**\n * Parse URL and retrieve hostname\n *\n * @param url - The URL string to parse\n *\n * @returns a hostname string value\n */\n export function getHostName(url: string): string {\n return urlparse(url).hostname;\n }\n /**\n * Normalize a url.\n */\n export function normalize(url: string): string;\n export function normalize(url: undefined): undefined;\n export function normalize(url: string | undefined): string | undefined;\n export function normalize(url: string | undefined): string | undefined {\n return url && parse(url).toString();\n }\n\n /**\n * Join a sequence of url components and normalizes as in node `path.join`.\n *\n * @param parts - The url components.\n *\n * @returns the joined url.\n */\n export function join(...parts: string[]): string {\n let u = urlparse(parts[0], {});\n // Schema-less URL can be only parsed as relative to a base URL\n // see https://github.com/unshiftio/url-parse/issues/219#issuecomment-1002219326\n const isSchemaLess = u.protocol === '' && u.slashes;\n if (isSchemaLess) {\n u = urlparse(parts[0], 'https:' + parts[0]);\n }\n const prefix = `${isSchemaLess ? '' : u.protocol}${u.slashes ? '//' : ''}${\n u.auth\n }${u.auth ? '@' : ''}${u.host}`;\n // If there was a prefix, then the first path must start at the root.\n const path = posix.join(\n `${!!prefix && u.pathname[0] !== '/' ? '/' : ''}${u.pathname}`,\n ...parts.slice(1)\n );\n return `${prefix}${path === '.' ? '' : path}`;\n }\n\n /**\n * Encode the components of a multi-segment url.\n *\n * @param url - The url to encode.\n *\n * @returns the encoded url.\n *\n * #### Notes\n * Preserves the `'/'` separators.\n * Should not include the base url, since all parts are escaped.\n */\n export function encodeParts(url: string): string {\n return join(...url.split('/').map(encodeURIComponent));\n }\n\n /**\n * Return a serialized object string suitable for a query.\n *\n * @param value The source object.\n *\n * @returns an encoded url query.\n *\n * #### Notes\n * Modified version of [stackoverflow](http://stackoverflow.com/a/30707423).\n */\n export function objectToQueryString(value: PartialJSONObject): string {\n const keys = Object.keys(value).filter(key => key.length > 0);\n\n if (!keys.length) {\n return '';\n }\n\n return (\n '?' +\n keys\n .map(key => {\n const content = encodeURIComponent(String(value[key]));\n\n return key + (content ? '=' + content : '');\n })\n .join('&')\n );\n }\n\n /**\n * Return a parsed object that represents the values in a query string.\n */\n export function queryStringToObject(value: string): {\n [key: string]: string | undefined;\n } {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce(\n (acc, val) => {\n const [key, value] = val.split('=');\n\n if (key.length > 0) {\n acc[key] = decodeURIComponent(value || '');\n }\n\n return acc;\n },\n {} as { [key: string]: string }\n );\n }\n\n /**\n * Test whether the url is a local url.\n *\n * @param allowRoot - Whether the paths starting at Unix-style filesystem root (`/`) are permitted.\n *\n * #### Notes\n * This function returns `false` for any fully qualified url, including\n * `data:`, `file:`, and `//` protocol URLs.\n */\n export function isLocal(url: string, allowRoot: boolean = false): boolean {\n const { protocol } = parse(url);\n\n return (\n (!protocol || url.toLowerCase().indexOf(protocol) !== 0) &&\n (allowRoot ? url.indexOf('//') !== 0 : url.indexOf('/') !== 0)\n );\n }\n\n /**\n * The interface for a URL object\n */\n export interface IUrl {\n /**\n * The full URL string that was parsed with both the protocol and host\n * components converted to lower-case.\n */\n href: string;\n\n /**\n * Identifies the URL's lower-cased protocol scheme.\n */\n protocol: string;\n\n /**\n * The full lower-cased host portion of the URL, including the port if\n * specified.\n */\n host: string;\n\n /**\n * The lower-cased host name portion of the host component without the\n * port included.\n */\n hostname: string;\n\n /**\n * The numeric port portion of the host component.\n */\n port: string;\n\n /**\n * The entire path section of the URL.\n */\n pathname: string;\n\n /**\n * The \"fragment\" portion of the URL including the leading ASCII hash\n * `(#)` character\n */\n hash: string;\n\n /**\n * The search element, including leading question mark (`'?'`), if any,\n * of the URL.\n */\n search?: string;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { JSONExt } from '@lumino/coreutils';\nimport minimist from 'minimist';\nimport { URLExt } from './url';\n\n/**\n * Declare stubs for the node variables.\n */\ndeclare let process: any;\ndeclare let require: any;\n\n/**\n * The namespace for `PageConfig` functions.\n */\nexport namespace PageConfig {\n /**\n * Get global configuration data for the Jupyter application.\n *\n * @param name - The name of the configuration option.\n *\n * @returns The config value or an empty string if not found.\n *\n * #### Notes\n * All values are treated as strings.\n * For browser based applications, it is assumed that the page HTML\n * includes a script tag with the id `jupyter-config-data` containing the\n * configuration as valid JSON. In order to support the classic Notebook,\n * we fall back on checking for `body` data of the given `name`.\n *\n * For node applications, it is assumed that the process was launched\n * with a `--jupyter-config-data` option pointing to a JSON settings\n * file.\n */\n export function getOption(name: string): string {\n if (configData) {\n return configData[name] || getBodyData(name);\n }\n configData = Object.create(null);\n let found = false;\n\n // Use script tag if available.\n if (typeof document !== 'undefined' && document) {\n const el = document.getElementById('jupyter-config-data');\n\n if (el) {\n configData = JSON.parse(el.textContent || '') as {\n [key: string]: string;\n };\n found = true;\n }\n }\n // Otherwise use CLI if given.\n if (!found && typeof process !== 'undefined' && process.argv) {\n try {\n const cli = minimist(process.argv.slice(2));\n const path: any = require('path');\n let fullPath = '';\n if ('jupyter-config-data' in cli) {\n fullPath = path.resolve(cli['jupyter-config-data']);\n } else if ('JUPYTER_CONFIG_DATA' in process.env) {\n fullPath = path.resolve(process.env['JUPYTER_CONFIG_DATA']);\n }\n if (fullPath) {\n // Force Webpack to ignore this require.\n // eslint-disable-next-line\n configData = eval('require')(fullPath) as { [key: string]: string };\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n if (!JSONExt.isObject(configData)) {\n configData = Object.create(null);\n } else {\n for (const key in configData) {\n // PageConfig expects strings\n if (typeof configData[key] !== 'string') {\n configData[key] = JSON.stringify(configData[key]);\n }\n }\n }\n return configData![name] || getBodyData(name);\n }\n\n /**\n * Set global configuration data for the Jupyter application.\n *\n * @param name - The name of the configuration option.\n * @param value - The value to set the option to.\n *\n * @returns The last config value or an empty string if it doesn't exist.\n */\n export function setOption(name: string, value: string): string {\n const last = getOption(name);\n\n configData![name] = value;\n return last;\n }\n\n /**\n * Get the base url for a Jupyter application, or the base url of the page.\n */\n export function getBaseUrl(): string {\n return URLExt.normalize(getOption('baseUrl') || '/');\n }\n\n /**\n * Get the tree url for a JupyterLab application.\n */\n export function getTreeUrl(): string {\n return URLExt.join(getBaseUrl(), getOption('treeUrl'));\n }\n\n /**\n * Get the base url for sharing links (usually baseUrl)\n */\n export function getShareUrl(): string {\n return URLExt.normalize(getOption('shareUrl') || getBaseUrl());\n }\n\n /**\n * Get the tree url for shareable links.\n * Usually the same as treeUrl,\n * but overrideable e.g. when sharing with JupyterHub.\n */\n export function getTreeShareUrl(): string {\n return URLExt.normalize(URLExt.join(getShareUrl(), getOption('treeUrl')));\n }\n\n /**\n * Create a new URL given an optional mode and tree path.\n *\n * This is used to create URLS when the mode or tree path change as the user\n * changes mode or the current document in the main area. If fields in\n * options are omitted, the value in PageConfig will be used.\n *\n * @param options - IGetUrlOptions for the new path.\n */\n export function getUrl(options: IGetUrlOptions): string {\n let path = options.toShare ? getShareUrl() : getBaseUrl();\n const mode = options.mode ?? getOption('mode');\n const workspace = options.workspace ?? getOption('workspace');\n const labOrDoc = mode === 'single-document' ? 'doc' : 'lab';\n path = URLExt.join(path, labOrDoc);\n if (workspace !== defaultWorkspace) {\n path = URLExt.join(\n path,\n 'workspaces',\n encodeURIComponent(getOption('workspace') ?? defaultWorkspace)\n );\n }\n const treePath = options.treePath ?? getOption('treePath');\n if (treePath) {\n path = URLExt.join(path, 'tree', URLExt.encodeParts(treePath));\n }\n return path;\n }\n\n export const defaultWorkspace: string = 'default';\n\n /**\n * Options for getUrl\n */\n\n export interface IGetUrlOptions {\n /**\n * The optional mode as a string 'single-document' or 'multiple-document'. If\n * the mode argument is missing, it will be provided from the PageConfig.\n */\n mode?: string;\n\n /**\n * The optional workspace as a string. If this argument is missing, the value will\n * be pulled from PageConfig. To use the default workspace (no /workspaces/<name>\n * URL segment will be included) pass the string PageConfig.defaultWorkspace.\n */\n workspace?: string;\n\n /**\n * Whether the url is meant to be shared or not; default false.\n */\n toShare?: boolean;\n\n /**\n * The optional tree path as as string. If treePath is not provided it will be\n * provided from the PageConfig. If an empty string, the resulting path will not\n * contain a tree portion.\n */\n treePath?: string;\n }\n\n /**\n * Get the base websocket url for a Jupyter application, or an empty string.\n */\n export function getWsUrl(baseUrl?: string): string {\n let wsUrl = getOption('wsUrl');\n if (!wsUrl) {\n baseUrl = baseUrl ? URLExt.normalize(baseUrl) : getBaseUrl();\n if (baseUrl.indexOf('http') !== 0) {\n return '';\n }\n wsUrl = 'ws' + baseUrl.slice(4);\n }\n return URLExt.normalize(wsUrl);\n }\n\n /**\n * Returns the URL converting this notebook to a certain\n * format with nbconvert.\n */\n export function getNBConvertURL({\n path,\n format,\n download\n }: {\n path: string;\n format: string;\n download: boolean;\n }): string {\n const notebookPath = URLExt.encodeParts(path);\n const url = URLExt.join(getBaseUrl(), 'nbconvert', format, notebookPath);\n if (download) {\n return url + '?download=true';\n }\n return url;\n }\n\n /**\n * Get the authorization token for a Jupyter application.\n */\n export function getToken(): string {\n return getOption('token') || getBodyData('jupyterApiToken');\n }\n\n /**\n * Get the Notebook version info [major, minor, patch].\n */\n export function getNotebookVersion(): [number, number, number] {\n const notebookVersion = getOption('notebookVersion');\n if (notebookVersion === '') {\n return [0, 0, 0];\n }\n return JSON.parse(notebookVersion);\n }\n\n /**\n * Private page config data for the Jupyter application.\n */\n let configData: { [key: string]: string } | null = null;\n\n /**\n * Get a url-encoded item from `body.data` and decode it\n * We should never have any encoded URLs anywhere else in code\n * until we are building an actual request.\n */\n function getBodyData(key: string): string {\n if (typeof document === 'undefined' || !document.body) {\n return '';\n }\n const val = document.body.dataset[key];\n if (typeof val === 'undefined') {\n return '';\n }\n return decodeURIComponent(val);\n }\n\n /**\n * The namespace for page config `Extension` functions.\n */\n export namespace Extension {\n /**\n * Populate an array from page config.\n *\n * @param key - The page config key (e.g., `deferredExtensions`).\n *\n * #### Notes\n * This is intended for `deferredExtensions` and `disabledExtensions`.\n */\n function populate(key: string): string[] {\n try {\n const raw = getOption(key);\n if (raw) {\n return JSON.parse(raw);\n }\n } catch (error) {\n console.warn(`Unable to parse ${key}.`, error);\n }\n return [];\n }\n\n /**\n * The collection of deferred extensions in page config.\n */\n export const deferred = populate('deferredExtensions');\n\n /**\n * The collection of disabled extensions in page config.\n */\n export const disabled = populate('disabledExtensions');\n\n /**\n * Returns whether a plugin is deferred.\n *\n * @param id - The plugin ID.\n */\n export function isDeferred(id: string): boolean {\n // Check for either a full plugin id match or an extension\n // name match.\n const separatorIndex = id.indexOf(':');\n let extName = '';\n if (separatorIndex !== -1) {\n extName = id.slice(0, separatorIndex);\n }\n return deferred.some(val => val === id || (extName && val === extName));\n }\n\n /**\n * Returns whether a plugin is disabled.\n *\n * @param id - The plugin ID.\n */\n export function isDisabled(id: string): boolean {\n // Check for either a full plugin id match or an extension\n // name match.\n const separatorIndex = id.indexOf(':');\n let extName = '';\n if (separatorIndex !== -1) {\n extName = id.slice(0, separatorIndex);\n }\n return disabled.some(val => val === id || (extName && val === extName));\n }\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { posix } from 'path';\n\n/**\n * The namespace for path-related functions.\n *\n * Note that Jupyter server paths do not start with a leading slash.\n */\nexport namespace PathExt {\n /**\n * Join all arguments together and normalize the resulting path.\n * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.\n *\n * @param paths - The string paths to join.\n */\n export function join(...paths: string[]): string {\n const path = posix.join(...paths);\n return path === '.' ? '' : removeSlash(path);\n }\n\n /**\n * Join all arguments together and normalize the resulting path and preserve the leading slash.\n *\n * @param paths - The string paths to join.\n */\n export function joinWithLeadingSlash(...paths: string[]): string {\n const path = posix.join(...paths);\n return path === '.' ? '' : path;\n }\n\n /**\n * Return the last portion of a path. Similar to the Unix basename command.\n * Often used to extract the file name from a fully qualified path.\n *\n * @param path - The path to evaluate.\n *\n * @param ext - An extension to remove from the result.\n */\n export function basename(path: string, ext?: string): string {\n return posix.basename(path, ext);\n }\n\n /**\n * Get the directory name of a path, similar to the Unix dirname command.\n * When an empty path is given, returns the root path.\n *\n * @param path - The file path.\n */\n export function dirname(path: string): string {\n const dir = removeSlash(posix.dirname(path));\n return dir === '.' ? '' : dir;\n }\n\n /**\n * Get the extension of the path.\n *\n * @param path - The file path.\n *\n * @returns the extension of the file.\n *\n * #### Notes\n * The extension is the string from the last occurrence of the `.`\n * character to end of string in the last portion of the path, inclusive.\n * If there is no `.` in the last portion of the path, or if the first\n * character of the basename of path [[basename]] is `.`, then an\n * empty string is returned.\n */\n export function extname(path: string): string {\n return posix.extname(path);\n }\n\n /**\n * Normalize a string path, reducing '..' and '.' parts.\n * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.\n * When an empty path is given, returns the root path.\n *\n * @param path - The string path to normalize.\n */\n export function normalize(path: string): string {\n if (path === '') {\n return '';\n }\n return removeSlash(posix.normalize(path));\n }\n\n /**\n * Resolve a sequence of paths or path segments into an absolute path.\n * The root path in the application has no leading slash, so it is removed.\n *\n * @param parts - The paths to join.\n *\n * #### Notes\n * The right-most parameter is considered \\{to\\}. Other parameters are considered an array of \\{from\\}.\n *\n * Starting from leftmost \\{from\\} parameter, resolves \\{to\\} to an absolute path.\n *\n * If \\{to\\} isn't already absolute, \\{from\\} arguments are prepended in right to left order, until an absolute path is found. If after using all \\{from\\} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.\n */\n export function resolve(...parts: string[]): string {\n return removeSlash(posix.resolve(...parts));\n }\n\n /**\n * Solve the relative path from \\{from\\} to \\{to\\}.\n *\n * @param from - The source path.\n *\n * @param to - The target path.\n *\n * #### Notes\n * If from and to each resolve to the same path (after calling\n * path.resolve() on each), a zero-length string is returned.\n * If a zero-length string is passed as from or to, `/`\n * will be used instead of the zero-length strings.\n */\n export function relative(from: string, to: string): string {\n return removeSlash(posix.relative(from, to));\n }\n\n /**\n * Normalize a file extension to be of the type `'.foo'`.\n *\n * @param extension - the file extension.\n *\n * #### Notes\n * Adds a leading dot if not present and converts to lower case.\n */\n export function normalizeExtension(extension: string): string {\n if (extension.length > 0 && extension.indexOf('.') !== 0) {\n extension = `.${extension}`;\n }\n return extension;\n }\n\n /**\n * Remove the leading slash from a path.\n *\n * @param path the path from which to remove a leading slash.\n */\n export function removeSlash(path: string): string {\n if (path.indexOf('/') === 0) {\n path = path.slice(1);\n }\n return path;\n }\n}\n", "/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\nimport { PromiseDelegate } from '@lumino/coreutils';\nimport { ISignal } from '@lumino/signaling';\n\n/**\n * Convert a signal into a promise for the first emitted value.\n *\n * @param signal - The signal we are listening to.\n * @param timeout - Timeout to wait for signal in ms (not timeout if not defined or 0)\n *\n * @returns a Promise that resolves with a `(sender, args)` pair.\n */\nexport function signalToPromise<T, U>(\n signal: ISignal<T, U>,\n timeout?: number\n): Promise<[T, U]> {\n const waitForSignal = new PromiseDelegate<[T, U]>();\n\n function cleanup() {\n signal.disconnect(slot);\n }\n\n function slot(sender: T, args: U) {\n cleanup();\n waitForSignal.resolve([sender, args]);\n }\n signal.connect(slot);\n\n if ((timeout ?? 0) > 0) {\n setTimeout(() => {\n cleanup();\n waitForSignal.reject(`Signal not emitted within ${timeout} ms.`);\n }, timeout);\n }\n return waitForSignal.promise;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/**\n * The namespace for text-related functions.\n */\nexport namespace Text {\n // javascript stores text as utf16 and string indices use \"code units\",\n // which stores high-codepoint characters as \"surrogate pairs\",\n // which occupy two indices in the javascript string.\n // We need to translate cursor_pos in the Jupyter protocol (in characters)\n // to js offset (with surrogate pairs taking two spots).\n\n const HAS_SURROGATES: boolean = '\uD835\uDC1A'.length > 1;\n\n /**\n * Convert a javascript string index into a unicode character offset\n *\n * @param jsIdx - The javascript string index (counting surrogate pairs)\n *\n * @param text - The text in which the offset is calculated\n *\n * @returns The unicode character offset\n */\n export function jsIndexToCharIndex(jsIdx: number, text: string): number {\n if (HAS_SURROGATES) {\n // not using surrogates, nothing to do\n return jsIdx;\n }\n let charIdx = jsIdx;\n for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {\n const charCode = text.charCodeAt(i);\n // check for surrogate pair\n if (charCode >= 0xd800 && charCode <= 0xdbff) {\n const nextCharCode = text.charCodeAt(i + 1);\n if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {\n charIdx--;\n i++;\n }\n }\n }\n return charIdx;\n }\n\n /**\n * Convert a unicode character offset to a javascript string index.\n *\n * @param charIdx - The index in unicode characters\n *\n * @param text - The text in which the offset is calculated\n *\n * @returns The js-native index\n */\n export function charIndexToJsIndex(charIdx: number, text: string): number {\n if (HAS_SURROGATES) {\n // not using surrogates, nothing to do\n return charIdx;\n }\n let jsIdx = charIdx;\n for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {\n const charCode = text.charCodeAt(i);\n // check for surrogate pair\n if (charCode >= 0xd800 && charCode <= 0xdbff) {\n const nextCharCode = text.charCodeAt(i + 1);\n if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {\n jsIdx++;\n i++;\n }\n }\n }\n return jsIdx;\n }\n\n /**\n * Given a 'snake-case', 'snake_case', 'snake:case', or\n * 'snake case' string, will return the camel case version: 'snakeCase'.\n *\n * @param str the snake-case input string.\n *\n * @param upper default = false. If true, the first letter of the\n * returned string will be capitalized.\n *\n * @returns the camel case version of the input string.\n */\n export function camelCase(str: string, upper: boolean = false): string {\n return str.replace(/^(\\w)|[\\s-_:]+(\\w)/g, function (match, p1, p2) {\n if (p2) {\n return p2.toUpperCase();\n } else {\n return upper ? p1.toUpperCase() : p1.toLowerCase();\n }\n });\n }\n\n /**\n * Given a string, title case the words in the string.\n *\n * @param str the string to title case.\n *\n * @returns the same string, but with each word capitalized.\n */\n export function titleCase(str: string): string {\n return (str || '')\n .toLowerCase()\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/**\n * A list of time units with their associated value in milliseconds.\n */\nconst UNITS: { name: Intl.RelativeTimeFormatUnit; milliseconds: number }[] = [\n { name: 'years', milliseconds: 365 * 24 * 60 * 60 * 1000 },\n { name: 'months', milliseconds: 30 * 24 * 60 * 60 * 1000 },\n { name: 'days', milliseconds: 24 * 60 * 60 * 1000 },\n { name: 'hours', milliseconds: 60 * 60 * 1000 },\n { name: 'minutes', milliseconds: 60 * 1000 },\n { name: 'seconds', milliseconds: 1000 }\n];\n\n/**\n * The namespace for date functions.\n */\nexport namespace Time {\n // Intl.RelativeTimeFormatStyle contains these, but it requires `ES2020.Intl`.\n // We currently compile to an `ES2018` target.\n export type HumanStyle = 'long' | 'short' | 'narrow';\n\n /**\n * Convert a timestring to a human readable string (e.g. 'two minutes ago').\n *\n * @param value - The date timestring or date object.\n *\n * @returns A formatted date.\n */\n export function formatHuman(\n value: string | Date,\n format: HumanStyle = 'long'\n ): string {\n const lang = document.documentElement.lang || 'en';\n const formatter = new Intl.RelativeTimeFormat(lang, {\n numeric: 'auto',\n style: format\n });\n const delta = new Date(value).getTime() - Date.now();\n for (let unit of UNITS) {\n const amount = Math.ceil(delta / unit.milliseconds);\n if (amount === 0) {\n continue;\n }\n return formatter.format(amount, unit.name);\n }\n return formatter.format(0, 'seconds');\n }\n\n /**\n * Convenient helper to convert a timestring to a date format.\n *\n * @param value - The date timestring or date object.\n *\n * @returns A formatted date.\n */\n export function format(value: string | Date): string {\n const lang = document.documentElement.lang || 'en';\n const formatter = new Intl.DateTimeFormat(lang, {\n dateStyle: 'short',\n timeStyle: 'short'\n });\n return formatter.format(new Date(value));\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module coreutils\n */\n\nexport * from './activitymonitor';\nexport * from './interfaces';\nexport * from './lru';\nexport * from './markdowncodeblocks';\nexport * from './pageconfig';\nexport * from './path';\nexport * from './signal';\nexport * from './text';\nexport * from './time';\nexport * from './url';\n", "'use strict';\n\n/**\n * @param typeMap [Object] Map of MIME type -> Array[extensions]\n * @param ...\n */\nfunction Mime() {\n this._types = Object.create(null);\n this._extensions = Object.create(null);\n\n for (let i = 0; i < arguments.length; i++) {\n this.define(arguments[i]);\n }\n\n this.define = this.define.bind(this);\n this.getType = this.getType.bind(this);\n this.getExtension = this.getExtension.bind(this);\n}\n\n/**\n * Define mimetype -> extension mappings. Each key is a mime-type that maps\n * to an array of extensions associated with the type. The first extension is\n * used as the default extension for the type.\n *\n * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});\n *\n * If a type declares an extension that has already been defined, an error will\n * be thrown. To suppress this error and force the extension to be associated\n * with the new type, pass `force`=true. Alternatively, you may prefix the\n * extension with \"*\" to map the type to extension, without mapping the\n * extension to the type.\n *\n * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']});\n *\n *\n * @param map (Object) type definitions\n * @param force (Boolean) if true, force overriding of existing definitions\n */\nMime.prototype.define = function(typeMap, force) {\n for (let type in typeMap) {\n let extensions = typeMap[type].map(function(t) {\n return t.toLowerCase();\n });\n type = type.toLowerCase();\n\n for (let i = 0; i < extensions.length; i++) {\n const ext = extensions[i];\n\n // '*' prefix = not the preferred type for this extension. So fixup the\n // extension, and skip it.\n if (ext[0] === '*') {\n continue;\n }\n\n if (!force && (ext in this._types)) {\n throw new Error(\n 'Attempt to change mapping for \"' + ext +\n '\" extension from \"' + this._types[ext] + '\" to \"' + type +\n '\". Pass `force=true` to allow this, otherwise remove \"' + ext +\n '\" from the list of extensions for \"' + type + '\".'\n );\n }\n\n this._types[ext] = type;\n }\n\n // Use first extension as default\n if (force || !this._extensions[type]) {\n const ext = extensions[0];\n this._extensions[type] = (ext[0] !== '*') ? ext : ext.substr(1);\n }\n }\n};\n\n/**\n * Lookup a mime type based on extension\n */\nMime.prototype.getType = function(path) {\n path = String(path);\n let last = path.replace(/^.*[/\\\\]/, '').toLowerCase();\n let ext = last.replace(/^.*\\./, '').toLowerCase();\n\n let hasPath = last.length < path.length;\n let hasDot = ext.length < last.length - 1;\n\n return (hasDot || !hasPath) && this._types[ext] || null;\n};\n\n/**\n * Return file extension associated with a mime type\n */\nMime.prototype.getExtension = function(type) {\n type = /^\\s*([^;\\s]*)/.test(type) && RegExp.$1;\n return type && this._extensions[type.toLowerCase()] || null;\n};\n\nmodule.exports = Mime;\n", "module.exports = {\"application/andrew-inset\":[\"ez\"],\"application/applixware\":[\"aw\"],\"application/atom+xml\":[\"atom\"],\"application/atomcat+xml\":[\"atomcat\"],\"application/atomdeleted+xml\":[\"atomdeleted\"],\"application/atomsvc+xml\":[\"atomsvc\"],\"application/atsc-dwd+xml\":[\"dwd\"],\"application/atsc-held+xml\":[\"held\"],\"application/atsc-rsat+xml\":[\"rsat\"],\"application/bdoc\":[\"bdoc\"],\"application/calendar+xml\":[\"xcs\"],\"application/ccxml+xml\":[\"ccxml\"],\"application/cdfx+xml\":[\"cdfx\"],\"application/cdmi-capability\":[\"cdmia\"],\"application/cdmi-container\":[\"cdmic\"],\"application/cdmi-domain\":[\"cdmid\"],\"application/cdmi-object\":[\"cdmio\"],\"application/cdmi-queue\":[\"cdmiq\"],\"application/cu-seeme\":[\"cu\"],\"application/dash+xml\":[\"mpd\"],\"application/davmount+xml\":[\"davmount\"],\"application/docbook+xml\":[\"dbk\"],\"application/dssc+der\":[\"dssc\"],\"application/dssc+xml\":[\"xdssc\"],\"application/ecmascript\":[\"es\",\"ecma\"],\"application/emma+xml\":[\"emma\"],\"application/emotionml+xml\":[\"emotionml\"],\"application/epub+zip\":[\"epub\"],\"application/exi\":[\"exi\"],\"application/express\":[\"exp\"],\"application/fdt+xml\":[\"fdt\"],\"application/font-tdpfr\":[\"pfr\"],\"application/geo+json\":[\"geojson\"],\"application/gml+xml\":[\"gml\"],\"application/gpx+xml\":[\"gpx\"],\"application/gxf\":[\"gxf\"],\"application/gzip\":[\"gz\"],\"application/hjson\":[\"hjson\"],\"application/hyperstudio\":[\"stk\"],\"application/inkml+xml\":[\"ink\",\"inkml\"],\"application/ipfix\":[\"ipfix\"],\"application/its+xml\":[\"its\"],\"application/java-archive\":[\"jar\",\"war\",\"ear\"],\"application/java-serialized-object\":[\"ser\"],\"application/java-vm\":[\"class\"],\"application/javascript\":[\"js\",\"mjs\"],\"application/json\":[\"json\",\"map\"],\"application/json5\":[\"json5\"],\"application/jsonml+json\":[\"jsonml\"],\"application/ld+json\":[\"jsonld\"],\"application/lgr+xml\":[\"lgr\"],\"application/lost+xml\":[\"lostxml\"],\"application/mac-binhex40\":[\"hqx\"],\"application/mac-compactpro\":[\"cpt\"],\"application/mads+xml\":[\"mads\"],\"application/manifest+json\":[\"webmanifest\"],\"application/marc\":[\"mrc\"],\"application/marcxml+xml\":[\"mrcx\"],\"application/mathematica\":[\"ma\",\"nb\",\"mb\"],\"application/mathml+xml\":[\"mathml\"],\"application/mbox\":[\"mbox\"],\"application/mediaservercontrol+xml\":[\"mscml\"],\"application/metalink+xml\":[\"metalink\"],\"application/metalink4+xml\":[\"meta4\"],\"application/mets+xml\":[\"mets\"],\"application/mmt-aei+xml\":[\"maei\"],\"application/mmt-usd+xml\":[\"musd\"],\"application/mods+xml\":[\"mods\"],\"application/mp21\":[\"m21\",\"mp21\"],\"application/mp4\":[\"mp4s\",\"m4p\"],\"application/msword\":[\"doc\",\"dot\"],\"application/mxf\":[\"mxf\"],\"application/n-quads\":[\"nq\"],\"application/n-triples\":[\"nt\"],\"application/node\":[\"cjs\"],\"application/octet-stream\":[\"bin\",\"dms\",\"lrf\",\"mar\",\"so\",\"dist\",\"distz\",\"pkg\",\"bpk\",\"dump\",\"elc\",\"deploy\",\"exe\",\"dll\",\"deb\",\"dmg\",\"iso\",\"img\",\"msi\",\"msp\",\"msm\",\"buffer\"],\"application/oda\":[\"oda\"],\"application/oebps-package+xml\":[\"opf\"],\"application/ogg\":[\"ogx\"],\"application/omdoc+xml\":[\"omdoc\"],\"application/onenote\":[\"onetoc\",\"onetoc2\",\"onetmp\",\"onepkg\"],\"application/oxps\":[\"oxps\"],\"application/p2p-overlay+xml\":[\"relo\"],\"application/patch-ops-error+xml\":[\"xer\"],\"application/pdf\":[\"pdf\"],\"application/pgp-encrypted\":[\"pgp\"],\"application/pgp-signature\":[\"asc\",\"sig\"],\"application/pics-rules\":[\"prf\"],\"application/pkcs10\":[\"p10\"],\"application/pkcs7-mime\":[\"p7m\",\"p7c\"],\"application/pkcs7-signature\":[\"p7s\"],\"application/pkcs8\":[\"p8\"],\"application/pkix-attr-cert\":[\"ac\"],\"application/pkix-cert\":[\"cer\"],\"application/pkix-crl\":[\"crl\"],\"application/pkix-pkipath\":[\"pkipath\"],\"application/pkixcmp\":[\"pki\"],\"application/pls+xml\":[\"pls\"],\"application/postscript\":[\"ai\",\"eps\",\"ps\"],\"application/provenance+xml\":[\"provx\"],\"application/pskc+xml\":[\"pskcxml\"],\"application/raml+yaml\":[\"raml\"],\"application/rdf+xml\":[\"rdf\",\"owl\"],\"application/reginfo+xml\":[\"rif\"],\"application/relax-ng-compact-syntax\":[\"rnc\"],\"application/resource-lists+xml\":[\"rl\"],\"application/resource-lists-diff+xml\":[\"rld\"],\"application/rls-services+xml\":[\"rs\"],\"application/route-apd+xml\":[\"rapd\"],\"application/route-s-tsid+xml\":[\"sls\"],\"application/route-usd+xml\":[\"rusd\"],\"application/rpki-ghostbusters\":[\"gbr\"],\"application/rpki-manifest\":[\"mft\"],\"application/rpki-roa\":[\"roa\"],\"application/rsd+xml\":[\"rsd\"],\"application/rss+xml\":[\"rss\"],\"application/rtf\":[\"rtf\"],\"application/sbml+xml\":[\"sbml\"],\"application/scvp-cv-request\":[\"scq\"],\"application/scvp-cv-response\":[\"scs\"],\"application/scvp-vp-request\":[\"spq\"],\"application/scvp-vp-response\":[\"spp\"],\"application/sdp\":[\"sdp\"],\"application/senml+xml\":[\"senmlx\"],\"application/sensml+xml\":[\"sensmlx\"],\"application/set-payment-initiation\":[\"setpay\"],\"application/set-registration-initiation\":[\"setreg\"],\"application/shf+xml\":[\"shf\"],\"application/sieve\":[\"siv\",\"sieve\"],\"application/smil+xml\":[\"smi\",\"smil\"],\"application/sparql-query\":[\"rq\"],\"application/sparql-results+xml\":[\"srx\"],\"application/srgs\":[\"gram\"],\"application/srgs+xml\":[\"grxml\"],\"application/sru+xml\":[\"sru\"],\"application/ssdl+xml\":[\"ssdl\"],\"application/ssml+xml\":[\"ssml\"],\"application/swid+xml\":[\"swidtag\"],\"application/tei+xml\":[\"tei\",\"teicorpus\"],\"application/thraud+xml\":[\"tfi\"],\"application/timestamped-data\":[\"tsd\"],\"application/toml\":[\"toml\"],\"application/trig\":[\"trig\"],\"application/ttml+xml\":[\"ttml\"],\"application/ubjson\":[\"ubj\"],\"application/urc-ressheet+xml\":[\"rsheet\"],\"application/urc-targetdesc+xml\":[\"td\"],\"application/voicexml+xml\":[\"vxml\"],\"application/wasm\":[\"wasm\"],\"application/widget\":[\"wgt\"],\"application/winhlp\":[\"hlp\"],\"application/wsdl+xml\":[\"wsdl\"],\"application/wspolicy+xml\":[\"wspolicy\"],\"application/xaml+xml\":[\"xaml\"],\"application/xcap-att+xml\":[\"xav\"],\"application/xcap-caps+xml\":[\"xca\"],\"application/xcap-diff+xml\":[\"xdf\"],\"application/xcap-el+xml\":[\"xel\"],\"application/xcap-ns+xml\":[\"xns\"],\"application/xenc+xml\":[\"xenc\"],\"application/xhtml+xml\":[\"xhtml\",\"xht\"],\"application/xliff+xml\":[\"xlf\"],\"application/xml\":[\"xml\",\"xsl\",\"xsd\",\"rng\"],\"application/xml-dtd\":[\"dtd\"],\"application/xop+xml\":[\"xop\"],\"application/xproc+xml\":[\"xpl\"],\"application/xslt+xml\":[\"*xsl\",\"xslt\"],\"application/xspf+xml\":[\"xspf\"],\"application/xv+xml\":[\"mxml\",\"xhvml\",\"xvml\",\"xvm\"],\"application/yang\":[\"yang\"],\"application/yin+xml\":[\"yin\"],\"application/zip\":[\"zip\"],\"audio/3gpp\":[\"*3gpp\"],\"audio/adpcm\":[\"adp\"],\"audio/amr\":[\"amr\"],\"audio/basic\":[\"au\",\"snd\"],\"audio/midi\":[\"mid\",\"midi\",\"kar\",\"rmi\"],\"audio/mobile-xmf\":[\"mxmf\"],\"audio/mp3\":[\"*mp3\"],\"audio/mp4\":[\"m4a\",\"mp4a\"],\"audio/mpeg\":[\"mpga\",\"mp2\",\"mp2a\",\"mp3\",\"m2a\",\"m3a\"],\"audio/ogg\":[\"oga\",\"ogg\",\"spx\",\"opus\"],\"audio/s3m\":[\"s3m\"],\"audio/silk\":[\"sil\"],\"audio/wav\":[\"wav\"],\"audio/wave\":[\"*wav\"],\"audio/webm\":[\"weba\"],\"audio/xm\":[\"xm\"],\"font/collection\":[\"ttc\"],\"font/otf\":[\"otf\"],\"font/ttf\":[\"ttf\"],\"font/woff\":[\"woff\"],\"font/woff2\":[\"woff2\"],\"image/aces\":[\"exr\"],\"image/apng\":[\"apng\"],\"image/avif\":[\"avif\"],\"image/bmp\":[\"bmp\"],\"image/cgm\":[\"cgm\"],\"image/dicom-rle\":[\"drle\"],\"image/emf\":[\"emf\"],\"image/fits\":[\"fits\"],\"image/g3fax\":[\"g3\"],\"image/gif\":[\"gif\"],\"image/heic\":[\"heic\"],\"image/heic-sequence\":[\"heics\"],\"image/heif\":[\"heif\"],\"image/heif-sequence\":[\"heifs\"],\"image/hej2k\":[\"hej2\"],\"image/hsj2\":[\"hsj2\"],\"image/ief\":[\"ief\"],\"image/jls\":[\"jls\"],\"image/jp2\":[\"jp2\",\"jpg2\"],\"image/jpeg\":[\"jpeg\",\"jpg\",\"jpe\"],\"image/jph\":[\"jph\"],\"image/jphc\":[\"jhc\"],\"image/jpm\":[\"jpm\"],\"image/jpx\":[\"jpx\",\"jpf\"],\"image/jxr\":[\"jxr\"],\"image/jxra\":[\"jxra\"],\"image/jxrs\":[\"jxrs\"],\"image/jxs\":[\"jxs\"],\"image/jxsc\":[\"jxsc\"],\"image/jxsi\":[\"jxsi\"],\"image/jxss\":[\"jxss\"],\"image/ktx\":[\"ktx\"],\"image/ktx2\":[\"ktx2\"],\"image/png\":[\"png\"],\"image/sgi\":[\"sgi\"],\"image/svg+xml\":[\"svg\",\"svgz\"],\"image/t38\":[\"t38\"],\"image/tiff\":[\"tif\",\"tiff\"],\"image/tiff-fx\":[\"tfx\"],\"image/webp\":[\"webp\"],\"image/wmf\":[\"wmf\"],\"message/disposition-notification\":[\"disposition-notification\"],\"message/global\":[\"u8msg\"],\"message/global-delivery-status\":[\"u8dsn\"],\"message/global-disposition-notification\":[\"u8mdn\"],\"message/global-headers\":[\"u8hdr\"],\"message/rfc822\":[\"eml\",\"mime\"],\"model/3mf\":[\"3mf\"],\"model/gltf+json\":[\"gltf\"],\"model/gltf-binary\":[\"glb\"],\"model/iges\":[\"igs\",\"iges\"],\"model/mesh\":[\"msh\",\"mesh\",\"silo\"],\"model/mtl\":[\"mtl\"],\"model/obj\":[\"obj\"],\"model/step+xml\":[\"stpx\"],\"model/step+zip\":[\"stpz\"],\"model/step-xml+zip\":[\"stpxz\"],\"model/stl\":[\"stl\"],\"model/vrml\":[\"wrl\",\"vrml\"],\"model/x3d+binary\":[\"*x3db\",\"x3dbz\"],\"model/x3d+fastinfoset\":[\"x3db\"],\"model/x3d+vrml\":[\"*x3dv\",\"x3dvz\"],\"model/x3d+xml\":[\"x3d\",\"x3dz\"],\"model/x3d-vrml\":[\"x3dv\"],\"text/cache-manifest\":[\"appcache\",\"manifest\"],\"text/calendar\":[\"ics\",\"ifb\"],\"text/coffeescript\":[\"coffee\",\"litcoffee\"],\"text/css\":[\"css\"],\"text/csv\":[\"csv\"],\"text/html\":[\"html\",\"htm\",\"shtml\"],\"text/jade\":[\"jade\"],\"text/jsx\":[\"jsx\"],\"text/less\":[\"less\"],\"text/markdown\":[\"markdown\",\"md\"],\"text/mathml\":[\"mml\"],\"text/mdx\":[\"mdx\"],\"text/n3\":[\"n3\"],\"text/plain\":[\"txt\",\"text\",\"conf\",\"def\",\"list\",\"log\",\"in\",\"ini\"],\"text/richtext\":[\"rtx\"],\"text/rtf\":[\"*rtf\"],\"text/sgml\":[\"sgml\",\"sgm\"],\"text/shex\":[\"shex\"],\"text/slim\":[\"slim\",\"slm\"],\"text/spdx\":[\"spdx\"],\"text/stylus\":[\"stylus\",\"styl\"],\"text/tab-separated-values\":[\"tsv\"],\"text/troff\":[\"t\",\"tr\",\"roff\",\"man\",\"me\",\"ms\"],\"text/turtle\":[\"ttl\"],\"text/uri-list\":[\"uri\",\"uris\",\"urls\"],\"text/vcard\":[\"vcard\"],\"text/vtt\":[\"vtt\"],\"text/xml\":[\"*xml\"],\"text/yaml\":[\"yaml\",\"yml\"],\"video/3gpp\":[\"3gp\",\"3gpp\"],\"video/3gpp2\":[\"3g2\"],\"video/h261\":[\"h261\"],\"video/h263\":[\"h263\"],\"video/h264\":[\"h264\"],\"video/iso.segment\":[\"m4s\"],\"video/jpeg\":[\"jpgv\"],\"video/jpm\":[\"*jpm\",\"jpgm\"],\"video/mj2\":[\"mj2\",\"mjp2\"],\"video/mp2t\":[\"ts\"],\"video/mp4\":[\"mp4\",\"mp4v\",\"mpg4\"],\"video/mpeg\":[\"mpeg\",\"mpg\",\"mpe\",\"m1v\",\"m2v\"],\"video/ogg\":[\"ogv\"],\"video/quicktime\":[\"qt\",\"mov\"],\"video/webm\":[\"webm\"]};", "module.exports = {\"application/prs.cww\":[\"cww\"],\"application/vnd.1000minds.decision-model+xml\":[\"1km\"],\"application/vnd.3gpp.pic-bw-large\":[\"plb\"],\"application/vnd.3gpp.pic-bw-small\":[\"psb\"],\"application/vnd.3gpp.pic-bw-var\":[\"pvb\"],\"application/vnd.3gpp2.tcap\":[\"tcap\"],\"application/vnd.3m.post-it-notes\":[\"pwn\"],\"application/vnd.accpac.simply.aso\":[\"aso\"],\"application/vnd.accpac.simply.imp\":[\"imp\"],\"application/vnd.acucobol\":[\"acu\"],\"application/vnd.acucorp\":[\"atc\",\"acutc\"],\"application/vnd.adobe.air-application-installer-package+zip\":[\"air\"],\"application/vnd.adobe.formscentral.fcdt\":[\"fcdt\"],\"application/vnd.adobe.fxp\":[\"fxp\",\"fxpl\"],\"application/vnd.adobe.xdp+xml\":[\"xdp\"],\"application/vnd.adobe.xfdf\":[\"xfdf\"],\"application/vnd.ahead.space\":[\"ahead\"],\"application/vnd.airzip.filesecure.azf\":[\"azf\"],\"application/vnd.airzip.filesecure.azs\":[\"azs\"],\"application/vnd.amazon.ebook\":[\"azw\"],\"application/vnd.americandynamics.acc\":[\"acc\"],\"application/vnd.amiga.ami\":[\"ami\"],\"application/vnd.android.package-archive\":[\"apk\"],\"application/vnd.anser-web-certificate-issue-initiation\":[\"cii\"],\"application/vnd.anser-web-funds-transfer-initiation\":[\"fti\"],\"application/vnd.antix.game-component\":[\"atx\"],\"application/vnd.apple.installer+xml\":[\"mpkg\"],\"application/vnd.apple.keynote\":[\"key\"],\"application/vnd.apple.mpegurl\":[\"m3u8\"],\"application/vnd.apple.numbers\":[\"numbers\"],\"application/vnd.apple.pages\":[\"pages\"],\"application/vnd.apple.pkpass\":[\"pkpass\"],\"application/vnd.aristanetworks.swi\":[\"swi\"],\"application/vnd.astraea-software.iota\":[\"iota\"],\"application/vnd.audiograph\":[\"aep\"],\"application/vnd.balsamiq.bmml+xml\":[\"bmml\"],\"application/vnd.blueice.multipass\":[\"mpm\"],\"application/vnd.bmi\":[\"bmi\"],\"application/vnd.businessobjects\":[\"rep\"],\"application/vnd.chemdraw+xml\":[\"cdxml\"],\"application/vnd.chipnuts.karaoke-mmd\":[\"mmd\"],\"application/vnd.cinderella\":[\"cdy\"],\"application/vnd.citationstyles.style+xml\":[\"csl\"],\"application/vnd.claymore\":[\"cla\"],\"application/vnd.cloanto.rp9\":[\"rp9\"],\"application/vnd.clonk.c4group\":[\"c4g\",\"c4d\",\"c4f\",\"c4p\",\"c4u\"],\"application/vnd.cluetrust.cartomobile-config\":[\"c11amc\"],\"application/vnd.cluetrust.cartomobile-config-pkg\":[\"c11amz\"],\"application/vnd.commonspace\":[\"csp\"],\"application/vnd.contact.cmsg\":[\"cdbcmsg\"],\"application/vnd.cosmocaller\":[\"cmc\"],\"application/vnd.crick.clicker\":[\"clkx\"],\"application/vnd.crick.clicker.keyboard\":[\"clkk\"],\"application/vnd.crick.clicker.palette\":[\"clkp\"],\"application/vnd.crick.clicker.template\":[\"clkt\"],\"application/vnd.crick.clicker.wordbank\":[\"clkw\"],\"application/vnd.criticaltools.wbs+xml\":[\"wbs\"],\"application/vnd.ctc-posml\":[\"pml\"],\"application/vnd.cups-ppd\":[\"ppd\"],\"application/vnd.curl.car\":[\"car\"],\"application/vnd.curl.pcurl\":[\"pcurl\"],\"application/vnd.dart\":[\"dart\"],\"application/vnd.data-vision.rdz\":[\"rdz\"],\"application/vnd.dbf\":[\"dbf\"],\"application/vnd.dece.data\":[\"uvf\",\"uvvf\",\"uvd\",\"uvvd\"],\"application/vnd.dece.ttml+xml\":[\"uvt\",\"uvvt\"],\"application/vnd.dece.unspecified\":[\"uvx\",\"uvvx\"],\"application/vnd.dece.zip\":[\"uvz\",\"uvvz\"],\"application/vnd.denovo.fcselayout-link\":[\"fe_launch\"],\"application/vnd.dna\":[\"dna\"],\"application/vnd.dolby.mlp\":[\"mlp\"],\"application/vnd.dpgraph\":[\"dpg\"],\"application/vnd.dreamfactory\":[\"dfac\"],\"application/vnd.ds-keypoint\":[\"kpxx\"],\"application/vnd.dvb.ait\":[\"ait\"],\"application/vnd.dvb.service\":[\"svc\"],\"application/vnd.dynageo\":[\"geo\"],\"application/vnd.ecowin.chart\":[\"mag\"],\"application/vnd.enliven\":[\"nml\"],\"application/vnd.epson.esf\":[\"esf\"],\"application/vnd.epson.msf\":[\"msf\"],\"application/vnd.epson.quickanime\":[\"qam\"],\"application/vnd.epson.salt\":[\"slt\"],\"application/vnd.epson.ssf\":[\"ssf\"],\"application/vnd.eszigno3+xml\":[\"es3\",\"et3\"],\"application/vnd.ezpix-album\":[\"ez2\"],\"application/vnd.ezpix-package\":[\"ez3\"],\"application/vnd.fdf\":[\"fdf\"],\"application/vnd.fdsn.mseed\":[\"mseed\"],\"application/vnd.fdsn.seed\":[\"seed\",\"dataless\"],\"application/vnd.flographit\":[\"gph\"],\"application/vnd.fluxtime.clip\":[\"ftc\"],\"application/vnd.framemaker\":[\"fm\",\"frame\",\"maker\",\"book\"],\"application/vnd.frogans.fnc\":[\"fnc\"],\"application/vnd.frogans.ltf\":[\"ltf\"],\"application/vnd.fsc.weblaunch\":[\"fsc\"],\"application/vnd.fujitsu.oasys\":[\"oas\"],\"application/vnd.fujitsu.oasys2\":[\"oa2\"],\"application/vnd.fujitsu.oasys3\":[\"oa3\"],\"application/vnd.fujitsu.oasysgp\":[\"fg5\"],\"application/vnd.fujitsu.oasysprs\":[\"bh2\"],\"application/vnd.fujixerox.ddd\":[\"ddd\"],\"application/vnd.fujixerox.docuworks\":[\"xdw\"],\"application/vnd.fujixerox.docuworks.binder\":[\"xbd\"],\"application/vnd.fuzzysheet\":[\"fzs\"],\"application/vnd.genomatix.tuxedo\":[\"txd\"],\"application/vnd.geogebra.file\":[\"ggb\"],\"application/vnd.geogebra.tool\":[\"ggt\"],\"application/vnd.geometry-explorer\":[\"gex\",\"gre\"],\"application/vnd.geonext\":[\"gxt\"],\"application/vnd.geoplan\":[\"g2w\"],\"application/vnd.geospace\":[\"g3w\"],\"application/vnd.gmx\":[\"gmx\"],\"application/vnd.google-apps.document\":[\"gdoc\"],\"application/vnd.google-apps.presentation\":[\"gslides\"],\"application/vnd.google-apps.spreadsheet\":[\"gsheet\"],\"application/vnd.google-earth.kml+xml\":[\"kml\"],\"application/vnd.google-earth.kmz\":[\"kmz\"],\"application/vnd.grafeq\":[\"gqf\",\"gqs\"],\"application/vnd.groove-account\":[\"gac\"],\"application/vnd.groove-help\":[\"ghf\"],\"application/vnd.groove-identity-message\":[\"gim\"],\"application/vnd.groove-injector\":[\"grv\"],\"application/vnd.groove-tool-message\":[\"gtm\"],\"application/vnd.groove-tool-template\":[\"tpl\"],\"application/vnd.groove-vcard\":[\"vcg\"],\"application/vnd.hal+xml\":[\"hal\"],\"application/vnd.handheld-entertainment+xml\":[\"zmm\"],\"application/vnd.hbci\":[\"hbci\"],\"application/vnd.hhe.lesson-player\":[\"les\"],\"application/vnd.hp-hpgl\":[\"hpgl\"],\"application/vnd.hp-hpid\":[\"hpid\"],\"application/vnd.hp-hps\":[\"hps\"],\"application/vnd.hp-jlyt\":[\"jlt\"],\"application/vnd.hp-pcl\":[\"pcl\"],\"application/vnd.hp-pclxl\":[\"pclxl\"],\"application/vnd.hydrostatix.sof-data\":[\"sfd-hdstx\"],\"application/vnd.ibm.minipay\":[\"mpy\"],\"application/vnd.ibm.modcap\":[\"afp\",\"listafp\",\"list3820\"],\"application/vnd.ibm.rights-management\":[\"irm\"],\"application/vnd.ibm.secure-container\":[\"sc\"],\"application/vnd.iccprofile\":[\"icc\",\"icm\"],\"application/vnd.igloader\":[\"igl\"],\"application/vnd.immervision-ivp\":[\"ivp\"],\"application/vnd.immervision-ivu\":[\"ivu\"],\"application/vnd.insors.igm\":[\"igm\"],\"application/vnd.intercon.formnet\":[\"xpw\",\"xpx\"],\"application/vnd.intergeo\":[\"i2g\"],\"application/vnd.intu.qbo\":[\"qbo\"],\"application/vnd.intu.qfx\":[\"qfx\"],\"application/vnd.ipunplugged.rcprofile\":[\"rcprofile\"],\"application/vnd.irepository.package+xml\":[\"irp\"],\"application/vnd.is-xpr\":[\"xpr\"],\"application/vnd.isac.fcs\":[\"fcs\"],\"application/vnd.jam\":[\"jam\"],\"application/vnd.jcp.javame.midlet-rms\":[\"rms\"],\"application/vnd.jisp\":[\"jisp\"],\"application/vnd.joost.joda-archive\":[\"joda\"],\"application/vnd.kahootz\":[\"ktz\",\"ktr\"],\"application/vnd.kde.karbon\":[\"karbon\"],\"application/vnd.kde.kchart\":[\"chrt\"],\"application/vnd.kde.kformula\":[\"kfo\"],\"application/vnd.kde.kivio\":[\"flw\"],\"application/vnd.kde.kontour\":[\"kon\"],\"application/vnd.kde.kpresenter\":[\"kpr\",\"kpt\"],\"application/vnd.kde.kspread\":[\"ksp\"],\"application/vnd.kde.kword\":[\"kwd\",\"kwt\"],\"application/vnd.kenameaapp\":[\"htke\"],\"application/vnd.kidspiration\":[\"kia\"],\"application/vnd.kinar\":[\"kne\",\"knp\"],\"application/vnd.koan\":[\"skp\",\"skd\",\"skt\",\"skm\"],\"application/vnd.kodak-descriptor\":[\"sse\"],\"application/vnd.las.las+xml\":[\"lasxml\"],\"application/vnd.llamagraphics.life-balance.desktop\":[\"lbd\"],\"application/vnd.llamagraphics.life-balance.exchange+xml\":[\"lbe\"],\"application/vnd.lotus-1-2-3\":[\"123\"],\"application/vnd.lotus-approach\":[\"apr\"],\"application/vnd.lotus-freelance\":[\"pre\"],\"application/vnd.lotus-notes\":[\"nsf\"],\"application/vnd.lotus-organizer\":[\"org\"],\"application/vnd.lotus-screencam\":[\"scm\"],\"application/vnd.lotus-wordpro\":[\"lwp\"],\"application/vnd.macports.portpkg\":[\"portpkg\"],\"application/vnd.mapbox-vector-tile\":[\"mvt\"],\"application/vnd.mcd\":[\"mcd\"],\"application/vnd.medcalcdata\":[\"mc1\"],\"application/vnd.mediastation.cdkey\":[\"cdkey\"],\"application/vnd.mfer\":[\"mwf\"],\"application/vnd.mfmp\":[\"mfm\"],\"application/vnd.micrografx.flo\":[\"flo\"],\"application/vnd.micrografx.igx\":[\"igx\"],\"application/vnd.mif\":[\"mif\"],\"application/vnd.mobius.daf\":[\"daf\"],\"application/vnd.mobius.dis\":[\"dis\"],\"application/vnd.mobius.mbk\":[\"mbk\"],\"application/vnd.mobius.mqy\":[\"mqy\"],\"application/vnd.mobius.msl\":[\"msl\"],\"application/vnd.mobius.plc\":[\"plc\"],\"application/vnd.mobius.txf\":[\"txf\"],\"application/vnd.mophun.application\":[\"mpn\"],\"application/vnd.mophun.certificate\":[\"mpc\"],\"application/vnd.mozilla.xul+xml\":[\"xul\"],\"application/vnd.ms-artgalry\":[\"cil\"],\"application/vnd.ms-cab-compressed\":[\"cab\"],\"application/vnd.ms-excel\":[\"xls\",\"xlm\",\"xla\",\"xlc\",\"xlt\",\"xlw\"],\"application/vnd.ms-excel.addin.macroenabled.12\":[\"xlam\"],\"application/vnd.ms-excel.sheet.binary.macroenabled.12\":[\"xlsb\"],\"application/vnd.ms-excel.sheet.macroenabled.12\":[\"xlsm\"],\"application/vnd.ms-excel.template.macroenabled.12\":[\"xltm\"],\"application/vnd.ms-fontobject\":[\"eot\"],\"application/vnd.ms-htmlhelp\":[\"chm\"],\"application/vnd.ms-ims\":[\"ims\"],\"application/vnd.ms-lrm\":[\"lrm\"],\"application/vnd.ms-officetheme\":[\"thmx\"],\"application/vnd.ms-outlook\":[\"msg\"],\"application/vnd.ms-pki.seccat\":[\"cat\"],\"application/vnd.ms-pki.stl\":[\"*stl\"],\"application/vnd.ms-powerpoint\":[\"ppt\",\"pps\",\"pot\"],\"application/vnd.ms-powerpoint.addin.macroenabled.12\":[\"ppam\"],\"application/vnd.ms-powerpoint.presentation.macroenabled.12\":[\"pptm\"],\"application/vnd.ms-powerpoint.slide.macroenabled.12\":[\"sldm\"],\"application/vnd.ms-powerpoint.slideshow.macroenabled.12\":[\"ppsm\"],\"application/vnd.ms-powerpoint.template.macroenabled.12\":[\"potm\"],\"application/vnd.ms-project\":[\"mpp\",\"mpt\"],\"application/vnd.ms-word.document.macroenabled.12\":[\"docm\"],\"application/vnd.ms-word.template.macroenabled.12\":[\"dotm\"],\"application/vnd.ms-works\":[\"wps\",\"wks\",\"wcm\",\"wdb\"],\"application/vnd.ms-wpl\":[\"wpl\"],\"application/vnd.ms-xpsdocument\":[\"xps\"],\"application/vnd.mseq\":[\"mseq\"],\"application/vnd.musician\":[\"mus\"],\"application/vnd.muvee.style\":[\"msty\"],\"application/vnd.mynfc\":[\"taglet\"],\"application/vnd.neurolanguage.nlu\":[\"nlu\"],\"application/vnd.nitf\":[\"ntf\",\"nitf\"],\"application/vnd.noblenet-directory\":[\"nnd\"],\"application/vnd.noblenet-sealer\":[\"nns\"],\"application/vnd.noblenet-web\":[\"nnw\"],\"application/vnd.nokia.n-gage.ac+xml\":[\"*ac\"],\"application/vnd.nokia.n-gage.data\":[\"ngdat\"],\"application/vnd.nokia.n-gage.symbian.install\":[\"n-gage\"],\"application/vnd.nokia.radio-preset\":[\"rpst\"],\"application/vnd.nokia.radio-presets\":[\"rpss\"],\"application/vnd.novadigm.edm\":[\"edm\"],\"application/vnd.novadigm.edx\":[\"edx\"],\"application/vnd.novadigm.ext\":[\"ext\"],\"application/vnd.oasis.opendocument.chart\":[\"odc\"],\"application/vnd.oasis.opendocument.chart-template\":[\"otc\"],\"application/vnd.oasis.opendocument.database\":[\"odb\"],\"application/vnd.oasis.opendocument.formula\":[\"odf\"],\"application/vnd.oasis.opendocument.formula-template\":[\"odft\"],\"application/vnd.oasis.opendocument.graphics\":[\"odg\"],\"application/vnd.oasis.opendocument.graphics-template\":[\"otg\"],\"application/vnd.oasis.opendocument.image\":[\"odi\"],\"application/vnd.oasis.opendocument.image-template\":[\"oti\"],\"application/vnd.oasis.opendocument.presentation\":[\"odp\"],\"application/vnd.oasis.opendocument.presentation-template\":[\"otp\"],\"application/vnd.oasis.opendocument.spreadsheet\":[\"ods\"],\"application/vnd.oasis.opendocument.spreadsheet-template\":[\"ots\"],\"application/vnd.oasis.opendocument.text\":[\"odt\"],\"application/vnd.oasis.opendocument.text-master\":[\"odm\"],\"application/vnd.oasis.opendocument.text-template\":[\"ott\"],\"application/vnd.oasis.opendocument.text-web\":[\"oth\"],\"application/vnd.olpc-sugar\":[\"xo\"],\"application/vnd.oma.dd2+xml\":[\"dd2\"],\"application/vnd.openblox.game+xml\":[\"obgx\"],\"application/vnd.openofficeorg.extension\":[\"oxt\"],\"application/vnd.openstreetmap.data+xml\":[\"osm\"],\"application/vnd.openxmlformats-officedocument.presentationml.presentation\":[\"pptx\"],\"application/vnd.openxmlformats-officedocument.presentationml.slide\":[\"sldx\"],\"application/vnd.openxmlformats-officedocument.presentationml.slideshow\":[\"ppsx\"],\"application/vnd.openxmlformats-officedocument.presentationml.template\":[\"potx\"],\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":[\"xlsx\"],\"application/vnd.openxmlformats-officedocument.spreadsheetml.template\":[\"xltx\"],\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":[\"docx\"],\"application/vnd.openxmlformats-officedocument.wordprocessingml.template\":[\"dotx\"],\"application/vnd.osgeo.mapguide.package\":[\"mgp\"],\"application/vnd.osgi.dp\":[\"dp\"],\"application/vnd.osgi.subsystem\":[\"esa\"],\"application/vnd.palm\":[\"pdb\",\"pqa\",\"oprc\"],\"application/vnd.pawaafile\":[\"paw\"],\"application/vnd.pg.format\":[\"str\"],\"application/vnd.pg.osasli\":[\"ei6\"],\"application/vnd.picsel\":[\"efif\"],\"application/vnd.pmi.widget\":[\"wg\"],\"application/vnd.pocketlearn\":[\"plf\"],\"application/vnd.powerbuilder6\":[\"pbd\"],\"application/vnd.previewsystems.box\":[\"box\"],\"application/vnd.proteus.magazine\":[\"mgz\"],\"application/vnd.publishare-delta-tree\":[\"qps\"],\"application/vnd.pvi.ptid1\":[\"ptid\"],\"application/vnd.quark.quarkxpress\":[\"qxd\",\"qxt\",\"qwd\",\"qwt\",\"qxl\",\"qxb\"],\"application/vnd.rar\":[\"rar\"],\"application/vnd.realvnc.bed\":[\"bed\"],\"application/vnd.recordare.musicxml\":[\"mxl\"],\"application/vnd.recordare.musicxml+xml\":[\"musicxml\"],\"application/vnd.rig.cryptonote\":[\"cryptonote\"],\"application/vnd.rim.cod\":[\"cod\"],\"application/vnd.rn-realmedia\":[\"rm\"],\"application/vnd.rn-realmedia-vbr\":[\"rmvb\"],\"application/vnd.route66.link66+xml\":[\"link66\"],\"application/vnd.sailingtracker.track\":[\"st\"],\"application/vnd.seemail\":[\"see\"],\"application/vnd.sema\":[\"sema\"],\"application/vnd.semd\":[\"semd\"],\"application/vnd.semf\":[\"semf\"],\"application/vnd.shana.informed.formdata\":[\"ifm\"],\"application/vnd.shana.informed.formtemplate\":[\"itp\"],\"application/vnd.shana.informed.interchange\":[\"iif\"],\"application/vnd.shana.informed.package\":[\"ipk\"],\"application/vnd.simtech-mindmapper\":[\"twd\",\"twds\"],\"application/vnd.smaf\":[\"mmf\"],\"application/vnd.smart.teacher\":[\"teacher\"],\"application/vnd.software602.filler.form+xml\":[\"fo\"],\"application/vnd.solent.sdkm+xml\":[\"sdkm\",\"sdkd\"],\"application/vnd.spotfire.dxp\":[\"dxp\"],\"application/vnd.spotfire.sfs\":[\"sfs\"],\"application/vnd.stardivision.calc\":[\"sdc\"],\"application/vnd.stardivision.draw\":[\"sda\"],\"application/vnd.stardivision.impress\":[\"sdd\"],\"application/vnd.stardivision.math\":[\"smf\"],\"application/vnd.stardivision.writer\":[\"sdw\",\"vor\"],\"application/vnd.stardivision.writer-global\":[\"sgl\"],\"application/vnd.stepmania.package\":[\"smzip\"],\"application/vnd.stepmania.stepchart\":[\"sm\"],\"application/vnd.sun.wadl+xml\":[\"wadl\"],\"application/vnd.sun.xml.calc\":[\"sxc\"],\"application/vnd.sun.xml.calc.template\":[\"stc\"],\"application/vnd.sun.xml.draw\":[\"sxd\"],\"application/vnd.sun.xml.draw.template\":[\"std\"],\"application/vnd.sun.xml.impress\":[\"sxi\"],\"application/vnd.sun.xml.impress.template\":[\"sti\"],\"application/vnd.sun.xml.math\":[\"sxm\"],\"application/vnd.sun.xml.writer\":[\"sxw\"],\"application/vnd.sun.xml.writer.global\":[\"sxg\"],\"application/vnd.sun.xml.writer.template\":[\"stw\"],\"application/vnd.sus-calendar\":[\"sus\",\"susp\"],\"application/vnd.svd\":[\"svd\"],\"application/vnd.symbian.install\":[\"sis\",\"sisx\"],\"application/vnd.syncml+xml\":[\"xsm\"],\"application/vnd.syncml.dm+wbxml\":[\"bdm\"],\"application/vnd.syncml.dm+xml\":[\"xdm\"],\"application/vnd.syncml.dmddf+xml\":[\"ddf\"],\"application/vnd.tao.intent-module-archive\":[\"tao\"],\"application/vnd.tcpdump.pcap\":[\"pcap\",\"cap\",\"dmp\"],\"application/vnd.tmobile-livetv\":[\"tmo\"],\"application/vnd.trid.tpt\":[\"tpt\"],\"application/vnd.triscape.mxs\":[\"mxs\"],\"application/vnd.trueapp\":[\"tra\"],\"application/vnd.ufdl\":[\"ufd\",\"ufdl\"],\"application/vnd.uiq.theme\":[\"utz\"],\"application/vnd.umajin\":[\"umj\"],\"application/vnd.unity\":[\"unityweb\"],\"application/vnd.uoml+xml\":[\"uoml\"],\"application/vnd.vcx\":[\"vcx\"],\"application/vnd.visio\":[\"vsd\",\"vst\",\"vss\",\"vsw\"],\"application/vnd.visionary\":[\"vis\"],\"application/vnd.vsf\":[\"vsf\"],\"application/vnd.wap.wbxml\":[\"wbxml\"],\"application/vnd.wap.wmlc\":[\"wmlc\"],\"application/vnd.wap.wmlscriptc\":[\"wmlsc\"],\"application/vnd.webturbo\":[\"wtb\"],\"application/vnd.wolfram.player\":[\"nbp\"],\"application/vnd.wordperfect\":[\"wpd\"],\"application/vnd.wqd\":[\"wqd\"],\"application/vnd.wt.stf\":[\"stf\"],\"application/vnd.xara\":[\"xar\"],\"application/vnd.xfdl\":[\"xfdl\"],\"application/vnd.yamaha.hv-dic\":[\"hvd\"],\"application/vnd.yamaha.hv-script\":[\"hvs\"],\"application/vnd.yamaha.hv-voice\":[\"hvp\"],\"application/vnd.yamaha.openscoreformat\":[\"osf\"],\"application/vnd.yamaha.openscoreformat.osfpvg+xml\":[\"osfpvg\"],\"application/vnd.yamaha.smaf-audio\":[\"saf\"],\"application/vnd.yamaha.smaf-phrase\":[\"spf\"],\"application/vnd.yellowriver-custom-menu\":[\"cmp\"],\"application/vnd.zul\":[\"zir\",\"zirz\"],\"application/vnd.zzazz.deck+xml\":[\"zaz\"],\"application/x-7z-compressed\":[\"7z\"],\"application/x-abiword\":[\"abw\"],\"application/x-ace-compressed\":[\"ace\"],\"application/x-apple-diskimage\":[\"*dmg\"],\"application/x-arj\":[\"arj\"],\"application/x-authorware-bin\":[\"aab\",\"x32\",\"u32\",\"vox\"],\"application/x-authorware-map\":[\"aam\"],\"application/x-authorware-seg\":[\"aas\"],\"application/x-bcpio\":[\"bcpio\"],\"application/x-bdoc\":[\"*bdoc\"],\"application/x-bittorrent\":[\"torrent\"],\"application/x-blorb\":[\"blb\",\"blorb\"],\"application/x-bzip\":[\"bz\"],\"application/x-bzip2\":[\"bz2\",\"boz\"],\"application/x-cbr\":[\"cbr\",\"cba\",\"cbt\",\"cbz\",\"cb7\"],\"application/x-cdlink\":[\"vcd\"],\"application/x-cfs-compressed\":[\"cfs\"],\"application/x-chat\":[\"chat\"],\"application/x-chess-pgn\":[\"pgn\"],\"application/x-chrome-extension\":[\"crx\"],\"application/x-cocoa\":[\"cco\"],\"application/x-conference\":[\"nsc\"],\"application/x-cpio\":[\"cpio\"],\"application/x-csh\":[\"csh\"],\"application/x-debian-package\":[\"*deb\",\"udeb\"],\"application/x-dgc-compressed\":[\"dgc\"],\"application/x-director\":[\"dir\",\"dcr\",\"dxr\",\"cst\",\"cct\",\"cxt\",\"w3d\",\"fgd\",\"swa\"],\"application/x-doom\":[\"wad\"],\"application/x-dtbncx+xml\":[\"ncx\"],\"application/x-dtbook+xml\":[\"dtb\"],\"application/x-dtbresource+xml\":[\"res\"],\"application/x-dvi\":[\"dvi\"],\"application/x-envoy\":[\"evy\"],\"application/x-eva\":[\"eva\"],\"application/x-font-bdf\":[\"bdf\"],\"application/x-font-ghostscript\":[\"gsf\"],\"application/x-font-linux-psf\":[\"psf\"],\"application/x-font-pcf\":[\"pcf\"],\"application/x-font-snf\":[\"snf\"],\"application/x-font-type1\":[\"pfa\",\"pfb\",\"pfm\",\"afm\"],\"application/x-freearc\":[\"arc\"],\"application/x-futuresplash\":[\"spl\"],\"application/x-gca-compressed\":[\"gca\"],\"application/x-glulx\":[\"ulx\"],\"application/x-gnumeric\":[\"gnumeric\"],\"application/x-gramps-xml\":[\"gramps\"],\"application/x-gtar\":[\"gtar\"],\"application/x-hdf\":[\"hdf\"],\"application/x-httpd-php\":[\"php\"],\"application/x-install-instructions\":[\"install\"],\"application/x-iso9660-image\":[\"*iso\"],\"application/x-iwork-keynote-sffkey\":[\"*key\"],\"application/x-iwork-numbers-sffnumbers\":[\"*numbers\"],\"application/x-iwork-pages-sffpages\":[\"*pages\"],\"application/x-java-archive-diff\":[\"jardiff\"],\"application/x-java-jnlp-file\":[\"jnlp\"],\"application/x-keepass2\":[\"kdbx\"],\"application/x-latex\":[\"latex\"],\"application/x-lua-bytecode\":[\"luac\"],\"application/x-lzh-compressed\":[\"lzh\",\"lha\"],\"application/x-makeself\":[\"run\"],\"application/x-mie\":[\"mie\"],\"application/x-mobipocket-ebook\":[\"prc\",\"mobi\"],\"application/x-ms-application\":[\"application\"],\"application/x-ms-shortcut\":[\"lnk\"],\"application/x-ms-wmd\":[\"wmd\"],\"application/x-ms-wmz\":[\"wmz\"],\"application/x-ms-xbap\":[\"xbap\"],\"application/x-msaccess\":[\"mdb\"],\"application/x-msbinder\":[\"obd\"],\"application/x-mscardfile\":[\"crd\"],\"application/x-msclip\":[\"clp\"],\"application/x-msdos-program\":[\"*exe\"],\"application/x-msdownload\":[\"*exe\",\"*dll\",\"com\",\"bat\",\"*msi\"],\"application/x-msmediaview\":[\"mvb\",\"m13\",\"m14\"],\"application/x-msmetafile\":[\"*wmf\",\"*wmz\",\"*emf\",\"emz\"],\"application/x-msmoney\":[\"mny\"],\"application/x-mspublisher\":[\"pub\"],\"application/x-msschedule\":[\"scd\"],\"application/x-msterminal\":[\"trm\"],\"application/x-mswrite\":[\"wri\"],\"application/x-netcdf\":[\"nc\",\"cdf\"],\"application/x-ns-proxy-autoconfig\":[\"pac\"],\"application/x-nzb\":[\"nzb\"],\"application/x-perl\":[\"pl\",\"pm\"],\"application/x-pilot\":[\"*prc\",\"*pdb\"],\"application/x-pkcs12\":[\"p12\",\"pfx\"],\"application/x-pkcs7-certificates\":[\"p7b\",\"spc\"],\"application/x-pkcs7-certreqresp\":[\"p7r\"],\"application/x-rar-compressed\":[\"*rar\"],\"application/x-redhat-package-manager\":[\"rpm\"],\"application/x-research-info-systems\":[\"ris\"],\"application/x-sea\":[\"sea\"],\"application/x-sh\":[\"sh\"],\"application/x-shar\":[\"shar\"],\"application/x-shockwave-flash\":[\"swf\"],\"application/x-silverlight-app\":[\"xap\"],\"application/x-sql\":[\"sql\"],\"application/x-stuffit\":[\"sit\"],\"application/x-stuffitx\":[\"sitx\"],\"application/x-subrip\":[\"srt\"],\"application/x-sv4cpio\":[\"sv4cpio\"],\"application/x-sv4crc\":[\"sv4crc\"],\"application/x-t3vm-image\":[\"t3\"],\"application/x-tads\":[\"gam\"],\"application/x-tar\":[\"tar\"],\"application/x-tcl\":[\"tcl\",\"tk\"],\"application/x-tex\":[\"tex\"],\"application/x-tex-tfm\":[\"tfm\"],\"application/x-texinfo\":[\"texinfo\",\"texi\"],\"application/x-tgif\":[\"*obj\"],\"application/x-ustar\":[\"ustar\"],\"application/x-virtualbox-hdd\":[\"hdd\"],\"application/x-virtualbox-ova\":[\"ova\"],\"application/x-virtualbox-ovf\":[\"ovf\"],\"application/x-virtualbox-vbox\":[\"vbox\"],\"application/x-virtualbox-vbox-extpack\":[\"vbox-extpack\"],\"application/x-virtualbox-vdi\":[\"vdi\"],\"application/x-virtualbox-vhd\":[\"vhd\"],\"application/x-virtualbox-vmdk\":[\"vmdk\"],\"application/x-wais-source\":[\"src\"],\"application/x-web-app-manifest+json\":[\"webapp\"],\"application/x-x509-ca-cert\":[\"der\",\"crt\",\"pem\"],\"application/x-xfig\":[\"fig\"],\"application/x-xliff+xml\":[\"*xlf\"],\"application/x-xpinstall\":[\"xpi\"],\"application/x-xz\":[\"xz\"],\"application/x-zmachine\":[\"z1\",\"z2\",\"z3\",\"z4\",\"z5\",\"z6\",\"z7\",\"z8\"],\"audio/vnd.dece.audio\":[\"uva\",\"uvva\"],\"audio/vnd.digital-winds\":[\"eol\"],\"audio/vnd.dra\":[\"dra\"],\"audio/vnd.dts\":[\"dts\"],\"audio/vnd.dts.hd\":[\"dtshd\"],\"audio/vnd.lucent.voice\":[\"lvp\"],\"audio/vnd.ms-playready.media.pya\":[\"pya\"],\"audio/vnd.nuera.ecelp4800\":[\"ecelp4800\"],\"audio/vnd.nuera.ecelp7470\":[\"ecelp7470\"],\"audio/vnd.nuera.ecelp9600\":[\"ecelp9600\"],\"audio/vnd.rip\":[\"rip\"],\"audio/x-aac\":[\"aac\"],\"audio/x-aiff\":[\"aif\",\"aiff\",\"aifc\"],\"audio/x-caf\":[\"caf\"],\"audio/x-flac\":[\"flac\"],\"audio/x-m4a\":[\"*m4a\"],\"audio/x-matroska\":[\"mka\"],\"audio/x-mpegurl\":[\"m3u\"],\"audio/x-ms-wax\":[\"wax\"],\"audio/x-ms-wma\":[\"wma\"],\"audio/x-pn-realaudio\":[\"ram\",\"ra\"],\"audio/x-pn-realaudio-plugin\":[\"rmp\"],\"audio/x-realaudio\":[\"*ra\"],\"audio/x-wav\":[\"*wav\"],\"chemical/x-cdx\":[\"cdx\"],\"chemical/x-cif\":[\"cif\"],\"chemical/x-cmdf\":[\"cmdf\"],\"chemical/x-cml\":[\"cml\"],\"chemical/x-csml\":[\"csml\"],\"chemical/x-xyz\":[\"xyz\"],\"image/prs.btif\":[\"btif\"],\"image/prs.pti\":[\"pti\"],\"image/vnd.adobe.photoshop\":[\"psd\"],\"image/vnd.airzip.accelerator.azv\":[\"azv\"],\"image/vnd.dece.graphic\":[\"uvi\",\"uvvi\",\"uvg\",\"uvvg\"],\"image/vnd.djvu\":[\"djvu\",\"djv\"],\"image/vnd.dvb.subtitle\":[\"*sub\"],\"image/vnd.dwg\":[\"dwg\"],\"image/vnd.dxf\":[\"dxf\"],\"image/vnd.fastbidsheet\":[\"fbs\"],\"image/vnd.fpx\":[\"fpx\"],\"image/vnd.fst\":[\"fst\"],\"image/vnd.fujixerox.edmics-mmr\":[\"mmr\"],\"image/vnd.fujixerox.edmics-rlc\":[\"rlc\"],\"image/vnd.microsoft.icon\":[\"ico\"],\"image/vnd.ms-dds\":[\"dds\"],\"image/vnd.ms-modi\":[\"mdi\"],\"image/vnd.ms-photo\":[\"wdp\"],\"image/vnd.net-fpx\":[\"npx\"],\"image/vnd.pco.b16\":[\"b16\"],\"image/vnd.tencent.tap\":[\"tap\"],\"image/vnd.valve.source.texture\":[\"vtf\"],\"image/vnd.wap.wbmp\":[\"wbmp\"],\"image/vnd.xiff\":[\"xif\"],\"image/vnd.zbrush.pcx\":[\"pcx\"],\"image/x-3ds\":[\"3ds\"],\"image/x-cmu-raster\":[\"ras\"],\"image/x-cmx\":[\"cmx\"],\"image/x-freehand\":[\"fh\",\"fhc\",\"fh4\",\"fh5\",\"fh7\"],\"image/x-icon\":[\"*ico\"],\"image/x-jng\":[\"jng\"],\"image/x-mrsid-image\":[\"sid\"],\"image/x-ms-bmp\":[\"*bmp\"],\"image/x-pcx\":[\"*pcx\"],\"image/x-pict\":[\"pic\",\"pct\"],\"image/x-portable-anymap\":[\"pnm\"],\"image/x-portable-bitmap\":[\"pbm\"],\"image/x-portable-graymap\":[\"pgm\"],\"image/x-portable-pixmap\":[\"ppm\"],\"image/x-rgb\":[\"rgb\"],\"image/x-tga\":[\"tga\"],\"image/x-xbitmap\":[\"xbm\"],\"image/x-xpixmap\":[\"xpm\"],\"image/x-xwindowdump\":[\"xwd\"],\"message/vnd.wfa.wsc\":[\"wsc\"],\"model/vnd.collada+xml\":[\"dae\"],\"model/vnd.dwf\":[\"dwf\"],\"model/vnd.gdl\":[\"gdl\"],\"model/vnd.gtw\":[\"gtw\"],\"model/vnd.mts\":[\"mts\"],\"model/vnd.opengex\":[\"ogex\"],\"model/vnd.parasolid.transmit.binary\":[\"x_b\"],\"model/vnd.parasolid.transmit.text\":[\"x_t\"],\"model/vnd.sap.vds\":[\"vds\"],\"model/vnd.usdz+zip\":[\"usdz\"],\"model/vnd.valve.source.compiled-map\":[\"bsp\"],\"model/vnd.vtu\":[\"vtu\"],\"text/prs.lines.tag\":[\"dsc\"],\"text/vnd.curl\":[\"curl\"],\"text/vnd.curl.dcurl\":[\"dcurl\"],\"text/vnd.curl.mcurl\":[\"mcurl\"],\"text/vnd.curl.scurl\":[\"scurl\"],\"text/vnd.dvb.subtitle\":[\"sub\"],\"text/vnd.fly\":[\"fly\"],\"text/vnd.fmi.flexstor\":[\"flx\"],\"text/vnd.graphviz\":[\"gv\"],\"text/vnd.in3d.3dml\":[\"3dml\"],\"text/vnd.in3d.spot\":[\"spot\"],\"text/vnd.sun.j2me.app-descriptor\":[\"jad\"],\"text/vnd.wap.wml\":[\"wml\"],\"text/vnd.wap.wmlscript\":[\"wmls\"],\"text/x-asm\":[\"s\",\"asm\"],\"text/x-c\":[\"c\",\"cc\",\"cxx\",\"cpp\",\"h\",\"hh\",\"dic\"],\"text/x-component\":[\"htc\"],\"text/x-fortran\":[\"f\",\"for\",\"f77\",\"f90\"],\"text/x-handlebars-template\":[\"hbs\"],\"text/x-java-source\":[\"java\"],\"text/x-lua\":[\"lua\"],\"text/x-markdown\":[\"mkd\"],\"text/x-nfo\":[\"nfo\"],\"text/x-opml\":[\"opml\"],\"text/x-org\":[\"*org\"],\"text/x-pascal\":[\"p\",\"pas\"],\"text/x-processing\":[\"pde\"],\"text/x-sass\":[\"sass\"],\"text/x-scss\":[\"scss\"],\"text/x-setext\":[\"etx\"],\"text/x-sfv\":[\"sfv\"],\"text/x-suse-ymp\":[\"ymp\"],\"text/x-uuencode\":[\"uu\"],\"text/x-vcalendar\":[\"vcs\"],\"text/x-vcard\":[\"vcf\"],\"video/vnd.dece.hd\":[\"uvh\",\"uvvh\"],\"video/vnd.dece.mobile\":[\"uvm\",\"uvvm\"],\"video/vnd.dece.pd\":[\"uvp\",\"uvvp\"],\"video/vnd.dece.sd\":[\"uvs\",\"uvvs\"],\"video/vnd.dece.video\":[\"uvv\",\"uvvv\"],\"video/vnd.dvb.file\":[\"dvb\"],\"video/vnd.fvt\":[\"fvt\"],\"video/vnd.mpegurl\":[\"mxu\",\"m4u\"],\"video/vnd.ms-playready.media.pyv\":[\"pyv\"],\"video/vnd.uvvu.mp4\":[\"uvu\",\"uvvu\"],\"video/vnd.vivo\":[\"viv\"],\"video/x-f4v\":[\"f4v\"],\"video/x-fli\":[\"fli\"],\"video/x-flv\":[\"flv\"],\"video/x-m4v\":[\"m4v\"],\"video/x-matroska\":[\"mkv\",\"mk3d\",\"mks\"],\"video/x-mng\":[\"mng\"],\"video/x-ms-asf\":[\"asf\",\"asx\"],\"video/x-ms-vob\":[\"vob\"],\"video/x-ms-wm\":[\"wm\"],\"video/x-ms-wmv\":[\"wmv\"],\"video/x-ms-wmx\":[\"wmx\"],\"video/x-ms-wvx\":[\"wvx\"],\"video/x-msvideo\":[\"avi\"],\"video/x-sgi-movie\":[\"movie\"],\"video/x-smv\":[\"smv\"],\"x-conference/x-cooltalk\":[\"ice\"]};", "'use strict';\n\nlet Mime = require('./Mime');\nmodule.exports = new Mime(require('./types/standard'), require('./types/other'));\n", "import { IDisposable } from '@lumino/disposable';\nimport { IRenderMime } from '@jupyterlab/rendermime-interfaces';\nimport { PageConfig } from '@jupyterlab/coreutils';\nimport mime from 'mime';\n\nimport { Contents as ServerContents } from '@jupyterlab/services';\n\nimport { Token } from '@lumino/coreutils';\n\n/**\n * The token for the settings service.\n */\nexport const IContents = new Token<IContents>('@jupyterlite/contents:IContents');\n\n/**\n * The interface for the contents service.\n */\nexport interface IContents {\n /**\n * A promise that resolves after the contents have been full initialized.\n */\n ready: Promise<void>;\n\n /**\n * Create a new untitled file or directory in the specified directory path.\n *\n * @param options: The options used to create the file.\n *\n * @returns A promise which resolves with the created file content when the file is created.\n */\n newUntitled(\n options?: ServerContents.ICreateOptions,\n ): Promise<ServerContents.IModel | null>;\n\n /**\n * Copy a file into a given directory.\n *\n * @param path - The original file path.\n * @param toDir - The destination directory path.\n *\n * @returns A promise which resolves with the new contents model when the\n * file is copied.\n *\n * #### Notes\n * The server will select the name of the copied file.\n */\n copy(path: string, toDir: string): Promise<ServerContents.IModel>;\n\n /**\n * Get a file or directory.\n *\n * @param path: The path to the file.\n * @param options: The options used to fetch the file.\n *\n * @returns A promise which resolves with the file content.\n */\n get(\n path: string,\n options?: ServerContents.IFetchOptions,\n ): Promise<ServerContents.IModel | null>;\n\n /**\n * Rename a file or directory.\n *\n * @param oldLocalPath - The original file path.\n * @param newLocalPath - The new file path.\n *\n * @returns A promise which resolves with the new file content model when the file is renamed.\n */\n rename(oldLocalPath: string, newLocalPath: string): Promise<ServerContents.IModel>;\n\n /**\n * Save a file.\n *\n * @param path - The desired file path.\n * @param options - Optional overrides to the model.\n *\n * @returns A promise which resolves with the file content model when the file is saved.\n */\n save(\n path: string,\n options?: Partial<ServerContents.IModel>,\n ): Promise<ServerContents.IModel | null>;\n\n /**\n * Delete a file.\n *\n * @param path - The path to the file.\n */\n delete(path: string): Promise<void>;\n\n /**\n * Create a checkpoint for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with the new checkpoint model when the\n * checkpoint is created.\n */\n createCheckpoint(path: string): Promise<ServerContents.ICheckpointModel>;\n\n /**\n * List available checkpoints for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with a list of checkpoint models for\n * the file.\n */\n listCheckpoints(path: string): Promise<ServerContents.ICheckpointModel[]>;\n\n /**\n * Restore a file to a known checkpoint state.\n *\n * @param path - The path of the file.\n * @param checkpointID - The id of the checkpoint to restore.\n *\n * @returns A promise which resolves when the checkpoint is restored.\n */\n restoreCheckpoint(path: string, checkpointID: string): Promise<void>;\n\n /**\n * Delete a checkpoint for a file.\n *\n * @param path - The path of the file.\n * @param checkpointID - The id of the checkpoint to delete.\n *\n * @returns A promise which resolves when the checkpoint is deleted.\n */\n deleteCheckpoint(path: string, checkpointID: string): Promise<void>;\n}\n\n/**\n * Commonly-used mimetypes\n */\nexport namespace MIME {\n export const JSON = 'application/json';\n export const PLAIN_TEXT = 'text/plain';\n export const OCTET_STREAM = 'octet/stream';\n}\n\n/**\n * A namespace for file constructs.\n */\nexport namespace FILE {\n /**\n * Build-time configured file types.\n */\n const TYPES: Record<string, Partial<IRenderMime.IFileType>> = JSON.parse(\n PageConfig.getOption('fileTypes') || '{}',\n );\n\n /**\n * Get a mimetype (or fallback).\n */\n export function getType(ext: string, defaultType: string | null = null): string {\n ext = ext.toLowerCase();\n for (const fileType of Object.values(TYPES)) {\n for (const fileExt of fileType.extensions || []) {\n if (fileExt === ext && fileType.mimeTypes && fileType.mimeTypes.length) {\n return fileType.mimeTypes[0];\n }\n }\n }\n\n return mime.getType(ext) || defaultType || MIME.OCTET_STREAM;\n }\n\n /**\n * Determine whether the given extension matches a given fileFormat.\n */\n export function hasFormat(\n ext: string,\n fileFormat: 'base64' | 'text' | 'json',\n ): boolean {\n ext = ext.toLowerCase();\n for (const fileType of Object.values(TYPES)) {\n if (fileType.fileFormat !== fileFormat) {\n continue;\n }\n for (const fileExt of fileType.extensions || []) {\n if (fileExt === ext) {\n return true;\n }\n }\n }\n return false;\n }\n}\n\n/**\n * The token for the BroadcastChannel broadcaster.\n */\nexport const IBroadcastChannelWrapper = new Token<IBroadcastChannelWrapper>(\n '@jupyterlite/contents:IBroadcastChannelWrapper',\n);\n\nexport interface IBroadcastChannelWrapper extends IDisposable {\n enable(): void;\n disable(): void;\n enabled: boolean;\n}\n", "import { PageConfig, URLExt } from '@jupyterlab/coreutils';\n\nimport { Contents as ServerContents } from '@jupyterlab/services';\n\nimport { INotebookContent } from '@jupyterlab/nbformat';\n\nimport { PathExt } from '@jupyterlab/coreutils';\n\nimport type localforage from 'localforage';\n\nimport { IContents, MIME, FILE } from './tokens';\nimport { PromiseDelegate } from '@lumino/coreutils';\n\nexport type IModel = ServerContents.IModel;\n\n/**\n * The name of the local storage.\n */\nconst DEFAULT_STORAGE_NAME = 'JupyterLite Storage';\n\n/**\n * The number of checkpoints to save.\n */\nconst N_CHECKPOINTS = 5;\n\n/**\n * A class to handle requests to /api/contents\n */\nexport class Contents implements IContents {\n /**\n * Construct a new localForage-powered contents provider\n */\n constructor(options: Contents.IOptions) {\n this._localforage = options.localforage;\n this._storageName = options.storageName || DEFAULT_STORAGE_NAME;\n this._storageDrivers = options.storageDrivers || null;\n this._ready = new PromiseDelegate();\n }\n\n /**\n * Finish any initialization after server has started and all extensions are applied.\n */\n async initialize() {\n await this.initStorage();\n this._ready.resolve(void 0);\n }\n\n /**\n * Initialize all storage instances\n */\n protected async initStorage(): Promise<void> {\n this._storage = this.createDefaultStorage();\n this._counters = this.createDefaultCounters();\n this._checkpoints = this.createDefaultCheckpoints();\n }\n\n /**\n * A promise that resolves once all storage is fully initialized.\n */\n get ready(): Promise<void> {\n return this._ready.promise;\n }\n\n /**\n * A lazy reference to the underlying storage.\n */\n protected get storage(): Promise<LocalForage> {\n return this.ready.then(() => this._storage as LocalForage);\n }\n\n /**\n * A lazy reference to the underlying counters.\n */\n protected get counters(): Promise<LocalForage> {\n return this.ready.then(() => this._counters as LocalForage);\n }\n\n /**\n * A lazy reference to the underlying checkpoints.\n */\n protected get checkpoints(): Promise<LocalForage> {\n return this.ready.then(() => this._checkpoints as LocalForage);\n }\n\n /**\n * Get default options for localForage instances\n */\n protected get defaultStorageOptions(): LocalForageOptions {\n const driver =\n this._storageDrivers && this._storageDrivers.length ? this._storageDrivers : null;\n return {\n version: 1,\n name: this._storageName,\n ...(driver ? { driver } : {}),\n };\n }\n\n /**\n * Initialize the default storage for contents.\n */\n protected createDefaultStorage(): LocalForage {\n return this._localforage.createInstance({\n description: 'Offline Storage for Notebooks and Files',\n storeName: 'files',\n ...this.defaultStorageOptions,\n });\n }\n\n /**\n * Initialize the default storage for counting file suffixes.\n */\n protected createDefaultCounters(): LocalForage {\n return this._localforage.createInstance({\n description: 'Store the current file suffix counters',\n storeName: 'counters',\n ...this.defaultStorageOptions,\n });\n }\n\n /**\n * Create the default checkpoint storage.\n */\n protected createDefaultCheckpoints(): LocalForage {\n return this._localforage.createInstance({\n description: 'Offline Storage for Checkpoints',\n storeName: 'checkpoints',\n ...this.defaultStorageOptions,\n });\n }\n\n /**\n * Create a new untitled file or directory in the specified directory path.\n *\n * @param options: The options used to create the file.\n *\n * @returns A promise which resolves with the created file content when the file is created.\n */\n async newUntitled(options?: ServerContents.ICreateOptions): Promise<IModel | null> {\n const path = options?.path ?? '';\n const type = options?.type ?? 'notebook';\n const created = new Date().toISOString();\n\n let dirname = PathExt.dirname(path);\n const basename = PathExt.basename(path);\n const extname = PathExt.extname(path);\n const item = await this.get(dirname);\n\n // handle the case of \"Save As\", where the path points to the new file\n // to create, e.g. subfolder/example-copy.ipynb\n let name = '';\n if (path && !extname && item) {\n // directory\n dirname = `${path}/`;\n name = '';\n } else if (dirname && basename) {\n // file in a subfolder\n dirname = `${dirname}/`;\n name = basename;\n } else {\n // file at the top level\n dirname = '';\n name = path;\n }\n\n let file: IModel;\n switch (type) {\n case 'directory': {\n const counter = await this._incrementCounter('directory');\n name = `Untitled Folder${counter || ''}`;\n file = {\n name,\n path: `${dirname}${name}`,\n last_modified: created,\n created,\n format: 'json',\n mimetype: '',\n content: null,\n size: 0,\n writable: true,\n type: 'directory',\n };\n break;\n }\n case 'notebook': {\n const counter = await this._incrementCounter('notebook');\n name = name || `Untitled${counter || ''}.ipynb`;\n file = {\n name,\n path: `${dirname}${name}`,\n last_modified: created,\n created,\n format: 'json',\n mimetype: MIME.JSON,\n content: Private.EMPTY_NB,\n size: JSON.stringify(Private.EMPTY_NB).length,\n writable: true,\n type: 'notebook',\n };\n break;\n }\n default: {\n const ext = options?.ext ?? '.txt';\n const counter = await this._incrementCounter('file');\n const mimetype = FILE.getType(ext) || MIME.OCTET_STREAM;\n\n let format: ServerContents.FileFormat;\n if (FILE.hasFormat(ext, 'text') || mimetype.indexOf('text') !== -1) {\n format = 'text';\n } else if (ext.indexOf('json') !== -1 || ext.indexOf('ipynb') !== -1) {\n format = 'json';\n } else {\n format = 'base64';\n }\n\n name = name || `untitled${counter || ''}${ext}`;\n file = {\n name,\n path: `${dirname}${name}`,\n last_modified: created,\n created,\n format,\n mimetype,\n content: '',\n size: 0,\n writable: true,\n type: 'file',\n };\n break;\n }\n }\n\n const key = file.path;\n await (await this.storage).setItem(key, file);\n return file;\n }\n\n /**\n * Copy a file into a given directory.\n *\n * @param path - The original file path.\n * @param toDir - The destination directory path.\n *\n * @returns A promise which resolves with the new contents model when the\n * file is copied.\n *\n * #### Notes\n * The server will select the name of the copied file.\n */\n async copy(path: string, toDir: string): Promise<IModel> {\n let name = PathExt.basename(path);\n toDir = toDir === '' ? '' : `${toDir.slice(1)}/`;\n // TODO: better handle naming collisions with existing files\n while (await this.get(`${toDir}${name}`, { content: true })) {\n const ext = PathExt.extname(name);\n const base = name.replace(ext, '');\n name = `${base} (copy)${ext}`;\n }\n const toPath = `${toDir}${name}`;\n let item = await this.get(path, { content: true });\n if (!item) {\n throw Error(`Could not find file with path ${path}`);\n }\n item = {\n ...item,\n name,\n path: toPath,\n };\n await (await this.storage).setItem(toPath, item);\n return item;\n }\n\n /**\n * Get a file or directory.\n *\n * @param path: The path to the file.\n * @param options: The options used to fetch the file.\n *\n * @returns A promise which resolves with the file content.\n */\n async get(\n path: string,\n options?: ServerContents.IFetchOptions,\n ): Promise<IModel | null> {\n // remove leading slash\n path = decodeURIComponent(path.replace(/^\\//, ''));\n\n if (path === '') {\n return await this._getFolder(path);\n }\n\n const storage = await this.storage;\n const item = await storage.getItem(path);\n const serverItem = await this._getServerContents(path, options);\n\n const model = (item || serverItem) as IModel | null;\n\n if (!model) {\n return null;\n }\n\n if (!options?.content) {\n return {\n size: 0,\n ...model,\n content: null,\n };\n }\n\n // for directories, find all files with the path as the prefix\n if (model.type === 'directory') {\n const contentMap = new Map<string, IModel>();\n await storage.iterate<IModel, void>((file, key) => {\n // use an additional slash to not include the directory itself\n if (key === `${path}/${file.name}`) {\n contentMap.set(file.name, file);\n }\n });\n\n const serverContents: IModel[] = serverItem\n ? serverItem.content\n : Array.from((await this._getServerDirectory(path)).values());\n for (const file of serverContents) {\n if (!contentMap.has(file.name)) {\n contentMap.set(file.name, file);\n }\n }\n\n const content = [...contentMap.values()];\n\n return {\n name: PathExt.basename(path),\n path,\n last_modified: model.last_modified,\n created: model.created,\n format: 'json',\n mimetype: MIME.JSON,\n content,\n size: 0,\n writable: true,\n type: 'directory',\n };\n }\n return model;\n }\n\n /**\n * Rename a file or directory.\n *\n * @param oldLocalPath - The original file path.\n * @param newLocalPath - The new file path.\n *\n * @returns A promise which resolves with the new file content model when the file is renamed.\n */\n async rename(oldLocalPath: string, newLocalPath: string): Promise<IModel> {\n const path = decodeURIComponent(oldLocalPath);\n const file = await this.get(path, { content: true });\n if (!file) {\n throw Error(`Could not find file with path ${path}`);\n }\n const modified = new Date().toISOString();\n const name = PathExt.basename(newLocalPath);\n const newFile = {\n ...file,\n name,\n path: newLocalPath,\n last_modified: modified,\n };\n const storage = await this.storage;\n await storage.setItem(newLocalPath, newFile);\n // remove the old file\n await storage.removeItem(path);\n // remove the corresponding checkpoint\n await (await this.checkpoints).removeItem(path);\n // if a directory, recurse through all children\n if (file.type === 'directory') {\n let child: IModel;\n for (child of file.content) {\n await this.rename(\n URLExt.join(oldLocalPath, child.name),\n URLExt.join(newLocalPath, child.name),\n );\n }\n }\n\n return newFile;\n }\n\n /**\n * Save a file.\n *\n * @param path - The desired file path.\n * @param options - Optional overrides to the model.\n *\n * @returns A promise which resolves with the file content model when the file is saved.\n */\n async save(path: string, options: Partial<IModel> = {}): Promise<IModel | null> {\n path = decodeURIComponent(path);\n\n // process the file if coming from an upload\n const ext = PathExt.extname(options.name ?? '');\n const chunk = options.chunk;\n\n // retrieve the content if it is a later chunk or the last one\n // the new content will then be appended to the existing one\n const chunked = chunk ? chunk > 1 || chunk === -1 : false;\n let item: IModel | null = await this.get(path, { content: chunked });\n\n if (!item) {\n item = await this.newUntitled({ path, ext, type: 'file' });\n }\n\n if (!item) {\n return null;\n }\n\n // keep a reference to the original content\n const originalContent = item.content;\n\n const modified = new Date().toISOString();\n // override with the new values\n item = {\n ...item,\n ...options,\n last_modified: modified,\n };\n\n if (options.content && options.format === 'base64') {\n const lastChunk = chunk ? chunk === -1 : true;\n\n if (ext === '.ipynb') {\n const content = this._handleChunk(options.content, originalContent, chunked);\n item = {\n ...item,\n content: lastChunk ? JSON.parse(content) : content,\n format: 'json',\n type: 'notebook',\n size: content.length,\n };\n } else if (FILE.hasFormat(ext, 'json')) {\n const content = this._handleChunk(options.content, originalContent, chunked);\n item = {\n ...item,\n content: lastChunk ? JSON.parse(content) : content,\n format: 'json',\n type: 'file',\n size: content.length,\n };\n } else if (FILE.hasFormat(ext, 'text')) {\n const content = this._handleChunk(options.content, originalContent, chunked);\n item = {\n ...item,\n content,\n format: 'text',\n type: 'file',\n size: content.length,\n };\n } else {\n const content = options.content;\n item = {\n ...item,\n content,\n size: atob(content).length,\n };\n }\n }\n\n await (await this.storage).setItem(path, item);\n return item;\n }\n\n /**\n * Delete a file from browser storage.\n *\n * Has no effect on server-backed files, which will re-appear with their\n * original timestamp.\n *\n * @param path - The path to the file.\n */\n async delete(path: string): Promise<void> {\n path = decodeURIComponent(path);\n const slashed = `${path}/`;\n const toDelete = (await (await this.storage).keys()).filter(\n (key) => key === path || key.startsWith(slashed),\n );\n await Promise.all(toDelete.map(this.forgetPath, this));\n }\n\n /**\n * Remove the localForage and checkpoints for a path.\n *\n * @param path - The path to the file\n */\n protected async forgetPath(path: string): Promise<void> {\n await Promise.all([\n (await this.storage).removeItem(path),\n (await this.checkpoints).removeItem(path),\n ]);\n }\n\n /**\n * Create a checkpoint for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with the new checkpoint model when the\n * checkpoint is created.\n */\n async createCheckpoint(path: string): Promise<ServerContents.ICheckpointModel> {\n const checkpoints = await this.checkpoints;\n path = decodeURIComponent(path);\n const item = await this.get(path, { content: true });\n if (!item) {\n throw Error(`Could not find file with path ${path}`);\n }\n const copies = (((await checkpoints.getItem(path)) as IModel[]) ?? []).filter(\n Boolean,\n );\n copies.push(item);\n // keep only a certain amount of checkpoints per file\n if (copies.length > N_CHECKPOINTS) {\n copies.splice(0, copies.length - N_CHECKPOINTS);\n }\n await checkpoints.setItem(path, copies);\n const id = `${copies.length - 1}`;\n return { id, last_modified: (item as IModel).last_modified };\n }\n\n /**\n * List available checkpoints for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with a list of checkpoint models for\n * the file.\n */\n async listCheckpoints(path: string): Promise<ServerContents.ICheckpointModel[]> {\n const copies: IModel[] = (await (await this.checkpoints).getItem(path)) || [];\n return copies.filter(Boolean).map(this.normalizeCheckpoint, this);\n }\n\n protected normalizeCheckpoint(\n model: IModel,\n id: number,\n ): ServerContents.ICheckpointModel {\n return { id: id.toString(), last_modified: model.last_modified };\n }\n\n /**\n * Restore a file to a known checkpoint state.\n *\n * @param path - The path of the file.\n * @param checkpointID - The id of the checkpoint to restore.\n *\n * @returns A promise which resolves when the checkpoint is restored.\n */\n async restoreCheckpoint(path: string, checkpointID: string): Promise<void> {\n path = decodeURIComponent(path);\n const copies = ((await (await this.checkpoints).getItem(path)) || []) as IModel[];\n const id = parseInt(checkpointID);\n const item = copies[id];\n await (await this.storage).setItem(path, item);\n }\n\n /**\n * Delete a checkpoint for a file.\n *\n * @param path - The path of the file.\n * @param checkpointID - The id of the checkpoint to delete.\n *\n * @returns A promise which resolves when the checkpoint is deleted.\n */\n async deleteCheckpoint(path: string, checkpointID: string): Promise<void> {\n path = decodeURIComponent(path);\n const copies = ((await (await this.checkpoints).getItem(path)) || []) as IModel[];\n const id = parseInt(checkpointID);\n copies.splice(id, 1);\n await (await this.checkpoints).setItem(path, copies);\n }\n\n /**\n * Handle a chunk of a file.\n * Decode and unescape a base64-encoded string.\n * @param content the content to process\n *\n * @returns the decoded string, appended to the original content if chunked\n * /\n */\n private _handleChunk(\n newContent: string,\n originalContent: string,\n chunked?: boolean,\n ): string {\n const escaped = decodeURIComponent(escape(atob(newContent)));\n const content = chunked ? originalContent + escaped : escaped;\n return content;\n }\n\n /**\n * retrieve the contents for this path from the union of local storage and\n * `api/contents/{path}/all.json`.\n *\n * @param path - The contents path to retrieve\n *\n * @returns A promise which resolves with a Map of contents, keyed by local file name\n */\n private async _getFolder(path: string): Promise<IModel | null> {\n const content = new Map<string, IModel>();\n const storage = await this.storage;\n await storage.iterate<IModel, void>((file, key) => {\n if (key.includes('/')) {\n return;\n }\n content.set(file.path, file);\n });\n\n // layer in contents that don't have local overwrites\n for (const file of (await this._getServerDirectory(path)).values()) {\n if (!content.has(file.path)) {\n content.set(file.path, file);\n }\n }\n\n if (path && content.size === 0) {\n return null;\n }\n\n return {\n name: '',\n path,\n last_modified: new Date(0).toISOString(),\n created: new Date(0).toISOString(),\n format: 'json',\n mimetype: MIME.JSON,\n content: Array.from(content.values()),\n size: 0,\n writable: true,\n type: 'directory',\n };\n }\n\n /**\n * Attempt to recover the model from `{:path}/__all__.json` file, fall back to\n * deriving the model (including content) off the file in `/files/`. Otherwise\n * return `null`.\n */\n private async _getServerContents(\n path: string,\n options?: ServerContents.IFetchOptions,\n ): Promise<IModel | null> {\n const name = PathExt.basename(path);\n const parentContents = await this._getServerDirectory(URLExt.join(path, '..'));\n let model = parentContents.get(name);\n if (!model) {\n return null;\n }\n model = model || {\n name,\n path,\n last_modified: new Date(0).toISOString(),\n created: new Date(0).toISOString(),\n format: 'text',\n mimetype: MIME.PLAIN_TEXT,\n type: 'file',\n writable: true,\n size: 0,\n content: '',\n };\n\n if (options?.content) {\n if (model.type === 'directory') {\n const serverContents = await this._getServerDirectory(path);\n model = { ...model, content: Array.from(serverContents.values()) };\n } else {\n const fileUrl = URLExt.join(PageConfig.getBaseUrl(), 'files', path);\n const response = await fetch(fileUrl);\n if (!response.ok) {\n return null;\n }\n const mimetype = model.mimetype || response.headers.get('Content-Type');\n const ext = PathExt.extname(name);\n\n if (\n model.type === 'notebook' ||\n FILE.hasFormat(ext, 'json') ||\n mimetype?.indexOf('json') !== -1 ||\n path.match(/\\.(ipynb|[^/]*json[^/]*)$/)\n ) {\n const contentText = await response.text();\n model = {\n ...model,\n content: JSON.parse(contentText),\n format: 'json',\n mimetype: model.mimetype || MIME.JSON,\n size: contentText.length,\n };\n } else if (FILE.hasFormat(ext, 'text') || mimetype.indexOf('text') !== -1) {\n const contentText = await response.text();\n model = {\n ...model,\n content: contentText,\n format: 'text',\n mimetype: mimetype || MIME.PLAIN_TEXT,\n size: contentText.length,\n };\n } else {\n const contentBytes = await response.arrayBuffer();\n const contentBuffer = new Uint8Array(contentBytes);\n model = {\n ...model,\n content: btoa(contentBuffer.reduce(this.reduceBytesToString, '')),\n format: 'base64',\n mimetype: mimetype || MIME.OCTET_STREAM,\n size: contentBuffer.length,\n };\n }\n }\n }\n\n return model;\n }\n\n /**\n * A reducer for turning arbitrary binary into a string\n */\n protected reduceBytesToString = (data: string, byte: number): string => {\n return data + String.fromCharCode(byte);\n };\n\n /**\n * retrieve the contents for this path from `__index__.json` in the appropriate\n * folder.\n *\n * @param newLocalPath - The new file path.\n *\n * @returns A promise which resolves with a Map of contents, keyed by local file name\n */\n private async _getServerDirectory(path: string): Promise<Map<string, IModel>> {\n const content = this._serverContents.get(path) || new Map();\n\n if (!this._serverContents.has(path)) {\n const apiURL = URLExt.join(\n PageConfig.getBaseUrl(),\n 'api/contents',\n path,\n 'all.json',\n );\n\n try {\n const response = await fetch(apiURL);\n const json = JSON.parse(await response.text());\n for (const file of json['content'] as IModel[]) {\n content.set(file.name, file);\n }\n } catch (err) {\n console.warn(\n `don't worry, about ${err}... nothing's broken. If there had been a\n file at ${apiURL}, you might see some more files.`,\n );\n }\n this._serverContents.set(path, content);\n }\n\n return content;\n }\n\n /**\n * Increment the counter for a given file type.\n * Used to avoid collisions when creating new untitled files.\n *\n * @param type The file type to increment the counter for.\n */\n private async _incrementCounter(type: ServerContents.ContentType): Promise<number> {\n const counters = await this.counters;\n const current = ((await counters.getItem(type)) as number) ?? -1;\n const counter = current + 1;\n await counters.setItem(type, counter);\n return counter;\n }\n\n private _serverContents = new Map<string, Map<string, IModel>>();\n private _storageName: string = DEFAULT_STORAGE_NAME;\n private _storageDrivers: string[] | null = null;\n private _ready: PromiseDelegate<void>;\n private _storage: LocalForage | undefined;\n private _counters: LocalForage | undefined;\n private _checkpoints: LocalForage | undefined;\n private _localforage: typeof localforage;\n}\n\n/**\n * A namespace for contents information.\n */\nexport namespace Contents {\n export interface IOptions {\n /**\n * The name of the storage instance on e.g. IndexedDB, localStorage\n */\n storageName?: string | null;\n storageDrivers?: string[] | null;\n localforage: typeof localforage;\n }\n}\n\n/**\n * A namespace for private data.\n */\nnamespace Private {\n /**\n * The content for an empty notebook.\n */\n export const EMPTY_NB: INotebookContent = {\n metadata: {\n orig_nbformat: 4,\n },\n nbformat_minor: 4,\n nbformat: 4,\n cells: [],\n };\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n// Types and implementation inspired from https://github.com/jvilk/BrowserFS\n// LICENSE: https://github.com/jvilk/BrowserFS/blob/8977a704ea469d05daf857e4818bef1f4f498326/LICENSE\n// And from https://github.com/gzuidhof/starboard-notebook\n\n// LICENSE: https://github.com/gzuidhof/starboard-notebook/blob/cd8d3fc30af4bd29cdd8f6b8c207df8138f5d5dd/LICENSE\n\n/**\n * Types for Emscripten primitives.\n *\n * Ideally, much more of these would be taken from `@types/emscripten`.\n */\n\n// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// <reference path=\"../../../node_modules/@types/emscripten/index.d.ts\" />\ntype EmscriptenFS = typeof FS;\n\nexport const DIR_MODE = 16895; // 040777\nexport const FILE_MODE = 33206; // 100666\nexport const SEEK_CUR = 1;\nexport const SEEK_END = 2;\n\nexport interface IStats {\n dev: number;\n ino?: number;\n mode?: number;\n nlink: number;\n uid: number;\n gid: number;\n rdev: number;\n size: number;\n blksize: number;\n blocks: number;\n atime: Date | string;\n mtime: Date | string;\n ctime: Date | string;\n timestamp?: number;\n}\n\nexport interface IEmscriptenFSNode {\n id: number;\n name: string;\n mode: number;\n parent: IEmscriptenFSNode;\n mount: { opts: { root: string } };\n stream_ops: IEmscriptenStreamOps;\n node_ops: IEmscriptenNodeOps;\n timestamp: number;\n}\n\nexport interface IEmscriptenStream {\n node: IEmscriptenFSNode;\n nfd: any;\n flags: string;\n position: number;\n}\n\nexport function instanceOfStream(\n nodeOrStream: IEmscriptenFSNode | IEmscriptenStream,\n): nodeOrStream is IEmscriptenStream {\n return 'node' in nodeOrStream;\n}\n\nexport interface IEmscriptenNodeOps {\n getattr(node: IEmscriptenFSNode | IEmscriptenStream): IStats;\n setattr(node: IEmscriptenFSNode | IEmscriptenStream, attr: IStats): void;\n lookup(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n name: string,\n ): IEmscriptenFSNode;\n mknod(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n name: string,\n mode: number,\n dev: number,\n ): IEmscriptenFSNode;\n rename(\n oldNode: IEmscriptenFSNode | IEmscriptenStream,\n newDir: IEmscriptenFSNode | IEmscriptenStream,\n newName: string,\n ): void;\n unlink(parent: IEmscriptenFSNode | IEmscriptenStream, name: string): void;\n rmdir(parent: IEmscriptenFSNode | IEmscriptenStream, name: string): void;\n readdir(node: IEmscriptenFSNode | IEmscriptenStream): string[];\n symlink(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n newName: string,\n oldPath: string,\n ): void;\n readlink(node: IEmscriptenFSNode | IEmscriptenStream): string;\n}\n\nexport interface IEmscriptenStreamOps {\n open(stream: IEmscriptenStream): void;\n close(stream: IEmscriptenStream): void;\n read(\n stream: IEmscriptenStream,\n buffer: Uint8Array,\n offset: number,\n length: number,\n position: number,\n ): number;\n write(\n stream: IEmscriptenStream,\n buffer: Uint8Array,\n offset: number,\n length: number,\n position: number,\n ): number;\n llseek(stream: IEmscriptenStream, offset: number, whence: number): number;\n}\n\n/**\n * The emscripten filesystem module API.\n */\nexport type FS = EmscriptenFS & {\n ErrnoError: any;\n createNode: (\n parent: IEmscriptenFSNode | null,\n name: string,\n mode: number,\n dev: number,\n ) => IEmscriptenFSNode;\n};\n\n/**\n * The emscripten filesystem error codes.\n */\nexport type ERRNO_CODES = any;\n\n/**\n * The emscripten FS Path API.\n */\nexport type PATH = {\n basename: (path: string) => string;\n dirname: (path: string) => string;\n join: (...parts: string[]) => string;\n join2: (l: string, r: string) => string;\n normalize: (path: string) => string;\n splitPath: (filename: string) => string;\n};\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n// Types and implementation inspired from https://github.com/jvilk/BrowserFS\n// LICENSE: https://github.com/jvilk/BrowserFS/blob/8977a704ea469d05daf857e4818bef1f4f498326/LICENSE\n// And from https://github.com/gzuidhof/starboard-notebook\n\n// LICENSE: https://github.com/gzuidhof/starboard-notebook/blob/cd8d3fc30af4bd29cdd8f6b8c207df8138f5d5dd/LICENSE\nimport { Contents } from '@jupyterlab/services';\n\nimport {\n FS,\n ERRNO_CODES,\n PATH,\n DIR_MODE,\n SEEK_CUR,\n SEEK_END,\n IEmscriptenStream,\n instanceOfStream,\n IEmscriptenStreamOps,\n IEmscriptenNodeOps,\n IEmscriptenFSNode,\n IStats,\n} from './emscripten';\n\nexport const DRIVE_SEPARATOR = ':';\nexport const DRIVE_API_PATH = '/api/drive.v1';\n\nexport const BLOCK_SIZE = 4096;\n\nconst encoder = new TextEncoder();\nconst decoder = new TextDecoder('utf-8');\n\nexport type TDriveMethod =\n | 'readdir'\n | 'rmdir'\n | 'rename'\n | 'getmode'\n | 'lookup'\n | 'mknod'\n | 'getattr'\n | 'get'\n | 'put';\n\n/**\n * Type of the data argument for the drive request, based on the request name\n */\nexport type TDriveData = {\n rename: {\n /**\n * The new path for the file\n */\n newPath: string;\n };\n mknod: {\n /**\n * The mode of the file to create\n */\n mode: number;\n };\n put: {\n /**\n * The file content to write\n */\n data: any;\n\n /**\n * The file content format\n */\n format: Contents.FileFormat;\n };\n};\n\n/**\n * Drive request\n */\nexport type TDriveRequest<T extends TDriveMethod> = {\n /**\n * The method of the request (rmdir, readdir etc)\n */\n method: T;\n\n /**\n * The expected receiver of the request\n */\n receiver?: 'broadcast.ts';\n\n /**\n * The path to the file/directory for which the request was sent\n */\n path: string;\n} & (T extends keyof TDriveData ? { data: TDriveData[T] } : object);\n\ntype TDriveResponses = {\n readdir: string[];\n rmdir: null;\n rename: null;\n getmode: number;\n lookup: DriveFS.ILookup;\n mknod: null;\n getattr: IStats;\n get:\n | {\n /**\n * The returned file content\n */\n content: any;\n\n /**\n * The content format\n */\n format: Contents.FileFormat;\n }\n | undefined;\n put: null;\n};\n\n/**\n * Drive response\n */\nexport type TDriveResponse<T extends TDriveMethod> = TDriveResponses[T];\n\n// Mapping flag -> do we need to overwrite the file upon closing it\nconst flagNeedsWrite: { [flag: number]: boolean } = {\n 0 /*O_RDONLY*/: false,\n 1 /*O_WRONLY*/: true,\n 2 /*O_RDWR*/: true,\n 64 /*O_CREAT*/: true,\n 65 /*O_WRONLY|O_CREAT*/: true,\n 66 /*O_RDWR|O_CREAT*/: true,\n 129 /*O_WRONLY|O_EXCL*/: true,\n 193 /*O_WRONLY|O_CREAT|O_EXCL*/: true,\n 514 /*O_RDWR|O_TRUNC*/: true,\n 577 /*O_WRONLY|O_CREAT|O_TRUNC*/: true,\n 578 /*O_CREAT|O_RDWR|O_TRUNC*/: true,\n 705 /*O_WRONLY|O_CREAT|O_EXCL|O_TRUNC*/: true,\n 706 /*O_RDWR|O_CREAT|O_EXCL|O_TRUNC*/: true,\n 1024 /*O_APPEND*/: true,\n 1025 /*O_WRONLY|O_APPEND*/: true,\n 1026 /*O_RDWR|O_APPEND*/: true,\n 1089 /*O_WRONLY|O_CREAT|O_APPEND*/: true,\n 1090 /*O_RDWR|O_CREAT|O_APPEND*/: true,\n 1153 /*O_WRONLY|O_EXCL|O_APPEND*/: true,\n 1154 /*O_RDWR|O_EXCL|O_APPEND*/: true,\n 1217 /*O_WRONLY|O_CREAT|O_EXCL|O_APPEND*/: true,\n 1218 /*O_RDWR|O_CREAT|O_EXCL|O_APPEND*/: true,\n 4096 /*O_RDONLY|O_DSYNC*/: true,\n 4098 /*O_RDWR|O_DSYNC*/: true,\n};\n\n/** Implementation-specifc extension of an open stream, adding the file. */\nexport interface IDriveStream extends IEmscriptenStream {\n file?: DriveFS.IFile;\n}\n\nexport class DriveFSEmscriptenStreamOps implements IEmscriptenStreamOps {\n private fs: DriveFS;\n\n constructor(fs: DriveFS) {\n this.fs = fs;\n }\n\n open(stream: IDriveStream): void {\n const path = this.fs.realPath(stream.node);\n if (this.fs.FS.isFile(stream.node.mode)) {\n stream.file = this.fs.API.get(path);\n }\n }\n\n close(stream: IDriveStream): void {\n if (!this.fs.FS.isFile(stream.node.mode) || !stream.file) {\n return;\n }\n\n const path = this.fs.realPath(stream.node);\n\n const flags = stream.flags;\n let parsedFlags = typeof flags === 'string' ? parseInt(flags, 10) : flags;\n parsedFlags &= 0x1fff;\n\n let needsWrite = true;\n if (parsedFlags in flagNeedsWrite) {\n needsWrite = flagNeedsWrite[parsedFlags];\n }\n\n if (needsWrite) {\n this.fs.API.put(path, stream.file);\n }\n\n stream.file = undefined;\n }\n\n read(\n stream: IDriveStream,\n buffer: Uint8Array,\n offset: number,\n length: number,\n position: number,\n ): number {\n if (\n length <= 0 ||\n stream.file === undefined ||\n position >= (stream.file.data.length || 0)\n ) {\n return 0;\n }\n\n const size = Math.min(stream.file.data.length - position, length);\n buffer.set(stream.file.data.subarray(position, position + size), offset);\n return size;\n }\n\n write(\n stream: IDriveStream,\n buffer: Uint8Array,\n offset: number,\n length: number,\n position: number,\n ): number {\n if (length <= 0 || stream.file === undefined) {\n return 0;\n }\n\n stream.node.timestamp = Date.now();\n\n if (position + length > (stream.file?.data.length || 0)) {\n const oldData = stream.file.data ? stream.file.data : new Uint8Array();\n stream.file.data = new Uint8Array(position + length);\n stream.file.data.set(oldData);\n }\n\n stream.file.data.set(buffer.subarray(offset, offset + length), position);\n\n return length;\n }\n\n llseek(stream: IDriveStream, offset: number, whence: number): number {\n let position = offset;\n if (whence === SEEK_CUR) {\n position += stream.position;\n } else if (whence === SEEK_END) {\n if (this.fs.FS.isFile(stream.node.mode)) {\n if (stream.file !== undefined) {\n position += stream.file.data.length;\n } else {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM);\n }\n }\n }\n\n if (position < 0) {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EINVAL);\n }\n\n return position;\n }\n}\n\nexport class DriveFSEmscriptenNodeOps implements IEmscriptenNodeOps {\n private fs: DriveFS;\n\n constructor(fs: DriveFS) {\n this.fs = fs;\n }\n\n protected node(\n nodeOrStream: IEmscriptenFSNode | IEmscriptenStream,\n ): IEmscriptenFSNode {\n if (instanceOfStream(nodeOrStream)) {\n return nodeOrStream.node;\n }\n return nodeOrStream;\n }\n\n getattr(value: IEmscriptenFSNode | IEmscriptenStream): IStats {\n const node = this.node(value);\n return {\n ...this.fs.API.getattr(this.fs.realPath(node)),\n mode: node.mode,\n ino: node.id,\n };\n }\n\n setattr(value: IEmscriptenFSNode | IEmscriptenStream, attr: IStats): void {\n const node = this.node(value);\n for (const [key, value] of Object.entries(attr)) {\n switch (key) {\n case 'mode':\n node.mode = value;\n break;\n case 'timestamp':\n node.timestamp = value;\n break;\n default:\n console.warn('setattr', key, 'of', value, 'on', node, 'not yet implemented');\n break;\n }\n }\n }\n\n lookup(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n name: string,\n ): IEmscriptenFSNode {\n const node = this.node(parent);\n const path = this.fs.PATH.join2(this.fs.realPath(node), name);\n const result = this.fs.API.lookup(path);\n if (!result.ok) {\n throw this.fs.FS.genericErrors[this.fs.ERRNO_CODES['ENOENT']];\n }\n return this.fs.createNode(node, name, result.mode!, 0);\n }\n\n mknod(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n name: string,\n mode: number,\n dev: number,\n ): IEmscriptenFSNode {\n const node = this.node(parent);\n const path = this.fs.PATH.join2(this.fs.realPath(node), name);\n this.fs.API.mknod(path, mode);\n return this.fs.createNode(node, name, mode, dev);\n }\n\n rename(\n value: IEmscriptenFSNode | IEmscriptenStream,\n newDir: IEmscriptenFSNode | IEmscriptenStream,\n newName: string,\n ): void {\n const oldNode = this.node(value);\n const newDirNode = this.node(newDir);\n this.fs.API.rename(\n oldNode.parent\n ? this.fs.PATH.join2(this.fs.realPath(oldNode.parent), oldNode.name)\n : oldNode.name,\n this.fs.PATH.join2(this.fs.realPath(newDirNode), newName),\n );\n\n // Updating the in-memory node\n oldNode.name = newName;\n oldNode.parent = newDirNode;\n }\n\n unlink(parent: IEmscriptenFSNode | IEmscriptenStream, name: string): void {\n this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(this.node(parent)), name));\n }\n\n rmdir(parent: IEmscriptenFSNode | IEmscriptenStream, name: string) {\n this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(this.node(parent)), name));\n }\n\n readdir(value: IEmscriptenFSNode | IEmscriptenStream): string[] {\n return this.fs.API.readdir(this.fs.realPath(this.node(value)));\n }\n\n symlink(\n parent: IEmscriptenFSNode | IEmscriptenStream,\n newName: string,\n oldPath: string,\n ): void {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES['EPERM']);\n }\n\n readlink(node: IEmscriptenFSNode | IEmscriptenStream): string {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES['EPERM']);\n }\n}\n\n/**\n * ContentsAPI base class\n */\nexport abstract class ContentsAPI {\n constructor(driveName: string, mountpoint: string, FS: FS, ERRNO_CODES: ERRNO_CODES) {\n this._driveName = driveName;\n this._mountpoint = mountpoint;\n\n this.FS = FS;\n this.ERRNO_CODES = ERRNO_CODES;\n }\n\n lookup(path: string): DriveFS.ILookup {\n return this.request({ method: 'lookup', path: this.normalizePath(path) });\n }\n\n getmode(path: string): number {\n return this.request({ method: 'getmode', path: this.normalizePath(path) });\n }\n\n mknod(path: string, mode: number): null {\n return this.request({\n method: 'mknod',\n path: this.normalizePath(path),\n data: { mode },\n });\n }\n\n rename(oldPath: string, newPath: string): null {\n return this.request({\n method: 'rename',\n path: this.normalizePath(oldPath),\n data: { newPath: this.normalizePath(newPath) },\n });\n }\n\n readdir(path: string): string[] {\n const dirlist = this.request({\n method: 'readdir',\n path: this.normalizePath(path),\n });\n dirlist.push('.');\n dirlist.push('..');\n return dirlist;\n }\n\n rmdir(path: string): null {\n return this.request({ method: 'rmdir', path: this.normalizePath(path) });\n }\n\n get(path: string): DriveFS.IFile {\n const response = this.request({\n method: 'get',\n path: this.normalizePath(path),\n });\n\n if (!response) {\n throw new this.FS.ErrnoError(this.ERRNO_CODES['ENOENT']);\n }\n\n const serializedContent = response.content;\n const format: 'json' | 'text' | 'base64' | null = response.format;\n\n switch (format) {\n case 'json':\n case 'text':\n return {\n data: encoder.encode(serializedContent),\n format,\n };\n case 'base64': {\n const binString = atob(serializedContent);\n const len = binString.length;\n const data = new Uint8Array(len);\n for (let i = 0; i < len; i++) {\n data[i] = binString.charCodeAt(i);\n }\n return {\n data,\n format,\n };\n }\n default:\n throw new this.FS.ErrnoError(this.ERRNO_CODES['ENOENT']);\n }\n }\n\n put(path: string, value: DriveFS.IFile): null {\n switch (value.format) {\n case 'json':\n case 'text':\n return this.request({\n method: 'put',\n path: this.normalizePath(path),\n data: {\n format: value.format,\n data: decoder.decode(value.data),\n },\n });\n case 'base64': {\n let binary = '';\n for (let i = 0; i < value.data.byteLength; i++) {\n binary += String.fromCharCode(value.data[i]);\n }\n return this.request({\n method: 'put',\n path: this.normalizePath(path),\n data: {\n format: value.format,\n data: btoa(binary),\n },\n });\n }\n }\n }\n\n getattr(path: string): IStats {\n const stats = this.request({\n method: 'getattr',\n path: this.normalizePath(path),\n });\n // Turn datetimes into proper objects\n if (stats.atime) {\n stats.atime = new Date(stats.atime);\n }\n if (stats.mtime) {\n stats.mtime = new Date(stats.mtime);\n }\n if (stats.ctime) {\n stats.ctime = new Date(stats.ctime);\n }\n // ensure a non-undefined size (0 isn't great, though)\n stats.size = stats.size || 0;\n return stats;\n }\n\n /**\n * Normalize a Path by making it compliant for the content manager\n *\n * @param path: the path relatively to the Emscripten drive\n */\n normalizePath(path: string): string {\n // Remove mountpoint prefix\n if (path.startsWith(this._mountpoint)) {\n path = path.slice(this._mountpoint.length);\n }\n\n // Add JupyterLab drive name\n if (this._driveName) {\n path = `${this._driveName}${DRIVE_SEPARATOR}${path}`;\n }\n\n return path;\n }\n\n abstract request<T extends TDriveMethod>(data: TDriveRequest<T>): TDriveResponse<T>;\n\n private _driveName: string;\n private _mountpoint: string;\n\n protected FS: FS;\n protected ERRNO_CODES: ERRNO_CODES;\n}\n\n/**\n * An Emscripten-compatible synchronous Contents API using the service worker.\n */\nexport class ServiceWorkerContentsAPI extends ContentsAPI {\n constructor(\n baseUrl: string,\n driveName: string,\n mountpoint: string,\n FS: FS,\n ERRNO_CODES: ERRNO_CODES,\n ) {\n super(driveName, mountpoint, FS, ERRNO_CODES);\n\n this._baseUrl = baseUrl;\n }\n\n request<T extends TDriveMethod>(data: TDriveRequest<T>): TDriveResponse<T> {\n const xhr = new XMLHttpRequest();\n xhr.open('POST', encodeURI(this.endpoint), false);\n\n try {\n xhr.send(JSON.stringify(data));\n } catch (e) {\n console.error(e);\n }\n\n if (xhr.status >= 400) {\n throw new this.FS.ErrnoError(this.ERRNO_CODES['EINVAL']);\n }\n\n return JSON.parse(xhr.responseText);\n }\n\n /**\n * Get the api/drive endpoint\n */\n get endpoint(): string {\n return `${this._baseUrl}api/drive`;\n }\n\n private _baseUrl: string;\n}\n\nexport class DriveFS {\n FS: FS;\n API: ContentsAPI;\n PATH: PATH;\n ERRNO_CODES: ERRNO_CODES;\n driveName: string;\n\n constructor(options: DriveFS.IOptions) {\n this.FS = options.FS;\n this.PATH = options.PATH;\n this.ERRNO_CODES = options.ERRNO_CODES;\n this.API = this.createAPI(options);\n\n this.driveName = options.driveName;\n\n this.node_ops = new DriveFSEmscriptenNodeOps(this);\n this.stream_ops = new DriveFSEmscriptenStreamOps(this);\n }\n\n node_ops: IEmscriptenNodeOps;\n stream_ops: IEmscriptenStreamOps;\n\n /**\n * Create the ContentsAPI.\n *\n * This is supposed to be overwritten if needed.\n */\n createAPI(options: DriveFS.IOptions): ContentsAPI {\n return new ServiceWorkerContentsAPI(\n options.baseUrl,\n options.driveName,\n options.mountpoint,\n options.FS,\n options.ERRNO_CODES,\n );\n }\n\n mount(mount: any): IEmscriptenFSNode {\n return this.createNode(null, mount.mountpoint, DIR_MODE | 511, 0);\n }\n\n createNode(\n parent: IEmscriptenFSNode | null,\n name: string,\n mode: number,\n dev: number,\n ): IEmscriptenFSNode {\n const FS = this.FS;\n if (!FS.isDir(mode) && !FS.isFile(mode)) {\n throw new FS.ErrnoError(this.ERRNO_CODES['EINVAL']);\n }\n const node = FS.createNode(parent, name, mode, dev);\n node.node_ops = this.node_ops;\n node.stream_ops = this.stream_ops;\n return node;\n }\n\n getMode(path: string): number {\n return this.API.getmode(path);\n }\n\n realPath(node: IEmscriptenFSNode): string {\n const parts: string[] = [];\n let currentNode: IEmscriptenFSNode = node;\n\n parts.push(currentNode.name);\n while (currentNode.parent !== currentNode) {\n currentNode = currentNode.parent;\n parts.push(currentNode.name);\n }\n parts.reverse();\n\n return this.PATH.join.apply(null, parts);\n }\n}\n\n/**\n * A namespace for DriveFS configurations, etc.\n */\nexport namespace DriveFS {\n /**\n * A file representation;\n */\n export interface IFile {\n data: Uint8Array;\n format: 'json' | 'text' | 'base64';\n }\n\n /**\n * The response to a lookup request;\n */\n export interface ILookup {\n ok: boolean;\n mode?: number;\n }\n\n /**\n * Initialization options for a drive;\n */\n export interface IOptions {\n FS: FS;\n PATH: PATH;\n ERRNO_CODES: ERRNO_CODES;\n baseUrl: string;\n driveName: string;\n mountpoint: string;\n }\n}\n", "import { PathExt } from '@jupyterlab/coreutils';\nimport { Contents } from '@jupyterlab/services';\nimport { BLOCK_SIZE, TDriveMethod, TDriveRequest, TDriveResponse } from './drivefs';\nimport { DIR_MODE, FILE_MODE } from './emscripten';\n\nexport interface IDriveContentsProcessor {\n /**\n * Process a content request\n *\n * @param request the request\n */\n processDriveRequest<T extends TDriveMethod>(\n request: TDriveRequest<T>,\n ): Promise<TDriveResponse<T>>;\n\n /**\n * Process the request to read a directory content\n *\n * @param request the request\n */\n readdir(request: TDriveRequest<'readdir'>): Promise<TDriveResponse<'readdir'>>;\n\n /**\n * Process the request to remove a directory\n *\n * @param request the request\n */\n rmdir(request: TDriveRequest<'rmdir'>): Promise<TDriveResponse<'rmdir'>>;\n\n /**\n * Process the request to rename a file or directory\n *\n * @param request the request\n */\n rename(request: TDriveRequest<'rename'>): Promise<TDriveResponse<'rename'>>;\n\n /**\n * Process the request to get the node mode (file or directory)\n *\n * @param request the request\n */\n getmode(request: TDriveRequest<'getmode'>): Promise<TDriveResponse<'getmode'>>;\n\n /**\n * Process the request to check if a node exist\n *\n * @param request the request\n */\n lookup(request: TDriveRequest<'lookup'>): Promise<TDriveResponse<'lookup'>>;\n\n /**\n * Process the request to create a directory/file\n *\n * @param request the request\n */\n mknod(request: TDriveRequest<'mknod'>): Promise<TDriveResponse<'mknod'>>;\n\n /**\n * Process the request to get a node stats\n *\n * @param request the request\n */\n getattr(request: TDriveRequest<'getattr'>): Promise<TDriveResponse<'getattr'>>;\n\n /**\n * Process the request to get the content of a file\n *\n * @param request the request\n */\n get(request: TDriveRequest<'get'>): Promise<TDriveResponse<'get'>>;\n\n /**\n * Process the request to write the content of a file\n *\n * @param request the request\n */\n put(request: TDriveRequest<'put'>): Promise<TDriveResponse<'put'>>;\n}\n\n/**\n * Class for processing a drive request from the DriveFS.\n */\nexport class DriveContentsProcessor implements IDriveContentsProcessor {\n private contentsManager: Contents.IManager;\n\n constructor(options: DriveContentsProcessor.IOptions) {\n this.contentsManager = options.contentsManager;\n }\n\n async processDriveRequest<T extends TDriveMethod>(\n request: TDriveRequest<T>,\n ): Promise<TDriveResponse<T>> {\n switch (request.method) {\n case 'readdir':\n return this.readdir(request as TDriveRequest<'readdir'>) as Promise<\n TDriveResponse<T>\n >;\n case 'rmdir':\n return this.rmdir(request as TDriveRequest<'rmdir'>) as Promise<\n TDriveResponse<T>\n >;\n case 'rename':\n return this.rename(request as TDriveRequest<'rename'>) as Promise<\n TDriveResponse<T>\n >;\n case 'getmode':\n return this.getmode(request as TDriveRequest<'getmode'>) as Promise<\n TDriveResponse<T>\n >;\n case 'lookup':\n return this.lookup(request as TDriveRequest<'lookup'>) as Promise<\n TDriveResponse<T>\n >;\n case 'mknod':\n return this.mknod(request as TDriveRequest<'mknod'>) as Promise<\n TDriveResponse<T>\n >;\n case 'getattr':\n return this.getattr(request as TDriveRequest<'getattr'>) as Promise<\n TDriveResponse<T>\n >;\n case 'get':\n return this.get(request as TDriveRequest<'get'>) as Promise<TDriveResponse<T>>;\n case 'put':\n return this.put(request as TDriveRequest<'put'>) as Promise<TDriveResponse<T>>;\n }\n\n throw `Drive request ${request.method} does not exist.`;\n }\n\n async readdir(request: TDriveRequest<'readdir'>): Promise<TDriveResponse<'readdir'>> {\n const model = await this.contentsManager.get(request.path, { content: true });\n let response: string[] = [];\n if (model.type === 'directory' && model.content) {\n response = model.content.map((subcontent: Contents.IModel) => subcontent.name);\n }\n return response;\n }\n\n async rmdir(request: TDriveRequest<'rmdir'>): Promise<TDriveResponse<'rmdir'>> {\n await this.contentsManager.delete(request.path);\n return null;\n }\n\n async rename(request: TDriveRequest<'rename'>): Promise<TDriveResponse<'rename'>> {\n await this.contentsManager.rename(request.path, request.data.newPath);\n return null;\n }\n\n async getmode(request: TDriveRequest<'getmode'>): Promise<TDriveResponse<'getmode'>> {\n const model = await this.contentsManager.get(request.path);\n let response: number;\n if (model.type === 'directory') {\n response = DIR_MODE;\n } else {\n response = FILE_MODE;\n }\n return response;\n }\n\n async lookup(request: TDriveRequest<'lookup'>): Promise<TDriveResponse<'lookup'>> {\n let response: TDriveResponse<'lookup'>;\n\n try {\n const model = await this.contentsManager.get(request.path);\n response = {\n ok: true,\n mode: model.type === 'directory' ? DIR_MODE : FILE_MODE,\n };\n } catch (e) {\n response = { ok: false };\n }\n\n return response;\n }\n\n async mknod(request: TDriveRequest<'mknod'>): Promise<TDriveResponse<'mknod'>> {\n const model = await this.contentsManager.newUntitled({\n path: PathExt.dirname(request.path),\n type: request.data.mode === DIR_MODE ? 'directory' : 'file',\n ext: PathExt.extname(request.path),\n });\n await this.contentsManager.rename(model.path, request.path);\n return null;\n }\n\n async getattr(request: TDriveRequest<'getattr'>): Promise<TDriveResponse<'getattr'>> {\n const model = await this.contentsManager.get(request.path);\n // create a default date for drives that send incomplete information\n // for nested foldes and files\n const defaultDate = new Date(0).toISOString();\n\n return {\n dev: 1,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n size: model.size || 0,\n blksize: BLOCK_SIZE,\n blocks: Math.ceil(model.size || 0 / BLOCK_SIZE),\n atime: model.last_modified || defaultDate, // TODO Get the proper atime?\n mtime: model.last_modified || defaultDate,\n ctime: model.created || defaultDate,\n timestamp: 0,\n };\n }\n\n async get(request: TDriveRequest<'get'>): Promise<TDriveResponse<'get'>> {\n const model = await this.contentsManager.get(request.path, { content: true });\n\n let response;\n\n if (model.type !== 'directory') {\n response = {\n content:\n model.format === 'json' ? JSON.stringify(model.content) : model.content,\n format: model.format,\n };\n }\n\n return response;\n }\n\n async put(request: TDriveRequest<'put'>): Promise<TDriveResponse<'put'>> {\n await this.contentsManager.save(request.path, {\n content:\n request.data.format === 'json'\n ? JSON.parse(request.data.data)\n : request.data.data,\n type: 'file',\n format: request.data.format as Contents.FileFormat,\n });\n return null;\n }\n}\n\n/**\n * A namespace for DriveContentsProcessor configurations, etc.\n */\nexport namespace DriveContentsProcessor {\n /**\n * Initialization options for a drive;\n */\n export interface IOptions {\n contentsManager: Contents.IManager;\n }\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { Contents as ServerContents } from '@jupyterlab/services';\n\nimport { TDriveRequest, DRIVE_API_PATH, TDriveMethod } from './drivefs';\n\nimport { IBroadcastChannelWrapper } from './tokens';\nimport { IDriveContentsProcessor, DriveContentsProcessor } from './drivecontents';\n\n/** A broadcaster for the ServiceWorker */\nexport class BroadcastChannelWrapper implements IBroadcastChannelWrapper {\n public isDisposed = false;\n\n constructor(options: BroadcastChannelWrapper.IOptions) {\n this._contents = options.contents;\n this._driveContentsProcessor = new DriveContentsProcessor({\n contentsManager: this._contents,\n });\n }\n\n get enabled() {\n return this._enabled;\n }\n\n enable() {\n if (this._channel) {\n console.warn('BroadcastChannel already created and enabled');\n return;\n }\n this._channel = new BroadcastChannel(DRIVE_API_PATH);\n this._channel.addEventListener('message', this._onMessage);\n this._enabled = true;\n }\n\n disable() {\n if (this._channel) {\n this._channel.removeEventListener('message', this._onMessage);\n this._channel = null;\n }\n this._enabled = false;\n }\n\n /** Clean up the broadcaster. */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this.disable();\n this.isDisposed = true;\n }\n\n /** Handle a message received on the BroadcastChannel */\n protected _onMessage = async <T extends TDriveMethod>(\n event: MessageEvent<TDriveRequest<T>>,\n ): Promise<void> => {\n if (!this._channel) {\n return;\n }\n\n const request = event.data;\n const receiver = request?.receiver;\n if (receiver !== 'broadcast.ts') {\n // Message is not meant for us\n return;\n }\n\n const response = await this._driveContentsProcessor.processDriveRequest(request);\n\n this._channel.postMessage(response);\n };\n\n protected _channel: BroadcastChannel | null = null;\n protected _contents: ServerContents.IManager;\n protected _driveContentsProcessor: IDriveContentsProcessor;\n protected _enabled = false;\n}\n\n/** A namespace for */\nexport namespace BroadcastChannelWrapper {\n export interface IOptions {\n contents: ServerContents.IManager;\n }\n export type TBroadcastResponse = any;\n}\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nexport * from './contents';\nexport * from './drivefs';\nexport * from './tokens';\nexport * from './broadcast';\nexport * from './emscripten';\nexport * from './drivecontents';\n", "export const ARRAY = 'array';\nexport const BIGINT = 'bigint';\nexport const BOOLEAN = 'boolean';\nexport const FUNCTION = 'function';\nexport const NULL = 'null';\nexport const NUMBER = 'number';\nexport const OBJECT = 'object';\nexport const STRING = 'string';\nexport const SYMBOL = 'symbol';\nexport const UNDEFINED = 'undefined';\n", "// \u26A0\uFE0F AUTOMATICALLY GENERATED - DO NOT CHANGE\nexport const CHANNEL = '64e10b34-2bf7-4616-9668-f99de5aa046e';\n\nexport const MAIN = 'M' + CHANNEL;\nexport const THREAD = 'T' + CHANNEL;\n", "export const APPLY = 'apply';\nexport const CONSTRUCT = 'construct';\nexport const DEFINE_PROPERTY = 'defineProperty';\nexport const DELETE_PROPERTY = 'deleteProperty';\nexport const GET = 'get';\nexport const GET_OWN_PROPERTY_DESCRIPTOR = 'getOwnPropertyDescriptor';\nexport const GET_PROTOTYPE_OF = 'getPrototypeOf';\nexport const HAS = 'has';\nexport const IS_EXTENSIBLE = 'isExtensible';\nexport const OWN_KEYS = 'ownKeys';\nexport const PREVENT_EXTENSION = 'preventExtensions';\nexport const SET = 'set';\nexport const SET_PROTOTYPE_OF = 'setPrototypeOf';\n", "// The goal of this file is to normalize SAB\n// at least in main -> worker() use cases.\n// This still cannot possibly solve the sync\n// worker -> main() use case if SharedArrayBuffer\n// is not available or usable.\n\nimport {CHANNEL} from './channel.js';\n\nconst {isArray} = Array;\n\nlet {SharedArrayBuffer, window} = globalThis;\nlet {notify, wait, waitAsync} = Atomics;\nlet postPatched = null;\n\n// This is needed for some version of Firefox\nif (!waitAsync) {\n waitAsync = buffer => ({\n value: new Promise(onmessage => {\n // encodeURIComponent('onmessage=({data:b})=>(Atomics.wait(b,0),postMessage(0))')\n let w = new Worker('data:application/javascript,onmessage%3D(%7Bdata%3Ab%7D)%3D%3E(Atomics.wait(b%2C0)%2CpostMessage(0))');\n w.onmessage = onmessage;\n w.postMessage(buffer);\n })\n });\n}\n\n// Monkey-patch SharedArrayBuffer if needed\ntry {\n new SharedArrayBuffer(4);\n}\ncatch (_) {\n SharedArrayBuffer = ArrayBuffer;\n\n const ids = new WeakMap;\n // patch only main -> worker():async use case\n if (window) {\n const resolvers = new Map;\n const {prototype: {postMessage}} = Worker;\n\n const listener = event => {\n const details = event.data?.[CHANNEL];\n if (!isArray(details)) {\n event.stopImmediatePropagation();\n const { id, sb } = details;\n resolvers.get(id)(sb);\n }\n };\n\n postPatched = function (data, ...rest) {\n const details = data?.[CHANNEL];\n if (isArray(details)) {\n const [id, sb] = details;\n ids.set(sb, id);\n this.addEventListener('message', listener);\n }\n return postMessage.call(this, data, ...rest);\n };\n\n waitAsync = sb => ({\n value: new Promise(resolve => {\n resolvers.set(ids.get(sb), resolve);\n }).then(buff => {\n resolvers.delete(ids.get(sb));\n ids.delete(sb);\n for (let i = 0; i < buff.length; i++) sb[i] = buff[i];\n return 'ok';\n })\n });\n }\n else {\n const as = (id, sb) => ({[CHANNEL]: { id, sb }});\n\n notify = sb => {\n postMessage(as(ids.get(sb), sb));\n };\n\n addEventListener('message', event => {\n const details = event.data?.[CHANNEL];\n if (isArray(details)) {\n const [id, sb] = details;\n ids.set(sb, id);\n }\n });\n }\n}\n\nexport {SharedArrayBuffer, isArray, notify, postPatched, wait, waitAsync};\n", "/*! (c) Andrea Giammarchi - ISC */\n\nimport {FUNCTION} from 'proxy-target/types';\n\nimport {CHANNEL} from './channel.js';\nimport {GET, HAS, SET} from './shared/traps.js';\n\nimport {SharedArrayBuffer, isArray, notify, postPatched, wait, waitAsync} from './bridge.js';\n\n// just minifier friendly for Blob Workers' cases\nconst {Int32Array, Map, Uint16Array} = globalThis;\n\n// common constants / utilities for repeated operations\nconst {BYTES_PER_ELEMENT: I32_BYTES} = Int32Array;\nconst {BYTES_PER_ELEMENT: UI16_BYTES} = Uint16Array;\n\nconst waitInterrupt = (sb, delay, handler) => {\n while (wait(sb, 0, 0, delay) === 'timed-out')\n handler();\n};\n\n// retain buffers to transfer\nconst buffers = new WeakSet;\n\n// retain either main threads or workers global context\nconst context = new WeakMap;\n\nconst syncResult = {value: {then: fn => fn()}};\n\n// used to generate a unique `id` per each worker `postMessage` \"transaction\"\nlet uid = 0;\n\n/**\n * @typedef {Object} Interrupt used to sanity-check interrupts while waiting synchronously.\n * @prop {function} [handler] a callback invoked every `delay` milliseconds.\n * @prop {number} [delay=42] define `handler` invokes in terms of milliseconds.\n */\n\n/**\n * Create once a `Proxy` able to orchestrate synchronous `postMessage` out of the box.\n * @param {globalThis | Worker} self the context in which code should run\n * @param {{parse: (serialized: string) => any, stringify: (serializable: any) => string, transform?: (value:any) => any, interrupt?: () => void | Interrupt}} [JSON] an optional `JSON` like interface to `parse` or `stringify` content with extra `transform` ability.\n * @returns {ProxyHandler<globalThis> | ProxyHandler<Worker>}\n */\nconst coincident = (self, {parse = JSON.parse, stringify = JSON.stringify, transform, interrupt} = JSON) => {\n // create a Proxy once for the given context (globalThis or Worker instance)\n if (!context.has(self)) {\n // ensure no SAB gets a chance to pass through this call\n const sendMessage = postPatched || self.postMessage;\n // ensure the CHANNEL and data are posted correctly\n const post = (transfer, ...args) => sendMessage.call(self, {[CHANNEL]: args}, {transfer});\n\n const handler = typeof interrupt === FUNCTION ? interrupt : interrupt?.handler;\n const delay = interrupt?.delay || 42;\n const decoder = new TextDecoder('utf-16');\n\n // automatically uses sync wait (worker -> main)\n // or fallback to async wait (main -> worker)\n const waitFor = (isAsync, sb) => isAsync ?\n waitAsync(sb, 0) :\n ((handler ? waitInterrupt(sb, delay, handler) : wait(sb, 0)), syncResult);\n\n // prevent Harakiri https://github.com/WebReflection/coincident/issues/18\n let seppuku = false;\n\n context.set(self, new Proxy(new Map, {\n // there is very little point in checking prop in proxy for this very specific case\n // and I don't want to orchestrate a whole roundtrip neither, as stuff would fail\n // regardless if from Worker we access non existent Main callback, and vice-versa.\n // This is here mostly to guarantee that if such check is performed, at least the\n // get trap goes through and then it's up to developers guarantee they are accessing\n // stuff that actually exists elsewhere.\n [HAS]: (_, action) => typeof action === 'string' && !action.startsWith('_'),\n\n // worker related: get any utility that should be available on the main thread\n [GET]: (_, action) => action === 'then' ? null : ((...args) => {\n // transaction id\n const id = uid++;\n\n // first contact: just ask for how big the buffer should be\n // the value would be stored at index [1] while [0] is just control\n let sb = new Int32Array(new SharedArrayBuffer(I32_BYTES * 2));\n\n // if a transfer list has been passed, drop it from args\n let transfer = [];\n if (buffers.has(args.at(-1) || transfer))\n buffers.delete(transfer = args.pop());\n\n // ask for invoke with arguments and wait for it\n post(transfer, id, sb, action, transform ? args.map(transform) : args);\n\n // helps deciding how to wait for results\n const isAsync = self !== globalThis;\n\n // warn users about possible deadlock still allowing them\n // to explicitly `proxy.invoke().then(...)` without blocking\n let deadlock = 0;\n if (seppuku && isAsync)\n deadlock = setTimeout(console.warn, 1000, `\uD83D\uDC80\uD83D\uDD12 - Possible deadlock if proxy.${action}(...args) is awaited`);\n\n return waitFor(isAsync, sb).value.then(() => {\n clearTimeout(deadlock);\n\n // commit transaction using the returned / needed buffer length\n const length = sb[1];\n\n // filter undefined results\n if (!length) return;\n\n // calculate the needed ui16 bytes length to store the result string\n const bytes = UI16_BYTES * length;\n\n // round up to the next amount of bytes divided by 4 to allow i32 operations\n sb = new Int32Array(new SharedArrayBuffer(bytes + (bytes % I32_BYTES)));\n\n // ask for results and wait for it\n post([], id, sb);\n return waitFor(isAsync, sb).value.then(() => parse(\n decoder.decode(new Uint16Array(sb.buffer).slice(0, length)))\n );\n });\n }),\n\n // main thread related: react to any utility a worker is asking for\n [SET](actions, action, callback) {\n const type = typeof callback;\n if (type !== FUNCTION)\n throw new Error(`Unable to assign ${action} as ${type}`);\n // lazy event listener and logic handling, triggered once by setters actions\n if (!actions.size) {\n // maps results by `id` as they are asked for\n const results = new Map;\n // add the event listener once (first defined setter, all others work the same)\n self.addEventListener('message', async (event) => {\n // grub the very same library CHANNEL; ignore otherwise\n const details = event.data?.[CHANNEL];\n if (isArray(details)) {\n // if early enough, avoid leaking data to other listeners\n event.stopImmediatePropagation();\n const [id, sb, ...rest] = details;\n let error;\n // action available: it must be defined/known on the main thread\n if (rest.length) {\n const [action, args] = rest;\n if (actions.has(action)) {\n seppuku = true;\n try {\n // await for result either sync or async and serialize it\n const result = await actions.get(action)(...args);\n if (result !== void 0) {\n const serialized = stringify(transform ? transform(result) : result);\n // store the result for \"the very next\" event listener call\n results.set(id, serialized);\n // communicate the required SharedArrayBuffer length out of the\n // resulting serialized string\n sb[1] = serialized.length;\n }\n }\n catch (_) {\n error = _;\n }\n finally {\n seppuku = false;\n }\n }\n // unknown action should be notified as missing on the main thread\n else {\n error = new Error(`Unsupported action: ${action}`);\n }\n // unlock the wait lock later on\n sb[0] = 1;\n }\n // no action means: get results out of the well known `id`\n // wait lock automatically unlocked here as no `0` value would\n // possibly ever land at index `0`\n else {\n const result = results.get(id);\n results.delete(id);\n // populate the SharedArrayBuffer with utf-16 chars code\n for (let ui16a = new Uint16Array(sb.buffer), i = 0; i < result.length; i++)\n ui16a[i] = result.charCodeAt(i);\n }\n // release te worker waiting either the length or the result\n notify(sb, 0);\n if (error) throw error;\n }\n });\n }\n // store this action callback allowing the setter in the process\n return !!actions.set(action, callback);\n }\n }));\n }\n return context.get(self);\n};\n\ncoincident.transfer = (...args) => (buffers.add(args), args);\n\nexport default coincident;\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/**\n * A WebWorker entrypoint that uses coincident to handle postMessage details\n */\nimport coincident from 'coincident';\n\nimport {\n ContentsAPI,\n DriveFS,\n TDriveMethod,\n TDriveRequest,\n TDriveResponse,\n} from '@jupyterlite/contents';\n\nimport { IPyodideWorkerKernel } from './tokens';\n\nimport { PyodideRemoteKernel } from './worker';\n\nconst workerAPI = coincident(self) as IPyodideWorkerKernel;\n\n/**\n * An Emscripten-compatible synchronous Contents API using shared array buffers.\n */\nexport class SharedBufferContentsAPI extends ContentsAPI {\n request<T extends TDriveMethod>(data: TDriveRequest<T>): TDriveResponse<T> {\n return workerAPI.processDriveRequest(data);\n }\n}\n\n/**\n * A custom drive implementation which uses shared array buffers (via coincident) if available\n */\nclass PyodideDriveFS extends DriveFS {\n createAPI(options: DriveFS.IOptions): ContentsAPI {\n return new SharedBufferContentsAPI(\n options.driveName,\n options.mountpoint,\n options.FS,\n options.ERRNO_CODES,\n );\n }\n}\n\nexport class PyodideCoincidentKernel extends PyodideRemoteKernel {\n /**\n * Setup custom Emscripten FileSystem\n */\n protected async initFilesystem(\n options: IPyodideWorkerKernel.IOptions,\n ): Promise<void> {\n if (options.mountDrive) {\n const mountpoint = '/drive';\n const { FS, PATH, ERRNO_CODES } = this._pyodide;\n const { baseUrl } = options;\n\n const driveFS = new PyodideDriveFS({\n FS,\n PATH,\n ERRNO_CODES,\n baseUrl,\n driveName: this._driveName,\n mountpoint,\n });\n FS.mkdir(mountpoint);\n FS.mount(driveFS, {}, mountpoint);\n FS.chdir(mountpoint);\n this._driveFS = driveFS;\n }\n }\n}\n\nconst worker = new PyodideCoincidentKernel();\n\nconst sendWorkerMessage = workerAPI.processWorkerMessage.bind(workerAPI);\nworker.registerCallback(sendWorkerMessage);\n\nworkerAPI.initialize = worker.initialize.bind(worker);\nworkerAPI.execute = worker.execute.bind(worker);\nworkerAPI.complete = worker.complete.bind(worker);\nworkerAPI.inspect = worker.inspect.bind(worker);\nworkerAPI.isComplete = worker.isComplete.bind(worker);\nworkerAPI.commInfo = worker.commInfo.bind(worker);\nworkerAPI.commOpen = worker.commOpen.bind(worker);\nworkerAPI.commMsg = worker.commMsg.bind(worker);\nworkerAPI.commClose = worker.commClose.bind(worker);\nworkerAPI.inputReply = worker.inputReply.bind(worker);\n", "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport type Pyodide from 'pyodide';\n\nimport type { DriveFS } from '@jupyterlite/contents';\n\nimport { KernelMessage } from '@jupyterlab/services';\n\nimport type { IPyodideWorkerKernel } from './tokens';\n\nexport class PyodideRemoteKernel {\n constructor() {\n this._initialized = new Promise((resolve, reject) => {\n this._initializer = { resolve, reject };\n });\n }\n\n /**\n * Accept the URLs from the host\n **/\n async initialize(options: IPyodideWorkerKernel.IOptions): Promise<void> {\n this._options = options;\n\n if (options.location.includes(':')) {\n const parts = options.location.split(':');\n this._driveName = parts[0];\n this._localPath = parts[1];\n } else {\n this._driveName = '';\n this._localPath = options.location;\n }\n\n await this.initRuntime(options);\n await this.initFilesystem(options);\n await this.initPackageManager(options);\n await this.initKernel(options);\n await this.initGlobals(options);\n this._initializer?.resolve();\n }\n\n protected async initRuntime(options: IPyodideWorkerKernel.IOptions): Promise<void> {\n const { pyodideUrl, indexUrl } = options;\n let loadPyodide: typeof Pyodide.loadPyodide;\n if (pyodideUrl.endsWith('.mjs')) {\n // note: this does not work at all in firefox\n const pyodideModule: typeof Pyodide = await import(\n /* webpackIgnore: true */ pyodideUrl\n );\n loadPyodide = pyodideModule.loadPyodide;\n } else {\n importScripts(pyodideUrl);\n loadPyodide = (self as any).loadPyodide;\n }\n this._pyodide = await loadPyodide({\n indexURL: indexUrl,\n ...options.loadPyodideOptions,\n });\n }\n\n protected async initPackageManager(\n options: IPyodideWorkerKernel.IOptions,\n ): Promise<void> {\n if (!this._options) {\n throw new Error('Uninitialized');\n }\n\n const { pipliteWheelUrl, disablePyPIFallback, pipliteUrls, loadPyodideOptions } =\n this._options;\n\n const preloaded = (loadPyodideOptions || {}).packages || [];\n\n if (!preloaded.includes('micropip')) {\n await this._pyodide.loadPackage(['micropip']);\n }\n\n if (!preloaded.includes('piplite')) {\n await this._pyodide.runPythonAsync(`\n import micropip\n await micropip.install('${pipliteWheelUrl}', keep_going=True)\n `);\n }\n\n // get piplite early enough to impact pyodide-kernel dependencies\n await this._pyodide.runPythonAsync(`\n import piplite.piplite\n piplite.piplite._PIPLITE_DISABLE_PYPI = ${disablePyPIFallback ? 'True' : 'False'}\n piplite.piplite._PIPLITE_URLS = ${JSON.stringify(pipliteUrls)}\n `);\n }\n\n protected async initKernel(options: IPyodideWorkerKernel.IOptions): Promise<void> {\n const preloaded = (options.loadPyodideOptions || {}).packages || [];\n\n const toLoad = ['ssl', 'sqlite3', 'ipykernel', 'comm', 'pyodide_kernel', 'ipython'];\n\n const scriptLines: string[] = [];\n\n // use piplite for packages that weren't pre-loaded\n for (const pkgName of toLoad) {\n if (!preloaded.includes(pkgName)) {\n scriptLines.push(`await piplite.install('${pkgName}', keep_going=True)`);\n }\n }\n\n // import the kernel\n scriptLines.push('import pyodide_kernel');\n\n // cd to the kernel location\n if (options.mountDrive && this._localPath) {\n scriptLines.push('import os', `os.chdir(\"${this._localPath}\")`);\n }\n\n // from this point forward, only use piplite (but not %pip)\n await this._pyodide.runPythonAsync(scriptLines.join('\\n'));\n }\n\n protected async initGlobals(options: IPyodideWorkerKernel.IOptions): Promise<void> {\n const { globals } = this._pyodide;\n this._kernel = globals.get('pyodide_kernel').kernel_instance.copy();\n this._stdout_stream = globals.get('pyodide_kernel').stdout_stream.copy();\n this._stderr_stream = globals.get('pyodide_kernel').stderr_stream.copy();\n this._interpreter = this._kernel.interpreter.copy();\n this._interpreter.send_comm = this.sendComm.bind(this);\n }\n\n /**\n * Setup custom Emscripten FileSystem\n */\n protected async initFilesystem(\n options: IPyodideWorkerKernel.IOptions,\n ): Promise<void> {\n if (options.mountDrive) {\n const mountpoint = '/drive';\n const { FS, PATH, ERRNO_CODES } = this._pyodide;\n const { baseUrl } = options;\n const { DriveFS } = await import('@jupyterlite/contents');\n\n const driveFS = new DriveFS({\n FS,\n PATH,\n ERRNO_CODES,\n baseUrl,\n driveName: this._driveName,\n mountpoint,\n });\n FS.mkdir(mountpoint);\n FS.mount(driveFS, {}, mountpoint);\n FS.chdir(mountpoint);\n this._driveFS = driveFS;\n }\n }\n\n /**\n * Recursively convert a Map to a JavaScript object\n * @param obj A Map, Array, or other object to convert\n */\n mapToObject(obj: any) {\n const out: any = obj instanceof Array ? [] : {};\n obj.forEach((value: any, key: string) => {\n out[key] =\n value instanceof Map || value instanceof Array\n ? this.mapToObject(value)\n : value;\n });\n return out;\n }\n\n /**\n * Format the response from the Pyodide evaluation.\n *\n * @param res The result object from the Pyodide evaluation\n */\n formatResult(res: any): any {\n if (!(res instanceof this._pyodide.ffi.PyProxy)) {\n return res;\n }\n // TODO: this is a bit brittle\n const m = res.toJs();\n const results = this.mapToObject(m);\n return results;\n }\n\n /**\n * Register the callback function to send messages from the worker back to the main thread.\n * @param callback the callback to register\n */\n registerCallback(callback: (msg: any) => void): void {\n this._sendWorkerMessage = callback;\n }\n\n /**\n * Makes sure pyodide is ready before continuing, and cache the parent message.\n */\n async setup(parent: any): Promise<void> {\n await this._initialized;\n this._kernel._parent_header = this._pyodide.toPy(parent);\n }\n\n /**\n * Execute code with the interpreter.\n *\n * @param content The incoming message with the code to execute.\n */\n async execute(content: any, parent: any) {\n await this.setup(parent);\n\n const publishExecutionResult = (\n prompt_count: any,\n data: any,\n metadata: any,\n ): void => {\n const bundle = {\n execution_count: prompt_count,\n data: this.formatResult(data),\n metadata: this.formatResult(metadata),\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'execute_result',\n });\n };\n\n const publishExecutionError = (ename: any, evalue: any, traceback: any): void => {\n const bundle = {\n ename: ename,\n evalue: evalue,\n traceback: traceback,\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'execute_error',\n });\n };\n\n const clearOutputCallback = (wait: boolean): void => {\n const bundle = {\n wait: this.formatResult(wait),\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'clear_output',\n });\n };\n\n const displayDataCallback = (data: any, metadata: any, transient: any): void => {\n const bundle = {\n data: this.formatResult(data),\n metadata: this.formatResult(metadata),\n transient: this.formatResult(transient),\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'display_data',\n });\n };\n\n const updateDisplayDataCallback = (\n data: any,\n metadata: any,\n transient: any,\n ): void => {\n const bundle = {\n data: this.formatResult(data),\n metadata: this.formatResult(metadata),\n transient: this.formatResult(transient),\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'update_display_data',\n });\n };\n\n const publishStreamCallback = (name: any, text: any): void => {\n const bundle = {\n name: this.formatResult(name),\n text: this.formatResult(text),\n };\n\n this._sendWorkerMessage({\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n bundle,\n type: 'stream',\n });\n };\n\n this._stdout_stream.publish_stream_callback = publishStreamCallback;\n this._stderr_stream.publish_stream_callback = publishStreamCallback;\n this._interpreter.display_pub.clear_output_callback = clearOutputCallback;\n this._interpreter.display_pub.display_data_callback = displayDataCallback;\n this._interpreter.display_pub.update_display_data_callback =\n updateDisplayDataCallback;\n this._interpreter.displayhook.publish_execution_result = publishExecutionResult;\n this._interpreter.input = this.input.bind(this);\n this._interpreter.getpass = this.getpass.bind(this);\n\n const res = await this._kernel.run(content.code);\n const results = this.formatResult(res);\n\n if (results['status'] === 'error') {\n publishExecutionError(results['ename'], results['evalue'], results['traceback']);\n }\n\n return results;\n }\n\n /**\n * Complete the code submitted by a user.\n *\n * @param content The incoming message with the code to complete.\n */\n async complete(content: any, parent: any) {\n await this.setup(parent);\n\n const res = this._kernel.complete(content.code, content.cursor_pos);\n const results = this.formatResult(res);\n return results;\n }\n\n /**\n * Inspect the code submitted by a user.\n *\n * @param content The incoming message with the code to inspect.\n */\n async inspect(\n content: { code: string; cursor_pos: number; detail_level: 0 | 1 },\n parent: any,\n ) {\n await this.setup(parent);\n\n const res = this._kernel.inspect(\n content.code,\n content.cursor_pos,\n content.detail_level,\n );\n const results = this.formatResult(res);\n return results;\n }\n\n /**\n * Check code for completeness submitted by a user.\n *\n * @param content The incoming message with the code to check.\n */\n async isComplete(content: { code: string }, parent: any) {\n await this.setup(parent);\n\n const res = this._kernel.is_complete(content.code);\n const results = this.formatResult(res);\n return results;\n }\n\n /**\n * Respond to the commInfoRequest.\n *\n * @param content The incoming message with the comm target name.\n */\n async commInfo(\n content: any,\n parent: any,\n ): Promise<KernelMessage.ICommInfoReplyMsg['content']> {\n await this.setup(parent);\n\n const res = this._kernel.comm_info(content.target_name);\n const results = this.formatResult(res);\n\n return {\n comms: results,\n status: 'ok',\n };\n }\n\n /**\n * Respond to the commOpen.\n *\n * @param content The incoming message with the comm open.\n */\n async commOpen(content: any, parent: any) {\n await this.setup(parent);\n\n const res = this._kernel.comm_manager.comm_open(\n this._pyodide.toPy(null),\n this._pyodide.toPy(null),\n this._pyodide.toPy(content),\n );\n const results = this.formatResult(res);\n\n return results;\n }\n\n /**\n * Respond to the commMsg.\n *\n * @param content The incoming message with the comm msg.\n */\n async commMsg(content: any, parent: any) {\n await this.setup(parent);\n\n const res = this._kernel.comm_manager.comm_msg(\n this._pyodide.toPy(null),\n this._pyodide.toPy(null),\n this._pyodide.toPy(content),\n );\n const results = this.formatResult(res);\n\n return results;\n }\n\n /**\n * Respond to the commClose.\n *\n * @param content The incoming message with the comm close.\n */\n async commClose(content: any, parent: any) {\n await this.setup(parent);\n\n const res = this._kernel.comm_manager.comm_close(\n this._pyodide.toPy(null),\n this._pyodide.toPy(null),\n this._pyodide.toPy(content),\n );\n const results = this.formatResult(res);\n\n return results;\n }\n\n /**\n * Resolve the input request by getting back the reply from the main thread\n *\n * @param content The incoming message with the reply\n */\n async inputReply(content: any, parent: any) {\n await this.setup(parent);\n\n this._resolveInputReply(content);\n }\n\n /**\n * Send a input request to the front-end.\n *\n * @param prompt the text to show at the prompt\n * @param password Is the request for a password?\n */\n async sendInputRequest(prompt: string, password: boolean) {\n const content = {\n prompt,\n password,\n };\n\n this._sendWorkerMessage({\n type: 'input_request',\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n content,\n });\n }\n\n async getpass(prompt: string) {\n prompt = typeof prompt === 'undefined' ? '' : prompt;\n await this.sendInputRequest(prompt, true);\n const replyPromise = new Promise((resolve) => {\n this._resolveInputReply = resolve;\n });\n const result: any = await replyPromise;\n return result['value'];\n }\n\n async input(prompt: string) {\n prompt = typeof prompt === 'undefined' ? '' : prompt;\n await this.sendInputRequest(prompt, false);\n const replyPromise = new Promise((resolve) => {\n this._resolveInputReply = resolve;\n });\n const result: any = await replyPromise;\n return result['value'];\n }\n\n /**\n * Send a comm message to the front-end.\n *\n * @param type The type of the comm message.\n * @param content The content.\n * @param metadata The metadata.\n * @param ident The ident.\n * @param buffers The binary buffers.\n */\n async sendComm(type: string, content: any, metadata: any, ident: any, buffers: any) {\n this._sendWorkerMessage({\n type: type,\n content: this.formatResult(content),\n metadata: this.formatResult(metadata),\n ident: this.formatResult(ident),\n buffers: this.formatResult(buffers),\n parentHeader: this.formatResult(this._kernel._parent_header)['header'],\n });\n }\n\n /**\n * Initialization options.\n */\n protected _options: IPyodideWorkerKernel.IOptions | null = null;\n /**\n * A promise that resolves when all initiaization is complete.\n */\n protected _initialized: Promise<void>;\n private _initializer: {\n reject: () => void;\n resolve: () => void;\n } | null = null;\n protected _pyodide: Pyodide.PyodideInterface = null as any;\n /** TODO: real typing */\n protected _localPath = '';\n protected _driveName = '';\n protected _kernel: any;\n protected _interpreter: any;\n protected _stdout_stream: any;\n protected _stderr_stream: any;\n protected _resolveInputReply: any;\n protected _driveFS: DriveFS | null = null;\n protected _sendWorkerMessage: (msg: any) => void = () => {};\n}\n"],
5
+ "mappings": "k3BAaiBA,EAAAA,SAAAA,OAAjB,SAAiBA,EAAQ,CAyCvB,SAAgBC,EACdC,EACAC,EACAC,EAAQ,EACRC,EAAO,GAAE,CAET,IAAIC,EAAIJ,EAAM,OACd,GAAII,IAAM,EACR,MAAO,GAELF,EAAQ,EACVA,EAAQ,KAAK,IAAI,EAAGA,EAAQE,CAAC,EAE7BF,EAAQ,KAAK,IAAIA,EAAOE,EAAI,CAAC,EAE3BD,EAAO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bS,GAAoBjB,EAAU,qBAAqB,KAAKA,CAAS,EACvEgB,EAAO,iBAAiBC,EAAiB,EAEzCjB,EAAU,WAAagB,EAAO,WAAW,KAAKA,CAAM,EACpDhB,EAAU,QAAUgB,EAAO,QAAQ,KAAKA,CAAM,EAC9ChB,EAAU,SAAWgB,EAAO,SAAS,KAAKA,CAAM,EAChDhB,EAAU,QAAUgB,EAAO,QAAQ,KAAKA,CAAM,EAC9ChB,EAAU,WAAagB,EAAO,WAAW,KAAKA,CAAM,EACpDhB,EAAU,SAAWgB,EAAO,SAAS,KAAKA,CAAM,EAChDhB,EAAU,SAAWgB,EAAO,SAAS,KAAKA,CAAM,EAChDhB,EAAU,QAAUgB,EAAO,QAAQ,KAAKA,CAAM,EAC9ChB,EAAU,UAAYgB,EAAO,UAAU,KAAKA,CAAM,EAClDhB,EAAU,WAAagB,EAAO,WAAW,KAAKA,CAAM",
6
6
  "names": ["ArrayExt", "firstIndexOf", "array", "value", "start", "stop", "n", "span", "i", "j", "lastIndexOf", "findFirstIndex", "fn", "findLastIndex", "d", "findFirstValue", "index", "findLastValue", "lowerBound", "begin", "half", "middle", "upperBound", "shallowEqual", "a", "b", "slice", "options", "step", "length", "result", "move", "fromIndex", "toIndex", "reverse", "rotate", "delta", "pivot", "fill", "insert", "removeAt", "removeFirstOf", "removeLastOf", "removeAllOf", "count", "removeFirstWhere", "removeLastWhere", "removeAllWhere", "chain", "objects", "object", "empty", "enumerate", "filter", "find", "findIndex", "min", "max", "minmax", "vmin", "vmax", "toArray", "toObject", "key", "each", "every", "some", "map", "range", "Private", "rangeLength", "reduce", "initial", "it", "first", "second", "accumulator", "next", "repeat", "once", "retro", "topologicSort", "edges", "sorted", "visited", "graph", "edge", "addEdge", "k", "visit", "fromNode", "toNode", "children", "node", "child", "stride", "StringExt", "findIndices", "source", "query", "indices", "matchSumOfSquares", "score", "matchSumOfDeltas", "last", "highlight", "cmp", "take", "item", "zip", "iters", "obj", "tuple", "JSONExt", "isPrimitive", "value", "isArray", "isObject", "deepEqual", "first", "second", "a1", "a2", "deepArrayEqual", "deepObjectEqual", "deepCopy", "deepArrayCopy", "deepObjectCopy", "i", "n", "key", "firstValue", "secondValue", "result", "subvalue", "MimeData", "mime", "data", "PromiseDelegate", "resolve", "reject", "reason", "Token", "name", "description", "fallbackRandomValues", "buffer", "Random", "crypto", "uuid4Factory", "getRandomValues", "bytes", "lut", "UUID", "Signal", "sender", "slot", "thisArg", "Private", "args", "disconnectBetween", "receiver", "disconnectSender", "disconnectReceiver", "disconnectAll", "object", "clearData", "getExceptionHandler", "setExceptionHandler", "handler", "old", "Stream", "PromiseDelegate", "pending", "next", "err", "connect", "signal", "receivers", "receiversForSender", "findConnection", "senders", "sendersForReceiver", "connection", "disconnect", "scheduleCleanup", "emit", "i", "n", "invokeSlot", "dirtySet", "schedule", "connections", "find", "array", "cleanupDirtySet", "cleanupConnections", "ArrayExt", "isDeadConnection", "signaling_1", "ActivityMonitor", "options", "value", "sender", "args", "exports", "DEFAULT_MAX_SIZE", "LruCache", "options", "key", "item", "value", "exports", "MarkdownCodeBlocks", "markdownExtensions", "MarkdownCodeBlock", "startLine", "isMarkdown", "extension", "findMarkdownCodeBlocks", "text", "lines", "codeBlocks", "currentBlock", "lineIndex", "line", "lineContainsMarker", "constructingBlock", "firstIndex", "lastIndex", "exports", "require_minimist", "__commonJSMin", "exports", "module", "hasKey", "obj", "keys", "o", "key", "isNumber", "x", "isConstructorOrProto", "args", "opts", "flags", "aliases", "aliasIsBoolean", "y", "k", "defaults", "argv", "argDefined", "arg", "setKey", "value", "i", "lastKey", "setArg", "val", "notFlags", "next", "m", "letters", "broken", "j", "require_path_browserify", "__commonJSMin", "exports", "module", "assertPath", "path", "normalizeStringPosix", "allowAboveRoot", "res", "lastSegmentLength", "lastSlash", "dots", "code", "i", "lastSlashIndex", "_format", "sep", "pathObject", "dir", "base", "posix", "resolvedPath", "resolvedAbsolute", "cwd", "isAbsolute", "trailingSeparator", "joined", "arg", "from", "to", "fromStart", "fromEnd", "fromLen", "toStart", "toEnd", "toLen", "length", "lastCommonSep", "fromCode", "toCode", "out", "hasRoot", "end", "matchedSlash", "ext", "start", "extIdx", "firstNonSlashEnd", "startDot", "startPart", "preDotState", "ret", "require_requires_port", "__commonJSMin", "exports", "module", "port", "protocol", "require_querystringify", "__commonJSMin", "exports", "has", "undef", "decode", "input", "encode", "querystring", "query", "parser", "result", "part", "key", "value", "querystringify", "obj", "prefix", "pairs", "require_url_parse", "__commonJSMin", "exports", "module", "required", "qs", "controlOrWhitespace", "CRHTLF", "slashes", "port", "protocolre", "windowsDriveLetter", "trimLeft", "str", "rules", "address", "url", "isSpecial", "ignore", "lolcation", "loc", "globalVar", "location", "finaldestination", "type", "key", "Url", "scheme", "extractProtocol", "match", "protocol", "forwardSlashes", "otherSlashes", "slashesCount", "rest", "resolve", "relative", "base", "path", "last", "unshift", "up", "parser", "extracted", "parse", "instruction", "index", "instructions", "i", "set", "part", "value", "fn", "char", "ins", "toString", "stringify", "query", "host", "result", "path_1", "url_parse_1", "__importDefault", "URLExt", "parse", "url", "a", "getHostName", "normalize", "join", "parts", "u", "isSchemaLess", "prefix", "path", "encodeParts", "objectToQueryString", "value", "keys", "key", "content", "queryStringToObject", "acc", "val", "isLocal", "allowRoot", "protocol", "exports", "el", "e", "key", "name", "value", "last", "options", "path", "mode", "_a", "workspace", "_b", "labOrDoc", "_c", "treePath", "_d", "baseUrl", "wsUrl", "format", "download", "notebookPath", "url", "notebookVersion", "val", "Extension", "populate", "raw", "error", "isDeferred", "id", "separatorIndex", "extName", "isDisabled", "path_1", "PathExt", "join", "paths", "path", "removeSlash", "joinWithLeadingSlash", "basename", "ext", "dirname", "dir", "extname", "normalize", "resolve", "parts", "relative", "from", "to", "normalizeExtension", "extension", "exports", "coreutils_1", "signalToPromise", "signal", "timeout", "waitForSignal", "cleanup", "slot", "sender", "args", "exports", "Text", "HAS_SURROGATES", "jsIndexToCharIndex", "jsIdx", "text", "charIdx", "i", "charCode", "nextCharCode", "charIndexToJsIndex", "camelCase", "str", "upper", "match", "p1", "p2", "titleCase", "word", "exports", "UNITS", "Time", "formatHuman", "value", "format", "lang", "formatter", "delta", "unit", "amount", "exports", "__exportStar", "exports", "require_Mime", "__commonJSMin", "exports", "module", "Mime", "i", "typeMap", "force", "type", "extensions", "t", "ext", "path", "last", "hasPath", "require_standard", "__commonJSMin", "exports", "module", "require_other", "__commonJSMin", "exports", "module", "require_mime", "__commonJSMin", "exports", "module", "Mime", "import_coreutils", "import_mime", "IContents", "MIME", "FILE", "IBroadcastChannelWrapper", "init_tokens", "__esmMin", "TYPES", "getType", "ext", "defaultType", "fileType", "fileExt", "mime", "hasFormat", "fileFormat", "import_coreutils", "DEFAULT_STORAGE_NAME", "N_CHECKPOINTS", "Contents", "Private", "init_contents", "__esmMin", "init_tokens", "options", "data", "byte", "driver", "path", "_a", "type", "_b", "created", "dirname", "basename", "extname", "item", "name", "file", "counter", "MIME", "ext", "_c", "mimetype", "FILE", "format", "key", "toDir", "toPath", "storage", "serverItem", "model", "contentMap", "serverContents", "content", "oldLocalPath", "newLocalPath", "modified", "newFile", "child", "chunk", "chunked", "originalContent", "lastChunk", "slashed", "toDelete", "checkpoints", "copies", "id", "checkpointID", "newContent", "escaped", "fileUrl", "response", "contentText", "contentBytes", "contentBuffer", "apiURL", "json", "err", "counters", "instanceOfStream", "nodeOrStream", "DIR_MODE", "FILE_MODE", "SEEK_CUR", "SEEK_END", "init_emscripten", "__esmMin", "DRIVE_SEPARATOR", "DRIVE_API_PATH", "BLOCK_SIZE", "encoder", "decoder", "flagNeedsWrite", "DriveFSEmscriptenStreamOps", "DriveFSEmscriptenNodeOps", "ContentsAPI", "ServiceWorkerContentsAPI", "DriveFS", "init_drivefs", "__esmMin", "init_emscripten", "fs", "stream", "path", "flags", "parsedFlags", "needsWrite", "buffer", "offset", "length", "position", "size", "_a", "oldData", "whence", "nodeOrStream", "instanceOfStream", "value", "node", "attr", "key", "parent", "name", "result", "mode", "dev", "newDir", "newName", "oldNode", "newDirNode", "oldPath", "driveName", "mountpoint", "FS", "ERRNO_CODES", "newPath", "dirlist", "response", "serializedContent", "format", "binString", "len", "data", "i", "binary", "stats", "baseUrl", "xhr", "e", "options", "mount", "parts", "currentNode", "import_coreutils", "DriveContentsProcessor", "init_drivecontents", "__esmMin", "init_drivefs", "options", "request", "model", "response", "subcontent", "defaultDate", "BLOCK_SIZE", "BroadcastChannelWrapper", "init_broadcast", "__esmMin", "init_drivefs", "init_drivecontents", "options", "event", "request", "response", "DriveContentsProcessor", "DRIVE_API_PATH", "lib_exports", "__export", "BLOCK_SIZE", "BroadcastChannelWrapper", "Contents", "ContentsAPI", "DIR_MODE", "DRIVE_API_PATH", "DRIVE_SEPARATOR", "DriveContentsProcessor", "DriveFS", "DriveFSEmscriptenNodeOps", "DriveFSEmscriptenStreamOps", "FILE", "FILE_MODE", "IBroadcastChannelWrapper", "IContents", "MIME", "SEEK_CUR", "SEEK_END", "ServiceWorkerContentsAPI", "instanceOfStream", "init_lib", "__esmMin", "init_contents", "init_drivefs", "init_tokens", "init_broadcast", "init_emscripten", "init_drivecontents", "FUNCTION", "CHANNEL", "MAIN", "THREAD", "GET", "HAS", "SET", "isArray", "SharedArrayBuffer", "window", "notify", "wait", "waitAsync", "postPatched", "buffer", "onmessage", "w", "ids", "resolvers", "postMessage", "listener", "event", "_a", "details", "CHANNEL", "id", "sb", "data", "rest", "resolve", "buff", "i", "as", "Int32Array", "Map", "Uint16Array", "I32_BYTES", "UI16_BYTES", "waitInterrupt", "sb", "delay", "handler", "wait", "buffers", "context", "syncResult", "fn", "uid", "coincident", "self", "parse", "stringify", "transform", "interrupt", "sendMessage", "postPatched", "post", "transfer", "args", "CHANNEL", "FUNCTION", "decoder", "waitFor", "isAsync", "waitAsync", "seppuku", "HAS", "_", "action", "GET", "id", "SharedArrayBuffer", "deadlock", "length", "bytes", "SET", "actions", "callback", "type", "results", "event", "_a", "details", "isArray", "rest", "error", "result", "serialized", "ui16a", "i", "notify", "esm_default", "init_lib", "PyodideRemoteKernel", "resolve", "reject", "options", "_a", "parts", "pyodideUrl", "indexUrl", "loadPyodide", "pipliteWheelUrl", "disablePyPIFallback", "pipliteUrls", "loadPyodideOptions", "preloaded", "toLoad", "scriptLines", "pkgName", "globals", "mountpoint", "FS", "PATH", "ERRNO_CODES", "baseUrl", "DriveFS", "driveFS", "obj", "out", "value", "key", "res", "m", "callback", "parent", "content", "publishExecutionResult", "prompt_count", "data", "metadata", "bundle", "publishExecutionError", "ename", "evalue", "traceback", "clearOutputCallback", "wait", "displayDataCallback", "transient", "updateDisplayDataCallback", "publishStreamCallback", "name", "text", "results", "prompt", "password", "type", "ident", "buffers", "workerAPI", "esm_default", "SharedBufferContentsAPI", "ContentsAPI", "data", "PyodideDriveFS", "DriveFS", "options", "PyodideCoincidentKernel", "PyodideRemoteKernel", "mountpoint", "FS", "PATH", "ERRNO_CODES", "baseUrl", "driveFS", "worker", "sendWorkerMessage"]
7
7
  }