{"version":3,"sources":["jsdelivr-header.js","webpack://@lokidb/full-text-search/webpack/universalModuleDefinition","webpack://@lokidb/full-text-search/webpack/bootstrap","webpack://@lokidb/full-text-search/packages/common/plugin.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/analyzer/tokenizer.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/analyzer/token_filter.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/analyzer/analyzer.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/inverted_index.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/scorer.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/fuzzy/run_automaton.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/fuzzy/automaton.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/fuzzy/long.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/fuzzy/parametric_description.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/fuzzy/lev1t_parametric_description.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/fuzzy/lev2t_parametric_description.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/fuzzy/levenshtein_automata.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/index_searcher.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/full_text_search.ts","webpack://@lokidb/full-text-search/packages/full-text-search/src/index.ts","webpack://@lokidb/full-text-search/(webpack)/buildin/global.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,CCNA,SAAA,EAAA,GACA,iBAAA,SAAA,iBAAA,OACA,OAAA,QAAA,IACA,mBAAA,eAAA,IACA,OAAA,8BAAA,GACA,iBAAA,QACA,QAAA,4BAAA,KAEA,EAAA,4BAAA,IAAA,EAAA,mBAAA,EAAA,4BAAA,QACC,CATD,CASC,oBAAA,UAAA,MAAA,WACD,O,YCTA,IAAA,EAAA,GAGA,SAAA,EAAA,GAGA,GAAA,EAAA,GACA,OAAA,EAAA,GAAA,QAGA,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CACT,E,sSCxGF,EAAyB,SAAI,GAC7B,EAAyB,SAAW,QAAI,EACxC,EAAyB,SAAoB,iBAAI,EACjD,EAA0B,UAAI,GAC9B,EAA0B,UAAuB,oBAAI,EACrD,EAA4B,YAAI,GAChC,EAA4B,YAAwB,qBAAI,EACxD,EAA4B,YAAwB,qBAAI,EAOxD,EAAA,S,gBCnBA,IAAA,EAGA,EAAA,WACA,OAAA,IACC,CAFD,GAIA,IAEA,KAAA,SAAA,cAAA,KAAA,EAAA,MAAA,OACA,CAAC,MAAA,GAED,iBAAA,SAAA,EAAA,OACA,CAMA,EAAA,QAAA,C","file":"/npm/@lokidb/full-text-search@2.1.0/lokidb.full-text-search.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@lokidb/full-text-search@2.1.0/lokidb.full-text-search.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@lokidb/full-text-search\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@lokidb/full-text-search\"] = factory();\n\telse\n\t\troot[\"@lokidb/full-text-search\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","function getGlobal(): any {\n  let glob;\n  (function (global) {\n    glob = global;\n  })(global !== undefined && global || this);\n  return glob;\n}\n\n\nfunction create(): void {\n  const global = getGlobal();\n  const sym = Symbol.for(\"LOKI\") as any;\n  if (global[sym] === undefined) {\n    global[sym] = {\n    };\n  }\n  return global[sym];\n}\n\n/**\n * @hidden\n */\nexport const PLUGINS = create();\n","/**\n * A tokenizer splits a string into individual tokens.\n */\nexport type Tokenizer = (value: string) => string[];\n\n/**\n * Splits a string at whitespace characters into tokens.\n * @param {string} value - the string\n * @returns {string[]} - the tokens\n */\nexport function whitespaceTokenizer(value: string): string[] {\n  return value.split(/[\\s]+/);\n}\n\n","/**\n * A token filter takes tokens from a tokenizer and modify, delete or add tokens.\n */\nexport type TokenFilter = (value: string, index: number, array: string[]) => string;\n\n/**\n * Converts a token to lowercase.\n * @param {string} token - the token\n * @returns {string} - the lowercased token\n */\nexport function lowercaseTokenFilter(token: string): string {\n  return token.toLowerCase();\n}\n\n/**\n * Converts a token to uppercase.\n * @param {string} token - the token\n * @returns {string} - the uppercased token\n */\nexport function uppercaseTokenFilter(token: string): string {\n  return token.toUpperCase();\n}\n","import { CharacterFilter } from \"./character_filter\";\nimport { Tokenizer, whitespaceTokenizer } from \"./tokenizer\";\nimport { lowercaseTokenFilter, TokenFilter } from \"./token_filter\";\n\n/**\n * A analyzer converts a string into tokens which are added to the inverted index for searching.\n */\nexport interface Analyzer {\n  /**\n   * The character filters of the analyzer.\n   */\n  char_filter?: CharacterFilter[];\n  /**\n   * The tokenizer of the analyzer.\n   */\n  tokenizer: Tokenizer;\n  /**\n   * The token filters of the analyzer.\n   */\n  token_filter?: TokenFilter[];\n}\n\n/**\n * Analyzes a given string.\n * @param {Analyzer} analyzer - the analyzer\n * @param {string} str - the string\n * @returns {string[]} - the tokens\n */\nexport function analyze(analyzer: Analyzer, str: string): string[] {\n  if (analyzer.char_filter) {\n    for (let j = 0; j < analyzer.char_filter.length; j++) {\n      str = analyzer.char_filter[j](str);\n    }\n  }\n  const tokens = analyzer.tokenizer(str);\n  if (analyzer.token_filter) {\n    for (let i = 0; i < tokens.length; i++) {\n      for (let k = 0; k < analyzer.token_filter.length; k++) {\n        tokens[i] = analyzer.token_filter[k](tokens[i], i, tokens);\n      }\n    }\n  }\n  // Remove empty tokens.\n  return tokens.filter((token) => token);\n}\n\n/**\n * An analyzer with the whitespace tokenizer and the lowercase token filter.\n */\nexport class StandardAnalyzer implements Analyzer {\n  tokenizer = whitespaceTokenizer;\n  token_filter = [lowercaseTokenFilter];\n}\n","import { Analyzer, StandardAnalyzer, analyze } from \"./analyzer/analyzer\";\n\n/**\n * Converts a string into an array of code points.\n * @param str - the string\n * @returns {number[]} to code points\n * @hidden\n */\nexport function toCodePoints(str: string): number[] {\n  const r = [];\n  for (let i = 0; i < str.length;) {\n    const chr = str.charCodeAt(i++);\n    if (chr >= 0xD800 && chr <= 0xDBFF) {\n      // surrogate pair\n      const low = str.charCodeAt(i++);\n      r.push(0x10000 + ((chr - 0xD800) << 10) | (low - 0xDC00));\n    } else {\n      // ordinary character\n      r.push(chr);\n    }\n  }\n  return r;\n}\n\n/**\n * Inverted index class handles featured text search for specific document fields.\n * @hidden\n */\nexport class InvertedIndex {\n  public analyzer: Analyzer;\n  public docCount: number = 0;\n  public docStore: Map<InvertedIndex.DocumentIndex, InvertedIndex.DocStore> = new Map();\n  public totalFieldLength: number = 0;\n  public root: InvertedIndex.Index = new Map();\n\n  private _store: boolean;\n  private _optimizeChanges: boolean;\n\n  /**\n   * @param {boolean} [options.store=true] - inverted index will be stored at serialization rather than rebuilt on load\n   * @param {boolean} [options.optimizeChanges=true] - flag to store additional metadata inside the index for better\n   *  performance if an existing field is updated or removed\n   * @param {Analyzer} [options.analyzer=] - the analyzer of this inverted index\n   */\n  constructor(options: InvertedIndex.FieldOptions = {}) {\n    (\n      {\n        store: this._store = true,\n        optimizeChanges: this._optimizeChanges = true,\n        analyzer: this.analyzer = new StandardAnalyzer()\n      } = options\n    );\n  }\n\n  /**\n   * Adds defined fields of a document to the inverted index.\n   * @param {string} field - the field to add\n   * @param {number} docId - the doc id of the field\n   */\n  public insert(field: string, docId: InvertedIndex.DocumentIndex): void {\n    if (this.docStore.has(docId)) {\n      throw Error(\"Field already added.\");\n    }\n\n    // Tokenize document field.\n    const fieldTokens = analyze(this.analyzer, field);\n    if (fieldTokens.length == 0) {\n      // Add empty field at least to document store for query 'exists'.\n      this.docStore.set(docId, {fieldLength: 0});\n      return;\n    }\n    this.totalFieldLength += fieldTokens.length;\n    this.docCount += 1;\n    this.docStore.set(docId, {fieldLength: fieldTokens.length});\n\n    // Holds references to each index of a document.\n    const indexRef: InvertedIndex.Index[] = [];\n    if (this._optimizeChanges) {\n      Object.defineProperties(this.docStore.get(docId), {\n        indexRef: {enumerable: false, configurable: true, writable: true, value: indexRef}\n      });\n    }\n\n    // Iterate over all unique field terms.\n    for (const token of new Set(fieldTokens)) {\n      // Calculate term frequency.\n      let tf = 0;\n      for (let j = 0; j < fieldTokens.length; j++) {\n        if (fieldTokens[j] === token) {\n          ++tf;\n        }\n      }\n\n      // Add term to index tree.\n      let branch = this.root;\n\n      for (const c of toCodePoints(token)) {\n        let child = branch.get(c);\n        if (child === undefined) {\n          child = new Map();\n          if (this._optimizeChanges) {\n            child.pa = branch;\n          }\n          branch.set(c, child);\n        }\n        branch = child;\n      }\n      // Add term info to index leaf.\n      if (branch.dc === undefined) {\n        branch.dc = new Map();\n        branch.df = 0;\n      }\n      branch.dc.set(docId, tf);\n      branch.df += 1;\n\n      // Store index leaf for deletion.\n      indexRef.push(branch);\n    }\n  }\n\n  /**\n   * Removes all relevant terms of a document from the inverted index.\n   * @param {number} docId - the document.\n   */\n  public remove(docId: InvertedIndex.DocumentIndex): void {\n    if (!this.docStore.has(docId)) {\n      return;\n    }\n    const docStore = this.docStore.get(docId);\n    // Remove document.\n    this.docStore.delete(docId);\n    if (docStore.fieldLength === 0) {\n      return;\n    }\n    this.docCount -= 1;\n\n    // Reduce total field length.\n    this.totalFieldLength -= docStore.fieldLength;\n\n    if (this._optimizeChanges) {\n      // Iterate over all term references.\n      // Remove docId from docs and decrement document frequency.\n      const indexRef = docStore.indexRef;\n      for (let j = 0; j < indexRef.length; j++) {\n        let index = indexRef[j];\n        index.df -= 1;\n        index.dc.delete(docId);\n\n        // Check if no document is left for current tree.\n        if (index.df === 0) {\n          // Delete unused meta data of branch.\n          delete index.df;\n          delete index.dc;\n\n          // Check for sub branches.\n          if (index.size !== 0) {\n            continue;\n          }\n\n          // Delete term branch if not used anymore.\n          do {\n            // Go tree upwards.\n            const parent = index.pa;\n            // Delete parent reference for preventing memory leak (cycle reference).\n            delete index.pa;\n\n            // Iterate over all children.\n            for (const key of parent.keys()) {\n              // Remove previous child form parent.\n              if (parent.get(key) === index) {\n                parent.delete(key);\n                break;\n              }\n            }\n            index = parent;\n          } while (index.pa !== undefined && index.size === 0 && index.df === undefined);\n        }\n      }\n    } else {\n      this._remove(this.root, docId);\n    }\n  }\n\n  /**\n   * Gets the term index of a term.\n   * @param {string} term - the term\n   * @param {object} root - the term index to start from\n   * @param {number} start - the position of the term string to start from\n   * @return {object} - The term index or null if the term is not in the term tree.\n   */\n  public static getTermIndex(term: number[], root: InvertedIndex.Index, start: number = 0): InvertedIndex.Index {\n    if (start >= term.length) {\n      return null;\n    }\n    for (let i = start; i < term.length; i++) {\n      let child = root.get(term[i]);\n      if (child === undefined) {\n        return null;\n      }\n      root = child;\n    }\n    return root;\n  }\n\n  /**\n   * Extends a term index to all available term leafs.\n   * @param {object} idx - the term index to start from\n   * @param {number[]} [term=[]] - the current term\n   * @param {Array} termIndices - all extended indices with their term\n   * @returns {Array} - Array with term indices and extension\n   */\n  public static extendTermIndex(idx: InvertedIndex.Index, term: number[] = [],\n                                termIndices: InvertedIndex.IndexTerm[] = []): InvertedIndex.IndexTerm[] {\n    if (idx.df !== undefined) {\n      termIndices.push({index: idx, term: term.slice()});\n    }\n\n    term.push(0);\n    for (const child of idx) {\n      term[term.length - 1] = child[0];\n      InvertedIndex.extendTermIndex(child[1], term, termIndices);\n    }\n    term.pop();\n    return termIndices;\n  }\n\n  /**\n   * Serialize the inverted index.\n   * @returns {{docStore: *, _fields: *, index: *}}\n   */\n  public toJSON(): InvertedIndex.Serialization {\n    if (this._store) {\n      return {\n        _store: true,\n        _optimizeChanges: this._optimizeChanges,\n        docCount: this.docCount,\n        docStore: [...this.docStore],\n        totalFieldLength: this.totalFieldLength,\n        root: InvertedIndex._serializeIndex(this.root)\n      };\n    }\n    return {\n      _store: false,\n      _optimizeChanges: this._optimizeChanges,\n    };\n  }\n\n  /**\n   * Deserialize the inverted index.\n   * @param {{docStore: *, _fields: *, index: *}} serialized - The serialized inverted index.\n   * @param {Analyzer} analyzer[undefined] - an analyzer\n   */\n  public static fromJSONObject(serialized: InvertedIndex.Serialization, analyzer?: Analyzer): InvertedIndex {\n    const invIdx = new InvertedIndex({\n      store: serialized._store,\n      optimizeChanges: serialized._optimizeChanges,\n      analyzer: analyzer\n    });\n\n    if (serialized._store) {\n      invIdx.docCount = serialized.docCount;\n      invIdx.docStore = new Map(serialized.docStore);\n      invIdx.totalFieldLength = serialized.totalFieldLength;\n      invIdx.root = InvertedIndex._deserializeIndex(serialized.root);\n    }\n\n    if (invIdx._optimizeChanges) {\n      invIdx._regenerate(invIdx.root, null);\n    }\n\n    return invIdx;\n  }\n\n  private static _serializeIndex(idx: InvertedIndex.Index): InvertedIndex.SerializedIndex {\n    const serialized: InvertedIndex.SerializedIndex = {};\n    if (idx.dc !== undefined) {\n      serialized.d = {df: idx.df, dc: [...idx.dc]};\n    }\n\n    if (idx.size === 0) {\n      return serialized;\n    }\n\n    const keys = [];\n    const values = [];\n    for (const child of idx) {\n      keys.push(child[0]);\n      values.push(InvertedIndex._serializeIndex(child[1]));\n    }\n    serialized.k = keys;\n    serialized.v = values;\n\n    return serialized;\n  }\n\n  private static _deserializeIndex(serialized: InvertedIndex.SerializedIndex): InvertedIndex.Index {\n    const idx: InvertedIndex.Index = new Map();\n\n    if (serialized.k !== undefined) {\n      for (let i = 0; i < serialized.k.length; i++) {\n        idx.set(serialized.k[i], InvertedIndex._deserializeIndex(serialized.v[i]));\n      }\n    }\n    if (serialized.d !== undefined) {\n      idx.df = serialized.d.df;\n      idx.dc = new Map(serialized.d.dc);\n    }\n    return idx;\n  }\n\n  /**\n   * Set parent of to each index and regenerate the indexRef.\n   * @param {Index} index - the index\n   * @param {Index} parent - the parent\n   */\n  private _regenerate(index: InvertedIndex.Index, parent: InvertedIndex.Index): void {\n    // Set parent.\n    if (parent !== null) {\n      index.pa = parent;\n    }\n\n    // Iterate over subtree.\n    for (const child of index.values()) {\n      this._regenerate(child, index);\n    }\n\n    if (index.dc !== undefined) {\n      // Get documents of term.\n      for (const docId of index.dc.keys()) {\n        // Get document store at specific document/field.\n        const ref = this.docStore.get(docId);\n        if (ref.indexRef === undefined) {\n          Object.defineProperties(ref, {\n            indexRef: {enumerable: false, configurable: true, writable: true, value: []}\n          });\n        }\n        // Set reference to term index.\n        ref.indexRef.push(index);\n      }\n    }\n  }\n\n  /**\n   * Iterate over the whole inverted index and remove the document.\n   * Delete branch if not needed anymore.\n   * Function is needed if index is used without optimization.\n   * @param {Index} idx - the index\n   * @param {number} docId - the doc id\n   * @returns {boolean} true if index is empty\n   */\n  private _remove(idx: InvertedIndex.Index, docId: InvertedIndex.DocumentIndex): boolean {\n    for (const child of idx) {\n      // Checkout branch.\n      if (this._remove(child[1], docId)) {\n        idx.delete(child[0]);\n      }\n    }\n    // Remove docId from docs and decrement document frequency.\n    if (idx.df !== undefined) {\n      if (idx.dc.has(docId)) {\n        idx.df -= 1;\n        idx.dc.delete(docId);\n\n        // Delete unused meta data of branch.\n        if (idx.df === 0) {\n          delete idx.df;\n          delete idx.dc;\n        }\n      }\n    }\n    return idx.size === 0 && idx.dc === undefined;\n  }\n}\n\nexport namespace InvertedIndex {\n  export interface FieldOptions {\n    store?: boolean;\n    optimizeChanges?: boolean;\n    analyzer?: Analyzer;\n  }\n\n  export type Index = Map<number, any> & { dc?: Map<DocumentIndex, number>, df?: number, pa?: Index };\n\n  export type IndexTerm = { index: Index, term: number[] };\n\n  export interface SerializedIndex {\n    d?: {\n      df: number;\n      dc: [DocumentIndex, number][]\n    };\n    k?: number[];\n    v?: SerializedIndex[];\n  }\n\n  export type Serialization = SpareSerialization | FullSerialization;\n\n  export type SpareSerialization = {\n    _store: false;\n    _optimizeChanges: boolean;\n  };\n\n  export type FullSerialization = {\n    _store: true;\n    _optimizeChanges: boolean;\n    docCount: number;\n    docStore: [DocumentIndex, DocStore][];\n    totalFieldLength: number;\n    root: SerializedIndex;\n  };\n\n  export interface DocStore {\n    fieldLength?: number;\n    indexRef?: Index[];\n  }\n\n  export type DocumentIndex = number | string;\n}\n","import { InvertedIndex } from \"./inverted_index\";\nimport { Dict } from \"../../common/types\";\nimport { Query } from \"./query_types\";\n\n/**\n * @hidden\n */\nexport class Scorer {\n  private _invIdxs: Dict<InvertedIndex>;\n  private _cache: Dict<Scorer.IDFCache> = {};\n\n  constructor(invIdxs: Dict<InvertedIndex>) {\n    this._invIdxs = invIdxs;\n  }\n\n  public setDirty(): void {\n    this._cache = {};\n  }\n\n  public score(fieldName: string, boost: number, termIdx: InvertedIndex.Index, doScoring: boolean | null,\n               queryResults: Scorer.QueryResults, term: number[], df: number = 0): void {\n    if (termIdx === null || termIdx.dc === undefined) {\n      return;\n    }\n\n    const idf = this._idf(fieldName, df || termIdx.df);\n    for (const [docId, tf] of termIdx.dc) {\n      if (!queryResults.has(docId)) {\n        queryResults.set(docId, []);\n      }\n\n      if (doScoring === true) {\n        // BM25 scoring.\n        queryResults.get(docId).push({tf, idf, boost, fieldName, term});\n      } else if (doScoring === false) {\n        // Constant scoring.\n        queryResults.set(docId, [{boost}]);\n      } else {\n        // Zero scoring.\n        queryResults.set(docId, [{boost: 0}]);\n      }\n    }\n  }\n\n  public scoreConstant(boost: number, docId: InvertedIndex.DocumentIndex,\n                       queryResults: Scorer.QueryResults): Scorer.QueryResults {\n    if (!queryResults.has(docId)) {\n      queryResults.set(docId, []);\n    }\n    queryResults.get(docId).push({boost});\n    return queryResults;\n  }\n\n  public finalScore(query: Query, queryResults: Scorer.QueryResults): Scorer.ScoreResults {\n    const finalResult: Scorer.ScoreResults = {};\n    const k1 = query.bm25 !== undefined ? query.bm25.k1 : 1.2;\n    const b = query.bm25 !== undefined ? query.bm25.b : 0.75;\n    const explain = query.explain !== undefined ? query.explain : false;\n\n    for (const [docId, result] of queryResults) {\n      let docScore = 0;\n      let docExplanation: Scorer.ScoreExplanation[] = [];\n      for (let i = 0; i < result.length; i++) {\n        const queryResult = result[i];\n        let score = 0;\n        if (queryResult.tf !== undefined) {\n          // BM25 scoring.\n          const tf = queryResult.tf;\n          const fieldLength = Scorer._calculateFieldLength(this._invIdxs[queryResult.fieldName].docStore.get(docId)\n            .fieldLength);\n          const avgFieldLength = this._avgFieldLength(queryResult.fieldName);\n          const tfNorm = (tf * (k1 + 1)) / (tf + k1 * (1 - b + b * (fieldLength / avgFieldLength)));\n          score = queryResult.idf * tfNorm * queryResult.boost;\n          if (explain) {\n            docExplanation.push({\n              boost: queryResult.boost,\n              score: score,\n              docID: docId,\n              fieldName: queryResult.fieldName,\n              index: String.fromCharCode(...queryResult.term),\n              idf: queryResult.idf,\n              tfNorm: tfNorm,\n              tf: tf,\n              fieldLength: fieldLength,\n              avgFieldLength: avgFieldLength,\n            });\n          }\n        } else {\n          // Constant scoring.\n          score = queryResult.boost;\n\n          if (explain) {\n            docExplanation.push({\n              boost: queryResult.boost,\n              score: score\n            });\n          }\n        }\n        docScore += score;\n      }\n      if (explain) {\n        finalResult[docId] = {\n          score: docScore,\n          explanation: docExplanation\n        };\n      } else {\n        finalResult[docId] = {\n          score: docScore\n        };\n      }\n    }\n    return finalResult;\n  }\n\n  private static _calculateFieldLength(fieldLength: number): number {\n    // Dummy function to be compatible to lucene in unit tests.\n    return fieldLength;\n  }\n\n  private _getCache(fieldName: string): Scorer.IDFCache {\n    if (this._cache[fieldName] === undefined) {\n      const avgFieldLength = this._invIdxs[fieldName].totalFieldLength / this._invIdxs[fieldName].docCount;\n      this._cache[fieldName] = {idfs: {}, avgFieldLength};\n    }\n    return this._cache[fieldName];\n  }\n\n  /**\n   * Returns the idf by either calculate it or use a cached one.\n   * @param {string} fieldName - the name of the field\n   * @param {number} docFreq - the doc frequency of the term\n   * @returns {number} the idf\n   * @private\n   */\n  private _idf(fieldName: string, docFreq: number): number {\n    const cache = this._getCache(fieldName);\n    if (cache.idfs[docFreq] !== undefined) {\n      return cache.idfs[docFreq];\n    }\n    return cache.idfs[docFreq] = Math.log(1 + (this._invIdxs[fieldName].docCount - docFreq + 0.5) / (docFreq + 0.5));\n  }\n\n  private _avgFieldLength(fieldName: string): number {\n    return this._getCache(fieldName).avgFieldLength;\n  }\n}\n\nexport namespace Scorer {\n  export interface IDFCache {\n    idfs: Dict<number>;\n    avgFieldLength: number;\n  }\n\n  export interface QueryResult {\n    tf?: number; // Term frequency.\n    idf?: number; // Inverse document frequency\n    boost: number;\n    fieldName?: string;\n    term?: number[];\n  }\n\n  export type QueryResults = Map<InvertedIndex.DocumentIndex, QueryResult[]>;\n\n  export interface BM25Explanation {\n    boost: number;\n    score: number;\n    docID: number;\n    fieldName: string;\n    index: string;\n    idf: number;\n    tfNorm: number;\n    tf: number;\n    fieldLength: number;\n    avgFieldLength: number;\n  }\n\n  export interface ConstantExplanation {\n    boost: number;\n    score: number;\n  }\n\n  export type ScoreExplanation = BM25Explanation | ConstantExplanation;\n  export type ScoreResult = { score: number, explanation?: ScoreExplanation[] };\n  export type ScoreResults = Dict<ScoreResult>;\n}\n","import { Automaton } from \"./automaton\";\n\n/**\n * From org/apache/lucene/util/automaton/RunAutomaton.java\n * @hidden\n */\nexport class RunAutomaton {\n  private _points: number[];\n  private _accept: boolean[];\n  private _transitions: number[];\n  private _classmap: number[];\n\n  constructor(automaton: Automaton) {\n    const size = automaton.getNumStates();\n    this._points = automaton.getStartPoints();\n    this._accept = new Array(size);\n    this._transitions = new Array(size * this._points.length);\n\n    for (let n = 0; n < size; n++) {\n      this._accept[n] = automaton.isAccept(n);\n      for (let c = 0; c < this._points.length; c++) {\n        // assert dest === -1 || dest < size;\n        this._transitions[n * this._points.length + c] = automaton.step(n, this._points[c]);\n      }\n    }\n\n    this._classmap = new Array(256 /* alphaSize */);\n    for (let i = 0, j = 0; j < this._classmap.length; j++) {\n      if (i + 1 < this._points.length && j === this._points[i + 1]) {\n        i++;\n      }\n      this._classmap[j] = i;\n    }\n  }\n\n  public getCharClass(c: number): number {\n    // binary search\n    let a = 0;\n    let b = this._points.length;\n    while (b - a > 1) {\n      const d = (a + b) >>> 1;\n      if (this._points[d] > c) {\n        b = d;\n      } else if (this._points[d] < c) {\n        a = d;\n      } else {\n        return d;\n      }\n    }\n    return a;\n  }\n\n  public step(state: number, c: number): number {\n    if (c >= this._classmap.length) {\n      return this._transitions[state * this._points.length + this.getCharClass(c)];\n    } else {\n      return this._transitions[state * this._points.length + this._classmap[c]];\n    }\n  }\n\n  public isAccept(state: number): boolean {\n    return this._accept[state];\n  }\n}\n","/**\n * Transition with dest, min and max.\n * @hidden\n */\nexport declare type Transition = [number, number, number];\n\n/**\n * @type {number}\n * @hidden\n */\nexport const MIN_CODE_POINT = 0;\n/**\n * @type {number}\n * @hidden\n */\nexport const MAX_CODE_POINT = 1114111;\n\nfunction sortByDestMinMax(a: Transition, b: Transition) {\n  if (a[0] < b[0]) {\n    return -1;\n  } else if (a[0] > b[0]) {\n    return 1;\n  }\n  if (a[1] < b[1]) {\n    return -1;\n  } else if (a[1] > b[1]) {\n    return 1;\n  }\n  if (a[2] < b[2]) {\n    return -1;\n  } else if (a[2] > b[2]) {\n    return 1;\n  }\n  return 0;\n}\n\nfunction sortByMinMaxDest(a: Transition, b: Transition) {\n  if (a[1] < b[1]) {\n    return -1;\n  } else if (a[1] > b[1]) {\n    return 1;\n  }\n  if (a[2] < b[2]) {\n    return -1;\n  } else if (a[2] > b[2]) {\n    return 1;\n  }\n  if (a[0] < b[0]) {\n    return -1;\n  } else if (a[0] > b[0]) {\n    return 1;\n  }\n  return 0;\n}\n\n/**\n * From org/apache/lucene/util/automaton/Automaton.java\n * @hidden\n */\nexport class Automaton {\n  private _stateTransitions: Transition[] = [];\n  private _accept: Set<number>;\n  private _nextState: number;\n  private _currState: number;\n  // public deterministic: boolean;\n  private _transitions: object;\n\n  constructor() {\n    this._stateTransitions = [];\n    this._accept = new Set();\n    this._nextState = 0;\n    this._currState = -1;\n    // this.deterministic = true;\n    this._transitions = {};\n  }\n\n  public isAccept(n: number): boolean {\n    return this._accept.has(n);\n  }\n\n  public createState(): number {\n    return this._nextState++;\n  }\n\n  public setAccept(state: number, accept: boolean): void {\n    if (accept) {\n      this._accept.add(state);\n    } else {\n      this._accept.delete(state);\n    }\n  }\n\n  public finishState(): void {\n    if (this._currState !== -1) {\n      this._finishCurrentState();\n      this._currState = -1;\n    }\n  }\n\n  private _finishCurrentState(): void {\n    // Sort all transitions.\n    this._stateTransitions.sort(sortByDestMinMax);\n\n    let upto = 0;\n    let p: Transition = [-1, -1, -1];\n\n    for (let i = 0, len = this._stateTransitions.length; i < len; i++) {\n      let t = this._stateTransitions[i];\n      if (p[0] === t[0]) {\n        if (t[1] <= p[2] + 1) {\n          if (t[2] > p[2]) {\n            p[2] = t[2];\n          }\n        } else {\n          if (p[0] !== -1) {\n            this._stateTransitions[upto][0] = p[0];\n            this._stateTransitions[upto][1] = p[1];\n            this._stateTransitions[upto][2] = p[2];\n            upto++;\n          }\n          p[1] = t[1];\n          p[2] = t[2];\n        }\n      } else {\n        if (p[0] !== -1) {\n          this._stateTransitions[upto][0] = p[0];\n          this._stateTransitions[upto][1] = p[1];\n          this._stateTransitions[upto][2] = p[2];\n          upto++;\n        }\n        p[0] = t[0];\n        p[1] = t[1];\n        p[2] = t[2];\n      }\n    }\n\n    if (p[0] !== -1) {\n      // Last transition\n      this._stateTransitions[upto][0] = p[0];\n      this._stateTransitions[upto][1] = p[1];\n      this._stateTransitions[upto][2] = p[2];\n      upto++;\n    }\n\n    this._transitions[this._currState] = this._stateTransitions.slice(0, upto).sort(sortByMinMaxDest);\n\n    // if (this.deterministic && upto > 1) {\n    //   let lastMax = this.stateTransitions[0][2];\n    //   for (let i = 1; i < upto; i++) {\n    //     let min = this.stateTransitions[i][1];\n    //     if (min <= lastMax) {\n    //       this.deterministic = false;\n    //       break;\n    //     }\n    //     lastMax = this.stateTransitions[i][2];\n    //   }\n    // }\n\n    this._stateTransitions = [];\n  }\n\n  public getStartPoints(): number[] {\n    const pointset = new Set();\n    pointset.add(MIN_CODE_POINT);\n\n    const states = Object.keys(this._transitions);\n    for (let i = 0; i < states.length; i++) {\n      let trans = this._transitions[states[i]];\n      for (let j = 0; j < trans.length; j++) {\n        let tran = trans[j];\n        pointset.add(tran[1]);\n        if (tran[2] < MAX_CODE_POINT) {\n          pointset.add(tran[2] + 1);\n        }\n      }\n    }\n    return Array.from(pointset).sort((a, b) => a - b);\n  }\n\n  public step(state: number, label: number): number {\n    let trans = this._transitions[state];\n    if (trans) {\n      for (let i = 0; i < trans.length; i++) {\n        let tran = trans[i];\n        if (tran[1] <= label && label <= tran[2]) {\n          return tran[0];\n        }\n      }\n    }\n    return -1;\n  }\n\n  public getNumStates(): number {\n    return this._nextState;\n  }\n\n  public addTransition(source: number, dest: number, min: number, max: number): void {\n    if (this._currState !== source) {\n      if (this._currState !== -1) {\n        this._finishCurrentState();\n      }\n      this._currState = source;\n    }\n    this._stateTransitions.push([dest, min, max]);\n  }\n}\n","/**\n * Class supports 64Bit integer operations.\n * A cut-down version of dcodeIO/long.js.\n * @hidden\n */\nexport class Long {\n  private _low: number;\n  private _high: number;\n\n  constructor(low: number = 0, high: number = 0) {\n    this._low = low;\n    this._high = high;\n  }\n\n  /**\n   * Returns this long with bits arithmetically shifted to the right by the given amount.\n   * @param {number} numBits - number of bits\n   * @returns {Long} the long\n   */\n  public shiftRight(numBits: number): Long {\n    if ((numBits &= 63) === 0)\n      return this;\n    else if (numBits < 32)\n      return new Long((this._low >>> numBits) | (this._high << (32 - numBits)), this._high >> numBits);\n    else\n      return new Long((this._high >> (numBits - 32)), this._high >= 0 ? 0 : -1);\n  }\n\n  /**\n   * Returns this long with bits arithmetically shifted to the left by the given amount.\n   * @param {number} numBits - number of bits\n   * @returns {Long} the long\n   */\n  public shiftLeft(numBits: number): Long {\n    if ((numBits &= 63) === 0)\n      return this;\n    else if (numBits < 32)\n      return new Long(this._low << numBits, (this._high << numBits) | (this._low >>> (32 - numBits)));\n    else\n      return new Long(0, this._low << (numBits - 32));\n  }\n\n  /**\n   * Returns the bitwise AND of this Long and the specified.\n   * @param {Long} other - the other Long\n   * @returns {Long} the long\n   */\n  public and(other: Long): Long {\n    return new Long(this._low & other._low, this._high & other._high);\n  }\n\n  /**\n   * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n   * @returns {number}\n   */\n  public toInt(): number {\n    return this._low;\n  }\n}\n","import { Long } from \"./long\";\n\nconst MASKS = [new Long(0x1), new Long(0x3), new Long(0x7), new Long(0xf),\n  new Long(0x1f), new Long(0x3f), new Long(0x7f), new Long(0xff),\n  new Long(0x1ff), new Long(0x3ff), new Long(0x7ff), new Long(0xfff),\n  new Long(0x1fff), new Long(0x3fff), new Long(0x7fff), new Long(0xffff),\n  new Long(0xf, 0x1fff), new Long(0xf, 0x3fff), new Long(0xf, 0x7fff), new Long(0xf, 0xffff),\n  new Long(0xff, 0x1fff), new Long(0xff, 0x3fff), new Long(0xff, 0x7fff), new Long(0xff, 0xffff),\n  new Long(0xfff, 0x1fff), new Long(0xfff, 0x3fff), new Long(0xfff, 0x7fff), new Long(0xfff, 0xffff),\n  new Long(0xffff, 0x1fff), new Long(0xffff, 0x3fff), new Long(0xffff, 0x7fff), new Long(0xffff, 0xffff),\n  new Long(0xfffff, 0x1fff), new Long(0xfffff, 0x3fff), new Long(0xfffff, 0x7fff), new Long(0xfffff, 0xffff),\n  new Long(0xffffff, 0x1fff), new Long(0xffffff, 0x3fff), new Long(0xffffff, 0x7fff), new Long(0xffffff, 0xffff),\n  new Long(0xfffffff, 0x1fff), new Long(0xfffffff, 0x3fff), new Long(0xfffffff, 0x7fff), new Long(0xfffffff, 0xffff),\n  new Long(0xffffffff, 0x1fff), new Long(0xffffffff, 0x3fff), new Long(0xffffffff, 0x7fff), new Long(0xffffffff, 0xffff),\n  new Long(0xfffffffff, 0x1fff), new Long(0xfffffffff, 0x3fff), new Long(0xfffffffff, 0x7fff), new Long(0xfffffffff, 0xffff),\n  new Long(0xffffffffff, 0x1fff), new Long(0xffffffffff, 0x3fff), new Long(0xffffffffff, 0x7fff), new Long(0xffffffffff, 0xffff),\n  new Long(0xfffffffffff, 0x1fff), new Long(0xfffffffffff, 0x3fff), new Long(0xfffffffffff, 0x7fff), new Long(0xfffffffffff, 0xffff),\n  new Long(0xffffffffffff, 0x1fff), new Long(0xffffffffffff, 0x3fff), new Long(0xffffffffffff, 0x7fff)];\n\n/**\n * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription\n * @hidden\n */\nexport class ParametricDescription {\n  protected _w: number;\n  private _n: number;\n  private _minErrors: number[];\n\n  constructor(w: number, n: number, minErrors: number[]) {\n    this._w = w;\n    this._n = n;\n    this._minErrors = minErrors;\n  }\n\n  /**\n   * Return the number of states needed to compute a Levenshtein DFA\n   */\n  public size(): number {\n    return this._minErrors.length * (this._w + 1);\n  }\n\n  /**\n   * Returns true if the <code>state</code> in any Levenshtein DFA is an accept state (final state).\n   */\n  public isAccept(absState: number): boolean {\n    // decode absState -> state, offset\n    let state = Math.floor(absState / (this._w + 1));\n    let offset = absState % (this._w + 1);\n    //assert offset >= 0;\n    return this._w - offset + this._minErrors[state] <= this._n;\n  }\n\n  /**\n   * Returns the position in the input word for a given <code>state</code>.\n   * This is the minimal boundary for the state.\n   */\n  public getPosition(absState: number): number {\n    return absState % (this._w + 1);\n  }\n\n  public static unpack(data: Long[], index: number, bitsPerValue: number): number {\n    const bitLoc = bitsPerValue * index;\n    const dataLoc = (bitLoc >> 6);\n    const bitStart = (bitLoc & 63);\n\n    if (bitStart + bitsPerValue <= 64) {\n      // not split\n      return data[dataLoc].shiftRight(bitStart).and(MASKS[bitsPerValue - 1]).toInt();\n    } else {\n      // split\n      const part = 64 - bitStart;\n      return (data[dataLoc].shiftRight(bitStart).and(MASKS[part - 1])).toInt()\n        + (data[1 + dataLoc].and(MASKS[bitsPerValue - part - 1]).shiftLeft(part)).toInt();\n    }\n  }\n}\n","import { Long } from \"./long\";\nimport { ParametricDescription } from \"./parametric_description\";\n\n// 1 vectors; 2 states per vector; array length = 2\nconst toStates0 = [new Long(0x2)];\nconst offsetIncrs0 = [new Long(0x0)];\n\n// 2 vectors; 3 states per vector; array length = 6\nconst toStates1 = [new Long(0xa43)];\n\nconst offsetIncrs1 = [new Long(0x38)];\n\n// 4 vectors; 6 states per vector; array length = 24\nconst toStates2 = [new Long(0x82140003, 0x34534914), new Long(0x6d)];\nconst offsetIncrs2 = [new Long(0x55a20000, 0x5555)];\n\n// 8 vectors; 6 states per vector; array length = 48\nconst toStates3 = [new Long(0x900C0003, 0x21520854), new Long(0x4534916d, 0x5b4d19a2), new Long(0xda34)];\nconst offsetIncrs3 = [new Long(0x20fc0000, 0x5555ae0a), new Long(0x55555555)];\n\n// state map\n//   0 -> [(0, 0)]\n//   1 -> [(0, 1)]\n//   2 -> [(0, 1), (1, 1)]\n//   3 -> [(0, 1), (2, 1)]\n//   4 -> [t(0, 1), (0, 1), (1, 1), (2, 1)]\n//   5 -> [(0, 1), (1, 1), (2, 1)]\n\n/**\n * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java\n * @hidden\n */\nexport class Lev1TParametricDescription extends ParametricDescription {\n  constructor(w: number) {\n    super(w, 1, [0, 1, 0, -1, -1, -1]);\n  }\n\n  public transition(absState: number, position: number, vector: number): number {\n    // null absState should never be passed in\n    //assert absState != -1;\n\n    // decode absState -> state, offset\n    let state = Math.floor(absState / (this._w + 1));\n    let offset = absState % (this._w + 1);\n    //assert offset >= 0;\n\n    if (position === this._w) {\n      if (state < 2) {\n        const loc = vector * 2 + state;\n        offset += ParametricDescription.unpack(offsetIncrs0, loc, 1);\n        state = ParametricDescription.unpack(toStates0, loc, 2) - 1;\n      }\n    } else if (position === this._w - 1) {\n      if (state < 3) {\n        const loc = vector * 3 + state;\n        offset += ParametricDescription.unpack(offsetIncrs1, loc, 1);\n        state = ParametricDescription.unpack(toStates1, loc, 2) - 1;\n      }\n    } else if (position === this._w - 2) {\n      if (state < 6) {\n        const loc = vector * 6 + state;\n        offset += ParametricDescription.unpack(offsetIncrs2, loc, 2);\n        state = ParametricDescription.unpack(toStates2, loc, 3) - 1;\n      }\n    } else {\n      if (state < 6) {\n        const loc = vector * 6 + state;\n        offset += ParametricDescription.unpack(offsetIncrs3, loc, 2);\n        state = ParametricDescription.unpack(toStates3, loc, 3) - 1;\n      }\n    }\n\n    if (state === -1) {\n      // null state\n      return -1;\n    } else {\n      // translate back to abs\n      return state * (this._w + 1) + offset;\n    }\n  }\n}\n","import { Long } from \"./long\";\nimport { ParametricDescription } from \"./parametric_description\";\n\n// 1 vectors; 3 states per vector; array length = 3\nconst toStates0 = /*2 bits per value */ [\n  new Long(0x23)\n];\nconst offsetIncrs0 = /*1 bits per value */ [\n  new Long(0x0)\n];\n\n// 2 vectors; 5 states per vector; array length = 10\nconst toStates1 = /*3 bits per value */ [\n  new Long(0x13688b44)\n];\nconst offsetIncrs1 = /*1 bits per value */ [\n  new Long(0x3e0)\n];\n\n// 4 vectors; 13 states per vector; array length = 52\nconst toStates2 = /*4 bits per value */ [\n  new Long(0x5200b504, 0x60dbb0b0), new Long(0x27062227, 0x52332176), new Long(0x14323235, 0x23555432), new Long(0x4354)\n];\nconst offsetIncrs2 = /*2 bits per value */ [\n  new Long(0x00002000, 0x555080a8), new Long(0x55555555, 0x55)\n];\n\n// 8 vectors; 28 states per vector; array length = 224\nconst toStates3 = /*5 bits per value */ [\n  new Long(0x40059404, 0xe701c029), new Long(0x00a50000, 0xa0101620), new Long(0xa1416288, 0xb02c8c40), new Long(0x310858c0, 0xa821032),\n  new Long(0x0d28b201, 0x31442398), new Long(0x847788e0, 0x5281e528), new Long(0x08c2280e, 0xa23980d3), new Long(0xa962278c, 0x1e3294b1),\n  new Long(0x2288e528, 0x8c41309e), new Long(0x021aca21, 0x11444409), new Long(0x86b1086b, 0x11a46248), new Long(0x1d6240c4, 0x2a625894),\n  new Long(0x489074ad, 0x5024a50b), new Long(0x520c411a, 0x14821aca), new Long(0x0b594a44, 0x5888b589), new Long(0xc411a465, 0x941d6520),\n  new Long(0xad6a62d4, 0x8b589075), new Long(0x1a5055a4)\n];\nconst offsetIncrs3 = /*2 bits per value */ [\n  new Long(0x00002000, 0x30c302), new Long(0xc3fc333c, 0x2a0030f3), new Long(0x8282a820, 0x233a0032), new Long(0x32b283a8, 0x55555555),\n  new Long(0x55555555, 0x55555555), new Long(0x55555555, 0x55555555), new Long(0x55555555, 0x55555555)\n];\n\n// 16 vectors; 45 states per vector; array length = 720\nconst toStates4 = /*6 bits per value */ [\n  new Long(0x002c5004, 0x3801450), new Long(0x00000e38, 0xc500014b), new Long(0x51401402, 0x514), new Long(0x0),\n  new Long(0x14010000, 0x518000b), new Long(0x28e20230, 0x9f1c208), new Long(0x830a70c2, 0x219f0df0), new Long(0x08208200, 0x82000082),\n  new Long(0x60800800, 0x8050501), new Long(0x02602643, 0x30820986), new Long(0x50508064, 0x45640142), new Long(0x20000831, 0x8500514),\n  new Long(0x85002082, 0x41405820), new Long(0x0990c201, 0x45618098), new Long(0x50a01051, 0x8316d0c), new Long(0x050df0e0, 0x21451420),\n  new Long(0x14508214, 0xd142140), new Long(0x50821c60, 0x3c21c018), new Long(0xcb142087, 0x1cb1403), new Long(0x1851822c, 0x80082145),\n  new Long(0x20800020, 0x200208), new Long(0x87180345, 0xd0061820), new Long(0x24976b09, 0xcb0a81cb), new Long(0x624709d1, 0x8b1a60e),\n  new Long(0x82249089, 0x2490820), new Long(0x00d2c024, 0xc31421c6), new Long(0x15454423, 0x3c314515), new Long(0xc21cb140, 0x31853c22),\n  new Long(0x2c208214, 0x4514500b), new Long(0x508b0051, 0x8718034), new Long(0x5108f0c5, 0xb2cb4551), new Long(0x1cb0a810, 0xe824715d),\n  new Long(0x908b0e60, 0x1422cb14), new Long(0xc02cb145, 0x30812c22), new Long(0x0cb1420c, 0x84202202), new Long(0x20ce0850, 0x5c20ce08),\n  new Long(0x8b0d70c2, 0x20820820), new Long(0x14214208, 0x42085082), new Long(0x50830c20, 0x9208340), new Long(0x13653592, 0xc6134dc6),\n  new Long(0x6dc4db4d, 0xd309341c), new Long(0x54d34d34, 0x6424d908), new Long(0x030814c2, 0x92072c22), new Long(0x24a30930, 0x4220724b),\n  new Long(0x25c920e2, 0x2470d720), new Long(0x975c9082, 0x92c92d70), new Long(0x04924e08, 0xcb0880c2), new Long(0xc24c2481, 0x45739728),\n  new Long(0xda6174da, 0xc6da4db5), new Long(0x5d30971d, 0x4b5d35d7), new Long(0x93825ce2, 0x1030815c), new Long(0x020cb145, 0x51442051),\n  new Long(0x2c220e2c, 0xc538210e), new Long(0x52cb0d70, 0x8514214), new Long(0x85145142, 0x204b0850), new Long(0x4051440c, 0x92156083),\n  new Long(0xa60e6595, 0x4d660e4d), new Long(0x1c6dc658, 0x94d914e4), new Long(0x1454d365, 0x82642659), new Long(0x51030813, 0x2892072c),\n  new Long(0xcb2ca30b, 0xe2c22072), new Long(0x20538910, 0x452c70d7), new Long(0x708e3891, 0x8b2cb2d), new Long(0xc204b24e, 0x81cb1440),\n  new Long(0x28c2ca24, 0xda44e38e), new Long(0x85d660e4, 0x1dc6da65), new Long(0x8e5d914e, 0xe2cb5d33), new Long(0x38938238)\n];\nconst offsetIncrs4 = /*3 bits per value */ [\n  new Long(0x00080000, 0x30020000), new Long(0x20c060), new Long(0x04000000, 0x81490000), new Long(0x10824824, 0x40249241),\n  new Long(0x60002082, 0xdb6030c3), new Long(0x301b0d80, 0x6c36c06c), new Long(0x000db0db, 0xb01861b0), new Long(0x9188e06d, 0x1b703620),\n  new Long(0x06d86db7, 0x8009200), new Long(0x02402490, 0x4920c24), new Long(0x08249009, 0x490002), new Long(0x28124804, 0x49081281),\n  new Long(0x124a44a2, 0x34800104), new Long(0x0d24020c, 0xc3093090), new Long(0x24c24d24, 0x40009a09), new Long(0x9201061a, 0x4984a06),\n  new Long(0x71269262, 0x494d0492), new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249),\n  new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924),\n  new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492),\n  new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249),\n  new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x2492)\n];\n\n// 32 vectors; 45 states per vector; array length = 1440\nconst toStates5 = /*6 bits per value */ [\n  new Long(0x002c5004, 0x3801450), new Long(0x00000e38, 0xc500014b), new Long(0x51401402, 0x514), new Long(0x0),\n  new Long(0x14010000, 0x514000b), new Long(0x038e00e0, 0x550000), new Long(0x0600b180, 0x26451850), new Long(0x08208208, 0x82082082),\n  new Long(0x40820820, 0x2c500), new Long(0x808c0146, 0x70820a38), new Long(0x9c30827c, 0xc37c20c2), new Long(0x20800867, 0x208208),\n  new Long(0x02002080, 0xb1401020), new Long(0x00518000, 0x828e2023), new Long(0x209f1c20, 0x830a70c), new Long(0x853df0df, 0x51451450),\n  new Long(0x14508214, 0x16142142), new Long(0x30805050, 0x60260264), new Long(0x43082098, 0x25050806), new Long(0x14564014, 0x42000083),\n  new Long(0x20850051, 0x8500208), new Long(0x14140582, 0x80990c20), new Long(0x08261809, 0x82019202), new Long(0x90060941, 0x8920519),\n  new Long(0xc22cb242, 0x22492492), new Long(0x0162492c, 0x43080505), new Long(0x86026026, 0x80414515), new Long(0xc5b43142, 0x37c38020),\n  new Long(0x14508014, 0x42085085), new Long(0x50850051, 0x1414058), new Long(0x980990c2, 0x51456180), new Long(0x0c50a010, 0xe008316d),\n  new Long(0x508b21f0, 0x2c52cb2c), new Long(0xc22cb249, 0x600d2c92), new Long(0x1850821c, 0x873c21c0), new Long(0x03cb1420, 0x2c01cb14),\n  new Long(0x45185182, 0x20800821), new Long(0x08208000, 0x45002002), new Long(0x20871803, 0x8700614), new Long(0x050821cf, 0x740500f5),\n  new Long(0x18609000, 0x934d9646), new Long(0x30824d30, 0x4c24d34d), new Long(0xc600d642, 0x1860821), new Long(0x25dac274, 0xc2a072c9),\n  new Long(0x91c27472, 0x2c698398), new Long(0x89242242, 0x92420820), new Long(0x34b00900, 0x82087180), new Long(0xb09d0061, 0x1cb24976),\n  new Long(0x9d1cb0a8, 0x60e62470), new Long(0x1574ce3e, 0xd31455d7), new Long(0x25c25d74, 0x1c600d38), new Long(0x423c3142, 0x51515454),\n  new Long(0x1403c314, 0xc22c21cb), new Long(0x21431853, 0xb2c208), new Long(0x05145145, 0x34508b0), new Long(0x0c508718, 0x5515108f),\n  new Long(0xf2051454, 0x8740500), new Long(0x0618f090, 0xe2534d92), new Long(0x6592c238, 0x49382659), new Long(0x21c600d6, 0x4423c314),\n  new Long(0xcb2d1545, 0x72c2a042), new Long(0xa091c574, 0x422c3983), new Long(0x508b2c52, 0xb2c514), new Long(0x8034b08b, 0xf0c50871),\n  new Long(0x45515108, 0xa810b2cb), new Long(0x715d1cb0, 0x2260e824), new Long(0x8e2d74ce, 0xe6592c53), new Long(0x38938238, 0x420c3081),\n  new Long(0x22020cb1, 0x8508420), new Long(0xce0820ce, 0x70c25c20), new Long(0x08208b0d, 0x42082082), new Long(0x50821421, 0xc204208),\n  new Long(0x832c5083, 0x21080880), new Long(0x0838c214, 0xa5083882), new Long(0xa9c39430, 0xaaaaaaaa), new Long(0x9fa9faaa, 0x1aaa7eaa),\n  new Long(0x1420c308, 0x824820d0), new Long(0x84d94d64, 0x7184d371), new Long(0x1b7136d3, 0x34c24d07), new Long(0x1534d34d, 0x99093642),\n  new Long(0x30c20530, 0x8340508), new Long(0x53592092, 0x34dc6136), new Long(0x4db4dc61, 0xa479c6dc), new Long(0x4924924a, 0x920a9f92),\n  new Long(0x8192a82a, 0x72c22030), new Long(0x30930920, 0x724b24a), new Long(0x920e2422, 0xd72025c), new Long(0xc9082247, 0x92d70975),\n  new Long(0x24e0892c, 0x880c2049), new Long(0xc2481cb0, 0x2c928c24), new Long(0x89088749, 0x80a52488), new Long(0xaac74394, 0x6a861b2a),\n  new Long(0xab27b278, 0x81b2ca6), new Long(0x072c2203, 0xa3093092), new Long(0x6915ce5c, 0xd76985d3), new Long(0x771b6936, 0x5d74c25c),\n  new Long(0x892d74d7, 0x724e0973), new Long(0x0880c205, 0x4c2481cb), new Long(0x739728c2, 0x6174da45), new Long(0xda4db5da, 0x4aa175c6),\n  new Long(0x86486186, 0x6a869b27), new Long(0x308186ca, 0xcb14510), new Long(0x44205102, 0x220e2c51), new Long(0x38210e2c, 0xcb0d70c5),\n  new Long(0x51421452, 0x14514208), new Long(0x4b085085, 0x51440c20), new Long(0x1440832c, 0xcb145108), new Long(0x488b0888, 0x94316208),\n  new Long(0x9f7e79c3, 0xfaaa7dfa), new Long(0x7ea7df7d, 0x30819ea), new Long(0x20d01451, 0x65648558), new Long(0x93698399, 0x96135983),\n  new Long(0x39071b71, 0xd9653645), new Long(0x96451534, 0x4e09909), new Long(0x051440c2, 0x21560834), new Long(0x60e65959, 0xd660e4da),\n  new Long(0xc6dc6584, 0x9207e979), new Long(0xdf924820, 0xa82a8207), new Long(0x103081a6, 0x892072c5), new Long(0xb2ca30b2, 0x2c22072c),\n  new Long(0x0538910e, 0x52c70d72), new Long(0x08e38914, 0x8b2cb2d7), new Long(0x204b24e0, 0x1cb1440c), new Long(0x8c2ca248, 0x874b2cb2),\n  new Long(0x24488b08, 0x43948162), new Long(0x9b1f7e77, 0x9e786aa6), new Long(0xeca6a9e7, 0x51030819), new Long(0x2892072c, 0x8e38a30b),\n  new Long(0x83936913, 0x69961759), new Long(0x4538771b, 0x74ce3976), new Long(0x08e38b2d, 0xc204e24e), new Long(0x81cb1440, 0x28c2ca24),\n  new Long(0xda44e38e, 0x85d660e4), new Long(0x75c6da65, 0x698607e9), new Long(0x99e7864a, 0xa6ca6aa6)\n];\nconst offsetIncrs5 = /*3 bits per value */ [\n  new Long(0x00080000, 0x30020000), new Long(0x20c060), new Long(0x04000000, 0x1000000), new Long(0x50603018, 0xdb6db6db),\n  new Long(0x00002db6, 0xa4800002), new Long(0x41241240, 0x12492088), new Long(0x00104120, 0x40000100), new Long(0x92092052, 0x2492c420),\n  new Long(0x096592d9, 0xc30d800), new Long(0xc36036d8, 0xb01b0c06), new Long(0x6c36db0d, 0x186c0003), new Long(0xb01b6c06, 0xad860361),\n  new Long(0x5b6dd6dd, 0x360001b7), new Long(0x0db6030c, 0xc412311c), new Long(0xb6e36e06, 0xdb0d), new Long(0xdb01861b, 0x9188e06),\n  new Long(0x71b72b62, 0x6dd6db), new Long(0x00800920, 0x40240249), new Long(0x904920c2, 0x20824900), new Long(0x40049000, 0x12012480),\n  new Long(0xa4906120, 0x5524ad4a), new Long(0x02480015, 0x40924020), new Long(0x48409409, 0x92522512), new Long(0x24000820, 0x49201001),\n  new Long(0x204a04a0, 0x29128924), new Long(0x00055549, 0x900830d2), new Long(0x24c24034, 0x934930c), new Long(0x02682493, 0x4186900),\n  new Long(0x61201a48, 0x9a498612), new Long(0x355249d4, 0xc348001), new Long(0x940d2402, 0x24c40930), new Long(0x0924e24d, 0x1a40009a),\n  new Long(0x06920106, 0x6204984a), new Long(0x92712692, 0x92494d54), new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924),\n  new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492),\n  new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249),\n  new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924),\n  new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492),\n  new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249),\n  new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924),\n  new Long(0x49249249, 0x92492492), new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492),\n  new Long(0x24924924, 0x49249249), new Long(0x92492492, 0x24924924), new Long(0x49249249, 0x92492492), new Long(0x24924924)\n];\n\n// state map\n//   0 -> [(0, 0)]\n//   1 -> [(0, 2)]\n//   2 -> [(0, 1)]\n//   3 -> [(0, 1), (1, 1)]\n//   4 -> [(0, 2), (1, 2)]\n//   5 -> [t(0, 2), (0, 2), (1, 2), (2, 2)]\n//   6 -> [(0, 2), (2, 1)]\n//   7 -> [(0, 1), (2, 2)]\n//   8 -> [(0, 2), (2, 2)]\n//   9 -> [(0, 1), (1, 1), (2, 1)]\n//   10 -> [(0, 2), (1, 2), (2, 2)]\n//   11 -> [(0, 1), (2, 1)]\n//   12 -> [t(0, 1), (0, 1), (1, 1), (2, 1)]\n//   13 -> [(0, 2), (1, 2), (2, 2), (3, 2)]\n//   14 -> [t(0, 2), (0, 2), (1, 2), (2, 2), (3, 2)]\n//   15 -> [(0, 2), t(1, 2), (1, 2), (2, 2), (3, 2)]\n//   16 -> [(0, 2), (2, 1), (3, 1)]\n//   17 -> [(0, 1), t(1, 2), (2, 2), (3, 2)]\n//   18 -> [(0, 2), (3, 2)]\n//   19 -> [(0, 2), (1, 2), t(1, 2), (2, 2), (3, 2)]\n//   20 -> [t(0, 2), (0, 2), (1, 2), (3, 1)]\n//   21 -> [(0, 1), (1, 1), (3, 2)]\n//   22 -> [(0, 2), (2, 2), (3, 2)]\n//   23 -> [(0, 2), (1, 2), (3, 1)]\n//   24 -> [(0, 2), (1, 2), (3, 2)]\n//   25 -> [(0, 1), (2, 2), (3, 2)]\n//   26 -> [(0, 2), (3, 1)]\n//   27 -> [(0, 1), (3, 2)]\n//   28 -> [(0, 2), (2, 1), (4, 2)]\n//   29 -> [(0, 2), t(1, 2), (1, 2), (2, 2), (3, 2), (4, 2)]\n//   30 -> [(0, 2), (1, 2), (4, 2)]\n//   31 -> [(0, 2), (1, 2), (3, 2), (4, 2)]\n//   32 -> [(0, 2), (2, 2), (3, 2), (4, 2)]\n//   33 -> [(0, 2), (1, 2), t(2, 2), (2, 2), (3, 2), (4, 2)]\n//   34 -> [(0, 2), (1, 2), (2, 2), t(2, 2), (3, 2), (4, 2)]\n//   35 -> [(0, 2), (3, 2), (4, 2)]\n//   36 -> [(0, 2), t(2, 2), (2, 2), (3, 2), (4, 2)]\n//   37 -> [t(0, 2), (0, 2), (1, 2), (2, 2), (4, 2)]\n//   38 -> [(0, 2), (1, 2), (2, 2), (4, 2)]\n//   39 -> [t(0, 2), (0, 2), (1, 2), (2, 2), (3, 2), (4, 2)]\n//   40 -> [(0, 2), (1, 2), (2, 2), (3, 2), (4, 2)]\n//   41 -> [(0, 2), (4, 2)]\n//   42 -> [t(0, 2), (0, 2), (1, 2), (2, 2), t(2, 2), (3, 2), (4, 2)]\n//   43 -> [(0, 2), (2, 2), (4, 2)]\n//   44 -> [(0, 2), (1, 2), t(1, 2), (2, 2), (3, 2), (4, 2)]\n\n/**\n * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java\n * @hidden\n */\nexport class Lev2TParametricDescription extends ParametricDescription {\n  constructor(w: number) {\n    super(w, 2, [0, 2, 1, 0, 1, 0, -1, 0, 0, -1, 0, -1, -1, -1, -1, -1, -2, -1, -1, -1, -2, -1, -1, -2, -1, -1, -2, -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2]);\n  }\n\n  public transition(absState: number, position: number, vector: number): number {\n    // null absState should never be passed in\n    // assert absState != -1;\n\n    // decode absState -> state, offset\n    let state = Math.floor(absState / (this._w + 1));\n    let offset = absState % (this._w + 1);\n    // assert offset >= 0;\n\n    if (position === this._w) {\n      if (state < 3) {\n        const loc = vector * 3 + state;\n        offset += ParametricDescription.unpack(offsetIncrs0, loc, 1);\n        state = ParametricDescription.unpack(toStates0, loc, 2) - 1;\n      }\n    } else if (position === this._w - 1) {\n      if (state < 5) {\n        const loc = vector * 5 + state;\n        offset += ParametricDescription.unpack(offsetIncrs1, loc, 1);\n        state = ParametricDescription.unpack(toStates1, loc, 3) - 1;\n      }\n    } else if (position === this._w - 2) {\n      if (state < 13) {\n        const loc = vector * 13 + state;\n        offset += ParametricDescription.unpack(offsetIncrs2, loc, 2);\n        state = ParametricDescription.unpack(toStates2, loc, 4) - 1;\n      }\n    } else if (position === this._w - 3) {\n      if (state < 28) {\n        const loc = vector * 28 + state;\n        offset += ParametricDescription.unpack(offsetIncrs3, loc, 2);\n        state = ParametricDescription.unpack(toStates3, loc, 5) - 1;\n      }\n    } else if (position === this._w - 4) {\n      if (state < 45) {\n        const loc = vector * 45 + state;\n        offset += ParametricDescription.unpack(offsetIncrs4, loc, 3);\n        state = ParametricDescription.unpack(toStates4, loc, 6) - 1;\n      }\n    } else {\n      if (state < 45) {\n        const loc = vector * 45 + state;\n        offset += ParametricDescription.unpack(offsetIncrs5, loc, 3);\n        state = ParametricDescription.unpack(toStates5, loc, 6) - 1;\n      }\n    }\n\n    if (state === -1) {\n      // null state\n      return -1;\n    } else {\n      // translate back to abs\n      return state * (this._w + 1) + offset;\n    }\n  }\n}\n","import { Automaton, MAX_CODE_POINT } from \"./automaton\";\nimport { Lev1TParametricDescription } from \"./lev1t_parametric_description\";\nimport { Lev2TParametricDescription } from \"./lev2t_parametric_description\";\n\n/**\n * From org/apache/lucene/util/automaton/LevenshteinAutomata.java\n * @hidden\n */\nexport class LevenshteinAutomata {\n  private _word: number[];\n  private _numRanges: number;\n  private _rangeLower: number[];\n  private _rangeUpper: number[];\n  private _description: Lev1TParametricDescription;\n  private _alphabet: number[];\n  private _editDistance: number;\n\n  constructor(input: number[], editDistance: number) {\n    this._word = input;\n    this._editDistance = editDistance;\n    this._alphabet = [...new Set(this._word)].sort((a: number, b: number) => a - b);\n\n    this._numRanges = 0;\n    this._rangeLower = new Array(this._alphabet.length + 2);\n    this._rangeUpper = new Array(this._alphabet.length + 2);\n    // calculate the unicode range intervals that exclude the alphabet\n    // these are the ranges for all unicode characters not in the alphabet\n    let lower = 0;\n    for (let i = 0; i < this._alphabet.length; i++) {\n      const higher = this._alphabet[i];\n      if (higher > lower) {\n        this._rangeLower[this._numRanges] = lower;\n        this._rangeUpper[this._numRanges] = higher - 1;\n        this._numRanges++;\n      }\n      lower = higher + 1;\n    }\n    /* add the final endpoint */\n    if (lower <= MAX_CODE_POINT) {\n      this._rangeLower[this._numRanges] = lower;\n      this._rangeUpper[this._numRanges] = MAX_CODE_POINT;\n      this._numRanges++;\n    }\n\n    if (editDistance === 1) {\n      this._description = new Lev1TParametricDescription(input.length);\n    } else {\n      this._description = new Lev2TParametricDescription(input.length);\n    }\n  }\n\n  /**\n   * Transforms the NDFA to a DFA.\n   * @returns {Automaton}\n   */\n  public toAutomaton(): Automaton {\n    let automat = new Automaton();\n    const range = 2 * this._editDistance + 1;\n\n    // the number of states is based on the length of the word and the edit distance\n    const numStates = this._description.size();\n\n    // Prefix is not needed to be handled by the automaton.\n    // stateOffset = 0;\n    automat.createState();\n\n    // create all states, and mark as accept states if appropriate\n    for (let i = 1; i < numStates; i++) {\n      let state = automat.createState();\n      automat.setAccept(state, this._description.isAccept(i));\n    }\n\n    for (let k = 0; k < numStates; k++) {\n      const xpos = this._description.getPosition(k);\n\n      if (xpos < 0) {\n        continue;\n      }\n\n      const end = xpos + Math.min(this._word.length - xpos, range);\n      for (let x = 0; x < this._alphabet.length; x++) {\n        const ch = this._alphabet[x];\n        const cvec = this._getVector(ch, xpos, end);\n        const dest = this._description.transition(k, xpos, cvec);\n\n        if (dest >= 0) {\n          automat.addTransition(k, dest, ch, ch);\n        }\n      }\n\n      const dest = this._description.transition(k, xpos, 0);\n      if (dest >= 0) {\n        for (let r = 0; r < this._numRanges; r++) {\n          automat.addTransition(k, dest, this._rangeLower[r], this._rangeUpper[r]);\n        }\n      }\n    }\n\n    // assert automat.deterministic;\n    automat.finishState();\n\n    return automat;\n  }\n\n  private _getVector(x: number, pos: number, end: number): number {\n    let vector = 0;\n    for (let i = pos; i < end; i++) {\n      vector <<= 1;\n      if (this._word[i] === x) {\n        vector |= 1;\n      }\n    }\n    return vector;\n  }\n}\n","import { Scorer } from \"./scorer\";\nimport { InvertedIndex, toCodePoints } from \"./inverted_index\";\nimport { BoolQuery, FuzzyQuery, Query, QueryTypes, TermQuery, WildcardQuery } from \"./query_types\";\nimport { Dict } from \"../../common/types\";\nimport { RunAutomaton } from \"./fuzzy/run_automaton\";\nimport { LevenshteinAutomata } from \"./fuzzy/levenshtein_automata\";\nimport QueryResults = Scorer.QueryResults;\nimport Index = InvertedIndex.Index;\nimport { analyze, Analyzer } from \"./analyzer/analyzer\";\n\nfunction calculateMinShouldMatch(optionalClauseCount: number, spec: undefined | number | string): number {\n  if (spec === undefined) {\n    return 1;\n  }\n  if (typeof spec === \"number\") {\n    return (spec < 0) ? optionalClauseCount + spec : spec;\n  }\n\n  let result = optionalClauseCount;\n  if (spec.includes(\"<\")) {\n    // Parse conditional minimumShouldMatch.;\n    for (const s of spec.split(\" \")) {\n      const parts = s.split(\"<\");\n      const upperBound = parseInt(parts[0]);\n      if (optionalClauseCount <= upperBound) {\n        return result;\n      } else {\n        result = calculateMinShouldMatch(optionalClauseCount, parts[1]);\n      }\n    }\n    return result;\n  }\n\n  if (spec.includes(\"%\")) {\n    // Parse percentage.\n    const percent = parseInt(spec.slice(0, -1));\n    const calc = (result * percent) * (1 / 100);\n    result = (calc < 0) ? result + Math.ceil(calc) : Math.floor(calc);\n  } else {\n    const calc = parseInt(spec);\n    result = (calc < 0) ? result + calc : calc;\n  }\n\n  return (result < 1) ? 1 : result;\n}\n\n/**\n * @hidden\n */\nexport class IndexSearcher {\n  private _invIdxs: Dict<InvertedIndex>;\n  private _docs: Set<InvertedIndex.DocumentIndex>;\n  private _scorer: Scorer;\n\n  /**\n   * Constructs an index searcher.\n   * @param {Dict<InvertedIndex>} invIdxs - the inverted indexes\n   * @param {Set<number>} docs - the ids of the documents\n   */\n  constructor(invIdxs: Dict<InvertedIndex>, docs: Set<InvertedIndex.DocumentIndex>) {\n    this._invIdxs = invIdxs;\n    this._docs = docs;\n    this._scorer = new Scorer(this._invIdxs);\n  }\n\n  public search(query: Query): Scorer.ScoreResults {\n    let queryResults = this._recursive(query.query, true);\n\n    // Do final scoring.\n    if (query.calculate_scoring !== undefined ? query.calculate_scoring : true) {\n      return this._scorer.finalScore(query, queryResults);\n    }\n\n    const result: Scorer.ScoreResults = {};\n    for (const key of queryResults.keys()) {\n      result[key] = {score: 1};\n    }\n    return result;\n  }\n\n  public setDirty() {\n    this._scorer.setDirty();\n  }\n\n  private _recursive(query: any, doScoring: boolean | null) {\n    let queryResults: QueryResults = new Map();\n    const boost = query.boost !== undefined ? query.boost : 1;\n    const fieldName = query.field !== undefined ? query.field : null;\n\n    let root = null;\n    let analyzer: Analyzer = null;\n    if (this._invIdxs[fieldName] !== undefined) {\n      root = this._invIdxs[fieldName].root;\n      analyzer = this._invIdxs[fieldName].analyzer;\n    }\n\n    switch (query.type) {\n      case \"bool\": {\n        queryResults = null;\n        if (query.must !== undefined) {\n          queryResults = this._getUnique(query.must, doScoring, queryResults);\n        }\n        if (query.filter !== undefined) {\n          queryResults = this._getUnique(query.filter, null, queryResults);\n        }\n        if (query.should !== undefined) {\n          const shouldDocs = this._getAll(query.should, doScoring);\n\n          let empty = false;\n          if (queryResults === null) {\n            empty = true;\n            queryResults = new Map();\n          }\n\n          const msm = Math.max(1, calculateMinShouldMatch(query.should.length, query.minimum_should_match));\n          if (empty && msm === 1) {\n            // Take all documents.\n            queryResults = shouldDocs;\n          } else {\n            // Remove documents with fewer matches.\n            for (const [docId, res] of shouldDocs) {\n              if (res.length >= msm) {\n                if (queryResults.has(docId)) {\n                  queryResults.get(docId).push(...res);\n                } else if (empty) {\n                  queryResults.set(docId, res);\n                } else {\n                  queryResults.delete(docId);\n                }\n              }\n            }\n          }\n        }\n        // Match all documents if must/filter/should is not defined.\n        if (queryResults === null) {\n          queryResults = this._recursive({type: \"match_all\"}, false);\n        }\n        if (query.not !== undefined) {\n          let notDocs = this._getAll(query.not, null);\n          // Remove all matching documents.\n          for (const docId of notDocs.keys()) {\n            if (queryResults.has(docId)) {\n              queryResults.delete(docId);\n            }\n          }\n        }\n        // Boost query results afterwards.\n        if (boost !== 1) {\n          for (const [_, result] of queryResults) {\n            for (let i = 0; i < result.length; i++) {\n              result[i].boost *= boost;\n            }\n          }\n        }\n        break;\n      }\n      case \"term\": {\n        const cps = toCodePoints(query.value);\n        let termIdx = InvertedIndex.getTermIndex(cps, root);\n        this._scorer.score(fieldName, boost, termIdx, doScoring, queryResults, cps);\n        break;\n      }\n      case \"terms\": {\n        for (let i = 0; i < query.value.length; i++) {\n          const cps = toCodePoints(query.value[i]);\n          let termIdx = InvertedIndex.getTermIndex(cps, root);\n          this._scorer.score(fieldName, boost, termIdx, doScoring, queryResults, cps);\n        }\n        break;\n      }\n      case \"fuzzy\": {\n        const [f, idf] = fuzzySearch(query, root);\n        for (let i = 0; i < f.length; i++) {\n          this._scorer.score(fieldName, boost * f[i].boost, f[i].index, doScoring, queryResults, f[i].term, idf);\n        }\n        break;\n      }\n      case \"wildcard\": {\n        const enableScoring = query.enable_scoring !== undefined ? query.enable_scoring : false;\n        const w = wildcardSearch(query, root);\n        for (let i = 0; i < w.length; i++) {\n          this._scorer.score(fieldName, boost, w[i].index, doScoring && enableScoring, queryResults,\n            w[i].term);\n        }\n        break;\n      }\n      case \"match_all\": {\n        for (let docId of this._docs) {\n          this._scorer.scoreConstant(boost, docId, queryResults);\n        }\n        break;\n      }\n      case \"constant_score\": {\n        let tmpQueryResults = this._getAll(query.filter, false);\n        // Add to each document a constant score.\n        for (const docId of tmpQueryResults.keys()) {\n          this._scorer.scoreConstant(boost, docId, queryResults);\n        }\n        break;\n      }\n      case \"prefix\": {\n        const enableScoring = query.enable_scoring !== undefined ? query.enable_scoring : false;\n        const cps = toCodePoints(query.value);\n        const termIdx = InvertedIndex.getTermIndex(cps, root);\n        if (termIdx !== null) {\n          const termIdxs = InvertedIndex.extendTermIndex(termIdx);\n          for (let i = 0; i < termIdxs.length; i++) {\n            this._scorer.score(fieldName, boost, termIdxs[i].index, doScoring && enableScoring, queryResults,\n              [...cps, ...termIdxs[i].term]);\n          }\n        }\n        break;\n      }\n      case \"exists\": {\n        if (root !== null) {\n          for (const docId of this._invIdxs[fieldName].docStore.keys()) {\n            this._scorer.scoreConstant(boost, docId, queryResults);\n          }\n        }\n        break;\n      }\n      case \"match\": {\n        const terms = analyze(analyzer, query.value);\n        const operator = query.operator !== undefined ? query.operator : \"or\";\n\n        const boolQuery: BoolQuery = {type: \"bool\"};\n        const subQueries: QueryTypes[] = [];\n        if (operator === \"or\") {\n          if (query.minimum_should_match !== undefined) {\n            boolQuery.minimum_should_match = query.minimum_should_match;\n          }\n          // Create a should query.\n          boolQuery.should = subQueries;\n        } else {\n          // Create a must query.\n          boolQuery.must = subQueries;\n        }\n        boolQuery.boost = boost;\n\n        if (query.fuzziness !== undefined) {\n          let prefixLength = query.prefix_length !== undefined ? query.prefix_length : 2;\n          let extended = query.extended !== undefined ? query.extended : false;\n          // Add each fuzzy.\n          for (let i = 0; i < terms.length; i++) {\n            subQueries.push({\n              type: \"fuzzy\", field: fieldName, value: terms[i], fuzziness: query.fuzziness,\n              prefix_length: prefixLength, extended: extended\n            } as FuzzyQuery);\n          }\n        } else {\n          // Add each term.\n          for (let i = 0; i < terms.length; i++) {\n            subQueries.push({type: \"term\", field: fieldName, value: terms[i]} as TermQuery);\n          }\n        }\n        queryResults = this._recursive(boolQuery, doScoring);\n\n        break;\n      }\n      default:\n        break;\n    }\n    return queryResults;\n  }\n\n  private _getUnique(queries: any[], doScoring: boolean | null, queryResults: QueryResults): QueryResults {\n    if (queries.length === 0) {\n      return queryResults;\n    }\n\n    for (let i = 0; i < queries.length; i++) {\n      let currDocs = this._recursive(queries[i], doScoring);\n      if (queryResults === null) {\n        queryResults = this._recursive(queries[0], doScoring);\n        continue;\n      }\n\n      for (const docId of queryResults.keys()) {\n        if (!currDocs.has(docId)) {\n          queryResults.delete(docId);\n        } else {\n          queryResults.get(docId).push(...currDocs.get(docId));\n        }\n      }\n    }\n    return queryResults;\n  }\n\n  private _getAll(queries: any[], doScoring: boolean | null, queryResults: QueryResults = new Map()): QueryResults {\n    for (let i = 0; i < queries.length; i++) {\n      let currDocs = this._recursive(queries[i], doScoring);\n      for (const docId of currDocs.keys()) {\n        if (!queryResults.has(docId)) {\n          queryResults.set(docId, currDocs.get(docId));\n        } else {\n          queryResults.get(docId).push(...currDocs.get(docId));\n        }\n      }\n    }\n    return queryResults;\n  }\n}\n\ntype FuzzyResult = { index: Index, term: number[], boost: number };\n\n/**\n * Calculates the levenshtein distance. Specialized version.\n * Copyright Kigiri: https://github.com/kigiri\n *           Milot Mirdita: https://github.com/milot-mirdita\n *           Toni Neubert:  https://github.com/Viatorus/\n * @param {string} a - a string\n * @param {string} b - a string\n */\nfunction calculateLevenshteinDistance(a: number[], b: number[]): number {\n  let i;\n  let j;\n  let prev;\n  let val;\n\n  const row = Array(a.length + 1);\n  // init the row\n  for (i = 0; i <= a.length; i++) {\n    row[i] = i;\n  }\n\n  // fill in the rest\n  for (i = 1; i <= b.length; i++) {\n    prev = i;\n    for (j = 1; j <= a.length; j++) {\n      if (b[i - 1] === a[j - 1]) {\t// match\n        val = row[j - 1];\n      } else {\n        val = Math.min(row[j - 1] + 1, // substitution\n          Math.min(prev + 1,         // insertion\n            row[j] + 1));          // deletion\n\n        // transposition\n        if (i > 1 && j > 1 && b[i - 2] === a[j - 1] && a[j - 2] === b[i - 1]) {\n          val = Math.min(val, row[j - 1] - (a[j - 1] === b[i - 1] ? 1 : 0));\n        }\n      }\n      row[j - 1] = prev;\n      prev = val;\n    }\n    row[a.length] = prev;\n  }\n  return row[a.length];\n}\n\n/**\n * Performs a fuzzy search.\n * @param {FuzzyQuery} query - the fuzzy query\n * @param {Index} root - the root index\n * @returns {[FuzzyResult, number]} - the fuzzy results and the maximum df\n */\nfunction fuzzySearch(query: FuzzyQuery, root: Index): [FuzzyResult[], number] {\n  let value = toCodePoints(query.value);\n  let fuzziness = query.fuzziness !== undefined ? query.fuzziness : \"AUTO\";\n  if (fuzziness === \"AUTO\") {\n    if (value.length <= 2) {\n      fuzziness = 0;\n    } else if (value.length <= 5) {\n      fuzziness = 1;\n    } else {\n      fuzziness = 2;\n    }\n  }\n  let prefixLength = query.prefix_length !== undefined ? query.prefix_length : 0;\n  let extended = query.extended !== undefined ? query.extended : false;\n\n  // Do just a prefix search if zero fuzziness.\n  if (fuzziness === 0) {\n    prefixLength = value.length;\n  }\n\n  let result: FuzzyResult[] = [];\n  let startIdx = root;\n  let prefix = value.slice(0, prefixLength);\n  let fuzzy = value;\n  let df = 0;\n\n  // Perform a prefix search.\n  if (prefixLength !== 0) {\n    startIdx = InvertedIndex.getTermIndex(prefix, startIdx);\n    fuzzy = fuzzy.slice(prefixLength);\n  }\n\n  // No startIdx found.\n  if (startIdx === null) {\n    return [result, df];\n  }\n\n  // Fuzzy is not necessary anymore, because prefix search includes the whole query value.\n  if (fuzzy.length === 0) {\n    if (extended) {\n      // Add all terms down the index.\n      const all = InvertedIndex.extendTermIndex(startIdx);\n      for (let i = 0; i < all.length; i++) {\n        result.push({index: all[i].index, term: all[i].term, boost: 1});\n        df = Math.max(df, all[i].index.df);\n      }\n    } else if (startIdx.dc !== undefined) {\n      // Add prefix search result.\n      result.push({index: startIdx, term: value, boost: 1});\n      df = startIdx.df;\n    }\n    return [result, df];\n  }\n\n  // The matching term.\n  const term = [0];\n  // Create an automaton from the fuzzy.\n  const automaton = new RunAutomaton(new LevenshteinAutomata(fuzzy, fuzziness).toAutomaton());\n\n  function determineEditDistance(state: number, term: number[], fuzzy: number[]): number {\n    // Check how many edits this fuzzy can still do.\n    let ed = 0;\n    state = automaton.step(state, 0);\n    if (state !== -1 && automaton.isAccept(state)) {\n      ed++;\n      state = automaton.step(state, 0);\n      if (state !== -1 && automaton.isAccept(state)) {\n        ed++;\n      }\n      // Special handling for smaller terms.\n      if (term.length < fuzzy.length) {\n        if (ed !== fuzziness) {\n          return calculateLevenshteinDistance(term, fuzzy);\n        }\n        // Include the term and fuzzy length.\n        ed -= fuzzy.length - term.length;\n      }\n    }\n    return fuzziness as number - ed;\n  }\n\n  function recursive(state: number, key: number, idx: Index) {\n    term[term.length - 1] = key;\n\n    // Check the current key of term with the automaton.\n    state = automaton.step(state, key);\n    if (state === -1) {\n      return;\n    }\n\n    if (automaton.isAccept(state)) {\n      if (extended) {\n        // Add all terms down the index.\n        const all = InvertedIndex.extendTermIndex(idx);\n        for (let i = 0; i < all.length; i++) {\n          result.push({index: all[i].index, term: all[i].term, boost: 1});\n          df = Math.max(df, all[i].index.df);\n        }\n        return;\n      } else if (idx.df !== undefined) {\n        // Calculate boost.\n        const distance = determineEditDistance(state, term, fuzzy);\n        const boost = Math.max(0, 1 - distance / Math.min(prefix.length + term.length, value.length));\n        result.push({index: idx, term: [...prefix, ...term], boost});\n        df = Math.max(df, idx.df);\n      }\n    }\n\n    term.push(0);\n    for (const child of idx) {\n      recursive(state, child[0], child[1]);\n    }\n    term.pop();\n  }\n\n  for (const child of startIdx) {\n    recursive(0, child[0], child[1]);\n  }\n\n  return [result, df];\n}\n\ntype WildcardResult = { index: Index, term: number[] };\n\n/**\n * Performs a wildcard search.\n * @param {WildcardQuery} query - the wildcard query\n * @param {Index} root - the root index\n * @returns {Array} - the results\n */\nfunction wildcardSearch(query: WildcardQuery, root: Index): WildcardResult[] {\n  let wildcard = toCodePoints(query.value);\n  let result: WildcardResult[] = [];\n\n  function recursive(index: Index, idx: number = 0, term: number[] = [], escaped: boolean = false) {\n    if (index === null) {\n      return;\n    }\n\n    if (idx === wildcard.length) {\n      if (index.df !== undefined) {\n        result.push({index: index, term: term.slice()});\n      }\n      return;\n    }\n\n    // Escaped character.\n    if (!escaped && wildcard[idx] === 92 /* \\ */) {\n      recursive(index, idx + 1, term, true);\n    } else if (!escaped && wildcard[idx] === 63 /* ? */) {\n      for (const child of index) {\n        recursive(child[1], idx + 1, [...term, child[0]]);\n      }\n    } else if (!escaped && wildcard[idx] === 42 /* * */) {\n      // Check if asterisk is last wildcard character\n      if (idx + 1 === wildcard.length) {\n        const all = InvertedIndex.extendTermIndex(index);\n        for (let i = 0; i < all.length; i++) {\n          recursive(all[i].index, idx + 1, [...term, ...all[i].term]);\n        }\n      } else {\n        // Iterate over the whole tree.\n        recursive(index, idx + 1, term, false);\n        const indices: InvertedIndex.IndexTerm[] = [{index: index, term: []}];\n        do {\n          const index = indices.pop();\n          for (const child of index.index) {\n            recursive(child[1], idx + 1, [...term, ...index.term, child[0]]);\n            indices.push({index: child[1], term: [...index.term, child[0]]});\n          }\n        } while (indices.length !== 0);\n      }\n    } else {\n      recursive(InvertedIndex.getTermIndex([wildcard[idx]], index), idx + 1, [...term, wildcard[idx]]);\n    }\n  }\n\n  recursive(root);\n\n  return result;\n}\n","import { InvertedIndex } from \"./inverted_index\";\nimport { IndexSearcher } from \"./index_searcher\";\nimport { Dict } from \"../../common/types\";\nimport { PLUGINS } from \"../../common/plugin\";\nimport { Query } from \"./query_types\";\nimport { Scorer } from \"./scorer\";\nimport { Analyzer } from \"./analyzer/analyzer\";\n\nexport class FullTextSearch {\n  /// The id field of each document.\n  private _id: string;\n  /// Set of ids of all indexed documents.\n  private _docs: Set<InvertedIndex.DocumentIndex>;\n  private _idxSearcher: IndexSearcher;\n  private _invIdxs: Dict<InvertedIndex> = {};\n\n  /**\n   * Registers the full-text search as plugin.\n   */\n  public static register(): void {\n    PLUGINS[\"FullTextSearch\"] = FullTextSearch;\n  }\n\n  /**\n   * Initialize the full-text search for the given fields.\n   * @param {object[]} fieldOptions - the field options\n   * @param {string} fieldOptions.field - the name of the property field\n   * @param {boolean=true} fieldOptions.store - flag to indicate if the full-text search should be stored on serialization or\n   *  rebuild on deserialization\n   * @param {boolean=true} fieldOptions.optimizeChanges - flag to optimize updating and deleting of documents\n   *    (requires more memory but performs faster)\n   * @param {Analyzer} fieldOptions.analyzer - an analyzer for the field\n   * @param {string} [id] - the property name of the document index\n   */\n  constructor(fieldOptions: FullTextSearch.FieldOptions[] = [], id?: string) {\n    // Create an inverted index for each field.\n    for (let i = 0; i < fieldOptions.length; i++) {\n      let fieldOption = fieldOptions[i];\n      this._invIdxs[fieldOption.field] = new InvertedIndex(fieldOption);\n    }\n    this._id = id;\n    this._docs = new Set();\n    this._idxSearcher = new IndexSearcher(this._invIdxs, this._docs);\n  }\n\n  public addDocument(doc: object, id: InvertedIndex.DocumentIndex = doc[this._id]): void {\n    let fieldNames = Object.keys(this._invIdxs);\n    for (let i = 0, fieldName; i < fieldNames.length, fieldName = fieldNames[i]; i++) {\n      let field = doc[fieldName];\n      // Skip null and undefined.\n      if (field === null || field === undefined) {\n        continue;\n      }\n      if (typeof field !== \"string\") {\n        // Convert number to string.\n        if (typeof field === \"number\") {\n          field = field.toString();\n        } else {\n          throw TypeError(\"Unsupported field type for full text search.\");\n        }\n      }\n      this._invIdxs[fieldName].insert(field, id);\n    }\n    this._docs.add(id);\n    this._idxSearcher.setDirty();\n  }\n\n  public removeDocument(doc: object, id: InvertedIndex.DocumentIndex = doc[this._id]): void {\n    let fieldNames = Object.keys(this._invIdxs);\n    for (let i = 0; i < fieldNames.length; i++) {\n      this._invIdxs[fieldNames[i]].remove(id);\n    }\n    this._docs.delete(id);\n    this._idxSearcher.setDirty();\n  }\n\n  public updateDocument(doc: object, id: InvertedIndex.DocumentIndex = doc[this._id]): void {\n    this.removeDocument(doc, id);\n    this.addDocument(doc, id);\n  }\n\n  public clear(): void {\n    for (let id of this._docs) {\n      this.removeDocument(null, id);\n    }\n  }\n\n  public search(query: Query): Scorer.ScoreResults {\n    return this._idxSearcher.search(query);\n  }\n\n  public toJSON(): FullTextSearch.Serialization {\n    let serialized = {id: this._id, ii: {}};\n    let fieldNames = Object.keys(this._invIdxs);\n    for (let i = 0; i < fieldNames.length; i++) {\n      const fieldName = fieldNames[i];\n      serialized.ii[fieldName] = this._invIdxs[fieldName].toJSON();\n    }\n    return serialized;\n  }\n\n  public static fromJSONObject(serialized: FullTextSearch.Serialization, analyzers: Dict<Analyzer> = {}): FullTextSearch {\n    let fts = new FullTextSearch([], serialized.id);\n    let fieldNames = Object.keys(serialized.ii);\n    for (let i = 0; i < fieldNames.length; i++) {\n      const fieldName = fieldNames[i];\n      fts._invIdxs[fieldName] = InvertedIndex.fromJSONObject(serialized.ii[fieldName], analyzers[fieldName]);\n    }\n    return fts;\n  }\n}\n\nexport namespace FullTextSearch {\n  export interface FieldOptions extends InvertedIndex.FieldOptions {\n    field: string;\n  }\n\n  export interface Serialization {\n    id: string;\n    ii: Dict<InvertedIndex.Serialization>;\n  }\n}\n","import { FullTextSearch } from \"./full_text_search\";\nimport { analyze, StandardAnalyzer } from \"./analyzer/analyzer\";\nimport { whitespaceTokenizer } from \"./analyzer/tokenizer\";\nimport { lowercaseTokenFilter, uppercaseTokenFilter } from \"./analyzer/token_filter\";\n\nFullTextSearch[\"Analyzer\"] = {};\nFullTextSearch[\"Analyzer\"][\"analyze\"] = analyze;\nFullTextSearch[\"Analyzer\"][\"StandardAnalyzer\"] = StandardAnalyzer;\nFullTextSearch[\"Tokenizer\"] = {};\nFullTextSearch[\"Tokenizer\"][\"whitespaceTokenizer\"] = whitespaceTokenizer;\nFullTextSearch[\"TokenFilter\"] = {};\nFullTextSearch[\"TokenFilter\"][\"lowercaseTokenFilter\"] = lowercaseTokenFilter;\nFullTextSearch[\"TokenFilter\"][\"uppercaseTokenFilter\"] = uppercaseTokenFilter;\n\nexport {FullTextSearch,\n  analyze, StandardAnalyzer,\n  whitespaceTokenizer,\n  lowercaseTokenFilter, uppercaseTokenFilter\n};\nexport default FullTextSearch;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n"]}