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pB,OAAO,CACT,EAEA,EAAS,KAAO,cAChB,EAAS,QAAU,QACnB,EAAS,KAAO,CAAE,KAAM,MAGxB,IAAI,EAAgB,IAAI,EAKxB,EAAS,WAAa,WACpB,OAAO,EAAc,YACvB,EAOA,EAAS,MAAQ,SAAU,EAAU,GACnC,OAAO,EAAc,MAAM,EAAU,EACvC,EAMA,EAAS,OAAS,SAAU,EAAU,EAAM,GAC1C,OAAO,EAAc,OAAO,EAAU,EAAM,EAC9C,EAGA,EAAS,QAAU,SAAU,EAAU,EAAM,EAAU,GACrD,IAAI,EAAS,EAAS,OAAO,EAAU,EAAM,GAE7C,IAAI,EAAW,GAGb,OAAO,EAFP,EAAK,EAIT,EAIA,EAAS,OArfT,SAAoB,GAClB,OAAO,OAAO,GAAQ,QAAQ,cAAc,SAAU,GACpD,OAAO,EAAU,EACnB,GACF,EAofA,EAAS,QAAU,EACnB,EAAS,QAAU,EACnB,EAAS,OAAS,CAEpB","file":"/npm/mustache@0.8.1/mustache.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/mustache@0.8.1/mustache.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*!\n * mustache.js - Logic-less {{mustache}} templates with JavaScript\n * http://github.com/janl/mustache.js\n */\n\n/*global define: false*/\n\n(function (root, factory) {\n  if (typeof exports === \"object\" && exports) {\n    factory(exports); // CommonJS\n  } else {\n    var mustache = {};\n    factory(mustache);\n    if (typeof define === \"function\" && define.amd) {\n      define(mustache); // AMD\n    } else {\n      root.Mustache = mustache; // <script>\n    }\n  }\n}(this, function (mustache) {\n\n  var whiteRe = /\\s*/;\n  var spaceRe = /\\s+/;\n  var nonSpaceRe = /\\S/;\n  var eqRe = /\\s*=/;\n  var curlyRe = /\\s*\\}/;\n  var tagRe = /#|\\^|\\/|>|\\{|&|=|!/;\n\n  // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577\n  // See https://github.com/janl/mustache.js/issues/189\n  var RegExp_test = RegExp.prototype.test;\n  function testRegExp(re, string) {\n    return RegExp_test.call(re, string);\n  }\n\n  function isWhitespace(string) {\n    return !testRegExp(nonSpaceRe, string);\n  }\n\n  var Object_toString = Object.prototype.toString;\n  var isArray = Array.isArray || function (object) {\n    return Object_toString.call(object) === '[object Array]';\n  };\n\n  function isFunction(object) {\n    return typeof object === 'function';\n  }\n\n  function escapeRegExp(string) {\n    return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n  }\n\n  var entityMap = {\n    \"&\": \"&amp;\",\n    \"<\": \"&lt;\",\n    \">\": \"&gt;\",\n    '\"': '&quot;',\n    \"'\": '&#39;',\n    \"/\": '&#x2F;'\n  };\n\n  function escapeHtml(string) {\n    return String(string).replace(/[&<>\"'\\/]/g, function (s) {\n      return entityMap[s];\n    });\n  }\n\n  function escapeTags(tags) {\n    if (!isArray(tags) || tags.length !== 2) {\n      throw new Error('Invalid tags: ' + tags);\n    }\n\n    return [\n      new RegExp(escapeRegExp(tags[0]) + \"\\\\s*\"),\n      new RegExp(\"\\\\s*\" + escapeRegExp(tags[1]))\n    ];\n  }\n\n  /**\n   * Breaks up the given `template` string into a tree of tokens. If the `tags`\n   * argument is given here it must be an array with two string values: the\n   * opening and closing tags used in the template (e.g. [ \"<%\", \"%>\" ]). Of\n   * course, the default is to use mustaches (i.e. mustache.tags).\n   *\n   * A token is an array with at least 4 elements. The first element is the\n   * mustache symbol that was used inside the tag, e.g. \"#\" or \"&\". If the tag\n   * did not contain a symbol (i.e. {{myValue}}) this element is \"name\". For\n   * all template text that appears outside a symbol this element is \"text\".\n   *\n   * The second element of a token is its \"value\". For mustache tags this is\n   * whatever else was inside the tag besides the opening symbol. For text tokens\n   * this is the text itself.\n   *\n   * The third and fourth elements of the token are the start and end indices\n   * in the original template of the token, respectively.\n   *\n   * Tokens that are the root node of a subtree contain two more elements: an\n   * array of tokens in the subtree and the index in the original template at which\n   * the closing tag for that section begins.\n   */\n  function parseTemplate(template, tags) {\n    tags = tags || mustache.tags;\n    template = template || '';\n\n    if (typeof tags === 'string') {\n      tags = tags.split(spaceRe);\n    }\n\n    var tagRes = escapeTags(tags);\n    var scanner = new Scanner(template);\n\n    var sections = [];     // Stack to hold section tokens\n    var tokens = [];       // Buffer to hold the tokens\n    var spaces = [];       // Indices of whitespace tokens on the current line\n    var hasTag = false;    // Is there a {{tag}} on the current line?\n    var nonSpace = false;  // Is there a non-space char on the current line?\n\n    // Strips all whitespace tokens array for the current line\n    // if there was a {{#tag}} on it and otherwise only space.\n    function stripSpace() {\n      if (hasTag && !nonSpace) {\n        while (spaces.length) {\n          delete tokens[spaces.pop()];\n        }\n      } else {\n        spaces = [];\n      }\n\n      hasTag = false;\n      nonSpace = false;\n    }\n\n    var start, type, value, chr, token, openSection;\n    while (!scanner.eos()) {\n      start = scanner.pos;\n\n      // Match any text between tags.\n      value = scanner.scanUntil(tagRes[0]);\n      if (value) {\n        for (var i = 0, len = value.length; i < len; ++i) {\n          chr = value.charAt(i);\n\n          if (isWhitespace(chr)) {\n            spaces.push(tokens.length);\n          } else {\n            nonSpace = true;\n          }\n\n          tokens.push(['text', chr, start, start + 1]);\n          start += 1;\n\n          // Check for whitespace on the current line.\n          if (chr === '\\n') {\n            stripSpace();\n          }\n        }\n      }\n\n      // Match the opening tag.\n      if (!scanner.scan(tagRes[0])) break;\n      hasTag = true;\n\n      // Get the tag type.\n      type = scanner.scan(tagRe) || 'name';\n      scanner.scan(whiteRe);\n\n      // Get the tag value.\n      if (type === '=') {\n        value = scanner.scanUntil(eqRe);\n        scanner.scan(eqRe);\n        scanner.scanUntil(tagRes[1]);\n      } else if (type === '{') {\n        value = scanner.scanUntil(new RegExp('\\\\s*' + escapeRegExp('}' + tags[1])));\n        scanner.scan(curlyRe);\n        scanner.scanUntil(tagRes[1]);\n        type = '&';\n      } else {\n        value = scanner.scanUntil(tagRes[1]);\n      }\n\n      // Match the closing tag.\n      if (!scanner.scan(tagRes[1])) {\n        throw new Error('Unclosed tag at ' + scanner.pos);\n      }\n\n      token = [ type, value, start, scanner.pos ];\n      tokens.push(token);\n\n      if (type === '#' || type === '^') {\n        sections.push(token);\n      } else if (type === '/') {\n        // Check section nesting.\n        openSection = sections.pop();\n\n        if (!openSection) {\n          throw new Error('Unopened section \"' + value + '\" at ' + start);\n        }\n        if (openSection[1] !== value) {\n          throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + start);\n        }\n      } else if (type === 'name' || type === '{' || type === '&') {\n        nonSpace = true;\n      } else if (type === '=') {\n        // Set the tags for the next time around.\n        tagRes = escapeTags(tags = value.split(spaceRe));\n      }\n    }\n\n    // Make sure there are no open sections when we're done.\n    openSection = sections.pop();\n    if (openSection) {\n      throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + scanner.pos);\n    }\n\n    return nestTokens(squashTokens(tokens));\n  }\n\n  /**\n   * Combines the values of consecutive text tokens in the given `tokens` array\n   * to a single token.\n   */\n  function squashTokens(tokens) {\n    var squashedTokens = [];\n\n    var token, lastToken;\n    for (var i = 0, len = tokens.length; i < len; ++i) {\n      token = tokens[i];\n\n      if (token) {\n        if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {\n          lastToken[1] += token[1];\n          lastToken[3] = token[3];\n        } else {\n          squashedTokens.push(token);\n          lastToken = token;\n        }\n      }\n    }\n\n    return squashedTokens;\n  }\n\n  /**\n   * Forms the given array of `tokens` into a nested tree structure where\n   * tokens that represent a section have two additional items: 1) an array of\n   * all tokens that appear in that section and 2) the index in the original\n   * template that represents the end of that section.\n   */\n  function nestTokens(tokens) {\n    var nestedTokens = [];\n    var collector = nestedTokens;\n    var sections = [];\n\n    var token, section;\n    for (var i = 0, len = tokens.length; i < len; ++i) {\n      token = tokens[i];\n\n      switch (token[0]) {\n      case '#':\n      case '^':\n        collector.push(token);\n        sections.push(token);\n        collector = token[4] = [];\n        break;\n      case '/':\n        section = sections.pop();\n        section[5] = token[2];\n        collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;\n        break;\n      default:\n        collector.push(token);\n      }\n    }\n\n    return nestedTokens;\n  }\n\n  /**\n   * A simple string scanner that is used by the template parser to find\n   * tokens in template strings.\n   */\n  function Scanner(string) {\n    this.string = string;\n    this.tail = string;\n    this.pos = 0;\n  }\n\n  /**\n   * Returns `true` if the tail is empty (end of string).\n   */\n  Scanner.prototype.eos = function () {\n    return this.tail === \"\";\n  };\n\n  /**\n   * Tries to match the given regular expression at the current position.\n   * Returns the matched text if it can match, the empty string otherwise.\n   */\n  Scanner.prototype.scan = function (re) {\n    var match = this.tail.match(re);\n\n    if (match && match.index === 0) {\n      var string = match[0];\n      this.tail = this.tail.substring(string.length);\n      this.pos += string.length;\n      return string;\n    }\n\n    return \"\";\n  };\n\n  /**\n   * Skips all text until the given regular expression can be matched. Returns\n   * the skipped string, which is the entire tail if no match can be made.\n   */\n  Scanner.prototype.scanUntil = function (re) {\n    var index = this.tail.search(re), match;\n\n    switch (index) {\n    case -1:\n      match = this.tail;\n      this.tail = \"\";\n      break;\n    case 0:\n      match = \"\";\n      break;\n    default:\n      match = this.tail.substring(0, index);\n      this.tail = this.tail.substring(index);\n    }\n\n    this.pos += match.length;\n\n    return match;\n  };\n\n  /**\n   * Represents a rendering context by wrapping a view object and\n   * maintaining a reference to the parent context.\n   */\n  function Context(view, parentContext) {\n    this.view = view == null ? {} : view;\n    this.cache = { '.': this.view };\n    this.parent = parentContext;\n  }\n\n  /**\n   * Creates a new context using the given view with this context\n   * as the parent.\n   */\n  Context.prototype.push = function (view) {\n    return new Context(view, this);\n  };\n\n  /**\n   * Returns the value of the given name in this context, traversing\n   * up the context hierarchy if the value is absent in this context's view.\n   */\n  Context.prototype.lookup = function (name) {\n    var value;\n    if (name in this.cache) {\n      value = this.cache[name];\n    } else {\n      var context = this;\n\n      while (context) {\n        if (name.indexOf('.') > 0) {\n          value = context.view;\n\n          var names = name.split('.'), i = 0;\n          while (value != null && i < names.length) {\n            value = value[names[i++]];\n          }\n        } else {\n          value = context.view[name];\n        }\n\n        if (value != null) break;\n\n        context = context.parent;\n      }\n\n      this.cache[name] = value;\n    }\n\n    if (isFunction(value)) {\n      value = value.call(this.view);\n    }\n\n    return value;\n  };\n\n  /**\n   * A Writer knows how to take a stream of tokens and render them to a\n   * string, given a context. It also maintains a cache of templates to\n   * avoid the need to parse the same template twice.\n   */\n  function Writer() {\n    this.cache = {};\n  }\n\n  /**\n   * Clears all cached templates in this writer.\n   */\n  Writer.prototype.clearCache = function () {\n    this.cache = {};\n  };\n\n  /**\n   * Parses and caches the given `template` and returns the array of tokens\n   * that is generated from the parse.\n   */\n  Writer.prototype.parse = function (template, tags) {\n    var cache = this.cache;\n    var tokens = cache[template];\n\n    if (tokens == null) {\n      tokens = cache[template] = parseTemplate(template, tags);\n    }\n\n    return tokens;\n  };\n\n  /**\n   * High-level method that is used to render the given `template` with\n   * the given `view`.\n   *\n   * The optional `partials` argument may be an object that contains the\n   * names and templates of partials that are used in the template. It may\n   * also be a function that is used to load partial templates on the fly\n   * that takes a single argument: the name of the partial.\n   */\n  Writer.prototype.render = function (template, view, partials) {\n    var tokens = this.parse(template);\n    var context = (view instanceof Context) ? view : new Context(view);\n    return this.renderTokens(tokens, context, partials, template);\n  };\n\n  /**\n   * Low-level method that renders the given array of `tokens` using\n   * the given `context` and `partials`.\n   *\n   * Note: The `originalTemplate` is only ever used to extract the portion\n   * of the original template that was contained in a higher-order section.\n   * If the template doesn't use higher-order sections, this argument may\n   * be omitted.\n   */\n  Writer.prototype.renderTokens = function (tokens, context, partials, originalTemplate) {\n    var buffer = '';\n\n    // This function is used to render an arbitrary template\n    // in the current context by higher-order sections.\n    var self = this;\n    function subRender(template) {\n      return self.render(template, context, partials);\n    }\n\n    var token, value;\n    for (var i = 0, len = tokens.length; i < len; ++i) {\n      token = tokens[i];\n\n      switch (token[0]) {\n      case '#':\n        value = context.lookup(token[1]);\n        if (!value) continue;\n\n        if (isArray(value)) {\n          for (var j = 0, jlen = value.length; j < jlen; ++j) {\n            buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate);\n          }\n        } else if (typeof value === 'object' || typeof value === 'string') {\n          buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate);\n        } else if (isFunction(value)) {\n          if (typeof originalTemplate !== 'string') {\n            throw new Error('Cannot use higher-order sections without the original template');\n          }\n\n          // Extract the portion of the original template that the section contains.\n          value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);\n\n          if (value != null) buffer += value;\n        } else {\n          buffer += this.renderTokens(token[4], context, partials, originalTemplate);\n        }\n\n        break;\n      case '^':\n        value = context.lookup(token[1]);\n\n        // Use JavaScript's definition of falsy. Include empty arrays.\n        // See https://github.com/janl/mustache.js/issues/186\n        if (!value || (isArray(value) && value.length === 0)) {\n          buffer += this.renderTokens(token[4], context, partials, originalTemplate);\n        }\n\n        break;\n      case '>':\n        if (!partials) continue;\n        value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n        if (value != null) buffer += this.renderTokens(this.parse(value), context, partials, value);\n        break;\n      case '&':\n        value = context.lookup(token[1]);\n        if (value != null) buffer += value;\n        break;\n      case 'name':\n        value = context.lookup(token[1]);\n        if (value != null) buffer += mustache.escape(value);\n        break;\n      case 'text':\n        buffer += token[1];\n        break;\n      }\n    }\n\n    return buffer;\n  };\n\n  mustache.name = \"mustache.js\";\n  mustache.version = \"0.8.1\";\n  mustache.tags = [ \"{{\", \"}}\" ];\n\n  // All high-level mustache.* functions use this writer.\n  var defaultWriter = new Writer();\n\n  /**\n   * Clears all cached templates in the default writer.\n   */\n  mustache.clearCache = function () {\n    return defaultWriter.clearCache();\n  };\n\n  /**\n   * Parses and caches the given template in the default writer and returns the\n   * array of tokens it contains. Doing this ahead of time avoids the need to\n   * parse templates on the fly as they are rendered.\n   */\n  mustache.parse = function (template, tags) {\n    return defaultWriter.parse(template, tags);\n  };\n\n  /**\n   * Renders the `template` with the given `view` and `partials` using the\n   * default writer.\n   */\n  mustache.render = function (template, view, partials) {\n    return defaultWriter.render(template, view, partials);\n  };\n\n  // This is here for backwards compatibility with 0.4.x.\n  mustache.to_html = function (template, view, partials, send) {\n    var result = mustache.render(template, view, partials);\n\n    if (isFunction(send)) {\n      send(result);\n    } else {\n      return result;\n    }\n  };\n\n  // Export the escaping function so that the user may override it.\n  // See https://github.com/janl/mustache.js/issues/244\n  mustache.escape = escapeHtml;\n\n  // Export these mainly for testing, but also for advanced usage.\n  mustache.Scanner = Scanner;\n  mustache.Context = Context;\n  mustache.Writer = Writer;\n\n}));\n"]}