longdown 2023.4.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/LICENSE +10 -0
  2. package/README.md +77 -0
  3. package/bin/cli.js +3 -0
  4. package/lib/cli.js +120 -0
  5. package/lib/cljs-runtime/cljs.core.js +38285 -0
  6. package/lib/cljs-runtime/cljs.core.js.map +1 -0
  7. package/lib/cljs-runtime/cljs_env.js +1268 -0
  8. package/lib/cljs-runtime/clojure.string.js +477 -0
  9. package/lib/cljs-runtime/clojure.string.js.map +1 -0
  10. package/lib/cljs-runtime/clojure.tools.cli.js +1684 -0
  11. package/lib/cljs-runtime/clojure.tools.cli.js.map +1 -0
  12. package/lib/cljs-runtime/clojure.walk.js +131 -0
  13. package/lib/cljs-runtime/clojure.walk.js.map +1 -0
  14. package/lib/cljs-runtime/goog.array.array.js +658 -0
  15. package/lib/cljs-runtime/goog.array.array.js.map +9 -0
  16. package/lib/cljs-runtime/goog.asserts.asserts.js +131 -0
  17. package/lib/cljs-runtime/goog.asserts.asserts.js.map +9 -0
  18. package/lib/cljs-runtime/goog.asserts.dom.js +87 -0
  19. package/lib/cljs-runtime/goog.asserts.dom.js.map +9 -0
  20. package/lib/cljs-runtime/goog.base.js +1242 -0
  21. package/lib/cljs-runtime/goog.base.js.map +9 -0
  22. package/lib/cljs-runtime/goog.collections.maps.js +79 -0
  23. package/lib/cljs-runtime/goog.collections.maps.js.map +9 -0
  24. package/lib/cljs-runtime/goog.debug.error.js +29 -0
  25. package/lib/cljs-runtime/goog.debug.error.js.map +9 -0
  26. package/lib/cljs-runtime/goog.dom.asserts.js +39 -0
  27. package/lib/cljs-runtime/goog.dom.asserts.js.map +9 -0
  28. package/lib/cljs-runtime/goog.dom.element.js +67 -0
  29. package/lib/cljs-runtime/goog.dom.element.js.map +9 -0
  30. package/lib/cljs-runtime/goog.dom.htmlelement.js +6 -0
  31. package/lib/cljs-runtime/goog.dom.htmlelement.js.map +9 -0
  32. package/lib/cljs-runtime/goog.dom.nodetype.js +5 -0
  33. package/lib/cljs-runtime/goog.dom.nodetype.js.map +9 -0
  34. package/lib/cljs-runtime/goog.dom.safe.js +265 -0
  35. package/lib/cljs-runtime/goog.dom.safe.js.map +9 -0
  36. package/lib/cljs-runtime/goog.dom.tagname.js +146 -0
  37. package/lib/cljs-runtime/goog.dom.tagname.js.map +9 -0
  38. package/lib/cljs-runtime/goog.dom.tags.js +9 -0
  39. package/lib/cljs-runtime/goog.dom.tags.js.map +9 -0
  40. package/lib/cljs-runtime/goog.flags.flags.js +11 -0
  41. package/lib/cljs-runtime/goog.flags.flags.js.map +9 -0
  42. package/lib/cljs-runtime/goog.fs.blob.js +37 -0
  43. package/lib/cljs-runtime/goog.fs.blob.js.map +9 -0
  44. package/lib/cljs-runtime/goog.fs.url.js +36 -0
  45. package/lib/cljs-runtime/goog.fs.url.js.map +9 -0
  46. package/lib/cljs-runtime/goog.functions.functions.js +210 -0
  47. package/lib/cljs-runtime/goog.functions.functions.js.map +9 -0
  48. package/lib/cljs-runtime/goog.html.safehtml.js +306 -0
  49. package/lib/cljs-runtime/goog.html.safehtml.js.map +9 -0
  50. package/lib/cljs-runtime/goog.html.safescript.js +61 -0
  51. package/lib/cljs-runtime/goog.html.safescript.js.map +9 -0
  52. package/lib/cljs-runtime/goog.html.safestyle.js +170 -0
  53. package/lib/cljs-runtime/goog.html.safestyle.js.map +9 -0
  54. package/lib/cljs-runtime/goog.html.safestylesheet.js +93 -0
  55. package/lib/cljs-runtime/goog.html.safestylesheet.js.map +9 -0
  56. package/lib/cljs-runtime/goog.html.safeurl.js +225 -0
  57. package/lib/cljs-runtime/goog.html.safeurl.js.map +9 -0
  58. package/lib/cljs-runtime/goog.html.trustedresourceurl.js +113 -0
  59. package/lib/cljs-runtime/goog.html.trustedresourceurl.js.map +9 -0
  60. package/lib/cljs-runtime/goog.html.trustedtypes.js +15 -0
  61. package/lib/cljs-runtime/goog.html.trustedtypes.js.map +9 -0
  62. package/lib/cljs-runtime/goog.html.uncheckedconversions.js +43 -0
  63. package/lib/cljs-runtime/goog.html.uncheckedconversions.js.map +9 -0
  64. package/lib/cljs-runtime/goog.labs.useragent.browser.js +332 -0
  65. package/lib/cljs-runtime/goog.labs.useragent.browser.js.map +9 -0
  66. package/lib/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js +13 -0
  67. package/lib/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js.map +9 -0
  68. package/lib/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js +72 -0
  69. package/lib/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js.map +9 -0
  70. package/lib/cljs-runtime/goog.labs.useragent.useragent.js +20 -0
  71. package/lib/cljs-runtime/goog.labs.useragent.useragent.js.map +9 -0
  72. package/lib/cljs-runtime/goog.labs.useragent.util.js +77 -0
  73. package/lib/cljs-runtime/goog.labs.useragent.util.js.map +9 -0
  74. package/lib/cljs-runtime/goog.math.integer.js +425 -0
  75. package/lib/cljs-runtime/goog.math.integer.js.map +9 -0
  76. package/lib/cljs-runtime/goog.math.long.js +427 -0
  77. package/lib/cljs-runtime/goog.math.long.js.map +9 -0
  78. package/lib/cljs-runtime/goog.object.object.js +283 -0
  79. package/lib/cljs-runtime/goog.object.object.js.map +9 -0
  80. package/lib/cljs-runtime/goog.reflect.reflect.js +31 -0
  81. package/lib/cljs-runtime/goog.reflect.reflect.js.map +9 -0
  82. package/lib/cljs-runtime/goog.string.const.js +33 -0
  83. package/lib/cljs-runtime/goog.string.const.js.map +9 -0
  84. package/lib/cljs-runtime/goog.string.internal.js +118 -0
  85. package/lib/cljs-runtime/goog.string.internal.js.map +9 -0
  86. package/lib/cljs-runtime/goog.string.string.js +458 -0
  87. package/lib/cljs-runtime/goog.string.string.js.map +9 -0
  88. package/lib/cljs-runtime/goog.string.stringbuffer.js +31 -0
  89. package/lib/cljs-runtime/goog.string.stringbuffer.js.map +9 -0
  90. package/lib/cljs-runtime/goog.string.stringformat.js +74 -0
  91. package/lib/cljs-runtime/goog.string.stringformat.js.map +9 -0
  92. package/lib/cljs-runtime/goog.string.typedstring.js +8 -0
  93. package/lib/cljs-runtime/goog.string.typedstring.js.map +9 -0
  94. package/lib/cljs-runtime/goog.structs.structs.js +188 -0
  95. package/lib/cljs-runtime/goog.structs.structs.js.map +9 -0
  96. package/lib/cljs-runtime/goog.uri.uri.js +616 -0
  97. package/lib/cljs-runtime/goog.uri.uri.js.map +9 -0
  98. package/lib/cljs-runtime/goog.uri.utils.js +320 -0
  99. package/lib/cljs-runtime/goog.uri.utils.js.map +9 -0
  100. package/lib/cljs-runtime/longdown.cli.js +128 -0
  101. package/lib/cljs-runtime/longdown.cli.js.map +1 -0
  102. package/lib/cljs-runtime/longdown.lib.js +122 -0
  103. package/lib/cljs-runtime/longdown.lib.js.map +1 -0
  104. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_from_markdown.js +5 -0
  105. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_from_markdown.js.map +9 -0
  106. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_to_markdown$lib$unsafe.js +5 -0
  107. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_to_markdown$lib$unsafe.js.map +9 -0
  108. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_to_markdown.js +5 -0
  109. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_to_markdown.js.map +9 -0
  110. package/lib/cljs-runtime/shadow.esm.esm_import$node_fs.js +5 -0
  111. package/lib/cljs-runtime/shadow.esm.esm_import$node_fs.js.map +9 -0
  112. package/lib/cljs-runtime/shadow.esm.esm_import$node_path.js +5 -0
  113. package/lib/cljs-runtime/shadow.esm.esm_import$node_path.js.map +9 -0
  114. package/lib/cljs-runtime/shadow.esm.esm_import$remark_parse.js +5 -0
  115. package/lib/cljs-runtime/shadow.esm.esm_import$remark_parse.js.map +9 -0
  116. package/lib/cljs-runtime/shadow.esm.esm_import$remark_stringify.js +5 -0
  117. package/lib/cljs-runtime/shadow.esm.esm_import$remark_stringify.js.map +9 -0
  118. package/lib/cljs-runtime/shadow.esm.esm_import$unified.js +5 -0
  119. package/lib/cljs-runtime/shadow.esm.esm_import$unified.js.map +9 -0
  120. package/lib/cljs-runtime/shadow.module.cli.append.js +1 -0
  121. package/lib/cljs-runtime/shadow.module.cli.prepend.js +17 -0
  122. package/lib/cljs-runtime/shadow.module.lib.append.js +1 -0
  123. package/lib/cljs-runtime/shadow.module.lib.prepend.js +2 -0
  124. package/lib/lib.js +8 -0
  125. package/package.json +33 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "version":3,
3
+ "file":"goog.string.string.js",
4
+ "lineCount":456,
5
+ "mappings":"AAcAA,IAAKC,CAAAA,OAAL,CAAa,aAAb,CAAA;AACAD,IAAKC,CAAAA,OAAL,CAAa,qBAAb,CAAA;AAEAD,IAAKE,CAAAA,OAAL,CAAa,eAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,gCAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,mBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,sBAAb,CAAA;AAOAF,IAAKG,CAAAA,MAAOC,CAAAA,sBAAZ,GACIJ,IAAKK,CAAAA,MAAL,CAAY,oCAAZ,EAAkD,KAAlD,CADJ;AAOAL,IAAKG,CAAAA,MAAOG,CAAAA,6BAAZ,GACIN,IAAKK,CAAAA,MAAL,CAAY,2CAAZ,EAAyD,KAAzD,CADJ;AAQAL,IAAKG,CAAAA,MAAOI,CAAAA,OAAZ,GAAsB,CACpBC,KAAM,GADc,EAEpBC,iBAAkB,GAFE,CAAtB;AAYAT,IAAKG,CAAAA,MAAOO,CAAAA,UAAZ,GAAyBV,IAAKG,CAAAA,MAAOQ,CAAAA,QAASD,CAAAA,UAA9C;AASAV,IAAKG,CAAAA,MAAOS,CAAAA,QAAZ,GAAuBZ,IAAKG,CAAAA,MAAOQ,CAAAA,QAASC,CAAA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,CAAb;AAGAD,QAAA,CAAGC,CAAH,GAAO,CAAP,CAAA,GAAYtL,IAAKC,CAAAA,GAAL,CAASoL,EAAA,CAAGC,CAAH,CAAT,GAAiB,CAAjB,EAAoBF,EAAA,CAAGE,CAAH,GAAO,CAAP,CAApB,GAAgC,CAAhC,EAAmCF,EAAA,CAAGE,CAAH,CAAnC,GAA2CC,IAA3C,CAAZ;AAJiC;AAOnC,SAAK,IAAID,IAAI,CAAb,EAAgBA,CAAhB,GAAoBF,EAAG1O,CAAAA,MAAvB,EAA+B4O,CAAA,EAA/B;AACEF,QAAA,CAAGE,CAAH,CAAA,GAAQD,EAAA,CAAGC,CAAH,CAAR;AADF;AAViC;AAenC,SAAOD,EAAA,CAAGjL,CAAE1D,CAAAA,MAAL,CAAP;AAhCwC,CAA1C;;",
6
+ "sources":["goog/string/string.js"],
7
+ "sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for string manipulation.\n */\n\n\n/**\n * Namespace for string utilities\n */\ngoog.provide('goog.string');\ngoog.provide('goog.string.Unicode');\n\ngoog.require('goog.dom.safe');\ngoog.require('goog.html.uncheckedconversions');\ngoog.require('goog.string.Const');\ngoog.require('goog.string.internal');\n\n\n/**\n * @define {boolean} Enables HTML escaping of lowercase letter \"e\" which helps\n * with detection of double-escaping as this letter is frequently used.\n */\ngoog.string.DETECT_DOUBLE_ESCAPING =\n goog.define('goog.string.DETECT_DOUBLE_ESCAPING', false);\n\n\n/**\n * @define {boolean} Whether to force non-dom html unescaping.\n */\ngoog.string.FORCE_NON_DOM_HTML_UNESCAPING =\n goog.define('goog.string.FORCE_NON_DOM_HTML_UNESCAPING', false);\n\n\n/**\n * Common Unicode string characters.\n * @enum {string}\n */\ngoog.string.Unicode = {\n NBSP: '\\xa0',\n ZERO_WIDTH_SPACE: '\\u200b' // This is equivalent to <wbr>.\n};\n\n\n/**\n * Fast prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix A string to look for at the start of `str`.\n * @return {boolean} True if `str` begins with `prefix`.\n */\ngoog.string.startsWith = goog.string.internal.startsWith;\n\n\n/**\n * Fast suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix`.\n */\ngoog.string.endsWith = goog.string.internal.endsWith;\n\n\n/**\n * Case-insensitive prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix A string to look for at the end of `str`.\n * @return {boolean} True if `str` begins with `prefix` (ignoring\n * case).\n */\ngoog.string.caseInsensitiveStartsWith =\n goog.string.internal.caseInsensitiveStartsWith;\n\n\n/**\n * Case-insensitive suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix` (ignoring\n * case).\n */\ngoog.string.caseInsensitiveEndsWith =\n goog.string.internal.caseInsensitiveEndsWith;\n\n\n/**\n * Case-insensitive equality checker.\n * @param {string} str1 First string to check.\n * @param {string} str2 Second string to check.\n * @return {boolean} True if `str1` and `str2` are the same string,\n * ignoring case.\n */\ngoog.string.caseInsensitiveEquals = goog.string.internal.caseInsensitiveEquals;\n\n\n/**\n * Does simple python-style string substitution.\n * subs(\"foo%s hot%s\", \"bar\", \"dog\") becomes \"foobar hotdog\".\n * @param {string} str The string containing the pattern.\n * @param {...*} var_args The items to substitute into the pattern.\n * @return {string} A copy of `str` in which each occurrence of\n * {@code %s} has been replaced an argument from `var_args`.\n */\ngoog.string.subs = function(str, var_args) {\n 'use strict';\n const splitParts = str.split('%s');\n let returnString = '';\n\n const subsArguments = Array.prototype.slice.call(arguments, 1);\n while (subsArguments.length &&\n // Replace up to the last split part. We are inserting in the\n // positions between split parts.\n splitParts.length > 1) {\n returnString += splitParts.shift() + subsArguments.shift();\n }\n\n return returnString + splitParts.join('%s'); // Join unused '%s'\n};\n\n\n/**\n * Converts multiple whitespace chars (spaces, non-breaking-spaces, new lines\n * and tabs) to a single space, and strips leading and trailing whitespace.\n * @param {string} str Input string.\n * @return {string} A copy of `str` with collapsed whitespace.\n */\ngoog.string.collapseWhitespace = function(str) {\n 'use strict';\n // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n // include it in the regexp to enforce consistent cross-browser behavior.\n return str.replace(/[\\s\\xa0]+/g, ' ').replace(/^\\s+|\\s+$/g, '');\n};\n\n\n/**\n * Checks if a string is empty or contains only whitespaces.\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty or whitespace only.\n */\ngoog.string.isEmptyOrWhitespace = goog.string.internal.isEmptyOrWhitespace;\n\n\n/**\n * Checks if a string is empty.\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty.\n */\ngoog.string.isEmptyString = function(str) {\n 'use strict';\n return str.length == 0;\n};\n\n\n/**\n * Checks if a string is empty or contains only whitespaces.\n *\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty or whitespace only.\n * @deprecated Use goog.string.isEmptyOrWhitespace instead.\n */\ngoog.string.isEmpty = goog.string.isEmptyOrWhitespace;\n\n\n/**\n * Checks if a string is null, undefined, empty or contains only whitespaces.\n * @param {*} str The string to check.\n * @return {boolean} Whether `str` is null, undefined, empty, or\n * whitespace only.\n * @deprecated Use goog.string.isEmptyOrWhitespace(goog.string.makeSafe(str))\n * instead.\n */\ngoog.string.isEmptyOrWhitespaceSafe = function(str) {\n 'use strict';\n return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(str));\n};\n\n\n/**\n * Checks if a string is null, undefined, empty or contains only whitespaces.\n *\n * @param {*} str The string to check.\n * @return {boolean} Whether `str` is null, undefined, empty, or\n * whitespace only.\n * @deprecated Use goog.string.isEmptyOrWhitespace instead.\n */\ngoog.string.isEmptySafe = goog.string.isEmptyOrWhitespaceSafe;\n\n\n/**\n * Checks if a string is all breaking whitespace.\n * @param {string} str The string to check.\n * @return {boolean} Whether the string is all breaking whitespace.\n */\ngoog.string.isBreakingWhitespace = function(str) {\n 'use strict';\n return !/[^\\t\\n\\r ]/.test(str);\n};\n\n\n/**\n * Checks if a string contains all letters.\n * @param {string} str string to check.\n * @return {boolean} True if `str` consists entirely of letters.\n */\ngoog.string.isAlpha = function(str) {\n 'use strict';\n return !/[^a-zA-Z]/.test(str);\n};\n\n\n/**\n * Checks if a string contains only numbers.\n * @param {*} str string to check. If not a string, it will be\n * casted to one.\n * @return {boolean} True if `str` is numeric.\n */\ngoog.string.isNumeric = function(str) {\n 'use strict';\n return !/[^0-9]/.test(str);\n};\n\n\n/**\n * Checks if a string contains only numbers or letters.\n * @param {string} str string to check.\n * @return {boolean} True if `str` is alphanumeric.\n */\ngoog.string.isAlphaNumeric = function(str) {\n 'use strict';\n return !/[^a-zA-Z0-9]/.test(str);\n};\n\n\n/**\n * Checks if a character is a space character.\n * @param {string} ch Character to check.\n * @return {boolean} True if `ch` is a space.\n */\ngoog.string.isSpace = function(ch) {\n 'use strict';\n return ch == ' ';\n};\n\n\n/**\n * Checks if a character is a valid unicode character.\n * @param {string} ch Character to check.\n * @return {boolean} True if `ch` is a valid unicode character.\n */\ngoog.string.isUnicodeChar = function(ch) {\n 'use strict';\n return ch.length == 1 && ch >= ' ' && ch <= '~' ||\n ch >= '\\u0080' && ch <= '\\uFFFD';\n};\n\n\n/**\n * Takes a string and replaces newlines with a space. Multiple lines are\n * replaced with a single space.\n * @param {string} str The string from which to strip newlines.\n * @return {string} A copy of `str` stripped of newlines.\n */\ngoog.string.stripNewlines = function(str) {\n 'use strict';\n return str.replace(/(\\r\\n|\\r|\\n)+/g, ' ');\n};\n\n\n/**\n * Replaces Windows and Mac new lines with unix style: \\r or \\r\\n with \\n.\n * @param {string} str The string to in which to canonicalize newlines.\n * @return {string} `str` A copy of {@code} with canonicalized newlines.\n */\ngoog.string.canonicalizeNewlines = function(str) {\n 'use strict';\n return str.replace(/(\\r\\n|\\r|\\n)/g, '\\n');\n};\n\n\n/**\n * Normalizes whitespace in a string, replacing all whitespace chars with\n * a space.\n * @param {string} str The string in which to normalize whitespace.\n * @return {string} A copy of `str` with all whitespace normalized.\n */\ngoog.string.normalizeWhitespace = function(str) {\n 'use strict';\n return str.replace(/\\xa0|\\s/g, ' ');\n};\n\n\n/**\n * Normalizes spaces in a string, replacing all consecutive spaces and tabs\n * with a single space. Replaces non-breaking space with a space.\n * @param {string} str The string in which to normalize spaces.\n * @return {string} A copy of `str` with all consecutive spaces and tabs\n * replaced with a single space.\n */\ngoog.string.normalizeSpaces = function(str) {\n 'use strict';\n return str.replace(/\\xa0|[ \\t]+/g, ' ');\n};\n\n\n/**\n * Removes the breaking spaces from the left and right of the string and\n * collapses the sequences of breaking spaces in the middle into single spaces.\n * The original and the result strings render the same way in HTML.\n * @param {string} str A string in which to collapse spaces.\n * @return {string} Copy of the string with normalized breaking spaces.\n */\ngoog.string.collapseBreakingSpaces = function(str) {\n 'use strict';\n return str.replace(/[\\t\\r\\n ]+/g, ' ')\n .replace(/^[\\t\\r\\n ]+|[\\t\\r\\n ]+$/g, '');\n};\n\n\n/**\n * Trims white spaces to the left and right of a string.\n * @param {string} str The string to trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.trim = goog.string.internal.trim;\n\n\n/**\n * Trims whitespaces at the left end of a string.\n * @param {string} str The string to left trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.trimLeft = function(str) {\n 'use strict';\n // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n // include it in the regexp to enforce consistent cross-browser behavior.\n return str.replace(/^[\\s\\xa0]+/, '');\n};\n\n\n/**\n * Trims whitespaces at the right end of a string.\n * @param {string} str The string to right trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.trimRight = function(str) {\n 'use strict';\n // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n // include it in the regexp to enforce consistent cross-browser behavior.\n return str.replace(/[\\s\\xa0]+$/, '');\n};\n\n\n/**\n * A string comparator that ignores case.\n * -1 = str1 less than str2\n * 0 = str1 equals str2\n * 1 = str1 greater than str2\n *\n * @param {string} str1 The string to compare.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} The comparator result, as described above.\n */\ngoog.string.caseInsensitiveCompare =\n goog.string.internal.caseInsensitiveCompare;\n\n\n/**\n * Compares two strings interpreting their numeric substrings as numbers.\n *\n * @param {string} str1 First string.\n * @param {string} str2 Second string.\n * @param {!RegExp} tokenizerRegExp Splits a string into substrings of\n * non-negative integers, non-numeric characters and optionally fractional\n * numbers starting with a decimal point.\n * @return {number} Negative if str1 < str2, 0 is str1 == str2, positive if\n * str1 > str2.\n * @private\n */\ngoog.string.numberAwareCompare_ = function(str1, str2, tokenizerRegExp) {\n 'use strict';\n if (str1 == str2) {\n return 0;\n }\n if (!str1) {\n return -1;\n }\n if (!str2) {\n return 1;\n }\n\n // Using match to split the entire string ahead of time turns out to be faster\n // for most inputs than using RegExp.exec or iterating over each character.\n const tokens1 = str1.toLowerCase().match(tokenizerRegExp);\n const tokens2 = str2.toLowerCase().match(tokenizerRegExp);\n\n const count = Math.min(tokens1.length, tokens2.length);\n\n for (let i = 0; i < count; i++) {\n const a = tokens1[i];\n const b = tokens2[i];\n\n // Compare pairs of tokens, returning if one token sorts before the other.\n if (a != b) {\n // Only if both tokens are integers is a special comparison required.\n // Decimal numbers are sorted as strings (e.g., '.09' < '.1').\n const num1 = parseInt(a, 10);\n if (!isNaN(num1)) {\n const num2 = parseInt(b, 10);\n if (!isNaN(num2) && num1 - num2) {\n return num1 - num2;\n }\n }\n return a < b ? -1 : 1;\n }\n }\n\n // If one string is a substring of the other, the shorter string sorts first.\n if (tokens1.length != tokens2.length) {\n return tokens1.length - tokens2.length;\n }\n\n // The two strings must be equivalent except for case (perfect equality is\n // tested at the head of the function.) Revert to default ASCII string\n // comparison to stabilize the sort.\n return str1 < str2 ? -1 : 1;\n};\n\n\n/**\n * String comparison function that handles non-negative integer numbers in a\n * way humans might expect. Using this function, the string 'File 2.jpg' sorts\n * before 'File 10.jpg', and 'Version 1.9' before 'Version 1.10'. The comparison\n * is mostly case-insensitive, though strings that are identical except for case\n * are sorted with the upper-case strings before lower-case.\n *\n * This comparison function is up to 50x slower than either the default or the\n * case-insensitive compare. It should not be used in time-critical code, but\n * should be fast enough to sort several hundred short strings (like filenames)\n * with a reasonable delay.\n *\n * @param {string} str1 The string to compare in a numerically sensitive way.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} less than 0 if str1 < str2, 0 if str1 == str2, greater than\n * 0 if str1 > str2.\n */\ngoog.string.intAwareCompare = function(str1, str2) {\n 'use strict';\n return goog.string.numberAwareCompare_(str1, str2, /\\d+|\\D+/g);\n};\n\n\n/**\n * String comparison function that handles non-negative integer and fractional\n * numbers in a way humans might expect. Using this function, the string\n * 'File 2.jpg' sorts before 'File 10.jpg', and '3.14' before '3.2'. Equivalent\n * to {@link goog.string.intAwareCompare} apart from the way how it interprets\n * dots.\n *\n * @param {string} str1 The string to compare in a numerically sensitive way.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} less than 0 if str1 < str2, 0 if str1 == str2, greater than\n * 0 if str1 > str2.\n */\ngoog.string.floatAwareCompare = function(str1, str2) {\n 'use strict';\n return goog.string.numberAwareCompare_(str1, str2, /\\d+|\\.\\d+|\\D+/g);\n};\n\n\n/**\n * Alias for {@link goog.string.floatAwareCompare}.\n *\n * @param {string} str1\n * @param {string} str2\n * @return {number}\n */\ngoog.string.numerateCompare = goog.string.floatAwareCompare;\n\n\n/**\n * URL-encodes a string\n * @param {*} str The string to url-encode.\n * @return {string} An encoded copy of `str` that is safe for urls.\n * Note that '#', ':', and other characters used to delimit portions\n * of URLs *will* be encoded.\n */\ngoog.string.urlEncode = function(str) {\n 'use strict';\n return encodeURIComponent(String(str));\n};\n\n\n/**\n * URL-decodes the string. We need to specially handle '+'s because\n * the javascript library doesn't convert them to spaces.\n * @param {string} str The string to url decode.\n * @return {string} The decoded `str`.\n */\ngoog.string.urlDecode = function(str) {\n 'use strict';\n return decodeURIComponent(str.replace(/\\+/g, ' '));\n};\n\n\n/**\n * Converts \\n to <br>s or <br />s.\n * @param {string} str The string in which to convert newlines.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} A copy of `str` with converted newlines.\n */\ngoog.string.newLineToBr = goog.string.internal.newLineToBr;\n\n\n/**\n * Escapes double quote '\"' and single quote '\\'' characters in addition to\n * '&', '<', and '>' so that a string can be included in an HTML tag attribute\n * value within double or single quotes.\n *\n * It should be noted that > doesn't need to be escaped for the HTML or XML to\n * be valid, but it has been decided to escape it for consistency with other\n * implementations.\n *\n * With goog.string.DETECT_DOUBLE_ESCAPING, this function escapes also the\n * lowercase letter \"e\".\n *\n * NOTE(user):\n * HtmlEscape is often called during the generation of large blocks of HTML.\n * Using statics for the regular expressions and strings is an optimization\n * that can more than half the amount of time IE spends in this function for\n * large apps, since strings and regexes both contribute to GC allocations.\n *\n * Testing for the presence of a character before escaping increases the number\n * of function calls, but actually provides a speed increase for the average\n * case -- since the average case often doesn't require the escaping of all 4\n * characters and indexOf() is much cheaper than replace().\n * The worst case does suffer slightly from the additional calls, therefore the\n * opt_isLikelyToContainHtmlChars option has been included for situations\n * where all 4 HTML entities are very likely to be present and need escaping.\n *\n * Some benchmarks (times tended to fluctuate +-0.05ms):\n * FireFox IE6\n * (no chars / average (mix of cases) / all 4 chars)\n * no checks 0.13 / 0.22 / 0.22 0.23 / 0.53 / 0.80\n * indexOf 0.08 / 0.17 / 0.26 0.22 / 0.54 / 0.84\n * indexOf + re test 0.07 / 0.17 / 0.28 0.19 / 0.50 / 0.85\n *\n * An additional advantage of checking if replace actually needs to be called\n * is a reduction in the number of object allocations, so as the size of the\n * application grows the difference between the various methods would increase.\n *\n * @param {string} str string to be escaped.\n * @param {boolean=} opt_isLikelyToContainHtmlChars Don't perform a check to see\n * if the character needs replacing - use this option if you expect each of\n * the characters to appear often. Leave false if you expect few html\n * characters to occur in your strings, such as if you are escaping HTML.\n * @return {string} An escaped copy of `str`.\n */\ngoog.string.htmlEscape = function(str, opt_isLikelyToContainHtmlChars) {\n 'use strict';\n str = goog.string.internal.htmlEscape(str, opt_isLikelyToContainHtmlChars);\n if (goog.string.DETECT_DOUBLE_ESCAPING) {\n str = str.replace(goog.string.E_RE_, '&#101;');\n }\n return str;\n};\n\n\n/**\n * Regular expression that matches a lowercase letter \"e\", for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.E_RE_ = /e/g;\n\n\n/**\n * Unescapes an HTML string.\n *\n * @param {string} str The string to unescape.\n * @return {string} An unescaped copy of `str`.\n */\ngoog.string.unescapeEntities = function(str) {\n 'use strict';\n if (goog.string.contains(str, '&')) {\n // We are careful not to use a DOM if we do not have one or we explicitly\n // requested non-DOM html unescaping.\n if (!goog.string.FORCE_NON_DOM_HTML_UNESCAPING &&\n 'document' in goog.global) {\n return goog.string.unescapeEntitiesUsingDom_(str);\n } else {\n // Fall back on pure XML entities\n return goog.string.unescapePureXmlEntities_(str);\n }\n }\n return str;\n};\n\n\n/**\n * Unescapes a HTML string using the provided document.\n *\n * @param {string} str The string to unescape.\n * @param {!Document} document A document to use in escaping the string.\n * @return {string} An unescaped copy of `str`.\n */\ngoog.string.unescapeEntitiesWithDocument = function(str, document) {\n 'use strict';\n if (goog.string.contains(str, '&')) {\n return goog.string.unescapeEntitiesUsingDom_(str, document);\n }\n return str;\n};\n\n\n/**\n * Unescapes an HTML string using a DOM to resolve non-XML, non-numeric\n * entities. This function is XSS-safe and whitespace-preserving.\n * @private\n * @param {string} str The string to unescape.\n * @param {Document=} opt_document An optional document to use for creating\n * elements. If this is not specified then the default window.document\n * will be used.\n * @return {string} The unescaped `str` string.\n */\ngoog.string.unescapeEntitiesUsingDom_ = function(str, opt_document) {\n 'use strict';\n /** @type {!Object<string, string>} */\n const seen = {'&amp;': '&', '&lt;': '<', '&gt;': '>', '&quot;': '\"'};\n /** @type {!Element} */\n let div;\n if (opt_document) {\n div = opt_document.createElement('div');\n } else {\n div = goog.global.document.createElement('div');\n }\n // Match as many valid entity characters as possible. If the actual entity\n // happens to be shorter, it will still work as innerHTML will return the\n // trailing characters unchanged. Since the entity characters do not include\n // open angle bracket, there is no chance of XSS from the innerHTML use.\n // Since no whitespace is passed to innerHTML, whitespace is preserved.\n return str.replace(goog.string.HTML_ENTITY_PATTERN_, function(s, entity) {\n 'use strict';\n // Check for cached entity.\n let value = seen[s];\n if (value) {\n return value;\n }\n // Check for numeric entity.\n if (entity.charAt(0) == '#') {\n // Prefix with 0 so that hex entities (e.g. &#x10) parse as hex numbers.\n const n = Number('0' + entity.slice(1));\n if (!isNaN(n)) {\n value = String.fromCharCode(n);\n }\n }\n // Fall back to innerHTML otherwise.\n if (!value) {\n // Append a non-entity character to avoid a bug in Webkit that parses\n // an invalid entity at the end of innerHTML text as the empty string.\n goog.dom.safe.setInnerHtml(\n div,\n goog.html.uncheckedconversions\n .safeHtmlFromStringKnownToSatisfyTypeContract(\n goog.string.Const.from('Single HTML entity.'), s + ' '));\n // Then remove the trailing character from the result.\n value = div.firstChild.nodeValue.slice(0, -1);\n }\n // Cache and return.\n return seen[s] = value;\n });\n};\n\n\n/**\n * Unescapes XML entities.\n * @private\n * @param {string} str The string to unescape.\n * @return {string} An unescaped copy of `str`.\n */\ngoog.string.unescapePureXmlEntities_ = function(str) {\n 'use strict';\n return str.replace(/&([^;]+);/g, function(s, entity) {\n 'use strict';\n switch (entity) {\n case 'amp':\n return '&';\n case 'lt':\n return '<';\n case 'gt':\n return '>';\n case 'quot':\n return '\"';\n default:\n if (entity.charAt(0) == '#') {\n // Prefix with 0 so that hex entities (e.g. &#x10) parse as hex.\n const n = Number('0' + entity.slice(1));\n if (!isNaN(n)) {\n return String.fromCharCode(n);\n }\n }\n // For invalid entities we just return the entity\n return s;\n }\n });\n};\n\n\n/**\n * Regular expression that matches an HTML entity.\n * See also HTML5: Tokenization / Tokenizing character references.\n * @private\n * @type {!RegExp}\n */\ngoog.string.HTML_ENTITY_PATTERN_ = /&([^;\\s<&]+);?/g;\n\n\n/**\n * Do escaping of whitespace to preserve spatial formatting. We use character\n * entity #160 to make it safer for xml.\n * @param {string} str The string in which to escape whitespace.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} An escaped copy of `str`.\n */\ngoog.string.whitespaceEscape = function(str, opt_xml) {\n 'use strict';\n // This doesn't use goog.string.preserveSpaces for backwards compatibility.\n return goog.string.newLineToBr(str.replace(/ /g, ' &#160;'), opt_xml);\n};\n\n\n/**\n * Preserve spaces that would be otherwise collapsed in HTML by replacing them\n * with non-breaking space Unicode characters.\n * @param {string} str The string in which to preserve whitespace.\n * @return {string} A copy of `str` with preserved whitespace.\n */\ngoog.string.preserveSpaces = function(str) {\n 'use strict';\n return str.replace(/(^|[\\n ]) /g, '$1' + goog.string.Unicode.NBSP);\n};\n\n\n/**\n * Strip quote characters around a string. The second argument is a string of\n * characters to treat as quotes. This can be a single character or a string of\n * multiple character and in that case each of those are treated as possible\n * quote characters. For example:\n *\n * <pre>\n * goog.string.stripQuotes('\"abc\"', '\"`') --\u003e 'abc'\n * goog.string.stripQuotes('`abc`', '\"`') --\u003e 'abc'\n * </pre>\n *\n * @param {string} str The string to strip.\n * @param {string} quoteChars The quote characters to strip.\n * @return {string} A copy of `str` without the quotes.\n */\ngoog.string.stripQuotes = function(str, quoteChars) {\n 'use strict';\n const length = quoteChars.length;\n for (let i = 0; i < length; i++) {\n const quoteChar = length == 1 ? quoteChars : quoteChars.charAt(i);\n if (str.charAt(0) == quoteChar && str.charAt(str.length - 1) == quoteChar) {\n return str.substring(1, str.length - 1);\n }\n }\n return str;\n};\n\n\n/**\n * Truncates a string to a certain length and adds '...' if necessary. The\n * length also accounts for the ellipsis, so a maximum length of 10 and a string\n * 'Hello World!' produces 'Hello W...'.\n * @param {string} str The string to truncate.\n * @param {number} chars Max number of characters.\n * @param {boolean=} opt_protectEscapedCharacters Whether to protect escaped\n * characters from being cut off in the middle.\n * @return {string} The truncated `str` string.\n */\ngoog.string.truncate = function(str, chars, opt_protectEscapedCharacters) {\n 'use strict';\n if (opt_protectEscapedCharacters) {\n str = goog.string.unescapeEntities(str);\n }\n\n if (str.length > chars) {\n str = str.substring(0, chars - 3) + '...';\n }\n\n if (opt_protectEscapedCharacters) {\n str = goog.string.htmlEscape(str);\n }\n\n return str;\n};\n\n\n/**\n * Truncate a string in the middle, adding \"...\" if necessary,\n * and favoring the beginning of the string.\n * @param {string} str The string to truncate the middle of.\n * @param {number} chars Max number of characters.\n * @param {boolean=} opt_protectEscapedCharacters Whether to protect escaped\n * characters from being cutoff in the middle.\n * @param {number=} opt_trailingChars Optional number of trailing characters to\n * leave at the end of the string, instead of truncating as close to the\n * middle as possible.\n * @return {string} A truncated copy of `str`.\n */\ngoog.string.truncateMiddle = function(\n str, chars, opt_protectEscapedCharacters, opt_trailingChars) {\n 'use strict';\n if (opt_protectEscapedCharacters) {\n str = goog.string.unescapeEntities(str);\n }\n\n if (opt_trailingChars && str.length > chars) {\n if (opt_trailingChars > chars) {\n opt_trailingChars = chars;\n }\n const endPoint = str.length - opt_trailingChars;\n const startPoint = chars - opt_trailingChars;\n str = str.substring(0, startPoint) + '...' + str.substring(endPoint);\n } else if (str.length > chars) {\n // Favor the beginning of the string:\n let half = Math.floor(chars / 2);\n const endPos = str.length - half;\n half += chars % 2;\n str = str.substring(0, half) + '...' + str.substring(endPos);\n }\n\n if (opt_protectEscapedCharacters) {\n str = goog.string.htmlEscape(str);\n }\n\n return str;\n};\n\n\n/**\n * Special chars that need to be escaped for goog.string.quote.\n * @private {!Object<string, string>}\n */\ngoog.string.specialEscapeChars_ = {\n '\\0': '\\\\0',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t',\n '\\x0B': '\\\\x0B', // '\\v' is not supported in JScript\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n // To support the use case of embedding quoted strings inside of script\n // tags, we have to make sure HTML comments and opening/closing script tags do\n // not appear in the resulting string. The specific strings that must be\n // escaped are documented at:\n // https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements\n '<': '\\\\u003C' // NOTE: JSON.parse crashes on '\\\\x3c'.\n};\n\n\n/**\n * Character mappings used internally for goog.string.escapeChar.\n * @private {!Object<string, string>}\n */\ngoog.string.jsEscapeCache_ = {\n '\\'': '\\\\\\''\n};\n\n\n/**\n * Encloses a string in double quotes and escapes characters so that the\n * string is a valid JS string. The resulting string is safe to embed in\n * `<script>` tags as \"<\" is escaped.\n * @param {string} s The string to quote.\n * @return {string} A copy of `s` surrounded by double quotes.\n */\ngoog.string.quote = function(s) {\n 'use strict';\n s = String(s);\n const sb = ['\"'];\n for (let i = 0; i < s.length; i++) {\n const ch = s.charAt(i);\n const cc = ch.charCodeAt(0);\n sb[i + 1] = goog.string.specialEscapeChars_[ch] ||\n ((cc > 31 && cc < 127) ? ch : goog.string.escapeChar(ch));\n }\n sb.push('\"');\n return sb.join('');\n};\n\n\n/**\n * Takes a string and returns the escaped string for that input string.\n * @param {string} str The string to escape.\n * @return {string} An escaped string representing `str`.\n */\ngoog.string.escapeString = function(str) {\n 'use strict';\n const sb = [];\n for (let i = 0; i < str.length; i++) {\n sb[i] = goog.string.escapeChar(str.charAt(i));\n }\n return sb.join('');\n};\n\n\n/**\n * Takes a character and returns the escaped string for that character. For\n * example escapeChar(String.fromCharCode(15)) -> \"\\\\x0E\".\n * @param {string} c The character to escape.\n * @return {string} An escaped string representing `c`.\n */\ngoog.string.escapeChar = function(c) {\n 'use strict';\n if (c in goog.string.jsEscapeCache_) {\n return goog.string.jsEscapeCache_[c];\n }\n\n if (c in goog.string.specialEscapeChars_) {\n return goog.string.jsEscapeCache_[c] = goog.string.specialEscapeChars_[c];\n }\n\n let rv = c;\n const cc = c.charCodeAt(0);\n if (cc > 31 && cc < 127) {\n rv = c;\n } else {\n // tab is 9 but handled above\n if (cc < 256) {\n rv = '\\\\x';\n if (cc < 16 || cc > 256) {\n rv += '0';\n }\n } else {\n rv = '\\\\u';\n if (cc < 4096) { // \\u1000\n rv += '0';\n }\n }\n rv += cc.toString(16).toUpperCase();\n }\n\n return goog.string.jsEscapeCache_[c] = rv;\n};\n\n\n/**\n * Determines whether a string contains a substring.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n */\ngoog.string.contains = goog.string.internal.contains;\n\n\n/**\n * Determines whether a string contains a substring, ignoring case.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n */\ngoog.string.caseInsensitiveContains =\n goog.string.internal.caseInsensitiveContains;\n\n\n/**\n * Returns the non-overlapping occurrences of ss in s.\n * If either s or ss evalutes to false, then returns zero.\n * @param {string} s The string to look in.\n * @param {string} ss The string to look for.\n * @return {number} Number of occurrences of ss in s.\n */\ngoog.string.countOf = function(s, ss) {\n 'use strict';\n return s && ss ? s.split(ss).length - 1 : 0;\n};\n\n\n/**\n * Removes a substring of a specified length at a specific\n * index in a string.\n * @param {string} s The base string from which to remove.\n * @param {number} index The index at which to remove the substring.\n * @param {number} stringLength The length of the substring to remove.\n * @return {string} A copy of `s` with the substring removed or the full\n * string if nothing is removed or the input is invalid.\n */\ngoog.string.removeAt = function(s, index, stringLength) {\n 'use strict';\n let resultStr = s;\n // If the index is greater or equal to 0 then remove substring\n if (index >= 0 && index < s.length && stringLength > 0) {\n resultStr = s.slice(0, index) + s.slice(index + stringLength);\n }\n return resultStr;\n};\n\n\n/**\n * Removes the first occurrence of a substring from a string.\n * @param {string} str The base string from which to remove.\n * @param {string} substr The string to remove.\n * @return {string} A copy of `str` with `substr` removed or the\n * full string if nothing is removed.\n */\ngoog.string.remove = function(str, substr) {\n 'use strict';\n return str.replace(substr, '');\n};\n\n\n/**\n * Removes all occurrences of a substring from a string.\n * @param {string} s The base string from which to remove.\n * @param {string} ss The string to remove.\n * @return {string} A copy of `s` with `ss` removed or the full\n * string if nothing is removed.\n */\ngoog.string.removeAll = function(s, ss) {\n 'use strict';\n const re = new RegExp(goog.string.regExpEscape(ss), 'g');\n return s.replace(re, '');\n};\n\n\n/**\n * Replaces all occurrences of a substring of a string with a new substring.\n * @param {string} s The base string from which to remove.\n * @param {string} ss The string to replace.\n * @param {string} replacement The replacement string.\n * @return {string} A copy of `s` with `ss` replaced by\n * `replacement` or the original string if nothing is replaced.\n */\ngoog.string.replaceAll = function(s, ss, replacement) {\n 'use strict';\n const re = new RegExp(goog.string.regExpEscape(ss), 'g');\n return s.replace(re, replacement.replace(/\\$/g, '$$$$'));\n};\n\n\n/**\n * Escapes characters in the string that are not safe to use in a RegExp.\n * @param {*} s The string to escape. If not a string, it will be casted\n * to one.\n * @return {string} A RegExp safe, escaped copy of `s`.\n */\ngoog.string.regExpEscape = function(s) {\n 'use strict';\n return String(s)\n .replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1')\n .replace(/\\x08/g, '\\\\x08');\n};\n\n\n/**\n * Repeats a string n times.\n * @param {string} string The string to repeat.\n * @param {number} length The number of times to repeat.\n * @return {string} A string containing `length` repetitions of\n * `string`.\n */\ngoog.string.repeat = (String.prototype.repeat) ? function(string, length) {\n 'use strict';\n // The native method is over 100 times faster than the alternative.\n return string.repeat(length);\n} : function(string, length) {\n 'use strict';\n return new Array(length + 1).join(string);\n};\n\n\n/**\n * Pads number to given length and optionally rounds it to a given precision.\n * For example:\n * <pre>padNumber(1.25, 2, 3) -> '01.250'\n * padNumber(1.25, 2) -> '01.25'\n * padNumber(1.25, 2, 1) -> '01.3'\n * padNumber(1.25, 0) -> '1.25'</pre>\n *\n * @param {number} num The number to pad.\n * @param {number} length The desired length.\n * @param {number=} opt_precision The desired precision.\n * @return {string} `num` as a string with the given options.\n */\ngoog.string.padNumber = function(num, length, opt_precision) {\n 'use strict';\n if (!Number.isFinite(num)) return String(num);\n let s =\n (opt_precision !== undefined) ? num.toFixed(opt_precision) : String(num);\n let index = s.indexOf('.');\n if (index === -1) {\n index = s.length;\n }\n const sign = s[0] === '-' ? '-' : '';\n if (sign) {\n s = s.substring(1);\n }\n return sign + goog.string.repeat('0', Math.max(0, length - index)) + s;\n};\n\n\n/**\n * Returns a string representation of the given object, with\n * null and undefined being returned as the empty string.\n *\n * @param {*} obj The object to convert.\n * @return {string} A string representation of the `obj`.\n */\ngoog.string.makeSafe = function(obj) {\n 'use strict';\n return obj == null ? '' : String(obj);\n};\n\n/**\n * Returns a string with at least 64-bits of randomness.\n *\n * Doesn't trust JavaScript's random function entirely. Uses a combination of\n * random and current timestamp, and then encodes the string in base-36 to\n * make it shorter.\n *\n * @return {string} A random string, e.g. sn1s7vb4gcic.\n */\ngoog.string.getRandomString = function() {\n 'use strict';\n const x = 2147483648;\n return Math.floor(Math.random() * x).toString(36) +\n Math.abs(Math.floor(Math.random() * x) ^ goog.now()).toString(36);\n};\n\n\n/**\n * Compares two version numbers.\n *\n * @param {string|number} version1 Version of first item.\n * @param {string|number} version2 Version of second item.\n *\n * @return {number} 1 if `version1` is higher.\n * 0 if arguments are equal.\n * -1 if `version2` is higher.\n */\ngoog.string.compareVersions = goog.string.internal.compareVersions;\n\n\n/**\n * String hash function similar to java.lang.String.hashCode().\n * The hash code for a string is computed as\n * s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],\n * where s[i] is the ith character of the string and n is the length of\n * the string. We mod the result to make it between 0 (inclusive) and 2^32\n * (exclusive).\n * @param {string} str A string.\n * @return {number} Hash value for `str`, between 0 (inclusive) and 2^32\n * (exclusive). The empty string returns 0.\n */\ngoog.string.hashCode = function(str) {\n 'use strict';\n let result = 0;\n for (let i = 0; i < str.length; ++i) {\n // Normalize to 4 byte range, 0 ... 2^32.\n result = (31 * result + str.charCodeAt(i)) >>> 0;\n }\n return result;\n};\n\n\n/**\n * The most recent unique ID. |0 is equivalent to Math.floor in this case.\n * @type {number}\n * @private\n */\ngoog.string.uniqueStringCounter_ = Math.random() * 0x80000000 | 0;\n\n\n/**\n * Generates and returns a string which is unique in the current document.\n * This is useful, for example, to create unique IDs for DOM elements.\n * @return {string} A unique id.\n */\ngoog.string.createUniqueString = function() {\n 'use strict';\n return 'goog_' + goog.string.uniqueStringCounter_++;\n};\n\n\n/**\n * Converts the supplied string to a number, which may be Infinity or NaN.\n * This function strips whitespace: (toNumber(' 123') === 123)\n * This function accepts scientific notation: (toNumber('1e1') === 10)\n *\n * This is better than JavaScript's built-in conversions because, sadly:\n * (Number(' ') === 0) and (parseFloat('123a') === 123)\n *\n * @param {string} str The string to convert.\n * @return {number} The number the supplied string represents, or NaN.\n */\ngoog.string.toNumber = function(str) {\n 'use strict';\n const num = Number(str);\n if (num == 0 && goog.string.isEmptyOrWhitespace(str)) {\n return NaN;\n }\n return num;\n};\n\n\n/**\n * Returns whether the given string is lower camel case (e.g. \"isFooBar\").\n *\n * Note that this assumes the string is entirely letters.\n * @see http://en.wikipedia.org/wiki/CamelCase#Variations_and_synonyms\n *\n * @param {string} str String to test.\n * @return {boolean} Whether the string is lower camel case.\n */\ngoog.string.isLowerCamelCase = function(str) {\n 'use strict';\n return /^[a-z]+([A-Z][a-z]*)*$/.test(str);\n};\n\n\n/**\n * Returns whether the given string is upper camel case (e.g. \"FooBarBaz\").\n *\n * Note that this assumes the string is entirely letters.\n * @see http://en.wikipedia.org/wiki/CamelCase#Variations_and_synonyms\n *\n * @param {string} str String to test.\n * @return {boolean} Whether the string is upper camel case.\n */\ngoog.string.isUpperCamelCase = function(str) {\n 'use strict';\n return /^([A-Z][a-z]*)+$/.test(str);\n};\n\n\n/**\n * Converts a string from selector-case to camelCase (e.g. from\n * \"multi-part-string\" to \"multiPartString\"), useful for converting\n * CSS selectors and HTML dataset keys to their equivalent JS properties.\n * @param {string} str The string in selector-case form.\n * @return {string} The string in camelCase form.\n */\ngoog.string.toCamelCase = function(str) {\n 'use strict';\n return String(str).replace(/\\-([a-z])/g, function(all, match) {\n 'use strict';\n return match.toUpperCase();\n });\n};\n\n\n/**\n * Converts a string from camelCase to selector-case (e.g. from\n * \"multiPartString\" to \"multi-part-string\"), useful for converting JS\n * style and dataset properties to equivalent CSS selectors and HTML keys.\n * @param {string} str The string in camelCase form.\n * @return {string} The string in selector-case form.\n */\ngoog.string.toSelectorCase = function(str) {\n 'use strict';\n return String(str).replace(/([A-Z])/g, '-$1').toLowerCase();\n};\n\n\n/**\n * Converts a string into TitleCase. First character of the string is always\n * capitalized in addition to the first letter of every subsequent word.\n * Words are delimited by one or more whitespaces by default. Custom delimiters\n * can optionally be specified to replace the default, which doesn't preserve\n * whitespace delimiters and instead must be explicitly included if needed.\n *\n * Default delimiter => \" \":\n * goog.string.toTitleCase('oneTwoThree') => 'OneTwoThree'\n * goog.string.toTitleCase('one two three') => 'One Two Three'\n * goog.string.toTitleCase(' one two ') => ' One Two '\n * goog.string.toTitleCase('one_two_three') => 'One_two_three'\n * goog.string.toTitleCase('one-two-three') => 'One-two-three'\n *\n * Custom delimiter => \"_-.\":\n * goog.string.toTitleCase('oneTwoThree', '_-.') => 'OneTwoThree'\n * goog.string.toTitleCase('one two three', '_-.') => 'One two three'\n * goog.string.toTitleCase(' one two ', '_-.') => ' one two '\n * goog.string.toTitleCase('one_two_three', '_-.') => 'One_Two_Three'\n * goog.string.toTitleCase('one-two-three', '_-.') => 'One-Two-Three'\n * goog.string.toTitleCase('one...two...three', '_-.') => 'One...Two...Three'\n * goog.string.toTitleCase('one. two. three', '_-.') => 'One. two. three'\n * goog.string.toTitleCase('one-two.three', '_-.') => 'One-Two.Three'\n *\n * @param {string} str String value in camelCase form.\n * @param {string=} opt_delimiters Custom delimiter character set used to\n * distinguish words in the string value. Each character represents a\n * single delimiter. When provided, default whitespace delimiter is\n * overridden and must be explicitly included if needed.\n * @return {string} String value in TitleCase form.\n */\ngoog.string.toTitleCase = function(str, opt_delimiters) {\n 'use strict';\n let delimiters = (typeof opt_delimiters === 'string') ?\n goog.string.regExpEscape(opt_delimiters) :\n '\\\\s';\n\n // For IE8, we need to prevent using an empty character set. Otherwise,\n // incorrect matching will occur.\n delimiters = delimiters ? '|[' + delimiters + ']+' : '';\n\n const regexp = new RegExp('(^' + delimiters + ')([a-z])', 'g');\n return str.replace(regexp, function(all, p1, p2) {\n 'use strict';\n return p1 + p2.toUpperCase();\n });\n};\n\n\n/**\n * Capitalizes a string, i.e. converts the first letter to uppercase\n * and all other letters to lowercase, e.g.:\n *\n * goog.string.capitalize('one') => 'One'\n * goog.string.capitalize('ONE') => 'One'\n * goog.string.capitalize('one two') => 'One two'\n *\n * Note that this function does not trim initial whitespace.\n *\n * @param {string} str String value to capitalize.\n * @return {string} String value with first letter in uppercase.\n */\ngoog.string.capitalize = function(str) {\n 'use strict';\n return String(str.charAt(0)).toUpperCase() +\n String(str.slice(1)).toLowerCase();\n};\n\n\n/**\n * Parse a string in decimal or hexidecimal ('0xFFFF') form.\n *\n * To parse a particular radix, please use parseInt(string, radix) directly. See\n * https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseInt\n *\n * This is a wrapper for the built-in parseInt function that will only parse\n * numbers as base 10 or base 16. Some JS implementations assume strings\n * starting with \"0\" are intended to be octal. ES3 allowed but discouraged\n * this behavior. ES5 forbids it. This function emulates the ES5 behavior.\n *\n * For more information, see Mozilla JS Reference: http://goo.gl/8RiFj\n *\n * @param {string|number|null|undefined} value The value to be parsed.\n * @return {number} The number, parsed. If the string failed to parse, this\n * will be NaN.\n */\ngoog.string.parseInt = function(value) {\n 'use strict';\n // Force finite numbers to strings.\n if (isFinite(value)) {\n value = String(value);\n }\n\n if (typeof value === 'string') {\n // If the string starts with '0x' or '-0x', parse as hex.\n return /^\\s*-?0x/i.test(value) ? parseInt(value, 16) : parseInt(value, 10);\n }\n\n return NaN;\n};\n\n\n/**\n * Splits a string on a separator a limited number of times.\n *\n * This implementation is more similar to Python or Java, where the limit\n * parameter specifies the maximum number of splits rather than truncating\n * the number of results.\n *\n * See http://docs.python.org/2/library/stdtypes.html#str.split\n * See JavaDoc: http://goo.gl/F2AsY\n * See Mozilla reference: http://goo.gl/dZdZs\n *\n * @param {string} str String to split.\n * @param {string} separator The separator.\n * @param {number} limit The limit to the number of splits. The resulting array\n * will have a maximum length of limit+1. Negative numbers are the same\n * as zero.\n * @return {!Array<string>} The string, split.\n */\ngoog.string.splitLimit = function(str, separator, limit) {\n 'use strict';\n const parts = str.split(separator);\n const returnVal = [];\n\n // Only continue doing this while we haven't hit the limit and we have\n // parts left.\n while (limit > 0 && parts.length) {\n returnVal.push(parts.shift());\n limit--;\n }\n\n // If there are remaining parts, append them to the end.\n if (parts.length) {\n returnVal.push(parts.join(separator));\n }\n\n return returnVal;\n};\n\n\n/**\n * Finds the characters to the right of the last instance of any separator\n *\n * This function is similar to goog.string.path.baseName, except it can take a\n * list of characters to split the string on. It will return the rightmost\n * grouping of characters to the right of any separator as a left-to-right\n * oriented string.\n *\n * @see goog.string.path.baseName\n * @param {string} str The string\n * @param {string|!Array<string>} separators A list of separator characters\n * @return {string} The last part of the string with respect to the separators\n */\ngoog.string.lastComponent = function(str, separators) {\n 'use strict';\n if (!separators) {\n return str;\n } else if (typeof separators == 'string') {\n separators = [separators];\n }\n\n let lastSeparatorIndex = -1;\n for (let i = 0; i < separators.length; i++) {\n if (separators[i] == '') {\n continue;\n }\n const currentSeparatorIndex = str.lastIndexOf(separators[i]);\n if (currentSeparatorIndex > lastSeparatorIndex) {\n lastSeparatorIndex = currentSeparatorIndex;\n }\n }\n if (lastSeparatorIndex == -1) {\n return str;\n }\n return str.slice(lastSeparatorIndex + 1);\n};\n\n\n/**\n * Computes the Levenshtein edit distance between two strings.\n * @param {string} a\n * @param {string} b\n * @return {number} The edit distance between the two strings.\n */\ngoog.string.editDistance = function(a, b) {\n 'use strict';\n const v0 = [];\n const v1 = [];\n\n if (a == b) {\n return 0;\n }\n\n if (!a.length || !b.length) {\n return Math.max(a.length, b.length);\n }\n\n for (let i = 0; i < b.length + 1; i++) {\n v0[i] = i;\n }\n\n for (let i = 0; i < a.length; i++) {\n v1[0] = i + 1;\n\n for (let j = 0; j < b.length; j++) {\n const cost = Number(a[i] != b[j]);\n // Cost for the substring is the minimum of adding one character, removing\n // one character, or a swap.\n v1[j + 1] = Math.min(v1[j] + 1, v0[j + 1] + 1, v0[j] + cost);\n }\n\n for (let j = 0; j < v0.length; j++) {\n v0[j] = v1[j];\n }\n }\n\n return v1[b.length];\n};\n"],
8
+ "names":["goog","provide","require","string","DETECT_DOUBLE_ESCAPING","define","FORCE_NON_DOM_HTML_UNESCAPING","Unicode","NBSP","ZERO_WIDTH_SPACE","startsWith","internal","endsWith","caseInsensitiveStartsWith","caseInsensitiveEndsWith","caseInsensitiveEquals","subs","goog.string.subs","str","var_args","splitParts","split","returnString","subsArguments","Array","prototype","slice","call","arguments","length","shift","join","collapseWhitespace","goog.string.collapseWhitespace","replace","isEmptyOrWhitespace","isEmptyString","goog.string.isEmptyString","isEmpty","isEmptyOrWhitespaceSafe","goog.string.isEmptyOrWhitespaceSafe","makeSafe","isEmptySafe","isBreakingWhitespace","goog.string.isBreakingWhitespace","test","isAlpha","goog.string.isAlpha","isNumeric","goog.string.isNumeric","isAlphaNumeric","goog.string.isAlphaNumeric","isSpace","goog.string.isSpace","ch","isUnicodeChar","goog.string.isUnicodeChar","stripNewlines","goog.string.stripNewlines","canonicalizeNewlines","goog.string.canonicalizeNewlines","normalizeWhitespace","goog.string.normalizeWhitespace","normalizeSpaces","goog.string.normalizeSpaces","collapseBreakingSpaces","goog.string.collapseBreakingSpaces","trim","trimLeft","goog.string.trimLeft","trimRight","goog.string.trimRight","caseInsensitiveCompare","numberAwareCompare_","goog.string.numberAwareCompare_","str1","str2","tokenizerRegExp","tokens1","toLowerCase","match","tokens2","count","Math","min","i","a","b","num1","parseInt","isNaN","num2","intAwareCompare","goog.string.intAwareCompare","floatAwareCompare","goog.string.floatAwareCompare","numerateCompare","urlEncode","goog.string.urlEncode","encodeURIComponent","String","urlDecode","goog.string.urlDecode","decodeURIComponent","newLineToBr","htmlEscape","goog.string.htmlEscape","opt_isLikelyToContainHtmlChars","E_RE_","unescapeEntities","goog.string.unescapeEntities","contains","global","unescapeEntitiesUsingDom_","unescapePureXmlEntities_","unescapeEntitiesWithDocument","goog.string.unescapeEntitiesWithDocument","document","goog.string.unescapeEntitiesUsingDom_","opt_document","seen","div","createElement","HTML_ENTITY_PATTERN_","s","entity","value","charAt","n","Number","fromCharCode","dom","safe","setInnerHtml","html","uncheckedconversions","safeHtmlFromStringKnownToSatisfyTypeContract","Const","from","firstChild","nodeValue","goog.string.unescapePureXmlEntities_","whitespaceEscape","goog.string.whitespaceEscape","opt_xml","preserveSpaces","goog.string.preserveSpaces","stripQuotes","goog.string.stripQuotes","quoteChars","quoteChar","substring","truncate","goog.string.truncate","chars","opt_protectEscapedCharacters","truncateMiddle","goog.string.truncateMiddle","opt_trailingChars","endPoint","startPoint","half","floor","endPos","specialEscapeChars_","jsEscapeCache_","quote","goog.string.quote","sb","cc","charCodeAt","escapeChar","push","escapeString","goog.string.escapeString","goog.string.escapeChar","c","rv","toString","toUpperCase","caseInsensitiveContains","countOf","goog.string.countOf","ss","removeAt","goog.string.removeAt","index","stringLength","resultStr","remove","goog.string.remove","substr","removeAll","goog.string.removeAll","re","RegExp","regExpEscape","replaceAll","goog.string.replaceAll","replacement","goog.string.regExpEscape","repeat","padNumber","goog.string.padNumber","num","opt_precision","isFinite","undefined","toFixed","indexOf","sign","max","goog.string.makeSafe","obj","getRandomString","goog.string.getRandomString","x","random","abs","now","compareVersions","hashCode","goog.string.hashCode","result","uniqueStringCounter_","createUniqueString","goog.string.createUniqueString","toNumber","goog.string.toNumber","NaN","isLowerCamelCase","goog.string.isLowerCamelCase","isUpperCamelCase","goog.string.isUpperCamelCase","toCamelCase","goog.string.toCamelCase","all","toSelectorCase","goog.string.toSelectorCase","toTitleCase","goog.string.toTitleCase","opt_delimiters","delimiters","regexp","p1","p2","capitalize","goog.string.capitalize","goog.string.parseInt","splitLimit","goog.string.splitLimit","separator","limit","parts","returnVal","lastComponent","goog.string.lastComponent","separators","lastSeparatorIndex","currentSeparatorIndex","lastIndexOf","editDistance","goog.string.editDistance","v0","v1","j","cost"]
9
+ }
@@ -0,0 +1,31 @@
1
+ import "./cljs_env.js";
2
+ goog.provide("goog.string.StringBuffer");
3
+ goog.string.StringBuffer = function(opt_a1, var_args) {
4
+ if (opt_a1 != null) {
5
+ this.append.apply(this, arguments);
6
+ }
7
+ };
8
+ goog.string.StringBuffer.prototype.buffer_ = "";
9
+ goog.string.StringBuffer.prototype.set = function(s) {
10
+ this.buffer_ = "" + s;
11
+ };
12
+ goog.string.StringBuffer.prototype.append = function(a1, opt_a2, var_args) {
13
+ this.buffer_ += String(a1);
14
+ if (opt_a2 != null) {
15
+ for (let i = 1; i < arguments.length; i++) {
16
+ this.buffer_ += arguments[i];
17
+ }
18
+ }
19
+ return this;
20
+ };
21
+ goog.string.StringBuffer.prototype.clear = function() {
22
+ this.buffer_ = "";
23
+ };
24
+ goog.string.StringBuffer.prototype.getLength = function() {
25
+ return this.buffer_.length;
26
+ };
27
+ goog.string.StringBuffer.prototype.toString = function() {
28
+ return this.buffer_;
29
+ };
30
+
31
+ //# sourceMappingURL=goog.string.stringbuffer.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version":3,
3
+ "file":"goog.string.stringbuffer.js",
4
+ "lineCount":29,
5
+ "mappings":"AAUAA,IAAKC,CAAAA,OAAL,CAAa,0BAAb,CAAA;AAYAD,IAAKE,CAAAA,MAAOC,CAAAA,YAAZ,GAA2BC,QAAQ,CAACC,MAAD,EAASC,QAAT,CAAmB;AAEpD,MAAID,MAAJ,IAAc,IAAd;AACE,QAAKE,CAAAA,MAAOC,CAAAA,KAAZ,CAAkB,IAAlB,EAAwBC,SAAxB,CAAA;AADF;AAFoD,CAAtD;AAaAT,IAAKE,CAAAA,MAAOC,CAAAA,YAAaO,CAAAA,SAAUC,CAAAA,OAAnC,GAA6C,EAA7C;AASAX,IAAKE,CAAAA,MAAOC,CAAAA,YAAaO,CAAAA,SAAUE,CAAAA,GAAnC,GAAyCC,QAAQ,CAACC,CAAD,CAAI;AAEnD,MAAKH,CAAAA,OAAL,GAAe,EAAf,GAAoBG,CAApB;AAFmD,CAArD;AAkBAd,IAAKE,CAAAA,MAAOC,CAAAA,YAAaO,CAAAA,SAAUH,CAAAA,MAAnC,GAA4CQ,QAAQ,CAACC,EAAD,EAAKC,MAAL,EAAaX,QAAb,CAAuB;AAGzE,MAAKK,CAAAA,OAAL,IAAgBO,MAAA,CAAOF,EAAP,CAAhB;AACA,MAAIC,MAAJ,IAAc,IAAd;AACE,SAAK,IAAIE,IAAI,CAAb,EAAgBA,CAAhB,GAAoBV,SAAUW,CAAAA,MAA9B,EAAsCD,CAAA,EAAtC;AACE,UAAKR,CAAAA,OAAL,IAAgBF,SAAA,CAAUU,CAAV,CAAhB;AADF;AADF;AAKA,SAAO,IAAP;AATyE,CAA3E;AAgBAnB,IAAKE,CAAAA,MAAOC,CAAAA,YAAaO,CAAAA,SAAUW,CAAAA,KAAnC,GAA2CC,QAAQ,EAAG;AAEpD,MAAKX,CAAAA,OAAL,GAAe,EAAf;AAFoD,CAAtD;AASAX,IAAKE,CAAAA,MAAOC,CAAAA,YAAaO,CAAAA,SAAUa,CAAAA,SAAnC,GAA+CC,QAAQ,EAAG;AAExD,SAAO,IAAKb,CAAAA,OAAQS,CAAAA,MAApB;AAFwD,CAA1D;AAUApB,IAAKE,CAAAA,MAAOC,CAAAA,YAAaO,CAAAA,SAAUe,CAAAA,QAAnC,GAA8CC,QAAQ,EAAG;AAEvD,SAAO,IAAKf,CAAAA,OAAZ;AAFuD,CAAzD;;",
6
+ "sources":["goog/string/stringbuffer.js"],
7
+ "sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utility for fast string concatenation.\n */\n\ngoog.provide('goog.string.StringBuffer');\n\n\n\n/**\n * Utility class to facilitate string concatenation.\n *\n * @param {*=} opt_a1 Optional first initial item to append.\n * @param {...*} var_args Other initial items to\n * append, e.g., new goog.string.StringBuffer('foo', 'bar').\n * @constructor\n */\ngoog.string.StringBuffer = function(opt_a1, var_args) {\n 'use strict';\n if (opt_a1 != null) {\n this.append.apply(this, arguments);\n }\n};\n\n\n/**\n * Internal buffer for the string to be concatenated.\n * @type {string}\n * @private\n */\ngoog.string.StringBuffer.prototype.buffer_ = '';\n\n\n/**\n * Sets the contents of the string buffer object, replacing what's currently\n * there.\n *\n * @param {*} s String to set.\n */\ngoog.string.StringBuffer.prototype.set = function(s) {\n 'use strict';\n this.buffer_ = '' + s;\n};\n\n\n/**\n * Appends one or more items to the buffer.\n *\n * Calling this with null, undefined, or empty arguments is an error.\n *\n * @param {*} a1 Required first string.\n * @param {*=} opt_a2 Optional second string.\n * @param {...?} var_args Other items to append,\n * e.g., sb.append('foo', 'bar', 'baz').\n * @return {!goog.string.StringBuffer} This same StringBuffer object.\n * @suppress {duplicate}\n */\ngoog.string.StringBuffer.prototype.append = function(a1, opt_a2, var_args) {\n 'use strict';\n // Use a1 directly to avoid arguments instantiation for single-arg case.\n this.buffer_ += String(a1);\n if (opt_a2 != null) { // second argument is undefined (null == undefined)\n for (let i = 1; i < arguments.length; i++) {\n this.buffer_ += arguments[i];\n }\n }\n return this;\n};\n\n\n/**\n * Clears the internal buffer.\n */\ngoog.string.StringBuffer.prototype.clear = function() {\n 'use strict';\n this.buffer_ = '';\n};\n\n\n/**\n * @return {number} the length of the current contents of the buffer.\n */\ngoog.string.StringBuffer.prototype.getLength = function() {\n 'use strict';\n return this.buffer_.length;\n};\n\n\n/**\n * @return {string} The concatenated string.\n * @override\n */\ngoog.string.StringBuffer.prototype.toString = function() {\n 'use strict';\n return this.buffer_;\n};\n"],
8
+ "names":["goog","provide","string","StringBuffer","goog.string.StringBuffer","opt_a1","var_args","append","apply","arguments","prototype","buffer_","set","goog.string.StringBuffer.prototype.set","s","goog.string.StringBuffer.prototype.append","a1","opt_a2","String","i","length","clear","goog.string.StringBuffer.prototype.clear","getLength","goog.string.StringBuffer.prototype.getLength","toString","goog.string.StringBuffer.prototype.toString"]
9
+ }
@@ -0,0 +1,74 @@
1
+ import "./cljs_env.js";
2
+ goog.provide("goog.string.format");
3
+ goog.require("goog.string");
4
+ goog.string.format = function(formatString, var_args) {
5
+ const args = Array.prototype.slice.call(arguments);
6
+ const template = args.shift();
7
+ if (typeof template == "undefined") {
8
+ throw new Error("[goog.string.format] Template required");
9
+ }
10
+ const formatRe = /%([0\- \+]*)(\d+)?(\.(\d+))?([%sfdiu])/g;
11
+ function replacerDemuxer(match, flags, width, dotp, precision, type, offset, wholeString) {
12
+ if (type == "%") {
13
+ return "%";
14
+ }
15
+ const value = args.shift();
16
+ if (typeof value == "undefined") {
17
+ throw new Error("[goog.string.format] Not enough arguments");
18
+ }
19
+ arguments[0] = value;
20
+ return goog.string.format.demuxes_[type].apply(null, arguments);
21
+ }
22
+ return template.replace(formatRe, replacerDemuxer);
23
+ };
24
+ goog.string.format.demuxes_ = {};
25
+ goog.string.format.demuxes_["s"] = function(value, flags, width, dotp, precision, type, offset, wholeString) {
26
+ let replacement = value;
27
+ if (isNaN(width) || width == "" || replacement.length >= Number(width)) {
28
+ return replacement;
29
+ }
30
+ if (flags.indexOf("-", 0) > -1) {
31
+ replacement = replacement + goog.string.repeat(" ", Number(width) - replacement.length);
32
+ } else {
33
+ replacement = goog.string.repeat(" ", Number(width) - replacement.length) + replacement;
34
+ }
35
+ return replacement;
36
+ };
37
+ goog.string.format.demuxes_["f"] = function(value, flags, width, dotp, precision, type, offset, wholeString) {
38
+ let replacement = value.toString();
39
+ if (!(isNaN(precision) || precision == "")) {
40
+ replacement = parseFloat(value).toFixed(precision);
41
+ }
42
+ let sign;
43
+ if (Number(value) < 0) {
44
+ sign = "-";
45
+ } else if (flags.indexOf("+") >= 0) {
46
+ sign = "+";
47
+ } else if (flags.indexOf(" ") >= 0) {
48
+ sign = " ";
49
+ } else {
50
+ sign = "";
51
+ }
52
+ if (Number(value) >= 0) {
53
+ replacement = sign + replacement;
54
+ }
55
+ if (isNaN(width) || replacement.length >= Number(width)) {
56
+ return replacement;
57
+ }
58
+ replacement = isNaN(precision) ? Math.abs(Number(value)).toString() : Math.abs(Number(value)).toFixed(precision);
59
+ const padCount = Number(width) - replacement.length - sign.length;
60
+ if (flags.indexOf("-", 0) >= 0) {
61
+ replacement = sign + replacement + goog.string.repeat(" ", padCount);
62
+ } else {
63
+ const paddingChar = flags.indexOf("0", 0) >= 0 ? "0" : " ";
64
+ replacement = sign + goog.string.repeat(paddingChar, padCount) + replacement;
65
+ }
66
+ return replacement;
67
+ };
68
+ goog.string.format.demuxes_["d"] = function(value, flags, width, dotp, precision, type, offset, wholeString) {
69
+ return goog.string.format.demuxes_["f"](parseInt(value, 10), flags, width, dotp, 0, type, offset, wholeString);
70
+ };
71
+ goog.string.format.demuxes_["i"] = goog.string.format.demuxes_["d"];
72
+ goog.string.format.demuxes_["u"] = goog.string.format.demuxes_["d"];
73
+
74
+ //# sourceMappingURL=goog.string.stringformat.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version":3,
3
+ "file":"goog.string.stringformat.js",
4
+ "lineCount":72,
5
+ "mappings":"AAgBAA,IAAKC,CAAAA,OAAL,CAAa,oBAAb,CAAA;AAEAD,IAAKE,CAAAA,OAAL,CAAa,aAAb,CAAA;AAcAF,IAAKG,CAAAA,MAAOC,CAAAA,MAAZ,GAAqBC,QAAQ,CAACC,YAAD,EAAeC,QAAf,CAAyB;AAGpD,QAAMC,OAAOC,KAAMC,CAAAA,SAAUC,CAAAA,KAAMC,CAAAA,IAAtB,CAA2BC,SAA3B,CAAb;AAGA,QAAMC,WAAWN,IAAKO,CAAAA,KAAL,EAAjB;AACA,MAAI,MAAOD,SAAX,IAAuB,WAAvB;AACE,UAAM,IAAIE,KAAJ,CAAU,wCAAV,CAAN;AADF;AAKA,QAAMC,WAAW,yCAAjB;AAeAC,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C,EACkD,CADlD,EAEHE,IAFG,EAEGC,MAFH,EAEWC,WAFX,CAAP;AAFmE,CADrE;AAUA1B,IAAKG,CAAAA,MAAOC,CAAAA,MAAOwB,CAAAA,QAAnB,CAA4B,GAA5B,CAAA,GAAmC5B,IAAKG,CAAAA,MAAOC,CAAAA,MAAOwB,CAAAA,QAAnB,CAA4B,GAA5B,CAAnC;AACA5B,IAAKG,CAAAA,MAAOC,CAAAA,MAAOwB,CAAAA,QAAnB,CAA4B,GAA5B,CAAA,GAAmC5B,IAAKG,CAAAA,MAAOC,CAAAA,MAAOwB,CAAAA,QAAnB,CAA4B,GAA5B,CAAnC;;",
6
+ "sources":["goog/string/stringformat.js"],
7
+ "sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Implementation of sprintf-like, python-%-operator-like,\n * .NET-String.Format-like functionality. Uses JS string's replace method to\n * extract format specifiers and sends those specifiers to a handler function,\n * which then, based on conversion type part of the specifier, calls the\n * appropriate function to handle the specific conversion.\n * For specific functionality implemented, look at formatRe below, or look\n * at the tests.\n */\n\ngoog.provide('goog.string.format');\n\ngoog.require('goog.string');\n\n\n// TODO(johnlenz): goog.string.format should not accept undefined as a parameter\n/**\n * Performs sprintf-like conversion, i.e. puts the values in a template.\n * DO NOT use it instead of built-in conversions in simple cases such as\n * 'Cost: %.2f' as it would introduce unnecessary latency opposed to\n * 'Cost: ' + cost.toFixed(2).\n * @param {string} formatString Template string containing % specifiers.\n * @param {...(string|number|undefined)} var_args Values formatString is to\n * be filled with.\n * @return {string} Formatted string.\n */\ngoog.string.format = function(formatString, var_args) {\n 'use strict';\n // Convert the arguments to an array (MDC recommended way).\n const args = Array.prototype.slice.call(arguments);\n\n // Try to get the template.\n const template = args.shift();\n if (typeof template == 'undefined') {\n throw new Error('[goog.string.format] Template required');\n }\n\n // This re is used for matching, it also defines what is supported.\n const formatRe = /%([0\\-\\ \\+]*)(\\d+)?(\\.(\\d+))?([%sfdiu])/g;\n\n /**\n * Chooses which conversion function to call based on type conversion\n * specifier.\n * @param {string} match Contains the re matched string.\n * @param {string} flags Formatting flags.\n * @param {string} width Replacement string minimum width.\n * @param {string} dotp Matched precision including a dot.\n * @param {string} precision Specifies floating point precision.\n * @param {string} type Type conversion specifier.\n * @param {string} offset Matching location in the original string.\n * @param {string} wholeString Has the actualString being searched.\n * @return {string} Formatted parameter.\n */\n function replacerDemuxer(\n match, flags, width, dotp, precision, type, offset, wholeString) {\n // The % is too simple and doesn't take an argument.\n if (type == '%') {\n return '%';\n }\n\n // Try to get the actual value from parent function.\n const value = args.shift();\n\n // If we didn't get any arguments, fail.\n if (typeof value == 'undefined') {\n throw new Error('[goog.string.format] Not enough arguments');\n }\n\n // Patch the value argument to the beginning of our type specific call.\n arguments[0] = value;\n\n return goog.string.format.demuxes_[type].apply(null, arguments);\n }\n\n return template.replace(formatRe, replacerDemuxer);\n};\n\n\n/**\n * Contains various conversion functions (to be filled in later on).\n * @private {!Object}\n */\ngoog.string.format.demuxes_ = {};\n\n\n/**\n * Processes %s conversion specifier.\n * @param {string} value Contains the formatRe matched string.\n * @param {string} flags Formatting flags.\n * @param {string} width Replacement string minimum width.\n * @param {string} dotp Matched precision including a dot.\n * @param {string} precision Specifies floating point precision.\n * @param {string} type Type conversion specifier.\n * @param {string} offset Matching location in the original string.\n * @param {string} wholeString Has the actualString being searched.\n * @return {string} Replacement string.\n */\ngoog.string.format.demuxes_['s'] = function(\n value, flags, width, dotp, precision, type, offset, wholeString) {\n 'use strict';\n let replacement = value;\n // If no padding is necessary we're done.\n // The check for '' is necessary because Firefox incorrectly provides the\n // empty string instead of undefined for non-participating capture groups,\n // and isNaN('') == false.\n if (isNaN(width) || width == '' || replacement.length >= Number(width)) {\n return replacement;\n }\n\n // Otherwise we should find out where to put spaces.\n if (flags.indexOf('-', 0) > -1) {\n replacement = replacement +\n goog.string.repeat(' ', Number(width) - replacement.length);\n } else {\n replacement = goog.string.repeat(' ', Number(width) - replacement.length) +\n replacement;\n }\n return replacement;\n};\n\n\n/**\n * Processes %f conversion specifier.\n * @param {string} value Contains the formatRe matched string.\n * @param {string} flags Formatting flags.\n * @param {string} width Replacement string minimum width.\n * @param {string} dotp Matched precision including a dot.\n * @param {string} precision Specifies floating point precision.\n * @param {string} type Type conversion specifier.\n * @param {string} offset Matching location in the original string.\n * @param {string} wholeString Has the actualString being searched.\n * @return {string} Replacement string.\n */\ngoog.string.format.demuxes_['f'] = function(\n value, flags, width, dotp, precision, type, offset, wholeString) {\n 'use strict';\n let replacement = value.toString();\n\n // The check for '' is necessary because Firefox incorrectly provides the\n // empty string instead of undefined for non-participating capture groups,\n // and isNaN('') == false.\n if (!(isNaN(precision) || precision == '')) {\n replacement = parseFloat(value).toFixed(precision);\n }\n\n // Generates sign string that will be attached to the replacement.\n let sign;\n if (Number(value) < 0) {\n sign = '-';\n } else if (flags.indexOf('+') >= 0) {\n sign = '+';\n } else if (flags.indexOf(' ') >= 0) {\n sign = ' ';\n } else {\n sign = '';\n }\n\n if (Number(value) >= 0) {\n replacement = sign + replacement;\n }\n\n // If no padding is necessary we're done.\n if (isNaN(width) || replacement.length >= Number(width)) {\n return replacement;\n }\n\n // We need a clean signless replacement to start with\n replacement = isNaN(precision) ? Math.abs(Number(value)).toString() :\n Math.abs(Number(value)).toFixed(precision);\n\n const padCount = Number(width) - replacement.length - sign.length;\n\n // Find out which side to pad, and if it's left side, then which character to\n // pad, and set the sign on the left and padding in the middle.\n if (flags.indexOf('-', 0) >= 0) {\n replacement = sign + replacement + goog.string.repeat(' ', padCount);\n } else {\n // Decides which character to pad.\n const paddingChar = (flags.indexOf('0', 0) >= 0) ? '0' : ' ';\n replacement =\n sign + goog.string.repeat(paddingChar, padCount) + replacement;\n }\n\n return replacement;\n};\n\n\n/**\n * Processes %d conversion specifier.\n * @param {string} value Contains the formatRe matched string.\n * @param {string} flags Formatting flags.\n * @param {string} width Replacement string minimum width.\n * @param {string} dotp Matched precision including a dot.\n * @param {string} precision Specifies floating point precision.\n * @param {string} type Type conversion specifier.\n * @param {string} offset Matching location in the original string.\n * @param {string} wholeString Has the actualString being searched.\n * @return {string} Replacement string.\n */\ngoog.string.format.demuxes_['d'] = function(\n value, flags, width, dotp, precision, type, offset, wholeString) {\n 'use strict';\n return goog.string.format.demuxes_['f'](\n parseInt(value, 10) /* value */, flags, width, dotp, 0 /* precision */,\n type, offset, wholeString);\n};\n\n\n// These are additional aliases, for integer conversion.\ngoog.string.format.demuxes_['i'] = goog.string.format.demuxes_['d'];\ngoog.string.format.demuxes_['u'] = goog.string.format.demuxes_['d'];\n"],
8
+ "names":["goog","provide","require","string","format","goog.string.format","formatString","var_args","args","Array","prototype","slice","call","arguments","template","shift","Error","formatRe","replacerDemuxer","match","flags","width","dotp","precision","type","offset","wholeString","value","demuxes_","apply","replace","replacement","isNaN","length","Number","indexOf","repeat","toString","parseFloat","toFixed","sign","Math","abs","padCount","paddingChar","parseInt"]
9
+ }
@@ -0,0 +1,8 @@
1
+ import "./cljs_env.js";
2
+ goog.provide("goog.string.TypedString");
3
+ goog.string.TypedString = function() {
4
+ };
5
+ goog.string.TypedString.prototype.implementsGoogStringTypedString;
6
+ goog.string.TypedString.prototype.getTypedStringValue;
7
+
8
+ //# sourceMappingURL=goog.string.typedstring.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version":3,
3
+ "file":"goog.string.typedstring.js",
4
+ "lineCount":6,
5
+ "mappings":"AAMAA,IAAKC,CAAAA,OAAL,CAAa,yBAAb,CAAA;AAeAD,IAAKE,CAAAA,MAAOC,CAAAA,WAAZ,GAA0BC,QAAQ,EAAG;CAArC;AAWAJ,IAAKE,CAAAA,MAAOC,CAAAA,WAAYE,CAAAA,SAAUC,CAAAA,+BAAlC;AAOAN,IAAKE,CAAAA,MAAOC,CAAAA,WAAYE,CAAAA,SAAUE,CAAAA,mBAAlC;;",
6
+ "sources":["goog/string/typedstring.js"],
7
+ "sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.provide('goog.string.TypedString');\n\n\n\n/**\n * Wrapper for strings that conform to a data type or language.\n *\n * Implementations of this interface are wrappers for strings, and typically\n * associate a type contract with the wrapped string. Concrete implementations\n * of this interface may choose to implement additional run-time type checking,\n * see for example `goog.html.SafeHtml`. If available, client code that\n * needs to ensure type membership of an object should use the type's function\n * to assert type membership, such as `goog.html.SafeHtml.unwrap`.\n * @interface\n */\ngoog.string.TypedString = function() {};\n\n\n/**\n * Interface marker of the TypedString interface.\n *\n * This property can be used to determine at runtime whether or not an object\n * implements this interface. All implementations of this interface set this\n * property to `true`.\n * @type {boolean}\n */\ngoog.string.TypedString.prototype.implementsGoogStringTypedString;\n\n\n/**\n * Retrieves this wrapped string's value.\n * @return {string} The wrapped string's value.\n */\ngoog.string.TypedString.prototype.getTypedStringValue;\n"],
8
+ "names":["goog","provide","string","TypedString","goog.string.TypedString","prototype","implementsGoogStringTypedString","getTypedStringValue"]
9
+ }
@@ -0,0 +1,188 @@
1
+ import "./cljs_env.js";
2
+ goog.provide("goog.structs");
3
+ goog.require("goog.array");
4
+ goog.require("goog.object");
5
+ goog.structs.getCount = function(col) {
6
+ if (col.getCount && typeof col.getCount == "function") {
7
+ return col.getCount();
8
+ }
9
+ if (goog.isArrayLike(col) || typeof col === "string") {
10
+ return col.length;
11
+ }
12
+ return goog.object.getCount(col);
13
+ };
14
+ goog.structs.getValues = function(col) {
15
+ if (col.getValues && typeof col.getValues == "function") {
16
+ return col.getValues();
17
+ }
18
+ if (typeof Map !== "undefined" && col instanceof Map || typeof Set !== "undefined" && col instanceof Set) {
19
+ return Array.from(col.values());
20
+ }
21
+ if (typeof col === "string") {
22
+ return col.split("");
23
+ }
24
+ if (goog.isArrayLike(col)) {
25
+ var rv = [];
26
+ var l = col.length;
27
+ for (var i = 0; i < l; i++) {
28
+ rv.push(col[i]);
29
+ }
30
+ return rv;
31
+ }
32
+ return goog.object.getValues(col);
33
+ };
34
+ goog.structs.getKeys = function(col) {
35
+ if (col.getKeys && typeof col.getKeys == "function") {
36
+ return col.getKeys();
37
+ }
38
+ if (col.getValues && typeof col.getValues == "function") {
39
+ return undefined;
40
+ }
41
+ if (typeof Map !== "undefined" && col instanceof Map) {
42
+ return Array.from(col.keys());
43
+ }
44
+ if (typeof Set !== "undefined" && col instanceof Set) {
45
+ return undefined;
46
+ }
47
+ if (goog.isArrayLike(col) || typeof col === "string") {
48
+ var rv = [];
49
+ var l = col.length;
50
+ for (var i = 0; i < l; i++) {
51
+ rv.push(i);
52
+ }
53
+ return rv;
54
+ }
55
+ return goog.object.getKeys(col);
56
+ };
57
+ goog.structs.contains = function(col, val) {
58
+ if (col.contains && typeof col.contains == "function") {
59
+ return col.contains(val);
60
+ }
61
+ if (col.containsValue && typeof col.containsValue == "function") {
62
+ return col.containsValue(val);
63
+ }
64
+ if (goog.isArrayLike(col) || typeof col === "string") {
65
+ return goog.array.contains(col, val);
66
+ }
67
+ return goog.object.containsValue(col, val);
68
+ };
69
+ goog.structs.isEmpty = function(col) {
70
+ if (col.isEmpty && typeof col.isEmpty == "function") {
71
+ return col.isEmpty();
72
+ }
73
+ if (goog.isArrayLike(col) || typeof col === "string") {
74
+ return col.length === 0;
75
+ }
76
+ return goog.object.isEmpty(col);
77
+ };
78
+ goog.structs.clear = function(col) {
79
+ if (col.clear && typeof col.clear == "function") {
80
+ col.clear();
81
+ } else if (goog.isArrayLike(col)) {
82
+ goog.array.clear(col);
83
+ } else {
84
+ goog.object.clear(col);
85
+ }
86
+ };
87
+ goog.structs.forEach = function(col, f, opt_obj) {
88
+ if (col.forEach && typeof col.forEach == "function") {
89
+ col.forEach(f, opt_obj);
90
+ } else if (goog.isArrayLike(col) || typeof col === "string") {
91
+ Array.prototype.forEach.call(col, f, opt_obj);
92
+ } else {
93
+ var keys = goog.structs.getKeys(col);
94
+ var values = goog.structs.getValues(col);
95
+ var l = values.length;
96
+ for (var i = 0; i < l; i++) {
97
+ f.call(opt_obj, values[i], keys && keys[i], col);
98
+ }
99
+ }
100
+ };
101
+ goog.structs.filter = function(col, f, opt_obj) {
102
+ if (typeof col.filter == "function") {
103
+ return col.filter(f, opt_obj);
104
+ }
105
+ if (goog.isArrayLike(col) || typeof col === "string") {
106
+ return Array.prototype.filter.call(col, f, opt_obj);
107
+ }
108
+ var rv;
109
+ var keys = goog.structs.getKeys(col);
110
+ var values = goog.structs.getValues(col);
111
+ var l = values.length;
112
+ if (keys) {
113
+ rv = {};
114
+ for (var i = 0; i < l; i++) {
115
+ if (f.call(opt_obj, values[i], keys[i], col)) {
116
+ rv[keys[i]] = values[i];
117
+ }
118
+ }
119
+ } else {
120
+ rv = [];
121
+ for (var i = 0; i < l; i++) {
122
+ if (f.call(opt_obj, values[i], undefined, col)) {
123
+ rv.push(values[i]);
124
+ }
125
+ }
126
+ }
127
+ return rv;
128
+ };
129
+ goog.structs.map = function(col, f, opt_obj) {
130
+ if (typeof col.map == "function") {
131
+ return col.map(f, opt_obj);
132
+ }
133
+ if (goog.isArrayLike(col) || typeof col === "string") {
134
+ return Array.prototype.map.call(col, f, opt_obj);
135
+ }
136
+ var rv;
137
+ var keys = goog.structs.getKeys(col);
138
+ var values = goog.structs.getValues(col);
139
+ var l = values.length;
140
+ if (keys) {
141
+ rv = {};
142
+ for (var i = 0; i < l; i++) {
143
+ rv[keys[i]] = f.call(opt_obj, values[i], keys[i], col);
144
+ }
145
+ } else {
146
+ rv = [];
147
+ for (var i = 0; i < l; i++) {
148
+ rv[i] = f.call(opt_obj, values[i], undefined, col);
149
+ }
150
+ }
151
+ return rv;
152
+ };
153
+ goog.structs.some = function(col, f, opt_obj) {
154
+ if (typeof col.some == "function") {
155
+ return col.some(f, opt_obj);
156
+ }
157
+ if (goog.isArrayLike(col) || typeof col === "string") {
158
+ return Array.prototype.some.call(col, f, opt_obj);
159
+ }
160
+ var keys = goog.structs.getKeys(col);
161
+ var values = goog.structs.getValues(col);
162
+ var l = values.length;
163
+ for (var i = 0; i < l; i++) {
164
+ if (f.call(opt_obj, values[i], keys && keys[i], col)) {
165
+ return true;
166
+ }
167
+ }
168
+ return false;
169
+ };
170
+ goog.structs.every = function(col, f, opt_obj) {
171
+ if (typeof col.every == "function") {
172
+ return col.every(f, opt_obj);
173
+ }
174
+ if (goog.isArrayLike(col) || typeof col === "string") {
175
+ return Array.prototype.every.call(col, f, opt_obj);
176
+ }
177
+ var keys = goog.structs.getKeys(col);
178
+ var values = goog.structs.getValues(col);
179
+ var l = values.length;
180
+ for (var i = 0; i < l; i++) {
181
+ if (!f.call(opt_obj, values[i], keys && keys[i], col)) {
182
+ return false;
183
+ }
184
+ }
185
+ return true;
186
+ };
187
+
188
+ //# sourceMappingURL=goog.structs.structs.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version":3,
3
+ "file":"goog.structs.structs.js",
4
+ "lineCount":186,
5
+ "mappings":"AAiBAA,IAAKC,CAAAA,OAAL,CAAa,cAAb,CAAA;AAEAD,IAAKE,CAAAA,OAAL,CAAa,YAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,aAAb,CAAA;AAYAF,IAAKG,CAAAA,OAAQC,CAAAA,QAAb,GAAwBC,QAAQ,CAACC,GAAD,CAAM;AAEpC,MAAIA,GAAIF,CAAAA,QAAR,IAAoB,MAAOE,IAAIF,CAAAA,QAA/B,IAA2C,UAA3C;AACE,WAAOE,GAAIF,CAAAA,QAAJ,EAAP;AADF;AAGA,MAAIJ,IAAKO,CAAAA,WAAL,CAAiBD,GAAjB,CAAJ,IAA6B,MAAOA,IAApC,KAA4C,QAA5C;AACE,WAAOA,GAAIE,CAAAA,MAAX;AADF;AAGA,SAAOR,IAAKS,CAAAA,MAAOL,CAAAA,QAAZ,CAAqBE,GAArB,CAAP;AARoC,CAAtC;AAiBAN,IAAKG,CAAAA,OAAQO,CAAAA,SAAb,GAAyBC,QAAQ,CAACL,GAAD,CAAM;AAErC,MAAIA,GAAII,CAAAA,SAAR,IAAqB,MAAOJ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CAApB,EAAuBC,CAAA,EAAvB;AACE,QAAI,CAACiB,CAAEG,CAAAA,IAAF,CAAyBF,OAAzB,EAAmCtB,MAAA,CAAOI,CAAP,CAAnC,EAA8CK,IAA9C,IAAsDA,IAAA,CAAKL,CAAL,CAAtD,EAA+Dd,GAA/D,CAAL;AACE,aAAO,KAAP;AADF;AADF;AAKA,SAAO,IAAP;AAjB6C,CAA/C;;",
6
+ "sources":["goog/structs/structs.js"],
7
+ "sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Generics method for collection-like classes and objects.\n *\n *\n * This file contains functions to work with collections. It supports using\n * Map, Set, Array and Object and other classes that implement collection-like\n * methods.\n * @suppress {strictMissingProperties}\n */\n\n\ngoog.provide('goog.structs');\n\ngoog.require('goog.array');\ngoog.require('goog.object');\n\n\n// We treat an object as a dictionary if it has getKeys or it is an object that\n// isn't arrayLike.\n\n\n/**\n * Returns the number of values in the collection-like object.\n * @param {Object} col The collection-like object.\n * @return {number} The number of values in the collection-like object.\n */\ngoog.structs.getCount = function(col) {\n 'use strict';\n if (col.getCount && typeof col.getCount == 'function') {\n return col.getCount();\n }\n if (goog.isArrayLike(col) || typeof col === 'string') {\n return col.length;\n }\n return goog.object.getCount(col);\n};\n\n\n/**\n * Returns the values of the collection-like object.\n * @param {Object} col The collection-like object.\n * @return {!Array<?>} The values in the collection-like object.\n */\ngoog.structs.getValues = function(col) {\n 'use strict';\n if (col.getValues && typeof col.getValues == 'function') {\n return col.getValues();\n }\n // ES6 Map and Set both define a values function that returns an iterator.\n // The typeof check allows the compiler to remove the Map and Set polyfills\n // if they are otherwise unused throughout the entire binary.\n if ((typeof Map !== 'undefined' && col instanceof Map) ||\n (typeof Set !== 'undefined' && col instanceof Set)) {\n return Array.from(col.values());\n }\n if (typeof col === 'string') {\n return col.split('');\n }\n if (goog.isArrayLike(col)) {\n var rv = [];\n var l = col.length;\n for (var i = 0; i < l; i++) {\n rv.push(col[i]);\n }\n return rv;\n }\n return goog.object.getValues(col);\n};\n\n\n/**\n * Returns the keys of the collection. Some collections have no notion of\n * keys/indexes and this function will return undefined in those cases.\n * @param {Object} col The collection-like object.\n * @return {!Array|undefined} The keys in the collection.\n */\ngoog.structs.getKeys = function(col) {\n 'use strict';\n if (col.getKeys && typeof col.getKeys == 'function') {\n return col.getKeys();\n }\n // if we have getValues but no getKeys we know this is a key-less collection\n if (col.getValues && typeof col.getValues == 'function') {\n return undefined;\n }\n // ES6 Map and Set both define a keys function that returns an iterator. For\n // Sets this iterates over the same values as the values iterator.\n // The typeof check allows the compiler to remove the Map and Set polyfills\n // if they are otherwise unused throughout the entire binary.\n if (typeof Map !== 'undefined' && col instanceof Map) {\n return Array.from(col.keys());\n }\n // Unlike the native Set, goog.structs.Set does not expose keys as the values.\n if (typeof Set !== 'undefined' && col instanceof Set) {\n return undefined;\n }\n if (goog.isArrayLike(col) || typeof col === 'string') {\n var rv = [];\n var l = col.length;\n for (var i = 0; i < l; i++) {\n rv.push(i);\n }\n return rv;\n }\n\n return goog.object.getKeys(col);\n};\n\n\n/**\n * Whether the collection contains the given value. This is O(n) and uses\n * equals (==) to test the existence.\n * @param {Object} col The collection-like object.\n * @param {*} val The value to check for.\n * @return {boolean} True if the map contains the value.\n */\ngoog.structs.contains = function(col, val) {\n 'use strict';\n if (col.contains && typeof col.contains == 'function') {\n return col.contains(val);\n }\n if (col.containsValue && typeof col.containsValue == 'function') {\n return col.containsValue(val);\n }\n if (goog.isArrayLike(col) || typeof col === 'string') {\n return goog.array.contains(/** @type {!Array<?>} */ (col), val);\n }\n return goog.object.containsValue(col, val);\n};\n\n\n/**\n * Whether the collection is empty.\n * @param {Object} col The collection-like object.\n * @return {boolean} True if empty.\n */\ngoog.structs.isEmpty = function(col) {\n 'use strict';\n if (col.isEmpty && typeof col.isEmpty == 'function') {\n return col.isEmpty();\n }\n\n // We do not use goog.string.isEmptyOrWhitespace because here we treat the\n // string as\n // collection and as such even whitespace matters\n\n if (goog.isArrayLike(col) || typeof col === 'string') {\n return /** @type {!Array<?>} */ (col).length === 0;\n }\n return goog.object.isEmpty(col);\n};\n\n\n/**\n * Removes all the elements from the collection.\n * @param {Object} col The collection-like object.\n * @return {void}\n */\ngoog.structs.clear = function(col) {\n 'use strict';\n // NOTE(arv): This should not contain strings because strings are immutable\n if (col.clear && typeof col.clear == 'function') {\n col.clear();\n } else if (goog.isArrayLike(col)) {\n goog.array.clear(/** @type {IArrayLike<?>} */ (col));\n } else {\n goog.object.clear(col);\n }\n};\n\n\n/**\n * Calls a function for each value in a collection. The function takes\n * three arguments; the value, the key and the collection.\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):?} f The function to call for every value.\n * This function takes\n * 3 arguments (the value, the key or undefined if the collection has no\n * notion of keys, and the collection) and the return value is irrelevant.\n * @param {T=} opt_obj The object to be used as the value of 'this'\n * within `f`.\n * @return {void}\n * @template T,S\n * @deprecated Use a more specific method, e.g. native Array.prototype.forEach,\n * or for-of.\n */\ngoog.structs.forEach = function(col, f, opt_obj) {\n 'use strict';\n if (col.forEach && typeof col.forEach == 'function') {\n col.forEach(f, opt_obj);\n } else if (goog.isArrayLike(col) || typeof col === 'string') {\n Array.prototype.forEach.call(/** @type {!Array<?>} */ (col), f, opt_obj);\n } else {\n var keys = goog.structs.getKeys(col);\n var values = goog.structs.getValues(col);\n var l = values.length;\n for (var i = 0; i < l; i++) {\n f.call(/** @type {?} */ (opt_obj), values[i], keys && keys[i], col);\n }\n }\n};\n\n\n/**\n * Calls a function for every value in the collection. When a call returns true,\n * adds the value to a new collection (Array is returned by default).\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):boolean} f The function to call for every\n * value. This function takes\n * 3 arguments (the value, the key or undefined if the collection has no\n * notion of keys, and the collection) and should return a Boolean. If the\n * return value is true the value is added to the result collection. If it\n * is false the value is not included.\n * @param {T=} opt_obj The object to be used as the value of 'this'\n * within `f`.\n * @return {!Object|!Array<?>} A new collection where the passed values are\n * present. If col is a key-less collection an array is returned. If col\n * has keys and values a plain old JS object is returned.\n * @template T,S\n */\ngoog.structs.filter = function(col, f, opt_obj) {\n 'use strict';\n if (typeof col.filter == 'function') {\n return col.filter(f, opt_obj);\n }\n if (goog.isArrayLike(col) || typeof col === 'string') {\n return Array.prototype.filter.call(\n /** @type {!Array<?>} */ (col), f, opt_obj);\n }\n\n var rv;\n var keys = goog.structs.getKeys(col);\n var values = goog.structs.getValues(col);\n var l = values.length;\n if (keys) {\n rv = {};\n for (var i = 0; i < l; i++) {\n if (f.call(/** @type {?} */ (opt_obj), values[i], keys[i], col)) {\n rv[keys[i]] = values[i];\n }\n }\n } else {\n // We should not use Array#filter here since we want to make sure that\n // the index is undefined as well as make sure that col is passed to the\n // function.\n rv = [];\n for (var i = 0; i < l; i++) {\n if (f.call(opt_obj, values[i], undefined, col)) {\n rv.push(values[i]);\n }\n }\n }\n return rv;\n};\n\n\n/**\n * Calls a function for every value in the collection and adds the result into a\n * new collection (defaults to creating a new Array).\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):V} f The function to call for every value.\n * This function takes 3 arguments (the value, the key or undefined if the\n * collection has no notion of keys, and the collection) and should return\n * something. The result will be used as the value in the new collection.\n * @param {T=} opt_obj The object to be used as the value of 'this'\n * within `f`.\n * @return {!Object<V>|!Array<V>} A new collection with the new values. If\n * col is a key-less collection an array is returned. If col has keys and\n * values a plain old JS object is returned.\n * @template T,S,V\n */\ngoog.structs.map = function(col, f, opt_obj) {\n 'use strict';\n if (typeof col.map == 'function') {\n return col.map(f, opt_obj);\n }\n if (goog.isArrayLike(col) || typeof col === 'string') {\n return Array.prototype.map.call(/** @type {!Array<?>} */ (col), f, opt_obj);\n }\n\n var rv;\n var keys = goog.structs.getKeys(col);\n var values = goog.structs.getValues(col);\n var l = values.length;\n if (keys) {\n rv = {};\n for (var i = 0; i < l; i++) {\n rv[keys[i]] = f.call(/** @type {?} */ (opt_obj), values[i], keys[i], col);\n }\n } else {\n // We should not use Array#map here since we want to make sure that\n // the index is undefined as well as make sure that col is passed to the\n // function.\n rv = [];\n for (var i = 0; i < l; i++) {\n rv[i] = f.call(/** @type {?} */ (opt_obj), values[i], undefined, col);\n }\n }\n return rv;\n};\n\n\n/**\n * Calls f for each value in a collection. If any call returns true this returns\n * true (without checking the rest). If all returns false this returns false.\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):boolean} f The function to call for every\n * value. This function takes 3 arguments (the value, the key or undefined\n * if the collection has no notion of keys, and the collection) and should\n * return a boolean.\n * @param {T=} opt_obj The object to be used as the value of 'this'\n * within `f`.\n * @return {boolean} True if any value passes the test.\n * @template T,S\n */\ngoog.structs.some = function(col, f, opt_obj) {\n 'use strict';\n if (typeof col.some == 'function') {\n return col.some(f, opt_obj);\n }\n if (goog.isArrayLike(col) || typeof col === 'string') {\n return Array.prototype.some.call(\n /** @type {!Array<?>} */ (col), f, opt_obj);\n }\n var keys = goog.structs.getKeys(col);\n var values = goog.structs.getValues(col);\n var l = values.length;\n for (var i = 0; i < l; i++) {\n if (f.call(/** @type {?} */ (opt_obj), values[i], keys && keys[i], col)) {\n return true;\n }\n }\n return false;\n};\n\n\n/**\n * Calls f for each value in a collection. If all calls return true this return\n * true this returns true. If any returns false this returns false at this point\n * and does not continue to check the remaining values.\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):boolean} f The function to call for every\n * value. This function takes 3 arguments (the value, the key or\n * undefined if the collection has no notion of keys, and the collection)\n * and should return a boolean.\n * @param {T=} opt_obj The object to be used as the value of 'this'\n * within `f`.\n * @return {boolean} True if all key-value pairs pass the test.\n * @template T,S\n */\ngoog.structs.every = function(col, f, opt_obj) {\n 'use strict';\n if (typeof col.every == 'function') {\n return col.every(f, opt_obj);\n }\n if (goog.isArrayLike(col) || typeof col === 'string') {\n return Array.prototype.every.call(\n /** @type {!Array<?>} */ (col), f, opt_obj);\n }\n var keys = goog.structs.getKeys(col);\n var values = goog.structs.getValues(col);\n var l = values.length;\n for (var i = 0; i < l; i++) {\n if (!f.call(/** @type {?} */ (opt_obj), values[i], keys && keys[i], col)) {\n return false;\n }\n }\n return true;\n};\n"],
8
+ "names":["goog","provide","require","structs","getCount","goog.structs.getCount","col","isArrayLike","length","object","getValues","goog.structs.getValues","Map","Set","Array","from","values","split","rv","l","i","push","getKeys","goog.structs.getKeys","undefined","keys","contains","goog.structs.contains","val","containsValue","array","isEmpty","goog.structs.isEmpty","clear","goog.structs.clear","forEach","goog.structs.forEach","f","opt_obj","prototype","call","filter","goog.structs.filter","map","goog.structs.map","some","goog.structs.some","every","goog.structs.every"]
9
+ }