@veritone-ce/design-system 2.9.0-next.2 → 2.9.0-next.3

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 (629) hide show
  1. package/dist/cjs/bundled_modules/d3-array/src/ascending.js +9 -0
  2. package/dist/cjs/bundled_modules/d3-array/src/bisect.js +16 -0
  3. package/dist/cjs/bundled_modules/d3-array/src/bisector.js +62 -0
  4. package/dist/cjs/bundled_modules/d3-array/src/descending.js +13 -0
  5. package/dist/cjs/bundled_modules/d3-array/src/deviation.js +12 -0
  6. package/dist/cjs/bundled_modules/d3-array/src/fsum.js +45 -0
  7. package/dist/cjs/bundled_modules/d3-array/src/intersection.js +25 -0
  8. package/dist/cjs/bundled_modules/d3-array/src/max.js +26 -0
  9. package/dist/cjs/bundled_modules/d3-array/src/mean.js +25 -0
  10. package/dist/cjs/bundled_modules/d3-array/src/median.js +11 -0
  11. package/dist/cjs/bundled_modules/d3-array/src/merge.js +15 -0
  12. package/dist/cjs/bundled_modules/d3-array/src/min.js +26 -0
  13. package/dist/cjs/bundled_modules/d3-array/src/number.js +27 -0
  14. package/dist/cjs/bundled_modules/d3-array/src/permute.js +9 -0
  15. package/dist/cjs/bundled_modules/d3-array/src/quantile.js +36 -0
  16. package/dist/cjs/bundled_modules/d3-array/src/quickselect.js +59 -0
  17. package/dist/cjs/bundled_modules/d3-array/src/range.js +19 -0
  18. package/dist/cjs/bundled_modules/d3-array/src/sort.js +20 -0
  19. package/dist/cjs/bundled_modules/d3-array/src/sum.js +17 -0
  20. package/dist/cjs/bundled_modules/d3-array/src/ticks.js +63 -0
  21. package/dist/cjs/bundled_modules/d3-array/src/union.js +17 -0
  22. package/dist/cjs/bundled_modules/d3-array/src/variance.js +31 -0
  23. package/dist/cjs/bundled_modules/d3-color/src/color.js +410 -0
  24. package/dist/cjs/bundled_modules/d3-color/src/cubehelix.js +68 -0
  25. package/dist/cjs/bundled_modules/d3-color/src/define.js +17 -0
  26. package/dist/cjs/bundled_modules/d3-color/src/lab.js +124 -0
  27. package/dist/cjs/bundled_modules/d3-color/src/math.js +7 -0
  28. package/dist/cjs/bundled_modules/d3-delaunay/src/delaunay.js +254 -0
  29. package/dist/cjs/bundled_modules/d3-delaunay/src/path.js +43 -0
  30. package/dist/cjs/bundled_modules/d3-delaunay/src/polygon.js +23 -0
  31. package/dist/cjs/bundled_modules/d3-delaunay/src/voronoi.js +338 -0
  32. package/dist/cjs/bundled_modules/d3-dispatch/src/dispatch.js +88 -0
  33. package/dist/cjs/bundled_modules/d3-dsv/src/dsv.js +170 -0
  34. package/dist/cjs/bundled_modules/d3-force/src/center.js +46 -0
  35. package/dist/cjs/bundled_modules/d3-force/src/collide.js +106 -0
  36. package/dist/cjs/bundled_modules/d3-force/src/constant.js +11 -0
  37. package/dist/cjs/bundled_modules/d3-force/src/jiggle.js +9 -0
  38. package/dist/cjs/bundled_modules/d3-force/src/lcg.js +15 -0
  39. package/dist/cjs/bundled_modules/d3-force/src/link.js +123 -0
  40. package/dist/cjs/bundled_modules/d3-force/src/manyBody.js +122 -0
  41. package/dist/cjs/bundled_modules/d3-force/src/simulation.js +164 -0
  42. package/dist/cjs/bundled_modules/d3-force/src/x.js +47 -0
  43. package/dist/cjs/bundled_modules/d3-force/src/y.js +47 -0
  44. package/dist/cjs/bundled_modules/d3-format/src/defaultLocale.js +24 -0
  45. package/dist/cjs/bundled_modules/d3-format/src/exponent.js +11 -0
  46. package/dist/cjs/bundled_modules/d3-format/src/formatDecimal.js +27 -0
  47. package/dist/cjs/bundled_modules/d3-format/src/formatGroup.js +24 -0
  48. package/dist/cjs/bundled_modules/d3-format/src/formatNumerals.js +13 -0
  49. package/dist/cjs/bundled_modules/d3-format/src/formatPrefixAuto.js +22 -0
  50. package/dist/cjs/bundled_modules/d3-format/src/formatRounded.js +17 -0
  51. package/dist/cjs/bundled_modules/d3-format/src/formatSpecifier.js +54 -0
  52. package/dist/cjs/bundled_modules/d3-format/src/formatTrim.js +17 -0
  53. package/dist/cjs/bundled_modules/d3-format/src/formatTypes.js +25 -0
  54. package/dist/cjs/bundled_modules/d3-format/src/identity.js +9 -0
  55. package/dist/cjs/bundled_modules/d3-format/src/locale.js +154 -0
  56. package/dist/cjs/bundled_modules/d3-format/src/precisionFixed.js +11 -0
  57. package/dist/cjs/bundled_modules/d3-format/src/precisionPrefix.js +11 -0
  58. package/dist/cjs/bundled_modules/d3-format/src/precisionRound.js +12 -0
  59. package/dist/cjs/bundled_modules/d3-geo/src/area.js +83 -0
  60. package/dist/cjs/bundled_modules/d3-geo/src/bounds.js +185 -0
  61. package/dist/cjs/bundled_modules/d3-geo/src/cartesian.js +43 -0
  62. package/dist/cjs/bundled_modules/d3-geo/src/centroid.js +149 -0
  63. package/dist/cjs/bundled_modules/d3-geo/src/circle.js +35 -0
  64. package/dist/cjs/bundled_modules/d3-geo/src/clip/antimeridian.js +98 -0
  65. package/dist/cjs/bundled_modules/d3-geo/src/clip/buffer.js +30 -0
  66. package/dist/cjs/bundled_modules/d3-geo/src/clip/circle.js +183 -0
  67. package/dist/cjs/bundled_modules/d3-geo/src/clip/index.js +137 -0
  68. package/dist/cjs/bundled_modules/d3-geo/src/clip/line.js +65 -0
  69. package/dist/cjs/bundled_modules/d3-geo/src/clip/rectangle.js +174 -0
  70. package/dist/cjs/bundled_modules/d3-geo/src/clip/rejoin.js +109 -0
  71. package/dist/cjs/bundled_modules/d3-geo/src/compose.js +18 -0
  72. package/dist/cjs/bundled_modules/d3-geo/src/graticule.js +107 -0
  73. package/dist/cjs/bundled_modules/d3-geo/src/identity.js +7 -0
  74. package/dist/cjs/bundled_modules/d3-geo/src/math.js +57 -0
  75. package/dist/cjs/bundled_modules/d3-geo/src/noop.js +7 -0
  76. package/dist/cjs/bundled_modules/d3-geo/src/path/area.js +54 -0
  77. package/dist/cjs/bundled_modules/d3-geo/src/path/bounds.js +32 -0
  78. package/dist/cjs/bundled_modules/d3-geo/src/path/centroid.js +104 -0
  79. package/dist/cjs/bundled_modules/d3-geo/src/path/context.js +51 -0
  80. package/dist/cjs/bundled_modules/d3-geo/src/path/index.js +82 -0
  81. package/dist/cjs/bundled_modules/d3-geo/src/path/measure.js +49 -0
  82. package/dist/cjs/bundled_modules/d3-geo/src/path/string.js +92 -0
  83. package/dist/cjs/bundled_modules/d3-geo/src/pointEqual.js +11 -0
  84. package/dist/cjs/bundled_modules/d3-geo/src/polygonContains.js +80 -0
  85. package/dist/cjs/bundled_modules/d3-geo/src/projection/albers.js +16 -0
  86. package/dist/cjs/bundled_modules/d3-geo/src/projection/albersUsa.js +117 -0
  87. package/dist/cjs/bundled_modules/d3-geo/src/projection/azimuthal.js +32 -0
  88. package/dist/cjs/bundled_modules/d3-geo/src/projection/azimuthalEqualArea.js +24 -0
  89. package/dist/cjs/bundled_modules/d3-geo/src/projection/azimuthalEquidistant.js +24 -0
  90. package/dist/cjs/bundled_modules/d3-geo/src/projection/conic.js +19 -0
  91. package/dist/cjs/bundled_modules/d3-geo/src/projection/conicConformal.js +45 -0
  92. package/dist/cjs/bundled_modules/d3-geo/src/projection/conicEqualArea.js +40 -0
  93. package/dist/cjs/bundled_modules/d3-geo/src/projection/conicEquidistant.js +39 -0
  94. package/dist/cjs/bundled_modules/d3-geo/src/projection/cylindricalEqualArea.js +19 -0
  95. package/dist/cjs/bundled_modules/d3-geo/src/projection/equalEarth.js +43 -0
  96. package/dist/cjs/bundled_modules/d3-geo/src/projection/equirectangular.js +19 -0
  97. package/dist/cjs/bundled_modules/d3-geo/src/projection/fit.js +54 -0
  98. package/dist/cjs/bundled_modules/d3-geo/src/projection/gnomonic.js +23 -0
  99. package/dist/cjs/bundled_modules/d3-geo/src/projection/identity.js +91 -0
  100. package/dist/cjs/bundled_modules/d3-geo/src/projection/index.js +184 -0
  101. package/dist/cjs/bundled_modules/d3-geo/src/projection/mercator.js +60 -0
  102. package/dist/cjs/bundled_modules/d3-geo/src/projection/naturalEarth1.js +35 -0
  103. package/dist/cjs/bundled_modules/d3-geo/src/projection/orthographic.js +22 -0
  104. package/dist/cjs/bundled_modules/d3-geo/src/projection/resample.js +108 -0
  105. package/dist/cjs/bundled_modules/d3-geo/src/projection/stereographic.js +25 -0
  106. package/dist/cjs/bundled_modules/d3-geo/src/projection/transverseMercator.js +34 -0
  107. package/dist/cjs/bundled_modules/d3-geo/src/rotation.js +86 -0
  108. package/dist/cjs/bundled_modules/d3-geo/src/stream.js +75 -0
  109. package/dist/cjs/bundled_modules/d3-geo/src/transform.js +24 -0
  110. package/dist/cjs/bundled_modules/d3-geo-projection/src/math.js +28 -0
  111. package/dist/cjs/bundled_modules/d3-geo-projection/src/mollweide.js +38 -0
  112. package/dist/cjs/bundled_modules/d3-hierarchy/src/accessors.js +13 -0
  113. package/dist/cjs/bundled_modules/d3-hierarchy/src/array.js +27 -0
  114. package/dist/cjs/bundled_modules/d3-hierarchy/src/cluster.js +90 -0
  115. package/dist/cjs/bundled_modules/d3-hierarchy/src/constant.js +16 -0
  116. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/ancestors.js +13 -0
  117. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/count.js +18 -0
  118. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/descendants.js +9 -0
  119. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/each.js +13 -0
  120. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/eachAfter.js +21 -0
  121. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/eachBefore.js +18 -0
  122. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/find.js +14 -0
  123. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/index.js +99 -0
  124. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/iterator.js +20 -0
  125. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/leaves.js +15 -0
  126. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/links.js +15 -0
  127. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/path.js +36 -0
  128. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/sort.js +13 -0
  129. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/sum.js +15 -0
  130. package/dist/cjs/bundled_modules/d3-hierarchy/src/lcg.js +15 -0
  131. package/dist/cjs/bundled_modules/d3-hierarchy/src/pack/enclose.js +122 -0
  132. package/dist/cjs/bundled_modules/d3-hierarchy/src/pack/index.js +87 -0
  133. package/dist/cjs/bundled_modules/d3-hierarchy/src/pack/siblings.js +118 -0
  134. package/dist/cjs/bundled_modules/d3-hierarchy/src/partition.js +58 -0
  135. package/dist/cjs/bundled_modules/d3-hierarchy/src/stratify.js +151 -0
  136. package/dist/cjs/bundled_modules/d3-hierarchy/src/tree.js +243 -0
  137. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/binary.js +52 -0
  138. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/dice.js +18 -0
  139. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/index.js +100 -0
  140. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/resquarify.js +42 -0
  141. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/round.js +12 -0
  142. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/slice.js +18 -0
  143. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/sliceDice.js +12 -0
  144. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/squarify.js +74 -0
  145. package/dist/cjs/bundled_modules/d3-interpolate/src/array.js +29 -0
  146. package/dist/cjs/bundled_modules/d3-interpolate/src/basis.js +26 -0
  147. package/dist/cjs/bundled_modules/d3-interpolate/src/basisClosed.js +19 -0
  148. package/dist/cjs/bundled_modules/d3-interpolate/src/color.js +37 -0
  149. package/dist/cjs/bundled_modules/d3-interpolate/src/constant.js +7 -0
  150. package/dist/cjs/bundled_modules/d3-interpolate/src/cubehelix.js +36 -0
  151. package/dist/cjs/bundled_modules/d3-interpolate/src/date.js +12 -0
  152. package/dist/cjs/bundled_modules/d3-interpolate/src/discrete.js +12 -0
  153. package/dist/cjs/bundled_modules/d3-interpolate/src/hcl.js +28 -0
  154. package/dist/cjs/bundled_modules/d3-interpolate/src/hsl.js +28 -0
  155. package/dist/cjs/bundled_modules/d3-interpolate/src/hue.js +15 -0
  156. package/dist/cjs/bundled_modules/d3-interpolate/src/index.js +53 -0
  157. package/dist/cjs/bundled_modules/d3-interpolate/src/lab.js +22 -0
  158. package/dist/cjs/bundled_modules/d3-interpolate/src/number.js +11 -0
  159. package/dist/cjs/bundled_modules/d3-interpolate/src/numberArray.js +21 -0
  160. package/dist/cjs/bundled_modules/d3-interpolate/src/object.js +29 -0
  161. package/dist/cjs/bundled_modules/d3-interpolate/src/piecewise.js +17 -0
  162. package/dist/cjs/bundled_modules/d3-interpolate/src/quantize.js +11 -0
  163. package/dist/cjs/bundled_modules/d3-interpolate/src/rgb.js +63 -0
  164. package/dist/cjs/bundled_modules/d3-interpolate/src/round.js +11 -0
  165. package/dist/cjs/bundled_modules/d3-interpolate/src/string.js +70 -0
  166. package/dist/cjs/bundled_modules/d3-interpolate/src/transform/decompose.js +33 -0
  167. package/dist/cjs/bundled_modules/d3-interpolate/src/transform/index.js +68 -0
  168. package/dist/cjs/bundled_modules/d3-interpolate/src/transform/parse.js +23 -0
  169. package/dist/cjs/bundled_modules/d3-interpolate/src/value.js +28 -0
  170. package/dist/cjs/bundled_modules/d3-interpolate/src/zoom.js +77 -0
  171. package/dist/cjs/bundled_modules/d3-path/src/path.js +157 -0
  172. package/dist/cjs/bundled_modules/d3-quadtree/src/add.js +91 -0
  173. package/dist/cjs/bundled_modules/d3-quadtree/src/cover.js +49 -0
  174. package/dist/cjs/bundled_modules/d3-quadtree/src/data.js +13 -0
  175. package/dist/cjs/bundled_modules/d3-quadtree/src/extent.js +11 -0
  176. package/dist/cjs/bundled_modules/d3-quadtree/src/find.js +76 -0
  177. package/dist/cjs/bundled_modules/d3-quadtree/src/quad.js +13 -0
  178. package/dist/cjs/bundled_modules/d3-quadtree/src/quadtree.js +79 -0
  179. package/dist/cjs/bundled_modules/d3-quadtree/src/remove.js +69 -0
  180. package/dist/cjs/bundled_modules/d3-quadtree/src/root.js +9 -0
  181. package/dist/cjs/bundled_modules/d3-quadtree/src/size.js +13 -0
  182. package/dist/cjs/bundled_modules/d3-quadtree/src/visit.js +22 -0
  183. package/dist/cjs/bundled_modules/d3-quadtree/src/visitAfter.js +27 -0
  184. package/dist/cjs/bundled_modules/d3-quadtree/src/x.js +14 -0
  185. package/dist/cjs/bundled_modules/d3-quadtree/src/y.js +14 -0
  186. package/dist/cjs/bundled_modules/d3-scale/src/constant.js +11 -0
  187. package/dist/cjs/bundled_modules/d3-scale/src/continuous.js +136 -0
  188. package/dist/cjs/bundled_modules/d3-scale/src/diverging.js +116 -0
  189. package/dist/cjs/bundled_modules/d3-scale/src/identity.js +34 -0
  190. package/dist/cjs/bundled_modules/d3-scale/src/init.js +31 -0
  191. package/dist/cjs/bundled_modules/d3-scale/src/linear.js +77 -0
  192. package/dist/cjs/bundled_modules/d3-scale/src/log.js +148 -0
  193. package/dist/cjs/bundled_modules/d3-scale/src/nice.js +24 -0
  194. package/dist/cjs/bundled_modules/d3-scale/src/number.js +9 -0
  195. package/dist/cjs/bundled_modules/d3-scale/src/ordinal.js +53 -0
  196. package/dist/cjs/bundled_modules/d3-scale/src/pow.js +58 -0
  197. package/dist/cjs/bundled_modules/d3-scale/src/quantile.js +65 -0
  198. package/dist/cjs/bundled_modules/d3-scale/src/quantize.js +62 -0
  199. package/dist/cjs/bundled_modules/d3-scale/src/sequential.js +119 -0
  200. package/dist/cjs/bundled_modules/d3-scale/src/symlog.js +42 -0
  201. package/dist/cjs/bundled_modules/d3-scale/src/threshold.js +45 -0
  202. package/dist/cjs/bundled_modules/d3-scale/src/tickFormat.js +39 -0
  203. package/dist/cjs/bundled_modules/d3-scale/src/time.js +85 -0
  204. package/dist/cjs/bundled_modules/d3-scale/src/utcTime.js +21 -0
  205. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Accent.js +9 -0
  206. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Dark2.js +9 -0
  207. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Paired.js +9 -0
  208. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Pastel1.js +9 -0
  209. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Pastel2.js +9 -0
  210. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Set1.js +9 -0
  211. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Set2.js +9 -0
  212. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Set3.js +9 -0
  213. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/category10.js +9 -0
  214. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/observable10.js +9 -0
  215. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/colors.js +11 -0
  216. package/dist/cjs/bundled_modules/d3-shape/src/arc.js +274 -0
  217. package/dist/cjs/bundled_modules/d3-shape/src/area.js +118 -0
  218. package/dist/cjs/bundled_modules/d3-shape/src/array.js +11 -0
  219. package/dist/cjs/bundled_modules/d3-shape/src/constant.js +11 -0
  220. package/dist/cjs/bundled_modules/d3-shape/src/curve/basis.js +59 -0
  221. package/dist/cjs/bundled_modules/d3-shape/src/curve/basisClosed.js +58 -0
  222. package/dist/cjs/bundled_modules/d3-shape/src/curve/basisOpen.js +45 -0
  223. package/dist/cjs/bundled_modules/d3-shape/src/curve/bundle.js +62 -0
  224. package/dist/cjs/bundled_modules/d3-shape/src/curve/cardinal.js +69 -0
  225. package/dist/cjs/bundled_modules/d3-shape/src/curve/cardinalClosed.js +68 -0
  226. package/dist/cjs/bundled_modules/d3-shape/src/curve/cardinalOpen.js +56 -0
  227. package/dist/cjs/bundled_modules/d3-shape/src/curve/catmullRom.js +95 -0
  228. package/dist/cjs/bundled_modules/d3-shape/src/curve/catmullRomClosed.js +80 -0
  229. package/dist/cjs/bundled_modules/d3-shape/src/curve/catmullRomOpen.js +68 -0
  230. package/dist/cjs/bundled_modules/d3-shape/src/curve/linear.js +37 -0
  231. package/dist/cjs/bundled_modules/d3-shape/src/curve/linearClosed.js +31 -0
  232. package/dist/cjs/bundled_modules/d3-shape/src/curve/monotone.js +109 -0
  233. package/dist/cjs/bundled_modules/d3-shape/src/curve/natural.js +71 -0
  234. package/dist/cjs/bundled_modules/d3-shape/src/curve/step.js +61 -0
  235. package/dist/cjs/bundled_modules/d3-shape/src/line.js +64 -0
  236. package/dist/cjs/bundled_modules/d3-shape/src/math.js +36 -0
  237. package/dist/cjs/bundled_modules/d3-shape/src/noop.js +7 -0
  238. package/dist/cjs/bundled_modules/d3-shape/src/path.js +23 -0
  239. package/dist/cjs/bundled_modules/d3-shape/src/point.js +12 -0
  240. package/dist/cjs/bundled_modules/d3-shape/src/symbol/circle.js +15 -0
  241. package/dist/cjs/bundled_modules/d3-shape/src/symbol.js +38 -0
  242. package/dist/cjs/bundled_modules/d3-time/src/day.js +41 -0
  243. package/dist/cjs/bundled_modules/d3-time/src/duration.js +17 -0
  244. package/dist/cjs/bundled_modules/d3-time/src/hour.js +31 -0
  245. package/dist/cjs/bundled_modules/d3-time/src/interval.js +73 -0
  246. package/dist/cjs/bundled_modules/d3-time/src/millisecond.js +29 -0
  247. package/dist/cjs/bundled_modules/d3-time/src/minute.js +31 -0
  248. package/dist/cjs/bundled_modules/d3-time/src/month.js +32 -0
  249. package/dist/cjs/bundled_modules/d3-time/src/second.js +18 -0
  250. package/dist/cjs/bundled_modules/d3-time/src/ticks.js +64 -0
  251. package/dist/cjs/bundled_modules/d3-time/src/week.js +73 -0
  252. package/dist/cjs/bundled_modules/d3-time/src/year.js +54 -0
  253. package/dist/cjs/bundled_modules/d3-time-format/src/defaultLocale.js +33 -0
  254. package/dist/cjs/bundled_modules/d3-time-format/src/locale.js +694 -0
  255. package/dist/cjs/bundled_modules/d3-timer/src/interval.js +23 -0
  256. package/dist/cjs/bundled_modules/d3-timer/src/timer.js +117 -0
  257. package/dist/cjs/bundled_modules/delaunator/index.js +485 -0
  258. package/dist/cjs/bundled_modules/internmap/src/index.js +66 -0
  259. package/dist/cjs/bundled_modules/json-stringify-pretty-compact/index.js +104 -0
  260. package/dist/cjs/bundled_modules/robust-predicates/esm/orient2d.js +184 -0
  261. package/dist/cjs/bundled_modules/robust-predicates/esm/util.js +95 -0
  262. package/dist/cjs/bundled_modules/topojson-client/src/feature.js +77 -0
  263. package/dist/cjs/bundled_modules/topojson-client/src/identity.js +9 -0
  264. package/dist/cjs/bundled_modules/topojson-client/src/mesh.js +60 -0
  265. package/dist/cjs/bundled_modules/topojson-client/src/reverse.js +10 -0
  266. package/dist/cjs/bundled_modules/topojson-client/src/stitch.js +79 -0
  267. package/dist/cjs/bundled_modules/topojson-client/src/transform.js +25 -0
  268. package/dist/cjs/bundled_modules/vega/build/vega.module.js +272 -0
  269. package/dist/cjs/bundled_modules/vega-canvas/build/vega-canvas.browser.js +18 -0
  270. package/dist/cjs/bundled_modules/vega-crossfilter/build/vega-crossfilter.js +676 -0
  271. package/dist/cjs/bundled_modules/vega-dataflow/build/vega-dataflow.js +2102 -0
  272. package/dist/cjs/bundled_modules/vega-embed/build/embed.js +2939 -0
  273. package/dist/cjs/bundled_modules/vega-encode/build/vega-encode.js +962 -0
  274. package/dist/cjs/bundled_modules/vega-event-selector/build/vega-event-selector.js +192 -0
  275. package/dist/cjs/bundled_modules/vega-expression/build/vega-expression.js +1615 -0
  276. package/dist/cjs/bundled_modules/vega-force/build/vega-force.js +295 -0
  277. package/dist/cjs/bundled_modules/vega-format/build/vega-format.js +201 -0
  278. package/dist/cjs/bundled_modules/vega-functions/build/vega-functions.js +842 -0
  279. package/dist/cjs/bundled_modules/vega-geo/build/vega-geo.js +1333 -0
  280. package/dist/cjs/bundled_modules/vega-hierarchy/build/vega-hierarchy.js +580 -0
  281. package/dist/cjs/bundled_modules/vega-interpreter/build/vega-interpreter.js +310 -0
  282. package/dist/cjs/bundled_modules/vega-label/build/vega-label.js +876 -0
  283. package/dist/cjs/bundled_modules/vega-lite/build/index.js +20157 -0
  284. package/dist/cjs/bundled_modules/vega-loader/build/vega-loader.browser.js +337 -0
  285. package/dist/cjs/bundled_modules/vega-parser/build/vega-parser.js +3805 -0
  286. package/dist/cjs/bundled_modules/vega-projection/build/vega-projection.js +90 -0
  287. package/dist/cjs/bundled_modules/vega-regression/build/vega-regression.js +236 -0
  288. package/dist/cjs/bundled_modules/vega-runtime/build/vega-runtime.js +588 -0
  289. package/dist/cjs/bundled_modules/vega-scale/build/vega-scale.js +846 -0
  290. package/dist/cjs/bundled_modules/vega-scenegraph/build/vega-scenegraph.js +5040 -0
  291. package/dist/cjs/bundled_modules/vega-schema-url-parser/dist/parser.modern.js +7 -0
  292. package/dist/cjs/bundled_modules/vega-selections/build/vega-selection.js +342 -0
  293. package/dist/cjs/bundled_modules/vega-statistics/build/vega-statistics.js +1193 -0
  294. package/dist/cjs/bundled_modules/vega-themes/build/index.js +853 -0
  295. package/dist/cjs/bundled_modules/vega-time/build/vega-time.js +342 -0
  296. package/dist/cjs/bundled_modules/vega-tooltip/build/index.js +353 -0
  297. package/dist/cjs/bundled_modules/vega-transforms/build/vega-transforms.js +3781 -0
  298. package/dist/cjs/bundled_modules/vega-util/build/vega-util.js +824 -0
  299. package/dist/cjs/bundled_modules/vega-view/build/vega-view.js +1306 -0
  300. package/dist/cjs/bundled_modules/vega-view-transforms/build/vega-view-transforms.js +1313 -0
  301. package/dist/cjs/bundled_modules/vega-voronoi/build/vega-voronoi.js +80 -0
  302. package/dist/cjs/bundled_modules/vega-wordcloud/build/vega-wordcloud.js +540 -0
  303. package/dist/cjs/unstable/extras/chart/BarChart.js +42 -0
  304. package/dist/cjs/unstable/extras/chart/Chart.js +100 -0
  305. package/dist/cjs/unstable/extras/chart/DistributionChart.js +84 -0
  306. package/dist/cjs/unstable/extras/chart/DonutChart.js +43 -0
  307. package/dist/cjs/unstable/extras/chart/LineChart.js +45 -0
  308. package/dist/cjs/unstable/extras/chart/PieChart.js +39 -0
  309. package/dist/cjs/unstable/extras/chart/TimelineChart.js +48 -0
  310. package/dist/cjs/unstable/extras/chart/index.js +23 -0
  311. package/dist/esm/bundled_modules/d3-array/src/ascending.js +5 -0
  312. package/dist/esm/bundled_modules/d3-array/src/bisect.js +10 -0
  313. package/dist/esm/bundled_modules/d3-array/src/bisector.js +58 -0
  314. package/dist/esm/bundled_modules/d3-array/src/descending.js +9 -0
  315. package/dist/esm/bundled_modules/d3-array/src/deviation.js +8 -0
  316. package/dist/esm/bundled_modules/d3-array/src/fsum.js +43 -0
  317. package/dist/esm/bundled_modules/d3-array/src/intersection.js +21 -0
  318. package/dist/esm/bundled_modules/d3-array/src/max.js +22 -0
  319. package/dist/esm/bundled_modules/d3-array/src/mean.js +21 -0
  320. package/dist/esm/bundled_modules/d3-array/src/median.js +7 -0
  321. package/dist/esm/bundled_modules/d3-array/src/merge.js +11 -0
  322. package/dist/esm/bundled_modules/d3-array/src/min.js +22 -0
  323. package/dist/esm/bundled_modules/d3-array/src/number.js +22 -0
  324. package/dist/esm/bundled_modules/d3-array/src/permute.js +5 -0
  325. package/dist/esm/bundled_modules/d3-array/src/quantile.js +31 -0
  326. package/dist/esm/bundled_modules/d3-array/src/quickselect.js +55 -0
  327. package/dist/esm/bundled_modules/d3-array/src/range.js +15 -0
  328. package/dist/esm/bundled_modules/d3-array/src/sort.js +17 -0
  329. package/dist/esm/bundled_modules/d3-array/src/sum.js +13 -0
  330. package/dist/esm/bundled_modules/d3-array/src/ticks.js +57 -0
  331. package/dist/esm/bundled_modules/d3-array/src/union.js +13 -0
  332. package/dist/esm/bundled_modules/d3-array/src/variance.js +27 -0
  333. package/dist/esm/bundled_modules/d3-color/src/color.js +398 -0
  334. package/dist/esm/bundled_modules/d3-color/src/cubehelix.js +63 -0
  335. package/dist/esm/bundled_modules/d3-color/src/define.js +12 -0
  336. package/dist/esm/bundled_modules/d3-color/src/lab.js +117 -0
  337. package/dist/esm/bundled_modules/d3-color/src/math.js +4 -0
  338. package/dist/esm/bundled_modules/d3-delaunay/src/delaunay.js +250 -0
  339. package/dist/esm/bundled_modules/d3-delaunay/src/path.js +39 -0
  340. package/dist/esm/bundled_modules/d3-delaunay/src/polygon.js +19 -0
  341. package/dist/esm/bundled_modules/d3-delaunay/src/voronoi.js +334 -0
  342. package/dist/esm/bundled_modules/d3-dispatch/src/dispatch.js +84 -0
  343. package/dist/esm/bundled_modules/d3-dsv/src/dsv.js +166 -0
  344. package/dist/esm/bundled_modules/d3-force/src/center.js +42 -0
  345. package/dist/esm/bundled_modules/d3-force/src/collide.js +102 -0
  346. package/dist/esm/bundled_modules/d3-force/src/constant.js +7 -0
  347. package/dist/esm/bundled_modules/d3-force/src/jiggle.js +5 -0
  348. package/dist/esm/bundled_modules/d3-force/src/lcg.js +11 -0
  349. package/dist/esm/bundled_modules/d3-force/src/link.js +119 -0
  350. package/dist/esm/bundled_modules/d3-force/src/manyBody.js +118 -0
  351. package/dist/esm/bundled_modules/d3-force/src/simulation.js +158 -0
  352. package/dist/esm/bundled_modules/d3-force/src/x.js +43 -0
  353. package/dist/esm/bundled_modules/d3-force/src/y.js +43 -0
  354. package/dist/esm/bundled_modules/d3-format/src/defaultLocale.js +20 -0
  355. package/dist/esm/bundled_modules/d3-format/src/exponent.js +7 -0
  356. package/dist/esm/bundled_modules/d3-format/src/formatDecimal.js +22 -0
  357. package/dist/esm/bundled_modules/d3-format/src/formatGroup.js +20 -0
  358. package/dist/esm/bundled_modules/d3-format/src/formatNumerals.js +9 -0
  359. package/dist/esm/bundled_modules/d3-format/src/formatPrefixAuto.js +18 -0
  360. package/dist/esm/bundled_modules/d3-format/src/formatRounded.js +13 -0
  361. package/dist/esm/bundled_modules/d3-format/src/formatSpecifier.js +49 -0
  362. package/dist/esm/bundled_modules/d3-format/src/formatTrim.js +13 -0
  363. package/dist/esm/bundled_modules/d3-format/src/formatTypes.js +21 -0
  364. package/dist/esm/bundled_modules/d3-format/src/identity.js +5 -0
  365. package/dist/esm/bundled_modules/d3-format/src/locale.js +150 -0
  366. package/dist/esm/bundled_modules/d3-format/src/precisionFixed.js +7 -0
  367. package/dist/esm/bundled_modules/d3-format/src/precisionPrefix.js +7 -0
  368. package/dist/esm/bundled_modules/d3-format/src/precisionRound.js +8 -0
  369. package/dist/esm/bundled_modules/d3-geo/src/area.js +78 -0
  370. package/dist/esm/bundled_modules/d3-geo/src/bounds.js +181 -0
  371. package/dist/esm/bundled_modules/d3-geo/src/cartesian.js +35 -0
  372. package/dist/esm/bundled_modules/d3-geo/src/centroid.js +145 -0
  373. package/dist/esm/bundled_modules/d3-geo/src/circle.js +33 -0
  374. package/dist/esm/bundled_modules/d3-geo/src/clip/antimeridian.js +94 -0
  375. package/dist/esm/bundled_modules/d3-geo/src/clip/buffer.js +26 -0
  376. package/dist/esm/bundled_modules/d3-geo/src/clip/circle.js +179 -0
  377. package/dist/esm/bundled_modules/d3-geo/src/clip/index.js +133 -0
  378. package/dist/esm/bundled_modules/d3-geo/src/clip/line.js +61 -0
  379. package/dist/esm/bundled_modules/d3-geo/src/clip/rectangle.js +170 -0
  380. package/dist/esm/bundled_modules/d3-geo/src/clip/rejoin.js +105 -0
  381. package/dist/esm/bundled_modules/d3-geo/src/compose.js +14 -0
  382. package/dist/esm/bundled_modules/d3-geo/src/graticule.js +103 -0
  383. package/dist/esm/bundled_modules/d3-geo/src/identity.js +3 -0
  384. package/dist/esm/bundled_modules/d3-geo/src/math.js +33 -0
  385. package/dist/esm/bundled_modules/d3-geo/src/noop.js +3 -0
  386. package/dist/esm/bundled_modules/d3-geo/src/path/area.js +50 -0
  387. package/dist/esm/bundled_modules/d3-geo/src/path/bounds.js +28 -0
  388. package/dist/esm/bundled_modules/d3-geo/src/path/centroid.js +100 -0
  389. package/dist/esm/bundled_modules/d3-geo/src/path/context.js +47 -0
  390. package/dist/esm/bundled_modules/d3-geo/src/path/index.js +78 -0
  391. package/dist/esm/bundled_modules/d3-geo/src/path/measure.js +45 -0
  392. package/dist/esm/bundled_modules/d3-geo/src/path/string.js +88 -0
  393. package/dist/esm/bundled_modules/d3-geo/src/pointEqual.js +7 -0
  394. package/dist/esm/bundled_modules/d3-geo/src/polygonContains.js +76 -0
  395. package/dist/esm/bundled_modules/d3-geo/src/projection/albers.js +12 -0
  396. package/dist/esm/bundled_modules/d3-geo/src/projection/albersUsa.js +113 -0
  397. package/dist/esm/bundled_modules/d3-geo/src/projection/azimuthal.js +29 -0
  398. package/dist/esm/bundled_modules/d3-geo/src/projection/azimuthalEqualArea.js +19 -0
  399. package/dist/esm/bundled_modules/d3-geo/src/projection/azimuthalEquidistant.js +19 -0
  400. package/dist/esm/bundled_modules/d3-geo/src/projection/conic.js +17 -0
  401. package/dist/esm/bundled_modules/d3-geo/src/projection/conicConformal.js +40 -0
  402. package/dist/esm/bundled_modules/d3-geo/src/projection/conicEqualArea.js +35 -0
  403. package/dist/esm/bundled_modules/d3-geo/src/projection/conicEquidistant.js +34 -0
  404. package/dist/esm/bundled_modules/d3-geo/src/projection/cylindricalEqualArea.js +17 -0
  405. package/dist/esm/bundled_modules/d3-geo/src/projection/equalEarth.js +38 -0
  406. package/dist/esm/bundled_modules/d3-geo/src/projection/equirectangular.js +14 -0
  407. package/dist/esm/bundled_modules/d3-geo/src/projection/fit.js +49 -0
  408. package/dist/esm/bundled_modules/d3-geo/src/projection/gnomonic.js +18 -0
  409. package/dist/esm/bundled_modules/d3-geo/src/projection/identity.js +87 -0
  410. package/dist/esm/bundled_modules/d3-geo/src/projection/index.js +179 -0
  411. package/dist/esm/bundled_modules/d3-geo/src/projection/mercator.js +54 -0
  412. package/dist/esm/bundled_modules/d3-geo/src/projection/naturalEarth1.js +30 -0
  413. package/dist/esm/bundled_modules/d3-geo/src/projection/orthographic.js +17 -0
  414. package/dist/esm/bundled_modules/d3-geo/src/projection/resample.js +104 -0
  415. package/dist/esm/bundled_modules/d3-geo/src/projection/stereographic.js +20 -0
  416. package/dist/esm/bundled_modules/d3-geo/src/projection/transverseMercator.js +29 -0
  417. package/dist/esm/bundled_modules/d3-geo/src/rotation.js +81 -0
  418. package/dist/esm/bundled_modules/d3-geo/src/stream.js +71 -0
  419. package/dist/esm/bundled_modules/d3-geo/src/transform.js +22 -0
  420. package/dist/esm/bundled_modules/d3-geo-projection/src/math.js +18 -0
  421. package/dist/esm/bundled_modules/d3-geo-projection/src/mollweide.js +31 -0
  422. package/dist/esm/bundled_modules/d3-hierarchy/src/accessors.js +10 -0
  423. package/dist/esm/bundled_modules/d3-hierarchy/src/array.js +22 -0
  424. package/dist/esm/bundled_modules/d3-hierarchy/src/cluster.js +86 -0
  425. package/dist/esm/bundled_modules/d3-hierarchy/src/constant.js +11 -0
  426. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/ancestors.js +9 -0
  427. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/count.js +14 -0
  428. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/descendants.js +5 -0
  429. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/each.js +9 -0
  430. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/eachAfter.js +17 -0
  431. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/eachBefore.js +14 -0
  432. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/find.js +10 -0
  433. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/index.js +93 -0
  434. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/iterator.js +16 -0
  435. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/leaves.js +11 -0
  436. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/links.js +11 -0
  437. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/path.js +32 -0
  438. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/sort.js +9 -0
  439. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/sum.js +11 -0
  440. package/dist/esm/bundled_modules/d3-hierarchy/src/lcg.js +11 -0
  441. package/dist/esm/bundled_modules/d3-hierarchy/src/pack/enclose.js +120 -0
  442. package/dist/esm/bundled_modules/d3-hierarchy/src/pack/index.js +83 -0
  443. package/dist/esm/bundled_modules/d3-hierarchy/src/pack/siblings.js +116 -0
  444. package/dist/esm/bundled_modules/d3-hierarchy/src/partition.js +54 -0
  445. package/dist/esm/bundled_modules/d3-hierarchy/src/stratify.js +147 -0
  446. package/dist/esm/bundled_modules/d3-hierarchy/src/tree.js +239 -0
  447. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/binary.js +48 -0
  448. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/dice.js +14 -0
  449. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/index.js +96 -0
  450. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/resquarify.js +38 -0
  451. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/round.js +8 -0
  452. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/slice.js +14 -0
  453. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/sliceDice.js +8 -0
  454. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/squarify.js +68 -0
  455. package/dist/esm/bundled_modules/d3-interpolate/src/array.js +24 -0
  456. package/dist/esm/bundled_modules/d3-interpolate/src/basis.js +21 -0
  457. package/dist/esm/bundled_modules/d3-interpolate/src/basisClosed.js +15 -0
  458. package/dist/esm/bundled_modules/d3-interpolate/src/color.js +31 -0
  459. package/dist/esm/bundled_modules/d3-interpolate/src/constant.js +3 -0
  460. package/dist/esm/bundled_modules/d3-interpolate/src/cubehelix.js +31 -0
  461. package/dist/esm/bundled_modules/d3-interpolate/src/date.js +8 -0
  462. package/dist/esm/bundled_modules/d3-interpolate/src/discrete.js +8 -0
  463. package/dist/esm/bundled_modules/d3-interpolate/src/hcl.js +23 -0
  464. package/dist/esm/bundled_modules/d3-interpolate/src/hsl.js +23 -0
  465. package/dist/esm/bundled_modules/d3-interpolate/src/hue.js +11 -0
  466. package/dist/esm/bundled_modules/d3-interpolate/src/index.js +21 -0
  467. package/dist/esm/bundled_modules/d3-interpolate/src/lab.js +18 -0
  468. package/dist/esm/bundled_modules/d3-interpolate/src/number.js +7 -0
  469. package/dist/esm/bundled_modules/d3-interpolate/src/numberArray.js +16 -0
  470. package/dist/esm/bundled_modules/d3-interpolate/src/object.js +25 -0
  471. package/dist/esm/bundled_modules/d3-interpolate/src/piecewise.js +13 -0
  472. package/dist/esm/bundled_modules/d3-interpolate/src/quantize.js +7 -0
  473. package/dist/esm/bundled_modules/d3-interpolate/src/rgb.js +57 -0
  474. package/dist/esm/bundled_modules/d3-interpolate/src/round.js +7 -0
  475. package/dist/esm/bundled_modules/d3-interpolate/src/string.js +66 -0
  476. package/dist/esm/bundled_modules/d3-interpolate/src/transform/decompose.js +28 -0
  477. package/dist/esm/bundled_modules/d3-interpolate/src/transform/index.js +65 -0
  478. package/dist/esm/bundled_modules/d3-interpolate/src/transform/parse.js +20 -0
  479. package/dist/esm/bundled_modules/d3-interpolate/src/value.js +24 -0
  480. package/dist/esm/bundled_modules/d3-interpolate/src/zoom.js +73 -0
  481. package/dist/esm/bundled_modules/d3-path/src/path.js +154 -0
  482. package/dist/esm/bundled_modules/d3-quadtree/src/add.js +86 -0
  483. package/dist/esm/bundled_modules/d3-quadtree/src/cover.js +45 -0
  484. package/dist/esm/bundled_modules/d3-quadtree/src/data.js +9 -0
  485. package/dist/esm/bundled_modules/d3-quadtree/src/extent.js +7 -0
  486. package/dist/esm/bundled_modules/d3-quadtree/src/find.js +72 -0
  487. package/dist/esm/bundled_modules/d3-quadtree/src/quad.js +9 -0
  488. package/dist/esm/bundled_modules/d3-quadtree/src/quadtree.js +75 -0
  489. package/dist/esm/bundled_modules/d3-quadtree/src/remove.js +64 -0
  490. package/dist/esm/bundled_modules/d3-quadtree/src/root.js +5 -0
  491. package/dist/esm/bundled_modules/d3-quadtree/src/size.js +9 -0
  492. package/dist/esm/bundled_modules/d3-quadtree/src/visit.js +18 -0
  493. package/dist/esm/bundled_modules/d3-quadtree/src/visitAfter.js +23 -0
  494. package/dist/esm/bundled_modules/d3-quadtree/src/x.js +9 -0
  495. package/dist/esm/bundled_modules/d3-quadtree/src/y.js +9 -0
  496. package/dist/esm/bundled_modules/d3-scale/src/constant.js +7 -0
  497. package/dist/esm/bundled_modules/d3-scale/src/continuous.js +129 -0
  498. package/dist/esm/bundled_modules/d3-scale/src/diverging.js +108 -0
  499. package/dist/esm/bundled_modules/d3-scale/src/identity.js +30 -0
  500. package/dist/esm/bundled_modules/d3-scale/src/init.js +28 -0
  501. package/dist/esm/bundled_modules/d3-scale/src/linear.js +72 -0
  502. package/dist/esm/bundled_modules/d3-scale/src/log.js +143 -0
  503. package/dist/esm/bundled_modules/d3-scale/src/nice.js +20 -0
  504. package/dist/esm/bundled_modules/d3-scale/src/number.js +5 -0
  505. package/dist/esm/bundled_modules/d3-scale/src/ordinal.js +48 -0
  506. package/dist/esm/bundled_modules/d3-scale/src/pow.js +52 -0
  507. package/dist/esm/bundled_modules/d3-scale/src/quantile.js +61 -0
  508. package/dist/esm/bundled_modules/d3-scale/src/quantize.js +58 -0
  509. package/dist/esm/bundled_modules/d3-scale/src/sequential.js +110 -0
  510. package/dist/esm/bundled_modules/d3-scale/src/symlog.js +37 -0
  511. package/dist/esm/bundled_modules/d3-scale/src/threshold.js +41 -0
  512. package/dist/esm/bundled_modules/d3-scale/src/tickFormat.js +35 -0
  513. package/dist/esm/bundled_modules/d3-scale/src/time.js +80 -0
  514. package/dist/esm/bundled_modules/d3-scale/src/utcTime.js +17 -0
  515. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Accent.js +5 -0
  516. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Dark2.js +5 -0
  517. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Paired.js +5 -0
  518. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Pastel1.js +5 -0
  519. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Pastel2.js +5 -0
  520. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Set1.js +5 -0
  521. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Set2.js +5 -0
  522. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Set3.js +5 -0
  523. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/category10.js +5 -0
  524. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/observable10.js +5 -0
  525. package/dist/esm/bundled_modules/d3-scale-chromatic/src/colors.js +7 -0
  526. package/dist/esm/bundled_modules/d3-shape/src/arc.js +270 -0
  527. package/dist/esm/bundled_modules/d3-shape/src/area.js +114 -0
  528. package/dist/esm/bundled_modules/d3-shape/src/array.js +7 -0
  529. package/dist/esm/bundled_modules/d3-shape/src/constant.js +7 -0
  530. package/dist/esm/bundled_modules/d3-shape/src/curve/basis.js +53 -0
  531. package/dist/esm/bundled_modules/d3-shape/src/curve/basisClosed.js +54 -0
  532. package/dist/esm/bundled_modules/d3-shape/src/curve/basisOpen.js +41 -0
  533. package/dist/esm/bundled_modules/d3-shape/src/curve/bundle.js +58 -0
  534. package/dist/esm/bundled_modules/d3-shape/src/curve/cardinal.js +63 -0
  535. package/dist/esm/bundled_modules/d3-shape/src/curve/cardinalClosed.js +63 -0
  536. package/dist/esm/bundled_modules/d3-shape/src/curve/cardinalOpen.js +51 -0
  537. package/dist/esm/bundled_modules/d3-shape/src/curve/catmullRom.js +90 -0
  538. package/dist/esm/bundled_modules/d3-shape/src/curve/catmullRomClosed.js +76 -0
  539. package/dist/esm/bundled_modules/d3-shape/src/curve/catmullRomOpen.js +64 -0
  540. package/dist/esm/bundled_modules/d3-shape/src/curve/linear.js +33 -0
  541. package/dist/esm/bundled_modules/d3-shape/src/curve/linearClosed.js +27 -0
  542. package/dist/esm/bundled_modules/d3-shape/src/curve/monotone.js +106 -0
  543. package/dist/esm/bundled_modules/d3-shape/src/curve/natural.js +67 -0
  544. package/dist/esm/bundled_modules/d3-shape/src/curve/step.js +55 -0
  545. package/dist/esm/bundled_modules/d3-shape/src/line.js +60 -0
  546. package/dist/esm/bundled_modules/d3-shape/src/math.js +22 -0
  547. package/dist/esm/bundled_modules/d3-shape/src/noop.js +3 -0
  548. package/dist/esm/bundled_modules/d3-shape/src/path.js +21 -0
  549. package/dist/esm/bundled_modules/d3-shape/src/point.js +9 -0
  550. package/dist/esm/bundled_modules/d3-shape/src/symbol/circle.js +11 -0
  551. package/dist/esm/bundled_modules/d3-shape/src/symbol.js +34 -0
  552. package/dist/esm/bundled_modules/d3-time/src/day.js +37 -0
  553. package/dist/esm/bundled_modules/d3-time/src/duration.js +9 -0
  554. package/dist/esm/bundled_modules/d3-time/src/hour.js +28 -0
  555. package/dist/esm/bundled_modules/d3-time/src/interval.js +71 -0
  556. package/dist/esm/bundled_modules/d3-time/src/millisecond.js +27 -0
  557. package/dist/esm/bundled_modules/d3-time/src/minute.js +28 -0
  558. package/dist/esm/bundled_modules/d3-time/src/month.js +29 -0
  559. package/dist/esm/bundled_modules/d3-time/src/second.js +16 -0
  560. package/dist/esm/bundled_modules/d3-time/src/ticks.js +59 -0
  561. package/dist/esm/bundled_modules/d3-time/src/week.js +58 -0
  562. package/dist/esm/bundled_modules/d3-time/src/year.js +51 -0
  563. package/dist/esm/bundled_modules/d3-time-format/src/defaultLocale.js +29 -0
  564. package/dist/esm/bundled_modules/d3-time-format/src/locale.js +690 -0
  565. package/dist/esm/bundled_modules/d3-timer/src/interval.js +19 -0
  566. package/dist/esm/bundled_modules/d3-timer/src/timer.js +112 -0
  567. package/dist/esm/bundled_modules/delaunator/index.js +481 -0
  568. package/dist/esm/bundled_modules/internmap/src/index.js +63 -0
  569. package/dist/esm/bundled_modules/json-stringify-pretty-compact/index.js +100 -0
  570. package/dist/esm/bundled_modules/robust-predicates/esm/orient2d.js +182 -0
  571. package/dist/esm/bundled_modules/robust-predicates/esm/util.js +88 -0
  572. package/dist/esm/bundled_modules/topojson-client/src/feature.js +72 -0
  573. package/dist/esm/bundled_modules/topojson-client/src/identity.js +5 -0
  574. package/dist/esm/bundled_modules/topojson-client/src/mesh.js +55 -0
  575. package/dist/esm/bundled_modules/topojson-client/src/reverse.js +6 -0
  576. package/dist/esm/bundled_modules/topojson-client/src/stitch.js +75 -0
  577. package/dist/esm/bundled_modules/topojson-client/src/transform.js +21 -0
  578. package/dist/esm/bundled_modules/vega/build/vega.module.js +38 -0
  579. package/dist/esm/bundled_modules/vega-canvas/build/vega-canvas.browser.js +14 -0
  580. package/dist/esm/bundled_modules/vega-crossfilter/build/vega-crossfilter.js +673 -0
  581. package/dist/esm/bundled_modules/vega-dataflow/build/vega-dataflow.js +2080 -0
  582. package/dist/esm/bundled_modules/vega-embed/build/embed.js +2932 -0
  583. package/dist/esm/bundled_modules/vega-encode/build/vega-encode.js +952 -0
  584. package/dist/esm/bundled_modules/vega-event-selector/build/vega-event-selector.js +190 -0
  585. package/dist/esm/bundled_modules/vega-expression/build/vega-expression.js +1597 -0
  586. package/dist/esm/bundled_modules/vega-force/build/vega-force.js +293 -0
  587. package/dist/esm/bundled_modules/vega-format/build/vega-format.js +191 -0
  588. package/dist/esm/bundled_modules/vega-functions/build/vega-functions.js +779 -0
  589. package/dist/esm/bundled_modules/vega-geo/build/vega-geo.js +1322 -0
  590. package/dist/esm/bundled_modules/vega-hierarchy/build/vega-hierarchy.js +572 -0
  591. package/dist/esm/bundled_modules/vega-interpreter/build/vega-interpreter.js +308 -0
  592. package/dist/esm/bundled_modules/vega-label/build/vega-label.js +874 -0
  593. package/dist/esm/bundled_modules/vega-lite/build/index.js +20110 -0
  594. package/dist/esm/bundled_modules/vega-loader/build/vega-loader.browser.js +328 -0
  595. package/dist/esm/bundled_modules/vega-parser/build/vega-parser.js +3783 -0
  596. package/dist/esm/bundled_modules/vega-projection/build/vega-projection.js +86 -0
  597. package/dist/esm/bundled_modules/vega-regression/build/vega-regression.js +233 -0
  598. package/dist/esm/bundled_modules/vega-runtime/build/vega-runtime.js +586 -0
  599. package/dist/esm/bundled_modules/vega-scale/build/vega-scale.js +799 -0
  600. package/dist/esm/bundled_modules/vega-scenegraph/build/vega-scenegraph.js +4982 -0
  601. package/dist/esm/bundled_modules/vega-schema-url-parser/dist/parser.modern.js +3 -0
  602. package/dist/esm/bundled_modules/vega-selections/build/vega-selection.js +336 -0
  603. package/dist/esm/bundled_modules/vega-statistics/build/vega-statistics.js +1157 -0
  604. package/dist/esm/bundled_modules/vega-themes/build/index.js +837 -0
  605. package/dist/esm/bundled_modules/vega-time/build/vega-time.js +314 -0
  606. package/dist/esm/bundled_modules/vega-tooltip/build/index.js +339 -0
  607. package/dist/esm/bundled_modules/vega-transforms/build/vega-transforms.js +3740 -0
  608. package/dist/esm/bundled_modules/vega-util/build/vega-util.js +753 -0
  609. package/dist/esm/bundled_modules/vega-view/build/vega-view.js +1304 -0
  610. package/dist/esm/bundled_modules/vega-view-transforms/build/vega-view-transforms.js +1306 -0
  611. package/dist/esm/bundled_modules/vega-voronoi/build/vega-voronoi.js +78 -0
  612. package/dist/esm/bundled_modules/vega-wordcloud/build/vega-wordcloud.js +538 -0
  613. package/dist/esm/unstable/extras/chart/BarChart.js +40 -0
  614. package/dist/esm/unstable/extras/chart/Chart.js +96 -0
  615. package/dist/esm/unstable/extras/chart/DistributionChart.js +82 -0
  616. package/dist/esm/unstable/extras/chart/DonutChart.js +41 -0
  617. package/dist/esm/unstable/extras/chart/LineChart.js +43 -0
  618. package/dist/esm/unstable/extras/chart/PieChart.js +37 -0
  619. package/dist/esm/unstable/extras/chart/TimelineChart.js +46 -0
  620. package/dist/esm/unstable/extras/chart/index.js +8 -0
  621. package/dist/types/unstable/extras/chart/BarChart.d.ts +16 -0
  622. package/dist/types/unstable/extras/chart/Chart.d.ts +33 -0
  623. package/dist/types/unstable/extras/chart/DistributionChart.d.ts +18 -0
  624. package/dist/types/unstable/extras/chart/DonutChart.d.ts +16 -0
  625. package/dist/types/unstable/extras/chart/LineChart.d.ts +16 -0
  626. package/dist/types/unstable/extras/chart/PieChart.d.ts +14 -0
  627. package/dist/types/unstable/extras/chart/TimelineChart.d.ts +15 -0
  628. package/dist/types/unstable/extras/chart/index.d.ts +15 -0
  629. package/package.json +1 -1
@@ -0,0 +1,1615 @@
1
+ 'use strict';
2
+
3
+ var vegaUtil = require('../../vega-util/build/vega-util.js');
4
+
5
+ const RawCode = 'RawCode';
6
+ const Literal = 'Literal';
7
+ const Property = 'Property';
8
+ const Identifier = 'Identifier';
9
+ const ArrayExpression = 'ArrayExpression';
10
+ const BinaryExpression = 'BinaryExpression';
11
+ const CallExpression = 'CallExpression';
12
+ const ConditionalExpression = 'ConditionalExpression';
13
+ const LogicalExpression = 'LogicalExpression';
14
+ const MemberExpression = 'MemberExpression';
15
+ const ObjectExpression = 'ObjectExpression';
16
+ const UnaryExpression = 'UnaryExpression';
17
+ function ASTNode(type) {
18
+ this.type = type;
19
+ }
20
+ ASTNode.prototype.visit = function (visitor) {
21
+ let c, i, n;
22
+ if (visitor(this)) return 1;
23
+ for (c = children(this), i = 0, n = c.length; i < n; ++i) {
24
+ if (c[i].visit(visitor)) return 1;
25
+ }
26
+ };
27
+ function children(node) {
28
+ switch (node.type) {
29
+ case ArrayExpression:
30
+ return node.elements;
31
+ case BinaryExpression:
32
+ case LogicalExpression:
33
+ return [node.left, node.right];
34
+ case CallExpression:
35
+ return [node.callee].concat(node.arguments);
36
+ case ConditionalExpression:
37
+ return [node.test, node.consequent, node.alternate];
38
+ case MemberExpression:
39
+ return [node.object, node.property];
40
+ case ObjectExpression:
41
+ return node.properties;
42
+ case Property:
43
+ return [node.key, node.value];
44
+ case UnaryExpression:
45
+ return [node.argument];
46
+ case Identifier:
47
+ case Literal:
48
+ case RawCode:
49
+ default:
50
+ return [];
51
+ }
52
+ }
53
+
54
+ /*
55
+ The following expression parser is based on Esprima (http://esprima.org/).
56
+ Original header comment and license for Esprima is included here:
57
+
58
+ Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>
59
+ Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>
60
+ Copyright (C) 2013 Mathias Bynens <mathias@qiwi.be>
61
+ Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
62
+ Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>
63
+ Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>
64
+ Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>
65
+ Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>
66
+ Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com>
67
+ Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
68
+
69
+ Redistribution and use in source and binary forms, with or without
70
+ modification, are permitted provided that the following conditions are met:
71
+
72
+ * Redistributions of source code must retain the above copyright
73
+ notice, this list of conditions and the following disclaimer.
74
+ * Redistributions in binary form must reproduce the above copyright
75
+ notice, this list of conditions and the following disclaimer in the
76
+ documentation and/or other materials provided with the distribution.
77
+
78
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
79
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
80
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
81
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
82
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
83
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
84
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
85
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
86
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
87
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
+ */
89
+ var TokenName, source, index, length, lookahead;
90
+ var TokenBooleanLiteral = 1,
91
+ TokenEOF = 2,
92
+ TokenIdentifier = 3,
93
+ TokenKeyword = 4,
94
+ TokenNullLiteral = 5,
95
+ TokenNumericLiteral = 6,
96
+ TokenPunctuator = 7,
97
+ TokenStringLiteral = 8,
98
+ TokenRegularExpression = 9;
99
+ TokenName = {};
100
+ TokenName[TokenBooleanLiteral] = 'Boolean';
101
+ TokenName[TokenEOF] = '<end>';
102
+ TokenName[TokenIdentifier] = 'Identifier';
103
+ TokenName[TokenKeyword] = 'Keyword';
104
+ TokenName[TokenNullLiteral] = 'Null';
105
+ TokenName[TokenNumericLiteral] = 'Numeric';
106
+ TokenName[TokenPunctuator] = 'Punctuator';
107
+ TokenName[TokenStringLiteral] = 'String';
108
+ TokenName[TokenRegularExpression] = 'RegularExpression';
109
+ var SyntaxArrayExpression = 'ArrayExpression',
110
+ SyntaxBinaryExpression = 'BinaryExpression',
111
+ SyntaxCallExpression = 'CallExpression',
112
+ SyntaxConditionalExpression = 'ConditionalExpression',
113
+ SyntaxIdentifier = 'Identifier',
114
+ SyntaxLiteral = 'Literal',
115
+ SyntaxLogicalExpression = 'LogicalExpression',
116
+ SyntaxMemberExpression = 'MemberExpression',
117
+ SyntaxObjectExpression = 'ObjectExpression',
118
+ SyntaxProperty = 'Property',
119
+ SyntaxUnaryExpression = 'UnaryExpression';
120
+
121
+ // Error messages should be identical to V8.
122
+ var MessageUnexpectedToken = 'Unexpected token %0',
123
+ MessageUnexpectedNumber = 'Unexpected number',
124
+ MessageUnexpectedString = 'Unexpected string',
125
+ MessageUnexpectedIdentifier = 'Unexpected identifier',
126
+ MessageUnexpectedReserved = 'Unexpected reserved word',
127
+ MessageUnexpectedEOS = 'Unexpected end of input',
128
+ MessageInvalidRegExp = 'Invalid regular expression',
129
+ MessageUnterminatedRegExp = 'Invalid regular expression: missing /',
130
+ MessageStrictOctalLiteral = 'Octal literals are not allowed in strict mode.',
131
+ MessageStrictDuplicateProperty = 'Duplicate data property in object literal not allowed in strict mode';
132
+ var ILLEGAL = 'ILLEGAL',
133
+ DISABLED = 'Disabled.';
134
+
135
+ // See also tools/generate-unicode-regex.py.
136
+ var RegexNonAsciiIdentifierStart = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),
137
+ // eslint-disable-next-line no-misleading-character-class
138
+ RegexNonAsciiIdentifierPart = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]');
139
+
140
+ // Ensure the condition is true, otherwise throw an error.
141
+ // This is only to have a better contract semantic, i.e. another safety net
142
+ // to catch a logic error. The condition shall be fulfilled in normal case.
143
+ // Do NOT use this to enforce a certain condition on any user input.
144
+
145
+ function assert(condition, message) {
146
+ /* istanbul ignore next */
147
+ if (!condition) {
148
+ throw new Error('ASSERT: ' + message);
149
+ }
150
+ }
151
+ function isDecimalDigit(ch) {
152
+ return ch >= 0x30 && ch <= 0x39; // 0..9
153
+ }
154
+ function isHexDigit(ch) {
155
+ return '0123456789abcdefABCDEF'.includes(ch);
156
+ }
157
+ function isOctalDigit(ch) {
158
+ return '01234567'.includes(ch);
159
+ }
160
+
161
+ // 7.2 White Space
162
+
163
+ function isWhiteSpace(ch) {
164
+ return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].includes(ch);
165
+ }
166
+
167
+ // 7.3 Line Terminators
168
+
169
+ function isLineTerminator(ch) {
170
+ return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
171
+ }
172
+
173
+ // 7.6 Identifier Names and Identifiers
174
+
175
+ function isIdentifierStart(ch) {
176
+ return ch === 0x24 || ch === 0x5F ||
177
+ // $ (dollar) and _ (underscore)
178
+ ch >= 0x41 && ch <= 0x5A ||
179
+ // A..Z
180
+ ch >= 0x61 && ch <= 0x7A ||
181
+ // a..z
182
+ ch === 0x5C ||
183
+ // \ (backslash)
184
+ ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));
185
+ }
186
+ function isIdentifierPart(ch) {
187
+ return ch === 0x24 || ch === 0x5F ||
188
+ // $ (dollar) and _ (underscore)
189
+ ch >= 0x41 && ch <= 0x5A ||
190
+ // A..Z
191
+ ch >= 0x61 && ch <= 0x7A ||
192
+ // a..z
193
+ ch >= 0x30 && ch <= 0x39 ||
194
+ // 0..9
195
+ ch === 0x5C ||
196
+ // \ (backslash)
197
+ ch >= 0x80 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch));
198
+ }
199
+
200
+ // 7.6.1.1 Keywords
201
+
202
+ const keywords = {
203
+ 'if': 1,
204
+ 'in': 1,
205
+ 'do': 1,
206
+ 'var': 1,
207
+ 'for': 1,
208
+ 'new': 1,
209
+ 'try': 1,
210
+ 'let': 1,
211
+ 'this': 1,
212
+ 'else': 1,
213
+ 'case': 1,
214
+ 'void': 1,
215
+ 'with': 1,
216
+ 'enum': 1,
217
+ 'while': 1,
218
+ 'break': 1,
219
+ 'catch': 1,
220
+ 'throw': 1,
221
+ 'const': 1,
222
+ 'yield': 1,
223
+ 'class': 1,
224
+ 'super': 1,
225
+ 'return': 1,
226
+ 'typeof': 1,
227
+ 'delete': 1,
228
+ 'switch': 1,
229
+ 'export': 1,
230
+ 'import': 1,
231
+ 'public': 1,
232
+ 'static': 1,
233
+ 'default': 1,
234
+ 'finally': 1,
235
+ 'extends': 1,
236
+ 'package': 1,
237
+ 'private': 1,
238
+ 'function': 1,
239
+ 'continue': 1,
240
+ 'debugger': 1,
241
+ 'interface': 1,
242
+ 'protected': 1,
243
+ 'instanceof': 1,
244
+ 'implements': 1
245
+ };
246
+ function skipComment() {
247
+ while (index < length) {
248
+ const ch = source.charCodeAt(index);
249
+ if (isWhiteSpace(ch) || isLineTerminator(ch)) {
250
+ ++index;
251
+ } else {
252
+ break;
253
+ }
254
+ }
255
+ }
256
+ function scanHexEscape(prefix) {
257
+ var i,
258
+ len,
259
+ ch,
260
+ code = 0;
261
+ len = prefix === 'u' ? 4 : 2;
262
+ for (i = 0; i < len; ++i) {
263
+ if (index < length && isHexDigit(source[index])) {
264
+ ch = source[index++];
265
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
266
+ } else {
267
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
268
+ }
269
+ }
270
+ return String.fromCharCode(code);
271
+ }
272
+ function scanUnicodeCodePointEscape() {
273
+ var ch, code, cu1, cu2;
274
+ ch = source[index];
275
+ code = 0;
276
+
277
+ // At least, one hex digit is required.
278
+ if (ch === '}') {
279
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
280
+ }
281
+ while (index < length) {
282
+ ch = source[index++];
283
+ if (!isHexDigit(ch)) {
284
+ break;
285
+ }
286
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
287
+ }
288
+ if (code > 0x10FFFF || ch !== '}') {
289
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
290
+ }
291
+
292
+ // UTF-16 Encoding
293
+ if (code <= 0xFFFF) {
294
+ return String.fromCharCode(code);
295
+ }
296
+ cu1 = (code - 0x10000 >> 10) + 0xD800;
297
+ cu2 = (code - 0x10000 & 1023) + 0xDC00;
298
+ return String.fromCharCode(cu1, cu2);
299
+ }
300
+ function getEscapedIdentifier() {
301
+ var ch, id;
302
+ ch = source.charCodeAt(index++);
303
+ id = String.fromCharCode(ch);
304
+
305
+ // '\u' (U+005C, U+0075) denotes an escaped character.
306
+ if (ch === 0x5C) {
307
+ if (source.charCodeAt(index) !== 0x75) {
308
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
309
+ }
310
+ ++index;
311
+ ch = scanHexEscape('u');
312
+ if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) {
313
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
314
+ }
315
+ id = ch;
316
+ }
317
+ while (index < length) {
318
+ ch = source.charCodeAt(index);
319
+ if (!isIdentifierPart(ch)) {
320
+ break;
321
+ }
322
+ ++index;
323
+ id += String.fromCharCode(ch);
324
+
325
+ // '\u' (U+005C, U+0075) denotes an escaped character.
326
+ if (ch === 0x5C) {
327
+ id = id.substr(0, id.length - 1);
328
+ if (source.charCodeAt(index) !== 0x75) {
329
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
330
+ }
331
+ ++index;
332
+ ch = scanHexEscape('u');
333
+ if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) {
334
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
335
+ }
336
+ id += ch;
337
+ }
338
+ }
339
+ return id;
340
+ }
341
+ function getIdentifier() {
342
+ var start, ch;
343
+ start = index++;
344
+ while (index < length) {
345
+ ch = source.charCodeAt(index);
346
+ if (ch === 0x5C) {
347
+ // Blackslash (U+005C) marks Unicode escape sequence.
348
+ index = start;
349
+ return getEscapedIdentifier();
350
+ }
351
+ if (isIdentifierPart(ch)) {
352
+ ++index;
353
+ } else {
354
+ break;
355
+ }
356
+ }
357
+ return source.slice(start, index);
358
+ }
359
+ function scanIdentifier() {
360
+ var start, id, type;
361
+ start = index;
362
+
363
+ // Backslash (U+005C) starts an escaped character.
364
+ id = source.charCodeAt(index) === 0x5C ? getEscapedIdentifier() : getIdentifier();
365
+
366
+ // There is no keyword or literal with only one character.
367
+ // Thus, it must be an identifier.
368
+ if (id.length === 1) {
369
+ type = TokenIdentifier;
370
+ } else if (keywords.hasOwnProperty(id)) {
371
+ // eslint-disable-line no-prototype-builtins
372
+ type = TokenKeyword;
373
+ } else if (id === 'null') {
374
+ type = TokenNullLiteral;
375
+ } else if (id === 'true' || id === 'false') {
376
+ type = TokenBooleanLiteral;
377
+ } else {
378
+ type = TokenIdentifier;
379
+ }
380
+ return {
381
+ type: type,
382
+ value: id,
383
+ start: start,
384
+ end: index
385
+ };
386
+ }
387
+
388
+ // 7.7 Punctuators
389
+
390
+ function scanPunctuator() {
391
+ var start = index,
392
+ code = source.charCodeAt(index),
393
+ code2,
394
+ ch1 = source[index],
395
+ ch2,
396
+ ch3,
397
+ ch4;
398
+ switch (code) {
399
+ // Check for most common single-character punctuators.
400
+ case 0x2E: // . dot
401
+ case 0x28: // ( open bracket
402
+ case 0x29: // ) close bracket
403
+ case 0x3B: // ; semicolon
404
+ case 0x2C: // , comma
405
+ case 0x7B: // { open curly brace
406
+ case 0x7D: // } close curly brace
407
+ case 0x5B: // [
408
+ case 0x5D: // ]
409
+ case 0x3A: // :
410
+ case 0x3F: // ?
411
+ case 0x7E:
412
+ // ~
413
+ ++index;
414
+ return {
415
+ type: TokenPunctuator,
416
+ value: String.fromCharCode(code),
417
+ start: start,
418
+ end: index
419
+ };
420
+ default:
421
+ code2 = source.charCodeAt(index + 1);
422
+
423
+ // '=' (U+003D) marks an assignment or comparison operator.
424
+ if (code2 === 0x3D) {
425
+ switch (code) {
426
+ case 0x2B: // +
427
+ case 0x2D: // -
428
+ case 0x2F: // /
429
+ case 0x3C: // <
430
+ case 0x3E: // >
431
+ case 0x5E: // ^
432
+ case 0x7C: // |
433
+ case 0x25: // %
434
+ case 0x26: // &
435
+ case 0x2A:
436
+ // *
437
+ index += 2;
438
+ return {
439
+ type: TokenPunctuator,
440
+ value: String.fromCharCode(code) + String.fromCharCode(code2),
441
+ start: start,
442
+ end: index
443
+ };
444
+ case 0x21: // !
445
+ case 0x3D:
446
+ // =
447
+ index += 2;
448
+
449
+ // !== and ===
450
+ if (source.charCodeAt(index) === 0x3D) {
451
+ ++index;
452
+ }
453
+ return {
454
+ type: TokenPunctuator,
455
+ value: source.slice(start, index),
456
+ start: start,
457
+ end: index
458
+ };
459
+ }
460
+ }
461
+ }
462
+
463
+ // 4-character punctuator: >>>=
464
+
465
+ ch4 = source.substr(index, 4);
466
+ if (ch4 === '>>>=') {
467
+ index += 4;
468
+ return {
469
+ type: TokenPunctuator,
470
+ value: ch4,
471
+ start: start,
472
+ end: index
473
+ };
474
+ }
475
+
476
+ // 3-character punctuators: === !== >>> <<= >>=
477
+
478
+ ch3 = ch4.substr(0, 3);
479
+ if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {
480
+ index += 3;
481
+ return {
482
+ type: TokenPunctuator,
483
+ value: ch3,
484
+ start: start,
485
+ end: index
486
+ };
487
+ }
488
+
489
+ // Other 2-character punctuators: ++ -- << >> && ||
490
+ ch2 = ch3.substr(0, 2);
491
+ if (ch1 === ch2[1] && '+-<>&|'.includes(ch1) || ch2 === '=>') {
492
+ index += 2;
493
+ return {
494
+ type: TokenPunctuator,
495
+ value: ch2,
496
+ start: start,
497
+ end: index
498
+ };
499
+ }
500
+ if (ch2 === '//') {
501
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
502
+ }
503
+
504
+ // 1-character punctuators: < > = ! + - * % & | ^ /
505
+
506
+ if ('<>=!+-*%&|^/'.includes(ch1)) {
507
+ ++index;
508
+ return {
509
+ type: TokenPunctuator,
510
+ value: ch1,
511
+ start: start,
512
+ end: index
513
+ };
514
+ }
515
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
516
+ }
517
+
518
+ // 7.8.3 Numeric Literals
519
+
520
+ function scanHexLiteral(start) {
521
+ let number = '';
522
+ while (index < length) {
523
+ if (!isHexDigit(source[index])) {
524
+ break;
525
+ }
526
+ number += source[index++];
527
+ }
528
+ if (number.length === 0) {
529
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
530
+ }
531
+ if (isIdentifierStart(source.charCodeAt(index))) {
532
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
533
+ }
534
+ return {
535
+ type: TokenNumericLiteral,
536
+ value: parseInt('0x' + number, 16),
537
+ start: start,
538
+ end: index
539
+ };
540
+ }
541
+ function scanOctalLiteral(start) {
542
+ let number = '0' + source[index++];
543
+ while (index < length) {
544
+ if (!isOctalDigit(source[index])) {
545
+ break;
546
+ }
547
+ number += source[index++];
548
+ }
549
+ if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {
550
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
551
+ }
552
+ return {
553
+ type: TokenNumericLiteral,
554
+ value: parseInt(number, 8),
555
+ octal: true,
556
+ start: start,
557
+ end: index
558
+ };
559
+ }
560
+ function scanNumericLiteral() {
561
+ var number, start, ch;
562
+ ch = source[index];
563
+ assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');
564
+ start = index;
565
+ number = '';
566
+ if (ch !== '.') {
567
+ number = source[index++];
568
+ ch = source[index];
569
+
570
+ // Hex number starts with '0x'.
571
+ // Octal number starts with '0'.
572
+ if (number === '0') {
573
+ if (ch === 'x' || ch === 'X') {
574
+ ++index;
575
+ return scanHexLiteral(start);
576
+ }
577
+ if (isOctalDigit(ch)) {
578
+ return scanOctalLiteral(start);
579
+ }
580
+
581
+ // decimal number starts with '0' such as '09' is illegal.
582
+ if (ch && isDecimalDigit(ch.charCodeAt(0))) {
583
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
584
+ }
585
+ }
586
+ while (isDecimalDigit(source.charCodeAt(index))) {
587
+ number += source[index++];
588
+ }
589
+ ch = source[index];
590
+ }
591
+ if (ch === '.') {
592
+ number += source[index++];
593
+ while (isDecimalDigit(source.charCodeAt(index))) {
594
+ number += source[index++];
595
+ }
596
+ ch = source[index];
597
+ }
598
+ if (ch === 'e' || ch === 'E') {
599
+ number += source[index++];
600
+ ch = source[index];
601
+ if (ch === '+' || ch === '-') {
602
+ number += source[index++];
603
+ }
604
+ if (isDecimalDigit(source.charCodeAt(index))) {
605
+ while (isDecimalDigit(source.charCodeAt(index))) {
606
+ number += source[index++];
607
+ }
608
+ } else {
609
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
610
+ }
611
+ }
612
+ if (isIdentifierStart(source.charCodeAt(index))) {
613
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
614
+ }
615
+ return {
616
+ type: TokenNumericLiteral,
617
+ value: parseFloat(number),
618
+ start: start,
619
+ end: index
620
+ };
621
+ }
622
+
623
+ // 7.8.4 String Literals
624
+
625
+ function scanStringLiteral() {
626
+ var str = '',
627
+ quote,
628
+ start,
629
+ ch,
630
+ code,
631
+ octal = false;
632
+ quote = source[index];
633
+ assert(quote === '\'' || quote === '"', 'String literal must starts with a quote');
634
+ start = index;
635
+ ++index;
636
+ while (index < length) {
637
+ ch = source[index++];
638
+ if (ch === quote) {
639
+ quote = '';
640
+ break;
641
+ } else if (ch === '\\') {
642
+ ch = source[index++];
643
+ if (!ch || !isLineTerminator(ch.charCodeAt(0))) {
644
+ switch (ch) {
645
+ case 'u':
646
+ case 'x':
647
+ if (source[index] === '{') {
648
+ ++index;
649
+ str += scanUnicodeCodePointEscape();
650
+ } else {
651
+ str += scanHexEscape(ch);
652
+ }
653
+ break;
654
+ case 'n':
655
+ str += '\n';
656
+ break;
657
+ case 'r':
658
+ str += '\r';
659
+ break;
660
+ case 't':
661
+ str += '\t';
662
+ break;
663
+ case 'b':
664
+ str += '\b';
665
+ break;
666
+ case 'f':
667
+ str += '\f';
668
+ break;
669
+ case 'v':
670
+ str += '\x0B';
671
+ break;
672
+ default:
673
+ if (isOctalDigit(ch)) {
674
+ code = '01234567'.indexOf(ch);
675
+
676
+ // \0 is not octal escape sequence
677
+ if (code !== 0) {
678
+ octal = true;
679
+ }
680
+ if (index < length && isOctalDigit(source[index])) {
681
+ octal = true;
682
+ code = code * 8 + '01234567'.indexOf(source[index++]);
683
+
684
+ // 3 digits are only allowed when string starts
685
+ // with 0, 1, 2, 3
686
+ if ('0123'.includes(ch) && index < length && isOctalDigit(source[index])) {
687
+ code = code * 8 + '01234567'.indexOf(source[index++]);
688
+ }
689
+ }
690
+ str += String.fromCharCode(code);
691
+ } else {
692
+ str += ch;
693
+ }
694
+ break;
695
+ }
696
+ } else {
697
+ if (ch === '\r' && source[index] === '\n') {
698
+ ++index;
699
+ }
700
+ }
701
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
702
+ break;
703
+ } else {
704
+ str += ch;
705
+ }
706
+ }
707
+ if (quote !== '') {
708
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
709
+ }
710
+ return {
711
+ type: TokenStringLiteral,
712
+ value: str,
713
+ octal: octal,
714
+ start: start,
715
+ end: index
716
+ };
717
+ }
718
+ function testRegExp(pattern, flags) {
719
+ let tmp = pattern;
720
+ if (flags.includes('u')) {
721
+ // Replace each astral symbol and every Unicode code point
722
+ // escape sequence with a single ASCII symbol to avoid throwing on
723
+ // regular expressions that are only valid in combination with the
724
+ // `/u` flag.
725
+ // Note: replacing with the ASCII symbol `x` might cause false
726
+ // negatives in unlikely scenarios. For example, `[\u{61}-b]` is a
727
+ // perfectly valid pattern that is equivalent to `[a-b]`, but it
728
+ // would be replaced by `[x-b]` which throws an error.
729
+ tmp = tmp.replace(/\\u\{([0-9a-fA-F]+)\}/g, ($0, $1) => {
730
+ if (parseInt($1, 16) <= 0x10FFFF) {
731
+ return 'x';
732
+ }
733
+ throwError({}, MessageInvalidRegExp);
734
+ }).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, 'x');
735
+ }
736
+
737
+ // First, detect invalid regular expressions.
738
+ try {
739
+ new RegExp(tmp);
740
+ } catch (e) {
741
+ throwError({}, MessageInvalidRegExp);
742
+ }
743
+
744
+ // Return a regular expression object for this pattern-flag pair, or
745
+ // `null` in case the current environment doesn't support the flags it
746
+ // uses.
747
+ try {
748
+ return new RegExp(pattern, flags);
749
+ } catch (exception) {
750
+ return null;
751
+ }
752
+ }
753
+ function scanRegExpBody() {
754
+ var ch, str, classMarker, terminated, body;
755
+ ch = source[index];
756
+ assert(ch === '/', 'Regular expression literal must start with a slash');
757
+ str = source[index++];
758
+ classMarker = false;
759
+ terminated = false;
760
+ while (index < length) {
761
+ ch = source[index++];
762
+ str += ch;
763
+ if (ch === '\\') {
764
+ ch = source[index++];
765
+ // ECMA-262 7.8.5
766
+ if (isLineTerminator(ch.charCodeAt(0))) {
767
+ throwError({}, MessageUnterminatedRegExp);
768
+ }
769
+ str += ch;
770
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
771
+ throwError({}, MessageUnterminatedRegExp);
772
+ } else if (classMarker) {
773
+ if (ch === ']') {
774
+ classMarker = false;
775
+ }
776
+ } else {
777
+ if (ch === '/') {
778
+ terminated = true;
779
+ break;
780
+ } else if (ch === '[') {
781
+ classMarker = true;
782
+ }
783
+ }
784
+ }
785
+ if (!terminated) {
786
+ throwError({}, MessageUnterminatedRegExp);
787
+ }
788
+
789
+ // Exclude leading and trailing slash.
790
+ body = str.substr(1, str.length - 2);
791
+ return {
792
+ value: body,
793
+ literal: str
794
+ };
795
+ }
796
+ function scanRegExpFlags() {
797
+ var ch, str, flags;
798
+ str = '';
799
+ flags = '';
800
+ while (index < length) {
801
+ ch = source[index];
802
+ if (!isIdentifierPart(ch.charCodeAt(0))) {
803
+ break;
804
+ }
805
+ ++index;
806
+ if (ch === '\\' && index < length) {
807
+ throwError({}, MessageUnexpectedToken, ILLEGAL);
808
+ } else {
809
+ flags += ch;
810
+ str += ch;
811
+ }
812
+ }
813
+ if (flags.search(/[^gimuy]/g) >= 0) {
814
+ throwError({}, MessageInvalidRegExp, flags);
815
+ }
816
+ return {
817
+ value: flags,
818
+ literal: str
819
+ };
820
+ }
821
+ function scanRegExp() {
822
+ var start, body, flags, value;
823
+ lookahead = null;
824
+ skipComment();
825
+ start = index;
826
+ body = scanRegExpBody();
827
+ flags = scanRegExpFlags();
828
+ value = testRegExp(body.value, flags.value);
829
+ return {
830
+ literal: body.literal + flags.literal,
831
+ value: value,
832
+ regex: {
833
+ pattern: body.value,
834
+ flags: flags.value
835
+ },
836
+ start: start,
837
+ end: index
838
+ };
839
+ }
840
+ function isIdentifierName(token) {
841
+ return token.type === TokenIdentifier || token.type === TokenKeyword || token.type === TokenBooleanLiteral || token.type === TokenNullLiteral;
842
+ }
843
+ function advance() {
844
+ skipComment();
845
+ if (index >= length) {
846
+ return {
847
+ type: TokenEOF,
848
+ start: index,
849
+ end: index
850
+ };
851
+ }
852
+ const ch = source.charCodeAt(index);
853
+ if (isIdentifierStart(ch)) {
854
+ return scanIdentifier();
855
+ }
856
+
857
+ // Very common: ( and ) and ;
858
+ if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {
859
+ return scanPunctuator();
860
+ }
861
+
862
+ // String literal starts with single quote (U+0027) or double quote (U+0022).
863
+ if (ch === 0x27 || ch === 0x22) {
864
+ return scanStringLiteral();
865
+ }
866
+
867
+ // Dot (.) U+002E can also start a floating-point number, hence the need
868
+ // to check the next character.
869
+ if (ch === 0x2E) {
870
+ if (isDecimalDigit(source.charCodeAt(index + 1))) {
871
+ return scanNumericLiteral();
872
+ }
873
+ return scanPunctuator();
874
+ }
875
+ if (isDecimalDigit(ch)) {
876
+ return scanNumericLiteral();
877
+ }
878
+ return scanPunctuator();
879
+ }
880
+ function lex() {
881
+ const token = lookahead;
882
+ index = token.end;
883
+ lookahead = advance();
884
+ index = token.end;
885
+ return token;
886
+ }
887
+ function peek() {
888
+ const pos = index;
889
+ lookahead = advance();
890
+ index = pos;
891
+ }
892
+ function finishArrayExpression(elements) {
893
+ const node = new ASTNode(SyntaxArrayExpression);
894
+ node.elements = elements;
895
+ return node;
896
+ }
897
+ function finishBinaryExpression(operator, left, right) {
898
+ const node = new ASTNode(operator === '||' || operator === '&&' ? SyntaxLogicalExpression : SyntaxBinaryExpression);
899
+ node.operator = operator;
900
+ node.left = left;
901
+ node.right = right;
902
+ return node;
903
+ }
904
+ function finishCallExpression(callee, args) {
905
+ const node = new ASTNode(SyntaxCallExpression);
906
+ node.callee = callee;
907
+ node.arguments = args;
908
+ return node;
909
+ }
910
+ function finishConditionalExpression(test, consequent, alternate) {
911
+ const node = new ASTNode(SyntaxConditionalExpression);
912
+ node.test = test;
913
+ node.consequent = consequent;
914
+ node.alternate = alternate;
915
+ return node;
916
+ }
917
+ function finishIdentifier(name) {
918
+ const node = new ASTNode(SyntaxIdentifier);
919
+ node.name = name;
920
+ return node;
921
+ }
922
+ function finishLiteral(token) {
923
+ const node = new ASTNode(SyntaxLiteral);
924
+ node.value = token.value;
925
+ node.raw = source.slice(token.start, token.end);
926
+ if (token.regex) {
927
+ if (node.raw === '//') {
928
+ node.raw = '/(?:)/';
929
+ }
930
+ node.regex = token.regex;
931
+ }
932
+ return node;
933
+ }
934
+ function finishMemberExpression(accessor, object, property) {
935
+ const node = new ASTNode(SyntaxMemberExpression);
936
+ node.computed = accessor === '[';
937
+ node.object = object;
938
+ node.property = property;
939
+ if (!node.computed) property.member = true;
940
+ return node;
941
+ }
942
+ function finishObjectExpression(properties) {
943
+ const node = new ASTNode(SyntaxObjectExpression);
944
+ node.properties = properties;
945
+ return node;
946
+ }
947
+ function finishProperty(kind, key, value) {
948
+ const node = new ASTNode(SyntaxProperty);
949
+ node.key = key;
950
+ node.value = value;
951
+ node.kind = kind;
952
+ return node;
953
+ }
954
+ function finishUnaryExpression(operator, argument) {
955
+ const node = new ASTNode(SyntaxUnaryExpression);
956
+ node.operator = operator;
957
+ node.argument = argument;
958
+ node.prefix = true;
959
+ return node;
960
+ }
961
+
962
+ // Throw an exception
963
+
964
+ function throwError(token, messageFormat) {
965
+ var error,
966
+ args = Array.prototype.slice.call(arguments, 2),
967
+ msg = messageFormat.replace(/%(\d)/g, (whole, index) => {
968
+ assert(index < args.length, 'Message reference must be in range');
969
+ return args[index];
970
+ });
971
+ error = new Error(msg);
972
+ error.index = index;
973
+ error.description = msg;
974
+ throw error;
975
+ }
976
+
977
+ // Throw an exception because of the token.
978
+
979
+ function throwUnexpected(token) {
980
+ if (token.type === TokenEOF) {
981
+ throwError(token, MessageUnexpectedEOS);
982
+ }
983
+ if (token.type === TokenNumericLiteral) {
984
+ throwError(token, MessageUnexpectedNumber);
985
+ }
986
+ if (token.type === TokenStringLiteral) {
987
+ throwError(token, MessageUnexpectedString);
988
+ }
989
+ if (token.type === TokenIdentifier) {
990
+ throwError(token, MessageUnexpectedIdentifier);
991
+ }
992
+ if (token.type === TokenKeyword) {
993
+ throwError(token, MessageUnexpectedReserved);
994
+ }
995
+
996
+ // BooleanLiteral, NullLiteral, or Punctuator.
997
+ throwError(token, MessageUnexpectedToken, token.value);
998
+ }
999
+
1000
+ // Expect the next token to match the specified punctuator.
1001
+ // If not, an exception will be thrown.
1002
+
1003
+ function expect(value) {
1004
+ const token = lex();
1005
+ if (token.type !== TokenPunctuator || token.value !== value) {
1006
+ throwUnexpected(token);
1007
+ }
1008
+ }
1009
+
1010
+ // Return true if the next token matches the specified punctuator.
1011
+
1012
+ function match(value) {
1013
+ return lookahead.type === TokenPunctuator && lookahead.value === value;
1014
+ }
1015
+
1016
+ // Return true if the next token matches the specified keyword
1017
+
1018
+ function matchKeyword(keyword) {
1019
+ return lookahead.type === TokenKeyword && lookahead.value === keyword;
1020
+ }
1021
+
1022
+ // 11.1.4 Array Initialiser
1023
+
1024
+ function parseArrayInitialiser() {
1025
+ const elements = [];
1026
+ index = lookahead.start;
1027
+ expect('[');
1028
+ while (!match(']')) {
1029
+ if (match(',')) {
1030
+ lex();
1031
+ elements.push(null);
1032
+ } else {
1033
+ elements.push(parseConditionalExpression());
1034
+ if (!match(']')) {
1035
+ expect(',');
1036
+ }
1037
+ }
1038
+ }
1039
+ lex();
1040
+ return finishArrayExpression(elements);
1041
+ }
1042
+
1043
+ // 11.1.5 Object Initialiser
1044
+
1045
+ function parseObjectPropertyKey() {
1046
+ index = lookahead.start;
1047
+ const token = lex();
1048
+
1049
+ // Note: This function is called only from parseObjectProperty(), where
1050
+ // EOF and Punctuator tokens are already filtered out.
1051
+
1052
+ if (token.type === TokenStringLiteral || token.type === TokenNumericLiteral) {
1053
+ if (token.octal) {
1054
+ throwError(token, MessageStrictOctalLiteral);
1055
+ }
1056
+ return finishLiteral(token);
1057
+ }
1058
+ return finishIdentifier(token.value);
1059
+ }
1060
+ function parseObjectProperty() {
1061
+ var token, key, id, value;
1062
+ index = lookahead.start;
1063
+ token = lookahead;
1064
+ if (token.type === TokenIdentifier) {
1065
+ id = parseObjectPropertyKey();
1066
+ expect(':');
1067
+ value = parseConditionalExpression();
1068
+ return finishProperty('init', id, value);
1069
+ }
1070
+ if (token.type === TokenEOF || token.type === TokenPunctuator) {
1071
+ throwUnexpected(token);
1072
+ } else {
1073
+ key = parseObjectPropertyKey();
1074
+ expect(':');
1075
+ value = parseConditionalExpression();
1076
+ return finishProperty('init', key, value);
1077
+ }
1078
+ }
1079
+ function parseObjectInitialiser() {
1080
+ var properties = [],
1081
+ property,
1082
+ name,
1083
+ key,
1084
+ map = {},
1085
+ toString = String;
1086
+ index = lookahead.start;
1087
+ expect('{');
1088
+ while (!match('}')) {
1089
+ property = parseObjectProperty();
1090
+ if (property.key.type === SyntaxIdentifier) {
1091
+ name = property.key.name;
1092
+ } else {
1093
+ name = toString(property.key.value);
1094
+ }
1095
+ key = '$' + name;
1096
+ if (Object.prototype.hasOwnProperty.call(map, key)) {
1097
+ throwError({}, MessageStrictDuplicateProperty);
1098
+ } else {
1099
+ map[key] = true;
1100
+ }
1101
+ properties.push(property);
1102
+ if (!match('}')) {
1103
+ expect(',');
1104
+ }
1105
+ }
1106
+ expect('}');
1107
+ return finishObjectExpression(properties);
1108
+ }
1109
+
1110
+ // 11.1.6 The Grouping Operator
1111
+
1112
+ function parseGroupExpression() {
1113
+ expect('(');
1114
+ const expr = parseExpression();
1115
+ expect(')');
1116
+ return expr;
1117
+ }
1118
+
1119
+ // 11.1 Primary Expressions
1120
+
1121
+ const legalKeywords = {
1122
+ 'if': 1
1123
+ };
1124
+ function parsePrimaryExpression() {
1125
+ var type, token, expr;
1126
+ if (match('(')) {
1127
+ return parseGroupExpression();
1128
+ }
1129
+ if (match('[')) {
1130
+ return parseArrayInitialiser();
1131
+ }
1132
+ if (match('{')) {
1133
+ return parseObjectInitialiser();
1134
+ }
1135
+ type = lookahead.type;
1136
+ index = lookahead.start;
1137
+ if (type === TokenIdentifier || legalKeywords[lookahead.value]) {
1138
+ expr = finishIdentifier(lex().value);
1139
+ } else if (type === TokenStringLiteral || type === TokenNumericLiteral) {
1140
+ if (lookahead.octal) {
1141
+ throwError(lookahead, MessageStrictOctalLiteral);
1142
+ }
1143
+ expr = finishLiteral(lex());
1144
+ } else if (type === TokenKeyword) {
1145
+ throw new Error(DISABLED);
1146
+ } else if (type === TokenBooleanLiteral) {
1147
+ token = lex();
1148
+ token.value = token.value === 'true';
1149
+ expr = finishLiteral(token);
1150
+ } else if (type === TokenNullLiteral) {
1151
+ token = lex();
1152
+ token.value = null;
1153
+ expr = finishLiteral(token);
1154
+ } else if (match('/') || match('/=')) {
1155
+ expr = finishLiteral(scanRegExp());
1156
+ peek();
1157
+ } else {
1158
+ throwUnexpected(lex());
1159
+ }
1160
+ return expr;
1161
+ }
1162
+
1163
+ // 11.2 Left-Hand-Side Expressions
1164
+
1165
+ function parseArguments() {
1166
+ const args = [];
1167
+ expect('(');
1168
+ if (!match(')')) {
1169
+ while (index < length) {
1170
+ args.push(parseConditionalExpression());
1171
+ if (match(')')) {
1172
+ break;
1173
+ }
1174
+ expect(',');
1175
+ }
1176
+ }
1177
+ expect(')');
1178
+ return args;
1179
+ }
1180
+ function parseNonComputedProperty() {
1181
+ index = lookahead.start;
1182
+ const token = lex();
1183
+ if (!isIdentifierName(token)) {
1184
+ throwUnexpected(token);
1185
+ }
1186
+ return finishIdentifier(token.value);
1187
+ }
1188
+ function parseNonComputedMember() {
1189
+ expect('.');
1190
+ return parseNonComputedProperty();
1191
+ }
1192
+ function parseComputedMember() {
1193
+ expect('[');
1194
+ const expr = parseExpression();
1195
+ expect(']');
1196
+ return expr;
1197
+ }
1198
+ function parseLeftHandSideExpressionAllowCall() {
1199
+ var expr, args, property;
1200
+ expr = parsePrimaryExpression();
1201
+ for (;;) {
1202
+ if (match('.')) {
1203
+ property = parseNonComputedMember();
1204
+ expr = finishMemberExpression('.', expr, property);
1205
+ } else if (match('(')) {
1206
+ args = parseArguments();
1207
+ expr = finishCallExpression(expr, args);
1208
+ } else if (match('[')) {
1209
+ property = parseComputedMember();
1210
+ expr = finishMemberExpression('[', expr, property);
1211
+ } else {
1212
+ break;
1213
+ }
1214
+ }
1215
+ return expr;
1216
+ }
1217
+
1218
+ // 11.3 Postfix Expressions
1219
+
1220
+ function parsePostfixExpression() {
1221
+ const expr = parseLeftHandSideExpressionAllowCall();
1222
+ if (lookahead.type === TokenPunctuator) {
1223
+ if (match('++') || match('--')) {
1224
+ throw new Error(DISABLED);
1225
+ }
1226
+ }
1227
+ return expr;
1228
+ }
1229
+
1230
+ // 11.4 Unary Operators
1231
+
1232
+ function parseUnaryExpression() {
1233
+ var token, expr;
1234
+ if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {
1235
+ expr = parsePostfixExpression();
1236
+ } else if (match('++') || match('--')) {
1237
+ throw new Error(DISABLED);
1238
+ } else if (match('+') || match('-') || match('~') || match('!')) {
1239
+ token = lex();
1240
+ expr = parseUnaryExpression();
1241
+ expr = finishUnaryExpression(token.value, expr);
1242
+ } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {
1243
+ throw new Error(DISABLED);
1244
+ } else {
1245
+ expr = parsePostfixExpression();
1246
+ }
1247
+ return expr;
1248
+ }
1249
+ function binaryPrecedence(token) {
1250
+ let prec = 0;
1251
+ if (token.type !== TokenPunctuator && token.type !== TokenKeyword) {
1252
+ return 0;
1253
+ }
1254
+ switch (token.value) {
1255
+ case '||':
1256
+ prec = 1;
1257
+ break;
1258
+ case '&&':
1259
+ prec = 2;
1260
+ break;
1261
+ case '|':
1262
+ prec = 3;
1263
+ break;
1264
+ case '^':
1265
+ prec = 4;
1266
+ break;
1267
+ case '&':
1268
+ prec = 5;
1269
+ break;
1270
+ case '==':
1271
+ case '!=':
1272
+ case '===':
1273
+ case '!==':
1274
+ prec = 6;
1275
+ break;
1276
+ case '<':
1277
+ case '>':
1278
+ case '<=':
1279
+ case '>=':
1280
+ case 'instanceof':
1281
+ case 'in':
1282
+ prec = 7;
1283
+ break;
1284
+ case '<<':
1285
+ case '>>':
1286
+ case '>>>':
1287
+ prec = 8;
1288
+ break;
1289
+ case '+':
1290
+ case '-':
1291
+ prec = 9;
1292
+ break;
1293
+ case '*':
1294
+ case '/':
1295
+ case '%':
1296
+ prec = 11;
1297
+ break;
1298
+ }
1299
+ return prec;
1300
+ }
1301
+
1302
+ // 11.5 Multiplicative Operators
1303
+ // 11.6 Additive Operators
1304
+ // 11.7 Bitwise Shift Operators
1305
+ // 11.8 Relational Operators
1306
+ // 11.9 Equality Operators
1307
+ // 11.10 Binary Bitwise Operators
1308
+ // 11.11 Binary Logical Operators
1309
+
1310
+ function parseBinaryExpression() {
1311
+ var marker, markers, expr, token, prec, stack, right, operator, left, i;
1312
+ marker = lookahead;
1313
+ left = parseUnaryExpression();
1314
+ token = lookahead;
1315
+ prec = binaryPrecedence(token);
1316
+ if (prec === 0) {
1317
+ return left;
1318
+ }
1319
+ token.prec = prec;
1320
+ lex();
1321
+ markers = [marker, lookahead];
1322
+ right = parseUnaryExpression();
1323
+ stack = [left, token, right];
1324
+ while ((prec = binaryPrecedence(lookahead)) > 0) {
1325
+ // Reduce: make a binary expression from the three topmost entries.
1326
+ while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {
1327
+ right = stack.pop();
1328
+ operator = stack.pop().value;
1329
+ left = stack.pop();
1330
+ markers.pop();
1331
+ expr = finishBinaryExpression(operator, left, right);
1332
+ stack.push(expr);
1333
+ }
1334
+
1335
+ // Shift.
1336
+ token = lex();
1337
+ token.prec = prec;
1338
+ stack.push(token);
1339
+ markers.push(lookahead);
1340
+ expr = parseUnaryExpression();
1341
+ stack.push(expr);
1342
+ }
1343
+
1344
+ // Final reduce to clean-up the stack.
1345
+ i = stack.length - 1;
1346
+ expr = stack[i];
1347
+ markers.pop();
1348
+ while (i > 1) {
1349
+ markers.pop();
1350
+ expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);
1351
+ i -= 2;
1352
+ }
1353
+ return expr;
1354
+ }
1355
+
1356
+ // 11.12 Conditional Operator
1357
+
1358
+ function parseConditionalExpression() {
1359
+ var expr, consequent, alternate;
1360
+ expr = parseBinaryExpression();
1361
+ if (match('?')) {
1362
+ lex();
1363
+ consequent = parseConditionalExpression();
1364
+ expect(':');
1365
+ alternate = parseConditionalExpression();
1366
+ expr = finishConditionalExpression(expr, consequent, alternate);
1367
+ }
1368
+ return expr;
1369
+ }
1370
+
1371
+ // 11.14 Comma Operator
1372
+
1373
+ function parseExpression() {
1374
+ const expr = parseConditionalExpression();
1375
+ if (match(',')) {
1376
+ throw new Error(DISABLED); // no sequence expressions
1377
+ }
1378
+ return expr;
1379
+ }
1380
+ function parser (code) {
1381
+ source = code;
1382
+ index = 0;
1383
+ length = source.length;
1384
+ lookahead = null;
1385
+ peek();
1386
+ const expr = parseExpression();
1387
+ if (lookahead.type !== TokenEOF) {
1388
+ throw new Error('Unexpect token after expression.');
1389
+ }
1390
+ return expr;
1391
+ }
1392
+
1393
+ var Constants = {
1394
+ NaN: 'NaN',
1395
+ E: 'Math.E',
1396
+ LN2: 'Math.LN2',
1397
+ LN10: 'Math.LN10',
1398
+ LOG2E: 'Math.LOG2E',
1399
+ LOG10E: 'Math.LOG10E',
1400
+ PI: 'Math.PI',
1401
+ SQRT1_2: 'Math.SQRT1_2',
1402
+ SQRT2: 'Math.SQRT2',
1403
+ MIN_VALUE: 'Number.MIN_VALUE',
1404
+ MAX_VALUE: 'Number.MAX_VALUE'
1405
+ };
1406
+
1407
+ function Functions (codegen) {
1408
+ function fncall(name, args, cast, type) {
1409
+ let obj = codegen(args[0]);
1410
+ if (cast) {
1411
+ obj = cast + '(' + obj + ')';
1412
+ if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';
1413
+ }
1414
+ return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');
1415
+ }
1416
+ function fn(name, cast, type) {
1417
+ return args => fncall(name, args, cast, type);
1418
+ }
1419
+ const DATE = 'new Date',
1420
+ STRING = 'String',
1421
+ REGEXP = 'RegExp';
1422
+ return {
1423
+ // MATH functions
1424
+ isNaN: 'Number.isNaN',
1425
+ isFinite: 'Number.isFinite',
1426
+ abs: 'Math.abs',
1427
+ acos: 'Math.acos',
1428
+ asin: 'Math.asin',
1429
+ atan: 'Math.atan',
1430
+ atan2: 'Math.atan2',
1431
+ ceil: 'Math.ceil',
1432
+ cos: 'Math.cos',
1433
+ exp: 'Math.exp',
1434
+ floor: 'Math.floor',
1435
+ hypot: 'Math.hypot',
1436
+ log: 'Math.log',
1437
+ max: 'Math.max',
1438
+ min: 'Math.min',
1439
+ pow: 'Math.pow',
1440
+ random: 'Math.random',
1441
+ round: 'Math.round',
1442
+ sin: 'Math.sin',
1443
+ sqrt: 'Math.sqrt',
1444
+ tan: 'Math.tan',
1445
+ clamp: function (args) {
1446
+ if (args.length < 3) vegaUtil.error('Missing arguments to clamp function.');
1447
+ if (args.length > 3) vegaUtil.error('Too many arguments to clamp function.');
1448
+ const a = args.map(codegen);
1449
+ return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';
1450
+ },
1451
+ // DATE functions
1452
+ now: 'Date.now',
1453
+ utc: 'Date.UTC',
1454
+ datetime: DATE,
1455
+ date: fn('getDate', DATE, 0),
1456
+ day: fn('getDay', DATE, 0),
1457
+ year: fn('getFullYear', DATE, 0),
1458
+ month: fn('getMonth', DATE, 0),
1459
+ hours: fn('getHours', DATE, 0),
1460
+ minutes: fn('getMinutes', DATE, 0),
1461
+ seconds: fn('getSeconds', DATE, 0),
1462
+ milliseconds: fn('getMilliseconds', DATE, 0),
1463
+ time: fn('getTime', DATE, 0),
1464
+ timezoneoffset: fn('getTimezoneOffset', DATE, 0),
1465
+ utcdate: fn('getUTCDate', DATE, 0),
1466
+ utcday: fn('getUTCDay', DATE, 0),
1467
+ utcyear: fn('getUTCFullYear', DATE, 0),
1468
+ utcmonth: fn('getUTCMonth', DATE, 0),
1469
+ utchours: fn('getUTCHours', DATE, 0),
1470
+ utcminutes: fn('getUTCMinutes', DATE, 0),
1471
+ utcseconds: fn('getUTCSeconds', DATE, 0),
1472
+ utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),
1473
+ // sequence functions
1474
+ length: fn('length', null, -1),
1475
+ // STRING functions
1476
+ parseFloat: 'parseFloat',
1477
+ parseInt: 'parseInt',
1478
+ upper: fn('toUpperCase', STRING, 0),
1479
+ lower: fn('toLowerCase', STRING, 0),
1480
+ substring: fn('substring', STRING),
1481
+ split: fn('split', STRING),
1482
+ trim: fn('trim', STRING, 0),
1483
+ // base64 encode/decode
1484
+ btoa: 'btoa',
1485
+ atob: 'atob',
1486
+ // REGEXP functions
1487
+ regexp: REGEXP,
1488
+ test: fn('test', REGEXP),
1489
+ // Control Flow functions
1490
+ if: function (args) {
1491
+ if (args.length < 3) vegaUtil.error('Missing arguments to if function.');
1492
+ if (args.length > 3) vegaUtil.error('Too many arguments to if function.');
1493
+ const a = args.map(codegen);
1494
+ return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';
1495
+ }
1496
+ };
1497
+ }
1498
+
1499
+ function stripQuotes(s) {
1500
+ const n = s && s.length - 1;
1501
+ return n && (s[0] === '"' && s[n] === '"' || s[0] === '\'' && s[n] === '\'') ? s.slice(1, -1) : s;
1502
+ }
1503
+ function codegen (opt) {
1504
+ opt = opt || {};
1505
+ const allowed = opt.allowed ? vegaUtil.toSet(opt.allowed) : {},
1506
+ forbidden = opt.forbidden ? vegaUtil.toSet(opt.forbidden) : {},
1507
+ constants = opt.constants || Constants,
1508
+ functions = (opt.functions || Functions)(visit),
1509
+ globalvar = opt.globalvar,
1510
+ fieldvar = opt.fieldvar,
1511
+ outputGlobal = vegaUtil.isFunction(globalvar) ? globalvar : id => `${globalvar}["${id}"]`;
1512
+ // JSON authors are not allowed to set properties with these names, as these are built-in to the JS Object Prototype.
1513
+ new Set([...Object.getOwnPropertyNames(Object.prototype).filter(name => typeof Object.prototype[name] === 'function'), '__proto__']);
1514
+ let globals = {},
1515
+ fields = {},
1516
+ memberDepth = 0;
1517
+ function visit(ast) {
1518
+ if (vegaUtil.isString(ast)) return ast;
1519
+ const generator = Generators[ast.type];
1520
+ if (generator == null) vegaUtil.error('Unsupported type: ' + ast.type);
1521
+ return generator(ast);
1522
+ }
1523
+ const Generators = {
1524
+ Literal: n => n.raw,
1525
+ Identifier: n => {
1526
+ const id = n.name;
1527
+ if (memberDepth > 0) {
1528
+ return id;
1529
+ } else if (vegaUtil.hasOwnProperty(forbidden, id)) {
1530
+ return vegaUtil.error('Illegal identifier: ' + id);
1531
+ } else if (vegaUtil.hasOwnProperty(constants, id)) {
1532
+ return constants[id];
1533
+ } else if (vegaUtil.hasOwnProperty(allowed, id)) {
1534
+ return id;
1535
+ } else {
1536
+ globals[id] = 1;
1537
+ return outputGlobal(id);
1538
+ }
1539
+ },
1540
+ MemberExpression: n => {
1541
+ const d = !n.computed,
1542
+ o = visit(n.object);
1543
+ if (d) memberDepth += 1;
1544
+ const p = visit(n.property);
1545
+ if (o === fieldvar) {
1546
+ // strip quotes to sanitize field name (#1653)
1547
+ fields[stripQuotes(p)] = 1;
1548
+ }
1549
+ if (d) memberDepth -= 1;
1550
+ return o + (d ? '.' + p : '[' + p + ']');
1551
+ },
1552
+ CallExpression: n => {
1553
+ if (n.callee.type !== 'Identifier') {
1554
+ vegaUtil.error('Illegal callee type: ' + n.callee.type);
1555
+ }
1556
+ const callee = n.callee.name,
1557
+ args = n.arguments,
1558
+ fn = vegaUtil.hasOwnProperty(functions, callee) && functions[callee];
1559
+ if (!fn) vegaUtil.error('Unrecognized function: ' + callee);
1560
+ return vegaUtil.isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';
1561
+ },
1562
+ ArrayExpression: n => '[' + n.elements.map(visit).join(',') + ']',
1563
+ BinaryExpression: n => '(' + visit(n.left) + ' ' + n.operator + ' ' + visit(n.right) + ')',
1564
+ UnaryExpression: n => '(' + n.operator + visit(n.argument) + ')',
1565
+ ConditionalExpression: n => '(' + visit(n.test) + '?' + visit(n.consequent) + ':' + visit(n.alternate) + ')',
1566
+ LogicalExpression: n => '(' + visit(n.left) + n.operator + visit(n.right) + ')',
1567
+ ObjectExpression: n => {
1568
+ // If any keys would override Object prototype methods, throw error
1569
+ for (const prop of n.properties) {
1570
+ const keyName = prop.key.name;
1571
+ if (vegaUtil.DisallowedObjectProperties.has(keyName)) {
1572
+ vegaUtil.error('Illegal property: ' + keyName);
1573
+ }
1574
+ }
1575
+ return '{' + n.properties.map(visit).join(',') + '}';
1576
+ },
1577
+ Property: n => {
1578
+ memberDepth += 1;
1579
+ const k = visit(n.key);
1580
+ memberDepth -= 1;
1581
+ return k + ':' + visit(n.value);
1582
+ }
1583
+ };
1584
+ function codegen(ast) {
1585
+ const result = {
1586
+ code: visit(ast),
1587
+ globals: Object.keys(globals),
1588
+ fields: Object.keys(fields)
1589
+ };
1590
+ globals = {};
1591
+ fields = {};
1592
+ return result;
1593
+ }
1594
+ codegen.functions = functions;
1595
+ codegen.constants = constants;
1596
+ return codegen;
1597
+ }
1598
+
1599
+ exports.ASTNode = ASTNode;
1600
+ exports.ArrayExpression = ArrayExpression;
1601
+ exports.BinaryExpression = BinaryExpression;
1602
+ exports.CallExpression = CallExpression;
1603
+ exports.ConditionalExpression = ConditionalExpression;
1604
+ exports.Identifier = Identifier;
1605
+ exports.Literal = Literal;
1606
+ exports.LogicalExpression = LogicalExpression;
1607
+ exports.MemberExpression = MemberExpression;
1608
+ exports.ObjectExpression = ObjectExpression;
1609
+ exports.Property = Property;
1610
+ exports.RawCode = RawCode;
1611
+ exports.UnaryExpression = UnaryExpression;
1612
+ exports.codegenExpression = codegen;
1613
+ exports.constants = Constants;
1614
+ exports.functions = Functions;
1615
+ exports.parseExpression = parser;